@skf-design-system/ui-components 1.0.2-beta.5 → 1.0.2-beta.6
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.
- package/custom-elements.json +25490 -0
- package/dist/components/accordion/accordion.component.d.ts +1 -1
- package/dist/components/accordion/accordion.component.js +2 -2
- package/dist/components/datepicker/datepicker.component.js +1 -0
- package/dist/components/divider/divider.component.d.ts +3 -0
- package/dist/components/divider/divider.component.js +43 -22
- package/dist/components/divider/divider.styles.js +8 -8
- package/dist/components/drawer/drawer.component.d.ts +8 -2
- package/dist/components/drawer/drawer.component.js +74 -54
- package/dist/components/drawer/drawer.styles.js +47 -40
- package/dist/components/input/input.component.js +1 -0
- package/dist/components/link/link.component.d.ts +15 -18
- package/dist/components/link/link.component.js +99 -108
- package/dist/components/link/link.styles.js +45 -45
- package/dist/components/loader/loader.component.d.ts +5 -1
- package/dist/components/loader/loader.component.js +43 -29
- package/dist/components/loader/loader.styles.js +5 -9
- package/dist/components/menu/menu-item.component.d.ts +1 -1
- package/dist/components/menu/menu-item.component.js +8 -8
- package/dist/components/menu/menu-item.styles.js +8 -5
- package/dist/components/menu/menu.component.d.ts +1 -1
- package/dist/components/menu/menu.component.js +8 -8
- package/dist/components/nav/nav-item.component.d.ts +4 -0
- package/dist/components/nav/nav-item.component.js +44 -25
- package/dist/components/nav/nav-item.styles.js +29 -25
- package/dist/components/nav/nav.component.d.ts +6 -0
- package/dist/components/nav/nav.component.js +42 -21
- package/dist/components/nav/nav.styles.js +15 -9
- package/dist/components/popover/popover.component.d.ts +4 -0
- package/dist/components/popover/popover.component.js +30 -22
- package/dist/components/progress/progress.component.d.ts +2 -0
- package/dist/components/progress/progress.component.js +38 -29
- package/dist/components/progress/progress.styles.js +3 -3
- package/dist/components/select/select-option-group.component.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +37 -18
- package/dist/components/select/select-option-group.style.js +12 -6
- package/dist/components/select/select-option.component.d.ts +6 -1
- package/dist/components/select/select-option.component.js +73 -53
- package/dist/components/select/select-option.styles.js +43 -31
- package/dist/components/select/select.component.d.ts +5 -1
- package/dist/components/select/select.component.js +47 -29
- package/dist/components/select/select.controllers.js +2 -1
- package/dist/components/select/select.styles.js +8 -2
- package/dist/components/stepper/stepper-item.component.d.ts +1 -1
- package/dist/components/stepper/stepper-item.component.js +26 -23
- package/dist/components/tabs/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +19 -16
- package/dist/components/tabs/tab.component.d.ts +1 -1
- package/dist/components/tabs/tab.component.js +17 -14
- package/dist/components/textarea/textarea.component.js +5 -4
- package/dist/components/toast/toast-item.styles.js +13 -10
- package/dist/components/toast/toast.component.js +9 -9
- package/dist/components/toast/toast.singleton.d.ts +1 -1
- package/dist/components/toast/toast.singleton.js +18 -18
- package/dist/components/tooltip/tooltip.component.d.ts +1 -0
- package/dist/components/tooltip/tooltip.component.js +10 -7
- package/dist/custom-elements.json +803 -704
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -20
- package/dist/internal/base-classes/popover/popover.base.d.ts +3 -3
- package/dist/internal/base-classes/popover/popover.base.js +27 -26
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- package/dist/internal/components/hint/hint.component.d.ts +4 -0
- package/dist/internal/components/hint/hint.component.js +47 -20
- package/dist/internal/components/hint/hint.styles.js +29 -25
- package/dist/internal/types.d.ts +4 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +184 -81
- package/dist/types/vue/index.d.ts +77 -80
- package/dist/vscode.html-custom-data.json +93 -97
- package/dist/web-types.json +210 -215
- package/package.json +28 -28
@@ -1,22 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { componentStyles as f } from "../../styles/component.styles.js";
|
4
|
-
import { LitElement as m, html as d } from "lit";
|
5
|
-
import { property as l, queryAssignedNodes as _ } from "lit/decorators.js";
|
6
|
-
import { ifDefined as p } from "lit/directives/if-defined.js";
|
7
|
-
import { styles as y } from "./select-option.styles.js";
|
8
|
-
var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (h, t, s, i) => {
|
9
|
-
for (var r = i > 1 ? void 0 : i ? b(t, s) : t, a = h.length - 1, c; a >= 0; a--)
|
10
|
-
(c = h[a]) && (r = (i ? c(t, s, r) : c(r)) || r);
|
11
|
-
return i && r && v(t, s, r), r;
|
1
|
+
var y = (e) => {
|
2
|
+
throw TypeError(e);
|
12
3
|
};
|
13
|
-
|
4
|
+
var b = (e, s, t) => s.has(e) || y("Cannot " + t);
|
5
|
+
var u = (e, s, t) => (b(e, s, "read from private field"), t ? t.call(e) : s.get(e)), f = (e, s, t) => s.has(e) ? y("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), m = (e, s, t, i) => (b(e, s, "write to private field"), i ? i.call(e, t) : s.set(e, t), t);
|
6
|
+
import "../icon/icon.js";
|
7
|
+
import { SkfElement as C } from "../../internal/components/skf-element.js";
|
8
|
+
import { stateMap as g } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as x } from "../../internal/helpers/watch.js";
|
10
|
+
import { componentStyles as N } from "../../styles/component.styles.js";
|
11
|
+
import { LitElement as T, html as _ } from "lit";
|
12
|
+
import { property as n, state as $, queryAssignedNodes as k } from "lit/decorators.js";
|
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) => {
|
16
|
+
for (var r = i > 1 ? void 0 : i ? w(s, t) : s, d = e.length - 1, p; d >= 0; d--)
|
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;
|
20
|
+
const c = class c extends C {
|
14
21
|
constructor() {
|
15
|
-
super()
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
super();
|
23
|
+
f(this, a);
|
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) => {
|
26
|
+
t.stopPropagation(), this.selected = !this.selected;
|
27
|
+
}, this._shortcutUpdate = !1;
|
20
28
|
}
|
21
29
|
set text(t) {
|
22
30
|
this.textContent = t.trim();
|
@@ -32,14 +40,20 @@ const n = class n extends u {
|
|
32
40
|
var t;
|
33
41
|
return !this._value && this._slotContainsOnlyText ? this._getSlottedContent().trim() : ((t = this._value) == null ? void 0 : t.trim()) ?? this.text;
|
34
42
|
}
|
43
|
+
connectedCallback() {
|
44
|
+
super.connectedCallback(), this.role = "option";
|
45
|
+
}
|
35
46
|
updated(t) {
|
36
|
-
super.updated(t), t.has("selected") && !this._shortcutUpdate && this.emit("skf-select-option-select", {
|
47
|
+
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", {
|
37
48
|
detail: {
|
38
49
|
value: this.selected ? this.value : null,
|
39
50
|
option: this
|
40
51
|
}
|
41
52
|
});
|
42
53
|
}
|
54
|
+
_handleStateChange() {
|
55
|
+
g(u(this, h), "small").set(this.small);
|
56
|
+
}
|
43
57
|
/**
|
44
58
|
* @internal
|
45
59
|
* This internal setter is to change selected state without emitting events triggering other side effects,
|
@@ -60,14 +74,14 @@ const n = class n extends u {
|
|
60
74
|
/** @internal */
|
61
75
|
get _slotContainsOnlyText() {
|
62
76
|
return this._assignedNodes ? [...this._assignedNodes].every(
|
63
|
-
(
|
64
|
-
var
|
65
|
-
return
|
77
|
+
(i) => {
|
78
|
+
var r;
|
79
|
+
return i.nodeType === Node.TEXT_NODE && ((r = i.textContent) == null ? void 0 : r.trim()) !== "";
|
66
80
|
}
|
67
81
|
) : "";
|
68
82
|
}
|
69
83
|
render() {
|
70
|
-
return
|
84
|
+
return _`
|
71
85
|
<button
|
72
86
|
?disabled=${this.disabled}
|
73
87
|
@click=${this._handleClick}
|
@@ -78,46 +92,52 @@ const n = class n extends u {
|
|
78
92
|
<slot>${this.text}</slot>
|
79
93
|
<div id="adornments">
|
80
94
|
<slot name="icon">
|
81
|
-
${this.icon &&
|
95
|
+
${this.icon && _`
|
82
96
|
<skf-icon
|
83
|
-
color=${
|
84
|
-
data-color=${
|
97
|
+
color=${v(this.iconColor)}
|
98
|
+
data-color=${v((this.disabled || !this.iconColor) && "custom")}
|
85
99
|
name=${this.icon}
|
86
100
|
></skf-icon>
|
87
101
|
`}
|
88
102
|
</slot>
|
89
|
-
${this.shortLabel &&
|
103
|
+
${this.shortLabel && _`<div id="short-label">${this.shortLabel}</div>`}
|
90
104
|
</div>
|
91
105
|
</button>
|
92
106
|
`;
|
93
107
|
}
|
94
108
|
};
|
95
|
-
|
96
|
-
let
|
97
|
-
|
98
|
-
|
99
|
-
],
|
100
|
-
|
101
|
-
|
102
|
-
],
|
103
|
-
|
104
|
-
|
105
|
-
],
|
106
|
-
|
107
|
-
|
108
|
-
],
|
109
|
-
|
110
|
-
|
111
|
-
],
|
112
|
-
|
113
|
-
|
114
|
-
],
|
115
|
-
|
116
|
-
|
117
|
-
],
|
118
|
-
|
119
|
-
|
120
|
-
],
|
109
|
+
a = new WeakMap(), h = new WeakMap(), c.styles = [N, O], c.shadowRootOptions = { ...T.shadowRootOptions, delegatesFocus: !0 };
|
110
|
+
let o = c;
|
111
|
+
l([
|
112
|
+
n({ type: Boolean, reflect: !0 })
|
113
|
+
], o.prototype, "disabled", 2);
|
114
|
+
l([
|
115
|
+
n({ reflect: !0 })
|
116
|
+
], o.prototype, "icon", 2);
|
117
|
+
l([
|
118
|
+
n({ reflect: !0, attribute: "icon-color" })
|
119
|
+
], o.prototype, "iconColor", 2);
|
120
|
+
l([
|
121
|
+
n({ type: Boolean, reflect: !0 })
|
122
|
+
], o.prototype, "selected", 2);
|
123
|
+
l([
|
124
|
+
n({ reflect: !0, attribute: "short-label" })
|
125
|
+
], o.prototype, "shortLabel", 2);
|
126
|
+
l([
|
127
|
+
n({ attribute: !1 })
|
128
|
+
], o.prototype, "text", 1);
|
129
|
+
l([
|
130
|
+
n({ reflect: !0 })
|
131
|
+
], o.prototype, "value", 1);
|
132
|
+
l([
|
133
|
+
$()
|
134
|
+
], o.prototype, "small", 2);
|
135
|
+
l([
|
136
|
+
k({ flatten: !0 })
|
137
|
+
], o.prototype, "_assignedNodes", 2);
|
138
|
+
l([
|
139
|
+
x("small")
|
140
|
+
], o.prototype, "_handleStateChange", 1);
|
121
141
|
export {
|
122
|
-
|
142
|
+
o as SkfSelectOption
|
123
143
|
};
|
@@ -1,50 +1,62 @@
|
|
1
1
|
import { css as e } from "lit";
|
2
2
|
const o = e`
|
3
3
|
@layer components {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
@layer base {
|
5
|
+
button {
|
6
|
+
--_skf-select-option-bg: var(--skf-interactive-bg-color-secondary);
|
7
|
+
--_skf-select-option-color: inherit;
|
8
|
+
--_skf-select-option-height: var(--skf-size-44);
|
9
|
+
|
10
|
+
align-items: center;
|
11
|
+
background-color: var(--_skf-select-option-bg);
|
12
|
+
block-size: var(--_skf-select-option-height);
|
13
|
+
color: var(--_skf-select-option-color);
|
14
|
+
display: flex;
|
15
|
+
gap: var(--skf-spacing-50);
|
16
|
+
padding-inline: var(--skf-spacing-50);
|
17
|
+
width: 100%;
|
16
18
|
}
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
+
#icon-check {
|
21
|
+
opacity: 0;
|
22
|
+
|
23
|
+
:host([selected]) & {
|
24
|
+
opacity: 1;
|
25
|
+
}
|
20
26
|
}
|
21
27
|
|
22
|
-
|
23
|
-
|
28
|
+
#adornments {
|
29
|
+
align-items: inherit;
|
30
|
+
display: inherit;
|
31
|
+
gap: inherit;
|
32
|
+
margin-inline-start: auto;
|
24
33
|
}
|
25
34
|
|
26
|
-
|
27
|
-
|
35
|
+
#short-label {
|
36
|
+
color: var(--skf-text-color-tertiary);
|
28
37
|
}
|
29
38
|
}
|
30
39
|
|
31
|
-
|
32
|
-
|
40
|
+
@layer states {
|
41
|
+
button {
|
42
|
+
&:disabled {
|
43
|
+
--_skf-select-option-color: var(--skf-interactive-text-color-disabled);
|
44
|
+
}
|
33
45
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
46
|
+
&:is(:hover, :focus):not(:disabled) {
|
47
|
+
--_skf-select-option-bg: var(--skf-interactive-bg-color-secondary-hover);
|
48
|
+
}
|
38
49
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
margin-inline-start: auto;
|
50
|
+
&:active:not(:disabled) {
|
51
|
+
--_skf-select-option-bg: var(--skf-interactive-bg-color-secondary-active);
|
52
|
+
}
|
53
|
+
}
|
44
54
|
}
|
45
55
|
|
46
|
-
|
47
|
-
|
56
|
+
@layer mods {
|
57
|
+
:host(:state(small)) button {
|
58
|
+
--_skf-select-option-height: var(--skf-size-32);
|
59
|
+
}
|
48
60
|
}
|
49
61
|
}
|
50
62
|
`;
|
@@ -1,10 +1,11 @@
|
|
1
|
+
import { SkfSelectOptionGroup } from '../select/select-option-group.component.js';
|
1
2
|
import '../tag/tag.js';
|
2
3
|
import { FormBase } from '../../internal/components/formBase.js';
|
3
4
|
import '../../internal/components/hint/hint.js';
|
4
5
|
import { PopoverController } from '../../internal/controllers/popover.controller.js';
|
5
6
|
import type { FormFieldSeverity } from '../../internal/types.js';
|
6
7
|
import { type CSSResultGroup } from 'lit';
|
7
|
-
import
|
8
|
+
import { SkfSelectOption, type SelectOptionEvent } from './select-option.component.js';
|
8
9
|
import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController } from './select.controllers.js';
|
9
10
|
/**
|
10
11
|
* TODO: abstract the popover logic to a separate component/helper/partial, and use it in both select and in input[datalist], combobox etc
|
@@ -92,6 +93,8 @@ export declare class SkfSelect extends FormBase {
|
|
92
93
|
/** @internal */
|
93
94
|
$popover: HTMLDivElement;
|
94
95
|
/** @internal */
|
96
|
+
_slottedItems: SkfSelectOption[] | SkfSelectOptionGroup[];
|
97
|
+
/** @internal */
|
95
98
|
protected globalClickController: GlobalClickController;
|
96
99
|
/** @internal */
|
97
100
|
protected keyboardNavController: KeyboardNavigationController;
|
@@ -102,6 +105,7 @@ export declare class SkfSelect extends FormBase {
|
|
102
105
|
constructor();
|
103
106
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
104
107
|
firstUpdated(): void;
|
108
|
+
_handleSizeUpdate(): void;
|
105
109
|
handleExpandedChange(): void;
|
106
110
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
107
111
|
disconnectedCallback(): void;
|
@@ -1,28 +1,30 @@
|
|
1
|
+
import { SkfSelectOptionGroup as v } from "./select-option-group.component.js";
|
1
2
|
import "../tag/tag.js";
|
2
|
-
import { computePosition as
|
3
|
-
import { FormBase as
|
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";
|
4
5
|
import "../../internal/components/hint/hint.js";
|
5
|
-
import { PopoverController as
|
6
|
-
import { findMatchingTags as
|
7
|
-
import { hintSeverity as
|
8
|
-
import { raiseError as
|
9
|
-
import { watch as
|
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";
|
10
11
|
import { Asterisk as V } from "../../internal/templates/asterisk.js";
|
11
|
-
import { componentStyles as
|
12
|
-
import { nothing as
|
13
|
-
import { property as o, state as h, query as p } from "lit/decorators.js";
|
14
|
-
import { classMap as
|
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";
|
15
16
|
import { ifDefined as m } from "lit/directives/if-defined.js";
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
|
19
|
-
|
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--)
|
20
22
|
(d = u[a]) && (r = (l ? d(t, e, r) : d(r)) || r);
|
21
|
-
return l && r &&
|
23
|
+
return l && r && U(t, e, r), r;
|
22
24
|
};
|
23
|
-
const c = class c extends
|
25
|
+
const c = class c extends O {
|
24
26
|
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
|
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) => {
|
26
28
|
this._pristine = !1;
|
27
29
|
const e = this._selectedOptions.length > 0;
|
28
30
|
this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
|
@@ -33,9 +35,9 @@ const c = class c extends b {
|
|
33
35
|
this.$popover.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
|
34
36
|
}, 50);
|
35
37
|
}, this.reposition = async () => {
|
36
|
-
const { x: t, y: e } = await
|
38
|
+
const { x: t, y: e } = await _(this.$anchor, this.$popover, {
|
37
39
|
placement: "bottom",
|
38
|
-
middleware: [
|
40
|
+
middleware: [g(), b(), y(2)],
|
39
41
|
strategy: "fixed"
|
40
42
|
});
|
41
43
|
Object.assign(this.$popover.style, {
|
@@ -68,7 +70,7 @@ const c = class c extends b {
|
|
68
70
|
(e || l !== t) && l.removeAttribute("selected");
|
69
71
|
});
|
70
72
|
}, this._handleSlotChange = () => {
|
71
|
-
this._collectSlotOptionTags(), this._validateInput();
|
73
|
+
this._handleSizeUpdate(), this._collectSlotOptionTags(), this._validateInput();
|
72
74
|
}, this._computeVisibleValue = () => {
|
73
75
|
var t, e;
|
74
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;
|
@@ -89,8 +91,12 @@ const c = class c extends b {
|
|
89
91
|
return this._selectedOptions.map((t) => t.textContent ?? "");
|
90
92
|
}
|
91
93
|
set value(t) {
|
92
|
-
|
93
|
-
this.
|
94
|
+
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();
|
94
100
|
}
|
95
101
|
get value() {
|
96
102
|
return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
|
@@ -123,6 +129,11 @@ const c = class c extends b {
|
|
123
129
|
var t;
|
124
130
|
this.addEventListener("skf-select-option-select", this._handleOptionSelected), (t = this._internals.form) == null || t.addEventListener("reset", this._handleReset), this.onUpdateComplete(), this._validateInput();
|
125
131
|
}
|
132
|
+
_handleSizeUpdate() {
|
133
|
+
this._slottedItems.forEach((t) => {
|
134
|
+
(t instanceof A || t instanceof v) && (t.small = this.size === "sm");
|
135
|
+
});
|
136
|
+
}
|
126
137
|
handleExpandedChange() {
|
127
138
|
this._expanded ? (this.$popover.togglePopover(this._expanded), this.popoverController.start()) : (this.$popover.togglePopover(this._expanded), this.popoverController.stop().catch((t) => {
|
128
139
|
console.error(t);
|
@@ -159,7 +170,7 @@ const c = class c extends b {
|
|
159
170
|
/** @internal */
|
160
171
|
/** Filter out elements other than skf-select-option and store in this._optionsList */
|
161
172
|
_collectSlotOptionTags() {
|
162
|
-
this._optionsList =
|
173
|
+
this._optionsList = w(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), $({
|
163
174
|
assert: this._optionsList.length > 0,
|
164
175
|
reason: "no-children",
|
165
176
|
replaceStrings: [this.localName, "skf-select-option"]
|
@@ -204,7 +215,7 @@ const c = class c extends b {
|
|
204
215
|
>
|
205
216
|
<span
|
206
217
|
id="selected-value"
|
207
|
-
class=${
|
218
|
+
class=${k({ "selected-value": !0, "contains-meta-info": !this.value })}>
|
208
219
|
${this._computeVisibleValue()}
|
209
220
|
</span>
|
210
221
|
<skf-icon class="arrow" data-color="custom" name="chevronDown"></skf-icon>
|
@@ -229,12 +240,13 @@ const c = class c extends b {
|
|
229
240
|
`
|
230
241
|
)}
|
231
242
|
</div>
|
232
|
-
` :
|
243
|
+
` : E}
|
233
244
|
${this.hint && n`
|
234
245
|
<skf-hint
|
246
|
+
?disabled=${this.disabled}
|
235
247
|
aria-live=${this._invalid ? "assertive" : "polite"}
|
236
248
|
id="hint"
|
237
|
-
severity=${m(
|
249
|
+
severity=${m(S(this._invalid, this.severity))}
|
238
250
|
>
|
239
251
|
${this.customInvalid ?? this.hint}
|
240
252
|
</skf-hint>
|
@@ -244,7 +256,7 @@ const c = class c extends b {
|
|
244
256
|
`;
|
245
257
|
}
|
246
258
|
};
|
247
|
-
c.styles = [
|
259
|
+
c.styles = [C, F];
|
248
260
|
let i = c;
|
249
261
|
s([
|
250
262
|
o({ type: String, reflect: !0, attribute: "button-label" })
|
@@ -316,7 +328,13 @@ s([
|
|
316
328
|
p("#select-dropdown")
|
317
329
|
], i.prototype, "$popover", 2);
|
318
330
|
s([
|
319
|
-
|
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 })
|
320
338
|
], i.prototype, "handleExpandedChange", 1);
|
321
339
|
export {
|
322
340
|
i as SkfSelect
|
@@ -104,7 +104,8 @@ class b {
|
|
104
104
|
reason: "attribute-mismatch",
|
105
105
|
replaceStrings: [t, "min or max", "together with multiple"]
|
106
106
|
}), a({
|
107
|
-
|
107
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
108
|
+
assert: this.host.hideTags && this.host.multiple || !this.host.hideTags,
|
108
109
|
reason: "attribute-mismatch",
|
109
110
|
replaceStrings: [t, "hide-tags", "together with multiple"]
|
110
111
|
});
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { visuallyHidden as r } from "../../styles/util.styles.js";
|
2
|
-
import { css as
|
2
|
+
import { css as e } from "lit";
|
3
3
|
const t = [
|
4
4
|
r,
|
5
|
-
|
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
|
-
|
38
|
+
connectedCallback(): void;
|
39
39
|
protected firstUpdated(): void;
|
40
40
|
/** @internal */
|
41
41
|
_handleState(): void;
|
@@ -2,30 +2,30 @@ var v = (e) => {
|
|
2
2
|
throw TypeError(e);
|
3
3
|
};
|
4
4
|
var u = (e, i, t) => i.has(e) || v("Cannot " + t);
|
5
|
-
var
|
5
|
+
var m = (e, i, t) => (u(e, i, "read from private field"), t ? t.call(e) : i.get(e)), _ = (e, i, t) => i.has(e) ? v("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), r = (e, i, t, a) => (u(e, i, "write to private field"), a ? a.call(e, t) : i.set(e, t), t);
|
6
6
|
import "../icon/icon.js";
|
7
|
-
import { SkfElement as
|
8
|
-
import { watch as
|
7
|
+
import { SkfElement as C } from "../../internal/components/skf-element.js";
|
8
|
+
import { watch as g } from "../../internal/helpers/watch.js";
|
9
9
|
import { componentStyles as x } from "../../styles/component.styles.js";
|
10
10
|
import "lit";
|
11
|
-
import { property as b, state as
|
11
|
+
import { property as b, state as n } from "lit/decorators.js";
|
12
12
|
import { classMap as $ } from "lit/directives/class-map.js";
|
13
13
|
import { ifDefined as w } from "lit/directives/if-defined.js";
|
14
14
|
import { literal as S, html as y } from "lit/static-html.js";
|
15
15
|
import { styles as U } from "./stepper-item.styles.js";
|
16
16
|
var I = Object.defineProperty, O = Object.getOwnPropertyDescriptor, o = (e, i, t, a) => {
|
17
|
-
for (var p = a > 1 ? void 0 : a ? O(i, t) : i,
|
18
|
-
(
|
17
|
+
for (var p = a > 1 ? void 0 : a ? O(i, t) : i, d = e.length - 1, h; d >= 0; d--)
|
18
|
+
(h = e[d]) && (p = (a ? h(i, t, p) : h(p)) || p);
|
19
19
|
return a && p && I(i, t, p), p;
|
20
|
-
}, l,
|
21
|
-
const f = class f extends
|
20
|
+
}, l, c;
|
21
|
+
const f = class f extends C {
|
22
22
|
constructor() {
|
23
|
-
super();
|
23
|
+
super(...arguments);
|
24
24
|
_(this, l);
|
25
|
-
_(this,
|
26
|
-
r(this, l, !1), r(this,
|
25
|
+
_(this, c);
|
26
|
+
r(this, l, !1), r(this, c, !1), this.completed = !1, this._index = 0, this._linear = !1, this._handleClick = () => {
|
27
27
|
this._linear || (this.state = "active");
|
28
|
-
}
|
28
|
+
};
|
29
29
|
}
|
30
30
|
set _setInternalState(t) {
|
31
31
|
r(this, l, !0), this._uiState = t, t === "active" || t === "activeCompleted" ? this.state = t === "active" ? "active" : "completed" : this.state = void 0, setTimeout(() => {
|
@@ -35,6 +35,9 @@ const f = class f extends g {
|
|
35
35
|
get _setInternalState() {
|
36
36
|
return this.state;
|
37
37
|
}
|
38
|
+
connectedCallback() {
|
39
|
+
super.connectedCallback(), this.role = "listitem";
|
40
|
+
}
|
38
41
|
firstUpdated() {
|
39
42
|
this._handleState();
|
40
43
|
}
|
@@ -44,20 +47,20 @@ const f = class f extends g {
|
|
44
47
|
this._setInternalState = "activeCompleted";
|
45
48
|
return;
|
46
49
|
}
|
47
|
-
if (
|
50
|
+
if (m(this, l)) {
|
48
51
|
r(this, l, !1);
|
49
52
|
return;
|
50
53
|
}
|
51
|
-
r(this,
|
54
|
+
r(this, c, ["active", "completed"].includes(String(this.state)) && !["active", "activeCompleted"].includes(String(this._uiState))), this._emitUpdate();
|
52
55
|
}
|
53
56
|
/** @internal */
|
54
57
|
_emitUpdate() {
|
55
58
|
this.emit("skf-stepper-item-select", {
|
56
59
|
detail: {
|
57
60
|
item: this,
|
58
|
-
triggerActiveIndexUpdate:
|
61
|
+
triggerActiveIndexUpdate: m(this, c)
|
59
62
|
}
|
60
|
-
}), r(this,
|
63
|
+
}), r(this, c, !1);
|
61
64
|
}
|
62
65
|
render() {
|
63
66
|
const t = this._linear ? S`div` : S`button`;
|
@@ -82,7 +85,7 @@ const f = class f extends g {
|
|
82
85
|
`;
|
83
86
|
}
|
84
87
|
};
|
85
|
-
l = new WeakMap(),
|
88
|
+
l = new WeakMap(), c = new WeakMap(), f.styles = [x, U];
|
86
89
|
let s = f;
|
87
90
|
o([
|
88
91
|
b({ reflect: !0 })
|
@@ -91,22 +94,22 @@ o([
|
|
91
94
|
b({ type: Boolean })
|
92
95
|
], s.prototype, "completed", 2);
|
93
96
|
o([
|
94
|
-
|
97
|
+
n()
|
95
98
|
], s.prototype, "_disabled", 2);
|
96
99
|
o([
|
97
|
-
|
100
|
+
n()
|
98
101
|
], s.prototype, "_index", 2);
|
99
102
|
o([
|
100
|
-
|
103
|
+
n()
|
101
104
|
], s.prototype, "_linear", 2);
|
102
105
|
o([
|
103
|
-
|
106
|
+
n()
|
104
107
|
], s.prototype, "_uiState", 2);
|
105
108
|
o([
|
106
|
-
|
109
|
+
n()
|
107
110
|
], s.prototype, "_setInternalState", 1);
|
108
111
|
o([
|
109
|
-
|
112
|
+
g("state")
|
110
113
|
], s.prototype, "_handleState", 1);
|
111
114
|
export {
|
112
115
|
s as SkfStepperItem
|
@@ -12,7 +12,7 @@ export declare class SkfTabPanel extends SkfElement {
|
|
12
12
|
/** The tab panel's name. */
|
13
13
|
name: string;
|
14
14
|
active: boolean;
|
15
|
-
|
15
|
+
connectedCallback(): void;
|
16
16
|
/** @internal */
|
17
17
|
handleActiveChanged(): void;
|
18
18
|
render(): import("lit").TemplateResult<1>;
|