@skf-design-system/ui-components 1.0.2-beta.6 → 1.0.2-beta.7

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 (88) hide show
  1. package/README.md +18 -0
  2. package/dist/components/alert/alert.component.d.ts +3 -2
  3. package/dist/components/alert/alert.component.js +39 -33
  4. package/dist/components/button/button.styles.js +3 -3
  5. package/dist/components/checkbox/checkbox.component.d.ts +4 -2
  6. package/dist/components/checkbox/checkbox.component.js +73 -65
  7. package/dist/components/checkbox/checkbox.styles.js +1 -1
  8. package/dist/components/datepicker/datepicker-calendar.component.d.ts +4 -0
  9. package/dist/components/datepicker/datepicker-calendar.component.js +134 -127
  10. package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
  11. package/dist/components/datepicker/datepicker-popup.component.js +100 -88
  12. package/dist/components/datepicker/datepicker.component.d.ts +4 -2
  13. package/dist/components/datepicker/datepicker.component.js +150 -140
  14. package/dist/components/dialog/dialog.component.d.ts +3 -2
  15. package/dist/components/dialog/dialog.component.js +39 -37
  16. package/dist/components/divider/divider.component.js +13 -13
  17. package/dist/components/divider/divider.styles.js +2 -2
  18. package/dist/components/drawer/drawer.component.d.ts +3 -2
  19. package/dist/components/drawer/drawer.component.js +37 -35
  20. package/dist/components/drawer/drawer.styles.js +1 -1
  21. package/dist/components/header/header.component.d.ts +4 -2
  22. package/dist/components/header/header.component.js +66 -57
  23. package/dist/components/header/header.styles.js +2 -2
  24. package/dist/components/icon/icon.component.js +7 -7
  25. package/dist/components/icon/icon.styles.js +2 -2
  26. package/dist/components/input/input.component.d.ts +4 -8
  27. package/dist/components/input/input.component.js +146 -147
  28. package/dist/components/input/input.controllers.d.ts +0 -1
  29. package/dist/components/input/input.controllers.js +12 -12
  30. package/dist/components/link/link.component.js +19 -12
  31. package/dist/components/link/link.styles.js +11 -3
  32. package/dist/components/loader/loader.component.d.ts +0 -2
  33. package/dist/components/loader/loader.component.js +27 -30
  34. package/dist/components/loader/loader.styles.js +1 -1
  35. package/dist/components/menu/menu-item.styles.js +8 -7
  36. package/dist/components/menu/menu.component.d.ts +4 -1
  37. package/dist/components/nav/nav.component.d.ts +3 -0
  38. package/dist/components/nav/nav.component.js +38 -33
  39. package/dist/components/popover/popover.component.d.ts +6 -3
  40. package/dist/components/progress/progress.styles.js +3 -3
  41. package/dist/components/radio/radio.component.d.ts +4 -2
  42. package/dist/components/radio/radio.component.js +91 -83
  43. package/dist/components/radio/radio.styles.js +1 -1
  44. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  45. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  46. package/dist/components/select/select-option.component.d.ts +2 -2
  47. package/dist/components/select/select-option.component.js +16 -19
  48. package/dist/components/select/select.component.d.ts +13 -9
  49. package/dist/components/select/select.component.js +169 -144
  50. package/dist/components/stepper/stepper-item.styles.js +4 -4
  51. package/dist/components/switch/switch.component.d.ts +4 -2
  52. package/dist/components/switch/switch.component.js +64 -56
  53. package/dist/components/switch/switch.styles.js +1 -1
  54. package/dist/components/tabs/tab.styles.js +2 -2
  55. package/dist/components/tag/tag.component.d.ts +3 -0
  56. package/dist/components/tag/tag.component.js +50 -41
  57. package/dist/components/textarea/textarea.component.d.ts +4 -2
  58. package/dist/components/textarea/textarea.component.js +126 -118
  59. package/dist/components/tooltip/tooltip.component.d.ts +8 -2
  60. package/dist/components/tooltip/tooltip.component.js +3 -0
  61. package/dist/custom-elements.json +569 -309
  62. package/dist/internal/base-classes/popover/popover.base.d.ts +21 -2
  63. package/dist/internal/base-classes/popover/popover.base.js +10 -12
  64. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  65. package/dist/internal/helpers/uuid.d.ts +8 -10
  66. package/dist/internal/helpers/uuid.js +4 -11
  67. package/dist/internal/helpers/watch.d.ts +1 -1
  68. package/dist/internal/templates/asterisk.d.ts +1 -1
  69. package/dist/internal/templates/asterisk.js +4 -4
  70. package/dist/styles/global-alt.css +1 -1
  71. package/dist/styles/global.css +1 -1
  72. package/dist/translations/en.d.ts +3 -0
  73. package/dist/translations/en.js +27 -0
  74. package/dist/translations/es.d.ts +3 -0
  75. package/dist/translations/es.js +27 -0
  76. package/dist/translations/index.d.ts +4 -0
  77. package/dist/translations/pt.d.ts +3 -0
  78. package/dist/translations/pt.js +27 -0
  79. package/dist/translations/sv.d.ts +3 -0
  80. package/dist/translations/sv.js +27 -0
  81. package/dist/types/jsx/custom-element-jsx.d.ts +59 -47
  82. package/dist/types/vue/index.d.ts +59 -47
  83. package/dist/utilities/localize.d.ts +28 -0
  84. package/dist/utilities/localize.js +13 -0
  85. package/dist/vscode.html-custom-data.json +75 -80
  86. package/dist/web-types.json +201 -166
  87. package/package.json +26 -33
  88. package/custom-elements.json +0 -25490
@@ -9,20 +9,20 @@ import { stateMap as g } from "../../internal/helpers/stateMap.js";
9
9
  import { watch as x } from "../../internal/helpers/watch.js";
10
10
  import { componentStyles as N } from "../../styles/component.styles.js";
11
11
  import { LitElement as T, html as _ } from "lit";
12
- import { property as n, state as $, queryAssignedNodes as k } from "lit/decorators.js";
12
+ import { property as a, state as $, queryAssignedNodes as O } from "lit/decorators.js";
13
13
  import { ifDefined as v } from "lit/directives/if-defined.js";
14
- import { styles as O } from "./select-option.styles.js";
15
- var E = Object.defineProperty, w = Object.getOwnPropertyDescriptor, l = (e, s, t, i) => {
14
+ import { styles as E } from "./select-option.styles.js";
15
+ var k = Object.defineProperty, w = Object.getOwnPropertyDescriptor, l = (e, s, t, i) => {
16
16
  for (var r = i > 1 ? void 0 : i ? w(s, t) : s, d = e.length - 1, p; d >= 0; d--)
17
17
  (p = e[d]) && (r = (i ? p(s, t, r) : p(r)) || r);
18
- return i && r && E(s, t, r), r;
19
- }, a, h;
18
+ return i && r && k(s, t, r), r;
19
+ }, n, h;
20
20
  const c = class c extends C {
21
21
  constructor() {
22
22
  super();
23
- f(this, a);
23
+ f(this, n);
24
24
  f(this, h);
25
- m(this, a, this.attachInternals()), m(this, h, u(this, a).states), this._parent = null, this._shortcutUpdate = !1, this.disabled = !1, this.selected = !1, this.small = !1, this._handleClick = (t) => {
25
+ m(this, n, this.attachInternals()), m(this, h, u(this, n).states), this._parent = null, this._shortcutUpdate = !1, this.disabled = !1, this.selected = !1, this.small = !1, this._handleClick = (t) => {
26
26
  t.stopPropagation(), this.selected = !this.selected;
27
27
  }, this._shortcutUpdate = !1;
28
28
  }
@@ -40,9 +40,6 @@ const c = class c extends C {
40
40
  var t;
41
41
  return !this._value && this._slotContainsOnlyText ? this._getSlottedContent().trim() : ((t = this._value) == null ? void 0 : t.trim()) ?? this.text;
42
42
  }
43
- connectedCallback() {
44
- super.connectedCallback(), this.role = "option";
45
- }
46
43
  updated(t) {
47
44
  super.updated(t), this._parent ?? (this._parent = this.closest("skf-select")), this._parent || console.warn("skf-select-option must be used inside a skf-select or skf-select-option-group"), t.has("selected") && !this._shortcutUpdate && this.emit("skf-select-option-select", {
48
45
  detail: {
@@ -106,34 +103,34 @@ const c = class c extends C {
106
103
  `;
107
104
  }
108
105
  };
109
- a = new WeakMap(), h = new WeakMap(), c.styles = [N, O], c.shadowRootOptions = { ...T.shadowRootOptions, delegatesFocus: !0 };
106
+ n = new WeakMap(), h = new WeakMap(), c.styles = [N, E], c.shadowRootOptions = { ...T.shadowRootOptions, delegatesFocus: !0 };
110
107
  let o = c;
111
108
  l([
112
- n({ type: Boolean, reflect: !0 })
109
+ a({ type: Boolean, reflect: !0 })
113
110
  ], o.prototype, "disabled", 2);
114
111
  l([
115
- n({ reflect: !0 })
112
+ a({ reflect: !0 })
116
113
  ], o.prototype, "icon", 2);
117
114
  l([
118
- n({ reflect: !0, attribute: "icon-color" })
115
+ a({ reflect: !0, attribute: "icon-color" })
119
116
  ], o.prototype, "iconColor", 2);
120
117
  l([
121
- n({ type: Boolean, reflect: !0 })
118
+ a({ type: Boolean, reflect: !0 })
122
119
  ], o.prototype, "selected", 2);
123
120
  l([
124
- n({ reflect: !0, attribute: "short-label" })
121
+ a({ reflect: !0, attribute: "short-label" })
125
122
  ], o.prototype, "shortLabel", 2);
126
123
  l([
127
- n({ attribute: !1 })
124
+ a({ attribute: !1 })
128
125
  ], o.prototype, "text", 1);
129
126
  l([
130
- n({ reflect: !0 })
127
+ a({ reflect: !0 })
131
128
  ], o.prototype, "value", 1);
132
129
  l([
133
130
  $()
134
131
  ], o.prototype, "small", 2);
135
132
  l([
136
- k({ flatten: !0 })
133
+ O({ flatten: !0 })
137
134
  ], o.prototype, "_assignedNodes", 2);
138
135
  l([
139
136
  x("small")
@@ -4,6 +4,7 @@ import { FormBase } from '../../internal/components/formBase.js';
4
4
  import '../../internal/components/hint/hint.js';
5
5
  import { PopoverController } from '../../internal/controllers/popover.controller.js';
6
6
  import type { FormFieldSeverity } from '../../internal/types.js';
7
+ import { type Language } from '../../utilities/localize.js';
7
8
  import { type CSSResultGroup } from 'lit';
8
9
  import { SkfSelectOption, type SelectOptionEvent } from './select-option.component.js';
9
10
  import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController } from './select.controllers.js';
@@ -27,11 +28,14 @@ import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationC
27
28
  * @event {Event} reset - Fired when the form is reset
28
29
  * @event {CustomEvent} skf-select-dropdown - {detail: {expanded: boolean}} Fired when the select dropdown is toggled
29
30
  * @event {CustomEvent} skf-select-option-select - {detail: {value: string | null, option: SkfSelectOption}} Fired when the select dropdown is toggled
31
+ * @event {CustomEvent} skf-update-calendar-view - Fires when the calendar view is updated
30
32
  *
31
33
  * @tagname skf-select
32
34
  */
33
35
  export declare class SkfSelect extends FormBase {
36
+ #private;
34
37
  static styles: CSSResultGroup;
38
+ private _componentIsConnected;
35
39
  /** @internal */
36
40
  selectDelay: number;
37
41
  /** @internal */
@@ -54,6 +58,8 @@ export declare class SkfSelect extends FormBase {
54
58
  get selectedOptionsText(): string[];
55
59
  /** If defined, displays provided label */
56
60
  label?: string;
61
+ /** Sets the internal language of the component */
62
+ lang: Language;
57
63
  /** If defined, limits the number of selectable options */
58
64
  max?: number;
59
65
  /** If defined, sets the minimum number of required options */
@@ -62,22 +68,18 @@ export declare class SkfSelect extends FormBase {
62
68
  multiple: boolean;
63
69
  /** If defined, set name of the component */
64
70
  name?: string;
65
- /** If defined, renders an alternative A11y text for the asterisk */
66
- requiredLabel?: string;
67
71
  /** If defined, displays provided severity state */
68
72
  severity?: FormFieldSeverity;
69
73
  /** If true, displays valid state after interaction */
70
74
  showValid: boolean;
71
75
  /** Size of the Select */
72
76
  size: 'sm' | 'md';
73
- /** Read only, returns the selected value. (if multiple: in a comma separated string) */
77
+ /** Returns the selected value. (if multiple: in a comma separated string). If set will default set corresponding option. */
74
78
  set value(newValue: string);
75
79
  get value(): string;
76
- /** @internal */
77
- /** Stores the selected SkfSelectOption tag(s) in a array. Is the source of truth for the internal state. */
80
+ /** @internal - Stores the selected SkfSelectOption tag(s) in a array. Is the source of truth for the internal state. */
78
81
  private _selectedOptions;
79
- /** @internal */
80
- /** The selected options in an array. Treat it as a read only property. See selectedValues, slectedSlots for computed value arrays. */
82
+ /** @internal - Read only. The selected options in an array. See also selectedValues, slectedSlots for computed value arrays. */
81
83
  set selectedOptions(option: SkfSelectOption[]);
82
84
  /** @internal */
83
85
  get selectedOptions(): SkfSelectOption[];
@@ -135,8 +137,10 @@ export declare class SkfSelect extends FormBase {
135
137
  _resetSelectedOptions: (target?: SkfSelectOption) => void;
136
138
  /** @internal */
137
139
  _handleSlotChange: () => void;
138
- /** @internal */
139
- _computeVisibleValue: () => string;
140
+ /** @internal - on slot update, if value is set, select the corresponding option */
141
+ _ifValueIsSetSelectOption: () => void;
142
+ /** @internal - Computes the visible value of the select component - if multiple options are selected, shows a visually dimmed summary (meta info) */
143
+ _computeVisibleValue: () => string | null;
140
144
  /** @internal */
141
145
  private _validateInput;
142
146
  render(): import("lit").TemplateResult<1>;
@@ -1,30 +1,38 @@
1
- import { SkfSelectOptionGroup as v } from "./select-option-group.component.js";
1
+ var _ = (l) => {
2
+ throw TypeError(l);
3
+ };
4
+ var v = (l, r, t) => r.has(l) || _("Cannot " + t);
5
+ var c = (l, r, t) => (v(l, r, "read from private field"), t ? t.call(l) : r.get(l)), g = (l, r, t) => r.has(l) ? _("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(l) : r.set(l, t), y = (l, r, t, e) => (v(l, r, "write to private field"), e ? e.call(l, t) : r.set(l, t), t);
6
+ import { SkfSelectOptionGroup as w } from "./select-option-group.component.js";
2
7
  import "../tag/tag.js";
3
- import { computePosition as _, flip as g, shift as b, offset as y } from "@floating-ui/dom";
4
- import { FormBase as O } from "../../internal/components/formBase.js";
8
+ import { computePosition as x, flip as C, shift as V, offset as $ } from "@floating-ui/dom";
9
+ import { FormBase as L } from "../../internal/components/formBase.js";
5
10
  import "../../internal/components/hint/hint.js";
6
- import { PopoverController as x } from "../../internal/controllers/popover.controller.js";
7
- import { findMatchingTags as w } from "../../internal/helpers/findMatchingTags.js";
8
- import { hintSeverity as S } from "../../internal/helpers/hintSeverity.js";
9
- import { raiseError as $ } from "../../internal/helpers/raiseError.js";
10
- import { watch as f } from "../../internal/helpers/watch.js";
11
- import { Asterisk as V } from "../../internal/templates/asterisk.js";
12
- import { componentStyles as C } from "../../styles/component.styles.js";
13
- import { nothing as E, html as n } from "lit";
14
- import { property as o, state as h, query as p, queryAssignedElements as L } from "lit/decorators.js";
15
- import { classMap as k } from "lit/directives/class-map.js";
16
- import { ifDefined as m } from "lit/directives/if-defined.js";
17
- import { SkfSelectOption as A } from "./select-option.component.js";
18
- import { GlobalClickController as P, KeyboardNavigationController as T, DeveloperFeedbackController as D } from "./select.controllers.js";
19
- import { styles as F } from "./select.styles.js";
20
- var U = Object.defineProperty, M = Object.getOwnPropertyDescriptor, s = (u, t, e, l) => {
21
- for (var r = l > 1 ? void 0 : l ? M(t, e) : t, a = u.length - 1, d; a >= 0; a--)
22
- (d = u[a]) && (r = (l ? d(t, e, r) : d(r)) || r);
23
- return l && r && U(t, e, r), r;
24
- };
25
- const c = class c extends O {
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 b, html as p } from "lit";
20
+ import { property as a, 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 q, DeveloperFeedbackController as j } from "./select.controllers.js";
25
+ import { styles as N } from "./select.styles.js";
26
+ var B = Object.defineProperty, R = Object.getOwnPropertyDescriptor, o = (l, r, t, e) => {
27
+ for (var i = e > 1 ? void 0 : e ? R(r, t) : r, d = l.length - 1, n; d >= 0; d--)
28
+ (n = l[d]) && (i = (e ? n(r, t, i) : n(i)) || i);
29
+ return e && i && B(r, t, i), i;
30
+ }, h;
31
+ const f = class f extends L {
26
32
  constructor() {
27
- 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 P(this), this.keyboardNavController = new T(this), this.developerFeedbackController = new D(this), this.popoverController = new x(this), this._handleOptionSelected = (t) => {
33
+ super();
34
+ g(this, h);
35
+ y(this, h, new T(this)), this._componentIsConnected = !1, this.selectDelay = 200, this._optionsList = [], this.buttonLabel = "Select an option", 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 q(this), this.developerFeedbackController = new j(this), this.popoverController = new E(this), this._handleOptionSelected = (t) => {
28
36
  this._pristine = !1;
29
37
  const e = this._selectedOptions.length > 0;
30
38
  this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
@@ -35,9 +43,9 @@ const c = class c extends O {
35
43
  this.$popover.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
36
44
  }, 50);
37
45
  }, this.reposition = async () => {
38
- const { x: t, y: e } = await _(this.$anchor, this.$popover, {
46
+ const { x: t, y: e } = await x(this.$anchor, this.$popover, {
39
47
  placement: "bottom",
40
- middleware: [g(), b(), y(2)],
48
+ middleware: [C(), V(), $(2)],
41
49
  strategy: "fixed"
42
50
  });
43
51
  Object.assign(this.$popover.style, {
@@ -61,19 +69,36 @@ const c = class c extends O {
61
69
  default:
62
70
  throw new Error("Something went wrong");
63
71
  }
64
- 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 = () => {
65
73
  this.multiple || (this._expanded = !1), t("done");
66
74
  });
67
75
  }), this._resetSelectedOptions = (t) => {
68
76
  const e = !t;
69
- this._optionsList.forEach((l) => {
70
- (e || l !== t) && l.removeAttribute("selected");
71
- });
77
+ this._optionsList.forEach((i) => {
78
+ (e || i !== t) && i.removeAttribute("selected");
79
+ }), this._optionsList = [];
72
80
  }, this._handleSlotChange = () => {
73
- this._handleSizeUpdate(), this._collectSlotOptionTags(), this._validateInput();
81
+ this._handleSizeUpdate(), this._collectSlotOptionTags(), this._ifValueIsSetSelectOption(), this._validateInput(), this._componentIsConnected = !0;
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
+ (i) => i.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((i) => i.value.toLowerCase().trim() === t);
95
+ e && (e.setSelectedDiscrete = !0, this.selectedOptions = [e], this._setValue().catch((i) => {
96
+ console.error(i);
97
+ }));
98
+ }
74
99
  }, this._computeVisibleValue = () => {
75
100
  var t, e;
76
- 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;
101
+ return (t = this.$selectedValue) == null || t.classList.add("contains-meta-info"), this._selectedOptions.length > 1 ? `(${c(this, h).term("itemsSelected", this._selectedOptions.length)})` : this.value ? ((e = this.$selectedValue) == null || e.classList.remove("contains-meta-info"), this._selectedOptions[0].textContent) : this.buttonLabel;
77
102
  }, this._selectedOptions = [];
78
103
  }
79
104
  set selectedValues(t) {
@@ -92,11 +117,11 @@ const c = class c extends O {
92
117
  }
93
118
  set value(t) {
94
119
  let e = [];
95
- this.multiple ? e = t.split(",").map((l) => l.toLowerCase().trim()) : e = [t.toLowerCase().trim()], this._selectedOptions = this._optionsList.filter(
96
- (l) => e.includes(l.value.toLowerCase().trim())
97
- ), this._optionsList.forEach((l) => {
98
- l.selected && (l.setSelectedDiscrete = !1);
99
- }), this._selectedOptions.forEach((l) => l.setSelectedDiscrete = !0), this._setValue();
120
+ this.multiple ? e = String(t).split(",").map((i) => i.toLowerCase().trim()) : e = [String(t).toLowerCase().trim()], this._selectedOptions = this._optionsList.filter(
121
+ (i) => e.includes(i.value.toLowerCase().trim())
122
+ ), this._optionsList.forEach((i) => {
123
+ i.selected && (i.setSelectedDiscrete = !1);
124
+ }), this._selectedOptions.forEach((i) => i.setSelectedDiscrete = !0), this._setValue();
100
125
  }
101
126
  get value() {
102
127
  return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
@@ -131,7 +156,7 @@ const c = class c extends O {
131
156
  }
132
157
  _handleSizeUpdate() {
133
158
  this._slottedItems.forEach((t) => {
134
- (t instanceof A || t instanceof v) && (t.small = this.size === "sm");
159
+ (t instanceof z || t instanceof w) && (t.small = this.size === "sm");
135
160
  });
136
161
  }
137
162
  handleExpandedChange() {
@@ -139,11 +164,11 @@ const c = class c extends O {
139
164
  console.error(t);
140
165
  })), this.emit("skf-select-dropdown", { detail: { expanded: this._expanded } });
141
166
  }
142
- attributeChangedCallback(t, e, l) {
143
- if (super.attributeChangedCallback(t, e, l), t === "custom-invalid")
144
- if (typeof l == "string") {
145
- const a = this.withFallback(l);
146
- this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, a), this.checkValidity();
167
+ attributeChangedCallback(t, e, i) {
168
+ if (super.attributeChangedCallback(t, e, i), t === "custom-invalid")
169
+ if (typeof i == "string") {
170
+ const n = this.withFallback(i);
171
+ this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, n), this.checkValidity();
147
172
  } else
148
173
  this.setValidity({}), this._validateInput();
149
174
  }
@@ -158,8 +183,8 @@ const c = class c extends O {
158
183
  e.selected && (this.selectedOptions = [...this.selectedOptions, e]);
159
184
  });
160
185
  else {
161
- const e = this._selectedOptions.length > 0, l = t.detail.value !== null;
162
- e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), l && (this.selectedOptions = [t.target]);
186
+ const e = this._selectedOptions.length > 0, i = t.detail.value !== null;
187
+ e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), i && (this.selectedOptions = [t.target]);
163
188
  }
164
189
  this._setValue();
165
190
  }
@@ -170,7 +195,7 @@ const c = class c extends O {
170
195
  /** @internal */
171
196
  /** Filter out elements other than skf-select-option and store in this._optionsList */
172
197
  _collectSlotOptionTags() {
173
- this._optionsList = w(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), $({
198
+ this._optionsList = k(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), D({
174
199
  assert: this._optionsList.length > 0,
175
200
  reason: "no-children",
176
201
  replaceStrings: [this.localName, "skf-select-option"]
@@ -179,29 +204,29 @@ const c = class c extends O {
179
204
  /** @internal */
180
205
  _validateInput() {
181
206
  this._invalid = !1;
182
- const t = this.required && !this.selectedValues.length || this.min === 1, e = !!(this.min && this.selectedValues.length < this.min), l = !!(this.max && this.selectedValues.length > this.max);
207
+ const t = this.required && !this.selectedValues.length || this.min === 1, e = !!(this.min && this.selectedValues.length < this.min), i = !!(this.max && this.selectedValues.length > this.max);
183
208
  if (this._internals.validity.customError) {
184
209
  this._invalid = !0;
185
210
  return;
186
211
  } else if (t) {
187
- const a = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
188
- this.setValidity({ valueMissing: !0 }, String(a)), this._pristine || (this._invalid = !0);
212
+ const n = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
213
+ this.setValidity({ valueMissing: !0 }, String(n)), this._pristine || (this._invalid = !0);
189
214
  } else if (e) {
190
- const a = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
191
- this.setValidity({ rangeUnderflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
192
- } else if (l) {
193
- const a = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
194
- this.setValidity({ rangeOverflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
215
+ const n = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
216
+ this.setValidity({ rangeUnderflow: !0 }, String(n)), this._pristine || (this._invalid = !0);
217
+ } else if (i) {
218
+ const n = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
219
+ this.setValidity({ rangeOverflow: !0 }, String(n)), this._pristine || (this._invalid = !0);
195
220
  } else
196
221
  this.setValidity({}), !this._pristine && this.showValid && this.setAttribute("valid", "true");
197
222
  }
198
223
  render() {
199
- return n`
224
+ return p`
200
225
  <div id="root">
201
226
  <label>
202
227
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
203
228
  ${this.label}
204
- ${this.required ? V(this.requiredLabel) : null}
229
+ ${this.required ? I(c(this, h).term("required")) : b}
205
230
  </div>
206
231
  <button
207
232
  ?disabled=${this.disabled}
@@ -215,19 +240,19 @@ const c = class c extends O {
215
240
  >
216
241
  <span
217
242
  id="selected-value"
218
- class=${k({ "selected-value": !0, "contains-meta-info": !this.value })}>
243
+ class=${U({ "selected-value": !0, "contains-meta-info": !this.value })}>
219
244
  ${this._computeVisibleValue()}
220
245
  </span>
221
246
  <skf-icon class="arrow" data-color="custom" name="chevronDown"></skf-icon>
222
247
  </button>
223
248
  </label>
224
- <div aria-multiselectable=${m(this.multiple && !0)} id="select-dropdown" popover role="listbox">
249
+ <div aria-multiselectable=${O(this.multiple && !0)} id="select-dropdown" popover role="listbox">
225
250
  <slot @slotchange=${this._handleSlotChange}></slot>
226
251
  </div>
227
- ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? n`
252
+ ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? p`
228
253
  <div id="tags">
229
254
  ${this.selectedOptions.map(
230
- (t) => n`
255
+ (t) => p`
231
256
  <skf-tag
232
257
  style="${`view-transition-name: tag-${String(t.textContent).replace(/[^a-zA-Z]/g, "").toLowerCase()}`}"
233
258
  removable
@@ -240,13 +265,13 @@ const c = class c extends O {
240
265
  `
241
266
  )}
242
267
  </div>
243
- ` : E}
244
- ${this.hint && n`
268
+ ` : b}
269
+ ${this.hint && p`
245
270
  <skf-hint
246
271
  ?disabled=${this.disabled}
247
272
  aria-live=${this._invalid ? "assertive" : "polite"}
248
273
  id="hint"
249
- severity=${m(S(this._invalid, this.severity))}
274
+ severity=${O(A(this._invalid, this.severity))}
250
275
  >
251
276
  ${this.customInvalid ?? this.hint}
252
277
  </skf-hint>
@@ -256,86 +281,86 @@ const c = class c extends O {
256
281
  `;
257
282
  }
258
283
  };
259
- c.styles = [C, F];
260
- let i = c;
261
- s([
262
- o({ type: String, reflect: !0, attribute: "button-label" })
263
- ], i.prototype, "buttonLabel", 2);
264
- s([
265
- o({ attribute: "custom-invalid" })
266
- ], i.prototype, "customInvalid", 2);
267
- s([
268
- o({ type: Boolean, attribute: "hide-label" })
269
- ], i.prototype, "hideLabel", 2);
270
- s([
271
- o({ type: Boolean, reflect: !0, attribute: "hide-tags" })
272
- ], i.prototype, "hideTags", 2);
273
- s([
274
- o()
275
- ], i.prototype, "hint", 2);
276
- s([
277
- o({ type: Array, attribute: !1 })
278
- ], i.prototype, "selectedValues", 1);
279
- s([
280
- o({ type: Array, attribute: !1 })
281
- ], i.prototype, "selectedOptionsText", 1);
282
- s([
283
- o({ reflect: !0 })
284
- ], i.prototype, "label", 2);
285
- s([
286
- o({ type: Number })
287
- ], i.prototype, "max", 2);
288
- s([
289
- o({ type: Number })
290
- ], i.prototype, "min", 2);
291
- s([
292
- o({ type: Boolean, reflect: !0 })
293
- ], i.prototype, "multiple", 2);
294
- s([
295
- o()
296
- ], i.prototype, "name", 2);
297
- s([
298
- o({ attribute: "required-label" })
299
- ], i.prototype, "requiredLabel", 2);
300
- s([
301
- o()
302
- ], i.prototype, "severity", 2);
303
- s([
304
- o({ type: Boolean, attribute: "show-valid" })
305
- ], i.prototype, "showValid", 2);
306
- s([
307
- o({ reflect: !0 })
308
- ], i.prototype, "size", 2);
309
- s([
310
- h()
311
- ], i.prototype, "value", 1);
312
- s([
313
- h()
314
- ], i.prototype, "selectedOptions", 1);
315
- s([
316
- h()
317
- ], i.prototype, "_expanded", 2);
318
- s([
319
- h()
320
- ], i.prototype, "_invalid", 2);
321
- s([
322
- p("#select-button")
323
- ], i.prototype, "$anchor", 2);
324
- s([
325
- p("#selected-value")
326
- ], i.prototype, "$selectedValue", 2);
327
- s([
328
- p("#select-dropdown")
329
- ], i.prototype, "$popover", 2);
330
- s([
331
- L()
332
- ], i.prototype, "_slottedItems", 2);
333
- s([
334
- f("size", { waitUntilFirstUpdate: !0 })
335
- ], i.prototype, "_handleSizeUpdate", 1);
336
- s([
337
- f("_expanded", { afterUpdate: !0 })
338
- ], i.prototype, "handleExpandedChange", 1);
284
+ h = new WeakMap(), f.styles = [P, N];
285
+ let s = f;
286
+ o([
287
+ a({ type: String, reflect: !0, attribute: "button-label" })
288
+ ], s.prototype, "buttonLabel", 2);
289
+ o([
290
+ a({ type: String, attribute: "custom-invalid" })
291
+ ], s.prototype, "customInvalid", 2);
292
+ o([
293
+ a({ type: Boolean, attribute: "hide-label" })
294
+ ], s.prototype, "hideLabel", 2);
295
+ o([
296
+ a({ type: Boolean, reflect: !0, attribute: "hide-tags" })
297
+ ], s.prototype, "hideTags", 2);
298
+ o([
299
+ a({ type: String })
300
+ ], s.prototype, "hint", 2);
301
+ o([
302
+ a({ type: Array, attribute: !1 })
303
+ ], s.prototype, "selectedValues", 1);
304
+ o([
305
+ a({ type: Array, attribute: !1 })
306
+ ], s.prototype, "selectedOptionsText", 1);
307
+ o([
308
+ a({ type: String, reflect: !0 })
309
+ ], s.prototype, "label", 2);
310
+ o([
311
+ a({ type: String })
312
+ ], s.prototype, "lang", 2);
313
+ o([
314
+ a({ type: Number })
315
+ ], s.prototype, "max", 2);
316
+ o([
317
+ a({ type: Number })
318
+ ], s.prototype, "min", 2);
319
+ o([
320
+ a({ type: Boolean, reflect: !0 })
321
+ ], s.prototype, "multiple", 2);
322
+ o([
323
+ a({ type: String })
324
+ ], s.prototype, "name", 2);
325
+ o([
326
+ a()
327
+ ], s.prototype, "severity", 2);
328
+ o([
329
+ a({ type: Boolean, attribute: "show-valid" })
330
+ ], s.prototype, "showValid", 2);
331
+ o([
332
+ a({ reflect: !0 })
333
+ ], s.prototype, "size", 2);
334
+ o([
335
+ a({ type: String, attribute: !1 })
336
+ ], s.prototype, "value", 1);
337
+ o([
338
+ u()
339
+ ], s.prototype, "selectedOptions", 1);
340
+ o([
341
+ u()
342
+ ], s.prototype, "_expanded", 2);
343
+ o([
344
+ u()
345
+ ], s.prototype, "_invalid", 2);
346
+ o([
347
+ m("#select-button")
348
+ ], s.prototype, "$anchor", 2);
349
+ o([
350
+ m("#selected-value")
351
+ ], s.prototype, "$selectedValue", 2);
352
+ o([
353
+ m("#select-dropdown")
354
+ ], s.prototype, "$popover", 2);
355
+ o([
356
+ F()
357
+ ], s.prototype, "_slottedItems", 2);
358
+ o([
359
+ S("size", { waitUntilFirstUpdate: !0 })
360
+ ], s.prototype, "_handleSizeUpdate", 1);
361
+ o([
362
+ S("_expanded", { afterUpdate: !0 })
363
+ ], s.prototype, "handleExpandedChange", 1);
339
364
  export {
340
- i as SkfSelect
365
+ s as SkfSelect
341
366
  };
@@ -50,7 +50,7 @@ const s = e`
50
50
  }
51
51
 
52
52
  :is(.stepper-item--active, .stepper-item--completed) {
53
- --_skf-stepper-color: var(--skf-text-color-emphasised);
53
+ --_skf-stepper-color: var(--skf-text-color-emphasized);
54
54
  }
55
55
 
56
56
  .stepper-item--enabled {
@@ -70,17 +70,17 @@ const s = e`
70
70
  user-select: none;
71
71
 
72
72
  :is(.stepper-item--active, .stepper-item--active-completed, .stepper-item--completed) & {
73
- --_skf-stepper-circle-border-color: var(--skf-border-color-emphasised);
73
+ --_skf-stepper-circle-border-color: var(--skf-border-color-emphasized);
74
74
  }
75
75
 
76
76
  :is(.stepper-item--active, .stepper-item--active-completed) & {
77
77
  --_skf-stepper-circle-color: var(--skf-text-color-inverse);
78
- --_skf-stepper-circle-bg-color: var(--skf-bg-color-emphasised);
78
+ --_skf-stepper-circle-bg-color: var(--skf-bg-color-emphasized);
79
79
  }
80
80
 
81
81
  .stepper-item--enabled & {
82
82
  --_skf-stepper-circle-border-color: #6292e4; /* Missing token */
83
- --_skf-stepper-circle-color: var(--skf-text-color-emphasised);
83
+ --_skf-stepper-circle-color: var(--skf-text-color-emphasized);
84
84
  }
85
85
  }
86
86
 
@@ -1,5 +1,6 @@
1
1
  import { FormBase } from '../../internal/components/formBase.js';
2
2
  import type { FormFieldBaseProps } from '../../internal/types/formField.js';
3
+ import { type Language } from '../../utilities/localize.js';
3
4
  import { type CSSResultGroup } from 'lit';
4
5
  /**
5
6
  * The `<skf-switch>` is a component that displays a list of actions or options
@@ -14,6 +15,7 @@ import { type CSSResultGroup } from 'lit';
14
15
  * @tagname skf-switch
15
16
  */
16
17
  export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
18
+ #private;
17
19
  static styles: CSSResultGroup;
18
20
  /** @internal */
19
21
  private _initialChecked;
@@ -25,10 +27,10 @@ export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
25
27
  hideLabel: boolean;
26
28
  /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
27
29
  label?: string;
30
+ /** Sets the internal language of the component */
31
+ lang: Language;
28
32
  /** If defined, adds name to the input-element */
29
33
  name?: string;
30
- /** If defined, renders an alternative A11y text for the asterisk */
31
- requiredLabel?: string;
32
34
  /** Size of the Switch */
33
35
  size: 'sm' | 'md';
34
36
  /** The current value of the input field */