@sbb-esta/lyne-elements 2.5.0 → 2.5.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/autocomplete/autocomplete-base-element.d.ts +0 -1
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete.js +13 -13
- package/core/base-elements/button-base-element.d.ts +5 -0
- package/core/base-elements/button-base-element.d.ts.map +1 -1
- package/core/base-elements.js +94 -79
- package/core/dom/platform.d.ts +5 -0
- package/core/dom/platform.d.ts.map +1 -1
- package/core/dom.js +10 -9
- package/core/mixins/form-associated-input-mixin.d.ts.map +1 -1
- package/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
- package/core/mixins.js +16 -13
- package/custom-elements.json +992 -102
- package/development/autocomplete/autocomplete-base-element.d.ts +0 -1
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete.js +2 -4
- package/development/core/base-elements/button-base-element.d.ts +5 -0
- package/development/core/base-elements/button-base-element.d.ts.map +1 -1
- package/development/core/base-elements.js +38 -10
- package/development/core/dom/platform.d.ts +5 -0
- package/development/core/dom/platform.d.ts.map +1 -1
- package/development/core/dom.js +3 -1
- package/development/core/mixins/form-associated-input-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 +8 -4
- package/development/form-field/form-field.js +2 -2
- package/development/radio-button/radio-button-group/radio-button-group.d.ts +0 -1
- package/development/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/development/radio-button/radio-button-group.js +3 -5
- package/development/select/select.d.ts +5 -2
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +6 -4
- package/development/stepper/step/step.d.ts +1 -3
- package/development/stepper/step/step.d.ts.map +1 -1
- package/development/stepper/step.js +2 -7
- package/form-field/form-field.js +1 -1
- package/package.json +1 -1
- package/radio-button/radio-button-group/radio-button-group.d.ts +0 -1
- package/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/radio-button/radio-button-group.js +8 -8
- package/select/select.d.ts +5 -2
- package/select/select.d.ts.map +1 -1
- package/select.js +8 -9
- package/stepper/step/step.d.ts +1 -3
- package/stepper/step/step.d.ts.map +1 -1
- package/stepper/step.js +11 -14
package/select.js
CHANGED
|
@@ -14,7 +14,7 @@ import { SbbOpenCloseBaseElement as oe } from "./core/base-elements.js";
|
|
|
14
14
|
import { SbbEscapableOverlayController as le, SbbLanguageController as re } from "./core/controllers.js";
|
|
15
15
|
import { hostAttributes as ne, forceType as E, handleDistinctChange as S, getOverride as be } from "./core/decorators.js";
|
|
16
16
|
import { setOrRemoveAttribute as D, isZeroAnimationDuration as de, isNextjs as J, isSafari as he } from "./core/dom.js";
|
|
17
|
-
import { EventEmitter as
|
|
17
|
+
import { EventEmitter as V } from "./core/eventing.js";
|
|
18
18
|
import { i18nSelectionRequired as pe } from "./core/i18n.js";
|
|
19
19
|
import { SbbUpdateSchedulerMixin as ce, SbbDisabledMixin as ue, SbbNegativeMixin as ve, SbbHydrationMixin as _e, SbbRequiredMixin as ge, SbbFormAssociatedMixin as fe } from "./core/mixins.js";
|
|
20
20
|
import { isEventOnElement as Q, setOverlayPosition as me, overlayGapFixCorners as ye } from "./core/overlay.js";
|
|
@@ -23,8 +23,8 @@ let xe = 0, Re = (() => {
|
|
|
23
23
|
var p, c, u, v, _, n;
|
|
24
24
|
let a = [se("sbb-select"), ne({
|
|
25
25
|
role: O ? "listbox" : null
|
|
26
|
-
})], l, r = [], h,
|
|
27
|
-
var y = (n = class extends
|
|
26
|
+
})], l, r = [], h, I = ce(ue(ve(_e(ge(fe(oe)))))), L, P = [], $ = [], T, z = [], U = [], q, M = [], R = [], N, B = [], K = [], F, j = [], H = [];
|
|
27
|
+
var y = (n = class extends I {
|
|
28
28
|
constructor() {
|
|
29
29
|
var e, t, s;
|
|
30
30
|
super();
|
|
@@ -33,7 +33,7 @@ let xe = 0, Re = (() => {
|
|
|
33
33
|
f(this, u);
|
|
34
34
|
f(this, v);
|
|
35
35
|
f(this, _);
|
|
36
|
-
b(this, p, d(this, P, "")), b(this, c, (d(this, $), d(this, z, !1))), b(this, u, (d(this, U), d(this, M, !1))), b(this, v, (d(this, R), d(this, B, !1))), b(this, _, (d(this, K), d(this, j, null))), this._change = (d(this, H), new
|
|
36
|
+
b(this, p, d(this, P, "")), b(this, c, (d(this, $), d(this, z, !1))), b(this, u, (d(this, U), d(this, M, !1))), b(this, v, (d(this, R), d(this, B, !1))), b(this, _, (d(this, K), d(this, j, null))), this._change = (d(this, H), new V(this, y.events.change)), this._input = new V(this, y.events.input), this._displayValueChanged = new V(this, y.events.displayValueChange, {
|
|
37
37
|
composed: !1
|
|
38
38
|
}), this._sbbEscapableOverlayController = new le(this), this._overlayId = `sbb-select-${++xe}`, this._activeItemIndex = -1, this._searchString = "", this._didLoad = !1, this._isPointerDownEventOnMenu = !1, this._languageController = new re(this), this._pointerDownListener = (i) => {
|
|
39
39
|
this._isPointerDownEventOnMenu = Q(this._overlay, i);
|
|
@@ -134,7 +134,7 @@ let xe = 0, Re = (() => {
|
|
|
134
134
|
!Array.isArray(s) && t !== s || Array.isArray(s) && !s.includes(t) || this._updateDisplayValue(s);
|
|
135
135
|
}
|
|
136
136
|
_updateDisplayValue(e) {
|
|
137
|
-
Array.isArray(e) ? this._displayValue = e.map((t) => t.textContent).join(", ") || null : e ? this._displayValue = (e == null ? void 0 : e.textContent) || null : this._displayValue = null;
|
|
137
|
+
Array.isArray(e) ? this._displayValue = e.map((t) => t.textContent).join(", ") || null : e ? this._displayValue = (e == null ? void 0 : e.textContent) || null : this._displayValue = null, this._displayValueChanged.emit();
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
140
|
* The `value` property should be adapted when the `multiple` property changes:
|
|
@@ -161,7 +161,6 @@ let xe = 0, Re = (() => {
|
|
|
161
161
|
const s = t.find((i) => (i.value ?? i.getAttribute("value")) === e) ?? null;
|
|
162
162
|
s && (s.selected = !0), t.filter((i) => (i.value ?? i.getAttribute("value")) !== e).forEach((i) => i.selected = !1), this._updateDisplayValue(s);
|
|
163
163
|
}
|
|
164
|
-
this._stateChange.emit({ type: "value", value: e });
|
|
165
164
|
}
|
|
166
165
|
firstUpdated(e) {
|
|
167
166
|
super.firstUpdated(e), this.focus = () => this._triggerElement.focus(), this.blur = () => this._triggerElement.blur(), J() || (this.startUpdate(), this._setupSelect());
|
|
@@ -380,7 +379,7 @@ let xe = 0, Re = (() => {
|
|
|
380
379
|
t.push(s.value);
|
|
381
380
|
this.value = t;
|
|
382
381
|
}
|
|
383
|
-
} else e
|
|
382
|
+
} else e ? (this._activeItemIndex = this._filteredOptions.findIndex((t) => t === e), this.value = e.value) : this.value && this._onValueChanged(this.value);
|
|
384
383
|
}
|
|
385
384
|
_getSelected() {
|
|
386
385
|
return this.multiple ? this._filteredOptions.filter((e) => e.selected) : this._filteredOptions.find((e) => e.selected) ?? null;
|
|
@@ -454,7 +453,7 @@ let xe = 0, Re = (() => {
|
|
|
454
453
|
`;
|
|
455
454
|
}
|
|
456
455
|
}, p = new WeakMap(), c = new WeakMap(), u = new WeakMap(), v = new WeakMap(), _ = new WeakMap(), h = n, (() => {
|
|
457
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
456
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(I[Symbol.metadata] ?? null) : void 0;
|
|
458
457
|
L = [E(), k()], T = [E(), S((t, s) => t._onMultipleChanged(s)), k({ reflect: !0, type: Boolean })], q = [E(), S((t, s) => t._closeOnDisabledReadonlyChanged(s)), k({ reflect: !0, type: Boolean }), be((t, s) => s || t.isDisabledExternally())], N = [E(), S((t, s) => t._closeOnDisabledReadonlyChanged(s)), k({ type: Boolean })], F = [ie()], m(n, null, L, { kind: "accessor", name: "placeholder", static: !1, private: !1, access: { has: (t) => "placeholder" in t, get: (t) => t.placeholder, set: (t, s) => {
|
|
459
458
|
t.placeholder = s;
|
|
460
459
|
} }, metadata: e }, P, $), m(n, null, T, { kind: "accessor", name: "multiple", static: !1, private: !1, access: { has: (t) => "multiple" in t, get: (t) => t.multiple, set: (t, s) => {
|
|
@@ -469,7 +468,7 @@ let xe = 0, Re = (() => {
|
|
|
469
468
|
})(), n.styles = we, n.events = {
|
|
470
469
|
change: "change",
|
|
471
470
|
input: "input",
|
|
472
|
-
|
|
471
|
+
displayValueChange: "displayValueChange",
|
|
473
472
|
willOpen: "willOpen",
|
|
474
473
|
didOpen: "didOpen",
|
|
475
474
|
willClose: "willClose",
|
package/stepper/step/step.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement,
|
|
1
|
+
import { CSSResultGroup, LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import { SbbStepLabelElement } from '../step-label.js';
|
|
3
3
|
export type SbbStepValidateEventDetails = {
|
|
4
4
|
currentIndex: number | null;
|
|
@@ -19,7 +19,6 @@ export declare class SbbStepElement extends LitElement {
|
|
|
19
19
|
};
|
|
20
20
|
/** Emits whenever step switch is triggered. */
|
|
21
21
|
private _validate;
|
|
22
|
-
private _loaded;
|
|
23
22
|
private _stepper;
|
|
24
23
|
private _label;
|
|
25
24
|
/** The label of the step. */
|
|
@@ -51,7 +50,6 @@ export declare class SbbStepElement extends LitElement {
|
|
|
51
50
|
private _isGoPreviousElement;
|
|
52
51
|
private _getStepLabel;
|
|
53
52
|
connectedCallback(): void;
|
|
54
|
-
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
55
53
|
protected render(): TemplateResult;
|
|
56
54
|
}
|
|
57
55
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/elements/stepper/step/step.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/elements/stepper/step/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EA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as m, LitElement as v, html as u } from "lit";
|
|
3
3
|
import { customElement as y } from "lit/decorators.js";
|
|
4
4
|
import { hostAttributes as g } from "../core/decorators.js";
|
|
5
5
|
import { EventEmitter as f } from "../core/eventing.js";
|
|
@@ -9,7 +9,7 @@ let x = 0, A = (() => {
|
|
|
9
9
|
let d = [y("sbb-step"), g({
|
|
10
10
|
slot: "step",
|
|
11
11
|
role: "tabpanel"
|
|
12
|
-
})], b, r = [],
|
|
12
|
+
})], b, r = [], i, o = v;
|
|
13
13
|
var n = (e = class extends o {
|
|
14
14
|
/** The label of the step. */
|
|
15
15
|
get label() {
|
|
@@ -17,14 +17,14 @@ let x = 0, A = (() => {
|
|
|
17
17
|
}
|
|
18
18
|
constructor() {
|
|
19
19
|
var t;
|
|
20
|
-
super(), this._validate = new f(this, n.events.validate), this.
|
|
20
|
+
super(), this._validate = new f(this, n.events.validate), this._stepper = null, this._label = null, (t = this.addEventListener) == null || t.call(this, "click", (a) => this._handleClick(a));
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Selects and configures the step.
|
|
24
24
|
* @internal
|
|
25
25
|
*/
|
|
26
26
|
select() {
|
|
27
|
-
!this.
|
|
27
|
+
!this.hasUpdated || !this.label || (this.toggleAttribute("data-selected", !0), this.label.select());
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Deselects and configures the step.
|
|
@@ -50,8 +50,8 @@ let x = 0, A = (() => {
|
|
|
50
50
|
/** Watches for clicked elements with `sbb-stepper-next` or `sbb-stepper-previous` attributes. */
|
|
51
51
|
_handleClick(t) {
|
|
52
52
|
var l, p;
|
|
53
|
-
const a = t.composedPath().filter((
|
|
54
|
-
a.some((
|
|
53
|
+
const a = t.composedPath().filter((s) => s instanceof window.HTMLElement);
|
|
54
|
+
a.some((s) => this._isGoNextElement(s)) ? (l = this._stepper) == null || l.next() : a.some((s) => this._isGoPreviousElement(s)) && ((p = this._stepper) == null || p.previous());
|
|
55
55
|
}
|
|
56
56
|
_isGoNextElement(t) {
|
|
57
57
|
return t.hasAttribute("sbb-stepper-next") && !t.hasAttribute("disabled");
|
|
@@ -68,11 +68,8 @@ let x = 0, A = (() => {
|
|
|
68
68
|
connectedCallback() {
|
|
69
69
|
super.connectedCallback(), this.id = this.id || `sbb-step-${x++}`, this._stepper = this.closest("sbb-stepper"), this._label = this._getStepLabel();
|
|
70
70
|
}
|
|
71
|
-
firstUpdated(t) {
|
|
72
|
-
super.firstUpdated(t), this._loaded = !0;
|
|
73
|
-
}
|
|
74
71
|
render() {
|
|
75
|
-
return
|
|
72
|
+
return u`
|
|
76
73
|
<div class="sbb-step--wrapper">
|
|
77
74
|
<div class="sbb-step">
|
|
78
75
|
<slot></slot>
|
|
@@ -80,13 +77,13 @@ let x = 0, A = (() => {
|
|
|
80
77
|
</div>
|
|
81
78
|
`;
|
|
82
79
|
}
|
|
83
|
-
},
|
|
80
|
+
}, i = e, (() => {
|
|
84
81
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
85
|
-
c(null, b = { value:
|
|
82
|
+
c(null, b = { value: i }, d, { kind: "class", name: i.name, metadata: t }, null, r), n = i = b.value, t && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
86
83
|
})(), e.styles = _, e.events = {
|
|
87
84
|
validate: "validate"
|
|
88
|
-
}, h(
|
|
89
|
-
return n =
|
|
85
|
+
}, h(i, r), e);
|
|
86
|
+
return n = i;
|
|
90
87
|
})();
|
|
91
88
|
export {
|
|
92
89
|
A as SbbStepElement
|