@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
|
@@ -0,0 +1,1016 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, B as Build, g as getElement, c as createEvent } from './index-WeqgWisK.js';
|
|
2
|
+
import { i as isAriaValidationEnabled, u as useVerboseLogging, A as ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, q as queueValidation, r as runPromise, f as fetchIconSvg, t as tapError, l as logError, a as catchAll, s as succeed, b as emptyDefaultSvg } from './icons-D1lxdRXP.js';
|
|
3
|
+
import './assets-BD98wsl7.js';
|
|
4
|
+
|
|
5
|
+
function getDefaultExportFromCjs (x) {
|
|
6
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const HeaderIntegration = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
activeNav;
|
|
14
|
+
activate(event) {
|
|
15
|
+
const target = event.currentTarget;
|
|
16
|
+
const navItem = target.closest('[slot="nav-primary"]');
|
|
17
|
+
if (!navItem)
|
|
18
|
+
return;
|
|
19
|
+
const navId = navItem.id;
|
|
20
|
+
if (!navId) {
|
|
21
|
+
console.warn('Nav item does not have an id:', navItem);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
console.log('Activating nav item:', navId);
|
|
25
|
+
this.activeNav = navId;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return (h(Host, { key: 'c70b22cccc010b6a18ec6003e31b9fb905cd669e' }, h("lmvz-header", { key: 'bf4f3a9c603dcfeee519dc1e78d8e9cd6e836f98', lmvzActiveNav: this.activeNav }, h("lmvz-menuitem", { key: '64f3b9e2a6d5bb7feab15169d0de61e64a4002f1', slot: "nav-primary", id: "lehrmittel", onLmvzActivation: this.activate.bind(this) }, h("a", { key: '2af5799904621d8b48640694a16f3858b0a5ccf9', href: "#" }, "Lehrmittel")), h("lmvz-menuitem", { key: '54ed8090f68463bea9a18b290b1a1e707259119f', slot: "nav-primary", id: "verwaltung", onLmvzActivation: this.activate.bind(this) }, h("a", { key: '98b8d121e0fca6b0630bc664cbfeb9307ce5b7e5', href: "#" }, "Verwaltung")), h("lmvz-menuitem", { key: 'c656b1a95940f1e14cf905a20c4679e92ca456ee', slot: "connect-nav-lehrmittel" }, h("lmvz-icon", { key: 'd9d16fe6d1d0ac183724881f7f1b41ce04f3c607', icon: "book" }), "Deutsch 7"), h("lmvz-menuitem", { key: '7aaf7887accf7fc388fe425718bdf2f703686f98', slot: "connect-nav-lehrmittel" }, h("lmvz-icon", { key: 'e2791405657a2de9527057f6c6767260cd9d21af', icon: "book" }), "Mathe 2"), h("lmvz-menuitem", { key: 'c99fd516f891ae6bd6a76c92e504cf17ec3c0820', slot: "connect-nav-verwaltung" }, h("lmvz-icon", { key: '78d9563d8c9a78f6b7bee0ad79ac0c51d8575790', icon: "cog" }), "iwas mit Verwaltung"), h("lmvz-menuitem", { key: '225f8207ee869d5e37bb9d6dbd7881a6fe636637', slot: "connect-nav-verwaltung", "aria-label": "Einstellungen" }, h("lmvz-icon", { key: '0d89fcb8bfbb3918ff14d783cfc087c658df151a', icon: "cog" })), h("lmvz-button", { key: '2637addd2ee7158087d6ab50808e6f900acabbf2', slot: "actions", "aria-label": "Benutzerkonto" }, h("lmvz-icon", { key: 'c927e171d6f29474f18e2c222fff50c4947a0b3b', icon: "user" })))));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
HeaderIntegration.style = `.active button {
|
|
32
|
+
background-color: var(--lmvz-semantic-color-status-selected);
|
|
33
|
+
}`;
|
|
34
|
+
|
|
35
|
+
var classnames = {exports: {}};
|
|
36
|
+
|
|
37
|
+
/*!
|
|
38
|
+
Copyright (c) 2018 Jed Watson.
|
|
39
|
+
Licensed under the MIT License (MIT), see
|
|
40
|
+
http://jedwatson.github.io/classnames
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
var hasRequiredClassnames;
|
|
44
|
+
|
|
45
|
+
function requireClassnames () {
|
|
46
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
47
|
+
hasRequiredClassnames = 1;
|
|
48
|
+
(function (module) {
|
|
49
|
+
/* global define */
|
|
50
|
+
|
|
51
|
+
(function () {
|
|
52
|
+
|
|
53
|
+
var hasOwn = {}.hasOwnProperty;
|
|
54
|
+
|
|
55
|
+
function classNames () {
|
|
56
|
+
var classes = '';
|
|
57
|
+
|
|
58
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
59
|
+
var arg = arguments[i];
|
|
60
|
+
if (arg) {
|
|
61
|
+
classes = appendClass(classes, parseValue(arg));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return classes;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function parseValue (arg) {
|
|
69
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
70
|
+
return arg;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (typeof arg !== 'object') {
|
|
74
|
+
return '';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (Array.isArray(arg)) {
|
|
78
|
+
return classNames.apply(null, arg);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
82
|
+
return arg.toString();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var classes = '';
|
|
86
|
+
|
|
87
|
+
for (var key in arg) {
|
|
88
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
89
|
+
classes = appendClass(classes, key);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return classes;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function appendClass (value, newClass) {
|
|
97
|
+
if (!newClass) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (value) {
|
|
102
|
+
return value + ' ' + newClass;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return value + newClass;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (module.exports) {
|
|
109
|
+
classNames.default = classNames;
|
|
110
|
+
module.exports = classNames;
|
|
111
|
+
} else {
|
|
112
|
+
window.classNames = classNames;
|
|
113
|
+
}
|
|
114
|
+
}());
|
|
115
|
+
} (classnames));
|
|
116
|
+
return classnames.exports;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var classnamesExports = requireClassnames();
|
|
120
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
121
|
+
|
|
122
|
+
class AriaValidationController {
|
|
123
|
+
host;
|
|
124
|
+
config;
|
|
125
|
+
visibilityObserver;
|
|
126
|
+
elementQueued = false;
|
|
127
|
+
elementValidated = false;
|
|
128
|
+
elementLoaded = false;
|
|
129
|
+
static knownValidationErrors = [];
|
|
130
|
+
get disabled() {
|
|
131
|
+
return !isAriaValidationEnabled();
|
|
132
|
+
}
|
|
133
|
+
get useVerboseLogging() {
|
|
134
|
+
return this.config?.verboseLogging || Build.isDev || useVerboseLogging();
|
|
135
|
+
}
|
|
136
|
+
constructor(host, config) {
|
|
137
|
+
this.host = host;
|
|
138
|
+
this.config = config;
|
|
139
|
+
}
|
|
140
|
+
onRuntimeConfigChange = () => {
|
|
141
|
+
if (!isAriaValidationEnabled())
|
|
142
|
+
return;
|
|
143
|
+
this.checkLazyValidation();
|
|
144
|
+
};
|
|
145
|
+
hostDidLoad() {
|
|
146
|
+
this.elementLoaded = true;
|
|
147
|
+
if (typeof window !== 'undefined') {
|
|
148
|
+
window.addEventListener(ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, this.onRuntimeConfigChange);
|
|
149
|
+
}
|
|
150
|
+
if (this.elementQueued || this.elementValidated)
|
|
151
|
+
return;
|
|
152
|
+
if (this.config?.validationTiming === 'slot') {
|
|
153
|
+
this.observeSlot();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (!this.host.validationEl?.checkVisibility() || this.config?.validationTiming !== 'load') {
|
|
157
|
+
this.observeVisibilityOnce();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.enqueueValidation();
|
|
161
|
+
}
|
|
162
|
+
hostDidUpdate() {
|
|
163
|
+
this.checkLazyValidation();
|
|
164
|
+
}
|
|
165
|
+
hostDisconnected() {
|
|
166
|
+
this.discardVisibilityObserver();
|
|
167
|
+
if (typeof window !== 'undefined') {
|
|
168
|
+
window.removeEventListener(ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, this.onRuntimeConfigChange);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
revalidateAria() {
|
|
172
|
+
this.enqueueValidation();
|
|
173
|
+
}
|
|
174
|
+
observeSlot() {
|
|
175
|
+
this.host.validationSlot?.addEventListener('slotchange', this.enqueueValidation.bind(this));
|
|
176
|
+
}
|
|
177
|
+
observeVisibilityOnce() {
|
|
178
|
+
window.setTimeout(() => {
|
|
179
|
+
if (!this.host.validationEl)
|
|
180
|
+
return;
|
|
181
|
+
this.visibilityObserver = new IntersectionObserver((entries) => {
|
|
182
|
+
for (const entry of entries) {
|
|
183
|
+
if (entry.target !== this.host.validationEl)
|
|
184
|
+
continue;
|
|
185
|
+
if (!entry.isIntersecting)
|
|
186
|
+
continue;
|
|
187
|
+
this.checkLazyValidation();
|
|
188
|
+
this.discardVisibilityObserver();
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
191
|
+
root: this.host.validationEl?.parentElement,
|
|
192
|
+
rootMargin: '0px',
|
|
193
|
+
threshold: 0.01,
|
|
194
|
+
});
|
|
195
|
+
this.visibilityObserver.observe(this.host.validationEl);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
checkLazyValidation() {
|
|
199
|
+
if (!this.elementLoaded)
|
|
200
|
+
return;
|
|
201
|
+
if (!this.config?.reValidateOnPropChanges && (this.elementQueued || this.elementValidated))
|
|
202
|
+
return;
|
|
203
|
+
if (!this.host.validationEl?.checkVisibility())
|
|
204
|
+
return;
|
|
205
|
+
this.enqueueValidation();
|
|
206
|
+
}
|
|
207
|
+
enqueueValidation() {
|
|
208
|
+
if (!isAriaValidationEnabled())
|
|
209
|
+
return;
|
|
210
|
+
this.elementQueued = true;
|
|
211
|
+
queueValidation({
|
|
212
|
+
context: { include: this.host.validationEl, exclude: AriaValidationController.knownValidationErrors },
|
|
213
|
+
onComplete: (error, results) => {
|
|
214
|
+
this.elementValidated = true;
|
|
215
|
+
const elementName = this.host.tagName || this.host.validationEl?.tagName || 'Element';
|
|
216
|
+
if (error) {
|
|
217
|
+
console.error('Error running ARIA validation:', error, elementName);
|
|
218
|
+
if (!this.host.validationEl?.tagName) {
|
|
219
|
+
console.dir(this.host);
|
|
220
|
+
}
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const message = [elementName];
|
|
224
|
+
if (!results?.violations.length) {
|
|
225
|
+
if (this.useVerboseLogging) {
|
|
226
|
+
console.log(...message, 'has no ARIA violations');
|
|
227
|
+
if (!this.host.validationEl?.tagName) {
|
|
228
|
+
console.dir(this.host);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const count = results.violations.length;
|
|
234
|
+
const label = [...message, results.violations.at(0).id, count > 1 ? `(+${count - 1} more)` : ''].filter(Boolean).join(' ');
|
|
235
|
+
if (this.useVerboseLogging) {
|
|
236
|
+
console.group(label);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
console.groupCollapsed(label);
|
|
240
|
+
}
|
|
241
|
+
const targets = results.violations.flatMap((violation) => {
|
|
242
|
+
console.dir(violation, { showHidden: true, compact: false });
|
|
243
|
+
return violation.nodes.map((node) => node.target);
|
|
244
|
+
});
|
|
245
|
+
if (this.host.validationEl) {
|
|
246
|
+
console.log('element:', this.host.validationEl);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
console.dir(this.host);
|
|
250
|
+
}
|
|
251
|
+
console.groupEnd();
|
|
252
|
+
AriaValidationController.knownValidationErrors.push(...targets);
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
discardVisibilityObserver() {
|
|
257
|
+
if (!this.visibilityObserver)
|
|
258
|
+
return;
|
|
259
|
+
this.visibilityObserver.disconnect();
|
|
260
|
+
this.visibilityObserver = undefined;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
class ElementActivationController {
|
|
265
|
+
host;
|
|
266
|
+
config;
|
|
267
|
+
constructor(host, config) {
|
|
268
|
+
this.host = host;
|
|
269
|
+
this.config = config;
|
|
270
|
+
}
|
|
271
|
+
hostDidLoad() {
|
|
272
|
+
if (!this.host.el.hasAttribute('tabindex')) {
|
|
273
|
+
console.warn('Interactive element does not have a tabindex attribute!', this.host.el);
|
|
274
|
+
}
|
|
275
|
+
this.host.el.addEventListener('keydown', this.handleKeyDown.bind(this));
|
|
276
|
+
this.host.el.addEventListener('click', this.handleActivation.bind(this));
|
|
277
|
+
}
|
|
278
|
+
handleKeyDown = (event) => {
|
|
279
|
+
if ((this.config?.keys ?? ['Enter', ' ']).includes(event.key)) {
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
this.handleActivation(event);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
handleActivation = (event) => {
|
|
285
|
+
this.host.lmvzActivation.emit();
|
|
286
|
+
if (this.config?.localHandler) {
|
|
287
|
+
this.config.localHandler(event);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const componentOnReady = (el, callback) => {
|
|
293
|
+
if (el.componentOnReady) {
|
|
294
|
+
el.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
raf(() => callback(el));
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
const inheritAttributes = (el, attributes = []) => {
|
|
301
|
+
const attributeObject = {};
|
|
302
|
+
attributes.forEach((attr) => {
|
|
303
|
+
if (el.hasAttribute(attr)) {
|
|
304
|
+
const value = el.getAttribute(attr);
|
|
305
|
+
if (value !== null) {
|
|
306
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
307
|
+
}
|
|
308
|
+
el.removeAttribute(attr);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
return attributeObject;
|
|
312
|
+
};
|
|
313
|
+
const ariaAttributes = [
|
|
314
|
+
'role',
|
|
315
|
+
'aria-activedescendant',
|
|
316
|
+
'aria-atomic',
|
|
317
|
+
'aria-autocomplete',
|
|
318
|
+
'aria-braillelabel',
|
|
319
|
+
'aria-brailleroledescription',
|
|
320
|
+
'aria-busy',
|
|
321
|
+
'aria-checked',
|
|
322
|
+
'aria-colcount',
|
|
323
|
+
'aria-colindex',
|
|
324
|
+
'aria-colindextext',
|
|
325
|
+
'aria-colspan',
|
|
326
|
+
'aria-controls',
|
|
327
|
+
'aria-current',
|
|
328
|
+
'aria-describedby',
|
|
329
|
+
'aria-description',
|
|
330
|
+
'aria-details',
|
|
331
|
+
'aria-disabled',
|
|
332
|
+
'aria-errormessage',
|
|
333
|
+
'aria-expanded',
|
|
334
|
+
'aria-flowto',
|
|
335
|
+
'aria-haspopup',
|
|
336
|
+
'aria-hidden',
|
|
337
|
+
'aria-invalid',
|
|
338
|
+
'aria-keyshortcuts',
|
|
339
|
+
'aria-label',
|
|
340
|
+
'aria-labelledby',
|
|
341
|
+
'aria-level',
|
|
342
|
+
'aria-live',
|
|
343
|
+
'aria-multiline',
|
|
344
|
+
'aria-multiselectable',
|
|
345
|
+
'aria-orientation',
|
|
346
|
+
'aria-owns',
|
|
347
|
+
'aria-placeholder',
|
|
348
|
+
'aria-posinset',
|
|
349
|
+
'aria-pressed',
|
|
350
|
+
'aria-readonly',
|
|
351
|
+
'aria-relevant',
|
|
352
|
+
'aria-required',
|
|
353
|
+
'aria-roledescription',
|
|
354
|
+
'aria-rowcount',
|
|
355
|
+
'aria-rowindex',
|
|
356
|
+
'aria-rowindextext',
|
|
357
|
+
'aria-rowspan',
|
|
358
|
+
'aria-selected',
|
|
359
|
+
'aria-setsize',
|
|
360
|
+
'aria-sort',
|
|
361
|
+
'aria-valuemax',
|
|
362
|
+
'aria-valuemin',
|
|
363
|
+
'aria-valuenow',
|
|
364
|
+
'aria-valuetext',
|
|
365
|
+
];
|
|
366
|
+
const inheritAriaAttributes = (el, ignoreList) => {
|
|
367
|
+
let attributesToInherit = ariaAttributes;
|
|
368
|
+
return inheritAttributes(el, attributesToInherit);
|
|
369
|
+
};
|
|
370
|
+
const raf = (h) => {
|
|
371
|
+
if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
|
372
|
+
return __zone_symbol__requestAnimationFrame(h);
|
|
373
|
+
}
|
|
374
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
375
|
+
return requestAnimationFrame(h);
|
|
376
|
+
}
|
|
377
|
+
return setTimeout(h);
|
|
378
|
+
};
|
|
379
|
+
function getDeepActiveElement(root = document) {
|
|
380
|
+
let activeElement = root.activeElement;
|
|
381
|
+
if (!activeElement) {
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
while (activeElement?.shadowRoot) {
|
|
385
|
+
const next = activeElement.shadowRoot.activeElement;
|
|
386
|
+
if (!next) {
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
activeElement = next;
|
|
390
|
+
}
|
|
391
|
+
return activeElement;
|
|
392
|
+
}
|
|
393
|
+
function canReceiveFocus(el) {
|
|
394
|
+
if (!el)
|
|
395
|
+
return false;
|
|
396
|
+
return (el instanceof HTMLElement && el.tabIndex >= 0 && !el.hasAttribute('disabled') && el.getAttribute('aria-hidden') !== 'true' && el.checkVisibility() && el.offsetParent !== null);
|
|
397
|
+
}
|
|
398
|
+
function findFormByRef(form, el) {
|
|
399
|
+
if (form instanceof HTMLFormElement) {
|
|
400
|
+
return form;
|
|
401
|
+
}
|
|
402
|
+
if (typeof form === 'string') {
|
|
403
|
+
const el = document.getElementById(form);
|
|
404
|
+
if (el) {
|
|
405
|
+
if (el instanceof HTMLFormElement) {
|
|
406
|
+
return el;
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
console.warn(`No Form found with selector: "#${form}". Verify that the element with id exists and is actually a <form> element.`, el);
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
console.warn(`No Form found with selector: "#${form}". Verify that the id is correct and the form is rendered in the DOM.`, el);
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (form !== undefined) {
|
|
419
|
+
console.warn(`The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.`, el);
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
return el.closest('form');
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
class ReactiveControllerHost {
|
|
426
|
+
controllers = new Set();
|
|
427
|
+
addController(controller) {
|
|
428
|
+
this.controllers.add(controller);
|
|
429
|
+
}
|
|
430
|
+
removeController(controller) {
|
|
431
|
+
this.controllers.delete(controller);
|
|
432
|
+
}
|
|
433
|
+
get activeControllers() {
|
|
434
|
+
return Array.from(this.controllers).filter(controller => !controller.disabled);
|
|
435
|
+
}
|
|
436
|
+
connectedCallback() {
|
|
437
|
+
if (!this.controllers.size) {
|
|
438
|
+
console.warn('ReactiveControllerHost connected with no controllers registered.', this);
|
|
439
|
+
}
|
|
440
|
+
this.activeControllers.forEach(controller => controller.hostConnected?.());
|
|
441
|
+
}
|
|
442
|
+
disconnectedCallback() {
|
|
443
|
+
this.activeControllers.forEach(controller => controller.hostDisconnected?.());
|
|
444
|
+
}
|
|
445
|
+
componentWillLoad() {
|
|
446
|
+
this.activeControllers.forEach(controller => controller.hostWillLoad?.());
|
|
447
|
+
}
|
|
448
|
+
componentDidLoad() {
|
|
449
|
+
this.activeControllers.forEach(controller => controller.hostDidLoad?.());
|
|
450
|
+
}
|
|
451
|
+
componentWillRender() {
|
|
452
|
+
this.activeControllers.forEach(controller => controller.hostWillRender?.());
|
|
453
|
+
}
|
|
454
|
+
componentDidRender() {
|
|
455
|
+
this.activeControllers.forEach(controller => controller.hostDidRender?.());
|
|
456
|
+
}
|
|
457
|
+
componentWillUpdate() {
|
|
458
|
+
this.activeControllers.forEach(controller => controller.hostWillUpdate?.());
|
|
459
|
+
}
|
|
460
|
+
componentDidUpdate() {
|
|
461
|
+
this.activeControllers.forEach(controller => controller.hostDidUpdate?.());
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
const lmvzButtonCss = () => ` @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } } :host { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; 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; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: contents; } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } `;
|
|
466
|
+
|
|
467
|
+
const LmvzButton = class extends ReactiveControllerHost {
|
|
468
|
+
get el() { return getElement(this); }
|
|
469
|
+
validationEl;
|
|
470
|
+
inheritedAttributes = {};
|
|
471
|
+
formEl = null;
|
|
472
|
+
formButtonEl = null;
|
|
473
|
+
lmvzActivation;
|
|
474
|
+
get ti() {
|
|
475
|
+
return 0;
|
|
476
|
+
}
|
|
477
|
+
scale = 'default';
|
|
478
|
+
variant = 'secondary';
|
|
479
|
+
disabled = false;
|
|
480
|
+
type = 'button';
|
|
481
|
+
form;
|
|
482
|
+
constructor(hostRef) {
|
|
483
|
+
super();
|
|
484
|
+
registerInstance(this, hostRef);
|
|
485
|
+
this.lmvzActivation = createEvent(this, "lmvzActivation");
|
|
486
|
+
this.addController(new AriaValidationController(this));
|
|
487
|
+
this.addController(new ElementActivationController(this, {
|
|
488
|
+
localHandler: this.handleClick.bind(this),
|
|
489
|
+
keys: ['Enter'],
|
|
490
|
+
}));
|
|
491
|
+
}
|
|
492
|
+
connectedCallback() {
|
|
493
|
+
this.inheritedAttributes = inheritAriaAttributes(this.el);
|
|
494
|
+
super.connectedCallback();
|
|
495
|
+
}
|
|
496
|
+
renderHiddenButton() {
|
|
497
|
+
const formEl = (this.formEl = findFormByRef(this.form, this.el));
|
|
498
|
+
if (!formEl)
|
|
499
|
+
return;
|
|
500
|
+
const { formButtonEl } = this;
|
|
501
|
+
if (formButtonEl !== null && formEl.contains(formButtonEl))
|
|
502
|
+
return;
|
|
503
|
+
const newFormButtonEl = (this.formButtonEl = document.createElement('button'));
|
|
504
|
+
newFormButtonEl.type = 'submit';
|
|
505
|
+
newFormButtonEl.style.display = 'none';
|
|
506
|
+
newFormButtonEl.disabled = this.disabled;
|
|
507
|
+
formEl.appendChild(newFormButtonEl);
|
|
508
|
+
}
|
|
509
|
+
submitForm(ev) {
|
|
510
|
+
if (this.formEl && this.formButtonEl) {
|
|
511
|
+
ev.preventDefault();
|
|
512
|
+
this.formButtonEl.click();
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
handleClick = (ev) => {
|
|
516
|
+
if (this.type === 'submit') {
|
|
517
|
+
this.submitForm(ev);
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
render() {
|
|
521
|
+
this.renderHiddenButton();
|
|
522
|
+
return (h(Host, { key: 'c6f44d3765d579e04ab91272747035d8589e2ff2', "aria-disabled": this.disabled ? 'true' : null }, h("button", { key: '9d48dfc7a6a23df1eda46e9c9035520789a08d4c', ref: (e) => (this.validationEl = e), disabled: this.disabled, class: classNames(this.variant, { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, h("slot", { key: '95e9fb932e477c7d6e933d2c00e6a3728e55c256' }))));
|
|
523
|
+
}
|
|
524
|
+
static get delegatesFocus() { return true; }
|
|
525
|
+
};
|
|
526
|
+
LmvzButton.style = lmvzButtonCss();
|
|
527
|
+
|
|
528
|
+
const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDYiIGhlaWdodD0iNzIiIHZpZXdCb3g9IjAgMCA0NiA3MiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzI3Ml80MDUpIj4KPHBhdGggZD0iTTEyLjUgMjAuNjVDMTMuMSAyMC42NSAxNC4yIDIwLjM1IDE0LjcgMjAuMzVDMTYuMSAyMC4zNSAxNy4yIDIxLjQ1IDE3LjIgMjIuODVDMTcuMiAyNC4yNSAxNi4xIDI1LjM1IDE0LjcgMjUuMzVIMi44QzEuMiAyNS4zNSAwIDI0LjE1IDAgMjIuNTVDMCAyMS45NSAwLjIgMjAuNjUgMC4yIDIwLjA1VjUuODQ5OTlDMC4yIDUuMTQ5OTkgMCAzLjk0OTk5IDAgMy4zNDk5OUMwIDEuNzQ5OTkgMS4yIDAuNTQ5OTg4IDIuOCAwLjU0OTk4OEM0LjMgMC41NDk5ODggNS42IDEuNzQ5OTkgNS42IDMuMzQ5OTlDNS42IDMuOTQ5OTkgNS40IDUuMTQ5OTkgNS40IDUuODQ5OTlWMjAuNTVIMTIuNVYyMC42NVpNMjIuMSAyMi43NUMyMi4xIDIyLjE1IDIyLjMgMjAuOTUgMjIuMyAyMC4yNVY1Ljg0OTk5QzIyLjMgNS4xNDk5OSAyMi4xIDMuOTQ5OTkgMjIuMSAzLjQ0OTk5QzIyLjEgMS45NDk5OSAyMy4yIDAuNzQ5OTg4IDI0LjYgMC43NDk5ODhIMjUuMkMyNi40IDAuNzQ5OTg4IDI3LjIgMS41NDk5OSAyNy42IDIuNjQ5OTlMMjggMy40NDk5OUwzMi45IDE0LjA1QzMzLjMgMTQuOTUgMzMuNyAxNi4wNSAzNCAxNi43NUMzNC4zIDE2LjA1IDM0LjcgMTQuOTUgMzUuMSAxNC4wNUw0MCAzLjU0OTk5TDQwLjMgMi41NDk5OUM0MC43IDEuNTQ5OTkgNDEuNSAwLjY0OTk4OCA0Mi42IDAuNjQ5OTg4SDQzLjJDNDQuNyAwLjY0OTk4OCA0NS43IDEuODQ5OTkgNDUuNyAzLjM0OTk5QzQ1LjcgMy45NDk5OSA0NS41IDUuMTQ5OTkgNDUuNSA1Ljc0OTk5VjIwLjE1QzQ1LjUgMjAuODUgNDUuNyAyMi4wNSA0NS43IDIyLjY1QzQ1LjcgMjQuMjUgNDQuNSAyNS40NSA0MyAyNS40NUM0MS40IDI1LjQ1IDQwLjMgMjQuMjUgNDAuMyAyMi42NUM0MC4zIDIxLjk1IDQwLjQgMjAuNzUgNDAuNCAyMC4xNUw0MC42IDE0LjA1QzQwLjYgMTMuMTUgNDAuNyAxMS43NSA0MC43IDEwLjY1TDM3IDE5LjA1QzM2LjcgMTkuNzUgMzYuNiAxOS45NSAzNi40IDIwLjM1QzM2IDIxLjI1IDM1LjMgMjEuODUgMzMuOSAyMS44NUMzMi41IDIxLjg1IDMxLjggMjEuMjUgMzEuNCAyMC40NUMzMS4yIDIwLjA1IDMxLjIgMTkuNzUgMzAuOCAxOS4wNUwyNyAxMC43NUMyNyAxMC43NSAyNy4xIDEzLjE1IDI3LjIgMTQuMDVMMjcuNCAyMC4xNUMyNy40IDIwLjg1IDI3LjUgMjEuOTUgMjcuNSAyMi42NUMyNy41IDI0LjI1IDI2LjQgMjUuNDUgMjQuOCAyNS40NUMyMy4zIDI1LjU1IDIyLjEgMjQuMjUgMjIuMSAyMi43NVpNMjguNyAzMi45NUMyOS4xIDMyLjk1IDMwLjIgMzMuMTUgMzAuNyAzMy4xNUg0MS44QzQyLjMgMzMuMTUgNDMuMiAzMi45NSA0My43IDMyLjk1QzQ0LjkgMzIuOTUgNDUuOCAzMy44NSA0NS44IDM1LjA1QzQ1LjggMzYuMTUgNDQuOSAzNy4xNSA0My43IDM3LjE1QzQzLjMgMzcuMTUgNDIuMyAzNi45NSA0MS44IDM2Ljk1SDMwLjhDMzAuMyAzNi45NSAyOS4yIDM3LjE1IDI4LjggMzcuMTVDMjcuNiAzNy4xNSAyNi43IDM2LjI1IDI2LjcgMzUuMDVDMjYuNiAzMy45NSAyNy41IDMyLjk1IDI4LjcgMzIuOTVaTTIuMSA2Ny4yNUMyLjUgNjcuMjUgMy42IDY3LjQ1IDQuMSA2Ny40NUgxOC41QzE5IDY3LjQ1IDE5LjkgNjcuMjUgMjAuNCA2Ny4yNUMyMS42IDY3LjI1IDIyLjUgNjguMTUgMjIuNSA2OS4zNUMyMi41IDcwLjQ1IDIxLjYgNzEuNDUgMjAuNCA3MS40NUMyMCA3MS40NSAxOSA3MS4yNSAxOC41IDcxLjI1SDQuMUMzLjYgNzEuMjUgMi41IDcxLjQ1IDIuMSA3MS40NUMwLjkgNzEuNDUgMCA3MC41NSAwIDY5LjM1QzAgNjguMjUgMC45IDY3LjI1IDIuMSA2Ny4yNVpNMjEuOSAzNS42NUMyMS45IDM1Ljk1IDIxLjggMzYuMzUgMjEuNiAzNi43NUMyMS4zIDM3LjQ1IDIwLjkgMzguMzUgMjAuNyAzOC44NUwxNC43IDU0LjY1QzE0LjUgNTUuMDUgMTQuNCA1NS41NSAxNC4yIDU2LjM1QzEzLjggNTcuNjUgMTIuNiA1OC4yNSAxMS4yIDU4LjI1SDEwLjhDOS40IDU4LjI1IDguMiA1Ny43NSA3LjggNTYuMzVDNy42IDU1LjU1IDcuNCA1NS4xNSA3LjIgNTQuNjVMMS4yIDM4Ljg1QzEgMzguMzUgMC42IDM3LjU1IDAuMiAzNi44NUMwLjEgMzYuNDUgMCAzNS45NSAwIDM1LjY1QzAgMzQuMTUgMS4yIDMyLjg1IDIuOCAzMi44NUMzLjkgMzIuODUgNSAzMy41NSA1LjMgMzQuNzVDNS41IDM1LjU1IDUuNSAzNi4xNSA2IDM3LjU1TDEwLjIgNDkuNDVDMTAuNSA1MC4zNSAxMC45IDUxLjQ1IDExLjEgNTIuMzVDMTEuMyA1MS40NSAxMS42IDUwLjQ1IDExLjkgNDkuNTVMMTYgMzcuNTVDMTYuNSAzNi4wNSAxNi40IDM1LjY1IDE2LjcgMzQuODVDMTcuMSAzMy42NSAxOC4xIDMyLjg1IDE5LjMgMzIuODVDMjAuOSAzMi44NSAyMS45IDM0LjE1IDIxLjkgMzUuNjVaTTI5LjcgNzEuNDVDMjguMiA3MS40NSAyNy4yIDcwLjQ1IDI3LjIgNjkuMTVDMjcuMiA2OC43NSAyNy4yIDY4LjI1IDI3LjggNjcuNDVMMzcuNCA1My40NUMzNy45IDUyLjc1IDM4LjUgNTIuMDUgMzkuMSA1MS4zNUgzMi4yQzMxLjUgNTEuMzUgMzAuNyA1MS42NSAzMC4xIDUxLjY1QzI4LjcgNTEuNjUgMjcuNiA1MC43NSAyNy42IDQ5LjM1QzI3LjYgNDcuOTUgMjguNyA0Ni45NSAzMC4xIDQ2Ljk1SDQyLjdDNDQuMiA0Ni45NSA0NS4yIDQ3Ljg1IDQ1LjIgNDkuMjVDNDUuMiA0OS42NSA0NSA1MC4zNSA0NC41IDUxLjA1TDM1LjIgNjQuODVDMzQuNyA2NS42NSAzNC4xIDY2LjQ1IDMzLjUgNjcuMDVINDEuMUM0MS45IDY3LjA1IDQyLjcgNjYuNzUgNDMuMyA2Ni43NUM0NC43IDY2Ljc1IDQ1LjcgNjcuNzUgNDUuNyA2OS4wNUM0NS43IDcwLjU1IDQ0LjUgNzEuNTUgNDMuMiA3MS41NUgyOS43VjcxLjQ1WiIgZmlsbD0iYmxhY2siLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8yNzJfNDA1Ij4KPHJlY3Qgd2lkdGg9IjQ2IiBoZWlnaHQ9IjcyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=';
|
|
529
|
+
|
|
530
|
+
class ListKeyboardNavigationController {
|
|
531
|
+
host;
|
|
532
|
+
elements = [];
|
|
533
|
+
constructor(host) {
|
|
534
|
+
this.host = host;
|
|
535
|
+
}
|
|
536
|
+
hostDidRender() {
|
|
537
|
+
this.host.el.addEventListener('keydown', this.handleKeydown);
|
|
538
|
+
}
|
|
539
|
+
updateElements(elements) {
|
|
540
|
+
this.elements = elements;
|
|
541
|
+
}
|
|
542
|
+
handleKeydown = (event) => {
|
|
543
|
+
const { key } = event;
|
|
544
|
+
if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft'].includes(key))
|
|
545
|
+
return;
|
|
546
|
+
const activeElement = getDeepActiveElement(document);
|
|
547
|
+
const nextElement = this.getNextFocusableElement(activeElement, ['ArrowDown', 'ArrowRight'].includes(key) ? 'down' : 'up');
|
|
548
|
+
if (nextElement) {
|
|
549
|
+
event.preventDefault();
|
|
550
|
+
nextElement.focus?.();
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
getNextFocusableElement(current, direction) {
|
|
554
|
+
if (!current)
|
|
555
|
+
return undefined;
|
|
556
|
+
const { elements } = this;
|
|
557
|
+
const currentIndex = elements.indexOf(current);
|
|
558
|
+
if (currentIndex === -1)
|
|
559
|
+
return undefined;
|
|
560
|
+
let nextIndex = undefined;
|
|
561
|
+
if (direction === 'down') {
|
|
562
|
+
nextIndex = (currentIndex + 1) % elements.length;
|
|
563
|
+
}
|
|
564
|
+
else if (direction === 'up') {
|
|
565
|
+
nextIndex = (currentIndex - 1 + elements.length) % elements.length;
|
|
566
|
+
}
|
|
567
|
+
if (nextIndex == undefined)
|
|
568
|
+
return undefined;
|
|
569
|
+
const candidate = elements[nextIndex];
|
|
570
|
+
if (!canReceiveFocus(candidate))
|
|
571
|
+
return this.getNextFocusableElement(candidate, direction);
|
|
572
|
+
return candidate;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
const lmvzHeaderCss = () => `:host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}`;
|
|
577
|
+
|
|
578
|
+
const LmvzHeader = class extends ReactiveControllerHost {
|
|
579
|
+
get el() { return getElement(this); }
|
|
580
|
+
get validationEl() {
|
|
581
|
+
return this.el;
|
|
582
|
+
}
|
|
583
|
+
primarySlot;
|
|
584
|
+
secondarySlot;
|
|
585
|
+
secondaryNav;
|
|
586
|
+
keyboardNavigationController = new ListKeyboardNavigationController(this);
|
|
587
|
+
get primaryMenuitems() {
|
|
588
|
+
return this.primarySlot?.assignedElements({ flatten: false }) || [];
|
|
589
|
+
}
|
|
590
|
+
get secondaryMenuitems() {
|
|
591
|
+
return this.secondarySlot?.assignedElements({ flatten: true }) || [];
|
|
592
|
+
}
|
|
593
|
+
get role() {
|
|
594
|
+
return 'banner';
|
|
595
|
+
}
|
|
596
|
+
lmvzActiveNav;
|
|
597
|
+
get secondarySlotName() {
|
|
598
|
+
return `connect-nav-${this.lmvzActiveNav}`;
|
|
599
|
+
}
|
|
600
|
+
constructor(hostRef) {
|
|
601
|
+
super();
|
|
602
|
+
registerInstance(this, hostRef);
|
|
603
|
+
this.addController(new AriaValidationController(this, { reValidateOnPropChanges: true }));
|
|
604
|
+
this.addController(this.keyboardNavigationController);
|
|
605
|
+
}
|
|
606
|
+
handleActiveNavChange() {
|
|
607
|
+
this.updateElementsActive();
|
|
608
|
+
}
|
|
609
|
+
componentDidLoad() {
|
|
610
|
+
this.primarySlot?.addEventListener('slotchange', this.handlePrimaryNavItemsChange.bind(this));
|
|
611
|
+
this.handlePrimaryNavItemsChange();
|
|
612
|
+
this.secondarySlot?.addEventListener('slotchange', this.handleSecondaryNavItemsChange.bind(this));
|
|
613
|
+
super.componentDidLoad();
|
|
614
|
+
}
|
|
615
|
+
handlePrimaryNavItemsChange() {
|
|
616
|
+
const items = this.primaryMenuitems;
|
|
617
|
+
if (!items.length) {
|
|
618
|
+
console.warn('Primary slot has no assigned elements. Please add navigation items to the primary slot.');
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
items.forEach((el) => {
|
|
622
|
+
el.setAttribute('aria-haspopup', 'true');
|
|
623
|
+
el.setAttribute('aria-controls', `nav-secondary`);
|
|
624
|
+
});
|
|
625
|
+
this.updateElementsActive();
|
|
626
|
+
this.updateKeyboardNavSubjects();
|
|
627
|
+
}
|
|
628
|
+
handleSecondaryNavItemsChange() {
|
|
629
|
+
const items = this.secondaryMenuitems;
|
|
630
|
+
if (!items.length) {
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
this.updateKeyboardNavSubjects();
|
|
634
|
+
}
|
|
635
|
+
updateKeyboardNavSubjects() {
|
|
636
|
+
this.keyboardNavigationController.updateElements([...this.primaryMenuitems, ...this.secondaryMenuitems]);
|
|
637
|
+
}
|
|
638
|
+
updateElementsActive() {
|
|
639
|
+
const items = this.primaryMenuitems;
|
|
640
|
+
if (!items.length)
|
|
641
|
+
return;
|
|
642
|
+
let label = '';
|
|
643
|
+
items.forEach((el) => {
|
|
644
|
+
const isActive = el.id === this.lmvzActiveNav;
|
|
645
|
+
if (isActive)
|
|
646
|
+
label = el.textContent || el.id;
|
|
647
|
+
el.setAttribute('aria-expanded', isActive ? 'true' : 'false');
|
|
648
|
+
});
|
|
649
|
+
if (!label)
|
|
650
|
+
return;
|
|
651
|
+
this.secondaryNav?.setAttribute('aria-label', `Untermenü für ${label}`);
|
|
652
|
+
}
|
|
653
|
+
delegateFocus() {
|
|
654
|
+
const firstFocusable = this.primaryMenuitems[0];
|
|
655
|
+
if (firstFocusable) {
|
|
656
|
+
firstFocusable.focus();
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
render() {
|
|
660
|
+
return (h(Host, { key: '35883b5d4a92d10b5b010d822fb2233604464f9b', onFocus: this.delegateFocus.bind(this) }, h("div", { key: '6fdec3af75bab2b076651b8cfef4aec8e23326a6', class: "brand" }, h("slot", { key: '3127b4223b8bebfe425efc7ce45626f37fbf76b9', name: "brand" }, h("img", { key: '20b3dd598e320c6950fb08bbd55dd80c47552eaf', id: "fallback-logo-lmvz", src: logoSvg, alt: "Lehrmittelverlag Z\u00FCrich" }))), h("nav", { key: 'c3bf07f78930085c1a7b89421506bcd41d139911', "aria-label": "Hauptnavigation" }, h("div", { key: 'fbc5199080f52da4f10c8c14fbbc0877ecc5f31c', role: "menubar", class: "primary-menubar" }, h("slot", { key: '4210d213dcf7a1a27a73f2a9cf7ff97fec62f0db', name: "nav-primary", ref: (el) => (this.primarySlot = el) }), h("div", { key: '7b91c269f75e1245f75d471ec5bb7eeabfe1094d', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: (el) => (this.secondaryNav = el) }, h("slot", { key: 'e23eb0f222b49d912bb45870df6d9b0d01f43788', name: this.secondarySlotName, ref: (el) => (this.secondarySlot = el) })))), h("div", { key: '4b19026d5b2e54aa7aed072ce57de4acaa75cb4f', class: "actions" }, h("slot", { key: '8f02d5d178bb60b40604fcd1be74d373d89c911f', name: "actions" }))));
|
|
661
|
+
}
|
|
662
|
+
static get watchers() { return {
|
|
663
|
+
"lmvzActiveNav": [{
|
|
664
|
+
"handleActiveNavChange": 0
|
|
665
|
+
}]
|
|
666
|
+
}; }
|
|
667
|
+
};
|
|
668
|
+
LmvzHeader.style = lmvzHeaderCss();
|
|
669
|
+
|
|
670
|
+
const lmvzIconCss = () => `.sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height: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)}}`;
|
|
671
|
+
|
|
672
|
+
const LmvzIcon = class extends ReactiveControllerHost {
|
|
673
|
+
intersectionObserver;
|
|
674
|
+
ariaValidationController = new AriaValidationController(this);
|
|
675
|
+
get el() { return getElement(this); }
|
|
676
|
+
validationEl;
|
|
677
|
+
icon;
|
|
678
|
+
weight = 'medium';
|
|
679
|
+
size = 'md';
|
|
680
|
+
iconData;
|
|
681
|
+
visible = false;
|
|
682
|
+
ariaLabel;
|
|
683
|
+
get ariaHidden() {
|
|
684
|
+
return !this.ariaLabel;
|
|
685
|
+
}
|
|
686
|
+
constructor(hostRef) {
|
|
687
|
+
super();
|
|
688
|
+
registerInstance(this, hostRef);
|
|
689
|
+
this.addController(this.ariaValidationController);
|
|
690
|
+
}
|
|
691
|
+
connectedCallback() {
|
|
692
|
+
this.waitUntilVisible(() => {
|
|
693
|
+
this.visible = true;
|
|
694
|
+
this.loadIconPathData();
|
|
695
|
+
});
|
|
696
|
+
super.connectedCallback();
|
|
697
|
+
}
|
|
698
|
+
disconnectedCallback() {
|
|
699
|
+
if (this.intersectionObserver) {
|
|
700
|
+
this.intersectionObserver.disconnect();
|
|
701
|
+
this.intersectionObserver = undefined;
|
|
702
|
+
}
|
|
703
|
+
super.disconnectedCallback();
|
|
704
|
+
}
|
|
705
|
+
async loadIconPathData() {
|
|
706
|
+
const { icon, visible } = this;
|
|
707
|
+
if (!icon || !visible) {
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
this.iconData = await runPromise(fetchIconSvg(this.icon).pipe(tapError((error) => logError(`Error loading icon "${icon}":`, error.message, error.cause, error.stack)), catchAll(() => succeed(emptyDefaultSvg()))));
|
|
711
|
+
}
|
|
712
|
+
componentDidRender() {
|
|
713
|
+
this.validationEl = this.el.querySelector('svg');
|
|
714
|
+
this.ariaValidationController.revalidateAria();
|
|
715
|
+
super.componentDidRender();
|
|
716
|
+
}
|
|
717
|
+
render() {
|
|
718
|
+
return h(Host, { key: 'f5c2f8025d0e9598d903e72770ebca6cad01961c', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
719
|
+
}
|
|
720
|
+
waitUntilVisible(callback, rootMargin = 50) {
|
|
721
|
+
if (typeof window === 'undefined' || !window.IntersectionObserver) {
|
|
722
|
+
callback();
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
this.intersectionObserver = new IntersectionObserver((entries) => {
|
|
726
|
+
entries.some((entry) => {
|
|
727
|
+
if (entry.isIntersecting) {
|
|
728
|
+
this.intersectionObserver?.disconnect();
|
|
729
|
+
this.intersectionObserver = undefined;
|
|
730
|
+
callback();
|
|
731
|
+
return true;
|
|
732
|
+
}
|
|
733
|
+
return false;
|
|
734
|
+
});
|
|
735
|
+
}, { rootMargin: `${rootMargin}px` });
|
|
736
|
+
this.intersectionObserver.observe(this.el);
|
|
737
|
+
}
|
|
738
|
+
static get assetsDirs() { return ["../../assets/icons"]; }
|
|
739
|
+
static get watchers() { return {
|
|
740
|
+
"icon": [{
|
|
741
|
+
"loadIconPathData": 0
|
|
742
|
+
}]
|
|
743
|
+
}; }
|
|
744
|
+
};
|
|
745
|
+
LmvzIcon.style = lmvzIconCss();
|
|
746
|
+
|
|
747
|
+
const lmvzInputCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --input-border-color-focus: var(--lmvz-semantic-color-status-on-selected, #0e7ab4); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: 48px; --input-padding-x: 16px; --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); --label-floating-scale: 0.85; --label-minimized-top: -6px; --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: 8px; } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); outline: 2px solid var(--input-border-color-focus); outline-offset: 2px; } .input-container.sc-lmvz-input:has(input:focus-visible) .input-wrapper.sc-lmvz-input { box-shadow: 0 0 0 3px rgb(0 86 214 / 20%); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } [error].sc-lmvz-input-h:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); outline-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: 14px; font-family: Router, sans-serif; font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: normal; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0; transform: translateY(-50%) scale(0.85); transform-origin: left top; background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 500; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: 14px; outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } div.sc-lmvz-input:empty { display: none; } [role='status'].sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--helper-text-color); font-family: Router, sans-serif; font-weight: 500; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--error-text-color); font-family: Router, sans-serif; font-weight: 500; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: 4px; }`;
|
|
748
|
+
|
|
749
|
+
let inputIdCounter = 0;
|
|
750
|
+
const LmvzInput = class extends ReactiveControllerHost {
|
|
751
|
+
get el() { return getElement(this); }
|
|
752
|
+
get validationEl() {
|
|
753
|
+
return this.el;
|
|
754
|
+
}
|
|
755
|
+
lmvzInput;
|
|
756
|
+
internals;
|
|
757
|
+
nativeInputElement;
|
|
758
|
+
inputId = `lmvz-input-${inputIdCounter++}`;
|
|
759
|
+
initialValue = '';
|
|
760
|
+
nativeError = false;
|
|
761
|
+
errorFromProp = false;
|
|
762
|
+
get helperId() {
|
|
763
|
+
return this.helperText ? `${this.inputId}-helper` : undefined;
|
|
764
|
+
}
|
|
765
|
+
get showErrorMessage() {
|
|
766
|
+
return this.error && Boolean(this.errorMessage);
|
|
767
|
+
}
|
|
768
|
+
get errorId() {
|
|
769
|
+
return `${this.inputId}-error`;
|
|
770
|
+
}
|
|
771
|
+
get describedBy() {
|
|
772
|
+
const ids = [];
|
|
773
|
+
if (this.helperId)
|
|
774
|
+
ids.push(this.helperId);
|
|
775
|
+
if (this.showErrorMessage)
|
|
776
|
+
ids.push(this.errorId);
|
|
777
|
+
return ids.length > 0 ? ids.join(' ') : undefined;
|
|
778
|
+
}
|
|
779
|
+
value;
|
|
780
|
+
label;
|
|
781
|
+
helperText;
|
|
782
|
+
placeholder;
|
|
783
|
+
disabled = false;
|
|
784
|
+
readonly = false;
|
|
785
|
+
required = false;
|
|
786
|
+
name;
|
|
787
|
+
type = 'text';
|
|
788
|
+
errorMessage;
|
|
789
|
+
autocomplete;
|
|
790
|
+
inputmode;
|
|
791
|
+
autocorrect;
|
|
792
|
+
autocapitalize;
|
|
793
|
+
spellcheck;
|
|
794
|
+
autofocus = false;
|
|
795
|
+
minlength;
|
|
796
|
+
maxlength;
|
|
797
|
+
pattern;
|
|
798
|
+
min;
|
|
799
|
+
max;
|
|
800
|
+
step;
|
|
801
|
+
form;
|
|
802
|
+
get error() {
|
|
803
|
+
return this.errorFromProp || this.nativeError;
|
|
804
|
+
}
|
|
805
|
+
set error(value) {
|
|
806
|
+
this.errorFromProp = value;
|
|
807
|
+
}
|
|
808
|
+
async setValue(newValue) {
|
|
809
|
+
const input = this.nativeInputElement;
|
|
810
|
+
const val = newValue ?? '';
|
|
811
|
+
if (input) {
|
|
812
|
+
input.value = val;
|
|
813
|
+
}
|
|
814
|
+
this.value = val;
|
|
815
|
+
this.internals.setFormValue?.(val);
|
|
816
|
+
this.lmvzInput.emit(val);
|
|
817
|
+
}
|
|
818
|
+
async focusInput() {
|
|
819
|
+
this.nativeInputElement?.focus();
|
|
820
|
+
}
|
|
821
|
+
async blurInput() {
|
|
822
|
+
this.nativeInputElement?.blur();
|
|
823
|
+
}
|
|
824
|
+
async select() {
|
|
825
|
+
this.nativeInputElement?.select();
|
|
826
|
+
}
|
|
827
|
+
async checkValidity() {
|
|
828
|
+
return this.nativeInputElement?.checkValidity?.() ?? false;
|
|
829
|
+
}
|
|
830
|
+
async reportValidity() {
|
|
831
|
+
return this.nativeInputElement?.reportValidity?.() ?? false;
|
|
832
|
+
}
|
|
833
|
+
async getInputElement() {
|
|
834
|
+
if (!this.nativeInputElement) {
|
|
835
|
+
await new Promise((resolve) => componentOnReady(this.el, resolve));
|
|
836
|
+
}
|
|
837
|
+
return Promise.resolve(this.nativeInputElement);
|
|
838
|
+
}
|
|
839
|
+
constructor(hostRef) {
|
|
840
|
+
super();
|
|
841
|
+
registerInstance(this, hostRef);
|
|
842
|
+
this.lmvzInput = createEvent(this, "lmvzInput");
|
|
843
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
844
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
848
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
849
|
+
}
|
|
850
|
+
this.addController(new AriaValidationController(this, {
|
|
851
|
+
reValidateOnPropChanges: true,
|
|
852
|
+
}));
|
|
853
|
+
}
|
|
854
|
+
componentWillLoad() {
|
|
855
|
+
this.initialValue = this.value ?? '';
|
|
856
|
+
super.componentWillLoad();
|
|
857
|
+
}
|
|
858
|
+
formAssociatedCallback(form) {
|
|
859
|
+
if (!form)
|
|
860
|
+
return;
|
|
861
|
+
this.internals.setFormValue?.(this.value ?? '');
|
|
862
|
+
}
|
|
863
|
+
formResetCallback() {
|
|
864
|
+
this.internals.setValidity({});
|
|
865
|
+
this.setValue(this.initialValue);
|
|
866
|
+
}
|
|
867
|
+
formStateRestoreCallback(state) {
|
|
868
|
+
this.setValue(state);
|
|
869
|
+
}
|
|
870
|
+
handleValueChange(newValue) {
|
|
871
|
+
if (!this.nativeInputElement)
|
|
872
|
+
return;
|
|
873
|
+
const isInternalChange = this.nativeInputElement.value === newValue;
|
|
874
|
+
if (isInternalChange)
|
|
875
|
+
return;
|
|
876
|
+
this.setValue(newValue);
|
|
877
|
+
}
|
|
878
|
+
handleDisabledChange(disabled) {
|
|
879
|
+
if (disabled && this.nativeInputElement) {
|
|
880
|
+
this.nativeInputElement.blur();
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
handleInput = (event) => {
|
|
884
|
+
const input = event.target;
|
|
885
|
+
this.setValue(input.value);
|
|
886
|
+
};
|
|
887
|
+
handleChange = (event) => {
|
|
888
|
+
const input = event.target ?? this.nativeInputElement;
|
|
889
|
+
this.updateNativeError(input);
|
|
890
|
+
};
|
|
891
|
+
handleFocus = () => { };
|
|
892
|
+
handleBlur = (event) => {
|
|
893
|
+
const input = event.target;
|
|
894
|
+
input.reportValidity?.();
|
|
895
|
+
};
|
|
896
|
+
updateNativeError(fromEvent) {
|
|
897
|
+
const input = fromEvent ?? this.nativeInputElement;
|
|
898
|
+
if (!input)
|
|
899
|
+
return;
|
|
900
|
+
this.nativeError = !(input.checkValidity?.() ?? true);
|
|
901
|
+
}
|
|
902
|
+
render() {
|
|
903
|
+
const hasValue = Boolean(this.value);
|
|
904
|
+
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
905
|
+
return (h("div", { key: '195e2c5046d48d01f4912993bde3c8d2b3a73d1d', class: classNames('input-container', {
|
|
906
|
+
'interaction-filled': hasValue,
|
|
907
|
+
}) }, h("div", { key: '66bc3deab063a309eefc0de5ebf7f54331c9190c', class: "input-wrapper" }, h("slot", { key: 'fac318070421d526bb09ba0dd0efdecf8964d952', name: "before-input" }), h("div", { key: '1945152dc010d571c5886f222332b057e89e496c', class: "label-input-group" }, h("label", { key: 'd57392c2c83b1e5f362dd33fa9d060e570417f3f', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (h("span", { key: '507603a50eb08f0f4f5e2b87b2550fe6b657c4d4', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), h("input", { key: '0fe916fef48618331806142c0d3500d9e6dec9cb', id: this.inputId, ref: (el) => (this.nativeInputElement = el), 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, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur })), h("slot", { key: 'b415bedde58862e5bd7621f73a1d77bc478850a3', name: "after-input" })), h("div", { key: 'bc0e07f5243417f4c632eb2f7976dc944fdbf17a', id: this.helperId, role: "status" }, this.helperText || null), h("div", { key: '62e2267453b92edd47077b233cb231a1deecedc4', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
908
|
+
}
|
|
909
|
+
static get formAssociated() { return true; }
|
|
910
|
+
static get watchers() { return {
|
|
911
|
+
"value": [{
|
|
912
|
+
"handleValueChange": 0
|
|
913
|
+
}],
|
|
914
|
+
"disabled": [{
|
|
915
|
+
"handleDisabledChange": 0
|
|
916
|
+
}]
|
|
917
|
+
}; }
|
|
918
|
+
};
|
|
919
|
+
LmvzInput.style = lmvzInputCss();
|
|
920
|
+
|
|
921
|
+
const lmvzMenuitemCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } .sc-lmvz-menuitem-h { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-lg, 14px); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); padding: var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)) var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); cursor: pointer; --lmvz-menuitem-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); --lmvz-menuitem-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); background: var(--lmvz-menuitem-background); color: var(--lmvz-menuitem-color); } .sc-lmvz-menuitem-h:hover { --lmvz-menuitem-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } .sc-lmvz-menuitem-h:active { --lmvz-menuitem-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } .sc-lmvz-menuitem-h:focus-visible { z-index: 1; } [aria-expanded='true'].sc-lmvz-menuitem-h { --lmvz-menuitem-background: var(--lmvz-semantic-color-status-selected, #f1f9fe); --lmvz-menuitem-color: var(--lmvz-semantic-color-status-on-selected, #0e7ab4); }`;
|
|
922
|
+
|
|
923
|
+
const LmvzMenuItem = class extends ReactiveControllerHost {
|
|
924
|
+
get el() { return getElement(this); }
|
|
925
|
+
get validationEl() {
|
|
926
|
+
return this.el;
|
|
927
|
+
}
|
|
928
|
+
validationSlot;
|
|
929
|
+
get role() {
|
|
930
|
+
return 'menuitem';
|
|
931
|
+
}
|
|
932
|
+
get ti() {
|
|
933
|
+
return 0;
|
|
934
|
+
}
|
|
935
|
+
lmvzActivation;
|
|
936
|
+
constructor(hostRef) {
|
|
937
|
+
super();
|
|
938
|
+
registerInstance(this, hostRef);
|
|
939
|
+
this.lmvzActivation = createEvent(this, "lmvzActivation");
|
|
940
|
+
this.addController(new AriaValidationController(this, { validationTiming: 'slot' }));
|
|
941
|
+
this.addController(new ElementActivationController(this));
|
|
942
|
+
}
|
|
943
|
+
render() {
|
|
944
|
+
return (h(Host, { key: '1a37d2873a29c713cf95c60070c8dcf045c9f8fc' }, h("slot", { key: 'c6578bcfdb9f0cebad095d80f0ed63cf663bf91e', ref: (e) => (this.validationSlot = e) })));
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
LmvzMenuItem.style = lmvzMenuitemCss();
|
|
948
|
+
|
|
949
|
+
const chevronDownSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIwLjMzMzQgOC42NjY2M0wxMi4wMDAxIDE3TDMuNjY2NzUgOC42NjY2MyIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=';
|
|
950
|
+
|
|
951
|
+
const lmvzSelectCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } .sc-lmvz-select-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --lmvz-internal-select-floating-label-top-offset: 0.375rem; padding-top: var(--lmvz-internal-select-floating-label-top-offset); --lmvz-select-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-select-bg: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-select-bg-hover: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-select-text-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-select-label-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --lmvz-select-padding-x: var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --lmvz-select-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-select-height: 40px; --lmvz-select-label-font-size: var(--lmvz-component-component-typography-body-sm-font-size, 0.75rem); --lmvz-select-label-top-offset: calc(var(--lmvz-internal-select-floating-label-top-offset) * -1); --lmvz-select-label-minimized-padding-x: 4px; --lmvz-select-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); --lmvz-select-helper-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --lmvz-select-focus-color: var(--lmvz-semantic-color-status-on-selected, #0e7ab4); --lmvz-select-error-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); } .select-wrapper.sc-lmvz-select { position: relative; height: var(--lmvz-select-height); } label.sc-lmvz-select { position: absolute; top: 50%; left: var(--lmvz-select-padding-x); font-size: var(--lmvz-select-label-font-size); color: var(--lmvz-select-label-color); line-height: normal; white-space: nowrap; pointer-events: none; z-index: 2; transform: translateY(-50%); transform-origin: left top; transition: top 0.2s ease-out, transform 0.2s ease-out, opacity 0.2s ease-out, padding 0.2s ease-out; } label.assistive-label.sc-lmvz-select { opacity: 0; padding: 0; } label.floating-label.sc-lmvz-select { top: var(--lmvz-select-label-top-offset); transform: translateY(0) scale(0.85); left: calc(var(--lmvz-select-padding-x) - 2px); background-color: var(--lmvz-select-bg); padding: 0 var(--lmvz-select-label-minimized-padding-x); opacity: 1; font-weight: 500; } label.sc-lmvz-select > span[aria-hidden='true'].sc-lmvz-select, div[aria-hidden='true'].sc-lmvz-select > span.sc-lmvz-select:first-child > span[aria-hidden='true'].sc-lmvz-select { color: var(--lmvz-select-error-color); margin-left: 2px; display: inline-block; line-height: 0; vertical-align: middle; } div[aria-hidden].sc-lmvz-select { display: flex; align-items: center; gap: var(--lmvz-select-gap); height: 100%; padding: 0 var(--lmvz-select-padding-x); border-radius: var(--lmvz-select-radius); background-color: var(--lmvz-select-bg); cursor: pointer; position: relative; z-index: 1; transition: background-color 0.15s ease; } .sc-lmvz-select-h:not([disabled]) .select-wrapper.sc-lmvz-select:hover div[aria-hidden].sc-lmvz-select { background-color: var(--lmvz-select-bg-hover); } .select-wrapper.sc-lmvz-select:focus-within div[aria-hidden].sc-lmvz-select { outline: 2px solid var(--lmvz-select-focus-color); outline-offset: 2px; } div[aria-hidden].sc-lmvz-select > span.sc-lmvz-select:first-child { flex: 1 0 0; font-size: var(--lmvz-component-component-typography-body-md-font-size, 0.875rem); font-weight: var(--lmvz-global-font-weight-500, 500); color: var(--lmvz-select-text-color); line-height: 1.4; letter-spacing: var(--lmvz-component-body-md-letter-spacing, 0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } div[aria-hidden].sc-lmvz-select > span.sc-lmvz-select:last-child { flex-shrink: 0; display: flex; align-items: center; justify-content: center; } img.sc-lmvz-select { display: block; width: var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); height: var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); } select.sc-lmvz-select { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; border: none; background: transparent; margin: 0; padding: 0; } [disabled].sc-lmvz-select-h .select-wrapper.sc-lmvz-select { opacity: var(--lmvz-select-disabled-opacity); pointer-events: none; cursor: not-allowed; } [role='status'].sc-lmvz-select { margin-top: 4px; padding-left: var(--lmvz-select-padding-x); font-size: var(--lmvz-select-label-font-size); color: var(--lmvz-select-helper-color); line-height: normal; }`;
|
|
952
|
+
|
|
953
|
+
let selectIdCounter = 0;
|
|
954
|
+
const LmvzSelect = class extends ReactiveControllerHost {
|
|
955
|
+
get el() { return getElement(this); }
|
|
956
|
+
get validationEl() {
|
|
957
|
+
return this.el;
|
|
958
|
+
}
|
|
959
|
+
selectId = `lmvz-select-${selectIdCounter++}`;
|
|
960
|
+
nativeSelectEl;
|
|
961
|
+
constructor(hostRef) {
|
|
962
|
+
super();
|
|
963
|
+
registerInstance(this, hostRef);
|
|
964
|
+
this.lmvzChange = createEvent(this, "lmvzChange");
|
|
965
|
+
this.addController(new AriaValidationController(this));
|
|
966
|
+
}
|
|
967
|
+
lmvzChange;
|
|
968
|
+
value;
|
|
969
|
+
label;
|
|
970
|
+
helperText;
|
|
971
|
+
disabled = false;
|
|
972
|
+
required = false;
|
|
973
|
+
name;
|
|
974
|
+
selectedLabel = '';
|
|
975
|
+
get hasValue() {
|
|
976
|
+
return Boolean(this.value);
|
|
977
|
+
}
|
|
978
|
+
componentDidLoad() {
|
|
979
|
+
this.syncSelectedLabel();
|
|
980
|
+
super.componentDidLoad();
|
|
981
|
+
}
|
|
982
|
+
handleValueChange(newValue) {
|
|
983
|
+
if (this.nativeSelectEl && this.nativeSelectEl.value !== (newValue ?? '')) {
|
|
984
|
+
this.nativeSelectEl.value = newValue ?? '';
|
|
985
|
+
}
|
|
986
|
+
this.syncSelectedLabel();
|
|
987
|
+
}
|
|
988
|
+
syncSelectedLabel() {
|
|
989
|
+
if (!this.nativeSelectEl)
|
|
990
|
+
return;
|
|
991
|
+
const idx = this.nativeSelectEl.selectedIndex;
|
|
992
|
+
this.selectedLabel = idx >= 0 ? (this.nativeSelectEl.options[idx]?.text ?? '') : '';
|
|
993
|
+
}
|
|
994
|
+
handleChange = (event) => {
|
|
995
|
+
const select = event.target;
|
|
996
|
+
this.value = select.value;
|
|
997
|
+
this.syncSelectedLabel();
|
|
998
|
+
this.lmvzChange.emit(select.value);
|
|
999
|
+
};
|
|
1000
|
+
render() {
|
|
1001
|
+
const hasValue = this.hasValue;
|
|
1002
|
+
const shouldShowLabel = hasValue;
|
|
1003
|
+
return (h(Host, { key: '7d1abb943f79e90451b43c9221801b80a2f61346' }, h("div", { key: 'ded3e45246ab38e89d444c59239cdc63a2c4d4fc', class: "select-wrapper" }, h("label", { key: 'cb68ff79976c2fb55d4cc827f9e90ba2597a8a43', htmlFor: this.selectId, class: shouldShowLabel ? 'floating-label' : 'assistive-label' }, this.label, this.required && shouldShowLabel && h("span", { key: 'ab77eaea1645b95d90f00ffb609bbd7a1704f7bc', "aria-hidden": "true" }, " *")), h("div", { key: '45cee00478a6cc31c10dddf69d8e6687fc8f440d', "aria-hidden": "true" }, h("span", { key: '0c5d425ea8843234aa6abd94a207377e2a675686' }, hasValue ? this.selectedLabel : this.label, this.required && !hasValue && h("span", { key: 'ebef5322371ee0253b50dd801b80cbb6402c067a', "aria-hidden": "true" }, " *")), h("span", { key: 'a12d31dc29563444f728133f181b48914d31705b' }, h("img", { key: 'dd3f175d1ca2b9ccc6c2bfa2075e5da62016a896', src: chevronDownSvg, alt: "" }))), h("select", { key: 'a196f3b824177d1b45971c38341bf6a2939dda82', id: this.selectId, ref: (el) => (this.nativeSelectEl = el), name: this.name, disabled: this.disabled, required: this.required, "aria-label": this.label, onChange: this.handleChange }, !hasValue && h("option", { key: '536cc559def0e9ffa4b2150693ece9a597c238d1', value: "", disabled: true, selected: true, hidden: true }), h("slot", { key: 'ad9fed96b9f8c1d8257511bb1d5ab5ee756973ce' }))), this.helperText && h("div", { key: '4723b44d781c900be5aae7ece2a0be04b6c744b9', role: "status" }, this.helperText)));
|
|
1004
|
+
}
|
|
1005
|
+
static get watchers() { return {
|
|
1006
|
+
"value": [{
|
|
1007
|
+
"handleValueChange": 0
|
|
1008
|
+
}]
|
|
1009
|
+
}; }
|
|
1010
|
+
};
|
|
1011
|
+
LmvzSelect.style = lmvzSelectCss();
|
|
1012
|
+
|
|
1013
|
+
export { HeaderIntegration as header_integration, LmvzButton as lmvz_button, LmvzHeader as lmvz_header, LmvzIcon as lmvz_icon, LmvzInput as lmvz_input, LmvzMenuItem as lmvz_menuitem, LmvzSelect as lmvz_select };
|
|
1014
|
+
//# sourceMappingURL=header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem.lmvz-select.entry.js.map
|
|
1015
|
+
|
|
1016
|
+
//# sourceMappingURL=header-integration_7.entry.js.map
|