@six-group/ui-library 4.0.0 → 4.0.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.
Files changed (235) hide show
  1. package/dist/cjs/{form-control-d369af14.js → form-control-9769b310.js} +10 -7
  2. package/dist/cjs/form-control-9769b310.js.map +1 -0
  3. package/dist/cjs/index-900437fc.js +8 -4
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/six-checkbox.cjs.entry.js +6 -3
  6. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  7. package/dist/cjs/six-datepicker.cjs.entry.js +2 -7
  8. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  9. package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
  10. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  11. package/dist/cjs/six-error.cjs.entry.js +21 -0
  12. package/dist/cjs/six-error.cjs.entry.js.map +1 -0
  13. package/dist/cjs/six-group-label.cjs.entry.js +2 -2
  14. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  15. package/dist/cjs/six-input.cjs.entry.js +6 -3
  16. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  17. package/dist/cjs/six-range.cjs.entry.js +6 -3
  18. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  19. package/dist/cjs/six-select.cjs.entry.js +6 -3
  20. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  21. package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
  22. package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
  23. package/dist/cjs/six-switch.cjs.entry.js +22 -4
  24. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  25. package/dist/cjs/six-tag.cjs.entry.js +23 -1
  26. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  27. package/dist/cjs/six-textarea.cjs.entry.js +6 -3
  28. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  29. package/dist/cjs/six-timepicker.cjs.entry.js +4 -9
  30. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  31. package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
  32. package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
  33. package/dist/cjs/ui-library.cjs.js +1 -1
  34. package/dist/collection/collection-manifest.json +1 -0
  35. package/dist/collection/components/six-checkbox/six-checkbox.css +1 -1
  36. package/dist/collection/components/six-checkbox/six-checkbox.js +25 -4
  37. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  38. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
  39. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
  40. package/dist/collection/components/six-datepicker/six-datepicker.js +22 -11
  41. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  42. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
  43. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
  44. package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
  45. package/dist/collection/components/six-error/six-error.css +5 -0
  46. package/dist/collection/components/six-error/six-error.js +25 -0
  47. package/dist/collection/components/six-error/six-error.js.map +1 -0
  48. package/dist/collection/components/six-group-label/six-group-label.css +1 -1
  49. package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
  50. package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
  51. package/dist/collection/components/six-input/six-input.css +1 -1
  52. package/dist/collection/components/six-input/six-input.js +27 -4
  53. package/dist/collection/components/six-input/six-input.js.map +1 -1
  54. package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
  55. package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
  56. package/dist/collection/components/six-range/six-range.css +1 -1
  57. package/dist/collection/components/six-range/six-range.js +24 -3
  58. package/dist/collection/components/six-range/six-range.js.map +1 -1
  59. package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
  60. package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
  61. package/dist/collection/components/six-select/six-select.css +1 -1
  62. package/dist/collection/components/six-select/six-select.js +24 -3
  63. package/dist/collection/components/six-select/six-select.js.map +1 -1
  64. package/dist/collection/components/six-select/test/six-select.spec.js +6 -2
  65. package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
  66. package/dist/collection/components/six-sidebar/six-sidebar.css +1 -0
  67. package/dist/collection/components/six-switch/six-switch.css +1 -1
  68. package/dist/collection/components/six-switch/six-switch.js +45 -4
  69. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  70. package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
  71. package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
  72. package/dist/collection/components/six-tag/six-tag.js +23 -1
  73. package/dist/collection/components/six-tag/six-tag.js.map +1 -1
  74. package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
  75. package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
  76. package/dist/collection/components/six-textarea/six-textarea.css +1 -1
  77. package/dist/collection/components/six-textarea/six-textarea.js +25 -4
  78. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  79. package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
  80. package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
  81. package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
  82. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  83. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
  84. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
  85. package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
  86. package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
  87. package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
  88. package/dist/collection/functional-components/form-control/form-control.js +8 -6
  89. package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
  90. package/dist/components/form-control.js +9 -6
  91. package/dist/components/form-control.js.map +1 -1
  92. package/dist/components/index.js +2 -0
  93. package/dist/components/index.js.map +1 -1
  94. package/dist/components/six-checkbox.js +14 -3
  95. package/dist/components/six-checkbox.js.map +1 -1
  96. package/dist/components/six-datepicker.js +10 -8
  97. package/dist/components/six-datepicker.js.map +1 -1
  98. package/dist/components/six-dropdown2.js +8 -2
  99. package/dist/components/six-dropdown2.js.map +1 -1
  100. package/dist/components/six-error.d.ts +11 -0
  101. package/dist/components/six-error.js +8 -0
  102. package/dist/components/six-error.js.map +1 -0
  103. package/dist/components/six-error2.js +32 -0
  104. package/dist/components/six-error2.js.map +1 -0
  105. package/dist/components/six-group-label.js +8 -2
  106. package/dist/components/six-group-label.js.map +1 -1
  107. package/dist/components/six-header.js +8 -2
  108. package/dist/components/six-header.js.map +1 -1
  109. package/dist/components/six-input2.js +14 -3
  110. package/dist/components/six-input2.js.map +1 -1
  111. package/dist/components/six-range.js +14 -3
  112. package/dist/components/six-range.js.map +1 -1
  113. package/dist/components/six-search-field.js +7 -1
  114. package/dist/components/six-search-field.js.map +1 -1
  115. package/dist/components/six-select.js +33 -16
  116. package/dist/components/six-select.js.map +1 -1
  117. package/dist/components/six-sidebar.js +1 -1
  118. package/dist/components/six-sidebar.js.map +1 -1
  119. package/dist/components/six-switch.js +30 -4
  120. package/dist/components/six-switch.js.map +1 -1
  121. package/dist/components/six-tag2.js +33 -5
  122. package/dist/components/six-tag2.js.map +1 -1
  123. package/dist/components/six-textarea.js +14 -3
  124. package/dist/components/six-textarea.js.map +1 -1
  125. package/dist/components/six-timepicker2.js +12 -10
  126. package/dist/components/six-timepicker2.js.map +1 -1
  127. package/dist/components/six-tooltip2.js +2 -2
  128. package/dist/components/six-tooltip2.js.map +1 -1
  129. package/dist/components.json +419 -48
  130. package/dist/esm/{form-control-32cb533f.js → form-control-b0febe88.js} +10 -7
  131. package/dist/esm/form-control-b0febe88.js.map +1 -0
  132. package/dist/esm/index-8a74f992.js +8 -4
  133. package/dist/esm/loader.js +1 -1
  134. package/dist/esm/six-checkbox.entry.js +6 -3
  135. package/dist/esm/six-checkbox.entry.js.map +1 -1
  136. package/dist/esm/six-datepicker.entry.js +2 -7
  137. package/dist/esm/six-datepicker.entry.js.map +1 -1
  138. package/dist/esm/six-dropdown_2.entry.js +1 -1
  139. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  140. package/dist/esm/six-error.entry.js +17 -0
  141. package/dist/esm/six-error.entry.js.map +1 -0
  142. package/dist/esm/six-group-label.entry.js +2 -2
  143. package/dist/esm/six-group-label.entry.js.map +1 -1
  144. package/dist/esm/six-input.entry.js +6 -3
  145. package/dist/esm/six-input.entry.js.map +1 -1
  146. package/dist/esm/six-range.entry.js +6 -3
  147. package/dist/esm/six-range.entry.js.map +1 -1
  148. package/dist/esm/six-select.entry.js +6 -3
  149. package/dist/esm/six-select.entry.js.map +1 -1
  150. package/dist/esm/six-sidebar.entry.js +1 -1
  151. package/dist/esm/six-sidebar.entry.js.map +1 -1
  152. package/dist/esm/six-switch.entry.js +22 -4
  153. package/dist/esm/six-switch.entry.js.map +1 -1
  154. package/dist/esm/six-tag.entry.js +23 -1
  155. package/dist/esm/six-tag.entry.js.map +1 -1
  156. package/dist/esm/six-textarea.entry.js +6 -3
  157. package/dist/esm/six-textarea.entry.js.map +1 -1
  158. package/dist/esm/six-timepicker.entry.js +4 -9
  159. package/dist/esm/six-timepicker.entry.js.map +1 -1
  160. package/dist/esm/six-tooltip.entry.js +2 -2
  161. package/dist/esm/six-tooltip.entry.js.map +1 -1
  162. package/dist/esm/ui-library.js +1 -1
  163. package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -1
  164. package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
  165. package/dist/types/components/six-error/six-error.d.ts +9 -0
  166. package/dist/types/components/six-input/six-input.d.ts +7 -2
  167. package/dist/types/components/six-range/six-range.d.ts +4 -1
  168. package/dist/types/components/six-select/six-select.d.ts +4 -1
  169. package/dist/types/components/six-switch/six-switch.d.ts +8 -1
  170. package/dist/types/components/six-tag/six-tag.d.ts +8 -0
  171. package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
  172. package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
  173. package/dist/types/components.d.ts +109 -16
  174. package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
  175. package/dist/ui-library/{p-ed381ad9.entry.js → p-14c1ec31.entry.js} +2 -2
  176. package/dist/ui-library/p-14c1ec31.entry.js.map +1 -0
  177. package/dist/ui-library/p-25bb1752.entry.js +2 -0
  178. package/dist/ui-library/p-25bb1752.entry.js.map +1 -0
  179. package/dist/ui-library/p-2a141e10.entry.js +2 -0
  180. package/dist/ui-library/p-2a141e10.entry.js.map +1 -0
  181. package/dist/ui-library/p-4435ff73.entry.js +2 -0
  182. package/dist/ui-library/p-4435ff73.entry.js.map +1 -0
  183. package/dist/ui-library/p-538f3c50.entry.js +2 -0
  184. package/dist/ui-library/p-538f3c50.entry.js.map +1 -0
  185. package/dist/ui-library/p-a457fee8.entry.js +2 -0
  186. package/dist/ui-library/p-a457fee8.entry.js.map +1 -0
  187. package/dist/ui-library/p-ab91c2a9.entry.js +2 -0
  188. package/dist/ui-library/p-ab91c2a9.entry.js.map +1 -0
  189. package/dist/ui-library/p-b57afbe4.entry.js +2 -0
  190. package/dist/ui-library/p-b57afbe4.entry.js.map +1 -0
  191. package/dist/ui-library/p-b6f47c9d.entry.js +2 -0
  192. package/dist/ui-library/p-b6f47c9d.entry.js.map +1 -0
  193. package/dist/ui-library/p-db34a6cc.entry.js +2 -0
  194. package/dist/ui-library/p-db34a6cc.entry.js.map +1 -0
  195. package/dist/ui-library/p-db936ad7.entry.js +2 -0
  196. package/dist/ui-library/{p-d367f4f9.entry.js.map → p-db936ad7.entry.js.map} +1 -1
  197. package/dist/ui-library/p-dc4f41d8.entry.js +2 -0
  198. package/dist/ui-library/p-dc4f41d8.entry.js.map +1 -0
  199. package/dist/ui-library/p-e5020f0d.js +2 -0
  200. package/dist/ui-library/p-e5020f0d.js.map +1 -0
  201. package/dist/ui-library/p-e775dcb4.entry.js +2 -0
  202. package/dist/ui-library/p-e775dcb4.entry.js.map +1 -0
  203. package/dist/ui-library/p-f1dc3a88.entry.js +2 -0
  204. package/dist/ui-library/p-f1dc3a88.entry.js.map +1 -0
  205. package/dist/ui-library/ui-library.esm.js +1 -1
  206. package/dist/ui-library/ui-library.esm.js.map +1 -1
  207. package/package.json +2 -2
  208. package/dist/cjs/form-control-d369af14.js.map +0 -1
  209. package/dist/esm/form-control-32cb533f.js.map +0 -1
  210. package/dist/ui-library/p-02981b91.entry.js +0 -2
  211. package/dist/ui-library/p-02981b91.entry.js.map +0 -1
  212. package/dist/ui-library/p-314b2096.entry.js +0 -2
  213. package/dist/ui-library/p-314b2096.entry.js.map +0 -1
  214. package/dist/ui-library/p-330a4988.entry.js +0 -2
  215. package/dist/ui-library/p-330a4988.entry.js.map +0 -1
  216. package/dist/ui-library/p-3d9de119.entry.js +0 -2
  217. package/dist/ui-library/p-3d9de119.entry.js.map +0 -1
  218. package/dist/ui-library/p-4abed9df.entry.js +0 -2
  219. package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
  220. package/dist/ui-library/p-5d6b7353.entry.js +0 -2
  221. package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
  222. package/dist/ui-library/p-72254eef.entry.js +0 -2
  223. package/dist/ui-library/p-72254eef.entry.js.map +0 -1
  224. package/dist/ui-library/p-9f0b43f9.entry.js +0 -2
  225. package/dist/ui-library/p-9f0b43f9.entry.js.map +0 -1
  226. package/dist/ui-library/p-b550a258.entry.js +0 -2
  227. package/dist/ui-library/p-b550a258.entry.js.map +0 -1
  228. package/dist/ui-library/p-bf87464b.entry.js +0 -2
  229. package/dist/ui-library/p-bf87464b.entry.js.map +0 -1
  230. package/dist/ui-library/p-d367f4f9.entry.js +0 -2
  231. package/dist/ui-library/p-d42c2025.js +0 -2
  232. package/dist/ui-library/p-d42c2025.js.map +0 -1
  233. package/dist/ui-library/p-ed381ad9.entry.js.map +0 -1
  234. package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
  235. package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
@@ -10,6 +10,8 @@ export interface SixTimepickerChange {
10
10
  * @since 2.0.0
11
11
  * @status experimental
12
12
  *
13
+ * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.
14
+ *
13
15
  * @part input - The input field
14
16
  * @part container - The container of whole component
15
17
  * @part popup - The popup of the timepicker component
@@ -78,7 +80,9 @@ export declare class SixTimepicker {
78
80
  */
79
81
  placeholder?: string;
80
82
  /** The input's error text. Alternatively, you can use the error-text slot. */
81
- errorText: string;
83
+ errorText: string | string[];
84
+ /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */
85
+ errorTextCount?: number;
82
86
  /** The input's label. Alternatively, you can use the label slot. */
83
87
  label: string;
84
88
  /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */
@@ -133,7 +137,6 @@ export declare class SixTimepicker {
133
137
  * Update the native input element when the value changes
134
138
  */
135
139
  protected valueChanged(): void;
136
- protected invalidChanged(invalid: boolean): void;
137
140
  /** Sets focus on the datepickers input. */
138
141
  setFocus(options?: FocusOptions): Promise<void>;
139
142
  private popupValue;
@@ -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
  */
@@ -297,7 +301,11 @@ export namespace Components {
297
301
  /**
298
302
  * The error message shown, if `invalid` is set to true.
299
303
  */
300
- "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;
301
309
  /**
302
310
  * Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`.
303
311
  */
@@ -581,6 +589,12 @@ export namespace Components {
581
589
  */
582
590
  "virtualScroll": boolean;
583
591
  }
592
+ /**
593
+ * @since 4.0
594
+ * @status beta
595
+ */
596
+ interface SixError {
597
+ }
584
598
  interface SixErrorPage {
585
599
  /**
586
600
  * Defines a custom description.
@@ -812,7 +826,11 @@ export namespace Components {
812
826
  /**
813
827
  * The error message shown, if `invalid` is set to true.
814
828
  */
815
- "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;
816
834
  /**
817
835
  * The input's help text. Alternatively, you can use the help-text slot.
818
836
  */
@@ -1182,7 +1200,11 @@ export namespace Components {
1182
1200
  /**
1183
1201
  * The error message shown, if `invalid` is set to true.
1184
1202
  */
1185
- "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;
1186
1208
  /**
1187
1209
  * The range's help text. Alternatively, you can use the help-text slot.
1188
1210
  */
@@ -1309,7 +1331,11 @@ export namespace Components {
1309
1331
  /**
1310
1332
  * The error message shown, if `invalid` is set to true.
1311
1333
  */
1312
- "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;
1313
1339
  /**
1314
1340
  * Set to true to allow filtering for entries in the dropdown
1315
1341
  */
@@ -1511,7 +1537,11 @@ export namespace Components {
1511
1537
  /**
1512
1538
  * The error message shown, if `invalid` is set to true.
1513
1539
  */
1514
- "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;
1515
1545
  /**
1516
1546
  * If this property is set to true and an error message is provided by `errorText`, the error message is displayed.
1517
1547
  */
@@ -1658,7 +1688,11 @@ export namespace Components {
1658
1688
  /**
1659
1689
  * The error message shown, if `invalid` is set to true.
1660
1690
  */
1661
- "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;
1662
1696
  /**
1663
1697
  * The textarea's help text. Alternatively, you can use the help-text slot.
1664
1698
  */
@@ -1806,7 +1840,11 @@ export namespace Components {
1806
1840
  /**
1807
1841
  * The input's error text. Alternatively, you can use the error-text slot.
1808
1842
  */
1809
- "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;
1810
1848
  /**
1811
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
1812
1850
  */
@@ -2177,6 +2215,16 @@ declare global {
2177
2215
  prototype: HTMLSixDropdownElement;
2178
2216
  new (): HTMLSixDropdownElement;
2179
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
+ };
2180
2228
  interface HTMLSixErrorPageElement extends Components.SixErrorPage, HTMLStencilElement {
2181
2229
  }
2182
2230
  var HTMLSixErrorPageElement: {
@@ -2597,6 +2645,7 @@ declare global {
2597
2645
  "six-dialog": HTMLSixDialogElement;
2598
2646
  "six-drawer": HTMLSixDrawerElement;
2599
2647
  "six-dropdown": HTMLSixDropdownElement;
2648
+ "six-error": HTMLSixErrorElement;
2600
2649
  "six-error-page": HTMLSixErrorPageElement;
2601
2650
  "six-file-list": HTMLSixFileListElement;
2602
2651
  "six-file-list-item": HTMLSixFileListItemElement;
@@ -2821,7 +2870,11 @@ declare namespace LocalJSX {
2821
2870
  /**
2822
2871
  * The error message shown, if `invalid` is set to true.
2823
2872
  */
2824
- "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;
2825
2878
  /**
2826
2879
  * Set to true to draw the checkbox in an indeterminate state.
2827
2880
  */
@@ -2899,7 +2952,11 @@ declare namespace LocalJSX {
2899
2952
  /**
2900
2953
  * The error message shown, if `invalid` is set to true.
2901
2954
  */
2902
- "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;
2903
2960
  /**
2904
2961
  * Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`.
2905
2962
  */
@@ -3243,6 +3300,12 @@ declare namespace LocalJSX {
3243
3300
  */
3244
3301
  "virtualScroll"?: boolean;
3245
3302
  }
3303
+ /**
3304
+ * @since 4.0
3305
+ * @status beta
3306
+ */
3307
+ interface SixError {
3308
+ }
3246
3309
  interface SixErrorPage {
3247
3310
  /**
3248
3311
  * Defines a custom description.
@@ -3506,7 +3569,11 @@ declare namespace LocalJSX {
3506
3569
  /**
3507
3570
  * The error message shown, if `invalid` is set to true.
3508
3571
  */
3509
- "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;
3510
3577
  /**
3511
3578
  * The input's help text. Alternatively, you can use the help-text slot.
3512
3579
  */
@@ -3880,7 +3947,11 @@ declare namespace LocalJSX {
3880
3947
  /**
3881
3948
  * The error message shown, if `invalid` is set to true.
3882
3949
  */
3883
- "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;
3884
3955
  /**
3885
3956
  * The range's help text. Alternatively, you can use the help-text slot.
3886
3957
  */
@@ -4019,7 +4090,11 @@ declare namespace LocalJSX {
4019
4090
  /**
4020
4091
  * The error message shown, if `invalid` is set to true.
4021
4092
  */
4022
- "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;
4023
4098
  /**
4024
4099
  * Set to true to allow filtering for entries in the dropdown
4025
4100
  */
@@ -4229,7 +4304,11 @@ declare namespace LocalJSX {
4229
4304
  /**
4230
4305
  * The error message shown, if `invalid` is set to true.
4231
4306
  */
4232
- "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;
4233
4312
  /**
4234
4313
  * If this property is set to true and an error message is provided by `errorText`, the error message is displayed.
4235
4314
  */
@@ -4384,7 +4463,11 @@ declare namespace LocalJSX {
4384
4463
  /**
4385
4464
  * The error message shown, if `invalid` is set to true.
4386
4465
  */
4387
- "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;
4388
4471
  /**
4389
4472
  * The textarea's help text. Alternatively, you can use the help-text slot.
4390
4473
  */
@@ -4528,7 +4611,11 @@ declare namespace LocalJSX {
4528
4611
  /**
4529
4612
  * The input's error text. Alternatively, you can use the error-text slot.
4530
4613
  */
4531
- "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;
4532
4619
  /**
4533
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
4534
4621
  */
@@ -4685,6 +4772,7 @@ declare namespace LocalJSX {
4685
4772
  "six-dialog": SixDialog;
4686
4773
  "six-drawer": SixDrawer;
4687
4774
  "six-dropdown": SixDropdown;
4775
+ "six-error": SixError;
4688
4776
  "six-error-page": SixErrorPage;
4689
4777
  "six-file-list": SixFileList;
4690
4778
  "six-file-list-item": SixFileListItem;
@@ -4796,6 +4884,11 @@ declare module "@stencil/core" {
4796
4884
  * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.
4797
4885
  */
4798
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>;
4799
4892
  "six-error-page": LocalJSX.SixErrorPage & JSXBase.HTMLAttributes<HTMLSixErrorPageElement>;
4800
4893
  /**
4801
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;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.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.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:_(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;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,"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-ed381ad9.entry.js.map
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