@lmvz-ds/components 0.21.0 → 0.22.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/CHANGELOG.md +6 -0
- package/assets/icons/close-sm.svg +3 -0
- package/cjs/{component-Csg9MtNK.js → component-C7cavwmZ.js} +3 -0
- package/cjs/{index-C2yDXRqP.js → index-lW-SEvL7.js} +67 -3
- package/cjs/lmvz-action.cjs.entry.js +2 -2
- package/cjs/{lmvz-button.cjs.entry.js → lmvz-button_2.cjs.entry.js} +139 -14
- package/cjs/lmvz-card.cjs.entry.js +2 -2
- package/cjs/lmvz-checkbox.cjs.entry.js +3 -3
- package/cjs/lmvz-chip.cjs.entry.js +4 -4
- package/cjs/lmvz-components.cjs.js +2 -2
- package/cjs/lmvz-header_2.cjs.entry.js +3 -3
- package/cjs/lmvz-input.cjs.entry.js +4 -4
- package/cjs/lmvz-menuitem.cjs.entry.js +3 -3
- package/cjs/lmvz-modal.cjs.entry.js +349 -0
- package/cjs/lmvz-select.cjs.entry.js +4 -4
- package/cjs/lmvz-toggle.cjs.entry.js +5 -5
- package/cjs/loader.cjs.js +2 -2
- package/cjs/{reactive-controller-host-BA4ZhjKA.js → reactive-controller-host-DnSTWHCF.js} +1 -1
- package/collection/assets/icons/close-sm.svg +3 -0
- package/collection/collection-manifest.json +1 -0
- package/collection/components/lmvz-button/lmvz-button.js +98 -10
- package/collection/components/lmvz-chip/lmvz-chip.js +2 -2
- package/collection/components/lmvz-modal/lmvz-modal.css +120 -0
- package/collection/components/lmvz-modal/lmvz-modal.js +448 -0
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/components/lmvz-toggle/lmvz-toggle.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.bak +2 -0
- package/components/index.js +1 -1
- package/components/lmvz-action.js +1 -1
- package/components/lmvz-button.js +1 -1
- package/components/lmvz-card.js +1 -1
- package/components/lmvz-checkbox.js +1 -1
- package/components/lmvz-chip.js +1 -1
- package/components/lmvz-header.js +1 -1
- package/components/lmvz-icon.js +1 -1
- package/components/lmvz-input.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-modal.d.ts +11 -0
- package/components/lmvz-modal.d.ts.bak +11 -0
- package/components/lmvz-modal.js +1 -0
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-toggle.js +1 -1
- package/components/p-Boj0PCdB.js +1 -0
- package/components/p-CK8cAKcB.js +1 -0
- package/components/p-Cc6dOWwS.js +1 -0
- package/components/{p-BuFx0tTm.js → p-DBc1BzQb.js} +1 -1
- package/components/p-DOTK1OW3.js +1 -0
- package/esm/{component-DIrAQ4IB.js → component-DOTK1OW3.js} +3 -0
- package/esm/{index-saW7O-EW.js → index-Aa_425iY.js} +67 -3
- package/esm/lmvz-action.entry.js +2 -2
- package/esm/{lmvz-button.entry.js → lmvz-button_2.entry.js} +139 -15
- package/esm/lmvz-card.entry.js +2 -2
- package/esm/lmvz-checkbox.entry.js +3 -3
- package/esm/lmvz-chip.entry.js +4 -4
- package/esm/lmvz-components.js +3 -3
- package/esm/lmvz-header_2.entry.js +3 -3
- package/esm/lmvz-input.entry.js +4 -4
- package/esm/lmvz-menuitem.entry.js +3 -3
- package/esm/lmvz-modal.entry.js +347 -0
- package/esm/lmvz-select.entry.js +4 -4
- package/esm/lmvz-toggle.entry.js +5 -5
- package/esm/loader.js +3 -3
- package/esm/{reactive-controller-host-DHcPpJW7.js → reactive-controller-host-lF2kXM1x.js} +1 -1
- package/hydrate/index.js +451 -26
- package/hydrate/index.mjs +451 -26
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/p-08a08b63.entry.js +1 -0
- package/lmvz-components/p-1b181e90.entry.js +1 -0
- package/lmvz-components/p-23fb2476.entry.js +1 -0
- package/lmvz-components/p-3846ba08.entry.js +1 -0
- package/lmvz-components/p-6bb145e4.entry.js +1 -0
- package/lmvz-components/{p-2f83d7a2.entry.js → p-7a310b1e.entry.js} +1 -1
- package/lmvz-components/p-Aa_425iY.js +2 -0
- package/lmvz-components/{p-GdMr6Qlp.js → p-DCTzMRMQ.js} +1 -1
- package/lmvz-components/p-DOTK1OW3.js +1 -0
- package/lmvz-components/p-b7940687.entry.js +1 -0
- package/lmvz-components/p-d984e118.entry.js +1 -0
- package/lmvz-components/p-db8306a5.entry.js +1 -0
- package/lmvz-components/p-ea335543.entry.js +1 -0
- package/lmvz-components/p-f8ea0eb2.entry.js +1 -0
- package/manifest.json +252 -5
- package/package.json +5 -1
- package/types/api/index.d.ts +6 -0
- package/types/components/lmvz-button/lmvz-button.d.ts +4 -0
- package/types/components/lmvz-modal/lmvz-modal.d.ts +58 -0
- package/types/components.d.ts +77 -0
- package/cjs/lmvz-icon.cjs.entry.js +0 -100
- package/components/p-C_bScbrd.js +0 -1
- package/components/p-DIrAQ4IB.js +0 -1
- package/esm/lmvz-icon.entry.js +0 -98
- package/lmvz-components/p-0f7a4236.entry.js +0 -1
- package/lmvz-components/p-32171f4f.entry.js +0 -1
- package/lmvz-components/p-400b2318.entry.js +0 -1
- package/lmvz-components/p-43e295ba.entry.js +0 -1
- package/lmvz-components/p-851969bd.entry.js +0 -1
- package/lmvz-components/p-9f9d845d.entry.js +0 -1
- package/lmvz-components/p-DIrAQ4IB.js +0 -1
- package/lmvz-components/p-a12f95da.entry.js +0 -1
- package/lmvz-components/p-ab4437dc.entry.js +0 -1
- package/lmvz-components/p-c3b7890d.entry.js +0 -1
- package/lmvz-components/p-d0a0e206.entry.js +0 -1
- package/lmvz-components/p-saW7O-EW.js +0 -2
package/hydrate/index.js
CHANGED
|
@@ -1835,9 +1835,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
1835
1835
|
return {
|
|
1836
1836
|
emit: (detail) => {
|
|
1837
1837
|
return emitEvent(elm, name, {
|
|
1838
|
-
bubbles:
|
|
1839
|
-
composed:
|
|
1840
|
-
cancelable:
|
|
1838
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1839
|
+
composed: !!(flags & 2 /* Composed */),
|
|
1840
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1841
1841
|
detail
|
|
1842
1842
|
});
|
|
1843
1843
|
}
|
|
@@ -2640,6 +2640,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2640
2640
|
hostRef.$deferredConnectedCallback$ = false;
|
|
2641
2641
|
safeCall(instance, "connectedCallback", void 0, elm);
|
|
2642
2642
|
}
|
|
2643
|
+
{
|
|
2644
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
2645
|
+
if (hostRef.$queuedListeners$) {
|
|
2646
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
2647
|
+
hostRef.$queuedListeners$ = void 0;
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2643
2650
|
if (hostRef.$fetchedCbList$.length) {
|
|
2644
2651
|
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
2645
2652
|
}
|
|
@@ -3078,6 +3085,7 @@ var connectedCallback = (elm) => {
|
|
|
3078
3085
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
3079
3086
|
}
|
|
3080
3087
|
} else {
|
|
3088
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
3081
3089
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
3082
3090
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
3083
3091
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -3097,6 +3105,32 @@ var setContentReference = (elm) => {
|
|
|
3097
3105
|
contentRefElm["s-cn"] = true;
|
|
3098
3106
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
3099
3107
|
};
|
|
3108
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3109
|
+
if (listeners && win.document) {
|
|
3110
|
+
listeners.map(([flags, name, method]) => {
|
|
3111
|
+
const target = elm;
|
|
3112
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
3113
|
+
const opts = hostListenerOpts(flags);
|
|
3114
|
+
plt.ael(target, name, handler, opts);
|
|
3115
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
3116
|
+
});
|
|
3117
|
+
}
|
|
3118
|
+
};
|
|
3119
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3120
|
+
var _a2;
|
|
3121
|
+
try {
|
|
3122
|
+
{
|
|
3123
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3124
|
+
(_a2 = hostRef.$lazyInstance$) == null ? void 0 : _a2[methodName](ev);
|
|
3125
|
+
} else {
|
|
3126
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3129
|
+
} catch (e) {
|
|
3130
|
+
consoleError(e, hostRef.$hostElement$);
|
|
3131
|
+
}
|
|
3132
|
+
};
|
|
3133
|
+
var hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
3100
3134
|
function transformTag(tag) {
|
|
3101
3135
|
return tag;
|
|
3102
3136
|
}
|
|
@@ -5087,6 +5121,7 @@ async function hydrateComponent(win2, results, tagName, elm, waitingElements) {
|
|
|
5087
5121
|
if (!hostRef) {
|
|
5088
5122
|
return;
|
|
5089
5123
|
}
|
|
5124
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
5090
5125
|
try {
|
|
5091
5126
|
connectedCallback(elm);
|
|
5092
5127
|
await elm.componentOnReady();
|
|
@@ -5352,7 +5387,7 @@ const lmvzActionCss = () => `:host{display:block}`;
|
|
|
5352
5387
|
class LmvzAction {
|
|
5353
5388
|
constructor(hostRef) {
|
|
5354
5389
|
registerInstance(this, hostRef);
|
|
5355
|
-
this.actionClick = createEvent(this, "actionClick");
|
|
5390
|
+
this.actionClick = createEvent(this, "actionClick", 7);
|
|
5356
5391
|
}
|
|
5357
5392
|
actionClick;
|
|
5358
5393
|
_onClick(event) {
|
|
@@ -5751,6 +5786,9 @@ const ariaAttributes = [
|
|
|
5751
5786
|
];
|
|
5752
5787
|
const inheritAriaAttributes = (el, ignoreList) => {
|
|
5753
5788
|
let attributesToInherit = ariaAttributes;
|
|
5789
|
+
if (ignoreList && ignoreList.length > 0) {
|
|
5790
|
+
attributesToInherit = attributesToInherit.filter((attr) => !ignoreList.includes(attr));
|
|
5791
|
+
}
|
|
5754
5792
|
return inheritAttributes(el, attributesToInherit);
|
|
5755
5793
|
};
|
|
5756
5794
|
const raf = (h) => {
|
|
@@ -5865,10 +5903,13 @@ class LmvzButton extends ReactiveControllerHost {
|
|
|
5865
5903
|
disabled = false;
|
|
5866
5904
|
type = 'button';
|
|
5867
5905
|
form;
|
|
5906
|
+
formMethod;
|
|
5907
|
+
name;
|
|
5908
|
+
value;
|
|
5868
5909
|
constructor(hostRef) {
|
|
5869
5910
|
super();
|
|
5870
5911
|
registerInstance(this, hostRef);
|
|
5871
|
-
this.lmvzActivation = createEvent(this, "lmvzActivation");
|
|
5912
|
+
this.lmvzActivation = createEvent(this, "lmvzActivation", 7);
|
|
5872
5913
|
this.addController(new AriaValidationController(this));
|
|
5873
5914
|
this.addController(new ElementActivationController(this, {
|
|
5874
5915
|
localHandler: this.handleClick.bind(this),
|
|
@@ -5879,18 +5920,46 @@ class LmvzButton extends ReactiveControllerHost {
|
|
|
5879
5920
|
this.inheritedAttributes = inheritAriaAttributes(this.el);
|
|
5880
5921
|
super.connectedCallback();
|
|
5881
5922
|
}
|
|
5923
|
+
disconnectedCallback() {
|
|
5924
|
+
this.formButtonEl?.remove();
|
|
5925
|
+
this.formButtonEl = null;
|
|
5926
|
+
this.formEl = null;
|
|
5927
|
+
super.disconnectedCallback();
|
|
5928
|
+
}
|
|
5882
5929
|
renderHiddenButton() {
|
|
5883
|
-
|
|
5884
|
-
|
|
5930
|
+
if (this.type !== 'submit') {
|
|
5931
|
+
this.formButtonEl?.remove();
|
|
5932
|
+
this.formButtonEl = null;
|
|
5933
|
+
this.formEl = null;
|
|
5885
5934
|
return;
|
|
5886
|
-
|
|
5887
|
-
|
|
5935
|
+
}
|
|
5936
|
+
const formEl = findFormByRef(this.form, this.el);
|
|
5937
|
+
if (!formEl) {
|
|
5938
|
+
this.formButtonEl?.remove();
|
|
5939
|
+
this.formButtonEl = null;
|
|
5940
|
+
this.formEl = null;
|
|
5888
5941
|
return;
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5942
|
+
}
|
|
5943
|
+
this.formEl = formEl;
|
|
5944
|
+
const formButtonEl = this.formButtonEl ?? document.createElement('button');
|
|
5945
|
+
formButtonEl.type = 'submit';
|
|
5946
|
+
formButtonEl.style.display = 'none';
|
|
5947
|
+
formButtonEl.disabled = this.disabled;
|
|
5948
|
+
formButtonEl.name = this.name ?? '';
|
|
5949
|
+
formButtonEl.value = this.value ?? '';
|
|
5950
|
+
if (this.formMethod) {
|
|
5951
|
+
formButtonEl.setAttribute('formmethod', this.formMethod);
|
|
5952
|
+
}
|
|
5953
|
+
else {
|
|
5954
|
+
formButtonEl.removeAttribute('formmethod');
|
|
5955
|
+
}
|
|
5956
|
+
if (this.formButtonEl !== formButtonEl) {
|
|
5957
|
+
this.formButtonEl = formButtonEl;
|
|
5958
|
+
}
|
|
5959
|
+
if (formButtonEl.parentElement !== formEl) {
|
|
5960
|
+
formButtonEl.remove();
|
|
5961
|
+
formEl.appendChild(formButtonEl);
|
|
5962
|
+
}
|
|
5894
5963
|
}
|
|
5895
5964
|
submitForm(ev) {
|
|
5896
5965
|
if (this.formEl && this.formButtonEl) {
|
|
@@ -5905,7 +5974,7 @@ class LmvzButton extends ReactiveControllerHost {
|
|
|
5905
5974
|
};
|
|
5906
5975
|
render() {
|
|
5907
5976
|
this.renderHiddenButton();
|
|
5908
|
-
return (hAsync(Host, { key: '
|
|
5977
|
+
return (hAsync(Host, { key: '6c44aa8a4b40927313461b5139e88066b855dca6', "aria-disabled": this.disabled ? 'true' : null }, hAsync("button", { key: '3696f0ad46a03fe9573571b46a56772def87bf53', ref: (e) => (this.validationEl = e), disabled: this.disabled, type: this.type, class: classNames(this.variant, { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, hAsync("slot", { key: '3ecce9c6ae978b72b14a807d93248a4566a13f4b' }))));
|
|
5909
5978
|
}
|
|
5910
5979
|
static get delegatesFocus() { return true; }
|
|
5911
5980
|
static get style() { return lmvzButtonCss(); }
|
|
@@ -5918,7 +5987,10 @@ class LmvzButton extends ReactiveControllerHost {
|
|
|
5918
5987
|
"variant": [513],
|
|
5919
5988
|
"disabled": [516],
|
|
5920
5989
|
"type": [1],
|
|
5921
|
-
"form": [1]
|
|
5990
|
+
"form": [1],
|
|
5991
|
+
"formMethod": [1, "form-method"],
|
|
5992
|
+
"name": [1],
|
|
5993
|
+
"value": [1]
|
|
5922
5994
|
},
|
|
5923
5995
|
"$listeners$": undefined,
|
|
5924
5996
|
"$lazyBundleId$": "-",
|
|
@@ -5951,7 +6023,7 @@ const lmvzCardCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.componen
|
|
|
5951
6023
|
class LmvzCard {
|
|
5952
6024
|
constructor(hostRef) {
|
|
5953
6025
|
registerInstance(this, hostRef);
|
|
5954
|
-
this.primaryAction = createEvent(this, "primaryAction");
|
|
6026
|
+
this.primaryAction = createEvent(this, "primaryAction", 7);
|
|
5955
6027
|
}
|
|
5956
6028
|
cardTitle;
|
|
5957
6029
|
imageUrl;
|
|
@@ -8194,7 +8266,7 @@ class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
8194
8266
|
constructor(hostRef) {
|
|
8195
8267
|
super();
|
|
8196
8268
|
registerInstance(this, hostRef);
|
|
8197
|
-
this.lmvzChange = createEvent(this, "lmvzChange");
|
|
8269
|
+
this.lmvzChange = createEvent(this, "lmvzChange", 7);
|
|
8198
8270
|
if (hostRef.$hostElement$["s-ei"]) {
|
|
8199
8271
|
this.internals = hostRef.$hostElement$["s-ei"];
|
|
8200
8272
|
}
|
|
@@ -8324,7 +8396,7 @@ class LmvzChip extends ReactiveControllerHost {
|
|
|
8324
8396
|
this.checkContent();
|
|
8325
8397
|
}
|
|
8326
8398
|
checkContent = debounce(() => {
|
|
8327
|
-
if (!isAriaValidationEnabled)
|
|
8399
|
+
if (!isAriaValidationEnabled())
|
|
8328
8400
|
return;
|
|
8329
8401
|
const elements = [...(this.beforeSlot?.assignedElements() ?? []), ...(this.defaultSlot?.assignedElements() ?? []), ...(this.afterSlot?.assignedElements() ?? [])];
|
|
8330
8402
|
if (!elements.length) {
|
|
@@ -8332,7 +8404,7 @@ class LmvzChip extends ReactiveControllerHost {
|
|
|
8332
8404
|
}
|
|
8333
8405
|
}, 500);
|
|
8334
8406
|
render() {
|
|
8335
|
-
return (hAsync(Host, { key: '
|
|
8407
|
+
return (hAsync(Host, { key: '14ee006aff40f125aef2e9a461e68e25c6ed27d6', type: this.type, size: this.size }, hAsync("slot", { key: '3222c7f40b833f344aa233c13e2644d6e928bf4c', name: "before-text", ref: (el) => (this.beforeSlot = el), onSlotchange: () => this.checkContent() }), hAsync("span", { key: '4d1c9fa87ccda9387b945444e9ac6a50703a19e5', class: "content-overflow-wrapper" }, hAsync("slot", { key: '42866115b8a6c50e86663ed8934504240ee0e6fa', ref: (el) => (this.defaultSlot = el), onSlotchange: () => this.checkContent() })), hAsync("slot", { key: '890afa73be440ee7e7620a024744be08fee57b83', name: "after-text", ref: (el) => (this.afterSlot = el), onSlotchange: () => this.checkContent() })));
|
|
8336
8408
|
}
|
|
8337
8409
|
static get watchers() { return {
|
|
8338
8410
|
"type": [{
|
|
@@ -8686,7 +8758,7 @@ class LmvzInput extends ReactiveControllerHost {
|
|
|
8686
8758
|
constructor(hostRef) {
|
|
8687
8759
|
super();
|
|
8688
8760
|
registerInstance(this, hostRef);
|
|
8689
|
-
this.lmvzInput = createEvent(this, "lmvzInput");
|
|
8761
|
+
this.lmvzInput = createEvent(this, "lmvzInput", 7);
|
|
8690
8762
|
if (hostRef.$hostElement$["s-ei"]) {
|
|
8691
8763
|
this.internals = hostRef.$hostElement$["s-ei"];
|
|
8692
8764
|
}
|
|
@@ -8824,7 +8896,7 @@ class LmvzMenuItem extends ReactiveControllerHost {
|
|
|
8824
8896
|
constructor(hostRef) {
|
|
8825
8897
|
super();
|
|
8826
8898
|
registerInstance(this, hostRef);
|
|
8827
|
-
this.lmvzActivation = createEvent(this, "lmvzActivation");
|
|
8899
|
+
this.lmvzActivation = createEvent(this, "lmvzActivation", 7);
|
|
8828
8900
|
this.addController(new AriaValidationController(this, { validationTiming: 'slot' }));
|
|
8829
8901
|
this.addController(new ElementActivationController(this));
|
|
8830
8902
|
}
|
|
@@ -8845,6 +8917,358 @@ class LmvzMenuItem extends ReactiveControllerHost {
|
|
|
8845
8917
|
}; }
|
|
8846
8918
|
}
|
|
8847
8919
|
|
|
8920
|
+
const closeSmSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYgNkwxMiAxMk0xMiAxMkwxOCAxOE0xMiAxMkw2IDE4TTEyIDEyTDE4IDYiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==';
|
|
8921
|
+
|
|
8922
|
+
const lmvzModalCss = () => ` @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } } :host { display: contents; color: var(--lmvz-semantic-color-on-surface-primary, #000000); --lmvz-modal-shell-padding: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)); --lmvz-modal-shell-gap: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)); --lmvz-modal-actions-gap: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-modal-viewport-padding: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)); --lmvz-modal-shell-max-width: 40rem; } dialog { border: none; padding: 0; background: transparent; color: var(--lmvz-semantic-color-on-surface-primary, #000000); } dialog::backdrop { background: rgba(0, 0, 0, 0.19); background: rgb(from var(--lmvz-semantic-color-int-primary, #000000) r g b / 0.19); } .modal-shell { display: flex; flex-direction: column; gap: var(--lmvz-modal-shell-gap); inline-size: min(calc(100vw - (2 * var(--lmvz-modal-viewport-padding))), var(--lmvz-modal-shell-max-width)); max-inline-size: 100%; padding: var(--lmvz-modal-shell-padding); border-radius: var(--lmvz-semantic-border-radius-lg, 14px); background: var(--lmvz-semantic-color-surface-primary, #ffffff); overflow: auto; } .header { display: flex; align-items: flex-start; justify-content: flex-end; gap: var(--lmvz-modal-shell-gap); } .title { min-inline-size: 0; font: var(--lmvz-typography-heading-lg, 500 clamp(1.25rem, 1.19rem + 0.26vw, 1.5rem) / 1.4 Router); } .has-title .title { flex: 1 1 auto; } .body { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--lmvz-modal-actions-gap); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .close-button { display: inline-flex; flex: none; } ::slotted([slot='actions'][hidden]) { display: none; } `;
|
|
8923
|
+
|
|
8924
|
+
const closeIconSvg = toValidSvgStringWithFallback(closeSmSvg);
|
|
8925
|
+
let modalIdCounter = 0;
|
|
8926
|
+
class LmvzModal extends ReactiveControllerHost {
|
|
8927
|
+
get el() { return getElement(this); }
|
|
8928
|
+
inheritedAriaAttributes = {};
|
|
8929
|
+
dialogEl;
|
|
8930
|
+
dialogStateObserver;
|
|
8931
|
+
actionsStateObserver;
|
|
8932
|
+
headerSlot;
|
|
8933
|
+
actionsSlot;
|
|
8934
|
+
closeButtonEl;
|
|
8935
|
+
previouslyFocusedElement = null;
|
|
8936
|
+
wrappedDialogShowModal;
|
|
8937
|
+
lastActionValidationMessage;
|
|
8938
|
+
pendingCloseReturnValue;
|
|
8939
|
+
dialogTitleId = `lmvz-modal-title-${modalIdCounter++}`;
|
|
8940
|
+
hasActions = false;
|
|
8941
|
+
hasHeader = false;
|
|
8942
|
+
open = false;
|
|
8943
|
+
closeLabel = 'Schliessen';
|
|
8944
|
+
dialogClose;
|
|
8945
|
+
dialogCancel;
|
|
8946
|
+
get dialog() {
|
|
8947
|
+
return this.dialogEl;
|
|
8948
|
+
}
|
|
8949
|
+
get validationEl() {
|
|
8950
|
+
return this.dialogEl ?? this.el;
|
|
8951
|
+
}
|
|
8952
|
+
get validationSlot() {
|
|
8953
|
+
return this.actionsSlot;
|
|
8954
|
+
}
|
|
8955
|
+
constructor(hostRef) {
|
|
8956
|
+
super();
|
|
8957
|
+
registerInstance(this, hostRef);
|
|
8958
|
+
this.dialogClose = createEvent(this, "close", 6);
|
|
8959
|
+
this.dialogCancel = createEvent(this, "cancel", 1);
|
|
8960
|
+
this.addController(new AriaValidationController(this, { validationTiming: 'slot' }));
|
|
8961
|
+
}
|
|
8962
|
+
handleFormDialogSubmit(event) {
|
|
8963
|
+
const form = event.target;
|
|
8964
|
+
const submitter = event.submitter;
|
|
8965
|
+
const isDialogForm = form.method === 'dialog' || submitter?.getAttribute('formmethod') === 'dialog';
|
|
8966
|
+
if (!isDialogForm)
|
|
8967
|
+
return;
|
|
8968
|
+
event.preventDefault();
|
|
8969
|
+
this.dialogEl?.close(submitter?.value ?? '');
|
|
8970
|
+
}
|
|
8971
|
+
connectedCallback() {
|
|
8972
|
+
this.inheritedAriaAttributes = inheritAriaAttributes(this.el, ['role']);
|
|
8973
|
+
Object.defineProperty(this.el, 'dialog', {
|
|
8974
|
+
configurable: true,
|
|
8975
|
+
enumerable: true,
|
|
8976
|
+
get: () => {
|
|
8977
|
+
this.ensureDialogShowModalCapture();
|
|
8978
|
+
return this.dialogEl;
|
|
8979
|
+
},
|
|
8980
|
+
});
|
|
8981
|
+
super.connectedCallback();
|
|
8982
|
+
}
|
|
8983
|
+
componentDidLoad() {
|
|
8984
|
+
this.handleHeaderSlotChange();
|
|
8985
|
+
this.handleActionsSlotChange();
|
|
8986
|
+
this.observeDialogState();
|
|
8987
|
+
this.syncDialogVisibility();
|
|
8988
|
+
super.componentDidLoad();
|
|
8989
|
+
}
|
|
8990
|
+
disconnectedCallback() {
|
|
8991
|
+
this.actionsStateObserver?.disconnect();
|
|
8992
|
+
this.dialogStateObserver?.disconnect();
|
|
8993
|
+
super.disconnectedCallback();
|
|
8994
|
+
}
|
|
8995
|
+
componentDidRender() {
|
|
8996
|
+
if (this.open) {
|
|
8997
|
+
this.focusPrimaryAction();
|
|
8998
|
+
}
|
|
8999
|
+
super.componentDidRender();
|
|
9000
|
+
}
|
|
9001
|
+
handleOpenChange() {
|
|
9002
|
+
this.syncDialogVisibility();
|
|
9003
|
+
}
|
|
9004
|
+
get dialogAccessibilityAttributes() {
|
|
9005
|
+
const attributes = { ...this.inheritedAriaAttributes };
|
|
9006
|
+
delete attributes['aria-label'];
|
|
9007
|
+
delete attributes['aria-labelledby'];
|
|
9008
|
+
if (this.hasHeader) {
|
|
9009
|
+
attributes['aria-labelledby'] = this.dialogTitleId;
|
|
9010
|
+
return attributes;
|
|
9011
|
+
}
|
|
9012
|
+
const inheritedLabelledBy = this.inheritedAriaAttributes['aria-labelledby'];
|
|
9013
|
+
if (typeof inheritedLabelledBy === 'string') {
|
|
9014
|
+
attributes['aria-labelledby'] = inheritedLabelledBy;
|
|
9015
|
+
return attributes;
|
|
9016
|
+
}
|
|
9017
|
+
const inheritedLabel = this.inheritedAriaAttributes['aria-label'];
|
|
9018
|
+
if (typeof inheritedLabel === 'string') {
|
|
9019
|
+
attributes['aria-label'] = inheritedLabel;
|
|
9020
|
+
}
|
|
9021
|
+
return attributes;
|
|
9022
|
+
}
|
|
9023
|
+
get actionButtons() {
|
|
9024
|
+
return (this.actionsSlot?.assignedElements({ flatten: true }) ?? []).filter((element) => {
|
|
9025
|
+
return this.isVisibleActionButton(element);
|
|
9026
|
+
});
|
|
9027
|
+
}
|
|
9028
|
+
get enabledActionButtons() {
|
|
9029
|
+
return this.actionButtons.filter((element) => {
|
|
9030
|
+
return !this.isDisabledActionButton(element);
|
|
9031
|
+
});
|
|
9032
|
+
}
|
|
9033
|
+
get assignedActionElements() {
|
|
9034
|
+
return this.actionsSlot?.assignedElements({ flatten: true }) ?? [];
|
|
9035
|
+
}
|
|
9036
|
+
isDisabledActionButton(element) {
|
|
9037
|
+
return element.hasAttribute('disabled') || element.disabled === true;
|
|
9038
|
+
}
|
|
9039
|
+
getActionVariant(element) {
|
|
9040
|
+
const variant = element.getAttribute('variant') ?? element.variant;
|
|
9041
|
+
return variant === 'primary' || variant === 'secondary' || variant === 'tertiary' ? variant : 'secondary';
|
|
9042
|
+
}
|
|
9043
|
+
getActionValidationResult() {
|
|
9044
|
+
if (!this.actionButtons.length) {
|
|
9045
|
+
return {};
|
|
9046
|
+
}
|
|
9047
|
+
const primaryActions = this.actionButtons.filter((element) => this.getActionVariant(element) === 'primary');
|
|
9048
|
+
const secondaryActions = this.actionButtons.filter((element) => this.getActionVariant(element) === 'secondary');
|
|
9049
|
+
const issues = [
|
|
9050
|
+
primaryActions.length !== 1 ? `${primaryActions.length} primary action${primaryActions.length === 1 ? '' : 's'}` : undefined,
|
|
9051
|
+
secondaryActions.length > 1 ? `${secondaryActions.length} secondary actions` : undefined,
|
|
9052
|
+
].filter((issue) => Boolean(issue));
|
|
9053
|
+
return {
|
|
9054
|
+
errorMessage: issues.length
|
|
9055
|
+
? `LmvzModal actions slot must contain exactly one primary action, at most one secondary action, and optional tertiary actions. Received ${issues.join(' and ')}.`
|
|
9056
|
+
: undefined,
|
|
9057
|
+
primaryAction: primaryActions[0],
|
|
9058
|
+
};
|
|
9059
|
+
}
|
|
9060
|
+
hasAssignedContent(slot) {
|
|
9061
|
+
return Boolean(slot?.assignedNodes({ flatten: true }).some((node) => {
|
|
9062
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
9063
|
+
return Boolean(node.textContent?.trim());
|
|
9064
|
+
}
|
|
9065
|
+
return node.nodeType === Node.ELEMENT_NODE;
|
|
9066
|
+
}));
|
|
9067
|
+
}
|
|
9068
|
+
observeDialogState() {
|
|
9069
|
+
if (!this.dialogEl || typeof MutationObserver === 'undefined')
|
|
9070
|
+
return;
|
|
9071
|
+
this.dialogStateObserver?.disconnect();
|
|
9072
|
+
this.dialogStateObserver = new MutationObserver(() => {
|
|
9073
|
+
if (!this.dialogEl || this.dialogEl.open === this.open)
|
|
9074
|
+
return;
|
|
9075
|
+
if (this.dialogEl.open) {
|
|
9076
|
+
this.open = true;
|
|
9077
|
+
return;
|
|
9078
|
+
}
|
|
9079
|
+
this.open = false;
|
|
9080
|
+
});
|
|
9081
|
+
this.dialogStateObserver.observe(this.dialogEl, {
|
|
9082
|
+
attributes: true,
|
|
9083
|
+
attributeFilter: ['open'],
|
|
9084
|
+
});
|
|
9085
|
+
}
|
|
9086
|
+
isVisibleActionButton(element) {
|
|
9087
|
+
return element.tagName === 'LMVZ-BUTTON' && !element.hasAttribute('hidden');
|
|
9088
|
+
}
|
|
9089
|
+
capturePreviouslyFocusedElement() {
|
|
9090
|
+
const dialog = this.dialogEl;
|
|
9091
|
+
const activeElement = getDeepActiveElement(document);
|
|
9092
|
+
if (!dialog || !activeElement || dialog.contains(activeElement))
|
|
9093
|
+
return;
|
|
9094
|
+
this.previouslyFocusedElement = activeElement;
|
|
9095
|
+
}
|
|
9096
|
+
ensureDialogShowModalCapture() {
|
|
9097
|
+
const dialog = this.dialogEl;
|
|
9098
|
+
if (!dialog || typeof dialog.showModal !== 'function')
|
|
9099
|
+
return;
|
|
9100
|
+
const showModal = dialog.showModal;
|
|
9101
|
+
if (showModal === this.wrappedDialogShowModal)
|
|
9102
|
+
return;
|
|
9103
|
+
const wrappedShowModal = () => {
|
|
9104
|
+
this.capturePreviouslyFocusedElement();
|
|
9105
|
+
return showModal.call(dialog);
|
|
9106
|
+
};
|
|
9107
|
+
Object.defineProperty(dialog, 'showModal', {
|
|
9108
|
+
configurable: true,
|
|
9109
|
+
value: wrappedShowModal,
|
|
9110
|
+
});
|
|
9111
|
+
this.wrappedDialogShowModal = wrappedShowModal;
|
|
9112
|
+
}
|
|
9113
|
+
syncDialogVisibility() {
|
|
9114
|
+
const dialog = this.dialogEl;
|
|
9115
|
+
if (!dialog)
|
|
9116
|
+
return;
|
|
9117
|
+
if (this.open) {
|
|
9118
|
+
if (!dialog.open) {
|
|
9119
|
+
this.capturePreviouslyFocusedElement();
|
|
9120
|
+
if (typeof dialog.showModal === 'function') {
|
|
9121
|
+
dialog.showModal();
|
|
9122
|
+
}
|
|
9123
|
+
else {
|
|
9124
|
+
dialog.setAttribute('open', '');
|
|
9125
|
+
}
|
|
9126
|
+
}
|
|
9127
|
+
this.focusPrimaryAction();
|
|
9128
|
+
return;
|
|
9129
|
+
}
|
|
9130
|
+
if (!dialog.open)
|
|
9131
|
+
return;
|
|
9132
|
+
if (typeof dialog.close === 'function') {
|
|
9133
|
+
dialog.close();
|
|
9134
|
+
}
|
|
9135
|
+
else {
|
|
9136
|
+
dialog.removeAttribute('open');
|
|
9137
|
+
this.handleDialogClose();
|
|
9138
|
+
}
|
|
9139
|
+
}
|
|
9140
|
+
focusPrimaryAction() {
|
|
9141
|
+
const primaryAction = this.enabledActionButtons.find((element) => {
|
|
9142
|
+
return this.getActionVariant(element) === 'primary';
|
|
9143
|
+
}) ?? this.enabledActionButtons[0];
|
|
9144
|
+
const focusTarget = primaryAction ?? this.closeButtonEl;
|
|
9145
|
+
if (!focusTarget || typeof window === 'undefined')
|
|
9146
|
+
return;
|
|
9147
|
+
window.requestAnimationFrame(() => {
|
|
9148
|
+
if (this.open) {
|
|
9149
|
+
focusTarget.focus();
|
|
9150
|
+
}
|
|
9151
|
+
});
|
|
9152
|
+
}
|
|
9153
|
+
restoreFocus() {
|
|
9154
|
+
if (!this.previouslyFocusedElement?.isConnected)
|
|
9155
|
+
return;
|
|
9156
|
+
this.previouslyFocusedElement.focus();
|
|
9157
|
+
this.previouslyFocusedElement = null;
|
|
9158
|
+
}
|
|
9159
|
+
handleCloseButtonClick = () => {
|
|
9160
|
+
if (!this.dialogEl)
|
|
9161
|
+
return;
|
|
9162
|
+
const dialogWithRequestClose = this.dialogEl;
|
|
9163
|
+
if (typeof dialogWithRequestClose.requestClose === 'function') {
|
|
9164
|
+
this.pendingCloseReturnValue = 'close';
|
|
9165
|
+
dialogWithRequestClose.requestClose('close');
|
|
9166
|
+
return;
|
|
9167
|
+
}
|
|
9168
|
+
if (typeof this.dialogEl.close === 'function') {
|
|
9169
|
+
this.dialogEl.close('close');
|
|
9170
|
+
return;
|
|
9171
|
+
}
|
|
9172
|
+
this.handleDialogClose();
|
|
9173
|
+
};
|
|
9174
|
+
handleDialogCancel = (event) => {
|
|
9175
|
+
event.preventDefault();
|
|
9176
|
+
const emitted = this.dialogCancel.emit();
|
|
9177
|
+
if (emitted.defaultPrevented) {
|
|
9178
|
+
this.pendingCloseReturnValue = undefined;
|
|
9179
|
+
return;
|
|
9180
|
+
}
|
|
9181
|
+
const returnValue = this.pendingCloseReturnValue;
|
|
9182
|
+
this.pendingCloseReturnValue = undefined;
|
|
9183
|
+
this.dialogEl?.close(returnValue);
|
|
9184
|
+
};
|
|
9185
|
+
handleDialogClose = () => {
|
|
9186
|
+
console.log('Dialog close handler called');
|
|
9187
|
+
if (this.open) {
|
|
9188
|
+
this.open = false;
|
|
9189
|
+
}
|
|
9190
|
+
this.restoreFocus();
|
|
9191
|
+
this.dialogClose.emit();
|
|
9192
|
+
};
|
|
9193
|
+
handleHeaderSlotChange = () => {
|
|
9194
|
+
this.hasHeader = this.hasAssignedContent(this.headerSlot);
|
|
9195
|
+
};
|
|
9196
|
+
observeActionState() {
|
|
9197
|
+
if (typeof MutationObserver === 'undefined')
|
|
9198
|
+
return;
|
|
9199
|
+
this.actionsStateObserver?.disconnect();
|
|
9200
|
+
if (!this.assignedActionElements.length)
|
|
9201
|
+
return;
|
|
9202
|
+
this.actionsStateObserver = new MutationObserver(() => {
|
|
9203
|
+
this.syncActionsState();
|
|
9204
|
+
});
|
|
9205
|
+
this.assignedActionElements.forEach((element) => {
|
|
9206
|
+
this.actionsStateObserver?.observe(element, {
|
|
9207
|
+
attributes: true,
|
|
9208
|
+
attributeFilter: ['disabled', 'hidden', 'variant'],
|
|
9209
|
+
});
|
|
9210
|
+
});
|
|
9211
|
+
}
|
|
9212
|
+
syncActionsState() {
|
|
9213
|
+
const assignedElements = this.assignedActionElements;
|
|
9214
|
+
assignedElements.forEach((element) => {
|
|
9215
|
+
const isAllowedAction = ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
9216
|
+
if (isAllowedAction)
|
|
9217
|
+
return;
|
|
9218
|
+
if (!element.hasAttribute('hidden')) {
|
|
9219
|
+
element.setAttribute('hidden', '');
|
|
9220
|
+
}
|
|
9221
|
+
if (element.getAttribute('aria-hidden') !== 'true') {
|
|
9222
|
+
element.setAttribute('aria-hidden', 'true');
|
|
9223
|
+
}
|
|
9224
|
+
});
|
|
9225
|
+
this.hasActions = assignedElements.some((element) => this.isVisibleActionButton(element));
|
|
9226
|
+
this.checkActions();
|
|
9227
|
+
if (this.open) {
|
|
9228
|
+
this.focusPrimaryAction();
|
|
9229
|
+
}
|
|
9230
|
+
}
|
|
9231
|
+
handleActionsSlotChange = () => {
|
|
9232
|
+
this.syncActionsState();
|
|
9233
|
+
this.observeActionState();
|
|
9234
|
+
};
|
|
9235
|
+
checkActions() {
|
|
9236
|
+
if (!isAriaValidationEnabled())
|
|
9237
|
+
return;
|
|
9238
|
+
const { errorMessage } = this.getActionValidationResult();
|
|
9239
|
+
if (!errorMessage) {
|
|
9240
|
+
this.lastActionValidationMessage = undefined;
|
|
9241
|
+
return;
|
|
9242
|
+
}
|
|
9243
|
+
if (this.lastActionValidationMessage === errorMessage)
|
|
9244
|
+
return;
|
|
9245
|
+
console.error(errorMessage);
|
|
9246
|
+
this.lastActionValidationMessage = errorMessage;
|
|
9247
|
+
}
|
|
9248
|
+
render() {
|
|
9249
|
+
return (hAsync(Host, { key: 'f319dcb33aaa6426e568fba1bfb6c8c3927432cb' }, hAsync("dialog", { key: '1c5b1659b243a2af19ec5b41d19a2096b522671c', ref: (element) => (this.dialogEl = element), onCancel: this.handleDialogCancel, onClose: this.handleDialogClose, ...this.dialogAccessibilityAttributes }, hAsync("div", { key: '2d0260f11a75e28688a14b0263df0d00f8ba54b9', class: "modal-shell" }, hAsync("header", { key: 'd96739e3b0a7f2c04e46585ddf4e431c91a698ce', class: { header: true, 'has-title': this.hasHeader } }, hAsync("div", { key: 'f5202ac26195a3571e3767e0d3683c2bc960c2ec', class: "title", id: this.dialogTitleId, hidden: !this.hasHeader }, hAsync("slot", { key: '2568ee3465bc070e353e647c58735a34005907d7', name: "header", ref: (element) => (this.headerSlot = element), onSlotchange: this.handleHeaderSlotChange })), hAsync("lmvz-button", { key: '7978e838dc84ce83ee674aa111523b260d1861da', ref: (element) => (this.closeButtonEl = element), type: "button", class: "close-button", "aria-label": this.closeLabel, onClick: this.handleCloseButtonClick, variant: "tertiary" }, hAsync("lmvz-icon", { key: '9f235507acbf2ee42747bfc44302fcae47d9ba0e', icon: closeIconSvg }))), hAsync("div", { key: '7eeab9b2f0fd5d41c0218380436e2f092481813a', class: "body" }, hAsync("slot", { key: '8904e87fa438caf2b7f34c4025ff688d94f4dea2' })), hAsync("footer", { key: '0610abd150de228da893092e9f38721087144564', class: "actions", hidden: !this.hasActions }, hAsync("slot", { key: '0f5457cb2544602a3b980f90e7297ed700d62fee', name: "actions", ref: (element) => (this.actionsSlot = element), onSlotchange: this.handleActionsSlotChange }))))));
|
|
9250
|
+
}
|
|
9251
|
+
static get watchers() { return {
|
|
9252
|
+
"open": [{
|
|
9253
|
+
"handleOpenChange": 0
|
|
9254
|
+
}]
|
|
9255
|
+
}; }
|
|
9256
|
+
static get style() { return lmvzModalCss(); }
|
|
9257
|
+
static get cmpMeta() { return {
|
|
9258
|
+
"$flags$": 777,
|
|
9259
|
+
"$tagName$": "lmvz-modal",
|
|
9260
|
+
"$members$": {
|
|
9261
|
+
"open": [1540],
|
|
9262
|
+
"closeLabel": [1, "close-label"],
|
|
9263
|
+
"hasActions": [32],
|
|
9264
|
+
"hasHeader": [32]
|
|
9265
|
+
},
|
|
9266
|
+
"$listeners$": [[0, "submit", "handleFormDialogSubmit"]],
|
|
9267
|
+
"$lazyBundleId$": "-",
|
|
9268
|
+
"$attrsToReflect$": [["open", "open"]]
|
|
9269
|
+
}; }
|
|
9270
|
+
}
|
|
9271
|
+
|
|
8848
9272
|
const chevronDownSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIwLjMzMzQgOC42NjY2M0wxMi4wMDAxIDE3TDMuNjY2NzUgOC42NjY2MyIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=';
|
|
8849
9273
|
|
|
8850
9274
|
const lmvzSelectCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } .sc-lmvz-select-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --lmvz-internal-select-floating-label-top-offset: 0.375rem; padding-top: var(--lmvz-internal-select-floating-label-top-offset); --lmvz-select-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-select-bg: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-select-bg-hover: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-select-text-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-select-label-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --lmvz-select-padding-x: var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --lmvz-select-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-select-height: 40px; --lmvz-select-label-font-size: var(--lmvz-component-component-typography-body-sm-font-size, 0.75rem); --lmvz-select-label-top-offset: calc(var(--lmvz-internal-select-floating-label-top-offset) * -1); --lmvz-select-label-minimized-padding-x: 4px; --lmvz-select-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); --lmvz-select-helper-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --lmvz-select-focus-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --lmvz-select-error-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); } .select-wrapper.sc-lmvz-select { position: relative; height: var(--lmvz-select-height); } label.sc-lmvz-select { position: absolute; top: 50%; left: var(--lmvz-select-padding-x); font-size: var(--lmvz-select-label-font-size); color: var(--lmvz-select-label-color); line-height: normal; white-space: nowrap; pointer-events: none; z-index: 2; transform: translateY(-50%); transform-origin: left top; transition: top 0.2s ease-out, transform 0.2s ease-out, opacity 0.2s ease-out, padding 0.2s ease-out; } label.assistive-label.sc-lmvz-select { opacity: 0; padding: 0; } label.floating-label.sc-lmvz-select { top: var(--lmvz-select-label-top-offset); transform: translateY(0) scale(0.85); left: calc(var(--lmvz-select-padding-x) - 2px); background-color: var(--lmvz-select-bg); padding: 0 var(--lmvz-select-label-minimized-padding-x); opacity: 1; font-weight: 500; } label.sc-lmvz-select > span[aria-hidden='true'].sc-lmvz-select, div[aria-hidden='true'].sc-lmvz-select > span.sc-lmvz-select:first-child > span[aria-hidden='true'].sc-lmvz-select { color: var(--lmvz-select-error-color); margin-left: 2px; display: inline-block; line-height: 0; vertical-align: middle; } div[aria-hidden].sc-lmvz-select { display: flex; align-items: center; gap: var(--lmvz-select-gap); height: 100%; padding: 0 var(--lmvz-select-padding-x); border-radius: var(--lmvz-select-radius); background-color: var(--lmvz-select-bg); cursor: pointer; position: relative; z-index: 1; transition: background-color 0.15s ease; } .sc-lmvz-select-h:not([disabled]) .select-wrapper.sc-lmvz-select:hover div[aria-hidden].sc-lmvz-select { background-color: var(--lmvz-select-bg-hover); } .select-wrapper.sc-lmvz-select:focus-within div[aria-hidden].sc-lmvz-select { outline: 2px solid var(--lmvz-select-focus-color); outline-offset: 2px; } div[aria-hidden].sc-lmvz-select > span.sc-lmvz-select:first-child { flex: 1 0 0; font-size: var(--lmvz-component-component-typography-body-md-font-size, 0.875rem); font-weight: var(--lmvz-global-font-weight-500, 500); color: var(--lmvz-select-text-color); line-height: 1.4; letter-spacing: var(--lmvz-component-body-md-letter-spacing, 0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } div[aria-hidden].sc-lmvz-select > span.sc-lmvz-select:last-child { flex-shrink: 0; display: flex; align-items: center; justify-content: center; } img.sc-lmvz-select { display: block; width: var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); height: var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } select.sc-lmvz-select { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; border: none; background: transparent; margin: 0; padding: 0; } [disabled].sc-lmvz-select-h .select-wrapper.sc-lmvz-select { opacity: var(--lmvz-select-disabled-opacity); pointer-events: none; cursor: not-allowed; } [role='status'].sc-lmvz-select { margin-top: 4px; padding-left: var(--lmvz-select-padding-x); font-size: var(--lmvz-select-label-font-size); color: var(--lmvz-select-helper-color); line-height: normal; }`;
|
|
@@ -8860,7 +9284,7 @@ class LmvzSelect extends ReactiveControllerHost {
|
|
|
8860
9284
|
constructor(hostRef) {
|
|
8861
9285
|
super();
|
|
8862
9286
|
registerInstance(this, hostRef);
|
|
8863
|
-
this.lmvzChange = createEvent(this, "lmvzChange");
|
|
9287
|
+
this.lmvzChange = createEvent(this, "lmvzChange", 7);
|
|
8864
9288
|
this.addController(new AriaValidationController(this));
|
|
8865
9289
|
}
|
|
8866
9290
|
lmvzChange;
|
|
@@ -8899,7 +9323,7 @@ class LmvzSelect extends ReactiveControllerHost {
|
|
|
8899
9323
|
render() {
|
|
8900
9324
|
const hasValue = this.hasValue;
|
|
8901
9325
|
const shouldShowLabel = hasValue;
|
|
8902
|
-
return (hAsync(Host, { key: '
|
|
9326
|
+
return (hAsync(Host, { key: '4a78608686bd771615d1bd6f5c5df243b813f0a3' }, hAsync("div", { key: 'fc526485d7c1718c0044a8076151954fb0db680d', class: "select-wrapper" }, hAsync("label", { key: '16c68d944b626f06b36c458daa351b05f0d6de92', htmlFor: this.selectId, class: shouldShowLabel ? 'floating-label' : 'assistive-label' }, this.label, this.required && shouldShowLabel && hAsync("span", { key: '06ea7ab990b1119c726d39620cda2f2f53d6342a', "aria-hidden": "true" }, " *")), hAsync("div", { key: '46e77a996cd17db6e882fdc0f5ac65fb90f71df5', "aria-hidden": "true" }, hAsync("span", { key: '6b1e9f849e7e876f704816de6f55128e3d462587' }, hasValue ? this.selectedLabel : this.label, this.required && !hasValue && hAsync("span", { key: 'd90c6b965c594a45f6699aaca3bc85de38bf5584', "aria-hidden": "true" }, " *")), hAsync("span", { key: 'd91ce778422521a0b414aceb7161a871023730d9' }, hAsync("img", { key: '3e405cebf0c02d91448c9db412837f4af554c4b2', src: chevronDownSvg, alt: "" }))), hAsync("select", { key: 'b443a08e1436f75af572e102e8d43a9c3d031810', id: this.selectId, ref: (el) => (this.nativeSelectEl = el), name: this.name, disabled: this.disabled, required: this.required, "aria-label": this.label, onChange: this.handleChange }, !hasValue && hAsync("option", { key: '7125eccebfb3541522d0461adcf1e203514d8af6', value: "", disabled: true, selected: true, hidden: true }), hAsync("slot", { key: '80f7edf9e20b19ec8041d23b84752f2cd7c1a72e' }))), this.helperText && hAsync("div", { key: '49cdd7ce54b5bc9031db2ef9826891d6a4f666b1', role: "status" }, this.helperText)));
|
|
8903
9327
|
}
|
|
8904
9328
|
static get watchers() { return {
|
|
8905
9329
|
"value": [{
|
|
@@ -8947,7 +9371,7 @@ class LmvzToggle extends ReactiveControllerHost {
|
|
|
8947
9371
|
constructor(hostRef) {
|
|
8948
9372
|
super();
|
|
8949
9373
|
registerInstance(this, hostRef);
|
|
8950
|
-
this.lmvzChange = createEvent(this, "lmvzChange");
|
|
9374
|
+
this.lmvzChange = createEvent(this, "lmvzChange", 7);
|
|
8951
9375
|
if (hostRef.$hostElement$["s-ei"]) {
|
|
8952
9376
|
this.internals = hostRef.$hostElement$["s-ei"];
|
|
8953
9377
|
}
|
|
@@ -8999,7 +9423,7 @@ class LmvzToggle extends ReactiveControllerHost {
|
|
|
8999
9423
|
this.lmvzChange.emit(newChecked);
|
|
9000
9424
|
};
|
|
9001
9425
|
render() {
|
|
9002
|
-
return (hAsync(Host, { key: '
|
|
9426
|
+
return (hAsync(Host, { key: '49a543437a842709b6a3bfb00c828a40b227bb57' }, hAsync("span", { key: '746292d49c58656336037f7b07a9aaee9dbc6ed1', class: "track" }, hAsync("input", { key: 'ae329571344b05d9af814fdc1cc792e1c600d807', type: "checkbox", role: "switch", id: this.toggleId, checked: this.checked, disabled: this.disabled, required: this.required, name: this.name, value: this.value, form: this.form, ref: (el) => (this.nativeInputElement = el), onChange: this.handleChange }), hAsync("span", { key: 'e5742029679333fcd66a25aeb3f8826dbb3a8956', class: "thumb", "aria-hidden": "true" })), hAsync("label", { key: '4cb92eb975b8c337162986011497afdeb188ed4f', htmlFor: this.toggleId }, this.label)));
|
|
9003
9427
|
}
|
|
9004
9428
|
static get formAssociated() { return true; }
|
|
9005
9429
|
static get watchers() { return {
|
|
@@ -9044,6 +9468,7 @@ registerComponents([
|
|
|
9044
9468
|
LmvzIcon,
|
|
9045
9469
|
LmvzInput,
|
|
9046
9470
|
LmvzMenuItem,
|
|
9471
|
+
LmvzModal,
|
|
9047
9472
|
LmvzSelect,
|
|
9048
9473
|
LmvzToggle,
|
|
9049
9474
|
]);
|