@sbb-esta/lyne-elements 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.d.ts +1 -1
- package/accordion/accordion.d.ts.map +1 -1
- package/alert/alert/alert.d.ts +1 -1
- package/alert/alert/alert.d.ts.map +1 -1
- package/button/common/button-common.d.ts.map +1 -1
- package/button/mini-button.js +5 -5
- package/calendar/calendar.d.ts +3 -1
- package/calendar/calendar.d.ts.map +1 -1
- package/calendar.js +62 -52
- package/card/common/card-action-common.d.ts.map +1 -1
- package/checkbox/common/checkbox-common.d.ts.map +1 -1
- package/clock/clock.d.ts +19 -13
- package/clock/clock.d.ts.map +1 -1
- package/clock.js +93 -87
- package/core/decorators/host-attributes.d.ts.map +1 -1
- package/core/eventing/throttle.d.ts.map +1 -1
- package/core/i18n/i18n.d.ts +1 -3
- package/core/i18n/i18n.d.ts.map +1 -1
- package/core/i18n.js +91 -127
- package/core/mixins/disabled-mixin.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.map +1 -1
- package/core/mixins/hydration-mixin.d.ts +2 -8
- package/core/mixins/hydration-mixin.d.ts.map +1 -1
- package/core/mixins/named-slot-list-mixin.d.ts.map +1 -1
- package/core/mixins/negative-mixin.d.ts.map +1 -1
- package/core/mixins/panel-mixin.d.ts.map +1 -1
- package/core/mixins/required-mixin.d.ts.map +1 -1
- package/core/mixins/update-scheduler-mixin.d.ts.map +1 -1
- package/core/mixins.js +133 -148
- package/core/observers/intersection-observer.d.ts +1 -1
- package/core/styles/_index.scss +1 -0
- package/core/styles/mixins/buttons.scss +1 -1
- package/core/styles/mixins/table.scss +148 -0
- package/core/styles/standard-theme.scss +1 -0
- package/core/styles/table.scss +56 -0
- package/core/testing/private.d.ts +0 -1
- package/core/testing/private.d.ts.map +1 -1
- package/core/testing/wait-for-render.d.ts +1 -1
- package/core/testing/wait-for-render.d.ts.map +1 -1
- package/core/testing.js +40 -37
- package/custom-elements.json +498 -997
- package/datepicker/datepicker-next-day.js +5 -5
- package/datepicker/datepicker-previous-day.js +1 -1
- package/datepicker/datepicker-toggle.js +7 -7
- package/development/accordion/accordion.d.ts +1 -1
- package/development/accordion/accordion.d.ts.map +1 -1
- package/development/accordion.js +7 -1
- package/development/action-group.js +7 -1
- package/development/alert/alert/alert.d.ts +1 -1
- package/development/alert/alert/alert.d.ts.map +1 -1
- package/development/alert/alert-group.js +7 -1
- package/development/alert/alert.js +7 -1
- package/development/autocomplete.js +7 -1
- package/development/breadcrumb/breadcrumb-group.js +7 -1
- package/development/breadcrumb/breadcrumb.js +7 -1
- package/development/button/common/button-common.d.ts.map +1 -1
- package/development/button/common.js +7 -1
- package/development/button/mini-button.js +8 -2
- package/development/calendar/calendar.d.ts +3 -1
- package/development/calendar/calendar.d.ts.map +1 -1
- package/development/calendar.js +18 -2
- package/development/card/card-badge.js +7 -1
- package/development/card/card.js +7 -1
- package/development/card/common/card-action-common.d.ts.map +1 -1
- package/development/card/common.js +7 -1
- package/development/checkbox/checkbox-group.js +7 -1
- package/development/checkbox/checkbox.js +7 -1
- package/development/checkbox/common/checkbox-common.d.ts.map +1 -1
- package/development/checkbox/common.js +7 -1
- package/development/chip.js +7 -1
- package/development/clock/clock.d.ts +19 -13
- package/development/clock/clock.d.ts.map +1 -1
- package/development/clock.js +103 -94
- package/development/container/container.js +7 -1
- package/development/container/sticky-bar.js +7 -1
- package/development/core/decorators/host-attributes.d.ts.map +1 -1
- package/development/core/eventing/throttle.d.ts.map +1 -1
- package/development/core/i18n/i18n.d.ts +1 -3
- package/development/core/i18n/i18n.d.ts.map +1 -1
- package/development/core/i18n.js +5 -43
- package/development/core/mixins/disabled-mixin.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.map +1 -1
- package/development/core/mixins/hydration-mixin.d.ts +2 -8
- package/development/core/mixins/hydration-mixin.d.ts.map +1 -1
- package/development/core/mixins/named-slot-list-mixin.d.ts.map +1 -1
- package/development/core/mixins/negative-mixin.d.ts.map +1 -1
- package/development/core/mixins/panel-mixin.d.ts.map +1 -1
- package/development/core/mixins/required-mixin.d.ts.map +1 -1
- package/development/core/mixins/update-scheduler-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +39 -50
- package/development/core/observers/intersection-observer.d.ts +1 -1
- package/development/core/testing/private.d.ts +0 -1
- package/development/core/testing/private.d.ts.map +1 -1
- package/development/core/testing/wait-for-render.d.ts +1 -1
- package/development/core/testing/wait-for-render.d.ts.map +1 -1
- package/development/core/testing.js +6 -2
- package/development/datepicker/datepicker-next-day.js +8 -2
- package/development/datepicker/datepicker-previous-day.js +8 -2
- package/development/datepicker/datepicker-toggle.js +7 -2
- package/development/datepicker/datepicker.js +7 -1
- package/development/dialog/dialog-actions.js +7 -1
- package/development/dialog/dialog-content.js +7 -1
- package/development/dialog/dialog-title.js +7 -1
- package/development/dialog/dialog.js +7 -1
- package/development/divider.js +7 -1
- package/development/expansion-panel/expansion-panel-content.js +7 -1
- package/development/expansion-panel/expansion-panel-header.js +7 -1
- package/development/expansion-panel/expansion-panel.js +7 -1
- package/development/file-selector.js +7 -1
- package/development/footer.js +7 -1
- package/development/form-error.js +7 -1
- package/development/form-field/form-field-clear.js +8 -2
- package/development/form-field/form-field.js +7 -1
- package/development/header/common/header-action-common.d.ts.map +1 -1
- package/development/header/common.js +7 -1
- package/development/header/header.js +7 -1
- package/development/icon/icon-name-mixin.d.ts.map +1 -1
- package/development/icon/icon-request.d.ts.map +1 -1
- package/development/icon.js +14 -13
- package/development/image.js +7 -1
- package/development/journey-header.js +7 -1
- package/development/lead-container.js +7 -1
- package/development/link/common/block-link-common.d.ts.map +1 -1
- package/development/link/common/inline-link-common.d.ts.map +1 -1
- package/development/link/common/link-common.d.ts.map +1 -1
- package/development/link/common.js +19 -1
- package/development/link-list.js +7 -1
- package/development/loading-indicator.js +7 -1
- package/development/logo.js +7 -1
- package/development/map-container.js +7 -1
- package/development/menu/common/menu-action-common.d.ts.map +1 -1
- package/development/menu/common.js +7 -1
- package/development/menu/menu.js +7 -1
- package/development/message.js +7 -1
- package/development/navigation/common/navigation-action-common.d.ts.map +1 -1
- package/development/navigation/common.js +7 -1
- package/development/navigation/navigation-list.js +7 -1
- package/development/navigation/navigation-marker.js +7 -1
- package/development/navigation/navigation-section.js +7 -1
- package/development/navigation/navigation.js +7 -1
- package/development/notification.js +8 -1
- package/development/option/optgroup/optgroup.d.ts +2 -0
- package/development/option/optgroup/optgroup.d.ts.map +1 -1
- package/development/option/optgroup.js +21 -4
- package/development/option/option/option.d.ts +6 -5
- package/development/option/option/option.d.ts.map +1 -1
- package/development/option/option.js +53 -29
- package/development/overlay.js +7 -1
- package/development/popover/popover-trigger.js +8 -2
- package/development/popover/popover.js +7 -1
- package/development/radio-button/common/radio-button-common.d.ts.map +1 -1
- package/development/radio-button/common.js +7 -1
- package/development/radio-button/radio-button-group.js +7 -1
- package/development/radio-button/radio-button.js +7 -1
- package/development/screen-reader-only.js +7 -1
- package/development/select.js +7 -1
- package/development/selection-expansion-panel.js +7 -1
- package/development/signet.js +7 -1
- package/development/skiplink-list.js +7 -1
- package/development/slider.js +7 -1
- package/development/status.js +7 -1
- package/development/stepper/step-label.js +7 -1
- package/development/stepper/step.js +7 -1
- package/development/stepper/stepper.js +7 -1
- package/development/table/table-wrapper/table-wrapper.d.ts +24 -0
- package/development/table/table-wrapper/table-wrapper.d.ts.map +1 -0
- package/development/table/table-wrapper.d.ts +2 -0
- package/development/table/table-wrapper.d.ts.map +1 -0
- package/development/table/table-wrapper.js +130 -0
- package/development/table.d.ts +2 -0
- package/development/table.d.ts.map +1 -0
- package/development/table.js +2 -0
- package/development/tabs/tab-group/tab-group.d.ts +4 -7
- package/development/tabs/tab-group/tab-group.d.ts.map +1 -1
- package/development/tabs/tab-group.js +69 -73
- package/development/tabs/tab-label.js +7 -1
- package/development/tabs/tab.js +7 -1
- package/development/tag/tag-group.js +7 -1
- package/development/tag/tag.js +7 -1
- package/development/teaser.js +7 -1
- package/development/time-input.js +7 -1
- package/development/timetable-occupancy-icon.js +7 -1
- package/development/timetable-occupancy.js +7 -1
- package/development/title.js +13 -1
- package/development/toast.js +7 -1
- package/development/toggle/toggle-option.js +7 -1
- package/development/toggle/toggle.js +7 -1
- package/development/toggle-check/toggle-check.d.ts +2 -2
- package/development/toggle-check/toggle-check.d.ts.map +1 -1
- package/development/toggle-check.js +7 -1
- package/development/train/train-blocked-passage.js +7 -1
- package/development/train/train-formation.js +7 -1
- package/development/train/train-wagon.js +7 -1
- package/development/train/train.js +7 -1
- package/development/visual-checkbox.js +9 -3
- package/form-field/form-field-clear.js +1 -1
- package/header/common/header-action-common.d.ts.map +1 -1
- package/icon/icon-name-mixin.d.ts.map +1 -1
- package/icon/icon-request.d.ts.map +1 -1
- package/icon.js +86 -86
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/link/common/block-link-common.d.ts.map +1 -1
- package/link/common/inline-link-common.d.ts.map +1 -1
- package/link/common/link-common.d.ts.map +1 -1
- package/menu/common/menu-action-common.d.ts.map +1 -1
- package/navigation/common/navigation-action-common.d.ts.map +1 -1
- package/notification.js +1 -1
- package/option/optgroup/optgroup.d.ts +2 -0
- package/option/optgroup/optgroup.d.ts.map +1 -1
- package/option/optgroup.js +24 -21
- package/option/option/option.d.ts +6 -5
- package/option/option/option.d.ts.map +1 -1
- package/option/option.js +72 -69
- package/package.json +11 -1
- package/popover/popover-trigger.js +1 -1
- package/radio-button/common/radio-button-common.d.ts.map +1 -1
- package/standard-theme.css +196 -0
- package/table/table-wrapper/table-wrapper.d.ts +24 -0
- package/table/table-wrapper/table-wrapper.d.ts.map +1 -0
- package/table/table-wrapper.d.ts +2 -0
- package/table/table-wrapper.d.ts.map +1 -0
- package/table/table-wrapper.js +39 -0
- package/table.d.ts +2 -0
- package/table.d.ts.map +1 -0
- package/table.js +1 -0
- package/tabs/tab-group/tab-group.d.ts +4 -7
- package/tabs/tab-group/tab-group.d.ts.map +1 -1
- package/tabs/tab-group.js +80 -81
- package/toggle-check/toggle-check.d.ts +2 -2
- package/toggle-check/toggle-check.d.ts.map +1 -1
- package/visual-checkbox.js +4 -4
package/core/mixins.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { property as o, state as
|
|
2
|
-
import { defaultConverter as
|
|
3
|
-
import { hostAttributes as
|
|
4
|
-
import { preventScrollOnSpacebarPress as
|
|
5
|
-
import { getLocalName as
|
|
1
|
+
import { property as o, state as y } from "lit/decorators.js";
|
|
2
|
+
import { defaultConverter as u, html as b, nothing as p, css as x } from "lit";
|
|
3
|
+
import { hostAttributes as k } from "./decorators.js";
|
|
4
|
+
import { preventScrollOnSpacebarPress as v, EventEmitter as w } from "./eventing.js";
|
|
5
|
+
import { getLocalName as f } from "./dom.js";
|
|
6
6
|
import "../screen-reader-only.js";
|
|
7
|
-
var
|
|
8
|
-
for (var e = E(
|
|
9
|
-
(a = n[i]) && (e = a(
|
|
10
|
-
return e &&
|
|
7
|
+
var S = Object.defineProperty, E = Object.getOwnPropertyDescriptor, P = (n, s, r, t) => {
|
|
8
|
+
for (var e = E(s, r), i = n.length - 1, a; i >= 0; i--)
|
|
9
|
+
(a = n[i]) && (e = a(s, r, e) || e);
|
|
10
|
+
return e && S(s, r, e), e;
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
class
|
|
12
|
+
const C = (n) => {
|
|
13
|
+
class s extends n {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments), this._disabled = !1;
|
|
16
16
|
}
|
|
@@ -30,22 +30,22 @@ const y = (n) => {
|
|
|
30
30
|
}
|
|
31
31
|
return P([
|
|
32
32
|
o({ reflect: !0, type: Boolean })
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
class
|
|
33
|
+
], s.prototype, "disabled"), s;
|
|
34
|
+
}, J = (n) => {
|
|
35
|
+
class s extends C(n) {
|
|
36
36
|
willUpdate(t) {
|
|
37
37
|
super.willUpdate(t), t.has("disabled") && (this.disabled ? (this.setAttribute("aria-disabled", "true"), this.removeAttribute("tabindex")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0")));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return s;
|
|
41
41
|
};
|
|
42
|
-
var $ = Object.defineProperty, R = Object.getOwnPropertyDescriptor,
|
|
43
|
-
for (var e = t > 1 ? void 0 : t ? R(
|
|
44
|
-
(a = n[i]) && (e = (t ? a(
|
|
45
|
-
return t && e && $(
|
|
42
|
+
var $ = Object.defineProperty, R = Object.getOwnPropertyDescriptor, c = (n, s, r, t) => {
|
|
43
|
+
for (var e = t > 1 ? void 0 : t ? R(s, r) : s, i = n.length - 1, a; i >= 0; i--)
|
|
44
|
+
(a = n[i]) && (e = (t ? a(s, r, e) : a(e)) || e);
|
|
45
|
+
return t && e && $(s, r, e), e;
|
|
46
46
|
};
|
|
47
47
|
const A = (n) => {
|
|
48
|
-
const
|
|
48
|
+
const r = class r extends n {
|
|
49
49
|
constructor() {
|
|
50
50
|
super(...arguments), this._value = null, this.internals = this.attachInternals(), this.formDisabled = !1;
|
|
51
51
|
}
|
|
@@ -133,23 +133,23 @@ const A = (n) => {
|
|
|
133
133
|
this.internals.setFormValue(this.value);
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
-
|
|
137
|
-
let
|
|
138
|
-
return
|
|
136
|
+
r.formAssociated = !0;
|
|
137
|
+
let s = r;
|
|
138
|
+
return c([
|
|
139
139
|
o()
|
|
140
|
-
],
|
|
140
|
+
], s.prototype, "name", 1), c([
|
|
141
141
|
o()
|
|
142
|
-
],
|
|
143
|
-
|
|
144
|
-
],
|
|
142
|
+
], s.prototype, "value", 1), c([
|
|
143
|
+
y()
|
|
144
|
+
], s.prototype, "formDisabled", 2), s;
|
|
145
145
|
};
|
|
146
|
-
var O = Object.defineProperty, q = Object.getOwnPropertyDescriptor, L = (n,
|
|
147
|
-
for (var e = q(
|
|
148
|
-
(a = n[i]) && (e = a(
|
|
149
|
-
return e && O(
|
|
146
|
+
var O = Object.defineProperty, q = Object.getOwnPropertyDescriptor, L = (n, s, r, t) => {
|
|
147
|
+
for (var e = q(s, r), i = n.length - 1, a; i >= 0; i--)
|
|
148
|
+
(a = n[i]) && (e = a(s, r, e) || e);
|
|
149
|
+
return e && O(s, r, e), e;
|
|
150
150
|
};
|
|
151
|
-
const
|
|
152
|
-
class
|
|
151
|
+
const D = (n) => {
|
|
152
|
+
class s extends n {
|
|
153
153
|
constructor() {
|
|
154
154
|
super(...arguments), this._required = !1;
|
|
155
155
|
}
|
|
@@ -172,38 +172,38 @@ const U = (n) => {
|
|
|
172
172
|
}
|
|
173
173
|
return L([
|
|
174
174
|
o({ reflect: !0, type: Boolean })
|
|
175
|
-
],
|
|
175
|
+
], s.prototype, "required"), s;
|
|
176
176
|
};
|
|
177
|
-
var
|
|
178
|
-
for (var e = t > 1 ? void 0 : t ?
|
|
179
|
-
(a = n[i]) && (e = (t ? a(
|
|
180
|
-
return t && e &&
|
|
177
|
+
var M = Object.defineProperty, U = Object.getOwnPropertyDescriptor, m = (n, s, r, t) => {
|
|
178
|
+
for (var e = t > 1 ? void 0 : t ? U(s, r) : s, i = n.length - 1, a; i >= 0; i--)
|
|
179
|
+
(a = n[i]) && (e = (t ? a(s, r, e) : a(e)) || e);
|
|
180
|
+
return t && e && M(s, r, e), e;
|
|
181
181
|
};
|
|
182
|
-
const
|
|
183
|
-
let
|
|
182
|
+
const Q = (n) => {
|
|
183
|
+
let s = class extends C(D(A(n))) {
|
|
184
184
|
constructor() {
|
|
185
|
-
super(), this._attributeMutationBlocked = !1, this._checked = !1, this._handleKeyboardInteraction = (
|
|
186
|
-
|
|
185
|
+
super(), this._attributeMutationBlocked = !1, this._checked = !1, this._handleKeyboardInteraction = (r) => {
|
|
186
|
+
r.key === " " && this._handleUserInteraction();
|
|
187
187
|
}, this._handleUserInteraction = () => {
|
|
188
|
-
var
|
|
189
|
-
this.disabled || ((
|
|
188
|
+
var r;
|
|
189
|
+
this.disabled || ((r = this.withUserInteraction) == null || r.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 })), this.dispatchEvent(new CustomEvent("didChange", { bubbles: !0 })));
|
|
190
190
|
}, this.internals.role = "checkbox";
|
|
191
191
|
}
|
|
192
|
-
set checked(
|
|
193
|
-
const t = typeof
|
|
194
|
-
t && (
|
|
192
|
+
set checked(r) {
|
|
193
|
+
const t = typeof r == "object" ? r.attribute : !1;
|
|
194
|
+
t && (r = r.value), this.hasUpdated && !t && (this._attributeMutationBlocked = !0), this._checked = !!r, this.updateFormValue();
|
|
195
195
|
}
|
|
196
196
|
get checked() {
|
|
197
197
|
return this._checked;
|
|
198
198
|
}
|
|
199
199
|
connectedCallback() {
|
|
200
|
-
super.connectedCallback(), this.addEventListener("click", this._handleUserInteraction), this.addEventListener("keydown",
|
|
200
|
+
super.connectedCallback(), this.addEventListener("click", this._handleUserInteraction), this.addEventListener("keydown", v), this.addEventListener("keyup", this._handleKeyboardInteraction);
|
|
201
201
|
}
|
|
202
202
|
disconnectedCallback() {
|
|
203
|
-
super.disconnectedCallback(), this.removeEventListener("click", this._handleUserInteraction), this.removeEventListener("keydown",
|
|
203
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleUserInteraction), this.removeEventListener("keydown", v), this.removeEventListener("keyup", this._handleKeyboardInteraction);
|
|
204
204
|
}
|
|
205
|
-
attributeChangedCallback(
|
|
206
|
-
(
|
|
205
|
+
attributeChangedCallback(r, t, e) {
|
|
206
|
+
(r !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(r, t, e);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Is called whenever the form is being reset.
|
|
@@ -222,42 +222,50 @@ const Y = (n) => {
|
|
|
222
222
|
*
|
|
223
223
|
* @internal
|
|
224
224
|
*/
|
|
225
|
-
formStateRestoreCallback(
|
|
226
|
-
|
|
225
|
+
formStateRestoreCallback(r, t) {
|
|
226
|
+
r && (this.checked = r === "true");
|
|
227
227
|
}
|
|
228
228
|
updateFormValue() {
|
|
229
229
|
this.checked ? this.internals.setFormValue(this.value, `${this.checked}`) : this.internals.setFormValue(null);
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
return
|
|
232
|
+
return m([
|
|
233
233
|
o({
|
|
234
234
|
type: Boolean,
|
|
235
235
|
converter: {
|
|
236
|
-
...
|
|
236
|
+
...u,
|
|
237
237
|
// We need to pass information to the setter so that we know it was called by attribute change.
|
|
238
|
-
fromAttribute: (
|
|
238
|
+
fromAttribute: (r, t) => {
|
|
239
239
|
var i, a;
|
|
240
|
-
return { value: (a = (i =
|
|
240
|
+
return { value: (a = (i = u).fromAttribute) == null ? void 0 : a.call(i, r, t), attribute: !0 };
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
})
|
|
244
|
-
],
|
|
245
|
-
|
|
244
|
+
], s.prototype, "checked", 1), s = m([
|
|
245
|
+
k({
|
|
246
246
|
tabindex: "0"
|
|
247
247
|
})
|
|
248
|
-
],
|
|
249
|
-
},
|
|
250
|
-
class
|
|
251
|
-
constructor() {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
248
|
+
], s), s;
|
|
249
|
+
}, I = (n) => {
|
|
250
|
+
class s extends n {
|
|
251
|
+
constructor(...t) {
|
|
252
|
+
var e;
|
|
253
|
+
if (super(...t), this._hydrationComplete = new Promise(
|
|
254
|
+
(i) => this._resolveHydration = i
|
|
255
|
+
), this._hydrationRequired = !!this.shadowRoot, !this._hydrationRequired)
|
|
256
|
+
this._resolveHydration(!1);
|
|
257
|
+
else {
|
|
258
|
+
const i = (l) => {
|
|
259
|
+
this._hydrationRequired && l.stopImmediatePropagation();
|
|
260
|
+
}, a = { capture: !0 }, d = (e = this.shadowRoot) == null ? void 0 : e.querySelectorAll("slot");
|
|
261
|
+
d != null && d.length && (d.forEach(
|
|
262
|
+
(l) => l.addEventListener("slotchange", i, a)
|
|
263
|
+
), this.hydrationComplete.then(
|
|
264
|
+
() => d.forEach((l) => {
|
|
265
|
+
l.removeEventListener("slotchange", i, a), l.assignedNodes().length && l.dispatchEvent(new Event("slotchange", { bubbles: !0 }));
|
|
266
|
+
})
|
|
267
|
+
));
|
|
268
|
+
}
|
|
261
269
|
}
|
|
262
270
|
/**
|
|
263
271
|
* Returns a Promise that resolves when the element has completed hydration.
|
|
@@ -270,54 +278,31 @@ const Y = (n) => {
|
|
|
270
278
|
get hydrationComplete() {
|
|
271
279
|
return this._hydrationComplete;
|
|
272
280
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this._resolveHydration(!1);
|
|
277
|
-
else {
|
|
278
|
-
const i = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll("slot");
|
|
279
|
-
i != null && i.length && (i.forEach(
|
|
280
|
-
(a) => a.addEventListener("slotchange", this._handleBeforeHydrationSlotchange, {
|
|
281
|
-
capture: !0
|
|
282
|
-
})
|
|
283
|
-
), this.hydrationComplete.then(
|
|
284
|
-
() => i.forEach(
|
|
285
|
-
(a) => a.removeEventListener("slotchange", this._handleBeforeHydrationSlotchange)
|
|
286
|
-
)
|
|
287
|
-
)), (e = this.recoverSsrState) == null || e.call(this);
|
|
288
|
-
}
|
|
289
|
-
return super.createRenderRoot();
|
|
290
|
-
}
|
|
291
|
-
willUpdate(t) {
|
|
292
|
-
var e;
|
|
293
|
-
super.willUpdate(t), b && ((e = this.recoverSsrState) == null || e.call(this));
|
|
281
|
+
/** Returns whether hydration is required and not completed. */
|
|
282
|
+
get hydrationRequired() {
|
|
283
|
+
return this._hydrationRequired;
|
|
294
284
|
}
|
|
295
285
|
update(t) {
|
|
296
286
|
super.update(t), this._hydrationRequired && (this._hydrationRequired = !1, this._resolveHydration(!0));
|
|
297
287
|
}
|
|
298
|
-
/** Reads and removes an attribute with the given name. Either returns the attributte value or null. */
|
|
299
|
-
getAndRemoveAttribute(t) {
|
|
300
|
-
const e = this.getAttribute(t);
|
|
301
|
-
return this.removeAttribute(t), e;
|
|
302
|
-
}
|
|
303
288
|
}
|
|
304
|
-
return
|
|
289
|
+
return s;
|
|
305
290
|
};
|
|
306
|
-
var N = Object.defineProperty,
|
|
291
|
+
var N = Object.defineProperty, B = (n, s, r, t) => {
|
|
307
292
|
for (var e = void 0, i = n.length - 1, a; i >= 0; i--)
|
|
308
|
-
(a = n[i]) && (e = a(
|
|
309
|
-
return e && N(
|
|
293
|
+
(a = n[i]) && (e = a(s, r, e) || e);
|
|
294
|
+
return e && N(s, r, e), e;
|
|
310
295
|
};
|
|
311
|
-
const
|
|
312
|
-
class
|
|
296
|
+
const _ = "data-ssr-child-count", g = "li", W = (n) => {
|
|
297
|
+
class s extends I(n) {
|
|
313
298
|
constructor() {
|
|
314
299
|
super(...arguments), this.listChildren = [], this._handleSlotchange = () => {
|
|
315
300
|
const t = Array.from(this.children ?? []).filter(
|
|
316
301
|
(e) => this.listChildLocalNames.includes(e.localName)
|
|
317
302
|
);
|
|
318
303
|
t.length === this.listChildren.length && this.listChildren.every((e, i) => t[i] === e) || (this.listChildren.filter((e) => !t.includes(e)).forEach((e) => e.removeAttribute("slot")), this.listChildren = t, this.listChildren.forEach(
|
|
319
|
-
(e, i) => e.setAttribute("slot", `${
|
|
320
|
-
), this.removeAttribute(
|
|
304
|
+
(e, i) => e.setAttribute("slot", `${g}-${i}`)
|
|
305
|
+
), this.removeAttribute(_));
|
|
321
306
|
};
|
|
322
307
|
}
|
|
323
308
|
connectedCallback() {
|
|
@@ -339,17 +324,17 @@ const m = "data-ssr-child-count", _ = "li", Z = (n) => {
|
|
|
339
324
|
*/
|
|
340
325
|
renderList(t = {}) {
|
|
341
326
|
const e = this.listSlotNames();
|
|
342
|
-
return e.length >= 2 ?
|
|
327
|
+
return e.length >= 2 ? b`
|
|
343
328
|
<ul
|
|
344
|
-
class=${t.class || (this.localName ??
|
|
345
|
-
aria-label=${t.ariaLabel ||
|
|
346
|
-
aria-labelledby=${t.ariaLabelledby ||
|
|
329
|
+
class=${t.class || (this.localName ?? f(this))}
|
|
330
|
+
aria-label=${t.ariaLabel || p}
|
|
331
|
+
aria-labelledby=${t.ariaLabelledby || p}
|
|
347
332
|
>
|
|
348
|
-
${e.map((i) =>
|
|
333
|
+
${e.map((i) => b`<li><slot name=${i}></slot></li>`)}
|
|
349
334
|
</ul>
|
|
350
335
|
${this.renderHiddenSlot()}
|
|
351
|
-
` : e.length === 1 ?
|
|
352
|
-
<span class=${t.class || (this.localName ??
|
|
336
|
+
` : e.length === 1 ? b`<sbb-screen-reader-only>${t.ariaLabel}</sbb-screen-reader-only>
|
|
337
|
+
<span class=${t.class || (this.localName ?? f(this))}>
|
|
353
338
|
<span><slot name=${e[0]}></slot></span>
|
|
354
339
|
</span>
|
|
355
340
|
${this.renderHiddenSlot()} ` : this.renderHiddenSlot();
|
|
@@ -364,7 +349,7 @@ const m = "data-ssr-child-count", _ = "li", Z = (n) => {
|
|
|
364
349
|
* children to be passed via the `data-ssr-child-count` attribute value.
|
|
365
350
|
*/
|
|
366
351
|
listSlotNames() {
|
|
367
|
-
return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(
|
|
352
|
+
return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(_) ?? 0) })).map((e, i) => `${g}-${i}`);
|
|
368
353
|
}
|
|
369
354
|
/**
|
|
370
355
|
* Returns a hidden slot, which is intended as the children change detection.
|
|
@@ -372,38 +357,38 @@ const m = "data-ssr-child-count", _ = "li", Z = (n) => {
|
|
|
372
357
|
* the slotchange event, which can be used to assign it to the appropriate named slot.
|
|
373
358
|
*/
|
|
374
359
|
renderHiddenSlot() {
|
|
375
|
-
return
|
|
360
|
+
return b`<span hidden><slot></slot></span>`;
|
|
376
361
|
}
|
|
377
362
|
}
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
],
|
|
363
|
+
return B([
|
|
364
|
+
y()
|
|
365
|
+
], s.prototype, "listChildren"), s;
|
|
381
366
|
};
|
|
382
|
-
var
|
|
367
|
+
var V = Object.defineProperty, j = (n, s, r, t) => {
|
|
383
368
|
for (var e = void 0, i = n.length - 1, a; i >= 0; i--)
|
|
384
|
-
(a = n[i]) && (e = a(
|
|
385
|
-
return e &&
|
|
369
|
+
(a = n[i]) && (e = a(s, r, e) || e);
|
|
370
|
+
return e && V(s, r, e), e;
|
|
386
371
|
};
|
|
387
|
-
const
|
|
388
|
-
class
|
|
372
|
+
const Y = (n) => {
|
|
373
|
+
class s extends n {
|
|
389
374
|
constructor() {
|
|
390
375
|
super(...arguments), this.negative = !1;
|
|
391
376
|
}
|
|
392
377
|
}
|
|
393
|
-
return
|
|
378
|
+
return j([
|
|
394
379
|
o({ reflect: !0, type: Boolean })
|
|
395
|
-
],
|
|
380
|
+
], s.prototype, "negative"), s;
|
|
396
381
|
};
|
|
397
|
-
var
|
|
382
|
+
var H = Object.defineProperty, h = (n, s, r, t) => {
|
|
398
383
|
for (var e = void 0, i = n.length - 1, a; i >= 0; i--)
|
|
399
|
-
(a = n[i]) && (e = a(
|
|
400
|
-
return e &&
|
|
384
|
+
(a = n[i]) && (e = a(s, r, e) || e);
|
|
385
|
+
return e && H(s, r, e), e;
|
|
401
386
|
};
|
|
402
|
-
const
|
|
387
|
+
const Z = (n) => {
|
|
403
388
|
var t;
|
|
404
|
-
const
|
|
389
|
+
const s = (t = class extends n {
|
|
405
390
|
constructor() {
|
|
406
|
-
super(...arguments), this.color = "white", this.borderless = !1, this._panelConnected = new
|
|
391
|
+
super(...arguments), this.color = "white", this.borderless = !1, this._panelConnected = new w(
|
|
407
392
|
this,
|
|
408
393
|
t.events.panelConnected,
|
|
409
394
|
{ bubbles: !0 }
|
|
@@ -415,15 +400,15 @@ const te = (n) => {
|
|
|
415
400
|
}, t.events = {
|
|
416
401
|
panelConnected: "panelConnected"
|
|
417
402
|
}, t);
|
|
418
|
-
return
|
|
403
|
+
return h([
|
|
419
404
|
o()
|
|
420
|
-
],
|
|
405
|
+
], s.prototype, "color"), h([
|
|
421
406
|
o({ reflect: !0, type: Boolean })
|
|
422
|
-
],
|
|
407
|
+
], s.prototype, "borderless"), h([
|
|
423
408
|
o()
|
|
424
|
-
],
|
|
425
|
-
},
|
|
426
|
-
class
|
|
409
|
+
], s.prototype, "expansionState"), s;
|
|
410
|
+
}, ee = (n) => {
|
|
411
|
+
class s extends n {
|
|
427
412
|
constructor() {
|
|
428
413
|
super(...arguments), this._updatePromise = Promise.resolve(), this._updateResolve = () => {
|
|
429
414
|
};
|
|
@@ -439,18 +424,18 @@ const te = (n) => {
|
|
|
439
424
|
return await this._updatePromise, t;
|
|
440
425
|
}
|
|
441
426
|
}
|
|
442
|
-
return
|
|
443
|
-
},
|
|
427
|
+
return s;
|
|
428
|
+
}, te = x`: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-zero-time, 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([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}`;
|
|
444
429
|
export {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
430
|
+
C as SbbDisabledMixin,
|
|
431
|
+
J as SbbDisabledTabIndexActionMixin,
|
|
432
|
+
Q as SbbFormAssociatedCheckboxMixin,
|
|
448
433
|
A as SbbFormAssociatedMixin,
|
|
449
434
|
I as SbbHydrationMixin,
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
435
|
+
W as SbbNamedSlotListMixin,
|
|
436
|
+
Y as SbbNegativeMixin,
|
|
437
|
+
Z as SbbPanelMixin,
|
|
438
|
+
D as SbbRequiredMixin,
|
|
439
|
+
ee as SbbUpdateSchedulerMixin,
|
|
440
|
+
te as panelCommonStyle
|
|
456
441
|
};
|
|
@@ -8,7 +8,7 @@ export declare class NodeIntersectionObserver implements IntersectionObserver {
|
|
|
8
8
|
unobserve(): void;
|
|
9
9
|
}
|
|
10
10
|
export declare const AgnosticIntersectionObserver: typeof NodeIntersectionObserver | {
|
|
11
|
-
new (callback: IntersectionObserverCallback, options?: IntersectionObserverInit
|
|
11
|
+
new (callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;
|
|
12
12
|
prototype: IntersectionObserver;
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=intersection-observer.d.ts.map
|
package/core/styles/_index.scss
CHANGED
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
color: var(--sbb-button-color-default-text);
|
|
119
119
|
cursor: pointer;
|
|
120
120
|
user-select: none;
|
|
121
|
-
display:
|
|
121
|
+
display: flex;
|
|
122
122
|
|
|
123
123
|
// Renders background and border in the background absolute to enable the hover animation
|
|
124
124
|
&::before {
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
@use './typo';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* SBB table mixin
|
|
5
|
+
* Notes:
|
|
6
|
+
* We cannot use `border-collapse` because it is not compatible with the `border-radius` property.
|
|
7
|
+
* Therefore, we have to build the grid avoiding double borders.
|
|
8
|
+
*/
|
|
9
|
+
@mixin table {
|
|
10
|
+
@include table--striped;
|
|
11
|
+
@include table--m;
|
|
12
|
+
|
|
13
|
+
--sbb-table-border: var(--sbb-border-width-1x) solid var(--sbb-table-border-color);
|
|
14
|
+
--sbb-table-border-color: var(--sbb-color-cloud);
|
|
15
|
+
--sbb-table-border-radius: var(--sbb-border-radius-4x);
|
|
16
|
+
--sbb-table-background-color: var(--sbb-color-white);
|
|
17
|
+
--sbb-table-row-striped-color: var(--sbb-color-milk);
|
|
18
|
+
--sbb-table-color: inherit;
|
|
19
|
+
--sbb-table-caption-color: var(--sbb-color-granite);
|
|
20
|
+
--sbb-table-caption-margin-block-start: var(--sbb-spacing-fixed-4x);
|
|
21
|
+
|
|
22
|
+
background-color: var(--sbb-table-background-color);
|
|
23
|
+
border: var(--sbb-table-border);
|
|
24
|
+
border-radius: var(--sbb-table-border-radius);
|
|
25
|
+
border-spacing: 0;
|
|
26
|
+
caption-side: bottom;
|
|
27
|
+
color: var(--sbb-table-color);
|
|
28
|
+
table-layout: auto;
|
|
29
|
+
|
|
30
|
+
thead {
|
|
31
|
+
& > tr > th {
|
|
32
|
+
@include table-header-cell;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
tbody {
|
|
37
|
+
& > tr {
|
|
38
|
+
@include table-data-row;
|
|
39
|
+
|
|
40
|
+
& > td {
|
|
41
|
+
@include table-data-cell;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
caption {
|
|
47
|
+
@include table-caption;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin table-header-cell {
|
|
52
|
+
@include typo.text-xs--bold;
|
|
53
|
+
|
|
54
|
+
border-bottom: var(--sbb-table-border);
|
|
55
|
+
border-right: var(--sbb-table-border);
|
|
56
|
+
padding-block: var(--sbb-table-header-padding-block);
|
|
57
|
+
padding-inline: var(--sbb-table-header-padding-inline);
|
|
58
|
+
text-align: left;
|
|
59
|
+
|
|
60
|
+
// To avoid double border
|
|
61
|
+
&:last-of-type {
|
|
62
|
+
border-right: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@mixin table-data-row {
|
|
67
|
+
// To avoid double borders
|
|
68
|
+
&:first-of-type td {
|
|
69
|
+
border-top: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@mixin table-data-cell {
|
|
74
|
+
@include typo.text-s--regular;
|
|
75
|
+
|
|
76
|
+
border-top: var(--sbb-table-border);
|
|
77
|
+
border-right: var(--sbb-table-border);
|
|
78
|
+
padding-block: var(--sbb-table-cell-padding-block);
|
|
79
|
+
padding-inline: var(--sbb-table-cell-padding-inline);
|
|
80
|
+
|
|
81
|
+
// To avoid double border
|
|
82
|
+
&:last-of-type {
|
|
83
|
+
border-right: none;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@mixin table-caption {
|
|
88
|
+
@include typo.text-xs--regular;
|
|
89
|
+
|
|
90
|
+
// Defaults are needed for cases where the caption is used outside a table
|
|
91
|
+
color: var(--sbb-table-caption-color, var(--sbb-color-granite));
|
|
92
|
+
margin-block-start: var(--sbb-table-caption-margin-block-start, var(--sbb-spacing-fixed-4x));
|
|
93
|
+
text-align: left;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@mixin table--striped {
|
|
97
|
+
tbody tr:nth-child(odd) {
|
|
98
|
+
@include table-row--striped;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@mixin table--unstriped {
|
|
103
|
+
tbody tr:nth-child(odd) {
|
|
104
|
+
background-color: unset;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@mixin table-row--striped {
|
|
109
|
+
background-color: var(--sbb-table-row-striped-color);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@mixin table--negative {
|
|
113
|
+
--sbb-table-border-color: var(--sbb-color-anthracite);
|
|
114
|
+
--sbb-table-background-color: var(--sbb-color-midnight);
|
|
115
|
+
--sbb-table-color: var(--sbb-color-white);
|
|
116
|
+
--sbb-table-row-striped-color: var(--sbb-color-charcoal);
|
|
117
|
+
--sbb-table-caption-color: var(--sbb-color-cement);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@mixin table--m {
|
|
121
|
+
--sbb-table-header-padding-block: var(--sbb-spacing-fixed-3x);
|
|
122
|
+
--sbb-table-header-padding-inline: var(--sbb-spacing-fixed-4x);
|
|
123
|
+
--sbb-table-cell-padding-block: var(--sbb-spacing-responsive-xxxs);
|
|
124
|
+
--sbb-table-cell-padding-inline: var(--sbb-spacing-fixed-4x);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@mixin table--s {
|
|
128
|
+
--sbb-table-header-padding-block: var(--sbb-spacing-fixed-1x);
|
|
129
|
+
--sbb-table-header-padding-inline: var(--sbb-spacing-fixed-2x);
|
|
130
|
+
--sbb-table-cell-padding-block: var(--sbb-spacing-fixed-1x);
|
|
131
|
+
--sbb-table-cell-padding-inline: var(--sbb-spacing-fixed-2x);
|
|
132
|
+
|
|
133
|
+
tbody > tr > td {
|
|
134
|
+
@include typo.text-xs--regular;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@mixin table--theme-iron {
|
|
139
|
+
--sbb-table-cell-color: var(--sbb-color-iron);
|
|
140
|
+
|
|
141
|
+
tbody > tr > td {
|
|
142
|
+
color: var(--sbb-table-cell-color);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@mixin table--theme-iron-negative {
|
|
147
|
+
--sbb-table-cell-color: var(--sbb-color-cloud);
|
|
148
|
+
}
|