@cdmx/wappler_ag_grid 0.0.9 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/app_connect/components.hjson +163 -3
- package/dmx-ag-grid.js +81 -5
- package/package.json +1 -1
- package/switch-toggle-slider.css +345 -0
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Maintained by: Roney Dsilva
|
|
2
|
+
|
|
2
3
|
This Custom Module provides the below features:
|
|
3
4
|
1. Generates AG-Grid given a Data Source
|
|
4
5
|
2. Automatically sets the Filter types and Date formats
|
|
@@ -12,4 +13,6 @@ This Custom Module provides the below features:
|
|
|
12
13
|
10. Timezone setting for Date fields
|
|
13
14
|
11. Data Manipulation
|
|
14
15
|
12. Theme selection
|
|
15
|
-
13. Row Click Event Handling
|
|
16
|
+
13. Row Click Event Handling
|
|
17
|
+
14. Options to enable checkboxes for IDs for bulk select Operations
|
|
18
|
+
15. Options to enable Toggle Sliders for status fields
|
|
@@ -357,7 +357,23 @@
|
|
|
357
357
|
"title": "Row Click Events",
|
|
358
358
|
"type": "boolean",
|
|
359
359
|
"defaultValue": false,
|
|
360
|
-
"help": "This enabled row click
|
|
360
|
+
"help": "This enabled row click events which can then be used in Dynamic events => Grid Events => Row Clicked"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "rowCheckboxEvent",
|
|
364
|
+
"attribute": "dmx-bind:row_checkbox_event",
|
|
365
|
+
"title": "Row Checkbox Events",
|
|
366
|
+
"type": "boolean",
|
|
367
|
+
"defaultValue": false,
|
|
368
|
+
"help": "This enabled row checkbox events which can then be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"name": "rowStatusEvent",
|
|
372
|
+
"attribute": "dmx-bind:row_status_event",
|
|
373
|
+
"title": "Row Status Events",
|
|
374
|
+
"type": "boolean",
|
|
375
|
+
"defaultValue": false,
|
|
376
|
+
"help": "This enabled row status events which can then be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked"
|
|
361
377
|
}
|
|
362
378
|
]
|
|
363
379
|
},
|
|
@@ -670,6 +686,10 @@
|
|
|
670
686
|
"src": "ag-theme-material.css",
|
|
671
687
|
"dst": "css/ag-theme-material.css"
|
|
672
688
|
},
|
|
689
|
+
{
|
|
690
|
+
"src": "switch-toggle-slider.css",
|
|
691
|
+
"dst": "css/switch-toggle-slider.css"
|
|
692
|
+
},
|
|
673
693
|
{
|
|
674
694
|
"src": "dmx-ag-grid.js",
|
|
675
695
|
"dst": "js/dmx-ag-grid.js"
|
|
@@ -697,6 +717,10 @@
|
|
|
697
717
|
{
|
|
698
718
|
"src": "css/ag-theme-material.css",
|
|
699
719
|
"type": "css"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"src": "css/switch-toggle-slider.css",
|
|
723
|
+
"type": "css"
|
|
700
724
|
}
|
|
701
725
|
],
|
|
702
726
|
"cssOrder": [],
|
|
@@ -751,8 +775,7 @@
|
|
|
751
775
|
"groupIcon": "fa fa-lg fa-cubes",
|
|
752
776
|
"defaultValue": false,
|
|
753
777
|
"show": [
|
|
754
|
-
"rowClicked"
|
|
755
|
-
"rowMods"
|
|
778
|
+
"rowClicked"
|
|
756
779
|
],
|
|
757
780
|
"noChangeOnHide": true,
|
|
758
781
|
"type": "boolean",
|
|
@@ -774,6 +797,143 @@
|
|
|
774
797
|
"allowedOn": {
|
|
775
798
|
"dmx-ag-grid": true
|
|
776
799
|
}
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"name": "dmx-ag-grid-checkbox-checked",
|
|
803
|
+
"attributeStartsWith": "dmx-on",
|
|
804
|
+
"attribute": "row_checkbox_checked",
|
|
805
|
+
"display": "fieldset",
|
|
806
|
+
"title": "Checkbox Checked",
|
|
807
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
808
|
+
"groupTitle": "Grid Events",
|
|
809
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
810
|
+
"defaultValue": false,
|
|
811
|
+
"show": [
|
|
812
|
+
"rowCheckboxChecked"
|
|
813
|
+
],
|
|
814
|
+
"noChangeOnHide": true,
|
|
815
|
+
"type": "boolean",
|
|
816
|
+
"groupEnabler": true,
|
|
817
|
+
"children": [
|
|
818
|
+
{
|
|
819
|
+
"name": "rowCheckboxChecked",
|
|
820
|
+
"attributeStartsWith": "dmx-on",
|
|
821
|
+
"attribute": "row_checkbox_checked",
|
|
822
|
+
"isValue": true,
|
|
823
|
+
"actionsPicker": true,
|
|
824
|
+
"title": "Action:",
|
|
825
|
+
"type": "text",
|
|
826
|
+
"help": "Choose the action to execute.",
|
|
827
|
+
"defaultValue": "",
|
|
828
|
+
"initDisplay": "none"
|
|
829
|
+
}
|
|
830
|
+
],
|
|
831
|
+
"allowedOn": {
|
|
832
|
+
"dmx-ag-grid": true
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
"name": "dmx-ag-grid-checkbox-unchecked",
|
|
837
|
+
"attributeStartsWith": "dmx-on",
|
|
838
|
+
"attribute": "row_checkbox_unchecked",
|
|
839
|
+
"display": "fieldset",
|
|
840
|
+
"title": "Checkbox Unchecked",
|
|
841
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
842
|
+
"groupTitle": "Grid Events",
|
|
843
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
844
|
+
"defaultValue": false,
|
|
845
|
+
"show": [
|
|
846
|
+
"rowCheckboxUnchecked"
|
|
847
|
+
],
|
|
848
|
+
"noChangeOnHide": true,
|
|
849
|
+
"type": "boolean",
|
|
850
|
+
"groupEnabler": true,
|
|
851
|
+
"children": [
|
|
852
|
+
{
|
|
853
|
+
"name": "rowCheckboxUnchecked",
|
|
854
|
+
"attributeStartsWith": "dmx-on",
|
|
855
|
+
"attribute": "row_checkbox_unchecked",
|
|
856
|
+
"isValue": true,
|
|
857
|
+
"actionsPicker": true,
|
|
858
|
+
"title": "Action:",
|
|
859
|
+
"type": "text",
|
|
860
|
+
"help": "Choose the action to execute.",
|
|
861
|
+
"defaultValue": "",
|
|
862
|
+
"initDisplay": "none"
|
|
863
|
+
}
|
|
864
|
+
],
|
|
865
|
+
"allowedOn": {
|
|
866
|
+
"dmx-ag-grid": true
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
,
|
|
870
|
+
{
|
|
871
|
+
"name": "dmx-ag-grid-status-checked",
|
|
872
|
+
"attributeStartsWith": "dmx-on",
|
|
873
|
+
"attribute": "row_status_checked",
|
|
874
|
+
"display": "fieldset",
|
|
875
|
+
"title": "Status Checked",
|
|
876
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
877
|
+
"groupTitle": "Grid Events",
|
|
878
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
879
|
+
"defaultValue": false,
|
|
880
|
+
"show": [
|
|
881
|
+
"rowStatusChecked"
|
|
882
|
+
],
|
|
883
|
+
"noChangeOnHide": true,
|
|
884
|
+
"type": "boolean",
|
|
885
|
+
"groupEnabler": true,
|
|
886
|
+
"children": [
|
|
887
|
+
{
|
|
888
|
+
"name": "rowStatusChecked",
|
|
889
|
+
"attributeStartsWith": "dmx-on",
|
|
890
|
+
"attribute": "row_status_checked",
|
|
891
|
+
"isValue": true,
|
|
892
|
+
"actionsPicker": true,
|
|
893
|
+
"title": "Action:",
|
|
894
|
+
"type": "text",
|
|
895
|
+
"help": "Choose the action to execute.",
|
|
896
|
+
"defaultValue": "",
|
|
897
|
+
"initDisplay": "none"
|
|
898
|
+
}
|
|
899
|
+
],
|
|
900
|
+
"allowedOn": {
|
|
901
|
+
"dmx-ag-grid": true
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"name": "dmx-ag-grid-status-unchecked",
|
|
906
|
+
"attributeStartsWith": "dmx-on",
|
|
907
|
+
"attribute": "row_status_unchecked",
|
|
908
|
+
"display": "fieldset",
|
|
909
|
+
"title": "Status Unchecked",
|
|
910
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
911
|
+
"groupTitle": "Grid Events",
|
|
912
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
913
|
+
"defaultValue": false,
|
|
914
|
+
"show": [
|
|
915
|
+
"rowStatusUnchecked"
|
|
916
|
+
],
|
|
917
|
+
"noChangeOnHide": true,
|
|
918
|
+
"type": "boolean",
|
|
919
|
+
"groupEnabler": true,
|
|
920
|
+
"children": [
|
|
921
|
+
{
|
|
922
|
+
"name": "rowStatusUnchecked",
|
|
923
|
+
"attributeStartsWith": "dmx-on",
|
|
924
|
+
"attribute": "row_status_unchecked",
|
|
925
|
+
"isValue": true,
|
|
926
|
+
"actionsPicker": true,
|
|
927
|
+
"title": "Action:",
|
|
928
|
+
"type": "text",
|
|
929
|
+
"help": "Choose the action to execute.",
|
|
930
|
+
"defaultValue": "",
|
|
931
|
+
"initDisplay": "none"
|
|
932
|
+
}
|
|
933
|
+
],
|
|
934
|
+
"allowedOn": {
|
|
935
|
+
"dmx-ag-grid": true
|
|
936
|
+
}
|
|
777
937
|
}
|
|
778
938
|
],
|
|
779
939
|
"static_events": []
|
package/dmx-ag-grid.js
CHANGED
|
@@ -85,7 +85,10 @@ dmx.Component('ag-grid', {
|
|
|
85
85
|
fixedTopOffset: { type: Number, default: 80 },
|
|
86
86
|
fixedHorizonatalScroll: { type: Boolean, default: false },
|
|
87
87
|
timezone: {type: Text, default: '' },
|
|
88
|
-
row_click_event: {type: Boolean, default: false }
|
|
88
|
+
row_click_event: {type: Boolean, default: false },
|
|
89
|
+
row_checkbox_event: {type: Boolean, default: false },
|
|
90
|
+
row_status_event: {type: Boolean, default: false }
|
|
91
|
+
|
|
89
92
|
},
|
|
90
93
|
|
|
91
94
|
methods: {
|
|
@@ -106,6 +109,8 @@ dmx.Component('ag-grid', {
|
|
|
106
109
|
const timezone = this.props.timezone || false;
|
|
107
110
|
const dataChanges = this.props.data_changes;
|
|
108
111
|
const grid_theme = this.props.grid_theme;
|
|
112
|
+
const enableCheckboxEvent = this.props.row_checkbox_event;
|
|
113
|
+
const enableStatusToggle = this.props.row_status_event;
|
|
109
114
|
let columnDefs = [];
|
|
110
115
|
let exportToCSV = this.props.exportToCSV;
|
|
111
116
|
|
|
@@ -128,7 +133,8 @@ dmx.Component('ag-grid', {
|
|
|
128
133
|
}
|
|
129
134
|
} else if (dataType === 'date') {
|
|
130
135
|
return formatTime(params, timezone);
|
|
131
|
-
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
132
138
|
return blankOrNullValueFormatter(params);
|
|
133
139
|
}
|
|
134
140
|
}
|
|
@@ -137,6 +143,34 @@ dmx.Component('ag-grid', {
|
|
|
137
143
|
this.set('id', idValue);
|
|
138
144
|
this.dispatchEvent('row_clicked')
|
|
139
145
|
};
|
|
146
|
+
window.handleCheckboxClick = (event, columnName, value, idValue) => {
|
|
147
|
+
const isChecked = event.target.checked;
|
|
148
|
+
if (isChecked) {
|
|
149
|
+
// Code for when the checkbox is checked
|
|
150
|
+
this.set('id', idValue);
|
|
151
|
+
this.set('fields', {"field": columnName, "data": value});
|
|
152
|
+
this.dispatchEvent('row_checkbox_checked')
|
|
153
|
+
} else {
|
|
154
|
+
// Code for when the checkbox is unchecked
|
|
155
|
+
this.set('id', idValue);
|
|
156
|
+
this.set('fields', {"field": columnName, "data": value});
|
|
157
|
+
this.dispatchEvent('row_checkbox_unchecked')
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
window.handleStatusToggle = (event, columnName, value, idValue) => {
|
|
161
|
+
const isChecked = event.target.checked;
|
|
162
|
+
if (isChecked) {
|
|
163
|
+
// Code for when the checkbox is checked
|
|
164
|
+
this.set('id', idValue);
|
|
165
|
+
this.set('fields', {"field": columnName, "data": value});
|
|
166
|
+
this.dispatchEvent('row_status_checked')
|
|
167
|
+
} else {
|
|
168
|
+
// Code for when the checkbox is unchecked
|
|
169
|
+
this.set('id', idValue);
|
|
170
|
+
this.set('fields', {"field": columnName, "data": value});
|
|
171
|
+
this.dispatchEvent('row_status_unchecked')
|
|
172
|
+
}
|
|
173
|
+
};
|
|
140
174
|
function clickCellRenderer(params) {
|
|
141
175
|
const idValue = params.data.id;
|
|
142
176
|
const columnName = params.colDef.field;
|
|
@@ -144,6 +178,43 @@ dmx.Component('ag-grid', {
|
|
|
144
178
|
const value = formatValue(params.value, columnName, dataType, timezone);
|
|
145
179
|
return `<div onclick="clickEvent('${columnName}', '${value}', '${idValue}')" style="cursor: pointer;">${value}</div>`;
|
|
146
180
|
}
|
|
181
|
+
function checkboxCellRenderer(params) {
|
|
182
|
+
const idValue = params.data.id;
|
|
183
|
+
const columnName = params.colDef.field;
|
|
184
|
+
const dataType = detectDataType([params.value]);
|
|
185
|
+
const value = formatValue(params.value, columnName, dataType, timezone);
|
|
186
|
+
|
|
187
|
+
if (columnName === "id") {
|
|
188
|
+
return `
|
|
189
|
+
<input
|
|
190
|
+
type="checkbox"
|
|
191
|
+
onclick="handleCheckboxClick(event, '${columnName}', '${value}', '${idValue}')"
|
|
192
|
+
/>
|
|
193
|
+
`;
|
|
194
|
+
} else if (columnName == "status" && enableStatusToggle) {
|
|
195
|
+
// Assuming `value` is a boolean representing the status
|
|
196
|
+
const checked = value==true ? "checked" : "";
|
|
197
|
+
return `
|
|
198
|
+
<label class="switch switch-success">
|
|
199
|
+
<input
|
|
200
|
+
type="checkbox" class="switch-input"
|
|
201
|
+
${checked}
|
|
202
|
+
onclick="handleStatusToggle(event, '${columnName}', '${value}', '${idValue}')"
|
|
203
|
+
/>
|
|
204
|
+
<span class="switch-toggle-slider" role="status">
|
|
205
|
+
</span>
|
|
206
|
+
<span class="switch-on">
|
|
207
|
+
<i class="bx bx-check"></i>
|
|
208
|
+
</span>
|
|
209
|
+
<span class="switch-off">
|
|
210
|
+
<i class="bx bx-x"></i>
|
|
211
|
+
</span>
|
|
212
|
+
</label>
|
|
213
|
+
`;
|
|
214
|
+
} else {
|
|
215
|
+
return value;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
147
218
|
|
|
148
219
|
|
|
149
220
|
function humanize(str) {
|
|
@@ -356,7 +427,7 @@ const cstyles = this.props.cstyles
|
|
|
356
427
|
minWidth: parseInt(cwidths[key].min_width),
|
|
357
428
|
maxWidth: parseInt(cwidths[key].max_width),
|
|
358
429
|
}),
|
|
359
|
-
cellRenderer: enableClickEvent ? 'clickCellRenderer' : undefined
|
|
430
|
+
cellRenderer: enableClickEvent ? 'clickCellRenderer' : (enableCheckboxEvent ? 'checkboxCellRenderer' : undefined)
|
|
360
431
|
};
|
|
361
432
|
});
|
|
362
433
|
}
|
|
@@ -390,7 +461,8 @@ const cstyles = this.props.cstyles
|
|
|
390
461
|
suppressPropertyNamesCheck: this.props.suppressPropertyNamesCheck,
|
|
391
462
|
localeText: this.props.localeText,
|
|
392
463
|
components: {
|
|
393
|
-
clickCellRenderer: clickCellRenderer
|
|
464
|
+
clickCellRenderer: clickCellRenderer,
|
|
465
|
+
checkboxCellRenderer: checkboxCellRenderer
|
|
394
466
|
}
|
|
395
467
|
};
|
|
396
468
|
|
|
@@ -468,7 +540,11 @@ const cstyles = this.props.cstyles
|
|
|
468
540
|
},
|
|
469
541
|
|
|
470
542
|
events: {
|
|
471
|
-
row_clicked: Event
|
|
543
|
+
row_clicked: Event,
|
|
544
|
+
row_checkbox_checked: Event,
|
|
545
|
+
row_checkbox_unchecked: Event,
|
|
546
|
+
row_status_checked: Event,
|
|
547
|
+
row_status_unchecked: Event
|
|
472
548
|
},
|
|
473
549
|
|
|
474
550
|
render: function(node) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
.select-wrapper-status {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.select-wrapper-status i.fa {
|
|
6
|
+
position: absolute;
|
|
7
|
+
right: 20px;
|
|
8
|
+
top: 50%;
|
|
9
|
+
transform: translateY(-50%);
|
|
10
|
+
}
|
|
11
|
+
.switch {
|
|
12
|
+
margin-right: 0.75rem;
|
|
13
|
+
position: relative;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
display: inline-block;
|
|
17
|
+
border-radius: 30rem;
|
|
18
|
+
min-height: 1.35rem;
|
|
19
|
+
font-size: 0.9375rem;
|
|
20
|
+
line-height: 1.4;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.switch .switch-label:first-child {
|
|
24
|
+
padding-right: 0.5rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.switch .switch-input~.switch-label {
|
|
28
|
+
padding-left: 3rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.switch .switch-toggle-slider {
|
|
32
|
+
width: 2.5rem;
|
|
33
|
+
height: 1.35rem;
|
|
34
|
+
font-size: 0.625rem;
|
|
35
|
+
line-height: 1.35rem;
|
|
36
|
+
border: 1px solid transparent;
|
|
37
|
+
top: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.switch .switch-toggle-slider i {
|
|
41
|
+
position: relative;
|
|
42
|
+
font-size: 0.9375rem;
|
|
43
|
+
top: -1.35px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.switch .switch-label {
|
|
47
|
+
top: 0.01875rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.switch .switch-input:checked~.switch-toggle-slider::after {
|
|
51
|
+
left: 1.15rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.switch .switch-toggle-slider::after {
|
|
55
|
+
top: -1px;
|
|
56
|
+
margin: 0.25rem 0 0 0.25rem;
|
|
57
|
+
width: 13px;
|
|
58
|
+
height: 13px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.switch .switch-on {
|
|
62
|
+
padding-left: 0.25rem;
|
|
63
|
+
padding-right: 1.1rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.switch .switch-off {
|
|
67
|
+
padding-left: 1.1rem;
|
|
68
|
+
padding-right: 0.25rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[dir=rtl] .switch .switch-label {
|
|
72
|
+
padding-right: 3rem;
|
|
73
|
+
padding-left: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[dir=rtl] .switch .switch-input:checked~.switch-toggle-slider::after {
|
|
77
|
+
left: auto;
|
|
78
|
+
right: 1.15rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[dir=rtl] .switch .switch-toggle-slider::after {
|
|
82
|
+
margin-left: 0;
|
|
83
|
+
margin-right: 0.25rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[dir=rtl] .switch .switch-on {
|
|
87
|
+
padding-left: 1.1rem;
|
|
88
|
+
padding-right: 0.25rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[dir=rtl] .switch .switch-off {
|
|
92
|
+
padding-left: 0.25rem;
|
|
93
|
+
padding-right: 1.1rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[dir=rtl] .switch {
|
|
97
|
+
margin-left: 0.75rem;
|
|
98
|
+
margin-right: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.switch-input {
|
|
102
|
+
opacity: 0;
|
|
103
|
+
position: absolute;
|
|
104
|
+
padding: 0;
|
|
105
|
+
margin: 0;
|
|
106
|
+
z-index: -1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.switch-toggle-slider {
|
|
110
|
+
position: absolute;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
border-radius: 30rem;
|
|
113
|
+
background: #e9ecee;
|
|
114
|
+
color: #677788;
|
|
115
|
+
-webkit-transition-duration: 0.2s;
|
|
116
|
+
transition-duration: 0.2s;
|
|
117
|
+
-webkit-transition-property: left, right, background, -webkit-box-shadow;
|
|
118
|
+
transition-property: left, right, background, -webkit-box-shadow;
|
|
119
|
+
transition-property: left, right, background, box-shadow;
|
|
120
|
+
transition-property: left, right, background, box-shadow, -webkit-box-shadow;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
-webkit-user-select: none;
|
|
123
|
+
-moz-user-select: none;
|
|
124
|
+
-ms-user-select: none;
|
|
125
|
+
user-select: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.switch-label {
|
|
129
|
+
display: inline-block;
|
|
130
|
+
font-weight: 400;
|
|
131
|
+
color: #677788;
|
|
132
|
+
position: relative;
|
|
133
|
+
cursor: default;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.switch-off,
|
|
137
|
+
.switch-on {
|
|
138
|
+
height: 100%;
|
|
139
|
+
width: 100%;
|
|
140
|
+
text-align: center;
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: 0;
|
|
143
|
+
-webkit-transition-duration: 0.2s;
|
|
144
|
+
transition-duration: 0.2s;
|
|
145
|
+
-webkit-transition-property: left, right;
|
|
146
|
+
transition-property: left, right;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.switch-on {
|
|
150
|
+
left: -100%;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[dir=rtl] .switch-on {
|
|
154
|
+
left: auto;
|
|
155
|
+
right: -100%;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.switch-input:not(:checked)~.switch-toggle-slider .switch-on {
|
|
159
|
+
color: transparent;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.switch-off {
|
|
163
|
+
left: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[dir=rtl] .switch-off {
|
|
167
|
+
right: 0;
|
|
168
|
+
left: auto;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.switch-input:checked~.switch-toggle-slider .switch-on {
|
|
172
|
+
left: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[dir=rtl] .switch-input:checked~.switch-toggle-slider .switch-on {
|
|
176
|
+
right: 0;
|
|
177
|
+
left: auto;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.switch-input:checked~.switch-toggle-slider .switch-off {
|
|
181
|
+
left: 100%;
|
|
182
|
+
color: transparent;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
[dir=rtl] .switch-input:checked~.switch-toggle-slider .switch-off {
|
|
186
|
+
right: 100%;
|
|
187
|
+
left: auto;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.switch-toggle-slider::after {
|
|
191
|
+
content: "";
|
|
192
|
+
position: absolute;
|
|
193
|
+
left: 0;
|
|
194
|
+
display: block;
|
|
195
|
+
border-radius: 999px;
|
|
196
|
+
background: #fff;
|
|
197
|
+
-webkit-box-shadow: -1px 2px 3px 0 rgba(0, 0, 0, 0.2);
|
|
198
|
+
box-shadow: -1px 2px 3px 0 rgba(0, 0, 0, 0.2);
|
|
199
|
+
-webkit-transition-duration: 0.2s;
|
|
200
|
+
transition-duration: 0.2s;
|
|
201
|
+
-webkit-transition-property: left, right, background;
|
|
202
|
+
transition-property: left, right, background;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
[dir=rtl] .switch-toggle-slider::after {
|
|
206
|
+
right: 0;
|
|
207
|
+
left: auto;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.switches-stacked::after {
|
|
211
|
+
display: block;
|
|
212
|
+
clear: both;
|
|
213
|
+
content: "";
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.switches-stacked .switch {
|
|
217
|
+
display: block;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
html:not([dir=rtl]) .switches-stacked .switch {
|
|
221
|
+
margin-right: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
[dir=rtl] .switches-stacked .switch {
|
|
225
|
+
margin-left: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.switches-stacked .switch:not(:last-child) {
|
|
229
|
+
margin-bottom: 0.75rem;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.switch-square,
|
|
233
|
+
.switch-square .switch-toggle-slider {
|
|
234
|
+
border-radius: 0.25rem;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.switch-square .switch-toggle-slider::after {
|
|
238
|
+
border-radius: calc(0.25rem - 2px);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.switch-input:disabled~.switch-toggle-slider {
|
|
242
|
+
opacity: 0.65;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.switch-input:disabled~.switch-toggle-slider::after {
|
|
246
|
+
-webkit-box-shadow: none;
|
|
247
|
+
box-shadow: none;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.switch-input:disabled~.switch-label {
|
|
251
|
+
color: #a8b1bb;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.switch-success.switch .switch-input:checked~.switch-toggle-slider {
|
|
255
|
+
background: #39da8a;
|
|
256
|
+
color: #fff;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.switch-success.switch .switch-input:active~.switch-toggle-slider {
|
|
260
|
+
-webkit-box-shadow: none;
|
|
261
|
+
box-shadow: none;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.switch-success.switch .switch-input:focus~.switch-toggle-slider {
|
|
265
|
+
-webkit-box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
266
|
+
box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.switch-info.switch .switch-input:checked~.switch-toggle-slider {
|
|
270
|
+
background: #00cfdd;
|
|
271
|
+
color: #fff;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.switch-info.switch .switch-input:active~.switch-toggle-slider {
|
|
275
|
+
-webkit-box-shadow: none;
|
|
276
|
+
box-shadow: none;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.switch-info.switch .switch-input:focus~.switch-toggle-slider {
|
|
280
|
+
-webkit-box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
281
|
+
box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.switch-warning.switch .switch-input:checked~.switch-toggle-slider {
|
|
285
|
+
background: #fdac41;
|
|
286
|
+
color: #fff;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.switch-warning.switch .switch-input:active~.switch-toggle-slider {
|
|
290
|
+
-webkit-box-shadow: none;
|
|
291
|
+
box-shadow: none;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.switch-warning.switch .switch-input:focus~.switch-toggle-slider {
|
|
295
|
+
-webkit-box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
296
|
+
box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.switch-danger.switch .switch-input:checked~.switch-toggle-slider {
|
|
300
|
+
background: #ff5b5c;
|
|
301
|
+
color: #fff;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.switch-danger.switch .switch-input:active~.switch-toggle-slider {
|
|
305
|
+
-webkit-box-shadow: none;
|
|
306
|
+
box-shadow: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.switch-danger.switch .switch-input:focus~.switch-toggle-slider {
|
|
310
|
+
-webkit-box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
311
|
+
box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.switch-dark.switch .switch-input:checked~.switch-toggle-slider {
|
|
315
|
+
background: #495563;
|
|
316
|
+
color: #fff;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.switch-dark.switch .switch-input:active~.switch-toggle-slider {
|
|
320
|
+
-webkit-box-shadow: none;
|
|
321
|
+
box-shadow: none;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.switch-dark.switch .switch-input:focus~.switch-toggle-slider {
|
|
325
|
+
-webkit-box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
326
|
+
box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.switch-gray.switch .switch-input:checked~.switch-toggle-slider {
|
|
330
|
+
background: rgba(38, 60, 85, 0.5);
|
|
331
|
+
color: #fff;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.switch-gray.switch .switch-input:active~.switch-toggle-slider {
|
|
335
|
+
-webkit-box-shadow: none;
|
|
336
|
+
box-shadow: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.switch-gray.switch .switch-input:focus~.switch-toggle-slider {
|
|
340
|
+
-webkit-box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
341
|
+
box-shadow: 0 0 0 0.12rem rgba(147, 158, 170, 0.3);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|