@skf-design-system/ui-components 1.0.2-beta.0 → 1.0.2-beta.10

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 (297) hide show
  1. package/README.md +37 -9
  2. package/dist/components/accordion/accordion-item.component.d.ts +36 -0
  3. package/dist/components/accordion/accordion-item.component.js +98 -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 +6 -10
  8. package/dist/components/accordion/accordion.component.js +9 -10
  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 +12 -10
  12. package/dist/components/alert/alert.component.js +59 -51
  13. package/dist/components/alert/alert.styles.js +50 -51
  14. package/dist/components/breadcrumb/breadcrumb-item.component.js +59 -0
  15. package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +2 -2
  16. package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
  17. package/dist/components/breadcrumb/breadcrumb-item.styles.js +63 -0
  18. package/dist/components/breadcrumb/breadcrumb.component.d.ts +6 -3
  19. package/dist/components/breadcrumb/breadcrumb.component.js +65 -0
  20. package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
  21. package/dist/components/breadcrumb/breadcrumb.js +6 -0
  22. package/dist/components/breadcrumb/breadcrumb.styles.js +25 -0
  23. package/dist/components/button/button.component.d.ts +13 -10
  24. package/dist/components/button/button.component.js +69 -66
  25. package/dist/components/button/button.styles.d.ts +1 -2
  26. package/dist/components/button/button.styles.js +6 -5
  27. package/dist/components/card/card.component.d.ts +6 -1
  28. package/dist/components/card/card.component.js +46 -24
  29. package/dist/components/card/card.styles.js +31 -14
  30. package/dist/components/checkbox/checkbox.component.d.ts +14 -11
  31. package/dist/components/checkbox/checkbox.component.js +67 -69
  32. package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
  33. package/dist/components/checkbox/checkbox.styles.js +2 -6
  34. package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +8 -1
  35. package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +109 -115
  36. package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
  37. package/dist/components/datepicker/datepicker-calendar.js +6 -0
  38. package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +9 -20
  39. package/dist/components/datepicker/datepicker-popup.component.js +272 -0
  40. package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
  41. package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
  42. package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
  43. package/dist/components/datepicker/datepicker-popup.js +6 -0
  44. package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
  45. package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +22 -14
  46. package/dist/components/datepicker/datepicker.component.js +455 -0
  47. package/dist/components/datepicker/datepicker.d.ts +8 -0
  48. package/dist/components/datepicker/datepicker.js +6 -0
  49. package/dist/components/dialog/dialog.component.d.ts +8 -6
  50. package/dist/components/dialog/dialog.component.js +67 -67
  51. package/dist/components/dialog/dialog.d.ts +2 -2
  52. package/dist/components/dialog/dialog.styles.js +4 -4
  53. package/dist/components/divider/divider.component.d.ts +3 -0
  54. package/dist/components/divider/divider.component.js +43 -22
  55. package/dist/components/divider/divider.styles.js +9 -9
  56. package/dist/components/drawer/drawer.component.d.ts +24 -12
  57. package/dist/components/drawer/drawer.component.js +87 -63
  58. package/dist/components/drawer/drawer.d.ts +2 -2
  59. package/dist/components/drawer/drawer.styles.js +47 -40
  60. package/dist/components/header/header.component.d.ts +7 -4
  61. package/dist/components/header/header.component.js +68 -55
  62. package/dist/components/header/header.d.ts +2 -2
  63. package/dist/components/header/header.styles.js +2 -2
  64. package/dist/components/heading/heading.component.d.ts +8 -6
  65. package/dist/components/heading/heading.component.js +52 -24
  66. package/dist/components/heading/heading.styles.js +34 -36
  67. package/dist/components/icon/icon.component.d.ts +15 -17
  68. package/dist/components/icon/icon.component.js +62 -43
  69. package/dist/components/icon/icon.styles.d.ts +1 -2
  70. package/dist/components/icon/icon.styles.js +60 -60
  71. package/dist/components/input/input.component.d.ts +34 -39
  72. package/dist/components/input/input.component.js +159 -153
  73. package/dist/components/input/input.controllers.d.ts +0 -1
  74. package/dist/components/input/input.controllers.js +14 -19
  75. package/dist/components/link/link.component.d.ts +20 -25
  76. package/dist/components/link/link.component.js +104 -107
  77. package/dist/components/link/link.styles.d.ts +1 -2
  78. package/dist/components/link/link.styles.js +54 -46
  79. package/dist/components/loader/loader.component.d.ts +6 -4
  80. package/dist/components/loader/loader.component.js +49 -42
  81. package/dist/components/loader/loader.styles.d.ts +1 -2
  82. package/dist/components/loader/loader.styles.js +34 -30
  83. package/dist/components/logo/logo.component.d.ts +8 -6
  84. package/dist/components/logo/logo.component.js +55 -51
  85. package/dist/components/logo/logo.styles.js +26 -16
  86. package/dist/components/menu/menu-item.component.d.ts +13 -0
  87. package/dist/components/menu/menu-item.component.js +13 -0
  88. package/dist/components/{menu-item → menu}/menu-item.d.ts +2 -2
  89. package/dist/components/menu/menu-item.styles.js +23 -0
  90. package/dist/components/menu/menu.component.d.ts +14 -8
  91. package/dist/components/menu/menu.component.js +10 -12
  92. package/dist/components/menu/menu.d.ts +2 -2
  93. package/dist/components/{nav-item → nav}/nav-item.component.d.ts +6 -4
  94. package/dist/components/nav/nav-item.component.js +57 -0
  95. package/dist/components/nav/nav-item.styles.js +43 -0
  96. package/dist/components/nav/nav.component.d.ts +9 -0
  97. package/dist/components/nav/nav.component.js +47 -21
  98. package/dist/components/nav/nav.d.ts +2 -2
  99. package/dist/components/nav/nav.styles.js +15 -9
  100. package/dist/components/popover/popover.component.d.ts +17 -6
  101. package/dist/components/popover/popover.component.js +22 -16
  102. package/dist/components/popover/popover.d.ts +2 -2
  103. package/dist/components/progress/progress.component.d.ts +4 -2
  104. package/dist/components/progress/progress.component.js +38 -35
  105. package/dist/components/progress/progress.d.ts +2 -2
  106. package/dist/components/progress/progress.styles.js +42 -35
  107. package/dist/components/radio/radio.component.d.ts +13 -9
  108. package/dist/components/radio/radio.component.js +96 -91
  109. package/dist/components/radio/radio.styles.js +1 -1
  110. package/dist/components/{segmented-button-item → segmented-button}/segmented-button-item.component.d.ts +4 -4
  111. package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
  112. package/dist/components/{segmented-button-item → segmented-button}/segmented-button-item.d.ts +2 -2
  113. package/dist/components/segmented-button/segmented-button-item.js +6 -0
  114. package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
  115. package/dist/components/segmented-button/segmented-button.component.d.ts +0 -2
  116. package/dist/components/segmented-button/segmented-button.component.js +71 -0
  117. package/dist/components/segmented-button/segmented-button.d.ts +2 -2
  118. package/dist/components/segmented-button/segmented-button.js +6 -0
  119. package/dist/components/segmented-button/segmented-button.styles.js +16 -0
  120. package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +4 -0
  121. package/dist/components/select/select-option-group.component.js +50 -0
  122. package/dist/components/{select-option-group → select}/select-option-group.d.ts +2 -2
  123. package/dist/components/select/select-option-group.style.js +24 -0
  124. package/dist/components/{select-option → select}/select-option.component.d.ts +16 -12
  125. package/dist/components/select/select-option.component.js +135 -0
  126. package/dist/components/select/select-option.styles.js +65 -0
  127. package/dist/components/select/select.component.d.ts +35 -25
  128. package/dist/components/select/select.component.js +126 -88
  129. package/dist/components/select/select.controllers.d.ts +1 -1
  130. package/dist/components/select/select.controllers.js +16 -18
  131. package/dist/components/select/select.styles.js +8 -2
  132. package/dist/components/select/stories/select.stories.icons.d.ts +7 -0
  133. package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +1 -1
  134. package/dist/components/stepper/stepper-item.component.js +116 -0
  135. package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +2 -2
  136. package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +4 -4
  137. package/dist/components/stepper/stepper.component.d.ts +2 -2
  138. package/dist/components/stepper/stepper.component.js +17 -18
  139. package/dist/components/stepper/stepper.d.ts +2 -2
  140. package/dist/components/stepper/stepper.helpers.d.ts +1 -1
  141. package/dist/components/stepper/stepper.helpers.js +6 -7
  142. package/dist/components/switch/switch.component.d.ts +4 -2
  143. package/dist/components/switch/switch.component.js +64 -58
  144. package/dist/components/switch/switch.d.ts +2 -2
  145. package/dist/components/switch/switch.styles.js +1 -1
  146. package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +1 -1
  147. package/dist/components/tabs/tab-panel.component.js +39 -0
  148. package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
  149. package/dist/components/{tab → tabs}/tab.component.d.ts +3 -3
  150. package/dist/components/{tab → tabs}/tab.component.js +18 -15
  151. package/dist/components/{tab → tabs}/tab.d.ts +2 -2
  152. package/dist/components/{tab → tabs}/tab.styles.js +2 -2
  153. package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
  154. package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +36 -37
  155. package/dist/components/tabs/tabs.d.ts +8 -0
  156. package/dist/components/tabs/tabs.js +6 -0
  157. package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
  158. package/dist/components/tag/tag.component.d.ts +20 -16
  159. package/dist/components/tag/tag.component.js +74 -65
  160. package/dist/components/tag/tag.d.ts +2 -2
  161. package/dist/components/tag/tag.styles.js +63 -50
  162. package/dist/components/textarea/textarea.component.d.ts +14 -13
  163. package/dist/components/textarea/textarea.component.js +77 -72
  164. package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
  165. package/dist/components/{toast-item → toast}/toast-item.js +4 -0
  166. package/dist/components/toast/toast-item.styles.js +21 -0
  167. package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
  168. package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
  169. package/dist/components/toast/toast.component.d.ts +5 -4
  170. package/dist/components/toast/toast.component.js +16 -16
  171. package/dist/components/toast/toast.singleton.d.ts +5 -5
  172. package/dist/components/toast/toast.singleton.js +28 -29
  173. package/dist/components/tooltip/tooltip.component.d.ts +11 -3
  174. package/dist/components/tooltip/tooltip.component.js +18 -9
  175. package/dist/components/tooltip/tooltip.d.ts +2 -2
  176. package/dist/custom-elements.json +2202 -1720
  177. package/dist/index.d.ts +19 -12
  178. package/dist/index.js +108 -89
  179. package/dist/internal/base-classes/popover/popover.base.d.ts +30 -6
  180. package/dist/internal/base-classes/popover/popover.base.js +83 -69
  181. package/dist/internal/base-classes/popover/popover.styles.js +4 -5
  182. package/dist/internal/components/formBase.d.ts +1 -0
  183. package/dist/internal/components/formBase.js +11 -19
  184. package/dist/internal/components/hint/hint.component.d.ts +6 -2
  185. package/dist/internal/components/hint/hint.component.js +47 -20
  186. package/dist/internal/components/hint/hint.styles.d.ts +1 -2
  187. package/dist/internal/components/hint/hint.styles.js +30 -26
  188. package/dist/internal/components/skf-element.d.ts +1 -3
  189. package/dist/internal/components/skf-element.js +4 -9
  190. package/dist/internal/constants/iconSeverity.d.ts +3 -2
  191. package/dist/internal/constants/iconSeverity.js +2 -3
  192. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  193. package/dist/internal/controllers/popover.controller.js +11 -14
  194. package/dist/internal/helpers/hintSeverity.d.ts +2 -2
  195. package/dist/internal/helpers/hintSeverity.js +1 -1
  196. package/dist/internal/helpers/stateMap.d.ts +14 -0
  197. package/dist/internal/helpers/stateMap.js +68 -0
  198. package/dist/internal/helpers/uuid.d.ts +8 -10
  199. package/dist/internal/helpers/uuid.js +4 -11
  200. package/dist/internal/helpers/watch.d.ts +1 -1
  201. package/dist/internal/helpers/watch.js +12 -12
  202. package/dist/internal/templates/asterisk.d.ts +1 -1
  203. package/dist/internal/templates/asterisk.js +4 -4
  204. package/dist/internal/types/formField.d.ts +1 -1
  205. package/dist/internal/types.d.ts +22 -0
  206. package/dist/styles/component.styles.d.ts +1 -2
  207. package/dist/styles/component.styles.js +38 -37
  208. package/dist/styles/global-alt.css +1 -0
  209. package/dist/styles/global.css +1 -1
  210. package/dist/translations/en.d.ts +3 -0
  211. package/dist/translations/en.js +27 -0
  212. package/dist/translations/es.d.ts +3 -0
  213. package/dist/translations/es.js +27 -0
  214. package/dist/translations/index.d.ts +4 -0
  215. package/dist/translations/pt.d.ts +3 -0
  216. package/dist/translations/pt.js +27 -0
  217. package/dist/translations/sv.d.ts +3 -0
  218. package/dist/translations/sv.js +27 -0
  219. package/dist/types/jsx/custom-element-jsx.d.ts +2031 -927
  220. package/dist/types/vue/index.d.ts +357 -324
  221. package/dist/utilities/localize.d.ts +28 -0
  222. package/dist/utilities/localize.js +13 -0
  223. package/dist/vscode.html-custom-data.json +360 -1241
  224. package/dist/web-types.json +932 -805
  225. package/package.json +38 -52
  226. package/dist/components/accordion/accordion.test.d.ts +0 -1
  227. package/dist/components/checkbox/checkbox.test.d.ts +0 -1
  228. package/dist/components/collapse/collapse.component.d.ts +0 -40
  229. package/dist/components/collapse/collapse.component.js +0 -86
  230. package/dist/components/collapse/collapse.d.ts +0 -8
  231. package/dist/components/collapse/collapse.js +0 -6
  232. package/dist/components/collapse/collapse.styles.d.ts +0 -2
  233. package/dist/components/collapse/collapse.styles.js +0 -77
  234. package/dist/components/collapse/collapse.test.d.ts +0 -1
  235. package/dist/components/date-picker/datepicker.component.js +0 -261
  236. package/dist/components/date-picker/datepicker.d.ts +0 -10
  237. package/dist/components/date-picker/datepicker.helpers.js +0 -76
  238. package/dist/components/date-picker/datepicker.js +0 -8
  239. package/dist/components/date-picker-input/datepicker-input.component.js +0 -441
  240. package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
  241. package/dist/components/date-picker-input/datepicker-input.js +0 -6
  242. package/dist/components/input/input.test.d.ts +0 -1
  243. package/dist/components/menu-item/menu-item.component.d.ts +0 -25
  244. package/dist/components/menu-item/menu-item.component.js +0 -13
  245. package/dist/components/menu-item/menu-item.styles.js +0 -19
  246. package/dist/components/nav-item/nav-item.component.js +0 -38
  247. package/dist/components/nav-item/nav-item.styles.js +0 -39
  248. package/dist/components/radio/radio.test.d.ts +0 -1
  249. package/dist/components/select-option/select-option.component.js +0 -123
  250. package/dist/components/select-option/select-option.styles.js +0 -53
  251. package/dist/components/select-option-group/select-option-group.component.js +0 -31
  252. package/dist/components/select-option-group/select-option-group.style.js +0 -18
  253. package/dist/components/stepper-item/stepper-item.component.js +0 -113
  254. package/dist/components/switch/switch.test.d.ts +0 -1
  255. package/dist/components/tab-group/tab-group.d.ts +0 -8
  256. package/dist/components/tab-group/tab-group.js +0 -6
  257. package/dist/components/tab-panel/tab-panel.component.js +0 -36
  258. package/dist/components/toast-item/toast-item.styles.js +0 -18
  259. package/dist/internal/constants/heading.d.ts +0 -2
  260. package/dist/internal/playwright/index.d.ts +0 -1
  261. /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
  262. /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
  263. /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
  264. /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
  265. /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
  266. /package/dist/components/{menu-item/menu-item.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
  267. /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
  268. /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
  269. /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
  270. /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
  271. /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
  272. /package/dist/components/{nav-item/nav-item.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
  273. /package/dist/components/{nav-item → nav}/nav-item.d.ts +0 -0
  274. /package/dist/components/{nav-item → nav}/nav-item.js +0 -0
  275. /package/dist/components/{segmented-button-item/segmented-button-item.styles.d.ts → nav/nav-item.styles.d.ts} +0 -0
  276. /package/dist/components/{select-option-group/select-option-group.style.d.ts → segmented-button/segmented-button-item.styles.d.ts} +0 -0
  277. /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
  278. /package/dist/components/{select-option/select-option.styles.d.ts → select/select-option-group.style.d.ts} +0 -0
  279. /package/dist/components/{select-option → select}/select-option.controllers.d.ts +0 -0
  280. /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
  281. /package/dist/components/{select-option → select}/select-option.js +0 -0
  282. /package/dist/components/{stepper-item/stepper-item.styles.d.ts → select/select-option.styles.d.ts} +0 -0
  283. /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
  284. /package/dist/components/{tab-group/tab-group.styles.d.ts → stepper/stepper-item.styles.d.ts} +0 -0
  285. /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
  286. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
  287. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
  288. /package/dist/components/{tab → tabs}/tab.js +0 -0
  289. /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
  290. /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
  291. /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
  292. /package/dist/components/{toast-item → toast}/toast-item.component.js +0 -0
  293. /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
  294. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
  295. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
  296. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
  297. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -1,51 +1,58 @@
1
+ var f = (a) => {
2
+ throw TypeError(a);
3
+ };
4
+ var b = (a, n, t) => n.has(a) || f("Cannot " + t);
5
+ var c = (a, n, t) => (b(a, n, "read from private field"), t ? t.call(a) : n.get(a)), _ = (a, n, t) => n.has(a) ? f("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), $ = (a, n, t, r) => (b(a, n, "write to private field"), r ? r.call(a, t) : n.set(a, t), t);
1
6
  import "../icon/icon.js";
2
- import { FormBase as b } from "../../internal/components/formBase.js";
7
+ import { FormBase as g } from "../../internal/components/formBase.js";
3
8
  import "../../internal/components/hint/hint.js";
4
- import { hintSeverity as v } from "../../internal/helpers/hintSeverity.js";
5
- import { watch as y } from "../../internal/helpers/watch.js";
6
- import { Asterisk as f } from "../../internal/templates/asterisk.js";
7
- import _ from "../../styles/component.styles.js";
8
- import { html as h, nothing as u } from "lit";
9
- import { property as i, state as c, query as $, queryAssignedNodes as g } from "lit/decorators.js";
10
- import { ifDefined as n } from "lit/directives/if-defined.js";
11
- import { live as w } from "lit/directives/live.js";
12
- import { InputNumberController as E, InputPasswordController as C } from "./input.controllers.js";
13
- import A from "./input.styles.js";
14
- var S = Object.defineProperty, L = Object.getOwnPropertyDescriptor, e = (m, s, r, a) => {
15
- for (var o = a > 1 ? void 0 : a ? L(s, r) : s, l = m.length - 1, d; l >= 0; l--)
16
- (d = m[l]) && (o = (a ? d(s, r, o) : d(o)) || o);
17
- return a && o && S(s, r, o), o;
18
- };
19
- const p = class p extends b {
9
+ import { hintSeverity as w } from "../../internal/helpers/hintSeverity.js";
10
+ import { watch as E } from "../../internal/helpers/watch.js";
11
+ import { Asterisk as P } from "../../internal/templates/asterisk.js";
12
+ import { componentStyles as C } from "../../styles/component.styles.js";
13
+ import { LocalizeController as k } from "../../utilities/localize.js";
14
+ import { html as p, nothing as m } from "lit";
15
+ import { state as v, property as s, query as S, queryAssignedNodes as x } from "lit/decorators.js";
16
+ import { ifDefined as l } from "lit/directives/if-defined.js";
17
+ import { live as B } from "lit/directives/live.js";
18
+ import { InputNumberController as A, InputPasswordController as V } from "./input.controllers.js";
19
+ import I from "./input.styles.js";
20
+ var L = Object.defineProperty, D = Object.getOwnPropertyDescriptor, e = (a, n, t, r) => {
21
+ for (var o = r > 1 ? void 0 : r ? D(n, t) : n, h = a.length - 1, d; h >= 0; h--)
22
+ (d = a[h]) && (o = (r ? d(n, t, o) : d(o)) || o);
23
+ return r && o && L(n, t, o), o;
24
+ }, u;
25
+ const y = class y extends g {
20
26
  constructor() {
21
- super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._numberController = new E(this), this._passwordController = new C(this), this._handleInput = () => {
22
- this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
23
- }, this._resetValue = (s) => {
24
- var r;
25
- s.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
26
- }, this._handlePressStart = (s) => {
27
- this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(s);
27
+ super(...arguments);
28
+ _(this, u);
29
+ $(this, u, new k(this)), this._value = "", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new A(this), this._passwordController = new V(this), this._handleInput = () => {
30
+ this._value = this.$input?.value ?? "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
31
+ }, this._resetValue = (t) => {
32
+ t.stopPropagation(), this.value = this.getAttribute("value")?.trim() ?? "", this._value = this.value, this._internals.setFormValue(this.value), this.$input?.focus();
33
+ }, this._handlePressStart = (t) => {
34
+ this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(t);
28
35
  }, this._handlePressEnd = () => {
29
36
  this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
30
- }, this._renderNumberButton = (s) => h`
37
+ }, this._renderNumberButton = (t) => p`
31
38
  <button
32
39
  ?disabled=${this.disabled}
33
40
  @click=${(r) => {
34
- this._numberController.handleActionBtnClick(r, s);
41
+ this._numberController.handleActionBtnClick(r, t);
35
42
  }}
36
43
  @mousedown=${this._handlePressStart}
37
44
  @mouseup=${this._handlePressEnd}
38
45
  @mouseleave=${this._handlePressEnd}
39
- aria-label="${s === "inc" ? "Increment" : "Decrement"}"
46
+ aria-label="${t === "inc" ? "Increment" : "Decrement"}"
40
47
  class="number skf-icon-host"
41
48
  type="button"
42
49
  >
43
- <skf-icon name="${s === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
50
+ <skf-icon name="${t === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
44
51
  </button>
45
- `, this._renderPasswordButton = () => h`
52
+ `, this._renderPasswordButton = () => p`
46
53
  <button
47
54
  @click=${this._passwordController.toggleVisibility}
48
- aria-label=${n(this._passwordController._buttonAriaLabel)}
55
+ aria-label=${this._passwordController._type === "password" ? c(this, u).term("showPassword") : c(this, u).term("hidePassword")}
49
56
  class="password skf-icon-host"
50
57
  type="button"
51
58
  @mousedown="${this._handlePressStart}"
@@ -54,37 +61,43 @@ const p = class p extends b {
54
61
  >
55
62
  <skf-icon name=${this._passwordController._icon} size="sm"></skf-icon>
56
63
  </button>
57
- `, this._renderSearchButton = () => h`
64
+ `, this._renderSearchButton = () => p`
58
65
  <button
59
66
  @click=${this._resetValue}
60
67
  @mousedown=${this._handlePressStart}
61
68
  @mouseup=${this._handlePressEnd}
62
69
  @mouseleave=${this._handlePressEnd}
63
- aria-label=${n(this.buttonAriaLabelClear)}
70
+ aria-label=${c(this, u).term("clearEntry")}
64
71
  class="search skf-icon-host"
65
72
  type="button"
66
73
  >
67
74
  <skf-icon name="close" size="sm"></skf-icon>
68
75
  </button>
69
76
  `, this._onBlur = () => {
70
- this._buttonDown && this.$input.focus();
77
+ this._buttonDown && this.$input?.focus();
71
78
  };
72
79
  }
73
- set customInvalid(s) {
74
- this.customError = s ?? "";
80
+ set customInvalid(t) {
81
+ this.customError = t ?? "";
75
82
  }
76
83
  get customInvalid() {
77
84
  return this.customError;
78
85
  }
86
+ set value(t) {
87
+ this.$input && (this.$input.value = t, this._value = t, this._internals.setFormValue(t), this.validateInput());
88
+ }
89
+ get value() {
90
+ return this.$input?.value ?? "";
91
+ }
79
92
  firstUpdated() {
80
- this.$input.addEventListener("change", () => {
81
- this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
82
- }), this.addEventListener("invalid", (s) => {
83
- this._pristine = !1, this.invalid = !0, this.customErrorDisplay && s.preventDefault();
93
+ this.$input?.addEventListener("change", () => {
94
+ this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input?.value ?? ""), this.emitEvent("change"), this.validateInput();
95
+ }), this.addEventListener("invalid", (t) => {
96
+ this._pristine = !1, this.invalid = !0, this.customErrorDisplay && t.preventDefault();
84
97
  }), this.addEventListener("reset", this._resetValue), this.validateInput();
85
98
  }
86
- willUpdate(s) {
87
- if (s.has("invalid"))
99
+ willUpdate(t) {
100
+ if (t.has("invalid"))
88
101
  if (this.invalid) {
89
102
  this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
90
103
  const r = this._internals.validationMessage;
@@ -95,95 +108,94 @@ const p = class p extends b {
95
108
  valueChanged() {
96
109
  this._internals.setFormValue(this.value), this.validateInput();
97
110
  }
98
- attributeChangedCallback(s, r, a) {
99
- if (super.attributeChangedCallback(s, r, a), s === "value" && this._internals.setFormValue(a), s === "custom-invalid")
100
- if (typeof a == "string") {
101
- const l = this.withFallback(a);
102
- this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
111
+ attributeChangedCallback(t, r, o) {
112
+ if (super.attributeChangedCallback(t, r, o), t === "value" && this._internals.setFormValue(o), t === "custom-invalid")
113
+ if (typeof o == "string") {
114
+ const d = this.withFallback(o);
115
+ this._pristine = !1, this._internals.setValidity({ customError: !0 }, d), this.invalid = !0, this.hint = d, this.checkValidity();
103
116
  } else
104
117
  this._internals.setValidity({}), this.validateInput();
105
118
  }
106
119
  /** @internal */
107
120
  validateInput() {
108
- if (this._internals.validity.customError) return;
121
+ if (this._internals.validity.customError || !this.$input) return;
109
122
  const r = this.$input.validity;
110
123
  if (this.invalid = !1, r.valid)
111
124
  this._internals.setValidity({ customError: this._internals.validity.customError });
112
125
  else {
113
126
  this.invalid = !this._pristine && !r.valid;
114
- let a;
115
- for (a in r) {
116
- const o = `data-${a.toString()}`;
117
- if (r[a] && !this.hasAttribute(o) && this.debug && console.log(
118
- `Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
119
- ), r[a]) {
120
- this.validationError = a.toString();
121
- const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
127
+ let o;
128
+ for (o in r) {
129
+ const h = `data-${o.toString()}`;
130
+ if (r[o] && !this.hasAttribute(h) && this.debug && console.log(
131
+ `Add custom message on ${this.localName} using attribute: ${h.toUpperCase()}="Your custom message"`
132
+ ), r[o]) {
133
+ this.validationError = o.toString();
134
+ const d = this.hasAttribute(h) ? this.getAttribute(h) : this.$input.validationMessage;
122
135
  this._internals.setValidity(
123
136
  { [this.validationError]: !0, customError: this._internals.validity.customError },
124
- this.withFallback(l)
137
+ this.withFallback(d)
125
138
  ), this.invalid && this.customErrorDisplay && this.checkValidity();
126
139
  }
127
140
  }
128
141
  }
129
142
  }
130
143
  render() {
131
- var r, a, o, l;
132
- const s = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
133
- return h`
144
+ const t = (this._defaultSlot.length === 0 || !this._defaultSlot[0]?.textContent?.trim()) && !this.label;
145
+ return p`
134
146
  <div id="root">
135
147
  <label>
136
- <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${s} id="label">
148
+ <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
137
149
  <slot>${this.label}</slot>
138
- ${this.required ? f(this.requiredLabel) : null}
150
+ ${this.required ? P(c(this, u).term("required")) : m}
139
151
  </div>
140
152
  <div id="input">
141
- ${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : u}
153
+ ${this.type === "search" ? p`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : m}
142
154
  <div
143
- data-leading=${n(this.leading)}
144
- data-trailing=${n(this.trailing)}
155
+ data-leading=${l(this.leading)}
156
+ data-trailing=${l(this.trailing)}
145
157
  id="affix"
146
158
  >
147
159
  <input
148
160
  ?disabled=${this.disabled}
149
161
  ?readonly=${this.readonly}
150
162
  ?required=${this.required}
151
- .value=${w(this.value)}
163
+ .autocomplete=${this.autocomplete ?? "off"}
164
+ .value=${B(this.value)}
152
165
  @blur=${this._onBlur}
153
166
  @input=${this._handleInput}
154
- autocomplete=${this.autocomplete}
155
- aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : u)}
156
- aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : u)}
167
+ aria-describedby=${l(this.hint?.trim() ? "hint" : m)}
168
+ aria-errormessage=${l(this.hint?.trim() ? "hint" : m)}
157
169
  aria-invalid=${!!this.invalid}
158
- autocomplete="off"
159
170
  data-testid="field-input"
160
- inputmode=${n(this.inputMode)}
161
- max=${n(this.max)}
162
- maxlength=${n(this.maxLength)}
163
- min=${n(this.min)}
164
- minlength=${n(this.minLength)}
165
- name=${n(this.name)}
166
- pattern=${n(this.pattern)}
167
- placeholder=${n(this.placeholder)}
168
- type=${n(
171
+ inputmode=${l(this.inputMode)}
172
+ max=${l(this.max)}
173
+ maxlength=${l(this.maxLength)}
174
+ min=${l(this.min)}
175
+ minlength=${l(this.minLength)}
176
+ name=${l(this.name)}
177
+ pattern=${l(this.pattern)}
178
+ placeholder=${l(this.placeholder)}
179
+ type=${l(
169
180
  this.type === "password" ? this._passwordController._type : this.type
170
181
  )}
171
182
  />
172
183
  </div>
173
- ${this.type === "number" ? h`
184
+ ${this.type === "number" ? p`
174
185
  <div id="action">
175
186
  ${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
176
187
  </div>
177
- ` : u}
178
- ${this.type === "password" ? this._renderPasswordButton() : u}
179
- ${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() : u}
188
+ ` : m}
189
+ ${this.type === "password" ? this._renderPasswordButton() : m}
190
+ ${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() : m}
180
191
  </div>
181
192
  </label>
182
- ${this.hint && h`
193
+ ${this.hint && p`
183
194
  <skf-hint
195
+ ?disabled=${this.disabled}
184
196
  aria-live=${this.invalid ? "assertive" : "polite"}
185
197
  id="hint"
186
- severity=${n(v(this.severity, this.invalid))}
198
+ severity=${l(w(this.invalid, this.severity))}
187
199
  >${this.customInvalid ?? this.hint}
188
200
  </skf-hint>
189
201
  `}
@@ -191,104 +203,98 @@ const p = class p extends b {
191
203
  `;
192
204
  }
193
205
  };
194
- p.styles = [_, A];
195
- let t = p;
196
- e([
197
- i({ type: String })
198
- ], t.prototype, "autocomplete", 2);
199
- e([
200
- i({ attribute: "button-aria-label-clear" })
201
- ], t.prototype, "buttonAriaLabelClear", 2);
206
+ u = new WeakMap(), y.styles = [C, I];
207
+ let i = y;
202
208
  e([
203
- i({ attribute: "button-aria-label-hide" })
204
- ], t.prototype, "buttonAriaLabelHide", 2);
209
+ v()
210
+ ], i.prototype, "_value", 2);
205
211
  e([
206
- i({ attribute: "button-aria-label-show" })
207
- ], t.prototype, "buttonAriaLabelShow", 2);
212
+ s()
213
+ ], i.prototype, "autocomplete", 2);
208
214
  e([
209
- i({ attribute: "custom-invalid", reflect: !0 })
210
- ], t.prototype, "customInvalid", 1);
215
+ s({ attribute: "custom-invalid", reflect: !0 })
216
+ ], i.prototype, "customInvalid", 1);
211
217
  e([
212
- i({ type: Boolean })
213
- ], t.prototype, "debug", 2);
218
+ s({ type: Boolean })
219
+ ], i.prototype, "debug", 2);
214
220
  e([
215
- i({ type: Boolean, attribute: "hide-label" })
216
- ], t.prototype, "hideLabel", 2);
221
+ s({ type: Boolean, attribute: "hide-label" })
222
+ ], i.prototype, "hideLabel", 2);
217
223
  e([
218
- i()
219
- ], t.prototype, "hint", 2);
224
+ s()
225
+ ], i.prototype, "hint", 2);
220
226
  e([
221
- i({ type: String })
222
- ], t.prototype, "inputmode", 2);
227
+ s()
228
+ ], i.prototype, "inputmode", 2);
223
229
  e([
224
- i()
225
- ], t.prototype, "label", 2);
230
+ s()
231
+ ], i.prototype, "label", 2);
226
232
  e([
227
- i()
228
- ], t.prototype, "leading", 2);
233
+ s({ type: String })
234
+ ], i.prototype, "lang", 2);
229
235
  e([
230
- i()
231
- ], t.prototype, "max", 2);
236
+ s()
237
+ ], i.prototype, "leading", 2);
232
238
  e([
233
- i({ type: Number, attribute: "maxlength" })
234
- ], t.prototype, "maxLength", 2);
239
+ s()
240
+ ], i.prototype, "max", 2);
235
241
  e([
236
- i()
237
- ], t.prototype, "min", 2);
242
+ s({ type: Number, attribute: "maxlength" })
243
+ ], i.prototype, "maxLength", 2);
238
244
  e([
239
- i({ type: Number, attribute: "minlength" })
240
- ], t.prototype, "minLength", 2);
245
+ s()
246
+ ], i.prototype, "min", 2);
241
247
  e([
242
- i({ reflect: !0 })
243
- ], t.prototype, "name", 2);
248
+ s({ type: Number, attribute: "minlength" })
249
+ ], i.prototype, "minLength", 2);
244
250
  e([
245
- i()
246
- ], t.prototype, "pattern", 2);
251
+ s({ reflect: !0 })
252
+ ], i.prototype, "name", 2);
247
253
  e([
248
- i()
249
- ], t.prototype, "placeholder", 2);
254
+ s()
255
+ ], i.prototype, "pattern", 2);
250
256
  e([
251
- i({ type: Boolean })
252
- ], t.prototype, "readonly", 2);
257
+ s()
258
+ ], i.prototype, "placeholder", 2);
253
259
  e([
254
- i({ attribute: "required-label" })
255
- ], t.prototype, "requiredLabel", 2);
260
+ s({ type: Boolean })
261
+ ], i.prototype, "readonly", 2);
256
262
  e([
257
- i({ reflect: !0 })
258
- ], t.prototype, "severity", 2);
263
+ s({ reflect: !0 })
264
+ ], i.prototype, "severity", 2);
259
265
  e([
260
- i({ type: Boolean, attribute: "show-valid" })
261
- ], t.prototype, "showValid", 2);
266
+ s({ type: Boolean, attribute: "show-valid" })
267
+ ], i.prototype, "showValid", 2);
262
268
  e([
263
- i({ reflect: !0 })
264
- ], t.prototype, "size", 2);
269
+ s({ reflect: !0 })
270
+ ], i.prototype, "size", 2);
265
271
  e([
266
- i()
267
- ], t.prototype, "trailing", 2);
272
+ s()
273
+ ], i.prototype, "trailing", 2);
268
274
  e([
269
- i()
270
- ], t.prototype, "type", 2);
275
+ s()
276
+ ], i.prototype, "type", 2);
271
277
  e([
272
- i({ type: String, attribute: "validate-on" })
273
- ], t.prototype, "validateOn", 2);
278
+ s({ attribute: "validate-on" })
279
+ ], i.prototype, "validateOn", 2);
274
280
  e([
275
- i({ reflect: !0 })
276
- ], t.prototype, "value", 2);
281
+ s({})
282
+ ], i.prototype, "value", 1);
277
283
  e([
278
- c()
279
- ], t.prototype, "invalid", 2);
284
+ v()
285
+ ], i.prototype, "invalid", 2);
280
286
  e([
281
- c()
282
- ], t.prototype, "_buttonDown", 2);
287
+ v()
288
+ ], i.prototype, "_buttonDown", 2);
283
289
  e([
284
- $("input")
285
- ], t.prototype, "$input", 2);
290
+ S("input")
291
+ ], i.prototype, "$input", 2);
286
292
  e([
287
- g({ flatten: !0 })
288
- ], t.prototype, "_defaultSlot", 2);
293
+ x({ flatten: !0 })
294
+ ], i.prototype, "_defaultSlot", 2);
289
295
  e([
290
- y("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
291
- ], t.prototype, "valueChanged", 1);
296
+ E("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
297
+ ], i.prototype, "valueChanged", 1);
292
298
  export {
293
- t as SkfInput
299
+ i as SkfInput
294
300
  };
@@ -38,7 +38,6 @@ export declare class InputPasswordController implements ReactiveController {
38
38
  host?: ReactiveControllerHost & Partial<ControllerHostProps>;
39
39
  _inputElement?: HTMLInputElement;
40
40
  _icon: Extract<Icon, 'visibility' | 'visibilityOff'>;
41
- _buttonAriaLabel: string;
42
41
  _type: Extract<SkfInput['type'], 'password' | 'text'>;
43
42
  constructor(host: ReactiveControllerHost);
44
43
  hostUpdated(): void;
@@ -1,14 +1,13 @@
1
- class l {
1
+ class n {
2
2
  constructor(t) {
3
- this.handleActionBtnClick = (i, s) => {
4
- var h, n;
3
+ this.handleActionBtnClick = (s, i) => {
5
4
  const e = this._inputElement;
6
- !e || !this.host || (s === "inc" ? e.stepUp() : e.stepDown(), this.host.value = ((h = this._inputElement) == null ? void 0 : h.value) ?? "", (n = this.host._internals) == null || n.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
7
- }, this.handleActionBtnLongPressStart = (i) => {
8
- const s = i.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
5
+ !e || !this.host || (i === "inc" ? e.stepUp() : e.stepDown(), this.host.value = this._inputElement?.value ?? "", this.host._internals?.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
6
+ }, this.handleActionBtnLongPressStart = (s) => {
7
+ const i = s.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
9
8
  this._longPressId = setTimeout(() => {
10
9
  this._repeaterId = setInterval(() => {
11
- this.handleActionBtnClick(i, s);
10
+ this.handleActionBtnClick(s, i);
12
11
  }, 50);
13
12
  }, 400);
14
13
  }, this.handleActionBtnLongPressEnd = () => {
@@ -16,26 +15,22 @@ class l {
16
15
  }, (this.host = t).addController(this);
17
16
  }
18
17
  hostUpdated() {
19
- var t;
20
- this._inputElement = (t = this.host) == null ? void 0 : t.$input;
18
+ this._inputElement = this.host?.$input;
21
19
  }
22
20
  }
23
- class a {
21
+ class l {
24
22
  constructor(t) {
25
23
  this._icon = "visibility", this._type = "password", this.handleFieldLoaded = () => {
26
- var i;
27
- !this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
24
+ !this._inputElement || !this.host?._handleInput || (this.host.value = this._inputElement.value, this.host._handleInput());
28
25
  }, this.toggleVisibility = () => {
29
- var i;
30
- !this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "", this._icon = "visibility", this._type = "password") : (this._buttonAriaLabel = this.host.buttonAriaLabelHide ?? "", this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
31
- }, (this.host = t).addController(this), this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "";
26
+ !this._inputElement || !this.host?._handleInput || (this.host._handleInput(), this._type === "text" ? (this._icon = "visibility", this._type = "password") : (this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
27
+ }, (this.host = t).addController(this);
32
28
  }
33
29
  hostUpdated() {
34
- var t;
35
- this._inputElement = (t = this.host) == null ? void 0 : t.$input;
30
+ this._inputElement = this.host?.$input;
36
31
  }
37
32
  }
38
33
  export {
39
- l as InputNumberController,
40
- a as InputPasswordController
34
+ n as InputNumberController,
35
+ l as InputPasswordController
41
36
  };
@@ -1,59 +1,54 @@
1
- import type { SkfIcon } from '../icon/icon.component.js';
2
1
  import '../icon/icon.js';
3
2
  import { SkfElement } from '../../internal/components/skf-element.js';
3
+ import type { Icon } from '../../internal/types.js';
4
4
  import { type CSSResultGroup } from 'lit';
5
+ type Color = 'primary' | 'inverse';
5
6
  /**
6
- * The `<skf-link>` can be used as either a regular link or a link styled semantic button
7
+ * The `<skf-link>` can be used as either a regular link or a semantic button. The button variant is
8
+ * intended to be used for triggering javascript functions, not handling forms.
7
9
  *
8
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/folder/619626129069cd5f9510528f) for design principles
10
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
9
11
  *
10
- * @property {function} onClick - If provided, custom function triggered by click where the second return parameter enables custom routing.
12
+ * @event {CustomEvent} skf-link-click - Fired when the link is clicked
11
13
  *
12
14
  * @slot - The links' main content
13
15
  *
14
16
  * @tagname skf-link
15
17
  */
16
18
  export declare class SkfLink extends SkfElement {
19
+ #private;
17
20
  static styles: CSSResultGroup;
18
- static classMap: {};
19
- private _onClick?;
20
21
  /** Defines the semantic element to render */
21
- as: 'button' | 'a';
22
+ as: 'button' | 'link';
22
23
  /** Defines the text-color */
23
- color: 'primary' | 'inverse';
24
+ color: Color;
24
25
  /** If true, disables the link */
25
- disabled?: boolean;
26
+ disabled: boolean;
26
27
  /** If defined, downloads the url */
27
- download?: string;
28
+ download: boolean;
28
29
  /** If defined, loads url on click */
29
30
  href?: string;
30
- /**
31
- * If defined, renders an icon before or after the text
32
- * @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
33
- */
34
- icon?: SkfIcon['name'];
35
- /** Defines the position of the icon in relation to the text */
36
- iconPlacement: 'left' | 'right';
31
+ /** If defined, renders an icon before or after the text */
32
+ icon?: Icon;
33
+ /** If true, the icon is placed to the right in relation to the text */
34
+ iconRight: boolean;
37
35
  /** If defined, describes the relationship between a linked resource and the current document */
38
36
  rel?: string;
39
- /** If defined, used on conjunction with onClick property, second argument */
37
+ /** If defined, used on conjunction with onClick property. **Notice!** Only applicable to as=button. */
40
38
  route?: string;
41
39
  /** If true, fills the parents horizontal axis */
42
40
  stretch: boolean;
43
41
  /** If defined, specifies where to open the linked document */
44
42
  target?: '_blank' | '_parent' | '_self' | '_top';
45
- /** Defines the type of button */
46
- type: 'button' | 'submit' | 'reset';
47
- /** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
48
- set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
49
- get onClick(): ((event: Event, route?: string) => void) | undefined;
50
43
  connectedCallback(): void;
44
+ _handleAsChange(): void;
51
45
  /** @internal */
52
- private _assertValidOnClick;
46
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
53
47
  /** @internal */
54
48
  /** retargets click event to host */
55
- private _preprocessOnClick;
49
+ private _handleClick;
56
50
  /** @internal */
57
51
  private _renderIcon;
58
52
  render(): import("lit").TemplateResult;
59
53
  }
54
+ export {};