@lmvz-ds/components 0.24.0 → 0.26.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 +22 -0
- package/cjs/{ds.constants-DSnxZ3ia.js → ds.constants-8fh6ItAF.js} +1 -1
- package/cjs/{index-lW-SEvL7.js → index-BCFBLj0e.js} +1 -1
- package/cjs/index.cjs.js +196 -2
- package/cjs/lmvz-action.cjs.entry.js +1 -1
- package/cjs/lmvz-button-group.cjs.entry.js +183 -0
- package/cjs/lmvz-button_2.cjs.entry.js +198 -0
- package/cjs/lmvz-card.cjs.entry.js +2 -2
- package/cjs/lmvz-checkbox.cjs.entry.js +5 -5
- package/cjs/lmvz-chip.cjs.entry.js +4 -4
- package/cjs/lmvz-components.cjs.js +3 -3
- package/cjs/lmvz-header_2.cjs.entry.js +2 -2
- package/cjs/lmvz-input.cjs.entry.js +3 -3
- package/cjs/lmvz-menuitem.cjs.entry.js +3 -3
- package/cjs/lmvz-modal.cjs.entry.js +5 -5
- package/cjs/lmvz-radio.cjs.entry.js +334 -0
- package/cjs/lmvz-select.cjs.entry.js +4 -4
- package/cjs/lmvz-snackbar.cjs.entry.js +83 -0
- package/cjs/lmvz-toggle.cjs.entry.js +7 -5
- package/cjs/loader.cjs.js +2 -2
- package/cjs/{reactive-controller-host-BOFg4vL-.js → reactive-controller-host-DrtMkMd7.js} +1 -1
- package/collection/api/ds.constants.js +4 -1
- package/collection/collection-manifest.json +3 -1
- package/collection/components/lmvz-button/lmvz-button.css +8 -8
- package/collection/components/lmvz-button-group/lmvz-button-group.css +1 -1
- package/collection/components/lmvz-card/lmvz-card.css +11 -11
- package/collection/components/lmvz-checkbox/lmvz-checkbox.css +8 -11
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +2 -2
- package/collection/components/lmvz-chip/lmvz-chip.css +3 -3
- package/collection/components/lmvz-icon/lmvz-icon.js +1 -1
- package/collection/components/lmvz-input/lmvz-input.css +5 -9
- package/collection/components/lmvz-menuitem/lmvz-menuitem.css +3 -3
- package/collection/components/lmvz-modal/lmvz-modal.css +21 -15
- package/collection/components/lmvz-modal/lmvz-modal.js +2 -2
- package/collection/components/lmvz-radio/lmvz-radio.css +182 -0
- package/collection/components/lmvz-radio/lmvz-radio.js +487 -0
- package/collection/components/lmvz-select/lmvz-select.css +3 -3
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/components/lmvz-snackbar/lmvz-snackbar.css +101 -0
- package/collection/components/lmvz-snackbar/lmvz-snackbar.js +266 -0
- package/collection/components/lmvz-snackbar/public.js +1 -0
- package/collection/components/lmvz-snackbar/snackbar-controller.js +194 -0
- package/collection/components/lmvz-toggle/lmvz-toggle.css +4 -9
- package/collection/components/lmvz-toggle/lmvz-toggle.js +3 -3
- package/collection/index.js +1 -0
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/styles/fragments/_focus-within.css +13 -0
- package/collection/utils/radio/radio-group-controller.js +160 -0
- package/components/index.d.ts +4 -0
- package/components/index.d.ts.bak +4 -0
- package/components/index.js +1 -1
- package/components/lmvz-action.js +1 -1
- package/components/lmvz-button-group.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.js +1 -1
- package/components/lmvz-radio.d.ts +11 -0
- package/components/lmvz-radio.d.ts.bak +11 -0
- package/components/lmvz-radio.js +1 -0
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-snackbar.d.ts +11 -0
- package/components/lmvz-snackbar.d.ts.bak +11 -0
- package/components/lmvz-snackbar.js +1 -0
- package/components/lmvz-toggle.js +1 -1
- package/components/{p-slgmfnHm.js → p-BOzeYzKk.js} +1 -1
- package/components/{p-Cg2XX_J-.js → p-DYa3zcGE.js} +1 -1
- package/components/{p-DOTK1OW3.js → p-JAKQdFhF.js} +1 -1
- package/components/{p-CcnyKhAw.js → p-WLZ7VWNX.js} +1 -1
- package/components/{p-CK8cAKcB.js → p-c7OzBK8f.js} +1 -1
- package/components/{p-DSvYtVoD.js → p-lsUdmjdw.js} +1 -1
- package/esm/{ds.constants-Bmi89ll1.js → ds.constants-BOOwq5dE.js} +1 -1
- package/esm/{index-Aa_425iY.js → index-CKYszC64.js} +1 -1
- package/esm/index.js +198 -1
- package/esm/lmvz-action.entry.js +1 -1
- package/esm/lmvz-button-group.entry.js +181 -0
- package/esm/lmvz-button_2.entry.js +195 -0
- package/esm/lmvz-card.entry.js +2 -2
- package/esm/lmvz-checkbox.entry.js +5 -5
- package/esm/lmvz-chip.entry.js +4 -4
- package/esm/lmvz-components.js +4 -4
- package/esm/lmvz-header_2.entry.js +2 -2
- package/esm/lmvz-input.entry.js +3 -3
- package/esm/lmvz-menuitem.entry.js +3 -3
- package/esm/lmvz-modal.entry.js +5 -5
- package/esm/lmvz-radio.entry.js +332 -0
- package/esm/lmvz-select.entry.js +4 -4
- package/esm/lmvz-snackbar.entry.js +81 -0
- package/esm/lmvz-toggle.entry.js +7 -5
- package/esm/loader.js +3 -3
- package/esm/{reactive-controller-host-CroMsXdS.js → reactive-controller-host-ZrGf1F2-.js} +1 -1
- package/hydrate/index.js +467 -19
- package/hydrate/index.mjs +467 -19
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-d1dacf7e.entry.js → p-01aeca60.entry.js} +1 -1
- package/lmvz-components/p-0a37e0f2.entry.js +1 -0
- package/lmvz-components/p-14c3d837.entry.js +1 -0
- package/lmvz-components/{p-4263c9b2.entry.js → p-24e63b0a.entry.js} +1 -1
- package/lmvz-components/p-25f045b2.entry.js +1 -0
- package/lmvz-components/{p-f6d1d9df.entry.js → p-3da301a6.entry.js} +1 -1
- package/lmvz-components/p-40228d48.entry.js +1 -0
- package/lmvz-components/p-4da9073a.entry.js +1 -0
- package/lmvz-components/p-6de9981f.entry.js +1 -0
- package/lmvz-components/{p-6f8cbc4f.entry.js → p-758078db.entry.js} +1 -1
- package/lmvz-components/{p-88adb9fa.entry.js → p-8dae99f1.entry.js} +1 -1
- package/lmvz-components/p-BOOwq5dE.js +1 -0
- package/lmvz-components/{p-BRl6zKXT.js → p-CwX1wKkM.js} +1 -1
- package/lmvz-components/{p-a7c3074a.entry.js → p-e1eaa7a2.entry.js} +1 -1
- package/lmvz-components/p-f5cece32.entry.js +1 -0
- package/lmvz-components/p-fe607f10.entry.js +1 -0
- package/manifest.json +892 -205
- package/package.json +9 -1
- package/types/api/ds.constants.d.ts +9 -1
- package/types/components/lmvz-radio/lmvz-radio.d.ts +42 -0
- package/types/components/lmvz-snackbar/lmvz-snackbar.d.ts +21 -0
- package/types/components/lmvz-snackbar/public.d.ts +2 -0
- package/types/components/lmvz-snackbar/snackbar-controller.d.ts +32 -0
- package/types/components.d.ts +237 -1
- package/types/index.d.ts +1 -0
- package/types/stencil-public-runtime.d.ts +1 -0
- package/types/utils/radio/radio-group-controller.d.ts +26 -0
- package/assets/icons/checkmark.svg +0 -4
- package/assets/icons/close-sm.svg +0 -3
- package/cjs/lmvz-button_3.cjs.entry.js +0 -375
- package/collection/assets/icons/checkmark.svg +0 -4
- package/collection/assets/icons/close-sm.svg +0 -3
- package/esm/lmvz-button_3.entry.js +0 -371
- package/lmvz-components/p-2824a56b.entry.js +0 -1
- package/lmvz-components/p-3846ba08.entry.js +0 -1
- package/lmvz-components/p-4f5c3c4a.entry.js +0 -1
- package/lmvz-components/p-Bmi89ll1.js +0 -1
- package/lmvz-components/p-b3b04d46.entry.js +0 -1
- package/lmvz-components/p-fefefc54.entry.js +0 -1
- /package/lmvz-components/{p-Aa_425iY.js → p-CKYszC64.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-CKYszC64.js';
|
|
2
2
|
import { t as toValidSvgStringWithFallback } from './svg-B2YoIRuh.js';
|
|
3
|
-
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-
|
|
3
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-ZrGf1F2-.js';
|
|
4
4
|
import './logger-CGmJG63p.js';
|
|
5
5
|
import './aria-loader-GfsGHZHY.js';
|
|
6
6
|
|
|
7
|
-
const checkmarkSvg = 'data:image/svg+xml;base64,
|
|
7
|
+
const checkmarkSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNzUgMTIuNTYyNUw4LjgzMDc5IDE3LjYyNUwyMC40Mzc1IDYuMzc1IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjEuNzUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
|
|
8
8
|
|
|
9
|
-
const lmvzCheckboxCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-checkbox-h { display: inline-block; --checkbox-box-size: var(--lmvz-global-s18, 18px); --checkbox-border-radius: var(--lmvz-global-s4, 4px); --checkbox-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --checkbox-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --checkbox-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --checkbox-border-color-checked: var(--lmvz-semantic-color-border-active, #0f8acc); --checkbox-border-color-error: var(--lmvz-semantic-color-status-on-danger, #e52a31); --checkbox-wrapper-bg-hover: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --checkbox-wrapper-bg-checked: var(--lmvz-semantic-color-status-active, #
|
|
9
|
+
const lmvzCheckboxCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-checkbox-h { display: inline-block; --checkbox-box-size: var(--lmvz-global-s18, 18px); --checkbox-border-radius: var(--lmvz-global-s4, 4px); --checkbox-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --checkbox-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --checkbox-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --checkbox-border-color-checked: var(--lmvz-semantic-color-border-active, #0f8acc); --checkbox-border-color-error: var(--lmvz-semantic-color-status-on-danger, #e52a31); --checkbox-wrapper-bg-hover: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --checkbox-wrapper-bg-checked: var(--lmvz-semantic-color-status-active, #f6fbfe); --checkbox-ripple-bg: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --checkbox-checkmark-color: var(--lmvz-semantic-color-border-active, #0f8acc); --checkbox-label-color: var(--lmvz-semantic-color-on-surface-primary, #000000); --checkbox-label-color-checked: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --checkbox-helper-color: var(--lmvz-semantic-color-on-surface-secondary, #7a7a7a); --checkbox-error-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); --checkbox-focus-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --checkbox-easing: var(--lmvz-global-easing-default, ease); --checkbox-duration: 0.2s; } .pill.sc-lmvz-checkbox { display: flex; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); padding-block: var(--lmvz-dimension-2-8, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem)); padding-inline: var(--lmvz-dimension-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); cursor: pointer; text-decoration: none; background-color: transparent; transition: background-color var(--checkbox-duration) var(--checkbox-easing); } input.sc-lmvz-checkbox { position: absolute; opacity: 0; width: var(--checkbox-box-size); height: var(--checkbox-box-size); margin: 0; cursor: pointer; z-index: 1; } .box.sc-lmvz-checkbox { display: flex; align-items: center; justify-content: center; width: var(--checkbox-box-size); height: var(--checkbox-box-size); background-color: var(--checkbox-bg); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--checkbox-border-color); border-radius: var(--checkbox-border-radius); color: var(--checkbox-checkmark-color); transition: border-color var(--checkbox-duration) var(--checkbox-easing), background-color var(--checkbox-duration) var(--checkbox-easing); pointer-events: none; flex-shrink: 0; } .indicator.sc-lmvz-checkbox { display: flex; align-items: center; justify-content: center; line-height: 0; } .content.sc-lmvz-checkbox { display: flex; flex-direction: column; overflow-wrap: break-word; min-width: 0; } label.sc-lmvz-checkbox { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); color: var(--checkbox-label-color); transition: color var(--checkbox-duration) var(--checkbox-easing); } .helper-text.sc-lmvz-checkbox { font: var(--lmvz-typography-body-sm, 400 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.5 Router); color: var(--checkbox-helper-color); margin-block-start: 2px; } .error-text.sc-lmvz-checkbox { font: var(--lmvz-typography-body-sm, 400 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.5 Router); color: var(--checkbox-error-color); display: block; margin-block-start: 4px; padding-inline: 10px; } @media (hover: hover) { .pill.sc-lmvz-checkbox:hover { background-color: var(--checkbox-wrapper-bg-hover); } .pill.sc-lmvz-checkbox:hover .box.sc-lmvz-checkbox { border-color: var(--checkbox-border-color-hover); } } [checked].sc-lmvz-checkbox-h .pill.sc-lmvz-checkbox { background-color: var(--checkbox-wrapper-bg-checked); } [checked].sc-lmvz-checkbox-h .box.sc-lmvz-checkbox { border-color: var(--checkbox-border-color-checked); } [checked].sc-lmvz-checkbox-h label.sc-lmvz-checkbox { color: var(--checkbox-label-color-checked); } [error].sc-lmvz-checkbox-h .box.sc-lmvz-checkbox { border-color: var(--checkbox-border-color-error); } [error].sc-lmvz-checkbox-h .helper-text.sc-lmvz-checkbox { color: var(--checkbox-error-color); } [disabled].sc-lmvz-checkbox-h { opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; } [disabled].sc-lmvz-checkbox-h .pill.sc-lmvz-checkbox { cursor: not-allowed; } [disabled].sc-lmvz-checkbox-h input.sc-lmvz-checkbox { cursor: not-allowed; } .sc-lmvz-checkbox-h:focus-within .pill.sc-lmvz-checkbox { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); } @media (forced-colors: active) { .box.sc-lmvz-checkbox { forced-color-adjust: auto; border-color: ButtonText; background-color: Field; } [checked].sc-lmvz-checkbox-h .box.sc-lmvz-checkbox { border-color: Highlight; background-color: Field; } .indicator.sc-lmvz-checkbox { color: ButtonText; } [checked].sc-lmvz-checkbox-h .indicator.sc-lmvz-checkbox { color: HighlightText; } .sc-lmvz-checkbox-h:focus-within .pill.sc-lmvz-checkbox { outline-color: Highlight; box-shadow: none; } }`;
|
|
10
10
|
|
|
11
11
|
const CHECKMARK_SVG = toValidSvgStringWithFallback(checkmarkSvg);
|
|
12
12
|
let checkboxIdCounter = 0;
|
|
@@ -97,7 +97,7 @@ const LmvzCheckbox = class extends ReactiveControllerHost {
|
|
|
97
97
|
this.lmvzChange.emit(this.checked);
|
|
98
98
|
};
|
|
99
99
|
render() {
|
|
100
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: '158efacac5c28a18003149d4acb0d1cf5385cef4' }, h("div", { key: '5deaf853f9c465b70b7e5472579c5d5212105c34', class: "pill" }, h("input", { key: '7e8da452d41cd48293569ec60dad0585ff3290f1', type: "checkbox", id: this.checkboxId, checked: this.checkedState, disabled: this.disabled, required: this.required, "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": this.ariaDescribedBy, "aria-errormessage": this.error && this.errorId ? this.errorId : undefined, ref: (el) => (this.nativeInput = el), onChange: this.handleChange, autoFocus: this.autofocus }), h("span", { key: 'd1ee72be8e3fc2b4e70ff64b70bfcec93f08f063', class: "box", "aria-hidden": "true" }, this.checkedState && h("span", { key: '73e123aa8c91e9098b4d8bbd48bbc7bae6c12383', class: "indicator", innerHTML: CHECKMARK_SVG })), h("span", { key: '2a161e6db9e792dca1fa24c1562bd0b79d62235b', class: "content" }, h("label", { key: 'fb38792095bf6da433867472d866d6700db45dac', htmlFor: this.checkboxId }, this.label), this.helperText && (h("span", { key: 'b8c16fc4782f67e1dca82329d081943a7d75a524', class: "helper-text", id: this.helperId, role: "status" }, this.helperText)))), this.errorMessage && (h("span", { key: '87d6940217d379777e26c578cff761dcfd96e79a', class: "error-text", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
101
101
|
}
|
|
102
102
|
static get formAssociated() { return true; }
|
|
103
103
|
static get watchers() { return {
|
package/esm/lmvz-chip.entry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getElement, r as registerInstance, h, H as Host } from './index-
|
|
2
|
-
import { a as chipTypes, c as chipSizes } from './ds.constants-
|
|
3
|
-
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-
|
|
1
|
+
import { g as getElement, r as registerInstance, h, H as Host } from './index-CKYszC64.js';
|
|
2
|
+
import { a as chipTypes, c as chipSizes } from './ds.constants-BOOwq5dE.js';
|
|
3
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-ZrGf1F2-.js';
|
|
4
4
|
import { i as isAriaValidationEnabled } from './aria-loader-GfsGHZHY.js';
|
|
5
5
|
|
|
6
6
|
function debounce(func, wait) {
|
|
@@ -16,7 +16,7 @@ function debounce(func, wait) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const lmvzChipCss = () => `:host { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-neutral-subtle, #d4d4d4); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-neutral, #fcfcfc); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-neutral, #545454); padding-block: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); padding-inline: var(--lmvz-dimension-8-10, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); border: 1px solid var(--lmvz-chip-border-color); border-radius: var(--lmvz-semantic-border-radius-round, 999px); font: var(--lmvz-typography-body-xs-strong, 500 clamp(0.
|
|
19
|
+
const lmvzChipCss = () => `:host { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-neutral-subtle, #d4d4d4); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-neutral, #fcfcfc); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-neutral, #545454); padding-block: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); padding-inline: var(--lmvz-dimension-8-10, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); border: 1px solid var(--lmvz-chip-border-color); border-radius: var(--lmvz-semantic-border-radius-round, 999px); font: var(--lmvz-typography-body-xs-strong, 500 clamp(0.63rem, 0.61rem + 0.06vw, 0.69rem) / 1.5 Router); background-color: var(--lmvz-chip-background-color); color: var(--lmvz-chip-foreground-color); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); box-sizing: border-box; max-width: 100%; overflow: hidden; white-space: nowrap; > .content-overflow-wrapper { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } } :host([size='small']) { padding-block: var(--lmvz-dimension-2-4, clamp(0.13rem, 0.09rem + 0.13vw, 0.25rem)); padding-inline: var(--lmvz-dimension-6-8, clamp(0.38rem, 0.34rem + 0.13vw, 0.5rem)); font: var(--lmvz-typography-body-2xs-strong, 500 clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem) / 1.5 Router); gap: var(--lmvz-dimension-2-4, clamp(0.13rem, 0.09rem + 0.13vw, 0.25rem)); } ::slotted(*) { display: inline; white-space: inherit; } ::slotted(lmvz-icon) { --lmvz-component-color: var(--lmvz-chip-foreground-color); --lmvz-component-size: var(--lmvz-dimension-12-14, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } :host([size='small']) ::slotted(lmvz-icon) { --lmvz-component-size: var(--lmvz-dimension-10-12, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem)); } :host([type='active']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-active-subtle, #c1e6fa); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-active, #f6fbfe); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } :host([type='warning']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-warning-subtle, #ffdf75); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-warning, #fffbf0); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-warning, #7a5e00); } :host([type='success']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-success-subtle, #a5dad3); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-success, #f1f9f8); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-success, #37867c); } :host([type='error']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-danger-subtle, #f7bfc2); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-danger, #fdf1f2); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); } :host([type='neutral']) { --lmvz-chip-border-color: var(--lmvz-semantic-color-status-on-neutral-subtle, #d4d4d4); --lmvz-chip-background-color: var(--lmvz-semantic-color-status-neutral, #fcfcfc); --lmvz-chip-foreground-color: var(--lmvz-semantic-color-status-on-neutral, #545454); } `;
|
|
20
20
|
|
|
21
21
|
const LmvzChip = class extends ReactiveControllerHost {
|
|
22
22
|
ariaValidationController = new AriaValidationController(this);
|
package/esm/lmvz-components.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-CKYszC64.js';
|
|
2
|
+
export { s as setNonce } from './index-CKYszC64.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.43.
|
|
6
|
+
Stencil Client Patch Browser v4.43.5 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var patchBrowser = () => {
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["lmvz-modal",[[769,"lmvz-modal",{"open":[1540],"closeLabel":[1,"close-label"],"hasHeader":[32]},[[0,"submit","handleFormDialogSubmit"]],{"open":[{"handleOpenChange":0}]}]]],["lmvz-header_2",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action",[[257,"lmvz-action"]]],["lmvz-card",[[774,"lmvz-card",{"cardTitle":[1,"card-title"],"imageUrl":[1,"image-url"],"description":[1],"primaryActionLabel":[1,"primary-action-label"]}]]],["lmvz-checkbox",[[578,"lmvz-checkbox",{"label":[1],"checked":[1540],"value":[1],"name":[1],"disabled":[516],"required":[516],"error":[516],"errorMessage":[1,"error-message"],"helperText":[1,"helper-text"],"form":[1],"autofocus":[4],"checkedState":[32],"focusInput":[64],"checkValidity":[64],"reportValidity":[64]},null,{"checked":[{"handleCheckedChange":0}]}]]],["lmvz-chip",[[769,"lmvz-chip",{"type":[1537],"size":[1537]},null,{"type":[{"normalizeType":0}],"size":[{"normalizeSize":0}]}]]],["lmvz-input",[[838,"lmvz-input",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"placeholder":[1],"disabled":[516],"readonly":[516],"required":[516],"name":[1],"type":[1],"errorMessage":[1,"error-message"],"autocomplete":[1],"inputmode":[1],"autocorrect":[1],"autocapitalize":[1],"spellcheck":[4],"autofocus":[4],"minlength":[2],"maxlength":[2],"pattern":[1],"min":[8],"max":[8],"step":[8],"form":[1],"error":[6660],"nativeError":[32],"setValue":[64],"focusInput":[64],"blurInput":[64],"select":[64],"checkValidity":[64],"reportValidity":[64],"getInputElement":[64]},null,{"value":[{"handleValueChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-menuitem",[[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-select",[[774,"lmvz-select",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"disabled":[516],"required":[516],"name":[1],"selectedLabel":[32]},null,{"value":[{"handleValueChange":0}]}]]],["lmvz-toggle",[[578,"lmvz-toggle",{"label":[1],"checked":[1540],"disabled":[516],"required":[516],"name":[1],"value":[1],"form":[1],"focusToggle":[64],"blurToggle":[64],"checkValidity":[64],"reportValidity":[64],"getInputElement":[64]},null,{"checked":[{"handleCheckedChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-
|
|
20
|
+
return bootstrapLazy([["lmvz-modal",[[769,"lmvz-modal",{"open":[1540],"closeLabel":[1,"close-label"],"hasHeader":[32]},[[0,"submit","handleFormDialogSubmit"]],{"open":[{"handleOpenChange":0}]}]]],["lmvz-snackbar",[[513,"lmvz-snackbar",{"status":[1537],"message":[1025],"duration":[1026],"priority":[1025],"actionLabel":[1025,"action-label"],"animationClass":[32],"show":[64],"hide":[64]},null,{"status":[{"onStatusChange":0}]}]]],["lmvz-header_2",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action",[[257,"lmvz-action"]]],["lmvz-card",[[774,"lmvz-card",{"cardTitle":[1,"card-title"],"imageUrl":[1,"image-url"],"description":[1],"primaryActionLabel":[1,"primary-action-label"]}]]],["lmvz-checkbox",[[578,"lmvz-checkbox",{"label":[1],"checked":[1540],"value":[1],"name":[1],"disabled":[516],"required":[516],"error":[516],"errorMessage":[1,"error-message"],"helperText":[1,"helper-text"],"form":[1],"autofocus":[4],"checkedState":[32],"focusInput":[64],"checkValidity":[64],"reportValidity":[64]},null,{"checked":[{"handleCheckedChange":0}]}]]],["lmvz-chip",[[769,"lmvz-chip",{"type":[1537],"size":[1537]},null,{"type":[{"normalizeType":0}],"size":[{"normalizeSize":0}]}]]],["lmvz-input",[[838,"lmvz-input",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"placeholder":[1],"disabled":[516],"readonly":[516],"required":[516],"name":[1],"type":[1],"errorMessage":[1,"error-message"],"autocomplete":[1],"inputmode":[1],"autocorrect":[1],"autocapitalize":[1],"spellcheck":[4],"autofocus":[4],"minlength":[2],"maxlength":[2],"pattern":[1],"min":[8],"max":[8],"step":[8],"form":[1],"error":[6660],"nativeError":[32],"setValue":[64],"focusInput":[64],"blurInput":[64],"select":[64],"checkValidity":[64],"reportValidity":[64],"getInputElement":[64]},null,{"value":[{"handleValueChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-menuitem",[[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-radio",[[578,"lmvz-radio",{"label":[1],"checked":[1540],"value":[1],"name":[1],"disabled":[516],"required":[516],"error":[516],"helperText":[1,"helper-text"],"form":[513],"autofocus":[4],"focusInput":[64],"checkValidity":[64],"reportValidity":[64]},[[0,"keydown","handleKeydown"]],{"checked":[{"handleCheckedChange":0}],"value":[{"handleValueChange":0}],"label":[{"handleLabelChange":0}]}]]],["lmvz-select",[[774,"lmvz-select",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"disabled":[516],"required":[516],"name":[1],"selectedLabel":[32]},null,{"value":[{"handleValueChange":0}]}]]],["lmvz-toggle",[[578,"lmvz-toggle",{"label":[1],"checked":[1540],"disabled":[516],"required":[516],"name":[1],"value":[1],"form":[1],"focusToggle":[64],"blurToggle":[64],"checkValidity":[64],"reportValidity":[64],"getInputElement":[64]},null,{"checked":[{"handleCheckedChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-button-group",[[257,"lmvz-button-group",{"primaryEnabledAction":[2064],"hasActions":[2052,"has-actions"]}]]],["lmvz-button_2",[[785,"lmvz-button",{"ti":[2562,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1],"formMethod":[1,"form-method"],"name":[1],"value":[1]}],[514,"lmvz-icon",{"icon":[513],"weight":[513],"size":[513],"iconset":[513],"ariaLabel":[513,"aria-label"],"iconData":[32],"visible":[32]},null,{"icon":[{"loadIconPathData":0}],"iconset":[{"loadIconPathData":0}]}]]]], options);
|
|
21
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getElement, r as registerInstance, h, H as Host } from './index-
|
|
2
|
-
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-
|
|
1
|
+
import { g as getElement, r as registerInstance, h, H as Host } from './index-CKYszC64.js';
|
|
2
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-ZrGf1F2-.js';
|
|
3
3
|
import { g as getDeepActiveElement, a as canReceiveFocus } from './component-DOTK1OW3.js';
|
|
4
4
|
export { lmvz_menuitem } from './lmvz-menuitem.entry.js';
|
|
5
5
|
import './aria-loader-GfsGHZHY.js';
|
package/esm/lmvz-input.entry.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as getElement, r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { g as getElement, r as registerInstance, c as createEvent, h } from './index-CKYszC64.js';
|
|
2
2
|
import { c as classNames } from './index-BfTCfPZ1.js';
|
|
3
|
-
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-
|
|
3
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-ZrGf1F2-.js';
|
|
4
4
|
import { c as componentOnReady } from './component-DOTK1OW3.js';
|
|
5
5
|
import './aria-loader-GfsGHZHY.js';
|
|
6
6
|
|
|
7
|
-
const lmvzInputCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --input-border-color-focus: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: 48px; --input-padding-x: 16px; --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #
|
|
7
|
+
const lmvzInputCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --input-border-color-focus: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: 48px; --input-padding-x: 16px; --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); --label-floating-scale: 0.85; --label-minimized-top: -6px; --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: 8px; } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } [error].sc-lmvz-input-h:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); outline-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: 14px; font-family: Router, sans-serif; font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: normal; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0; transform: translateY(-50%) scale(0.85); transform-origin: left top; background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 500; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: 14px; outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } div.sc-lmvz-input:empty { display: none; } [role='status'].sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--helper-text-color); font-family: Router, sans-serif; font-weight: 500; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--error-text-color); font-family: Router, sans-serif; font-weight: 500; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: 4px; }`;
|
|
8
8
|
|
|
9
9
|
let inputIdCounter = 0;
|
|
10
10
|
const LmvzInput = class extends ReactiveControllerHost {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
2
|
-
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-
|
|
1
|
+
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-CKYszC64.js';
|
|
2
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-ZrGf1F2-.js';
|
|
3
3
|
import { E as ElementActivationController } from './element-activation-controller-CN0JX9-m.js';
|
|
4
4
|
import './aria-loader-GfsGHZHY.js';
|
|
5
5
|
|
|
6
|
-
const lmvzMenuitemCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-menuitem-h { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-lg, 14px); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.
|
|
6
|
+
const lmvzMenuitemCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-menuitem-h { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-lg, 14px); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); padding: var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)) var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); cursor: pointer; --lmvz-menuitem-color: var(--lmvz-semantic-color-int-on-tertiary, #000000); --lmvz-menuitem-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); background: var(--lmvz-menuitem-background); color: var(--lmvz-menuitem-color); } .sc-lmvz-menuitem-h:hover { --lmvz-menuitem-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } .sc-lmvz-menuitem-h:active { --lmvz-menuitem-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } .sc-lmvz-menuitem-h:focus-visible { z-index: 1; } [aria-expanded='true'].sc-lmvz-menuitem-h { --lmvz-menuitem-background: var(--lmvz-semantic-color-status-active, #f6fbfe); --lmvz-menuitem-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); }`;
|
|
7
7
|
|
|
8
8
|
const LmvzMenuItem = class extends ReactiveControllerHost {
|
|
9
9
|
get el() { return getElement(this); }
|
package/esm/lmvz-modal.entry.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-CKYszC64.js';
|
|
2
2
|
import { t as toValidSvgStringWithFallback } from './svg-B2YoIRuh.js';
|
|
3
|
-
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-
|
|
3
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-ZrGf1F2-.js';
|
|
4
4
|
import { i as inheritAriaAttributes, g as getDeepActiveElement } from './component-DOTK1OW3.js';
|
|
5
5
|
import './logger-CGmJG63p.js';
|
|
6
6
|
import './aria-loader-GfsGHZHY.js';
|
|
7
7
|
|
|
8
|
-
const closeSmSvg = 'data:image/svg+xml;base64,
|
|
8
|
+
const closeSmSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYgNkwxMiAxMk0xMiAxMkwxOCAxOE0xMiAxMkw2IDE4TTEyIDEyTDE4IDYiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMS43NSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==';
|
|
9
9
|
|
|
10
|
-
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('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } } :host { display: contents; --lmvz-modal-shell-gap: var(--lmvz-dimension-16-20, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); } dialog { border: none; padding: 0; background: transparent; } dialog::backdrop { background: rgba(0, 0, 0, 0.19); background: rgb(from var(--lmvz-semantic-color-int-primary, #000000) r g b / 0.29); } .modal-shell {
|
|
10
|
+
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('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } } :host { display: contents; --lmvz-modal-shell-gap: var(--lmvz-dimension-16-20, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); } dialog { border: none; padding: 0; background: transparent; height: 100vh; width: 100vw; contain: layout size; } dialog::backdrop { background: rgba(0, 0, 0, 0.19); background: rgb(from var(--lmvz-semantic-color-int-primary, #000000) r g b / 0.29); } .modal-shell { margin-inline: auto; top: 50%; transform: translateY(-50%); box-sizing: border-box; width: fit-content; max-height: 100%; max-width: clamp(20rem, 100%, 90vw); display: flex; flex-direction: column; gap: var(--lmvz-modal-shell-gap); padding: var(--lmvz-component-wrapper-lg-padding-y, clamp(2.25rem, 2.19rem + 0.26vw, 2.5rem)) var(--lmvz-component-wrapper-lg-padding-x, clamp(1.5rem, 1.14rem + 1.55vw, 3rem)); border-radius: var(--lmvz-component-wrapper-lg-border-radius, 18px); background: var(--lmvz-semantic-color-surface-primary, #ffffff); position: relative; .close-button { position: absolute; top: var(--lmvz-dimension-10-12, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem)); right: var(--lmvz-dimension-10-12, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem)); } } .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.5 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.5 Router); flex: 1; overflow: scroll; } `;
|
|
11
11
|
|
|
12
12
|
const closeIconSvg = toValidSvgStringWithFallback(closeSmSvg);
|
|
13
13
|
let modalIdCounter = 0;
|
|
@@ -231,7 +231,7 @@ const LmvzModal = class extends ReactiveControllerHost {
|
|
|
231
231
|
this.hasHeader = this.hasAssignedContent(this.headerSlot);
|
|
232
232
|
};
|
|
233
233
|
render() {
|
|
234
|
-
return (h(Host, { key: '
|
|
234
|
+
return (h(Host, { key: '1fbdbb1ab2d3ad423075465108d4ff807d07404e' }, h("dialog", { key: '622dd60366ad594e16471cc8921c97d23af14ccb', ref: (element) => (this.dialogEl = element), onCancel: this.handleDialogCancel, onClose: this.handleDialogClose, ...this.dialogAccessibilityAttributes }, h("div", { key: 'bcdfbefbd5f380e2bf946aed479d542a33927af1', class: "modal-shell" }, h("header", { key: 'dcd23467473d58b51bddaf613b3ac8c922eecdc6', class: { header: true, 'has-title': this.hasHeader } }, h("div", { key: 'b2aa21fda4a80d2ea003e6ec876c2b74df5d29fd', class: "title", id: this.dialogTitleId, hidden: !this.hasHeader }, h("slot", { key: 'b7238e5b24c0822a94087d4ff0567e6406542c73', name: "header", ref: (element) => (this.headerSlot = element), onSlotchange: this.handleHeaderSlotChange })), h("lmvz-button", { key: '5059671fb4d81c685becd3adb0be52dd92ec4dec', ref: (element) => (this.closeButtonEl = element), type: "button", class: "close-button", "aria-label": this.closeLabel, onClick: this.handleCloseButtonClick, variant: "tertiary" }, h("lmvz-icon", { key: '498447e60e0e33fc165f39cea35434080e869d3c', icon: closeIconSvg }))), h("div", { key: '39ecefb52d5990cb689b0e4f18a8b6fc501c840d', class: "body" }, h("slot", { key: 'b014d0633c28fb6b399f11f2323e102949548776' })), h("footer", { key: '201dae98bcf810f369d77b7e9f36d7cc71ed5db4', class: "actions", hidden: !this.buttonGroupEl?.hasActions }, h("lmvz-button-group", { key: 'e4559d383992e059f915670a0874cc3b9ef655a3', ref: (element) => (this.buttonGroupEl = element) }, h("slot", { key: '88b007e139d4a166a2ee886dcd0256293d5d33c9', name: "actions" })))))));
|
|
235
235
|
}
|
|
236
236
|
static get watchers() { return {
|
|
237
237
|
"open": [{
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-CKYszC64.js';
|
|
2
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-ZrGf1F2-.js';
|
|
3
|
+
import './aria-loader-GfsGHZHY.js';
|
|
4
|
+
|
|
5
|
+
function groupKey(name, scope) {
|
|
6
|
+
if (scope instanceof HTMLFormElement) {
|
|
7
|
+
if (!scope.dataset['lmvzRadioGroupId']) {
|
|
8
|
+
scope.dataset['lmvzRadioGroupId'] = String(Math.random());
|
|
9
|
+
}
|
|
10
|
+
return `${name}::form::${scope.dataset['lmvzRadioGroupId']}`;
|
|
11
|
+
}
|
|
12
|
+
return `${name}::document`;
|
|
13
|
+
}
|
|
14
|
+
function getScope(el) {
|
|
15
|
+
return el.closest('form') ?? document;
|
|
16
|
+
}
|
|
17
|
+
function getNativeInput(host) {
|
|
18
|
+
return host.el.shadowRoot?.querySelector('input') ?? host.el.querySelector('input') ?? null;
|
|
19
|
+
}
|
|
20
|
+
class RadioGroup {
|
|
21
|
+
hosts = [];
|
|
22
|
+
_focusedHost = null;
|
|
23
|
+
_focusinHandler = (event) => {
|
|
24
|
+
if (!this.hosts.some((h) => h.el.contains(event.target))) {
|
|
25
|
+
this.clearFocused();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
register(host) {
|
|
29
|
+
if (!this.hosts.includes(host)) {
|
|
30
|
+
const wasEmpty = this.hosts.length === 0;
|
|
31
|
+
this.hosts.push(host);
|
|
32
|
+
this.sortHosts();
|
|
33
|
+
if (wasEmpty) {
|
|
34
|
+
document.addEventListener('focusin', this._focusinHandler, true);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
unregister(host) {
|
|
39
|
+
if (host === this._focusedHost) {
|
|
40
|
+
this._focusedHost = null;
|
|
41
|
+
}
|
|
42
|
+
this.hosts = this.hosts.filter((h) => h !== host);
|
|
43
|
+
if (this.hosts.length === 0) {
|
|
44
|
+
document.removeEventListener('focusin', this._focusinHandler, true);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
get sortedEnabled() {
|
|
48
|
+
return this.hosts.filter((h) => !h.disabled);
|
|
49
|
+
}
|
|
50
|
+
setFocused(host) {
|
|
51
|
+
this._focusedHost = host;
|
|
52
|
+
this.updateTabindex();
|
|
53
|
+
host.focusInput();
|
|
54
|
+
}
|
|
55
|
+
clearFocused() {
|
|
56
|
+
this._focusedHost = null;
|
|
57
|
+
this.updateTabindex();
|
|
58
|
+
}
|
|
59
|
+
select(selectedHost) {
|
|
60
|
+
this._focusedHost = null;
|
|
61
|
+
for (const host of this.hosts) {
|
|
62
|
+
host.checked = host === selectedHost;
|
|
63
|
+
}
|
|
64
|
+
this.updateTabindex();
|
|
65
|
+
}
|
|
66
|
+
updateTabindex() {
|
|
67
|
+
const enabled = this.sortedEnabled;
|
|
68
|
+
const checkedHost = this.hosts.find((h) => h.checked);
|
|
69
|
+
let tabbableHost;
|
|
70
|
+
if (this._focusedHost && enabled.includes(this._focusedHost)) {
|
|
71
|
+
tabbableHost = this._focusedHost;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
tabbableHost = checkedHost ?? enabled[0] ?? null;
|
|
75
|
+
}
|
|
76
|
+
for (const host of this.hosts) {
|
|
77
|
+
const input = getNativeInput(host);
|
|
78
|
+
if (input) {
|
|
79
|
+
input.tabIndex = host === tabbableHost ? 0 : -1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
sortHosts() {
|
|
84
|
+
this.hosts.sort((a, b) => {
|
|
85
|
+
const pos = a.el.compareDocumentPosition(b.el);
|
|
86
|
+
return pos & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
class RadioGroupController {
|
|
91
|
+
host;
|
|
92
|
+
static registry = new Map();
|
|
93
|
+
group = null;
|
|
94
|
+
_groupKey = null;
|
|
95
|
+
_scope = null;
|
|
96
|
+
constructor(host) {
|
|
97
|
+
this.host = host;
|
|
98
|
+
}
|
|
99
|
+
hostConnected() {
|
|
100
|
+
const { group, key, scope } = RadioGroupController.acquireGroup(this.host);
|
|
101
|
+
this._groupKey = key;
|
|
102
|
+
this._scope = scope;
|
|
103
|
+
this.group = group;
|
|
104
|
+
this.group.register(this.host);
|
|
105
|
+
this.group.updateTabindex();
|
|
106
|
+
}
|
|
107
|
+
hostDidRender() {
|
|
108
|
+
this.group?.updateTabindex();
|
|
109
|
+
}
|
|
110
|
+
hostDisconnected() {
|
|
111
|
+
if (this.group) {
|
|
112
|
+
this.group.unregister(this.host);
|
|
113
|
+
this.group.updateTabindex();
|
|
114
|
+
RadioGroupController.releaseGroup(this._groupKey, this._scope);
|
|
115
|
+
this._groupKey = null;
|
|
116
|
+
this._scope = null;
|
|
117
|
+
this.group = null;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
get sortedEnabled() {
|
|
121
|
+
return this.group?.sortedEnabled ?? [];
|
|
122
|
+
}
|
|
123
|
+
select(selectedHost) {
|
|
124
|
+
this.group?.select(selectedHost);
|
|
125
|
+
}
|
|
126
|
+
setFocused(host) {
|
|
127
|
+
this.group?.setFocused(host);
|
|
128
|
+
}
|
|
129
|
+
clearFocused() {
|
|
130
|
+
this.group?.clearFocused();
|
|
131
|
+
}
|
|
132
|
+
updateTabindex() {
|
|
133
|
+
this.group?.updateTabindex();
|
|
134
|
+
}
|
|
135
|
+
static acquireGroup(host) {
|
|
136
|
+
const name = host.name;
|
|
137
|
+
if (!name) {
|
|
138
|
+
return { group: new RadioGroup(), key: null, scope: null };
|
|
139
|
+
}
|
|
140
|
+
const scope = getScope(host.el);
|
|
141
|
+
const key = groupKey(name, scope);
|
|
142
|
+
let entry = RadioGroupController.registry.get(key);
|
|
143
|
+
if (!entry) {
|
|
144
|
+
entry = { group: new RadioGroup(), refCount: 0 };
|
|
145
|
+
RadioGroupController.registry.set(key, entry);
|
|
146
|
+
}
|
|
147
|
+
entry.refCount++;
|
|
148
|
+
return { group: entry.group, key, scope };
|
|
149
|
+
}
|
|
150
|
+
static releaseGroup(key, scope) {
|
|
151
|
+
if (!key)
|
|
152
|
+
return;
|
|
153
|
+
const entry = RadioGroupController.registry.get(key);
|
|
154
|
+
if (!entry)
|
|
155
|
+
return;
|
|
156
|
+
entry.refCount--;
|
|
157
|
+
if (entry.refCount <= 0) {
|
|
158
|
+
RadioGroupController.registry.delete(key);
|
|
159
|
+
if (scope instanceof HTMLFormElement) {
|
|
160
|
+
scope.removeAttribute('data-lmvz-radio-group-id');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const lmvzRadioCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-radio-h { display: inline-block; --radio-circle-size: var(--lmvz-global-s18, 18px); --radio-dot-size: 0.5rem; --radio-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --radio-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --radio-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --radio-border-color-checked: var(--lmvz-semantic-color-border-active, #0f8acc); --radio-border-color-error: var(--lmvz-semantic-color-status-on-danger, #e52a31); --radio-dot-color: var(--lmvz-semantic-color-border-active, #0f8acc); --radio-wrapper-bg-hover: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --radio-wrapper-bg-active: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); --radio-label-color: var(--lmvz-semantic-color-on-surface-primary, #000000); --radio-label-color-checked: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --radio-helper-color: var(--lmvz-semantic-color-on-surface-secondary, #7a7a7a); --radio-easing: var(--lmvz-global-easing-default, ease); --radio-duration: 0.2s; display: flex; align-items: center; gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); padding-block: var(--lmvz-dimension-2-8, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem)); padding-inline: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); overflow: clip; cursor: pointer; background-color: transparent; position: relative; transition: background-color var(--radio-duration) var(--radio-easing); } input.sc-lmvz-radio { position: absolute; inset-block-start: var(--lmvz-dimension-2-8, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem)); inset-inline-start: var(--lmvz-dimension-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); opacity: 0; width: var(--radio-circle-size); height: var(--radio-circle-size); margin: 0; cursor: pointer; z-index: 1; } .circle.sc-lmvz-radio { width: var(--radio-circle-size); height: var(--radio-circle-size); border-radius: 50%; border: var(--lmvz-semantic-border-width-default, 1px) solid var(--radio-border-color); background-color: var(--radio-bg); pointer-events: none; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; transition: border-color var(--radio-duration) var(--radio-easing); } .dot.sc-lmvz-radio { width: var(--radio-dot-size); height: var(--radio-dot-size); border-radius: 50%; background-color: var(--radio-dot-color); } .content.sc-lmvz-radio { display: flex; flex-direction: column; overflow-wrap: break-word; min-width: 0; } label.sc-lmvz-radio { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); color: var(--radio-label-color); cursor: pointer; transition: color var(--radio-duration) var(--radio-easing); } .helper-text.sc-lmvz-radio { display: block; font: var(--lmvz-typography-body-sm, 400 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.5 Router); color: var(--radio-helper-color); margin-block-start: 2px; } .helper-text.sc-lmvz-radio:empty { display: none; } @media (hover: hover) { .sc-lmvz-radio-h:hover .circle.sc-lmvz-radio { border-color: var(--radio-border-color-hover); } .sc-lmvz-radio-h:hover { background-color: var(--radio-wrapper-bg-hover); } } .sc-lmvz-radio-h:active { background-color: var(--radio-wrapper-bg-active); } [checked].sc-lmvz-radio-h .circle.sc-lmvz-radio { border-color: var(--radio-border-color-checked); } [checked].sc-lmvz-radio-h label.sc-lmvz-radio { color: var(--radio-label-color-checked); } [error].sc-lmvz-radio-h .circle.sc-lmvz-radio { border-color: var(--radio-border-color-error); } [error].sc-lmvz-radio-h .helper-text.sc-lmvz-radio { color: var(--lmvz-semantic-color-status-on-danger, #e52a31); } [disabled].sc-lmvz-radio-h { opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; cursor: not-allowed; } @media (forced-colors: active) { .circle.sc-lmvz-radio { forced-color-adjust: auto; border-color: ButtonText; background-color: Field; } [checked].sc-lmvz-radio-h .circle.sc-lmvz-radio { border-color: Highlight; } .dot.sc-lmvz-radio { background-color: ButtonText; } [checked].sc-lmvz-radio-h .dot.sc-lmvz-radio { background-color: HighlightText; } }`;
|
|
167
|
+
|
|
168
|
+
const focusWithinCss = () => `.sc-lmvz-radio-h:focus-within{outline:var(--lmvz-ds-outline, 1px solid #0e7ab4);outline-offset:var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem))}@media (forced-colors: active){.sc-lmvz-radio-h:focus-within{outline-color:Highlight;box-shadow:none}}`;
|
|
169
|
+
|
|
170
|
+
let radioIdCounter = 0;
|
|
171
|
+
const LmvzRadio = class extends ReactiveControllerHost {
|
|
172
|
+
get el() { return getElement(this); }
|
|
173
|
+
get validationEl() {
|
|
174
|
+
return this.el;
|
|
175
|
+
}
|
|
176
|
+
internals;
|
|
177
|
+
nativeInput;
|
|
178
|
+
radioId = `lmvz-radio-${radioIdCounter++}`;
|
|
179
|
+
initialChecked = false;
|
|
180
|
+
radioGroupController;
|
|
181
|
+
get helperId() {
|
|
182
|
+
return this.helperText ? `${this.radioId}-helper` : undefined;
|
|
183
|
+
}
|
|
184
|
+
label;
|
|
185
|
+
checked = false;
|
|
186
|
+
value = 'on';
|
|
187
|
+
name;
|
|
188
|
+
disabled = false;
|
|
189
|
+
required = false;
|
|
190
|
+
error = false;
|
|
191
|
+
helperText;
|
|
192
|
+
form;
|
|
193
|
+
autofocus = false;
|
|
194
|
+
_handlingNativeChange = false;
|
|
195
|
+
_handlingFormReset = false;
|
|
196
|
+
handleCheckedChange(newVal, oldVal) {
|
|
197
|
+
this.internals.setFormValue?.(newVal ? this.value : null);
|
|
198
|
+
if (!newVal && oldVal && !this._handlingNativeChange && !this._handlingFormReset) {
|
|
199
|
+
this.lmvzChange.emit(false);
|
|
200
|
+
}
|
|
201
|
+
if (newVal && !oldVal && !this._handlingNativeChange && !this._handlingFormReset) {
|
|
202
|
+
this.lmvzChange.emit(true);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
handleValueChange(newVal) {
|
|
206
|
+
if (this.checked) {
|
|
207
|
+
this.internals.setFormValue?.(newVal);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
handleLabelChange(newVal) {
|
|
211
|
+
if (!newVal) {
|
|
212
|
+
console.warn('[lmvz-radio] label prop is required and must not be empty');
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
lmvzChange;
|
|
216
|
+
lmvzActivation;
|
|
217
|
+
async focusInput() {
|
|
218
|
+
this.nativeInput?.focus();
|
|
219
|
+
}
|
|
220
|
+
async checkValidity() {
|
|
221
|
+
return this.internals?.checkValidity() ?? true;
|
|
222
|
+
}
|
|
223
|
+
async reportValidity() {
|
|
224
|
+
return this.internals?.reportValidity() ?? true;
|
|
225
|
+
}
|
|
226
|
+
constructor(hostRef) {
|
|
227
|
+
super();
|
|
228
|
+
registerInstance(this, hostRef);
|
|
229
|
+
this.lmvzChange = createEvent(this, "lmvzChange", 7);
|
|
230
|
+
this.lmvzActivation = createEvent(this, "lmvzActivation", 7);
|
|
231
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
232
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
236
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
237
|
+
}
|
|
238
|
+
this.addController(new AriaValidationController(this, {
|
|
239
|
+
reValidateOnPropChanges: true,
|
|
240
|
+
}));
|
|
241
|
+
this.radioGroupController = new RadioGroupController(this);
|
|
242
|
+
this.addController(this.radioGroupController);
|
|
243
|
+
}
|
|
244
|
+
componentWillLoad() {
|
|
245
|
+
this.initialChecked = this.checked;
|
|
246
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
247
|
+
super.componentWillLoad();
|
|
248
|
+
}
|
|
249
|
+
formAssociatedCallback() {
|
|
250
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
251
|
+
}
|
|
252
|
+
formResetCallback() {
|
|
253
|
+
this._handlingFormReset = true;
|
|
254
|
+
try {
|
|
255
|
+
this.checked = this.initialChecked;
|
|
256
|
+
}
|
|
257
|
+
finally {
|
|
258
|
+
this._handlingFormReset = false;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
formStateRestoreCallback(state) {
|
|
262
|
+
if (typeof state !== 'string')
|
|
263
|
+
return;
|
|
264
|
+
this._handlingFormReset = true;
|
|
265
|
+
try {
|
|
266
|
+
this.checked = state === this.value;
|
|
267
|
+
}
|
|
268
|
+
finally {
|
|
269
|
+
this._handlingFormReset = false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
handleChange = (event) => {
|
|
273
|
+
this._handlingNativeChange = true;
|
|
274
|
+
try {
|
|
275
|
+
const input = event.target;
|
|
276
|
+
this.checked = input.checked;
|
|
277
|
+
this.lmvzChange.emit(this.checked);
|
|
278
|
+
this.radioGroupController.select(this);
|
|
279
|
+
this.lmvzActivation.emit();
|
|
280
|
+
}
|
|
281
|
+
finally {
|
|
282
|
+
this._handlingNativeChange = false;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
handleKeydown(event) {
|
|
286
|
+
const { key } = event;
|
|
287
|
+
if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft', 'Home', 'End'].includes(key))
|
|
288
|
+
return;
|
|
289
|
+
event.preventDefault();
|
|
290
|
+
const radios = this.radioGroupController.sortedEnabled;
|
|
291
|
+
if (radios.length === 0)
|
|
292
|
+
return;
|
|
293
|
+
const currentIndex = radios.indexOf(this);
|
|
294
|
+
if (currentIndex === -1)
|
|
295
|
+
return;
|
|
296
|
+
let targetIndex;
|
|
297
|
+
if (key === 'ArrowDown' || key === 'ArrowRight') {
|
|
298
|
+
targetIndex = (currentIndex + 1) % radios.length;
|
|
299
|
+
}
|
|
300
|
+
else if (key === 'ArrowUp' || key === 'ArrowLeft') {
|
|
301
|
+
targetIndex = (currentIndex - 1 + radios.length) % radios.length;
|
|
302
|
+
}
|
|
303
|
+
else if (key === 'Home') {
|
|
304
|
+
targetIndex = 0;
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
targetIndex = radios.length - 1;
|
|
308
|
+
}
|
|
309
|
+
const target = radios[targetIndex];
|
|
310
|
+
if (!target)
|
|
311
|
+
return;
|
|
312
|
+
this.radioGroupController.setFocused(target);
|
|
313
|
+
}
|
|
314
|
+
render() {
|
|
315
|
+
return (h(Host, { key: '0226e313fcf4fe3c3cf343cfe0776cf71da169a6' }, h("input", { key: '5bb1f733d2f29217bc7544d8fd24f6b21bedc654', type: "radio", id: this.radioId, name: this.name ?? undefined, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, autoFocus: this.autofocus, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.helperId, ref: (el) => (this.nativeInput = el), onChange: this.handleChange }), h("span", { key: 'ae18f49167d1a2e8e6ec4ceca435e69e3d79f593', class: "circle", "aria-hidden": "true" }, this.checked && h("span", { key: '5dfb65105831a672f2a47952aff987cd45e9b178', class: "dot" })), h("span", { key: 'df148ca52be7e580226d94ff9aef4e3cf5a6182c', class: "content" }, h("label", { key: 'e042c57755eadb64692ace49204dccb1ee03ed1c', htmlFor: this.radioId }, this.label), h("span", { key: 'a90b0bef927dddb39f9e6357adf888e0818a3c5a', "aria-live": "polite", class: "helper-text", id: this.helperId }, this.helperText))));
|
|
316
|
+
}
|
|
317
|
+
static get formAssociated() { return true; }
|
|
318
|
+
static get watchers() { return {
|
|
319
|
+
"checked": [{
|
|
320
|
+
"handleCheckedChange": 0
|
|
321
|
+
}],
|
|
322
|
+
"value": [{
|
|
323
|
+
"handleValueChange": 0
|
|
324
|
+
}],
|
|
325
|
+
"label": [{
|
|
326
|
+
"handleLabelChange": 0
|
|
327
|
+
}]
|
|
328
|
+
}; }
|
|
329
|
+
};
|
|
330
|
+
LmvzRadio.style = lmvzRadioCss() + focusWithinCss();
|
|
331
|
+
|
|
332
|
+
export { LmvzRadio as lmvz_radio };
|