@skf-design-system/ui-components 1.0.2-beta.1 → 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 (220) hide show
  1. package/README.md +25 -1
  2. package/dist/components/accordion/accordion-item.component.js +49 -38
  3. package/dist/components/accordion/accordion.component.d.ts +2 -2
  4. package/dist/components/accordion/accordion.component.js +12 -12
  5. package/dist/components/alert/alert.component.d.ts +8 -3
  6. package/dist/components/alert/alert.component.js +59 -50
  7. package/dist/components/alert/alert.styles.js +51 -47
  8. package/dist/components/breadcrumb/breadcrumb-item.component.js +30 -32
  9. package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
  10. package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
  11. package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
  12. package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
  13. package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
  14. package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
  15. package/dist/components/button/button.component.js +63 -67
  16. package/dist/components/button/button.styles.js +5 -4
  17. package/dist/components/card/card.component.d.ts +5 -0
  18. package/dist/components/card/card.component.js +46 -24
  19. package/dist/components/card/card.styles.js +31 -14
  20. package/dist/components/checkbox/checkbox.component.d.ts +6 -5
  21. package/dist/components/checkbox/checkbox.component.js +67 -69
  22. package/dist/components/checkbox/checkbox.styles.js +1 -1
  23. package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +8 -1
  24. package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +109 -115
  25. package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
  26. package/dist/components/datepicker/datepicker-calendar.js +6 -0
  27. package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +9 -20
  28. package/dist/components/datepicker/datepicker-popup.component.js +272 -0
  29. package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
  30. package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
  31. package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
  32. package/dist/components/datepicker/datepicker-popup.js +6 -0
  33. package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
  34. package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +21 -14
  35. package/dist/components/datepicker/datepicker.component.js +455 -0
  36. package/dist/components/datepicker/datepicker.d.ts +8 -0
  37. package/dist/components/datepicker/datepicker.js +6 -0
  38. package/dist/components/dialog/dialog.component.d.ts +3 -2
  39. package/dist/components/dialog/dialog.component.js +49 -49
  40. package/dist/components/dialog/dialog.d.ts +2 -2
  41. package/dist/components/divider/divider.component.d.ts +3 -0
  42. package/dist/components/divider/divider.component.js +43 -22
  43. package/dist/components/divider/divider.styles.js +9 -9
  44. package/dist/components/drawer/drawer.component.d.ts +12 -4
  45. package/dist/components/drawer/drawer.component.js +84 -61
  46. package/dist/components/drawer/drawer.d.ts +2 -2
  47. package/dist/components/drawer/drawer.styles.js +47 -40
  48. package/dist/components/header/header.component.d.ts +4 -2
  49. package/dist/components/header/header.component.js +64 -57
  50. package/dist/components/header/header.d.ts +2 -2
  51. package/dist/components/header/header.styles.js +2 -2
  52. package/dist/components/heading/heading.component.d.ts +5 -1
  53. package/dist/components/heading/heading.component.js +54 -27
  54. package/dist/components/heading/heading.styles.js +34 -36
  55. package/dist/components/icon/icon.component.d.ts +4 -0
  56. package/dist/components/icon/icon.component.js +62 -43
  57. package/dist/components/icon/icon.styles.js +60 -60
  58. package/dist/components/input/input.component.d.ts +4 -8
  59. package/dist/components/input/input.component.js +90 -97
  60. package/dist/components/input/input.controllers.d.ts +0 -1
  61. package/dist/components/input/input.controllers.js +14 -19
  62. package/dist/components/link/link.component.d.ts +15 -18
  63. package/dist/components/link/link.component.js +104 -107
  64. package/dist/components/link/link.styles.js +53 -45
  65. package/dist/components/loader/loader.component.d.ts +5 -3
  66. package/dist/components/loader/loader.component.js +39 -28
  67. package/dist/components/loader/loader.styles.js +6 -10
  68. package/dist/components/logo/logo.component.d.ts +4 -1
  69. package/dist/components/logo/logo.component.js +55 -51
  70. package/dist/components/logo/logo.styles.js +26 -16
  71. package/dist/components/menu/menu-item.component.d.ts +1 -1
  72. package/dist/components/menu/menu-item.component.js +8 -8
  73. package/dist/components/menu/menu-item.d.ts +2 -2
  74. package/dist/components/menu/menu-item.styles.js +13 -9
  75. package/dist/components/menu/menu.component.d.ts +5 -2
  76. package/dist/components/menu/menu.component.js +8 -8
  77. package/dist/components/menu/menu.d.ts +2 -2
  78. package/dist/components/nav/nav-item.component.d.ts +6 -2
  79. package/dist/components/nav/nav-item.component.js +44 -25
  80. package/dist/components/nav/nav-item.styles.js +29 -25
  81. package/dist/components/nav/nav.component.d.ts +9 -0
  82. package/dist/components/nav/nav.component.js +47 -21
  83. package/dist/components/nav/nav.d.ts +2 -2
  84. package/dist/components/nav/nav.styles.js +15 -9
  85. package/dist/components/popover/popover.component.d.ts +10 -3
  86. package/dist/components/popover/popover.component.js +30 -22
  87. package/dist/components/popover/popover.d.ts +2 -2
  88. package/dist/components/progress/progress.component.d.ts +2 -0
  89. package/dist/components/progress/progress.component.js +38 -29
  90. package/dist/components/progress/progress.d.ts +2 -2
  91. package/dist/components/progress/progress.styles.js +10 -8
  92. package/dist/components/radio/radio.component.d.ts +4 -2
  93. package/dist/components/radio/radio.component.js +96 -91
  94. package/dist/components/radio/radio.styles.js +1 -1
  95. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  96. package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
  97. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  98. package/dist/components/segmented-button/segmented-button.component.js +22 -24
  99. package/dist/components/segmented-button/segmented-button.d.ts +2 -2
  100. package/dist/components/select/select-option-group.component.d.ts +4 -0
  101. package/dist/components/select/select-option-group.component.js +37 -18
  102. package/dist/components/select/select-option-group.d.ts +2 -2
  103. package/dist/components/select/select-option-group.style.js +12 -6
  104. package/dist/components/select/select-option.component.d.ts +9 -4
  105. package/dist/components/select/select-option.component.js +70 -58
  106. package/dist/components/select/select-option.styles.js +43 -31
  107. package/dist/components/select/select.component.d.ts +21 -12
  108. package/dist/components/select/select.component.js +125 -87
  109. package/dist/components/select/select.controllers.js +15 -20
  110. package/dist/components/select/select.styles.js +8 -2
  111. package/dist/components/stepper/stepper-item.component.d.ts +1 -1
  112. package/dist/components/stepper/stepper-item.component.js +59 -56
  113. package/dist/components/stepper/stepper-item.d.ts +2 -2
  114. package/dist/components/stepper/stepper-item.styles.js +4 -4
  115. package/dist/components/stepper/stepper.component.js +2 -3
  116. package/dist/components/stepper/stepper.d.ts +2 -2
  117. package/dist/components/stepper/stepper.helpers.js +6 -7
  118. package/dist/components/switch/switch.component.d.ts +4 -2
  119. package/dist/components/switch/switch.component.js +64 -58
  120. package/dist/components/switch/switch.d.ts +2 -2
  121. package/dist/components/switch/switch.styles.js +1 -1
  122. package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +1 -1
  123. package/dist/components/tabs/tab-panel.component.js +39 -0
  124. package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
  125. package/dist/components/{tab → tabs}/tab.component.d.ts +3 -3
  126. package/dist/components/{tab → tabs}/tab.component.js +17 -14
  127. package/dist/components/{tab → tabs}/tab.d.ts +2 -2
  128. package/dist/components/{tab → tabs}/tab.styles.js +2 -2
  129. package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
  130. package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
  131. package/dist/components/tabs/tabs.d.ts +8 -0
  132. package/dist/components/tabs/tabs.js +6 -0
  133. package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
  134. package/dist/components/tag/tag.component.d.ts +10 -2
  135. package/dist/components/tag/tag.component.js +77 -65
  136. package/dist/components/tag/tag.d.ts +2 -2
  137. package/dist/components/tag/tag.styles.js +63 -50
  138. package/dist/components/textarea/textarea.component.d.ts +4 -2
  139. package/dist/components/textarea/textarea.component.js +102 -95
  140. package/dist/components/toast/toast-item.styles.js +13 -10
  141. package/dist/components/toast/toast.component.js +9 -9
  142. package/dist/components/toast/toast.singleton.d.ts +1 -1
  143. package/dist/components/toast/toast.singleton.js +19 -20
  144. package/dist/components/tooltip/tooltip.component.d.ts +9 -2
  145. package/dist/components/tooltip/tooltip.component.js +15 -11
  146. package/dist/components/tooltip/tooltip.d.ts +2 -2
  147. package/dist/custom-elements.json +1681 -1112
  148. package/dist/index.d.ts +8 -7
  149. package/dist/index.js +96 -93
  150. package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
  151. package/dist/internal/base-classes/popover/popover.base.js +41 -44
  152. package/dist/internal/base-classes/popover/popover.styles.js +4 -5
  153. package/dist/internal/components/formBase.d.ts +1 -0
  154. package/dist/internal/components/formBase.js +11 -19
  155. package/dist/internal/components/hint/hint.component.d.ts +4 -0
  156. package/dist/internal/components/hint/hint.component.js +47 -20
  157. package/dist/internal/components/hint/hint.styles.js +29 -25
  158. package/dist/internal/components/skf-element.d.ts +1 -3
  159. package/dist/internal/components/skf-element.js +4 -9
  160. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  161. package/dist/internal/controllers/popover.controller.js +11 -14
  162. package/dist/internal/helpers/stateMap.d.ts +14 -0
  163. package/dist/internal/helpers/stateMap.js +68 -0
  164. package/dist/internal/helpers/uuid.d.ts +8 -10
  165. package/dist/internal/helpers/uuid.js +4 -11
  166. package/dist/internal/helpers/watch.d.ts +1 -1
  167. package/dist/internal/helpers/watch.js +12 -12
  168. package/dist/internal/templates/asterisk.d.ts +1 -1
  169. package/dist/internal/templates/asterisk.js +4 -4
  170. package/dist/internal/types.d.ts +4 -0
  171. package/dist/styles/component.styles.js +37 -36
  172. package/dist/styles/global-alt.css +1 -0
  173. package/dist/styles/global.css +1 -1
  174. package/dist/translations/en.d.ts +3 -0
  175. package/dist/translations/en.js +27 -0
  176. package/dist/translations/es.d.ts +3 -0
  177. package/dist/translations/es.js +27 -0
  178. package/dist/translations/index.d.ts +4 -0
  179. package/dist/translations/pt.d.ts +3 -0
  180. package/dist/translations/pt.js +27 -0
  181. package/dist/translations/sv.d.ts +3 -0
  182. package/dist/translations/sv.js +27 -0
  183. package/dist/types/jsx/custom-element-jsx.d.ts +1988 -866
  184. package/dist/types/vue/index.d.ts +220 -169
  185. package/dist/utilities/localize.d.ts +28 -0
  186. package/dist/utilities/localize.js +13 -0
  187. package/dist/vscode.html-custom-data.json +265 -188
  188. package/dist/web-types.json +731 -548
  189. package/package.json +38 -51
  190. package/dist/components/accordion/accordion-item.test.d.ts +0 -1
  191. package/dist/components/accordion/accordion.test.d.ts +0 -1
  192. package/dist/components/checkbox/checkbox.test.d.ts +0 -1
  193. package/dist/components/date-picker/datepicker.component.js +0 -261
  194. package/dist/components/date-picker/datepicker.d.ts +0 -10
  195. package/dist/components/date-picker/datepicker.helpers.js +0 -76
  196. package/dist/components/date-picker/datepicker.js +0 -8
  197. package/dist/components/date-picker-input/datepicker-input.component.js +0 -442
  198. package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
  199. package/dist/components/date-picker-input/datepicker-input.js +0 -6
  200. package/dist/components/input/input.test.d.ts +0 -1
  201. package/dist/components/radio/radio.test.d.ts +0 -1
  202. package/dist/components/switch/switch.test.d.ts +0 -1
  203. package/dist/components/tab-group/tab-group.d.ts +0 -8
  204. package/dist/components/tab-group/tab-group.js +0 -6
  205. package/dist/components/tab-panel/tab-panel.component.js +0 -36
  206. package/dist/internal/playwright/index.d.ts +0 -1
  207. /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
  208. /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
  209. /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
  210. /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
  211. /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
  212. /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
  213. /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
  214. /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
  215. /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
  216. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
  217. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
  218. /package/dist/components/{tab → tabs}/tab.js +0 -0
  219. /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
  220. /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
@@ -1,28 +1,38 @@
1
- import { computePosition as v, flip as f, shift as _, offset as g } from "@floating-ui/dom";
2
- import { FormBase as b } from "../../internal/components/formBase.js";
3
- import { PopoverController as y } from "../../internal/controllers/popover.controller.js";
4
- import { findMatchingTags as O } from "../../internal/helpers/findMatchingTags.js";
5
- import { hintSeverity as x } from "../../internal/helpers/hintSeverity.js";
6
- import { raiseError as w } from "../../internal/helpers/raiseError.js";
7
- import { watch as $ } from "../../internal/helpers/watch.js";
8
- import { Asterisk as V } from "../../internal/templates/asterisk.js";
9
- import { componentStyles as S } from "../../styles/component.styles.js";
10
- import { nothing as C, html as n } from "lit";
11
- import { property as o, state as h, query as p } from "lit/decorators.js";
12
- import { classMap as E } from "lit/directives/class-map.js";
13
- import { ifDefined as m } from "lit/directives/if-defined.js";
14
- import "../../internal/components/hint/hint.js";
15
- import "../tag/tag.js";
16
- import { GlobalClickController as L, KeyboardNavigationController as k, DeveloperFeedbackController as A } from "./select.controllers.js";
17
- import { styles as P } from "./select.styles.js";
18
- var T = Object.defineProperty, D = Object.getOwnPropertyDescriptor, s = (u, t, e, l) => {
19
- for (var r = l > 1 ? void 0 : l ? D(t, e) : t, a = u.length - 1, d; a >= 0; a--)
20
- (d = u[a]) && (r = (l ? d(t, e, r) : d(r)) || r);
21
- return l && r && T(t, e, r), r;
1
+ var _ = (o) => {
2
+ throw TypeError(o);
22
3
  };
23
- const c = class c extends b {
4
+ var v = (o, a, t) => a.has(o) || _("Cannot " + t);
5
+ var c = (o, a, t) => (v(o, a, "read from private field"), t ? t.call(o) : a.get(o)), g = (o, a, t) => a.has(o) ? _("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(o) : a.set(o, t), b = (o, a, t, e) => (v(o, a, "write to private field"), e ? e.call(o, t) : a.set(o, t), t);
6
+ import { SkfSelectOptionGroup as w } from "./select-option-group.component.js";
7
+ import "../tag/tag.js";
8
+ import { computePosition as C, flip as x, shift as V, offset as $ } from "@floating-ui/dom";
9
+ import { FormBase as L } from "../../internal/components/formBase.js";
10
+ import "../../internal/components/hint/hint.js";
11
+ import { PopoverController as E } from "../../internal/controllers/popover.controller.js";
12
+ import { findMatchingTags as k } from "../../internal/helpers/findMatchingTags.js";
13
+ import { hintSeverity as A } from "../../internal/helpers/hintSeverity.js";
14
+ import { raiseError as D } from "../../internal/helpers/raiseError.js";
15
+ import { watch as S } from "../../internal/helpers/watch.js";
16
+ import { Asterisk as I } from "../../internal/templates/asterisk.js";
17
+ import { componentStyles as P } from "../../styles/component.styles.js";
18
+ import { LocalizeController as T } from "../../utilities/localize.js";
19
+ import { nothing as y, html as p } from "lit";
20
+ import { property as r, state as u, query as m, queryAssignedElements as F } from "lit/decorators.js";
21
+ import { classMap as U } from "lit/directives/class-map.js";
22
+ import { ifDefined as O } from "lit/directives/if-defined.js";
23
+ import { SkfSelectOption as z } from "./select-option.component.js";
24
+ import { GlobalClickController as M, KeyboardNavigationController as B, DeveloperFeedbackController as q } from "./select.controllers.js";
25
+ import { styles as j } from "./select.styles.js";
26
+ var N = Object.defineProperty, R = Object.getOwnPropertyDescriptor, s = (o, a, t, e) => {
27
+ for (var l = e > 1 ? void 0 : e ? R(a, t) : a, n = o.length - 1, h; n >= 0; n--)
28
+ (h = o[n]) && (l = (e ? h(a, t, l) : h(l)) || l);
29
+ return e && l && N(a, t, l), l;
30
+ }, d;
31
+ const f = class f extends L {
24
32
  constructor() {
25
- super(), this.selectDelay = 200, this._optionsList = [], this.buttonLabel = "Select an option", this.hideLabel = !1, this.hideTags = !1, this.multiple = !1, this.showValid = !1, this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new L(this), this.keyboardNavController = new k(this), this.developerFeedbackController = new A(this), this.popoverController = new y(this), this._handleOptionSelected = (t) => {
33
+ super();
34
+ g(this, d);
35
+ b(this, d, new T(this)), this._componentIsConnected = !1, this._defaultButtonLabel = "Select an option", this.selectDelay = 200, this._optionsList = [], this.buttonLabel = this._defaultButtonLabel, this.hideLabel = !1, this.hideTags = !1, this.lang = "en", this.multiple = !1, this.showValid = !1, this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new M(this), this.keyboardNavController = new B(this), this.developerFeedbackController = new q(this), this.popoverController = new E(this), this._handleOptionSelected = (t) => {
26
36
  this._pristine = !1;
27
37
  const e = this._selectedOptions.length > 0;
28
38
  this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
@@ -33,9 +43,9 @@ const c = class c extends b {
33
43
  this.$popover.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
34
44
  }, 50);
35
45
  }, this.reposition = async () => {
36
- const { x: t, y: e } = await v(this.$anchor, this.$popover, {
46
+ const { x: t, y: e } = await C(this.$anchor, this.$popover, {
37
47
  placement: "bottom",
38
- middleware: [f(), _({ padding: 5 }), g(2)],
48
+ middleware: [x(), V(), $(2)],
39
49
  strategy: "fixed"
40
50
  });
41
51
  Object.assign(this.$popover.style, {
@@ -59,20 +69,34 @@ const c = class c extends b {
59
69
  default:
60
70
  throw new Error("Something went wrong");
61
71
  }
62
- this.emitEvent("change"), this._validateInput(), this.$selectedValue && (this.$selectedValue.animate([{ opacity: 0.5 }, { opacity: 1 }], this.selectDelay).onfinish = () => {
72
+ this._componentIsConnected && this.emitEvent("change"), this._validateInput(), this.$selectedValue && (this.$selectedValue.animate([{ opacity: 0.5 }, { opacity: 1 }], this.selectDelay).onfinish = () => {
63
73
  this.multiple || (this._expanded = !1), t("done");
64
74
  });
65
75
  }), this._resetSelectedOptions = (t) => {
66
76
  const e = !t;
67
77
  this._optionsList.forEach((l) => {
68
78
  (e || l !== t) && l.removeAttribute("selected");
69
- });
79
+ }), this._optionsList = [];
70
80
  }, this._handleSlotChange = () => {
71
- this._collectSlotOptionTags(), this._validateInput();
72
- }, this._computeVisibleValue = () => {
73
- var t, e;
74
- return (t = this.$selectedValue) == null || t.classList.add("contains-meta-info"), this._selectedOptions.length > 1 ? `(${String(this._selectedOptions.length)} items selected)` : this.value ? ((e = this.$selectedValue) == null || e.classList.remove("contains-meta-info"), this.value) : this.buttonLabel;
75
- }, this._selectedOptions = [];
81
+ this._handleSizeUpdate(), this._collectSlotOptionTags(), this._ifValueIsSetSelectOption(), this._validateInput(), this._componentIsConnected = !0, this.emitEvent("skf-select-connected");
82
+ }, this._ifValueIsSetSelectOption = () => {
83
+ if (this.value)
84
+ if (this.multiple) {
85
+ const t = String(this.value).split(",").map((e) => e.toLowerCase().trim());
86
+ this._optionsList.forEach((e) => {
87
+ t.includes(e.value.toLowerCase().trim()) ? (e.setSelectedDiscrete = !0, this.selectedOptions = [...this.selectedOptions, e]) : (e.setSelectedDiscrete = !1, this._selectedOptions = this._selectedOptions.filter(
88
+ (l) => l.value.toLowerCase().trim() !== e.value.toLowerCase().trim()
89
+ ));
90
+ }), this._setValue().catch((e) => {
91
+ console.error(e);
92
+ });
93
+ } else {
94
+ const t = this.value.toLowerCase().trim(), e = this._optionsList.find((l) => l.value.toLowerCase().trim() === t);
95
+ e && (e.setSelectedDiscrete = !0, this.selectedOptions = [e], this._setValue().catch((l) => {
96
+ console.error(l);
97
+ }));
98
+ }
99
+ }, this._computeVisibleValue = () => this.buttonLabel !== this._defaultButtonLabel ? this.buttonLabel : (this.$selectedValue?.classList.add("contains-meta-info"), this._selectedOptions.length > 1 ? `(${c(this, d).term("itemsSelected", this._selectedOptions.length)})` : this.value ? (this.$selectedValue?.classList.remove("contains-meta-info"), this._selectedOptions[0].textContent) : (this.$selectedValue?.classList.add("contains-meta-info"), this.buttonLabel)), this._selectedOptions = [];
76
100
  }
77
101
  set selectedValues(t) {
78
102
  this._selectedOptions = this._optionsList.filter((e) => t.includes(e.value.trim()));
@@ -89,8 +113,12 @@ const c = class c extends b {
89
113
  return this._selectedOptions.map((t) => t.textContent ?? "");
90
114
  }
91
115
  set value(t) {
92
- const e = t.split(",").map((l) => l.trim());
93
- this._selectedOptions = this._optionsList.filter((l) => e.includes(l.value.trim()));
116
+ let e = [];
117
+ this._componentIsConnected && (this.multiple ? e = String(t).split(",").map((n) => n.toLowerCase().trim()) : e = [String(t).toLowerCase().trim()], this._selectedOptions = this._optionsList.filter(
118
+ (n) => e.includes(n.value.toLowerCase().trim())
119
+ ), this._optionsList.forEach((n) => {
120
+ n.selected && (n.setSelectedDiscrete = !1);
121
+ }), this._selectedOptions.forEach((n) => n.setSelectedDiscrete = !0)), this._setValue();
94
122
  }
95
123
  get value() {
96
124
  return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
@@ -120,8 +148,12 @@ const c = class c extends b {
120
148
  this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
121
149
  }
122
150
  firstUpdated() {
123
- var t;
124
- this.addEventListener("skf-select-option-select", this._handleOptionSelected), (t = this._internals.form) == null || t.addEventListener("reset", this._handleReset), this.onUpdateComplete(), this._validateInput();
151
+ this.addEventListener("skf-select-option-select", this._handleOptionSelected), this._internals.form?.addEventListener("reset", this._handleReset), this.onUpdateComplete(), this._validateInput();
152
+ }
153
+ _handleSizeUpdate() {
154
+ this._slottedItems.forEach((t) => {
155
+ (t instanceof z || t instanceof w) && (t.small = this.size === "sm");
156
+ });
125
157
  }
126
158
  handleExpandedChange() {
127
159
  this._expanded ? (this.$popover.togglePopover(this._expanded), this.popoverController.start()) : (this.$popover.togglePopover(this._expanded), this.popoverController.stop().catch((t) => {
@@ -131,14 +163,13 @@ const c = class c extends b {
131
163
  attributeChangedCallback(t, e, l) {
132
164
  if (super.attributeChangedCallback(t, e, l), t === "custom-invalid")
133
165
  if (typeof l == "string") {
134
- const a = this.withFallback(l);
135
- this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, a), this.checkValidity();
166
+ const h = this.withFallback(l);
167
+ this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, h), this.checkValidity();
136
168
  } else
137
169
  this.setValidity({}), this._validateInput();
138
170
  }
139
171
  disconnectedCallback() {
140
- var t;
141
- super.disconnectedCallback(), (t = this._internals.form) == null || t.removeEventListener("reset", this._handleReset);
172
+ super.disconnectedCallback(), this._internals.form?.removeEventListener("reset", this._handleReset);
142
173
  }
143
174
  /** @internal */
144
175
  _updateState(t) {
@@ -159,7 +190,7 @@ const c = class c extends b {
159
190
  /** @internal */
160
191
  /** Filter out elements other than skf-select-option and store in this._optionsList */
161
192
  _collectSlotOptionTags() {
162
- this._optionsList = O(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), w({
193
+ this._optionsList = k(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), D({
163
194
  assert: this._optionsList.length > 0,
164
195
  reason: "no-children",
165
196
  replaceStrings: [this.localName, "skf-select-option"]
@@ -173,51 +204,51 @@ const c = class c extends b {
173
204
  this._invalid = !0;
174
205
  return;
175
206
  } else if (t) {
176
- const a = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
177
- this.setValidity({ valueMissing: !0 }, String(a)), this._pristine || (this._invalid = !0);
207
+ const h = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
208
+ this.setValidity({ valueMissing: !0 }, String(h)), this._pristine || (this._invalid = !0);
178
209
  } else if (e) {
179
- const a = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
180
- this.setValidity({ rangeUnderflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
210
+ const h = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
211
+ this.setValidity({ rangeUnderflow: !0 }, String(h)), this._pristine || (this._invalid = !0);
181
212
  } else if (l) {
182
- const a = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
183
- this.setValidity({ rangeOverflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
213
+ const h = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
214
+ this.setValidity({ rangeOverflow: !0 }, String(h)), this._pristine || (this._invalid = !0);
184
215
  } else
185
216
  this.setValidity({}), !this._pristine && this.showValid && this.setAttribute("valid", "true");
186
217
  }
187
218
  render() {
188
- return n`
219
+ return p`
189
220
  <div id="root">
190
221
  <label>
191
222
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
192
223
  ${this.label}
193
- ${this.required ? V(this.requiredLabel) : null}
224
+ ${this.required ? I(c(this, d).term("required")) : y}
194
225
  </div>
195
226
  <button
196
227
  ?disabled=${this.disabled}
197
228
  @click=${this._handleDropdownToggle}
198
229
  aria-controls="select-dropdown"
199
230
  aria-expanded=${this._expanded}
200
- aria-invalid=${this._invalid}
201
231
  aria-haspopup="listbox"
202
- class="skf-icon-host"
232
+ aria-invalid=${this._invalid}
233
+ aria-labelledby="label"
203
234
  id="select-button"
204
235
  role="combobox"
205
236
  >
206
237
  <span
207
238
  id="selected-value"
208
- class=${E({ "selected-value": !0, "contains-meta-info": !this.value })}>
239
+ class=${U({ "selected-value": !0, "contains-meta-info": !this.value })}>
209
240
  ${this._computeVisibleValue()}
210
241
  </span>
211
- <skf-icon class="arrow" name="chevronDown"></skf-icon>
242
+ <skf-icon class="arrow" data-color="custom" name="chevronDown"></skf-icon>
212
243
  </button>
213
244
  </label>
214
- <div aria-multiselectable=${m(this.multiple && !0)} id="select-dropdown" popover role="listbox">
245
+ <div aria-labelledby="select-button" aria-multiselectable=${O(this.multiple && !0)} id="select-dropdown" popover role="listbox">
215
246
  <slot @slotchange=${this._handleSlotChange}></slot>
216
247
  </div>
217
- ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? n`
248
+ ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? p`
218
249
  <div id="tags">
219
250
  ${this.selectedOptions.map(
220
- (t) => n`
251
+ (t) => p`
221
252
  <skf-tag
222
253
  style="${`view-transition-name: tag-${String(t.textContent).replace(/[^a-zA-Z]/g, "").toLowerCase()}`}"
223
254
  removable
@@ -230,12 +261,13 @@ const c = class c extends b {
230
261
  `
231
262
  )}
232
263
  </div>
233
- ` : C}
234
- ${this.hint && n`
264
+ ` : y}
265
+ ${this.hint && p`
235
266
  <skf-hint
267
+ ?disabled=${this.disabled}
236
268
  aria-live=${this._invalid ? "assertive" : "polite"}
237
269
  id="hint"
238
- severity=${m(x(this._invalid, this.severity))}
270
+ severity=${O(A(this._invalid, this.severity))}
239
271
  >
240
272
  ${this.customInvalid ?? this.hint}
241
273
  </skf-hint>
@@ -245,79 +277,85 @@ const c = class c extends b {
245
277
  `;
246
278
  }
247
279
  };
248
- c.styles = [S, P];
249
- let i = c;
280
+ d = new WeakMap(), f.styles = [P, j];
281
+ let i = f;
250
282
  s([
251
- o({ type: String, reflect: !0, attribute: "button-label" })
283
+ r({ type: String, reflect: !0, attribute: "button-label" })
252
284
  ], i.prototype, "buttonLabel", 2);
253
285
  s([
254
- o({ attribute: "custom-invalid" })
286
+ r({ type: String, attribute: "custom-invalid" })
255
287
  ], i.prototype, "customInvalid", 2);
256
288
  s([
257
- o({ type: Boolean, attribute: "hide-label" })
289
+ r({ type: Boolean, attribute: "hide-label" })
258
290
  ], i.prototype, "hideLabel", 2);
259
291
  s([
260
- o({ type: Boolean, reflect: !0, attribute: "hide-tags" })
292
+ r({ type: Boolean, reflect: !0, attribute: "hide-tags" })
261
293
  ], i.prototype, "hideTags", 2);
262
294
  s([
263
- o()
295
+ r({ type: String })
264
296
  ], i.prototype, "hint", 2);
265
297
  s([
266
- o({ type: Array, attribute: !1 })
298
+ r({ type: Array, attribute: !1 })
267
299
  ], i.prototype, "selectedValues", 1);
268
300
  s([
269
- o({ type: Array, attribute: !1 })
301
+ r({ type: Array, attribute: !1 })
270
302
  ], i.prototype, "selectedOptionsText", 1);
271
303
  s([
272
- o({ reflect: !0 })
304
+ r({ type: String, reflect: !0 })
273
305
  ], i.prototype, "label", 2);
274
306
  s([
275
- o({ type: Number })
307
+ r({ type: String })
308
+ ], i.prototype, "lang", 2);
309
+ s([
310
+ r({ type: Number })
276
311
  ], i.prototype, "max", 2);
277
312
  s([
278
- o({ type: Number })
313
+ r({ type: Number })
279
314
  ], i.prototype, "min", 2);
280
315
  s([
281
- o({ type: Boolean, reflect: !0 })
316
+ r({ type: Boolean, reflect: !0 })
282
317
  ], i.prototype, "multiple", 2);
283
318
  s([
284
- o()
319
+ r({ type: String })
285
320
  ], i.prototype, "name", 2);
286
321
  s([
287
- o({ attribute: "required-label" })
288
- ], i.prototype, "requiredLabel", 2);
289
- s([
290
- o()
322
+ r()
291
323
  ], i.prototype, "severity", 2);
292
324
  s([
293
- o({ type: Boolean, attribute: "show-valid" })
325
+ r({ type: Boolean, attribute: "show-valid" })
294
326
  ], i.prototype, "showValid", 2);
295
327
  s([
296
- o({ reflect: !0 })
328
+ r({ reflect: !0 })
297
329
  ], i.prototype, "size", 2);
298
330
  s([
299
- h()
331
+ r({ type: String, attribute: !1 })
300
332
  ], i.prototype, "value", 1);
301
333
  s([
302
- h()
334
+ u()
303
335
  ], i.prototype, "selectedOptions", 1);
304
336
  s([
305
- h()
337
+ u()
306
338
  ], i.prototype, "_expanded", 2);
307
339
  s([
308
- h()
340
+ u()
309
341
  ], i.prototype, "_invalid", 2);
310
342
  s([
311
- p("#select-button")
343
+ m("#select-button")
312
344
  ], i.prototype, "$anchor", 2);
313
345
  s([
314
- p("#selected-value")
346
+ m("#selected-value")
315
347
  ], i.prototype, "$selectedValue", 2);
316
348
  s([
317
- p("#select-dropdown")
349
+ m("#select-dropdown")
318
350
  ], i.prototype, "$popover", 2);
319
351
  s([
320
- $("_expanded", { afterUpdate: !0 })
352
+ F()
353
+ ], i.prototype, "_slottedItems", 2);
354
+ s([
355
+ S("size", { waitUntilFirstUpdate: !0 })
356
+ ], i.prototype, "_handleSizeUpdate", 1);
357
+ s([
358
+ S("_expanded", { afterUpdate: !0 })
321
359
  ], i.prototype, "handleExpandedChange", 1);
322
360
  export {
323
361
  i as SkfSelect
@@ -1,9 +1,8 @@
1
- import { raiseError as a } from "../../internal/helpers/raiseError.js";
1
+ import { raiseError as l } from "../../internal/helpers/raiseError.js";
2
2
  class d {
3
3
  constructor(t) {
4
4
  this._globalClickHandler = (e) => {
5
- var i;
6
- !((i = this.host) != null && i.localName) || e.target.closest(this.host.localName) || (this.host._expanded = !1);
5
+ !this.host?.localName || e.target.closest(this.host.localName) || (this.host._expanded = !1);
7
6
  }, (this.host = t).addController(this);
8
7
  }
9
8
  // hostConnected() {
@@ -13,8 +12,7 @@ class d {
13
12
  this.disableGlobalClickDetection();
14
13
  }
15
14
  hostUpdated() {
16
- var t;
17
- (t = this.host) != null && t._expanded ? this.enableGlobalClickDetection() : this.disableGlobalClickDetection();
15
+ this.host?._expanded ? this.enableGlobalClickDetection() : this.disableGlobalClickDetection();
18
16
  }
19
17
  enableGlobalClickDetection() {
20
18
  document.addEventListener("click", this._globalClickHandler);
@@ -48,8 +46,7 @@ class p {
48
46
  this.removeKeyboardListener();
49
47
  }
50
48
  hostUpdated() {
51
- var t, e;
52
- (t = this.host) != null && t._expanded && !this._listenerActivated && this.setupKeyboardListener(), !((e = this.host) != null && e._expanded) && this._listenerActivated && this.removeKeyboardListener();
49
+ this.host?._expanded && !this._listenerActivated && this.setupKeyboardListener(), !this.host?._expanded && this._listenerActivated && this.removeKeyboardListener();
53
50
  }
54
51
  setupKeyboardListener() {
55
52
  this._listenerActivated = !0, this.host.addEventListener("keydown", this._handleKeyDown);
@@ -64,15 +61,15 @@ class p {
64
61
  });
65
62
  }
66
63
  _focusSiblingOption(t) {
67
- const e = (l) => l === document.activeElement, s = this._selectableOptions.find((l) => e(l));
64
+ const e = (n) => n === document.activeElement, s = this._selectableOptions.find((n) => e(n));
68
65
  if (!s) {
69
66
  this._focusFirstOption();
70
67
  return;
71
68
  }
72
- const i = this._selectableOptions.indexOf(s);
73
- let o = i - 1, n = i + 1;
74
- o < 0 && (o = this._selectableOptions.length - 1), n >= this._selectableOptions.length && (n = 0);
75
- const h = this._selectableOptions[t === "next" ? n : o];
69
+ const r = this._selectableOptions.indexOf(s);
70
+ let i = r - 1, o = r + 1;
71
+ i < 0 && (i = this._selectableOptions.length - 1), o >= this._selectableOptions.length && (o = 0);
72
+ const h = this._selectableOptions[t === "next" ? o : i];
76
73
  s.blur(), h.focus();
77
74
  }
78
75
  _selectFocusedOption(t) {
@@ -82,7 +79,7 @@ class p {
82
79
  return !this.host || !this.host._optionsList ? [] : this.host._optionsList.filter((t) => !t.disabled);
83
80
  }
84
81
  }
85
- class u {
82
+ class b {
86
83
  constructor(t) {
87
84
  (this.host = t).addController(this);
88
85
  }
@@ -92,29 +89,27 @@ class u {
92
89
  _badAttributeCombinationWarning() {
93
90
  if (!this.host) return;
94
91
  const t = this.host.localName ?? "never";
95
- a({
92
+ l({
96
93
  assert: (this.host.min ?? 0) <= (this.host.max ?? 1 / 0),
97
94
  reason: "attribute-mismatch",
98
95
  replaceStrings: [t, "min", "smaller than max"]
99
- }), a({
96
+ }), l({
100
97
  assert: (
101
98
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
102
99
  (this.host.min || this.host.max) && this.host.multiple || !(this.host.min && this.host.max)
103
100
  ),
104
101
  reason: "attribute-mismatch",
105
102
  replaceStrings: [t, "min or max", "together with multiple"]
106
- });
107
- const e = this.host.hideTags && this.host.multiple, s = !this.host.hideTags;
108
- a({
103
+ }), l({
109
104
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
110
- assert: e || s,
105
+ assert: this.host.hideTags && this.host.multiple || !this.host.hideTags,
111
106
  reason: "attribute-mismatch",
112
107
  replaceStrings: [t, "hide-tags", "together with multiple"]
113
108
  });
114
109
  }
115
110
  }
116
111
  export {
117
- u as DeveloperFeedbackController,
112
+ b as DeveloperFeedbackController,
118
113
  d as GlobalClickController,
119
114
  p as KeyboardNavigationController
120
115
  };
@@ -1,8 +1,8 @@
1
1
  import { visuallyHidden as r } from "../../styles/util.styles.js";
2
- import { css as o } from "lit";
2
+ import { css as e } from "lit";
3
3
  const t = [
4
4
  r,
5
- o`
5
+ e`
6
6
  @layer components {
7
7
  :host {
8
8
  contain: initial;
@@ -53,6 +53,12 @@ const t = [
53
53
  justify-content: space-between;
54
54
  padding-inline: var(--skf-spacing-75);
55
55
 
56
+ span {
57
+ overflow: hidden;
58
+ text-overflow: ellipsis;
59
+ white-space: nowrap;
60
+ }
61
+
56
62
  &:hover {
57
63
  --_skf-select-button-bg-color: var(--skf-interactive-bg-color-secondary-hover);
58
64
  }
@@ -35,7 +35,7 @@ export declare class SkfStepperItem extends SkfElement {
35
35
  /** @internal */
36
36
  set _setInternalState(state: typeof this._uiState);
37
37
  get _setInternalState(): typeof this._uiState;
38
- constructor();
38
+ connectedCallback(): void;
39
39
  protected firstUpdated(): void;
40
40
  /** @internal */
41
41
  _handleState(): void;