@skf-design-system/ui-components 1.0.2-beta.10 → 1.0.2-beta.12
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/dist/components/datepicker/datepicker-calendar.component.d.ts +0 -3
- package/dist/components/datepicker/datepicker-calendar.component.js +32 -35
- package/dist/components/datepicker/datepicker-popup.component.js +12 -11
- package/dist/components/dialog/dialog.component.js +2 -2
- package/dist/components/input/input.component.d.ts +4 -0
- package/dist/components/input/input.component.js +47 -35
- package/dist/components/link/link.component.d.ts +1 -0
- package/dist/components/link/link.component.js +49 -43
- package/dist/components/link/link.styles.js +0 -4
- package/dist/components/select/select.component.d.ts +6 -1
- package/dist/components/select/select.component.js +83 -69
- package/dist/custom-elements.json +78 -31
- package/dist/internal/base-classes/popover/popover.base.js +4 -4
- package/dist/types/jsx/custom-element-jsx.d.ts +18 -4
- package/dist/types/vue/index.d.ts +4 -2
- package/dist/vscode.html-custom-data.json +2 -5
- package/dist/web-types.json +11 -11
- package/package.json +2 -1
@@ -1,34 +1,34 @@
|
|
1
|
-
var
|
1
|
+
var g = (e) => {
|
2
2
|
throw TypeError(e);
|
3
3
|
};
|
4
|
-
var
|
5
|
-
var
|
4
|
+
var _ = (e, i, t) => i.has(e) || g("Cannot " + t);
|
5
|
+
var c = (e, i, t) => (_(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? g("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), y = (e, i, t, h) => (_(e, i, "write to private field"), h ? h.call(e, t) : i.set(e, t), t);
|
6
6
|
import "../icon/icon.js";
|
7
|
-
import { SkfElement as
|
7
|
+
import { SkfElement as w } from "../../internal/components/skf-element.js";
|
8
8
|
import { stateMap as k } from "../../internal/helpers/stateMap.js";
|
9
|
-
import { watch as
|
9
|
+
import { watch as b } from "../../internal/helpers/watch.js";
|
10
10
|
import { componentStyles as S } from "../../styles/component.styles.js";
|
11
|
-
import { nothing as
|
12
|
-
import { property as
|
13
|
-
import { ifDefined as
|
14
|
-
import { html as
|
15
|
-
import { styles as
|
16
|
-
var
|
17
|
-
for (var
|
18
|
-
(
|
19
|
-
return
|
11
|
+
import { nothing as m } from "lit";
|
12
|
+
import { property as s } from "lit/decorators.js";
|
13
|
+
import { ifDefined as D } from "lit/directives/if-defined.js";
|
14
|
+
import { html as v } from "lit/static-html.js";
|
15
|
+
import { styles as x } from "./link.styles.js";
|
16
|
+
var A = Object.defineProperty, E = Object.getOwnPropertyDescriptor, r = (e, i, t, h) => {
|
17
|
+
for (var n = h > 1 ? void 0 : h ? E(i, t) : i, p = e.length - 1, d; p >= 0; p--)
|
18
|
+
(d = e[p]) && (n = (h ? d(i, t, n) : d(n)) || n);
|
19
|
+
return h && n && A(i, t, n), n;
|
20
20
|
};
|
21
|
-
const
|
21
|
+
const C = {
|
22
22
|
color: ["inverse", "primary"],
|
23
23
|
stretch: "stretch"
|
24
24
|
};
|
25
25
|
var a, l;
|
26
|
-
const u = class u extends
|
26
|
+
const u = class u extends w {
|
27
27
|
constructor() {
|
28
28
|
super(...arguments);
|
29
29
|
f(this, a);
|
30
30
|
f(this, l);
|
31
|
-
|
31
|
+
y(this, a, this.attachInternals()), y(this, l, c(this, a).states), this.as = "link", this.color = "primary", this.disabled = !1, this.download = !1, this.iconRight = !1, this.stretch = !1, this._handleClick = () => {
|
32
32
|
if (!(this.as === "button" && this.disabled) && (this.emit("skf-link-click", { detail: { href: this.href, route: this.route } }), this.as === "link" && !this.route && this.href?.trim()))
|
33
33
|
if (this.target)
|
34
34
|
window.open(this.href, this.target);
|
@@ -40,80 +40,86 @@ const u = class u extends C {
|
|
40
40
|
};
|
41
41
|
}
|
42
42
|
connectedCallback() {
|
43
|
-
super.connectedCallback(), this.
|
44
|
-
|
45
|
-
this.ariaDisabled !== "true" && (this.tabIndex = t), this.addEventListener("keydown", (s) => {
|
46
|
-
(s.key === "Enter" || s.key === " ") && this._handleClick();
|
43
|
+
super.connectedCallback(), this.role = this.as, this.addEventListener("keydown", (t) => {
|
44
|
+
(t.key === "Enter" || t.key === " ") && this._handleClick();
|
47
45
|
}), this.addEventListener("click", this._handleClick);
|
48
46
|
}
|
49
47
|
_handleAsChange() {
|
50
48
|
this.as === "button" ? this.setAttribute("type", "button") : this.removeAttribute("type");
|
51
49
|
}
|
52
|
-
|
53
|
-
|
50
|
+
_handleDisabledChange() {
|
51
|
+
this.ariaDisabled = this.as === "button" && this.disabled ? "true" : null;
|
52
|
+
const t = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : 0;
|
53
|
+
this.ariaDisabled !== "true" && (this.tabIndex = t);
|
54
|
+
}
|
55
|
+
_handleStateChange(t, h, n) {
|
56
|
+
k(c(this, l), C[t]).set(n);
|
54
57
|
}
|
55
58
|
/** @internal */
|
56
59
|
_renderIcon() {
|
57
60
|
const t = this.color === "inverse" ? "inverse" : "emphasized";
|
58
|
-
return
|
61
|
+
return v`
|
59
62
|
<skf-icon
|
60
63
|
color=${t}
|
61
|
-
data-color=${this.disabled ? "custom" :
|
62
|
-
name=${
|
64
|
+
data-color=${this.disabled ? "custom" : m}
|
65
|
+
name=${D(this.icon)}
|
63
66
|
size="sm"
|
64
67
|
></skf-icon>
|
65
68
|
`;
|
66
69
|
}
|
67
70
|
render() {
|
68
|
-
return
|
71
|
+
return v`
|
69
72
|
<div id="root" part="root">
|
70
|
-
${this.icon && !this.iconRight ? this._renderIcon() :
|
73
|
+
${this.icon && !this.iconRight ? this._renderIcon() : m}
|
71
74
|
<slot></slot>
|
72
|
-
${this.icon && this.iconRight ? this._renderIcon() :
|
75
|
+
${this.icon && this.iconRight ? this._renderIcon() : m}
|
73
76
|
</div>
|
74
77
|
`;
|
75
78
|
}
|
76
79
|
};
|
77
|
-
a = new WeakMap(), l = new WeakMap(), u.styles = [S,
|
80
|
+
a = new WeakMap(), l = new WeakMap(), u.styles = [S, x];
|
78
81
|
let o = u;
|
79
82
|
r([
|
80
|
-
|
83
|
+
s({ type: String })
|
81
84
|
], o.prototype, "as", 2);
|
82
85
|
r([
|
83
|
-
|
86
|
+
s({ type: String })
|
84
87
|
], o.prototype, "color", 2);
|
85
88
|
r([
|
86
|
-
|
89
|
+
s({ type: Boolean })
|
87
90
|
], o.prototype, "disabled", 2);
|
88
91
|
r([
|
89
|
-
|
92
|
+
s({ type: Boolean })
|
90
93
|
], o.prototype, "download", 2);
|
91
94
|
r([
|
92
|
-
|
95
|
+
s({ type: String })
|
93
96
|
], o.prototype, "href", 2);
|
94
97
|
r([
|
95
|
-
|
98
|
+
s({ type: String })
|
96
99
|
], o.prototype, "icon", 2);
|
97
100
|
r([
|
98
|
-
|
101
|
+
s({ type: Boolean, attribute: "icon-right" })
|
99
102
|
], o.prototype, "iconRight", 2);
|
100
103
|
r([
|
101
|
-
|
104
|
+
s({ type: String })
|
102
105
|
], o.prototype, "rel", 2);
|
103
106
|
r([
|
104
|
-
|
107
|
+
s({ type: String })
|
105
108
|
], o.prototype, "route", 2);
|
106
109
|
r([
|
107
|
-
|
110
|
+
s({ type: Boolean })
|
108
111
|
], o.prototype, "stretch", 2);
|
109
112
|
r([
|
110
|
-
|
113
|
+
s({ type: String })
|
111
114
|
], o.prototype, "target", 2);
|
112
115
|
r([
|
113
|
-
|
116
|
+
b("as")
|
114
117
|
], o.prototype, "_handleAsChange", 1);
|
115
118
|
r([
|
116
|
-
|
119
|
+
b("disabled")
|
120
|
+
], o.prototype, "_handleDisabledChange", 1);
|
121
|
+
r([
|
122
|
+
b(Object.keys(C))
|
117
123
|
], o.prototype, "_handleStateChange", 1);
|
118
124
|
export {
|
119
125
|
o as SkfLink
|
@@ -63,6 +63,7 @@ export declare class SkfSelect extends FormBase {
|
|
63
63
|
lang: Language;
|
64
64
|
/** If defined, limits the number of selectable options */
|
65
65
|
max?: number;
|
66
|
+
maxVisibleItems?: number;
|
66
67
|
/** If defined, sets the minimum number of required options */
|
67
68
|
min?: number;
|
68
69
|
/** If true, allows for multiple options to be selected */
|
@@ -89,6 +90,7 @@ export declare class SkfSelect extends FormBase {
|
|
89
90
|
/** @internal */
|
90
91
|
/** True if the internal state is invalid */
|
91
92
|
private _invalid;
|
93
|
+
private desiredPopupHeight?;
|
92
94
|
/** @internal */
|
93
95
|
$anchor: HTMLButtonElement;
|
94
96
|
/** @internal */
|
@@ -109,10 +111,13 @@ export declare class SkfSelect extends FormBase {
|
|
109
111
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
110
112
|
firstUpdated(): void;
|
111
113
|
_handleSizeUpdate(): void;
|
112
|
-
|
114
|
+
/** @internal */
|
115
|
+
_handleExpandedChange(): void;
|
113
116
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
114
117
|
disconnectedCallback(): void;
|
115
118
|
/** @internal */
|
119
|
+
_getOptionalDropdownHeight(_skfSelectOption: SkfSelectOption): number | undefined;
|
120
|
+
/** @internal */
|
116
121
|
_handleOptionSelected: EventListener;
|
117
122
|
/** @internal */
|
118
123
|
_updateState(event: CustomEvent<SelectOptionEvent>): void;
|
@@ -1,38 +1,38 @@
|
|
1
|
-
var _ = (
|
2
|
-
throw TypeError(
|
1
|
+
var _ = (l) => {
|
2
|
+
throw TypeError(l);
|
3
3
|
};
|
4
|
-
var v = (
|
5
|
-
var
|
4
|
+
var v = (l, r, t) => r.has(l) || _("Cannot " + t);
|
5
|
+
var u = (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), b = (l, r, t, e) => (v(l, r, "write to private field"), e ? e.call(l, t) : r.set(l, t), t);
|
6
6
|
import { SkfSelectOptionGroup as w } from "./select-option-group.component.js";
|
7
7
|
import "../tag/tag.js";
|
8
|
-
import { computePosition as
|
8
|
+
import { computePosition as x, flip as C, shift as V, offset as $ } from "@floating-ui/dom";
|
9
9
|
import { FormBase as L } from "../../internal/components/formBase.js";
|
10
10
|
import "../../internal/components/hint/hint.js";
|
11
11
|
import { PopoverController as E } from "../../internal/controllers/popover.controller.js";
|
12
12
|
import { findMatchingTags as k } from "../../internal/helpers/findMatchingTags.js";
|
13
13
|
import { hintSeverity as A } from "../../internal/helpers/hintSeverity.js";
|
14
|
-
import { raiseError as
|
14
|
+
import { raiseError as I } from "../../internal/helpers/raiseError.js";
|
15
15
|
import { watch as S } from "../../internal/helpers/watch.js";
|
16
|
-
import { Asterisk as
|
16
|
+
import { Asterisk as D } from "../../internal/templates/asterisk.js";
|
17
17
|
import { componentStyles as P } from "../../styles/component.styles.js";
|
18
|
-
import { LocalizeController as
|
18
|
+
import { LocalizeController as F } from "../../utilities/localize.js";
|
19
19
|
import { nothing as y, html as p } from "lit";
|
20
|
-
import { property as
|
21
|
-
import { classMap as
|
20
|
+
import { property as n, state as c, query as m, queryAssignedElements as T } from "lit/decorators.js";
|
21
|
+
import { classMap as z } from "lit/directives/class-map.js";
|
22
22
|
import { ifDefined as O } from "lit/directives/if-defined.js";
|
23
|
-
import { SkfSelectOption as
|
24
|
-
import { GlobalClickController as M, KeyboardNavigationController as B, DeveloperFeedbackController as
|
25
|
-
import { styles as
|
26
|
-
var
|
27
|
-
for (var
|
28
|
-
(h =
|
29
|
-
return e &&
|
23
|
+
import { SkfSelectOption as U } from "./select-option.component.js";
|
24
|
+
import { GlobalClickController as M, KeyboardNavigationController as B, DeveloperFeedbackController as N } from "./select.controllers.js";
|
25
|
+
import { styles as H } from "./select.styles.js";
|
26
|
+
var q = Object.defineProperty, R = Object.getOwnPropertyDescriptor, s = (l, r, t, e) => {
|
27
|
+
for (var o = e > 1 ? void 0 : e ? R(r, t) : r, a = l.length - 1, h; a >= 0; a--)
|
28
|
+
(h = l[a]) && (o = (e ? h(r, t, o) : h(o)) || o);
|
29
|
+
return e && o && q(r, t, o), o;
|
30
30
|
}, d;
|
31
31
|
const f = class f extends L {
|
32
32
|
constructor() {
|
33
33
|
super();
|
34
34
|
g(this, d);
|
35
|
-
b(this, d, new
|
35
|
+
b(this, d, new F(this)), this._componentIsConnected = !1, this._defaultButtonLabel = "Select an option", this.selectDelay = 200, this._optionsList = [], this.buttonLabel = this._defaultButtonLabel, this.hideLabel = !1, this.hideTags = !1, this.lang = "en", this.multiple = !1, this.showValid = !1, this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new M(this), this.keyboardNavController = new B(this), this.developerFeedbackController = new N(this), this.popoverController = new E(this), this._handleOptionSelected = (t) => {
|
36
36
|
this._pristine = !1;
|
37
37
|
const e = this._selectedOptions.length > 0;
|
38
38
|
this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
|
@@ -43,9 +43,9 @@ const f = class f extends L {
|
|
43
43
|
this.$popover.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
|
44
44
|
}, 50);
|
45
45
|
}, this.reposition = async () => {
|
46
|
-
const { x: t, y: e } = await
|
46
|
+
const { x: t, y: e } = await x(this.$anchor, this.$popover, {
|
47
47
|
placement: "bottom",
|
48
|
-
middleware: [
|
48
|
+
middleware: [C(), V(), $(2)],
|
49
49
|
strategy: "fixed"
|
50
50
|
});
|
51
51
|
Object.assign(this.$popover.style, {
|
@@ -74,8 +74,8 @@ const f = class f extends L {
|
|
74
74
|
});
|
75
75
|
}), this._resetSelectedOptions = (t) => {
|
76
76
|
const e = !t;
|
77
|
-
this._optionsList.forEach((
|
78
|
-
(e ||
|
77
|
+
this._optionsList.forEach((o) => {
|
78
|
+
(e || o !== t) && o.removeAttribute("selected");
|
79
79
|
}), this._optionsList = [];
|
80
80
|
}, this._handleSlotChange = () => {
|
81
81
|
this._handleSizeUpdate(), this._collectSlotOptionTags(), this._ifValueIsSetSelectOption(), this._validateInput(), this._componentIsConnected = !0, this.emitEvent("skf-select-connected");
|
@@ -85,18 +85,18 @@ const f = class f extends L {
|
|
85
85
|
const t = String(this.value).split(",").map((e) => e.toLowerCase().trim());
|
86
86
|
this._optionsList.forEach((e) => {
|
87
87
|
t.includes(e.value.toLowerCase().trim()) ? (e.setSelectedDiscrete = !0, this.selectedOptions = [...this.selectedOptions, e]) : (e.setSelectedDiscrete = !1, this._selectedOptions = this._selectedOptions.filter(
|
88
|
-
(
|
88
|
+
(o) => o.value.toLowerCase().trim() !== e.value.toLowerCase().trim()
|
89
89
|
));
|
90
90
|
}), this._setValue().catch((e) => {
|
91
91
|
console.error(e);
|
92
92
|
});
|
93
93
|
} else {
|
94
|
-
const t = this.value.toLowerCase().trim(), e = this._optionsList.find((
|
95
|
-
e && (e.setSelectedDiscrete = !0, this.selectedOptions = [e], this._setValue().catch((
|
96
|
-
console.error(
|
94
|
+
const t = this.value.toLowerCase().trim(), e = this._optionsList.find((o) => o.value.toLowerCase().trim() === t);
|
95
|
+
e && (e.setSelectedDiscrete = !0, this.selectedOptions = [e], this._setValue().catch((o) => {
|
96
|
+
console.error(o);
|
97
97
|
}));
|
98
98
|
}
|
99
|
-
}, this._computeVisibleValue = () => this.buttonLabel !== this._defaultButtonLabel ? this.buttonLabel : (this.$selectedValue?.classList.add("contains-meta-info"), this._selectedOptions.length > 1 ? `(${
|
99
|
+
}, this._computeVisibleValue = () => this.buttonLabel !== this._defaultButtonLabel ? this.buttonLabel : (this.$selectedValue?.classList.add("contains-meta-info"), this._selectedOptions.length > 1 ? `(${u(this, d).term("itemsSelected", this._selectedOptions.length)})` : this.value ? (this.$selectedValue?.classList.remove("contains-meta-info"), this._selectedOptions[0].textContent) : (this.$selectedValue?.classList.add("contains-meta-info"), this.buttonLabel)), this._selectedOptions = [];
|
100
100
|
}
|
101
101
|
set selectedValues(t) {
|
102
102
|
this._selectedOptions = this._optionsList.filter((e) => t.includes(e.value.trim()));
|
@@ -114,11 +114,11 @@ const f = class f extends L {
|
|
114
114
|
}
|
115
115
|
set value(t) {
|
116
116
|
let e = [];
|
117
|
-
this._componentIsConnected && (this.multiple ? e = String(t).split(",").map((
|
118
|
-
(
|
119
|
-
), this._optionsList.forEach((
|
120
|
-
|
121
|
-
}), this._selectedOptions.forEach((
|
117
|
+
this._componentIsConnected && (this.multiple ? e = String(t).split(",").map((a) => a.toLowerCase().trim()) : e = [String(t).toLowerCase().trim()], this._selectedOptions = this._optionsList.filter(
|
118
|
+
(a) => e.includes(a.value.toLowerCase().trim())
|
119
|
+
), this._optionsList.forEach((a) => {
|
120
|
+
a.selected && (a.setSelectedDiscrete = !1);
|
121
|
+
}), this._selectedOptions.forEach((a) => a.setSelectedDiscrete = !0)), this._setValue();
|
122
122
|
}
|
123
123
|
get value() {
|
124
124
|
return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
|
@@ -152,18 +152,20 @@ const f = class f extends L {
|
|
152
152
|
}
|
153
153
|
_handleSizeUpdate() {
|
154
154
|
this._slottedItems.forEach((t) => {
|
155
|
-
(t instanceof
|
155
|
+
(t instanceof U || t instanceof w) && (t.small = this.size === "sm");
|
156
156
|
});
|
157
157
|
}
|
158
|
-
|
158
|
+
_handleExpandedChange() {
|
159
159
|
this._expanded ? (this.$popover.togglePopover(this._expanded), this.popoverController.start()) : (this.$popover.togglePopover(this._expanded), this.popoverController.stop().catch((t) => {
|
160
160
|
console.error(t);
|
161
|
-
})), this.
|
161
|
+
})), this.desiredPopupHeight = this._getOptionalDropdownHeight(
|
162
|
+
this._slottedItems[0]
|
163
|
+
), this.desiredPopupHeight ? this.$popover.style.height = `${this.desiredPopupHeight.toString()}px` : this.$popover.style.height = "", this.emit("skf-select-dropdown", { detail: { expanded: this._expanded } });
|
162
164
|
}
|
163
|
-
attributeChangedCallback(t, e,
|
164
|
-
if (super.attributeChangedCallback(t, e,
|
165
|
-
if (typeof
|
166
|
-
const h = this.withFallback(
|
165
|
+
attributeChangedCallback(t, e, o) {
|
166
|
+
if (super.attributeChangedCallback(t, e, o), t === "custom-invalid")
|
167
|
+
if (typeof o == "string") {
|
168
|
+
const h = this.withFallback(o);
|
167
169
|
this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, h), this.checkValidity();
|
168
170
|
} else
|
169
171
|
this.setValidity({}), this._validateInput();
|
@@ -172,14 +174,20 @@ const f = class f extends L {
|
|
172
174
|
super.disconnectedCallback(), this._internals.form?.removeEventListener("reset", this._handleReset);
|
173
175
|
}
|
174
176
|
/** @internal */
|
177
|
+
_getOptionalDropdownHeight(t) {
|
178
|
+
if (!this.maxVisibleItems) return;
|
179
|
+
const e = this._slottedItems.length;
|
180
|
+
return this.maxVisibleItems >= e ? void 0 : t.getBoundingClientRect().height * this.maxVisibleItems;
|
181
|
+
}
|
182
|
+
/** @internal */
|
175
183
|
_updateState(t) {
|
176
184
|
if (this.multiple)
|
177
185
|
this._selectedOptions = [], this._optionsList.forEach((e) => {
|
178
186
|
e.selected && (this.selectedOptions = [...this.selectedOptions, e]);
|
179
187
|
});
|
180
188
|
else {
|
181
|
-
const e = this._selectedOptions.length > 0,
|
182
|
-
e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []),
|
189
|
+
const e = this._selectedOptions.length > 0, o = t.detail.value !== null;
|
190
|
+
e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), o && (this.selectedOptions = [t.target]);
|
183
191
|
}
|
184
192
|
this._setValue();
|
185
193
|
}
|
@@ -190,7 +198,7 @@ const f = class f extends L {
|
|
190
198
|
/** @internal */
|
191
199
|
/** Filter out elements other than skf-select-option and store in this._optionsList */
|
192
200
|
_collectSlotOptionTags() {
|
193
|
-
this._optionsList = k(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected),
|
201
|
+
this._optionsList = k(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), I({
|
194
202
|
assert: this._optionsList.length > 0,
|
195
203
|
reason: "no-children",
|
196
204
|
replaceStrings: [this.localName, "skf-select-option"]
|
@@ -199,7 +207,7 @@ const f = class f extends L {
|
|
199
207
|
/** @internal */
|
200
208
|
_validateInput() {
|
201
209
|
this._invalid = !1;
|
202
|
-
const t = this.required && !this.selectedValues.length || this.min === 1, e = !!(this.min && this.selectedValues.length < this.min),
|
210
|
+
const t = this.required && !this.selectedValues.length || this.min === 1, e = !!(this.min && this.selectedValues.length < this.min), o = !!(this.max && this.selectedValues.length > this.max);
|
203
211
|
if (this._internals.validity.customError) {
|
204
212
|
this._invalid = !0;
|
205
213
|
return;
|
@@ -209,7 +217,7 @@ const f = class f extends L {
|
|
209
217
|
} else if (e) {
|
210
218
|
const h = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
|
211
219
|
this.setValidity({ rangeUnderflow: !0 }, String(h)), this._pristine || (this._invalid = !0);
|
212
|
-
} else if (
|
220
|
+
} else if (o) {
|
213
221
|
const h = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
|
214
222
|
this.setValidity({ rangeOverflow: !0 }, String(h)), this._pristine || (this._invalid = !0);
|
215
223
|
} else
|
@@ -221,7 +229,7 @@ const f = class f extends L {
|
|
221
229
|
<label>
|
222
230
|
<div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
|
223
231
|
${this.label}
|
224
|
-
${this.required ?
|
232
|
+
${this.required ? D(u(this, d).term("required")) : y}
|
225
233
|
</div>
|
226
234
|
<button
|
227
235
|
?disabled=${this.disabled}
|
@@ -236,7 +244,7 @@ const f = class f extends L {
|
|
236
244
|
>
|
237
245
|
<span
|
238
246
|
id="selected-value"
|
239
|
-
class=${
|
247
|
+
class=${z({ "selected-value": !0, "contains-meta-info": !this.value })}>
|
240
248
|
${this._computeVisibleValue()}
|
241
249
|
</span>
|
242
250
|
<skf-icon class="arrow" data-color="custom" name="chevronDown"></skf-icon>
|
@@ -277,68 +285,74 @@ const f = class f extends L {
|
|
277
285
|
`;
|
278
286
|
}
|
279
287
|
};
|
280
|
-
d = new WeakMap(), f.styles = [P,
|
288
|
+
d = new WeakMap(), f.styles = [P, H];
|
281
289
|
let i = f;
|
282
290
|
s([
|
283
|
-
|
291
|
+
n({ type: String, reflect: !0, attribute: "button-label" })
|
284
292
|
], i.prototype, "buttonLabel", 2);
|
285
293
|
s([
|
286
|
-
|
294
|
+
n({ type: String, attribute: "custom-invalid" })
|
287
295
|
], i.prototype, "customInvalid", 2);
|
288
296
|
s([
|
289
|
-
|
297
|
+
n({ type: Boolean, attribute: "hide-label" })
|
290
298
|
], i.prototype, "hideLabel", 2);
|
291
299
|
s([
|
292
|
-
|
300
|
+
n({ type: Boolean, reflect: !0, attribute: "hide-tags" })
|
293
301
|
], i.prototype, "hideTags", 2);
|
294
302
|
s([
|
295
|
-
|
303
|
+
n({ type: String })
|
296
304
|
], i.prototype, "hint", 2);
|
297
305
|
s([
|
298
|
-
|
306
|
+
n({ type: Array, attribute: !1 })
|
299
307
|
], i.prototype, "selectedValues", 1);
|
300
308
|
s([
|
301
|
-
|
309
|
+
n({ type: Array, attribute: !1 })
|
302
310
|
], i.prototype, "selectedOptionsText", 1);
|
303
311
|
s([
|
304
|
-
|
312
|
+
n({ type: String, reflect: !0 })
|
305
313
|
], i.prototype, "label", 2);
|
306
314
|
s([
|
307
|
-
|
315
|
+
n({ type: String })
|
308
316
|
], i.prototype, "lang", 2);
|
309
317
|
s([
|
310
|
-
|
318
|
+
n({ type: Number })
|
311
319
|
], i.prototype, "max", 2);
|
312
320
|
s([
|
313
|
-
|
321
|
+
n({ type: Number, attribute: "max-visible-items" })
|
322
|
+
], i.prototype, "maxVisibleItems", 2);
|
323
|
+
s([
|
324
|
+
n({ type: Number })
|
314
325
|
], i.prototype, "min", 2);
|
315
326
|
s([
|
316
|
-
|
327
|
+
n({ type: Boolean, reflect: !0 })
|
317
328
|
], i.prototype, "multiple", 2);
|
318
329
|
s([
|
319
|
-
|
330
|
+
n({ type: String })
|
320
331
|
], i.prototype, "name", 2);
|
321
332
|
s([
|
322
|
-
|
333
|
+
n()
|
323
334
|
], i.prototype, "severity", 2);
|
324
335
|
s([
|
325
|
-
|
336
|
+
n({ type: Boolean, attribute: "show-valid" })
|
326
337
|
], i.prototype, "showValid", 2);
|
327
338
|
s([
|
328
|
-
|
339
|
+
n({ reflect: !0 })
|
329
340
|
], i.prototype, "size", 2);
|
330
341
|
s([
|
331
|
-
|
342
|
+
n({ type: String, attribute: !1 })
|
332
343
|
], i.prototype, "value", 1);
|
333
344
|
s([
|
334
|
-
|
345
|
+
c()
|
335
346
|
], i.prototype, "selectedOptions", 1);
|
336
347
|
s([
|
337
|
-
|
348
|
+
c()
|
338
349
|
], i.prototype, "_expanded", 2);
|
339
350
|
s([
|
340
|
-
|
351
|
+
c()
|
341
352
|
], i.prototype, "_invalid", 2);
|
353
|
+
s([
|
354
|
+
c()
|
355
|
+
], i.prototype, "desiredPopupHeight", 2);
|
342
356
|
s([
|
343
357
|
m("#select-button")
|
344
358
|
], i.prototype, "$anchor", 2);
|
@@ -349,14 +363,14 @@ s([
|
|
349
363
|
m("#select-dropdown")
|
350
364
|
], i.prototype, "$popover", 2);
|
351
365
|
s([
|
352
|
-
|
366
|
+
T()
|
353
367
|
], i.prototype, "_slottedItems", 2);
|
354
368
|
s([
|
355
369
|
S("size", { waitUntilFirstUpdate: !0 })
|
356
370
|
], i.prototype, "_handleSizeUpdate", 1);
|
357
371
|
s([
|
358
372
|
S("_expanded", { afterUpdate: !0 })
|
359
|
-
], i.prototype, "
|
373
|
+
], i.prototype, "_handleExpandedChange", 1);
|
360
374
|
export {
|
361
375
|
i as SkfSelect
|
362
376
|
};
|