@sbb-esta/lyne-elements 2.1.0 → 2.3.0
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/accordion.js +6 -6
- package/action-group.js +3 -3
- package/alert/alert-group.js +4 -4
- package/alert/alert.js +9 -9
- package/autocomplete/autocomplete-base-element.d.ts +4 -0
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-button.js +4 -4
- package/autocomplete-grid/autocomplete-grid-cell.js +3 -3
- package/autocomplete-grid/autocomplete-grid-optgroup.js +4 -4
- package/autocomplete-grid/autocomplete-grid-row.js +5 -5
- package/autocomplete.js +26 -20
- package/badge.css +31 -0
- package/breadcrumb/breadcrumb-group.js +5 -5
- package/breadcrumb/breadcrumb.js +19 -19
- package/button/accent-button-link.js +9 -9
- package/button/accent-button-static.js +6 -6
- package/button/accent-button.js +6 -6
- package/button/button-link.js +7 -7
- package/button/button-static.js +7 -7
- package/button/button.js +8 -8
- package/button/common.js +15 -15
- package/button/mini-button-group.js +8 -8
- package/button/secondary-button-link.js +7 -7
- package/button/secondary-button-static.js +7 -7
- package/button/secondary-button.js +3 -3
- package/button/transparent-button-link.js +6 -6
- package/button/transparent-button-static.js +5 -5
- package/button/transparent-button.js +6 -6
- package/calendar.js +1 -1
- package/card/card-badge.js +11 -11
- package/card/card-button.js +5 -5
- package/card/card-link.js +7 -7
- package/card/card.js +3 -3
- package/checkbox/checkbox-panel.js +16 -16
- package/checkbox/checkbox.js +15 -15
- package/checkbox/common.js +3 -3
- package/chip-label.js +3 -3
- package/clock.js +10 -10
- package/container/container.js +6 -6
- package/core/a11y/focus.d.ts.map +1 -1
- package/core/a11y.js +8 -8
- package/core/base-elements/link-base-element.d.ts +2 -0
- package/core/base-elements/link-base-element.d.ts.map +1 -1
- package/core/base-elements.js +125 -114
- package/core/controllers.js +4 -4
- package/core/datetime.js +6 -6
- package/core/dom/scroll.d.ts +1 -0
- package/core/dom/scroll.d.ts.map +1 -1
- package/core/dom.js +31 -31
- package/core/eventing.js +4 -4
- package/core/i18n/i18n.d.ts +2 -0
- package/core/i18n/i18n.d.ts.map +1 -1
- package/core/i18n.js +43 -31
- package/core/images.d.ts.map +1 -1
- package/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/core/mixins/form-associated-mixin.d.ts +3 -0
- package/core/mixins/form-associated-mixin.d.ts.map +1 -1
- package/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/core/mixins.js +342 -248
- package/core/styles/badge.scss +3 -0
- package/core/styles/core.scss +2 -0
- package/core/styles/mixins/badge.scss +26 -1
- package/core/styles/mixins/font-face.scss +12 -12
- package/core/styles/mixins/link.scss +32 -8
- package/core/styles/standard-theme.scss +1 -0
- package/core/testing.js +14 -14
- package/core.css +5 -3
- package/custom-elements.json +7788 -173
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +23 -26
- package/datepicker/datepicker.js +4 -4
- package/development/action-group.js +1 -1
- package/development/alert/alert-group.js +1 -1
- package/development/alert/alert.js +1 -1
- package/development/autocomplete/autocomplete-base-element.d.ts +4 -0
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-cell.js +1 -1
- package/development/autocomplete-grid/autocomplete-grid-row.js +1 -1
- package/development/autocomplete.js +15 -2
- package/development/breadcrumb/breadcrumb-group.js +3 -3
- package/development/breadcrumb/breadcrumb.js +5 -2
- package/development/button/common.js +75 -74
- package/development/calendar.js +1 -1
- package/development/card/card-badge.js +1 -1
- package/development/card/card.js +1 -1
- package/development/checkbox/checkbox-panel.js +1 -1
- package/development/chip-label.js +1 -1
- package/development/clock.js +1 -1
- package/development/container/container.js +1 -1
- package/development/core/a11y/focus.d.ts.map +1 -1
- package/development/core/a11y.js +3 -3
- package/development/core/base-elements/link-base-element.d.ts +2 -0
- package/development/core/base-elements/link-base-element.d.ts.map +1 -1
- package/development/core/base-elements.js +22 -5
- package/development/core/controllers.js +1 -1
- package/development/core/dom/scroll.d.ts +1 -0
- package/development/core/dom/scroll.d.ts.map +1 -1
- package/development/core/dom.js +5 -2
- package/development/core/i18n/i18n.d.ts +2 -0
- package/development/core/i18n/i18n.d.ts.map +1 -1
- package/development/core/i18n.js +15 -1
- package/development/core/images.d.ts.map +1 -1
- package/development/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/development/core/mixins/form-associated-mixin.d.ts +3 -0
- package/development/core/mixins/form-associated-mixin.d.ts.map +1 -1
- package/development/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +159 -22
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +13 -6
- package/development/datepicker/datepicker.js +1 -1
- package/development/dialog/dialog-content.js +1 -1
- package/development/dialog/dialog-title.js +1 -1
- package/development/dialog/dialog.js +1 -1
- package/development/expansion-panel/expansion-panel-content.js +1 -1
- package/development/expansion-panel/expansion-panel-header.js +1 -1
- package/development/expansion-panel/expansion-panel.js +1 -1
- package/development/file-selector/common.js +1 -1
- package/development/flip-card/flip-card-details.js +1 -1
- package/development/flip-card/flip-card-summary.js +1 -1
- package/development/footer.js +1 -1
- package/development/form-field/form-field/form-field.d.ts.map +1 -1
- package/development/form-field/form-field.js +5 -2
- package/development/icon.js +1 -1
- package/development/image.js +2 -2
- package/development/journey-header.js +1 -1
- package/development/lead-container.js +1 -1
- package/development/link/common.js +19 -7
- package/development/link-list/common.js +1 -1
- package/development/link-list/link-list-anchor.js +1 -1
- package/development/link-list/link-list.js +1 -1
- package/development/loading-indicator-circle.js +1 -1
- package/development/loading-indicator.js +1 -1
- package/development/map-container.js +1 -1
- package/development/menu/common/menu-action-common.d.ts +3 -0
- package/development/menu/common/menu-action-common.d.ts.map +1 -1
- package/development/menu/common.js +35 -12
- package/development/message.js +1 -1
- package/development/navigation/navigation-section.js +1 -1
- package/development/notification.js +1 -1
- package/development/option/optgroup.js +1 -1
- package/development/option/option.js +1 -1
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay.js +3 -3
- package/development/paginator/paginator.js +1 -1
- package/development/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/development/radio-button/radio-button-group.js +2 -2
- package/development/radio-button/radio-button-panel.js +1 -1
- package/development/{sbb-tokens-BdGhUJjM.js → sbb-tokens-CSAKTXUi.js} +15 -15
- package/development/screen-reader-only.js +1 -1
- package/development/select/select.d.ts +4 -1
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +22 -4
- package/development/signet.js +1 -1
- package/development/skiplink-list.js +1 -1
- package/development/slider.js +1 -1
- package/development/stepper/step.js +1 -1
- package/development/tabs/tab-label.js +1 -1
- package/development/tabs/tab.js +1 -1
- package/development/time-input.js +1 -1
- package/development/timetable-occupancy.js +1 -1
- package/development/title/title-base.d.ts.map +1 -1
- package/development/title.js +4 -5
- package/development/toast.js +1 -1
- package/development/toggle/toggle/toggle.d.ts +25 -6
- package/development/toggle/toggle/toggle.d.ts.map +1 -1
- package/development/toggle/toggle-option/toggle-option.d.ts +2 -6
- package/development/toggle/toggle-option/toggle-option.d.ts.map +1 -1
- package/development/toggle/toggle-option.js +21 -39
- package/development/toggle/toggle.js +58 -40
- package/development/train/train-blocked-passage.js +1 -1
- package/development/train/train-formation.js +1 -1
- package/development/train/train.js +1 -1
- package/development/visual-checkbox.js +1 -1
- package/dialog/dialog-content.js +4 -4
- package/dialog/dialog-title.js +8 -8
- package/dialog/dialog.js +1 -1
- package/divider.js +12 -12
- package/expansion-panel/expansion-panel-content.js +3 -3
- package/expansion-panel/expansion-panel-header.js +1 -1
- package/expansion-panel/expansion-panel.js +1 -1
- package/file-selector/common.js +9 -9
- package/file-selector/file-selector-dropzone.js +5 -5
- package/file-selector/file-selector.js +6 -6
- package/flip-card/flip-card-details.js +7 -7
- package/flip-card/flip-card-summary.js +12 -12
- package/font-characters-extension.css +3 -3
- package/footer.js +4 -4
- package/form-field/form-field/form-field.d.ts.map +1 -1
- package/form-field/form-field.js +7 -5
- package/header/header-button.js +5 -5
- package/header/header-link.js +5 -5
- package/icon.js +37 -37
- package/image.js +16 -16
- package/journey-header.js +5 -5
- package/lead-container.js +3 -3
- package/link/block-link-button.js +4 -4
- package/link/block-link-static.js +9 -9
- package/link/block-link.js +4 -4
- package/link/common.js +28 -28
- package/link/link-button.js +7 -7
- package/link/link-static.js +7 -7
- package/link/link.js +4 -4
- package/link-list/common.js +15 -15
- package/link-list/link-list-anchor.js +3 -3
- package/link-list/link-list.js +3 -3
- package/loading-indicator-circle.js +14 -14
- package/loading-indicator.js +3 -3
- package/map-container.js +6 -6
- package/menu/common/menu-action-common.d.ts +3 -0
- package/menu/common/menu-action-common.d.ts.map +1 -1
- package/menu/common.js +34 -30
- package/menu/menu-button.js +8 -8
- package/menu/menu-link.js +6 -6
- package/menu/menu.js +7 -7
- package/message.js +3 -3
- package/navigation/navigation-button.js +4 -4
- package/navigation/navigation-link.js +7 -7
- package/navigation/navigation-list.js +4 -4
- package/navigation/navigation-marker.js +3 -3
- package/navigation/navigation-section.js +1 -1
- package/notification.js +19 -19
- package/option/optgroup.js +14 -14
- package/option/option.js +3 -3
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay.js +14 -14
- package/package.json +6 -2
- package/paginator/common.js +6 -6
- package/paginator/paginator.js +1 -1
- package/popover/popover.js +13 -13
- package/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/radio-button/radio-button-group.js +1 -1
- package/radio-button/radio-button-panel.js +6 -6
- package/{sbb-tokens-Dx20OtVg.js → sbb-tokens-BgDF8jIh.js} +14 -14
- package/screen-reader-only.js +8 -8
- package/select/select.d.ts +4 -1
- package/select/select.d.ts.map +1 -1
- package/select.js +35 -28
- package/signet.js +1 -1
- package/skiplink-list.js +3 -3
- package/slider.js +13 -13
- package/standard-theme.css +37 -3
- package/status.js +3 -3
- package/stepper/step-label.js +4 -4
- package/stepper/step.js +3 -3
- package/table/table-wrapper.js +4 -4
- package/tabs/tab-group.js +24 -24
- package/tabs/tab-label.js +1 -1
- package/tabs/tab.js +4 -4
- package/tag/tag-group.js +7 -7
- package/teaser-product/common.js +5 -5
- package/teaser-product/teaser-product-static.js +2 -2
- package/time-input.js +3 -3
- package/timetable-occupancy-icon.js +3 -3
- package/timetable-occupancy.js +6 -6
- package/title/title-base.d.ts.map +1 -1
- package/title.js +41 -42
- package/toast.js +5 -5
- package/toggle/toggle/toggle.d.ts +25 -6
- package/toggle/toggle/toggle.d.ts.map +1 -1
- package/toggle/toggle-option/toggle-option.d.ts +2 -6
- package/toggle/toggle-option/toggle-option.d.ts.map +1 -1
- package/toggle/toggle-option.js +44 -52
- package/toggle/toggle.js +103 -83
- package/toggle-check.js +5 -5
- package/train/train-blocked-passage.js +3 -3
- package/train/train-formation.js +1 -1
- package/train/train.js +29 -29
- package/visual-checkbox.js +1 -1
package/core/mixins.js
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var V = (c) => {
|
|
2
|
+
throw TypeError(c);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __esDecorate as
|
|
7
|
-
import { property as S, state as
|
|
8
|
-
import { forceType as
|
|
9
|
-
import { defaultConverter as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
var q = (c, m, u) => m.has(c) || V("Cannot " + u);
|
|
5
|
+
var x = (c, m, u) => (q(c, m, "read from private field"), u ? u.call(c) : m.get(c)), C = (c, m, u) => m.has(c) ? V("Cannot add the same private member more than once") : m instanceof WeakSet ? m.add(c) : m.set(c, u), y = (c, m, u, o) => (q(c, m, "write to private field"), o ? o.call(c, u) : m.set(c, u), u);
|
|
6
|
+
import { __esDecorate as g, __runInitializers as f } from "tslib";
|
|
7
|
+
import { property as S, state as A } from "lit/decorators.js";
|
|
8
|
+
import { forceType as R, getOverride as N, hostAttributes as P } from "./decorators.js";
|
|
9
|
+
import { defaultConverter as D, isServer as G, nothing as B, html as I, css as $ } from "lit";
|
|
10
|
+
import { SbbLanguageController as z, SbbConnectedAbortController as T } from "./controllers.js";
|
|
11
|
+
import { preventScrollOnSpacebarPress as H, EventEmitter as K } from "./eventing.js";
|
|
12
|
+
import { i18nCheckboxRequired as W, i18nSelectionRequired as X } from "./i18n.js";
|
|
13
|
+
import { isWebkit as J } from "./dom.js";
|
|
14
|
+
import { interactivityChecker as Q, isArrowKeyPressed as Y, getNextElementIndex as Z } from "./a11y.js";
|
|
13
15
|
import "../screen-reader-only.js";
|
|
14
|
-
const
|
|
15
|
-
var
|
|
16
|
-
let
|
|
17
|
-
return e = class extends
|
|
16
|
+
const M = (c) => (() => {
|
|
17
|
+
var h, e;
|
|
18
|
+
let u = c, o, p = [], r = [];
|
|
19
|
+
return e = class extends u {
|
|
18
20
|
constructor() {
|
|
19
21
|
super(...arguments);
|
|
20
|
-
|
|
21
|
-
f(this,
|
|
22
|
+
C(this, h, f(this, p, !1));
|
|
23
|
+
f(this, r);
|
|
22
24
|
}
|
|
23
25
|
/** Whether the component is disabled. */
|
|
24
26
|
get disabled() {
|
|
25
|
-
return
|
|
27
|
+
return x(this, h);
|
|
26
28
|
}
|
|
27
29
|
set disabled(t) {
|
|
28
|
-
|
|
30
|
+
y(this, h, t);
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* Will be used as 'or' check to the current disabled state.
|
|
@@ -34,52 +36,64 @@ const I = (l) => (() => {
|
|
|
34
36
|
isDisabledExternally() {
|
|
35
37
|
return !1;
|
|
36
38
|
}
|
|
37
|
-
},
|
|
38
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
39
|
-
|
|
40
|
-
s.disabled =
|
|
41
|
-
} }, metadata: t },
|
|
39
|
+
}, h = new WeakMap(), (() => {
|
|
40
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
41
|
+
o = [R(), S({ reflect: !0, type: Boolean }), N((s, l) => l || s.isDisabledExternally())], g(e, null, o, { kind: "accessor", name: "disabled", static: !1, private: !1, access: { has: (s) => "disabled" in s, get: (s) => s.disabled, set: (s, l) => {
|
|
42
|
+
s.disabled = l;
|
|
43
|
+
} }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
42
44
|
})(), e;
|
|
43
|
-
})(),
|
|
44
|
-
var
|
|
45
|
-
let
|
|
46
|
-
return e = class extends
|
|
45
|
+
})(), ee = (c) => (() => {
|
|
46
|
+
var h, e;
|
|
47
|
+
let u = c, o, p = [], r = [];
|
|
48
|
+
return e = class extends u {
|
|
47
49
|
constructor() {
|
|
48
50
|
super(...arguments);
|
|
49
|
-
|
|
50
|
-
f(this,
|
|
51
|
+
C(this, h, f(this, p, !1));
|
|
52
|
+
f(this, r);
|
|
51
53
|
}
|
|
52
54
|
/** Whether the button should be aria-disabled but stay interactive. */
|
|
53
55
|
get disabledInteractive() {
|
|
54
|
-
return
|
|
56
|
+
return x(this, h);
|
|
55
57
|
}
|
|
56
58
|
set disabledInteractive(t) {
|
|
57
|
-
|
|
59
|
+
y(this, h, t);
|
|
58
60
|
}
|
|
59
|
-
},
|
|
60
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
61
|
-
|
|
62
|
-
s.disabledInteractive =
|
|
63
|
-
} }, metadata: t },
|
|
61
|
+
}, h = new WeakMap(), (() => {
|
|
62
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
63
|
+
o = [R(), S({ attribute: "disabled-interactive", type: Boolean, reflect: !0 })], g(e, null, o, { kind: "accessor", name: "disabledInteractive", static: !1, private: !1, access: { has: (s) => "disabledInteractive" in s, get: (s) => s.disabledInteractive, set: (s, l) => {
|
|
64
|
+
s.disabledInteractive = l;
|
|
65
|
+
} }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
64
66
|
})(), e;
|
|
65
|
-
})(),
|
|
66
|
-
class
|
|
67
|
-
willUpdate(
|
|
68
|
-
super.willUpdate(
|
|
67
|
+
})(), pe = (c) => {
|
|
68
|
+
class m extends ee(M(c)) {
|
|
69
|
+
willUpdate(o) {
|
|
70
|
+
super.willUpdate(o), o.has("disabledInteractive") && (this.internals.ariaDisabled = this.disabledInteractive ? "true" : null), o.has("disabled") && (this.disabled ? this.removeAttribute("tabindex") : this.setAttribute("tabindex", "0"));
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
return
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
return m;
|
|
74
|
+
}, te = {
|
|
75
|
+
badInput: !1,
|
|
76
|
+
customError: !1,
|
|
77
|
+
patternMismatch: !1,
|
|
78
|
+
rangeOverflow: !1,
|
|
79
|
+
rangeUnderflow: !1,
|
|
80
|
+
stepMismatch: !1,
|
|
81
|
+
tooLong: !1,
|
|
82
|
+
tooShort: !1,
|
|
83
|
+
typeMismatch: !1,
|
|
84
|
+
valueMissing: !1
|
|
85
|
+
}, L = (c) => (() => {
|
|
86
|
+
var n, t;
|
|
87
|
+
let u = c, o = [], p, r, h, e = [], i = [];
|
|
88
|
+
return t = class extends u {
|
|
89
|
+
constructor(...a) {
|
|
90
|
+
var d;
|
|
91
|
+
super(...a);
|
|
92
|
+
C(this, n);
|
|
93
|
+
this._value = (f(this, o), null), this.internals = this.attachInternals(), this._validityStates = /* @__PURE__ */ new Map(), y(this, n, f(this, e, !1)), f(this, i), (d = this.addEventListener) == null || d.call(this, "invalid", (b) => b.preventDefault());
|
|
80
94
|
}
|
|
81
95
|
/**
|
|
82
|
-
* Returns the form owner of
|
|
96
|
+
* Returns the form owner of this element.
|
|
83
97
|
*/
|
|
84
98
|
get form() {
|
|
85
99
|
return this.internals.form;
|
|
@@ -90,8 +104,8 @@ const I = (l) => (() => {
|
|
|
90
104
|
* @description Developer note: In this case updating the attribute must be synchronous.
|
|
91
105
|
* Due to this it is implemented as a getter/setter and the attributeChangedCallback() handles the diff check.
|
|
92
106
|
*/
|
|
93
|
-
set name(
|
|
94
|
-
this.setAttribute("name", `${
|
|
107
|
+
set name(a) {
|
|
108
|
+
this.setAttribute("name", `${a}`), this.updateFormValue();
|
|
95
109
|
}
|
|
96
110
|
get name() {
|
|
97
111
|
return this.getAttribute("name") ?? "";
|
|
@@ -101,94 +115,150 @@ const I = (l) => (() => {
|
|
|
101
115
|
return this.localName;
|
|
102
116
|
}
|
|
103
117
|
/** Value of the form element. */
|
|
104
|
-
set value(
|
|
105
|
-
this._value =
|
|
118
|
+
set value(a) {
|
|
119
|
+
this._value = a, this.updateFormValue();
|
|
106
120
|
}
|
|
107
121
|
get value() {
|
|
108
122
|
return this._value;
|
|
109
123
|
}
|
|
110
124
|
/**
|
|
111
|
-
* Returns the ValidityState object for
|
|
112
|
-
*
|
|
113
|
-
* @internal
|
|
125
|
+
* Returns the ValidityState object for this element.
|
|
114
126
|
*/
|
|
115
127
|
get validity() {
|
|
116
128
|
return this.internals.validity;
|
|
117
129
|
}
|
|
118
130
|
/**
|
|
119
|
-
* Returns the error message
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
131
|
+
* Returns the current error message, if available, which corresponds
|
|
132
|
+
* to the current validation state.
|
|
133
|
+
* Please note that only one message is returned at a time (e.g. if
|
|
134
|
+
* multiple validity states are invalid, only the chronologically first one
|
|
135
|
+
* is returned until it is fixed, at which point the next message might be
|
|
136
|
+
* returned, if it is still applicable). Also a custom validity message
|
|
137
|
+
* (see below) has precedence over native validation messages.
|
|
123
138
|
*/
|
|
124
139
|
get validationMessage() {
|
|
125
140
|
return this.internals.validationMessage;
|
|
126
141
|
}
|
|
127
142
|
/**
|
|
128
|
-
* Returns true if
|
|
143
|
+
* Returns true if this element will be validated
|
|
129
144
|
* when the form is submitted; false otherwise.
|
|
130
|
-
*
|
|
131
|
-
* @internal
|
|
132
145
|
*/
|
|
133
146
|
get willValidate() {
|
|
134
147
|
return this.internals.willValidate;
|
|
135
148
|
}
|
|
136
149
|
/** Whenever a surrounding form or fieldset is changing its disabled state. */
|
|
137
150
|
get formDisabled() {
|
|
138
|
-
return
|
|
151
|
+
return x(this, n);
|
|
139
152
|
}
|
|
140
|
-
set formDisabled(
|
|
141
|
-
|
|
153
|
+
set formDisabled(a) {
|
|
154
|
+
y(this, n, a);
|
|
142
155
|
}
|
|
143
|
-
attributeChangedCallback(
|
|
144
|
-
(
|
|
156
|
+
attributeChangedCallback(a, d, b) {
|
|
157
|
+
(a !== "name" || d !== b) && super.attributeChangedCallback(a, d, b);
|
|
145
158
|
}
|
|
146
159
|
/**
|
|
147
|
-
* Returns true if
|
|
160
|
+
* Returns true if this element has no validity problems; false otherwise.
|
|
148
161
|
* Fires an invalid event at the element in the latter case.
|
|
149
|
-
*
|
|
150
|
-
* @internal
|
|
151
162
|
*/
|
|
152
163
|
checkValidity() {
|
|
153
164
|
return this.internals.checkValidity();
|
|
154
165
|
}
|
|
155
166
|
/**
|
|
156
|
-
* Returns true if
|
|
167
|
+
* Returns true if this element has no validity problems; otherwise,
|
|
157
168
|
* returns false, fires an invalid event at the element,
|
|
158
169
|
* and (if the event isn't canceled) reports the problem to the user.
|
|
159
|
-
*
|
|
160
|
-
* @internal
|
|
161
170
|
*/
|
|
162
171
|
reportValidity() {
|
|
163
172
|
return this.internals.reportValidity();
|
|
164
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Sets the custom validity message for this element. Use the empty string
|
|
176
|
+
* to indicate that the element does not have a custom validity error.
|
|
177
|
+
*/
|
|
178
|
+
setCustomValidity(a) {
|
|
179
|
+
a ? this.setValidityFlag("customError", a) : this.removeValidityFlag("customError");
|
|
180
|
+
}
|
|
165
181
|
/**
|
|
166
182
|
* Is called whenever a surrounding form / fieldset changes disabled state.
|
|
167
183
|
* @param disabled
|
|
168
184
|
*
|
|
169
185
|
* @internal
|
|
170
186
|
*/
|
|
171
|
-
formDisabledCallback(
|
|
187
|
+
formDisabledCallback(a) {
|
|
172
188
|
Promise.resolve().then(() => {
|
|
173
|
-
this.formDisabled =
|
|
189
|
+
this.formDisabled = a;
|
|
174
190
|
});
|
|
175
191
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Marks this element as suffering from the constraint indicated by the
|
|
194
|
+
* flag argument and associates the given message to it.
|
|
195
|
+
* Note that only one message is displayed at a time and custom messages by
|
|
196
|
+
* consumers are always displayed before internal messages and internal
|
|
197
|
+
* messages are displayed in the order they were added.
|
|
198
|
+
* To set/define custom validity state flags, you need to extend the
|
|
199
|
+
* ValidityState prototype and both the ValidityState and the
|
|
200
|
+
* ValidityStateFlags interface.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
*
|
|
204
|
+
* // The type of the custom validity state does not need to be boolean.
|
|
205
|
+
* Object.assign(ValidityState.prototype, {
|
|
206
|
+
* get myError(): boolean {
|
|
207
|
+
* return false;
|
|
208
|
+
* },
|
|
209
|
+
* });
|
|
210
|
+
*
|
|
211
|
+
* declare global {
|
|
212
|
+
* interface ValidityState {
|
|
213
|
+
* myError: boolean;
|
|
214
|
+
* }
|
|
215
|
+
* interface ValidityState {
|
|
216
|
+
* myError?: boolean;
|
|
217
|
+
* }
|
|
218
|
+
* }
|
|
219
|
+
*/
|
|
220
|
+
setValidityFlag(a, d, b) {
|
|
221
|
+
b ?? (b = !0), this._validityStates.set(a, { flagValue: b, message: d }), this._setInternalValidity();
|
|
222
|
+
}
|
|
223
|
+
removeValidityFlag(a) {
|
|
224
|
+
this._validityStates.delete(a), this._setInternalValidity();
|
|
225
|
+
}
|
|
226
|
+
_setInternalValidity() {
|
|
227
|
+
var a;
|
|
228
|
+
if (this._validityStates.size) {
|
|
229
|
+
let d = (a = this._validityStates.get("customError")) == null ? void 0 : a.message;
|
|
230
|
+
const b = {};
|
|
231
|
+
this._validityStates.forEach(({ flagValue: k, message: _ }, v) => {
|
|
232
|
+
b[v] = k, d || (d = _);
|
|
233
|
+
});
|
|
234
|
+
const E = Object.keys(ValidityState.prototype).filter((k) => !(k in te) && k !== "valid");
|
|
235
|
+
for (const k of E) {
|
|
236
|
+
const _ = k in b ? b[k] : !1;
|
|
237
|
+
Object.defineProperty(this.internals.validity, k, { value: _, configurable: !0 }), _ && (b.customError = !0);
|
|
238
|
+
}
|
|
239
|
+
this.internals.setValidity(b, d), J && Object.defineProperty(this.internals.validity, "customError", {
|
|
240
|
+
value: this._validityStates.has("customError") || !!b.customError,
|
|
241
|
+
configurable: !0
|
|
242
|
+
});
|
|
243
|
+
} else
|
|
244
|
+
this.internals.setValidity({});
|
|
245
|
+
}
|
|
246
|
+
}, n = new WeakMap(), (() => {
|
|
247
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
248
|
+
p = [S()], r = [S()], h = [A()], g(t, null, p, { kind: "setter", name: "name", static: !1, private: !1, access: { has: (d) => "name" in d, set: (d, b) => {
|
|
249
|
+
d.name = b;
|
|
250
|
+
} }, metadata: a }, null, o), g(t, null, r, { kind: "setter", name: "value", static: !1, private: !1, access: { has: (d) => "value" in d, set: (d, b) => {
|
|
251
|
+
d.value = b;
|
|
252
|
+
} }, metadata: a }, null, o), g(t, null, h, { kind: "accessor", name: "formDisabled", static: !1, private: !1, access: { has: (d) => "formDisabled" in d, get: (d) => d.formDisabled, set: (d, b) => {
|
|
253
|
+
d.formDisabled = b;
|
|
254
|
+
} }, metadata: a }, e, i), a && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
185
255
|
})(), t.formAssociated = !0, t;
|
|
186
|
-
})(),
|
|
187
|
-
var
|
|
188
|
-
let
|
|
189
|
-
return
|
|
256
|
+
})(), j = (c) => (() => {
|
|
257
|
+
var r;
|
|
258
|
+
let u = c, o = [], p;
|
|
259
|
+
return r = class extends u {
|
|
190
260
|
constructor() {
|
|
191
|
-
super(...arguments), this._required = (f(this,
|
|
261
|
+
super(...arguments), this._required = (f(this, o), !1);
|
|
192
262
|
}
|
|
193
263
|
/** Whether the component is required. */
|
|
194
264
|
set required(e) {
|
|
@@ -208,21 +278,21 @@ const I = (l) => (() => {
|
|
|
208
278
|
return !1;
|
|
209
279
|
}
|
|
210
280
|
}, (() => {
|
|
211
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
} }, metadata: e }, null,
|
|
215
|
-
})(),
|
|
216
|
-
})(),
|
|
217
|
-
var
|
|
218
|
-
let
|
|
281
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
282
|
+
p = [S({ reflect: !0, type: Boolean })], g(r, null, p, { kind: "setter", name: "required", static: !1, private: !1, access: { has: (i) => "required" in i, set: (i, n) => {
|
|
283
|
+
i.required = n;
|
|
284
|
+
} }, metadata: e }, null, o), e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
285
|
+
})(), r;
|
|
286
|
+
})(), me = (c) => (() => {
|
|
287
|
+
var n;
|
|
288
|
+
let u = [P({
|
|
219
289
|
tabindex: "0"
|
|
220
|
-
})],
|
|
221
|
-
return
|
|
290
|
+
})], o, p = [], r, h = M(j(L(c))), e = [], i;
|
|
291
|
+
return n = class extends h {
|
|
222
292
|
/** Whether the checkbox is checked. */
|
|
223
293
|
set checked(s) {
|
|
224
|
-
const
|
|
225
|
-
|
|
294
|
+
const l = typeof s == "object" ? s.attribute : !1;
|
|
295
|
+
l && (s = s.value), this.hasUpdated && !l && (this._attributeMutationBlocked = !0), this._checked = !!s, this.updateFormValue();
|
|
226
296
|
}
|
|
227
297
|
get checked() {
|
|
228
298
|
return this._checked;
|
|
@@ -235,16 +305,16 @@ const I = (l) => (() => {
|
|
|
235
305
|
return "checkbox";
|
|
236
306
|
}
|
|
237
307
|
constructor() {
|
|
238
|
-
var s,
|
|
239
|
-
super(), this._attributeMutationBlocked = (f(this, e), !1), this._checked = !1, this._handleKeyboardInteraction = (
|
|
240
|
-
|
|
308
|
+
var s, l, a;
|
|
309
|
+
super(), this._attributeMutationBlocked = (f(this, e), !1), this._languageController = new z(this), this._checked = !1, this._handleKeyboardInteraction = (d) => {
|
|
310
|
+
d.key === " " && this._handleUserInteraction();
|
|
241
311
|
}, this._handleUserInteraction = () => {
|
|
242
|
-
var
|
|
243
|
-
this.disabled || ((
|
|
244
|
-
}, this.internals.role = "checkbox", (s = this.addEventListener) == null || s.call(this, "click", this._handleUserInteraction), (
|
|
312
|
+
var d;
|
|
313
|
+
this.disabled || ((d = this.withUserInteraction) == null || d.call(this), this.checked = !this.checked, this._attributeMutationBlocked = !0, this.dispatchEvent(new InputEvent("input", { composed: !0, bubbles: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
314
|
+
}, this.internals.role = "checkbox", (s = this.addEventListener) == null || s.call(this, "click", this._handleUserInteraction), (l = this.addEventListener) == null || l.call(this, "keydown", H), (a = this.addEventListener) == null || a.call(this, "keyup", this._handleKeyboardInteraction);
|
|
245
315
|
}
|
|
246
|
-
attributeChangedCallback(s,
|
|
247
|
-
(s !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(s,
|
|
316
|
+
attributeChangedCallback(s, l, a) {
|
|
317
|
+
(s !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(s, l, a);
|
|
248
318
|
}
|
|
249
319
|
/**
|
|
250
320
|
* Is called whenever the form is being reset.
|
|
@@ -263,32 +333,41 @@ const I = (l) => (() => {
|
|
|
263
333
|
*
|
|
264
334
|
* @internal
|
|
265
335
|
*/
|
|
266
|
-
formStateRestoreCallback(s,
|
|
336
|
+
formStateRestoreCallback(s, l) {
|
|
267
337
|
s && (this.checked = s === "true");
|
|
268
338
|
}
|
|
339
|
+
requestUpdate(s, l, a) {
|
|
340
|
+
super.requestUpdate(s, l, a), this.hasUpdated && (s === "checked" || s === "required" || !s) && this._setValidity();
|
|
341
|
+
}
|
|
342
|
+
firstUpdated(s) {
|
|
343
|
+
super.firstUpdated(s), this._setValidity();
|
|
344
|
+
}
|
|
269
345
|
updateFormValue() {
|
|
270
346
|
this.checked ? this.internals.setFormValue(this.value, `${this.checked}`) : this.internals.setFormValue(null);
|
|
271
347
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
348
|
+
_setValidity() {
|
|
349
|
+
this.required && !this.checked ? this.setValidityFlag("valueMissing", W[this._languageController.current]) : this.removeValidityFlag("valueMissing");
|
|
350
|
+
}
|
|
351
|
+
}, r = n, (() => {
|
|
352
|
+
const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(h[Symbol.metadata] ?? null) : void 0;
|
|
353
|
+
i = [S({
|
|
275
354
|
type: Boolean,
|
|
276
355
|
converter: {
|
|
277
|
-
...
|
|
356
|
+
...D,
|
|
278
357
|
// We need to pass information to the setter so that we know it was called by attribute change.
|
|
279
|
-
fromAttribute: (
|
|
280
|
-
var
|
|
281
|
-
return { value: (
|
|
358
|
+
fromAttribute: (l, a) => {
|
|
359
|
+
var b, E;
|
|
360
|
+
return { value: (E = (b = D).fromAttribute) == null ? void 0 : E.call(b, l, a), attribute: !0 };
|
|
282
361
|
}
|
|
283
362
|
}
|
|
284
|
-
})],
|
|
285
|
-
|
|
286
|
-
} }, metadata: s }, null, e),
|
|
287
|
-
})(),
|
|
288
|
-
})(), O = /* @__PURE__ */ new WeakMap(),
|
|
289
|
-
var
|
|
290
|
-
let
|
|
291
|
-
return
|
|
363
|
+
})], g(n, null, i, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (l) => "checked" in l, set: (l, a) => {
|
|
364
|
+
l.checked = a;
|
|
365
|
+
} }, metadata: s }, null, e), g(null, o = { value: r }, u, { kind: "class", name: r.name, metadata: s }, null, p), r = o.value, s && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s }), f(r, p);
|
|
366
|
+
})(), r;
|
|
367
|
+
})(), O = /* @__PURE__ */ new WeakMap(), fe = (c) => (() => {
|
|
368
|
+
var r;
|
|
369
|
+
let u = M(j(L(c))), o = [], p;
|
|
370
|
+
return r = class extends u {
|
|
292
371
|
/**
|
|
293
372
|
* Whether the radio button is checked.
|
|
294
373
|
*/
|
|
@@ -313,7 +392,7 @@ const I = (l) => (() => {
|
|
|
313
392
|
}
|
|
314
393
|
constructor() {
|
|
315
394
|
var e;
|
|
316
|
-
super(), this._checked = (f(this,
|
|
395
|
+
super(), this._checked = (f(this, o), !1), this.abort = new T(this), this._didLoad = !1, this._languageController = new z(this), this.internals.role = "radio", (e = this.addEventListener) == null || e.call(this, "keydown", (i) => this._handleArrowKeyDown(i));
|
|
317
396
|
}
|
|
318
397
|
connectedCallback() {
|
|
319
398
|
super.connectedCallback(), this._connectToRegistry(), this._synchronizeGroupState();
|
|
@@ -334,14 +413,17 @@ const I = (l) => (() => {
|
|
|
334
413
|
* user in which case reason is “autocomplete”.
|
|
335
414
|
* @internal
|
|
336
415
|
*/
|
|
337
|
-
formStateRestoreCallback(e,
|
|
416
|
+
formStateRestoreCallback(e, i) {
|
|
338
417
|
e && (this.checked = e === this.value);
|
|
339
418
|
}
|
|
419
|
+
requestUpdate(e, i, n) {
|
|
420
|
+
super.requestUpdate(e, i, n), this.hasUpdated && (e === "checked" || e === "required" || !e) && this._setValidity();
|
|
421
|
+
}
|
|
340
422
|
willUpdate(e) {
|
|
341
423
|
super.willUpdate(e), e.has("disabled") && this.updateFocusableRadios();
|
|
342
424
|
}
|
|
343
425
|
firstUpdated(e) {
|
|
344
|
-
super.firstUpdated(e), this._didLoad = !0, this.updateFocusableRadios();
|
|
426
|
+
super.firstUpdated(e), this._didLoad = !0, this.updateFocusableRadios(), this._setValidity();
|
|
345
427
|
}
|
|
346
428
|
/**
|
|
347
429
|
* Called on `value` change
|
|
@@ -358,8 +440,8 @@ const I = (l) => (() => {
|
|
|
358
440
|
updateFocusableRadios() {
|
|
359
441
|
if (!this._didLoad)
|
|
360
442
|
return;
|
|
361
|
-
const e = this._interactableGroupedRadios(),
|
|
362
|
-
|
|
443
|
+
const e = this._interactableGroupedRadios(), i = e.findIndex((t) => t.checked && !t.disabled && !t.formDisabled), n = i !== -1 ? i : e.findIndex((t) => !t.disabled && !t.formDisabled);
|
|
444
|
+
n !== -1 && (e[n].tabIndex = 0, e.splice(n, 1)), e.forEach((t) => t.removeAttribute("tabindex"));
|
|
363
445
|
}
|
|
364
446
|
async navigateByKeyboard(e) {
|
|
365
447
|
e.checked = !0, this.emitChangeEvents(), await e.updateComplete, e.focus();
|
|
@@ -378,23 +460,35 @@ const I = (l) => (() => {
|
|
|
378
460
|
return;
|
|
379
461
|
const e = this.form ?? this.getRootNode();
|
|
380
462
|
this._radioButtonGroupsMap = O.get(e), this._radioButtonGroupsMap || (this._radioButtonGroupsMap = /* @__PURE__ */ new Map(), O.set(e, this._radioButtonGroupsMap)), this.associatedRadioButtons = this._radioButtonGroupsMap.get(this.name), this.associatedRadioButtons || (this.associatedRadioButtons = /* @__PURE__ */ new Set(), this._radioButtonGroupsMap.set(this.name, this.associatedRadioButtons));
|
|
381
|
-
const
|
|
463
|
+
const i = Array.from(this.associatedRadioButtons);
|
|
382
464
|
this.associatedRadioButtons.clear();
|
|
383
|
-
const
|
|
384
|
-
|
|
465
|
+
const n = i.findIndex((t) => this.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
466
|
+
n !== -1 ? i.splice(n, 0, this) : i.push(this), i.forEach((t) => this.associatedRadioButtons.add(t)), this._setValidity();
|
|
385
467
|
}
|
|
386
468
|
/**
|
|
387
469
|
* Remove `this` from the radioButton registry and, if the group is empty, delete the entry from the groups Map
|
|
388
470
|
*/
|
|
389
471
|
_disconnectFromRegistry() {
|
|
390
|
-
var e,
|
|
391
|
-
(e = this.associatedRadioButtons) == null || e.delete(this), ((
|
|
472
|
+
var e, i, n;
|
|
473
|
+
(e = this.associatedRadioButtons) == null || e.delete(this), ((i = this.associatedRadioButtons) == null ? void 0 : i.size) === 0 ? (n = this._radioButtonGroupsMap) == null || n.delete(this.name) : this._setValidity(), this.associatedRadioButtons = void 0, this._radioButtonGroupsMap = void 0;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Sets the validity of all associated radio buttons.
|
|
477
|
+
* If any radio button is required, all associated are required as well.
|
|
478
|
+
*/
|
|
479
|
+
_setValidity() {
|
|
480
|
+
if (!this.associatedRadioButtons)
|
|
481
|
+
return;
|
|
482
|
+
let e = !1, i = !1;
|
|
483
|
+
for (const n of this.associatedRadioButtons)
|
|
484
|
+
e || (e = n.required), i || (i = n.checked);
|
|
485
|
+
e && !i ? this.associatedRadioButtons.forEach((n) => n.setValidityFlag("valueMissing", X[this._languageController.current])) : this.associatedRadioButtons.forEach((n) => n.removeValidityFlag("valueMissing"));
|
|
392
486
|
}
|
|
393
487
|
/**
|
|
394
488
|
* Return a list of 'interactable' grouped radios, ordered in DOM order
|
|
395
489
|
*/
|
|
396
490
|
_interactableGroupedRadios() {
|
|
397
|
-
return Array.from(this.associatedRadioButtons ?? []).filter((e) =>
|
|
491
|
+
return Array.from(this.associatedRadioButtons ?? []).filter((e) => Q.isVisible(e));
|
|
398
492
|
}
|
|
399
493
|
/**
|
|
400
494
|
* Deselect other radio of the same group
|
|
@@ -403,20 +497,20 @@ const I = (l) => (() => {
|
|
|
403
497
|
Array.from(this.associatedRadioButtons ?? []).filter((e) => e !== this).forEach((e) => e.checked = !1);
|
|
404
498
|
}
|
|
405
499
|
async _handleArrowKeyDown(e) {
|
|
406
|
-
if (!
|
|
500
|
+
if (!Y(e))
|
|
407
501
|
return;
|
|
408
502
|
e.preventDefault();
|
|
409
|
-
const
|
|
410
|
-
await this.navigateByKeyboard(
|
|
503
|
+
const i = this._interactableGroupedRadios().filter((s) => !s.disabled && !s.formDisabled), n = i.indexOf(this), t = Z(e, n, i.length);
|
|
504
|
+
await this.navigateByKeyboard(i[t]);
|
|
411
505
|
}
|
|
412
506
|
}, (() => {
|
|
413
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
} }, metadata: e }, null,
|
|
417
|
-
})(),
|
|
418
|
-
})(),
|
|
419
|
-
class
|
|
507
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
508
|
+
p = [S({ type: Boolean })], g(r, null, p, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (i) => "checked" in i, set: (i, n) => {
|
|
509
|
+
i.checked = n;
|
|
510
|
+
} }, metadata: e }, null, o), e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
511
|
+
})(), r;
|
|
512
|
+
})(), se = (c) => {
|
|
513
|
+
class m extends c {
|
|
420
514
|
/**
|
|
421
515
|
* Returns a Promise that resolves when the element has completed hydration.
|
|
422
516
|
* The Promise value is a boolean that is `true` if the element required hydration
|
|
@@ -432,34 +526,34 @@ const I = (l) => (() => {
|
|
|
432
526
|
get hydrationRequired() {
|
|
433
527
|
return this._hydrationRequired;
|
|
434
528
|
}
|
|
435
|
-
constructor(...
|
|
436
|
-
var
|
|
437
|
-
if (super(...
|
|
529
|
+
constructor(...o) {
|
|
530
|
+
var p;
|
|
531
|
+
if (super(...o), this._hydrationComplete = new Promise((r) => this._resolveHydration = r), this._hydrationRequired = !!this.shadowRoot, !this._hydrationRequired)
|
|
438
532
|
this._resolveHydration(!1);
|
|
439
533
|
else {
|
|
440
|
-
const
|
|
441
|
-
this._hydrationRequired &&
|
|
442
|
-
},
|
|
443
|
-
e != null && e.length && (e.forEach((
|
|
444
|
-
|
|
534
|
+
const r = (i) => {
|
|
535
|
+
this._hydrationRequired && i.stopImmediatePropagation();
|
|
536
|
+
}, h = { capture: !0 }, e = (p = this.shadowRoot) == null ? void 0 : p.querySelectorAll("slot");
|
|
537
|
+
e != null && e.length && (e.forEach((i) => i.addEventListener("slotchange", r, h)), this.hydrationComplete.then(() => e.forEach((i) => {
|
|
538
|
+
i.removeEventListener("slotchange", r, h), i.assignedNodes().length && i.dispatchEvent(new Event("slotchange", { bubbles: !0 }));
|
|
445
539
|
})));
|
|
446
540
|
}
|
|
447
541
|
}
|
|
448
|
-
update(
|
|
449
|
-
super.update(
|
|
542
|
+
update(o) {
|
|
543
|
+
super.update(o), this._hydrationRequired && (this._hydrationRequired = !1, this._resolveHydration(!0));
|
|
450
544
|
}
|
|
451
545
|
}
|
|
452
|
-
return
|
|
453
|
-
},
|
|
454
|
-
var
|
|
455
|
-
let
|
|
456
|
-
return e = class extends
|
|
546
|
+
return m;
|
|
547
|
+
}, F = "data-ssr-child-count", U = "li", ve = (c) => (() => {
|
|
548
|
+
var h, e;
|
|
549
|
+
let u = se(c), o, p = [], r = [];
|
|
550
|
+
return e = class extends u {
|
|
457
551
|
constructor() {
|
|
458
552
|
super(...arguments);
|
|
459
|
-
|
|
460
|
-
|
|
553
|
+
C(this, h);
|
|
554
|
+
y(this, h, f(this, p, [])), this._handleSlotchange = (f(this, r), () => {
|
|
461
555
|
const t = Array.from(this.children ?? []).filter((s) => this.listChildLocalNames.includes(s.localName));
|
|
462
|
-
t.length === this.listChildren.length && this.listChildren.every((s,
|
|
556
|
+
t.length === this.listChildren.length && this.listChildren.every((s, l) => t[l] === s) || (this.listChildren.filter((s) => !t.includes(s)).forEach((s) => s.removeAttribute("slot")), this.listChildren = t, this.listChildren.forEach((s, l) => s.setAttribute("slot", `${U}-${l}`)), this.removeAttribute(F));
|
|
463
557
|
});
|
|
464
558
|
}
|
|
465
559
|
/**
|
|
@@ -468,10 +562,10 @@ const I = (l) => (() => {
|
|
|
468
562
|
* to the child elements.
|
|
469
563
|
*/
|
|
470
564
|
get listChildren() {
|
|
471
|
-
return
|
|
565
|
+
return x(this, h);
|
|
472
566
|
}
|
|
473
567
|
set listChildren(t) {
|
|
474
|
-
|
|
568
|
+
y(this, h, t);
|
|
475
569
|
}
|
|
476
570
|
connectedCallback() {
|
|
477
571
|
var t;
|
|
@@ -491,23 +585,23 @@ const I = (l) => (() => {
|
|
|
491
585
|
* children to be passed via the `data-ssr-child-count` attribute value.
|
|
492
586
|
*/
|
|
493
587
|
renderList(t = {}, s = {}) {
|
|
494
|
-
const
|
|
495
|
-
return
|
|
588
|
+
const l = this.listSlotEntries(s);
|
|
589
|
+
return l.length >= 2 ? I`
|
|
496
590
|
<ul
|
|
497
591
|
class=${t.class || this.localName}
|
|
498
|
-
aria-label=${t.ariaLabel ||
|
|
499
|
-
aria-labelledby=${t.ariaLabelledby ||
|
|
592
|
+
aria-label=${t.ariaLabel || B}
|
|
593
|
+
aria-labelledby=${t.ariaLabelledby || B}
|
|
500
594
|
>
|
|
501
|
-
${
|
|
502
|
-
<li aria-hidden=${
|
|
503
|
-
<slot name=${
|
|
595
|
+
${l.map((a) => I`
|
|
596
|
+
<li aria-hidden=${a.ariaHidden || B}>
|
|
597
|
+
<slot name=${a.name}></slot>
|
|
504
598
|
</li>
|
|
505
599
|
`)}
|
|
506
600
|
</ul>
|
|
507
601
|
${this.renderHiddenSlot()}
|
|
508
|
-
` :
|
|
602
|
+
` : l.length === 1 ? I`<sbb-screen-reader-only>${t.ariaLabel}</sbb-screen-reader-only>
|
|
509
603
|
<span class=${t.class || this.localName}>
|
|
510
|
-
<span><slot name=${
|
|
604
|
+
<span><slot name=${l[0].name}></slot></span>
|
|
511
605
|
</span>
|
|
512
606
|
${this.renderHiddenSlot()} ` : this.renderHiddenSlot();
|
|
513
607
|
}
|
|
@@ -521,11 +615,11 @@ const I = (l) => (() => {
|
|
|
521
615
|
* children to be passed via the `data-ssr-child-count` attribute value.
|
|
522
616
|
*/
|
|
523
617
|
listSlotEntries(t) {
|
|
524
|
-
return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(
|
|
525
|
-
var
|
|
618
|
+
return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(F) ?? 0) })).map((l, a) => {
|
|
619
|
+
var d;
|
|
526
620
|
return {
|
|
527
|
-
name: `${
|
|
528
|
-
ariaHidden: ((
|
|
621
|
+
name: `${U}-${a}`,
|
|
622
|
+
ariaHidden: ((d = t == null ? void 0 : t.localNameVisualOnly) == null ? void 0 : d.includes(l.localName)) ?? !1
|
|
529
623
|
};
|
|
530
624
|
});
|
|
531
625
|
}
|
|
@@ -535,115 +629,115 @@ const I = (l) => (() => {
|
|
|
535
629
|
* the slotchange event, which can be used to assign it to the appropriate named slot.
|
|
536
630
|
*/
|
|
537
631
|
renderHiddenSlot() {
|
|
538
|
-
return
|
|
632
|
+
return I`<span hidden><slot></slot></span>`;
|
|
539
633
|
}
|
|
540
|
-
},
|
|
541
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
542
|
-
|
|
543
|
-
s.listChildren =
|
|
544
|
-
} }, metadata: t },
|
|
634
|
+
}, h = new WeakMap(), (() => {
|
|
635
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
636
|
+
o = [A()], g(e, null, o, { kind: "accessor", name: "listChildren", static: !1, private: !1, access: { has: (s) => "listChildren" in s, get: (s) => s.listChildren, set: (s, l) => {
|
|
637
|
+
s.listChildren = l;
|
|
638
|
+
} }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
545
639
|
})(), e;
|
|
546
|
-
})(),
|
|
547
|
-
var
|
|
548
|
-
let
|
|
549
|
-
return e = class extends
|
|
640
|
+
})(), _e = (c) => (() => {
|
|
641
|
+
var h, e;
|
|
642
|
+
let u = c, o, p = [], r = [];
|
|
643
|
+
return e = class extends u {
|
|
550
644
|
constructor() {
|
|
551
645
|
super(...arguments);
|
|
552
|
-
|
|
553
|
-
f(this,
|
|
646
|
+
C(this, h, f(this, p, !1));
|
|
647
|
+
f(this, r);
|
|
554
648
|
}
|
|
555
649
|
/** Negative coloring variant flag. */
|
|
556
650
|
get negative() {
|
|
557
|
-
return
|
|
651
|
+
return x(this, h);
|
|
558
652
|
}
|
|
559
653
|
set negative(t) {
|
|
560
|
-
|
|
654
|
+
y(this, h, t);
|
|
561
655
|
}
|
|
562
|
-
},
|
|
563
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
564
|
-
|
|
565
|
-
s.negative =
|
|
566
|
-
} }, metadata: t },
|
|
656
|
+
}, h = new WeakMap(), (() => {
|
|
657
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
658
|
+
o = [R(), S({ reflect: !0, type: Boolean })], g(e, null, o, { kind: "accessor", name: "negative", static: !1, private: !1, access: { has: (s) => "negative" in s, get: (s) => s.negative, set: (s, l) => {
|
|
659
|
+
s.negative = l;
|
|
660
|
+
} }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
567
661
|
})(), e;
|
|
568
|
-
})(),
|
|
569
|
-
var
|
|
570
|
-
let
|
|
571
|
-
return
|
|
662
|
+
})(), ye = (c) => (() => {
|
|
663
|
+
var l, a, d, b;
|
|
664
|
+
let u = c, o, p = [], r = [], h, e = [], i = [], n, t = [], s = [];
|
|
665
|
+
return b = class extends u {
|
|
572
666
|
constructor() {
|
|
573
667
|
super(...arguments);
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
668
|
+
C(this, l);
|
|
669
|
+
C(this, a);
|
|
670
|
+
C(this, d);
|
|
671
|
+
y(this, l, f(this, p, "white")), y(this, a, (f(this, r), f(this, e, !1))), y(this, d, (f(this, i), f(this, t, ""))), this._panelConnected = (f(this, s), new K(this, b.events.panelConnected, { bubbles: !0 }));
|
|
578
672
|
}
|
|
579
673
|
/** The background color of the panel. */
|
|
580
674
|
get color() {
|
|
581
|
-
return
|
|
675
|
+
return x(this, l);
|
|
582
676
|
}
|
|
583
|
-
set color(
|
|
584
|
-
|
|
677
|
+
set color(_) {
|
|
678
|
+
y(this, l, _);
|
|
585
679
|
}
|
|
586
680
|
/** Whether the unselected panel has a border. */
|
|
587
681
|
get borderless() {
|
|
588
|
-
return
|
|
682
|
+
return x(this, a);
|
|
589
683
|
}
|
|
590
|
-
set borderless(
|
|
591
|
-
|
|
684
|
+
set borderless(_) {
|
|
685
|
+
y(this, a, _);
|
|
592
686
|
}
|
|
593
687
|
/** @internal used for accessibility label when in expansion panel */
|
|
594
688
|
get expansionState() {
|
|
595
|
-
return
|
|
689
|
+
return x(this, d);
|
|
596
690
|
}
|
|
597
|
-
set expansionState(
|
|
598
|
-
|
|
691
|
+
set expansionState(_) {
|
|
692
|
+
y(this, d, _);
|
|
599
693
|
}
|
|
600
694
|
connectedCallback() {
|
|
601
695
|
super.connectedCallback(), this._panelConnected.emit();
|
|
602
696
|
}
|
|
603
|
-
},
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
} }, metadata:
|
|
608
|
-
|
|
609
|
-
} }, metadata:
|
|
610
|
-
|
|
611
|
-
} }, metadata:
|
|
612
|
-
})(),
|
|
697
|
+
}, l = new WeakMap(), a = new WeakMap(), d = new WeakMap(), (() => {
|
|
698
|
+
const _ = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
699
|
+
o = [S()], h = [R(), S({ reflect: !0, type: Boolean })], n = [R(), S()], g(b, null, o, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (v) => "color" in v, get: (v) => v.color, set: (v, w) => {
|
|
700
|
+
v.color = w;
|
|
701
|
+
} }, metadata: _ }, p, r), g(b, null, h, { kind: "accessor", name: "borderless", static: !1, private: !1, access: { has: (v) => "borderless" in v, get: (v) => v.borderless, set: (v, w) => {
|
|
702
|
+
v.borderless = w;
|
|
703
|
+
} }, metadata: _ }, e, i), g(b, null, n, { kind: "accessor", name: "expansionState", static: !1, private: !1, access: { has: (v) => "expansionState" in v, get: (v) => v.expansionState, set: (v, w) => {
|
|
704
|
+
v.expansionState = w;
|
|
705
|
+
} }, metadata: _ }, t, s), _ && Object.defineProperty(b, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: _ });
|
|
706
|
+
})(), b.events = {
|
|
613
707
|
panelConnected: "panelConnected"
|
|
614
|
-
},
|
|
615
|
-
})(),
|
|
616
|
-
class
|
|
708
|
+
}, b;
|
|
709
|
+
})(), ge = (c) => {
|
|
710
|
+
class m extends c {
|
|
617
711
|
constructor() {
|
|
618
712
|
super(...arguments), this._updatePromise = Promise.resolve(), this._updateResolve = () => {
|
|
619
713
|
};
|
|
620
714
|
}
|
|
621
715
|
startUpdate() {
|
|
622
|
-
this._updatePromise = new Promise((
|
|
716
|
+
this._updatePromise = new Promise((o) => this._updateResolve = o);
|
|
623
717
|
}
|
|
624
718
|
completeUpdate() {
|
|
625
719
|
this._updateResolve();
|
|
626
720
|
}
|
|
627
721
|
async getUpdateComplete() {
|
|
628
|
-
const
|
|
629
|
-
return await this._updatePromise,
|
|
722
|
+
const o = await super.getUpdateComplete();
|
|
723
|
+
return await this._updatePromise, o;
|
|
630
724
|
}
|
|
631
725
|
}
|
|
632
|
-
return
|
|
633
|
-
},
|
|
726
|
+
return m;
|
|
727
|
+
}, Se = $`:host{--sbb-selection-panel-background: var( --sbb-selection-expansion-panel-inner-background, var(--sbb-color-white) );--sbb-selection-panel-border-color: var(--sbb-color-cloud);--sbb-selection-panel-border-radius: var( --sbb-selection-expansion-panel-border-radius, var(--sbb-border-radius-4x) );--sbb-selection-panel-border-width: var( --sbb-selection-expansion-panel-inner-border-width, var(--sbb-border-width-1x) );--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xs) var(--sbb-spacing-responsive-xxs);--sbb-selection-panel-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-selection-panel-cursor: pointer;--sbb-selection-panel-suffix-color: var(--sbb-color-charcoal);--sbb-selection-panel-subtext-color: var(--sbb-color-granite);display:block;outline:none!important}:host([size=s]){--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xxxs)}:host([color=milk]){--sbb-selection-panel-background: var( --sbb-selection-expansion-panel-inner-background, var(--sbb-color-milk) )}:host([borderless]:not([data-checked])){--sbb-selection-panel-border-color: transparent}:host(:is([data-checked]):not(:disabled,[disabled])){--sbb-selection-panel-border-color: var(--sbb-color-charcoal);--sbb-selection-panel-border-width: var( --sbb-selection-expansion-panel-inner-border-width, var(--sbb-border-width-2x) )}:host(:is(:disabled,[disabled])){--sbb-selection-panel-cursor: default}.sbb-selection-panel{display:block;cursor:var(--sbb-selection-panel-cursor);position:relative;border-radius:var(--sbb-selection-panel-border-radius);box-shadow:inset 0 0 0 var(--sbb-selection-panel-border-width) var(--sbb-selection-panel-border-color);padding:var(--sbb-selection-panel-input-padding);background-color:var(--sbb-selection-panel-background);transition-duration:var(--sbb-selection-panel-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-property:box-shadow}@media (forced-colors: active){.sbb-selection-panel:after{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:var(--sbb-selection-panel-border-width) solid var(--sbb-selection-panel-border-color);border-radius:var(--sbb-selection-panel-border-radius)}}:host(:focus-visible) .sbb-selection-panel{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width)}.sbb-selection-panel__badge{-webkit-user-select:none;user-select:none;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--sbb-selection-panel-border-radius);overflow:hidden}slot[name=suffix]{color:var(--sbb-selection-panel-suffix-color)}slot[name=subtext]{display:block;color:var(--sbb-selection-panel-subtext-color);padding-inline-start:var(--sbb-spacing-fixed-8x)}:host(:not([data-slot-names~=subtext])) slot[name=subtext]{display:none}`;
|
|
634
728
|
export {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
729
|
+
ee as SbbDisabledInteractiveMixin,
|
|
730
|
+
M as SbbDisabledMixin,
|
|
731
|
+
pe as SbbDisabledTabIndexActionMixin,
|
|
732
|
+
me as SbbFormAssociatedCheckboxMixin,
|
|
639
733
|
L as SbbFormAssociatedMixin,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
734
|
+
fe as SbbFormAssociatedRadioButtonMixin,
|
|
735
|
+
se as SbbHydrationMixin,
|
|
736
|
+
ve as SbbNamedSlotListMixin,
|
|
737
|
+
_e as SbbNegativeMixin,
|
|
738
|
+
ye as SbbPanelMixin,
|
|
739
|
+
j as SbbRequiredMixin,
|
|
740
|
+
ge as SbbUpdateSchedulerMixin,
|
|
741
|
+
Se as panelCommonStyle,
|
|
648
742
|
O as radioButtonRegistry
|
|
649
743
|
};
|