@lmvz-ds/components 0.14.1 → 0.16.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/dist/cjs/app-globals-V2Kpy_OQ.js +3 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/{assets-BnJmIx_h.js → assets-XY-cBmal.js} +5 -2
- package/dist/cjs/assets-XY-cBmal.js.map +1 -0
- package/dist/cjs/header-integration_7.cjs.entry.js +1024 -0
- package/dist/cjs/header-integration_7.cjs.entry.js.map +1 -0
- package/dist/cjs/{Effect-CpZhfb0D.js → icons-BOM23oli.js} +1010 -236
- package/dist/cjs/icons-BOM23oli.js.map +1 -0
- package/dist/cjs/{index-9ZJx0550.js → index-B1Puzu82.js} +11 -651
- package/dist/cjs/index-B1Puzu82.js.map +1 -0
- package/dist/cjs/{index-QRnWYctw.js → index-ww_DCXU7.js} +431 -426
- package/dist/cjs/index-ww_DCXU7.js.map +1 -0
- package/dist/cjs/index.cjs.js +13 -12
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/lmvz-action.cjs.entry.js +5 -2
- package/dist/cjs/lmvz-action.cjs.entry.js.map +1 -0
- package/dist/cjs/lmvz-card.cjs.entry.js +7 -4
- package/dist/cjs/lmvz-card.cjs.entry.js.map +1 -0
- package/dist/cjs/lmvz-chip.cjs.entry.js +5 -2
- package/dist/cjs/lmvz-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/lmvz-components.cjs.js +6 -3
- package/dist/cjs/lmvz-components.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +5 -2
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/api/ds.constants.js +1 -0
- package/dist/collection/api/ds.constants.js.map +1 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/api/index.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/lmvz-action/lmvz-action.js +2 -1
- package/dist/collection/components/lmvz-action/lmvz-action.js.map +1 -0
- package/dist/collection/components/lmvz-button/lmvz-button.css +4 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +3 -2
- package/dist/collection/components/lmvz-button/lmvz-button.js.map +1 -0
- package/dist/collection/components/lmvz-card/lmvz-card.css +4 -0
- package/dist/collection/components/lmvz-card/lmvz-card.js +4 -3
- package/dist/collection/components/lmvz-card/lmvz-card.js.map +1 -0
- package/dist/collection/components/lmvz-chip/lmvz-chip.js +3 -2
- package/dist/collection/components/lmvz-chip/lmvz-chip.js.map +1 -0
- package/dist/collection/components/lmvz-header/lmvz-header.js +17 -10
- package/dist/collection/components/lmvz-header/lmvz-header.js.map +1 -0
- package/dist/collection/components/lmvz-icon/icons.js +1 -0
- package/dist/collection/components/lmvz-icon/icons.js.map +1 -0
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +8 -7
- package/dist/collection/components/lmvz-icon/lmvz-icon.js.map +1 -0
- package/dist/collection/components/lmvz-icon/public.js +1 -0
- package/dist/collection/components/lmvz-icon/public.js.map +1 -0
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +1 -0
- package/dist/collection/components/lmvz-icon/test/icons.unit.js.map +1 -0
- package/dist/collection/components/lmvz-input/lmvz-input.js +35 -28
- package/dist/collection/components/lmvz-input/lmvz-input.js.map +1 -0
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +5 -2
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js.map +1 -0
- package/dist/collection/components/lmvz-select/lmvz-select.css +197 -0
- package/dist/collection/components/lmvz-select/lmvz-select.js +224 -0
- package/dist/collection/components/lmvz-select/lmvz-select.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/integration/header-integration.js +5 -4
- package/dist/collection/integration/header-integration.js.map +1 -0
- package/dist/collection/utils/aria/aria-validation-controller.js +1 -0
- package/dist/collection/utils/aria/aria-validation-controller.js.map +1 -0
- package/dist/collection/utils/aria/element-activation-controller.js +1 -0
- package/dist/collection/utils/aria/element-activation-controller.js.map +1 -0
- package/dist/collection/utils/aria/list-keyboard-controller.js +7 -4
- package/dist/collection/utils/aria/list-keyboard-controller.js.map +1 -0
- package/dist/collection/utils/assets.js +1 -0
- package/dist/collection/utils/assets.js.map +1 -0
- package/dist/collection/utils/component.js +7 -4
- package/dist/collection/utils/component.js.map +1 -0
- package/dist/collection/utils/effect.js +1 -0
- package/dist/collection/utils/effect.js.map +1 -0
- package/dist/collection/utils/environment.js +1 -0
- package/dist/collection/utils/environment.js.map +1 -0
- package/dist/collection/utils/http.js +1 -0
- package/dist/collection/utils/http.js.map +1 -0
- package/dist/collection/utils/http.unit.js +1 -0
- package/dist/collection/utils/http.unit.js.map +1 -0
- package/dist/collection/utils/public.js +1 -0
- package/dist/collection/utils/public.js.map +1 -0
- package/dist/collection/utils/reactive-controller-host.js +1 -0
- package/dist/collection/utils/reactive-controller-host.js.map +1 -0
- package/dist/collection/utils/validation/svg.js +1 -0
- package/dist/collection/utils/validation/svg.js.map +1 -0
- package/dist/components/header-integration.d.ts +11 -0
- package/dist/components/header-integration.js +2 -0
- package/dist/components/header-integration.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -0
- package/dist/components/lmvz-action.js +2 -1
- package/dist/components/lmvz-action.js.map +1 -0
- package/dist/components/lmvz-button.js +2 -1
- package/dist/components/lmvz-button.js.map +1 -0
- package/dist/components/lmvz-card.js +2 -1
- package/dist/components/lmvz-card.js.map +1 -0
- package/dist/components/lmvz-chip.js +2 -1
- package/dist/components/lmvz-chip.js.map +1 -0
- package/dist/components/lmvz-header.js +2 -1
- package/dist/components/lmvz-header.js.map +1 -0
- package/dist/components/lmvz-icon.js +2 -1
- package/dist/components/lmvz-icon.js.map +1 -0
- package/dist/components/lmvz-input.js +2 -1
- package/dist/components/lmvz-input.js.map +1 -0
- package/dist/components/lmvz-menuitem.js +2 -1
- package/dist/components/lmvz-menuitem.js.map +1 -0
- package/dist/components/lmvz-select.d.ts +11 -0
- package/dist/components/lmvz-select.js +2 -0
- package/dist/components/lmvz-select.js.map +1 -0
- package/dist/components/p-B2g3aN-E.js +2 -0
- package/dist/components/p-B2g3aN-E.js.map +1 -0
- package/dist/components/p-BXdOuZTp.js +2 -0
- package/dist/components/p-BXdOuZTp.js.map +1 -0
- package/dist/components/p-BfTCfPZ1.js +3 -2
- package/dist/components/p-BfTCfPZ1.js.map +1 -0
- package/dist/components/p-BpCjj39Z.js +2 -0
- package/dist/components/p-BpCjj39Z.js.map +1 -0
- package/dist/components/p-BsHYIl56.js +2 -0
- package/dist/components/p-BsHYIl56.js.map +1 -0
- package/dist/components/p-C5rqq3bf.js +2 -0
- package/dist/components/p-C5rqq3bf.js.map +1 -0
- package/dist/components/p-CI0tffvo.js +2 -0
- package/dist/components/p-CI0tffvo.js.map +1 -0
- package/dist/components/p-CN0JX9-m.js +2 -1
- package/dist/components/p-CN0JX9-m.js.map +1 -0
- package/dist/components/p-ClmDNIy4.js +2 -0
- package/dist/components/p-ClmDNIy4.js.map +1 -0
- package/dist/components/p-DQEkWkMh.js +2 -0
- package/dist/components/p-DQEkWkMh.js.map +1 -0
- package/dist/components/p-X5fEFT9T.js +2 -0
- package/dist/components/p-X5fEFT9T.js.map +1 -0
- package/dist/components/p-vIq2biqy.js +13 -0
- package/dist/components/p-vIq2biqy.js.map +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/{assets-CvV1KMMV.js → assets-BD98wsl7.js} +4 -1
- package/dist/esm/assets-BD98wsl7.js.map +1 -0
- package/dist/esm/header-integration_7.entry.js +1016 -0
- package/dist/esm/header-integration_7.entry.js.map +1 -0
- package/dist/esm/{Effect-DyamyJqO.js → icons-D1lxdRXP.js} +975 -174
- package/dist/esm/icons-D1lxdRXP.js.map +1 -0
- package/dist/esm/{index-CekEw3_K.js → index-DoNkkDv1.js} +6 -1
- package/dist/esm/index-DoNkkDv1.js.map +1 -0
- package/dist/esm/{index-smGPjoDX.js → index-WeqgWisK.js} +11 -651
- package/dist/esm/index-WeqgWisK.js.map +1 -0
- package/dist/esm/index.js +7 -5
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lmvz-action.entry.js +5 -2
- package/dist/esm/lmvz-action.entry.js.map +1 -0
- package/dist/esm/lmvz-card.entry.js +7 -4
- package/dist/esm/lmvz-card.entry.js.map +1 -0
- package/dist/esm/lmvz-chip.entry.js +5 -2
- package/dist/esm/lmvz-chip.entry.js.map +1 -0
- package/dist/esm/lmvz-components.js +7 -4
- package/dist/esm/lmvz-components.js.map +1 -0
- package/dist/esm/loader.js +6 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/ext-libs.d.ts +1 -0
- package/dist/lmvz-components/index.esm.js +2 -1
- package/dist/lmvz-components/index.esm.js.map +1 -0
- package/dist/lmvz-components/lmvz-components.esm.js +2 -1
- package/dist/lmvz-components/lmvz-components.esm.js.map +1 -0
- package/dist/lmvz-components/p-33485219.entry.js +2 -0
- package/dist/lmvz-components/p-33485219.entry.js.map +1 -0
- package/dist/lmvz-components/p-76032c32.entry.js +2 -0
- package/dist/lmvz-components/p-76032c32.entry.js.map +1 -0
- package/dist/lmvz-components/p-7aeec9a8.entry.js +7 -0
- package/dist/lmvz-components/p-7aeec9a8.entry.js.map +1 -0
- package/dist/lmvz-components/p-84e0a9dd.entry.js +2 -0
- package/dist/lmvz-components/p-84e0a9dd.entry.js.map +1 -0
- package/dist/lmvz-components/p-CkJb8WVZ.js +2 -0
- package/dist/lmvz-components/p-CkJb8WVZ.js.map +1 -0
- package/dist/lmvz-components/p-DQuL1Twl.js +2 -1
- package/dist/lmvz-components/p-DQuL1Twl.js.map +1 -0
- package/dist/lmvz-components/p-WeqgWisK.js +3 -0
- package/dist/lmvz-components/p-WeqgWisK.js.map +1 -0
- package/dist/lmvz-components/p-Z9X0_ik0.js +2 -0
- package/dist/lmvz-components/p-Z9X0_ik0.js.map +1 -0
- package/dist/lmvz-components/p-eP0oxQ44.js +13 -0
- package/dist/lmvz-components/p-eP0oxQ44.js.map +1 -0
- package/dist/manifest.json +392 -68
- package/dist/stencil.config.base.js +45 -0
- package/dist/stencil.config.base.js.map +1 -0
- package/dist/stencil.config.dev.js +22 -0
- package/dist/stencil.config.dev.js.map +1 -0
- package/dist/stencil.config.integration.js +27 -0
- package/dist/stencil.config.integration.js.map +1 -0
- package/dist/stencil.config.js +16 -0
- package/dist/stencil.config.js.map +1 -0
- package/dist/stencil.config.prod.js +30 -0
- package/dist/stencil.config.prod.js.map +1 -0
- package/dist/types/Users/patrick.nemenz/workspace/lmvz/lmvz-ds/packages/components/.stencil/stencil.config.base.d.ts +2 -0
- package/dist/types/Users/patrick.nemenz/workspace/lmvz/lmvz-ds/packages/components/.stencil/stencil.config.d.ts +2 -0
- package/dist/types/Users/patrick.nemenz/workspace/lmvz/lmvz-ds/packages/components/.stencil/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/patrick.nemenz/workspace/lmvz/lmvz-ds/packages/components/.stencil/stencil.config.integration.d.ts +2 -0
- package/dist/types/Users/patrick.nemenz/workspace/lmvz/lmvz-ds/packages/components/.stencil/stencil.config.prod.d.ts +2 -0
- package/dist/types/components/lmvz-action/lmvz-action.d.ts +1 -1
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +2 -2
- package/dist/types/components/lmvz-card/lmvz-card.d.ts +1 -1
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +4 -4
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +4 -4
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +4 -4
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +3 -3
- package/dist/types/components/lmvz-select/lmvz-select.d.ts +24 -0
- package/dist/types/components.d.ts +173 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/integration/header-integration.d.ts +5 -0
- package/dist/types/utils/aria/aria-validation-controller.d.ts +1 -1
- package/dist/types/utils/aria/element-activation-controller.d.ts +1 -1
- package/dist/types/utils/component.d.ts +2 -2
- package/dist/types/utils/http.d.ts +3 -3
- package/dist/types/utils/validation/svg.d.ts +1 -1
- package/hydrate/index.js +998 -436
- package/hydrate/index.mjs +998 -436
- package/package.json +37 -73
- package/readme.md +2 -2
- package/dist/cjs/aria-loader-BBKbBZLq.js +0 -76
- package/dist/cjs/component-CRc6eHcV.js +0 -138
- package/dist/cjs/element-activation-controller-DC_6T0Rt.js +0 -31
- package/dist/cjs/icons-Brr4vqiE.js +0 -653
- package/dist/cjs/index-Bp6Dd2i1.js +0 -94
- package/dist/cjs/lmvz-button.cjs.entry.js +0 -73
- package/dist/cjs/lmvz-header.cjs.entry.js +0 -142
- package/dist/cjs/lmvz-icon.cjs.entry.js +0 -87
- package/dist/cjs/lmvz-input.cjs.entry.js +0 -177
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +0 -34
- package/dist/cjs/reactive-controller-host-DWpVosFu.js +0 -189
- package/dist/collection/utils/typing.js +0 -1
- package/dist/components/p-B3JVFwO1.js +0 -1
- package/dist/components/p-BaPwpeMs.js +0 -1
- package/dist/components/p-CSRpdnrt.js +0 -1
- package/dist/components/p-DK2hpvEW.js +0 -12
- package/dist/components/p-DcMNH3fv.js +0 -1
- package/dist/components/p-DugBvwmd.js +0 -1
- package/dist/esm/aria-loader-DB71Xewa.js +0 -69
- package/dist/esm/component-B3JVFwO1.js +0 -132
- package/dist/esm/element-activation-controller-CN0JX9-m.js +0 -29
- package/dist/esm/icons-C69Um2xB.js +0 -649
- package/dist/esm/index-BfTCfPZ1.js +0 -92
- package/dist/esm/lmvz-button.entry.js +0 -71
- package/dist/esm/lmvz-header.entry.js +0 -140
- package/dist/esm/lmvz-icon.entry.js +0 -85
- package/dist/esm/lmvz-input.entry.js +0 -175
- package/dist/esm/lmvz-menuitem.entry.js +0 -32
- package/dist/esm/reactive-controller-host-1nFoJEdT.js +0 -186
- package/dist/lmvz-components/p-0e5aa1a3.entry.js +0 -1
- package/dist/lmvz-components/p-18c18de4.entry.js +0 -1
- package/dist/lmvz-components/p-5775a56c.entry.js +0 -1
- package/dist/lmvz-components/p-814ee542.entry.js +0 -1
- package/dist/lmvz-components/p-9faac8f3.entry.js +0 -1
- package/dist/lmvz-components/p-B3JVFwO1.js +0 -1
- package/dist/lmvz-components/p-B3j8zrhV.js +0 -1
- package/dist/lmvz-components/p-BEoSvNlI.js +0 -1
- package/dist/lmvz-components/p-BTpia82J.js +0 -1
- package/dist/lmvz-components/p-BfTCfPZ1.js +0 -6
- package/dist/lmvz-components/p-CN0JX9-m.js +0 -1
- package/dist/lmvz-components/p-D7GrtdQF.js +0 -1
- package/dist/lmvz-components/p-DyamyJqO.js +0 -1
- package/dist/lmvz-components/p-c61f7daa.entry.js +0 -1
- package/dist/lmvz-components/p-c6bae21b.entry.js +0 -1
- package/dist/lmvz-components/p-cM67HC0Z.js +0 -12
- package/dist/lmvz-components/p-d4b68381.entry.js +0 -1
- package/dist/lmvz-components/p-smGPjoDX.js +0 -2
- package/dist/types/utils/typing.d.ts +0 -3
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./p-BaPwpeMs.js";const e=(e,o)=>{const a=function(...t){return t.filter(Boolean).join("/").replace("//","/").replace("/./","/")}("../../assets",o,e);try{return t(a)}catch{return console.warn(`Failed to create URL for asset "${e}" in path "${o}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration! Falling back to a relative URL, which may work in some environments but is not guaranteed to be correct.`),new URL(a,import.meta?.url??window?.location?.origin??"")}};export{e as c}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as t,H as i}from"./p-BaPwpeMs.js";const o=Symbol("__lmvzAriaValidationRuntimeState"),s="lmvz:aria-validation-runtime-changed";function e(){const t=globalThis;return t[o]||(t[o]={enabled:!1}),t[o]}function n(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(s))}const h=()=>e().enabled,r=()=>e().verboseLogging??!1,a=(t={})=>{const i=e();i.enabled||(Object.assign(i,t),i.enabled=!0,async function(...t){const i=await async function(){const t=e();if(!t.enabled)return null;if(t.runtime)return t.runtime;t.loadPromise||(t.loadPromise=import("./p-DK2hpvEW.js").catch((()=>null)));const i=await t.loadPromise;return i&&(t.runtime=i),i}();e().enabled&&(i?i.initializeValidationStream(...t):console.warn("Failed to load aria validation runtime"))}().then((()=>{n()})))},l=()=>{const t=e();t.enabled&&(t.enabled=!1,n())};function c(...t){const i=e();i.enabled&&i.runtime&&i.runtime.enqueueValidation(...t)}class d{host;config;visibilityObserver;elementQueued=!1;elementValidated=!1;elementLoaded=!1;static knownValidationErrors=[];get disabled(){return!h()}get useVerboseLogging(){return this.config?.verboseLogging||t.isDev||r()}constructor(t,i){this.host=t,this.config=i}onRuntimeConfigChange=()=>{h()&&this.checkLazyValidation()};hostDidLoad(){this.elementLoaded=!0,"undefined"!=typeof window&&window.addEventListener(s,this.onRuntimeConfigChange),this.elementQueued||this.elementValidated||("slot"!==this.config?.validationTiming?this.host.validationEl?.checkVisibility()&&"load"===this.config?.validationTiming?this.enqueueValidation():this.observeVisibilityOnce():this.observeSlot())}hostDidUpdate(){this.checkLazyValidation()}hostDisconnected(){this.discardVisibilityObserver(),"undefined"!=typeof window&&window.removeEventListener(s,this.onRuntimeConfigChange)}revalidateAria(){this.enqueueValidation()}observeSlot(){this.host.validationSlot?.addEventListener("slotchange",this.enqueueValidation.bind(this))}observeVisibilityOnce(){window.setTimeout((()=>{this.host.validationEl&&(this.visibilityObserver=new IntersectionObserver((t=>{for(const i of t)i.target===this.host.validationEl&&i.isIntersecting&&(this.checkLazyValidation(),this.discardVisibilityObserver())}),{root:this.host.validationEl?.parentElement,rootMargin:"0px",threshold:.01}),this.visibilityObserver.observe(this.host.validationEl))}))}checkLazyValidation(){this.elementLoaded&&(this.config?.reValidateOnPropChanges||!this.elementQueued&&!this.elementValidated)&&this.host.validationEl?.checkVisibility()&&this.enqueueValidation()}enqueueValidation(){h()&&(this.elementQueued=!0,c({context:{include:this.host.validationEl,exclude:d.knownValidationErrors},onComplete:(t,i)=>{this.elementValidated=!0;const o=this.host.tagName||this.host.validationEl?.tagName||"Element";if(t)return console.error("Error running ARIA validation:",t,o),void(this.host.validationEl?.tagName||console.dir(this.host));const s=[o];if(!i?.violations.length)return void(this.useVerboseLogging&&(console.log(...s,"has no ARIA violations"),this.host.validationEl?.tagName||console.dir(this.host)));const e=i.violations.length,n=[...s,i.violations.at(0).id,e>1?`(+${e-1} more)`:""].filter(Boolean).join(" ");this.useVerboseLogging?console.group(n):console.groupCollapsed(n);const h=i.violations.flatMap((t=>(console.dir(t,{showHidden:!0,compact:!1}),t.nodes.map((t=>t.target)))));this.host.validationEl?console.log("element:",this.host.validationEl):console.dir(this.host),console.groupEnd(),d.knownValidationErrors.push(...h)}}))}discardVisibilityObserver(){this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=void 0)}}const u=class extends i{constructor(){super(!1)}controllers=new Set;addController(t){this.controllers.add(t)}removeController(t){this.controllers.delete(t)}get activeControllers(){return Array.from(this.controllers).filter((t=>!t.disabled))}connectedCallback(){this.controllers.size||console.warn("ReactiveControllerHost connected with no controllers registered.",this),this.activeControllers.forEach((t=>t.hostConnected?.()))}disconnectedCallback(){this.activeControllers.forEach((t=>t.hostDisconnected?.()))}componentWillLoad(){this.activeControllers.forEach((t=>t.hostWillLoad?.()))}componentDidLoad(){this.activeControllers.forEach((t=>t.hostDidLoad?.()))}componentWillRender(){this.activeControllers.forEach((t=>t.hostWillRender?.()))}componentDidRender(){this.activeControllers.forEach((t=>t.hostDidRender?.()))}componentWillUpdate(){this.activeControllers.forEach((t=>t.hostWillUpdate?.()))}componentDidUpdate(){this.activeControllers.forEach((t=>t.hostDidUpdate?.()))}};export{s as A,u as R,d as a,l as d,a as e,h as i,c as q,r as u}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const GLOBAL_STATE_KEY = Symbol('__lmvzAriaValidationRuntimeState');
|
|
2
|
-
const ARIA_VALIDATION_RUNTIME_CHANGED_EVENT = 'lmvz:aria-validation-runtime-changed';
|
|
3
|
-
function getRuntimeState() {
|
|
4
|
-
const globalState = globalThis;
|
|
5
|
-
if (!globalState[GLOBAL_STATE_KEY]) {
|
|
6
|
-
globalState[GLOBAL_STATE_KEY] = {
|
|
7
|
-
enabled: false,
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
return globalState[GLOBAL_STATE_KEY];
|
|
11
|
-
}
|
|
12
|
-
function notifyRuntimeChange() {
|
|
13
|
-
if (typeof window === 'undefined')
|
|
14
|
-
return;
|
|
15
|
-
window.dispatchEvent(new CustomEvent(ARIA_VALIDATION_RUNTIME_CHANGED_EVENT));
|
|
16
|
-
}
|
|
17
|
-
async function fetchRuntime() {
|
|
18
|
-
const state = getRuntimeState();
|
|
19
|
-
if (!state.enabled)
|
|
20
|
-
return null;
|
|
21
|
-
if (state.runtime)
|
|
22
|
-
return state.runtime;
|
|
23
|
-
if (!state.loadPromise) {
|
|
24
|
-
state.loadPromise = import('./index-CekEw3_K.js').catch(() => null);
|
|
25
|
-
}
|
|
26
|
-
const runtime = await state.loadPromise;
|
|
27
|
-
if (runtime) {
|
|
28
|
-
state.runtime = runtime;
|
|
29
|
-
}
|
|
30
|
-
return runtime;
|
|
31
|
-
}
|
|
32
|
-
async function initializeValidation(...args) {
|
|
33
|
-
const runtime = await fetchRuntime();
|
|
34
|
-
const s = getRuntimeState();
|
|
35
|
-
if (!s.enabled)
|
|
36
|
-
return;
|
|
37
|
-
if (!runtime) {
|
|
38
|
-
console.warn('Failed to load aria validation runtime');
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
runtime.initializeValidationStream(...args);
|
|
42
|
-
}
|
|
43
|
-
const isAriaValidationEnabled = () => getRuntimeState().enabled;
|
|
44
|
-
const useVerboseLogging = () => getRuntimeState().verboseLogging ?? false;
|
|
45
|
-
const enableAriaValidation = (options = {}) => {
|
|
46
|
-
const state = getRuntimeState();
|
|
47
|
-
if (state.enabled)
|
|
48
|
-
return;
|
|
49
|
-
Object.assign(state, options);
|
|
50
|
-
state.enabled = true;
|
|
51
|
-
initializeValidation().then(() => {
|
|
52
|
-
notifyRuntimeChange();
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
const disableAriaValidation = () => {
|
|
56
|
-
const state = getRuntimeState();
|
|
57
|
-
if (!state.enabled)
|
|
58
|
-
return;
|
|
59
|
-
state.enabled = false;
|
|
60
|
-
notifyRuntimeChange();
|
|
61
|
-
};
|
|
62
|
-
function queueValidation(...args) {
|
|
63
|
-
const state = getRuntimeState();
|
|
64
|
-
if (!state.enabled || !state.runtime)
|
|
65
|
-
return;
|
|
66
|
-
state.runtime.enqueueValidation(...args);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { ARIA_VALIDATION_RUNTIME_CHANGED_EVENT as A, disableAriaValidation as d, enableAriaValidation as e, isAriaValidationEnabled as i, queueValidation as q, useVerboseLogging as u };
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
const componentOnReady = (el, callback) => {
|
|
2
|
-
if (el.componentOnReady) {
|
|
3
|
-
el.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
|
4
|
-
}
|
|
5
|
-
else {
|
|
6
|
-
raf(() => callback(el));
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
const inheritAttributes = (el, attributes = []) => {
|
|
10
|
-
const attributeObject = {};
|
|
11
|
-
attributes.forEach(attr => {
|
|
12
|
-
if (el.hasAttribute(attr)) {
|
|
13
|
-
const value = el.getAttribute(attr);
|
|
14
|
-
if (value !== null) {
|
|
15
|
-
attributeObject[attr] = el.getAttribute(attr);
|
|
16
|
-
}
|
|
17
|
-
el.removeAttribute(attr);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
return attributeObject;
|
|
21
|
-
};
|
|
22
|
-
const ariaAttributes = [
|
|
23
|
-
'role',
|
|
24
|
-
'aria-activedescendant',
|
|
25
|
-
'aria-atomic',
|
|
26
|
-
'aria-autocomplete',
|
|
27
|
-
'aria-braillelabel',
|
|
28
|
-
'aria-brailleroledescription',
|
|
29
|
-
'aria-busy',
|
|
30
|
-
'aria-checked',
|
|
31
|
-
'aria-colcount',
|
|
32
|
-
'aria-colindex',
|
|
33
|
-
'aria-colindextext',
|
|
34
|
-
'aria-colspan',
|
|
35
|
-
'aria-controls',
|
|
36
|
-
'aria-current',
|
|
37
|
-
'aria-describedby',
|
|
38
|
-
'aria-description',
|
|
39
|
-
'aria-details',
|
|
40
|
-
'aria-disabled',
|
|
41
|
-
'aria-errormessage',
|
|
42
|
-
'aria-expanded',
|
|
43
|
-
'aria-flowto',
|
|
44
|
-
'aria-haspopup',
|
|
45
|
-
'aria-hidden',
|
|
46
|
-
'aria-invalid',
|
|
47
|
-
'aria-keyshortcuts',
|
|
48
|
-
'aria-label',
|
|
49
|
-
'aria-labelledby',
|
|
50
|
-
'aria-level',
|
|
51
|
-
'aria-live',
|
|
52
|
-
'aria-multiline',
|
|
53
|
-
'aria-multiselectable',
|
|
54
|
-
'aria-orientation',
|
|
55
|
-
'aria-owns',
|
|
56
|
-
'aria-placeholder',
|
|
57
|
-
'aria-posinset',
|
|
58
|
-
'aria-pressed',
|
|
59
|
-
'aria-readonly',
|
|
60
|
-
'aria-relevant',
|
|
61
|
-
'aria-required',
|
|
62
|
-
'aria-roledescription',
|
|
63
|
-
'aria-rowcount',
|
|
64
|
-
'aria-rowindex',
|
|
65
|
-
'aria-rowindextext',
|
|
66
|
-
'aria-rowspan',
|
|
67
|
-
'aria-selected',
|
|
68
|
-
'aria-setsize',
|
|
69
|
-
'aria-sort',
|
|
70
|
-
'aria-valuemax',
|
|
71
|
-
'aria-valuemin',
|
|
72
|
-
'aria-valuenow',
|
|
73
|
-
'aria-valuetext',
|
|
74
|
-
];
|
|
75
|
-
const inheritAriaAttributes = (el, ignoreList) => {
|
|
76
|
-
let attributesToInherit = ariaAttributes;
|
|
77
|
-
return inheritAttributes(el, attributesToInherit);
|
|
78
|
-
};
|
|
79
|
-
const raf = (h) => {
|
|
80
|
-
if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
|
81
|
-
return __zone_symbol__requestAnimationFrame(h);
|
|
82
|
-
}
|
|
83
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
84
|
-
return requestAnimationFrame(h);
|
|
85
|
-
}
|
|
86
|
-
return setTimeout(h);
|
|
87
|
-
};
|
|
88
|
-
function getDeepActiveElement(root = document) {
|
|
89
|
-
let activeElement = root.activeElement;
|
|
90
|
-
if (!activeElement) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
while (activeElement && activeElement.shadowRoot) {
|
|
94
|
-
const next = activeElement.shadowRoot.activeElement;
|
|
95
|
-
if (!next) {
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
activeElement = next;
|
|
99
|
-
}
|
|
100
|
-
return activeElement;
|
|
101
|
-
}
|
|
102
|
-
function canReceiveFocus(el) {
|
|
103
|
-
return (el instanceof HTMLElement && el.tabIndex >= 0 && !el.hasAttribute('disabled') && el.getAttribute('aria-hidden') !== 'true' && el.checkVisibility() && el.offsetParent !== null);
|
|
104
|
-
}
|
|
105
|
-
function findFormByRef(form, el) {
|
|
106
|
-
if (form instanceof HTMLFormElement) {
|
|
107
|
-
return form;
|
|
108
|
-
}
|
|
109
|
-
if (typeof form === 'string') {
|
|
110
|
-
const el = document.getElementById(form);
|
|
111
|
-
if (el) {
|
|
112
|
-
if (el instanceof HTMLFormElement) {
|
|
113
|
-
return el;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
console.warn(`No Form found with selector: "#${form}". Verify that the element with id exists and is actually a <form> element.`, el);
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
console.warn(`No Form found with selector: "#${form}". Verify that the id is correct and the form is rendered in the DOM.`, el);
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (form !== undefined) {
|
|
126
|
-
console.warn(`The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.`, el);
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
return el.closest('form');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export { componentOnReady as a, canReceiveFocus as c, findFormByRef as f, getDeepActiveElement as g, inheritAriaAttributes as i };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
class ElementActivationController {
|
|
2
|
-
host;
|
|
3
|
-
config;
|
|
4
|
-
constructor(host, config) {
|
|
5
|
-
this.host = host;
|
|
6
|
-
this.config = config;
|
|
7
|
-
}
|
|
8
|
-
hostDidLoad() {
|
|
9
|
-
if (!this.host.el.hasAttribute('tabindex')) {
|
|
10
|
-
console.warn('Interactive element does not have a tabindex attribute!', this.host.el);
|
|
11
|
-
}
|
|
12
|
-
this.host.el.addEventListener('keydown', this.handleKeyDown.bind(this));
|
|
13
|
-
this.host.el.addEventListener('click', this.handleActivation.bind(this));
|
|
14
|
-
}
|
|
15
|
-
handleKeyDown = (event) => {
|
|
16
|
-
if ((this.config?.keys ?? ['Enter', ' ']).includes(event.key)) {
|
|
17
|
-
event.preventDefault();
|
|
18
|
-
this.handleActivation(event);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
handleActivation = (event) => {
|
|
22
|
-
this.host.lmvzActivation.emit();
|
|
23
|
-
if (this.config?.localHandler) {
|
|
24
|
-
this.config.localHandler(event);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { ElementActivationController as E };
|