@skf-design-system/ui-components 1.0.0-alpha.35 → 1.0.0-alpha.36
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/card/card.component.d.ts +2 -0
- package/dist/components/card/card.styles.js +2 -1
- package/dist/components/datepicker/datepicker.component.js +1 -0
- package/dist/components/icon/icon.component.d.ts +1 -4
- package/dist/components/icon/icon.component.js +41 -53
- package/dist/components/icon/icon.styles.js +0 -1
- 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/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/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 +31 -23
- 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 +5 -1
- package/dist/components/select/select-option.component.js +69 -52
- 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/textarea/textarea.component.js +5 -4
- 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/custom-elements.json +758 -678
- package/dist/internal/base-classes/popover/popover.base.d.ts +2 -2
- package/dist/internal/base-classes/popover/popover.base.js +17 -17
- 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/types/jsx/custom-element-jsx.d.ts +188 -70
- package/dist/types/vue/index.d.ts +81 -69
- package/dist/vscode.html-custom-data.json +91 -95
- package/dist/web-types.json +204 -203
- package/package.json +13 -13
@@ -20,6 +20,7 @@ export interface SelectOptionEvent {
|
|
20
20
|
* @tagname skf-select-option
|
21
21
|
*/
|
22
22
|
export declare class SkfSelectOption extends SkfElement {
|
23
|
+
#private;
|
23
24
|
static styles: CSSResultGroup;
|
24
25
|
static shadowRootOptions: {
|
25
26
|
delegatesFocus: boolean;
|
@@ -53,16 +54,19 @@ export declare class SkfSelectOption extends SkfElement {
|
|
53
54
|
/** Returns or sets the tags value. If value is omitted, defaults to the tags text. */
|
54
55
|
set value(optionValue: string);
|
55
56
|
get value(): string;
|
57
|
+
small: boolean;
|
56
58
|
/** @internal */
|
57
59
|
private _assignedNodes?;
|
58
60
|
constructor();
|
59
61
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
62
|
+
/** @internal */
|
63
|
+
_handleStateChange(): void;
|
60
64
|
/**
|
61
65
|
* @internal
|
62
66
|
* This internal setter is to change selected state without emitting events triggering other side effects,
|
63
67
|
* e.g deselecting previous selected in a single select. Is used by skf-select in single select mode.
|
64
68
|
*/
|
65
|
-
set setSelectedDiscrete(
|
69
|
+
set setSelectedDiscrete(isSelected: boolean);
|
66
70
|
/**
|
67
71
|
* @internal
|
68
72
|
* Returns the slotted content as a string. If no slotted content, returns an empty string.
|
@@ -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 v = (e, s, t) => s.has(e) || y("Cannot " + t);
|
5
|
+
var u = (e, s, t) => (v(e, s, "read from private field"), t ? t.call(e) : s.get(e)), m = (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), f = (e, s, t, i) => (v(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 x } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as g } 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 a, state as $, queryAssignedNodes as O } from "lit/decorators.js";
|
13
|
+
import { ifDefined as b } from "lit/directives/if-defined.js";
|
14
|
+
import { styles as E } from "./select-option.styles.js";
|
15
|
+
var w = Object.defineProperty, D = Object.getOwnPropertyDescriptor, l = (e, s, t, i) => {
|
16
|
+
for (var r = i > 1 ? void 0 : i ? D(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 && w(s, t, r), r;
|
19
|
+
}, n, h;
|
20
|
+
const c = class c extends C {
|
14
21
|
constructor() {
|
15
|
-
super()
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
super();
|
23
|
+
m(this, n);
|
24
|
+
m(this, h);
|
25
|
+
f(this, n, this.attachInternals()), f(this, h, u(this, n).states), this._shortcutUpdate = !1, this.disabled = !1, this.selected = !1, this.small = !1, this._handleClick = (t) => {
|
26
|
+
t.stopPropagation(), this.selected = !this.selected;
|
27
|
+
}, this.role = "option", this._parent = this.closest("skf-select"), this._shortcutUpdate = !1;
|
20
28
|
}
|
21
29
|
set text(t) {
|
22
30
|
this.textContent = t.trim();
|
@@ -40,6 +48,9 @@ const n = class n extends u {
|
|
40
48
|
}
|
41
49
|
});
|
42
50
|
}
|
51
|
+
_handleStateChange() {
|
52
|
+
x(u(this, h), "small").set(this.small);
|
53
|
+
}
|
43
54
|
/**
|
44
55
|
* @internal
|
45
56
|
* This internal setter is to change selected state without emitting events triggering other side effects,
|
@@ -60,14 +71,14 @@ const n = class n extends u {
|
|
60
71
|
/** @internal */
|
61
72
|
get _slotContainsOnlyText() {
|
62
73
|
return this._assignedNodes ? [...this._assignedNodes].every(
|
63
|
-
(
|
64
|
-
var
|
65
|
-
return
|
74
|
+
(i) => {
|
75
|
+
var r;
|
76
|
+
return i.nodeType === Node.TEXT_NODE && ((r = i.textContent) == null ? void 0 : r.trim()) !== "";
|
66
77
|
}
|
67
78
|
) : "";
|
68
79
|
}
|
69
80
|
render() {
|
70
|
-
return
|
81
|
+
return _`
|
71
82
|
<button
|
72
83
|
?disabled=${this.disabled}
|
73
84
|
@click=${this._handleClick}
|
@@ -78,46 +89,52 @@ const n = class n extends u {
|
|
78
89
|
<slot>${this.text}</slot>
|
79
90
|
<div id="adornments">
|
80
91
|
<slot name="icon">
|
81
|
-
${this.icon &&
|
92
|
+
${this.icon && _`
|
82
93
|
<skf-icon
|
83
|
-
color=${
|
84
|
-
data-color=${
|
94
|
+
color=${b(this.iconColor)}
|
95
|
+
data-color=${b((this.disabled || !this.iconColor) && "custom")}
|
85
96
|
name=${this.icon}
|
86
97
|
></skf-icon>
|
87
98
|
`}
|
88
99
|
</slot>
|
89
|
-
${this.shortLabel &&
|
100
|
+
${this.shortLabel && _`<div id="short-label">${this.shortLabel}</div>`}
|
90
101
|
</div>
|
91
102
|
</button>
|
92
103
|
`;
|
93
104
|
}
|
94
105
|
};
|
95
|
-
n.styles = [
|
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
|
-
],
|
106
|
+
n = new WeakMap(), h = new WeakMap(), c.styles = [N, E], c.shadowRootOptions = { ...T.shadowRootOptions, delegatesFocus: !0 };
|
107
|
+
let o = c;
|
108
|
+
l([
|
109
|
+
a({ type: Boolean, reflect: !0 })
|
110
|
+
], o.prototype, "disabled", 2);
|
111
|
+
l([
|
112
|
+
a({ reflect: !0 })
|
113
|
+
], o.prototype, "icon", 2);
|
114
|
+
l([
|
115
|
+
a({ reflect: !0, attribute: "icon-color" })
|
116
|
+
], o.prototype, "iconColor", 2);
|
117
|
+
l([
|
118
|
+
a({ type: Boolean, reflect: !0 })
|
119
|
+
], o.prototype, "selected", 2);
|
120
|
+
l([
|
121
|
+
a({ reflect: !0, attribute: "short-label" })
|
122
|
+
], o.prototype, "shortLabel", 2);
|
123
|
+
l([
|
124
|
+
a({ attribute: !1 })
|
125
|
+
], o.prototype, "text", 1);
|
126
|
+
l([
|
127
|
+
a({ reflect: !0 })
|
128
|
+
], o.prototype, "value", 1);
|
129
|
+
l([
|
130
|
+
$()
|
131
|
+
], o.prototype, "small", 2);
|
132
|
+
l([
|
133
|
+
O({ flatten: !0 })
|
134
|
+
], o.prototype, "_assignedNodes", 2);
|
135
|
+
l([
|
136
|
+
g("small")
|
137
|
+
], o.prototype, "_handleStateChange", 1);
|
121
138
|
export {
|
122
|
-
|
139
|
+
o as SkfSelectOption
|
123
140
|
};
|
@@ -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({ padding: 5 }), 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
|
});
|
@@ -3,9 +3,9 @@ import { FormBase as m } from "../../internal/components/formBase.js";
|
|
3
3
|
import "../../internal/components/hint/hint.js";
|
4
4
|
import { hintSeverity as c } from "../../internal/helpers/hintSeverity.js";
|
5
5
|
import { Asterisk as y } from "../../internal/templates/asterisk.js";
|
6
|
-
import { componentStyles as
|
6
|
+
import { componentStyles as b } from "../../styles/component.styles.js";
|
7
7
|
import { nothing as u, html as v } from "lit";
|
8
|
-
import { property as r, state as
|
8
|
+
import { property as r, state as f, query as g } from "lit/decorators.js";
|
9
9
|
import { ifDefined as o } from "lit/directives/if-defined.js";
|
10
10
|
import $ from "./textarea.styles.js";
|
11
11
|
var E = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (p, i, s, a) => {
|
@@ -106,6 +106,7 @@ const d = class d extends m {
|
|
106
106
|
</label>
|
107
107
|
${this.hint && v`
|
108
108
|
<skf-hint
|
109
|
+
?disabled=${this.disabled}
|
109
110
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
110
111
|
id="hint"
|
111
112
|
severity=${o(c(this.invalid, this.severity))}
|
@@ -117,7 +118,7 @@ const d = class d extends m {
|
|
117
118
|
`;
|
118
119
|
}
|
119
120
|
};
|
120
|
-
d.styles = [
|
121
|
+
d.styles = [b, $];
|
121
122
|
let t = d;
|
122
123
|
e([
|
123
124
|
r({ type: Number })
|
@@ -174,7 +175,7 @@ e([
|
|
174
175
|
r()
|
175
176
|
], t.prototype, "value", 2);
|
176
177
|
e([
|
177
|
-
|
178
|
+
f()
|
178
179
|
], t.prototype, "invalid", 2);
|
179
180
|
e([
|
180
181
|
g("textarea")
|
@@ -1,25 +1,25 @@
|
|
1
1
|
import { SkfElement as l } from "../../internal/components/skf-element.js";
|
2
2
|
import { html as f } from "lit";
|
3
|
-
import { property as i, queryAssignedNodes as
|
4
|
-
import { SkfToastSingleton as
|
3
|
+
import { property as i, queryAssignedNodes as y } from "lit/decorators.js";
|
4
|
+
import { SkfToastSingleton as d } from "./toast.singleton.js";
|
5
5
|
import { styles as a } from "./toast.styles.js";
|
6
|
-
var u = Object.defineProperty, e = (n,
|
7
|
-
for (var s = void 0,
|
8
|
-
(
|
9
|
-
return s && u(
|
6
|
+
var u = Object.defineProperty, e = (n, r, m, g) => {
|
7
|
+
for (var s = void 0, o = n.length - 1, h; o >= 0; o--)
|
8
|
+
(h = n[o]) && (s = h(r, m, s) || s);
|
9
|
+
return s && u(r, m, s), s;
|
10
10
|
};
|
11
11
|
const p = class p extends l {
|
12
12
|
constructor() {
|
13
13
|
super(), this.debug = !1, this.persistent = !1, this.severity = "info", this.timer = 5, this._singleton = void 0;
|
14
14
|
}
|
15
15
|
firstUpdated() {
|
16
|
-
this._singleton = new
|
16
|
+
this._singleton = new d(), this._singleton.addData({
|
17
17
|
debug: this.debug,
|
18
18
|
icon: this.icon,
|
19
19
|
originEl: this,
|
20
20
|
persistent: this.persistent,
|
21
21
|
severity: this.severity,
|
22
|
-
text: this._slottedText.map((
|
22
|
+
text: this._slottedText.map((r) => r.textContent).join(),
|
23
23
|
timer: this.timer = this.timer && this.timer < 5 ? 5 : this.timer,
|
24
24
|
topOffset: this.topOffset
|
25
25
|
});
|
@@ -49,7 +49,7 @@ e([
|
|
49
49
|
i({ type: Number })
|
50
50
|
], t.prototype, "topOffset");
|
51
51
|
e([
|
52
|
-
|
52
|
+
y()
|
53
53
|
], t.prototype, "_slottedText");
|
54
54
|
export {
|
55
55
|
t as SkfToast
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import "./toast-item.js";
|
2
2
|
import "./toast-wrapper.js";
|
3
3
|
class s {
|
4
|
-
constructor(
|
5
|
-
if (this.data = [], this.root =
|
4
|
+
constructor() {
|
5
|
+
if (this.data = [], this.root = globalThis.document, this.usePopover = !0, this.root.nodeType !== Node.DOCUMENT_NODE)
|
6
6
|
throw new Error("Root node must be a document node");
|
7
7
|
return s.instance || (s.instance = this), s.instance;
|
8
8
|
}
|
@@ -15,31 +15,31 @@ class s {
|
|
15
15
|
getData() {
|
16
16
|
return this.data;
|
17
17
|
}
|
18
|
-
setData(
|
19
|
-
this.data =
|
18
|
+
setData(o) {
|
19
|
+
this.data = o;
|
20
20
|
}
|
21
|
-
addData(
|
22
|
-
this.data = [...this.data,
|
21
|
+
addData(o) {
|
22
|
+
this.data = [...this.data, o], this.udpateUI();
|
23
23
|
}
|
24
24
|
udpateUI() {
|
25
|
-
const
|
26
|
-
this.usePopover &&
|
25
|
+
const o = c(this.root, this.usePopover);
|
26
|
+
this.usePopover && o.showPopover(), u();
|
27
27
|
function u() {
|
28
|
-
const
|
29
|
-
for (;
|
30
|
-
const t =
|
28
|
+
const i = new s();
|
29
|
+
for (; i.hasToasts(); ) {
|
30
|
+
const t = i.popToast();
|
31
31
|
if (!t) return;
|
32
|
-
t.debug && (
|
33
|
-
const
|
34
|
-
|
32
|
+
t.debug && (o.debug = !0);
|
33
|
+
const e = document.createElement("skf-toast-item");
|
34
|
+
e.className = "toast-item", e.timer = t.timer, e.severity = t.severity, e.icon = t.icon, t.persistent && e.setAttribute("persistent", "true"), e.originEl = t.originEl, e.innerText = String(t.text);
|
35
35
|
const a = document.createElement("div");
|
36
|
-
a.classList.add("toast-item-wrapper"), a.appendChild(
|
36
|
+
a.classList.add("toast-item-wrapper"), a.appendChild(e), o.prepend(a);
|
37
37
|
}
|
38
38
|
}
|
39
|
-
function c(
|
39
|
+
function c(i, t) {
|
40
40
|
var p;
|
41
|
-
const a = ((p = new s(
|
42
|
-
let r =
|
41
|
+
const a = ((p = new s().getData()[0]) == null ? void 0 : p.topOffset) ?? null, n = i.querySelector("body");
|
42
|
+
let r = n == null ? void 0 : n.querySelector("skf-toast-wrapper");
|
43
43
|
if (!r) {
|
44
44
|
if (r = document.createElement("skf-toast-wrapper"), !r) throw new Error("Could not create toast wrapper element");
|
45
45
|
t && r.setAttribute("popover", "auto"), a && r.setAttribute("top-offset", a.toString()), document.body.appendChild(r);
|