procedure TUMM.UniGUIMainModuleNewComponent(AComponent: TComponent);
var
c1, c2 : string;
begin
if (AComponent is TUnimFileUploadButton) then
begin
if AnsiUpperCase(dMotyw) = 'ZIELONY'then
begin
c1 := '#53af48';
c2 := '#53af48';
end
else
begin
c1 := 'rgb(33, 150, 243)';
c2 := 'rgb(18 128 215)';
end;
with (AComponent as TUnimFileUploadButton), JSInterface do
begin
JSCallGlobal('Ext.util.CSS.createStyleSheet', ['#'+JSId+' .x-inner-el{ '+
' background-color: white; '+
' border-color: '+c1+'; '+
' border-width: 2px; '+
'}'+
'#'+JSId+' .x-text-el{ '+
' color: '+c2+'; '+
' font-weight: #525452; '+
'}'+
'#'+JSId+' .x-label-el{ '+
' display: none; '+
'}'+
'#'+JSId+' .x-input-el{ '+
' display: none; '+
'}'+
'#'+JSId+' .x-input-wrap-el{ '+
' border: none; '+
'}'+
'#'+JSId+' .x-after-input-el{ '+
' width: 100%; '+
' background-color: white; '+
'}'+
'#'+JSId+' .x-filetrigger{ '+
' width: 100%; '+
// ' margin-left: 1em; '+
'}'+
'#'+JSId+' .x-button-action{ '+
' width: 100%; '+
' height: 100%; '+
'}'+
'#'+JSId+' .x-field{ '+
' width: 100% !important; '+
'}'
]);
end;
end;
//
end;
Above is code in MainModule - adding styles
And this can change text of the button:
UnimFileUploadButton1.JSInterface.JSAssign('element.dom.querySelector(".x-text-el").innerText', ['Upload file']);