@skf-design-system/ui-components 1.0.1-beta.1 → 1.0.2-beta.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 (299) hide show
  1. package/README.md +13 -26
  2. package/dist/components/accordion/accordion-item.component.d.ts +36 -0
  3. package/dist/components/accordion/accordion-item.component.js +87 -0
  4. package/dist/components/accordion/accordion-item.d.ts +3 -3
  5. package/dist/components/accordion/accordion-item.js +4 -5
  6. package/dist/components/accordion/accordion-item.styles.js +77 -0
  7. package/dist/components/accordion/accordion.component.d.ts +9 -13
  8. package/dist/components/accordion/accordion.component.js +12 -13
  9. package/dist/components/accordion/accordion.d.ts +0 -1
  10. package/dist/components/accordion/accordion.js +0 -2
  11. package/dist/components/alert/alert.component.d.ts +6 -10
  12. package/dist/components/alert/alert.component.js +15 -16
  13. package/dist/components/alert/alert.styles.js +0 -5
  14. package/dist/components/breadcrumb/breadcrumb-item.component.js +61 -0
  15. package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
  16. package/dist/components/breadcrumb/breadcrumb-item.styles.js +62 -0
  17. package/dist/components/breadcrumb/breadcrumb.component.d.ts +2 -2
  18. package/dist/components/breadcrumb/breadcrumb.component.js +60 -0
  19. package/dist/components/breadcrumb/breadcrumb.js +6 -0
  20. package/dist/components/breadcrumb/breadcrumb.styles.js +22 -0
  21. package/dist/components/button/button.component.d.ts +13 -10
  22. package/dist/components/button/button.component.js +83 -76
  23. package/dist/components/button/button.styles.d.ts +1 -2
  24. package/dist/components/button/button.styles.js +1 -1
  25. package/dist/components/card/card.component.d.ts +1 -1
  26. package/dist/components/card/card.component.js +18 -30
  27. package/dist/components/card/card.styles.js +25 -28
  28. package/dist/components/checkbox/checkbox.component.d.ts +16 -14
  29. package/dist/components/checkbox/checkbox.component.js +5 -5
  30. package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
  31. package/dist/components/checkbox/checkbox.styles.js +1 -5
  32. package/dist/components/date-picker/datepicker.calendar.component.d.ts +5 -0
  33. package/dist/components/date-picker/datepicker.calendar.component.js +128 -95
  34. package/dist/components/date-picker/datepicker.calendar.styles.js +35 -25
  35. package/dist/components/date-picker/datepicker.component.d.ts +5 -0
  36. package/dist/components/date-picker/datepicker.component.js +117 -97
  37. package/dist/components/date-picker/datepicker.helpers.d.ts +3 -2
  38. package/dist/components/date-picker/datepicker.helpers.js +46 -39
  39. package/dist/components/date-picker/datepicker.styles.js +14 -26
  40. package/dist/components/date-picker-input/datepicker-input.component.d.ts +14 -5
  41. package/dist/components/date-picker-input/datepicker-input.component.js +264 -219
  42. package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +36 -2
  43. package/dist/components/date-picker-input/datepicker-input.helpers.js +25 -23
  44. package/dist/components/date-picker-input/datepicker-input.styles.js +6 -10
  45. package/dist/components/dialog/dialog.component.d.ts +20 -29
  46. package/dist/components/dialog/dialog.component.js +85 -75
  47. package/dist/components/dialog/dialog.styles.js +4 -4
  48. package/dist/components/divider/divider.component.d.ts +4 -8
  49. package/dist/components/divider/divider.component.js +24 -46
  50. package/dist/components/divider/divider.styles.js +34 -30
  51. package/dist/components/drawer/drawer.component.d.ts +61 -0
  52. package/dist/components/drawer/drawer.component.js +125 -0
  53. package/dist/components/drawer/drawer.d.ts +8 -0
  54. package/dist/components/drawer/drawer.js +6 -0
  55. package/dist/components/drawer/drawer.styles.js +71 -0
  56. package/dist/components/header/header.component.d.ts +46 -0
  57. package/dist/components/header/header.component.js +116 -0
  58. package/dist/components/header/header.d.ts +8 -0
  59. package/dist/components/header/header.js +6 -0
  60. package/dist/components/header/header.styles.js +68 -0
  61. package/dist/components/heading/heading.component.d.ts +3 -11
  62. package/dist/components/heading/heading.component.js +24 -23
  63. package/dist/components/heading/heading.styles.d.ts +1 -2
  64. package/dist/components/heading/heading.styles.js +1 -1
  65. package/dist/components/icon/icon.component.d.ts +11 -17
  66. package/dist/components/icon/icon.component.js +2 -2
  67. package/dist/components/icon/icon.styles.d.ts +1 -2
  68. package/dist/components/icon/icon.styles.js +1 -1
  69. package/dist/components/input/input.component.d.ts +30 -31
  70. package/dist/components/input/input.component.js +138 -125
  71. package/dist/components/input/input.controllers.d.ts +20 -6
  72. package/dist/components/input/input.controllers.js +14 -10
  73. package/dist/components/link/link.component.d.ts +12 -14
  74. package/dist/components/link/link.component.js +35 -34
  75. package/dist/components/link/link.styles.d.ts +1 -2
  76. package/dist/components/link/link.styles.js +24 -20
  77. package/dist/components/loader/loader.component.d.ts +1 -1
  78. package/dist/components/loader/loader.component.js +36 -40
  79. package/dist/components/loader/loader.styles.d.ts +1 -2
  80. package/dist/components/loader/loader.styles.js +40 -32
  81. package/dist/components/logo/logo.component.d.ts +4 -5
  82. package/dist/components/logo/logo.component.js +1 -1
  83. package/dist/components/menu/menu-item.component.d.ts +13 -0
  84. package/dist/components/{menu-item → menu}/menu-item.component.js +3 -3
  85. package/dist/components/menu/menu.component.d.ts +10 -8
  86. package/dist/components/menu/menu.component.js +8 -10
  87. package/dist/components/nav/nav-item.component.d.ts +18 -0
  88. package/dist/components/nav/nav-item.component.js +38 -0
  89. package/dist/components/nav/nav-item.d.ts +8 -0
  90. package/dist/components/nav/nav-item.js +6 -0
  91. package/dist/components/nav/nav-item.styles.js +39 -0
  92. package/dist/components/nav/nav.component.d.ts +17 -0
  93. package/dist/components/nav/nav.component.js +34 -0
  94. package/dist/components/nav/nav.d.ts +8 -0
  95. package/dist/components/nav/nav.js +6 -0
  96. package/dist/components/nav/nav.styles.d.ts +1 -0
  97. package/dist/components/nav/nav.styles.js +17 -0
  98. package/dist/components/popover/popover.component.d.ts +11 -8
  99. package/dist/components/popover/popover.component.js +24 -26
  100. package/dist/components/progress/progress.component.d.ts +2 -2
  101. package/dist/components/progress/progress.component.js +31 -37
  102. package/dist/components/progress/progress.styles.js +40 -35
  103. package/dist/components/radio/radio.component.d.ts +19 -13
  104. package/dist/components/radio/radio.component.js +12 -12
  105. package/dist/components/radio/radio.styles.d.ts +1 -2
  106. package/dist/components/radio/radio.styles.js +1 -1
  107. package/dist/components/segmented-button/segmented-button-item.component.d.ts +36 -0
  108. package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
  109. package/dist/components/segmented-button/segmented-button-item.d.ts +8 -0
  110. package/dist/components/segmented-button/segmented-button-item.js +6 -0
  111. package/dist/components/segmented-button/segmented-button-item.styles.d.ts +1 -0
  112. package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
  113. package/dist/components/segmented-button/segmented-button.component.d.ts +30 -0
  114. package/dist/components/segmented-button/segmented-button.component.js +73 -0
  115. package/dist/components/segmented-button/segmented-button.d.ts +8 -0
  116. package/dist/components/segmented-button/segmented-button.js +6 -0
  117. package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
  118. package/dist/components/segmented-button/segmented-button.styles.js +16 -0
  119. package/dist/components/{select-option-group → select}/select-option-group.component.js +1 -1
  120. package/dist/components/select/select-option-group.style.d.ts +1 -0
  121. package/dist/components/{select-option → select}/select-option.component.d.ts +7 -8
  122. package/dist/components/{select-option → select}/select-option.component.js +15 -15
  123. package/dist/components/select/select-option.controllers.d.ts +15 -0
  124. package/dist/components/select/select-option.styles.d.ts +1 -0
  125. package/dist/components/select/select.component.d.ts +16 -15
  126. package/dist/components/select/select.component.js +19 -19
  127. package/dist/components/select/select.controllers.d.ts +21 -10
  128. package/dist/components/select/select.controllers.js +31 -23
  129. package/dist/components/select/select.stories.icons.d.ts +7 -0
  130. package/dist/components/{stepper-item → stepper}/stepper-item.component.js +8 -8
  131. package/dist/components/stepper/stepper-item.styles.d.ts +1 -0
  132. package/dist/components/stepper/stepper.component.d.ts +4 -3
  133. package/dist/components/stepper/stepper.component.js +15 -15
  134. package/dist/components/stepper/stepper.helpers.d.ts +1 -1
  135. package/dist/components/switch/switch.component.d.ts +7 -6
  136. package/dist/components/switch/switch.component.js +21 -21
  137. package/dist/components/tab/tab.component.js +1 -1
  138. package/dist/components/tab-group/tab-group.component.js +1 -1
  139. package/dist/components/tab-panel/tab-panel.component.js +1 -1
  140. package/dist/components/tag/tag.component.d.ts +14 -16
  141. package/dist/components/tag/tag.component.js +36 -39
  142. package/dist/components/textarea/textarea.component.d.ts +10 -11
  143. package/dist/components/textarea/textarea.component.js +65 -67
  144. package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
  145. package/dist/components/{toast-item → toast}/toast-item.js +4 -0
  146. package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
  147. package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
  148. package/dist/components/toast/toast.component.d.ts +6 -5
  149. package/dist/components/toast/toast.component.js +15 -15
  150. package/dist/components/toast/toast.singleton.d.ts +4 -4
  151. package/dist/components/toast/toast.singleton.js +12 -12
  152. package/dist/components/tooltip/tooltip.component.d.ts +7 -7
  153. package/dist/components/tooltip/tooltip.component.js +16 -11
  154. package/dist/custom-elements.json +2718 -2073
  155. package/dist/index.d.ts +16 -6
  156. package/dist/index.js +103 -75
  157. package/dist/internal/base-classes/popover/popover.base.d.ts +24 -9
  158. package/dist/internal/base-classes/popover/popover.base.js +138 -77
  159. package/dist/internal/base-classes/popover/popover.styles.js +14 -1
  160. package/dist/internal/components/hint/hint.component.d.ts +2 -2
  161. package/dist/internal/components/hint/hint.component.js +2 -2
  162. package/dist/internal/components/hint/hint.styles.d.ts +1 -2
  163. package/dist/internal/components/hint/hint.styles.js +1 -1
  164. package/dist/internal/constants/iconSeverity.d.ts +3 -2
  165. package/dist/internal/constants/iconSeverity.js +2 -3
  166. package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
  167. package/dist/internal/controllers/popover.controller.d.ts +12 -7
  168. package/dist/internal/controllers/popover.controller.js +9 -14
  169. package/dist/internal/helpers/hintSeverity.d.ts +2 -2
  170. package/dist/internal/helpers/hintSeverity.js +1 -1
  171. package/dist/internal/helpers/utilityTypes.d.ts +1 -1
  172. package/dist/internal/helpers/uuid.d.ts +15 -0
  173. package/dist/internal/helpers/uuid.js +14 -0
  174. package/dist/internal/storybook/styles.d.ts +1 -0
  175. package/dist/internal/types/formField.d.ts +1 -1
  176. package/dist/internal/types.d.ts +18 -0
  177. package/dist/styles/component.styles.d.ts +1 -2
  178. package/dist/styles/component.styles.js +1 -1
  179. package/dist/styles/form-field.styles.js +11 -6
  180. package/dist/styles/global.css +1 -1
  181. package/dist/types/jsx/custom-element-jsx.d.ts +673 -1310
  182. package/dist/types/vue/index.d.ts +456 -319
  183. package/dist/vscode.html-custom-data.json +402 -1080
  184. package/dist/web-types.json +986 -767
  185. package/package.json +44 -55
  186. package/dist/components/collapse/collapse.component.d.ts +0 -40
  187. package/dist/components/collapse/collapse.component.js +0 -86
  188. package/dist/components/collapse/collapse.d.ts +0 -8
  189. package/dist/components/collapse/collapse.js +0 -6
  190. package/dist/components/collapse/collapse.styles.d.ts +0 -2
  191. package/dist/components/collapse/collapse.styles.js +0 -77
  192. package/dist/components/menu-item/menu-item.component.d.ts +0 -25
  193. package/dist/components/select-option/select-option.controllers.d.ts +0 -9
  194. package/dist/internal/constants/heading.d.ts +0 -2
  195. package/dist/react/index.d.ts +0 -36
  196. package/dist/react/index.js +0 -36
  197. package/dist/react/skf-accordion/index.d.ts +0 -3
  198. package/dist/react/skf-accordion/index.js +0 -13
  199. package/dist/react/skf-alert/index.d.ts +0 -9
  200. package/dist/react/skf-alert/index.js +0 -17
  201. package/dist/react/skf-breadcrumb/index.d.ts +0 -9
  202. package/dist/react/skf-breadcrumb/index.js +0 -17
  203. package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
  204. package/dist/react/skf-breadcrumb-item/index.js +0 -13
  205. package/dist/react/skf-button/index.d.ts +0 -9
  206. package/dist/react/skf-button/index.js +0 -17
  207. package/dist/react/skf-card/index.d.ts +0 -3
  208. package/dist/react/skf-card/index.js +0 -13
  209. package/dist/react/skf-checkbox/index.d.ts +0 -9
  210. package/dist/react/skf-checkbox/index.js +0 -17
  211. package/dist/react/skf-collapse/index.d.ts +0 -9
  212. package/dist/react/skf-collapse/index.js +0 -17
  213. package/dist/react/skf-datepicker/index.d.ts +0 -12
  214. package/dist/react/skf-datepicker/index.js +0 -18
  215. package/dist/react/skf-dialog/index.d.ts +0 -15
  216. package/dist/react/skf-dialog/index.js +0 -19
  217. package/dist/react/skf-divider/index.d.ts +0 -3
  218. package/dist/react/skf-divider/index.js +0 -13
  219. package/dist/react/skf-heading/index.d.ts +0 -3
  220. package/dist/react/skf-heading/index.js +0 -13
  221. package/dist/react/skf-icon/index.d.ts +0 -3
  222. package/dist/react/skf-icon/index.js +0 -13
  223. package/dist/react/skf-input/index.d.ts +0 -12
  224. package/dist/react/skf-input/index.js +0 -18
  225. package/dist/react/skf-link/index.d.ts +0 -3
  226. package/dist/react/skf-link/index.js +0 -13
  227. package/dist/react/skf-loader/index.d.ts +0 -3
  228. package/dist/react/skf-loader/index.js +0 -13
  229. package/dist/react/skf-logo/index.d.ts +0 -3
  230. package/dist/react/skf-logo/index.js +0 -13
  231. package/dist/react/skf-menu/index.d.ts +0 -12
  232. package/dist/react/skf-menu/index.js +0 -18
  233. package/dist/react/skf-menu-item/index.d.ts +0 -27
  234. package/dist/react/skf-menu-item/index.js +0 -23
  235. package/dist/react/skf-popover/index.d.ts +0 -12
  236. package/dist/react/skf-popover/index.js +0 -18
  237. package/dist/react/skf-progress/index.d.ts +0 -3
  238. package/dist/react/skf-progress/index.js +0 -13
  239. package/dist/react/skf-radio/index.d.ts +0 -9
  240. package/dist/react/skf-radio/index.js +0 -17
  241. package/dist/react/skf-select/index.d.ts +0 -21
  242. package/dist/react/skf-select/index.js +0 -21
  243. package/dist/react/skf-select-option/index.d.ts +0 -9
  244. package/dist/react/skf-select-option/index.js +0 -17
  245. package/dist/react/skf-select-option-group/index.d.ts +0 -3
  246. package/dist/react/skf-select-option-group/index.js +0 -13
  247. package/dist/react/skf-stepper/index.d.ts +0 -9
  248. package/dist/react/skf-stepper/index.js +0 -17
  249. package/dist/react/skf-stepper-item/index.d.ts +0 -9
  250. package/dist/react/skf-stepper-item/index.js +0 -17
  251. package/dist/react/skf-switch/index.d.ts +0 -3
  252. package/dist/react/skf-switch/index.js +0 -13
  253. package/dist/react/skf-tab/index.d.ts +0 -12
  254. package/dist/react/skf-tab/index.js +0 -18
  255. package/dist/react/skf-tab-group/index.d.ts +0 -3
  256. package/dist/react/skf-tab-group/index.js +0 -13
  257. package/dist/react/skf-tab-panel/index.d.ts +0 -3
  258. package/dist/react/skf-tab-panel/index.js +0 -13
  259. package/dist/react/skf-tag/index.d.ts +0 -3
  260. package/dist/react/skf-tag/index.js +0 -13
  261. package/dist/react/skf-textarea/index.d.ts +0 -12
  262. package/dist/react/skf-textarea/index.js +0 -18
  263. package/dist/react/skf-toast/index.d.ts +0 -3
  264. package/dist/react/skf-toast/index.js +0 -13
  265. package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
  266. package/dist/react/skf-toast-wrapper/index.js +0 -13
  267. package/dist/react/skf-tooltip/index.d.ts +0 -12
  268. package/dist/react/skf-tooltip/index.js +0 -18
  269. /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
  270. /package/dist/components/{collapse/collapse.test.d.ts → accordion/accordion-item.test.d.ts} +0 -0
  271. /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
  272. /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +0 -0
  273. /package/dist/components/{menu-item/menu-item.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
  274. /package/dist/components/{select-option-group/select-option-group.style.d.ts → drawer/drawer.styles.d.ts} +0 -0
  275. /package/dist/components/{select-option/select-option.styles.d.ts → header/header.styles.d.ts} +0 -0
  276. /package/dist/components/{menu-item → menu}/menu-item.d.ts +0 -0
  277. /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
  278. /package/dist/components/{stepper-item/stepper-item.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
  279. /package/dist/components/{menu-item → menu}/menu-item.styles.js +0 -0
  280. /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → nav/nav-item.styles.d.ts} +0 -0
  281. /package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +0 -0
  282. /package/dist/components/{select-option-group → select}/select-option-group.d.ts +0 -0
  283. /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
  284. /package/dist/components/{select-option-group → select}/select-option-group.style.js +0 -0
  285. /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
  286. /package/dist/components/{select-option → select}/select-option.js +0 -0
  287. /package/dist/components/{select-option → select}/select-option.styles.js +0 -0
  288. /package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +0 -0
  289. /package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +0 -0
  290. /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
  291. /package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +0 -0
  292. /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
  293. /package/dist/components/{toast-item → toast}/toast-item.component.js +0 -0
  294. /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
  295. /package/dist/components/{toast-item → toast}/toast-item.styles.js +0 -0
  296. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
  297. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
  298. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
  299. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -1,227 +1,263 @@
1
- import { dateFormatter as v, isPopoverOpen as S, debounce as E, isDate as $ } from "./datepicker-input.helpers.js";
2
- import { computePosition as C, flip as I, offset as M } from "@floating-ui/dom";
3
- import { FormBase as O } from "../../internal/components/formBase.js";
4
- import { PopoverController as T } from "../../internal/controllers/popover.controller.js";
5
- import { hintSeverity as B } from "../../internal/helpers/hintSeverity.js";
6
- import { watch as P } from "../../internal/helpers/watch.js";
1
+ import { dateFormatter as v, is as f, isPopoverOpen as S, debounce as E } from "./datepicker-input.helpers.js";
2
+ import "../icon/icon.js";
3
+ import { computePosition as C, flip as I, offset as O } from "@floating-ui/dom";
4
+ import { FormBase as M } from "../../internal/components/formBase.js";
5
+ import "../../internal/components/hint/hint.js";
6
+ import { PopoverController as P } from "../../internal/controllers/popover.controller.js";
7
+ import { hintSeverity as T } from "../../internal/helpers/hintSeverity.js";
8
+ import { watch as B } from "../../internal/helpers/watch.js";
7
9
  import { Asterisk as x } from "../../internal/templates/asterisk.js";
8
- import { Temporal as F } from "@js-temporal/polyfill";
9
- import q from "../../styles/component.styles.js";
10
- import { html as m, nothing as g } from "lit";
11
- import { property as d, state as b, query as y, queryAssignedNodes as R } from "lit/decorators.js";
12
- import { ifDefined as u } from "lit/directives/if-defined.js";
13
- import { live as k } from "lit/directives/live.js";
10
+ import { Temporal as w } from "@js-temporal/polyfill";
11
+ import { componentStyles as L } from "../../styles/component.styles.js";
12
+ import { nothing as g, html as y } from "lit";
13
+ import { property as h, state as $, query as b, queryAssignedNodes as R } from "lit/decorators.js";
14
+ import { ifDefined as p } from "lit/directives/if-defined.js";
15
+ import { live as F } from "lit/directives/live.js";
14
16
  import "../date-picker/datepicker.js";
15
- import { styles as j } from "./datepicker-input.styles.js";
16
- var L = Object.defineProperty, V = Object.getOwnPropertyDescriptor, n = (D, t, e, a) => {
17
- for (var l = a > 1 ? void 0 : a ? V(t, e) : t, o = D.length - 1, h; o >= 0; o--)
18
- (h = D[o]) && (l = (a ? h(t, e, l) : h(l)) || l);
19
- return a && l && L(t, e, l), l;
17
+ import { styles as A } from "./datepicker-input.styles.js";
18
+ var j = Object.defineProperty, q = Object.getOwnPropertyDescriptor, r = (D, e, t, a) => {
19
+ for (var l = a > 1 ? void 0 : a ? q(e, t) : e, n = D.length - 1, d; n >= 0; n--)
20
+ (d = D[n]) && (l = (a ? d(e, t, l) : d(l)) || l);
21
+ return a && l && j(e, t, l), l;
20
22
  };
21
- const _ = class _ extends O {
23
+ const _ = class _ extends M {
22
24
  constructor() {
23
- super(), this.popoverController = new T(this), this.id = "skf-datepicker-input", this.placeholder = "Select date", this.range = !1, this.validateOn = "change", this.invalid = !1, this.selectedRangeDates = { start: null, end: null }, this.showClearbutton = !1, this._handleSelectedDate = (t) => {
24
- console.log("selected-date-changed event fired", this.value || "no value", t.detail), this.pristine = !1, this._internals.setFormValue(this.value ?? ""), this.validateInput();
25
- }, this._handleDateSelected = (t) => {
26
- if (this.range && "start" in t.detail.date && "end" in t.detail.date) {
27
- const e = t.detail.date.start, a = t.detail.date.end;
28
- this.value = `${v(e)},${v(a)}`, this.selectedRangeDates = { start: e, end: a };
29
- } else !this.range && t.detail.date instanceof Date && (this.value = v(t.detail.date), this._animatePopover({ el: this.$popover, show: !1 }).then(() => {
25
+ super(), this.popoverController = new P(this), this.id = "skf-datepicker-input", this.placeholder = "YYYY-MM-DD", this.range = !1, this.size = "md", this.validateOn = "change", this.invalid = !1, this.selectedRangeDates = { start: null, end: null }, this.showClearbutton = !1, this.abortController = new AbortController(), this.abortSignal = this.abortController.signal, this._handleSelectedDate = () => {
26
+ this.pristine = !1, this._internals.setFormValue(this.value ?? ""), this.validateInput();
27
+ }, this._handleDateSelected = (e) => {
28
+ if (this.range && "start" in e.detail.date && "end" in e.detail.date) {
29
+ const t = e.detail.date.start, a = e.detail.date.end;
30
+ this.value = `${v(t)},${v(a)}`, this.selectedRangeDates = { start: t, end: a };
31
+ } else !this.range && e.detail.date instanceof Date && (this.value = v(e.detail.date), this._animatePopover({ el: this.$popover, show: !1 }).then(() => {
30
32
  this.$popover.hidePopover();
31
33
  }));
34
+ }, this._handleKeyboardEvents = (e) => {
35
+ var a, l;
36
+ const t = e.target.closest("input");
37
+ if (t) {
38
+ if ((t.selectionStart ?? 0) < t.value.length && /[[0-9-]/.test(e.key)) {
39
+ const n = t.selectionStart ?? 0, u = t.value.split("").slice(0, n);
40
+ t.value = u.join("");
41
+ }
42
+ if (t.name.endsWith("-end") && (e.key === "Backspace" && t.value.length === 0 || t.selectionStart === 0 && e.key === "ArrowLeft") && (e.preventDefault(), this.$input.focus()), e.key === "Tab" && !e.shiftKey && t.name.endsWith("-end")) {
43
+ e.preventDefault();
44
+ const d = (a = this.$popover.childNodes[1].shadowRoot) == null ? void 0 : a.querySelector("skf-datepicker-calendar"), u = (l = d == null ? void 0 : d.shadowRoot) == null ? void 0 : l.querySelector("button");
45
+ u == null || u.focus();
46
+ }
47
+ if ((t.value.length === 4 || t.value.length === 7) && /[[0-9]/.test(e.key) && (t.value = `${t.value}-${e.key}`, e.preventDefault()), e.key === "Escape")
48
+ if (t.blur(), this.$popover.hidePopover(), this.range) {
49
+ const n = this.$input.value, d = this.$input_range_end.value;
50
+ if (!f(n, d).date()) return;
51
+ this.$datepicker.selectedDateRange = {
52
+ start: new Date(n),
53
+ end: new Date(d)
54
+ }, this.$datepicker.emit("selected-date-changed", {
55
+ detail: { date: new Date(n) }
56
+ });
57
+ } else {
58
+ if (!t.value || !f(t.value).date()) return;
59
+ this.$datepicker.emit("selected-date-changed", {
60
+ detail: { date: new Date(t.value) }
61
+ });
62
+ }
63
+ e.key === "Enter" && (t.blur(), this.$popover.hidePopover());
64
+ }
32
65
  }, this._handleFocus = () => {
66
+ this.showPopover();
67
+ }, this.showPopover = () => {
33
68
  if (S(this.$popover)) return;
34
69
  E(() => {
35
70
  this.$popover.showPopover(), this._animatePopover({ show: !0 });
36
- }, 200)();
37
- }, this._handleBlur = (t) => {
38
- const e = t.target;
39
- if (!e.name.endsWith("-end") && !this.range) return;
40
- if ($(e.value) && this.$datepicker.emit("selected-date-changed", {
41
- detail: { date: new Date(e.value) }
42
- }), e.name.endsWith("-end") || !this.range) {
43
- const l = t.relatedTarget;
44
- a(this, l);
45
- }
46
- function a(l, o) {
47
- var h, c;
48
- if (o && !l.contains(o)) {
49
- console.log("Tab out detected");
50
- const r = (h = l.$popover.childNodes[1].shadowRoot) == null ? void 0 : h.querySelector("skf-datepicker-calendar"), p = (c = r == null ? void 0 : r.shadowRoot) == null ? void 0 : c.querySelector("button");
51
- p == null || p.focus();
52
- }
53
- }
71
+ }, 200)(), this.addEventListener("focusout", this.hidePopover, { once: !0, signal: this.abortSignal });
72
+ }, this.hidePopover = () => {
73
+ var t;
74
+ this.removeEventListener("focusout", this.hidePopover), ((t = document.activeElement) == null ? void 0 : t.closest("skf-datepicker-input")) !== this && this.$popover.hidePopover();
75
+ }, this._handleBlur = (e) => {
76
+ !e.target.name.endsWith("-end") && this.range;
54
77
  }, this._handleClose = () => {
55
78
  this.$anchor.blur();
56
79
  }, this.clearInput = () => {
57
80
  this.value = "", this.$datepicker.clearSelection();
58
81
  }, this.clear = () => {
59
82
  this.clearInput(), this._toggleClearButton(!1);
60
- }, this._handleInput = (t) => {
61
- const e = t.target;
62
- e.setCustomValidity(this.customError ?? ""), this.focusTomeoutId && clearTimeout(this.focusTomeoutId), this.$datepicker.date = e.value, this.range ? (this.$datepicker.selectedDateRange = {
63
- start: $(this.$input.value) ? new Date(this.$input.value) : null,
64
- end: $(this.$input_range_end.value) ? new Date(this.$input_range_end.value) : null
65
- }, $(this.$input.value) && (this.focusTomeoutId = setTimeout(() => {
66
- this.$input_range_end.focus();
67
- }, 2e3))) : this.$datepicker.selectedDate = new Date(e.value), this.validateOn === "input" && (this._pristine = !1, this.validateInput());
68
- }, this._toggleClearButton = (t = !1) => {
69
- this.showClearbutton = t;
83
+ }, this._handleInput = (e) => {
84
+ const t = e.target, a = String(t.value).replace(/[^0-9-]/g, "");
85
+ if (t.value = a, t.setCustomValidity(this.customError ?? ""), !!f(t.value).ISO()) {
86
+ if (this.focusTimeoutId && clearTimeout(this.focusTimeoutId), this.$datepicker.date = t.value, this.range) {
87
+ this.$datepicker.selectedDateRange = {
88
+ start: f(this.$input.value).ISO() ? new Date(this.$input.value) : null,
89
+ end: f(this.$input_range_end.value).ISO() ? new Date(this.$input_range_end.value) : null
90
+ };
91
+ const l = Object.values(this.$datepicker.selectedDateRange).filter(Boolean).map((n) => new Date(n).toLocaleDateString("en-CA")).join();
92
+ this.value = l, f(this.$input.value).ISO() && (this.focusTimeoutId = setTimeout(() => {
93
+ this.$input_range_end.focus();
94
+ }, 200));
95
+ } else
96
+ this.$datepicker.selectedDate = new Date(t.value), this.$datepicker.emit("selected-date-changed", {
97
+ detail: { date: new Date(t.value) }
98
+ });
99
+ this.validateOn === "input" && (this._pristine = !1, this.validateInput());
100
+ }
101
+ }, this._toggleClearButton = (e = !1) => {
102
+ this.showClearbutton = e;
70
103
  }, this.reposition = async () => {
71
- const { x: t, y: e } = await C(this.$anchor, this.$popover, {
104
+ const { x: e, y: t } = await C(this.$anchor, this.$popover, {
72
105
  placement: "bottom-start",
73
- middleware: [I(), M(0)],
106
+ middleware: [I(), O(0)],
74
107
  strategy: "fixed"
75
108
  });
76
109
  Object.assign(this.$popover.style, {
77
- left: `${String(t)}px`,
78
- top: `${String(e)}px`
110
+ left: `${String(e)}px`,
111
+ top: `${String(t)}px`
79
112
  });
80
113
  }, this.addEventListener("skf-datepicker-selected", this._handleDateSelected), this.addEventListener("reset", () => {
81
114
  this.clearInput(), this.validateInput();
82
115
  });
83
116
  }
84
- set customInvalid(t) {
85
- this.customError = t || "";
117
+ set customInvalid(e) {
118
+ this.customError = e ?? "";
86
119
  }
87
120
  get customInvalid() {
88
121
  return this.customError;
89
122
  }
90
123
  connectedCallback() {
91
- var t;
92
- super.connectedCallback(), this._init_date = (t = this.value) == null ? void 0 : t.split(",")[0], this.addEventListener("selected-date-changed", this._handleSelectedDate);
124
+ var e;
125
+ super.connectedCallback(), this._init_date = (e = this.value) == null ? void 0 : e.split(",")[0], this.addEventListener("selected-date-changed", this._handleSelectedDate);
126
+ }
127
+ disconnectedCallback() {
128
+ super.disconnectedCallback(), this.abortController.abort();
93
129
  }
94
130
  firstUpdated() {
95
- var t;
96
- this.$datepicker.date = this._init_date ? F.PlainDate.from(this._init_date).toString() : F.Now.plainDateISO().toString(), this.range ? this.$datepicker.selectedDateRange = {
131
+ var e;
132
+ this.$datepicker.date = this._init_date ? w.PlainDate.from(this._init_date).toString() : w.Now.plainDateISO().toString(), this.range ? this.$datepicker.selectedDateRange = {
97
133
  start: this._init_date ? new Date(this._init_date) : null,
98
- end: (t = this.value) != null && t.split(",")[1] ? new Date(this.value.split(",")[1]) : null
99
- } : this.$datepicker.selectedDate = this._init_date ? new Date(this._init_date) : void 0, this.validateInput();
134
+ end: (e = this.value) != null && e.split(",")[1] ? new Date(this.value.split(",")[1]) : null
135
+ } : this.$datepicker.selectedDate = this._init_date ? new Date(this._init_date) : void 0, this.hint && !this.hasAttribute("hint") && this.setAttribute("hint", this.hint), this.validateInput();
100
136
  }
101
- attributeChangedCallback(t, e, a) {
102
- if (super.attributeChangedCallback(t, e, a), t === "custom-invalid")
137
+ attributeChangedCallback(e, t, a) {
138
+ if (super.attributeChangedCallback(e, t, a), e === "custom-invalid")
103
139
  if (typeof a == "string") {
104
- const o = this.withFallback(a);
105
- this._pristine = !1, this._internals.setValidity({ customError: !0 }, o), this.invalid = !0, this.hint = o, this.checkValidity();
140
+ const n = this.withFallback(a);
141
+ this._pristine = !1, this._internals.setValidity({ customError: !0 }, n), this.invalid = !0, this.hint = n, this.checkValidity();
106
142
  } else
107
143
  this._internals.setValidity({}), this.validateInput();
108
144
  }
109
145
  _handleValueChange() {
110
- var t, e, a, l, o, h, c, i;
111
- (t = this.value) != null && t.trim() || this.$datepicker.clearSelection(), this._internals.setFormValue(this.value ?? ""), this.validateInput(), this._pristine = !1, this.$input.value = v((e = this.value) == null ? void 0 : e.split(",")[0]), this.range ? (this.$datepicker.selectedDateRange = {
112
- start: (o = this.value) != null && o.split(",")[0] ? new Date(this.value.split(",")[0]) : null,
113
- end: (h = this.value) != null && h.split(",")[1] ? new Date(this.value.split(",")[1]) : null
114
- }, this.$input_range_end.value = v((c = this.value) == null ? void 0 : c.split(",")[1]), this.$datepicker.date = ((i = this.value) == null ? void 0 : i.split(",")[0]) ?? "") : (this.$datepicker.selectedDate = (a = this.value) != null && a.split(",")[0] ? new Date(this.value.split(",")[0]) : void 0, this.$datepicker.date = ((l = this.value) == null ? void 0 : l.split(",")[0]) ?? ""), this.validateInput();
146
+ var e, t, a, l, n, d, u, i;
147
+ (e = this.value) != null && e.trim() || this.$datepicker.clearSelection(), this._internals.setFormValue(this.value ?? ""), this.validateInput(), this._pristine = !1, this.$input.value = v((t = this.value) == null ? void 0 : t.split(",")[0]), this.range ? (this.$datepicker.selectedDateRange = {
148
+ start: (n = this.value) != null && n.split(",")[0] ? new Date(this.value.split(",")[0]) : null,
149
+ end: (d = this.value) != null && d.split(",")[1] ? new Date(this.value.split(",")[1]) : null
150
+ }, this.$input_range_end.value = v((u = this.value) == null ? void 0 : u.split(",")[1]), this.$datepicker.date = ((i = this.value) == null ? void 0 : i.split(",")[0]) ?? "") : (this.$datepicker.selectedDate = (a = this.value) != null && a.split(",")[0] ? new Date(this.value.split(",")[0]) : void 0, this.$datepicker.date = ((l = this.value) == null ? void 0 : l.split(",")[0]) ?? ""), this.validateInput();
115
151
  }
116
152
  /** @internal */
117
- async _animatePopover({ el: t = this.$popover, show: e }) {
118
- return e && (t.style.opacity = "0", t.style.transform = "scaleY(0.5)"), new Promise((a) => {
153
+ async _animatePopover({ el: e = this.$popover, show: t }) {
154
+ return t && (e.style.opacity = "0", e.style.transform = "scaleY(0.5)"), new Promise((a) => {
119
155
  const l = [
120
156
  { opacity: 0, transform: "scaleY(0.5)" },
121
157
  { opacity: 1, transform: "scaleY(1)" }
122
- ], o = e ? l : l.reverse();
158
+ ], n = t ? l : l.reverse();
123
159
  setTimeout(
124
160
  () => {
125
- t.style.transformOrigin = "top";
126
- const h = this.$popover.animate(o, {
161
+ e.style.transformOrigin = "top";
162
+ const d = this.$popover.animate(n, {
127
163
  duration: 100,
128
164
  easing: "linear",
129
165
  fill: "both"
130
166
  });
131
- h.onfinish = () => {
167
+ d.onfinish = () => {
132
168
  a();
133
169
  };
134
170
  },
135
- e ? 0 : 50
171
+ t ? 0 : 50
136
172
  );
137
173
  });
138
174
  }
139
175
  /** @internal consider sharing this functionality with input */
140
176
  validateInput() {
141
177
  if (this._internals.validity.customError) return;
142
- let e = JSON.parse(JSON.stringify(this._internals.validity)), a = {};
178
+ let t = JSON.parse(JSON.stringify(this._internals.validity)), a = {};
143
179
  if (this.selectableFrom) {
144
- const { validityFragment: i, errorMessageFragment: r } = l(this);
145
- e = { ...e, ...i }, a = { ...a, ...r };
180
+ const { validityFragment: i, errorMessageFragment: o } = l(this);
181
+ t = { ...t, ...i }, a = { ...a, ...o };
146
182
  }
147
183
  if (this.selectableTo) {
148
- const { validityFragment: i, errorMessageFragment: r } = o(this);
149
- e = { ...e, ...i }, a = { ...a, ...r };
184
+ const { validityFragment: i, errorMessageFragment: o } = n(this);
185
+ t = { ...t, ...i }, a = { ...a, ...o };
150
186
  }
151
187
  if (this.range) {
152
- const { validityFragment: i, errorMessageFragment: r } = h(this);
153
- e = { ...e, ...i }, a = { ...a, ...r };
188
+ const { validityFragment: i, errorMessageFragment: o } = d(this);
189
+ t = { ...t, ...i }, a = { ...a, ...o };
154
190
  }
155
191
  if (this.required) {
156
- const { validityFragment: i, errorMessageFragment: r } = c(this);
157
- e = { ...e, ...i }, a = { ...a, ...r };
192
+ const { validityFragment: i, errorMessageFragment: o } = u(this);
193
+ t = { ...t, ...i }, a = { ...a, ...o };
158
194
  }
159
- if (e.valid = !Object.values(e).some((i) => i), this.invalid = !1, e.valid)
160
- this._internals.setValidity({ customError: this._internals.validity.customError });
195
+ if (t.valid = !Object.values(t).some((i) => i), this.invalid = !1, t.valid)
196
+ this._internals.setValidity({ customError: this._internals.validity.customError }), this.hint = this.getAttribute("hint") ?? "";
161
197
  else {
162
- this.invalid = !this._pristine && !e.valid;
198
+ this.invalid = !this._pristine && !t.valid;
163
199
  let i;
164
- for (i in e) {
165
- const r = `data-${i.toString()}`;
166
- if (e[i]) {
200
+ for (i in t) {
201
+ const o = `data-${i.toString()}`;
202
+ if (t[i]) {
167
203
  this.validationError = i.toString();
168
- const p = this.hasAttribute(r) ? this.getAttribute(r) : a[i];
204
+ const c = this.hasAttribute(o) ? this.getAttribute(o) : a[i];
169
205
  this._internals.setValidity(
170
206
  { [this.validationError]: !0, customError: this._internals.validity.customError },
171
- this.withFallback(p)
172
- ), this.invalid && this.customErrorDisplay && this.checkValidity();
207
+ this.withFallback(c)
208
+ ), c && !this._pristine && (this.hint = c), this.invalid && this.customErrorDisplay && this.checkValidity();
173
209
  }
174
210
  }
175
211
  }
176
212
  function l(i) {
177
- const r = { validityFragment: {}, errorMessageFragment: {} };
178
- if (!i.selectableFrom) return r;
179
- const p = new Date(i.selectableFrom);
180
- if (new Date(i.$input.value) < p) {
181
- const f = i.getAttribute("data-rangeunderflow") ?? "Date is out of range";
213
+ const o = { validityFragment: {}, errorMessageFragment: {} };
214
+ if (!i.selectableFrom) return o;
215
+ const c = new Date(i.selectableFrom);
216
+ if (new Date(i.$input.value) < c) {
217
+ const m = i.getAttribute("data-rangeunderflow") ?? `Date is out of range. Earliest selectable date is ${i.selectableFrom}.`;
182
218
  return {
183
219
  validityFragment: { rangeUnderflow: !0, valid: !1 },
184
- errorMessageFragment: { rangeUnderflow: f }
220
+ errorMessageFragment: { rangeUnderflow: m }
185
221
  };
186
222
  }
187
- return r;
223
+ return o;
188
224
  }
189
- function o(i) {
190
- const r = { validityFragment: {}, errorMessageFragment: {} };
191
- if (!i.selectableTo) return r;
192
- const p = new Date(i.selectableTo);
193
- if (new Date(i.$input.value) > p) {
194
- const f = i.getAttribute("data-rangeoverflow") ?? "Date is out of range";
225
+ function n(i) {
226
+ const o = { validityFragment: {}, errorMessageFragment: {} };
227
+ if (!i.selectableTo) return o;
228
+ const c = new Date(i.selectableTo);
229
+ if (new Date(i.$input.value) > c) {
230
+ const m = i.getAttribute("data-rangeoverflow") ?? `Date is out of range. Latest selectable date is ${i.selectableTo}.`;
195
231
  return {
196
232
  validityFragment: { rangeOverflow: !0, valid: !1 },
197
- errorMessageFragment: { rangeOverflow: f }
233
+ errorMessageFragment: { rangeOverflow: m }
198
234
  };
199
235
  }
200
- return r;
236
+ return o;
201
237
  }
202
- function h(i) {
203
- const r = { validityFragment: {}, errorMessageFragment: {} }, p = new Date(i.$input.value);
204
- if (new Date(i.$input_range_end.value) < p) {
205
- const f = i.getAttribute("data-rangeunderflow") ?? "Date is out of range";
238
+ function d(i) {
239
+ const o = { validityFragment: {}, errorMessageFragment: {} }, c = new Date(i.$input.value);
240
+ if (new Date(i.$input_range_end.value) < c) {
241
+ const m = i.getAttribute("data-rangeunderflow") ?? "End date cannot be before start date";
206
242
  return {
207
243
  validityFragment: { rangeUnderflow: !0, valid: !1 },
208
- errorMessageFragment: { rangeUnderflow: f }
244
+ errorMessageFragment: { rangeUnderflow: m }
209
245
  };
210
246
  }
211
- return r;
247
+ return o;
212
248
  }
213
- function c(i) {
214
- const r = { validityFragment: {}, errorMessageFragment: {} };
249
+ function u(i) {
250
+ const o = { validityFragment: {}, errorMessageFragment: {} };
215
251
  return !i.$input.value || i.range && !i.$input_range_end.value ? {
216
252
  validityFragment: { valueMissing: !0, valid: !1 },
217
253
  errorMessageFragment: { valueMissing: "This field is required" }
218
- } : r;
254
+ } : o;
219
255
  }
220
256
  }
221
257
  render() {
222
- var e, a, l, o, h, c, i, r;
223
- const t = (this._defaultSlot.length === 0 || !((a = (e = this._defaultSlot[0]) == null ? void 0 : e.textContent) != null && a.trim())) && !this.label;
224
- return m`
258
+ var t, a, l, n, d, u, i, o;
259
+ const e = (this._defaultSlot.length === 0 || !((a = (t = this._defaultSlot[0]) == null ? void 0 : t.textContent) != null && a.trim())) && !this.label;
260
+ return y`
225
261
  <div
226
262
  id="root"
227
263
  @mouseenter=${() => {
@@ -232,67 +268,73 @@ const _ = class _ extends O {
232
268
  }}
233
269
  >
234
270
  <label>
235
- <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
271
+ <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${e} id="label">
236
272
  <slot>${this.label}</slot>
237
273
  ${this.required ? x(this.requiredLabel) : null}
238
274
  </div>
239
275
  <div id="input">
240
- <div id="affix">
241
- <input
242
- ?disabled=${this.disabled}
243
- ?readonly=${this.readonly}
244
- .value=${k(
276
+ <input
277
+ ?disabled=${this.disabled}
278
+ ?readonly=${this.readonly}
279
+ .value=${F(
245
280
  this.range ? v((l = this.value) == null ? void 0 : l.split(",")[0]) : v(this.value)
246
281
  )}
247
- @blur=${this._handleBlur}
248
- @click=${this._handleFocus}
249
- @focus=${this._handleFocus}
250
- @input=${this._handleInput}
251
- aria-describedby=${u((o = this.hint) != null && o.trim() ? "hint" : g)}
252
- aria-errormessage=${u((h = this.hint) != null && h.trim() ? "hint" : g)}
253
- aria-invalid=${!!this.invalid}
254
- autocomplete="off"
255
- data-testid="field-input"
256
- inputmode=${u(this.inputMode)}
257
- name=${u(this.name)}
258
- placeholder=${u(this.placeholder)}
259
- type="date"
260
- />
261
- </div>
262
- ${this.range ? m`<div style="align-content:center">→</div>
282
+ @blur=${this._handleBlur}
283
+ @click=${this._handleFocus}
284
+ @focus=${this._handleFocus}
285
+ @input=${this._handleInput}
286
+ @keydown=${this._handleKeyboardEvents}
287
+ aria-describedby=${p((n = this.hint) != null && n.trim() ? "hint" : g)}
288
+ aria-errormessage=${p((d = this.hint) != null && d.trim() ? "hint" : g)}
289
+ aria-invalid=${!!this.invalid}
290
+ autocomplete="off"
291
+ data-testid="field-input"
292
+ inputmode=${p(this.inputMode)}
293
+ maxlength="10"
294
+ name=${this.name ?? "calendar"}
295
+ placeholder=${p(this.placeholder)}
296
+ type="text"
297
+ />
298
+ ${this.range ? y`
299
+ <skf-icon name="arrowRight"></skf-icon>
263
300
  <input
264
301
  ?disabled=${this.disabled}
265
302
  ?readonly=${this.readonly}
266
- .value=${k(v((c = this.value) == null ? void 0 : c.split(",")[1]))}
303
+ .value=${F(v((u = this.value) == null ? void 0 : u.split(",")[1]))}
267
304
  @blur=${this._handleBlur}
268
305
  @click=${this._handleFocus}
269
306
  @focus=${this._handleFocus}
270
307
  @input=${this._handleInput}
271
- aria-describedby=${u((i = this.hint) != null && i.trim() ? "hint" : g)}
272
- aria-errormessage=${u((r = this.hint) != null && r.trim() ? "hint" : g)}
308
+ @keydown=${this._handleKeyboardEvents}
309
+ aria-describedby=${p((i = this.hint) != null && i.trim() ? "hint" : g)}
310
+ aria-errormessage=${p((o = this.hint) != null && o.trim() ? "hint" : g)}
273
311
  aria-invalid=${!!this.invalid}
274
312
  autocomplete="off"
275
313
  data-testid="field-input-range-end"
276
- inputmode=${u(this.inputMode)}
277
- name=${u(String(this.name) + "-end")}
278
- placeholder=${u(this.placeholder)}
279
- type="date"
280
- />` : g}
281
- ${this.showClearbutton ? m`<button class="password skf-icon-host" type="button" @click=${this.clear}>
282
- <skf-icon name="close" size="sm"></skf-icon>
283
- </button>` : m`
314
+ inputmode=${p(this.inputMode)}
315
+ maxlength="10"
316
+ name=${(this.name ?? "calendar") + "-end"}
317
+ placeholder=${p(this.placeholder)}
318
+ type="text"
319
+ />
320
+ ` : g}
321
+ ${this.showClearbutton ? y`
322
+ <button class="password skf-icon-host" type="button" @click=${this.clear}>
323
+ <skf-icon name="close" size="sm"></skf-icon>
324
+ </button>
325
+ ` : y`
284
326
  <button class="password skf-icon-host" type="button">
285
327
  <skf-icon name="calendarMonth" size="sm"></skf-icon>
286
328
  </button>
287
329
  `}
288
330
  </div>
289
331
  </label>
290
- ${this.hint && m`
332
+ ${this.hint && y`
291
333
  <skf-hint
292
334
  aria-live=${this.invalid ? "assertive" : "polite"}
293
335
  id="hint"
294
- severity=${u(B(this.severity, this.invalid))}
295
- >${this.customInvalid ? this.customInvalid : this.hint}
336
+ severity=${p(T(this.invalid, this.severity))}
337
+ >${this.customInvalid ?? this.hint}
296
338
  </skf-hint>
297
339
  `}
298
340
  </div>
@@ -301,96 +343,99 @@ const _ = class _ extends O {
301
343
  <skf-datepicker
302
344
  ?range=${this.range}
303
345
  id=${this.id}
304
- invalid-dates=${u(this.invalidDates)}
305
- selectable-from=${u(this.selectableFrom)}
306
- selectable-to=${u(this.selectableTo)}
346
+ invalid-dates=${p(this.invalidDates)}
347
+ selectable-from=${p(this.selectableFrom)}
348
+ selectable-to=${p(this.selectableTo)}
307
349
  ></skf-datepicker>
308
350
  </div>
309
351
  `;
310
352
  }
311
353
  };
312
- _.styles = [q, j];
354
+ _.styles = [L, A];
313
355
  let s = _;
314
- n([
315
- d({ attribute: "custom-invalid", reflect: !0 })
356
+ r([
357
+ h({ attribute: "custom-invalid", reflect: !0 })
316
358
  ], s.prototype, "customInvalid", 1);
317
- n([
318
- d({ type: String })
359
+ r([
360
+ h({ type: String })
319
361
  ], s.prototype, "id", 2);
320
- n([
321
- d()
362
+ r([
363
+ h()
322
364
  ], s.prototype, "label", 2);
323
- n([
324
- d({ type: Boolean, attribute: "hide-label" })
365
+ r([
366
+ h({ type: Boolean, attribute: "hide-label" })
325
367
  ], s.prototype, "hideLabel", 2);
326
- n([
327
- d()
368
+ r([
369
+ h()
328
370
  ], s.prototype, "hint", 2);
329
- n([
330
- d({ attribute: "invalid-dates" })
371
+ r([
372
+ h({ attribute: "invalid-dates" })
331
373
  ], s.prototype, "invalidDates", 2);
332
- n([
333
- d({ reflect: !0 })
374
+ r([
375
+ h({ reflect: !0 })
334
376
  ], s.prototype, "name", 2);
335
- n([
336
- d()
377
+ r([
378
+ h()
337
379
  ], s.prototype, "placeholder", 2);
338
- n([
339
- d({ type: Boolean })
380
+ r([
381
+ h({ type: Boolean })
340
382
  ], s.prototype, "range", 2);
341
- n([
342
- d({ type: Boolean })
383
+ r([
384
+ h({ type: Boolean })
343
385
  ], s.prototype, "readonly", 2);
344
- n([
345
- d({ attribute: "required-label" })
386
+ r([
387
+ h({ attribute: "required-label" })
346
388
  ], s.prototype, "requiredLabel", 2);
347
- n([
348
- d({ attribute: "selectable-from" })
389
+ r([
390
+ h({ attribute: "selectable-from" })
349
391
  ], s.prototype, "selectableFrom", 2);
350
- n([
351
- d({ attribute: "selectable-to" })
392
+ r([
393
+ h({ attribute: "selectable-to" })
352
394
  ], s.prototype, "selectableTo", 2);
353
- n([
354
- d({ reflect: !0 })
395
+ r([
396
+ h({ reflect: !0 })
355
397
  ], s.prototype, "severity", 2);
356
- n([
357
- d({ type: String, attribute: "validate-on" })
398
+ r([
399
+ h({ reflect: !0 })
400
+ ], s.prototype, "size", 2);
401
+ r([
402
+ h({ type: String, attribute: "validate-on" })
358
403
  ], s.prototype, "validateOn", 2);
359
- n([
360
- d()
404
+ r([
405
+ h()
361
406
  ], s.prototype, "value", 2);
362
- n([
363
- b()
407
+ r([
408
+ $()
364
409
  ], s.prototype, "_init_date", 2);
365
- n([
366
- d({ type: Boolean, reflect: !0 })
410
+ r([
411
+ h({ type: Boolean, reflect: !0 })
367
412
  ], s.prototype, "invalid", 2);
368
- n([
369
- b()
413
+ r([
414
+ $()
370
415
  ], s.prototype, "selectedRangeDates", 2);
371
- n([
372
- b()
416
+ r([
417
+ $()
373
418
  ], s.prototype, "showClearbutton", 2);
374
- n([
375
- y("#popover")
419
+ r([
420
+ b("#popover")
376
421
  ], s.prototype, "$popover", 2);
377
- n([
378
- y("#input")
422
+ r([
423
+ b("#input")
379
424
  ], s.prototype, "$anchor", 2);
380
- n([
381
- y('input[data-testid="field-input"]')
425
+ r([
426
+ b('input[data-testid="field-input"]')
382
427
  ], s.prototype, "$input", 2);
383
- n([
384
- y('input[data-testid="field-input-range-end"]')
428
+ r([
429
+ b('input[data-testid="field-input-range-end"]')
385
430
  ], s.prototype, "$input_range_end", 2);
386
- n([
387
- y("skf-datepicker")
431
+ r([
432
+ b("skf-datepicker")
388
433
  ], s.prototype, "$datepicker", 2);
389
- n([
434
+ r([
390
435
  R({ flatten: !0 })
391
436
  ], s.prototype, "_defaultSlot", 2);
392
- n([
393
- P("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
437
+ r([
438
+ B("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
394
439
  ], s.prototype, "_handleValueChange", 1);
395
440
  export {
396
441
  s as SkfDatePickerInput