@sbb-esta/lyne-elements 1.14.1 → 1.15.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/autocomplete/autocomplete.d.ts +1 -1
- package/autocomplete/autocomplete.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts +1 -1
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid.js +6 -6
- package/autocomplete.js +20 -19
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.d.ts.map +1 -1
- package/calendar.js +25 -27
- package/checkbox/checkbox-panel/checkbox-panel.d.ts +1 -1
- package/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -1
- package/checkbox/checkbox-panel.js +5 -5
- package/checkbox/common.js +1 -1
- package/clock/clock.d.ts +1 -1
- package/clock/clock.d.ts.map +1 -1
- package/clock.js +2 -2
- package/container/sticky-bar/sticky-bar.d.ts +29 -2
- package/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/container/sticky-bar.js +69 -31
- package/core/controllers/media-matchers-controller.d.ts +32 -0
- package/core/controllers/media-matchers-controller.d.ts.map +1 -0
- package/core/controllers.d.ts +1 -0
- package/core/controllers.d.ts.map +1 -1
- package/core/controllers.js +75 -33
- package/core/dom/breakpoint.d.ts +2 -1
- package/core/dom/breakpoint.d.ts.map +1 -1
- package/core/dom.js +7 -7
- package/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/core/mixins.js +8 -1
- package/core/styles/core/mediaqueries.scss +1 -2
- package/core/styles/mixins/buttons.scss +5 -5
- package/core/testing/event-spy.d.ts +6 -4
- package/core/testing/event-spy.d.ts.map +1 -1
- package/core/testing.js +82 -55
- package/custom-elements.json +609 -62
- package/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/autocomplete/autocomplete.d.ts +1 -1
- package/development/autocomplete/autocomplete.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts +1 -1
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid.js +4 -3
- package/development/autocomplete.js +4 -3
- package/development/calendar/calendar.d.ts +1 -1
- package/development/calendar/calendar.d.ts.map +1 -1
- package/development/calendar.js +8 -11
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts +1 -1
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -1
- package/development/checkbox/checkbox-panel.js +2 -2
- package/development/checkbox/common.js +2 -2
- package/development/clock/clock.d.ts +1 -1
- package/development/clock/clock.d.ts.map +1 -1
- package/development/clock.js +3 -3
- package/development/container/sticky-bar/sticky-bar.d.ts +29 -2
- package/development/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/development/container/sticky-bar.js +149 -36
- package/development/core/controllers/media-matchers-controller.d.ts +32 -0
- package/development/core/controllers/media-matchers-controller.d.ts.map +1 -0
- package/development/core/controllers.d.ts +1 -0
- package/development/core/controllers.d.ts.map +1 -1
- package/development/core/controllers.js +65 -1
- package/development/core/dom/breakpoint.d.ts +2 -1
- package/development/core/dom/breakpoint.d.ts.map +1 -1
- package/development/core/dom.js +2 -2
- package/development/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +9 -2
- package/development/core/testing/event-spy.d.ts +6 -4
- package/development/core/testing/event-spy.d.ts.map +1 -1
- package/development/core/testing.js +35 -1
- package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/datepicker/datepicker.js +1 -1
- package/development/dialog/dialog.js +2 -2
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts +2 -0
- package/development/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/development/expansion-panel/expansion-panel-header.js +7 -3
- package/development/file-selector/file-selector.d.ts +5 -0
- package/development/file-selector/file-selector.d.ts.map +1 -1
- package/development/file-selector.js +8 -1
- package/development/flip-card/flip-card/flip-card.d.ts +4 -0
- package/development/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/development/flip-card/flip-card-details.js +4 -6
- package/development/flip-card/flip-card-summary/flip-card-summary.d.ts +1 -1
- package/development/flip-card/flip-card-summary/flip-card-summary.d.ts.map +1 -1
- package/development/flip-card/flip-card-summary.js +9 -10
- package/development/flip-card/flip-card.js +26 -2
- package/development/form-field/form-field.js +5 -3
- package/development/icon/icon.d.ts +1 -1
- package/development/icon.js +1 -1
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +3 -19
- package/development/map-container.js +3 -2
- package/development/menu/menu/menu.d.ts +1 -0
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +15 -11
- package/development/navigation/navigation-section.js +4 -14
- package/development/navigation/navigation.js +2 -7
- package/development/notification.js +3 -2
- package/development/paginator/paginator/paginator.d.ts +1 -5
- package/development/paginator/paginator/paginator.d.ts.map +1 -1
- package/development/paginator/paginator.js +19 -27
- package/development/popover/popover/popover.d.ts.map +1 -1
- package/development/popover/popover.js +9 -16
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts +1 -1
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/development/radio-button/radio-button-panel.js +2 -2
- package/development/sbb-tokens-BdGhUJjM.js +33 -0
- package/development/select/select.d.ts +6 -5
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +23 -14
- package/development/slider/slider.d.ts +5 -0
- package/development/slider/slider.d.ts.map +1 -1
- package/development/slider.js +8 -1
- package/development/table/table-wrapper/table-wrapper.d.ts +1 -1
- package/development/table/table-wrapper/table-wrapper.d.ts.map +1 -1
- package/development/table/table-wrapper.js +1 -1
- package/development/timetable-occupancy-icon/timetable-occupancy-icon.d.ts +2 -1
- package/development/timetable-occupancy-icon/timetable-occupancy-icon.d.ts.map +1 -1
- package/development/timetable-occupancy-icon.js +11 -9
- package/development/toggle-check/toggle-check.d.ts +1 -1
- package/development/toggle-check/toggle-check.d.ts.map +1 -1
- package/development/toggle-check.js +2 -2
- package/dialog/dialog.js +1 -1
- package/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts +2 -0
- package/expansion-panel/expansion-panel-header/expansion-panel-header.d.ts.map +1 -1
- package/expansion-panel/expansion-panel-header.js +25 -23
- package/file-selector/file-selector.d.ts +5 -0
- package/file-selector/file-selector.d.ts.map +1 -1
- package/file-selector.js +7 -0
- package/flip-card/flip-card/flip-card.d.ts +4 -0
- package/flip-card/flip-card/flip-card.d.ts.map +1 -1
- package/flip-card/flip-card-details.js +6 -6
- package/flip-card/flip-card-summary/flip-card-summary.d.ts +1 -1
- package/flip-card/flip-card-summary/flip-card-summary.d.ts.map +1 -1
- package/flip-card/flip-card-summary.js +8 -8
- package/flip-card/flip-card.js +56 -42
- package/icon/icon.d.ts +1 -1
- package/image/image.d.ts.map +1 -1
- package/image.js +46 -45
- package/map-container.js +7 -7
- package/menu/menu/menu.d.ts +1 -0
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +45 -41
- package/navigation/navigation-section.js +7 -7
- package/navigation/navigation.js +8 -8
- package/package.json +1 -1
- package/paginator/paginator/paginator.d.ts +1 -5
- package/paginator/paginator/paginator.d.ts.map +1 -1
- package/paginator/paginator.js +50 -52
- package/popover/popover/popover.d.ts.map +1 -1
- package/popover/popover.js +42 -46
- package/radio-button/radio-button-panel/radio-button-panel.d.ts +1 -1
- package/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/radio-button/radio-button-panel.js +7 -7
- package/sbb-tokens-Dx20OtVg.js +18 -0
- package/select/select.d.ts +6 -5
- package/select/select.d.ts.map +1 -1
- package/select.js +55 -53
- package/slider/slider.d.ts +5 -0
- package/slider/slider.d.ts.map +1 -1
- package/slider.js +12 -5
- package/table/table-wrapper/table-wrapper.d.ts +1 -1
- package/table/table-wrapper/table-wrapper.d.ts.map +1 -1
- package/timetable-occupancy-icon/timetable-occupancy-icon.d.ts +2 -1
- package/timetable-occupancy-icon/timetable-occupancy-icon.d.ts.map +1 -1
- package/timetable-occupancy-icon.js +45 -44
- package/toggle-check/toggle-check.d.ts +1 -1
- package/toggle-check/toggle-check.d.ts.map +1 -1
- package/toggle-check.js +1 -1
package/container/sticky-bar.js
CHANGED
|
@@ -1,51 +1,83 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _ = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var p = (a,
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as
|
|
7
|
-
import { IntersectionController as
|
|
8
|
-
import { css as
|
|
9
|
-
import { customElement as
|
|
10
|
-
import { hostAttributes as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
var p = (a, i, s) => i.has(a) || _("Cannot " + s);
|
|
5
|
+
var g = (a, i, s) => (p(a, i, "read from private field"), s ? s.call(a) : i.get(a)), f = (a, i, s) => i.has(a) ? _("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(a) : i.set(a, s), d = (a, i, s, e) => (p(a, i, "write to private field"), e ? e.call(a, s) : i.set(a, s), s);
|
|
6
|
+
import { __runInitializers as k, __esDecorate as w } from "tslib";
|
|
7
|
+
import { IntersectionController as S } from "@lit-labs/observers/intersection-controller.js";
|
|
8
|
+
import { css as C, LitElement as z, html as E } from "lit";
|
|
9
|
+
import { customElement as U, property as A } from "lit/decorators.js";
|
|
10
|
+
import { hostAttributes as R } from "../core/decorators.js";
|
|
11
|
+
import { EventEmitter as c } from "../core/eventing.js";
|
|
12
|
+
import { SbbUpdateSchedulerMixin as I } from "../core/mixins.js";
|
|
13
|
+
const T = C`*,:before,:after{box-sizing:border-box}:host{--sbb-sticky-bar-position: sticky;--sbb-sticky-bar-padding-block: var(--sbb-spacing-responsive-xs);--sbb-sticky-bar-border-radius: var(--sbb-border-radius-8x);--sbb-sticky-bar-animation-easing: var(--sbb-animation-easing);--sbb-sticky-bar-fade-in-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-5x) );--sbb-sticky-bar-fade-out-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-2x) );--sbb-sticky-bar-slide-vertically-animation-duration: var( --sbb-disable-animation-zero-duration, var(--sbb-animation-duration-4x) );--sbb-sticky-bar-slide-vertically-animation-easing: ease-out;--sbb-sticky-bar-slide-vertically-animation-delay: 0s;--sbb-sticky-bar-slide-vertically-animation-name: unset;--_sbb-sticky-bar-background-animation-duration: var( --sbb-sticky-bar-fade-out-animation-duration );--_sbb-sticky-bar-intersector-background-color: transparent;--_sbb-sticky-bar-forced-colors-border: none;display:contents}:host([data-sticking]:not([data-state=unsticky])){--sbb-sticky-bar-sticky-background-color: var( --sbb-container-background-color, var(--sbb-color-white) );--_sbb-sticky-bar-intersector-background-color: var(--sbb-sticky-bar-sticky-background-color);--_sbb-sticky-bar-background-animation-duration: var(--sbb-sticky-bar-fade-in-animation-duration)}@media (forced-colors: active){:host([data-sticking]:not([data-state=unsticky])){--_sbb-sticky-bar-forced-colors-border: var(--sbb-border-width-1x) solid CanvasText}}:host([data-sticking]:not([data-state=unsticky])[color=white]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-white)}:host([data-sticking]:not([data-state=unsticky])[color=milk]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-milk)}:host(:is([data-sticking]:is([data-slide-vertically],[data-state=sticking],[data-state=unsticking]),[data-state=unsticky])){--_sbb-sticky-bar-background-animation-duration: 0s}:host([data-sticking]:is([data-slide-vertically]:not([data-state=unsticky],[data-state=unsticking]),[data-state=sticking])){--sbb-sticky-bar-slide-vertically-animation-name: slide-in}:host([data-sticking][data-state=unsticking]){--sbb-sticky-bar-slide-vertically-animation-name: slide-out}:host(:is(:not([data-initialized]),[data-state=unsticky])){--sbb-sticky-bar-position: relative}.sbb-sticky-bar__wrapper{position:var(--sbb-sticky-bar-position);inset-block-end:0;display:block;z-index:var(--sbb-sticky-bar-z-index);animation-name:var(--sbb-sticky-bar-slide-vertically-animation-name);animation-duration:var(--sbb-sticky-bar-slide-vertically-animation-duration);animation-timing-function:var(--sbb-sticky-bar-slide-vertically-animation-easing);animation-delay:var(--sbb-sticky-bar-slide-vertically-animation-delay);animation-fill-mode:backwards}.sbb-sticky-bar__wrapper:after,.sbb-sticky-bar__wrapper:before{content:"";top:0;right:0;bottom:0;left:0;position:absolute;display:block;z-index:-1}.sbb-sticky-bar__wrapper:before{background-color:var(--sbb-container-background-color);padding:0!important}:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}.sbb-sticky-bar__wrapper:after{background-color:var(--sbb-sticky-bar-sticky-background-color, transparent);border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius);transition:background-color var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing);border:var(--_sbb-sticky-bar-forced-colors-border)}.sbb-sticky-bar{display:flex;padding-block:var(--sbb-sticky-bar-padding-block);margin-block-end:-1px}.sbb-sticky-bar:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius);transition:box-shadow var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing);clip-path:polygon(-50% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% 50%,-50% 50%)}:host([data-sticking]:not([data-state=unsticky])) .sbb-sticky-bar:before{box-shadow:var(--sbb-shadow-elevation-level-11-shadow-2-offset-x) var(--sbb-shadow-elevation-level-11-shadow-2-offset-y) var(--sbb-shadow-elevation-level-11-shadow-2-blur) var(--sbb-shadow-elevation-level-11-shadow-2-spread) var(--sbb-shadow-elevation-level-11-soft-2-color),var(--sbb-shadow-elevation-level-11-shadow-1-offset-x) var(--sbb-shadow-elevation-level-11-shadow-1-offset-y) var(--sbb-shadow-elevation-level-11-shadow-1-blur) var(--sbb-shadow-elevation-level-11-shadow-1-spread) var(--sbb-shadow-elevation-level-11-soft-1-color)}:host(:not([data-expanded])) .sbb-sticky-bar{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}:host([data-expanded]) .sbb-sticky-bar{padding-inline:var(--sbb-spacing-responsive-xxs)}.sbb-sticky-bar__intersector{height:1px}.sbb-sticky-bar__intersector:after{content:"";display:block;position:absolute;width:100%;height:calc(var(--sbb-sticky-bar-bottom-overlapping-height, 0) + 1px);background-color:var(--_sbb-sticky-bar-intersector-background-color);pointer-events:none;transition:background-color var(--_sbb-sticky-bar-background-animation-duration) var(--sbb-sticky-bar-animation-easing)}@keyframes slide-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-out{0%{transform:translateY(0)}to{transform:translateY(100%)}}`;
|
|
14
|
+
let M = (() => {
|
|
15
|
+
var b, r;
|
|
16
|
+
let a = [U("sbb-sticky-bar"), R({
|
|
15
17
|
slot: "sticky-bar"
|
|
16
|
-
})],
|
|
17
|
-
|
|
18
|
+
})], i, s = [], e, y = I(z), u, h = [], v = [];
|
|
19
|
+
var n = (r = class extends y {
|
|
18
20
|
constructor() {
|
|
19
21
|
super(...arguments);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
f(this, b);
|
|
23
|
+
d(this, b, k(this, h, null)), this._willStick = (k(this, v), new c(this, n.events.willStick)), this._didStick = new c(this, n.events.didStick), this._willUnstick = new c(this, n.events.willUnstick), this._didUnstick = new c(this, n.events.didUnstick), this._observer = new S(this, {
|
|
22
24
|
// Although `this` is observed, we have to postpone observing
|
|
23
25
|
// into firstUpdated() to achieve a correct initial state.
|
|
24
26
|
target: null,
|
|
25
|
-
callback: (t) => this.
|
|
27
|
+
callback: (t) => this._detectStickyState(t[0])
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
/** Color of the container, like transparent, white etc. */
|
|
29
31
|
get color() {
|
|
30
|
-
return
|
|
32
|
+
return g(this, b);
|
|
31
33
|
}
|
|
32
34
|
set color(t) {
|
|
33
|
-
|
|
35
|
+
d(this, b, t);
|
|
36
|
+
}
|
|
37
|
+
/** The state of the component. */
|
|
38
|
+
set _state(t) {
|
|
39
|
+
this.setAttribute("data-state", t);
|
|
40
|
+
}
|
|
41
|
+
get _state() {
|
|
42
|
+
return this.getAttribute("data-state");
|
|
34
43
|
}
|
|
35
44
|
connectedCallback() {
|
|
36
|
-
super.connectedCallback();
|
|
45
|
+
super.connectedCallback(), this._state = "sticky", this.startUpdate();
|
|
37
46
|
const t = this.closest("sbb-container");
|
|
38
47
|
t && this.toggleAttribute("data-expanded", t.expanded), this._intersector && this._observer.observe(this._intersector);
|
|
39
48
|
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
super.disconnectedCallback(), this.toggleAttribute("data-initialized", !1);
|
|
51
|
+
}
|
|
40
52
|
firstUpdated(t) {
|
|
41
53
|
super.firstUpdated(t), this._intersector || (this._intersector = this.shadowRoot.querySelector(".sbb-sticky-bar__intersector"), this._observer.observe(this._intersector)), this._observer.observe(this);
|
|
42
54
|
}
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
_detectStickyState(t) {
|
|
56
|
+
var m;
|
|
57
|
+
this.toggleAttribute("data-initialized", !0);
|
|
58
|
+
const o = !t.isIntersecting && t.boundingClientRect.top > 0, l = (m = this._intersector) == null ? void 0 : m.getBoundingClientRect(), x = this.shadowRoot.querySelector(".sbb-sticky-bar__wrapper").getBoundingClientRect();
|
|
59
|
+
this.toggleAttribute("data-slide-vertically", o && this._intersector && Math.abs(l.bottom - x.bottom) > 30), this.toggleAttribute("data-sticking", o), this.completeUpdate();
|
|
60
|
+
}
|
|
61
|
+
/** Animates from normal content flow position to `position: sticky`. */
|
|
62
|
+
stick() {
|
|
63
|
+
this._state !== "unsticky" || !this._willStick.emit() || (this._state = "sticking", this.hasAttribute("data-sticking") || this._stickyCallback());
|
|
64
|
+
}
|
|
65
|
+
/** Animates `position: sticky` to normal content flow position. */
|
|
66
|
+
unstick() {
|
|
67
|
+
this._state !== "sticky" || !this._willUnstick.emit() || (this._state = "unsticking", this.hasAttribute("data-sticking") || this._unstickyCallback());
|
|
68
|
+
}
|
|
69
|
+
_stickyCallback() {
|
|
70
|
+
this._state = "sticky", this._didStick.emit();
|
|
71
|
+
}
|
|
72
|
+
_unstickyCallback() {
|
|
73
|
+
this._didUnstick.emit(), this._state = "unsticky";
|
|
74
|
+
}
|
|
75
|
+
_onAnimationEnd(t) {
|
|
76
|
+
(this._state === "sticking" || this._state === "sticky") && t.animationName === "slide-in" ? this._stickyCallback() : this._state === "unsticking" && t.animationName === "slide-out" && this._unstickyCallback();
|
|
45
77
|
}
|
|
46
78
|
render() {
|
|
47
|
-
return
|
|
48
|
-
<div class="sbb-sticky-bar__wrapper">
|
|
79
|
+
return E`
|
|
80
|
+
<div class="sbb-sticky-bar__wrapper" @animationend=${this._onAnimationEnd}>
|
|
49
81
|
<div class="sbb-sticky-bar">
|
|
50
82
|
<slot></slot>
|
|
51
83
|
</div>
|
|
@@ -53,13 +85,19 @@ let U = (() => {
|
|
|
53
85
|
<div class="sbb-sticky-bar__intersector"></div>
|
|
54
86
|
`;
|
|
55
87
|
}
|
|
56
|
-
},
|
|
57
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} }, metadata: t },
|
|
61
|
-
})(),
|
|
88
|
+
}, b = new WeakMap(), e = r, (() => {
|
|
89
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(y[Symbol.metadata] ?? null) : void 0;
|
|
90
|
+
u = [A({ reflect: !0 })], w(r, null, u, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (o) => "color" in o, get: (o) => o.color, set: (o, l) => {
|
|
91
|
+
o.color = l;
|
|
92
|
+
} }, metadata: t }, h, v), w(null, i = { value: e }, a, { kind: "class", name: e.name, metadata: t }, null, s), n = e = i.value, t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
93
|
+
})(), r.styles = T, r.events = {
|
|
94
|
+
willStick: "willStick",
|
|
95
|
+
didStick: "didStick",
|
|
96
|
+
willUnstick: "willUnstick",
|
|
97
|
+
didUnstick: "didUnstick"
|
|
98
|
+
}, k(e, s), r);
|
|
99
|
+
return n = e;
|
|
62
100
|
})();
|
|
63
101
|
export {
|
|
64
|
-
|
|
102
|
+
M as SbbStickyBarElement
|
|
65
103
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export declare const SbbMediaQueryForcedColors = "(forced-colors: active)";
|
|
3
|
+
export declare const SbbMediaQueryHover = "(any-hover: hover)";
|
|
4
|
+
export declare const SbbMediaQueryPointerCoarse = "(pointer: coarse)";
|
|
5
|
+
export declare const SbbMediaQueryBreakpointMediumAndAbove: string;
|
|
6
|
+
export declare const SbbMediaQueryBreakpointSmallAndBelow: string;
|
|
7
|
+
/**
|
|
8
|
+
* A callback, which is invoked when the associated media query match
|
|
9
|
+
* status changes.
|
|
10
|
+
*/
|
|
11
|
+
export type SbbMediaMatcherHandler = (matches: boolean) => void;
|
|
12
|
+
/**
|
|
13
|
+
* This controller allows listening to media query changes.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* new SbbMediaMatcherController(this, {
|
|
17
|
+
* [SbbForcedColorsQuery]: (matches) => doSomething(matches),
|
|
18
|
+
* })
|
|
19
|
+
*/
|
|
20
|
+
export declare class SbbMediaMatcherController implements ReactiveController {
|
|
21
|
+
private _queries;
|
|
22
|
+
constructor(host: ReactiveControllerHost, _queries: Record<string, SbbMediaMatcherHandler>);
|
|
23
|
+
/**
|
|
24
|
+
* Returns whether the given query matches. Returns null with SSR.
|
|
25
|
+
* @param query The query to check against.
|
|
26
|
+
* @returns Whether the query matches or null with SSR.
|
|
27
|
+
*/
|
|
28
|
+
matches(query: string): boolean | null;
|
|
29
|
+
hostConnected(): void;
|
|
30
|
+
hostDisconnected(): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=media-matchers-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-matchers-controller.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/controllers/media-matchers-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAKrF,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AACnE,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAC9D,eAAO,MAAM,qCAAqC,QAAuD,CAAC;AAC1G,eAAO,MAAM,oCAAoC,QAAsD,CAAC;AAGxG;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAehE;;;;;;;GAOG;AACH,qBAAa,yBAA0B,YAAW,kBAAkB;IAGhE,OAAO,CAAC,QAAQ;gBADhB,IAAI,EAAE,sBAAsB,EACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;IAK1D;;;;OAIG;IACI,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAYtC,aAAa,IAAI,IAAI;IAoBrB,gBAAgB,IAAI,IAAI;CAWhC"}
|
package/core/controllers.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './controllers/connected-abort-controller.js';
|
|
2
2
|
export * from './controllers/inert-controller.js';
|
|
3
3
|
export * from './controllers/language-controller.js';
|
|
4
|
+
export * from './controllers/media-matchers-controller.js';
|
|
4
5
|
export * from './controllers/slot-state-controller.js';
|
|
5
6
|
//# sourceMappingURL=controllers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC"}
|
package/core/controllers.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isServer as n } from "lit";
|
|
2
|
-
import { readConfig as
|
|
3
|
-
|
|
2
|
+
import { readConfig as b } from "./config.js";
|
|
3
|
+
import { S as f, g as m, f as v } from "../sbb-tokens-Dx20OtVg.js";
|
|
4
|
+
class S {
|
|
4
5
|
get signal() {
|
|
5
6
|
var t;
|
|
6
7
|
return (t = this._abortController) == null ? void 0 : t.signal;
|
|
@@ -16,11 +17,11 @@ class m {
|
|
|
16
17
|
(t = this._abortController) == null || t.abort(), this._abortController = void 0;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
-
class
|
|
21
|
-
constructor(t,
|
|
20
|
+
const g = ["script", "head", "template", "style"], y = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set();
|
|
21
|
+
class O {
|
|
22
|
+
constructor(t, e = y, i = A) {
|
|
22
23
|
var s, o;
|
|
23
|
-
this._host = t, this._inertElements =
|
|
24
|
+
this._host = t, this._inertElements = e, this._inertOverlays = i, (o = (s = this._host).addController) == null || o.call(s, this);
|
|
24
25
|
}
|
|
25
26
|
hostConnected() {
|
|
26
27
|
this._host.isOpen && this.activate();
|
|
@@ -49,23 +50,23 @@ class A {
|
|
|
49
50
|
}), this._inertElements.clear();
|
|
50
51
|
}
|
|
51
52
|
_addInertAttributes() {
|
|
52
|
-
var
|
|
53
|
+
var e, i;
|
|
53
54
|
let t = this._currentOverlay();
|
|
54
55
|
for (; t !== document.documentElement && t !== null; )
|
|
55
|
-
Array.from(((
|
|
56
|
+
Array.from(((e = (t == null ? void 0 : t.parentElement) ?? (t == null ? void 0 : t.getRootNode())) == null ? void 0 : e.childNodes) ?? []).filter((s) => s !== t && s instanceof window.HTMLElement && !g.includes(s.localName)).forEach((s) => {
|
|
56
57
|
this._inertElements.add(s), s.inert || (s.inert = !0, s.toggleAttribute("data-sbb-inert", !0)), s.hasAttribute("aria-hidden") || (s.setAttribute("aria-hidden", "true"), s.toggleAttribute("data-sbb-aria-hidden", !0));
|
|
57
|
-
}), t = (t == null ? void 0 : t.parentElement) ?? ((
|
|
58
|
+
}), t = (t == null ? void 0 : t.parentElement) ?? ((i = t == null ? void 0 : t.getRootNode()) == null ? void 0 : i.host) ?? null;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
const
|
|
61
|
+
const r = class r {
|
|
61
62
|
/** Get the current language. */
|
|
62
63
|
static get current() {
|
|
63
|
-
const
|
|
64
|
-
return
|
|
64
|
+
const e = ((b().language ?? (n ? r._defaultLanguage : document.documentElement.getAttribute("lang"))) || r._defaultLanguage).split("-")[0];
|
|
65
|
+
return r._supportedLocales.includes(e) ? e : r._defaultLanguage;
|
|
65
66
|
}
|
|
66
67
|
/** Get the current language. */
|
|
67
68
|
get current() {
|
|
68
|
-
return
|
|
69
|
+
return r.current;
|
|
69
70
|
}
|
|
70
71
|
constructor(t) {
|
|
71
72
|
this._host = t, this._handlers = [], this._host.addController(this);
|
|
@@ -75,26 +76,61 @@ const e = class e {
|
|
|
75
76
|
return this._handlers.unshift(t), this;
|
|
76
77
|
}
|
|
77
78
|
hostConnected() {
|
|
78
|
-
n || (
|
|
79
|
+
n || (r._listeners.size || r._observer.observe(document.documentElement, r._observerConfig), r._listeners.add(this), this._previousLanguage !== this.current && this._callHandlers(this._previousLanguage !== void 0));
|
|
79
80
|
}
|
|
80
81
|
hostDisconnected() {
|
|
81
|
-
n || (this._previousLanguage = this.current,
|
|
82
|
+
n || (this._previousLanguage = this.current, r._listeners.delete(this), r._listeners.size || r._observer.disconnect());
|
|
82
83
|
}
|
|
83
84
|
_callHandlers(t = !0) {
|
|
84
|
-
this._handlers.forEach((
|
|
85
|
+
this._handlers.forEach((e) => e()), t && this._host.requestUpdate();
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
|
|
88
|
-
t[0].oldValue !== document.documentElement.getAttribute("lang") &&
|
|
89
|
-
}),
|
|
88
|
+
r._defaultLanguage = "en", r._supportedLocales = ["en", "de", "fr", "it"], r._listeners = /* @__PURE__ */ new Set(), r._observer = n ? null : new MutationObserver((t) => {
|
|
89
|
+
t[0].oldValue !== document.documentElement.getAttribute("lang") && r._listeners.forEach((e) => e._callHandlers());
|
|
90
|
+
}), r._observerConfig = {
|
|
90
91
|
attributeFilter: ["lang"],
|
|
91
92
|
attributeOldValue: !0
|
|
92
93
|
};
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
let u = r;
|
|
95
|
+
const _ = (a) => a / f, w = "(forced-colors: active)", M = "(any-hover: hover)", N = "(pointer: coarse)", Q = `(min-width: ${_(m)}rem)`, H = `(max-width: ${_(v)}rem)`, l = /* @__PURE__ */ new Map();
|
|
96
|
+
class L {
|
|
97
|
+
constructor(t, e) {
|
|
98
|
+
this._queries = e, t.addController(this);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Returns whether the given query matches. Returns null with SSR.
|
|
102
|
+
* @param query The query to check against.
|
|
103
|
+
* @returns Whether the query matches or null with SSR.
|
|
104
|
+
*/
|
|
105
|
+
matches(t) {
|
|
106
|
+
if (n)
|
|
107
|
+
return null;
|
|
108
|
+
const e = l.get(t);
|
|
109
|
+
return e ? e.mediaQueryList.matches : matchMedia(t).matches;
|
|
110
|
+
}
|
|
111
|
+
hostConnected() {
|
|
112
|
+
if (!n)
|
|
113
|
+
for (const [t, e] of Object.entries(this._queries)) {
|
|
114
|
+
const i = l.get(t);
|
|
115
|
+
if (i)
|
|
116
|
+
i.handlers.add(e);
|
|
117
|
+
else {
|
|
118
|
+
const s = matchMedia(t), o = /* @__PURE__ */ new Set([e]), h = (d) => o.forEach((c) => c(d.matches));
|
|
119
|
+
s.addEventListener("change", h), l.set(t, { mediaQueryList: s, handlers: o, eventHandler: h });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
hostDisconnected() {
|
|
124
|
+
for (const [t, e] of Object.entries(this._queries)) {
|
|
125
|
+
const i = l.get(t);
|
|
126
|
+
i && (i.handlers.delete(e), i.handlers.size || l.delete(t));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class I {
|
|
131
|
+
constructor(t, e = null) {
|
|
132
|
+
this._host = t, this._onChangeCallback = e, this.slots = /* @__PURE__ */ new Set(), this._slotchangeHandler = (i) => {
|
|
133
|
+
this._syncSlots(i.target);
|
|
98
134
|
}, this._host.addController(this);
|
|
99
135
|
}
|
|
100
136
|
hostConnected() {
|
|
@@ -109,18 +145,24 @@ class C {
|
|
|
109
145
|
var s;
|
|
110
146
|
for (const o of t) {
|
|
111
147
|
const h = o.name || "unnamed";
|
|
112
|
-
o.assignedNodes().some((
|
|
113
|
-
var
|
|
114
|
-
return "tagName" in
|
|
148
|
+
o.assignedNodes().some((d) => {
|
|
149
|
+
var c;
|
|
150
|
+
return "tagName" in d || ((c = d.textContent) == null ? void 0 : c.trim());
|
|
115
151
|
}) ? this.slots.add(h) : this.slots.delete(h);
|
|
116
152
|
}
|
|
117
|
-
const
|
|
118
|
-
|
|
153
|
+
const e = this._host.getAttribute("data-slot-names"), i = [...this.slots].sort().join(" ");
|
|
154
|
+
i ? this._host.getAttribute("data-slot-names") !== i && this._host.setAttribute("data-slot-names", i) : this._host.removeAttribute("data-slot-names"), i !== e && ((s = this._onChangeCallback) == null || s.call(this));
|
|
119
155
|
}
|
|
120
156
|
}
|
|
121
157
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
158
|
+
S as SbbConnectedAbortController,
|
|
159
|
+
O as SbbInertController,
|
|
160
|
+
u as SbbLanguageController,
|
|
161
|
+
L as SbbMediaMatcherController,
|
|
162
|
+
Q as SbbMediaQueryBreakpointMediumAndAbove,
|
|
163
|
+
H as SbbMediaQueryBreakpointSmallAndBelow,
|
|
164
|
+
w as SbbMediaQueryForcedColors,
|
|
165
|
+
M as SbbMediaQueryHover,
|
|
166
|
+
N as SbbMediaQueryPointerCoarse,
|
|
167
|
+
I as SbbSlotStateController
|
|
126
168
|
};
|
package/core/dom/breakpoint.d.ts
CHANGED
|
@@ -6,9 +6,10 @@ export type Breakpoint = (typeof breakpoints)[number];
|
|
|
6
6
|
*
|
|
7
7
|
* @param from The breakpoint corresponding to the `min-width` value of the media query (optional).
|
|
8
8
|
* @param to The breakpoint corresponding to the `max-width` value of the media query (optional).
|
|
9
|
+
* @param properties Whether the max breakpoint should be included
|
|
9
10
|
* @returns A boolean indicating whether the window matches the breakpoint.
|
|
10
11
|
*/
|
|
11
12
|
export declare function isBreakpoint(from?: Breakpoint, to?: Breakpoint, properties?: {
|
|
12
13
|
includeMaxBreakpoint: boolean;
|
|
13
|
-
}): boolean;
|
|
14
|
+
}): boolean | null;
|
|
14
15
|
//# sourceMappingURL=breakpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/breakpoint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,yEAA0E,CAAC;AACnG,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/breakpoint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,yEAA0E,CAAC;AACnG,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,IAAI,CAAC,EAAE,UAAU,EACjB,EAAE,CAAC,EAAE,UAAU,EACf,UAAU,CAAC,EAAE;IAAE,oBAAoB,EAAE,OAAO,CAAA;CAAE,GAC7C,OAAO,GAAG,IAAI,CAsBhB"}
|
package/core/dom.js
CHANGED
|
@@ -2,8 +2,8 @@ import { isServer as e } from "lit";
|
|
|
2
2
|
const v = ["zero", "micro", "small", "medium", "wide", "large", "ultra"];
|
|
3
3
|
function E(t, n, o) {
|
|
4
4
|
if (e)
|
|
5
|
-
return
|
|
6
|
-
const i = getComputedStyle(document.documentElement),
|
|
5
|
+
return null;
|
|
6
|
+
const i = getComputedStyle(document.documentElement), r = t ? i.getPropertyValue(`--sbb-breakpoint-${t}-min`) : "", s = n ? `${parseFloat(i.getPropertyValue(`--sbb-breakpoint-${n}-${o != null && o.includeMaxBreakpoint ? "max" : "min"}`)) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", m = r && `(min-width: ${r})`, f = s && `(max-width: ${s})`, y = r && s && " and ";
|
|
7
7
|
return window.matchMedia(`${m}${y}${f}`).matches;
|
|
8
8
|
}
|
|
9
9
|
function g(t) {
|
|
@@ -33,13 +33,13 @@ function x(t, n) {
|
|
|
33
33
|
function k(t, n, o) {
|
|
34
34
|
o ? t.setAttribute(n, o) : t.removeAttribute(n);
|
|
35
35
|
}
|
|
36
|
-
let
|
|
36
|
+
let c;
|
|
37
37
|
try {
|
|
38
|
-
|
|
38
|
+
c = typeof Intl < "u" && Intl.v8BreakIterator;
|
|
39
39
|
} catch {
|
|
40
|
-
|
|
40
|
+
c = !1;
|
|
41
41
|
}
|
|
42
|
-
const u = !e && /(edge)/i.test(navigator.userAgent),
|
|
42
|
+
const u = !e && /(edge)/i.test(navigator.userAgent), a = !e && /(msie|trident)/i.test(navigator.userAgent), b = !e && !!(window.chrome || c) && typeof CSS < "u" && !u && !a, h = !e && /AppleWebKit/i.test(navigator.userAgent) && !b && !u && !a, I = !e && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), $ = !e && /(firefox|minefield)/i.test(navigator.userAgent), M = !e && /android/i.test(navigator.userAgent) && !a, _ = !e && /safari/i.test(navigator.userAgent) && h, W = b, B = () => !!globalThis.next;
|
|
43
43
|
function l() {
|
|
44
44
|
return document.body.hasAttribute("data-sbb-scroll-disabled");
|
|
45
45
|
}
|
|
@@ -86,7 +86,7 @@ export {
|
|
|
86
86
|
I as isIOS,
|
|
87
87
|
B as isNextjs,
|
|
88
88
|
_ as isSafari,
|
|
89
|
-
|
|
89
|
+
a as isTrident,
|
|
90
90
|
h as isWebkit,
|
|
91
91
|
l as pageScrollDisabled,
|
|
92
92
|
k as setOrRemoveAttribute
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-associated-checkbox-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/form-associated-checkbox-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAMxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAErB,KAAK,0BAA0B,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAIlF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,kCAC5B,SAAQ,0BACR,YAAW,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAEvE,IAAW,OAAO,IAAI,OAAO,CAAC;IAC9B,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE;IAEnC,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAE/B,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAExB,iBAAiB,IAAI,IAAI;IACzB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAEhG,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,mBAAmB,CAAC,IAAI,IAAI;IACtC,SAAS,CAAC,eAAe,IAAI,IAAI;CAClC;AAED;;;;GAIG;AAEH,eAAO,MAAM,8BAA8B,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,cAClE,CAAC,KACZ,WAAW,CAAC,kCAAkC,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"form-associated-checkbox-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/form-associated-checkbox-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAMxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAErB,KAAK,0BAA0B,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAIlF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,kCAC5B,SAAQ,0BACR,YAAW,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAEvE,IAAW,OAAO,IAAI,OAAO,CAAC;IAC9B,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE;IAEnC,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAE/B,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE;IACpC,IAAW,QAAQ,IAAI,OAAO,CAAC;IAExB,iBAAiB,IAAI,IAAI;IACzB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAEhG,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,oBAAoB,IAAI,OAAO;IACzC,SAAS,CAAC,mBAAmB,CAAC,IAAI,IAAI;IACtC,SAAS,CAAC,eAAe,IAAI,IAAI;CAClC;AAED;;;;GAIG;AAEH,eAAO,MAAM,8BAA8B,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,cAClE,CAAC,KACZ,WAAW,CAAC,kCAAkC,CAAC,GAAG,CAqJpD,CAAC"}
|
package/core/mixins.js
CHANGED
|
@@ -202,7 +202,7 @@ const D = (r) => (() => {
|
|
|
202
202
|
get required() {
|
|
203
203
|
return this._required || this.isRequiredExternally();
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
willUpdate(s) {
|
|
206
206
|
super.willUpdate(s), s.has("required") && (this.internals.ariaRequired = `${this.required}`);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
@@ -232,6 +232,13 @@ const D = (r) => (() => {
|
|
|
232
232
|
get checked() {
|
|
233
233
|
return this._checked;
|
|
234
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Form type of element.
|
|
237
|
+
* @default 'checkbox'
|
|
238
|
+
*/
|
|
239
|
+
get type() {
|
|
240
|
+
return "checkbox";
|
|
241
|
+
}
|
|
235
242
|
constructor() {
|
|
236
243
|
super(), this._attributeMutationBlocked = (v(this, s), !1), this._checked = !1, this._handleKeyboardInteraction = (e) => {
|
|
237
244
|
e.key === " " && this._handleUserInteraction();
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
:host(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
:is(
|
|
38
|
+
[data-focus-visible],
|
|
39
|
+
:focus-visible:not([data-focus-origin='mouse'], [data-focus-origin='touch'])
|
|
40
|
+
)
|
|
41
|
+
) {
|
|
42
42
|
@include icon-button-focus-visible(#{$button-selector});
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This class exists to facilitate the test migration from stencil to lit.
|
|
3
3
|
* It mimics the API that stencil provided to test events.
|
|
4
|
-
*
|
|
5
|
-
* TODO: Document me
|
|
6
4
|
*/
|
|
7
5
|
export declare class EventSpy<T extends Event> {
|
|
8
6
|
private _event;
|
|
9
7
|
private readonly _target;
|
|
10
|
-
private _count;
|
|
11
8
|
get count(): number;
|
|
12
|
-
private
|
|
9
|
+
private _count;
|
|
13
10
|
get events(): T[];
|
|
11
|
+
private _events;
|
|
14
12
|
get firstEvent(): T | null;
|
|
15
13
|
get lastEvent(): T | null;
|
|
14
|
+
private _promiseEventMap;
|
|
16
15
|
constructor(_event: string, _target?: Node | null);
|
|
16
|
+
calledOnce(timeout?: number): Promise<T>;
|
|
17
|
+
calledTimes(count: number, timeout?: number): Promise<T>;
|
|
18
|
+
private _wrapPromiseWithTimeout;
|
|
17
19
|
private _listenForEvent;
|
|
18
20
|
}
|
|
19
21
|
//# sourceMappingURL=event-spy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-spy.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/testing/event-spy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-spy.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/testing/event-spy.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,KAAK;IAsBjC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ,CAAC,OAAO;IAtB1B,IAAW,KAAK,IAAI,MAAM,CAEzB;IACD,OAAO,CAAC,MAAM,CAAa;IAE3B,IAAW,MAAM,IAAI,CAAC,EAAE,CAEvB;IACD,OAAO,CAAC,OAAO,CAAW;IAE1B,IAAW,UAAU,IAAI,CAAC,GAAG,IAAI,CAEhC;IAED,IAAW,SAAS,IAAI,CAAC,GAAG,IAAI,CAE/B;IAED,OAAO,CAAC,gBAAgB,CAA6C;gBAG3D,MAAM,EAAE,MAAM,EACL,OAAO,GAAE,IAAI,GAAG,IAAW;IASvC,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IA6B7D,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,eAAe;CAOxB"}
|