├── includes
└── UniDSA.inc
├── demo
├── UniDSA.inc
├── Login.pas
├── Main.pas
├── UniDSADemo.res
├── Files
│ └── qrcode.png
├── View
│ ├── FrameConfirm.pas
│ ├── FrameMenuLateral.pas
│ ├── FrameBase.dfm
│ ├── FrameBase.pas
│ ├── FrameMenuLateral.vlb
│ ├── FrameHome.pas
│ ├── FrameHome.dfm
│ ├── FormLeitorQrCode.pas
│ ├── FrameToast.pas
│ ├── FormLeitorQrCode.dfm
│ ├── FrameLeitorQRCode.pas
│ ├── FormContribuicoes.pas
│ ├── FrameLeitorQRCode.dfm
│ ├── FrameToast.dfm
│ └── FrameConfirm.dfm
├── MainModule.dfm
├── Library
│ └── Funcoes.pas
├── ServerModule.dfm
├── MainModule.pas
├── ServerModule.pas
├── UniDSADemo.dpr
├── Login.dfm
└── Main.dfm
├── UniDSA.res
├── UniDSA.dres
├── UniDSAS.res
├── images
├── Logo.jpg
├── icones.xd
├── TUniDSAConfirm.bmp
├── TUniDSALogin.bmp
├── TUniDSALogin24.png
├── TUniDSAToast.bmp
├── TFormUniDSABrowser.bmp
├── TFormUniDSABrowser.ico
├── TUniDSAMenuLateral.bmp
└── TUniDSAQrCodeReader.bmp
├── sources
├── UniDSAMenu.pas
├── UniDSABrowser.pas
├── UniDSAMenuLateral.pas
├── UniDSAConst.pas
├── UniDSAColor.pas
├── UniDSADiv.pas
├── UniDSASource.pas
├── UniDSALibrary.pas
├── UniDSAExecuteFunction.pas
├── UniDSABase.pas
├── UniDSABaseControl.pas
├── UniDSAQrCodeReader.pas
├── UniDSAToast.pas
├── UniDSAControl.pas
└── UniDSALogin.pas
├── outros
└── WebView2Loader.dll
├── UniDSAResource.rc
├── dsa
├── css
│ ├── dsa.css
│ └── jquery.toast.css
├── login
│ ├── js
│ │ └── script.js
│ └── css
│ │ └── style.css
├── menu_lateral
│ ├── css
│ │ └── style.css
│ └── js
│ │ └── script.js
└── js
│ └── jquery.toast.js
├── UniDSA.identcache
├── UniDSADesign.dpk
├── UniDSAGroup.groupproj
├── .gitignore
├── UniDSA.dpk
├── UniDSA.dproj.local
└── README.md
/includes/UniDSA.inc:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/demo/UniDSA.inc:
--------------------------------------------------------------------------------
1 | //{$HINTS OFF}
2 |
--------------------------------------------------------------------------------
/UniDSA.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/UniDSA.res
--------------------------------------------------------------------------------
/UniDSA.dres:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/UniDSA.dres
--------------------------------------------------------------------------------
/UniDSAS.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/UniDSAS.res
--------------------------------------------------------------------------------
/demo/Login.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/demo/Login.pas
--------------------------------------------------------------------------------
/demo/Main.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/demo/Main.pas
--------------------------------------------------------------------------------
/images/Logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/Logo.jpg
--------------------------------------------------------------------------------
/images/icones.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/icones.xd
--------------------------------------------------------------------------------
/demo/UniDSADemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/demo/UniDSADemo.res
--------------------------------------------------------------------------------
/demo/Files/qrcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/demo/Files/qrcode.png
--------------------------------------------------------------------------------
/sources/UniDSAMenu.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/sources/UniDSAMenu.pas
--------------------------------------------------------------------------------
/images/TUniDSAConfirm.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TUniDSAConfirm.bmp
--------------------------------------------------------------------------------
/images/TUniDSALogin.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TUniDSALogin.bmp
--------------------------------------------------------------------------------
/images/TUniDSALogin24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TUniDSALogin24.png
--------------------------------------------------------------------------------
/images/TUniDSAToast.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TUniDSAToast.bmp
--------------------------------------------------------------------------------
/outros/WebView2Loader.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/outros/WebView2Loader.dll
--------------------------------------------------------------------------------
/sources/UniDSABrowser.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/sources/UniDSABrowser.pas
--------------------------------------------------------------------------------
/demo/View/FrameConfirm.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/demo/View/FrameConfirm.pas
--------------------------------------------------------------------------------
/demo/View/FrameMenuLateral.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/demo/View/FrameMenuLateral.pas
--------------------------------------------------------------------------------
/images/TFormUniDSABrowser.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TFormUniDSABrowser.bmp
--------------------------------------------------------------------------------
/images/TFormUniDSABrowser.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TFormUniDSABrowser.ico
--------------------------------------------------------------------------------
/images/TUniDSAMenuLateral.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TUniDSAMenuLateral.bmp
--------------------------------------------------------------------------------
/images/TUniDSAQrCodeReader.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/images/TUniDSAQrCodeReader.bmp
--------------------------------------------------------------------------------
/sources/UniDSAMenuLateral.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deividyalcantara/unidsa-unigui-delphi/HEAD/sources/UniDSAMenuLateral.pas
--------------------------------------------------------------------------------
/demo/MainModule.dfm:
--------------------------------------------------------------------------------
1 | object UniMainModule: TUniMainModule
2 | OnCreate = UniGUIMainModuleCreate
3 | Theme = 'gray'
4 | MonitoredKeys.Keys = <>
5 | EnableSynchronousOperations = True
6 | Height = 480
7 | Width = 640
8 | end
9 |
--------------------------------------------------------------------------------
/sources/UniDSAConst.pas:
--------------------------------------------------------------------------------
1 | unit UniDSAConst;
2 |
3 | interface
4 |
5 | const
6 | C_REPOSITORIO = 'https://github.com/deividyalcantara?tab=repositories';
7 | C_VERSION = '1.1.0';
8 |
9 | implementation
10 |
11 | end.
12 |
--------------------------------------------------------------------------------
/UniDSAResource.rc:
--------------------------------------------------------------------------------
1 | TUniDSAConfirm BITMAP "images\\TUniDSAConfirm.bmp"
2 | TUniDSALogin BITMAP "images\\TUniDSALogin.bmp"
3 | TUniDSAQrCodeReader BITMAP "images\\TUniDSAQrCodeReader.bmp"
4 | TUniDSAToast BITMAP "images\\TUniDSAToast.bmp"
5 | TUniDSAMenuLateral BITMAP "images\\TUniDSAMenuLateral.bmp"
6 |
--------------------------------------------------------------------------------
/demo/View/FrameBase.dfm:
--------------------------------------------------------------------------------
1 | object FrBase: TFrBase
2 | Left = 0
3 | Top = 0
4 | ClientHeight = 441
5 | ClientWidth = 624
6 | Color = clBtnFace
7 | Font.Charset = DEFAULT_CHARSET
8 | Font.Color = clWindowText
9 | Font.Height = -12
10 | Font.Name = 'Segoe UI'
11 | Font.Style = []
12 | TextHeight = 15
13 | end
14 |
--------------------------------------------------------------------------------
/demo/View/FrameBase.pas:
--------------------------------------------------------------------------------
1 | unit FrameBase;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics,
7 | Vcl.Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
8 | uniGUIClasses, uniGUIFrame;
9 |
10 | type
11 | TFrBase = class(TUniFrame)
12 | end;
13 |
14 | implementation
15 |
16 | {$R *.dfm}
17 |
18 | { TFrBase }
19 |
20 | end.
21 |
--------------------------------------------------------------------------------
/demo/View/FrameMenuLateral.vlb:
--------------------------------------------------------------------------------
1 | [TimeTema]
2 | Coordinates=260,56,76,36
3 |
4 | [UniLabel3]
5 | Coordinates=109,10,73,36
6 |
7 | []
8 | Coordinates=150,56,128,36
9 |
10 | [edtMenuBordaTopo]
11 | Coordinates=10,10,89,36
12 | Visible=True
13 |
14 | [ugbTema]
15 | Coordinates=10,56,47,36
16 |
17 | [b2]
18 | Coordinates=192,10,130,36
19 |
20 | [lblTitulo]
21 | Coordinates=67,56,73,36
22 |
23 | [lblSubTitulo]
24 | Coordinates=150,102,73,36
25 |
26 | [ucpTemaBorda]
27 | Coordinates=10,102,130,36
28 |
29 |
--------------------------------------------------------------------------------
/demo/View/FrameHome.pas:
--------------------------------------------------------------------------------
1 | unit FrameHome;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uniGUIFrame, uniGUIBaseClasses,
8 | uniGUIClasses, UniDSABase, UniDSAToast, uniButton, uniEdit, uniLabel, uniPanel,
9 | uniGroupBox, uniScrollBox;
10 |
11 | type
12 | TFrHome = class(TUniFrame)
13 | UniLabel2: TUniLabel;
14 | UniLabel1: TUniLabel;
15 | end;
16 |
17 | implementation
18 |
19 | {$R *.dfm}
20 |
21 | end.
22 |
--------------------------------------------------------------------------------
/demo/Library/Funcoes.pas:
--------------------------------------------------------------------------------
1 | unit Funcoes;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils, System.TypInfo, uniButton;
7 |
8 | type
9 | TFuncoes = class
10 | public
11 | class procedure AlternarLegendaBotao(var ABotao: TUniButton; const ALegenda1, ALegenda2: string);
12 | end;
13 |
14 | implementation
15 |
16 | { TFuncoes }
17 |
18 | { TFuncoes }
19 |
20 | class procedure TFuncoes.AlternarLegendaBotao(var ABotao: TUniButton; const ALegenda1, ALegenda2: string);
21 | begin
22 | if ABotao.Caption = ALegenda1 then
23 | ABotao.Caption := ALegenda2
24 | else
25 | ABotao.Caption := ALegenda1;
26 | end;
27 |
28 | end.
29 |
30 |
--------------------------------------------------------------------------------
/demo/ServerModule.dfm:
--------------------------------------------------------------------------------
1 | object UniServerModule: TUniServerModule
2 | TempFolder = 'temp\'
3 | Title = 'New Application'
4 | SuppressErrors = []
5 | Bindings = <>
6 | MainFormDisplayMode = mfPage
7 | SSL.SSLOptions.RootCertFile = 'root.pem'
8 | SSL.SSLOptions.CertFile = 'cert.pem'
9 | SSL.SSLOptions.KeyFile = 'key.pem'
10 | SSL.SSLOptions.Method = sslvTLSv1_1
11 | SSL.SSLOptions.SSLVersions = [sslvTLSv1_1]
12 | SSL.SSLOptions.Mode = sslmUnassigned
13 | SSL.SSLOptions.VerifyMode = []
14 | SSL.SSLOptions.VerifyDepth = 0
15 | ConnectionFailureRecovery.ErrorMessage = 'Connection Error'
16 | ConnectionFailureRecovery.RetryMessage = 'Retrying...'
17 | Height = 480
18 | Width = 640
19 | end
20 |
--------------------------------------------------------------------------------
/sources/UniDSAColor.pas:
--------------------------------------------------------------------------------
1 | unit UniDSAColor;
2 |
3 | interface
4 |
5 | uses
6 | System.Classes, System.UITypes, Vcl.Graphics;
7 |
8 | type
9 | TUniDSAColor = class(TPersistent)
10 | private
11 | FEnabled: Boolean;
12 | FColor: TColor;
13 | public
14 | constructor Create;
15 | destructor Destroy; override;
16 | published
17 | property Enabled: Boolean read FEnabled write FEnabled;
18 | property Color: TColor read FColor write FColor;
19 | end;
20 |
21 | implementation
22 |
23 | { TUniDSAColor }
24 |
25 | constructor TUniDSAColor.Create;
26 | begin
27 | Enabled := False;
28 | FColor := clAqua;
29 | end;
30 |
31 | destructor TUniDSAColor.Destroy;
32 | begin
33 | inherited;
34 | end;
35 |
36 | end.
37 |
--------------------------------------------------------------------------------
/dsa/css/dsa.css:
--------------------------------------------------------------------------------
1 | .control-label {
2 | display: inline-block;
3 | max-width: 100%;
4 | margin-bottom: 5px;
5 | font-weight: 700;
6 | }
7 |
8 | .form-control {
9 | width: 100%;
10 | padding: 12px 20px;
11 | margin: 8px 0;
12 | border-radius: 5px;
13 | border-style: solid;
14 | border-color: #cccccc;
15 | -webkit-box-shadow: inset 2px -3px 16px -5px rgba(0,0,0,0.08);
16 | -moz-box-shadow: inset 2px -3px 16px -5px rgba(0,0,0,0.08);
17 | box-shadow: inset 2px -3px 16px -5px rgba(0,0,0,0.08);
18 | }
19 |
20 | .form-control:focus {
21 | width: 100%;
22 | padding: 12px 20px;
23 | margin: 8px 0;
24 | border-radius: 5px;
25 | border-style: solid;
26 | border-color: #66afe9;
27 | }
28 |
29 | .form-group {
30 | margin-bottom: 10px;
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/demo/MainModule.pas:
--------------------------------------------------------------------------------
1 | unit MainModule;
2 |
3 | interface
4 |
5 | uses
6 | uniGUIMainModule, SysUtils, Classes;
7 |
8 | type
9 | TUniMainModule = class(TUniGUIMainModule)
10 | procedure UniGUIMainModuleCreate(Sender: TObject);
11 | private
12 | { Private declarations }
13 | public
14 | { Public declarations }
15 |
16 | end;
17 |
18 | function UniMainModule: TUniMainModule;
19 |
20 | implementation
21 |
22 | {$R *.dfm}
23 |
24 | uses
25 | UniGUIVars, ServerModule, uniGUIApplication;
26 |
27 | function UniMainModule: TUniMainModule;
28 | begin
29 | Result := TUniMainModule(UniApplication.UniMainModule)
30 | end;
31 |
32 | procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject);
33 | begin
34 | // Self.theme := gray;
35 | end;
36 |
37 | initialization
38 | RegisterMainModuleClass(TUniMainModule);
39 | end.
40 |
--------------------------------------------------------------------------------
/demo/ServerModule.pas:
--------------------------------------------------------------------------------
1 | unit ServerModule;
2 |
3 | interface
4 |
5 | uses
6 | Classes, SysUtils, uniGUIServer, uniGUIMainModule, uniGUIApplication, uIdCustomHTTPServer,
7 | uniGUITypes;
8 |
9 | type
10 | TUniServerModule = class(TUniGUIServerModule)
11 | private
12 | { Private declarations }
13 | protected
14 | procedure FirstInit; override;
15 | public
16 | { Public declarations }
17 | end;
18 |
19 | function UniServerModule: TUniServerModule;
20 |
21 | implementation
22 |
23 | {$R *.dfm}
24 |
25 | uses
26 | UniGUIVars;
27 |
28 | function UniServerModule: TUniServerModule;
29 | begin
30 | Result:=TUniServerModule(UniGUIServerInstance);
31 | end;
32 |
33 | procedure TUniServerModule.FirstInit;
34 | begin
35 | InitServerModule(Self);
36 | end;
37 |
38 | initialization
39 | RegisterServerModuleClass(TUniServerModule);
40 | end.
41 |
--------------------------------------------------------------------------------
/sources/UniDSADiv.pas:
--------------------------------------------------------------------------------
1 | unit UniDSADiv;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils, System.Classes, uniGUIClasses, UniDSABaseControl, UniDSAExecuteFunction, uniGUITypes,
7 | System.TypInfo, UniDSALibrary, System.Variants, Vcl.Graphics, UniDSASource, Vcl.Controls,
8 | System.Types, uniPanel, uniGUIInterfaces;
9 |
10 | type
11 | // Div em desenvolvimento ....
12 |
13 | TUniDSADiv = class(TUniControl)
14 | protected
15 | procedure WebCreate; override;
16 | public
17 | constructor Create(AOwner:TComponent); override;
18 | published
19 | property Align;
20 | property Height;
21 | property Width;
22 | property Visible;
23 | end;
24 |
25 | implementation
26 |
27 | { TUniDSADiv }
28 |
29 | constructor TUniDSADiv.Create(AOwner: TComponent);
30 | begin
31 | inherited;
32 | end;
33 |
34 | procedure TUniDSADiv.WebCreate;
35 | begin
36 | inherited;
37 | JSCls := 'x-uni-dsa-div-' + JSName;
38 | end;
39 |
40 | end.
41 |
--------------------------------------------------------------------------------
/demo/View/FrameHome.dfm:
--------------------------------------------------------------------------------
1 | inherited FrHome: TFrHome
2 | object UniLabel2: TUniLabel
3 | AlignWithMargins = True
4 | Left = 20
5 | Top = 50
6 | Width = 429
7 | Height = 20
8 | Hint = ''
9 | Margins.Left = 20
10 | Margins.Top = 0
11 | Margins.Right = 20
12 | Margins.Bottom = 0
13 | Caption = 'Bem-vindo a paleta de componente UniDSA para UniGUI/Delphi'
14 | Align = alTop
15 | ParentFont = False
16 | Font.Color = clGray
17 | Font.Height = -15
18 | ParentColor = False
19 | Color = clBtnFace
20 | TabOrder = 0
21 | end
22 | object UniLabel1: TUniLabel
23 | AlignWithMargins = True
24 | Left = 20
25 | Top = 20
26 | Width = 59
27 | Height = 30
28 | Hint = ''
29 | Margins.Left = 20
30 | Margins.Top = 20
31 | Margins.Right = 20
32 | Margins.Bottom = 0
33 | Caption = 'Home'
34 | Align = alTop
35 | ParentFont = False
36 | Font.Height = 30
37 | Font.Style = [fsBold]
38 | ParentColor = False
39 | Color = clBtnFace
40 | TabOrder = 1
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/demo/UniDSADemo.dpr:
--------------------------------------------------------------------------------
1 | program UniDSADemo;
2 |
3 | uses
4 | Forms,
5 | ServerModule in 'ServerModule.pas' {UniServerModule: TUniGUIServerModule},
6 | MainModule in 'MainModule.pas' {UniMainModule: TUniGUIMainModule},
7 | Main in 'Main.pas' {MainForm: TUniForm},
8 | FrameMenuLateral in 'View\FrameMenuLateral.pas' {FrMenuLateral: TUniFrame},
9 | Funcoes in 'Library\Funcoes.pas',
10 | FrameHome in 'View\FrameHome.pas' {FrHome: TUniFrame},
11 | FormContribuicoes in 'View\FormContribuicoes.pas' {FrmContribuicoes: TUniForm},
12 | FrameToast in 'View\FrameToast.pas' {FrToast: TUniFrame},
13 | FrameLeitorQRCode in 'View\FrameLeitorQRCode.pas' {FrLeitorQrCode: TUniFrame},
14 | FormLeitorQrCode in 'View\FormLeitorQrCode.pas' {FrmLeitorQrCode: TUniForm},
15 | FrameConfirm in 'View\FrameConfirm.pas' {FrConfirm: TUniFrame},
16 | Login in 'Login.pas' {FormLogin: TUniLoginForm};
17 |
18 | {$R *.res}
19 |
20 | {$I UniDSA.inc}
21 | {$INCLUDE UniDSA.inc}
22 |
23 | begin
24 | ReportMemoryLeaksOnShutdown := True;
25 |
26 | Application.Initialize;
27 | TUniServerModule.Create(Application);
28 | Application.Run;
29 | end.
30 |
31 |
--------------------------------------------------------------------------------
/demo/View/FormLeitorQrCode.pas:
--------------------------------------------------------------------------------
1 | unit FormLeitorQrCode;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics,
7 | Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
8 | uniGUIClasses, uniGUIForm, uniGUIBaseClasses, UniDSABaseControl, UniDSAQrCodeReader;
9 |
10 | type
11 | TFrmLeitorQrCode = class(TUniForm)
12 | qrcLeitor: TUniDSAQrCodeReader;
13 | procedure UniFormClose(Sender: TObject; var Action: TCloseAction);
14 | procedure qrcLeitorAfterReading(Sender: TObject);
15 | end;
16 |
17 | function Ler: string;
18 |
19 | implementation
20 |
21 | uses
22 | uniGUIApplication;
23 |
24 | {$R *.dfm}
25 |
26 | function Ler: string;
27 | var
28 | LForm: TFrmLeitorQrCode;
29 | begin
30 | Result := '';
31 | LForm := TFrmLeitorQrCode.Create(UniApplication);
32 | if LForm.ShowModal() = mrOk then begin
33 | Result := LForm.qrcLeitor.Result;
34 | LForm.qrcLeitor.Stop;
35 | end;
36 | LForm.Free;
37 | end;
38 |
39 |
40 | procedure TFrmLeitorQrCode.qrcLeitorAfterReading(Sender: TObject);
41 | begin
42 | ModalResult := mrOk;
43 | end;
44 |
45 | procedure TFrmLeitorQrCode.UniFormClose(Sender: TObject; var Action: TCloseAction);
46 | begin
47 | Action := TCloseAction.caFree;
48 | end;
49 |
50 | end.
51 |
--------------------------------------------------------------------------------
/UniDSA.identcache:
--------------------------------------------------------------------------------
1 | OD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSALibrary.pas ND:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSASource.pas MD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAToast.pas TD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAQrCodeReader.pas WD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAExecuteFunction.pas OD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAConfirm.pas MD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAConst.pas OD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAControl.pas SD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSABaseControl.pas MD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSALogin.pas KD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSADiv.pas SD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAMenuLateral.pas MD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAColor.pas LD:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSABase.pas
--------------------------------------------------------------------------------
/UniDSADesign.dpk:
--------------------------------------------------------------------------------
1 | package UniDSADesign;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION OFF}
16 | {$OVERFLOWCHECKS ON}
17 | {$RANGECHECKS ON}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES ON}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE DEBUG}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$IMPLICITBUILD ON}
29 |
30 | requires
31 | {$IFDEF VER360} // Delphi 12 Athens
32 | vcledge,
33 | {$IFEND}
34 |
35 | {$IFDEF VER350} // Delphi 11.0 Alexandria / C++Builder 11.0 Alexandria
36 | vcledge,
37 | {$IFEND}
38 |
39 | {$IFDEF VER340} // Delphi 10.4 Sydney / C++Builder 10.4 Sydney
40 | vcledge,
41 | {$IFEND}
42 |
43 | DesignIDE,
44 | UniDSA,
45 | rtl,
46 | DesignIDE,
47 | soaprtl,
48 | dbrtl,
49 | xmlrtl,
50 | inet,
51 | vclimg,
52 | vcl,
53 | vcldb,
54 | vclwinx;
55 |
56 | contains
57 | UniDSABrowser in 'sources\UniDSABrowser.pas' {FormUniDSABrowser},
58 | UniDSAMenu in 'sources\UniDSAMenu.pas';
59 |
60 | end.
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/demo/View/FrameToast.pas:
--------------------------------------------------------------------------------
1 | unit FrameToast;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uniGUIFrame, uniGUIBaseClasses,
8 | uniGUIClasses, UniDSABase, UniDSAToast, uniButton, uniEdit, uniLabel, uniPanel,
9 | uniGroupBox, uniScrollBox, UniDSAExecuteFunction;
10 |
11 | type
12 | TFrToast = class(TUniFrame)
13 | Toast: TUniDSAToast;
14 | usbPrincipal: TUniScrollBox;
15 | ugbMensagem: TUniGroupBox;
16 | UniContainerPanel20: TUniContainerPanel;
17 | UniContainerPanel23: TUniContainerPanel;
18 | UniLabel16: TUniLabel;
19 | edtTitulo: TUniEdit;
20 | UniContainerPanel21: TUniContainerPanel;
21 | UniLabel15: TUniLabel;
22 | edtMensagem: TUniEdit;
23 | UniContainerPanel22: TUniContainerPanel;
24 | btnMostrar: TUniButton;
25 | UniLabel1: TUniLabel;
26 | UniLabel2: TUniLabel;
27 | UniLabel3: TUniLabel;
28 | procedure btnMostrarClick(Sender: TObject);
29 | private
30 | { Private declarations }
31 | public
32 | { Public declarations }
33 | end;
34 |
35 | var
36 | FrToast: TFrToast;
37 |
38 | implementation
39 |
40 | {$R *.dfm}
41 |
42 | procedure TFrToast.btnMostrarClick(Sender: TObject);
43 | begin
44 | inherited;
45 | Toast.Heading := edtTitulo.Text;
46 | Toast.Text := edtTitulo.Text;
47 | Toast.Show;
48 | end;
49 |
50 | end.
51 |
--------------------------------------------------------------------------------
/demo/View/FormLeitorQrCode.dfm:
--------------------------------------------------------------------------------
1 | object FrmLeitorQrCode: TFrmLeitorQrCode
2 | Left = 0
3 | Top = 0
4 | ClientHeight = 484
5 | ClientWidth = 507
6 | Caption = 'Leitor QrCode e c'#243'digo de barras'
7 | OldCreateOrder = False
8 | OnClose = UniFormClose
9 | MonitoredKeys.Keys = <>
10 | TextHeight = 15
11 | object qrcLeitor: TUniDSAQrCodeReader
12 | AlignWithMargins = True
13 | Left = 0
14 | Top = 0
15 | Width = 507
16 | Height = 434
17 | Hint = ''
18 | Margins.Left = 0
19 | Margins.Top = 0
20 | Margins.Right = 0
21 | Margins.Bottom = 50
22 | Align = alClient
23 | Text = ''
24 | SingleRead = False
25 | QrBox = 250
26 | FPS = 10
27 | SupportedFormats.QR_CODE = True
28 | SupportedFormats.AZTEC = True
29 | SupportedFormats.CODABAR = True
30 | SupportedFormats.CODE_39 = True
31 | SupportedFormats.CODE_93 = True
32 | SupportedFormats.CODE_128 = True
33 | SupportedFormats.DATA_MATRIX = True
34 | SupportedFormats.MAXICODE = True
35 | SupportedFormats.ITF = True
36 | SupportedFormats.EAN_13 = True
37 | SupportedFormats.EAN_8 = True
38 | SupportedFormats.PDF_417 = True
39 | SupportedFormats.RSS_14 = True
40 | SupportedFormats.RSS_EXPANDED = True
41 | SupportedFormats.UPC_A = True
42 | SupportedFormats.UPC_E = True
43 | SupportedFormats.UPC_EAN_EXTENSION = True
44 | OnAfterReading = qrcLeitorAfterReading
45 | ExplicitLeft = -5
46 | ExplicitTop = -5
47 | ExplicitWidth = 333
48 | ExplicitHeight = 287
49 | end
50 | end
51 |
--------------------------------------------------------------------------------
/demo/View/FrameLeitorQRCode.pas:
--------------------------------------------------------------------------------
1 | unit FrameLeitorQRCode;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uniGUIFrame, uniGUIBaseClasses,
8 | uniGUIClasses, UniDSABase, UniDSAToast, uniButton, uniEdit, uniLabel, uniPanel,
9 | uniGroupBox, uniScrollBox, UniDSABaseControl, UniDSAQrCodeReader, FormLeitorQrCode, UniDSAExecuteFunction;
10 |
11 | type
12 | TFrLeitorQrCode = class(TUniFrame)
13 | usbPrincipal: TUniScrollBox;
14 | ugbMensagem: TUniGroupBox;
15 | UniContainerPanel20: TUniContainerPanel;
16 | UniContainerPanel23: TUniContainerPanel;
17 | UniLabel16: TUniLabel;
18 | edtResultado: TUniEdit;
19 | UniLabel1: TUniLabel;
20 | UniLabel2: TUniLabel;
21 | Toast: TUniDSAToast;
22 | qrcLeitor: TUniDSAQrCodeReader;
23 | UniContainerPanel22: TUniContainerPanel;
24 | btnLeitura: TUniButton;
25 | procedure qrcLeitorAfterReading(Sender: TObject);
26 | procedure btnLeituraClick(Sender: TObject);
27 | private
28 | { Private declarations }
29 | public
30 | { Public declarations }
31 | end;
32 |
33 | var
34 | FrLeitorQrCode: TFrLeitorQrCode;
35 |
36 | implementation
37 |
38 | {$R *.dfm}
39 |
40 | procedure TFrLeitorQrCode.btnLeituraClick(Sender: TObject);
41 | begin
42 | inherited;
43 | qrcLeitor.Stop;
44 | edtResultado.Text := FormLeitorQrCode.Ler;
45 | end;
46 |
47 | procedure TFrLeitorQrCode.qrcLeitorAfterReading(Sender: TObject);
48 | begin
49 | inherited;
50 | edtResultado.Text := TUniDSAQrCodeReader(Sender).Result;
51 | end;
52 |
53 | end.
54 |
--------------------------------------------------------------------------------
/demo/View/FormContribuicoes.pas:
--------------------------------------------------------------------------------
1 | unit FormContribuicoes;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics,
7 | Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
8 | uniGUIClasses, uniGUIForm, uniGUIBaseClasses, uniPanel, uniHTMLFrame, uniLabel, Vcl.Imaging.pngimage, uniImage, uniButton;
9 |
10 | type
11 | TFrmContribuicoes = class(TUniForm)
12 | a: TUniContainerPanel;
13 | UniLabel1: TUniLabel;
14 | UniImage1: TUniImage;
15 | UniLabel2: TUniLabel;
16 | UniLabel3: TUniLabel;
17 | UniLabel4: TUniLabel;
18 | UniLabel5: TUniLabel;
19 | b: TUniContainerPanel;
20 | btnObrigado: TUniButton;
21 | procedure btnObrigadoClick(Sender: TObject);
22 | procedure UniFormClose(Sender: TObject; var Action: TCloseAction);
23 | procedure UniFormCreate(Sender: TObject);
24 | end;
25 |
26 | procedure Contribuir;
27 |
28 | implementation
29 |
30 | uses
31 | uniGUIApplication;
32 |
33 | {$R *.dfm}
34 |
35 | procedure Contribuir;
36 | var
37 | LForm: TFrmContribuicoes;
38 | begin
39 | LForm := TFrmContribuicoes.Create(UniApplication);
40 | LForm.ShowModal();
41 | LForm.Free;
42 | end;
43 |
44 | procedure TFrmContribuicoes.btnObrigadoClick(Sender: TObject);
45 | begin
46 | Self.Close;
47 | end;
48 |
49 | procedure TFrmContribuicoes.UniFormClose(Sender: TObject; var Action: TCloseAction);
50 | begin
51 | Action := TCloseAction.caFree;
52 | end;
53 |
54 | procedure TFrmContribuicoes.UniFormCreate(Sender: TObject);
55 | begin
56 | a.Top := 40;
57 | a.Height := Round(Self.Height - b.Height - 40);
58 | a.Left := Round((Self.Width / 2) - (a.Width / 2));
59 |
60 | btnObrigado.Top := 0;
61 | btnObrigado.Height := b.Height;
62 | btnObrigado.Left := Round((Self.Width / 2) - (btnObrigado.Width / 2));
63 | end;
64 |
65 | end.
66 |
--------------------------------------------------------------------------------
/UniDSAGroup.groupproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {72CA7D80-E108-4B38-BB14-F59DBEF814CB}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Default.Personality.12
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Uncomment these types if you want even more clean repository. But be careful.
2 | # It can make harm to an existing project source. Read explanations below.
3 | #
4 | # Resource files are binaries containing manifest, project icon and version info.
5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
6 | #*.res
7 | #
8 | # Type library file (binary). In old Delphi versions it should be stored.
9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
10 | #*.tlb
11 | #
12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
13 | # Uncomment this if you are not using diagrams or use newer Delphi version.
14 | #*.ddp
15 | #
16 | # Visual LiveBindings file. Added in Delphi XE2.
17 | # Uncomment this if you are not using LiveBindings Designer.
18 | #*.vlb
19 | #
20 | # Deployment Manager configuration file for your project. Added in Delphi XE2.
21 | # Uncomment this if it is not mobile development and you do not use remote debug feature.
22 | #*.deployproj
23 | #
24 | # C++ object files produced when C/C++ Output file generation is configured.
25 | # Uncomment this if you are not using external objects (zlib library for example).
26 | #*.obj
27 | #
28 |
29 | # Delphi compiler-generated binaries (safe to delete)
30 | *.exe
31 | *.dll
32 | *.bpl
33 | *.bpi
34 | *.dcp
35 | *.so
36 | *.apk
37 | *.drc
38 | *.map
39 | *.dres
40 | *.rsm
41 | *.tds
42 | *.dcu
43 | *.lib
44 | *.a
45 | *.o
46 | *.ocx
47 |
48 | # Delphi autogenerated files (duplicated info)
49 | *.cfg
50 | *.hpp
51 |
52 | # Delphi local files (user-specific info)
53 | *.local
54 | *.identcache
55 | *.projdata
56 | *.tvsconfig
57 | *.dsk
58 |
59 | # Delphi history and backups
60 | __history/
61 | __recovery/
62 | *.~*
63 | bin/
64 | tmp/
65 |
66 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi)
67 | *.stat
68 |
69 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss
70 | modules/
71 |
72 | bin/
73 | tmp/
74 | *.res
75 | *.local
76 | *.identcache
77 |
--------------------------------------------------------------------------------
/sources/UniDSASource.pas:
--------------------------------------------------------------------------------
1 | unit UniDSASource;
2 |
3 | interface
4 |
5 | uses
6 | uniGUIClasses, uniGUITypes;
7 |
8 | type
9 | TTypeUniDSASource = (Toast, Confirm, MenuSiderbar, QrCodeReader, MenuLateral, Login);
10 |
11 | procedure GetLink(AComponent: TTypeUniDSASource);
12 |
13 | implementation
14 |
15 | const
16 | {$IFDEF DEBUG}
17 | cFolder = '/files/dsa';
18 | {$ELSE}
19 | cFolder = './files/dsa';
20 | {$ENDIF}
21 |
22 | procedure GetLink(AComponent: TTypeUniDSASource);
23 | begin
24 | if AComponent = TTypeUniDSASource.Toast then begin
25 | UniAddCSSLibrary(cFolder + '/css/jquery.toast.css', True, [upoFolderUni, upoPlatformBoth]);
26 | UniAddJSLibrary(cFolder + '/js/jquery.toast.js', True, [upoFolderUni, upoPlatformBoth]);
27 | end
28 | else if AComponent = TTypeUniDSASource.Confirm then begin
29 | UniAddCSSLibrary(cFolder + '/dist/jquery-confirm.min.css', True, [upoFolderUni, upoPlatformBoth]);
30 | UniAddCSSLibrary('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', True, [upoFolderUni, upoPlatformBoth]);
31 | UniAddJSLibrary(cFolder + '/dist/jquery-confirm.min.js', True, [upoFolderUni, upoPlatformBoth]);
32 | UniAddCSSLibrary(cFolder + '/css/dsa.css', True, [upoFolderUni, upoPlatformBoth]);
33 | end
34 | else if AComponent = TTypeUniDSASource.QrCodeReader then begin
35 | UniAddJSLibrary(cFolder + '/qrcode_reader/js/qrcode_library.js', True, [upoFolderUni, upoPlatformBoth]);
36 | end
37 | else if AComponent = TTypeUniDSASource.MenuLateral then begin
38 | UniAddCSSLibrary(cFolder + '/menu_lateral/css/style.css', True, [upoFolderUni, upoPlatformBoth]);
39 | UniAddJSLibrary(cFolder + '/menu_lateral/js/script.js', True, [upoFolderUni, upoPlatformBoth]);
40 | end
41 | else if AComponent = TTypeUniDSASource.Login then begin
42 | UniAddCSSLibrary(cFolder + '/login/css/style.css', True, [upoFolderUni, upoPlatformBoth]);
43 | UniAddJSLibrary(cFolder + '/login/js/script.js', True, [upoFolderUni, upoPlatformBoth]);
44 | end;
45 | end;
46 |
47 | end.
48 |
--------------------------------------------------------------------------------
/dsa/login/js/script.js:
--------------------------------------------------------------------------------
1 | window.onload = function() {
2 | // Aguardar 5 segundos
3 | setTimeout(function() {
4 | // Restante do código após 5 segundos
5 | $("#un-lg-lg-login").focus(function() {
6 | $(".un-lg-gp-login").css("background-color", "#edf2f5");
7 | $(".un-lg-gp-password").css("background-color", "#FFF");
8 | });
9 |
10 | $("#un-lg-lg-password").focus(function() {
11 | $(".un-lg-gp-login").css("background-color", "#FFF");
12 | $(".un-lg-gp-password").css("background-color", "#edf2f5");
13 | });
14 | }, 1000); // 5000 milissegundos = 5 segundos
15 | };
16 |
17 | function UniDSALoginLoginOnInput(AJSName, AEvent) {
18 | ajaxRequest(AJSName, 'UniDSALoginLoginOnInput', ["texto=" + AEvent.target.value]);
19 | };
20 |
21 | function UniDSALoginPasswordOnInput(AJSName, AEvent) {
22 | ajaxRequest(AJSName, 'UniDSALoginPasswordOnInput', ["texto=" + AEvent.target.value]);
23 | };
24 |
25 | function UniDSALoginLoginNowOnClick(AJSName) {
26 | ajaxRequest(AJSName, 'UniDSALoginLoginNowOnClick', []);
27 | };
28 |
29 | function UniDSALoginCreateAccountOnClick(AJSName) {
30 | ajaxRequest(AJSName, 'UniDSALoginCreateAccountOnClick', []);
31 | };
32 |
33 | function UniDSALoginRememberMeOnClick(AJSName, AEvent) {
34 | var isChecked = AEvent.target.checked;
35 | var valueToSend = isChecked ? 'S' : 'N';
36 |
37 | ajaxRequest(AJSName, 'UniDSALoginRememberMeOnClick', ["checked=" + valueToSend]);
38 | };
39 |
40 | function UniDSALoginForgetPasswordOnClick(AJSName) {
41 | ajaxRequest(AJSName, 'UniDSALoginForgetPasswordOnClick', []);
42 | };
43 |
44 | function UniDSALoginLoginOnKeyDown(AJSName, AEvent) {
45 | if (AEvent.key === 'Enter') {
46 | UniDSALoginLoginOnEnter(AJSName);
47 | }
48 | }
49 |
50 | function UniDSALoginPasswordOnKeyDown(AJSName, AEvent) {
51 | if (AEvent.key === 'Enter') {
52 | UniDSALoginPasswordOnEnter(AJSName);
53 | }
54 | }
55 |
56 | function UniDSALoginLoginOnEnter(AJSName) {
57 | ajaxRequest(AJSName, 'UniDSALoginLoginOnEnter', []);
58 | };
59 |
60 | function UniDSALoginPasswordOnEnter(AJSName) {
61 | ajaxRequest(AJSName, 'UniDSALoginPasswordOnEnter', []);
62 | };
63 |
64 | function UniDSALoginPasswordOnEnter(AJSName) {
65 | ajaxRequest(AJSName, 'UniDSALoginPasswordOnEnter', []);
66 | };
67 |
68 |
--------------------------------------------------------------------------------
/sources/UniDSALibrary.pas:
--------------------------------------------------------------------------------
1 | unit UniDSALibrary;
2 |
3 | interface
4 |
5 | uses
6 | System.UITypes, System.SysUtils, Vcl.Graphics, Windows;
7 |
8 | type
9 | TArrayOfString = Array of string;
10 |
11 | function ColorToHex(ACor: TColor): string;
12 | function IIfStr(ACondicao: Boolean; AVerdadeiro: string; AFalso: string): string;
13 | function IIfDbl(ACondicao: Boolean; AVerdadeiro: Double; AFalso: Double): Double;
14 | function IIf(ACondicao: Boolean; AVerdadeiro: Variant; AFalso: Variant): Variant;
15 | function SortName: string;
16 | function RemoverTagFontAwesome(AStr: string): string;
17 | function px(AValor: Integer): string;
18 |
19 | implementation
20 |
21 | function px(AValor: Integer): string;
22 | begin
23 | try
24 | Result := IntToStr(AValor) + 'px';
25 | except
26 | Result := '0px';
27 | end;
28 | end;
29 |
30 | function IIf(ACondicao: Boolean; AVerdadeiro: Variant; AFalso: Variant): Variant;
31 | begin
32 | if ACondicao then
33 | Result := AVerdadeiro
34 | else
35 | Result := AFalso;
36 | end;
37 |
38 | function IIfDbl(ACondicao: Boolean; AVerdadeiro: Double; AFalso: Double): Double;
39 | begin
40 | if ACondicao then
41 | Result := AVerdadeiro
42 | else
43 | Result := AFalso;
44 | end;
45 |
46 | function RemoverTagFontAwesome(AStr: string): string;
47 | begin
48 | Result := StringReplace(AStr, ' ', '', [rfReplaceAll]);
52 | end;
53 |
54 | function SortName: string;
55 | var
56 | i: Integer;
57 | AValues: TArrayOfString;
58 | begin
59 | AValues := ['D','E','I','V','I','D','Y', '_', 'A','L','C','A','N','T','A','R','A'];
60 |
61 | for i := 1 to 10 do
62 | Result := Result + AValues[random(16)];
63 | end;
64 |
65 | function ColorToHex(ACor: TColor): string;
66 | var
67 | LColor: LongInt;
68 | LRed: Integer;
69 | LGreen: Integer;
70 | LBlue: Integer;
71 | begin
72 | LColor := ColorToRGB(ACor);
73 |
74 | LRed := ($000000FF and LColor);
75 | LGreen := ($0000FF00 and LColor) Shr 8;
76 | LBlue := ($00FF0000 and LColor) Shr 16;
77 |
78 | Result := 'rgb(' + IntToStr(LRed) + ',' + IntToStr(LGreen) + ',' + IntToStr(LBlue) + ')';
79 | end;
80 |
81 | function IIfStr(ACondicao: Boolean; AVerdadeiro: string; AFalso: string): string;
82 | begin
83 | if ACondicao then
84 | Result := AVerdadeiro
85 | else
86 | Result := AFalso;
87 | end;
88 |
89 | end.
90 |
--------------------------------------------------------------------------------
/demo/Login.dfm:
--------------------------------------------------------------------------------
1 | object FormLogin: TFormLogin
2 | Left = 0
3 | Top = 0
4 | ClientHeight = 677
5 | ClientWidth = 904
6 | Caption = 'FormLogin'
7 | BorderStyle = bsNone
8 | WindowState = wsMaximized
9 | OldCreateOrder = False
10 | MonitoredKeys.Keys = <>
11 | Script.Strings = (
12 | 'window.onresize = function(){'
13 | ' if (typeof FormLogin !== '#39'undefined'#39') { '
14 | ' var getSize = Ext.getBody().getViewSize(),'
15 | ' winWidth = getSize.width,'
16 | ' winHeight = getSize.height,'
17 | ' left = (winWidth - FormLogin.window.width) / 2,'
18 | ' top = (winHeight - FormLogin.window.height) / 2;'
19 | ''
20 | ' FormLogin.window.setPosition(left, top);'
21 | ' }'
22 | '}')
23 | Visible = True
24 | OnCreate = UniLoginFormCreate
25 | TextHeight = 15
26 | object dsaLogin: TUniDSALogin
27 | Left = 0
28 | Top = 0
29 | Width = 904
30 | Height = 677
31 | Hint = ''
32 | Align = alClient
33 | LoginNow.Visible = True
34 | LoginNow.Caption = 'Entrar'
35 | LoginNow.Width = 90
36 | CreateAccount.Visible = True
37 | CreateAccount.Caption = 'Nova conta'
38 | CreateAccount.Width = 90
39 | RememberMe.Visible = True
40 | RememberMe.Caption = 'Lembrar da senha'
41 | RememberMe.Checked = False
42 | ForgetPassword.Visible = True
43 | ForgetPassword.Caption = 'Esqueceu a senha?'
44 | Login.Caption = 'Email:'
45 | Login.Enabled = False
46 | Slide.Image = 'https://i.ibb.co/QpmYjyw/working.png'
47 | Slide.MarginTop = 100
48 | Slide.MarginLeft = 40
49 | Password.Caption = 'Senha:'
50 | Password.Enabled = False
51 | Title = 'Bem-vindo de volta :)'
52 | Description =
53 | 'Para permanecer conectado conosco, por favor fa'#231'a login com suas' +
54 | ' informa'#231#245'es pessoais usando seu endere'#231'o de e-mail e senha '#55357#56596
55 | Logo.Image = 'https://i.ibb.co/4TTX0b6/logo-login-2.png'
56 | Logo.MarginTop = 0
57 | Logo.MarginLeft = 0
58 | TrimSpacesOnRememberMeForgetPassword = False
59 | OnLoginNow = dsaLoginLoginNow
60 | OnCreateAccount = dsaLoginCreateAccount
61 | OnRememberMe = dsaLoginRememberMe
62 | OnLoginEnter = dsaLoginLoginEnter
63 | OnPasswordEnter = dsaLoginPasswordEnter
64 | OnForgetPassword = dsaLoginForgetPassword
65 | end
66 | object saAlerta: TUniSweetAlert
67 | Title = 'Title'
68 | ConfirmButtonText = 'OK'
69 | CancelButtonText = 'Cancel'
70 | Padding = 20
71 | Left = 584
72 | Top = 416
73 | end
74 | end
75 |
--------------------------------------------------------------------------------
/sources/UniDSAExecuteFunction.pas:
--------------------------------------------------------------------------------
1 | unit UniDSAExecuteFunction;
2 |
3 | interface
4 |
5 | uses
6 | JSON, uniGUIApplication, UniDSALibrary, System.SysUtils;
7 |
8 | type
9 | TExecuteFunction = class
10 | private
11 | FFuncao: string;
12 | FComando: string;
13 | FVariavel: string;
14 | public
15 | constructor Create(AFuncao: string);
16 | destructor Destroy; override;
17 | procedure SetVariavel(value: string);
18 | function GetVariavel: string;
19 | procedure FunctionName(name: string);
20 | procedure Add(APar: string; AValor: string; ACondicao: Boolean = True; AAspas: Boolean = True; AAspasDuplas: Boolean = True); overload;
21 | procedure Add(APar: string; AValor: Integer; ACondicao: Boolean = True; AAspas: Boolean = False; AAspasDuplas: Boolean = True); overload;
22 | procedure Add(APar: string; AValor: Boolean; ACondicao: Boolean = True; AAspas: Boolean = False; AAspasDuplas: Boolean = True); overload;
23 | procedure Execute;
24 | function JQuery: string;
25 | procedure Clear;
26 | end;
27 |
28 | implementation
29 |
30 | { TExecuteFunction }
31 |
32 | procedure TExecuteFunction.Add(APar: string; AValor: string; ACondicao: Boolean = True; AAspas: Boolean = True; AAspasDuplas: Boolean = True);
33 | begin
34 | if not ACondicao then
35 | Exit;
36 |
37 | FComando := FComando + IIfStr(FComando <> '', ', ', ' ') + APar + ': ';
38 |
39 | if AAspas then begin
40 | if AAspasDuplas then
41 | FComando := FComando + '"' + AValor + '"'
42 | else
43 | FComando := FComando + QuotedStr(AValor);
44 | end
45 | else
46 | FComando := FComando + AValor;
47 | end;
48 |
49 | procedure TExecuteFunction.Add(APar: string; AValor: Boolean; ACondicao: Boolean = True; AAspas: Boolean = False; AAspasDuplas: Boolean = True);
50 | begin
51 | Add(APar, IIfStr(AValor, 'true', 'false'), ACondicao, AAspas, AAspasDuplas);
52 | end;
53 |
54 | procedure TExecuteFunction.Add(APar: string; AValor: Integer; ACondicao: Boolean = True; AAspas: Boolean = False; AAspasDuplas: Boolean = True);
55 | begin
56 | Add(APar, IntToStr(AValor), ACondicao, AAspas, AAspasDuplas);
57 | end;
58 |
59 | procedure TExecuteFunction.Clear;
60 | begin
61 | FComando := '';
62 | FVariavel := '';
63 | end;
64 |
65 | constructor TExecuteFunction.Create(AFuncao: string);
66 | begin
67 | FFuncao := AFuncao;
68 | FComando := '';
69 | end;
70 |
71 | destructor TExecuteFunction.Destroy;
72 | begin
73 | end;
74 |
75 | procedure TExecuteFunction.Execute;
76 | begin
77 | UniSession.AddJS(JQuery);
78 | end;
79 |
80 | procedure TExecuteFunction.FunctionName(name: string);
81 | begin
82 | FFuncao := name;
83 | end;
84 |
85 | function TExecuteFunction.GetVariavel: string;
86 | begin
87 | Result := FVariavel;
88 | end;
89 |
90 | function TExecuteFunction.JQuery: string;
91 | begin
92 | Result :=
93 | IIfStr(FVariavel <> '', 'var ' + FVariavel + ' = ', '') +
94 | '$.' + FFuncao + '( ' +
95 | '{'+
96 | FComando +
97 | '}' +
98 | ')';
99 | end;
100 |
101 | procedure TExecuteFunction.SetVariavel(value: string);
102 | begin
103 | FVariavel := value;
104 | end;
105 |
106 | end.
107 |
--------------------------------------------------------------------------------
/sources/UniDSABase.pas:
--------------------------------------------------------------------------------
1 | unit UniDSABase;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils, System.Classes, uniGUIClasses, UniDSAExecuteFunction, UniDSALibrary, uniGUITypes;
7 |
8 | type
9 | TUniDSABaseComponent = class(TUniComponent)
10 | private
11 | FAbout: string;
12 | FVersion: string;
13 | public
14 | constructor Create(AOwner: TComponent); override;
15 | destructor Destroy; override;
16 | function AjaxRequest(AEventName: string; AParametros: TArrayOfString = nil): string;
17 | function IIfStr(condicao: Boolean; verdadeiro: string; falso: string): string;
18 | function IIfVar(condicao: Boolean; verdadeiro: Variant; falso: Variant): Variant;
19 | protected
20 | procedure DOHandleEvent(EventName: string; Params: TUniStrings); override;
21 | procedure AJAXEvent(var EventName: string; var Params: TUniStrings); virtual;
22 | procedure WebCreate; override;
23 | procedure ExecuteJQuery(jquery: string);
24 | published
25 | property About: string read FAbout;
26 | property Version: string read FVersion write FVersion;
27 | end;
28 |
29 | implementation
30 |
31 | { TUniDSABaseComponent }
32 |
33 | procedure TUniDSABaseComponent.AJAXEvent(var EventName: string; var Params: TUniStrings);
34 | begin
35 | end;
36 |
37 | function TUniDSABaseComponent.AjaxRequest(AEventName: string; AParametros: TArrayOfString = nil): string;
38 | function GetParametros: string;
39 | var
40 | k: Integer;
41 | begin
42 | Result := '[';
43 |
44 | for k := Low(AParametros) to High(AParametros) do
45 | Result := Result + IIfStr(k <> Low(AParametros), ',', '') + QuotedStr(AParametros[k] + '=p' + IntToStr(k));
46 |
47 | Result := Result + ']'
48 | end;
49 | begin
50 | Result :=
51 | ' ' +
52 | 'function (p0) { ' +
53 | ' ajaxRequest(' + IIfStr(Self.JSName = '', 'body', Self.JSName) + ', "' + AEventName + '", ' + GetParametros +'); ' +
54 | ' $(".qrr-overlay").remove(); ' +
55 | '} ';
56 | end;
57 |
58 | constructor TUniDSABaseComponent.Create(AOwner: TComponent);
59 | begin
60 | inherited Create(AOwner);
61 | FAbout := 'https://github.com/deividyalcantara?tab=repositories';
62 | FVersion := '1.1.0';
63 | end;
64 |
65 | destructor TUniDSABaseComponent.Destroy;
66 | begin
67 | inherited Destroy;
68 | end;
69 |
70 | procedure TUniDSABaseComponent.DOHandleEvent(EventName: string; Params: TUniStrings);
71 | var
72 | i: Integer;
73 | begin
74 | inherited;
75 | for i := 0 to Params.Count - 1 do begin
76 | if Params.Objects[i] = nil then
77 | Continue;
78 |
79 | Params.ValueFromIndex[i] := IIfStr(Params.ValueFromIndex[i] = 'undefined', '', Params.ValueFromIndex[i]);
80 | end;
81 |
82 | AJAXEvent(EventName, Params);
83 | end;
84 |
85 | procedure TUniDSABaseComponent.ExecuteJQuery(jquery: string);
86 | begin
87 | UniSession.AddJS(JQuery);
88 | end;
89 |
90 | function TUniDSABaseComponent.IIfStr(condicao: Boolean; verdadeiro, falso: string): string;
91 | begin
92 | if condicao then
93 | Result := verdadeiro
94 | else
95 | Result := falso;
96 | end;
97 |
98 | function TUniDSABaseComponent.IIfVar(condicao: Boolean; verdadeiro, falso: Variant): Variant;
99 | begin
100 | if condicao then
101 | Result := verdadeiro
102 | else
103 | Result := falso;
104 | end;
105 |
106 | procedure TUniDSABaseComponent.WebCreate;
107 | begin
108 | inherited;
109 | JSComponent := TJSObject.JSCreate('Object');
110 | end;
111 |
112 | end.
113 |
--------------------------------------------------------------------------------
/UniDSA.dpk:
--------------------------------------------------------------------------------
1 | package UniDSA;
2 |
3 | {$R *.res}
4 | {$R *.dres}
5 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
6 | {$ALIGN 8}
7 | {$ASSERTIONS ON}
8 | {$BOOLEVAL OFF}
9 | {$DEBUGINFO OFF}
10 | {$EXTENDEDSYNTAX ON}
11 | {$IMPORTEDDATA ON}
12 | {$IOCHECKS ON}
13 | {$LOCALSYMBOLS ON}
14 | {$LONGSTRINGS ON}
15 | {$OPENSTRINGS ON}
16 | {$OPTIMIZATION OFF}
17 | {$OVERFLOWCHECKS ON}
18 | {$RANGECHECKS ON}
19 | {$REFERENCEINFO ON}
20 | {$SAFEDIVIDE OFF}
21 | {$STACKFRAMES ON}
22 | {$TYPEDADDRESS OFF}
23 | {$VARSTRINGCHECKS ON}
24 | {$WRITEABLECONST OFF}
25 | {$MINENUMSIZE 1}
26 | {$IMAGEBASE $400000}
27 | {$DEFINE DEBUG}
28 | {$ENDIF IMPLICITBUILDING}
29 | {$DESCRIPTION 'Componente UniDSA para UniGUI'}
30 | {$IMPLICITBUILD ON}
31 |
32 | requires
33 | {$IFDEF VER360} // Delphi 12 Athens
34 | uniGUI29Core,
35 | uniTools29,
36 | uIndy29,
37 | uniGUI29,
38 | {$IFEND}
39 |
40 | {$IFDEF VER350} // Delphi 11.0 Alexandria / C++Builder 11.0 Alexandria
41 | uniGUI28Core,
42 | uniTools28,
43 | uIndy28,
44 | uniGUI28,
45 | {$IFEND}
46 |
47 | {$IFDEF VER340} // Delphi 10.4 Sydney / C++Builder 10.4 Sydney
48 | uniGUI27Core,
49 | uniTools27,
50 | uIndy27,
51 | uniGUI27,
52 | {$IFEND}
53 |
54 | {$IFDEF VER330} // Delphi 10.3 Rio / C++Builder 10.3 Rio
55 | uniGUI26Core,
56 | uniTools26,
57 | uIndy26,
58 | uniGUI26,
59 | {$IFEND}
60 |
61 | {$IFDEF VER320} // Delphi 10.2 Tokyo / C++Builder 10.2 Tokyo
62 | uniGUI25Core,
63 | uniTools25,
64 | uIndy25,
65 | uniGUI25,
66 | {$IFEND}
67 |
68 | {$IFDEF VER310} // Delphi 10.1 Berlin / C++Builder 10.1 Berlin
69 | uniGUI24Core,
70 | uniTools24,
71 | uIndy24,
72 | uniGUI24,
73 | {$IFEND}
74 |
75 | {$IFDEF VER300} // Delphi 10 Seattle / C++Builder 10 Seattle
76 | uniGUI23Core,
77 | uniTools23,
78 | uIndy23,
79 | uniGUI23,
80 | {$IFEND}
81 |
82 | {$IFDEF VER290} // Delphi XE8 / C++Builder XE8
83 | uniGUI22Core,
84 | uniTools22,
85 | uIndy22,
86 | uniGUI22,
87 | {$IFEND}
88 |
89 | {$IFDEF VER280} // Delphi XE7 / C++Builder XE7
90 | uniGUI21Core,
91 | uniTools21,
92 | uIndy21,
93 | uniGUI21,
94 | {$IFEND}
95 |
96 | {$IFDEF VER270} // Delphi XE6 / C++Builder XE6
97 | uniGUI20Core,
98 | uniTools20,
99 | uIndy20,
100 | uniGUI20,
101 | {$IFEND}
102 |
103 | {$IFDEF VER260} // Delphi XE5 / C++Builder XE5
104 | uniGUI19Core,
105 | uniTools19,
106 | uIndy19,
107 | uniGUI19,
108 | {$IFEND}
109 |
110 | {$IFDEF VER250} // Delphi XE4 / C++Builder XE4
111 | uniGUI18Core,
112 | uniTools18,
113 | uIndy18,
114 | uniGUI18,
115 | {$IFEND}
116 |
117 | {$IFDEF VER240} // Delphi XE3 / C++Builder XE3
118 | uniGUI17Core,
119 | uniTools17,
120 | uIndy17,
121 | uniGUI17,
122 | {$IFEND}
123 |
124 | {$IFDEF VER230} // Delphi XE2 / C++Builder XE2
125 | uniGUI16Core,
126 | uniTools16,
127 | uIndy16,
128 | uniGUI16,
129 | {$IFEND}
130 |
131 | {$IFDEF VER220} // Delphi XE / C++Builder XE
132 | uniGUI15Core,
133 | uniTools15,
134 | uIndy15,
135 | uniGUI15,
136 | {$IFEND}
137 |
138 | {$IFDEF VER210} // Delphi 2010 / C++Builder 2010
139 | uniGUI14Core,
140 | uniTools14,
141 | uIndy14,
142 | uniGUI14,
143 | {$IFEND}
144 |
145 | {$IFDEF VER200} // Delphi 2009 / C++Builder 2009
146 | uniGUI12Core,
147 | uniTools12,
148 | uIndy12,
149 | uniGUI12,
150 | {$IFEND}
151 |
152 | {$IFDEF VER190} // Delphi 2007 for .Net
153 | uniGUI11Core,
154 | uniTools11,
155 | uIndy11,
156 | uniGUI11,
157 | {$IFEND}
158 |
159 | {$IFDEF VER180} // Delphi 2007 / C++Builder 2007 for Win32
160 | uniGUI11Core,
161 | uniTools11,
162 | uIndy11,
163 | uniGUI11,
164 | {$IFEND}
165 |
166 | {$IFDEF VER185} // Delphi 2007 / C++Builder 2007 for Win32
167 | uniGUI11Core,
168 | uniTools11,
169 | uIndy11,
170 | uniGUI11,
171 | {$IFEND}
172 |
173 | {$IFDEF VER180} // Delphi 2006 / C++Builder 2006
174 | uniGUI10Core,
175 | uniTools10,
176 | uIndy10,
177 | uniGUI10,
178 | {$IFEND}
179 |
180 | rtl,
181 | soaprtl,
182 | dbrtl,
183 | xmlrtl,
184 | inet,
185 | vclimg,
186 | vcl,
187 | vcldb,
188 | vclwinx;
189 |
190 | contains
191 | UniDSAExecuteFunction in 'sources\UniDSAExecuteFunction.pas',
192 | UniDSALibrary in 'sources\UniDSALibrary.pas',
193 | UniDSAToast in 'sources\UniDSAToast.pas',
194 | UniDSAConfirm in 'sources\UniDSAConfirm.pas',
195 | UniDSASource in 'sources\UniDSASource.pas',
196 | UniDSABase in 'sources\UniDSABase.pas',
197 | UniDSAColor in 'sources\UniDSAColor.pas',
198 | UniDSAQrCodeReader in 'sources\UniDSAQrCodeReader.pas',
199 | UniDSABaseControl in 'sources\UniDSABaseControl.pas',
200 | UniDSAMenuLateral in 'sources\UniDSAMenuLateral.pas',
201 | UniDSADiv in 'sources\UniDSADiv.pas',
202 | UniDSALogin in 'sources\UniDSALogin.pas',
203 | UniDSAConst in 'sources\UniDSAConst.pas',
204 | UniDSAControl in 'sources\UniDSAControl.pas';
205 |
206 | end.
207 |
208 |
209 |
--------------------------------------------------------------------------------
/dsa/css/jquery.toast.css:
--------------------------------------------------------------------------------
1 | /**
2 | * jQuery toast plugin created by Kamran Ahmed copyright MIT license 2014
3 | */
4 | .jq-toast-wrap {
5 | display: block;
6 | position: fixed;
7 | width: 250px;
8 | pointer-events: none !important;
9 | margin: 0;
10 | padding: 0;
11 | letter-spacing: normal;
12 | z-index: 999999 !important;
13 | }
14 |
15 | .jq-toast-wrap * {
16 | margin: 0;
17 | padding: 0;
18 | }
19 |
20 | .jq-toast-wrap.bottom-left {
21 | bottom: 20px;
22 | left: 20px;
23 | }
24 |
25 | .jq-toast-wrap.bottom-right {
26 | bottom: 20px;
27 | right: 40px;
28 | }
29 |
30 | .jq-toast-wrap.top-left {
31 | top: 20px;
32 | left: 20px;
33 | }
34 |
35 | .jq-toast-wrap.top-right {
36 | top: 20px;
37 | right: 40px;
38 | }
39 |
40 | .jq-toast-single {
41 | display: block;
42 | width: 100%;
43 | padding: 10px;
44 | margin: 0px 0px 5px;
45 | border-radius: 4px;
46 | font-size: 12px;
47 | font-family: arial, sans-serif;
48 | line-height: 17px;
49 | position: relative;
50 | pointer-events: all !important;
51 | background-color: #444444;
52 | color: white;
53 | }
54 |
55 | .jq-toast-single h2 {
56 | font-family: arial, sans-serif;
57 | font-size: 14px;
58 | margin: 0px 0px 7px;
59 | background: none;
60 | color: inherit;
61 | line-height: inherit;
62 | letter-spacing: normal;
63 | }
64 |
65 | .jq-toast-single a {
66 | color: #eee;
67 | text-decoration: none;
68 | font-weight: bold;
69 | border-bottom: 1px solid white;
70 | padding-bottom: 3px;
71 | font-size: 12px;
72 | }
73 |
74 | .jq-toast-single ul {
75 | margin: 0px 0px 0px 15px;
76 | background: none;
77 | padding: 0px;
78 | }
79 |
80 | .jq-toast-single ul li {
81 | list-style-type: disc !important;
82 | line-height: 17px;
83 | background: none;
84 | margin: 0;
85 | padding: 0;
86 | letter-spacing: normal;
87 | }
88 |
89 | .close-jq-toast-single {
90 | position: absolute;
91 | top: 3px;
92 | right: 7px;
93 | font-size: 14px;
94 | cursor: pointer;
95 | }
96 |
97 | .jq-toast-loader {
98 | display: block;
99 | position: absolute;
100 | top: -2px;
101 | height: 5px;
102 | width: 0%;
103 | left: 0;
104 | border-radius: 5px;
105 | background: red;
106 | }
107 |
108 | .jq-toast-loaded {
109 | width: 100%;
110 | }
111 |
112 | .jq-has-icon {
113 | padding: 10px 10px 10px 50px;
114 | background-repeat: no-repeat;
115 | background-position: 10px;
116 | }
117 |
118 | .jq-icon-info {
119 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=');
120 | background-color: #31708f;
121 | color: #d9edf7;
122 | border-color: #bce8f1;
123 | }
124 |
125 | .jq-icon-warning {
126 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=');
127 | background-color: #8a6d3b;
128 | color: #fcf8e3;
129 | border-color: #faebcc;
130 | }
131 |
132 | .jq-icon-error {
133 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=');
134 | background-color: #a94442;
135 | color: #f2dede;
136 | border-color: #ebccd1;
137 | }
138 |
139 | .jq-icon-success {
140 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==');
141 | color: #dff0d8;
142 | background-color: #3c763d;
143 | border-color: #d6e9c6;
144 | }
--------------------------------------------------------------------------------
/demo/View/FrameLeitorQRCode.dfm:
--------------------------------------------------------------------------------
1 | inherited FrLeitorQrCode: TFrLeitorQrCode
2 | object usbPrincipal: TUniScrollBox
3 | Left = 0
4 | Top = 0
5 | Width = 624
6 | Height = 441
7 | Hint = ''
8 | Align = alClient
9 | TabOrder = 0
10 | ExplicitWidth = 640
11 | ExplicitHeight = 480
12 | object ugbMensagem: TUniGroupBox
13 | AlignWithMargins = True
14 | Left = 20
15 | Top = 80
16 | Width = 697
17 | Height = 544
18 | Hint = ''
19 | Margins.Left = 20
20 | Margins.Top = 10
21 | Margins.Right = 20
22 | Margins.Bottom = 0
23 | Caption = 'Leitura'
24 | Align = alClient
25 | TabOrder = 0
26 | ExplicitTop = 98
27 | ExplicitWidth = 598
28 | ExplicitHeight = 380
29 | object UniContainerPanel20: TUniContainerPanel
30 | AlignWithMargins = True
31 | Left = 2
32 | Top = 20
33 | Width = 693
34 | Height = 42
35 | Hint = ''
36 | Margins.Left = 0
37 | Margins.Top = 5
38 | Margins.Right = 0
39 | Margins.Bottom = 0
40 | ParentColor = False
41 | Align = alTop
42 | TabOrder = 1
43 | ExplicitWidth = 594
44 | object UniContainerPanel23: TUniContainerPanel
45 | AlignWithMargins = True
46 | Left = 3
47 | Top = 0
48 | Width = 284
49 | Height = 39
50 | Hint = ''
51 | Margins.Top = 0
52 | ParentColor = False
53 | Align = alLeft
54 | TabOrder = 1
55 | object UniLabel16: TUniLabel
56 | Left = 0
57 | Top = 0
58 | Width = 52
59 | Height = 13
60 | Hint = ''
61 | Caption = 'Resultado'
62 | Align = alTop
63 | ParentColor = False
64 | Color = clBtnFace
65 | TabOrder = 1
66 | end
67 | object edtResultado: TUniEdit
68 | Left = 0
69 | Top = 17
70 | Width = 284
71 | Hint = ''
72 | Text = ''
73 | Align = alBottom
74 | TabOrder = 2
75 | end
76 | end
77 | object UniContainerPanel22: TUniContainerPanel
78 | AlignWithMargins = True
79 | Left = 293
80 | Top = 0
81 | Width = 108
82 | Height = 39
83 | Hint = ''
84 | Margins.Top = 0
85 | ParentColor = False
86 | Align = alLeft
87 | TabOrder = 2
88 | object btnLeitura: TUniButton
89 | Left = 0
90 | Top = 17
91 | Width = 108
92 | Height = 22
93 | Hint = ''
94 | Caption = 'Leitura '#250'nica'
95 | Align = alBottom
96 | TabOrder = 1
97 | OnClick = btnLeituraClick
98 | end
99 | end
100 | end
101 | object qrcLeitor: TUniDSAQrCodeReader
102 | Left = 3
103 | Top = 65
104 | Width = 400
105 | Height = 352
106 | Hint = ''
107 | Text = ''
108 | SingleRead = False
109 | QrBox = 250
110 | FPS = 10
111 | SupportedFormats.QR_CODE = True
112 | SupportedFormats.AZTEC = True
113 | SupportedFormats.CODABAR = True
114 | SupportedFormats.CODE_39 = True
115 | SupportedFormats.CODE_93 = True
116 | SupportedFormats.CODE_128 = True
117 | SupportedFormats.DATA_MATRIX = True
118 | SupportedFormats.MAXICODE = True
119 | SupportedFormats.ITF = True
120 | SupportedFormats.EAN_13 = True
121 | SupportedFormats.EAN_8 = True
122 | SupportedFormats.PDF_417 = True
123 | SupportedFormats.RSS_14 = True
124 | SupportedFormats.RSS_EXPANDED = True
125 | SupportedFormats.UPC_A = True
126 | SupportedFormats.UPC_E = True
127 | SupportedFormats.UPC_EAN_EXTENSION = True
128 | OnAfterReading = qrcLeitorAfterReading
129 | end
130 | end
131 | object UniLabel1: TUniLabel
132 | AlignWithMargins = True
133 | Left = 20
134 | Top = 20
135 | Width = 147
136 | Height = 30
137 | Hint = ''
138 | Margins.Left = 20
139 | Margins.Top = 20
140 | Margins.Right = 20
141 | Margins.Bottom = 0
142 | Caption = 'QrCode Reader'
143 | Align = alTop
144 | ParentFont = False
145 | Font.Height = 30
146 | Font.Style = [fsBold]
147 | ParentColor = False
148 | Color = clBtnFace
149 | TabOrder = 1
150 | end
151 | object UniLabel2: TUniLabel
152 | AlignWithMargins = True
153 | Left = 20
154 | Top = 50
155 | Width = 377
156 | Height = 20
157 | Hint = ''
158 | Margins.Left = 20
159 | Margins.Top = 0
160 | Margins.Right = 20
161 | Margins.Bottom = 0
162 | Caption = 'Componente para leitura de c'#243'digos de barras e QrCode'
163 | Align = alTop
164 | ParentFont = False
165 | Font.Color = clGray
166 | Font.Height = -15
167 | ParentColor = False
168 | Color = clBtnFace
169 | TabOrder = 2
170 | end
171 | end
172 | object Toast: TUniDSAToast
173 | Version = '1.1.0'
174 | Icon = Success
175 | ShowHideTransition = Fade
176 | HideAfter = 3000
177 | AllowToastClose = True
178 | Stack.Enabled = True
179 | Stack.Value = 5
180 | BgColor.Enabled = False
181 | BgColor.Color = clAqua
182 | TextColor.Enabled = False
183 | TextColor.Color = clAqua
184 | TextAlign = Left
185 | Position.Position = BottomRight
186 | Position.Custom.Left = 0
187 | Position.Custom.Top = 0
188 | Position.Custom.Right = 0
189 | Position.Custom.Bottom = 0
190 | Loader.Enabled = True
191 | Loader.Background = clAqua
192 | Left = 392
193 | Top = 288
194 | end
195 | end
196 |
--------------------------------------------------------------------------------
/demo/View/FrameToast.dfm:
--------------------------------------------------------------------------------
1 | inherited FrToast: TFrToast
2 | object usbPrincipal: TUniScrollBox
3 | Left = 0
4 | Top = 0
5 | Width = 624
6 | Height = 441
7 | Hint = ''
8 | Align = alClient
9 | TabOrder = 0
10 | ExplicitLeft = 3
11 | ExplicitTop = 8
12 | ExplicitWidth = 640
13 | ExplicitHeight = 480
14 | object ugbMensagem: TUniGroupBox
15 | AlignWithMargins = True
16 | Left = 20
17 | Top = 80
18 | Width = 601
19 | Height = 70
20 | Hint = ''
21 | Margins.Left = 20
22 | Margins.Top = 10
23 | Margins.Right = 20
24 | Margins.Bottom = 0
25 | Caption = 'Mensagem'
26 | Align = alTop
27 | TabOrder = 0
28 | ExplicitWidth = 598
29 | object UniContainerPanel20: TUniContainerPanel
30 | AlignWithMargins = True
31 | Left = 2
32 | Top = 20
33 | Width = 597
34 | Height = 42
35 | Hint = ''
36 | Margins.Left = 0
37 | Margins.Top = 5
38 | Margins.Right = 0
39 | Margins.Bottom = 0
40 | ParentColor = False
41 | Align = alTop
42 | TabOrder = 1
43 | ExplicitWidth = 594
44 | object UniContainerPanel23: TUniContainerPanel
45 | AlignWithMargins = True
46 | Left = 3
47 | Top = 0
48 | Width = 163
49 | Height = 39
50 | Hint = ''
51 | Margins.Top = 0
52 | ParentColor = False
53 | Align = alLeft
54 | TabOrder = 1
55 | object UniLabel16: TUniLabel
56 | Left = 0
57 | Top = 0
58 | Width = 30
59 | Height = 13
60 | Hint = ''
61 | Caption = 'T'#237'tulo'
62 | Align = alTop
63 | ParentColor = False
64 | Color = clBtnFace
65 | TabOrder = 1
66 | end
67 | object edtTitulo: TUniEdit
68 | Left = 0
69 | Top = 17
70 | Width = 163
71 | Hint = ''
72 | Text = 'T'#237'tulo Toast'
73 | Align = alBottom
74 | TabOrder = 2
75 | end
76 | end
77 | object UniContainerPanel21: TUniContainerPanel
78 | AlignWithMargins = True
79 | Left = 172
80 | Top = 0
81 | Width = 157
82 | Height = 39
83 | Hint = ''
84 | Margins.Top = 0
85 | ParentColor = False
86 | Align = alLeft
87 | TabOrder = 2
88 | object UniLabel15: TUniLabel
89 | Left = 0
90 | Top = 0
91 | Width = 56
92 | Height = 13
93 | Hint = ''
94 | Caption = 'Mensagem'
95 | Align = alTop
96 | TabOrder = 1
97 | end
98 | object edtMensagem: TUniEdit
99 | Left = 0
100 | Top = 17
101 | Width = 157
102 | Hint = ''
103 | Text = 'Mensagem Toast'
104 | Align = alBottom
105 | TabOrder = 2
106 | end
107 | end
108 | object UniContainerPanel22: TUniContainerPanel
109 | AlignWithMargins = True
110 | Left = 335
111 | Top = 0
112 | Width = 61
113 | Height = 39
114 | Hint = ''
115 | Margins.Top = 0
116 | ParentColor = False
117 | Align = alLeft
118 | TabOrder = 3
119 | object btnMostrar: TUniButton
120 | Left = 0
121 | Top = 17
122 | Width = 61
123 | Height = 22
124 | Hint = ''
125 | Caption = 'Mostrar'
126 | Align = alBottom
127 | TabOrder = 1
128 | OnClick = btnMostrarClick
129 | end
130 | end
131 | end
132 | end
133 | object UniLabel1: TUniLabel
134 | AlignWithMargins = True
135 | Left = 20
136 | Top = 20
137 | Width = 51
138 | Height = 30
139 | Hint = ''
140 | Margins.Left = 20
141 | Margins.Top = 20
142 | Margins.Right = 20
143 | Margins.Bottom = 0
144 | Caption = 'Toast'
145 | Align = alTop
146 | ParentFont = False
147 | Font.Height = 30
148 | Font.Style = [fsBold]
149 | ParentColor = False
150 | Color = clBtnFace
151 | TabOrder = 1
152 | end
153 | object UniLabel2: TUniLabel
154 | AlignWithMargins = True
155 | Left = 20
156 | Top = 50
157 | Width = 185
158 | Height = 20
159 | Hint = ''
160 | Margins.Left = 20
161 | Margins.Top = 0
162 | Margins.Right = 20
163 | Margins.Bottom = 0
164 | Caption = 'Componente de notifica'#231#227'o'
165 | Align = alTop
166 | ParentFont = False
167 | Font.Color = clGray
168 | Font.Height = -15
169 | ParentColor = False
170 | Color = clBtnFace
171 | TabOrder = 2
172 | end
173 | object UniLabel3: TUniLabel
174 | AlignWithMargins = True
175 | Left = 20
176 | Top = 155
177 | Width = 251
178 | Height = 13
179 | Hint = ''
180 | Margins.Left = 20
181 | Margins.Top = 5
182 | Margins.Right = 20
183 | Margins.Bottom = 0
184 | Caption = 'Demais recursos ser'#227'o exemplificados em breve...'
185 | Align = alTop
186 | ParentFont = False
187 | Font.Color = clGray
188 | Font.Height = -12
189 | ParentColor = False
190 | Color = clBtnFace
191 | TabOrder = 3
192 | end
193 | end
194 | object Toast: TUniDSAToast
195 | Version = '1.1.0'
196 | Icon = Success
197 | ShowHideTransition = Fade
198 | HideAfter = 3000
199 | AllowToastClose = True
200 | Stack.Enabled = True
201 | Stack.Value = 5
202 | BgColor.Enabled = False
203 | BgColor.Color = clAqua
204 | TextColor.Enabled = False
205 | TextColor.Color = clAqua
206 | TextAlign = Left
207 | Position.Position = BottomRight
208 | Position.Custom.Left = 0
209 | Position.Custom.Top = 0
210 | Position.Custom.Right = 0
211 | Position.Custom.Bottom = 0
212 | Loader.Enabled = True
213 | Loader.Background = clAqua
214 | Left = 392
215 | Top = 288
216 | end
217 | end
218 |
--------------------------------------------------------------------------------
/demo/View/FrameConfirm.dfm:
--------------------------------------------------------------------------------
1 | inherited FrConfirm: TFrConfirm
2 | object UniLabel2: TUniLabel
3 | AlignWithMargins = True
4 | Left = 20
5 | Top = 50
6 | Width = 352
7 | Height = 20
8 | Hint = ''
9 | Margins.Left = 20
10 | Margins.Top = 0
11 | Margins.Right = 20
12 | Margins.Bottom = 0
13 | Caption = 'Componente para exibi'#231#227'o de mensagem e dialogos'
14 | Align = alTop
15 | ParentFont = False
16 | Font.Color = clGray
17 | Font.Height = -15
18 | ParentColor = False
19 | Color = clBtnFace
20 | TabOrder = 0
21 | end
22 | object UniLabel1: TUniLabel
23 | AlignWithMargins = True
24 | Left = 20
25 | Top = 20
26 | Width = 80
27 | Height = 30
28 | Hint = ''
29 | Margins.Left = 20
30 | Margins.Top = 20
31 | Margins.Right = 20
32 | Margins.Bottom = 0
33 | Caption = 'Confirm'
34 | Align = alTop
35 | ParentFont = False
36 | Font.Height = 30
37 | Font.Style = [fsBold]
38 | ParentColor = False
39 | Color = clBtnFace
40 | TabOrder = 1
41 | end
42 | object ugbMensagem: TUniGroupBox
43 | AlignWithMargins = True
44 | Left = 20
45 | Top = 80
46 | Width = 584
47 | Height = 70
48 | Hint = ''
49 | Margins.Left = 20
50 | Margins.Top = 10
51 | Margins.Right = 20
52 | Margins.Bottom = 0
53 | Caption = 'Mensagem'
54 | Align = alTop
55 | TabOrder = 2
56 | ExplicitWidth = 601
57 | object UniContainerPanel20: TUniContainerPanel
58 | AlignWithMargins = True
59 | Left = 2
60 | Top = 20
61 | Width = 596
62 | Height = 42
63 | Hint = ''
64 | Margins.Left = 0
65 | Margins.Top = 5
66 | Margins.Right = 0
67 | Margins.Bottom = 0
68 | ParentColor = False
69 | Align = alTop
70 | TabOrder = 1
71 | ExplicitWidth = 597
72 | object UniContainerPanel23: TUniContainerPanel
73 | AlignWithMargins = True
74 | Left = 3
75 | Top = 0
76 | Width = 163
77 | Height = 39
78 | Hint = ''
79 | Margins.Top = 0
80 | ParentColor = False
81 | Align = alLeft
82 | TabOrder = 1
83 | object UniLabel16: TUniLabel
84 | Left = 0
85 | Top = 0
86 | Width = 30
87 | Height = 13
88 | Hint = ''
89 | Caption = 'T'#237'tulo'
90 | Align = alTop
91 | ParentColor = False
92 | Color = clBtnFace
93 | TabOrder = 1
94 | end
95 | object edtTitulo: TUniEdit
96 | Left = 0
97 | Top = 17
98 | Width = 163
99 | Hint = ''
100 | Text = 'T'#237'tulo Confirm'
101 | Align = alBottom
102 | TabOrder = 2
103 | end
104 | end
105 | object UniContainerPanel21: TUniContainerPanel
106 | AlignWithMargins = True
107 | Left = 172
108 | Top = 0
109 | Width = 157
110 | Height = 39
111 | Hint = ''
112 | Margins.Top = 0
113 | ParentColor = False
114 | Align = alLeft
115 | TabOrder = 2
116 | object UniLabel15: TUniLabel
117 | Left = 0
118 | Top = 0
119 | Width = 56
120 | Height = 13
121 | Hint = ''
122 | Caption = 'Mensagem'
123 | Align = alTop
124 | TabOrder = 1
125 | end
126 | object edtMensagem: TUniEdit
127 | Left = 0
128 | Top = 17
129 | Width = 157
130 | Hint = ''
131 | Text = 'Mensagem Confirm'
132 | Align = alBottom
133 | TabOrder = 2
134 | end
135 | end
136 | object UniContainerPanel22: TUniContainerPanel
137 | AlignWithMargins = True
138 | Left = 335
139 | Top = 0
140 | Width = 61
141 | Height = 39
142 | Hint = ''
143 | Margins.Top = 0
144 | ParentColor = False
145 | Align = alLeft
146 | TabOrder = 3
147 | object btnMostrar: TUniButton
148 | Left = 0
149 | Top = 17
150 | Width = 61
151 | Height = 22
152 | Hint = ''
153 | Caption = 'Mostrar'
154 | Align = alBottom
155 | TabOrder = 1
156 | OnClick = btnMostrarClick
157 | end
158 | end
159 | end
160 | end
161 | object UniLabel3: TUniLabel
162 | AlignWithMargins = True
163 | Left = 20
164 | Top = 155
165 | Width = 251
166 | Height = 13
167 | Hint = ''
168 | Margins.Left = 20
169 | Margins.Top = 5
170 | Margins.Right = 20
171 | Margins.Bottom = 0
172 | Caption = 'Demais recursos ser'#227'o exemplificados em breve...'
173 | Align = alTop
174 | ParentFont = False
175 | Font.Color = clGray
176 | Font.Height = -12
177 | ParentColor = False
178 | Color = clBtnFace
179 | TabOrder = 3
180 | end
181 | object Confirm: TUniDSAConfirm
182 | Version = '1.1.0'
183 | Draggable = True
184 | DrawWindowsBorder = True
185 | DrawWindowsGap = 15
186 | Buttons = <>
187 | Theme = Light
188 | Types.Enabled = True
189 | Types.Color = clBlue
190 | TypeAnimated = False
191 | ContainerFluid = False
192 | ColumnClass =
193 | 'col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-' +
194 | 'xs-offset-1'
195 | BoxWidth = '30%'
196 | UseBootstrap = False
197 | Dismiss.BackgroundDismiss = False
198 | Dismiss.BackgroundDismissAnimation = Shake
199 | AnimateFromElement = True
200 | SmoothContent = True
201 | LazyOpen = False
202 | BgOpacity = '1'
203 | Animation.Enabled = True
204 | Animation.Animation = 'scale'
205 | Animation.CloseAnimation = 'scale'
206 | Animation.AnimationSpeed = 400
207 | Animation.AnimationBounce = 1
208 | RTL = False
209 | Container = 'body'
210 | WatchInterval = 100
211 | ScrollToPreviousElement = True
212 | ScrollToPreviousElementAnimate = True
213 | OffsetTop = 40
214 | OffsetBottom = 40
215 | PromptCustom.ClassForm = 'formName'
216 | PromptCustom.ClassGroup = 'form-group'
217 | PromptCustom.ClassInput = 'name form-control'
218 | PromptCustom.PlaceHolder = 'Digite...'
219 | PromptCustom.InputType = Text
220 | EscapeKey = False
221 | Close.CloseIcon = False
222 | TypeConfirm = Alert
223 | Type = Blue
224 | Left = 160
225 | Top = 232
226 | end
227 | end
228 |
--------------------------------------------------------------------------------
/sources/UniDSABaseControl.pas:
--------------------------------------------------------------------------------
1 | unit UniDSABaseControl;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils, System.Classes, uniGUIClasses, UniDSAExecuteFunction, UniDSALibrary, uniGUITypes;
7 |
8 | type
9 | TUniDSABaseControl = class(TUniControl)
10 | private
11 | FAbout: string;
12 | FVersion: string;
13 | FFontAwesome: string;
14 | public
15 | constructor Create(AOwner: TComponent); override;
16 | destructor Destroy; override;
17 |
18 | function IIfVar(ACondicao: Boolean; AVerdadeiro: Variant; AFalso: Variant): Variant;
19 | procedure JS(AScript: string);
20 |
21 | procedure JQueryShow(AId: string);
22 | procedure JQueryHide(AId: string);
23 | procedure JQueryText(AId: string; AText: string);
24 | procedure JQueryVal(AId: string; AText: string);
25 | procedure JqueryWidth(AId: string; AWidth: Integer; ATipo: string = ''); overload;
26 | procedure JqueryWidth(AId: string; AWidth: string); overload;
27 | procedure JQueryMarginLeft(AId: string; AMargin: Integer; ATipo: string = '');
28 | procedure JQueryMarginRigth(AId: string; AMargin: Integer; ATipo: string = '');
29 | procedure JQueryMarginTop(AId: string; AMargin: Integer; ATipo: string = '');
30 | procedure JQueryMarginBottom(AId: string; AMargin: Integer; ATipo: string = '');
31 | procedure JQueryDisplayNone(AId: string);
32 | procedure JQueryDisplayFlex(AId: string);
33 | procedure JQueryAttr(AId: string; AValue: string; AAttribute: string);
34 | procedure JQuerySrc(AId: string; AUrl: string);
35 | procedure JQueryChecked(AId: string; AValue: Boolean);
36 | procedure JQueryFocus(AId: string);
37 | procedure JQueryDisabled(AId: string; AValue: Boolean);
38 | published
39 | property About: string read FAbout;
40 | property Version: string read FVersion;
41 | property FontAwesome: string read FFontAwesome;
42 | protected
43 | procedure InternalSetCaption(const Value: string); override;
44 | procedure ConfigJSClasses(ALoading: Boolean); override;
45 | end;
46 |
47 | implementation
48 |
49 | { TUniDSABaseControl }
50 |
51 | procedure TUniDSABaseControl.ConfigJSClasses(ALoading: Boolean);
52 | begin
53 | inherited;
54 | JSObjects.DefaultJSClassName:='Ext.form.Label';
55 | end;
56 |
57 | constructor TUniDSABaseControl.Create(AOwner: TComponent);
58 | begin
59 | inherited;
60 | FAbout := 'https://github.com/deividyalcantara?tab=repositories';
61 | FVersion := '1.1.0';
62 | FFontAwesome := '5.14.0';
63 | end;
64 |
65 | destructor TUniDSABaseControl.Destroy;
66 | begin
67 | inherited;
68 | end;
69 |
70 | function TUniDSABaseControl.IIfVar(ACondicao: Boolean; AVerdadeiro, AFalso: Variant): Variant;
71 | begin
72 | if ACondicao then
73 | Result := AVerdadeiro
74 | else
75 | Result := AFalso;
76 | end;
77 |
78 | procedure TUniDSABaseControl.JS(AScript: string);
79 | begin
80 | if WebMode then
81 | JSCode(AScript);
82 | end;
83 |
84 | procedure TUniDSABaseControl.InternalSetCaption(const Value: string);
85 | begin
86 | inherited;
87 | if not IsDesigning then begin
88 | InternalSetText(Value);
89 |
90 | if not IsLoading then
91 | JSProperty('html', [Caption, False], 'setText');
92 | end;
93 | end;
94 |
95 | procedure TUniDSABaseControl.JQueryAttr(AId, AValue: string; AAttribute: string);
96 | begin
97 | JSCode('$("' + AId + '").attr("' + AAttribute + '", "' + AValue + '");');
98 | end;
99 |
100 | procedure TUniDSABaseControl.JQueryChecked(AId: string; AValue: Boolean);
101 | begin
102 | if AValue then
103 | JSCode('$("' + AId + '").prop("checked", true);')
104 | else
105 | JSCode('$("' + AId + '").prop("checked", false);');
106 | end;
107 |
108 | procedure TUniDSABaseControl.JQueryDisabled(AId: string; AValue: Boolean);
109 | begin
110 | if AValue then
111 | JSCode('$("' + AId + '").prop("disabled", true);')
112 | else
113 | JSCode('$("' + AId + '").prop("disabled", false);');
114 | end;
115 |
116 | procedure TUniDSABaseControl.JQueryDisplayFlex(AId: string);
117 | begin
118 | JSCode('$("' + AId + '").css("display", "flex");');
119 | end;
120 |
121 | procedure TUniDSABaseControl.JQueryDisplayNone(AId: string);
122 | begin
123 | JSCode('$("' + AId + '").css("display", "none");');
124 | end;
125 |
126 | procedure TUniDSABaseControl.JQueryFocus(AId: string);
127 | begin
128 | JSCode('$("' + AId + '").focus();')
129 | end;
130 |
131 | procedure TUniDSABaseControl.JQueryHide(AId: string);
132 | begin
133 | JSCode('$("' + AId + '").hide();')
134 | end;
135 |
136 | procedure TUniDSABaseControl.JQueryMarginBottom(AId: string; AMargin: Integer; ATipo: string = '');
137 | begin
138 | JSCode('$("' + AId + '").css("margin-bottom", "' + IntToStr(AMargin) + '' + IIfStr(ATipo <> '', ATipo, 'px') + '");');
139 | end;
140 |
141 | procedure TUniDSABaseControl.JQueryMarginLeft(AId: string; AMargin: Integer; ATipo: string = '');
142 | begin
143 | JSCode('$("' + AId + '").css("margin-left", "' + IntToStr(AMargin) + '' + IIfStr(ATipo <> '', ATipo, 'px') + '");');
144 | end;
145 |
146 | procedure TUniDSABaseControl.JQueryMarginRigth(AId: string; AMargin: Integer; ATipo: string = '');
147 | begin
148 | JSCode('$("' + AId + '").css("margin-right", "' + IntToStr(AMargin) + '' + IIfStr(ATipo <> '', ATipo, 'px') + '");');
149 | end;
150 |
151 | procedure TUniDSABaseControl.JQueryMarginTop(AId: string; AMargin: Integer; ATipo: string = '');
152 | begin
153 | JSCode('$("' + AId + '").css("margin-top", "' + IntToStr(AMargin) + '' + IIfStr(ATipo <> '', ATipo, 'px') + '");');
154 | end;
155 |
156 | procedure TUniDSABaseControl.JQueryShow(AId: string);
157 | begin
158 | JSCode('$("' + AId + '").show();');
159 | end;
160 |
161 | procedure TUniDSABaseControl.JQuerySrc(AId, AUrl: string);
162 | begin
163 | JQueryAttr(AId, AUrl, 'src');
164 | end;
165 |
166 | procedure TUniDSABaseControl.JQueryText(AId: string; AText: string);
167 | begin
168 | JSCode('$("' + AId + '").text("' + AText + '");');
169 | end;
170 |
171 | procedure TUniDSABaseControl.JQueryVal(AId, AText: string);
172 | begin
173 | JSCode('$("' + AId + '").val("' + AText + '");');
174 | end;
175 |
176 | procedure TUniDSABaseControl.JqueryWidth(AId, AWidth: string);
177 | begin
178 | JSCode('$("' + AId + '").css("width", "' + AWidth + '");');
179 | end;
180 |
181 | procedure TUniDSABaseControl.JqueryWidth(AId: string; AWidth: Integer; ATipo: string = '');
182 | begin
183 | JSCode('$("' + AId + '").css("width", "' + IntToStr(AWidth) + '' + IIfStr(ATipo <> '', ATipo, 'px') + '");');
184 | end;
185 |
186 | end.
187 |
--------------------------------------------------------------------------------
/demo/Main.dfm:
--------------------------------------------------------------------------------
1 | object MainForm: TMainForm
2 | Left = 0
3 | Top = 0
4 | ClientHeight = 692
5 | ClientWidth = 966
6 | Caption = 'UniDSA Demo'
7 | Color = 16579066
8 | OldCreateOrder = False
9 | MonitoredKeys.Keys = <>
10 | Font.Height = -12
11 | OnAfterShow = UniFormAfterShow
12 | OnCreate = UniFormCreate
13 | TextHeight = 15
14 | object mlMenu: TUniDSAMenuLateral
15 | Left = 0
16 | Top = 0
17 | Width = 300
18 | Height = 692
19 | Hint = ''
20 | Logo.UrlImage = 'https://i.ibb.co/yhLx7mc/Logo.jpg'
21 | Logo.CompanyName = 'UniDSA - Unigui'
22 | Logo.Visible = True
23 | Search.Icon = 'fas fa-search'
24 | Search.TextPrompt = 'Pesquisa...'
25 | Search.AutoComplete = True
26 | Search.Visible = True
27 | Theme.StyleLeft = mltUniGray
28 | Theme.StyleRight = mltEscuro
29 | Theme.TitleLeft = 'Claro'
30 | Theme.TitleRight = 'Escuro'
31 | Theme.Visible = True
32 | Profile.Name = 'Nome Sobrenome'
33 | Profile.Email = 'nome@dominio.com'
34 | Profile.ImageURL = 'https://s11.gifyu.com/images/SchAL.png'
35 | Profile.Visible = True
36 | Menu.IMenuParent = mlMenu
37 | Menu = <
38 | item
39 | Icon = 'fas fa-home'
40 | Caption = 'Home'
41 | NotificationCount = 0
42 | Visible = True
43 | Enabled = True
44 | Hidden = False
45 | Separator = False
46 | OnClick = mlMenuMenu0Click
47 | end
48 | item
49 | Icon = 'fas fa-bars'
50 | Caption = 'Menu Lateral'
51 | NotificationCount = 0
52 | Visible = True
53 | Enabled = True
54 | Hidden = False
55 | Separator = False
56 | OnClick = mlMenuMenu1Click
57 | OnClickNotification = mlMenuMenu1ClickNotification
58 | end
59 | item
60 | Icon = 'fas fa-bell'
61 | Caption = 'Toast'
62 | NotificationCount = 0
63 | Visible = True
64 | Enabled = True
65 | Hidden = False
66 | Separator = False
67 | OnClick = mlMenuMenu2Click
68 | end
69 | item
70 | Icon = 'fas fa-check-square'
71 | Caption = 'Confirm'
72 | NotificationCount = 0
73 | Visible = True
74 | Enabled = True
75 | Hidden = False
76 | Separator = False
77 | OnClick = mlMenuMenu3Click
78 | end
79 | item
80 | Icon = 'fas fa-qrcode'
81 | Caption = 'QrCode Reader'
82 | NotificationCount = 0
83 | Visible = True
84 | Enabled = True
85 | Hidden = False
86 | Separator = False
87 | OnClick = mlMenuMenu4Click
88 | end
89 | item
90 | Icon = 'fas fa-bars'
91 | Caption = 'Menu 5'
92 | NotificationCount = 0
93 | Visible = True
94 | Enabled = True
95 | Hidden = False
96 | Separator = True
97 | end
98 | item
99 | Icon = 'fas fa-hands-helping'
100 | Caption = 'Apoie o projeto'
101 | NotificationCount = 0
102 | Visible = True
103 | Enabled = True
104 | Hidden = False
105 | Separator = False
106 | OnClick = mlMenuMenu6Click
107 | end>
108 | MenuState = mlmMaximize
109 | Style.PaddingTop = 20
110 | Style.PaddingLeft = 20
111 | Style.PaddingRight = 20
112 | Style.PaddingBottom = 20
113 | Style.BorderTop = 0
114 | Style.BorderLeft = 0
115 | Style.BorderRight = 2
116 | Style.BorderBottom = 0
117 | Style.BorderRadiusTopLeft = 0
118 | Style.BorderRadiusTopRight = 15
119 | Style.BorderRadiusBottomLeft = 0
120 | Style.BorderRadiusBottomRight = 15
121 | SelectedDiretionTheme = mltThemeLeft
122 | SelectedTheme = mltUniCrisp
123 | OnClickLogo = mlMenuClickLogo
124 | OnClickLogoff = mlMenuClickLogoff
125 | OnSearchEnter = mlMenuSearchEnter
126 | AjaxSecurity = True
127 | end
128 | object Toast: TUniDSAToast
129 | Version = '1.1.0'
130 | Icon = Success
131 | ShowHideTransition = Fade
132 | HideAfter = 0
133 | AllowToastClose = True
134 | Stack.Enabled = True
135 | Stack.Value = 5
136 | BgColor.Enabled = False
137 | BgColor.Color = clAqua
138 | TextColor.Enabled = False
139 | TextColor.Color = clAqua
140 | TextAlign = Left
141 | Position.Position = BottomLeft
142 | Position.Custom.Left = 0
143 | Position.Custom.Top = 0
144 | Position.Custom.Right = 0
145 | Position.Custom.Bottom = 0
146 | Loader.Enabled = True
147 | Loader.Background = clAqua
148 | OnAfterHidden = ToastAfterHidden
149 | Left = 488
150 | Top = 296
151 | end
152 | object Confirm: TUniDSAConfirm
153 | Version = '1.1.0'
154 | Title = 'Teste'
155 | Draggable = True
156 | DrawWindowsBorder = True
157 | DrawWindowsGap = 15
158 | Buttons = <
159 | item
160 | IsHidden = False
161 | isDisabled = False
162 | AutoClose = 0
163 | ScapeKey = False
164 | end
165 | item
166 | IsHidden = False
167 | isDisabled = False
168 | AutoClose = 0
169 | ScapeKey = False
170 | end>
171 | Theme = Supervan
172 | Types.Enabled = True
173 | Types.Color = clLime
174 | TypeAnimated = False
175 | ContainerFluid = False
176 | ColumnClass =
177 | 'col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-' +
178 | 'xs-offset-1'
179 | BoxWidth = '30%'
180 | UseBootstrap = False
181 | Dismiss.BackgroundDismiss = False
182 | Dismiss.BackgroundDismissAnimation = Shake
183 | AnimateFromElement = True
184 | SmoothContent = True
185 | LazyOpen = False
186 | BgOpacity = '1'
187 | Animation.Enabled = True
188 | Animation.Animation = 'scale'
189 | Animation.CloseAnimation = 'scale'
190 | Animation.AnimationSpeed = 400
191 | Animation.AnimationBounce = 1
192 | RTL = False
193 | Container = 'body'
194 | WatchInterval = 100
195 | ScrollToPreviousElement = True
196 | ScrollToPreviousElementAnimate = True
197 | OffsetTop = 40
198 | OffsetBottom = 40
199 | PromptCustom.ClassForm = 'formName'
200 | PromptCustom.ClassGroup = 'form-group'
201 | PromptCustom.ClassInput = 'name form-control'
202 | PromptCustom.PlaceHolder = 'Digite...'
203 | PromptCustom.InputType = Text
204 | EscapeKey = False
205 | Close.CloseIcon = False
206 | TypeConfirm = Alert
207 | Type = Green
208 | Left = 488
209 | Top = 224
210 | end
211 | end
212 |
--------------------------------------------------------------------------------
/dsa/login/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 0px;
3 | margin: 0px;
4 | }
5 |
6 | .un-lg-bg {
7 | width: 100%;
8 | height: 100vb;
9 | display: flex;
10 | align-items: center;
11 | justify-content: center;
12 | }
13 |
14 | .un-lg-bg .un-lg-shape {
15 | position: absolute;
16 | z-index: 1;
17 | display: flex;
18 | justify-content: center;
19 | align-items: center;
20 | width: 100%;
21 | height: 100%;
22 | }
23 |
24 | .un-lg-bg .un-lg-shape svg {
25 | margin-left: -40px;
26 | width: 100%;
27 | height: 100%;
28 | }
29 |
30 | .un-lg-bg .un-lg-login {
31 | background-color: #f8fafb;
32 | min-width: 290px;
33 | height: 500px;
34 | border-radius: 10px;
35 | border: 1px solid #f6f8f9;
36 | z-index: 2;
37 | -webkit-box-shadow: 0px 2px 13px 3px rgba(0,0,0,0.1);
38 | -moz-box-shadow: 0px 2px 13px 3px rgba(0,0,0,0.1);
39 | box-shadow: 0px 2px 13px 3px rgba(0,0,0,0.1);
40 | }
41 |
42 | .un-lg-bg .un-lg-login .un-lg-logo {
43 | height: 77px;
44 | width: auto;
45 | border-radius: 10px;
46 | display: flex;
47 | }
48 |
49 | .un-lg-bg .un-lg-login .un-lg-logo .un-lg-logo-left {
50 | width: 112px;
51 | display: flex;
52 | align-items: center;
53 | display: flex;
54 | margin-left: 30px;
55 | }
56 |
57 | .un-lg-bg .un-lg-login .un-lg-logo .un-lg-logo-left #un-lg-logo-left-img{
58 | max-height: 47px;
59 | max-width: 96px;
60 | }
61 |
62 | .un-lg-bg .un-lg-login .un-lg-img-submit {
63 | width: 100%;
64 | height: calc(100% - 77px);
65 | background-color: #f8fafb;
66 | border-radius: 10px;
67 | display: flex;
68 | flex-direction: row;
69 | }
70 |
71 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-img-demo {
72 | width: 438px;
73 | height: 100%;
74 | display: flex;
75 | flex-direction: row;
76 | justify-content: center;
77 | align-items: center;
78 | }
79 |
80 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-img-demo #un-lg-img-demo-img {
81 | margin-top: 100px;
82 | margin-left: 40px;
83 | max-width: 80%;
84 | max-height: 80%;
85 | }
86 |
87 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit {
88 | height: 100%;
89 | padding: 26px;
90 | display: flex;
91 | flex-direction: column;
92 | }
93 |
94 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-welcome-back {
95 | font-size: 25px;
96 | font-family: 'Roboto', sans-serif !important;
97 | font-weight: 400;
98 | }
99 |
100 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-msg-extra {
101 | font-size: 10px;
102 | margin-top: 20px;
103 | font-family: 'Roboto', sans-serif !important;
104 | font-weight: 500;
105 | color: #768096;
106 | }
107 |
108 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password,
109 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login {
110 | margin-top: 20px;
111 | display: flex;
112 | width: 100%;
113 | background-color: #edf2f5;
114 | height: 42px;
115 | }
116 |
117 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password {
118 | margin-top: 0px;
119 | background-color: white;
120 | border-bottom-right-radius: 5px;
121 | border-bottom-left-radius: 5px;
122 | }
123 |
124 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login {
125 | border-top-right-radius: 5px;
126 | border-top-left-radius: 5px;
127 | }
128 |
129 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login .un-lg-gp-login-left,
130 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password .un-lg-gp-password-left {
131 | width: 42px;
132 | height: 100%;
133 | display: flex;
134 | align-items: center;
135 | justify-content: center;
136 | }
137 |
138 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login .un-lg-gp-login-right,
139 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password .un-lg-gp-password-right {
140 | width: calc(100% - 42px);
141 | height: 100%;
142 | display: flex;
143 | flex-direction: column;
144 | }
145 |
146 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password .un-lg-gp-lg-r-title,
147 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login .un-lg-gp-lg-r-title {
148 | font-family: 'Roboto', sans-serif !important;
149 | color: #a4afc9;
150 | height: 16px;
151 | font-size: 10px;
152 | margin-top: 7px;
153 | width: 100%;
154 | margin-left: 0px;
155 | }
156 |
157 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password input,
158 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login input {
159 | font-family: 'Roboto', sans-serif !important;
160 | font-size: 11px;
161 | border: none;
162 | margin-top: -8px;
163 | font-weight: 500;
164 | height: calc(100% - 16px);
165 | background-color: transparent;
166 | caret-color: #63adf9;
167 | width: 100%;
168 | margin-left: -2px;
169 | }
170 |
171 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password input:hover,
172 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password input:active,
173 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-password input:focus,
174 |
175 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login input:hover,
176 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login input:active,
177 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-gp-login input:focus {
178 | background-color: transparent;
179 | border: none;
180 | outline: none;
181 | }
182 |
183 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-rm-fp {
184 | height: 30px;
185 | width: 100%;
186 | display: flex;
187 | flex-direction: row;
188 | margin-top: 10px;
189 | }
190 |
191 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-rm-fp .un-lg-remember-me {
192 | height: 100%;
193 | width: 110px;
194 | display: flex;
195 | flex-direction: row;
196 | font-family: 'Roboto', sans-serif !important;
197 | font-size: 11px;
198 | }
199 |
200 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-rm-fp .un-lg-remember-me label {
201 | margin-top: 8px;
202 | color: #768096;
203 | }
204 |
205 | .un-lg-bg .un-lg-login .un-lg-forget-password {
206 | height: 100%;
207 | width: calc(100% - 110px);
208 | display: flex;
209 | flex-direction: row;
210 | }
211 |
212 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-rm-fp .un-lg-forget-password {
213 | display: flex;
214 | flex-direction: row;
215 | justify-content: right;
216 | }
217 |
218 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-rm-fp .un-lg-forget-password .un-lg-action-forget-password {
219 | font-family: 'Roboto', sans-serif !important;
220 | font-size: 11px;
221 | margin-top: 8px;
222 | color: #768096;
223 | }
224 |
225 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-rm-fp .un-lg-remember-me label:hover,
226 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-rm-fp .un-lg-forget-password .un-lg-action-forget-password:hover {
227 | font-family: 'Roboto', sans-serif !important;
228 | font-size: 11px;
229 | margin-top: 8px;
230 | color: #2759c5;
231 | cursor: pointer;
232 | }
233 |
234 |
235 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit .un-lg-login-now-create-account {
236 | display: flex;
237 | flex-direction: row;
238 | height: 30px;
239 | width: 100%;
240 | margin-top: 10px;
241 | }
242 |
243 | #un-lg-create-account,
244 | #un-lg-login-now {
245 | font-family: 'Roboto', sans-serif !important;
246 | font-size: 11px;
247 | border-radius: 50px;
248 | background-color: #3f89fa;
249 | border: 1 solid #3e8afa;
250 | cursor: pointer;
251 | color: #fff;
252 | height: 100%;
253 | width: 80px;
254 | display: flex;
255 | align-items: center;
256 | justify-content: center;
257 | -webkit-box-shadow: 0px 2px 13px 2px rgba(0,0,0,0.1);
258 | -moz-box-shadow: 0px 2px 13px 2px rgba(0,0,0,0.1);
259 | box-shadow: 0px 2px 13px 2px rgba(0,0,0,0.1);
260 | }
261 |
262 | #un-lg-create-account {
263 | background-color: #fff;
264 | color: #768096;
265 | -webkit-box-shadow: 0px 2px 13px 2px rgba(0,0,0,0.1);
266 | -moz-box-shadow: 0px 2px 13px 2px rgba(0,0,0,0.1);
267 | box-shadow: 0px 2px 13px 2px rgba(0,0,0,0.1);
268 | margin-left: 10px;
269 | }
270 |
271 | #un-lg-login-now:hover {
272 | background-color: #3078e4;
273 | }
274 |
275 | #un-lg-create-account:hover {
276 | background-color: #f7f7f7;
277 | }
278 |
279 | @media (min-width: 725px) {
280 | .un-lg-bg .un-lg-login {
281 | width: 724px;
282 | max-width: 100%;
283 |
284 | }
285 |
286 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-img-demo {
287 | display: block;
288 | }
289 |
290 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit {
291 | width: calc(100% - 400px);
292 | height: auto;
293 | }
294 | }
295 |
296 | @media (max-width: 724px) {
297 | .un-lg-bg .un-lg-login {
298 | width: 260px;
299 | }
300 |
301 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-img-demo {
302 | display: none;
303 | }
304 |
305 | .un-lg-bg .un-lg-login .un-lg-img-submit .un-lg-submit {
306 | width: 100%;
307 | height: auto;
308 | }
309 | }
--------------------------------------------------------------------------------
/dsa/menu_lateral/css/style.css:
--------------------------------------------------------------------------------
1 | :root{
2 | --var-ml-tamanho: 230px;
3 | --var-ml-margem: 20px;
4 | --var-ml-margem-topo: 15px;
5 | --var-ml-altura-itens: 42px;
6 | --var-uni-ml-cor-bg: #FFF;
7 | --var-uni-ml-cor-borda: #edeeef;
8 | --var-uni-ml-tam-radius: 15px;
9 | --var-uni-ml-logo-altura: 40px;
10 | --var-uni-ml-cor-icones: #141414;
11 | --var-uni-ml-tamanho-fonte-padrao: 13px;
12 | --var-uni-ml-cor-notificacao: #f42e2e;
13 | --var-uni-ml-cor-itens-fundo: #00000009; /* #f5f6f6; 00000009 */
14 | --var-uni-ml-cor-itens: #141414;
15 | --var-uni-ml-cor-texto: #141414;
16 | --var-uni-ml-cor-tema-texto: #141414;
17 | --var-uni-ml-cor-tema-texto-selecionado: #141414;
18 | --var-uni-ml-cor-icone-sair: #f42e2e;
19 | }
20 |
21 | /* Menu */
22 | .uni-ml {
23 | width: 100%;
24 | min-width: 34px;
25 | background-color: var(--var-uni-ml-cor-bg);
26 | height: 100vh;
27 | border: 2px solid var(--var-uni-ml-cor-borda);
28 | border-top-right-radius: var(--var-uni-ml-tam-radius);
29 | border-bottom-right-radius: var(--var-uni-ml-tam-radius);
30 | padding: var(--var-ml-margem);
31 | display: flex;
32 | flex-direction: column;
33 | font-family: 'Poppins', sans-serif;
34 | user-select: none;
35 | color: var(--var-uni-ml-cor-texto);
36 | }
37 |
38 | /* Logo empresa */
39 | .uni-ml .uni-ml-logo {
40 | height: var(--var-uni-ml-logo-altura);
41 | width: 100%;
42 | display: flex;
43 | flex-direction: row;
44 | align-items: center;
45 | cursor: pointer;
46 | }
47 |
48 | .uni-ml .uni-ml-logo img{
49 | height: 100%;
50 | border-radius: 50%;
51 | width: var(--var-uni-ml-logo-altura);
52 | }
53 |
54 | .uni-ml .uni-ml-logo span{
55 | margin-left: 10px;
56 | width: 100%;
57 | font-size: 20px;
58 | font-weight: 800;
59 | }
60 |
61 | /* Pesquisa */
62 | .uni-ml-pesquisa {
63 | background-color: var(--var-uni-ml-cor-itens-fundo);
64 | margin-top: 20px;
65 | width: auto;
66 | height: var(--var-ml-altura-itens);
67 | border-radius: 8px;
68 | display: flex;
69 | align-items: center;
70 | padding-right: 15px;
71 | }
72 |
73 | .uni-ml-pesquisa .uni-ml-item-icone i {
74 | color: var(--var-uni-ml-cor-icones);
75 | cursor: pointer;
76 | }
77 |
78 | .uni-ml-pesquisa #uni-ml-pesquisar {
79 | font-size: var(--var-uni-ml-tamanho-fonte-padrao);
80 | color: var(--var-uni-ml-cor-texto);
81 | opacity: 1;
82 | }
83 |
84 | .uni-ml-pesquisa #uni-ml-pesquisar::placeholder {
85 | color: var(--var-uni-ml-cor-texto);
86 | opacity: 0.6;
87 | }
88 |
89 | .uni-ml-pesquisa #uni-ml-pesquisar,
90 | .uni-ml-pesquisa #uni-ml-pesquisar:hover,
91 | .uni-ml-pesquisa #uni-ml-pesquisar:active,
92 | .uni-ml-pesquisa #uni-ml-pesquisar:focus {
93 | border: 0px solid #000;
94 | background-color: #00000000;
95 | margin-left: 15px;
96 | outline: none;
97 | width: 100%;
98 | }
99 |
100 | /* Menu */
101 | .uni-ml-scroll-menu{
102 | display: flex;
103 | flex: 1;
104 | overflow-y: auto;
105 | flex-direction: column;
106 | height: 100%;
107 | }
108 |
109 | .uni-ml-scroll-menu .uni-ml-titulo-menu {
110 | margin-top: 20px;
111 | font-weight: 100;
112 | height: 30px;
113 | font-size: var(--var-uni-ml-tamanho-fonte-padrao);
114 | }
115 |
116 | .uni-ml-scroll-menu ul {
117 | list-style-type: none;
118 | overflow: auto;
119 | padding: 0px;
120 | display: flex;
121 | flex-direction: column;
122 | }
123 |
124 | .uni-ml-scroll-menu ul li {
125 | height: var(--var-ml-altura-itens);
126 | min-height: var(--var-ml-altura-itens);
127 | width: 100%;
128 | background-color: transparent;
129 | display: flex;
130 | align-items: center;
131 | cursor: pointer;
132 | margin-top: 5px;
133 | }
134 |
135 | .uni-ml-desativado {
136 | opacity: 0.1;
137 | pointer-events: none;
138 | cursor: none;
139 | }
140 |
141 | .uni-ml-scroll-menu ul li a {
142 | text-decoration: none;
143 | width: 100%;
144 | }
145 |
146 | .uni-ml-scroll-menu ul li span {
147 | color: var(--var-uni-ml-cor-itens);
148 | margin-left: 10px;
149 | font-size: var(--var-uni-ml-tamanho-fonte-padrao) ;
150 | width: calc(100% - 76px);
151 | }
152 |
153 | .uni-ml-scroll-menu ul li:hover {
154 | background-color: var(--var-uni-ml-cor-itens-fundo);
155 | border-radius: 8px;
156 | }
157 |
158 | .uni-ml-scroll-menu ul li:target {
159 | background-color: #129696ab;
160 | border-radius: 8px;
161 | }
162 |
163 | .uni-ml-scroll-menu ul li:hover span {
164 | color: var(--var-uni-ml-cor-icones);
165 | }
166 |
167 | .uni-ml-scroll-menu ul li a {
168 | display: flex;
169 | align-items: center;
170 | flex-direction: row;
171 | margin-right: 8px;
172 | }
173 |
174 | .uni-ml-scroll-menu ul li a .uni-ml-item-icone,
175 | .uni-ml-pesquisa .uni-ml-item-icone {
176 | width: 40px;
177 | display: flex;
178 | align-items: center;
179 | justify-content: center;
180 | }
181 |
182 | .uni-ml-scroll-menu ul li a .uni-ml-item-icone i {
183 | color: var(--var-uni-ml-cor-icones);
184 | width: auto;
185 | }
186 |
187 | .uni-ml-scroll-menu ul li a .uni-ml-item-menu-notif {
188 | background-color: var(--var-uni-ml-cor-notificacao);
189 | width: 27px;
190 | height: 15px;
191 | border-radius: 8px;
192 | color: #edeeef;
193 | display: flex;
194 | flex-direction: row;
195 | align-items: center;
196 | justify-content: center;
197 | padding-top: 1px;
198 | font-size: 10px;
199 | }
200 |
201 | .fa-chevron-right {
202 | width: 20px;
203 | color: var(--var-uni-ml-cor-icones);
204 | }
205 |
206 | .uni-ml-scroll-menu .uni-ml-item-menu-divisor {
207 | background-color: var(--var-uni-ml-cor-icones);
208 | min-height: 1px;
209 | width: 100%;
210 | margin-top: 10px;
211 | opacity: 0.2;
212 | margin-bottom: 10px;
213 | }
214 |
215 | .uni-ml-scroll-menu ul li a .uni-ml-item-icone .uni-ml-item-menu-status {
216 | width: 10px;
217 | height: 10px;
218 | /* Cor status */
219 | border-radius: 100%;
220 | }
221 |
222 | .uni-ml .uni-ml-config-usuario {
223 | height: auto;
224 | margin-bottom: 0px;
225 | display: flex;
226 | flex-direction: column;
227 | }
228 |
229 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema {
230 | min-height: calc(var(--var-ml-altura-itens) + 6px);
231 | background-color: var(--var-uni-ml-cor-itens-fundo);
232 | border-radius: var(--var-uni-ml-tam-radius);
233 | display: flex;
234 | flex-direction: row;
235 | justify-content: center;
236 | align-items: center;
237 | padding: 3px;
238 | }
239 |
240 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1,
241 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 {
242 | height: 100%;
243 | background-color: #FFF;
244 | border-radius: var(--var-uni-ml-tam-radius);
245 | width: 100%;
246 | display: flex;
247 | flex-direction: row;
248 | align-items: center;
249 | justify-content: center;
250 | cursor: pointer;
251 | font-size: var(--var-uni-ml-tamanho-fonte-padrao);
252 | }
253 |
254 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1:hover,
255 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2:hover {
256 | font-weight: 600;
257 | font-size: var(--var-uni-ml-tamanho-fonte-padrao);
258 | }
259 |
260 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1 i,
261 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 i {
262 | color: var(--var-uni-ml-cor-tema-texto);
263 | pointer-events: none;
264 | }
265 |
266 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1 span,
267 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 span {
268 | margin-left: 5px;
269 | color: var(--var-uni-ml-cor-tema-texto);
270 | pointer-events: none;
271 | }
272 |
273 | .uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 {
274 | background-color: transparent;
275 | }
276 |
277 | .uni-ml .uni-ml-config-usuario .uni-ml-perfil {
278 | height: var(--var-ml-altura-itens);
279 | margin-top: 10px;
280 | display: flex;
281 | flex-direction: row;
282 | justify-items: center;
283 | align-items: center;
284 | padding-left: 5px;
285 | padding-right: 5px;
286 | }
287 |
288 | .uni-ml .uni-ml-config-usuario .uni-ml-perfil img {
289 | width: var(--var-ml-altura-itens);
290 | height: var(--var-ml-altura-itens);
291 | border-radius: 50%;
292 | cursor: pointer;
293 | }
294 |
295 | .uni-ml .uni-ml-config-usuario .uni-ml-perfil .uni-ml-perfil-desc {
296 | width: calc(100% - var(--var-ml-altura-itens) - 25px);
297 | height: var(--var-ml-altura-itens);
298 | margin-left: 10px;
299 | display: flex;
300 | flex-direction: column;
301 | justify-content: center;
302 | cursor: pointer;
303 | }
304 |
305 | .uni-ml .uni-ml-config-usuario .uni-ml-perfil .uni-ml-perfil-desc #uni-ml-perfil-nome{
306 | width: 100%;
307 | height: auto;
308 | font-size: var(--var-uni-ml-tamanho-fonte-padrao);
309 | font-weight: 600;
310 | }
311 |
312 | .uni-ml .uni-ml-config-usuario .uni-ml-perfil .uni-ml-perfil-desc #uni-ml-perfil-email{
313 | width: 100%;
314 | height: auto;
315 | font-size: calc(var(--var-uni-ml-tamanho-fonte-padrao) - 2px);
316 | }
317 |
318 | .uni-ml .uni-ml-config-usuario .uni-ml-perfil i {
319 | color: var(--var-uni-ml-cor-icones);
320 | width: 25px;
321 | cursor: pointer;
322 | display: flex;
323 | flex-direction: row;
324 | align-items: center;
325 | justify-content: center;
326 | }
327 |
328 | .uni-ml .uni-ml-config-usuario .uni-ml-perfil i:hover {
329 | color: var(--var-uni-ml-cor-icone-sair);
330 | background-color: #c4dafb28;
331 | }
332 |
--------------------------------------------------------------------------------
/sources/UniDSAQrCodeReader.pas:
--------------------------------------------------------------------------------
1 | unit UniDSAQrCodeReader;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils, System.Classes, uniGUIClasses, UniDSABaseControl, UniDSAExecuteFunction, uniGUITypes,
7 | System.TypInfo, UniDSALibrary, System.Variants, Vcl.Graphics, UniDSASource;
8 |
9 | type
10 | TUniDSAQrCodeReaderSupportedFormats = class(TPersistent)
11 | private
12 | FQR_CODE: Boolean;
13 | FAZTEC: Boolean;
14 | FCODABAR: Boolean;
15 | FCODE_39: Boolean;
16 | FCODE_93: Boolean;
17 | FCODE_128: Boolean;
18 | FDATA_MATRIX: Boolean;
19 | FMAXICODE: Boolean;
20 | FITF: Boolean;
21 | FEAN_13: Boolean;
22 | FEAN_8: Boolean;
23 | FPDF_417: Boolean;
24 | FRSS_14: Boolean;
25 | FRSS_EXPANDED: Boolean;
26 | FUPC_A: Boolean;
27 | FUPC_E: Boolean;
28 | FUPC_EAN_EXTENSION: Boolean;
29 |
30 | public
31 | constructor Create;
32 | destructor Destroy; override;
33 | published
34 | property QR_CODE: Boolean read FQR_CODE write FQR_CODE;
35 | property AZTEC: Boolean read FAZTEC write FAZTEC;
36 | property CODABAR: Boolean read FCODABAR write FCODABAR;
37 | property CODE_39: Boolean read FCODE_39 write FCODE_39;
38 | property CODE_93: Boolean read FCODE_93 write FCODE_93;
39 | property CODE_128: Boolean read FCODE_128 write FCODE_128;
40 | property DATA_MATRIX: Boolean read FDATA_MATRIX write FDATA_MATRIX;
41 | property MAXICODE: Boolean read FMAXICODE write FMAXICODE;
42 | property ITF: Boolean read FITF write FITF;
43 | property EAN_13: Boolean read FEAN_13 write FEAN_13;
44 | property EAN_8: Boolean read FEAN_8 write FEAN_8;
45 | property PDF_417: Boolean read FPDF_417 write FPDF_417;
46 | property RSS_14: Boolean read FRSS_14 write FRSS_14;
47 | property RSS_EXPANDED: Boolean read FRSS_EXPANDED write FRSS_EXPANDED;
48 | property UPC_A: Boolean read FUPC_A write FUPC_A;
49 | property UPC_E: Boolean read FUPC_E write FUPC_E;
50 | property UPC_EAN_EXTENSION: Boolean read FUPC_EAN_EXTENSION write FUPC_EAN_EXTENSION;
51 | end;
52 |
53 | TUniDSAQrCodeReader = class(TUniDSABaseControl)
54 | private
55 | FQrCodeReader: TExecuteFunction;
56 | FText: string;
57 | FSingleRead: Boolean;
58 | FOnAfterReading: TNotifyEvent;
59 | FQrBox: Integer;
60 | FFPS: Integer;
61 | FSupportedFormats: TUniDSAQrCodeReaderSupportedFormats;
62 |
63 | procedure PrepareHtml;
64 | procedure PrepareJS;
65 | procedure NovoCaption(const Value: string);
66 | protected
67 | procedure JSEventHandler(AEventName: string; AParams: TUniStrings); override;
68 | procedure ConfigJSClasses(ALoading: Boolean); override;
69 | procedure InternalSetCaption(const Value: string); override;
70 | procedure LoadCompleted; override;
71 | procedure WebCreate; override;
72 | public
73 | constructor Create(AOwner: TComponent); override;
74 | destructor Destroy; override;
75 | published
76 | procedure Stop;
77 | procedure Start;
78 | property Align;
79 | property Text: string read FText write FText;
80 | property Result: string read FText write FText;
81 | property SingleRead: Boolean read FSingleRead write FSingleRead;
82 | property QrBox: Integer read FQrBox write FQrBox;
83 | property FPS: Integer read FFPS write FFPS;
84 | property SupportedFormats: TUniDSAQrCodeReaderSupportedFormats read FSupportedFormats write FSupportedFormats;
85 | property OnAfterReading: TNotifyEvent read FOnAfterReading write FOnAfterReading;
86 | end;
87 |
88 | procedure Register;
89 |
90 | implementation
91 |
92 | { TUniDSAQrCodeReader }
93 |
94 | procedure Register;
95 | begin
96 | RegisterComponents('UniDSA', [TUniDSAQrCodeReader]);
97 | end;
98 |
99 | procedure TUniDSAQrCodeReader.JSEventHandler(AEventName: string; AParams: TUniStrings);
100 | begin
101 | inherited;
102 | if AEventName = 'UniDSAQrCodeReaderAfterReading' then begin
103 | FText := AParams.Values['Resultado'];
104 |
105 | if Assigned(FOnAfterReading) then
106 | FOnAfterReading(Self);
107 | end;
108 | end;
109 |
110 | procedure TUniDSAQrCodeReader.LoadCompleted;
111 | begin
112 | inherited;
113 | PrepareHTML;
114 | PrepareJS;
115 | end;
116 |
117 | procedure TUniDSAQrCodeReader.NovoCaption(const Value: string);
118 | begin
119 | JSProperty('html', [Caption, False], 'setText');
120 | end;
121 |
122 | procedure TUniDSAQrCodeReader.ConfigJSClasses(ALoading: Boolean);
123 | begin
124 | inherited;
125 | JSObjects.DefaultJSClassName:='Ext.form.Label';
126 | end;
127 |
128 | constructor TUniDSAQrCodeReader.Create(AOwner: TComponent);
129 | begin
130 | inherited;
131 | FText := '';
132 | FSingleRead := True;
133 | Self.Height := 100;
134 | Self.Width := 100;
135 | FQrBox := 250;
136 | FFPS := 10;
137 | FQrCodeReader := TExecuteFunction.Create('qrCodeReader');
138 | FSupportedFormats := TUniDSAQrCodeReaderSupportedFormats.Create;
139 | end;
140 |
141 | destructor TUniDSAQrCodeReader.Destroy;
142 | begin
143 | inherited;
144 | FreeAndNil(FQrCodeReader);
145 | FreeAndNil(FSupportedFormats);
146 | end;
147 |
148 | procedure TUniDSAQrCodeReader.InternalSetCaption(const Value: string);
149 | begin
150 | inherited;
151 | if not IsDesigning then
152 | begin
153 | InternalSetText(Value);
154 |
155 | if not IsLoading then
156 | NovoCaption(Value);
157 | end;
158 | end;
159 |
160 | procedure TUniDSAQrCodeReader.PrepareHtml;
161 | var
162 | LHTML: TStringBuilder;
163 | begin
164 | if WebMode then begin
165 | LHTML := TStringBuilder.Create;
166 |
167 | try
168 | with LHTML do begin
169 | Append('
');
170 |
171 | Caption := LHTML.ToString;
172 | end;
173 | finally
174 | FreeAndNil(LHTML);
175 | end;
176 | end;
177 | end;
178 |
179 | procedure TUniDSAQrCodeReader.PrepareJS;
180 | begin
181 | if WebMode then begin
182 | JSCode(
183 | '$(document).ready(function(){ ' +
184 | ' function docReady(fn) { ' +
185 | ' if (document.readyState === "complete" ' +
186 | ' || document.readyState === "interactive") { ' +
187 | ' setTimeout(fn, 1); ' +
188 | ' } else { ' +
189 | ' document.addEventListener("DOMContentLoaded", fn); ' +
190 | ' } ' +
191 | '} ' +
192 |
193 | 'const formatsToSupport = [ ' +
194 | ' ' + IIfVar(FSupportedFormats.QR_CODE, 'Html5QrcodeSupportedFormats.QR_CODE,', ' ' ) +
195 | ' ' + IIfVar(FSupportedFormats.AZTEC, 'Html5QrcodeSupportedFormats.AZTEC,', ' ' ) +
196 | ' ' + IIfVar(FSupportedFormats.CODABAR, 'Html5QrcodeSupportedFormats.CODABAR,', ' ' ) +
197 | ' ' + IIfVar(FSupportedFormats.CODE_39, 'Html5QrcodeSupportedFormats.CODE_39,', ' ' ) +
198 | ' ' + IIfVar(FSupportedFormats.CODE_93, 'Html5QrcodeSupportedFormats.CODE_93,', ' ' ) +
199 | ' ' + IIfVar(FSupportedFormats.CODE_128, 'Html5QrcodeSupportedFormats.CODE_128,', ' ' ) +
200 | ' ' + IIfVar(FSupportedFormats.DATA_MATRIX, 'Html5QrcodeSupportedFormats.DATA_MATRIX,', ' ' ) +
201 | ' ' + IIfVar(FSupportedFormats.MAXICODE, 'Html5QrcodeSupportedFormats.MAXICODE,', ' ' ) +
202 | ' ' + IIfVar(FSupportedFormats.ITF, 'Html5QrcodeSupportedFormats.ITF,', ' ' ) +
203 | ' ' + IIfVar(FSupportedFormats.EAN_13, 'Html5QrcodeSupportedFormats.EAN_13,', ' ' ) +
204 | ' ' + IIfVar(FSupportedFormats.EAN_8, 'Html5QrcodeSupportedFormats.EAN_8,', ' ' ) +
205 | ' ' + IIfVar(FSupportedFormats.PDF_417, 'Html5QrcodeSupportedFormats.PDF_417,', ' ' ) +
206 | ' ' + IIfVar(FSupportedFormats.RSS_14, 'Html5QrcodeSupportedFormats.RSS_14,', ' ' ) +
207 | ' ' + IIfVar(FSupportedFormats.RSS_EXPANDED, 'Html5QrcodeSupportedFormats.RSS_EXPANDED,', ' ' ) +
208 | ' ' + IIfVar(FSupportedFormats.UPC_A, 'Html5QrcodeSupportedFormats.UPC_A,', ' ' ) +
209 | ' ' + IIfVar(FSupportedFormats.UPC_E, 'Html5QrcodeSupportedFormats.UPC_E,', ' ' ) +
210 | ' ' + IIfVar(FSupportedFormats.UPC_EAN_EXTENSION, 'Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION,', ' ' ) +
211 | ']; ' +
212 |
213 | ' docReady(function () { ' +
214 | ' var lastResult, countResults = 0; ' +
215 | ' function onScanSuccess(decodedText, decodedResult) { ' +
216 | ' if (decodedText !== lastResult) { ' +
217 | ' ++countResults; ' +
218 | ' lastResult = decodedText; ' +
219 |
220 | ' ajaxRequest('+ Self.JSName + ', "UniDSAQrCodeReaderAfterReading", ["Resultado=" + lastResult]); ' +
221 | ' ' + IIfVar(not SingleRead, ' ', 'html5QrcodeScanner.clear(); ' ) +
222 | ' } ' +
223 | ' } ' +
224 |
225 | ' var html5QrcodeScanner = new Html5QrcodeScanner( ' +
226 | ' "uni-dsa-qrcode-reader-qr-reader-' + Self.JSName + '", { fps: ' + IntToStr(FPS) + ', qrbox: ' + IntToStr(FQrBox) + ', formatsToSupport: formatsToSupport }); ' +
227 | ' html5QrcodeScanner.render(onScanSuccess); ' +
228 | ' }); ' +
229 | '}); '
230 | );
231 | end;
232 | end;
233 |
234 | procedure TUniDSAQrCodeReader.Start;
235 | begin
236 | JS('$("#uni-dsa-qrcode-reader-qr-reader-' + Self.JSName + '").find("#html5-qrcode-button-camera-start").click();');
237 | end;
238 |
239 | procedure TUniDSAQrCodeReader.Stop;
240 | begin
241 | JS('$("#uni-dsa-qrcode-reader-qr-reader-' + Self.JSName + '").find("#html5-qrcode-button-camera-stop").click();');
242 | end;
243 |
244 | procedure TUniDSAQrCodeReader.WebCreate;
245 | begin
246 | inherited;
247 | JSCls:='x-uni-dsa-qrcode-reader';
248 | end;
249 |
250 | { TUniDSAQrCodeReaderSupportedFormats }
251 |
252 | constructor TUniDSAQrCodeReaderSupportedFormats.Create;
253 | begin
254 | FQR_CODE := True;
255 | FAZTEC := True;
256 | FCODABAR := True;
257 | FCODE_39 := True;
258 | FCODE_93 := True;
259 | FCODE_128 := True;
260 | FDATA_MATRIX := True;
261 | FMAXICODE := True;
262 | FITF := True;
263 | FEAN_13 := True;
264 | FEAN_8 := True;
265 | FPDF_417 := True;
266 | FRSS_14 := True;
267 | FRSS_EXPANDED := True;
268 | FUPC_A := True;
269 | FUPC_E := True;
270 | FUPC_EAN_EXTENSION := True;
271 | end;
272 |
273 | destructor TUniDSAQrCodeReaderSupportedFormats.Destroy;
274 | begin
275 | inherited;
276 | end;
277 |
278 | initialization
279 | UniDSASource.GetLink(TTypeUniDSASource.QrCodeReader);
280 |
281 | end.
282 |
--------------------------------------------------------------------------------
/sources/UniDSAToast.pas:
--------------------------------------------------------------------------------
1 | unit UniDSAToast;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils, System.Classes, uniGUIBaseClasses, uniGUIClasses, UniDSAExecuteFunction, UniDSALibrary,
7 | System.UITypes, uniGUITypes, System.TypInfo, Vcl.Graphics, UniDSASource, UniDSABase,
8 | UniDSAColor;
9 |
10 | type
11 | TUniDSAToastTypeTextAlign = (Left, Right, Center);
12 | TUniDSAToastTypeIcon = (Info, Error, Warning, Success);
13 | TUniDSAToastTypeHideTransition = (Slide, Fade, Plain);
14 | TUniDSAToastTypePosition = (
15 | BottomLeft,
16 | BottomRight,
17 | BottomCenter,
18 | TopRight,
19 | TopLeft,
20 | TopCenter,
21 | MidCenter,
22 | Custom
23 | );
24 |
25 | TUniDSAToastStack = class(TPersistent)
26 | private
27 | FEnabled: Boolean;
28 | FValue: Integer;
29 | published
30 | property Enabled: Boolean read FEnabled write FEnabled;
31 | property Value: Integer read FValue write FValue;
32 | end;
33 |
34 | TUniDSAToastFixedPosition = class(TPersistent)
35 | private
36 | FLeft: Integer;
37 | FTop: Integer;
38 | FRight: Integer;
39 | FBottom: Integer;
40 | published
41 | property Left: Integer read FLeft write FLeft;
42 | property Top: Integer read FTop write FTop;
43 | property Right: Integer read FRight write FRight;
44 | property Bottom: Integer read FBottom write FBottom;
45 | end;
46 |
47 | TUniDSAToastPosition = class(TPersistent)
48 | private
49 | FFPosition: TUniDSAToastTypePosition;
50 | FCustom: TUniDSAToastFixedPosition;
51 | public
52 | constructor Create;
53 | destructor Destroy; override;
54 | published
55 | property Position: TUniDSAToastTypePosition read FFPosition write FFPosition;
56 | property Custom: TUniDSAToastFixedPosition read FCustom write FCustom;
57 | end;
58 |
59 | TUniDSAToastLoader = class(TPersistent)
60 | private
61 | FEnabled: Boolean;
62 | FBackground: TColor;
63 | published
64 | property Enabled: Boolean read FEnabled write FEnabled;
65 | property Background: TColor read FBackground write FBackground;
66 | end;
67 |
68 | TUniDSAToast = class(TUniDSABaseComponent)
69 | private
70 | FToast: TExecuteFunction;
71 | FText: string;
72 | FShowHideTransition: TUniDSAToastTypeHideTransition;
73 | FHeading: string;
74 | FIcon: TUniDSAToastTypeIcon;
75 | FHideAfter: Integer;
76 | FAllowToastClose: Boolean;
77 | FStack: TUniDSAToastStack;
78 | FBgColor: TUniDSAColor;
79 | FTextColor: TUniDSAColor;
80 | FTextAlign: TUniDSAToastTypeTextAlign;
81 | FPosition: TUniDSAToastPosition;
82 | FLoader: TUniDSAToastLoader;
83 | FOnBeforeShow: TNotifyEvent;
84 | FOnAfterShown: TNotifyEvent;
85 | FOnBeforeHide: TNotifyEvent;
86 | FOnAfterHidden: TNotifyEvent;
87 | function ValueTypePosition(tipo: TUniDSAToastTypePosition): string;
88 | protected
89 | procedure AJAXEvent(var EventName: string; var Params: TUniStrings); override;
90 | public
91 | constructor Create(AOwner: TComponent); override;
92 | destructor Destroy; override;
93 | procedure Clear;
94 | procedure Reset;
95 | procedure Show;
96 | procedure Prepare;
97 | published
98 | property Text: string read FText write FText;
99 | property Heading: string read FHeading write FHeading;
100 | property Icon: TUniDSAToastTypeIcon read FIcon write FIcon;
101 | property ShowHideTransition: TUniDSAToastTypeHideTransition read FShowHideTransition write FShowHideTransition;
102 | property HideAfter: Integer read FHideAfter write FHideAfter;
103 | property AllowToastClose: Boolean read FAllowToastClose write FAllowToastClose;
104 | property Stack: TUniDSAToastStack read FStack write FStack;
105 | property BgColor: TUniDSAColor read FBgColor write FBgColor;
106 | property TextColor: TUniDSAColor read FTextColor write FTextColor;
107 | property TextAlign: TUniDSAToastTypeTextAlign read FTextAlign write FTextAlign;
108 | property Position: TUniDSAToastPosition read FPosition write FPosition;
109 | property Loader: TUniDSAToastLoader read FLoader write FLoader;
110 | property OnBeforeShow: TNotifyEvent read FOnBeforeShow write FOnBeforeShow;
111 | property OnAfterShown: TNotifyEvent read FOnAfterShown write FOnAfterShown;
112 | property OnBeforeHide: TNotifyEvent read FOnBeforeHide write FOnBeforeHide;
113 | property OnAfterHidden: TNotifyEvent read FOnAfterHidden write FOnAfterHidden;
114 | property Toast: TExecuteFunction read FToast write FToast;
115 | end;
116 |
117 | procedure Register;
118 |
119 | implementation
120 |
121 | procedure Register;
122 | begin
123 | RegisterComponents('UniDSA', [TUniDSAToast]);
124 | end;
125 |
126 | { TUniDSAToast }
127 |
128 | procedure TUniDSAToast.AJAXEvent(var EventName: string; var Params: TUniStrings);
129 | begin
130 | inherited;
131 | if EventName = 'UniDSAToastBeforeShow' then begin
132 | if Assigned(FOnBeforeShow) then
133 | FOnBeforeShow(Self);
134 | end;
135 |
136 | if EventName = 'UniDSAToastAfterShown' then begin
137 | if Assigned(FOnAfterShown) then
138 | FOnAfterShown(Self);
139 | end;
140 |
141 | if EventName = 'UniDSAToastBeforeHide' then begin
142 | if Assigned(FOnBeforeHide) then
143 | FOnBeforeHide(Self);
144 | end;
145 |
146 | if EventName = 'UniDSAToastAfterHidden' then begin
147 | if Assigned(FOnAfterHidden) then
148 | FOnAfterHidden(Self);
149 | end;
150 | end;
151 |
152 | procedure TUniDSAToast.Clear;
153 | begin
154 | Reset;
155 | end;
156 |
157 | constructor TUniDSAToast.Create(AOwner: TComponent);
158 | begin
159 | inherited Create(AOwner);
160 | FStack := TUniDSAToastStack.Create;
161 | FPosition := TUniDSAToastPosition.Create;
162 | FLoader := TUniDSAToastLoader.Create;
163 | FToast := TExecuteFunction.Create('toast');
164 | FBgColor := TUniDSAColor.Create;
165 | FTextColor := TUniDSAColor.Create;
166 |
167 | Reset;
168 | end;
169 |
170 | destructor TUniDSAToast.Destroy;
171 | begin
172 | inherited Destroy;
173 | FreeAndNil(FStack);
174 | FreeAndNil(FPosition);
175 | FreeAndNil(FLoader);
176 | FreeAndNil(FToast);
177 | FreeAndNil(FBgColor);
178 | FreeAndNil(FTextColor);
179 | end;
180 |
181 | procedure TUniDSAToast.Prepare;
182 | begin
183 | with FToast do begin
184 | Clear;
185 |
186 | Add('text', FText, True, True, True);
187 | Add('heading', FHeading, FHeading <> '', True, True);
188 | Add('showHideTransition', GetEnumName(TypeInfo(TUniDSAToastTypeHideTransition), Integer(FShowHideTransition)));
189 | Add('icon', AnsiLowerCase(GetEnumName(TypeInfo(TUniDSAToastTypeIcon), Integer(FIcon))));
190 | Add('hideAfter', FHideAfter);
191 | Add('allowToastClose', FAllowToastClose);
192 |
193 | if FStack.FEnabled then
194 | Add('stack', FStack.FValue)
195 | else
196 | Add('stack', FStack.FEnabled);
197 |
198 | Add('bgColor', ColorToHex(FBgColor.Color), FBgColor.Enabled);
199 |
200 | Add('loader', FLoader.Enabled);
201 | Add('loaderBg', ColorToHex(FLoader.Background), (FLoader.Enabled) and (FLoader.FBackground <> clAqua));
202 | Add('textColor', ColorToHex(FTextColor.Color), FTextColor.Enabled);
203 | Add('textAlign', AnsiLowerCase(GetEnumName(TypeInfo(TUniDSAToastTypeTextAlign), Integer(FTextAlign))));
204 |
205 | if FPosition.FFPosition = TUniDSAToastTypePosition.Custom then begin
206 | Add(
207 | 'position',
208 | '{ ' +
209 | ' left: ' + IIfStr(FPosition.FCustom.FLeft = 0, QuotedStr('auto'), IntToStr(FPosition.FCustom.FLeft)) + ', ' +
210 | ' right: ' + IIfStr(FPosition.FCustom.FRight = 0, QuotedStr('auto'), IntToStr(FPosition.FCustom.FRight)) + ', ' +
211 | ' top: ' + IIfStr(FPosition.FCustom.FTop = 0, QuotedStr('auto'), IntToStr(FPosition.FCustom.FTop)) + ', ' +
212 | ' bottom: ' + IIfStr(FPosition.FCustom.FBottom = 0, QuotedStr('auto'), IntToStr(FPosition.FCustom.FBottom)) +
213 | '} ',
214 | True,
215 | False
216 | );
217 | end
218 | else
219 | Add('position', ValueTypePosition(FPosition.FFPosition));
220 |
221 | Add(
222 | 'beforeShow',
223 | AjaxRequest('UniDSAToastBeforeShow'),
224 | Assigned(FOnBeforeShow),
225 | False
226 | );
227 |
228 | Add(
229 | 'afterShown',
230 | AjaxRequest('UniDSAToastAfterShown'),
231 | Assigned(FOnAfterShown),
232 | False
233 | );
234 |
235 | Add(
236 | 'beforeHide',
237 | AjaxRequest('UniDSAToastBeforeHide'),
238 | Assigned(FOnBeforeHide),
239 | False
240 | );
241 |
242 | Add(
243 | 'afterHidden',
244 | AjaxRequest('UniDSAToastAfterHidden'),
245 | Assigned(FOnAfterHidden),
246 | False
247 | );
248 | end;
249 | end;
250 |
251 | procedure TUniDSAToast.Reset;
252 | begin
253 | FText := '';
254 | FShowHideTransition := TUniDSAToastTypeHideTransition.Fade;
255 | FHeading := '';
256 | FIcon := TUniDSAToastTypeIcon.Success;
257 | FHideAfter := 3000;
258 | FAllowToastClose := True;
259 | FStack.FEnabled := True;
260 | FStack.FValue := 5;
261 | FTextAlign := TUniDSAToastTypeTextAlign.Left;
262 | FPosition.FFPosition := TUniDSAToastTypePosition.BottomLeft;
263 | FLoader.Enabled := True;
264 | FLoader.Background := clAqua;
265 | end;
266 |
267 | procedure TUniDSAToast.Show;
268 | begin
269 | Prepare;
270 | FToast.Execute;
271 | end;
272 |
273 | function TUniDSAToast.ValueTypePosition(tipo: TUniDSAToastTypePosition): string;
274 | begin
275 | if tipo = TUniDSAToastTypePosition.BottomLeft then
276 | Result := 'bottom-left'
277 | else if tipo = TUniDSAToastTypePosition.BottomRight then
278 | Result := 'bottom-right'
279 | else if tipo = TUniDSAToastTypePosition.BottomCenter then
280 | Result := 'bottom-center'
281 | else if tipo = TUniDSAToastTypePosition.TopRight then
282 | Result := 'top-right'
283 | else if tipo = TUniDSAToastTypePosition.TopLeft then
284 | Result := 'top-left'
285 | else if tipo = TUniDSAToastTypePosition.TopCenter then
286 | Result := 'top-center'
287 | else if tipo = TUniDSAToastTypePosition.MidCenter then
288 | Result := 'mid-center'
289 | else if tipo = TUniDSAToastTypePosition.Custom then
290 | Result := 'custom';
291 | end;
292 |
293 | { TUniDSAToastPosition }
294 |
295 | constructor TUniDSAToastPosition.Create;
296 | begin
297 | FCustom := TUniDSAToastFixedPosition.Create;
298 | end;
299 |
300 | destructor TUniDSAToastPosition.Destroy;
301 | begin
302 | FreeAndNil(FCustom);
303 | end;
304 |
305 | initialization
306 | UniDSASource.GetLink(TTypeUniDSASource.Toast);
307 |
308 | end.
309 |
--------------------------------------------------------------------------------
/sources/UniDSAControl.pas:
--------------------------------------------------------------------------------
1 | unit UniDSAControl;
2 |
3 | interface
4 |
5 | uses
6 | System.Classes, UniDSABaseControl;
7 |
8 | type
9 | TUniDSAButton = class(TPersistent)
10 | private
11 | FParent: TUniDSABaseControl;
12 | FId: string;
13 | FVisible: Boolean;
14 | FCaption: string;
15 | FWidth: Integer;
16 | function GetVisible: Boolean;
17 | procedure SetVisible(const Value: Boolean);
18 | function GetCaption: string;
19 | procedure SetCaption(const Value: string);
20 | function GetWidth: Integer;
21 | procedure SetWidth(const Value: Integer);
22 | public
23 | constructor Create(
24 | AParentMenu: TUniDSABaseControl;
25 | AId: string;
26 | ACaption: string;
27 | AVisible: Boolean;
28 | AWidth: Integer // -1 igual a auto
29 | );
30 | destructor Destroy; override;
31 | procedure Refresh;
32 | published
33 | property Visible: Boolean read GetVisible write SetVisible;
34 | property Caption: string read GetCaption write SetCaption;
35 | property Width: Integer read GetWidth write SetWidth;
36 | procedure SetFocus;
37 | end;
38 |
39 | TUniDSAButtonText = class(TPersistent)
40 | private
41 | FId: string;
42 | FCk: string;
43 | FVisible: Boolean;
44 | FCaption: string;
45 | function GetVisible: Boolean;
46 | procedure SetVisible(const Value: Boolean);
47 | function GetCaption: string;
48 | procedure SetCaption(const Value: string);
49 | public
50 | constructor Create(
51 | AParentMenu: TUniDSABaseControl;
52 | AId: string;
53 | ACk: string;
54 | ACaption: string;
55 | AVisible: Boolean
56 | );
57 | destructor Destroy; override;
58 | procedure Refresh;
59 | protected
60 | FParent: TUniDSABaseControl;
61 | published
62 | property Visible: Boolean read GetVisible write SetVisible;
63 | property Caption: string read GetCaption write SetCaption;
64 | end;
65 |
66 | TUniDSACheckBox = class(TUniDSAButtonText)
67 | private
68 | FChecked: Boolean;
69 |
70 | function GetChecked: Boolean;
71 | procedure SetChecked(const Value: Boolean);
72 | public
73 | constructor Create(
74 | AParentMenu: TUniDSABaseControl;
75 | AId: string;
76 | ACk: string;
77 | ACaption: string;
78 | AVisible: Boolean
79 | );
80 | destructor Destroy; override;
81 | published
82 | procedure SetVarChecked(AValue: Boolean);
83 | property Checked: Boolean read GetChecked write SetChecked;
84 | end;
85 |
86 | TUniDSAInput = class(TPersistent)
87 | private
88 | FParent: TUniDSABaseControl;
89 | FId: string;
90 | FIdCaption: string;
91 | FValue: string;
92 | FCaption: string;
93 | FEnabled: Boolean;
94 | function GetCaption: string;
95 | procedure SetCaption(const Value: string);
96 | function GetValue: string;
97 | procedure SetValue(const Value: string);
98 | function GetEnabled: Boolean;
99 | procedure SetEnabled(const Value: Boolean);
100 | public
101 | constructor Create(
102 | AParentMenu: TUniDSABaseControl;
103 | AId: string;
104 | AIdCaption: string;
105 | ACaption: string;
106 | AValue: string
107 | );
108 | destructor Destroy; override;
109 | procedure Refresh;
110 | published
111 | property Caption: string read GetCaption write SetCaption;
112 | property Value: string read GetValue write SetValue;
113 | property Enabled: Boolean read GetEnabled write SetEnabled;
114 | procedure Clear;
115 | procedure SetFocus;
116 | end;
117 |
118 | TUniDSALoginImage = class(TPersistent)
119 | private
120 | FParent: TUniDSABaseControl;
121 | FImage: string;
122 | FMarginTop: Integer;
123 | FMarginLeft: Integer;
124 | FId: string;
125 | function GetImage: string;
126 | procedure SetImage(const Value: string);
127 | function GetMarginTop: Integer;
128 | procedure SetMarginTop(const Value: Integer);
129 | function GetMarginLeft: Integer;
130 | procedure SetMarginLeft(const Value: Integer);
131 | public
132 | constructor Create(
133 | AParentMenu: TUniDSABaseControl;
134 | AId: string;
135 | AImage: string;
136 | AMarginTop: Integer;
137 | AMarginLeft: Integer
138 | );
139 | destructor Destroy; override;
140 | procedure Refresh;
141 | published
142 | property Image: string read GetImage write SetImage;
143 | property MarginTop: Integer read GetMarginTop write SetMarginTop;
144 | property MarginLeft: Integer read GetMarginLeft write SetMarginLeft;
145 | end;
146 |
147 | implementation
148 |
149 | { TUniDSAButton }
150 |
151 | constructor TUniDSAButton.Create(
152 | AParentMenu: TUniDSABaseControl;
153 | AId: string;
154 | ACaption: string;
155 | AVisible: Boolean;
156 | AWidth: Integer // -1 igual a auto
157 | );
158 | begin
159 | FParent := AParentMenu;
160 | FId := AId;
161 | FVisible := AVisible;
162 | FWidth := AWidth;
163 | FCaption := ACaption;
164 | end;
165 |
166 | destructor TUniDSAButton.Destroy;
167 | begin
168 | inherited;
169 | end;
170 |
171 | function TUniDSAButton.GetCaption: string;
172 | begin
173 | Result := FCaption;
174 | end;
175 |
176 | function TUniDSAButton.GetVisible: Boolean;
177 | begin
178 | Result := FVisible;
179 | end;
180 |
181 | function TUniDSAButton.GetWidth: Integer;
182 | begin
183 | Result := FWidth;
184 | end;
185 |
186 | procedure TUniDSAButton.Refresh;
187 | begin
188 | Visible := Visible;
189 | Caption := Caption;
190 | Width := Width;
191 | end;
192 |
193 | procedure TUniDSAButton.SetCaption(const Value: string);
194 | begin
195 | if Assigned(FParent) then
196 | FParent.JQueryText(FId, Value);
197 |
198 | FCaption := Value;
199 | end;
200 |
201 | procedure TUniDSAButton.SetFocus;
202 | begin
203 | if Assigned(FParent) then
204 | FParent.JQueryFocus(FId);
205 | end;
206 |
207 | procedure TUniDSAButton.SetVisible(const Value: Boolean);
208 | begin
209 | if Assigned(FParent) then begin
210 | if Value then
211 | FParent.JQueryShow(FId)
212 | else
213 | FParent.JQueryHide(FId);
214 | end;
215 |
216 | FVisible := Value;
217 | end;
218 |
219 | procedure TUniDSAButton.SetWidth(const Value: Integer);
220 | begin
221 | if Assigned(FParent) then begin
222 | if Value = -1 then
223 | FParent.JqueryWidth(FId, 'auto')
224 | else
225 | FParent.JqueryWidth(FId, Value);
226 | end;
227 |
228 | FWidth := Value;
229 | end;
230 |
231 | { TUniDSALoginButtonText }
232 |
233 | constructor TUniDSAButtonText.Create(
234 | AParentMenu: TUniDSABaseControl;
235 | AId: string;
236 | ACk: string;
237 | ACaption: string;
238 | AVisible: Boolean
239 | );
240 | begin
241 | FParent := AParentMenu;
242 | FVisible := AVisible;
243 | FCaption := ACaption;
244 | FId := AId;
245 | FCk := ACk;
246 | end;
247 |
248 | destructor TUniDSAButtonText.Destroy;
249 | begin
250 | inherited;
251 | end;
252 |
253 | function TUniDSAButtonText.GetCaption: string;
254 | begin
255 | Result := FCaption;
256 | end;
257 |
258 | function TUniDSAButtonText.GetVisible: Boolean;
259 | begin
260 | Result := FVisible;
261 | end;
262 |
263 | procedure TUniDSAButtonText.Refresh;
264 | begin
265 | Visible := Visible;
266 | Caption := Caption;
267 | end;
268 |
269 | procedure TUniDSAButtonText.SetCaption(const Value: string);
270 | begin
271 | if Assigned(FParent) then
272 | FParent.JQueryText(FId, Value);
273 |
274 | FCaption := Value;
275 | end;
276 |
277 | procedure TUniDSAButtonText.SetVisible(const Value: Boolean);
278 | begin
279 | if Assigned(FParent) then begin
280 | if Value then begin
281 | FParent.JQueryShow(FId);
282 |
283 | if FCk <> '' then
284 | FParent.JQueryShow(FCk);
285 | end
286 | else begin
287 | FParent.JQueryHide(FId);
288 |
289 | if FCk <> '' then
290 | FParent.JQueryHide(FCk);
291 | end;
292 | end;
293 |
294 | FVisible := Value;
295 | end;
296 |
297 | { TUniDSAInput }
298 |
299 | procedure TUniDSAInput.Clear;
300 | begin
301 | Value := '';
302 | end;
303 |
304 | constructor TUniDSAInput.Create(
305 | AParentMenu: TUniDSABaseControl;
306 | AId: string;
307 | AIdCaption: string;
308 | ACaption: string;
309 | AValue: string
310 | );
311 | begin
312 | FParent := AParentMenu;
313 | FId := AId;
314 | FIdCaption := AIdCaption;
315 | FCaption := ACaption;
316 |
317 | end;
318 |
319 | destructor TUniDSAInput.Destroy;
320 | begin
321 | inherited;
322 | end;
323 |
324 | function TUniDSAInput.GetCaption: string;
325 | begin
326 | Result := FCaption;
327 | end;
328 |
329 | function TUniDSAInput.GetEnabled: Boolean;
330 | begin
331 | Result := FEnabled;
332 | end;
333 |
334 | function TUniDSAInput.GetValue: string;
335 | begin
336 | Result := FValue;
337 | end;
338 |
339 | procedure TUniDSAInput.Refresh;
340 | begin
341 | Caption := Caption;
342 | Value := Value;
343 | end;
344 |
345 | procedure TUniDSAInput.SetCaption(const Value: string);
346 | begin
347 | if Assigned(FParent) then
348 | FParent.JQueryText(FIdCaption, Value);
349 |
350 | FCaption := Value;
351 | end;
352 |
353 | procedure TUniDSAInput.SetEnabled(const Value: Boolean);
354 | begin
355 | if Assigned(FParent) then
356 | FParent.JQueryDisabled(FId, not Value);
357 |
358 | FEnabled := Value;
359 | end;
360 |
361 | procedure TUniDSAInput.SetFocus;
362 | begin
363 | if Assigned(FParent) then
364 | FParent.JQueryFocus(FId);
365 | end;
366 |
367 | procedure TUniDSAInput.SetValue(const Value: string);
368 | begin
369 | if Assigned(FParent) then
370 | FParent.JQueryVal(FId, Value);
371 |
372 | FValue := Value;
373 | end;
374 |
375 | { TUniDSALoginImage }
376 |
377 | constructor TUniDSALoginImage.Create(
378 | AParentMenu: TUniDSABaseControl;
379 | AId: string;
380 | AImage: string;
381 | AMarginTop: Integer;
382 | AMarginLeft: Integer
383 | );
384 | begin
385 | FParent := AParentMenu;
386 | FId := AId;
387 | FImage := AImage;
388 | FMarginTop := AMarginTop;
389 | FMarginLeft := AMarginLeft;
390 | end;
391 |
392 | destructor TUniDSALoginImage.Destroy;
393 | begin
394 | inherited;
395 | end;
396 |
397 | function TUniDSALoginImage.GetImage: string;
398 | begin
399 | Result := FImage;
400 | end;
401 |
402 | function TUniDSALoginImage.GetMarginLeft: Integer;
403 | begin
404 | Result := FMarginLeft;
405 | end;
406 |
407 | function TUniDSALoginImage.GetMarginTop: Integer;
408 | begin
409 | Result := FMarginTop;
410 | end;
411 |
412 | procedure TUniDSALoginImage.Refresh;
413 | begin
414 | Image := Image;
415 | MarginTop := MarginTop;
416 | MarginLeft := MarginLeft;
417 | end;
418 |
419 | procedure TUniDSALoginImage.SetImage(const Value: string);
420 | begin
421 | if Assigned(FParent) then
422 | FParent.JQuerySrc(FId, Value);
423 |
424 | FImage := Value;
425 | end;
426 |
427 | procedure TUniDSALoginImage.SetMarginLeft(const Value: Integer);
428 | begin
429 | if Assigned(FParent) then
430 | FParent.JQueryMarginLeft(FId, Value);
431 |
432 | FMarginLeft:= Value;
433 | end;
434 |
435 | procedure TUniDSALoginImage.SetMarginTop(const Value: Integer);
436 | begin
437 | if Assigned(FParent) then
438 | FParent.JQueryMarginTop(FId, Value);
439 |
440 | FMarginTop := Value;
441 | end;
442 |
443 |
444 | { TUniDSACheckBox }
445 |
446 | constructor TUniDSACheckBox.Create(AParentMenu: TUniDSABaseControl; AId, ACk, ACaption: string; AVisible: Boolean);
447 | begin
448 | inherited Create(AParentMenu, AId, ACk, ACaption, AVisible);
449 | FChecked := False;
450 | end;
451 |
452 | destructor TUniDSACheckBox.Destroy;
453 | begin
454 | inherited;
455 | end;
456 |
457 | function TUniDSACheckBox.GetChecked: Boolean;
458 | begin
459 | Result := FChecked;
460 | end;
461 |
462 | procedure TUniDSACheckBox.SetChecked(const Value: Boolean);
463 | begin
464 | if Assigned(FParent) then
465 | FParent.JQueryChecked(FCk, Value);
466 |
467 | FChecked := Value;
468 | end;
469 |
470 | procedure TUniDSACheckBox.SetVarChecked(AValue: Boolean);
471 | begin
472 | FChecked := AValue;
473 | end;
474 |
475 | end.
476 |
--------------------------------------------------------------------------------
/dsa/menu_lateral/js/script.js:
--------------------------------------------------------------------------------
1 | var LUniDSAMenuLateralTamanhoMenuNormal = 250;
2 | var LUniDSAMenuLateralTamanhoMenuMinimizado = 34;
3 | var LUniDSAMenuLateralManterPosicaoMimizado = 'S';
4 | var LUniDSAMenuLateralMinimizado = 'N';
5 | var LUniDSAMenuLateralTema = 'T1';
6 |
7 | var LUniDSAMenuLateralCorFundo1 = "#FFF";
8 | var LUniDSAMenuLateralCorBordaFundo1 = "#edeeef";
9 | var LUniDSAMenuLateralCorIcones1 = "#141414";
10 | var LUniDSAMenuLateralCorItensFundo1 = "#00000009";
11 | var LUniDSAMenuLateralCorItens1 = "#141414";
12 | var LUniDSAMenuLateralCorTexto1 = "#141414";
13 | var LUniDSAMenuLateralCorTemaTextoSelecionado1 = "#141414";
14 | var LUniDSAMenuLateralCorIconesHoverSair1 = "#f42e2e";
15 | var LUniDSAMenuLateralCorFundoNotificacoes1 = '#F42E2E';
16 |
17 | var LUniDSAMenuLateralCorFundo2 = "#1C1C1C"; // Fundo escuro
18 | var LUniDSAMenuLateralCorBordaFundo2 = "#2D2D2D"; // Borda de fundo escuro
19 | var LUniDSAMenuLateralCorIcones2 = "#FFFFFF"; // Ícones em branco
20 | var LUniDSAMenuLateralCorItensFundo2 = "#FFFFFF09"; // Fundo dos itens com transparência
21 | var LUniDSAMenuLateralCorItens2 = "#FFFFFF"; // Texto dos itens em branco
22 | var LUniDSAMenuLateralCorTexto2 = "#FFFFFF"; // Texto geral em branco
23 | var LUniDSAMenuLateralCorTemaTextoSelecionado2 = "#FFFFFF"; // Texto selecionado em branco
24 | var LUniDSAMenuLateralCorIconesHoverSair2 = "#F42E2E"; // Ícones de hover (pode permanecer a mesma cor)
25 | var LUniDSAMenuLateralCorFundoNotificacoes2 = '#F42E2E';
26 |
27 |
28 | function AlterarTema() {
29 | if (LUniDSAMenuLateralTema == 'T2') {
30 | $(".uni-ml-config-usuario-tema-1").css("background-color", "transparent");
31 | $(".uni-ml-config-usuario-tema-2").css("background-color", "#FFF");
32 |
33 | $(".uni-ml-config-usuario-tema-2 span").css("color", "var(--var-uni-ml-cor-tema-texto)");
34 | $(".uni-ml-config-usuario-tema-1 span").css("color", "var(--var-uni-ml-cor-tema-texto-selecionado)");
35 |
36 | $(".uni-ml-config-usuario-tema-2 i").css("color", "var(--var-uni-ml-cor-tema-texto)");
37 | $(".uni-ml-config-usuario-tema-1 i").css("color", "var(--var-uni-ml-cor-tema-texto-selecionado)");
38 | } else {
39 | $(".uni-ml-config-usuario-tema-2").css("background-color", "transparent");
40 | $(".uni-ml-config-usuario-tema-1").css("background-color", "#FFF");
41 |
42 | $(".uni-ml-config-usuario-tema-1 span").css("color", "var(--var-uni-ml-cor-tema-texto)");
43 | $(".uni-ml-config-usuario-tema-2 span").css("color", "var(--var-uni-ml-cor-tema-texto-selecionado)");
44 |
45 | $(".uni-ml-config-usuario-tema-1 i").css("color", "var(--var-uni-ml-cor-tema-texto)");
46 | $(".uni-ml-config-usuario-tema-2 i").css("color", "var(--var-uni-ml-cor-tema-texto-selecionado)");
47 | };
48 | };
49 |
50 | function ConfigurarCorTema(
51 | LUniDSAMenuLateralTema,
52 | LUniDSAMenuLateralCorFundo,
53 | LUniDSAMenuLateralCorBordaFundo,
54 | LUniDSAMenuLateralCorIcones,
55 | LUniDSAMenuLateralCorItensFundo,
56 | LUniDSAMenuLateralCorItens,
57 | LUniDSAMenuLateralCorTexto,
58 | LUniDSAMenuLateralCorTemaTextoSelecionado,
59 | LUniDSAMenuLateralCorIconesHoverSair,
60 | LUniDSAMenuLateralCorFundoNotificacoes
61 | ) {
62 | if (LUniDSAMenuLateralTema == 'T1') {
63 | LUniDSAMenuLateralCorFundo1 = LUniDSAMenuLateralCorFundo;
64 | LUniDSAMenuLateralCorBordaFundo1 = LUniDSAMenuLateralCorBordaFundo;
65 | LUniDSAMenuLateralCorIcones1 = LUniDSAMenuLateralCorIcones;
66 | LUniDSAMenuLateralCorItensFundo1 = LUniDSAMenuLateralCorItensFundo;
67 | LUniDSAMenuLateralCorItens1 = LUniDSAMenuLateralCorItens;
68 | LUniDSAMenuLateralCorTexto1 = LUniDSAMenuLateralCorTexto;
69 | LUniDSAMenuLateralCorTemaTextoSelecionado1 = LUniDSAMenuLateralCorTemaTextoSelecionado;
70 | LUniDSAMenuLateralCorIconesHoverSair1 = LUniDSAMenuLateralCorIconesHoverSair;
71 | LUniDSAMenuLateralCorFundoNotificacoes1 = LUniDSAMenuLateralCorFundoNotificacoes;
72 | } else {
73 | LUniDSAMenuLateralCorFundo2 = LUniDSAMenuLateralCorFundo;
74 | LUniDSAMenuLateralCorBordaFundo2 = LUniDSAMenuLateralCorBordaFundo;
75 | LUniDSAMenuLateralCorIcones2 = LUniDSAMenuLateralCorIcones;
76 | LUniDSAMenuLateralCorItensFundo2 = LUniDSAMenuLateralCorItensFundo;
77 | LUniDSAMenuLateralCorItens2 = LUniDSAMenuLateralCorItens;
78 | LUniDSAMenuLateralCorTexto2 = LUniDSAMenuLateralCorTexto;
79 | LUniDSAMenuLateralCorTemaTextoSelecionado2 = LUniDSAMenuLateralCorTemaTextoSelecionado;
80 | LUniDSAMenuLateralCorIconesHoverSair2 = LUniDSAMenuLateralCorIconesHoverSair;
81 | LUniDSAMenuLateralCorFundoNotificacoes2 = LUniDSAMenuLateralCorFundoNotificacoes;
82 | }
83 |
84 | AlterarTema();
85 | };
86 |
87 | function DefinirCorTema(
88 | LUniDSAMenuLateralCorFundo,
89 | LUniDSAMenuLateralCorBordaFundo,
90 | LUniDSAMenuLateralCorIcones,
91 | LUniDSAMenuLateralCorItensFundo,
92 | LUniDSAMenuLateralCorItens,
93 | LUniDSAMenuLateralCorTexto,
94 | LUniDSAMenuLateralCorTemaTextoSelecionado,
95 | LUniDSAMenuLateralCorIconesHoverSair,
96 | LUniDSAMenuLateralCorFundoNotificacoes
97 | ) {
98 | var root = document.querySelector(":root");
99 |
100 | root.style.setProperty("--var-uni-ml-cor-bg", LUniDSAMenuLateralCorFundo);
101 | root.style.setProperty("--var-uni-ml-cor-icones", LUniDSAMenuLateralCorIcones);
102 | root.style.setProperty("--var-uni-ml-cor-itens-fundo", LUniDSAMenuLateralCorItensFundo);
103 | root.style.setProperty("--var-uni-ml-cor-itens", LUniDSAMenuLateralCorItens);
104 | root.style.setProperty("--var-uni-ml-cor-texto", LUniDSAMenuLateralCorTexto);
105 | root.style.setProperty("--var-uni-ml-cor-tema-texto-selecionado", LUniDSAMenuLateralCorTemaTextoSelecionado);
106 | root.style.setProperty("--var-uni-ml-cor-icone-sair", LUniDSAMenuLateralCorIconesHoverSair);
107 | root.style.setProperty("--var-uni-ml-cor-borda", LUniDSAMenuLateralCorBordaFundo);
108 | root.style.setProperty("--var-uni-ml-cor-notificacao", LUniDSAMenuLateralCorFundoNotificacoes);
109 |
110 | AlterarTema();
111 | };
112 |
113 | function Tema1() {
114 | LUniDSAMenuLateralTema = 'T1';
115 |
116 | DefinirCorTema(
117 | LUniDSAMenuLateralCorFundo1,
118 | LUniDSAMenuLateralCorBordaFundo1,
119 | LUniDSAMenuLateralCorIcones1,
120 | LUniDSAMenuLateralCorItensFundo1,
121 | LUniDSAMenuLateralCorItens1,
122 | LUniDSAMenuLateralCorTexto1,
123 | LUniDSAMenuLateralCorTemaTextoSelecionado1,
124 | LUniDSAMenuLateralCorIconesHoverSair1,
125 | LUniDSAMenuLateralCorFundoNotificacoes1
126 | );
127 | };
128 |
129 | function Tema2() {
130 | LUniDSAMenuLateralTema = 'T2';
131 |
132 | DefinirCorTema(
133 | LUniDSAMenuLateralCorFundo2,
134 | LUniDSAMenuLateralCorBordaFundo2,
135 | LUniDSAMenuLateralCorIcones2,
136 | LUniDSAMenuLateralCorItensFundo2,
137 | LUniDSAMenuLateralCorItens2,
138 | LUniDSAMenuLateralCorTexto2,
139 | LUniDSAMenuLateralCorTemaTextoSelecionado2,
140 | LUniDSAMenuLateralCorIconesHoverSair2,
141 | LUniDSAMenuLateralCorFundoNotificacoes2
142 | );
143 | };
144 |
145 | function MenuLateralMinimizado() {
146 | LUniDSAMenuLateralMinimizado = 'S';
147 |
148 | document.documentElement.style.setProperty('--var-ml-tamanho', LUniDSAMenuLateralTamanhoMenuMinimizado + 'px');
149 | $("#uni-ml-logo-nome-empresa").hide();
150 | $("#uni-ml-pesquisar").hide();
151 | $(".uni-ml-pesquisa").css("padding-right", "0");
152 | $(".uni-ml-scroll-menu ul li span").hide();
153 | $(".uni-ml-scroll-menu ul li a").css("margin-right", "0");
154 | $(".uni-ml-scroll-menu").css("overflow-y", "hidden");
155 | $(".uni-ml-scroll-menu ul").css("overflow-y", "hidden");
156 |
157 | if (LUniDSAMenuLateralManterPosicaoMimizado == 'S') {
158 | $(".uni-ml-scroll-menu .uni-ml-titulo-menu").css("visibility", "hidden");
159 | $(".uni-ml-scroll-menu .uni-ml-titulo-menu").show();
160 | } else {
161 | $(".uni-ml-scroll-menu .uni-ml-titulo-menu").css("visibility", "visible");
162 | $(".uni-ml-scroll-menu .uni-ml-titulo-menu").hide();
163 | };
164 |
165 | $("#uni-ml-item-menu-notif").css("position", "absolute");
166 | $("#uni-ml-item-menu-notif").css("margin-top", "20px");
167 | $("#uni-ml-item-menu-notif").css("margin-left", "18px");
168 | $("#uni-ml-item-menu-notif").css("border-radius", "50px");
169 | $("#uni-ml-item-menu-notif").css("width", "18px");
170 |
171 | $(".fa-chevron-right").hide();
172 |
173 | $(".uni-ml-config-usuario-tema").css("flex-direction", "column");
174 | $(".uni-ml-config-usuario-tema").css("min-height", "calc(var(--var-ml-altura-itens) + var(--var-ml-altura-itens))");
175 |
176 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1 span").hide();
177 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 span").hide();
178 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1 i").css("height", "min-height: var(--var-ml-altura-itens)");
179 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 i").css("height", "min-height: var(--var-ml-altura-itens)");
180 |
181 | $(".uni-ml-perfil-desc").hide();
182 | $(".uni-ml-perfil i").hide();
183 |
184 | $(".uni-ml .uni-ml-config-usuario .uni-ml-perfil img").css("height", "24px");
185 | };
186 |
187 | function MenuLateralMaximizado() {
188 | LUniDSAMenuLateralMinimizado = 'N';
189 |
190 | document.documentElement.style.setProperty('--var-ml-tamanho', LUniDSAMenuLateralTamanhoMenuNormal + 'px');
191 | $("#uni-ml-logo-nome-empresa").show();
192 | $("#uni-ml-pesquisar").show();
193 | $(".uni-ml-pesquisa").css("padding-right", "15px");
194 | $(".uni-ml-scroll-menu ul li span").show();
195 | $(".uni-ml-scroll-menu .uni-ml-titulo-menu").show();
196 | $(".uni-ml-scroll-menu .uni-ml-titulo-menu").css("visibility", "visible");
197 | $(".uni-ml-scroll-menu .uni-ml-titulo-menu").show();
198 | $(".uni-ml-scroll-menu ul li a").css("margin-right", "8px");
199 | $(".uni-ml-scroll-menu").css("overflow-y", "auto");
200 | $(".uni-ml-scroll-menu ul").css("overflow-y", "auto");
201 |
202 | $("#uni-ml-item-menu-notif").css("position", "");
203 | $("#uni-ml-item-menu-notif").css("margin-top", "");
204 | $("#uni-ml-item-menu-notif").css("margin-left", "");
205 | $("#uni-ml-item-menu-notif").css("border-radius", "8px");
206 | $("#uni-ml-item-menu-notif").css("width", "30px");
207 |
208 | $(".fa-chevron-right").show();
209 |
210 | $(".uni-ml-config-usuario-tema").css("flex-direction", "row");
211 | $(".uni-ml-config-usuario-tema").css("min-height", "var(--var-ml-altura-itens)");
212 |
213 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1 span").show();
214 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 span").show();
215 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-1 i").css("height", "");
216 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema .uni-ml-config-usuario-tema-2 i").css("height", "");
217 | $(".uni-ml .uni-ml-config-usuario .uni-ml-config-usuario-tema").css("height", "calc(var(--var-ml-altura-itens) + 6px)");
218 |
219 | $(".uni-ml-perfil-desc").show();
220 | $(".uni-ml-perfil i").show();
221 |
222 | $(".uni-ml .uni-ml-config-usuario .uni-ml-perfil img").css("height", "var(--var-ml-altura-itens)");
223 | };
224 |
225 |
226 | function UniDSAMenuLateralOnClickLogo(AJSName) {
227 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnClickLogo', []);
228 | };
229 |
230 | function UniDSAMenuLateralOnClickMenu(AJSName, ANomeMenu) {
231 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnClickMenu', ["menu=" + ANomeMenu]);
232 | };
233 |
234 | function UniDSAMenuLateralOnClickNotificationMenu(AJSName, ANomeMenu, AEvent) {
235 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnClickNotificationMenu', ["menu=" + ANomeMenu]);
236 | AEvent.stopPropagation();
237 | };
238 |
239 | function UniDSAMenuLateralOnAfterSelectTheme(AJSName, AEvent) {
240 | var LOpcao = AEvent.target.getAttribute("option");
241 |
242 | AlterarTema();
243 |
244 | if (LOpcao == 'T2') {
245 | Tema2();
246 | } else {
247 | Tema1();
248 | };
249 |
250 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnAfterSelectTheme', ["tema=" + LOpcao]);
251 | };
252 |
253 | function UniDSAMenuLateralOnClickProfile(AJSName) {
254 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnClickProfile', []);
255 | };
256 |
257 | function UniDSAMenuLateralOnClickLogoff(AJSName) {
258 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnClickLogoff', []);
259 | };
260 |
261 | function UniDSAMenuLateralOnSearchEnter(AJSName, AValor) {
262 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnSearchEnter', ["texto=" + AValor]);
263 | };
264 |
265 | function UniDSAMenuLateralOnClickIconSearch(AJSName) {
266 | ajaxRequest(AJSName, 'UniDSAMenuLateralOnClickIconSearch', []);
267 | };
268 |
269 | function UniDSAMenuLateralOnKeyUpSearch(AJSName, AEvent) {
270 | ajaxRequest(AJSName, 'UniDSAMenuLateralGetSearchValue', ["texto=" + AEvent.target.value]);
271 | };
272 |
273 | function UniDSAMenuLateralOnKeyDownSearch(AJSName, AEvent) {
274 | if (AEvent.keyCode === 13) {
275 | const LValorInput = AEvent.target.value;
276 |
277 | UniDSAMenuLateralOnSearchEnter(AJSName, LValorInput)
278 | }
279 | };
280 |
--------------------------------------------------------------------------------
/dsa/js/jquery.toast.js:
--------------------------------------------------------------------------------
1 | // jQuery toast plugin created by Kamran Ahmed copyright MIT license 2015
2 | if ( typeof Object.create !== 'function' ) {
3 | Object.create = function( obj ) {
4 | function F() {}
5 | F.prototype = obj;
6 | return new F();
7 | };
8 | }
9 |
10 | (function( $, window, document, undefined ) {
11 |
12 | "use strict";
13 |
14 | var Toast = {
15 |
16 | _positionClasses : ['bottom-left', 'bottom-right', 'top-right', 'top-left', 'bottom-center', 'top-center', 'mid-center'],
17 | _defaultIcons : ['success', 'error', 'info', 'warning'],
18 |
19 | init: function (options, elem) {
20 | this.prepareOptions(options, $.toast.options);
21 | this.process();
22 | },
23 |
24 | prepareOptions: function(options, options_to_extend) {
25 | var _options = {};
26 | if ( ( typeof options === 'string' ) || ( options instanceof Array ) ) {
27 | _options.text = options;
28 | } else {
29 | _options = options;
30 | }
31 | this.options = $.extend( {}, options_to_extend, _options );
32 | },
33 |
34 | process: function () {
35 | this.setup();
36 | this.addToDom();
37 | this.position();
38 | this.bindToast();
39 | this.animate();
40 | },
41 |
42 | setup: function () {
43 |
44 | var _toastContent = '';
45 |
46 | this._toastEl = this._toastEl || $('', {
47 | class : 'jq-toast-single'
48 | });
49 |
50 | // For the loader on top
51 | _toastContent += '';
52 |
53 | if ( this.options.allowToastClose ) {
54 | _toastContent += '×';
55 | };
56 |
57 | if ( this.options.text instanceof Array ) {
58 |
59 | if ( this.options.heading ) {
60 | _toastContent +='' + this.options.heading + '
';
61 | };
62 |
63 | _toastContent += '';
64 | for (var i = 0; i < this.options.text.length; i++) {
65 | _toastContent += '- ' + this.options.text[i] + '
';
66 | }
67 | _toastContent += '
';
68 |
69 | } else {
70 | if ( this.options.heading ) {
71 | _toastContent +='' + this.options.heading + '
';
72 | };
73 | _toastContent += this.options.text;
74 | }
75 |
76 | this._toastEl.html( _toastContent );
77 |
78 | if ( this.options.bgColor !== false ) {
79 | this._toastEl.css("background-color", this.options.bgColor);
80 | };
81 |
82 | if ( this.options.textColor !== false ) {
83 | this._toastEl.css("color", this.options.textColor);
84 | };
85 |
86 | if ( this.options.textAlign ) {
87 | this._toastEl.css('text-align', this.options.textAlign);
88 | }
89 |
90 | if ( this.options.icon !== false ) {
91 | this._toastEl.addClass('jq-has-icon');
92 |
93 | if ( $.inArray(this.options.icon, this._defaultIcons) !== -1 ) {
94 | this._toastEl.addClass('jq-icon-' + this.options.icon);
95 | };
96 | };
97 |
98 | if ( this.options.class !== false ){
99 | this._toastEl.addClass(this.options.class)
100 | }
101 | },
102 |
103 | position: function () {
104 | if ( ( typeof this.options.position === 'string' ) && ( $.inArray( this.options.position, this._positionClasses) !== -1 ) ) {
105 |
106 | if ( this.options.position === 'bottom-center' ) {
107 | this._container.css({
108 | left: ( $(window).outerWidth() / 2 ) - this._container.outerWidth()/2,
109 | bottom: 20
110 | });
111 | } else if ( this.options.position === 'top-center' ) {
112 | this._container.css({
113 | left: ( $(window).outerWidth() / 2 ) - this._container.outerWidth()/2,
114 | top: 20
115 | });
116 | } else if ( this.options.position === 'mid-center' ) {
117 | this._container.css({
118 | left: ( $(window).outerWidth() / 2 ) - this._container.outerWidth()/2,
119 | top: ( $(window).outerHeight() / 2 ) - this._container.outerHeight()/2
120 | });
121 | } else {
122 | this._container.addClass( this.options.position );
123 | }
124 |
125 | } else if ( typeof this.options.position === 'object' ) {
126 | this._container.css({
127 | top : this.options.position.top ? this.options.position.top : 'auto',
128 | bottom : this.options.position.bottom ? this.options.position.bottom : 'auto',
129 | left : this.options.position.left ? this.options.position.left : 'auto',
130 | right : this.options.position.right ? this.options.position.right : 'auto'
131 | });
132 | } else {
133 | this._container.addClass( 'bottom-left' );
134 | }
135 | },
136 |
137 | bindToast: function () {
138 |
139 | var that = this;
140 |
141 | this._toastEl.on('afterShown', function () {
142 | that.processLoader();
143 | });
144 |
145 | this._toastEl.find('.close-jq-toast-single').on('click', function ( e ) {
146 |
147 | e.preventDefault();
148 |
149 | if( that.options.showHideTransition === 'fade') {
150 | that._toastEl.trigger('beforeHide');
151 | that._toastEl.fadeOut(function () {
152 | that._toastEl.trigger('afterHidden');
153 | });
154 | } else if ( that.options.showHideTransition === 'slide' ) {
155 | that._toastEl.trigger('beforeHide');
156 | that._toastEl.slideUp(function () {
157 | that._toastEl.trigger('afterHidden');
158 | });
159 | } else {
160 | that._toastEl.trigger('beforeHide');
161 | that._toastEl.hide(function () {
162 | that._toastEl.trigger('afterHidden');
163 | });
164 | }
165 | });
166 |
167 | if ( typeof this.options.beforeShow == 'function' ) {
168 | this._toastEl.on('beforeShow', function () {
169 | that.options.beforeShow(that._toastEl);
170 | });
171 | };
172 |
173 | if ( typeof this.options.afterShown == 'function' ) {
174 | this._toastEl.on('afterShown', function () {
175 | that.options.afterShown(that._toastEl);
176 | });
177 | };
178 |
179 | if ( typeof this.options.beforeHide == 'function' ) {
180 | this._toastEl.on('beforeHide', function () {
181 | that.options.beforeHide(that._toastEl);
182 | });
183 | };
184 |
185 | if ( typeof this.options.afterHidden == 'function' ) {
186 | this._toastEl.on('afterHidden', function () {
187 | that.options.afterHidden(that._toastEl);
188 | });
189 | };
190 |
191 | if ( typeof this.options.onClick == 'function' ) {
192 | this._toastEl.on('click', function () {
193 | that.options.onClick(that._toastEl);
194 | });
195 | };
196 | },
197 |
198 | addToDom: function () {
199 |
200 | var _container = $('.jq-toast-wrap');
201 |
202 | if ( _container.length === 0 ) {
203 |
204 | _container = $('',{
205 | class: "jq-toast-wrap",
206 | role: "alert",
207 | "aria-live": "polite"
208 | });
209 |
210 | $('body').append( _container );
211 |
212 | } else if ( !this.options.stack || isNaN( parseInt(this.options.stack, 10) ) ) {
213 | _container.empty();
214 | }
215 |
216 | _container.find('.jq-toast-single:hidden').remove();
217 |
218 | _container.append( this._toastEl );
219 |
220 | if ( this.options.stack && !isNaN( parseInt( this.options.stack ), 10 ) ) {
221 |
222 | var _prevToastCount = _container.find('.jq-toast-single').length,
223 | _extToastCount = _prevToastCount - this.options.stack;
224 |
225 | if ( _extToastCount > 0 ) {
226 | $('.jq-toast-wrap').find('.jq-toast-single').slice(0, _extToastCount).remove();
227 | };
228 |
229 | }
230 |
231 | this._container = _container;
232 | },
233 |
234 | canAutoHide: function () {
235 | return ( this.options.hideAfter !== false ) && !isNaN( parseInt( this.options.hideAfter, 10 ) );
236 | },
237 |
238 | processLoader: function () {
239 | // Show the loader only, if auto-hide is on and loader is demanded
240 | if (!this.canAutoHide() || this.options.loader === false) {
241 | return false;
242 | }
243 |
244 | var loader = this._toastEl.find('.jq-toast-loader');
245 |
246 | // 400 is the default time that jquery uses for fade/slide
247 | // Divide by 1000 for milliseconds to seconds conversion
248 | var transitionTime = (this.options.hideAfter - 400) / 1000 + 's';
249 | var loaderBg = this.options.loaderBg;
250 |
251 | var style = loader.attr('style') || '';
252 | style = style.substring(0, style.indexOf('-webkit-transition')); // Remove the last transition definition
253 |
254 | style += '-webkit-transition: width ' + transitionTime + ' ease-in; \
255 | -o-transition: width ' + transitionTime + ' ease-in; \
256 | transition: width ' + transitionTime + ' ease-in; \
257 | background-color: ' + loaderBg + ';';
258 |
259 |
260 | loader.attr('style', style).addClass('jq-toast-loaded');
261 | },
262 |
263 | animate: function () {
264 |
265 | var that = this;
266 |
267 | this._toastEl.hide();
268 |
269 | this._toastEl.trigger('beforeShow');
270 |
271 | if ( this.options.showHideTransition.toLowerCase() === 'fade' ) {
272 | this._toastEl.fadeIn(function ( ){
273 | that._toastEl.trigger('afterShown');
274 | });
275 | } else if ( this.options.showHideTransition.toLowerCase() === 'slide' ) {
276 | this._toastEl.slideDown(function ( ){
277 | that._toastEl.trigger('afterShown');
278 | });
279 | } else {
280 | this._toastEl.show(function ( ){
281 | that._toastEl.trigger('afterShown');
282 | });
283 | }
284 |
285 | if (this.canAutoHide()) {
286 |
287 | var that = this;
288 |
289 | window.setTimeout(function(){
290 |
291 | if ( that.options.showHideTransition.toLowerCase() === 'fade' ) {
292 | that._toastEl.trigger('beforeHide');
293 | that._toastEl.fadeOut(function () {
294 | that._toastEl.trigger('afterHidden');
295 | });
296 | } else if ( that.options.showHideTransition.toLowerCase() === 'slide' ) {
297 | that._toastEl.trigger('beforeHide');
298 | that._toastEl.slideUp(function () {
299 | that._toastEl.trigger('afterHidden');
300 | });
301 | } else {
302 | that._toastEl.trigger('beforeHide');
303 | that._toastEl.hide(function () {
304 | that._toastEl.trigger('afterHidden');
305 | });
306 | }
307 |
308 | }, this.options.hideAfter);
309 | };
310 | },
311 |
312 | reset: function ( resetWhat ) {
313 |
314 | if ( resetWhat === 'all' ) {
315 | $('.jq-toast-wrap').remove();
316 | } else {
317 | this._toastEl.remove();
318 | }
319 |
320 | },
321 |
322 | update: function(options) {
323 | this.prepareOptions(options, this.options);
324 | this.setup();
325 | this.bindToast();
326 | },
327 |
328 | close: function() {
329 | this._toastEl.find('.close-jq-toast-single').click();
330 | }
331 | };
332 |
333 | $.toast = function(options) {
334 | var toast = Object.create(Toast);
335 | toast.init(options, this);
336 |
337 | return {
338 |
339 | reset: function ( what ) {
340 | toast.reset( what );
341 | },
342 |
343 | update: function( options ) {
344 | toast.update( options );
345 | },
346 |
347 | close: function( ) {
348 | toast.close( );
349 | }
350 | }
351 | };
352 |
353 | $.toast.options = {
354 | text: '',
355 | heading: '',
356 | showHideTransition: 'fade',
357 | allowToastClose: true,
358 | hideAfter: 3000,
359 | loader: true,
360 | loaderBg: '#9EC600',
361 | stack: 5,
362 | position: 'bottom-left',
363 | bgColor: false,
364 | textColor: false,
365 | textAlign: 'left',
366 | icon: false,
367 | beforeShow: function () {},
368 | afterShown: function () {},
369 | beforeHide: function () {},
370 | afterHidden: function () {},
371 | onClick: function () {}
372 | };
373 |
374 | })( jQuery, window, document );
375 |
--------------------------------------------------------------------------------
/UniDSA.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2022/10/01 21:01:36.000.112,=rtl.dcp
5 | 2022/10/01 21:02:06.000.449,=bindengine.dcp
6 | 2022/10/01 21:02:06.000.405,=vcldb.dcp
7 | 2022/10/01 21:02:06.000.427,=vclwinx.dcp
8 | 2022/10/01 21:02:06.000.250,=soaprtl.dcp
9 | 2022/10/01 21:02:06.000.169,=uniTools28.dcp
10 | 2022/10/01 21:02:06.000.271,=dbrtl.dcp
11 | 2022/10/01 21:02:06.000.371,=vcl.dcp
12 | 2022/10/01 21:02:06.000.211,=uIndy28.dcp
13 | 2022/10/01 21:02:06.000.349,=vclimg.dcp
14 | 2022/10/01 21:02:06.000.328,=inet.dcp
15 | 2022/10/01 21:02:06.000.293,=xmlrtl.dcp
16 | 2022/10/01 21:02:06.000.094,=D:\Andamento\componente-unidsa-unigui\sources\UniDSAToast.pas
17 | 2022/10/01 21:02:06.000.144,=uniGUI28Core.dcp
18 | 2022/10/01 21:05:25.000.117,=D:\Andamento\componente-unidsa-unigui\librarys\UniLibrary.pas
19 | 2022/10/01 21:05:25.000.060,=D:\Andamento\componente-unidsa-unigui\librarys\UniJQuery.pas
20 | 2022/10/01 21:09:47.000.360,=D:\Andamento\componente-unidsa-unigui\sources\UniLibrary.pas
21 | 2022/10/01 21:09:47.000.323,=D:\Andamento\componente-unidsa-unigui\sources\UniJQuery.pas
22 | 2022/10/01 21:11:14.000.945,D:\Andamento\componente-unidsa-unigui\sources\UniDSAToast.pas=
23 | 2022/10/01 21:12:01.000.558,=D:\Andamento\componente-unidsa-unigui\sources\UniDSAToast.pas
24 | 2022/10/01 21:13:31.000.740,D:\Andamento\componente-unidsa-unigui\sources\UniJQuery.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAJQuery.pas
25 | 2022/10/01 21:13:36.000.263,D:\Andamento\componente-unidsa-unigui\sources\UniLibrary.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSALibrary.pas
26 | 2022/10/01 21:24:56.000.613,D:\Andamento\componente-unidsa-unigui\UniDSAS.dproj=D:\Andamento\componente-unidsa-unigui\UniDSA.dproj
27 | 2022/10/01 21:25:07.000.244,D:\Andamento\componente-unidsa-unigui\UniDSA.dproj=D:\Andamento\componente-unidsa-unigui\UniDSAS.dproj
28 | 2022/10/02 08:09:02.000.463,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
29 | 2022/10/02 08:09:24.000.637,D:\Andamento\componente-unidsa-unigui\sources\UniDSAConfirm.pas=D:\Andamento\componente-unidsa-unigui\Unit1.pas
30 | 2022/10/02 08:12:55.000.219,D:\Andamento\componente-unidsa-unigui\sources\UniDSAConfirm.pas=
31 | 2022/10/02 08:14:42.000.951,=D:\Andamento\componente-unidsa-unigui\sources\UniDSAConfirm.pas
32 | 2022/10/02 08:40:45.000.826,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
33 | 2022/10/02 08:40:56.000.964,D:\Andamento\componente-unidsa-unigui\Unit1.dfm=D:\Andamento\componente-unidsa-unigui\sources\TUniDSABrowser.dfm
34 | 2022/10/02 08:40:56.000.964,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\TUniDSABrowser.pas
35 | 2022/10/02 13:07:24.000.337,=D:\Andamento\componente-unidsa-unigui\sources\WebView2Loader.dll
36 | 2022/10/02 13:07:59.000.422,=vcledge.dcp
37 | 2022/10/02 13:16:31.000.010,D:\Andamento\componente-unidsa-unigui\sources\WebView2Loader.dll=
38 | 2022/10/02 13:16:38.000.545,=D:\Andamento\componente-unidsa-unigui\sources\WebView2Loader.dll
39 | 2022/10/02 13:16:51.000.209,D:\Andamento\componente-unidsa-unigui\sources\WebView2Loader.dll=
40 | 2022/10/02 13:17:02.000.445,=D:\Andamento\componente-unidsa-unigui\sources\WebView2Loader.dll
41 | 2022/10/02 14:54:24.000.829,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
42 | 2022/10/02 14:54:34.000.603,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSASource.pas
43 | 2022/10/06 18:31:47.000.536,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
44 | 2022/10/06 18:32:02.000.591,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\TuniDSAToastMenu.pas
45 | 2022/10/06 18:32:25.000.086,D:\Andamento\componente-unidsa-unigui\sources\TuniDSAToastMenu.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAToastMenu.pas
46 | 2022/10/06 18:33:34.000.895,D:\Andamento\componente-unidsa-unigui\sources\TUniDSABrowser.dfm=D:\Andamento\componente-unidsa-unigui\sources\UniDSABrowser.dfm
47 | 2022/10/06 18:33:34.000.895,D:\Andamento\componente-unidsa-unigui\sources\TUniDSABrowser.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSABrowser.pas
48 | 2022/10/07 21:11:02.000.907,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
49 | 2022/10/07 21:11:22.000.740,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSABaseComponent.pas
50 | 2022/10/07 21:48:41.000.551,D:\Andamento\componente-unidsa-unigui\sources\UniDSABaseComponent.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSABase.pas
51 | 2022/10/07 22:50:15.000.448,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
52 | 2022/10/07 22:50:24.000.349,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAKey.pas
53 | 2022/10/08 00:00:52.000.030,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
54 | 2022/10/08 00:01:07.000.498,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAColor.pas
55 | 2022/10/08 14:27:40.000.098,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
56 | 2022/10/08 14:33:07.000.646,D:\Andamento\componente-unidsa-unigui\sources\UniDSAMenuBrowser.pas=D:\Andamento\componente-unidsa-unigui\Unit1.pas
57 | 2022/10/10 21:50:48.000.221,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
58 | 2022/10/10 21:50:57.000.594,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAEditor.pas
59 | 2022/10/11 19:24:02.000.509,=D:\Andamento\componente-unidsa-unigui\images\TUniDSAConfirmButtonItem.bmp
60 | 2022/10/11 19:28:09.000.775,D:\Andamento\componente-unidsa-unigui\images\TUniDSAConfirm.bmp=D:\Andamento\componente-unidsa-unigui\images\TUniDSAConfirmButtonItem.bmp
61 | 2022/10/11 20:10:34.000.642,=D:\Andamento\componente-unidsa-unigui\images\TUniDSAToast.bmp
62 | 2022/10/11 20:14:05.000.070,D:\Andamento\componente-unidsa-unigui\sources\UniDSAEditor.pas=
63 | 2022/10/11 20:32:19.000.671,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
64 | 2022/10/11 20:32:33.000.099,D:\Andamento\componente-unidsa-unigui\sources\UniDSAMenu.pas=D:\Andamento\componente-unidsa-unigui\Unit1.pas
65 | 2022/10/12 10:47:02.000.170,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
66 | 2022/10/12 10:47:11.000.364,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAEditor.pas
67 | 2022/10/12 19:37:31.000.434,=D:\Andamento\componente-unidsa-unigui\images\TFormUniDSABrowser.bmp
68 | 2022/10/15 09:04:29.000.462,D:\Andamento\componente-unidsa-unigui\sources\UniDSAMenuBrowser.pas=
69 | 2022/10/15 09:04:34.000.479,D:\Andamento\componente-unidsa-unigui\sources\UniDSAMenu.pas=
70 | 2022/10/15 09:04:49.000.620,D:\Andamento\componente-unidsa-unigui\sources\UniDSAKey.pas=
71 | 2022/10/15 09:10:05.000.252,D:\Andamento\componente-unidsa-unigui\sources\UniDSAEditor.pas=
72 | 2022/10/15 09:11:56.000.480,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
73 | 2022/10/15 09:12:08.000.285,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAOthers.pas
74 | 2022/10/15 09:25:55.000.898,=D:\Andamento\componente-unidsa-unigui\Unit1.pas
75 | 2022/10/15 09:26:18.000.857,D:\Andamento\componente-unidsa-unigui\Unit1.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAConfirmMenu.pas
76 | 2022/10/15 09:40:52.000.312,D:\Andamento\componente-unidsa-unigui\sources\UniDSAConfirmMenu.pas=D:\Andamento\componente-unidsa-unigui\sources\UniDSAMenu.pas
77 | 2022/10/15 10:33:29.000.094,=uniGUI28.dcp
78 | 2022/10/25 19:30:04.000.755,=D:\Andamento\componente-unidsa-unigui\sources\UniDSAMenuSidebar.pas
79 | 2022/11/10 10:00:59.000.505,D:\Andamento\componente-unidsa-unigui\sources\UniDSAMenuSidebar.pas=
80 | 2022/11/10 10:01:03.000.837,D:\Andamento\componente-unidsa-unigui\sources\UniDSAToastMenu.pas=
81 | 2022/11/10 10:01:15.000.126,D:\Andamento\componente-unidsa-unigui\sources\UniDSAOthers.pas=
82 | 2023/07/16 16:04:16.000.479,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\Unit1.pas
83 | 2023/07/16 16:04:33.000.709,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\Unit1.pas=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\TUniDSABaseControl.pas
84 | 2023/07/16 16:05:01.000.741,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\TUniDSABaseControl.pas=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\UniDSABaseControl.pas
85 | 2023/07/17 20:28:34.000.435,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReaderSupportedFormats.bmp
86 | 2023/07/17 20:30:30.000.201,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReaderSupportedFormats.bmp=
87 | 2023/07/17 20:31:14.000.854,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
88 | 2023/07/17 20:39:51.000.821,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp=
89 | 2023/07/17 20:40:29.000.551,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
90 | 2023/07/17 21:05:10.000.945,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp=
91 | 2023/07/17 21:05:42.000.849,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
92 | 2023/07/17 21:08:39.000.343,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp=
93 | 2023/07/17 21:08:51.000.849,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
94 | 2023/07/17 21:13:14.000.292,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp=
95 | 2023/07/17 21:13:47.000.646,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
96 | 2023/07/17 21:21:03.000.999,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp=
97 | 2023/07/17 21:21:29.000.949,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
98 | 2023/07/23 10:58:09.000.436,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\UniDSAMenu.pas=
99 | 2023/07/23 10:58:26.000.788,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\UniDSAMenu.pas
100 | 2023/07/23 10:58:56.000.298,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\UniDSAMenuLateral.pas
101 | 2023/08/05 19:23:00.000.666,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\Unit1.pas
102 | 2023/08/05 19:23:16.000.665,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\Unit1.pas=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\UniDSAMenuLateralTypes.pas
103 | 2023/08/07 19:52:09.000.311,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\UniDSAMenuLateralTypes.pas=
104 | 2023/08/13 10:07:52.000.296,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\Unit1.pas
105 | 2023/08/13 10:08:29.000.216,E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\Unit1.pas=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\sources\UniDSADiv.pas
106 | 2023/08/19 20:59:14.000.168,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
107 | 2023/08/19 20:59:14.000.135,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAConfirm.bmp
108 | 2023/08/19 20:59:14.000.098,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TFormUniDSABrowser.bmp
109 | 2023/08/19 20:59:14.000.217,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAToast.bmp
110 | 2023/08/19 22:57:25.000.895,=E:\Embacadeiro\Repositorios\unidsa-unigui-delphi\images\TUniDSAMenuLateral.bmp
111 | 2024/03/28 21:37:53.000.618,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSALogin.pas
112 | 2024/03/28 21:38:25.000.609,=vcledge.dcp
113 | 2024/03/28 21:44:27.000.630,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAControl.pas
114 | 2024/03/28 21:44:27.000.489,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\sources\UniDSAConst.pas
115 | 2024/03/28 21:53:07.000.149,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\includes\diretivas.inc
116 | 2024/03/28 21:55:44.000.483,D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\includes\diretivas.inc=
117 | 2024/03/29 16:03:38.000.368,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\images\TUniDSAConfirm.bmp
118 | 2024/03/29 16:04:44.000.684,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\images\TUniDSALogin.bmp
119 | 2024/03/29 16:05:04.000.632,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\images\TUniDSAQrCodeReader.bmp
120 | 2024/03/29 16:05:17.000.488,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\images\TUniDSAToast.bmp
121 | 2024/03/29 16:05:27.000.556,=D:\Embacadeiro\Repositorios\novo\unidsa-unigui-delphi\images\TUniDSAMenuLateral.bmp
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Paleta de componentes UniDSA para UniGUI no Delphi
2 |
3 | 
4 |
5 | O **UniDSA** é uma paleta inovadora de componentes desenvolvida especificamente para aprimorar e estender as capacidades do **UniGUI no Delphi**. Composta por ferramentas altamente customizáveis, esta paleta visa oferecer soluções mais elegantes e eficazes para a construção de interfaces de usuário modernas.
6 |
7 |
8 | **Componentes disponíveis**
9 |
10 | > TUniDSAQrCodeReader
11 | > TUniDSAConfirm
12 | > TUniDSAToast
13 | > TUniDSAMenuLateral
14 | > TUniDSALogin
15 |
16 | ## [](https://i.ibb.co/rvfWQs8/TUni-DSAQr-Code-Reader.png "TUniDSAQrCodeReader") TUniDSAQrCodeReader
17 |
18 | Este é um componente avançado desenvolvido para aproveitar o poder do **HTML5** na leitura de uma ampla gama de** códigos de barras e QR codes**. Projetado para ser altamente flexível, o TUniDSAQrCodeReader oferece aos desenvolvedores a capacidade de personalizar exatamente quais tipos de códigos desejam ler, bem como a opção de escolher o dispositivo específico para leitura.
19 |
20 | #### Compatibilidade de Tipos de Códigos:
21 |
22 | | Tipo | Descrição |
23 | |------------- | -------------|
24 | |QR_CODE| Permite a leitura de QR codes padrão.|
25 | |AZTEC| Suporte para leitura de códigos Aztec|
26 | |CODABAR| Identifica e lê códigos Codabar|
27 | |CODE_39, CODE_93, CODE_128| Leitura abrangente de códigos Code, cobrindo variações 39, 93 e 128.|
28 | |DATA_MATRIX| Habilitado para reconhecer e interpretar códigos Data Matrix.|
29 | |MAXICODE| Suporte para códigos MaxiCode.|
30 | |ITF| Compatível com códigos Interleaved 2 of 5 (ITF).|
31 | |EAN_13, EAN_8| Leitura de códigos EAN, incluindo as variações 13 e 8.|
32 | |PDF_417| Suporte para códigos PDF417.|
33 | |RSS_14, RSS_EXPANDED| Habilitado para códigos RSS, tanto na versão 14 quanto na versão expandida.|
34 | |UPC_A, UPC_E, UPC_EAN_EXTENSION| Compatível com variações UPC, incluindo extensões EAN.|
35 |
36 | #### Características Principais:
37 |
38 | + Seleção de Tipo de Código: Os desenvolvedores têm a liberdade de marcar ou desmarcar tipos de códigos específicos para leitura, de acordo com as necessidades de sua aplicação.
39 |
40 | + Escolha do Dispositivo: Fornece a opção de selecionar o dispositivo específico para leitura, garantindo maior versatilidade na captação dos códigos.
41 |
42 | #### Imagem:
43 |
44 | [](https://i.ibb.co/NjD2Nvg/image.png)
45 |
46 | > Imagem ilustrativa, pois o componente pode ter opções de personalizações...
47 |
48 |
49 | ## [](https://i.ibb.co/F7whv8F/TUni-DSAConfirm.png "TUniDSAConfirm") TUniDSAConfirm
50 |
51 | O TUniDSAConfirm serve para criar e gerenciar janelas de diálogo modais para confirmações, alertas e prompts, sendo baseado no plugin disponível em [jquery-confirm](https://github.com/craftpip/jquery-confirm "jquery-confirm") . Este componente fornece uma ampla gama de propriedades e métodos que permitem uma personalização detalhada das janelas de diálogo, englobando desde o conteúdo exibido até aspectos estéticos e funcionais da janela.
52 |
53 | #### Principais Propriedades e Métodos:
54 |
55 | **Gerais**:
56 |
57 | + `Title` Define o título da janela de diálogo.
58 | + `Content` Define o conteúdo principal da janela de diálogo.
59 | + `Icon` Permite definir um ícone para a janela de diálogo.
60 | + `Theme` Define o tema da janela, permitindo personalização estética.
61 |
62 | **Controle de Janela:**
63 |
64 | + `Draggable` Controla se a janela pode ser arrastada.
65 |
66 | **Conteúdo:**
67 |
68 | + `ContentFile` Permite carregar o conteúdo da janela a partir de um arquivo externo.
69 | + `SmoothContent` Habilita uma transição suave para o conteúdo.
70 |
71 | **Botões:**
72 |
73 | + `Buttons` Define os botões disponíveis na janela de diálogo.
74 | + `OnButtonClick` Evento acionado ao clicar em um botão.
75 |
76 | **Animações:**
77 |
78 | + `Animation` Define o tipo de animação usado ao abrir e fechar a janela.
79 | + `TypeAnimated` Define se a janela terá animação ao mudar de tipo.
80 |
81 | **Layout e Estilo:**
82 |
83 | + `BoxWidth` Define a largura da janela.
84 | + `ColumnClass` `TitleClass` Permite definir classes customizadas para diferentes elementos da janela.
85 |
86 | **Eventos:**
87 |
88 | + `OnOpen`, `OnClose`, `OnDestroy`, `OnAction`, `OnContentReady` Diversos eventos que permitem o controle detalhado do ciclo de vida da janela de diálogo.
89 |
90 | **Outras Propriedades:**
91 |
92 | + `Type` Define o tipo de janela de diálogo (confirm, alert, etc.).
93 | + `UseBootstrap` Define se o Bootstrap será usado para estilização.
94 | + `RTL` Habilita o suporte a idiomas escritos da direita para a esquerda.
95 |
96 | **Métodos Públicos:**
97 |
98 | + `Show` Exibe a janela de diálogo.
99 | + `Alert`, `Dialog`, `Prompt`, `Confirm` Exibem janelas de diálogo com características pré-definidas para diferentes finalidades.
100 | + `Clear`, `ClearEvents` Métodos para limpar propriedades e eventos associados à janela.
101 |
102 |
103 | #### Imagem:
104 |
105 | [](https://i.ibb.co/PhvMbfb/image.png)
106 |
107 | > Imagem ilustrativa, pois o componente pode ter opções de personalizações...
108 |
109 |
110 | ## [](https://i.ibb.co/sKG9YDB/TUni-DSAToast.png "TUniDSAToast") TUniDSAToast
111 |
112 | O TUniDSAToast é uma classe que representa uma notificação simples e breve, frequentemente usada para fornecer feedback aos usuários sobre uma ação ou evento em uma aplicação. Baseado no plugin jquery-toast-plugin, este componente permite criar notificações toast estilizadas e personalizadas para aplicações UniGUI desenvolvidas em Delphi.
113 |
114 | **Principais propriedades e métodos:**
115 |
116 | **Gerais:**
117 |
118 | + `Text` Define o texto principal da notificação.
119 | + `Heading` Define o cabeçalho ou título da notificação.
120 | + `Icon` Define um ícone para a notificação. Diferentes ícones podem ser usados para + indicar o tipo ou a importância da notificação.
121 |
122 | **Comportamento:**
123 |
124 | - `ShowHideTransition` Determina o tipo de transição usado ao mostrar ou esconder a notificação.
125 | - `HideAfter` Define o tempo (em milissegundos) após o qual a notificação será automaticamente escondida.
126 | - `AllowToastClose` Se True, permite que os usuários fechem a notificação manualmente.
127 | - `Stack` Define quantas notificações podem ser exibidas simultaneamente.
128 |
129 | **Estilo e Aparência:**
130 |
131 | - `BgColor` Define a cor de fundo da notificação.
132 | - `TextColor` Define a cor do texto da notificação.
133 | - `TextAlign` Define o alinhamento do texto na notificação.
134 | - `Position` Define a posição na tela onde a notificação aparecerá.
135 | - `Loader` Especifica o tipo e o comportamento do carregador mostrado nas notificações.
136 |
137 | **Eventos:**
138 |
139 | - `OnBeforeShow` Acionado antes da notificação ser exibida.
140 | - `OnAfterShown` Acionado após a notificação ser exibida.
141 | - `OnBeforeHide` Acionado antes da notificação ser escondida.
142 | - `OnAfterHidden` Acionado após a notificação ser escondida.
143 |
144 | **Métodos Públicos:**
145 |
146 | - `Show` Exibe a notificação com as propriedades definidas.
147 | - `Clear` Limpa a notificação atual.
148 | - `Reset` Reinicializa a notificação para seus valores padrão.
149 |
150 | O componente **TUniDSAToast** proporciona uma maneira flexível e elegante de fornecer feedback para os usuários, sem ser intrusivo. Ao utilizar este componente em projetos Delphi com UniGUI, os desenvolvedores podem melhorar significativamente a experiência do usuário, fornecendo notificações contextuais relevantes em resposta a diversas ações e eventos.
151 |
152 | #### Imagem:
153 |
154 | [](https://i.ibb.co/HC6cC7h/image.png)
155 |
156 | > Imagem ilustrativa, pois o componente pode ter opções de personalizações...
157 |
158 | ## [](https://i.ibb.co/ScfMkHd/TUni-DSAMenu-Lateral.png "TUniDSAMenuLateral") TUniDSAMenuLateral
159 |
160 | Este é um componente que representa um menu lateral, comumente usado em aplicações web para fornecer navegação e opções adicionais, normalmente situado no lado esquerdo ou direito da página.
161 |
162 | **Principais propriedades e métodos:**
163 |
164 | **Gerais:**
165 |
166 | - `Logo`: Controla a aparência e comportamento do logotipo na parte superior do menu.
167 | 1. `UrlImage` Define a imagem do logo
168 | 2. `CompanyName` Define o nome do cliente/empresa
169 | - `Search`: Permite a pesquisa dentro do menu.
170 | 1. `Icon` Define o icone da área de pesquisa.
171 | 2. `TextPrompt` Define o texto informativo que será exibido na área da pesquisa, padrão "Pesquisar.."
172 | 3. `AutoComplete` Habilitar ou desabilitar a sugestão com bases nos textos já utilizados.
173 | 4. `Visible` Define se o pesquisar será exibido.
174 | 5. `SearchText` Texto pesquisado pelo usuário.
175 | - `Theme` Define o tema visual do menu.
176 | 1. `TitleLeft` Título do tema a esquerda.
177 | 2. `TitleRight` Título do tema a direita.
178 | 3. `StyleLeft` Estilo do tema a esquerda
179 | 4. `StyleRight` Estilo do tema a direita
180 | 5. `Visible` Define se ficará visível para o usuário a opção de mudança de temas
181 | - `Menu`: Controla os itens individuais dentro do menu.
182 | 1. `Icon` Define o icone do menu (Font Awesome 5.15.4)
183 | 2. `Caption` Descrição do menu
184 | 3. `NotificationCount` Quando maior que 0 será exibido ao lado do menu a quantidade de notificações.
185 | 4. `Visible` Define se o menu ficará visivel.
186 | 5. `Enabled` Define se o menu ficará ativo
187 | 6. `Hidden` Define se o menu ficará visível mantendo o local do mesmo.
188 | 7. `Separator` Define que o menu será um separador de menus
189 | 8. `Hint` Descrição do menu ao passar o mouse por cima.
190 | 9. `OnClick` Acionado ao clicar no menu
191 | 10. `OnClickNotification` Acionado ao clicar na notificação do menu.
192 | 11. `OnClickRef` Acionado ao clicar no menu (Usado em runtime)
193 | 12. `OnClickNotificationRef` Acionado ao clicar na notificação do menu (Usado em runtime)
194 | - `Profile` Permite exibir informações de perfil, como nome de usuário ou imagem, no menu.
195 | 1. `Name` Nome do usuário do sistema
196 | 2. `Email` E-mail do usuário do sistema
197 | 3. `ImageURL` Imagem do usuário do sistema
198 | 4. `Visible` Indica se o perfil do usuário será visível.
199 | - `Style` Controla o estilo visual geral do menu.
200 | 1. `PaddingTop` Similiar ao padding-top do CSS. Define o espaço interno no topo do elemento.
201 | 2. `PaddingLeft` Similar ao padding-left do CSS. Define o espaço interno à esquerda do elemento.
202 | 3. `PaddingRight` Similar ao padding-right do CSS. Define o espaço interno à direita do elemento.
203 | 4. `PaddingBottom` Similar ao padding-bottom do CSS. Define o espaço interno na parte inferior do elemento.
204 | 5. `BorderRadiusTopLeft` Similar ao border-top-left-radius do CSS. Define o raio da borda no canto superior esquerdo.
205 | 6. `BorderRadiusTopRight` Similar ao border-top-right-radius do CSS. Define o raio da borda no canto superior direito.
206 | 7. `BorderRadiusBottomLeft` Similar ao border-bottom-left-radius do CSS. Define o raio da borda no canto inferior esquerdo.
207 | 8. `BorderRadiusBottomRight` Similar ao border-bottom-right-radius do CSS. Define o raio da borda no canto inferior direito.
208 | 9. `BorderTop` Similar ao border-top do CSS. Define a espessura da borda superior do elemento.
209 | 10. `BorderLeft` Similar ao border-left do CSS. Define a espessura da borda à esquerda do elemento.
210 | 11. `BorderRight` Similar ao border-right do CSS. Define a espessura da borda à direita do elemento.
211 | 12. `BorderBottom` Similar ao border-bottom do CSS. Define a espessura da borda inferior do elemento.
212 |
213 | **Comportamento:**
214 |
215 | - `MenuState` Define o estado atual do menu (por exemplo, minimizado ou maximizado).
216 | - `SelectedDiretionTheme` Determina a direção do tema selecionado.
217 | - `SelectedTheme` Especifica o tema de estilo selecionado.
218 | - `SelectedMenu` Indica qual item de menu foi selecionado.
219 | - `AjaxSecurity` Um booleano que determina se a segurança Ajax está habilitada ou não.
220 |
221 | **Métodos Públicos:**
222 |
223 | - `MinimizeMaximize` Alterna entre os estados minimizado e maximizado do menu.
224 | - `HideMenu` Oculta o menu.
225 | - `ShowMenu` Exibe o menu.
226 | - `SetTheme` Define o tema do menu.
227 |
228 | **Eventos:**
229 |
230 | - `OnClickLogo` Acionado quando o logotipo é clicado.
231 | - `OnClickMenu` Acionado ao clicar em um item do menu.
232 | - `OnClickNotificationMenu` Acionado ao clicar em uma notificação no menu.
233 | - `OnAfterSelectTheme` Acionado após selecionar um tema.
234 | - `OnClickProfile` Acionado ao clicar no perfil.
235 | - `OnClickLogoff` Acionado ao clicar no botão de sair/logoff.
236 | - `OnSearchEnter` Acionado quando um termo de pesquisa é inserido.
237 | - `OnClickIconSearch` Acionado ao clicar no ícone de pesquisa.
238 |
239 | #### Imagem:
240 |
241 | [](https://i.ibb.co/c1r46Bf/image.png)
242 |
243 | > Imagem ilustrativa, pois o componente pode ter opções de personalizações...
244 |
245 | ## [](https://i.ibb.co/fk69Jz7/TUni-DSALogin24.png "TUniDSAMenuLateral") TUniDSALogin
246 |
247 | O componente TUniDSALogin é uma ferramenta versátil projetada para apresentar elementos cruciais em uma tela de login, oferecendo uma experiência de usuário fluida e personalizável além de agilizar todo processo de criação dessa tela. A tela de login é responsiva, sendo assim se adaptará a diferentes tamnhos de tela.
248 |
249 | **Principais propriedades e métodos:**
250 |
251 | **Gerais:**
252 |
253 | - `Geral`: Propriedades gerais
254 | 1. `Title` Define o título da tela de login
255 | 2. `Description` Define a descrição da tela de login, texto fica logo abaixo do título
256 | 3. `TrimSpacesOnRememberMeForgetPassword` Para quem não for usar a opção de lembra da senha ou recuperar a senha, essa opção marcado irá remover o espaçamento entre os inputs de botões
257 |
258 | - `Logo`: Controla a aparência e comportamento do logotipo na parte superior do menu.
259 | 1. `Image` Define a imagem do logo de acordo a URL informada
260 | 2. `MarginLeft` Define a margem a partir do lado esquerdo
261 | 3. `MarginTop`Define a margem a partir do lado direito
262 |
263 | - `Slide`: Referente a imagem de slide inicial
264 | 1. `Image` Define a imagem do logo de acordo a URL informada
265 | 2. `MarginLeft` Define a margem a partir do lado esquerdo
266 | 3. `MarginTop`Define a margem a partir do lado direito
267 |
268 | - `Login`: Configurações do input de login
269 | 1. `Caption` Define o título do input, ex: e-mail, telefone
270 | 2. `Enabled` Define se o input ficará ativo ou inativo
271 | 3. `Value` Define ou pega o valor do campo login
272 |
273 | - `Password`: Configurações do input de senha
274 | 1. `Caption` Define o título do input
275 | 2. `Enabled` Define se o input ficará ativo ou inativo
276 | 3. `Value` Define ou pega o valor do campo login
277 |
278 | - `RememberMe`: Configurações da opção de lembrar da senha
279 | 1. `Caption` Define o título
280 | 2. `Checked` Define ou verifica se o checkbox está marcado
281 | 3. `Visible` Define a visibilidade da opção
282 |
283 | - `ForgetPassword`: Configurações para recuperar a senha
284 | 1. `Caption` Define o título
285 | 2. `Visible` Define a visibilidade da opção
286 |
287 | - `LoginNow`: Configurações do botão Entrar
288 | 1. `Caption` Define o título
289 | 2. `Visible` Define a visibilidade da opção
290 | 3. `Visible` Define a largura do botão
291 |
292 | - `CreateAccount`: Configurações para criação de novas contas
293 | 1. `Caption` Define o título
294 | 2. `Visible` Define a visibilidade da opção
295 | 3. `Visible` Define a largura do botão
296 |
297 | **Eventos:**
298 |
299 | - `OnCreateAccount` Acionado ao clicar no botão de criação de conta .
300 | - `OnForgetPassword` Acionado ao clicar na opção de recuperar a senha.
301 | - `OnLoginEnter` Acionado ao pressionar enter no input de login.
302 | - `OnLoginNow` Acionado ao clicar no botão Entrar.
303 | - `OnPasswordEnter` Acionado ao pressionar ENTER no input do password.
304 | - `OnRememberMe` Acionado ao clicar no lembrar da senha
305 |
306 | **Comando**
307 |
308 | Todos os formulários do UniGUI atualizam a largura do form de acordo o redmensionamento do usuário, exceto no Form do tipo Login. Por isso é preciso o uso do seguinte script na propriedade "**Script**" do seu "**FormLogin**".
309 |
310 | window.onresize = function(){
311 | if (typeof FormLogin !== 'undefined') {
312 | var getSize = Ext.getBody().getViewSize(),
313 | winWidth = getSize.width,
314 | winHeight = getSize.height,
315 | left = (winWidth - FormLogin.window.width) / 2,
316 | top = (winHeight - FormLogin.window.height) / 2;
317 |
318 | FormLogin.window.setPosition(left, top);
319 | }
320 | }
321 |
322 | Obs.: troque o nome pelo nome do seu form **FormLogin**.
323 |
324 | Vale lembrar que é recomendado o modo **mfPage** no **UniServerModule** para que sua aplicação fique o mais parecido com os estilos padrões de páginas web.
325 |
326 |
327 | #### Imagem:
328 |
329 | [](https://i.ibb.co/RcwzzZW/TUni-DSALogin1.png "TUniDSALogin")
330 |
331 |
--------------------------------------------------------------------------------
/sources/UniDSALogin.pas:
--------------------------------------------------------------------------------
1 | unit UniDSALogin;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils, System.Classes, uniGUIClasses, UniDSABaseControl, UniDSAExecuteFunction, uniGUITypes,
7 | System.TypInfo, UniDSALibrary, System.Variants, Vcl.Graphics, UniDSASource, Vcl.Controls,
8 | System.Types, UniDSAControl;
9 |
10 | type
11 | TUniDSALogin = class(TUniDSABaseControl)
12 | private
13 | FOnLoginNow: TNotifyEvent;
14 | FOnCreateAccount: TNotifyEvent;
15 | FOnForgetPassword: TNotifyEvent;
16 | FLoginNow: TUniDSAButton;
17 | FCreateAccount: TUniDSAButton;
18 | FRememberMe: TUniDSACheckBox;
19 | FForgetPassword: TUniDSAButtonText;
20 | FSlide: TUniDSALoginImage;
21 | FLogin: TUniDSAInput;
22 | FPassword: TUniDSAInput;
23 | FLogo: TUniDSALoginImage;
24 | FTitle: string;
25 | FDescription: string;
26 | FTrimSpacesOnRememberMeForgetPassword: Boolean;
27 | FOnRememberMe: TNotifyEvent;
28 | FOnLoginEnter: TNotifyEvent;
29 | FOnPasswordEnter: TNotifyEvent;
30 |
31 | procedure PrepareHtml;
32 | procedure PrepareJS;
33 | procedure PrepareDefault;
34 |
35 | function GetTitle: string;
36 | procedure SetTitle(const Value: string);
37 | function GetDescription: string;
38 | procedure SetDescription(const Value: string);
39 | function GetTrimSpacesOnRememberMeForgetPassword: Boolean;
40 | procedure SetTrimSpacesOnRememberMeForgetPassword(const Value: Boolean);
41 | protected
42 | procedure JSEventHandler(AEventName: string; AParams: TUniStrings); override;
43 | procedure LoadCompleted; override;
44 | procedure WebCreate; override;
45 | public
46 | constructor Create(AOwner: TComponent); override;
47 | destructor Destroy; override;
48 | published
49 | property Align;
50 |
51 | property LoginNow: TUniDSAButton read FLoginNow write FLoginNow;
52 | property CreateAccount: TUniDSAButton read FCreateAccount write FCreateAccount;
53 | property RememberMe: TUniDSACheckBox read FRememberMe write FRememberMe;
54 | property ForgetPassword: TUniDSAButtonText read FForgetPassword write FForgetPassword;
55 | property Login: TUniDSAInput read FLogin write FLogin;
56 | property Slide: TUniDSALoginImage read FSlide write FSlide;
57 | property Password: TUniDSAInput read FPassword write FPassword;
58 | property Title: string read GetTitle write SetTitle;
59 | property Description: string read GetDescription write SetDescription;
60 | property Logo: TUniDSALoginImage read FLogo write FLogo;
61 | property TrimSpacesOnRememberMeForgetPassword: Boolean read GetTrimSpacesOnRememberMeForgetPassword write SetTrimSpacesOnRememberMeForgetPassword;
62 |
63 | property OnLoginNow: TNotifyEvent read FonLoginNow write FonLoginNow;
64 | property OnCreateAccount: TNotifyEvent read FOnCreateAccount write FOnCreateAccount;
65 | property OnRememberMe: TNotifyEvent read FOnRememberMe write FOnRememberMe;
66 | property OnLoginEnter: TNotifyEvent read FOnLoginEnter write FOnLoginEnter;
67 | property OnPasswordEnter: TNotifyEvent read FOnPasswordEnter write FOnPasswordEnter;
68 | property OnForgetPassword: TNotifyEvent read FOnForgetPassword write FOnForgetPassword;
69 | end;
70 |
71 | procedure Register;
72 |
73 | implementation
74 |
75 | { TUniDSALogin }
76 |
77 | procedure Register;
78 | begin
79 | RegisterComponents('UniDSA', [TUniDSALogin]);
80 | end;
81 |
82 |
83 | constructor TUniDSALogin.Create(AOwner: TComponent);
84 | begin
85 | inherited;
86 |
87 | Align := TAlign.alClient;
88 |
89 | FLoginNow := TUniDSAButton.Create(
90 | Self,
91 | '#un-lg-login-now',
92 | 'Entrar',
93 | True,
94 | 90
95 | );
96 |
97 | FCreateAccount := TUniDSAButton.Create(
98 | Self,
99 | '#un-lg-create-account',
100 | 'Nova conta',
101 | True,
102 | 90
103 | );
104 |
105 | FRememberMe := TUniDSACheckBox.Create(
106 | Self,
107 | '#un-lg-login-remember-me',
108 | '#un-lg-rm-ck',
109 | 'Lembrar da senha',
110 | True
111 | );
112 |
113 | ForgetPassword := TUniDSAButtonText.Create(
114 | Self,
115 | '#un-lg-forget-password',
116 | '',
117 | 'Esqueceu a senha?',
118 | True
119 | );
120 |
121 | FLogin := TUniDSAInput.Create(Self, '#un-lg-lg-login', 'un-lg-gp-lg-r-title-caption', 'Email:', '');
122 |
123 | FPassword := TUniDSAInput.Create(Self, '#un-lg-lg-password', '#un-lg-gp-lg-r-title-password', 'Senha:', '');
124 |
125 | FSlide := TUniDSALoginImage.Create(
126 | Self,
127 | '#un-lg-img-demo-img',
128 | 'https://i.ibb.co/QpmYjyw/working.png',
129 | 100,
130 | 40
131 | );
132 |
133 | FLogo := TUniDSALoginImage.Create(
134 | Self,
135 | 'un-lg-logo-left-img',
136 | 'https://i.ibb.co/4TTX0b6/logo-login-2.png',
137 | 0,
138 | 0
139 | );
140 |
141 | Description := 'Para permanecer conectado conosco, por favor faça login com suas informações pessoais usando seu endereço de e-mail e senha 🔔';
142 | Title := 'Bem-vindo de volta :)';
143 | TrimSpacesOnRememberMeForgetPassword := False;
144 | end;
145 |
146 | destructor TUniDSALogin.Destroy;
147 | begin
148 | inherited;
149 | FreeAndNil(FLoginNow);
150 | FreeAndNil(FCreateAccount);
151 | FreeAndNil(FRememberMe);
152 | FreeAndNil(FForgetPassword);
153 | FreeAndNil(FLogin);
154 | FreeAndNil(FPassword);
155 | FreeAndNil(FSlide);
156 | FreeAndNil(FLogo);
157 | end;
158 |
159 | function TUniDSALogin.GetDescription: string;
160 | begin
161 | Result := FDescription;
162 | end;
163 |
164 | function TUniDSALogin.GetTitle: string;
165 | begin
166 | Result := FTitle;
167 | end;
168 |
169 | function TUniDSALogin.GetTrimSpacesOnRememberMeForgetPassword: Boolean;
170 | begin
171 | Result := FTrimSpacesOnRememberMeForgetPassword;
172 | end;
173 |
174 | procedure TUniDSALogin.JSEventHandler(AEventName: string; AParams: TUniStrings);
175 | begin
176 | inherited;
177 | if AEventName = 'UniDSALoginLoginOnInput' then begin
178 | if Assigned(FLogin) then
179 | FLogin.Value := AParams.Values['texto']
180 | end
181 | else if AEventName = 'UniDSALoginPasswordOnInput' then begin
182 | if Assigned(FPassword) then
183 | FPassword.Value := AParams.Values['texto']
184 | end
185 | else if AEventName = 'UniDSALoginLoginNowOnClick' then begin
186 | if Assigned(FOnLoginNow) then
187 | FOnLoginNow(nil);
188 | end
189 | else if AEventName = 'UniDSALoginCreateAccountOnClick' then begin
190 | if Assigned(FOnCreateAccount) then
191 | FOnCreateAccount(nil);
192 | end
193 | else if AEventName = 'UniDSALoginRememberMeOnClick' then begin
194 | FRememberMe.SetVarChecked(IIf(AParams.Values['checked'] = 'S', True, False));
195 |
196 | if Assigned(FOnRememberMe) then
197 | FOnRememberMe(nil);
198 | end
199 | else if AEventName = 'UniDSALoginForgetPasswordOnClick' then begin
200 | if Assigned(FOnForgetPassword) then
201 | FOnForgetPassword(nil);
202 | end
203 | else if AEventName = 'UniDSALoginLoginOnEnter' then begin
204 | if Assigned(FOnLoginEnter) then
205 | FOnLoginEnter(nil);
206 | end
207 | else if AEventName = 'UniDSALoginPasswordOnEnter' then begin
208 | if Assigned(FOnPasswordEnter) then
209 | FOnPasswordEnter(nil);
210 | end;
211 | end;
212 |
213 | procedure TUniDSALogin.LoadCompleted;
214 | begin
215 | inherited;
216 | PrepareJS;
217 | PrepareDefault;
218 | PrepareHTML;
219 | end;
220 |
221 | procedure TUniDSALogin.PrepareDefault;
222 | begin
223 | TrimSpacesOnRememberMeForgetPassword := TrimSpacesOnRememberMeForgetPassword;
224 |
225 | CreateAccount.Refresh;
226 | LoginNow.Refresh;
227 | Login.Refresh;
228 | Password.Refresh;
229 | RememberMe.Refresh;
230 | ForgetPassword.Refresh;
231 | Slide.Refresh;
232 | end;
233 |
234 | procedure TUniDSALogin.PrepareHtml;
235 | var
236 | LHTML: TStringBuilder;
237 | begin
238 | if WebMode then begin
239 | LHTML := TStringBuilder.Create;
240 |
241 | try
242 | with LHTML do begin
243 | Append('');
244 | Append('');
245 | Append(' ');
246 | Append(' ');
247 | Append(' ');
248 | Append(' fdsfsd');
249 | Append(' ');
250 | Append(' ');
251 | Append(' ');
252 | Append(' ');
253 | Append(' ');
254 | Append(' ');
255 | Append(' ');
256 | Append(' ');
257 | Append(' ');
258 | Append(' ');
259 | Append(' ');
260 | Append('
');
261 | Append('
');
270 | Append('
');
271 | Append('
');
272 | Append('
');
273 | Append('
');
274 | Append('

');
275 | Append('
');
276 | Append('
');
277 | Append('
');
278 | Append('
');
279 | Append('

');
280 | Append('
');
281 | Append('
');
282 | Append('
' + FTitle + '');
283 | Append(' ');
284 | Append('
');
285 | Append('
');
286 | Append('
');
307 | Append('
');
308 | Append('
');
309 | Append(' ' + FLogin.Caption + '');
310 | Append(' ');
311 | Append('
');
312 | Append('
');
313 |
314 | Append('
');
315 | Append('
');
316 | Append('
');
318 | Append('
');
319 | Append('
');
320 | Append(' ' + FPassword.Caption + '');
321 | Append(' ');
322 | Append('
');
323 | Append('
');
324 |
325 | Append('
');
326 | Append('
');
327 | Append(' ');
328 | Append(' ');
329 | Append('
');
330 | Append('
');
331 | Append(' ' + FForgetPassword.Caption + '');
332 | Append('
');
333 | Append('
');
334 |
335 | Append('
');
336 | Append('
' + FLoginNow.Caption + '
');
337 | Append('
' + FCreateAccount.Caption + '
');
338 | Append('
');
339 |
340 | Append('
');
341 | Append('
');
342 | Append('
');
343 | Append('
');
344 | Append(' ');
345 | Append('');
346 |
347 | Caption := LHTML.ToString;
348 | end;
349 | finally
350 | FreeAndNil(LHTML);
351 | end;
352 | end;
353 | end;
354 |
355 | procedure TUniDSALogin.PrepareJS;
356 | begin
357 | end;
358 |
359 | procedure TUniDSALogin.SetDescription(const Value: string);
360 | begin
361 | JQueryText('#un-lg-id-msg-extra', Value);
362 |
363 | FDescription := Value;
364 | end;
365 |
366 | procedure TUniDSALogin.SetTitle(const Value: string);
367 | begin
368 | JQueryText('#un-lg-id-welcome-back', Value);
369 |
370 | FTitle := Value;
371 | end;
372 |
373 | procedure TUniDSALogin.SetTrimSpacesOnRememberMeForgetPassword(const Value: Boolean);
374 | begin
375 | if Value then
376 | JQueryHide('.un-lg-rm-fp')
377 | else
378 | JQueryShow('.un-lg-rm-fp');
379 |
380 | FTrimSpacesOnRememberMeForgetPassword := Value;
381 | end;
382 |
383 | procedure TUniDSALogin.WebCreate;
384 | begin
385 | inherited;
386 | JSCls := 'x-uni-dsa-login';
387 | end;
388 |
389 | initialization
390 | UniDSASource.GetLink(TTypeUniDSASource.Login);
391 |
392 | end.
393 |
--------------------------------------------------------------------------------