-
Notifications
You must be signed in to change notification settings - Fork 12
/
PackCss.pas
104 lines (89 loc) · 2.41 KB
/
PackCss.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
unit PackCss;
interface
uses
Interfaces,
Classes;
type
TPackCss = class(TInterfacedObject,iModelCSS)
private
FBackgroundColor : String;
FFontColor : String;
FBorderColor : String;
FCDN : Boolean;
public
constructor Create;
destructor Destroy; override;
class function New : iModelCSS;
function PackCSS : String;
function CDN(Value : Boolean) : iModelCSS;
function BackgroundColor ( Value : String ) : iModelCSS;
function BorderColor ( Value : String ) : iModelCSS;
function FontColor ( Value : String ) : iModelCSS;
end;
implementation
uses
StyleCSS,
BootstrapCss,
DataTableCss,
Chart.Easy.PieCSS,
PivotTableCSS;
{ TPackCss }
function TPackCss.BackgroundColor(Value: String): iModelCSS;
begin
Result := Self;
FBackgroundColor := Value;
end;
function TPackCss.BorderColor(Value: String): iModelCSS;
begin
Result := Self;
FBorderColor := Value;
end;
function TPackCss.CDN(Value: Boolean): iModelCSS;
begin
Result := SElf;
FCDN := Value;
end;
constructor TPackCss.Create;
begin
FCDN := False;
end;
destructor TPackCss.Destroy;
begin
inherited;
end;
function TPackCss.FontColor(Value: String): iModelCSS;
begin
Result := Self;
FFontColor := Value;
end;
class function TPackCss.New: iModelCSS;
begin
Result := Self.Create;
end;
function TPackCss.PackCSS: String;
begin
if FCDN then
begin
Result := Result + '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">';
Result := Result + '<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/jq-3.3.1/dt-1.10.20/r-2.2.3/sl-1.3.1/datatables.min.css"/>';
Result := Result + '<link rel="stylesheet" type="text/css" href="http://thuliobittencourt.com/pivotjs/dist/pivot.css">';
Result := Result + TStyleCSS.New
.BackgroundColor(FBackgroundColor)
.FontColor(FFontColor)
.BorderColor(FBorderColor)
.PackCSS;
end
else
Result := TBootstrapCss.New
.PackCSS+
TDataTableCss.New
.PackCSS+
TStyleCSS.New
.BackgroundColor(FBackgroundColor)
.FontColor(FFontColor)
.BorderColor(FBorderColor)
.PackCSS+
TChartEasyPieCSS.New.PackCSS+
TPivotTableCSS.New.PackCSS;
end;
end.