@six-group/ui-library 0.0.0-insider.db2b416 → 0.0.0-insider.e2aca06
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 +9 -0
- package/dist/cjs/{form-control-d369af14.js → form-control-9769b310.js} +10 -7
- package/dist/cjs/form-control-9769b310.js.map +1 -0
- package/dist/cjs/index-900437fc.js +214 -1
- package/dist/cjs/index-900437fc.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/six-checkbox.cjs.entry.js +8 -13
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +5 -8
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error.cjs.entry.js +21 -0
- package/dist/cjs/six-error.cjs.entry.js.map +1 -0
- package/dist/cjs/six-group-label.cjs.entry.js +2 -2
- package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
- package/dist/cjs/six-input.cjs.entry.js +6 -3
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-radio.cjs.entry.js +9 -17
- package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/six-range.cjs.entry.js +6 -3
- package/dist/cjs/six-range.cjs.entry.js.map +1 -1
- package/dist/cjs/six-select.cjs.entry.js +12 -8
- package/dist/cjs/six-select.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
- package/dist/cjs/six-switch.cjs.entry.js +25 -5
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tag.cjs.entry.js +24 -2
- package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js +6 -3
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/six-timepicker.cjs.entry.js +4 -9
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/ui-library.cjs.js +2 -2
- package/dist/cjs/ui-library.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/six-checkbox/six-checkbox.css +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.js +27 -31
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +25 -12
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
- package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
- package/dist/collection/components/six-error/six-error.css +5 -0
- package/dist/collection/components/six-error/six-error.js +25 -0
- package/dist/collection/components/six-error/six-error.js.map +1 -0
- package/dist/collection/components/six-group-label/six-group-label.css +1 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
- package/dist/collection/components/six-input/six-input.css +2 -2
- package/dist/collection/components/six-input/six-input.js +27 -4
- package/dist/collection/components/six-input/six-input.js.map +1 -1
- package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
- package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
- package/dist/collection/components/six-radio/six-radio.js +9 -34
- package/dist/collection/components/six-radio/six-radio.js.map +1 -1
- package/dist/collection/components/six-range/six-range.css +1 -1
- package/dist/collection/components/six-range/six-range.js +24 -3
- package/dist/collection/components/six-range/six-range.js.map +1 -1
- package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
- package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
- package/dist/collection/components/six-select/six-select.css +7 -10
- package/dist/collection/components/six-select/six-select.js +30 -8
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-select/test/six-select.spec.js +8 -4
- package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
- package/dist/collection/components/six-sidebar/six-sidebar.css +1 -0
- package/dist/collection/components/six-switch/six-switch.css +1 -1
- package/dist/collection/components/six-switch/six-switch.js +48 -5
- package/dist/collection/components/six-switch/six-switch.js.map +1 -1
- package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
- package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
- package/dist/collection/components/six-tag/six-tag.css +6 -0
- package/dist/collection/components/six-tag/six-tag.js +23 -1
- package/dist/collection/components/six-tag/six-tag.js.map +1 -1
- package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
- package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
- package/dist/collection/components/six-textarea/six-textarea.css +1 -1
- package/dist/collection/components/six-textarea/six-textarea.js +25 -4
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
- package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
- package/dist/collection/functional-components/form-control/form-control.js +8 -6
- package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
- package/dist/components/form-control.js +9 -6
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/six-checkbox.js +17 -15
- package/dist/components/six-checkbox.js.map +1 -1
- package/dist/components/six-datepicker.js +13 -9
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-dropdown2.js +8 -2
- package/dist/components/six-dropdown2.js.map +1 -1
- package/dist/components/six-error.d.ts +11 -0
- package/dist/components/six-error.js +8 -0
- package/dist/components/six-error.js.map +1 -0
- package/dist/components/six-error2.js +32 -0
- package/dist/components/six-error2.js.map +1 -0
- package/dist/components/six-group-label.js +8 -2
- package/dist/components/six-group-label.js.map +1 -1
- package/dist/components/six-header.js +8 -2
- package/dist/components/six-header.js.map +1 -1
- package/dist/components/six-input2.js +14 -3
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-radio.js +10 -19
- package/dist/components/six-radio.js.map +1 -1
- package/dist/components/six-range.js +14 -3
- package/dist/components/six-range.js.map +1 -1
- package/dist/components/six-search-field.js +7 -1
- package/dist/components/six-search-field.js.map +1 -1
- package/dist/components/six-select.js +39 -21
- package/dist/components/six-select.js.map +1 -1
- package/dist/components/six-sidebar.js +1 -1
- package/dist/components/six-sidebar.js.map +1 -1
- package/dist/components/six-switch.js +33 -5
- package/dist/components/six-switch.js.map +1 -1
- package/dist/components/six-tag2.js +34 -6
- package/dist/components/six-tag2.js.map +1 -1
- package/dist/components/six-textarea.js +14 -3
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components/six-timepicker2.js +12 -10
- package/dist/components/six-timepicker2.js.map +1 -1
- package/dist/components/six-tooltip2.js +2 -2
- package/dist/components/six-tooltip2.js.map +1 -1
- package/dist/components.json +420 -93
- package/dist/esm/{form-control-32cb533f.js → form-control-b0febe88.js} +10 -7
- package/dist/esm/form-control-b0febe88.js.map +1 -0
- package/dist/esm/index-8a74f992.js +214 -1
- package/dist/esm/index-8a74f992.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/six-checkbox.entry.js +8 -13
- package/dist/esm/six-checkbox.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +5 -8
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-dropdown_2.entry.js +1 -1
- package/dist/esm/six-dropdown_2.entry.js.map +1 -1
- package/dist/esm/six-error.entry.js +17 -0
- package/dist/esm/six-error.entry.js.map +1 -0
- package/dist/esm/six-group-label.entry.js +2 -2
- package/dist/esm/six-group-label.entry.js.map +1 -1
- package/dist/esm/six-input.entry.js +6 -3
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-radio.entry.js +9 -17
- package/dist/esm/six-radio.entry.js.map +1 -1
- package/dist/esm/six-range.entry.js +6 -3
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-select.entry.js +12 -8
- package/dist/esm/six-select.entry.js.map +1 -1
- package/dist/esm/six-sidebar.entry.js +1 -1
- package/dist/esm/six-sidebar.entry.js.map +1 -1
- package/dist/esm/six-switch.entry.js +25 -5
- package/dist/esm/six-switch.entry.js.map +1 -1
- package/dist/esm/six-tag.entry.js +24 -2
- package/dist/esm/six-tag.entry.js.map +1 -1
- package/dist/esm/six-textarea.entry.js +6 -3
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/six-timepicker.entry.js +4 -9
- package/dist/esm/six-timepicker.entry.js.map +1 -1
- package/dist/esm/six-tooltip.entry.js +2 -2
- package/dist/esm/six-tooltip.entry.js.map +1 -1
- package/dist/esm/ui-library.js +2 -2
- package/dist/esm/ui-library.js.map +1 -1
- package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -5
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
- package/dist/types/components/six-error/six-error.d.ts +9 -0
- package/dist/types/components/six-input/six-input.d.ts +7 -2
- package/dist/types/components/six-radio/six-radio.d.ts +0 -5
- package/dist/types/components/six-range/six-range.d.ts +4 -1
- package/dist/types/components/six-select/six-select.d.ts +4 -1
- package/dist/types/components/six-switch/six-switch.d.ts +8 -1
- package/dist/types/components/six-tag/six-tag.d.ts +8 -0
- package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
- package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
- package/dist/types/components.d.ts +109 -24
- package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
- package/dist/ui-library/{p-da19c7ce.entry.js → p-14c1ec31.entry.js} +2 -2
- package/dist/ui-library/p-14c1ec31.entry.js.map +1 -0
- package/dist/ui-library/p-25bb1752.entry.js +2 -0
- package/dist/ui-library/p-25bb1752.entry.js.map +1 -0
- package/dist/ui-library/p-264d4ea8.entry.js +2 -0
- package/dist/ui-library/p-264d4ea8.entry.js.map +1 -0
- package/dist/ui-library/p-2a141e10.entry.js +2 -0
- package/dist/ui-library/p-2a141e10.entry.js.map +1 -0
- package/dist/ui-library/p-4435ff73.entry.js +2 -0
- package/dist/ui-library/p-4435ff73.entry.js.map +1 -0
- package/dist/ui-library/p-538f3c50.entry.js +2 -0
- package/dist/ui-library/p-538f3c50.entry.js.map +1 -0
- package/dist/ui-library/p-6153045b.js.map +1 -1
- package/dist/ui-library/p-a457fee8.entry.js +2 -0
- package/dist/ui-library/p-a457fee8.entry.js.map +1 -0
- package/dist/ui-library/p-ab91c2a9.entry.js +2 -0
- package/dist/ui-library/p-ab91c2a9.entry.js.map +1 -0
- package/dist/ui-library/p-b57afbe4.entry.js +2 -0
- package/dist/ui-library/p-b57afbe4.entry.js.map +1 -0
- package/dist/ui-library/p-b6f47c9d.entry.js +2 -0
- package/dist/ui-library/p-b6f47c9d.entry.js.map +1 -0
- package/dist/ui-library/p-db34a6cc.entry.js +2 -0
- package/dist/ui-library/p-db34a6cc.entry.js.map +1 -0
- package/dist/ui-library/p-db936ad7.entry.js +2 -0
- package/dist/ui-library/{p-d367f4f9.entry.js.map → p-db936ad7.entry.js.map} +1 -1
- package/dist/ui-library/p-dc4f41d8.entry.js +2 -0
- package/dist/ui-library/p-dc4f41d8.entry.js.map +1 -0
- package/dist/ui-library/p-e5020f0d.js +2 -0
- package/dist/ui-library/p-e5020f0d.js.map +1 -0
- package/dist/ui-library/p-e775dcb4.entry.js +2 -0
- package/dist/ui-library/p-e775dcb4.entry.js.map +1 -0
- package/dist/ui-library/p-f1dc3a88.entry.js +2 -0
- package/dist/ui-library/p-f1dc3a88.entry.js.map +1 -0
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/form-control-d369af14.js.map +0 -1
- package/dist/esm/form-control-32cb533f.js.map +0 -1
- package/dist/ui-library/p-1730a174.entry.js +0 -2
- package/dist/ui-library/p-1730a174.entry.js.map +0 -1
- package/dist/ui-library/p-1d0bee53.entry.js +0 -2
- package/dist/ui-library/p-1d0bee53.entry.js.map +0 -1
- package/dist/ui-library/p-314b2096.entry.js +0 -2
- package/dist/ui-library/p-314b2096.entry.js.map +0 -1
- package/dist/ui-library/p-330a4988.entry.js +0 -2
- package/dist/ui-library/p-330a4988.entry.js.map +0 -1
- package/dist/ui-library/p-4abed9df.entry.js +0 -2
- package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
- package/dist/ui-library/p-5d6b7353.entry.js +0 -2
- package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
- package/dist/ui-library/p-6eb24bcb.entry.js +0 -2
- package/dist/ui-library/p-6eb24bcb.entry.js.map +0 -1
- package/dist/ui-library/p-72254eef.entry.js +0 -2
- package/dist/ui-library/p-72254eef.entry.js.map +0 -1
- package/dist/ui-library/p-cf49252a.entry.js +0 -2
- package/dist/ui-library/p-cf49252a.entry.js.map +0 -1
- package/dist/ui-library/p-d367f4f9.entry.js +0 -2
- package/dist/ui-library/p-d42c2025.js +0 -2
- package/dist/ui-library/p-d42c2025.js.map +0 -1
- package/dist/ui-library/p-da19c7ce.entry.js.map +0 -1
- package/dist/ui-library/p-e0b13ad3.entry.js +0 -2
- package/dist/ui-library/p-e0b13ad3.entry.js.map +0 -1
- package/dist/ui-library/p-f1eb03ba.entry.js +0 -2
- package/dist/ui-library/p-f1eb03ba.entry.js.map +0 -1
- package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
- package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
- package/readme.md +0 -156
|
@@ -223,7 +223,11 @@ export namespace Components {
|
|
|
223
223
|
/**
|
|
224
224
|
* The error message shown, if `invalid` is set to true.
|
|
225
225
|
*/
|
|
226
|
-
"errorText": string;
|
|
226
|
+
"errorText": string | string[];
|
|
227
|
+
/**
|
|
228
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
229
|
+
*/
|
|
230
|
+
"errorTextCount"?: number;
|
|
227
231
|
/**
|
|
228
232
|
* Set to true to draw the checkbox in an indeterminate state.
|
|
229
233
|
*/
|
|
@@ -248,10 +252,6 @@ export namespace Components {
|
|
|
248
252
|
* Set to true to show an asterisk beneath the label.
|
|
249
253
|
*/
|
|
250
254
|
"required": boolean;
|
|
251
|
-
/**
|
|
252
|
-
* Resets the formcontrol
|
|
253
|
-
*/
|
|
254
|
-
"reset": () => Promise<void>;
|
|
255
255
|
/**
|
|
256
256
|
* Sets focus on the checkbox.
|
|
257
257
|
*/
|
|
@@ -301,7 +301,11 @@ export namespace Components {
|
|
|
301
301
|
/**
|
|
302
302
|
* The error message shown, if `invalid` is set to true.
|
|
303
303
|
*/
|
|
304
|
-
"errorText": string;
|
|
304
|
+
"errorText": string | string[];
|
|
305
|
+
/**
|
|
306
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
307
|
+
*/
|
|
308
|
+
"errorTextCount"?: number;
|
|
305
309
|
/**
|
|
306
310
|
* Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`.
|
|
307
311
|
*/
|
|
@@ -585,6 +589,12 @@ export namespace Components {
|
|
|
585
589
|
*/
|
|
586
590
|
"virtualScroll": boolean;
|
|
587
591
|
}
|
|
592
|
+
/**
|
|
593
|
+
* @since 4.0
|
|
594
|
+
* @status beta
|
|
595
|
+
*/
|
|
596
|
+
interface SixError {
|
|
597
|
+
}
|
|
588
598
|
interface SixErrorPage {
|
|
589
599
|
/**
|
|
590
600
|
* Defines a custom description.
|
|
@@ -816,7 +826,11 @@ export namespace Components {
|
|
|
816
826
|
/**
|
|
817
827
|
* The error message shown, if `invalid` is set to true.
|
|
818
828
|
*/
|
|
819
|
-
"errorText": string;
|
|
829
|
+
"errorText": string | string[];
|
|
830
|
+
/**
|
|
831
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
832
|
+
*/
|
|
833
|
+
"errorTextCount"?: number;
|
|
820
834
|
/**
|
|
821
835
|
* The input's help text. Alternatively, you can use the help-text slot.
|
|
822
836
|
*/
|
|
@@ -1164,10 +1178,6 @@ export namespace Components {
|
|
|
1164
1178
|
* Removes focus from the radio.
|
|
1165
1179
|
*/
|
|
1166
1180
|
"removeFocus": () => Promise<void>;
|
|
1167
|
-
/**
|
|
1168
|
-
* Resets the formcontrol
|
|
1169
|
-
*/
|
|
1170
|
-
"reset": () => Promise<void>;
|
|
1171
1181
|
/**
|
|
1172
1182
|
* Sets focus on the radio.
|
|
1173
1183
|
*/
|
|
@@ -1190,7 +1200,11 @@ export namespace Components {
|
|
|
1190
1200
|
/**
|
|
1191
1201
|
* The error message shown, if `invalid` is set to true.
|
|
1192
1202
|
*/
|
|
1193
|
-
"errorText": string;
|
|
1203
|
+
"errorText": string | string[];
|
|
1204
|
+
/**
|
|
1205
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
1206
|
+
*/
|
|
1207
|
+
"errorTextCount"?: number;
|
|
1194
1208
|
/**
|
|
1195
1209
|
* The range's help text. Alternatively, you can use the help-text slot.
|
|
1196
1210
|
*/
|
|
@@ -1317,7 +1331,11 @@ export namespace Components {
|
|
|
1317
1331
|
/**
|
|
1318
1332
|
* The error message shown, if `invalid` is set to true.
|
|
1319
1333
|
*/
|
|
1320
|
-
"errorText": string;
|
|
1334
|
+
"errorText": string | string[];
|
|
1335
|
+
/**
|
|
1336
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
1337
|
+
*/
|
|
1338
|
+
"errorTextCount"?: number;
|
|
1321
1339
|
/**
|
|
1322
1340
|
* Set to true to allow filtering for entries in the dropdown
|
|
1323
1341
|
*/
|
|
@@ -1519,7 +1537,11 @@ export namespace Components {
|
|
|
1519
1537
|
/**
|
|
1520
1538
|
* The error message shown, if `invalid` is set to true.
|
|
1521
1539
|
*/
|
|
1522
|
-
"errorText": string;
|
|
1540
|
+
"errorText": string | string[];
|
|
1541
|
+
/**
|
|
1542
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
1543
|
+
*/
|
|
1544
|
+
"errorTextCount"?: number;
|
|
1523
1545
|
/**
|
|
1524
1546
|
* If this property is set to true and an error message is provided by `errorText`, the error message is displayed.
|
|
1525
1547
|
*/
|
|
@@ -1666,7 +1688,11 @@ export namespace Components {
|
|
|
1666
1688
|
/**
|
|
1667
1689
|
* The error message shown, if `invalid` is set to true.
|
|
1668
1690
|
*/
|
|
1669
|
-
"errorText": string;
|
|
1691
|
+
"errorText": string | string[];
|
|
1692
|
+
/**
|
|
1693
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
1694
|
+
*/
|
|
1695
|
+
"errorTextCount"?: number;
|
|
1670
1696
|
/**
|
|
1671
1697
|
* The textarea's help text. Alternatively, you can use the help-text slot.
|
|
1672
1698
|
*/
|
|
@@ -1814,7 +1840,11 @@ export namespace Components {
|
|
|
1814
1840
|
/**
|
|
1815
1841
|
* The input's error text. Alternatively, you can use the error-text slot.
|
|
1816
1842
|
*/
|
|
1817
|
-
"errorText": string;
|
|
1843
|
+
"errorText": string | string[];
|
|
1844
|
+
/**
|
|
1845
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
1846
|
+
*/
|
|
1847
|
+
"errorTextCount"?: number;
|
|
1818
1848
|
/**
|
|
1819
1849
|
* Define the time format. Valid formats are: HH:mm:ss hh:mm:ss:aa HH:mm:ss:ms hh:mm:ss:ms:aa HH:mm hh:mm:aa HH hh:aa mm ss ms where HH is the 24 hour format and hh is the 12 hour format Please notice that when using the 12-hour-clock (hh) you always need a period indicator (aa). So the time can be parsed as either am or pm
|
|
1820
1850
|
*/
|
|
@@ -2185,6 +2215,16 @@ declare global {
|
|
|
2185
2215
|
prototype: HTMLSixDropdownElement;
|
|
2186
2216
|
new (): HTMLSixDropdownElement;
|
|
2187
2217
|
};
|
|
2218
|
+
/**
|
|
2219
|
+
* @since 4.0
|
|
2220
|
+
* @status beta
|
|
2221
|
+
*/
|
|
2222
|
+
interface HTMLSixErrorElement extends Components.SixError, HTMLStencilElement {
|
|
2223
|
+
}
|
|
2224
|
+
var HTMLSixErrorElement: {
|
|
2225
|
+
prototype: HTMLSixErrorElement;
|
|
2226
|
+
new (): HTMLSixErrorElement;
|
|
2227
|
+
};
|
|
2188
2228
|
interface HTMLSixErrorPageElement extends Components.SixErrorPage, HTMLStencilElement {
|
|
2189
2229
|
}
|
|
2190
2230
|
var HTMLSixErrorPageElement: {
|
|
@@ -2605,6 +2645,7 @@ declare global {
|
|
|
2605
2645
|
"six-dialog": HTMLSixDialogElement;
|
|
2606
2646
|
"six-drawer": HTMLSixDrawerElement;
|
|
2607
2647
|
"six-dropdown": HTMLSixDropdownElement;
|
|
2648
|
+
"six-error": HTMLSixErrorElement;
|
|
2608
2649
|
"six-error-page": HTMLSixErrorPageElement;
|
|
2609
2650
|
"six-file-list": HTMLSixFileListElement;
|
|
2610
2651
|
"six-file-list-item": HTMLSixFileListItemElement;
|
|
@@ -2829,7 +2870,11 @@ declare namespace LocalJSX {
|
|
|
2829
2870
|
/**
|
|
2830
2871
|
* The error message shown, if `invalid` is set to true.
|
|
2831
2872
|
*/
|
|
2832
|
-
"errorText"?: string;
|
|
2873
|
+
"errorText"?: string | string[];
|
|
2874
|
+
/**
|
|
2875
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
2876
|
+
*/
|
|
2877
|
+
"errorTextCount"?: number;
|
|
2833
2878
|
/**
|
|
2834
2879
|
* Set to true to draw the checkbox in an indeterminate state.
|
|
2835
2880
|
*/
|
|
@@ -2907,7 +2952,11 @@ declare namespace LocalJSX {
|
|
|
2907
2952
|
/**
|
|
2908
2953
|
* The error message shown, if `invalid` is set to true.
|
|
2909
2954
|
*/
|
|
2910
|
-
"errorText"?: string;
|
|
2955
|
+
"errorText"?: string | string[];
|
|
2956
|
+
/**
|
|
2957
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
2958
|
+
*/
|
|
2959
|
+
"errorTextCount"?: number;
|
|
2911
2960
|
/**
|
|
2912
2961
|
* Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`.
|
|
2913
2962
|
*/
|
|
@@ -3251,6 +3300,12 @@ declare namespace LocalJSX {
|
|
|
3251
3300
|
*/
|
|
3252
3301
|
"virtualScroll"?: boolean;
|
|
3253
3302
|
}
|
|
3303
|
+
/**
|
|
3304
|
+
* @since 4.0
|
|
3305
|
+
* @status beta
|
|
3306
|
+
*/
|
|
3307
|
+
interface SixError {
|
|
3308
|
+
}
|
|
3254
3309
|
interface SixErrorPage {
|
|
3255
3310
|
/**
|
|
3256
3311
|
* Defines a custom description.
|
|
@@ -3514,7 +3569,11 @@ declare namespace LocalJSX {
|
|
|
3514
3569
|
/**
|
|
3515
3570
|
* The error message shown, if `invalid` is set to true.
|
|
3516
3571
|
*/
|
|
3517
|
-
"errorText"?: string;
|
|
3572
|
+
"errorText"?: string | string[];
|
|
3573
|
+
/**
|
|
3574
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
3575
|
+
*/
|
|
3576
|
+
"errorTextCount"?: number;
|
|
3518
3577
|
/**
|
|
3519
3578
|
* The input's help text. Alternatively, you can use the help-text slot.
|
|
3520
3579
|
*/
|
|
@@ -3888,7 +3947,11 @@ declare namespace LocalJSX {
|
|
|
3888
3947
|
/**
|
|
3889
3948
|
* The error message shown, if `invalid` is set to true.
|
|
3890
3949
|
*/
|
|
3891
|
-
"errorText"?: string;
|
|
3950
|
+
"errorText"?: string | string[];
|
|
3951
|
+
/**
|
|
3952
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
3953
|
+
*/
|
|
3954
|
+
"errorTextCount"?: number;
|
|
3892
3955
|
/**
|
|
3893
3956
|
* The range's help text. Alternatively, you can use the help-text slot.
|
|
3894
3957
|
*/
|
|
@@ -4027,7 +4090,11 @@ declare namespace LocalJSX {
|
|
|
4027
4090
|
/**
|
|
4028
4091
|
* The error message shown, if `invalid` is set to true.
|
|
4029
4092
|
*/
|
|
4030
|
-
"errorText"?: string;
|
|
4093
|
+
"errorText"?: string | string[];
|
|
4094
|
+
/**
|
|
4095
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
4096
|
+
*/
|
|
4097
|
+
"errorTextCount"?: number;
|
|
4031
4098
|
/**
|
|
4032
4099
|
* Set to true to allow filtering for entries in the dropdown
|
|
4033
4100
|
*/
|
|
@@ -4237,7 +4304,11 @@ declare namespace LocalJSX {
|
|
|
4237
4304
|
/**
|
|
4238
4305
|
* The error message shown, if `invalid` is set to true.
|
|
4239
4306
|
*/
|
|
4240
|
-
"errorText"?: string;
|
|
4307
|
+
"errorText"?: string | string[];
|
|
4308
|
+
/**
|
|
4309
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
4310
|
+
*/
|
|
4311
|
+
"errorTextCount"?: number;
|
|
4241
4312
|
/**
|
|
4242
4313
|
* If this property is set to true and an error message is provided by `errorText`, the error message is displayed.
|
|
4243
4314
|
*/
|
|
@@ -4392,7 +4463,11 @@ declare namespace LocalJSX {
|
|
|
4392
4463
|
/**
|
|
4393
4464
|
* The error message shown, if `invalid` is set to true.
|
|
4394
4465
|
*/
|
|
4395
|
-
"errorText"?: string;
|
|
4466
|
+
"errorText"?: string | string[];
|
|
4467
|
+
/**
|
|
4468
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
4469
|
+
*/
|
|
4470
|
+
"errorTextCount"?: number;
|
|
4396
4471
|
/**
|
|
4397
4472
|
* The textarea's help text. Alternatively, you can use the help-text slot.
|
|
4398
4473
|
*/
|
|
@@ -4536,7 +4611,11 @@ declare namespace LocalJSX {
|
|
|
4536
4611
|
/**
|
|
4537
4612
|
* The input's error text. Alternatively, you can use the error-text slot.
|
|
4538
4613
|
*/
|
|
4539
|
-
"errorText"?: string;
|
|
4614
|
+
"errorText"?: string | string[];
|
|
4615
|
+
/**
|
|
4616
|
+
* The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1
|
|
4617
|
+
*/
|
|
4618
|
+
"errorTextCount"?: number;
|
|
4540
4619
|
/**
|
|
4541
4620
|
* Define the time format. Valid formats are: HH:mm:ss hh:mm:ss:aa HH:mm:ss:ms hh:mm:ss:ms:aa HH:mm hh:mm:aa HH hh:aa mm ss ms where HH is the 24 hour format and hh is the 12 hour format Please notice that when using the 12-hour-clock (hh) you always need a period indicator (aa). So the time can be parsed as either am or pm
|
|
4542
4621
|
*/
|
|
@@ -4693,6 +4772,7 @@ declare namespace LocalJSX {
|
|
|
4693
4772
|
"six-dialog": SixDialog;
|
|
4694
4773
|
"six-drawer": SixDrawer;
|
|
4695
4774
|
"six-dropdown": SixDropdown;
|
|
4775
|
+
"six-error": SixError;
|
|
4696
4776
|
"six-error-page": SixErrorPage;
|
|
4697
4777
|
"six-file-list": SixFileList;
|
|
4698
4778
|
"six-file-list-item": SixFileListItem;
|
|
@@ -4804,6 +4884,11 @@ declare module "@stencil/core" {
|
|
|
4804
4884
|
* Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.
|
|
4805
4885
|
*/
|
|
4806
4886
|
"six-dropdown": LocalJSX.SixDropdown & JSXBase.HTMLAttributes<HTMLSixDropdownElement>;
|
|
4887
|
+
/**
|
|
4888
|
+
* @since 4.0
|
|
4889
|
+
* @status beta
|
|
4890
|
+
*/
|
|
4891
|
+
"six-error": LocalJSX.SixError & JSXBase.HTMLAttributes<HTMLSixErrorElement>;
|
|
4807
4892
|
"six-error-page": LocalJSX.SixErrorPage & JSXBase.HTMLAttributes<HTMLSixErrorPageElement>;
|
|
4808
4893
|
/**
|
|
4809
4894
|
* @since 2.0.0
|
|
@@ -16,10 +16,14 @@ export interface FormControlProps {
|
|
|
16
16
|
helpText?: string;
|
|
17
17
|
/** Whether a help text slot has been provided. */
|
|
18
18
|
hasHelpTextSlot?: boolean;
|
|
19
|
+
/** Whether an error text slot has been provided. */
|
|
20
|
+
hasErrorTextSlot?: boolean;
|
|
19
21
|
/** The error text id, used to map the input to the help text */
|
|
20
22
|
errorTextId?: string;
|
|
21
|
-
/** The error text */
|
|
22
|
-
errorText?: string;
|
|
23
|
+
/** The error text (if the error-text slot isn't used) */
|
|
24
|
+
errorText?: string | string[];
|
|
25
|
+
/** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */
|
|
26
|
+
errorTextCount?: number;
|
|
23
27
|
/** Set to true to disable the input. */
|
|
24
28
|
disabled?: boolean;
|
|
25
29
|
/** Set if the value is required. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,g as s}from"./p-6153045b.js";import{E as r}from"./p-7d95def3.js";import{D as n,d as o,a}from"./p-698bb2c8.js";import{h}from"./p-15559d38.js";import{m as l,c as d,a as c,b as u}from"./p-59210f0b.js";const p=t=>typeof t==="string";const m=t=>t==null;const y={en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsShortGrouped:[["Jan","Feb","Mar","Apr"],["May","Jun","Jul","Aug"],["Sep","Oct","Nov","Dec"]],weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysMin:["Mo","Tu","We","Th","Fr","Sa","Su"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],monthsShortGrouped:[["Jan.","Feb.","März","Apr."],["Mai","Juni","Juli","Aug."],["Sep.","Okt.","Nov.","Dez."]],weekdays:["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],weekdaysShort:["Mo.","Di.","Mi.","Do.","Fr.","Sa.","So."],weekdaysMin:["Mo","Di","Mi","Do","Fr","Sa","So"]},fr:{months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],monthsShortGrouped:[["janv.","févr.","mars","avr."],["mai","juin","juil.","août"],["sept.","oct.","nov.","déc."]],weekdays:["lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"],weekdaysShort:["lun.","mar.","mer.","jeu.","ven.","sam.","dim."],weekdaysMin:["lu","ma","me","je","ve","sa","di"]},it:{months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthsShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],monthsShortGrouped:[["gen","feb","mar","apr"],["mag","giu","lug","ago"],["set","ott","nov","dic"]],weekdays:["lunedì","martedì","mercoledì","giovedì","venerdì","sabato","domenica"],weekdaysShort:["lun","mar","mer","gio","ven","sab","dom"],weekdaysMin:["lu","ma","me","gi","ve","sa","do"]}};const b=()=>new Date;const f=t=>new Date(t.getFullYear(),t.getMonth(),t.getDate());const v=t=>t instanceof Date&&!isNaN(t.getTime())&&new Date(t).toString()!=="Invalid Date";const k=t=>{if(t&&v(t)){return t.getFullYear()}throw new Error("Not a valid date")};const g=t=>{if(t&&v(t)){return t.getMonth()}throw new Error("Not a valid date")};const w=t=>{if(t&&v(t)){return t.getDate()}throw new Error("Not a valid date")};const _=t=>{if(t&&v(t)){return t.getHours()}throw new Error("Not a valid date")};const x=t=>{if(t&&v(t)){return t.getMinutes()}throw new Error("Not a valid date")};const M=t=>{if(t&&v(t)){return t.getSeconds()}throw new Error("Not a valid date")};const D=t=>{const e=[6,0,1,2,3,4,5];const i=new Date(t);i.setDate(i.getDate()-e[i.getDay()]);return i};const S=(t,e)=>(t===null||t===void 0?void 0:t.getFullYear())===(e===null||e===void 0?void 0:e.getFullYear());const j=(t,e)=>S(t,e)&&(t===null||t===void 0?void 0:t.getMonth())===(e===null||e===void 0?void 0:e.getMonth());const C=(t,e)=>j(t,e)&&(t===null||t===void 0?void 0:t.getDate())===(e===null||e===void 0?void 0:e.getDate());const O=(t,e)=>C(D(t),D(e));const z=(t,e)=>{if(!p(t)||!p(e)){return false}if(t.length<6||e.length<6){return false}const{day:i,month:s}=U(t,e);if(i>31||s>11||i<=0||s<0){return false}const r=X(t,e);if(m(r)){return false}return r.toString()!=="Invalid Date"};const F=(t,e,i)=>{if(!t){return true}if(e&&t<e){return false}if(i&&i<t){return false}return true};const J=(t,e,i,s=2)=>{const r=s-1;const n=e.charAt(t+r)===i;const o=t+r<e.length;return o&&n};const N=(t,e)=>{let i=String(t);while(i.length<e){i="0"+i}return i};const A=(t,e)=>{if(t==null){return""}let i="";for(let s=0;s<e.length;s++){switch(e.charAt(s)){case"d":if(J(s,e,"d")){i+=N(t.getDate(),2);s++}else{i+=String(t.getDate())}break;case"m":if(J(s,e,"m")){i+=N(t.getMonth()+1,2);s++}else{i+=String(t.getMonth()+1)}break;case"y":if(J(s,e,"y",4)){s+=3;i+=t.getFullYear()}else{i+=(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;s++}break;case"h":if(J(s,e,"h")){i+=N(t.getHours(),2);s++}else{i+=String(t.getHours())}break;case"M":if(J(s,e,"M")){i+=N(t.getMinutes(),2);s++}else{i+=String(t.getMinutes())}break;case"s":if(J(s,e,"s")){i+=N(t.getSeconds(),2);s++}else{i+=String(t.getSeconds())}break;default:i+=e.charAt(s)}}return i};const E=/(\[[^\[]*\])|(mm|dd|yyyy|yy|hh|MM|ss|.)/g;const P=/\d\d/;const B=/\d{4}/;const G=/[^0-9]/g;const I="year";const L="month";const T="day";const Y="hour";const H="minute";const W="second";const q={};const R=(t,e,i)=>{const s=Array.isArray(t)?t:[t];let r;if(typeof i==="string"){r=t=>{const e=parseInt(t,10);return{[i]:e}}}else{r=i}s.forEach((t=>{q[t]=[e,r]}))};R("yy",P,(t=>{const e=(new Date).getFullYear();const i=Math.floor(e/100);let s=parseInt(t,10);s=(s>68?i-1:i)*100+s;return{[I]:s}}));R("yyyy",B,I);R("mm",P,(t=>({[L]:parseInt(t,10)-1})));R("dd",P,T);R("hh",P,Y);R("MM",P,H);R("ss",P,W);const V=(t,e=new Date)=>{const i=[0,0,1,0,0,0];const s=[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()];let r=true;for(let e=0;e<7;e++){if(t[e]===undefined){i[e]=r?s[e]:i[e]}else{i[e]=t[e];r=false}}return i};const $=(t,e,i,s,r,n)=>{if(!(t<100&&t>=0)){return new Date(t,e,i,s,r,n)}const o=new Date(t+400,e,i,s,r,n);if(isFinite(o.getFullYear())){o.setFullYear(t)}return o};const K=(t,e)=>{const i=e.match(E);if(!i){throw new Error}const{length:s}=i;let r={};for(let e=0;e<s;e+=1){const s=i[e];const n=q[s];if(!n){const e=s.replace(/^\[|\]$/g,"");if(t.indexOf(e)===0){t=t.substr(e.length)}else{throw new Error("not match")}}else{const e=n[0];const i=n[1];const s=(e.exec(t)||[])[0];const o=i(s);r=Object.assign(Object.assign({},r),o);t=t.replace(s,"")}}return r};const Q=(t,e)=>{if(t.length===e.length){return t}const i=t.match(G)[0];return t.split(i).map((t=>t.length===1?"0"+t:t)).join(i)};const U=(t,e)=>{const i=Q(t,e);return K(i,e)};const X=(t,e)=>{try{const{backupDate:i=new Date}={};const{year:s,month:r,day:n,hour:o,minute:a,second:h,date:l}=U(t,e);if(l!=null){return l}const d=[s,r,n,o,a,h];const c=V(d,i);return $(...c)}catch(t){return new Date(NaN)}};const Z=t=>{const{firstDateOfBox:e,allowedDates:i,dateFormat:s,selectedDate:r,minDate:n,maxDate:o,pointerDate:a}=t;const h=new Date(e);const l=new Date(e);let d=[];do{let t=[];do{t=[...t,{date:new Date(l),display:A(l,s),dateString:A(l,s),label:w(l).toString(),isToday:C(l,b()),isSelected:r&&C(l,r),isDisabled:!i(l)||!F(l,n,o),isOutdated:a.month!==l.getMonth()||!F(l,n,o)}];l.setDate(l.getDate()+1)}while(O(l,h));d=[...d,t];h.setDate(h.getDate()+7)}while(j(new Date(a.year,a.month,a.day),l));return d};function tt(t,e){const i=5;return[...Array(e).keys()].map((i=>i+t-Math.floor(e/2))).reduce(((t,e,s)=>{if(s%i===0){t.push([])}t[t.length-1].push(e);return t}),[])}var et;(function(t){t["DDMMYYY_DOT"]="dd.mm.yyyy";t["YYYYMMDD_DASH"]="yyyy-mm-dd";t["DDMMYYYY_DASH"]="dd-mm-yyyy";t["DDMMYYYY_SLASH"]="dd/mm/yyyy";t["YYYYMMDD_SLASH"]="yyyy/mm/dd";t["DDMMYY_DOT"]="dd.mm.yy";t["YYMMDD_DASH"]="yy-mm-dd";t["DDMMYY_DASH"]="dd-mm-yy";t["DDMMYY_SLASH"]="dd/mm/yy";t["YYMMDD_SLASH"]="yy/mm/dd";t["DDMMYYY_DOT_TIME"]="dd.mm.yyyy hh:MM:ss";t["YYYYMMDD_DASH_TIME"]="yyyy-mm-dd hh:MM:ss";t["DDMMYYYY_DASH_TIME"]="dd-mm-yyyy hh:MM:ss";t["DDMMYYYY_SLASH_TIME"]="dd/mm/yyyy hh:MM:ss";t["YYYYMMDD_SLASH_TIME"]="yyyy/mm/dd hh:MM:ss";t["DDMMYY_DOT_TIME"]="dd.mm.yy hh:MM:ss";t["YYMMDD_DASH_TIME"]="yy-mm-dd hh:MM:ss";t["DDMMYY_DASH_TIME"]="dd-mm-yy hh:MM:ss";t["DDMMYY_SLASH_TIME"]="dd/mm/yy hh:MM:ss";t["YYMMDD_SLASH_TIME"]="yy/mm/dd hh:MM:ss"})(et||(et={}));const it=e=>{const i=e.locale;const s=t=>i.monthsShort[b().getMonth()]===t;const r=t=>{var s;return((s=e.selectedDate)===null||s===void 0?void 0:s.getMonth())===i.monthsShort.findIndex((e=>e===t))};return t("table",{class:"datepicker-table",part:"month-selection"},t("tbody",null,i.monthsShortGrouped.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>t("td",{onClick:()=>e.onClickMonthCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":s(i),"datepicker-table__cell--is-selected":r(i)}},i))))))))};const st=e=>t("table",{class:"datepicker-table",part:"day-selection"},t("thead",{part:"weekday-header"},e.locale.weekdaysMin.map((e=>t("th",{class:"datepicker__cell"},e)))),t("tbody",null,e.calendarGrid.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>t("td",{"data-date":i.dateString,onClick:()=>e.onClickDateCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":i.isToday,"datepicker-table__cell--is-selected":i.isSelected,"datepicker-table__cell--is-outdated":i.isOutdated,"datepicker-table__cell--is-disabled":i.isDisabled,"datepicker-table__cell--is-selectable":!i.isDisabled}},i.label))))))));const rt=e=>t("table",{class:"datepicker-table",part:"year-selection"},t("tbody",null,e.yearSelection.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>{var s;return t("td",{onClick:()=>e.onClickYearCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":b().getFullYear()===i,"datepicker-table__cell--is-selected":((s=e.selectedDate)===null||s===void 0?void 0:s.getFullYear())===i}},i)})))))));const nt=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{display:block;font-family:var(--six-font-family)}.datepicker__container{position:relative}.datepicker__popup{min-width:400px;background-color:white;padding:0.5em 0.5em 1.5em;box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);user-select:none;position:absolute;z-index:var(--six-z-index-dropdown);right:0;left:0}.datepicker__popup--is-up{bottom:100%;min-height:382px}.datepicker__popup--is-inline{position:initial;box-shadow:none;border:1px solid var(--six-color-web-rock-400)}.datepicker-header{display:flex;justify-content:space-between;border-bottom:1px solid var(--six-color-web-rock-400);padding:0.5em;margin-bottom:1em}.datepicker-header svg{fill:var(--six-color-web-rock-900);stroke:none}.datepicker-header__btn{cursor:pointer;width:2.5em;height:2.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center}.datepicker-header__btn:hover{background-color:var(--six-color-web-rock-100);border-radius:100%}.datepicker-header__label{display:flex}.datepicker-header__label>div{cursor:pointer;padding:0.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center}.datepicker-header__label>div:hover{background-color:var(--six-color-web-rock-100)}.datepicker-table{width:100%}.datepicker-table__cell{text-align:center;width:2.5rem;height:2.5rem;cursor:pointer}.datepicker-table__cell:hover{background-color:var(--six-color-web-rock-100)}.datepicker-table__cell--is-today{border:1px solid var(--six-color-web-rock-400)}.datepicker-table__cell--is-selected{background-color:var(--six-color-red);color:var(--six-color-white)}.datepicker-table__cell--is-disabled{background-color:var(--six-color-web-rock-200);cursor:initial}.datepicker-table__cell--is-disabled:hover{background-color:var(--six-color-web-rock-200)}.datepicker-table__cell--is-outdated{color:var(--six-color-web-rock-400)}.datepicker-clear{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.datepicker-clear:hover{color:var(--six-input-icon-color-hover)}.datepicker-clear:focus{outline:none}.datepicker-clear--right{right:0;position:absolute}.datepicker-clear--left{right:35px;position:absolute}.input--empty .datepicker-clear{visibility:hidden}.prefix{cursor:pointer}.prefix--right{right:0;display:inline-flex;position:absolute;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;margin-right:var(--six-input-spacing-medium);transition:var(--six-transition-fast) color}six-timepicker::part(popup){border:none;padding:0.5em 0.5em 0;min-height:0}";const ot=25;const at=400;var ht;(function(t){t["DAY"]="day";t["MONTH"]="month";t["YEAR"]="year"})(ht||(ht={}));const lt=class{constructor(t){e(this,t);this.sixSelect=i(this,"six-datepicker-select",7);this.sixClear=i(this,"six-datepicker-clear",7);this.sixBlur=i(this,"six-datepicker-blur",7);this.eventListeners=new r;this.previousUnit=()=>{if(this.selectionMode===ht.DAY){this.previousMonth()}else if(this.selectionMode===ht.MONTH){this.previousYear()}else if(this.selectionMode===ht.YEAR){this.previousYearGroup()}};this.nextUnit=()=>{if(this.selectionMode===ht.DAY){this.nextMonth()}else if(this.selectionMode===ht.MONTH){this.nextYear()}else if(this.selectionMode===ht.YEAR){this.nextYearGroup()}};this.handleDocumentKeyDown=t=>{var e;const i=t;if(this.open&&i.key==="Escape"){i.stopPropagation();this.closePopup();void((e=this.inputElement)===null||e===void 0?void 0:e.setFocus())}if(i.key==="Tab"){this.closePopup()}};this.handleDocumentMouseDown=t=>{const e=t.composedPath();if(!e.includes(this.container)){this.closePopup();return}};this.handleClearClick=async t=>{t.stopPropagation();await this.select(undefined);this.sixClear.emit()};this.onTimepickerChange=t=>{const e=t.detail.value;const i=new Date;if(this.selectedDate!=null){i.setFullYear(this.selectedDate.getFullYear(),this.selectedDate.getMonth(),this.selectedDate.getDate())}if(e!=null){const t=e.hours;const s=e.minutes;const r=e.seconds;if(t!=null){i.setHours(t,s,r)}}this.updateValue(i);this.updatePointerDates()};this.onClickDateCell=t=>{if(!t.isDisabled){void this.select(t.dateString)}};this.onClickMonthCell=t=>{const e=y[this.locale].monthsShort.findIndex((e=>e===t));this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{month:e});this.selectionMode=ht.DAY};this.onClickYearCell=t=>{this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:t});this.selectionMode=ht.DAY};this.handleInputChange=t=>{if(this.inputElement==null){return}t.stopPropagation();const e=this.inputElement.value;if(!z(e,this.dateFormat)){return}const i=X(e,this.dateFormat);if(i===undefined){return}this.updateIfChanged(i);const s=e.replace(/[^\d]/g,"");if(s.length>=6){const t=X(e,this.dateFormat);const i=A(t,this.dateFormat);if(z(i,this.dateFormat)){this.selectedDate=X(i,this.dateFormat);this.updatePointerDates();this.updateValue(this.selectedDate)}}};this.handleOnBlur=t=>{var e,i;if(((e=this.inputElement)===null||e===void 0?void 0:e.value)===""&&v(this.value)){this.value=undefined}t.stopPropagation();const s=(i=this.inputElement)===null||i===void 0?void 0:i.value;const r=X(s,this.dateFormat);const n=A(this.value,this.dateFormat);if(this.inputElement!=null&&r!=null&&s!==n){this.inputElement.value=n}this.sixBlur.emit(this.value)};this.pointerDate=lt.getCurrentDateAsPointer();this.selectionMode=ht.DAY;this.isDropDownContentUp=false;this.type="date";this.locale="en";this.open=false;this.inline=false;this.readonly=false;this.disabled=false;this.allowedDates=()=>true;this.min=undefined;this.max=undefined;this.closeOnSelect=this.type==="date";this.placement=undefined;this.size="medium";this.required=false;this.defaultDate=undefined;this.placeholder=undefined;this.value=undefined;this.label="";this.errorText="";this.invalid=false;this.containingElement=undefined;this.dateFormat=et.DDMMYYY_DOT;this.debounce=n;this.name="";this.clearable=false;this.iconPosition="left";this.hoist=false}debounceChanged(){this.sixSelect=o(this.sixSelect,this.debounce)}invalidChanged(t){if(this.inputElement){this.inputElement.invalid=t}}valueChanged(){if(this.value!=null&&!v(this.value)){console.warn("invalid date value: ",this.value);this.value=undefined}this.selectedDate=this.value;this.updatePointerDates();this.sixSelect.emit(this.value)}async resizeHandler(){this.updateDropdownDirection();this.moveOpenHoistedPopup();this.adjustPopupPosition()}async scrollHandler(){this.updateDropdownDirection();this.moveOpenHoistedPopup()}moveOpenHoistedPopup(){l(this.hoist,this.open,this.popup,this.inputElement,this.wrapper,at)}get container(){return this.containingElement||this.host}get firstDateOfBox(){const t=new Date(this.pointerDate.year,this.pointerDate.month,1);return D(t)}async setFocus(t){var e;(e=this.inputElement)===null||e===void 0?void 0:e.setFocus(t)}get calendarGrid(){return Z({firstDateOfBox:this.firstDateOfBox,allowedDates:this.allowedDates,dateFormat:this.dateFormat,locale:this.locale,selectedDate:this.selectedDate,minDate:this.min,maxDate:this.max,pointerDate:this.pointerDate})}updateDropdownDirection(){if(this.inputElement==null||this.wrapper==null){return}this.isDropDownContentUp=d(this.inputElement,this.wrapper,at)}getMonthStringForIndex(t){return y[this.locale].months[t]}previousYear(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-1})}previousYearGroup(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-ot})}previousMonth(){if(this.pointerDate.month===0){this.pointerDate={year:this.pointerDate.year-1,month:11,day:1,hours:0,minutes:0,seconds:0}}else{this.pointerDate={year:this.pointerDate.year,month:this.pointerDate.month-1,day:1,hours:0,minutes:0,seconds:0}}}nextMonth(){if(this.pointerDate.month===11){this.pointerDate={year:this.pointerDate.year+1,month:0,day:1,hours:0,minutes:0,seconds:0}}else{this.pointerDate={year:this.pointerDate.year,month:this.pointerDate.month+1,day:1,hours:0,minutes:0,seconds:0}}}nextYear(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+1})}nextYearGroup(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+ot})}openCalendar(){if(!this.open&&!this.disabled){this.open=true;this.setupEventListenersForOpenPopup()}}setupEventListenersForOpenPopup(){this.eventListeners.add(document,"keydown",this.handleDocumentKeyDown);this.eventListeners.add(document,"mousedown",this.handleDocumentMouseDown)}closePopup(){if(this.inline){return}this.open=false;this.eventListeners.remove(document,"keydown",this.handleDocumentKeyDown);this.eventListeners.remove(document,"mousedown",this.handleDocumentMouseDown);this.selectionMode=ht.DAY}updatePointerDates(){const t=this.getPointerDate();if(this.differsFromPointerDate(t)){this.pointerDate={year:k(t),month:g(t),day:w(t),hours:_(t),minutes:x(t),seconds:M(t)}}}differsFromPointerDate(t){return this.pointerDate.day!==w(t)||this.pointerDate.month!==g(t)||this.pointerDate.year!==k(t)||this.pointerDate.hours!==_(t)||this.pointerDate.minutes!==x(t)||this.pointerDate.seconds!==M(t)}getPointerDate(){if(this.selectedDate!==undefined&&this.selectedDate!==null){return this.selectedDate}if(this.defaultDate==null){return this.type==="date"?f(b()):b()}else{return X(this.defaultDate,this.dateFormat)}}updateValue(t){this.updateIfChanged(t)}updateIfChanged(t){var e;if(((e=this.value)===null||e===void 0?void 0:e.getTime())===(t===null||t===void 0?void 0:t.getTime())){return}this.value=t}async select(t){if(t==null){this.updateValue(undefined)}else{const e=X(t,this.dateFormat);e===null||e===void 0?void 0:e.setHours(this.pointerDate.hours,this.pointerDate.minutes,this.pointerDate.seconds);this.updateValue(e)}this.updatePointerDates();if(this.closeOnSelect){this.closePopup()}}componentWillLoad(){this.selectedDate=this.value;this.updatePointerDates();this.updateValue(this.value);if(this.inline){this.open=true}if(this.open){this.setupEventListenersForOpenPopup()}}componentDidLoad(){if(this.inputElement!=null){this.eventListeners.add(this.inputElement,"six-input-input",a(this.handleInputChange,this.debounce));this.eventListeners.add(this.inputElement,"six-input-blur",this.handleOnBlur)}}componentDidRender(){this.adjustPopupPosition()}renderHeader(){return t("header",{class:"datepicker-header",part:"header"},t("div",{class:"datepicker-header__btn prev",onClick:this.previousUnit},t("svg",{viewBox:"0 5 13 13",width:"14",height:"23"},t("path",{d:"M11.67 3.87L9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}))),t("div",{class:"datepicker-header__label"},this.selectionMode===ht.DAY&&t("div",{onClick:()=>this.selectionMode=ht.MONTH},t("span",{class:"datepicker-header__label-month"},this.getMonthStringForIndex(this.pointerDate.month)),t("span",null,t("svg",{viewBox:"-3 -4 24 24",width:"20",height:"20"},t("polyline",{points:"6 9 12 15 18 9"})))),this.selectionMode!==ht.YEAR&&t("div",{onClick:()=>this.selectionMode=ht.YEAR},t("span",{class:"datepicker-header__label-year"},this.pointerDate.year),t("span",null,t("svg",{viewBox:"-3 -4 24 24",width:"20",height:"20"},t("polyline",{points:"6 9 12 15 18 9"})))),this.selectionMode===ht.YEAR&&t("div",null,this.pointerDate.year-Math.floor(ot/2)," –"," ",this.pointerDate.year+Math.floor(ot/2))),t("div",{class:"datepicker-header__btn next",onClick:this.nextUnit},t("svg",{viewBox:"5 5 13 13",width:"14",height:"23"},t("path",{d:"M5.88 4.12L13.76 12l-7.88 7.88L8 22l10-10L8 2z"}))))}renderBody(){switch(this.selectionMode){case ht.DAY:return t(st,{locale:y[this.locale],calendarGrid:this.calendarGrid,onClickDateCell:this.onClickDateCell});case ht.MONTH:return t(it,{locale:y[this.locale],selectedDate:this.selectedDate,onClickMonthCell:this.onClickMonthCell});case ht.YEAR:return t(rt,{selectedDate:this.selectedDate,yearSelection:tt(this.pointerDate.year,ot),onClickYearCell:this.onClickYearCell})}}renderCustomIcon(){const e=h(this.host,"custom-icon")?t("slot",{name:"custom-icon"}):t("six-icon",{size:this.size==="large"?"medium":this.size},"today");return t("span",{slot:"prefix",part:"icon",class:{prefix:true,"prefix--right":this.iconPosition==="right"}},e)}renderClearable(){return this.clearable&&t("button",{slot:"suffix",class:{"datepicker-clear":true,"datepicker-clear--right":this.iconPosition==="left","datepicker-clear--left":this.iconPosition==="right"},type:"button",onClick:this.handleClearClick,tabindex:"-1"},t("six-icon",{size:"small"},"clear"))}render(){var e,i,s;this.adjustPopupPosition();return t("div",{ref:t=>this.wrapper=t,class:"datepicker__container"},t("six-input",{part:"base",value:A(this.value,this.dateFormat),ref:t=>this.inputElement=t,placeholder:this.placeholder,readonly:this.readonly,disabled:this.disabled,name:this.name,label:this.label,required:this.required,"error-text":this.errorText,onClick:()=>this.openCalendar(),size:this.size,class:{"input--empty":this.value==null}},this.renderCustomIcon(),this.renderClearable(),h(this.host,"label")?t("span",{slot:"label"},t("slot",{name:"label"})):null),this.open&&t("div",{part:"popup",ref:t=>this.popup=t,class:{datepicker__popup:true,"datepicker__popup--is-up":this.placement!=null?this.placement==="top":this.isDropDownContentUp,"datepicker__popup--is-inline":this.inline}},this.renderHeader(),this.renderBody(),this.type==="date-time"&&t("six-timepicker",{inline:true,"onSix-timepicker-change-debounced":t=>this.onTimepickerChange(t),value:((e=this.selectedDate)===null||e===void 0?void 0:e.getHours())+":"+((i=this.selectedDate)===null||i===void 0?void 0:i.getMinutes())+":"+((s=this.selectedDate)===null||s===void 0?void 0:s.getSeconds())}),t("div",{class:"datepicker__footer"},t("slot",null))))}adjustPopupPosition(){c(this.hoist,this.popup,this.inputElement,this.wrapper,at,(t=>this.isDropDownContentUp=t));u(this.popup)}connectedCallback(){this.eventListeners.forward("six-datepicker-select","change",this.host);this.eventListeners.forward("six-datepicker-blur","blur",this.host)}disconnectedCallback(){this.eventListeners.removeAll()}static getCurrentDateAsPointer(){return{year:k(b()),month:g(b()),day:w(b()),hours:_(b()),minutes:x(b()),seconds:M(b())}}get host(){return s(this)}static get watchers(){return{debounce:["debounceChanged"],invalid:["invalidChanged"],value:["valueChanged"]}}};lt.style=nt;export{lt as six_datepicker};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{h as t,r as e,c as i,g as s}from"./p-6153045b.js";import{E as r}from"./p-7d95def3.js";import{D as n,d as o,a}from"./p-698bb2c8.js";import{h}from"./p-15559d38.js";import{m as l,c as d,a as c,b as u}from"./p-59210f0b.js";const p=t=>typeof t==="string";const m=t=>t==null;const y={en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsShortGrouped:[["Jan","Feb","Mar","Apr"],["May","Jun","Jul","Aug"],["Sep","Oct","Nov","Dec"]],weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysMin:["Mo","Tu","We","Th","Fr","Sa","Su"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],monthsShortGrouped:[["Jan.","Feb.","März","Apr."],["Mai","Juni","Juli","Aug."],["Sep.","Okt.","Nov.","Dez."]],weekdays:["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],weekdaysShort:["Mo.","Di.","Mi.","Do.","Fr.","Sa.","So."],weekdaysMin:["Mo","Di","Mi","Do","Fr","Sa","So"]},fr:{months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],monthsShortGrouped:[["janv.","févr.","mars","avr."],["mai","juin","juil.","août"],["sept.","oct.","nov.","déc."]],weekdays:["lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"],weekdaysShort:["lun.","mar.","mer.","jeu.","ven.","sam.","dim."],weekdaysMin:["lu","ma","me","je","ve","sa","di"]},it:{months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthsShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],monthsShortGrouped:[["gen","feb","mar","apr"],["mag","giu","lug","ago"],["set","ott","nov","dic"]],weekdays:["lunedì","martedì","mercoledì","giovedì","venerdì","sabato","domenica"],weekdaysShort:["lun","mar","mer","gio","ven","sab","dom"],weekdaysMin:["lu","ma","me","gi","ve","sa","do"]}};const b=()=>new Date;const f=t=>new Date(t.getFullYear(),t.getMonth(),t.getDate());const v=t=>t instanceof Date&&!isNaN(t.getTime())&&new Date(t).toString()!=="Invalid Date";const k=t=>{if(t&&v(t)){return t.getFullYear()}throw new Error("Not a valid date")};const g=t=>{if(t&&v(t)){return t.getMonth()}throw new Error("Not a valid date")};const w=t=>{if(t&&v(t)){return t.getDate()}throw new Error("Not a valid date")};const x=t=>{if(t&&v(t)){return t.getHours()}throw new Error("Not a valid date")};const _=t=>{if(t&&v(t)){return t.getMinutes()}throw new Error("Not a valid date")};const M=t=>{if(t&&v(t)){return t.getSeconds()}throw new Error("Not a valid date")};const D=t=>{const e=[6,0,1,2,3,4,5];const i=new Date(t);i.setDate(i.getDate()-e[i.getDay()]);return i};const S=(t,e)=>(t===null||t===void 0?void 0:t.getFullYear())===(e===null||e===void 0?void 0:e.getFullYear());const j=(t,e)=>S(t,e)&&(t===null||t===void 0?void 0:t.getMonth())===(e===null||e===void 0?void 0:e.getMonth());const C=(t,e)=>j(t,e)&&(t===null||t===void 0?void 0:t.getDate())===(e===null||e===void 0?void 0:e.getDate());const O=(t,e)=>C(D(t),D(e));const z=(t,e)=>{if(!p(t)||!p(e)){return false}if(t.length<6||e.length<6){return false}const{day:i,month:s}=U(t,e);if(i>31||s>11||i<=0||s<0){return false}const r=X(t,e);if(m(r)){return false}return r.toString()!=="Invalid Date"};const F=(t,e,i)=>{if(!t){return true}if(e&&t<e){return false}if(i&&i<t){return false}return true};const J=(t,e,i,s=2)=>{const r=s-1;const n=e.charAt(t+r)===i;const o=t+r<e.length;return o&&n};const N=(t,e)=>{let i=String(t);while(i.length<e){i="0"+i}return i};const A=(t,e)=>{if(t==null){return""}let i="";for(let s=0;s<e.length;s++){switch(e.charAt(s)){case"d":if(J(s,e,"d")){i+=N(t.getDate(),2);s++}else{i+=String(t.getDate())}break;case"m":if(J(s,e,"m")){i+=N(t.getMonth()+1,2);s++}else{i+=String(t.getMonth()+1)}break;case"y":if(J(s,e,"y",4)){s+=3;i+=t.getFullYear()}else{i+=(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;s++}break;case"h":if(J(s,e,"h")){i+=N(t.getHours(),2);s++}else{i+=String(t.getHours())}break;case"M":if(J(s,e,"M")){i+=N(t.getMinutes(),2);s++}else{i+=String(t.getMinutes())}break;case"s":if(J(s,e,"s")){i+=N(t.getSeconds(),2);s++}else{i+=String(t.getSeconds())}break;default:i+=e.charAt(s)}}return i};const E=/(\[[^\[]*\])|(mm|dd|yyyy|yy|hh|MM|ss|.)/g;const T=/\d\d/;const P=/\d{4}/;const B=/[^0-9]/g;const G="year";const I="month";const L="day";const Y="hour";const H="minute";const W="second";const q={};const R=(t,e,i)=>{const s=Array.isArray(t)?t:[t];let r;if(typeof i==="string"){r=t=>{const e=parseInt(t,10);return{[i]:e}}}else{r=i}s.forEach((t=>{q[t]=[e,r]}))};R("yy",T,(t=>{const e=(new Date).getFullYear();const i=Math.floor(e/100);let s=parseInt(t,10);s=(s>68?i-1:i)*100+s;return{[G]:s}}));R("yyyy",P,G);R("mm",T,(t=>({[I]:parseInt(t,10)-1})));R("dd",T,L);R("hh",T,Y);R("MM",T,H);R("ss",T,W);const V=(t,e=new Date)=>{const i=[0,0,1,0,0,0];const s=[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()];let r=true;for(let e=0;e<7;e++){if(t[e]===undefined){i[e]=r?s[e]:i[e]}else{i[e]=t[e];r=false}}return i};const $=(t,e,i,s,r,n)=>{if(!(t<100&&t>=0)){return new Date(t,e,i,s,r,n)}const o=new Date(t+400,e,i,s,r,n);if(isFinite(o.getFullYear())){o.setFullYear(t)}return o};const K=(t,e)=>{const i=e.match(E);if(!i){throw new Error}const{length:s}=i;let r={};for(let e=0;e<s;e+=1){const s=i[e];const n=q[s];if(!n){const e=s.replace(/^\[|\]$/g,"");if(t.indexOf(e)===0){t=t.substr(e.length)}else{throw new Error("not match")}}else{const e=n[0];const i=n[1];const s=(e.exec(t)||[])[0];const o=i(s);r=Object.assign(Object.assign({},r),o);t=t.replace(s,"")}}return r};const Q=(t,e)=>{if(t.length===e.length){return t}const i=t.match(B)[0];return t.split(i).map((t=>t.length===1?"0"+t:t)).join(i)};const U=(t,e)=>{const i=Q(t,e);return K(i,e)};const X=(t,e)=>{try{const{backupDate:i=new Date}={};const{year:s,month:r,day:n,hour:o,minute:a,second:h,date:l}=U(t,e);if(l!=null){return l}const d=[s,r,n,o,a,h];const c=V(d,i);return $(...c)}catch(t){return new Date(NaN)}};const Z=t=>{const{firstDateOfBox:e,allowedDates:i,dateFormat:s,selectedDate:r,minDate:n,maxDate:o,pointerDate:a}=t;const h=new Date(e);const l=new Date(e);let d=[];do{let t=[];do{t=[...t,{date:new Date(l),display:A(l,s),dateString:A(l,s),label:w(l).toString(),isToday:C(l,b()),isSelected:r&&C(l,r),isDisabled:!i(l)||!F(l,n,o),isOutdated:a.month!==l.getMonth()||!F(l,n,o)}];l.setDate(l.getDate()+1)}while(O(l,h));d=[...d,t];h.setDate(h.getDate()+7)}while(j(new Date(a.year,a.month,a.day),l));return d};function tt(t,e){const i=5;return[...Array(e).keys()].map((i=>i+t-Math.floor(e/2))).reduce(((t,e,s)=>{if(s%i===0){t.push([])}t[t.length-1].push(e);return t}),[])}var et;(function(t){t["DDMMYYY_DOT"]="dd.mm.yyyy";t["YYYYMMDD_DASH"]="yyyy-mm-dd";t["DDMMYYYY_DASH"]="dd-mm-yyyy";t["DDMMYYYY_SLASH"]="dd/mm/yyyy";t["YYYYMMDD_SLASH"]="yyyy/mm/dd";t["DDMMYY_DOT"]="dd.mm.yy";t["YYMMDD_DASH"]="yy-mm-dd";t["DDMMYY_DASH"]="dd-mm-yy";t["DDMMYY_SLASH"]="dd/mm/yy";t["YYMMDD_SLASH"]="yy/mm/dd";t["DDMMYYY_DOT_TIME"]="dd.mm.yyyy hh:MM:ss";t["YYYYMMDD_DASH_TIME"]="yyyy-mm-dd hh:MM:ss";t["DDMMYYYY_DASH_TIME"]="dd-mm-yyyy hh:MM:ss";t["DDMMYYYY_SLASH_TIME"]="dd/mm/yyyy hh:MM:ss";t["YYYYMMDD_SLASH_TIME"]="yyyy/mm/dd hh:MM:ss";t["DDMMYY_DOT_TIME"]="dd.mm.yy hh:MM:ss";t["YYMMDD_DASH_TIME"]="yy-mm-dd hh:MM:ss";t["DDMMYY_DASH_TIME"]="dd-mm-yy hh:MM:ss";t["DDMMYY_SLASH_TIME"]="dd/mm/yy hh:MM:ss";t["YYMMDD_SLASH_TIME"]="yy/mm/dd hh:MM:ss"})(et||(et={}));const it=e=>{const i=e.locale;const s=t=>i.monthsShort[b().getMonth()]===t;const r=t=>{var s;return((s=e.selectedDate)===null||s===void 0?void 0:s.getMonth())===i.monthsShort.findIndex((e=>e===t))};return t("table",{class:"datepicker-table",part:"month-selection"},t("tbody",null,i.monthsShortGrouped.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>t("td",{onClick:()=>e.onClickMonthCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":s(i),"datepicker-table__cell--is-selected":r(i)}},i))))))))};const st=e=>t("table",{class:"datepicker-table",part:"day-selection"},t("thead",{part:"weekday-header"},e.locale.weekdaysMin.map((e=>t("th",{class:"datepicker__cell"},e)))),t("tbody",null,e.calendarGrid.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>t("td",{"data-date":i.dateString,onClick:()=>e.onClickDateCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":i.isToday,"datepicker-table__cell--is-selected":i.isSelected,"datepicker-table__cell--is-outdated":i.isOutdated,"datepicker-table__cell--is-disabled":i.isDisabled,"datepicker-table__cell--is-selectable":!i.isDisabled}},i.label))))))));const rt=e=>t("table",{class:"datepicker-table",part:"year-selection"},t("tbody",null,e.yearSelection.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>{var s;return t("td",{onClick:()=>e.onClickYearCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":b().getFullYear()===i,"datepicker-table__cell--is-selected":((s=e.selectedDate)===null||s===void 0?void 0:s.getFullYear())===i}},i)})))))));const nt=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{display:block;font-family:var(--six-font-family)}.datepicker__container{position:relative}.datepicker__popup{min-width:400px;background-color:white;padding:0.5em 0.5em 1.5em;box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);user-select:none;position:absolute;z-index:var(--six-z-index-dropdown);right:0;left:0}.datepicker__popup--is-up{bottom:100%;min-height:382px}.datepicker__popup--is-inline{position:initial;box-shadow:none;border:1px solid var(--six-color-web-rock-400)}.datepicker-header{display:flex;justify-content:space-between;border-bottom:1px solid var(--six-color-web-rock-400);padding:0.5em;margin-bottom:1em}.datepicker-header svg{fill:var(--six-color-web-rock-900);stroke:none}.datepicker-header__btn{cursor:pointer;width:2.5em;height:2.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center}.datepicker-header__btn:hover{background-color:var(--six-color-web-rock-100);border-radius:100%}.datepicker-header__label{display:flex}.datepicker-header__label>div{cursor:pointer;padding:0.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center}.datepicker-header__label>div:hover{background-color:var(--six-color-web-rock-100)}.datepicker-table{width:100%}.datepicker-table__cell{text-align:center;width:2.5rem;height:2.5rem;cursor:pointer}.datepicker-table__cell:hover{background-color:var(--six-color-web-rock-100)}.datepicker-table__cell--is-today{border:1px solid var(--six-color-web-rock-400)}.datepicker-table__cell--is-selected{background-color:var(--six-color-red);color:var(--six-color-white)}.datepicker-table__cell--is-disabled{background-color:var(--six-color-web-rock-200);cursor:initial}.datepicker-table__cell--is-disabled:hover{background-color:var(--six-color-web-rock-200)}.datepicker-table__cell--is-outdated{color:var(--six-color-web-rock-400)}.datepicker-clear{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.datepicker-clear:hover{color:var(--six-input-icon-color-hover)}.datepicker-clear:focus{outline:none}.datepicker-clear--right{right:0;position:absolute}.datepicker-clear--left{right:35px;position:absolute}.input--empty .datepicker-clear{visibility:hidden}.prefix{cursor:pointer}.prefix--right{right:0;display:inline-flex;position:absolute;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;margin-right:var(--six-input-spacing-medium);transition:var(--six-transition-fast) color}six-timepicker::part(popup){border:none;padding:0.5em 0.5em 0;min-height:0}";const ot=25;const at=400;var ht;(function(t){t["DAY"]="day";t["MONTH"]="month";t["YEAR"]="year"})(ht||(ht={}));const lt=class{constructor(t){e(this,t);this.sixSelect=i(this,"six-datepicker-select",7);this.sixClear=i(this,"six-datepicker-clear",7);this.sixBlur=i(this,"six-datepicker-blur",7);this.eventListeners=new r;this.previousUnit=()=>{if(this.selectionMode===ht.DAY){this.previousMonth()}else if(this.selectionMode===ht.MONTH){this.previousYear()}else if(this.selectionMode===ht.YEAR){this.previousYearGroup()}};this.nextUnit=()=>{if(this.selectionMode===ht.DAY){this.nextMonth()}else if(this.selectionMode===ht.MONTH){this.nextYear()}else if(this.selectionMode===ht.YEAR){this.nextYearGroup()}};this.handleDocumentKeyDown=t=>{var e;const i=t;if(this.open&&i.key==="Escape"){i.stopPropagation();this.closePopup();void((e=this.inputElement)===null||e===void 0?void 0:e.setFocus())}if(i.key==="Tab"){this.closePopup()}};this.handleDocumentMouseDown=t=>{const e=t.composedPath();if(!e.includes(this.container)){this.closePopup();return}};this.handleClearClick=async t=>{t.stopPropagation();await this.select(undefined);this.sixClear.emit()};this.onTimepickerChange=t=>{const e=t.detail.value;const i=new Date;if(this.selectedDate!=null){i.setFullYear(this.selectedDate.getFullYear(),this.selectedDate.getMonth(),this.selectedDate.getDate())}if(e!=null){const t=e.hours;const s=e.minutes;const r=e.seconds;if(t!=null){i.setHours(t,s,r)}}this.updateValue(i);this.updatePointerDates()};this.onClickDateCell=t=>{if(!t.isDisabled){void this.select(t.dateString)}};this.onClickMonthCell=t=>{const e=y[this.locale].monthsShort.findIndex((e=>e===t));this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{month:e});this.selectionMode=ht.DAY};this.onClickYearCell=t=>{this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:t});this.selectionMode=ht.DAY};this.handleInputChange=t=>{if(this.inputElement==null){return}t.stopPropagation();const e=this.inputElement.value;if(!z(e,this.dateFormat)){return}const i=X(e,this.dateFormat);if(i===undefined){return}this.updateIfChanged(i);const s=e.replace(/[^\d]/g,"");if(s.length>=6){const t=X(e,this.dateFormat);const i=A(t,this.dateFormat);if(z(i,this.dateFormat)){this.selectedDate=X(i,this.dateFormat);this.updatePointerDates();this.updateValue(this.selectedDate)}}};this.handleOnBlur=t=>{var e,i;if(((e=this.inputElement)===null||e===void 0?void 0:e.value)===""&&v(this.value)){this.value=undefined;this.sixSelect.emit(this.value)}t.stopPropagation();const s=(i=this.inputElement)===null||i===void 0?void 0:i.value;const r=X(s,this.dateFormat);const n=A(this.value,this.dateFormat);if(this.inputElement!=null&&r!=null&&s!==n){this.inputElement.value=n}this.sixBlur.emit(this.value)};this.pointerDate=lt.getCurrentDateAsPointer();this.selectionMode=ht.DAY;this.isDropDownContentUp=false;this.type="date";this.locale="en";this.open=false;this.inline=false;this.readonly=false;this.disabled=false;this.allowedDates=()=>true;this.min=undefined;this.max=undefined;this.closeOnSelect=this.type==="date";this.placement=undefined;this.size="medium";this.required=false;this.defaultDate=undefined;this.placeholder=undefined;this.value=undefined;this.label="";this.errorText="";this.errorTextCount=undefined;this.invalid=false;this.containingElement=undefined;this.dateFormat=et.DDMMYYY_DOT;this.debounce=n;this.name="";this.clearable=false;this.iconPosition="left";this.hoist=false}debounceChanged(){this.sixSelect=o(this.sixSelect,this.debounce)}valueChanged(){if(this.value!=null&&!v(this.value)){console.warn("invalid date value: ",this.value);this.value=undefined;this.sixSelect.emit(this.value)}this.selectedDate=this.value;this.updatePointerDates()}async resizeHandler(){this.updateDropdownDirection();this.moveOpenHoistedPopup();this.adjustPopupPosition()}async scrollHandler(){this.updateDropdownDirection();this.moveOpenHoistedPopup()}moveOpenHoistedPopup(){l(this.hoist,this.open,this.popup,this.inputElement,this.wrapper,at)}get container(){return this.containingElement||this.host}get firstDateOfBox(){const t=new Date(this.pointerDate.year,this.pointerDate.month,1);return D(t)}async setFocus(t){var e;(e=this.inputElement)===null||e===void 0?void 0:e.setFocus(t)}get calendarGrid(){return Z({firstDateOfBox:this.firstDateOfBox,allowedDates:this.allowedDates,dateFormat:this.dateFormat,locale:this.locale,selectedDate:this.selectedDate,minDate:this.min,maxDate:this.max,pointerDate:this.pointerDate})}updateDropdownDirection(){if(this.inputElement==null||this.wrapper==null){return}this.isDropDownContentUp=d(this.inputElement,this.wrapper,at)}getMonthStringForIndex(t){return y[this.locale].months[t]}previousYear(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-1})}previousYearGroup(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-ot})}previousMonth(){if(this.pointerDate.month===0){this.pointerDate={year:this.pointerDate.year-1,month:11,day:1,hours:0,minutes:0,seconds:0}}else{this.pointerDate={year:this.pointerDate.year,month:this.pointerDate.month-1,day:1,hours:0,minutes:0,seconds:0}}}nextMonth(){if(this.pointerDate.month===11){this.pointerDate={year:this.pointerDate.year+1,month:0,day:1,hours:0,minutes:0,seconds:0}}else{this.pointerDate={year:this.pointerDate.year,month:this.pointerDate.month+1,day:1,hours:0,minutes:0,seconds:0}}}nextYear(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+1})}nextYearGroup(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+ot})}openCalendar(){if(!this.open&&!this.disabled){this.open=true;this.setupEventListenersForOpenPopup()}}setupEventListenersForOpenPopup(){this.eventListeners.add(document,"keydown",this.handleDocumentKeyDown);this.eventListeners.add(document,"mousedown",this.handleDocumentMouseDown)}closePopup(){if(this.inline){return}this.open=false;this.eventListeners.remove(document,"keydown",this.handleDocumentKeyDown);this.eventListeners.remove(document,"mousedown",this.handleDocumentMouseDown);this.selectionMode=ht.DAY}updatePointerDates(){const t=this.getPointerDate();if(this.differsFromPointerDate(t)){this.pointerDate={year:k(t),month:g(t),day:w(t),hours:x(t),minutes:_(t),seconds:M(t)}}}differsFromPointerDate(t){return this.pointerDate.day!==w(t)||this.pointerDate.month!==g(t)||this.pointerDate.year!==k(t)||this.pointerDate.hours!==x(t)||this.pointerDate.minutes!==_(t)||this.pointerDate.seconds!==M(t)}getPointerDate(){if(this.selectedDate!==undefined&&this.selectedDate!==null){return this.selectedDate}if(this.defaultDate==null){return this.type==="date"?f(b()):b()}else{return X(this.defaultDate,this.dateFormat)}}updateValue(t){this.updateIfChanged(t)}updateIfChanged(t){var e;if(((e=this.value)===null||e===void 0?void 0:e.getTime())===(t===null||t===void 0?void 0:t.getTime())){return}this.value=t;this.sixSelect.emit(this.value)}async select(t){if(t==null){this.updateValue(undefined)}else{const e=X(t,this.dateFormat);e===null||e===void 0?void 0:e.setHours(this.pointerDate.hours,this.pointerDate.minutes,this.pointerDate.seconds);this.updateValue(e)}this.updatePointerDates();if(this.closeOnSelect){this.closePopup()}}componentWillLoad(){this.selectedDate=this.value;this.updatePointerDates();this.updateValue(this.value);if(this.inline){this.open=true}if(this.open){this.setupEventListenersForOpenPopup()}}componentDidLoad(){if(this.inputElement!=null){this.eventListeners.add(this.inputElement,"six-input-input",a(this.handleInputChange,this.debounce));this.eventListeners.add(this.inputElement,"six-input-blur",this.handleOnBlur)}}componentDidRender(){this.adjustPopupPosition()}renderHeader(){return t("header",{class:"datepicker-header",part:"header"},t("div",{class:"datepicker-header__btn prev",onClick:this.previousUnit},t("svg",{viewBox:"0 5 13 13",width:"14",height:"23"},t("path",{d:"M11.67 3.87L9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}))),t("div",{class:"datepicker-header__label"},this.selectionMode===ht.DAY&&t("div",{onClick:()=>this.selectionMode=ht.MONTH},t("span",{class:"datepicker-header__label-month"},this.getMonthStringForIndex(this.pointerDate.month)),t("span",null,t("svg",{viewBox:"-3 -4 24 24",width:"20",height:"20"},t("polyline",{points:"6 9 12 15 18 9"})))),this.selectionMode!==ht.YEAR&&t("div",{onClick:()=>this.selectionMode=ht.YEAR},t("span",{class:"datepicker-header__label-year"},this.pointerDate.year),t("span",null,t("svg",{viewBox:"-3 -4 24 24",width:"20",height:"20"},t("polyline",{points:"6 9 12 15 18 9"})))),this.selectionMode===ht.YEAR&&t("div",null,this.pointerDate.year-Math.floor(ot/2)," –"," ",this.pointerDate.year+Math.floor(ot/2))),t("div",{class:"datepicker-header__btn next",onClick:this.nextUnit},t("svg",{viewBox:"5 5 13 13",width:"14",height:"23"},t("path",{d:"M5.88 4.12L13.76 12l-7.88 7.88L8 22l10-10L8 2z"}))))}renderBody(){switch(this.selectionMode){case ht.DAY:return t(st,{locale:y[this.locale],calendarGrid:this.calendarGrid,onClickDateCell:this.onClickDateCell});case ht.MONTH:return t(it,{locale:y[this.locale],selectedDate:this.selectedDate,onClickMonthCell:this.onClickMonthCell});case ht.YEAR:return t(rt,{selectedDate:this.selectedDate,yearSelection:tt(this.pointerDate.year,ot),onClickYearCell:this.onClickYearCell})}}renderCustomIcon(){const e=h(this.host,"custom-icon")?t("slot",{name:"custom-icon"}):t("six-icon",{size:this.size==="large"?"medium":this.size},"today");return t("span",{slot:"prefix",part:"icon",class:{prefix:true,"prefix--right":this.iconPosition==="right"}},e)}renderClearable(){return this.clearable&&t("button",{slot:"suffix",class:{"datepicker-clear":true,"datepicker-clear--right":this.iconPosition==="left","datepicker-clear--left":this.iconPosition==="right"},type:"button",onClick:this.handleClearClick,tabindex:"-1"},t("six-icon",{size:"small"},"clear"))}render(){var e,i,s;this.adjustPopupPosition();return t("div",{ref:t=>this.wrapper=t,class:"datepicker__container"},t("six-input",{part:"base",value:A(this.value,this.dateFormat),ref:t=>this.inputElement=t,placeholder:this.placeholder,readonly:this.readonly,disabled:this.disabled,name:this.name,label:this.label,required:this.required,errorText:this.errorText,errorTextCount:this.errorTextCount,invalid:this.invalid,onClick:()=>this.openCalendar(),size:this.size,class:{"input--empty":this.value==null}},this.renderCustomIcon(),this.renderClearable(),h(this.host,"label")?t("span",{slot:"label"},t("slot",{name:"label"})):null,h(this.host,"error-text")?t("span",{slot:"error-text"},t("slot",{name:"error-text"})):null),this.open&&t("div",{part:"popup",ref:t=>this.popup=t,class:{datepicker__popup:true,"datepicker__popup--is-up":this.placement!=null?this.placement==="top":this.isDropDownContentUp,"datepicker__popup--is-inline":this.inline}},this.renderHeader(),this.renderBody(),this.type==="date-time"&&t("six-timepicker",{inline:true,"onSix-timepicker-change-debounced":t=>this.onTimepickerChange(t),value:((e=this.selectedDate)===null||e===void 0?void 0:e.getHours())+":"+((i=this.selectedDate)===null||i===void 0?void 0:i.getMinutes())+":"+((s=this.selectedDate)===null||s===void 0?void 0:s.getSeconds())}),t("div",{class:"datepicker__footer"},t("slot",null))))}adjustPopupPosition(){c(this.hoist,this.popup,this.inputElement,this.wrapper,at,(t=>this.isDropDownContentUp=t));u(this.popup)}connectedCallback(){this.eventListeners.forward("six-datepicker-select","change",this.host);this.eventListeners.forward("six-datepicker-blur","blur",this.host)}disconnectedCallback(){this.eventListeners.removeAll()}static getCurrentDateAsPointer(){return{year:k(b()),month:g(b()),day:w(b()),hours:x(b()),minutes:_(b()),seconds:M(b())}}get host(){return s(this)}static get watchers(){return{debounce:["debounceChanged"],value:["valueChanged"]}}};lt.style=nt;export{lt as six_datepicker};
|
|
2
|
+
//# sourceMappingURL=p-14c1ec31.entry.js.map
|