@lmvz-ds/components 0.38.0 → 0.40.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 +17 -0
- package/README.md +12 -20
- package/cjs/{directional-focus-controller-8Xd_7MHT.js → directional-focus-controller-DDnhfX5w.js} +15 -5
- package/cjs/index.cjs.js +3 -195
- package/cjs/lmvz-action-list.cjs.entry.js +2 -2
- package/cjs/lmvz-button-group.cjs.entry.js +4 -0
- package/cjs/lmvz-button_2.cjs.entry.js +1 -1
- package/cjs/lmvz-card.cjs.entry.js +1 -1
- package/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-header_2.cjs.entry.js +3 -3
- package/cjs/lmvz-message.cjs.entry.js +2 -0
- package/cjs/lmvz-popover.cjs.entry.js +1 -1
- package/cjs/lmvz-select.cjs.entry.js +2 -3
- package/cjs/lmvz-tab.cjs.entry.js +3 -3
- package/cjs/lmvz-tabs.cjs.entry.js +43 -44
- package/cjs/loader.cjs.js +1 -1
- package/cjs/public-DTgpEs1_.js +206 -0
- package/collection/components/lmvz-action-list/lmvz-action-list.css +119 -116
- package/collection/components/lmvz-button/lmvz-button.css +109 -106
- package/collection/components/lmvz-card/lmvz-card.css +106 -103
- package/collection/components/lmvz-header/lmvz-header.js +2 -2
- package/collection/components/lmvz-select/lmvz-select.css +58 -43
- package/collection/components/lmvz-select/lmvz-select.js +1 -25
- package/collection/components/lmvz-snackbar/public.js +3 -0
- package/collection/components/lmvz-tab/lmvz-tab.css +0 -13
- package/collection/components/lmvz-tab/lmvz-tab.js +10 -14
- package/collection/components/lmvz-tabs/lmvz-tabs.css +0 -5
- package/collection/components/lmvz-tabs/lmvz-tabs.js +50 -65
- package/collection/utils/aria/directional-focus-controller.js +16 -7
- package/collection/utils/icons/public.js +3 -0
- package/components/index.js +1 -1
- package/components/lmvz-action-list.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-datepicker.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-link.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-message.js +1 -1
- package/components/lmvz-modal.js +1 -1
- package/components/lmvz-popover.js +1 -1
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-snackbar.js +1 -1
- package/components/lmvz-tab.js +1 -1
- package/components/lmvz-tabs.js +1 -1
- package/components/{p-CcP_sfo8.js → p--mU29mrX.js} +1 -1
- package/components/p-BPa0FHVO.js +1 -0
- package/components/{p-SnHLBAbf.js → p-Bc5MM0zh.js} +1 -1
- package/components/p-CyDgnpOB.js +1 -0
- package/components/{p-C-pRMuMh.js → p-DIyiticz.js} +1 -1
- package/components/{p-BhALzK62.js → p-DJLdOjL4.js} +1 -1
- package/components/{p-B6bUOPCG.js → p-DSDBThqb.js} +1 -1
- package/components/p-DXhP6UeF.js +1 -0
- package/components/p-DsTgD0_a.js +1 -0
- package/components/p-DyQ1GbaN.js +1 -0
- package/components/p-niXjuPxe.js +1 -0
- package/esm/{directional-focus-controller-QukTTWBE.js → directional-focus-controller-CJ0yNC00.js} +15 -5
- package/esm/index.js +1 -197
- package/esm/lmvz-action-list.entry.js +2 -2
- package/esm/lmvz-button-group.entry.js +4 -0
- package/esm/lmvz-button_2.entry.js +1 -1
- package/esm/lmvz-card.entry.js +1 -1
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-header_2.entry.js +3 -3
- package/esm/lmvz-message.entry.js +2 -0
- package/esm/lmvz-popover.entry.js +1 -1
- package/esm/lmvz-select.entry.js +2 -3
- package/esm/lmvz-tab.entry.js +3 -3
- package/esm/lmvz-tabs.entry.js +43 -44
- package/esm/loader.js +1 -1
- package/esm/public-m6pRVUeP.js +204 -0
- package/hydrate/index.js +280 -66
- package/hydrate/index.mjs +280 -66
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/p-143e9621.entry.js +1 -0
- package/lmvz-components/p-220e455e.entry.js +1 -0
- package/lmvz-components/p-304c7554.entry.js +1 -0
- package/lmvz-components/p-316dd61a.entry.js +1 -0
- package/lmvz-components/{p-1e1dea53.entry.js → p-41286514.entry.js} +1 -1
- package/lmvz-components/p-93b781ca.entry.js +1 -0
- package/lmvz-components/p-BPa0FHVO.js +1 -0
- package/lmvz-components/p-BlkpdeQI.js +1 -0
- package/lmvz-components/p-c884c76e.entry.js +1 -0
- package/lmvz-components/p-ebad823c.entry.js +1 -0
- package/lmvz-components/p-edec4d09.entry.js +1 -0
- package/lmvz-components/p-f911691c.entry.js +1 -0
- package/manifest.json +38 -98
- package/package.json +2 -1
- package/types/components/lmvz-select/lmvz-select.d.ts +0 -1
- package/types/components/lmvz-snackbar/public.d.ts +6 -0
- package/types/components/lmvz-tab/lmvz-tab.d.ts +1 -1
- package/types/components/lmvz-tabs/lmvz-tabs.d.ts +8 -8
- package/types/components.d.ts +17 -39
- package/types/index.d.ts +5 -0
- package/types/utils/aria/directional-focus-controller.d.ts +9 -7
- package/types/utils/icons/public.d.ts +6 -0
- package/components/p-CgGqXTxQ.js +0 -1
- package/components/p-D3wobLRi.js +0 -1
- package/components/p-DfFdoFeH.js +0 -1
- package/components/p-GJaYKpHS.js +0 -1
- package/lmvz-components/p-3b7203a3.entry.js +0 -1
- package/lmvz-components/p-3fc6c3f6.entry.js +0 -1
- package/lmvz-components/p-9813a7d2.entry.js +0 -1
- package/lmvz-components/p-CHxiS3ja.js +0 -1
- package/lmvz-components/p-b5a5eb9a.entry.js +0 -1
- package/lmvz-components/p-cadd88e5.entry.js +0 -1
- package/lmvz-components/p-cebaddb0.entry.js +0 -1
- package/lmvz-components/p-d53e69de.entry.js +0 -1
- package/lmvz-components/p-db75e362.entry.js +0 -1
- package/lmvz-components/p-eb741e1f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as a,c as e,h as s,d as o,t as n}from"./p-DbBJxuBm.js";import{w as r,i}from"./p-DsT_K3_I.js";import{d as c}from"./p-
|
|
1
|
+
import{p as t,H as a,c as e,h as s,d as o,t as n}from"./p-DbBJxuBm.js";import{w as r,i}from"./p-DsT_K3_I.js";import{d as c}from"./p-DsTgD0_a.js";import{d as m}from"./p-DXhP6UeF.js";const l={success:i,warning:r,error:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzM0Nl8zODApIj4KPHBhdGggZD0iTTEyIDUuMjVWMTMuMTI1TTIyLjUgMTJDMjIuNSAxNy43OTkgMTcuNzk5IDIyLjUgMTIgMjIuNUM2LjIwMTAxIDIyLjUgMS41IDE3Ljc5OSAxLjUgMTJDMS41IDYuMjAxMDEgNi4yMDEwMSAxLjUgMTIgMS41QzE3Ljc5OSAxLjUgMjIuNSA2LjIwMTAxIDIyLjUgMTJaTTEzLjEyNSAxNi44NzVDMTMuMTI1IDE3LjQ5NjMgMTIuNjIxMyAxOCAxMiAxOEMxMS4zNzg3IDE4IDEwLjg3NSAxNy40OTYzIDEwLjg3NSAxNi44NzVDMTAuODc1IDE2LjI1MzcgMTEuMzc4NyAxNS43NSAxMiAxNS43NUMxMi42MjEzIDE1Ljc1IDEzLjEyNSAxNi4yNTM3IDEzLjEyNSAxNi44NzVaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjEuNzUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzM0Nl8zODAiPgo8cmVjdCB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},u=t(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.lmvzClose=e(this,"lmvzClose",6)}get el(){return this}animationClass="";status="success";onStatusChange(){this.applyAriaLiveAttributes()}message="";duration;priority="normal";actionLabel;lmvzClose;connectedCallback(){"undefined"!=typeof document&&this.applyAriaLiveAttributes()}async show(){this.animationClass="",requestAnimationFrame((()=>{this.animationClass="entering"}))}async hide(){this.animationClass="leaving",await new Promise((t=>{const a=setTimeout(t,300),e=()=>{clearTimeout(a),this.el.removeEventListener("animationend",e),t()};this.el.addEventListener("animationend",e)}))}applyAriaLiveAttributes(){"error"===this.status?(this.el.setAttribute("role","alert"),this.el.setAttribute("aria-live","assertive")):(this.el.setAttribute("role","status"),this.el.setAttribute("aria-live","polite")),this.el.setAttribute("aria-atomic","true")}handleActionClick=()=>{this.lmvzClose.emit({reason:"action"}),this.el.dispatchEvent(new CustomEvent("lmvzAction",{bubbles:!1,composed:!1}))};render(){return s(o,{key:"f58c7657bf5511c72930dfc54ace4af1ff7f3554",class:this.animationClass},s("lmvz-icon",{key:"8632b42b9b246bf58480fb17ca336ce5f0883845",icon:l[this.status],size:"md",weight:"bold"}),s("span",{key:"4ca56d2cdf29415c6d21cc50399dc28aebb8de99",class:"message"},this.message),this.actionLabel&&s("lmvz-button",{key:"d09043056b968421143aa180f464effcd7b781fe",variant:"tertiary",scale:"small",onLmvzActivation:this.handleActionClick},this.actionLabel))}static get watchers(){return{status:[{onStatusChange:0}]}}static get style(){return":host{position:fixed;bottom:var(--lmvz-dimension-20-16, clamp(1rem, 0.94rem + 0.26vw, 1.25rem));left:50%;transform:translateX(-50%);z-index:2147483000;width:max-content;border:1px solid transparent;border-radius:var(--lmvz-semantic-border-radius-lg, 14px);padding:var(--lmvz-dimension-12-10, clamp(0.63rem, 0.59rem + 0.13vw, 0.75rem)) var(--lmvz-dimension-14-12, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem));display:flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--lmvz-dimension-12-8, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));pointer-events:auto;font:var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router);--lmvz-component-color:var(--lmvz-semantic-color-status-on-success, #28625b);color:var(--lmvz-component-color)}:host([status='success']){background-color:var(--lmvz-semantic-color-status-success, #c2e6e1);border-color:var(--lmvz-semantic-color-status-on-success-subtle, #4eb6a9);--lmvz-component-color:var(--lmvz-semantic-color-status-on-success, #28625b)}:host([status='warning']){background-color:var(--lmvz-semantic-color-status-warning, #ffeeb8);border-color:var(--lmvz-semantic-color-status-on-warning-subtle, #e6b000);--lmvz-component-color:var(--lmvz-semantic-color-status-on-warning, #614a00)}:host([status='error']){background-color:var(--lmvz-semantic-color-status-danger, #fbdfe0);border-color:var(--lmvz-semantic-color-status-on-danger-subtle, #e8454b);--lmvz-component-color:var(--lmvz-semantic-color-status-on-danger, #a31419)}lmvz-icon{flex-shrink:0}.message{white-space:nowrap}@keyframes snackbar-enter{from{transform:translateX(-50%) translateY(100%);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}@keyframes snackbar-leave{from{transform:translateX(-50%) translateY(0);opacity:1}to{transform:translateX(-50%) translateY(100%);opacity:0}}:host(.entering){animation:snackbar-enter 200ms cubic-bezier(0, 0, 0.2, 1) forwards}:host(.leaving){pointer-events:none;animation:snackbar-leave 200ms cubic-bezier(0.4, 0, 1, 1) forwards}@media (prefers-reduced-motion: reduce){:host(.entering){animation:none;transition:opacity 80ms ease;opacity:1}:host(.leaving){pointer-events:none;animation:none;transition:opacity 80ms ease;opacity:0}}"}},[513,"lmvz-snackbar",{status:[1537],message:[1025],duration:[1026],priority:[1025],actionLabel:[1025,"action-label"],animationClass:[32],show:[64],hide:[64]},void 0,{status:[{onStatusChange:0}]}]),d=u,v=function(){"undefined"!=typeof customElements&&["lmvz-snackbar","lmvz-button","lmvz-icon"].forEach((t=>{switch(t){case"lmvz-snackbar":customElements.get(n(t))||customElements.define(n(t),u);break;case"lmvz-button":customElements.get(n(t))||c();break;case"lmvz-icon":customElements.get(n(t))||m()}}))};export{d as LmvzSnackbar,v as defineCustomElement}
|
package/components/lmvz-tab.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as a,h as t,d as o,t as r}from"./p-DbBJxuBm.js";const
|
|
1
|
+
import{p as e,H as a,h as t,d as o,t as r}from"./p-DbBJxuBm.js";const n=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}get el(){return this}mediaSlotEl;value;disabled=!1;selected=!1;panel;handleMediaSlotChange=()=>{this.el.toggleAttribute("has-media",(this.mediaSlotEl?.assignedElements()??[]).length>0)};componentDidLoad(){this.handleMediaSlotChange(),this.el.dispatchEvent(new CustomEvent("lmvzTabReady",{bubbles:!0,composed:!1}))}render(){return t(o,{key:"8fb0ddc827d31fa1669a7fdaef288be5002a7c53"},t("button",{key:"72b8f8be2f7ec7d0d2840148d48188382699d9b9",part:"button",role:"tab",disabled:this.disabled,"aria-selected":this.selected+"","aria-disabled":this.disabled?"true":void 0,tabIndex:0},t("slot",{key:"c951ae74e7b15feff7f32bc87b2e3fd46221b6b4",name:"media",ref:e=>this.mediaSlotEl=e,onSlotchange:this.handleMediaSlotChange}),t("span",{key:"8a06f3a9598bbf90819ff3644874f53b1ed9f840",class:"label"},t("slot",{key:"98217fca2371ad7b0ded79628895337603a54c2f"})),t("span",{key:"68a11cf2f3d51aa6f4b9a7d2efcce1a1bb0c7640","aria-hidden":"true",part:"indicator",class:"indicator"})))}static get delegatesFocus(){return!0}static get style(){return" @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } hr { height: 0; border: none; margin: var(--lmvz-dimension-8-4, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } fieldset { border: none; margin: 0; padding: 0; } legend { padding: 0; display: block; } } :host { display: inline-block; flex: none; } :host([disabled]) { cursor: not-allowed; pointer-events: none; } button { --lmvz-tab-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-tab-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--lmvz-component-component-spacing-0-default, 4px); padding-top: var(--lmvz-dimension-12-8, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); padding-bottom: var(--lmvz-dimension-14-8, clamp(0.5rem, 0.41rem + 0.39vw, 0.88rem)); padding-inline: var(--lmvz-dimension-24-16, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)); border: none; border-radius: var(--lmvz-semantic-border-radius-round, 999px); background: var(--lmvz-tab-background); color: var(--lmvz-tab-color); font: var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); cursor: pointer; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease; } button:focus-visible { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); z-index: 1; } button:disabled { opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; cursor: not-allowed; } button:hover { --lmvz-tab-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --lmvz-tab-color: var(--lmvz-semantic-color-int-on-secondary-hover, #000000); } button:active { --lmvz-tab-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); --lmvz-tab-color: var(--lmvz-semantic-color-int-on-secondary-active, #000000); } :host([has-media]) { --lmvz-tab-color: var(--lmvz-semantic-color-int-on-tertiary, #000000); --lmvz-tab-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); } :host([has-media]) button { padding-top: var(--lmvz-dimension-18-16, clamp(1rem, 0.97rem + 0.13vw, 1.13rem)); padding-bottom: var(--lmvz-dimension-14-12, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); padding-inline: var(--lmvz-dimension-48-40, clamp(2.5rem, 2.38rem + 0.52vw, 3rem)); border-radius: var(--lmvz-semantic-border-radius-lg, 14px); } :host([has-media]) button:hover { --lmvz-tab-color: var(--lmvz-semantic-color-int-on-tertiary-hover, #000000); } :host([has-media]) button:active { --lmvz-tab-color: var(--lmvz-semantic-color-int-on-tertiary-active, #000000); } :host([selected]) button { --lmvz-tab-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); --lmvz-tab-background: var(--lmvz-semantic-color-status-active, #f6fbfe); } :host([selected][has-media]) button:hover, :host([selected][has-media]) button:active { --lmvz-tab-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } .indicator { --lmvz-tab-indicator-size: 4px; position: absolute; background: linear-gradient(to right, var(--lmvz-semantic-color-gradient-main-1, #0e7ab4), var(--lmvz-semantic-color-gradient-main-2, #0e7ab4)); opacity: 0; transition: opacity 0.15s ease; inset-block-end: 0; inset-inline: 0; block-size: var(--lmvz-tab-indicator-size); border-start-start-radius: 0; border-start-end-radius: 0; border-end-start-radius: var(--lmvz-tab-indicator-size); border-end-end-radius: var(--lmvz-tab-indicator-size); } :host([selected][has-media]) .indicator { opacity: 1; } ::slotted(*) { --lmvz-component-color: var(--lmvz-tab-color); } ::slotted(lmvz-icon) { --lmvz-component-size: var(--lmvz-dimension-18-16, clamp(1rem, 0.97rem + 0.13vw, 1.13rem)); } :host([has-media]) ::slotted(lmvz-icon) { --lmvz-component-size: var(--lmvz-component-icon-size-lg, clamp(1.25rem, 1.19rem + 0.26vw, 1.5rem)); } .label { display: contents; } "}},[785,"lmvz-tab",{value:[513],disabled:[516],selected:[516],panel:[513]}]),i=n,l=function(){"undefined"!=typeof customElements&&["lmvz-tab"].forEach((e=>{"lmvz-tab"===e&&(customElements.get(r(e))||customElements.define(r(e),n))}))};export{i as LmvzTab,l as defineCustomElement}
|
package/components/lmvz-tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,c as e,h as s,d as
|
|
1
|
+
import{p as t,c as e,h as s,d as a,t as n}from"./p-DbBJxuBm.js";import{D as i}from"./p-DyQ1GbaN.js";import{R as l}from"./p-DXFoXTse.js";let o=0;const r=t(class extends l{get el(){return this}instanceId=++o;tabSlotEl;panelSlotEl;tablistEl;focusController=new i(this,{orientation:"horizontal",manageTabIndex:!0,enableHomeAndEnd:!0,listenerTarget:this.tablistEl});value;lmvzChange;resolvedValue;constructor(t){super(!1),!1!==t&&this.__registerHost(),this.__attachShadow(),this.lmvzChange=e(this,"lmvzChange",7),this.addController(this.focusController)}componentWillLoad(){super.componentWillLoad()}componentDidLoad(){this.tabSlotEl?.addEventListener("slotchange",this.handleTabSlotChange.bind(this)),this.panelSlotEl?.addEventListener("slotchange",this.handlePanelSlotChange.bind(this)),this.el.addEventListener("lmvzTabReady",this.handleTabReady.bind(this)),this.handleTabSlotChange(),this.tablistEl&&this.focusController.updateListenerTarget(this.tablistEl),super.componentDidLoad()}disconnectedCallback(){this.el.removeEventListener("lmvzTabReady",this.handleTabReady.bind(this)),super.disconnectedCallback()}handleSlotChangeEvent(){this.wireAriaIds(),this.applySelection(this.resolvedValue??this.value)}handleValueChange(t){this.applySelection(t)}async initFocus(){this.focusController.initFocus()}async activateTab(t){const e=this.findTabByValue(t);e&&!this.isTabDisabled(e)&&this.selectTab(t)}async getTabElements(){return this.slottedTabs}async setTabPanelIds(t){const e=this.slottedTabs,s=this.slottedPanels;t.forEach((([t,a],n)=>{const i=e[n],l=s[n],o=t+"-btn";if(i){i.id=t;const e=i.shadowRoot?.querySelector("button");e&&(e.id=o,e.setAttribute("aria-controls",a))}l&&(l.id=a,l.setAttribute("aria-labelledby",o))}))}get slottedTabs(){return(this.tabSlotEl?.assignedElements({flatten:!1})??[]).filter((t=>"lmvz-tab"===t.tagName.toLowerCase()))}get slottedPanels(){return this.panelSlotEl?.assignedElements({flatten:!1})??[]}handleTabSlotChange(){this.syncFocusTargets(),this.wireAriaIds(),this.applySelection(this.value),this.updateIconTabsAttr()}handlePanelSlotChange(){this.wireAriaIds(),this.applySelection(this.resolvedValue??this.value)}handleTabReady(){this.syncFocusTargets(),this.wireAriaIds(),this.applySelection(this.resolvedValue??this.value),this.updateIconTabsAttr()}updateIconTabsAttr(){this.el.toggleAttribute("has-icon-tabs",this.slottedTabs.some((t=>t.hasAttribute("has-media"))))}syncFocusTargets(){const t=this.slottedTabs.map((t=>t.shadowRoot?.querySelector("button"))).filter((t=>!!t));this.focusController.updateElements(t)}resolvePanelForTab(t,e,s){const a=t.getAttribute("panel");if(a){const t=s.find((t=>t.id===a));if(t)return t}return s[e]}warnIfMixedPanelLinking(t){const e=t.some((t=>t.hasAttribute("panel"))),s=t.some((t=>!t.hasAttribute("panel")));e&&s&&console.warn("[lmvz-tabs] Mixed panel linking: some lmvz-tab elements have a 'panel' attribute and some do not. Use either id-based or positional linking consistently.")}wireAriaIds(){const t=this.slottedTabs,e=this.slottedPanels,s="lmvz-tabs-"+this.instanceId;this.warnIfMixedPanelLinking(t),t.forEach(((t,a)=>{const n=t.id||`${s}-tab-${a}`;t.id=n;const i=this.resolvePanelForTab(t,a,e);if(!i)return;const l=i.id||`${s}-panel-${a}`;i.id=l;const o=t.shadowRoot?.querySelector("button");o&&(o.setAttribute("aria-controls",l),o.setAttribute("id",n+"-btn")),i.setAttribute("role",i.getAttribute("role")??"tabpanel"),i.setAttribute("aria-labelledby",n+"-btn")}))}applySelection(t){const e=this.slottedTabs;if(!e.length)return;let s=this.findTabByValue(t);if(s&&!this.isTabDisabled(s)||(s=this.findNearestEnabled(t)??void 0),!s)return;const a=s.getAttribute("value")??"";this.resolvedValue=a,this.value!==a&&(this.value=a),e.forEach((t=>{const e=t.getAttribute("value")===a;t.toggleAttribute("selected",e);const s=t.shadowRoot?.querySelector("button");s&&s.setAttribute("aria-selected",e+"")}));const n=this.slottedPanels;e.forEach(((t,e)=>{const s=this.resolvePanelForTab(t,e,n);if(!s)return;const i=t.getAttribute("value")===a;s.toggleAttribute("hidden",!i)}));const i=s.shadowRoot?.querySelector("button");i&&this.focusController.setCurrentElement(i)}isTabDisabled(t){return t.hasAttribute("disabled")||!!t.disabled}findTabByValue(t){return this.slottedTabs.find((e=>e.getAttribute("value")===t))}findNearestEnabled(t){const e=this.slottedTabs,s=e.findIndex((e=>e.getAttribute("value")===t));for(let t=1;t<e.length;t++){const a=e[(s+t)%e.length];if(a&&!this.isTabDisabled(a))return a;const n=e[(s-t+e.length)%e.length];if(n&&!this.isTabDisabled(n))return n}}selectTab(t){t!==this.resolvedValue&&(this.applySelection(t),this.lmvzChange.emit({value:t}))}handleTabClick=t=>{const e=t.target.closest("lmvz-tab");if(!e)return;const s=e.getAttribute("value");s&&!this.isTabDisabled(e)&&this.selectTab(s)};handleKeydown=t=>{if("Enter"!==t.key&&" "!==t.key)return;const e=this.el.ownerDocument.activeElement;if(!e)return;let s=null;for(const t of this.slottedTabs)if(t===e){s=t;break}if(!s)return;const a=s.getAttribute("value");a&&!this.isTabDisabled(s)&&(t.preventDefault(),this.selectTab(a))};render(){return s(a,{key:"ba02ac9a48c62590b8c986670336b04f82030ad2",onClick:this.handleTabClick,onKeydown:this.handleKeydown},s("div",{key:"c5c123997d154d676947c8a4f49149ff9e209750",role:"tablist","aria-orientation":"horizontal",class:"tablist",ref:t=>this.tablistEl=t},s("slot",{key:"7e58d17a4ec8e8300b5dfb745cb36154adc9dbcb",ref:t=>this.tabSlotEl=t})),s("div",{key:"5e3e44442e0ffb1a51fd325d545fd799d7a9d119",part:"panels-container",class:"panels-container"},s("slot",{key:"a6208761b4422a297a58b863fff22843221644bd",name:"panels",ref:t=>this.panelSlotEl=t})))}static get watchers(){return{value:[{handleValueChange:0}]}}static get style(){return" @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } hr { height: 0; border: none; margin: var(--lmvz-dimension-8-4, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } fieldset { border: none; margin: 0; padding: 0; } legend { padding: 0; display: block; } } :host { display: inline-block; } .tablist { display: inline-flex; flex-direction: row; background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); border-radius: var(--lmvz-semantic-border-radius-round, 999px); overflow: auto hidden; scrollbar-width: none; } .tablist::-webkit-scrollbar { display: none; } :host([has-icon-tabs]) .tablist { gap: var(--lmvz-dimension-8-6, clamp(0.38rem, 0.34rem + 0.13vw, 0.5rem)); background: none; border-radius: 0; } ::slotted([role='tabpanel']) { display: block; } ::slotted([role='tabpanel'][hidden]) { display: none; } "}},[769,"lmvz-tabs",{value:[1537],resolvedValue:[32],initFocus:[64],activateTab:[64],getTabElements:[64],setTabPanelIds:[64]},[[0,"slotchange","handleSlotChangeEvent"]],{value:[{handleValueChange:0}]}]),h=r,d=function(){"undefined"!=typeof customElements&&["lmvz-tabs"].forEach((t=>{"lmvz-tabs"===t&&(customElements.get(n(t))||customElements.define(n(t),r))}))};export{h as LmvzTabs,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as t}from"./p-DJLdOjL4.js";import{r as i,g as s}from"./p-DXFoXTse.js";class n{host;config;handlers=new AbortController;constructor(t,s){this.host=t,this.config=s,i(t.el,"isLmvzElementActivationHost",!0)}hostDidLoad(){o(this.host.el,this.handleActivation.bind(this),this.handlers.signal,this.config?.keys??["Enter"," "])}hostDisconnected(){this.handlers.abort()}handleActivation=t=>{this.host.lmvzActivation.emit(),this.config?.localHandler&&this.config.localHandler(t)}}function o(t,i,s,n=[" "]){t.addEventListener("keydown",function(t,i=[" "]){return s=>{i.includes(s.key)&&(s.preventDefault(),t(s))}}(i,n),{signal:s}),t.addEventListener("click",i,{signal:s})}function e(...[i,n,e,a]){s(i,"isLmvzElementActivationHost")?i.addEventListener("lmvzActivation",n,{signal:e}):t(i)?o(i,n,e,a):console.error("addElementActivationListener called with non-interactive element")}export{n as E,e as a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t}from"./p-CyDgnpOB.js";const s={low:0,normal:1,high:2},i={success:5e3,warning:5e3,error:8e3};let o=0;function e(){return o+=1,`snackbar-${o}`}class n{hostEl=void 0;active=void 0;getHost(){return void 0===this.hostEl||this.hostEl.isConnected||(this.hostEl=void 0),void 0===this.hostEl&&(this.hostEl=function(){if("undefined"==typeof document)return;const t=document.querySelector("[data-snackbar-host]");if(t)return t;const s=document.createElement("lmvz-snackbar");return s.setAttribute("data-snackbar-host",""),document.body.appendChild(s),s}()),this.hostEl}clearTimer(t){void 0!==t.timerId&&(clearTimeout(t.timerId),t.timerId=void 0)}scheduleTimer(t,s){s<=0||(t.timerStartedAt=Date.now(),t.timerId=setTimeout((()=>{void 0!==this.active&&this.active.id===t.id&&this.dismissActive(t,"timeout")}),s))}dismissActive(t,s){this.clearTimer(t);const i=t.hostEl;i.removeEventListener("pointerenter",t.onPointerEnter),i.removeEventListener("pointerleave",t.onPointerLeave),i.removeEventListener("focusin",t.onFocusIn),i.removeEventListener("focusout",t.onFocusOut),t.onActionListener&&i.removeEventListener("lmvzAction",t.onActionListener),i.hide?.(),this.active?.id===t.id&&(this.active=void 0),"action"!==s&&i.dispatchEvent(new CustomEvent("lmvzClose",{detail:{reason:s},bubbles:!0,composed:!0})),t.resolve({reason:s})}pauseTimer(t){if(t.pauseCount+=1,t.pauseCount>1||void 0===t.timerId)return;const s=void 0!==t.timerStartedAt?Date.now()-t.timerStartedAt:0;t.remaining=Math.max(0,t.remaining-s),t.timerStartedAt=void 0,this.clearTimer(t)}resumeTimer(t){t.pauseCount>0&&(t.pauseCount-=1),t.pauseCount>0||t.remaining>0&&this.scheduleTimer(t,t.remaining)}applyToHost(t,s){t.setAttribute("status",s.status??"success"),void 0!==s.actionLabel?t.setAttribute("action-label",s.actionLabel):t.removeAttribute("action-label")}open(t){const o=s[t.priority??"normal"];if(void 0!==this.active&&o<this.active.priority){let t;const s=new Promise((s=>{t=s}));return t({reason:"swallowed"}),{id:e(),closed:s,dismiss(){}}}void 0!==this.active&&this.dismissActive(this.active,"overridden");const n=this.getHost();if(void 0===n){const t=e();let s;const i=new Promise((t=>{s=t}));return s({reason:"swallowed"}),{id:t,closed:i,dismiss(){}}}const r=e(),c=0===t.duration?0:t.duration??i[t.status??"success"];let a;const d=new Promise((t=>{a=t})),h={id:r,priority:o,resolve:a,timerId:void 0,remaining:c,timerStartedAt:void 0,pauseCount:0,hostEl:n,onPointerEnter:()=>this.pauseTimer(h),onPointerLeave:()=>this.resumeTimer(h),onFocusIn:()=>this.pauseTimer(h),onFocusOut:()=>this.resumeTimer(h)};this.active=h,n.addEventListener("pointerenter",h.onPointerEnter),n.addEventListener("pointerleave",h.onPointerLeave),n.addEventListener("focusin",h.onFocusIn),n.addEventListener("focusout",h.onFocusOut),this.applyToHost(n,t);const u=()=>{void 0!==this.active&&this.active.id===r&&(t.onAction?.(),this.dismissActive(h,"action"))};return h.onActionListener=u,n.addEventListener("lmvzAction",u,{once:!0}),n.show?.(),queueMicrotask((()=>n.setAttribute("message",t.message))),c>0&&this.scheduleTimer(h,c),{id:r,closed:d,dismiss:()=>{this.active?.id===r&&this.dismissActive(h,"manual")}}}dismiss(t){this.active&&(t&&this.active.id!==t||this.dismissActive(this.active,"manual"))}}window.LmvzApi??={},window.LmvzApi.SnackbarController=n,window.LmvzApi??={},window.LmvzApi.typedIconFromSet=t;export{n as S}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,c as n,h as o,d as r,t as i}from"./p-DbBJxuBm.js";import{i as a}from"./p-BDonpCG8.js";import{i as s}from"./p-GJaYKpHS.js";import{a as l}from"./p-CcP_sfo8.js";import{w as c,a as u}from"./p-DZj20TV1.js";import{d as f,g as d,j as p,w as h,k as m,h as v}from"./p-BhALzK62.js";const y=Math.min,g=Math.max,w=Math.round,x=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"};function z(t,e,n){return g(t,y(e,n))}function A(t,e){return"function"==typeof t?t(e):t}function C(t){return t.split("-")[0]}function k(t){return t.split("-")[1]}function E(t){return"x"===t?"y":"x"}function S(t){return"y"===t?"height":"width"}function F(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function R(t){return E(F(t))}function D(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const O=["left","right"],P=["right","left"],j=["top","bottom"],L=["bottom","top"];function B(t){const e=C(t);return b[e]+t.slice(e.length)}function T(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function M(t,e,n){let{reference:o,floating:r}=t;const i=F(e),a=R(e),s=S(a),l=C(e),c="y"===i,u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(k(e)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1)}return p}async function $(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=A(e,t),h=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),m=s[d?"floating"===f?"reference":"floating":f],v=T(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===f?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),w=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},x=T(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-x.top+h.top)/w.y,bottom:(x.bottom-v.bottom+h.bottom)/w.y,left:(v.left-x.left+h.left)/w.x,right:(x.right-v.right+h.right)/w.x}}const H=new Set(["left","top"]);function N(){return"undefined"!=typeof window}function G(t){return V(t)?(t.nodeName||"").toLowerCase():"#document"}function J(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function K(t){var e;return null==(e=(V(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function V(t){return!!N()&&(t instanceof Node||t instanceof J(t).Node)}function Y(t){return!!N()&&(t instanceof Element||t instanceof J(t).Element)}function _(t){return!!N()&&(t instanceof HTMLElement||t instanceof J(t).HTMLElement)}function I(t){return!(!N()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof J(t).ShadowRoot)}function X(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=rt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==r&&"contents"!==r}function Z(t){return/^(table|td|th)$/.test(G(t))}function q(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const Q=/transform|translate|scale|rotate|perspective|filter/,U=/paint|layout|strict|content/,W=t=>!!t&&"none"!==t;let tt;function et(t){const e=Y(t)?rt(t):t;return W(e.transform)||W(e.translate)||W(e.scale)||W(e.rotate)||W(e.perspective)||!nt()&&(W(e.backdropFilter)||W(e.filter))||Q.test(e.willChange||"")||U.test(e.contain||"")}function nt(){return null==tt&&(tt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tt}function ot(t){return/^(html|body|#document)$/.test(G(t))}function rt(t){return J(t).getComputedStyle(t)}function it(t){return Y(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function at(t){if("html"===G(t))return t;const e=t.assignedSlot||t.parentNode||I(t)&&t.host||K(t);return I(e)?e.host:e}function st(t){const e=at(t);return ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&X(e)?e:st(e)}function lt(t,e){var n;void 0===e&&(e=[]);const o=st(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),i=J(o);return r?e.concat(i,i.visualViewport||[],X(o)?o:[],[]):e.concat(o,lt(o,[]))}function ct(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ut(t){const e=rt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=_(t),i=r?t.offsetWidth:n,a=r?t.offsetHeight:o,s=w(n)!==i||w(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function ft(t){return Y(t)?t:t.contextElement}function dt(t){const e=ft(t);if(!_(e))return x(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ut(e);let a=(i?w(n.width):n.width)/o,s=(i?w(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const pt=x(0);function ht(t){const e=J(t);return nt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:pt}function mt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=ft(t);let a=x(1);e&&(o?Y(o)&&(a=dt(o)):a=dt(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==J(t))&&e}(i,n,o)?ht(i):x(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,f=r.height/a.y;if(i){const t=J(i),e=o&&Y(o)?J(o):o;let n=t,r=ct(n);for(;r&&o&&e!==n;){const t=dt(r),e=r.getBoundingClientRect(),o=rt(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,a=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,f*=t.y,l+=i,c+=a,n=J(r),r=ct(n)}}return T({width:u,height:f,x:l,y:c})}function vt(t,e){const n=it(t).scrollLeft;return e?e.left+n:mt(K(t)).left+n}function yt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-vt(t,n),y:n.top+e.scrollTop}}function gt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=J(t),o=K(t),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const t=nt();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}const c=vt(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-e.clientWidth-r);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=K(t),n=it(t),o=t.ownerDocument.body,r=g(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=g(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+vt(t);const s=-n.scrollTop;return"rtl"===rt(o).direction&&(a+=g(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(K(t));else if(Y(e))o=function(t,e){const n=mt(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?dt(t):x(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=ht(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return T(o)}function wt(t,e){const n=at(t);return!(n===e||!Y(n)||ot(n))&&("fixed"===rt(n).position||wt(n,e))}function xt(t,e,n){const o=_(e),r=K(e),i="fixed"===n,a=mt(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const l=x(0);function c(){l.x=vt(r)}if(o||!o&&!i)if(("body"!==G(e)||X(r))&&(s=it(e)),o){const t=mt(e,!0,i,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&c();i&&!o&&r&&c();const u=!r||o||i?x(0):yt(r,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function bt(t){return"static"===rt(t).position}function zt(t,e){if(!_(t)||"fixed"===rt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return K(t)===n&&(n=n.ownerDocument.body),n}function At(t,e){const n=J(t);if(q(t))return n;if(!_(t)){let e=at(t);for(;e&&!ot(e);){if(Y(e)&&!bt(e))return e;e=at(e)}return n}let o=zt(t,e);for(;o&&Z(o)&&bt(o);)o=zt(o,e);return o&&ot(o)&&bt(o)&&!et(o)?n:o||function(t){let e=at(t);for(;_(e)&&!ot(e);){if(et(e))return e;if(q(e))return null;e=at(e)}return null}(t)||n}const Ct={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i="fixed"===r,a=K(o),s=!!e&&q(e.floating);if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=x(1);const u=x(0),f=_(o);if((f||!f&&!i)&&(("body"!==G(o)||X(a))&&(l=it(o)),f)){const t=mt(o);c=dt(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!a||f||i?x(0):yt(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}},getDocumentElement:K,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===n?q(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=lt(t,[]).filter((t=>Y(t)&&"body"!==G(t))),r=null;const i="fixed"===rt(t).position;let a=i?at(t):t;for(;Y(a)&&!ot(a);){const e=rt(a),n=et(a);n||"fixed"!==e.position||(r=null),(i?!n&&!r:!n&&"static"===e.position&&r&&("absolute"===r.position||"fixed"===r.position)||X(a)&&!n&&wt(t,a))?o=o.filter((t=>t!==a)):r=e,a=at(a)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=gt(e,i[0],r);let s=a.top,l=a.right,c=a.bottom,u=a.left;for(let t=1;t<i.length;t++){const n=gt(e,i[t],r);s=g(n.top,s),l=y(n.right,l),c=y(n.bottom,c),u=g(n.left,u)}return{width:l-u,height:c-s,x:u,y:s}},getOffsetParent:At,getElementRects:async function(t){const e=this.getOffsetParent||At,n=this.getDimensions,o=await n(t.floating);return{reference:xt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ut(t);return{width:e,height:n}},getScale:dt,isElement:Y,isRTL:function(t){return"rtl"===rt(t).direction}},kt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=A(t,e),u={x:n,y:o},f=await i.detectOverflow(e,c),d=F(C(r)),p=E(d);let h=u[p],m=u[d];a&&(h=z(h+f["y"===p?"top":"left"],h,h-f["y"===p?"bottom":"right"])),s&&(m=z(m+f["y"===d?"top":"left"],m,m-f["y"===d?"bottom":"right"]));const v=l.fn({...e,[p]:h,[d]:m});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[p]:a,[d]:s}}}}}},Et=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=A(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=C(r),g=F(s),w=C(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=d||(w||!m?[B(s)]:function(t){const e=B(t);return[D(t),e,D(e)]}(s)),z="none"!==h;!d&&z&&b.push(...function(t,e,n,o){const r=k(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?P:O:e?O:P;case"left":case"right":return e?j:L;default:return[]}}(C(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(D)))),i}(s,m,h,x));const E=[s,...b],T=await l.detectOverflow(e,v),M=[];let $=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&M.push(T[y]),f){const t=function(t,e,n){void 0===n&&(n=!1);const o=k(t),r=R(t),i=S(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=B(a)),[a,B(a)]}(r,a,x);M.push(T[t[0]],T[t[1]])}if($=[...$,{placement:r,overflows:M}],!M.every((t=>t<=0))){var H,N;const t=((null==(H=i.flip)?void 0:H.index)||0)+1,e=E[t];if(e&&("alignment"!==f||g===F(e)||$.every((t=>F(t.placement)!==g||t.overflows[0]>0))))return{data:{index:t,overflows:$},reset:{placement:e}};let n=null==(N=$.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var G;const t=null==(G=$.filter((t=>{if(z){const e=F(t.placement);return e===g||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:G[0];t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},St=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.lmvzOpen=n(this,"lmvzOpen",7),this.lmvzClose=n(this,"lmvzClose",7),this.lmvzCancel=n(this,"lmvzCancel",7)}get el(){return this}extEventController=new AbortController;closureController;containerEl;slotEl;previouslyFocusedElement=null;anchorEl;open=!1;anchor;placement="bottom-start";size="sm";autoFocus=!0;containerRole="dialog";label;lmvzOpen;lmvzClose;lmvzCancel;async show(){this.open=!0}async hide(){this.triggerClose()}async toggle(){this.open?await this.hide():await this.show()}componentDidLoad(){Rt(this.el)}handleOpenChange(t){t?this.onOpen():this.onClose()}async handleAnchorChange(t){if(!t)return console.warn("anchor property missing for popover",this.el?.id),void(this.anchor=void 0);await c(),this.anchorEl="string"==typeof t?document.getElementById(t):t,this.setupAnchorEl(),this.open&&this.updatePosition()}disconnectedCallback(){this.removeCloseHandlers(),this.extEventController.abort()}setupAnchorEl(){const{anchorEl:t}=this;t?(t.hasAttribute("aria-haspopup")||t.setAttribute("aria-haspopup","dialog"===this.containerRole?"dialog":this.containerRole),t.setAttribute("aria-controls",this.el.getAttribute("id")),t.hasAttribute("aria-expanded")||t.setAttribute("aria-expanded",this.open?"true":"false"),f(t)&&l(t,this.toggle.bind(this),this.extEventController.signal),function(t,e,n,o){if(!a())return;const r=!!e,i=t.hasAttribute("aria-labelledby");r||i||console.warn("[lmvz-popover] Host element has no accessible label. Provide a `label` prop or an `aria-labelledby` attribute pointing to a valid element."),n&&(o?m(o)||console.warn("[lmvz-popover] Anchor element is not interactive. Ensure the anchor is a button, link, input, select, textarea, has a `tabindex` attribute, or has an ARIA role that implies interactivity (button, link, menuitem, option, combobox, listbox, checkbox, radio, switch, tab)."):console.warn("[lmvz-popover] Anchor prop is set but resolved to null. Ensure the anchor element exists in the DOM when the component loads."))}(this.el,this.label,this.anchor,t)):console.warn("no anchor element set for",this)}async updatePosition(){const{anchorEl:t}=this,e=this.containerEl;if(!t||!e)return;const n=function(t){return"start"===t?"left":"end"===t?"right":t}(this.placement),{x:o,y:r}=await((t,e,n)=>{const o=new Map,r={platform:Ct,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:$},l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=M(c,o,l),d=o,p=0;const h={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:v,fn:y}=m,{x:g,y:w,data:x,reset:b}=await y({x:u,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});u=null!=g?g:u,f=null!=w?w:f,h[v]={...h[v],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):b.rects),({x:u,y:f}=M(c,d,l))),n=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:h}})(t,e,{...r,platform:i})})(t,e,{placement:n,middleware:[(i=4,void 0===i&&(i=0),{name:"offset",options:i,async fn(t){var e,n;const{x:o,y:r,placement:a,middlewareData:s}=t,l=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=C(n),s=k(n),l="y"===F(n),c=H.has(a)?-1:1,u=i&&l?-1:1,f=A(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,i);return a===(null==(e=s.offset)?void 0:e.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:a}}}}),Et(),kt({padding:8})]});var i;e.style.left=`${o}px`,e.style.top=`${r}px`}async onOpen(){this.previouslyFocusedElement=d(document),this.setupCloseHandlers(),await u(),await this.updatePosition(),Rt(this.el),this.applyAnchorAriaOpen(),this.lmvzOpen.emit(),await u(),this.autoFocus&&"dialog"===this.containerRole&&this.focusFirst()}onClose(){this.removeCloseHandlers(),this.applyAnchorAriaClose(),this.restoreFocus(),this.lmvzClose.emit()}applyAnchorAriaOpen(){this.anchorEl&&this.anchorEl.setAttribute("aria-expanded","true")}applyAnchorAriaClose(){this.anchorEl&&this.anchorEl.setAttribute("aria-expanded","false")}focusFirst(){const{slotEl:t}=this;if(!t)return;const e=t.assignedElements({flatten:!0});for(const t of e){if(!p(t))continue;if(s(t))return void t.initFocus();const e=h(t,v);if(e)return void e.focus()}}restoreFocus(){const t=this.previouslyFocusedElement;t?.isConnected&&t.focus(),this.previouslyFocusedElement=null}triggerClose(){this.lmvzCancel.emit().defaultPrevented||(this.open=!1)}setupCloseHandlers(){this.closureController=new AbortController;const t={signal:this.closureController.signal};document.addEventListener("mousedown",(t=>{if(!this.open)return;const e=(t.target?.shadowRoot??document).elementFromPoint(t.x,t.y)??t.target;this.el===t.target||this.el.contains(e)||this.el.contains(t.target)||this.triggerClose()}),t),document.addEventListener("keydown",(t=>{this.open&&"Escape"===t.key&&this.triggerClose()}),t)}removeCloseHandlers(){this.closureController?.abort()}render(){return o(r,{key:"83529aeac05cdc706193fa8bbbcc8f8672756111",role:this.containerRole,"aria-label":this.label||void 0},o("div",{key:"97c255e788806c0dec2f4ed04c6fc815150912a2",part:"container",class:`container lmvz-wrapper-card-${this.size}`,ref:t=>this.containerEl=t},o("slot",{key:"e4ea69d179557e7d34f1475c07c9284ea8d10a67",ref:t=>this.slotEl=t})))}static get watchers(){return{open:[{handleOpenChange:0}],anchor:[{handleAnchorChange:1}]}}static get style(){return"@layer lmvz-ds.reset,lmvz-ds.theme,lmvz-ds.components,lmvz-ds.overrides; @layer lmvz-ds.components{.lmvz-wrapper-card-sm,.lmvz-wrapper-card-md,.lmvz-wrapper-card-lg{background:var(--lmvz-semantic-color-surface-primary, #ffffff);box-shadow:var(--lmvz-ds-shadow-l3-default-strong, 0 2px 32px 0 rgba(120, 120, 128, 0.11))}.lmvz-wrapper-card-sm{padding:var(--lmvz-component-wrapper-sm-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)) var(--lmvz-component-wrapper-sm-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));border-radius:var(--lmvz-component-wrapper-sm-border-radius, 14px)}.lmvz-wrapper-card-md{padding:var(--lmvz-component-wrapper-md-padding-y, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)) var(--lmvz-component-wrapper-md-padding-x, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));border-radius:var(--lmvz-component-wrapper-md-border-radius, 18px)}.lmvz-wrapper-card-lg{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)}}:host{--lmvz-popover-z-index-internal:var(--lmvz-popover-z-index, 100);display:contents;.container{position:absolute;top:-9999999999px;left:-9999999999px;max-width:var(--lmvz-popover-max-width, none);max-height:var(--lmvz-popover-max-height, none);z-index:var(--lmvz-popover-z-index-internal);overflow:auto;box-sizing:border-box}}:host(:not([open])){display:none}"}},[769,"lmvz-popover",{open:[1540],anchor:[1],placement:[1],size:[1],autoFocus:[4,"auto-focus"],containerRole:[1,"container-role"],label:[1],anchorEl:[32],show:[64],hide:[64],toggle:[64]},void 0,{open:[{handleOpenChange:0}],anchor:[{handleAnchorChange:1}]}]);let Ft=0;function Rt(t){t.getAttribute("id")||t.setAttribute("id","lmvz-popover-"+Ft++)}function Dt(){"undefined"!=typeof customElements&&["lmvz-popover"].forEach((t=>{"lmvz-popover"===t&&(customElements.get(i(t))||customElements.define(i(t),St))}))}export{St as L,Dt as d}
|
|
1
|
+
import{p as t,H as e,c as n,h as o,d as r,t as i}from"./p-DbBJxuBm.js";import{i as a}from"./p-BDonpCG8.js";import{i as s}from"./p-DyQ1GbaN.js";import{a as l}from"./p--mU29mrX.js";import{w as c,a as u}from"./p-DZj20TV1.js";import{h as f,g as d,m as p,w as m,b as h,l as v}from"./p-DJLdOjL4.js";const y=Math.min,g=Math.max,w=Math.round,x=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"};function z(t,e,n){return g(t,y(e,n))}function A(t,e){return"function"==typeof t?t(e):t}function C(t){return t.split("-")[0]}function E(t){return t.split("-")[1]}function k(t){return"x"===t?"y":"x"}function S(t){return"y"===t?"height":"width"}function D(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function F(t){return k(D(t))}function O(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const R=["left","right"],j=["right","left"],L=["top","bottom"],P=["bottom","top"];function T(t){const e=C(t);return b[e]+t.slice(e.length)}function B(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function M(t,e,n){let{reference:o,floating:r}=t;const i=D(e),a=F(e),s=S(a),l=C(e),c="y"===i,u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(E(e)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1)}return p}async function $(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=A(e,t),m=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),h=s[d?"floating"===f?"reference":"floating":f],v=B(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===f?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),w=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},x=B(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-x.top+m.top)/w.y,bottom:(x.bottom-v.bottom+m.bottom)/w.y,left:(v.left-x.left+m.left)/w.x,right:(x.right-v.right+m.right)/w.x}}const H=new Set(["left","top"]);function N(){return"undefined"!=typeof window}function G(t){return X(t)?(t.nodeName||"").toLowerCase():"#document"}function J(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function V(t){var e;return null==(e=(X(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function X(t){return!!N()&&(t instanceof Node||t instanceof J(t).Node)}function I(t){return!!N()&&(t instanceof Element||t instanceof J(t).Element)}function Q(t){return!!N()&&(t instanceof HTMLElement||t instanceof J(t).HTMLElement)}function U(t){return!(!N()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof J(t).ShadowRoot)}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=rt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==r&&"contents"!==r}function Z(t){return/^(table|td|th)$/.test(G(t))}function _(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const q=/transform|translate|scale|rotate|perspective|filter/,K=/paint|layout|strict|content/,W=t=>!!t&&"none"!==t;let tt;function et(t){const e=I(t)?rt(t):t;return W(e.transform)||W(e.translate)||W(e.scale)||W(e.rotate)||W(e.perspective)||!nt()&&(W(e.backdropFilter)||W(e.filter))||q.test(e.willChange||"")||K.test(e.contain||"")}function nt(){return null==tt&&(tt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tt}function ot(t){return/^(html|body|#document)$/.test(G(t))}function rt(t){return J(t).getComputedStyle(t)}function it(t){return I(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function at(t){if("html"===G(t))return t;const e=t.assignedSlot||t.parentNode||U(t)&&t.host||V(t);return U(e)?e.host:e}function st(t){const e=at(t);return ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&Y(e)?e:st(e)}function lt(t,e){var n;void 0===e&&(e=[]);const o=st(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),i=J(o);return r?e.concat(i,i.visualViewport||[],Y(o)?o:[],[]):e.concat(o,lt(o,[]))}function ct(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ut(t){const e=rt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=Q(t),i=r?t.offsetWidth:n,a=r?t.offsetHeight:o,s=w(n)!==i||w(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function ft(t){return I(t)?t:t.contextElement}function dt(t){const e=ft(t);if(!Q(e))return x(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ut(e);let a=(i?w(n.width):n.width)/o,s=(i?w(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const pt=x(0);function mt(t){const e=J(t);return nt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:pt}function ht(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=ft(t);let a=x(1);e&&(o?I(o)&&(a=dt(o)):a=dt(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==J(t))&&e}(i,n,o)?mt(i):x(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,f=r.height/a.y;if(i){const t=J(i),e=o&&I(o)?J(o):o;let n=t,r=ct(n);for(;r&&o&&e!==n;){const t=dt(r),e=r.getBoundingClientRect(),o=rt(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,a=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,f*=t.y,l+=i,c+=a,n=J(r),r=ct(n)}}return B({width:u,height:f,x:l,y:c})}function vt(t,e){const n=it(t).scrollLeft;return e?e.left+n:ht(V(t)).left+n}function yt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-vt(t,n),y:n.top+e.scrollTop}}function gt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=J(t),o=V(t),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const t=nt();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}const c=vt(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-e.clientWidth-r);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=V(t),n=it(t),o=t.ownerDocument.body,r=g(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=g(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+vt(t);const s=-n.scrollTop;return"rtl"===rt(o).direction&&(a+=g(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(V(t));else if(I(e))o=function(t,e){const n=ht(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=Q(t)?dt(t):x(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=mt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return B(o)}function wt(t,e){const n=at(t);return!(n===e||!I(n)||ot(n))&&("fixed"===rt(n).position||wt(n,e))}function xt(t,e,n){const o=Q(e),r=V(e),i="fixed"===n,a=ht(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const l=x(0);function c(){l.x=vt(r)}if(o||!o&&!i)if(("body"!==G(e)||Y(r))&&(s=it(e)),o){const t=ht(e,!0,i,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&c();i&&!o&&r&&c();const u=!r||o||i?x(0):yt(r,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function bt(t){return"static"===rt(t).position}function zt(t,e){if(!Q(t)||"fixed"===rt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return V(t)===n&&(n=n.ownerDocument.body),n}function At(t,e){const n=J(t);if(_(t))return n;if(!Q(t)){let e=at(t);for(;e&&!ot(e);){if(I(e)&&!bt(e))return e;e=at(e)}return n}let o=zt(t,e);for(;o&&Z(o)&&bt(o);)o=zt(o,e);return o&&ot(o)&&bt(o)&&!et(o)?n:o||function(t){let e=at(t);for(;Q(e)&&!ot(e);){if(et(e))return e;if(_(e))return null;e=at(e)}return null}(t)||n}const Ct={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i="fixed"===r,a=V(o),s=!!e&&_(e.floating);if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=x(1);const u=x(0),f=Q(o);if((f||!f&&!i)&&(("body"!==G(o)||Y(a))&&(l=it(o)),f)){const t=ht(o);c=dt(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!a||f||i?x(0):yt(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}},getDocumentElement:V,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===n?_(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=lt(t,[]).filter((t=>I(t)&&"body"!==G(t))),r=null;const i="fixed"===rt(t).position;let a=i?at(t):t;for(;I(a)&&!ot(a);){const e=rt(a),n=et(a);n||"fixed"!==e.position||(r=null),(i?!n&&!r:!n&&"static"===e.position&&r&&("absolute"===r.position||"fixed"===r.position)||Y(a)&&!n&&wt(t,a))?o=o.filter((t=>t!==a)):r=e,a=at(a)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=gt(e,i[0],r);let s=a.top,l=a.right,c=a.bottom,u=a.left;for(let t=1;t<i.length;t++){const n=gt(e,i[t],r);s=g(n.top,s),l=y(n.right,l),c=y(n.bottom,c),u=g(n.left,u)}return{width:l-u,height:c-s,x:u,y:s}},getOffsetParent:At,getElementRects:async function(t){const e=this.getOffsetParent||At,n=this.getDimensions,o=await n(t.floating);return{reference:xt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ut(t);return{width:e,height:n}},getScale:dt,isElement:I,isRTL:function(t){return"rtl"===rt(t).direction}},Et=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=A(t,e),u={x:n,y:o},f=await i.detectOverflow(e,c),d=D(C(r)),p=k(d);let m=u[p],h=u[d];a&&(m=z(m+f["y"===p?"top":"left"],m,m-f["y"===p?"bottom":"right"])),s&&(h=z(h+f["y"===d?"top":"left"],h,h-f["y"===d?"bottom":"right"]));const v=l.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[p]:a,[d]:s}}}}}},kt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=A(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=C(r),g=D(s),w=C(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=d||(w||!h?[T(s)]:function(t){const e=T(t);return[O(t),e,O(e)]}(s)),z="none"!==m;!d&&z&&b.push(...function(t,e,n,o){const r=E(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?j:R:e?R:j;case"left":case"right":return e?L:P;default:return[]}}(C(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(O)))),i}(s,h,m,x));const k=[s,...b],B=await l.detectOverflow(e,v),M=[];let $=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&M.push(B[y]),f){const t=function(t,e,n){void 0===n&&(n=!1);const o=E(t),r=F(t),i=S(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=T(a)),[a,T(a)]}(r,a,x);M.push(B[t[0]],B[t[1]])}if($=[...$,{placement:r,overflows:M}],!M.every((t=>t<=0))){var H,N;const t=((null==(H=i.flip)?void 0:H.index)||0)+1,e=k[t];if(e&&("alignment"!==f||g===D(e)||$.every((t=>D(t.placement)!==g||t.overflows[0]>0))))return{data:{index:t,overflows:$},reset:{placement:e}};let n=null==(N=$.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var G;const t=null==(G=$.filter((t=>{if(z){const e=D(t.placement);return e===g||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:G[0];t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},St=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.lmvzOpen=n(this,"lmvzOpen",7),this.lmvzClose=n(this,"lmvzClose",7),this.lmvzCancel=n(this,"lmvzCancel",7)}get el(){return this}extEventController=new AbortController;closureController;containerEl;slotEl;previouslyFocusedElement=null;anchorEl;open=!1;anchor;placement="bottom-start";size="sm";autoFocus=!0;containerRole="dialog";label;lmvzOpen;lmvzClose;lmvzCancel;async show(){this.open=!0}async hide(){this.triggerClose()}async toggle(){this.open?await this.hide():await this.show()}componentDidLoad(){Ft(this.el)}handleOpenChange(t){t?this.onOpen():this.onClose()}async handleAnchorChange(t){if(!t)return console.warn("anchor property missing for popover",this.el?.id),void(this.anchor=void 0);await c(),this.anchorEl="string"==typeof t?document.getElementById(t):t,this.setupAnchorEl(),this.open&&this.updatePosition()}disconnectedCallback(){this.removeCloseHandlers(),this.extEventController.abort()}setupAnchorEl(){const{anchorEl:t}=this;t?(t.hasAttribute("aria-haspopup")||t.setAttribute("aria-haspopup","dialog"===this.containerRole?"dialog":this.containerRole),t.setAttribute("aria-controls",this.el.getAttribute("id")),t.hasAttribute("aria-expanded")||t.setAttribute("aria-expanded",this.open?"true":"false"),f(t)&&l(t,this.toggle.bind(this),this.extEventController.signal),function(t,e,n,o){if(!a())return;const r=!!e,i=t.hasAttribute("aria-labelledby");r||i||console.warn("[lmvz-popover] Host element has no accessible label. Provide a `label` prop or an `aria-labelledby` attribute pointing to a valid element."),n&&(o?h(o)||console.warn("[lmvz-popover] Anchor element is not interactive. Ensure the anchor is a button, link, input, select, textarea, has a `tabindex` attribute, or has an ARIA role that implies interactivity (button, link, menuitem, option, combobox, listbox, checkbox, radio, switch, tab)."):console.warn("[lmvz-popover] Anchor prop is set but resolved to null. Ensure the anchor element exists in the DOM when the component loads."))}(this.el,this.label,this.anchor,t)):console.warn("no anchor element set for",this)}async updatePosition(){const{anchorEl:t}=this,e=this.containerEl;if(!t||!e)return;const n=function(t){return"start"===t?"left":"end"===t?"right":t}(this.placement),{x:o,y:r}=await((t,e,n)=>{const o=new Map,r={platform:Ct,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:$},l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=M(c,o,l),d=o,p=0;const m={};for(let n=0;n<i.length;n++){const h=i[n];if(!h)continue;const{name:v,fn:y}=h,{x:g,y:w,data:x,reset:b}=await y({x:u,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:m,rects:c,platform:s,elements:{reference:t,floating:e}});u=null!=g?g:u,f=null!=w?w:f,m[v]={...m[v],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):b.rects),({x:u,y:f}=M(c,d,l))),n=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:m}})(t,e,{...r,platform:i})})(t,e,{placement:n,middleware:[(i=4,void 0===i&&(i=0),{name:"offset",options:i,async fn(t){var e,n;const{x:o,y:r,placement:a,middlewareData:s}=t,l=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=C(n),s=E(n),l="y"===D(n),c=H.has(a)?-1:1,u=i&&l?-1:1,f=A(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,i);return a===(null==(e=s.offset)?void 0:e.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:a}}}}),kt(),Et({padding:8})]});var i;e.style.left=`${o}px`,e.style.top=`${r}px`}async onOpen(){this.previouslyFocusedElement=d(document),this.setupCloseHandlers(),await u(),await this.updatePosition(),Ft(this.el),this.applyAnchorAriaOpen(),this.lmvzOpen.emit(),await u(),this.autoFocus&&"dialog"===this.containerRole&&this.focusFirst()}onClose(){this.removeCloseHandlers(),this.applyAnchorAriaClose(),this.restoreFocus(),this.lmvzClose.emit()}applyAnchorAriaOpen(){this.anchorEl&&this.anchorEl.setAttribute("aria-expanded","true")}applyAnchorAriaClose(){this.anchorEl&&this.anchorEl.setAttribute("aria-expanded","false")}focusFirst(){const{slotEl:t}=this;if(!t)return;const e=t.assignedElements({flatten:!0});for(const t of e){if(!p(t))continue;if(s(t))return void t.initFocus();const e=m(t,v);if(e)return void e.focus()}}restoreFocus(){const t=this.previouslyFocusedElement;t?.isConnected&&t.focus(),this.previouslyFocusedElement=null}triggerClose(){this.lmvzCancel.emit().defaultPrevented||(this.open=!1)}setupCloseHandlers(){this.closureController=new AbortController;const t={signal:this.closureController.signal};document.addEventListener("mousedown",(t=>{if(!this.open)return;const e=(t.target?.shadowRoot??document).elementFromPoint(t.x,t.y)??t.target;this.el===t.target||this.el.contains(e)||this.el.contains(t.target)||this.triggerClose()}),t),document.addEventListener("keydown",(t=>{this.open&&"Escape"===t.key&&this.triggerClose()}),t)}removeCloseHandlers(){this.closureController?.abort()}render(){return o(r,{key:"83529aeac05cdc706193fa8bbbcc8f8672756111",role:this.containerRole,"aria-label":this.label||void 0},o("div",{key:"97c255e788806c0dec2f4ed04c6fc815150912a2",part:"container",class:`container lmvz-wrapper-card-${this.size}`,ref:t=>this.containerEl=t},o("slot",{key:"e4ea69d179557e7d34f1475c07c9284ea8d10a67",ref:t=>this.slotEl=t})))}static get watchers(){return{open:[{handleOpenChange:0}],anchor:[{handleAnchorChange:1}]}}static get style(){return"@layer lmvz-ds.reset,lmvz-ds.theme,lmvz-ds.components,lmvz-ds.overrides; @layer lmvz-ds.components{.lmvz-wrapper-card-sm,.lmvz-wrapper-card-md,.lmvz-wrapper-card-lg{background:var(--lmvz-semantic-color-surface-primary, #ffffff);box-shadow:var(--lmvz-ds-shadow-l3-default-strong, 0 2px 32px 0 rgba(120, 120, 128, 0.11))}.lmvz-wrapper-card-sm{padding:var(--lmvz-component-wrapper-sm-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)) var(--lmvz-component-wrapper-sm-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));border-radius:var(--lmvz-component-wrapper-sm-border-radius, 14px)}.lmvz-wrapper-card-md{padding:var(--lmvz-component-wrapper-md-padding-y, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)) var(--lmvz-component-wrapper-md-padding-x, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));border-radius:var(--lmvz-component-wrapper-md-border-radius, 18px)}.lmvz-wrapper-card-lg{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)}}:host{--lmvz-popover-z-index-internal:var(--lmvz-popover-z-index, 100);display:contents;.container{position:absolute;top:-9999999999px;left:-9999999999px;max-width:var(--lmvz-popover-max-width, none);max-height:var(--lmvz-popover-max-height, none);z-index:var(--lmvz-popover-z-index-internal);overflow:auto;box-sizing:border-box}}:host(:not([open])){display:none}"}},[769,"lmvz-popover",{open:[1540],anchor:[1],placement:[1],size:[1],autoFocus:[4,"auto-focus"],containerRole:[1,"container-role"],label:[1],anchorEl:[32],show:[64],hide:[64],toggle:[64]},void 0,{open:[{handleOpenChange:0}],anchor:[{handleAnchorChange:1}]}]);let Dt=0;function Ft(t){t.getAttribute("id")||t.setAttribute("id","lmvz-popover-"+Dt++)}function Ot(){"undefined"!=typeof customElements&&["lmvz-popover"].forEach((t=>{"lmvz-popover"===t&&(customElements.get(i(t))||customElements.define(i(t),St))}))}export{St as L,Ot as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as n,e as o}from"./p-DjvtQE7c.js";const e=Symbol.for("LMVZ__iconProviderRegistry"),i={};function t(){return"undefined"==typeof window?i:window[e]??(window[e]={})}function r(n,o){const e=t(),i=n;Object.prototype.hasOwnProperty.call(e,i)&&console.warn(`Icon provider with name "${i}" is already registered. Overwriting existing provider.`),e[i]=o}function s(n){const o=t();if(n)return o[n];const e=Object.keys(o);if(0===e.length)return;e.length>1&&console.warn(`Multiple icon providers registered (${e.join(", ")}). Using the first one: "${e[0]}".`);const i=e[0];return i?o[i]:void 0}async function c(e){const{icon:i,iconset:t}=e;return await(async()=>{const o=s(t);if(o)try{const e=await Promise.resolve(o.resolve(i));if(!e?.svg)return void console.warn(`Icon "${i}"${t?` from set "${t}"`:""} not found in provider. Using default icon.`);const r=n(e.svg);if(r)return r}catch(n){return void console.error(`Error resolving icon "${i}" with provider:`,n)}else console.warn(`No icon provider registered. Unable to resolve icon "${i}"${t?` from set "${t}"`:""}. Using default icon.`)})()||(console.error(`Icon "${i}" not found${t?` in set "${t}"`:""}. Using default icon.`),o())}function d(n,o){return{iconset:n,icon:o}}export{c as a,s as g,r,d as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],i=["aria-haspopup","aria-controls","aria-expanded","aria-activedescendant","aria-autocomplete"];export{
|
|
1
|
+
const a=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],i=["aria-haspopup","aria-controls","aria-expanded","aria-activedescendant","aria-autocomplete"];export{a,i as b}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as n}from"./p-DIyiticz.js";function t(n){return!!n&&["INPUT","TEXTAREA","SELECT","LMVZ-INPUT","LMVZ-SELECT","LMVZ-DATEPICKER"].includes(n.tagName?.toUpperCase())}function e(n){return["LMVZ-BUTTON","BUTTON"].includes(n.tagName.toUpperCase())}function r(n){return"LMVZ-BUTTON"===n?.tagName.toUpperCase()}function o(n){return n.hasAttribute("disabled")||!0===n.disabled}function i(n){return!n.hasAttribute("hidden")}function a(n){const t=n.getAttribute("variant")??n.variant;return"primary"===t||"secondary"===t||"tertiary"===t?t:"secondary"}function s(n){return"primary"===a(n)}function u(n){return"secondary"===a(n)}const c=(t,e)=>{let r=n;return e&&e.length>0&&(r=r.filter((n=>!e.includes(n)))),((n,t=[])=>{const e={};return t.forEach((t=>{n.hasAttribute(t)&&(null!==n.getAttribute(t)&&(e[t]=n.getAttribute(t)),n.removeAttribute(t))})),e})(t,r)};function l(n=document){let t=n.activeElement;if(!t)return null;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n)break;t=n}return t}function f(n,t){if(!n)return;if(t(n))return n;const e=Array.from(n.shadowRoot?n.shadowRoot.children:n.children);for(const n of e){const e=f(n,t);if(e)return e}}function d(n){return!!n&&n instanceof HTMLElement&&n.tabIndex>=0&&!n.hasAttribute("disabled")&&"true"!==n.getAttribute("aria-hidden")&&n.checkVisibility()&&null!==n.offsetParent}function m(n,t){if(n instanceof HTMLFormElement)return n;if("string"==typeof n){const t=document.getElementById(n);return t?t instanceof HTMLFormElement?t:(console.warn(`No Form found with selector: "#${n}". Verify that the element with id exists and is actually a <form> element.`,t),null):(console.warn(`No Form found with selector: "#${n}". Verify that the id is correct and the form is rendered in the DOM.`,t),null)}return void 0!==n?(console.warn('The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.',t),null):t.closest("form")}function h(n){const t=n.tagName.toLowerCase();if(["button","lmvz-button","input","lmvz-input","select","lmvz-select","textarea"].includes(t))return!0;if(["a","lmvz-link"].includes(t)&&n.hasAttribute("href"))return!0;if(n.hasAttribute("tabindex")){const t=parseInt(n.getAttribute("tabindex")??"-1");return(isNaN(t)||t<0)&&console.warn("Interactive element is not keyboard accessible due to negative tabindex!",n),!0}const e=n.getAttribute("role");return!(!e||!["button","link","menuitem","option","combobox","listbox","checkbox","radio","switch","tab"].includes(e))}function T(n){return n instanceof HTMLElement}export{c as a,h as b,r as c,s as d,i as e,m as f,l as g,e as h,t as i,o as j,u as k,d as l,T as m,f as w}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,c as t,h as i,t as r}from"./p-DbBJxuBm.js";import{c as a}from"./p-BfTCfPZ1.js";import{A as o}from"./p-sACbyedu.js";import{a as n}from"./p-C-pRMuMh.js";import{R as s}from"./p-DXFoXTse.js";import{c as l}from"./p-bh9cItsP.js";let p=0;const m=e(class extends s{get el(){return this}get validationEl(){return this.el}lmvzInput;internals;inputValidityActive=!1;nativeInputElement;inputId="lmvz-input-"+p++;initialValue="";ariaHostMirrorObserver;nativeError=!1;errorFromProp=!1;get helperId(){return this.helperText?`${this.inputId}-helper`:void 0}get showErrorMessage(){return this.error&&Boolean(this.errorMessage)}get errorId(){return`${this.inputId}-error`}get describedBy(){const e=[];return this.helperId&&e.push(this.helperId),this.showErrorMessage&&e.push(this.errorId),e.length>0?e.join(" "):void 0}value;label;helperText;placeholder;disabled=!1;readonly=!1;required=!1;name;type="text";errorMessage;autocomplete;inputmode;autocorrect;autocapitalize;spellcheck;autofocus=!1;minlength;maxlength;pattern;min;max;step;form;size="md";get error(){return this.errorFromProp||this.nativeError}set error(e){this.errorFromProp=e}async setValue(e){const t=this.nativeInputElement,i=e??"";t&&t.value!==i&&(t.value=i),this.value=i,this.internals.setFormValue?.(i),this.lmvzInput.emit(i)}async focusInput(){this.nativeInputElement?.focus()}async blurInput(){this.nativeInputElement?.blur()}async select(){this.nativeInputElement?.select()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getValidationMessage(){return this.nativeInputElement?.validationMessage??""}async getInputElement(){return this.nativeInputElement||await new Promise((e=>l(this.el,e))),Promise.resolve(this.nativeInputElement)}constructor(e){super(!1),!1!==e&&this.__registerHost(),this.lmvzInput=t(this,"lmvzInput",7),this.internals=this.attachInternals(),this.addController(new o(this,{reValidateOnPropChanges:!0}))}componentWillLoad(){this.initialValue=this.value??"",super.componentWillLoad()}connectedCallback(){super.connectedCallback(),this.ariaHostMirrorObserver=new MutationObserver((e=>{for(const t of e)this.mirrorHostAriaAttribute(t.attributeName)})),this.ariaHostMirrorObserver.observe(this.el,{attributes:!0,attributeFilter:[...n]})}disconnectedCallback(){super.disconnectedCallback(),this.ariaHostMirrorObserver?.disconnect(),this.ariaHostMirrorObserver=void 0}componentDidLoad(){super.componentDidLoad();for(const e of n)this.mirrorHostAriaAttribute(e)}mirrorHostAriaAttribute(e){if(e&&this.nativeInputElement)if(this.el.hasAttribute(e)){const t=this.el.getAttribute(e);null!==t&&this.nativeInputElement.setAttribute(e,t)}else this.nativeInputElement.removeAttribute(e)}formAssociatedCallback(e){e&&this.internals.setFormValue?.(this.value??"")}formResetCallback(){this.inputValidityActive=!1,this.internals.setValidity({}),this.setValue(this.initialValue),this.nativeInputElement?.checkValidity?.()&&(this.nativeError=!1)}formStateRestoreCallback(e){this.setValue(e)}handleValueChange(e){this.nativeInputElement&&(this.nativeInputElement.value===e||this.setValue(e))}handleDisabledChange(e){this.nativeInputElement&&(e?this.nativeInputElement.blur():this.inputValidityActive=!1)}handleInput=e=>{this.setValue(e.target.value),this.inputValidityActive&&this.updateNativeError("input")};handleInvalid=()=>this.updateNativeError("invalid");handleBlur=()=>{this.inputValidityActive=!0,this.updateNativeError("blur")};updateNativeError(e){const t=this.nativeInputElement;if(!t)return;const i="invalid"===e||!(t.checkValidity?.()??1);this.nativeError!==i&&(this.nativeError=i)}render(){const e=Boolean(this.value),t=e||Boolean(this.placeholder);return i("div",{key:"85f498773efdad53d309e8b1eb5b85ea0601277e",class:a("input-container",{"interaction-filled":e})},i("div",{key:"eb74bdd8170014c2a17c6046878b0f4d61fece25",class:"input-wrapper"},i("slot",{key:"ceb3acb5dcb641900caf9a22f43295d1c407ad2e",name:"before-input"}),i("div",{key:"a7f626addd83cbf79b435989bec94f777818794e",class:"label-input-group"},i("label",{key:"391e2d1f873f9aef9bd9e7f14b006d898a699abe",htmlFor:this.inputId,class:a({floating:t})},this.label,this.required&&i("span",{key:"691251a0efb1a60fd5e53447a6204c13008545a1",class:"required-indicator","aria-hidden":"true"}," ","*")),i("input",{key:"f37d3d7d5076636638b2da59cca91c1cedc7504a",id:this.inputId,ref:e=>this.nativeInputElement=e,type:this.type,min:this.min,max:this.max,step:this.step,value:this.value,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,required:this.required,form:this.form,autocomplete:this.autocomplete,inputmode:this.inputmode,autocorrect:this.autocorrect,autocapitalize:this.autocapitalize,spellcheck:this.spellcheck,autofocus:this.autofocus,minlength:this.minlength,maxlength:this.maxlength,pattern:this.pattern,"aria-invalid":this.error?"true":"false","aria-required":this.required?"true":"false","aria-describedby":this.describedBy,"aria-errormessage":this.errorId,onInput:this.handleInput,onBlur:this.handleBlur,onInvalid:this.handleInvalid})),i("slot",{key:"22b2be3072fc274bbeff4d92f25dccc5ea50c4d0",name:"after-input"})),i("div",{key:"95f28aad61a5d7ea45fb4479801097036652b08f",id:this.helperId,role:"status"},this.helperText||null),i("div",{key:"9ea8420b336b33a0fd3b7e53cc4efa44983cbdc3",id:this.errorId,role:"alert"},this.showErrorMessage&&this.errorMessage||null))}static get formAssociated(){return!0}static get watchers(){return{value:[{handleValueChange: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('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, #a1a1a1); --input-border-color-focus: var(--lmvz-semantic-color-border-active, #0f8acc); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --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, #a31419); --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } [size='sm'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); --input-padding-x: var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); --input-gap: var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem)); --input-font-size: var(--lmvz-component-body-sm-font-size, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } [size='md'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); } [size='lg'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem)); --input-padding-x: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); --input-gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --input-font-size: var(--lmvz-component-body-lg-font-size, clamp(1rem, 0.97rem + 0.13vw, 1.13rem)); } .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: var(--input-gap); } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .sc-lmvz-input-h:has(:focus-visible) .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); 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); } .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: var(--input-font-size); font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: 1.5; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0.5em; transform: translateY(-100%); transform-origin: left top; font-size: var(--lmvz-component-body-2xs-font-size, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 400; } .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: var(--input-font-size); 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: var(--input-padding-x); font-size: 12px; color: var(--helper-text-color); font-weight: 400; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--error-text-color); font-weight: 400; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: var(--lmvz-dimension-6-4, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); --lmvz-button-min-height-override: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); }"}},[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],size:[513],error:[6660],nativeError:[32],setValue:[64],focusInput:[64],blurInput:[64],select:[64],checkValidity:[64],reportValidity:[64],getValidationMessage:[64],getInputElement:[64]},void 0,{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}]);function c(){"undefined"!=typeof customElements&&["lmvz-input"].forEach((e=>{"lmvz-input"===e&&(customElements.get(r(e))||customElements.define(r(e),m))}))}export{m as L,c as d}
|
|
1
|
+
import{p as e,c as t,h as i,t as r}from"./p-DbBJxuBm.js";import{c as a}from"./p-BfTCfPZ1.js";import{A as o}from"./p-sACbyedu.js";import{b as n}from"./p-DIyiticz.js";import{R as s}from"./p-DXFoXTse.js";import{c as l}from"./p-bh9cItsP.js";let p=0;const m=e(class extends s{get el(){return this}get validationEl(){return this.el}lmvzInput;internals;inputValidityActive=!1;nativeInputElement;inputId="lmvz-input-"+p++;initialValue="";ariaHostMirrorObserver;nativeError=!1;errorFromProp=!1;get helperId(){return this.helperText?`${this.inputId}-helper`:void 0}get showErrorMessage(){return this.error&&Boolean(this.errorMessage)}get errorId(){return`${this.inputId}-error`}get describedBy(){const e=[];return this.helperId&&e.push(this.helperId),this.showErrorMessage&&e.push(this.errorId),e.length>0?e.join(" "):void 0}value;label;helperText;placeholder;disabled=!1;readonly=!1;required=!1;name;type="text";errorMessage;autocomplete;inputmode;autocorrect;autocapitalize;spellcheck;autofocus=!1;minlength;maxlength;pattern;min;max;step;form;size="md";get error(){return this.errorFromProp||this.nativeError}set error(e){this.errorFromProp=e}async setValue(e){const t=this.nativeInputElement,i=e??"";t&&t.value!==i&&(t.value=i),this.value=i,this.internals.setFormValue?.(i),this.lmvzInput.emit(i)}async focusInput(){this.nativeInputElement?.focus()}async blurInput(){this.nativeInputElement?.blur()}async select(){this.nativeInputElement?.select()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getValidationMessage(){return this.nativeInputElement?.validationMessage??""}async getInputElement(){return this.nativeInputElement||await new Promise((e=>l(this.el,e))),Promise.resolve(this.nativeInputElement)}constructor(e){super(!1),!1!==e&&this.__registerHost(),this.lmvzInput=t(this,"lmvzInput",7),this.internals=this.attachInternals(),this.addController(new o(this,{reValidateOnPropChanges:!0}))}componentWillLoad(){this.initialValue=this.value??"",super.componentWillLoad()}connectedCallback(){super.connectedCallback(),this.ariaHostMirrorObserver=new MutationObserver((e=>{for(const t of e)this.mirrorHostAriaAttribute(t.attributeName)})),this.ariaHostMirrorObserver.observe(this.el,{attributes:!0,attributeFilter:[...n]})}disconnectedCallback(){super.disconnectedCallback(),this.ariaHostMirrorObserver?.disconnect(),this.ariaHostMirrorObserver=void 0}componentDidLoad(){super.componentDidLoad();for(const e of n)this.mirrorHostAriaAttribute(e)}mirrorHostAriaAttribute(e){if(e&&this.nativeInputElement)if(this.el.hasAttribute(e)){const t=this.el.getAttribute(e);null!==t&&this.nativeInputElement.setAttribute(e,t)}else this.nativeInputElement.removeAttribute(e)}formAssociatedCallback(e){e&&this.internals.setFormValue?.(this.value??"")}formResetCallback(){this.inputValidityActive=!1,this.internals.setValidity({}),this.setValue(this.initialValue),this.nativeInputElement?.checkValidity?.()&&(this.nativeError=!1)}formStateRestoreCallback(e){this.setValue(e)}handleValueChange(e){this.nativeInputElement&&(this.nativeInputElement.value===e||this.setValue(e))}handleDisabledChange(e){this.nativeInputElement&&(e?this.nativeInputElement.blur():this.inputValidityActive=!1)}handleInput=e=>{this.setValue(e.target.value),this.inputValidityActive&&this.updateNativeError("input")};handleInvalid=()=>this.updateNativeError("invalid");handleBlur=()=>{this.inputValidityActive=!0,this.updateNativeError("blur")};updateNativeError(e){const t=this.nativeInputElement;if(!t)return;const i="invalid"===e||!(t.checkValidity?.()??1);this.nativeError!==i&&(this.nativeError=i)}render(){const e=Boolean(this.value),t=e||Boolean(this.placeholder);return i("div",{key:"85f498773efdad53d309e8b1eb5b85ea0601277e",class:a("input-container",{"interaction-filled":e})},i("div",{key:"eb74bdd8170014c2a17c6046878b0f4d61fece25",class:"input-wrapper"},i("slot",{key:"ceb3acb5dcb641900caf9a22f43295d1c407ad2e",name:"before-input"}),i("div",{key:"a7f626addd83cbf79b435989bec94f777818794e",class:"label-input-group"},i("label",{key:"391e2d1f873f9aef9bd9e7f14b006d898a699abe",htmlFor:this.inputId,class:a({floating:t})},this.label,this.required&&i("span",{key:"691251a0efb1a60fd5e53447a6204c13008545a1",class:"required-indicator","aria-hidden":"true"}," ","*")),i("input",{key:"f37d3d7d5076636638b2da59cca91c1cedc7504a",id:this.inputId,ref:e=>this.nativeInputElement=e,type:this.type,min:this.min,max:this.max,step:this.step,value:this.value,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,required:this.required,form:this.form,autocomplete:this.autocomplete,inputmode:this.inputmode,autocorrect:this.autocorrect,autocapitalize:this.autocapitalize,spellcheck:this.spellcheck,autofocus:this.autofocus,minlength:this.minlength,maxlength:this.maxlength,pattern:this.pattern,"aria-invalid":this.error?"true":"false","aria-required":this.required?"true":"false","aria-describedby":this.describedBy,"aria-errormessage":this.errorId,onInput:this.handleInput,onBlur:this.handleBlur,onInvalid:this.handleInvalid})),i("slot",{key:"22b2be3072fc274bbeff4d92f25dccc5ea50c4d0",name:"after-input"})),i("div",{key:"95f28aad61a5d7ea45fb4479801097036652b08f",id:this.helperId,role:"status"},this.helperText||null),i("div",{key:"9ea8420b336b33a0fd3b7e53cc4efa44983cbdc3",id:this.errorId,role:"alert"},this.showErrorMessage&&this.errorMessage||null))}static get formAssociated(){return!0}static get watchers(){return{value:[{handleValueChange: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('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, #a1a1a1); --input-border-color-focus: var(--lmvz-semantic-color-border-active, #0f8acc); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --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, #a31419); --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } [size='sm'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); --input-padding-x: var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); --input-gap: var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem)); --input-font-size: var(--lmvz-component-body-sm-font-size, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } [size='md'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); } [size='lg'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem)); --input-padding-x: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); --input-gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --input-font-size: var(--lmvz-component-body-lg-font-size, clamp(1rem, 0.97rem + 0.13vw, 1.13rem)); } .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: var(--input-gap); } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .sc-lmvz-input-h:has(:focus-visible) .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); 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); } .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: var(--input-font-size); font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: 1.5; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0.5em; transform: translateY(-100%); transform-origin: left top; font-size: var(--lmvz-component-body-2xs-font-size, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 400; } .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: var(--input-font-size); 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: var(--input-padding-x); font-size: 12px; color: var(--helper-text-color); font-weight: 400; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--error-text-color); font-weight: 400; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: var(--lmvz-dimension-6-4, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); --lmvz-button-min-height-override: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); }"}},[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],size:[513],error:[6660],nativeError:[32],setValue:[64],focusInput:[64],blurInput:[64],select:[64],checkValidity:[64],reportValidity:[64],getValidationMessage:[64],getInputElement:[64]},void 0,{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}]);function c(){"undefined"!=typeof customElements&&["lmvz-input"].forEach((e=>{"lmvz-input"===e&&(customElements.get(r(e))||customElements.define(r(e),m))}))}export{m as L,c as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as i,h as e,d as t,t as s}from"./p-DbBJxuBm.js";import{p as o}from"./p-DjvtQE7c.js";import{A as n}from"./p-sACbyedu.js";import{a as c}from"./p-CyDgnpOB.js";import{R as a}from"./p-DXFoXTse.js";const r=i(class extends a{intersectionObserver;ariaValidationController=new n(this);get el(){return this}validationEl;icon;weight="medium";size="md";iconset;iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(i){super(!1),!1!==i&&this.__registerHost(),this.addController(this.ariaValidationController)}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()})),super.connectedCallback()}disconnectedCallback(){this.intersectionObserver&&"function"==typeof this.intersectionObserver.disconnect&&this.intersectionObserver.disconnect(),this.intersectionObserver=void 0,super.disconnectedCallback()}async loadIconPathData(){const{icon:i,iconset:e,visible:t}=this;if(!i||!t)return;const s=o(i);this.iconData=s||await c({icon:i,iconset:e})}componentDidRender(){this.validationEl=this.el.querySelector("svg"),this.ariaValidationController.revalidateAria(),super.componentDidRender()}render(){return e(t,{key:"be6032d11399289c3baddd63ebc7d9e1fb98b773",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(i,e=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((e=>{e.some((e=>!!e.isIntersecting&&(this.intersectionObserver&&"function"==typeof this.intersectionObserver.disconnect&&this.intersectionObserver.disconnect(),this.intersectionObserver=void 0,i(),!0)))}),{rootMargin:`${e}px`}),this.intersectionObserver.observe(this.el)):i()}static get watchers(){return{icon:[{loadIconPathData:0}],iconset:[{loadIconPathData:0}]}}static get style(){return".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));--lmvz-icon-size:var(--lmvz-component-size, var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)));display:inline-block;line-height:0;svg{display:block;height:var(--lmvz-icon-size);width:auto}svg path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))}}[size='sm'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))}}[size='md'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))}}[size='lg'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-lg, clamp(1.25rem, 1.19rem + 0.26vw, 1.5rem))}}[size='inherit'].sc-lmvz-icon-h{svg{height:var(--lmvz-component-size, inherit)}}[weight='light'].sc-lmvz-icon-h{svg path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg path{stroke-width:2;fill:var(--lmvz-icon-color)}}"}},[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],iconset:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},void 0,{icon:[{loadIconPathData:0}],iconset:[{loadIconPathData:0}]}]);function m(){"undefined"!=typeof customElements&&["lmvz-icon"].forEach((i=>{"lmvz-icon"===i&&(customElements.get(s(i))||customElements.define(s(i),r))}))}export{r as L,m as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,c as r,h as o,d as e,t as n}from"./p-DbBJxuBm.js";import{c as a}from"./p-BfTCfPZ1.js";import{A as l}from"./p-sACbyedu.js";import{E as m}from"./p--mU29mrX.js";import{a as i,f as v}from"./p-DJLdOjL4.js";import{R as d}from"./p-DXFoXTse.js";const s=t(class extends d{get el(){return this}validationEl;inheritedAttributes={};formEl=null;formButtonEl=null;lmvzActivation;ti=0;resolveFocusableElement(){return this.validationEl}scale="default";variant;disabled=!1;type="button";form;formMethod;name;value;buttonRole;constructor(t){super(!1),!1!==t&&this.__registerHost(),this.__attachShadow(),this.lmvzActivation=r(this,"lmvzActivation",7),this.addController(new l(this)),this.addController(new m(this,{localHandler:this.handleClick.bind(this)}))}connectedCallback(){this.inheritedAttributes=i(this.el,["role"]),super.connectedCallback()}disconnectedCallback(){this.formButtonEl?.remove(),this.formButtonEl=null,this.formEl=null,super.disconnectedCallback()}renderHiddenButton(){if("submit"!==this.type)return this.formButtonEl?.remove(),this.formButtonEl=null,void(this.formEl=null);const t=v(this.form,this.el);if(!t)return this.formButtonEl?.remove(),this.formButtonEl=null,void(this.formEl=null);this.formEl=t;const r=this.formButtonEl??document.createElement("button");r.type="submit",r.style.display="none",r.disabled=this.disabled,r.name=this.name??"",r.value=this.value??"",this.formMethod?r.setAttribute("formmethod",this.formMethod):r.removeAttribute("formmethod"),this.formButtonEl!==r&&(this.formButtonEl=r),r.parentElement!==t&&(r.remove(),t.appendChild(r))}submitForm(t){this.formEl&&this.formButtonEl&&(t.preventDefault(),this.formButtonEl.click())}handleClick=t=>{"submit"===this.type&&this.submitForm(t)};render(){return this.renderHiddenButton(),o(e,{key:"eb0ee982f50f1e41b2aa72a0598d739b972cbcdf",role:"presentation"},o("button",{key:"aed6f44f51222e31d5f1deec952c0d81b8f1200a",ref:t=>this.validationEl=t,part:"button",role:this.buttonRole,disabled:this.disabled,type:this.type,class:a(this.variant??"secondary",{[this.scale??""]:!!this.scale,disabled:this.disabled}),...this.inheritedAttributes},o("slot",{key:"2aaedfde3c0d6ebf426f20a8489b22c2a356767e"})))}static get delegatesFocus(){return!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('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; } hr { height: 0; border: none; margin: var(--lmvz-dimension-8-4, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } fieldset { border: none; margin: 0; padding: 0; } legend { padding: 0; display: block; } } :host { display: inline-block; button { & { & { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-radius: var(--lmvz-button-radius-override, var(--lmvz-component-input-radius-default, 999px)); --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-label-md-strong, normal 700 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); display: inline-flex; align-items: center; justify-content: var(--lmvz-button-content-justification, center); gap: var(--lmvz-button-gap, var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem))); box-sizing: border-box; padding-block: var(--lmvz-button-padding-block, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))); padding-inline: var(--lmvz-button-padding-inline, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))); min-height: var(--lmvz-button-min-height, var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem))); border: var(--lmvz-button-border-width, 0) solid var(--lmvz-button-border-color, transparent); border-radius: var(--lmvz-button-radius, var(--lmvz-component-input-radius-default, 999px)); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } & > * { font: inherit; color: inherit; } &:focus-visible { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); position: relative; z-index: 1; } &:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } &:not([disabled]):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0)); } &:not([disabled]):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4)); } &.primary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary, #000000)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); } &.primary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-hover, #2e2e2e)); } &.primary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-active, #545454)); } &.danger { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary, #ffffff)); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-status-on-danger, #a31419)); } &.danger:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-status-danger, #fbdfe0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-status-on-danger, #a31419)); } &.danger:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-status-on-danger-subtle, #e8454b)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-status-on-danger, #a31419)); } &.tertiary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary, #ffffff)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary, #000000)); } &.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-hover, #000000)); } &.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-active, #000000)); } &.small { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-label-sm-strong, normal 700 clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem) / 1.5 Router)); } &.large { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-label-lg-strong, normal 700 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5 Router)); } } width: 100%; } } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } "}},[785,"lmvz-button",{ti:[514,"tabindex"],scale:[513],variant:[513],disabled:[516],type:[1],form:[1],formMethod:[1,"form-method"],name:[1],value:[1],buttonRole:[1,"button-role"]}]);function u(){"undefined"!=typeof customElements&&["lmvz-button"].forEach((t=>{"lmvz-button"===t&&(customElements.get(n(t))||customElements.define(n(t),s))}))}export{s as L,u as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t,g as s}from"./p-DJLdOjL4.js";import{r as i,g as e}from"./p-DXFoXTse.js";const n={orientation:"both",enableHomeAndEnd:!1,manageTabIndex:!1};class h{host;elements=[];currentElement;config;constructor(t,s={}){this.host=t,this.config={...n,...s}}hostConnected(){i(this.host.el,"isFocusControllerHost",!0),this.getListenerTarget().addEventListener("keydown",this.handleKeydown),this.syncManagedFocusTarget()}hostDisconnected(){this.getListenerTarget().removeEventListener("keydown",this.handleKeydown)}updateListenerTarget(t){t!==this.config.listenerTarget&&(this.getListenerTarget().removeEventListener("keydown",this.handleKeydown),this.config.listenerTarget=t,this.getListenerTarget().addEventListener("keydown",this.handleKeydown))}getListenerTarget(){return this.config.listenerTarget??this.host.el}updateElements(t){const s=this.currentElement??this.getManagedActiveElement()??void 0;this.elements=t.filter((t=>"focus"in t&&1===t.nodeType)),this.syncManagedFocusTarget(s)}setCurrentElement(t){const s=this.currentElement;this.currentElement=null!=t&&"focus"in t&&1===t.nodeType?t:void 0,this.syncManagedFocusTarget(s)}async initFocus(){const t=this.selectManagedElement();t&&this.applyFocusTarget(t,!0)}handleKeydown=s=>{if(t(s.target))return;const i=this.getFocusIntent(s.key);if(!i)return;const e=this.getManagedActiveElement(),n=this.getTargetElement(e,i);n&&(s.preventDefault(),this.applyFocusTarget(n,!0))};getFocusIntent(t){return this.config.enableHomeAndEnd&&"Home"===t?"first":this.config.enableHomeAndEnd&&"End"===t?"last":"horizontal"===this.config.orientation?"ArrowRight"===t?"next":"ArrowLeft"===t?"previous":void 0:"vertical"===this.config.orientation?"ArrowDown"===t?"next":"ArrowUp"===t?"previous":void 0:"ArrowDown"===t||"ArrowRight"===t?"next":"ArrowUp"===t||"ArrowLeft"===t?"previous":void 0}getManagedActiveElement(){const t=s(this.host.el.ownerDocument??document);if(t instanceof HTMLElement){const s=this.elements.find((s=>function(t){return function(t){return"function"==typeof t.resolveFocusableElement}(t)?t.resolveFocusableElement()??t:t}(s)===t));if(s&&this.canMoveFocusTo(s))return s}if(this.currentElement&&this.elements.includes(this.currentElement)&&this.canMoveFocusTo(this.currentElement))return this.currentElement}getTargetElement(t,s){if(!this.elements.length)return;if("first"===s)return this.findFocusableFromIndex(-1,"next");if("last"===s)return this.findFocusableFromIndex(this.elements.length,"previous");const i=t?this.elements.indexOf(t):-1;return-1===i?"next"===s?this.findFocusableFromIndex(-1,"next"):this.findFocusableFromIndex(this.elements.length,"previous"):this.findFocusableFromIndex(i,s)}findFocusableFromIndex(t,s){if(!this.elements.length)return;const i="next"===s?1:-1;for(let s=1;s<=this.elements.length;s++){const e=this.elements[(t+i*s+this.elements.length)%this.elements.length];if(this.canMoveFocusTo(e))return e}}syncManagedFocusTarget(t){const s=this.selectManagedElement(t),i=s!==this.currentElement;this.currentElement=s,this.config.manageTabIndex&&this.updateTabIndexes(s),i&&s&&this.config.onFocusTargetChange?.(s)}selectManagedElement(t){const s=this.getManagedActiveElement();if(s)return s;if(this.currentElement&&this.elements.includes(this.currentElement)&&this.canMoveFocusTo(this.currentElement))return this.currentElement;if(t&&this.elements.includes(t))return this.findFocusableFromIndex(this.elements.indexOf(t),"next")??this.findFocusableFromIndex(-1,"next");return this.elements.find((t=>0===t.tabIndex&&this.canMoveFocusTo(t)))||this.findFocusableFromIndex(-1,"next")}updateTabIndexes(t){this.elements.forEach((s=>{s.tabIndex=t&&s===t?0:-1}))}applyFocusTarget(t,s){const i=t!==this.currentElement;this.currentElement=t,this.config.manageTabIndex&&this.updateTabIndexes(t),s&&t.focus(),i&&this.config.onFocusTargetChange?.(t)}canMoveFocusTo(t){return!!t&&(!t.hasAttribute("disabled")&&((!("disabled"in t)||!Boolean(t.disabled))&&("true"!==t.getAttribute("aria-disabled")&&(this.config.isFocusableElement?this.config.isFocusableElement(t):(this.config.manageTabIndex||t.tabIndex>=0)&&"true"!==t.getAttribute("aria-hidden")&&(t.checkVisibility?.()??!0)&&null!==t.offsetParent))))}}function r(t){return Boolean(e(t,"isFocusControllerHost"))}export{h as D,r as i}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as e,h as s,d as i,t as n}from"./p-DbBJxuBm.js";import{a,i as o}from"./p-BDonpCG8.js";import{v as r}from"./p-0ctLESas.js";import"./p-BPa0FHVO.js";import{d as c,e as d,h,j as l,k as u,c as m,l as f}from"./p-DJLdOjL4.js";const p=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}get el(){return this}actionsSlot;validationMessageCache=[];actionsStateObserver;stacked=!1;get primaryEnabledAction(){return this.enabledButtons.find(c)??this.enabledButtons[0]}get hasActions(){return this.assignedButtons.some((t=>d(t)&&h(t)&&!l(t)))}componentDidLoad(){this.handleActionsSlotChange()}disconnectedCallback(){this.actionsStateObserver?.disconnect()}get assignedElements(){return this.actionsSlot?.assignedElements({flatten:!0})??[]}get assignedButtons(){return this.assignedElements.filter(h)}get visibleButtons(){return this.assignedButtons.filter(d)}get enabledButtons(){return this.visibleButtons.filter((t=l,(...e)=>{const s=t(...e);return a(s)?s.then((t=>!t)):!s}));var t}getActionValidationResult(){if(!this.visibleButtons.length)return[];const t=this.visibleButtons.filter(c),e=this.visibleButtons.filter(u),s=[],i=this.visibleButtons;if(1!==t.length&&s.push("LmvzButtonGroup actions slot should contain exactly one primary action."),e.length>1&&s.push(`LmvzButtonGroup actions slot should contain at most one secondary action (received ${e.length})`),t.length){const n=e[0];0!==i.indexOf(t[0])&&s.push("Primary action should be the first focusable element in the actions slot (i.e. first child of the actions slot)."),n&&1!==i.indexOf(n)&&s.push("Secondary action should be the second focusable element in the actions slot (i.e. immediately after the primary button).")}else e.length&&0!==i.indexOf(e[0])&&s.push("Secondary action should be the first focusable element in the actions slot when no primary action is present (i.e. first child of the actions slot).");return s}handleActionsSlotChange=()=>{this.observeActionState(),this.syncActionsState()};observeActionState(){"undefined"!=typeof MutationObserver&&(this.actionsStateObserver?.disconnect(),this.assignedButtons.length&&(this.actionsStateObserver=new MutationObserver((()=>{this.syncActionsState()})),this.assignedButtons.forEach((t=>{this.actionsStateObserver?.observe(t,{attributes:!0,attributeFilter:["disabled","hidden","variant"]})}))))}syncActionsState(){this.assignedElements.forEach((t=>{["LMVZ-BUTTON","BUTTON"].includes(t.tagName.toUpperCase())||(t.hasAttribute("hidden")||t.setAttribute("hidden",""),"true"!==t.getAttribute("aria-hidden")&&t.setAttribute("aria-hidden","true"))})),this.checkActions();const t=this.visibleButtons,e=t.length>0&&t.some((t=>c(t)||u(t)));t.length>0&&!e?this.el.setAttribute("data-only-tertiary",""):this.el.removeAttribute("data-only-tertiary"),this.visibleButtons.forEach(((t,e)=>{const s=r[e]??"tertiary";t&&(m(t)?t.getAttribute("variant")||t.variant||t.setAttribute("variant",s):t.classList.add(s))}));const s=this.visibleButtons.find((t=>"tertiary"===t.getAttribute("variant")));this.visibleButtons.forEach((t=>{t===s?t.setAttribute("data-first-tertiary",""):t.removeAttribute("data-first-tertiary")})),this.focusPrimaryAction()}focusPrimaryAction(){const t=this.primaryEnabledAction;t&&"undefined"!=typeof window&&window.requestAnimationFrame((()=>{f(t)&&t.focus()}))}checkActions(){if(!o())return;const t=this.getActionValidationResult();t.length&&t.forEach((t=>{this.validationMessageCache.includes(t)||(console.warn(t),this.validationMessageCache.push(t))}))}render(){return s(i,{key:"3e8ce38f7e83e201e47d31579f22161ff36247b1"},s("slot",{key:"bc953d19b333f51c5f5c5ba86be3a85d155a29d1",ref:t=>this.actionsSlot=t,onSlotchange:this.handleActionsSlotChange}))}static get style(){return":host{display:flex;flex-flow:row-reverse wrap;gap:var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));font:var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router);}:host([stacked]){flex-flow:column nowrap;align-items:stretch;padding:0}:host([stacked]) ::slotted(*){display:block;width:100%}::slotted([hidden]){display:none !important}:host(:not([data-only-tertiary],[stacked])) ::slotted([data-first-tertiary]){margin-inline-end:auto}:host([data-only-tertiary]:not([stacked])){justify-content:flex-end}"}},[769,"lmvz-button-group",{stacked:[516],primaryEnabledAction:[2064],hasActions:[2052,"has-actions"]}]);function y(){"undefined"!=typeof customElements&&["lmvz-button-group"].forEach((t=>{"lmvz-button-group"===t&&(customElements.get(n(t))||customElements.define(n(t),p))}))}export{p as L,y as d}
|
package/esm/{directional-focus-controller-QukTTWBE.js → directional-focus-controller-CJ0yNC00.js}
RENAMED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { i as isInputElement, g as getDeepActiveElement } from './element.util-3ydVsxUW.js';
|
|
2
2
|
import { r as registerLmvzComponentMetaInfo, g as getLmvzComponentMetaInfo } from './reactive-controller-host-CICeIanv.js';
|
|
3
3
|
|
|
4
|
-
function isFocusControllerHost(el) {
|
|
5
|
-
return Boolean(getLmvzComponentMetaInfo(el, 'isFocusControllerHost'));
|
|
6
|
-
}
|
|
7
4
|
const defaultConfig = {
|
|
8
5
|
orientation: 'both',
|
|
9
6
|
enableHomeAndEnd: false,
|
|
@@ -23,11 +20,21 @@ class DirectionalFocusController {
|
|
|
23
20
|
}
|
|
24
21
|
hostConnected() {
|
|
25
22
|
registerLmvzComponentMetaInfo(this.host.el, 'isFocusControllerHost', true);
|
|
26
|
-
this.
|
|
23
|
+
this.getListenerTarget().addEventListener('keydown', this.handleKeydown);
|
|
27
24
|
this.syncManagedFocusTarget();
|
|
28
25
|
}
|
|
29
26
|
hostDisconnected() {
|
|
30
|
-
this.
|
|
27
|
+
this.getListenerTarget().removeEventListener('keydown', this.handleKeydown);
|
|
28
|
+
}
|
|
29
|
+
updateListenerTarget(listenerTarget) {
|
|
30
|
+
if (listenerTarget === this.config.listenerTarget)
|
|
31
|
+
return;
|
|
32
|
+
this.getListenerTarget().removeEventListener('keydown', this.handleKeydown);
|
|
33
|
+
this.config.listenerTarget = listenerTarget;
|
|
34
|
+
this.getListenerTarget().addEventListener('keydown', this.handleKeydown);
|
|
35
|
+
}
|
|
36
|
+
getListenerTarget() {
|
|
37
|
+
return this.config.listenerTarget ?? this.host.el;
|
|
31
38
|
}
|
|
32
39
|
updateElements(elements) {
|
|
33
40
|
const previousElement = this.currentElement ?? this.getManagedActiveElement() ?? undefined;
|
|
@@ -179,6 +186,9 @@ class DirectionalFocusController {
|
|
|
179
186
|
return isTabOrderable && element.getAttribute('aria-hidden') !== 'true' && (element.checkVisibility?.() ?? true) && element.offsetParent !== null;
|
|
180
187
|
}
|
|
181
188
|
}
|
|
189
|
+
function isFocusControllerHost(el) {
|
|
190
|
+
return Boolean(getLmvzComponentMetaInfo(el, 'isFocusControllerHost'));
|
|
191
|
+
}
|
|
182
192
|
function isDirectionalFocusReceiver(el) {
|
|
183
193
|
return typeof el.resolveFocusableElement === 'function';
|
|
184
194
|
}
|