@skf-design-system/ui-components 1.0.0-beta.7 → 1.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/components/alert/alert.component.d.ts +2 -2
  2. package/dist/components/alert/alert.component.js +34 -34
  3. package/dist/components/breadcrumb/breadcrumb.component.d.ts +29 -0
  4. package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
  5. package/dist/components/breadcrumb/breadcrumb.styles.d.ts +1 -0
  6. package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +25 -0
  7. package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +8 -0
  8. package/dist/components/breadcrumb-item/breadcrumb-item.styles.d.ts +1 -0
  9. package/dist/components/button/button.component.d.ts +6 -4
  10. package/dist/components/button/button.component.js +87 -70
  11. package/dist/components/button/button.styles.js +64 -45
  12. package/dist/components/checkbox/checkbox.component.d.ts +3 -1
  13. package/dist/components/checkbox/checkbox.component.js +71 -58
  14. package/dist/components/date-picker/datepicker.calendar.component.d.ts +72 -0
  15. package/dist/components/date-picker/datepicker.calendar.component.js +382 -0
  16. package/dist/components/date-picker/datepicker.calendar.styles.d.ts +1 -0
  17. package/dist/components/date-picker/datepicker.calendar.styles.js +192 -0
  18. package/dist/components/date-picker/datepicker.component.d.ts +74 -0
  19. package/dist/components/date-picker/datepicker.component.js +241 -0
  20. package/dist/components/date-picker/datepicker.d.ts +10 -0
  21. package/dist/components/date-picker/datepicker.helpers.d.ts +40 -0
  22. package/dist/components/date-picker/datepicker.helpers.js +69 -0
  23. package/dist/components/date-picker/datepicker.js +8 -0
  24. package/dist/components/date-picker/datepicker.styles.d.ts +1 -0
  25. package/dist/components/date-picker/datepicker.styles.js +99 -0
  26. package/dist/components/date-picker-input/datepicker-input.component.d.ts +107 -0
  27. package/dist/components/date-picker-input/datepicker-input.component.js +397 -0
  28. package/dist/components/date-picker-input/datepicker-input.d.ts +8 -0
  29. package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +4 -0
  30. package/dist/components/date-picker-input/datepicker-input.helpers.js +29 -0
  31. package/dist/components/date-picker-input/datepicker-input.js +6 -0
  32. package/dist/components/date-picker-input/datepicker-input.styles.d.ts +1 -0
  33. package/dist/components/date-picker-input/datepicker-input.styles.js +22 -0
  34. package/dist/components/dialog/dialog.component.d.ts +0 -1
  35. package/dist/components/dialog/dialog.component.js +2 -4
  36. package/dist/components/icon/icon.component.d.ts +1 -4
  37. package/dist/components/icon/icon.component.js +28 -19
  38. package/dist/components/icon/icon.styles.js +53 -47
  39. package/dist/components/input/input.component.d.ts +1 -0
  40. package/dist/components/input/input.component.js +87 -80
  41. package/dist/components/link/link.component.d.ts +1 -0
  42. package/dist/components/link/link.component.js +21 -21
  43. package/dist/components/menu/menu.component.d.ts +24 -0
  44. package/dist/components/menu/menu.component.js +18 -0
  45. package/dist/components/menu/menu.d.ts +8 -0
  46. package/dist/components/menu/menu.js +6 -0
  47. package/dist/components/menu/menu.styles.d.ts +1 -0
  48. package/dist/components/menu/menu.styles.js +11 -0
  49. package/dist/components/menu-item/menu-item.component.d.ts +25 -0
  50. package/dist/components/menu-item/menu-item.component.js +13 -0
  51. package/dist/components/menu-item/menu-item.d.ts +8 -0
  52. package/dist/components/menu-item/menu-item.js +6 -0
  53. package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
  54. package/dist/components/menu-item/menu-item.styles.js +19 -0
  55. package/dist/components/popover/popover.component.d.ts +29 -0
  56. package/dist/components/popover/popover.component.js +37 -0
  57. package/dist/components/popover/popover.d.ts +8 -0
  58. package/dist/components/popover/popover.js +6 -0
  59. package/dist/components/popover/popover.styles.d.ts +1 -0
  60. package/dist/components/popover/popover.styles.js +12 -0
  61. package/dist/components/select/select.component.d.ts +8 -10
  62. package/dist/components/select/select.component.js +115 -118
  63. package/dist/components/select/select.controllers.d.ts +0 -25
  64. package/dist/components/select/select.controllers.js +35 -95
  65. package/dist/components/stepper/stepper.component.d.ts +38 -0
  66. package/dist/components/stepper/stepper.component.js +91 -0
  67. package/dist/components/stepper/stepper.d.ts +8 -0
  68. package/dist/components/stepper/stepper.helpers.d.ts +16 -0
  69. package/dist/components/stepper/stepper.helpers.js +18 -0
  70. package/dist/components/stepper/stepper.js +6 -0
  71. package/dist/components/stepper/stepper.styles.d.ts +1 -0
  72. package/dist/components/stepper/stepper.styles.js +15 -0
  73. package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
  74. package/dist/components/stepper-item/stepper-item.component.js +113 -0
  75. package/dist/components/stepper-item/stepper-item.d.ts +8 -0
  76. package/dist/components/stepper-item/stepper-item.js +6 -0
  77. package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
  78. package/dist/components/stepper-item/stepper-item.styles.js +98 -0
  79. package/dist/components/toast/toast.component.d.ts +7 -4
  80. package/dist/components/toast/toast.component.js +24 -20
  81. package/dist/components/toast/toast.singleton.d.ts +2 -7
  82. package/dist/components/toast/toast.singleton.js +25 -25
  83. package/dist/components/toast-item/toast-item.component.js +15 -15
  84. package/dist/components/toast-item/toast-item.styles.js +13 -11
  85. package/dist/components/tooltip/tooltip.component.d.ts +24 -0
  86. package/dist/components/tooltip/tooltip.component.js +18 -0
  87. package/dist/components/tooltip/tooltip.d.ts +8 -0
  88. package/dist/components/tooltip/tooltip.js +6 -0
  89. package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
  90. package/dist/components/tooltip/tooltip.styles.js +12 -0
  91. package/dist/custom-elements.json +3278 -1321
  92. package/dist/index.d.ts +8 -0
  93. package/dist/index.js +78 -54
  94. package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
  95. package/dist/internal/base-classes/popover/popover.base.js +116 -0
  96. package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
  97. package/dist/internal/base-classes/popover/popover.styles.js +29 -0
  98. package/dist/internal/controllers/popover.controller.d.ts +17 -0
  99. package/dist/internal/controllers/popover.controller.js +44 -0
  100. package/dist/internal/helpers/dateFormatter.d.ts +2 -0
  101. package/dist/internal/helpers/hintSeverity.d.ts +1 -1
  102. package/dist/internal/helpers/utilityTypes.d.ts +22 -0
  103. package/dist/react/index.d.ts +11 -2
  104. package/dist/react/index.js +11 -2
  105. package/dist/react/skf-breadcrumb/index.d.ts +9 -0
  106. package/dist/react/skf-breadcrumb/index.js +17 -0
  107. package/dist/react/skf-breadcrumb-item/index.d.ts +3 -0
  108. package/dist/react/skf-breadcrumb-item/index.js +13 -0
  109. package/dist/react/skf-datepicker/index.d.ts +12 -0
  110. package/dist/react/skf-datepicker/index.js +18 -0
  111. package/dist/react/skf-menu/index.d.ts +12 -0
  112. package/dist/react/skf-menu/index.js +18 -0
  113. package/dist/react/skf-menu-item/index.d.ts +27 -0
  114. package/dist/react/skf-menu-item/index.js +23 -0
  115. package/dist/react/skf-popover/index.d.ts +12 -0
  116. package/dist/react/skf-popover/index.js +18 -0
  117. package/dist/react/skf-stepper/index.d.ts +9 -0
  118. package/dist/react/skf-stepper/index.js +17 -0
  119. package/dist/react/skf-stepper-item/index.d.ts +9 -0
  120. package/dist/react/skf-stepper-item/index.js +17 -0
  121. package/dist/react/skf-tooltip/index.d.ts +12 -0
  122. package/dist/react/skf-tooltip/index.js +18 -0
  123. package/dist/types/jsx/custom-element-jsx.d.ts +628 -155
  124. package/dist/types/vue/index.d.ts +369 -74
  125. package/dist/vscode.html-custom-data.json +761 -391
  126. package/dist/web-types.json +936 -293
  127. package/package.json +34 -33
@@ -0,0 +1,11 @@
1
+ import { css as s } from "lit";
2
+ const n = s`
3
+ @layer components {
4
+ .menu {
5
+ padding-block: var(--skf-spacing-25);
6
+ }
7
+ }
8
+ `;
9
+ export {
10
+ n as styles
11
+ };
@@ -0,0 +1,25 @@
1
+ import { SkfLink } from '../link/link.component.js';
2
+ import { type CSSResultGroup } from 'lit';
3
+ /**
4
+ * The `<skf-menu-item>` is a component that displays a list of actions or options.
5
+ *
6
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
7
+ *
8
+ * @event {CustomEvent} my-tag-my-event - Fired when something happens
9
+ *
10
+ * @event click - Fired when the component is clicked
11
+ * @event mouseover - Fired when the mouse is over the component
12
+ * @event mouseout - Fired when the mouse is out of the component
13
+ * @event focus - Fired when the component is focused
14
+ * @event blur - Fired when the component is blurred
15
+ * @event change - Fired when the component's value changes
16
+ *
17
+ * @slot - The component's main content
18
+ * @slot my-named-slot - A named slot of the component
19
+ *
20
+ * @tagname skf-menu-item
21
+ */
22
+ export declare class SkfMenuItem extends SkfLink {
23
+ static styles: CSSResultGroup;
24
+ constructor();
25
+ }
@@ -0,0 +1,13 @@
1
+ import { SkfLink as s } from "../link/link.component.js";
2
+ import "lit";
3
+ import { styles as o } from "./menu-item.styles.js";
4
+ const t = class t extends s {
5
+ constructor() {
6
+ super(), s.classMap = { "menu-item": !0 };
7
+ }
8
+ };
9
+ t.styles = [s.styles, o];
10
+ let r = t;
11
+ export {
12
+ r as SkfMenuItem
13
+ };
@@ -0,0 +1,8 @@
1
+ import { SkfMenuItem } from './menu-item.component';
2
+ export * from './menu-item.component';
3
+ export default SkfMenuItem;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-menu-item': SkfMenuItem;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import { SkfMenuItem as e } from "./menu-item.component.js";
2
+ e.define("skf-menu-item");
3
+ export {
4
+ e as SkfMenuItem,
5
+ e as default
6
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,19 @@
1
+ import { css as e } from "lit";
2
+ const s = e`
3
+ @layer components {
4
+ .menu-item {
5
+ block-size: var(--skf-size-44);
6
+ display: flex;
7
+ padding-inline: var(--skf-spacing-75);
8
+
9
+ @media screen and (any-hover: hover) {
10
+ &:hover {
11
+ background-color: var(--skf-color-blue-lighest);
12
+ }
13
+ }
14
+ }
15
+ }
16
+ `;
17
+ export {
18
+ s as styles
19
+ };
@@ -0,0 +1,29 @@
1
+ import { SkfPopoverBase } from '../../internal/base-classes/popover/popover.base.js';
2
+ import type { CSSResultGroup } from 'lit';
3
+ /**
4
+ * The `<skf-popover>` is a general purpose component that displays the slot content.
5
+ *
6
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
7
+ *
8
+ * @property {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the menu
9
+ * @property {boolean} [isOpen=false] - Whether the menu is open
10
+ * @property {string} [anchor] - The id of the element the menu will be anchored to
11
+ *
12
+ * @event open - Fired when the menu is opened
13
+ * @event close - Fired when the menu is closed
14
+ *
15
+ * @slot - The popover content
16
+ *
17
+ * @tagname skf-popover
18
+ */
19
+ export declare class SkfPopover extends SkfPopoverBase {
20
+ static styles: CSSResultGroup;
21
+ /** If defined, sets a custom offset for the popover */
22
+ offset: number;
23
+ /** If true, hides the arrow */
24
+ hideArrow: boolean;
25
+ constructor();
26
+ hideArrowChanged(): void;
27
+ addEventListeners($element: HTMLElement | Element): void;
28
+ removeEventListeners($element: HTMLElement | Element): void;
29
+ }
@@ -0,0 +1,37 @@
1
+ import { SkfPopoverBase as h } from "../../internal/base-classes/popover/popover.base.js";
2
+ import { watch as d } from "../../internal/helpers/watch.js";
3
+ import { property as f } from "lit/decorators.js";
4
+ import { styles as v } from "./popover.styles.js";
5
+ var w = Object.defineProperty, l = Object.getOwnPropertyDescriptor, n = (m, e, s, o) => {
6
+ for (var r = o > 1 ? void 0 : o ? l(e, s) : e, i = m.length - 1, p; i >= 0; i--)
7
+ (p = m[i]) && (r = (o ? p(e, s, r) : p(r)) || r);
8
+ return o && r && w(e, s, r), r;
9
+ };
10
+ const a = class a extends h {
11
+ constructor() {
12
+ super(), this.offset = 8, this.hideArrow = !1, this.arrow = !this.hideArrow, this.placement = "bottom-start", h.classMap = { popover: !0 };
13
+ }
14
+ hideArrowChanged() {
15
+ this.arrow = !this.hideArrow;
16
+ }
17
+ addEventListeners(e) {
18
+ e.addEventListener("mouseenter", this.open);
19
+ }
20
+ removeEventListeners(e) {
21
+ e.removeEventListener("mouseenter", this.open);
22
+ }
23
+ };
24
+ a.styles = [h.styles, v];
25
+ let t = a;
26
+ n([
27
+ f({ type: Number })
28
+ ], t.prototype, "offset", 2);
29
+ n([
30
+ f({ type: Boolean })
31
+ ], t.prototype, "hideArrow", 2);
32
+ n([
33
+ d("hideArrow")
34
+ ], t.prototype, "hideArrowChanged", 1);
35
+ export {
36
+ t as SkfPopover
37
+ };
@@ -0,0 +1,8 @@
1
+ import { SkfPopover } from './popover.component';
2
+ export * from './popover.component';
3
+ export default SkfPopover;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-popover': SkfPopover;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import { SkfPopover as o } from "./popover.component.js";
2
+ o.define("skf-popover");
3
+ export {
4
+ o as SkfPopover,
5
+ o as default
6
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,12 @@
1
+ import { css as s } from "lit";
2
+ const e = s`
3
+ @layer components {
4
+ .popover {
5
+ font-size: var(--skf-font-size-75);
6
+ padding: var(--skf-spacing-50);
7
+ }
8
+ }
9
+ `;
10
+ export {
11
+ e as styles
12
+ };
@@ -1,10 +1,11 @@
1
1
  import { FormBase } from '../../internal/components/formBase.js';
2
+ import { PopoverController } from '../../internal/controllers/popover.controller.js';
2
3
  import type { FormFieldBaseProps } from '../../internal/types/formField.js';
3
4
  import { type CSSResultGroup } from 'lit';
4
5
  import '../../internal/components/hint/hint';
5
6
  import type { SelectOptionEvent, SkfSelectOption } from '../select-option/select-option.component.js';
6
7
  import '../tag/tag';
7
- import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController, ResizeController, ScrollController } from './select.controllers.js';
8
+ import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController } from './select.controllers.js';
8
9
  /**
9
10
  * TODO: abstract the popover logic to a separate component/helper/partial, and use it in both select and in input[datalist], combobox etc
10
11
  *
@@ -84,25 +85,23 @@ export declare class SkfSelect extends FormBase {
84
85
  /** True if the internal state is invalid */
85
86
  private _invalid;
86
87
  /** @internal */
87
- private $selectBtn?;
88
+ $anchor: HTMLButtonElement;
88
89
  /** @internal */
89
90
  private $selectedValue?;
90
91
  /** @internal */
91
- private $dropdown?;
92
- /** @internal */
93
- protected scrollController: ScrollController;
94
- /** @internal */
95
- protected resizeController: ResizeController;
92
+ $popover: HTMLDivElement;
96
93
  /** @internal */
97
94
  protected globalClickController: GlobalClickController;
98
95
  /** @internal */
99
96
  protected keyboardNavController: KeyboardNavigationController;
100
97
  /** @internal */
101
98
  protected developerFeedbackController: DeveloperFeedbackController;
99
+ /** @internal */
100
+ protected popoverController: PopoverController;
102
101
  constructor();
103
102
  willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
104
103
  firstUpdated(): void;
105
- updated(changedProperties: Map<string, unknown>): void;
104
+ handleExpandedChange(): void;
106
105
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
107
106
  disconnectedCallback(): void;
108
107
  /** @internal */
@@ -119,8 +118,7 @@ export declare class SkfSelect extends FormBase {
119
118
  /** @internal */
120
119
  _updateWidth: () => void;
121
120
  /** @internal */
122
- /** this runs only from the 'updated' lifecycle, by setting source-of-truth _expanded=false */
123
- private _managePopover;
121
+ reposition: () => Promise<void>;
124
122
  /** @internal */
125
123
  _handleDropdownToggle: (e: Event) => void;
126
124
  /** @internal
@@ -1,26 +1,28 @@
1
1
  import { computePosition as v, flip as f, shift as _, offset as g } from "@floating-ui/dom";
2
2
  import { FormBase as b } from "../../internal/components/formBase.js";
3
- import { findMatchingTags as y } from "../../internal/helpers/findMatchingTags.js";
4
- import { hintSeverity as O } from "../../internal/helpers/hintSeverity.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";
5
6
  import { raiseError as w } from "../../internal/helpers/raiseError.js";
6
- import { Asterisk as x } from "../../internal/templates/asterisk.js";
7
- import $ from "../../styles/component.styles.js";
8
- import { html as h, nothing as V } from "lit";
9
- import { property as o, state as d, query as p } from "lit/decorators.js";
10
- import { classMap as S } from "lit/directives/class-map.js";
7
+ import { watch as $ } from "../../internal/helpers/watch.js";
8
+ import { Asterisk as V } from "../../internal/templates/asterisk.js";
9
+ import S from "../../styles/component.styles.js";
10
+ import { html as n, nothing as C } 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";
11
13
  import { ifDefined as m } from "lit/directives/if-defined.js";
12
14
  import "../../internal/components/hint/hint.js";
13
15
  import "../tag/tag.js";
14
- import { ScrollController as C, ResizeController as k, GlobalClickController as L, KeyboardNavigationController as A, DeveloperFeedbackController as E } from "./select.controllers.js";
16
+ import { GlobalClickController as k, KeyboardNavigationController as L, DeveloperFeedbackController as A } from "./select.controllers.js";
15
17
  import { styles as P } from "./select.styles.js";
16
- var T = Object.defineProperty, D = Object.getOwnPropertyDescriptor, l = (u, t, e, i) => {
17
- for (var r = i > 1 ? void 0 : i ? D(t, e) : t, n = u.length - 1, a; n >= 0; n--)
18
- (a = u[n]) && (r = (i ? a(t, e, r) : a(r)) || r);
19
- return i && r && T(t, e, r), r;
18
+ var T = Object.defineProperty, D = Object.getOwnPropertyDescriptor, s = (u, t, e, l) => {
19
+ for (var a = l > 1 ? void 0 : l ? D(t, e) : t, r = u.length - 1, d; r >= 0; r--)
20
+ (d = u[r]) && (a = (l ? d(t, e, a) : d(a)) || a);
21
+ return l && a && T(t, e, a), a;
20
22
  };
21
23
  const c = class c extends b {
22
24
  constructor() {
23
- super(), this.selectDelay = 200, this._optionsList = [], this.buttonLabel = "Select an option", this.size = "md", this._expanded = !1, this._invalid = !1, this.scrollController = new C(this), this.resizeController = new k(this), this.globalClickController = new L(this), this.keyboardNavController = new A(this), this.developerFeedbackController = new E(this), this._handleOptionSelected = (t) => {
25
+ super(), this.selectDelay = 200, this._optionsList = [], this.buttonLabel = "Select an option", this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new k(this), this.keyboardNavController = new L(this), this.developerFeedbackController = new A(this), this.popoverController = new y(this), this._handleOptionSelected = (t) => {
24
26
  this._pristine = !1;
25
27
  const e = this._selectedOptions.length > 0;
26
28
  this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
@@ -28,26 +30,20 @@ const c = class c extends b {
28
30
  this.emitEvent("reset"), this._resetSelectedOptions();
29
31
  }, this._updateWidth = () => {
30
32
  setTimeout(() => {
31
- var t;
32
- (t = this.$dropdown) == null || t.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
33
+ this.$popover.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
33
34
  }, 50);
34
- }, this._managePopover = () => ({ close: () => {
35
- var i;
36
- (i = this.$dropdown) == null || i.hidePopover();
37
- }, open: () => {
38
- const i = this.$selectBtn, r = this.$dropdown;
39
- !i || !r || (r.showPopover(), v(i, r, {
35
+ }, this.reposition = async () => {
36
+ const { x: t, y: e } = await v(this.$anchor, this.$popover, {
40
37
  placement: "bottom",
41
- middleware: [f(), _({ padding: 5 }), g(2)]
42
- }).then(({ x: n, y: a }) => {
43
- Object.assign(r.style, {
44
- left: `${String(n)}px`,
45
- top: `${String(Math.round(a - window.scrollY))}px`
46
- });
47
- }).catch((n) => {
48
- console.error(n);
49
- }));
50
- } }), this._handleDropdownToggle = (t) => {
38
+ middleware: [f(), _({ padding: 5 }), g(2)],
39
+ strategy: "fixed"
40
+ });
41
+ Object.assign(this.$popover.style, {
42
+ left: `${String(t)}px`,
43
+ top: `${String(e)}px`,
44
+ width: `${String(this.$anchor.offsetWidth)}px`
45
+ });
46
+ }, this._handleDropdownToggle = (t) => {
51
47
  t.stopPropagation(), this._expanded = !this._expanded;
52
48
  }, this._setValue = async () => new Promise((t) => {
53
49
  switch (!0) {
@@ -68,8 +64,8 @@ const c = class c extends b {
68
64
  });
69
65
  }), this._resetSelectedOptions = (t) => {
70
66
  const e = !t;
71
- this._optionsList.forEach((i) => {
72
- (e || i !== t) && i.removeAttribute("selected");
67
+ this._optionsList.forEach((l) => {
68
+ (e || l !== t) && l.removeAttribute("selected");
73
69
  });
74
70
  }, this._handleSlotChange = () => {
75
71
  this._collectSlotOptionTags(), this._validateInput();
@@ -93,8 +89,8 @@ const c = class c extends b {
93
89
  return this._selectedOptions.map((t) => t.textContent ?? "");
94
90
  }
95
91
  set value(t) {
96
- const e = t.split(",").map((i) => i.trim());
97
- this._selectedOptions = this._optionsList.filter((i) => e.includes(i.value.trim()));
92
+ const e = t.split(",").map((l) => l.trim());
93
+ this._selectedOptions = this._optionsList.filter((l) => e.includes(l.value.trim()));
98
94
  }
99
95
  get value() {
100
96
  return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
@@ -127,18 +123,16 @@ const c = class c extends b {
127
123
  var t;
128
124
  this.addEventListener("skf-select-option:select", this._handleOptionSelected), (t = this._internals.form) == null || t.addEventListener("reset", this._handleReset), this.onUpdateComplete(), this._validateInput();
129
125
  }
130
- updated(t) {
131
- if (t.has("_expanded")) {
132
- const e = !!t.get("_expanded") === this._expanded;
133
- if (this.emit("skf-select:dropdown", { detail: { expanded: this._expanded } }), e) return;
134
- this._expanded ? this._managePopover().open() : this._managePopover().close();
135
- }
126
+ handleExpandedChange() {
127
+ this._expanded ? (this.$popover.togglePopover(this._expanded), this.popoverController.start()) : (this.$popover.togglePopover(this._expanded), this.popoverController.stop().catch((t) => {
128
+ console.error(t);
129
+ })), this.emit("skf-select:dropdown", { detail: { expanded: this._expanded } });
136
130
  }
137
- attributeChangedCallback(t, e, i) {
138
- if (super.attributeChangedCallback(t, e, i), t === "custom-invalid")
139
- if (typeof i == "string") {
140
- const n = this.withFallback(i);
141
- this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, n), this.checkValidity();
131
+ attributeChangedCallback(t, e, l) {
132
+ if (super.attributeChangedCallback(t, e, l), t === "custom-invalid")
133
+ if (typeof l == "string") {
134
+ const r = this.withFallback(l);
135
+ this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, r), this.checkValidity();
142
136
  } else
143
137
  this.setValidity({}), this._validateInput();
144
138
  }
@@ -153,8 +147,8 @@ const c = class c extends b {
153
147
  e.selected && (this.selectedOptions = [...this.selectedOptions, e]);
154
148
  });
155
149
  else {
156
- const e = this._selectedOptions.length > 0, i = t.detail.value !== null;
157
- e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), i && (this.selectedOptions = [t.target]);
150
+ const e = this._selectedOptions.length > 0, l = t.detail.value !== null;
151
+ e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), l && (this.selectedOptions = [t.target]);
158
152
  }
159
153
  this._setValue();
160
154
  }
@@ -165,7 +159,7 @@ const c = class c extends b {
165
159
  /** @internal */
166
160
  /** Filter out elements other than skf-select-option and store in this._optionsList */
167
161
  _collectSlotOptionTags() {
168
- this._optionsList = y(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), w({
162
+ this._optionsList = O(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), w({
169
163
  assert: this._optionsList.length > 0,
170
164
  reason: "no-children",
171
165
  replaceStrings: [this.localName, "skf-select-option"]
@@ -174,29 +168,29 @@ const c = class c extends b {
174
168
  /** @internal */
175
169
  _validateInput() {
176
170
  this._invalid = !1;
177
- 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);
171
+ 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);
178
172
  if (this._internals.validity.customError) {
179
173
  this._invalid = !0;
180
174
  return;
181
175
  } else if (t) {
182
- const n = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
183
- this.setValidity({ valueMissing: !0 }, String(n)), this._pristine || (this._invalid = !0);
176
+ const r = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
177
+ this.setValidity({ valueMissing: !0 }, String(r)), this._pristine || (this._invalid = !0);
184
178
  } else if (e) {
185
- const n = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
186
- this.setValidity({ rangeUnderflow: !0 }, String(n)), this._pristine || (this._invalid = !0);
187
- } else if (i) {
188
- const n = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
189
- this.setValidity({ rangeOverflow: !0 }, String(n)), this._pristine || (this._invalid = !0);
179
+ const r = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
180
+ this.setValidity({ rangeUnderflow: !0 }, String(r)), this._pristine || (this._invalid = !0);
181
+ } else if (l) {
182
+ const r = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
183
+ this.setValidity({ rangeOverflow: !0 }, String(r)), this._pristine || (this._invalid = !0);
190
184
  } else
191
185
  this.setValidity({}), !this._pristine && this.showValid && this.setAttribute("valid", "true");
192
186
  }
193
187
  render() {
194
- return h`
188
+ return n`
195
189
  <div id="root">
196
190
  <label>
197
191
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
198
192
  ${this.label}
199
- ${this.required ? x(this.requiredLabel) : null}
193
+ ${this.required ? V(this.requiredLabel) : null}
200
194
  </div>
201
195
  <button
202
196
  ?disabled=${this.disabled}
@@ -211,7 +205,7 @@ const c = class c extends b {
211
205
  >
212
206
  <span
213
207
  id="selected-value"
214
- class=${S({ "selected-value": !0, "contains-meta-info": !this.value })}>
208
+ class=${E({ "selected-value": !0, "contains-meta-info": !this.value })}>
215
209
  ${this._computeVisibleValue()}
216
210
  </span>
217
211
  <skf-icon class="arrow" name="chevronDown"></skf-icon>
@@ -220,10 +214,10 @@ const c = class c extends b {
220
214
  <div aria-multiselectable=${m(this.multiple && !0)} id="select-dropdown" popover role="listbox">
221
215
  <slot @slotchange=${this._handleSlotChange}></slot>
222
216
  </div>
223
- ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? h`
217
+ ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? n`
224
218
  <div id="tags">
225
219
  ${this.selectedOptions.map(
226
- (t) => h`
220
+ (t) => n`
227
221
  <skf-tag
228
222
  style="${`view-transition-name: tag-${String(t.textContent).replace(/[^a-zA-Z]/g, "").toLowerCase()}`}"
229
223
  removable
@@ -236,12 +230,12 @@ const c = class c extends b {
236
230
  `
237
231
  )}
238
232
  </div>
239
- ` : V}
240
- ${this.hint && h`
233
+ ` : C}
234
+ ${this.hint && n`
241
235
  <skf-hint
242
236
  aria-live=${this._invalid ? "assertive" : "polite"}
243
237
  id="hint"
244
- severity=${m(O(this.severity, this._invalid))}
238
+ severity=${m(x(this.severity, this._invalid))}
245
239
  >
246
240
  ${this.customInvalid ? this.customInvalid : this.hint}
247
241
  </skf-hint>
@@ -251,77 +245,80 @@ const c = class c extends b {
251
245
  `;
252
246
  }
253
247
  };
254
- c.styles = [$, P];
255
- let s = c;
256
- l([
248
+ c.styles = [S, P];
249
+ let i = c;
250
+ s([
257
251
  o({ type: String, reflect: !0, attribute: "button-label" })
258
- ], s.prototype, "buttonLabel", 2);
259
- l([
252
+ ], i.prototype, "buttonLabel", 2);
253
+ s([
260
254
  o({ attribute: "custom-invalid" })
261
- ], s.prototype, "customInvalid", 2);
262
- l([
255
+ ], i.prototype, "customInvalid", 2);
256
+ s([
263
257
  o({ type: Boolean, attribute: "hide-label" })
264
- ], s.prototype, "hideLabel", 2);
265
- l([
258
+ ], i.prototype, "hideLabel", 2);
259
+ s([
266
260
  o({ type: Boolean, reflect: !0, attribute: "hide-tags" })
267
- ], s.prototype, "hideTags", 2);
268
- l([
261
+ ], i.prototype, "hideTags", 2);
262
+ s([
269
263
  o()
270
- ], s.prototype, "hint", 2);
271
- l([
264
+ ], i.prototype, "hint", 2);
265
+ s([
272
266
  o({ type: Array, attribute: !1 })
273
- ], s.prototype, "selectedValues", 1);
274
- l([
267
+ ], i.prototype, "selectedValues", 1);
268
+ s([
275
269
  o({ type: Array, attribute: !1 })
276
- ], s.prototype, "selectedOptionsText", 1);
277
- l([
270
+ ], i.prototype, "selectedOptionsText", 1);
271
+ s([
278
272
  o({ reflect: !0 })
279
- ], s.prototype, "label", 2);
280
- l([
273
+ ], i.prototype, "label", 2);
274
+ s([
281
275
  o({ type: Number })
282
- ], s.prototype, "max", 2);
283
- l([
276
+ ], i.prototype, "max", 2);
277
+ s([
284
278
  o({ type: Number })
285
- ], s.prototype, "min", 2);
286
- l([
279
+ ], i.prototype, "min", 2);
280
+ s([
287
281
  o({ type: Boolean, reflect: !0 })
288
- ], s.prototype, "multiple", 2);
289
- l([
282
+ ], i.prototype, "multiple", 2);
283
+ s([
290
284
  o()
291
- ], s.prototype, "name", 2);
292
- l([
285
+ ], i.prototype, "name", 2);
286
+ s([
293
287
  o({ attribute: "required-label" })
294
- ], s.prototype, "requiredLabel", 2);
295
- l([
288
+ ], i.prototype, "requiredLabel", 2);
289
+ s([
296
290
  o()
297
- ], s.prototype, "severity", 2);
298
- l([
291
+ ], i.prototype, "severity", 2);
292
+ s([
299
293
  o({ type: Boolean, attribute: "show-valid" })
300
- ], s.prototype, "showValid", 2);
301
- l([
294
+ ], i.prototype, "showValid", 2);
295
+ s([
302
296
  o({ reflect: !0 })
303
- ], s.prototype, "size", 2);
304
- l([
305
- d()
306
- ], s.prototype, "value", 1);
307
- l([
308
- d()
309
- ], s.prototype, "selectedOptions", 1);
310
- l([
311
- d()
312
- ], s.prototype, "_expanded", 2);
313
- l([
314
- d()
315
- ], s.prototype, "_invalid", 2);
316
- l([
297
+ ], i.prototype, "size", 2);
298
+ s([
299
+ h()
300
+ ], i.prototype, "value", 1);
301
+ s([
302
+ h()
303
+ ], i.prototype, "selectedOptions", 1);
304
+ s([
305
+ h()
306
+ ], i.prototype, "_expanded", 2);
307
+ s([
308
+ h()
309
+ ], i.prototype, "_invalid", 2);
310
+ s([
317
311
  p("#select-button")
318
- ], s.prototype, "$selectBtn", 2);
319
- l([
312
+ ], i.prototype, "$anchor", 2);
313
+ s([
320
314
  p("#selected-value")
321
- ], s.prototype, "$selectedValue", 2);
322
- l([
315
+ ], i.prototype, "$selectedValue", 2);
316
+ s([
323
317
  p("#select-dropdown")
324
- ], s.prototype, "$dropdown", 2);
318
+ ], i.prototype, "$popover", 2);
319
+ s([
320
+ $("_expanded", { afterUpdate: !0 })
321
+ ], i.prototype, "handleExpandedChange", 1);
325
322
  export {
326
- s as SkfSelect
323
+ i as SkfSelect
327
324
  };
@@ -2,31 +2,6 @@ import type { SkfSelectOption } from '../select-option/select-option.component.j
2
2
  import type { ReactiveController } from 'lit';
3
3
  import type { SkfSelect } from './select.component.js';
4
4
  type ControllerHost = SkfSelect;
5
- export declare class ScrollController implements ReactiveController {
6
- _scrollHandler?: () => void;
7
- host?: ControllerHost;
8
- localExpanded: boolean;
9
- constructor(host: ControllerHost);
10
- hostDisconnected(): void;
11
- hostUpdated(): void;
12
- enableScrollDetection(): void;
13
- disableScrollDetection(): void;
14
- /** @internal */
15
- _onScrollOutOfView(): void;
16
- /** @internal */
17
- _onScrollIntoView(): void;
18
- }
19
- export declare class ResizeController implements ReactiveController {
20
- host: ControllerHost;
21
- _resizeObserver?: ResizeObserver;
22
- constructor(host: ControllerHost);
23
- hostConnected(): void;
24
- hostDisconnected(): void;
25
- enableResizeObserver(): void;
26
- disableResizeObserver(): void;
27
- /** @internal */
28
- _onResize: () => void;
29
- }
30
5
  export declare class GlobalClickController implements ReactiveController {
31
6
  host: ControllerHost;
32
7
  constructor(host: ControllerHost);