@lmvz-ds/components 0.20.0 → 0.21.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/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-toggle.cjs.entry.js +96 -0
- package/cjs/loader.cjs.js +1 -1
- package/collection/collection-manifest.json +1 -0
- package/collection/components/lmvz-toggle/lmvz-toggle.css +118 -0
- package/collection/components/lmvz-toggle/lmvz-toggle.js +358 -0
- 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-toggle.d.ts +11 -0
- package/components/lmvz-toggle.d.ts.bak +11 -0
- package/components/lmvz-toggle.js +1 -0
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-toggle.entry.js +94 -0
- package/esm/loader.js +1 -1
- package/hydrate/index.js +110 -0
- package/hydrate/index.mjs +110 -0
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/p-c3b7890d.entry.js +1 -0
- package/manifest.json +348 -1
- package/package.json +5 -1
- package/types/components/lmvz-toggle/lmvz-toggle.d.ts +31 -0
- package/types/components.d.ts +119 -0
package/components/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export { LmvzMenuItem as LmvzMenuitem } from '../../types/components/lmvz-menuit
|
|
|
19
19
|
export { defineCustomElement as defineCustomElementLmvzMenuitem } from './lmvz-menuitem';
|
|
20
20
|
export { LmvzSelect as LmvzSelect } from '../../types/components/lmvz-select/lmvz-select';
|
|
21
21
|
export { defineCustomElement as defineCustomElementLmvzSelect } from './lmvz-select';
|
|
22
|
+
export { LmvzToggle as LmvzToggle } from '../../types/components/lmvz-toggle/lmvz-toggle';
|
|
23
|
+
export { defineCustomElement as defineCustomElementLmvzToggle } from './lmvz-toggle';
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
@@ -19,6 +19,8 @@ export { LmvzMenuItem as LmvzMenuitem } from '../../types/components/lmvz-menuit
|
|
|
19
19
|
export { defineCustomElement as defineCustomElementLmvzMenuitem } from './lmvz-menuitem';
|
|
20
20
|
export { LmvzSelect as LmvzSelect } from '../../types/components/lmvz-select/lmvz-select';
|
|
21
21
|
export { defineCustomElement as defineCustomElementLmvzSelect } from './lmvz-select';
|
|
22
|
+
export { LmvzToggle as LmvzToggle } from '../../types/components/lmvz-toggle/lmvz-toggle';
|
|
23
|
+
export { defineCustomElement as defineCustomElementLmvzToggle } from './lmvz-toggle';
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
package/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-C_bScbrd.js";export{A as ARIA_VALIDATION_RUNTIME_CHANGED_EVENT,d as disableAriaValidation,e as enableAriaValidation,i as isAriaValidationEnabled,q as queueValidation,u as useVerboseLogging}from"./p-BuFx0tTm.js";export{LmvzChip,c as chipSizes,a as chipTypes,defineCustomElement as defineCustomElementLmvzChip,i as iconSizes,b as iconWeights,d as inputTypes,t as textSizes}from"./lmvz-chip.js";export{LmvzIcon,defineCustomElement as defineCustomElementLmvzIcon,g as getRegisteredIconProvider,r as registerIconProvider,t as typedIconFromSet}from"./lmvz-icon.js";export{LmvzAction,defineCustomElement as defineCustomElementLmvzAction}from"./lmvz-action.js";export{LmvzButton,defineCustomElement as defineCustomElementLmvzButton}from"./lmvz-button.js";export{LmvzCard,defineCustomElement as defineCustomElementLmvzCard}from"./lmvz-card.js";export{LmvzCheckbox,defineCustomElement as defineCustomElementLmvzCheckbox}from"./lmvz-checkbox.js";export{LmvzHeader,defineCustomElement as defineCustomElementLmvzHeader}from"./lmvz-header.js";export{LmvzInput,defineCustomElement as defineCustomElementLmvzInput}from"./lmvz-input.js";export{LmvzMenuitem,defineCustomElement as defineCustomElementLmvzMenuitem}from"./lmvz-menuitem.js";export{LmvzSelect,defineCustomElement as defineCustomElementLmvzSelect}from"./lmvz-select.js";
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-C_bScbrd.js";export{A as ARIA_VALIDATION_RUNTIME_CHANGED_EVENT,d as disableAriaValidation,e as enableAriaValidation,i as isAriaValidationEnabled,q as queueValidation,u as useVerboseLogging}from"./p-BuFx0tTm.js";export{LmvzChip,c as chipSizes,a as chipTypes,defineCustomElement as defineCustomElementLmvzChip,i as iconSizes,b as iconWeights,d as inputTypes,t as textSizes}from"./lmvz-chip.js";export{LmvzIcon,defineCustomElement as defineCustomElementLmvzIcon,g as getRegisteredIconProvider,r as registerIconProvider,t as typedIconFromSet}from"./lmvz-icon.js";export{LmvzAction,defineCustomElement as defineCustomElementLmvzAction}from"./lmvz-action.js";export{LmvzButton,defineCustomElement as defineCustomElementLmvzButton}from"./lmvz-button.js";export{LmvzCard,defineCustomElement as defineCustomElementLmvzCard}from"./lmvz-card.js";export{LmvzCheckbox,defineCustomElement as defineCustomElementLmvzCheckbox}from"./lmvz-checkbox.js";export{LmvzHeader,defineCustomElement as defineCustomElementLmvzHeader}from"./lmvz-header.js";export{LmvzInput,defineCustomElement as defineCustomElementLmvzInput}from"./lmvz-input.js";export{LmvzMenuitem,defineCustomElement as defineCustomElementLmvzMenuitem}from"./lmvz-menuitem.js";export{LmvzSelect,defineCustomElement as defineCustomElementLmvzSelect}from"./lmvz-select.js";export{LmvzToggle,defineCustomElement as defineCustomElementLmvzToggle}from"./lmvz-toggle.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface LmvzToggle extends Components.LmvzToggle, HTMLElement {}
|
|
4
|
+
export const LmvzToggle: {
|
|
5
|
+
prototype: LmvzToggle;
|
|
6
|
+
new (): LmvzToggle;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface LmvzToggle extends Components.LmvzToggle, HTMLElement {}
|
|
4
|
+
export const LmvzToggle: {
|
|
5
|
+
prototype: LmvzToggle;
|
|
6
|
+
new (): LmvzToggle;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,c as t,h as o,d as a,t as l}from"./p-C_bScbrd.js";import{R as r,a as s}from"./p-BuFx0tTm.js";import{c}from"./p-DIrAQ4IB.js";let i=0;const n=e(class extends r{get el(){return this}get validationEl(){return this.el}internals;nativeInputElement;toggleId="lmvz-toggle-"+i++;lmvzChange;label;checked=!1;disabled=!1;required=!1;name;value="on";form;constructor(e){super(!1),!1!==e&&this.__registerHost(),this.lmvzChange=t(this,"lmvzChange"),this.internals=this.attachInternals(),this.addController(new s(this))}formAssociatedCallback(e){this.internals.setFormValue?.(this.checked?this.value:null)}formResetCallback(){this.checked=!1}formStateRestoreCallback(e){this.checked=e===this.value,this.internals.setFormValue?.(this.checked?this.value:null)}handleCheckedChange(e){this.internals.setFormValue?.(e?this.value:null)}handleDisabledChange(e){e&&this.nativeInputElement&&this.nativeInputElement.blur()}async focusToggle(){this.nativeInputElement?.focus()}async blurToggle(){this.nativeInputElement?.blur()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getInputElement(){return this.nativeInputElement||await new Promise((e=>c(this.el,e))),Promise.resolve(this.nativeInputElement)}handleChange=e=>{const t=e.target.checked;this.checked=t,this.lmvzChange.emit(t)};render(){return o(a,{key:"0a0f0e278a0ccd6739e7e9e82267c047efad74ad"},o("span",{key:"da93a2dd256c72171e7a423223a3738d6ca13ebb",class:"track"},o("input",{key:"6e90ec39ec856fa38097e6224c7fed50b23088e5",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:e=>this.nativeInputElement=e,onChange:this.handleChange}),o("span",{key:"8fca08269e216b9a2840e7707fa5562220f8b36c",class:"thumb","aria-hidden":"true"})),o("label",{key:"f0a0842fef8c9fa3981b6d8c373a79fe0c33fad3",htmlFor:this.toggleId},this.label))}static get formAssociated(){return!0}static get watchers(){return{checked:[{handleCheckedChange:0}],disabled:[{handleDisabledChange:0}]}}static get style(){return"@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-toggle-h { display: inline-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-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); cursor: pointer; background-color: transparent; user-select: none; } .sc-lmvz-toggle-h:not([disabled]):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } [checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled][checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled].sc-lmvz-toggle-h { cursor: not-allowed; opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; } .track.sc-lmvz-toggle { position: relative; flex-shrink: 0; width: var(--lmvz-global-s32, 32px); height: var(--lmvz-global-s20, 20px); border-radius: var(--lmvz-semantic-border-radius-round, 999px); background-color: var(--lmvz-semantic-color-surface-input-primary, #ffffff); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); } .sc-lmvz-toggle-h:not([disabled]):hover .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } [checked].sc-lmvz-toggle-h .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-active, #0f8acc); } input.sc-lmvz-toggle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: inherit; } .sc-lmvz-toggle-h:focus-within { outline: 2px solid var(--lmvz-semantic-color-border-active, #0f8acc); outline-offset: 2px; } .thumb.sc-lmvz-toggle { position: absolute; width: var(--lmvz-global-s13, 13px); height: var(--lmvz-global-s13, 13px); border-radius: 50%; background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); top: 50%; transform: translateY(-50%); left: var(--lmvz-global-s4, 4px); transition: left 0.2s ease, background-color 0.2s ease; pointer-events: none; } [checked].sc-lmvz-toggle-h .thumb.sc-lmvz-toggle { left: calc(var(--lmvz-global-s4, 4px) + var(--lmvz-global-s11, 11px)); background-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } label.sc-lmvz-toggle { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); cursor: pointer; }"}},[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]},void 0,{checked:[{handleCheckedChange:0}],disabled:[{handleDisabledChange:0}]}]),m=n,d=function(){"undefined"!=typeof customElements&&["lmvz-toggle"].forEach((e=>{"lmvz-toggle"===e&&(customElements.get(l(e))||customElements.define(l(e),n))}))};export{m as LmvzToggle,d as defineCustomElement}
|
package/esm/lmvz-components.js
CHANGED
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["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-button",[[785,"lmvz-button",{"ti":[2562,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1]}]]],["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-icon",[[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}]}]]],["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}]}]]]], options);
|
|
20
|
+
return bootstrapLazy([["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-button",[[785,"lmvz-button",{"ti":[2562,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1]}]]],["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-icon",[[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}]}]]],["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}]}]]]], options);
|
|
21
21
|
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { g as getElement, r as registerInstance, c as createEvent, h, H as Host } from './index-saW7O-EW.js';
|
|
2
|
+
import { R as ReactiveControllerHost, A as AriaValidationController } from './reactive-controller-host-DHcPpJW7.js';
|
|
3
|
+
import { c as componentOnReady } from './component-DIrAQ4IB.js';
|
|
4
|
+
import './aria-loader-BVolm0lC.js';
|
|
5
|
+
|
|
6
|
+
const lmvzToggleCss = () => `@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-toggle-h { display: inline-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-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); cursor: pointer; background-color: transparent; user-select: none; } .sc-lmvz-toggle-h:not([disabled]):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } [checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled][checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled].sc-lmvz-toggle-h { cursor: not-allowed; opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; } .track.sc-lmvz-toggle { position: relative; flex-shrink: 0; width: var(--lmvz-global-s32, 32px); height: var(--lmvz-global-s20, 20px); border-radius: var(--lmvz-semantic-border-radius-round, 999px); background-color: var(--lmvz-semantic-color-surface-input-primary, #ffffff); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); } .sc-lmvz-toggle-h:not([disabled]):hover .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } [checked].sc-lmvz-toggle-h .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-active, #0f8acc); } input.sc-lmvz-toggle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: inherit; } .sc-lmvz-toggle-h:focus-within { outline: 2px solid var(--lmvz-semantic-color-border-active, #0f8acc); outline-offset: 2px; } .thumb.sc-lmvz-toggle { position: absolute; width: var(--lmvz-global-s13, 13px); height: var(--lmvz-global-s13, 13px); border-radius: 50%; background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); top: 50%; transform: translateY(-50%); left: var(--lmvz-global-s4, 4px); transition: left 0.2s ease, background-color 0.2s ease; pointer-events: none; } [checked].sc-lmvz-toggle-h .thumb.sc-lmvz-toggle { left: calc(var(--lmvz-global-s4, 4px) + var(--lmvz-global-s11, 11px)); background-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } label.sc-lmvz-toggle { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); cursor: pointer; }`;
|
|
7
|
+
|
|
8
|
+
let toggleIdCounter = 0;
|
|
9
|
+
const LmvzToggle = class extends ReactiveControllerHost {
|
|
10
|
+
get el() { return getElement(this); }
|
|
11
|
+
get validationEl() {
|
|
12
|
+
return this.el;
|
|
13
|
+
}
|
|
14
|
+
internals;
|
|
15
|
+
nativeInputElement;
|
|
16
|
+
toggleId = `lmvz-toggle-${toggleIdCounter++}`;
|
|
17
|
+
lmvzChange;
|
|
18
|
+
label;
|
|
19
|
+
checked = false;
|
|
20
|
+
disabled = false;
|
|
21
|
+
required = false;
|
|
22
|
+
name;
|
|
23
|
+
value = 'on';
|
|
24
|
+
form;
|
|
25
|
+
constructor(hostRef) {
|
|
26
|
+
super();
|
|
27
|
+
registerInstance(this, hostRef);
|
|
28
|
+
this.lmvzChange = createEvent(this, "lmvzChange");
|
|
29
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
30
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
34
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
35
|
+
}
|
|
36
|
+
this.addController(new AriaValidationController(this));
|
|
37
|
+
}
|
|
38
|
+
formAssociatedCallback(_form) {
|
|
39
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
40
|
+
}
|
|
41
|
+
formResetCallback() {
|
|
42
|
+
this.checked = false;
|
|
43
|
+
}
|
|
44
|
+
formStateRestoreCallback(state) {
|
|
45
|
+
this.checked = state === this.value;
|
|
46
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
47
|
+
}
|
|
48
|
+
handleCheckedChange(checked) {
|
|
49
|
+
this.internals.setFormValue?.(checked ? this.value : null);
|
|
50
|
+
}
|
|
51
|
+
handleDisabledChange(disabled) {
|
|
52
|
+
if (disabled && this.nativeInputElement) {
|
|
53
|
+
this.nativeInputElement.blur();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async focusToggle() {
|
|
57
|
+
this.nativeInputElement?.focus();
|
|
58
|
+
}
|
|
59
|
+
async blurToggle() {
|
|
60
|
+
this.nativeInputElement?.blur();
|
|
61
|
+
}
|
|
62
|
+
async checkValidity() {
|
|
63
|
+
return this.nativeInputElement?.checkValidity?.() ?? false;
|
|
64
|
+
}
|
|
65
|
+
async reportValidity() {
|
|
66
|
+
return this.nativeInputElement?.reportValidity?.() ?? false;
|
|
67
|
+
}
|
|
68
|
+
async getInputElement() {
|
|
69
|
+
if (!this.nativeInputElement) {
|
|
70
|
+
await new Promise((resolve) => componentOnReady(this.el, resolve));
|
|
71
|
+
}
|
|
72
|
+
return Promise.resolve(this.nativeInputElement);
|
|
73
|
+
}
|
|
74
|
+
handleChange = (event) => {
|
|
75
|
+
const newChecked = event.target.checked;
|
|
76
|
+
this.checked = newChecked;
|
|
77
|
+
this.lmvzChange.emit(newChecked);
|
|
78
|
+
};
|
|
79
|
+
render() {
|
|
80
|
+
return (h(Host, { key: '0a0f0e278a0ccd6739e7e9e82267c047efad74ad' }, h("span", { key: 'da93a2dd256c72171e7a423223a3738d6ca13ebb', class: "track" }, h("input", { key: '6e90ec39ec856fa38097e6224c7fed50b23088e5', 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 }), h("span", { key: '8fca08269e216b9a2840e7707fa5562220f8b36c', class: "thumb", "aria-hidden": "true" })), h("label", { key: 'f0a0842fef8c9fa3981b6d8c373a79fe0c33fad3', htmlFor: this.toggleId }, this.label)));
|
|
81
|
+
}
|
|
82
|
+
static get formAssociated() { return true; }
|
|
83
|
+
static get watchers() { return {
|
|
84
|
+
"checked": [{
|
|
85
|
+
"handleCheckedChange": 0
|
|
86
|
+
}],
|
|
87
|
+
"disabled": [{
|
|
88
|
+
"handleDisabledChange": 0
|
|
89
|
+
}]
|
|
90
|
+
}; }
|
|
91
|
+
};
|
|
92
|
+
LmvzToggle.style = lmvzToggleCss();
|
|
93
|
+
|
|
94
|
+
export { LmvzToggle as lmvz_toggle };
|
package/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["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-button",[[785,"lmvz-button",{"ti":[2562,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1]}]]],["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-icon",[[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}]}]]],["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}]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["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-button",[[785,"lmvz-button",{"ti":[2562,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1]}]]],["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-icon",[[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}]}]]],["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}]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
package/hydrate/index.js
CHANGED
|
@@ -8925,6 +8925,115 @@ class LmvzSelect extends ReactiveControllerHost {
|
|
|
8925
8925
|
}; }
|
|
8926
8926
|
}
|
|
8927
8927
|
|
|
8928
|
+
const lmvzToggleCss = () => `@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-toggle-h { display: inline-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-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); cursor: pointer; background-color: transparent; user-select: none; } .sc-lmvz-toggle-h:not([disabled]):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } [checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled][checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled].sc-lmvz-toggle-h { cursor: not-allowed; opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; } .track.sc-lmvz-toggle { position: relative; flex-shrink: 0; width: var(--lmvz-global-s32, 32px); height: var(--lmvz-global-s20, 20px); border-radius: var(--lmvz-semantic-border-radius-round, 999px); background-color: var(--lmvz-semantic-color-surface-input-primary, #ffffff); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); } .sc-lmvz-toggle-h:not([disabled]):hover .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } [checked].sc-lmvz-toggle-h .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-active, #0f8acc); } input.sc-lmvz-toggle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: inherit; } .sc-lmvz-toggle-h:focus-within { outline: 2px solid var(--lmvz-semantic-color-border-active, #0f8acc); outline-offset: 2px; } .thumb.sc-lmvz-toggle { position: absolute; width: var(--lmvz-global-s13, 13px); height: var(--lmvz-global-s13, 13px); border-radius: 50%; background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); top: 50%; transform: translateY(-50%); left: var(--lmvz-global-s4, 4px); transition: left 0.2s ease, background-color 0.2s ease; pointer-events: none; } [checked].sc-lmvz-toggle-h .thumb.sc-lmvz-toggle { left: calc(var(--lmvz-global-s4, 4px) + var(--lmvz-global-s11, 11px)); background-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } label.sc-lmvz-toggle { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); cursor: pointer; }`;
|
|
8929
|
+
|
|
8930
|
+
let toggleIdCounter = 0;
|
|
8931
|
+
class LmvzToggle extends ReactiveControllerHost {
|
|
8932
|
+
get el() { return getElement(this); }
|
|
8933
|
+
get validationEl() {
|
|
8934
|
+
return this.el;
|
|
8935
|
+
}
|
|
8936
|
+
internals;
|
|
8937
|
+
nativeInputElement;
|
|
8938
|
+
toggleId = `lmvz-toggle-${toggleIdCounter++}`;
|
|
8939
|
+
lmvzChange;
|
|
8940
|
+
label;
|
|
8941
|
+
checked = false;
|
|
8942
|
+
disabled = false;
|
|
8943
|
+
required = false;
|
|
8944
|
+
name;
|
|
8945
|
+
value = 'on';
|
|
8946
|
+
form;
|
|
8947
|
+
constructor(hostRef) {
|
|
8948
|
+
super();
|
|
8949
|
+
registerInstance(this, hostRef);
|
|
8950
|
+
this.lmvzChange = createEvent(this, "lmvzChange");
|
|
8951
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
8952
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
8953
|
+
}
|
|
8954
|
+
else {
|
|
8955
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
8956
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
8957
|
+
}
|
|
8958
|
+
this.addController(new AriaValidationController(this));
|
|
8959
|
+
}
|
|
8960
|
+
formAssociatedCallback(_form) {
|
|
8961
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
8962
|
+
}
|
|
8963
|
+
formResetCallback() {
|
|
8964
|
+
this.checked = false;
|
|
8965
|
+
}
|
|
8966
|
+
formStateRestoreCallback(state) {
|
|
8967
|
+
this.checked = state === this.value;
|
|
8968
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
8969
|
+
}
|
|
8970
|
+
handleCheckedChange(checked) {
|
|
8971
|
+
this.internals.setFormValue?.(checked ? this.value : null);
|
|
8972
|
+
}
|
|
8973
|
+
handleDisabledChange(disabled) {
|
|
8974
|
+
if (disabled && this.nativeInputElement) {
|
|
8975
|
+
this.nativeInputElement.blur();
|
|
8976
|
+
}
|
|
8977
|
+
}
|
|
8978
|
+
async focusToggle() {
|
|
8979
|
+
this.nativeInputElement?.focus();
|
|
8980
|
+
}
|
|
8981
|
+
async blurToggle() {
|
|
8982
|
+
this.nativeInputElement?.blur();
|
|
8983
|
+
}
|
|
8984
|
+
async checkValidity() {
|
|
8985
|
+
return this.nativeInputElement?.checkValidity?.() ?? false;
|
|
8986
|
+
}
|
|
8987
|
+
async reportValidity() {
|
|
8988
|
+
return this.nativeInputElement?.reportValidity?.() ?? false;
|
|
8989
|
+
}
|
|
8990
|
+
async getInputElement() {
|
|
8991
|
+
if (!this.nativeInputElement) {
|
|
8992
|
+
await new Promise((resolve) => componentOnReady(this.el, resolve));
|
|
8993
|
+
}
|
|
8994
|
+
return Promise.resolve(this.nativeInputElement);
|
|
8995
|
+
}
|
|
8996
|
+
handleChange = (event) => {
|
|
8997
|
+
const newChecked = event.target.checked;
|
|
8998
|
+
this.checked = newChecked;
|
|
8999
|
+
this.lmvzChange.emit(newChecked);
|
|
9000
|
+
};
|
|
9001
|
+
render() {
|
|
9002
|
+
return (hAsync(Host, { key: '0a0f0e278a0ccd6739e7e9e82267c047efad74ad' }, hAsync("span", { key: 'da93a2dd256c72171e7a423223a3738d6ca13ebb', class: "track" }, hAsync("input", { key: '6e90ec39ec856fa38097e6224c7fed50b23088e5', 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: '8fca08269e216b9a2840e7707fa5562220f8b36c', class: "thumb", "aria-hidden": "true" })), hAsync("label", { key: 'f0a0842fef8c9fa3981b6d8c373a79fe0c33fad3', htmlFor: this.toggleId }, this.label)));
|
|
9003
|
+
}
|
|
9004
|
+
static get formAssociated() { return true; }
|
|
9005
|
+
static get watchers() { return {
|
|
9006
|
+
"checked": [{
|
|
9007
|
+
"handleCheckedChange": 0
|
|
9008
|
+
}],
|
|
9009
|
+
"disabled": [{
|
|
9010
|
+
"handleDisabledChange": 0
|
|
9011
|
+
}]
|
|
9012
|
+
}; }
|
|
9013
|
+
static get style() { return lmvzToggleCss(); }
|
|
9014
|
+
static get cmpMeta() { return {
|
|
9015
|
+
"$flags$": 578,
|
|
9016
|
+
"$tagName$": "lmvz-toggle",
|
|
9017
|
+
"$members$": {
|
|
9018
|
+
"label": [1],
|
|
9019
|
+
"checked": [1540],
|
|
9020
|
+
"disabled": [516],
|
|
9021
|
+
"required": [516],
|
|
9022
|
+
"name": [1],
|
|
9023
|
+
"value": [1],
|
|
9024
|
+
"form": [1],
|
|
9025
|
+
"focusToggle": [64],
|
|
9026
|
+
"blurToggle": [64],
|
|
9027
|
+
"checkValidity": [64],
|
|
9028
|
+
"reportValidity": [64],
|
|
9029
|
+
"getInputElement": [64]
|
|
9030
|
+
},
|
|
9031
|
+
"$listeners$": undefined,
|
|
9032
|
+
"$lazyBundleId$": "-",
|
|
9033
|
+
"$attrsToReflect$": [["checked", "checked"], ["disabled", "disabled"], ["required", "required"]]
|
|
9034
|
+
}; }
|
|
9035
|
+
}
|
|
9036
|
+
|
|
8928
9037
|
registerComponents([
|
|
8929
9038
|
LmvzAction,
|
|
8930
9039
|
LmvzButton,
|
|
@@ -8936,6 +9045,7 @@ registerComponents([
|
|
|
8936
9045
|
LmvzInput,
|
|
8937
9046
|
LmvzMenuItem,
|
|
8938
9047
|
LmvzSelect,
|
|
9048
|
+
LmvzToggle,
|
|
8939
9049
|
]);
|
|
8940
9050
|
|
|
8941
9051
|
exports.hydrateApp = hydrateApp;
|
package/hydrate/index.mjs
CHANGED
|
@@ -8923,6 +8923,115 @@ class LmvzSelect extends ReactiveControllerHost {
|
|
|
8923
8923
|
}; }
|
|
8924
8924
|
}
|
|
8925
8925
|
|
|
8926
|
+
const lmvzToggleCss = () => `@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-toggle-h { display: inline-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-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); cursor: pointer; background-color: transparent; user-select: none; } .sc-lmvz-toggle-h:not([disabled]):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } [checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled][checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled].sc-lmvz-toggle-h { cursor: not-allowed; opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; } .track.sc-lmvz-toggle { position: relative; flex-shrink: 0; width: var(--lmvz-global-s32, 32px); height: var(--lmvz-global-s20, 20px); border-radius: var(--lmvz-semantic-border-radius-round, 999px); background-color: var(--lmvz-semantic-color-surface-input-primary, #ffffff); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); } .sc-lmvz-toggle-h:not([disabled]):hover .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } [checked].sc-lmvz-toggle-h .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-active, #0f8acc); } input.sc-lmvz-toggle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: inherit; } .sc-lmvz-toggle-h:focus-within { outline: 2px solid var(--lmvz-semantic-color-border-active, #0f8acc); outline-offset: 2px; } .thumb.sc-lmvz-toggle { position: absolute; width: var(--lmvz-global-s13, 13px); height: var(--lmvz-global-s13, 13px); border-radius: 50%; background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); top: 50%; transform: translateY(-50%); left: var(--lmvz-global-s4, 4px); transition: left 0.2s ease, background-color 0.2s ease; pointer-events: none; } [checked].sc-lmvz-toggle-h .thumb.sc-lmvz-toggle { left: calc(var(--lmvz-global-s4, 4px) + var(--lmvz-global-s11, 11px)); background-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } label.sc-lmvz-toggle { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); cursor: pointer; }`;
|
|
8927
|
+
|
|
8928
|
+
let toggleIdCounter = 0;
|
|
8929
|
+
class LmvzToggle extends ReactiveControllerHost {
|
|
8930
|
+
get el() { return getElement(this); }
|
|
8931
|
+
get validationEl() {
|
|
8932
|
+
return this.el;
|
|
8933
|
+
}
|
|
8934
|
+
internals;
|
|
8935
|
+
nativeInputElement;
|
|
8936
|
+
toggleId = `lmvz-toggle-${toggleIdCounter++}`;
|
|
8937
|
+
lmvzChange;
|
|
8938
|
+
label;
|
|
8939
|
+
checked = false;
|
|
8940
|
+
disabled = false;
|
|
8941
|
+
required = false;
|
|
8942
|
+
name;
|
|
8943
|
+
value = 'on';
|
|
8944
|
+
form;
|
|
8945
|
+
constructor(hostRef) {
|
|
8946
|
+
super();
|
|
8947
|
+
registerInstance(this, hostRef);
|
|
8948
|
+
this.lmvzChange = createEvent(this, "lmvzChange");
|
|
8949
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
8950
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
8951
|
+
}
|
|
8952
|
+
else {
|
|
8953
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
8954
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
8955
|
+
}
|
|
8956
|
+
this.addController(new AriaValidationController(this));
|
|
8957
|
+
}
|
|
8958
|
+
formAssociatedCallback(_form) {
|
|
8959
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
8960
|
+
}
|
|
8961
|
+
formResetCallback() {
|
|
8962
|
+
this.checked = false;
|
|
8963
|
+
}
|
|
8964
|
+
formStateRestoreCallback(state) {
|
|
8965
|
+
this.checked = state === this.value;
|
|
8966
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
8967
|
+
}
|
|
8968
|
+
handleCheckedChange(checked) {
|
|
8969
|
+
this.internals.setFormValue?.(checked ? this.value : null);
|
|
8970
|
+
}
|
|
8971
|
+
handleDisabledChange(disabled) {
|
|
8972
|
+
if (disabled && this.nativeInputElement) {
|
|
8973
|
+
this.nativeInputElement.blur();
|
|
8974
|
+
}
|
|
8975
|
+
}
|
|
8976
|
+
async focusToggle() {
|
|
8977
|
+
this.nativeInputElement?.focus();
|
|
8978
|
+
}
|
|
8979
|
+
async blurToggle() {
|
|
8980
|
+
this.nativeInputElement?.blur();
|
|
8981
|
+
}
|
|
8982
|
+
async checkValidity() {
|
|
8983
|
+
return this.nativeInputElement?.checkValidity?.() ?? false;
|
|
8984
|
+
}
|
|
8985
|
+
async reportValidity() {
|
|
8986
|
+
return this.nativeInputElement?.reportValidity?.() ?? false;
|
|
8987
|
+
}
|
|
8988
|
+
async getInputElement() {
|
|
8989
|
+
if (!this.nativeInputElement) {
|
|
8990
|
+
await new Promise((resolve) => componentOnReady(this.el, resolve));
|
|
8991
|
+
}
|
|
8992
|
+
return Promise.resolve(this.nativeInputElement);
|
|
8993
|
+
}
|
|
8994
|
+
handleChange = (event) => {
|
|
8995
|
+
const newChecked = event.target.checked;
|
|
8996
|
+
this.checked = newChecked;
|
|
8997
|
+
this.lmvzChange.emit(newChecked);
|
|
8998
|
+
};
|
|
8999
|
+
render() {
|
|
9000
|
+
return (hAsync(Host, { key: '0a0f0e278a0ccd6739e7e9e82267c047efad74ad' }, hAsync("span", { key: 'da93a2dd256c72171e7a423223a3738d6ca13ebb', class: "track" }, hAsync("input", { key: '6e90ec39ec856fa38097e6224c7fed50b23088e5', 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: '8fca08269e216b9a2840e7707fa5562220f8b36c', class: "thumb", "aria-hidden": "true" })), hAsync("label", { key: 'f0a0842fef8c9fa3981b6d8c373a79fe0c33fad3', htmlFor: this.toggleId }, this.label)));
|
|
9001
|
+
}
|
|
9002
|
+
static get formAssociated() { return true; }
|
|
9003
|
+
static get watchers() { return {
|
|
9004
|
+
"checked": [{
|
|
9005
|
+
"handleCheckedChange": 0
|
|
9006
|
+
}],
|
|
9007
|
+
"disabled": [{
|
|
9008
|
+
"handleDisabledChange": 0
|
|
9009
|
+
}]
|
|
9010
|
+
}; }
|
|
9011
|
+
static get style() { return lmvzToggleCss(); }
|
|
9012
|
+
static get cmpMeta() { return {
|
|
9013
|
+
"$flags$": 578,
|
|
9014
|
+
"$tagName$": "lmvz-toggle",
|
|
9015
|
+
"$members$": {
|
|
9016
|
+
"label": [1],
|
|
9017
|
+
"checked": [1540],
|
|
9018
|
+
"disabled": [516],
|
|
9019
|
+
"required": [516],
|
|
9020
|
+
"name": [1],
|
|
9021
|
+
"value": [1],
|
|
9022
|
+
"form": [1],
|
|
9023
|
+
"focusToggle": [64],
|
|
9024
|
+
"blurToggle": [64],
|
|
9025
|
+
"checkValidity": [64],
|
|
9026
|
+
"reportValidity": [64],
|
|
9027
|
+
"getInputElement": [64]
|
|
9028
|
+
},
|
|
9029
|
+
"$listeners$": undefined,
|
|
9030
|
+
"$lazyBundleId$": "-",
|
|
9031
|
+
"$attrsToReflect$": [["checked", "checked"], ["disabled", "disabled"], ["required", "required"]]
|
|
9032
|
+
}; }
|
|
9033
|
+
}
|
|
9034
|
+
|
|
8926
9035
|
registerComponents([
|
|
8927
9036
|
LmvzAction,
|
|
8928
9037
|
LmvzButton,
|
|
@@ -8934,6 +9043,7 @@ registerComponents([
|
|
|
8934
9043
|
LmvzInput,
|
|
8935
9044
|
LmvzMenuItem,
|
|
8936
9045
|
LmvzSelect,
|
|
9046
|
+
LmvzToggle,
|
|
8937
9047
|
]);
|
|
8938
9048
|
|
|
8939
9049
|
exports.hydrateApp = hydrateApp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-saW7O-EW.js";export{s as setNonce}from"./p-saW7O-EW.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-2f83d7a2",[[769,"lmvz-header",{role:[2561],lmvzActiveNav:[1,"lmvz-active-nav"]},null,{lmvzActiveNav:[{handleActiveNavChange:0}]}],[774,"lmvz-menuitem",{role:[2561],ti:[2562,"tabindex"]}]]],["p-43e295ba",[[257,"lmvz-action"]]],["p-0f7a4236",[[785,"lmvz-button",{ti:[2562,"tabindex"],scale:[513],variant:[513],disabled:[516],type:[1],form:[1]}]]],["p-d0a0e206",[[774,"lmvz-card",{cardTitle:[1,"card-title"],imageUrl:[1,"image-url"],description:[1],primaryActionLabel:[1,"primary-action-label"]}]]],["p-9f9d845d",[[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}]}]]],["p-851969bd",[[769,"lmvz-chip",{type:[1537],size:[1537]},null,{type:[{normalizeType:0}],size:[{normalizeSize:0}]}]]],["p-a12f95da",[[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}]}]]],["p-32171f4f",[[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}]}]]],["p-400b2318",[[774,"lmvz-menuitem",{role:[2561],ti:[2562,"tabindex"]}]]],["p-ab4437dc",[[774,"lmvz-select",{value:[1025],label:[1],helperText:[1,"helper-text"],disabled:[516],required:[516],name:[1],selectedLabel:[32]},null,{value:[{handleValueChange:0}]}]]]],e))));
|
|
1
|
+
import{p as e,b as a}from"./p-saW7O-EW.js";export{s as setNonce}from"./p-saW7O-EW.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-2f83d7a2",[[769,"lmvz-header",{role:[2561],lmvzActiveNav:[1,"lmvz-active-nav"]},null,{lmvzActiveNav:[{handleActiveNavChange:0}]}],[774,"lmvz-menuitem",{role:[2561],ti:[2562,"tabindex"]}]]],["p-43e295ba",[[257,"lmvz-action"]]],["p-0f7a4236",[[785,"lmvz-button",{ti:[2562,"tabindex"],scale:[513],variant:[513],disabled:[516],type:[1],form:[1]}]]],["p-d0a0e206",[[774,"lmvz-card",{cardTitle:[1,"card-title"],imageUrl:[1,"image-url"],description:[1],primaryActionLabel:[1,"primary-action-label"]}]]],["p-9f9d845d",[[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}]}]]],["p-851969bd",[[769,"lmvz-chip",{type:[1537],size:[1537]},null,{type:[{normalizeType:0}],size:[{normalizeSize:0}]}]]],["p-a12f95da",[[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}]}]]],["p-32171f4f",[[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}]}]]],["p-400b2318",[[774,"lmvz-menuitem",{role:[2561],ti:[2562,"tabindex"]}]]],["p-ab4437dc",[[774,"lmvz-select",{value:[1025],label:[1],helperText:[1,"helper-text"],disabled:[516],required:[516],name:[1],selectedLabel:[32]},null,{value:[{handleValueChange:0}]}]]],["p-c3b7890d",[[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}]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,r as t,c as o,h as r,H as a}from"./p-saW7O-EW.js";import{R as l,A as s}from"./p-GdMr6Qlp.js";import{c}from"./p-DIrAQ4IB.js";import"./p-dhVSUYqd.js";let i=0;const n=class extends l{get el(){return e(this)}get validationEl(){return this.el}internals;nativeInputElement;toggleId="lmvz-toggle-"+i++;lmvzChange;label;checked=!1;disabled=!1;required=!1;name;value="on";form;constructor(e){super(),t(this,e),this.lmvzChange=o(this,"lmvzChange"),e.$hostElement$["s-ei"]?this.internals=e.$hostElement$["s-ei"]:(this.internals=e.$hostElement$.attachInternals(),e.$hostElement$["s-ei"]=this.internals),this.addController(new s(this))}formAssociatedCallback(e){this.internals.setFormValue?.(this.checked?this.value:null)}formResetCallback(){this.checked=!1}formStateRestoreCallback(e){this.checked=e===this.value,this.internals.setFormValue?.(this.checked?this.value:null)}handleCheckedChange(e){this.internals.setFormValue?.(e?this.value:null)}handleDisabledChange(e){e&&this.nativeInputElement&&this.nativeInputElement.blur()}async focusToggle(){this.nativeInputElement?.focus()}async blurToggle(){this.nativeInputElement?.blur()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getInputElement(){return this.nativeInputElement||await new Promise((e=>c(this.el,e))),Promise.resolve(this.nativeInputElement)}handleChange=e=>{const t=e.target.checked;this.checked=t,this.lmvzChange.emit(t)};render(){return r(a,{key:"0a0f0e278a0ccd6739e7e9e82267c047efad74ad"},r("span",{key:"da93a2dd256c72171e7a423223a3738d6ca13ebb",class:"track"},r("input",{key:"6e90ec39ec856fa38097e6224c7fed50b23088e5",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:e=>this.nativeInputElement=e,onChange:this.handleChange}),r("span",{key:"8fca08269e216b9a2840e7707fa5562220f8b36c",class:"thumb","aria-hidden":"true"})),r("label",{key:"f0a0842fef8c9fa3981b6d8c373a79fe0c33fad3",htmlFor:this.toggleId},this.label))}static get formAssociated(){return!0}static get watchers(){return{checked:[{handleCheckedChange:0}],disabled:[{handleDisabledChange:0}]}}};n.style="@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-toggle-h { display: inline-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-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); cursor: pointer; background-color: transparent; user-select: none; } .sc-lmvz-toggle-h:not([disabled]):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } [checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled][checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f1f9fe); } [disabled].sc-lmvz-toggle-h { cursor: not-allowed; opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; } .track.sc-lmvz-toggle { position: relative; flex-shrink: 0; width: var(--lmvz-global-s32, 32px); height: var(--lmvz-global-s20, 20px); border-radius: var(--lmvz-semantic-border-radius-round, 999px); background-color: var(--lmvz-semantic-color-surface-input-primary, #ffffff); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); } .sc-lmvz-toggle-h:not([disabled]):hover .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } [checked].sc-lmvz-toggle-h .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-active, #0f8acc); } input.sc-lmvz-toggle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: inherit; } .sc-lmvz-toggle-h:focus-within { outline: 2px solid var(--lmvz-semantic-color-border-active, #0f8acc); outline-offset: 2px; } .thumb.sc-lmvz-toggle { position: absolute; width: var(--lmvz-global-s13, 13px); height: var(--lmvz-global-s13, 13px); border-radius: 50%; background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); top: 50%; transform: translateY(-50%); left: var(--lmvz-global-s4, 4px); transition: left 0.2s ease, background-color 0.2s ease; pointer-events: none; } [checked].sc-lmvz-toggle-h .thumb.sc-lmvz-toggle { left: calc(var(--lmvz-global-s4, 4px) + var(--lmvz-global-s11, 11px)); background-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } label.sc-lmvz-toggle { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); cursor: pointer; }";export{n as lmvz_toggle}
|