@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/core/mixins.js
CHANGED
|
@@ -6,7 +6,7 @@ var C = (d, v, c) => (L(d, v, "read from private field"), c ? c.call(d) : v.get(
|
|
|
6
6
|
import { __esDecorate as y, __runInitializers as _ } from "tslib";
|
|
7
7
|
import { property as k, state as j, eventOptions as G } from "lit/decorators.js";
|
|
8
8
|
import { forceType as I, getOverride as H, hostAttributes as K } from "./decorators.js";
|
|
9
|
-
import { defaultConverter as
|
|
9
|
+
import { defaultConverter as U, isServer as O, html as R, nothing as A, css as W } from "lit";
|
|
10
10
|
import { SbbLanguageController as M, SbbConnectedAbortController as X } from "./controllers.js";
|
|
11
11
|
import { preventScrollOnSpacebarPress as J, EventEmitter as Q } from "./eventing.js";
|
|
12
12
|
import { i18nCheckboxRequired as Y, i18nInputRequired as Z, i18nSelectionRequired as ee } from "./i18n.js";
|
|
@@ -414,11 +414,11 @@ const V = (d) => (() => {
|
|
|
414
414
|
r = [k({
|
|
415
415
|
type: Boolean,
|
|
416
416
|
converter: {
|
|
417
|
-
...
|
|
417
|
+
...U,
|
|
418
418
|
// We need to pass information to the setter so that we know it was called by attribute change.
|
|
419
419
|
fromAttribute: (a, i) => {
|
|
420
420
|
var p, x;
|
|
421
|
-
return { value: (x = (p =
|
|
421
|
+
return { value: (x = (p = U).fromAttribute) == null ? void 0 : x.call(p, a, i), attribute: !0 };
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
})], y(u, null, r, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (a) => "checked" in a, set: (a, i) => {
|
|
@@ -544,6 +544,9 @@ const V = (d) => (() => {
|
|
|
544
544
|
formStateRestoreCallback(e, s) {
|
|
545
545
|
e && typeof e == "string" && (this.value = e);
|
|
546
546
|
}
|
|
547
|
+
async firstUpdated(e) {
|
|
548
|
+
super.firstUpdated(e), this.value && !this.innerHTML.length && (this.innerHTML = this.value);
|
|
549
|
+
}
|
|
547
550
|
updateFormValue() {
|
|
548
551
|
this.internals.setFormValue(this.value, this.value);
|
|
549
552
|
}
|
|
@@ -586,7 +589,7 @@ const V = (d) => (() => {
|
|
|
586
589
|
s.placeholder = a;
|
|
587
590
|
} }, metadata: e }, null, l), y(r, null, t, { kind: "method", name: "_cleanChildren", static: !1, private: !1, access: { has: (s) => "_cleanChildren" in s, get: (s) => s._cleanChildren }, metadata: e }, null, l), e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
588
591
|
})(), r;
|
|
589
|
-
})(),
|
|
592
|
+
})(), T = /* @__PURE__ */ new WeakMap(), Ce = (d) => (() => {
|
|
590
593
|
var n;
|
|
591
594
|
let c = B(D(V(d))), l = [], f;
|
|
592
595
|
return n = class extends c {
|
|
@@ -614,7 +617,7 @@ const V = (d) => (() => {
|
|
|
614
617
|
}
|
|
615
618
|
constructor() {
|
|
616
619
|
var t;
|
|
617
|
-
super(), this._checked = (_(this, l), !1), this.abort = new X(this), this.
|
|
620
|
+
super(), this._checked = (_(this, l), !1), this.abort = new X(this), this._languageController = new M(this), this.internals.role = "radio", (t = this.addEventListener) == null || t.call(this, "keydown", (r) => this._handleArrowKeyDown(r));
|
|
618
621
|
}
|
|
619
622
|
connectedCallback() {
|
|
620
623
|
super.connectedCallback(), this._connectToRegistry(), this._synchronizeGroupState();
|
|
@@ -642,7 +645,7 @@ const V = (d) => (() => {
|
|
|
642
645
|
super.willUpdate(t), t.has("disabled") && this.updateFocusableRadios();
|
|
643
646
|
}
|
|
644
647
|
firstUpdated(t) {
|
|
645
|
-
super.firstUpdated(t), this.
|
|
648
|
+
super.firstUpdated(t), this.updateFocusableRadios();
|
|
646
649
|
}
|
|
647
650
|
/**
|
|
648
651
|
* Called on `value` change
|
|
@@ -672,7 +675,7 @@ const V = (d) => (() => {
|
|
|
672
675
|
* - the first non-disabled radio in DOM order;
|
|
673
676
|
*/
|
|
674
677
|
updateFocusableRadios() {
|
|
675
|
-
if (!this.
|
|
678
|
+
if (!this.hasUpdated)
|
|
676
679
|
return;
|
|
677
680
|
const t = this._interactableGroupedRadios(), r = t.findIndex((e) => e.checked && !e.disabled && !e.formDisabled), u = r !== -1 ? r : t.findIndex((e) => !e.disabled && !e.formDisabled);
|
|
678
681
|
u !== -1 && (t[u].tabIndex = 0, t.splice(u, 1)), t.forEach((e) => e.removeAttribute("tabindex"));
|
|
@@ -693,7 +696,7 @@ const V = (d) => (() => {
|
|
|
693
696
|
if (!this.name || O)
|
|
694
697
|
return;
|
|
695
698
|
const t = this.form ?? this.getRootNode();
|
|
696
|
-
this._radioButtonGroupsMap =
|
|
699
|
+
this._radioButtonGroupsMap = T.get(t), this._radioButtonGroupsMap || (this._radioButtonGroupsMap = /* @__PURE__ */ new Map(), T.set(t, this._radioButtonGroupsMap)), this.associatedRadioButtons = this._radioButtonGroupsMap.get(this.name), this.associatedRadioButtons || (this.associatedRadioButtons = /* @__PURE__ */ new Set(), this._radioButtonGroupsMap.set(this.name, this.associatedRadioButtons));
|
|
697
700
|
const r = Array.from(this.associatedRadioButtons);
|
|
698
701
|
this.associatedRadioButtons.clear();
|
|
699
702
|
const u = r.findIndex((e) => this.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
@@ -766,7 +769,7 @@ const V = (d) => (() => {
|
|
|
766
769
|
}
|
|
767
770
|
}
|
|
768
771
|
return v;
|
|
769
|
-
},
|
|
772
|
+
}, P = "data-ssr-child-count", z = "li", Ee = (d) => (() => {
|
|
770
773
|
var b, t;
|
|
771
774
|
let c = le(d), l, f = [], n = [];
|
|
772
775
|
return t = class extends c {
|
|
@@ -775,7 +778,7 @@ const V = (d) => (() => {
|
|
|
775
778
|
E(this, b);
|
|
776
779
|
S(this, b, _(this, f, [])), this._handleSlotchange = (_(this, n), () => {
|
|
777
780
|
const e = Array.from(this.children ?? []).filter((s) => this.listChildLocalNames.includes(s.localName));
|
|
778
|
-
e.length === this.listChildren.length && this.listChildren.every((s, a) => e[a] === s) || (this.listChildren.filter((s) => !e.includes(s)).forEach((s) => s.removeAttribute("slot")), this.listChildren = e, this.listChildren.forEach((s, a) => s.setAttribute("slot", `${
|
|
781
|
+
e.length === this.listChildren.length && this.listChildren.every((s, a) => e[a] === s) || (this.listChildren.filter((s) => !e.includes(s)).forEach((s) => s.removeAttribute("slot")), this.listChildren = e, this.listChildren.forEach((s, a) => s.setAttribute("slot", `${z}-${a}`)), this.removeAttribute(P));
|
|
779
782
|
});
|
|
780
783
|
}
|
|
781
784
|
/**
|
|
@@ -837,10 +840,10 @@ const V = (d) => (() => {
|
|
|
837
840
|
* children to be passed via the `data-ssr-child-count` attribute value.
|
|
838
841
|
*/
|
|
839
842
|
listSlotEntries(e) {
|
|
840
|
-
return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(
|
|
843
|
+
return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(P) ?? 0) })).map((a, i) => {
|
|
841
844
|
var o;
|
|
842
845
|
return {
|
|
843
|
-
name: `${
|
|
846
|
+
name: `${z}-${i}`,
|
|
844
847
|
ariaHidden: ((o = e == null ? void 0 : e.localNameVisualOnly) == null ? void 0 : o.includes(a.localName)) ?? !1
|
|
845
848
|
};
|
|
846
849
|
});
|
|
@@ -964,5 +967,5 @@ export {
|
|
|
964
967
|
D as SbbRequiredMixin,
|
|
965
968
|
Ie as SbbUpdateSchedulerMixin,
|
|
966
969
|
Ae as panelCommonStyle,
|
|
967
|
-
|
|
970
|
+
T as radioButtonRegistry
|
|
968
971
|
};
|