@lmvz-ds/components 0.35.2 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/assets/icons/calendar.svg +7 -0
- package/cjs/{aria-validation-controller-BC0Eaiv4.js → aria-validation-controller-Do0uEK4t.js} +1 -1
- package/cjs/{directional-focus-controller-DBat-oF7.js → directional-focus-controller-3uDoin45.js} +3 -1
- package/cjs/{element-activation-controller-BHqCUgQv.js → element-activation-controller-BWtUKzu2.js} +1 -1
- package/cjs/{element.util-CRS_YJ59.js → element.util-CctmBvUY.js} +14 -0
- package/cjs/{index-TGsVZNDP.js → index-BgvZ4y-3.js} +12 -0
- package/cjs/lmvz-action-list.cjs.entry.js +4 -4
- package/cjs/lmvz-action.cjs.entry.js +1 -1
- package/cjs/lmvz-button-group.cjs.entry.js +2 -2
- package/cjs/lmvz-button_2.cjs.entry.js +5 -5
- package/cjs/lmvz-card.cjs.entry.js +1 -1
- package/cjs/lmvz-checkbox.cjs.entry.js +2 -2
- package/cjs/lmvz-chip.cjs.entry.js +2 -2
- package/cjs/lmvz-components.cjs.js +2 -2
- package/cjs/lmvz-datepicker.cjs.entry.js +2764 -0
- package/cjs/lmvz-header_2.cjs.entry.js +6 -6
- package/cjs/{lmvz-popover.cjs.entry.js → lmvz-input_2.cjs.entry.js} +230 -11
- package/cjs/lmvz-link.cjs.entry.js +2 -2
- package/cjs/lmvz-menuitem.cjs.entry.js +5 -5
- package/cjs/lmvz-message.cjs.entry.js +2 -2
- package/cjs/lmvz-modal.cjs.entry.js +4 -4
- package/cjs/lmvz-radio.cjs.entry.js +3 -3
- package/cjs/lmvz-select.cjs.entry.js +3 -3
- package/cjs/lmvz-snackbar.cjs.entry.js +2 -2
- package/cjs/lmvz-spinner.cjs.entry.js +2 -2
- package/cjs/lmvz-tab.cjs.entry.js +2 -2
- package/cjs/lmvz-tabs.cjs.entry.js +4 -4
- package/cjs/lmvz-toggle.cjs.entry.js +4 -5
- package/cjs/loader.cjs.js +2 -2
- package/cjs/{async.util-Dnl6c82X.js → stencil.util-TjS8_DoU.js} +13 -1
- package/collection/assets/icons/calendar.svg +7 -0
- package/collection/collection-manifest.json +1 -0
- package/collection/components/lmvz-datepicker/lmvz-datepicker.css +166 -0
- package/collection/components/lmvz-datepicker/lmvz-datepicker.js +988 -0
- package/collection/components/lmvz-datepicker/lmvz-datepicker.utils.js +189 -0
- package/collection/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.js +300 -0
- package/collection/components/lmvz-header/lmvz-header.js +1 -1
- package/collection/components/lmvz-icon/lmvz-icon.js +1 -1
- package/collection/components/lmvz-input/lmvz-input.js +40 -2
- package/collection/components/lmvz-link/lmvz-link.js +1 -1
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
- package/collection/components/lmvz-message/lmvz-message.js +1 -1
- package/collection/components/lmvz-modal/lmvz-modal.js +1 -1
- package/collection/components/lmvz-popover/lmvz-popover.js +6 -2
- package/collection/components/lmvz-radio/lmvz-radio.js +1 -1
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/components/lmvz-snackbar/lmvz-snackbar.js +1 -1
- package/collection/components/lmvz-spinner/lmvz-spinner.js +1 -1
- package/collection/components/lmvz-tab/lmvz-tab.js +1 -1
- package/collection/components/lmvz-tabs/lmvz-tabs.js +1 -1
- package/collection/components/lmvz-toggle/lmvz-toggle.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/utils/aria/aria.constants.js +7 -0
- package/collection/utils/aria/directional-focus-controller.js +3 -1
- package/collection/utils/element/element.util.js +5 -0
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.bak +2 -0
- package/components/index.js +1 -1
- package/components/lmvz-action-list.js +1 -1
- package/components/lmvz-action.js +1 -1
- package/components/lmvz-button-group.js +1 -1
- package/components/lmvz-button.js +1 -1
- package/components/lmvz-card.js +1 -1
- package/components/lmvz-checkbox.js +1 -1
- package/components/lmvz-chip.js +1 -1
- package/components/lmvz-datepicker.d.ts +11 -0
- package/components/lmvz-datepicker.d.ts.bak +11 -0
- package/components/lmvz-datepicker.js +1 -0
- package/components/lmvz-header.js +1 -1
- package/components/lmvz-icon.js +1 -1
- package/components/lmvz-input.js +1 -1
- package/components/lmvz-link.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-message.js +1 -1
- package/components/lmvz-modal.js +1 -1
- package/components/lmvz-popover.js +1 -1
- package/components/lmvz-radio.js +1 -1
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-snackbar.js +1 -1
- package/components/lmvz-spinner.js +1 -1
- package/components/lmvz-tab.js +1 -1
- package/components/lmvz-tabs.js +1 -1
- package/components/lmvz-toggle.js +1 -1
- package/components/{p-Chj7BuUZ.js → p--FDdvoIg.js} +1 -1
- package/components/{p-CFTmV4XZ.js → p-BAj4FkUt.js} +1 -1
- package/components/{p-CxLd309t.js → p-BLMXiDE0.js} +1 -1
- package/components/{p-DGg7OzDl.js → p-BPYBmylI.js} +1 -1
- package/components/p-BhALzK62.js +1 -0
- package/components/{p-B_rnXUwq.js → p-Bnri3fEI.js} +1 -1
- package/components/p-C-pRMuMh.js +1 -0
- package/components/p-CPuI0_r_.js +1 -0
- package/components/p-CWpl0WaZ.js +1 -0
- package/components/{p-D5FL8n1q.js → p-CrQCHVKL.js} +1 -1
- package/components/p-DqdrUt_G.js +1 -0
- package/components/{p-CgK6-SEe.js → p-diOze8wI.js} +1 -1
- package/esm/{aria-validation-controller-BvOU1BO8.js → aria-validation-controller-Cp6pofER.js} +1 -1
- package/esm/{directional-focus-controller-DgAdCZrG.js → directional-focus-controller-Bhu7RqYE.js} +3 -1
- package/esm/{element-activation-controller-7PNSl6io.js → element-activation-controller-BuwyVq4A.js} +1 -1
- package/esm/{element.util-BFcYfHYq.js → element.util-Bd9JyKJZ.js} +13 -1
- package/esm/{index-BPeerEwm.js → index-BOXP1Vx0.js} +12 -1
- package/esm/lmvz-action-list.entry.js +4 -4
- package/esm/lmvz-action.entry.js +1 -1
- package/esm/lmvz-button-group.entry.js +2 -2
- package/esm/lmvz-button_2.entry.js +5 -5
- package/esm/lmvz-card.entry.js +1 -1
- package/esm/lmvz-checkbox.entry.js +2 -2
- package/esm/lmvz-chip.entry.js +2 -2
- package/esm/lmvz-components.js +3 -3
- package/esm/lmvz-datepicker.entry.js +2762 -0
- package/esm/lmvz-header_2.entry.js +6 -6
- package/esm/{lmvz-popover.entry.js → lmvz-input_2.entry.js} +227 -9
- package/esm/lmvz-link.entry.js +2 -2
- package/esm/lmvz-menuitem.entry.js +5 -5
- package/esm/lmvz-message.entry.js +2 -2
- package/esm/lmvz-modal.entry.js +4 -4
- package/esm/lmvz-radio.entry.js +3 -3
- package/esm/lmvz-select.entry.js +3 -3
- package/esm/lmvz-snackbar.entry.js +2 -2
- package/esm/lmvz-spinner.entry.js +2 -2
- package/esm/lmvz-tab.entry.js +2 -2
- package/esm/lmvz-tabs.entry.js +4 -4
- package/esm/lmvz-toggle.entry.js +4 -5
- package/esm/loader.js +3 -3
- package/esm/{async.util-DZj20TV1.js → stencil.util-C3QOYC8E.js} +13 -1
- package/hydrate/index.js +3079 -237
- package/hydrate/index.mjs +3079 -237
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-eb62d4af.entry.js → p-0af0211a.entry.js} +1 -1
- package/lmvz-components/{p-0c05f24b.entry.js → p-3d5867df.entry.js} +1 -1
- package/lmvz-components/{p-a887018d.entry.js → p-492adf21.entry.js} +1 -1
- package/lmvz-components/{p-24d13be6.entry.js → p-4fa6e72f.entry.js} +1 -1
- package/lmvz-components/{p-5bbbcfc0.entry.js → p-544e3ccb.entry.js} +1 -1
- package/lmvz-components/{p-eb4c5a6f.entry.js → p-63f6a596.entry.js} +1 -1
- package/lmvz-components/{p-d45164a8.entry.js → p-7a7aa922.entry.js} +1 -1
- package/lmvz-components/{p-b6dd045b.entry.js → p-8022c6dc.entry.js} +1 -1
- package/lmvz-components/{p-BPeerEwm.js → p-BOXP1Vx0.js} +2 -2
- package/lmvz-components/p-Bd9JyKJZ.js +1 -0
- package/lmvz-components/{p-D9PQIBzA.js → p-BeY96W7m.js} +1 -1
- package/lmvz-components/p-C3QOYC8E.js +1 -0
- package/lmvz-components/p-GGkwaiT6.js +1 -0
- package/lmvz-components/{p-wlMjNjuv.js → p-UhNgD4L3.js} +1 -1
- package/lmvz-components/{p-d4154a65.entry.js → p-a611c110.entry.js} +1 -1
- package/lmvz-components/{p-46edf36f.entry.js → p-b1bb4393.entry.js} +1 -1
- package/lmvz-components/p-b50b1cb5.entry.js +1 -0
- package/lmvz-components/{p-f42b16e6.entry.js → p-b932cf91.entry.js} +1 -1
- package/lmvz-components/p-bff115d4.entry.js +1 -0
- package/lmvz-components/p-d280d21a.entry.js +1 -0
- package/lmvz-components/{p-c2544495.entry.js → p-d48203f9.entry.js} +1 -1
- package/lmvz-components/{p-e4ce63b3.entry.js → p-d9aede81.entry.js} +1 -1
- package/lmvz-components/{p-ecbd9e93.entry.js → p-dbfbcb74.entry.js} +1 -1
- package/lmvz-components/{p-fbf066d9.entry.js → p-f0e28f3a.entry.js} +1 -1
- package/lmvz-components/{p-aaa7691c.entry.js → p-f853faae.entry.js} +1 -1
- package/lmvz-components/p-fa2efc42.entry.js +1 -0
- package/lmvz-components/{p-194a3af5.entry.js → p-fe6f5bdc.entry.js} +1 -1
- package/manifest.json +940 -159
- package/package.json +5 -1
- package/types/api/ds.constants.d.ts +0 -1
- package/types/api/ds.types.d.ts +8 -0
- package/types/components/lmvz-action/lmvz-action.d.ts +0 -1
- package/types/components/lmvz-action-list/lmvz-action-list.d.ts +0 -1
- package/types/components/lmvz-button/lmvz-button.d.ts +0 -1
- package/types/components/lmvz-button-group/lmvz-button-group.d.ts +0 -1
- package/types/components/lmvz-card/lmvz-card.d.ts +0 -1
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +0 -1
- package/types/components/lmvz-chip/lmvz-chip.d.ts +0 -1
- package/types/components/lmvz-datepicker/lmvz-datepicker.d.ts +75 -0
- package/types/components/lmvz-datepicker/lmvz-datepicker.utils.d.ts +22 -0
- package/types/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.d.ts +1 -0
- package/types/components/lmvz-header/lmvz-header.d.ts +0 -1
- package/types/components/lmvz-icon/lmvz-icon.d.ts +0 -1
- package/types/components/lmvz-input/lmvz-input.d.ts +5 -1
- package/types/components/lmvz-link/lmvz-link.d.ts +0 -1
- package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +0 -1
- package/types/components/lmvz-message/lmvz-message.d.ts +0 -1
- package/types/components/lmvz-message/public.d.ts +0 -1
- package/types/components/lmvz-modal/lmvz-modal.d.ts +0 -1
- package/types/components/lmvz-modal/test/testing.d.ts +0 -1
- package/types/components/lmvz-popover/lmvz-popover.d.ts +0 -1
- package/types/components/lmvz-radio/lmvz-radio.d.ts +0 -1
- package/types/components/lmvz-select/lmvz-select.d.ts +0 -1
- package/types/components/lmvz-snackbar/lmvz-snackbar.d.ts +0 -1
- package/types/components/lmvz-snackbar/public.d.ts +0 -1
- package/types/components/lmvz-snackbar/snackbar-controller.d.ts +0 -1
- package/types/components/lmvz-spinner/lmvz-spinner.d.ts +0 -1
- package/types/components/lmvz-tab/lmvz-tab.d.ts +0 -1
- package/types/components/lmvz-tabs/lmvz-tabs.d.ts +0 -1
- package/types/components/lmvz-toggle/lmvz-toggle.d.ts +0 -1
- package/types/components.d.ts +216 -0
- package/types/index.d.ts +0 -1
- package/types/utils/aria/aria-validation-controller.d.ts +0 -1
- package/types/utils/aria/aria.constants.d.ts +1 -1
- package/types/utils/aria/directional-focus-controller.d.ts +0 -1
- package/types/utils/aria/element-activation-controller.d.ts +0 -1
- package/types/utils/async/async.util.d.ts +1 -2
- package/types/utils/data/event.util.d.ts +0 -1
- package/types/utils/data/number.util.d.ts +0 -1
- package/types/utils/data/object.util.d.ts +0 -1
- package/types/utils/data/time.util.d.ts +0 -1
- package/types/utils/element/element.util.d.ts +1 -1
- package/types/utils/environment.d.ts +0 -1
- package/types/utils/icons/icons-registry.d.ts +0 -1
- package/types/utils/icons/icons.d.ts +0 -1
- package/types/utils/icons/icons.unit.d.ts +0 -1
- package/types/utils/icons/public.d.ts +0 -1
- package/types/utils/public.d.ts +0 -1
- package/types/utils/radio/radio-group-controller.d.ts +0 -1
- package/types/utils/stencil/assets.d.ts +0 -1
- package/types/utils/stencil/reactive-controller-host.d.ts +0 -1
- package/types/utils/stencil/stencil.util.d.ts +0 -1
- package/cjs/lmvz-input.cjs.entry.js +0 -186
- package/cjs/stencil.util-CBrPLd-F.js +0 -17
- package/components/p-DLUsBYJH.js +0 -1
- package/components/p-zMWemcoB.js +0 -1
- package/esm/lmvz-input.entry.js +0 -184
- package/esm/stencil.util-D2-5rsN3.js +0 -15
- package/lmvz-components/p-5ff55ba9.entry.js +0 -1
- package/lmvz-components/p-888e04d7.entry.js +0 -1
- package/lmvz-components/p-9dc420e2.entry.js +0 -1
- package/lmvz-components/p-BFcYfHYq.js +0 -1
- package/lmvz-components/p-BuEA0MWd.js +0 -1
- package/lmvz-components/p-DZj20TV1.js +0 -1
- package/lmvz-components/p-bh9cItsP.js +0 -1
- package/lmvz-components/p-c3e62aba.entry.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Attributes, Button, FormRef } from '../../api';
|
|
2
|
+
export declare function isInputElement(element: unknown): boolean;
|
|
2
3
|
export declare function isActionButton(element: Element): element is HTMLButtonElement;
|
|
3
4
|
export declare function isLmvzButton(element?: Element): element is HTMLLmvzButtonElement;
|
|
4
5
|
export declare function isDisabledButton(element: HTMLButtonElement): boolean;
|
|
@@ -22,4 +23,3 @@ export declare function findFormByRef(form: FormRef, el: HTMLElement): HTMLFormE
|
|
|
22
23
|
export declare function isInteractiveElement(el: HTMLElement): boolean;
|
|
23
24
|
export declare function isHtmlElement(element: unknown): element is HTMLElement;
|
|
24
25
|
export {};
|
|
25
|
-
//# sourceMappingURL=element.util.d.ts.map
|
|
@@ -10,4 +10,3 @@ export declare function registerIconProvider<I extends KnownIconSetId>(id: I, pr
|
|
|
10
10
|
export declare function getRegisteredIconProvider<I extends KnownIconSetId>(id: I): IconProvider<KnownIconName<I>> | undefined;
|
|
11
11
|
export declare function getRegisteredIconProvider(id?: string | undefined): IconProvider<string> | undefined;
|
|
12
12
|
export {};
|
|
13
|
-
//# sourceMappingURL=icons-registry.d.ts.map
|
|
@@ -4,4 +4,3 @@ export type IconData = SVGString;
|
|
|
4
4
|
export declare function resolveIconSvg<I extends KnownIconSetId>(options: IconPropsForSet<I>): Promise<IconData>;
|
|
5
5
|
export declare function resolveIconSvg(options: IconPropsFallback): Promise<IconData>;
|
|
6
6
|
export declare function typedIconFromSet<S extends string>(iconset: S, icon: IconPropsForSetWithoutFallback<S>['icon']): IconPropsForSetWithoutFallback<S>;
|
|
7
|
-
//# sourceMappingURL=icons.d.ts.map
|
package/types/utils/public.d.ts
CHANGED
|
@@ -30,4 +30,3 @@ export declare class ReactiveControllerHost implements ComponentInterface {
|
|
|
30
30
|
}
|
|
31
31
|
export declare function registerLmvzComponentMetaInfo<K extends keyof LmvzComponentMeta>(el: HTMLElement, key: K, info: LmvzComponentMeta[K]): void;
|
|
32
32
|
export declare function getLmvzComponentMetaInfo<K extends keyof LmvzComponentMeta>(el: HTMLElement, key: K): LmvzComponentMeta[K] | undefined;
|
|
33
|
-
//# sourceMappingURL=reactive-controller-host.d.ts.map
|
|
@@ -4,4 +4,3 @@ type LazyLoadedComponent<T extends HTMLElement> = T & {
|
|
|
4
4
|
export declare const componentOnReady: <T extends HTMLElement>(stencilEl: T, callback: (el: T) => unknown) => void;
|
|
5
5
|
export declare const hasLazyBuild: <T extends HTMLElement>(stencilEl: T) => stencilEl is LazyLoadedComponent<T>;
|
|
6
6
|
export {};
|
|
7
|
-
//# sourceMappingURL=stencil.util.d.ts.map
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-TGsVZNDP.js');
|
|
4
|
-
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
|
-
var ariaValidationController = require('./aria-validation-controller-BC0Eaiv4.js');
|
|
6
|
-
var reactiveControllerHost = require('./reactive-controller-host-Bc6B_T45.js');
|
|
7
|
-
var stencil_util = require('./stencil.util-CBrPLd-F.js');
|
|
8
|
-
require('./aria-loader-DWUVcapD.js');
|
|
9
|
-
require('./async.util-Dnl6c82X.js');
|
|
10
|
-
|
|
11
|
-
const lmvzInputCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #a1a1a1); --input-border-color-focus: var(--lmvz-semantic-color-border-active, #0f8acc); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #a31419); --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } [size='sm'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); --input-padding-x: var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); --input-gap: var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem)); --input-font-size: var(--lmvz-component-body-sm-font-size, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } [size='md'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); } [size='lg'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem)); --input-padding-x: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); --input-gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --input-font-size: var(--lmvz-component-body-lg-font-size, clamp(1rem, 0.97rem + 0.13vw, 1.13rem)); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: var(--input-gap); } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: var(--input-font-size); font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: 1.5; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0.5em; transform: translateY(-100%); transform-origin: left top; font-size: var(--lmvz-component-body-2xs-font-size, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 400; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: var(--input-font-size); outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } div.sc-lmvz-input:empty { display: none; } [role='status'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--helper-text-color); font-weight: 400; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--error-text-color); font-weight: 400; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: var(--lmvz-dimension-6-4, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); --lmvz-button-min-height-override: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); }`;
|
|
12
|
-
|
|
13
|
-
let inputIdCounter = 0;
|
|
14
|
-
const LmvzInput = class extends reactiveControllerHost.ReactiveControllerHost {
|
|
15
|
-
get el() { return index.getElement(this); }
|
|
16
|
-
get validationEl() {
|
|
17
|
-
return this.el;
|
|
18
|
-
}
|
|
19
|
-
lmvzInput;
|
|
20
|
-
internals;
|
|
21
|
-
nativeInputElement;
|
|
22
|
-
inputId = `lmvz-input-${inputIdCounter++}`;
|
|
23
|
-
initialValue = '';
|
|
24
|
-
nativeError = false;
|
|
25
|
-
errorFromProp = false;
|
|
26
|
-
get helperId() {
|
|
27
|
-
return this.helperText ? `${this.inputId}-helper` : undefined;
|
|
28
|
-
}
|
|
29
|
-
get showErrorMessage() {
|
|
30
|
-
return this.error && Boolean(this.errorMessage);
|
|
31
|
-
}
|
|
32
|
-
get errorId() {
|
|
33
|
-
return `${this.inputId}-error`;
|
|
34
|
-
}
|
|
35
|
-
get describedBy() {
|
|
36
|
-
const ids = [];
|
|
37
|
-
if (this.helperId)
|
|
38
|
-
ids.push(this.helperId);
|
|
39
|
-
if (this.showErrorMessage)
|
|
40
|
-
ids.push(this.errorId);
|
|
41
|
-
return ids.length > 0 ? ids.join(' ') : undefined;
|
|
42
|
-
}
|
|
43
|
-
value;
|
|
44
|
-
label;
|
|
45
|
-
helperText;
|
|
46
|
-
placeholder;
|
|
47
|
-
disabled = false;
|
|
48
|
-
readonly = false;
|
|
49
|
-
required = false;
|
|
50
|
-
name;
|
|
51
|
-
type = 'text';
|
|
52
|
-
errorMessage;
|
|
53
|
-
autocomplete;
|
|
54
|
-
inputmode;
|
|
55
|
-
autocorrect;
|
|
56
|
-
autocapitalize;
|
|
57
|
-
spellcheck;
|
|
58
|
-
autofocus = false;
|
|
59
|
-
minlength;
|
|
60
|
-
maxlength;
|
|
61
|
-
pattern;
|
|
62
|
-
min;
|
|
63
|
-
max;
|
|
64
|
-
step;
|
|
65
|
-
form;
|
|
66
|
-
size = 'md';
|
|
67
|
-
get error() {
|
|
68
|
-
return this.errorFromProp || this.nativeError;
|
|
69
|
-
}
|
|
70
|
-
set error(value) {
|
|
71
|
-
this.errorFromProp = value;
|
|
72
|
-
}
|
|
73
|
-
async setValue(newValue) {
|
|
74
|
-
const input = this.nativeInputElement;
|
|
75
|
-
const val = newValue ?? '';
|
|
76
|
-
if (input) {
|
|
77
|
-
input.value = val;
|
|
78
|
-
}
|
|
79
|
-
this.value = val;
|
|
80
|
-
this.internals.setFormValue?.(val);
|
|
81
|
-
this.lmvzInput.emit(val);
|
|
82
|
-
}
|
|
83
|
-
async focusInput() {
|
|
84
|
-
this.nativeInputElement?.focus();
|
|
85
|
-
}
|
|
86
|
-
async blurInput() {
|
|
87
|
-
this.nativeInputElement?.blur();
|
|
88
|
-
}
|
|
89
|
-
async select() {
|
|
90
|
-
this.nativeInputElement?.select();
|
|
91
|
-
}
|
|
92
|
-
async checkValidity() {
|
|
93
|
-
return this.nativeInputElement?.checkValidity?.() ?? false;
|
|
94
|
-
}
|
|
95
|
-
async reportValidity() {
|
|
96
|
-
return this.nativeInputElement?.reportValidity?.() ?? false;
|
|
97
|
-
}
|
|
98
|
-
async getInputElement() {
|
|
99
|
-
if (!this.nativeInputElement) {
|
|
100
|
-
await new Promise((resolve) => stencil_util.componentOnReady(this.el, resolve));
|
|
101
|
-
}
|
|
102
|
-
return Promise.resolve(this.nativeInputElement);
|
|
103
|
-
}
|
|
104
|
-
constructor(hostRef) {
|
|
105
|
-
super();
|
|
106
|
-
index.registerInstance(this, hostRef);
|
|
107
|
-
this.lmvzInput = index.createEvent(this, "lmvzInput", 7);
|
|
108
|
-
if (hostRef.$hostElement$["s-ei"]) {
|
|
109
|
-
this.internals = hostRef.$hostElement$["s-ei"];
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
this.internals = hostRef.$hostElement$.attachInternals();
|
|
113
|
-
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
114
|
-
}
|
|
115
|
-
this.addController(new ariaValidationController.AriaValidationController(this, {
|
|
116
|
-
reValidateOnPropChanges: true,
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
componentWillLoad() {
|
|
120
|
-
this.initialValue = this.value ?? '';
|
|
121
|
-
super.componentWillLoad();
|
|
122
|
-
}
|
|
123
|
-
formAssociatedCallback(form) {
|
|
124
|
-
if (!form)
|
|
125
|
-
return;
|
|
126
|
-
this.internals.setFormValue?.(this.value ?? '');
|
|
127
|
-
}
|
|
128
|
-
formResetCallback() {
|
|
129
|
-
this.internals.setValidity({});
|
|
130
|
-
this.setValue(this.initialValue);
|
|
131
|
-
}
|
|
132
|
-
formStateRestoreCallback(state) {
|
|
133
|
-
this.setValue(state);
|
|
134
|
-
}
|
|
135
|
-
handleValueChange(newValue) {
|
|
136
|
-
if (!this.nativeInputElement)
|
|
137
|
-
return;
|
|
138
|
-
const isInternalChange = this.nativeInputElement.value === newValue;
|
|
139
|
-
if (isInternalChange)
|
|
140
|
-
return;
|
|
141
|
-
this.setValue(newValue);
|
|
142
|
-
}
|
|
143
|
-
handleDisabledChange(disabled) {
|
|
144
|
-
if (disabled && this.nativeInputElement) {
|
|
145
|
-
this.nativeInputElement.blur();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
handleInput = (event) => {
|
|
149
|
-
const input = event.target;
|
|
150
|
-
this.setValue(input.value);
|
|
151
|
-
};
|
|
152
|
-
handleChange = (event) => {
|
|
153
|
-
const input = event.target ?? this.nativeInputElement;
|
|
154
|
-
this.updateNativeError(input);
|
|
155
|
-
};
|
|
156
|
-
handleFocus = () => { };
|
|
157
|
-
handleBlur = (event) => {
|
|
158
|
-
const input = event.target;
|
|
159
|
-
input.checkValidity?.();
|
|
160
|
-
};
|
|
161
|
-
updateNativeError(fromEvent) {
|
|
162
|
-
const input = fromEvent ?? this.nativeInputElement;
|
|
163
|
-
if (!input)
|
|
164
|
-
return;
|
|
165
|
-
this.nativeError = !(input.checkValidity?.() ?? true);
|
|
166
|
-
}
|
|
167
|
-
render() {
|
|
168
|
-
const hasValue = Boolean(this.value);
|
|
169
|
-
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
170
|
-
return (index.h("div", { key: '693614c334a94373dcef56b461455bf872249a69', class: index$1.classNames('input-container', {
|
|
171
|
-
'interaction-filled': hasValue,
|
|
172
|
-
}) }, index.h("div", { key: '0eb36d76661d70bea71027ca7b30763d89bd6cb6', class: "input-wrapper" }, index.h("slot", { key: '03adf18ebe01fe70dc821dcea2bb2963df40f8b4', name: "before-input" }), index.h("div", { key: 'f1254561b53e321d0f2e4cf4ac93936119083f3f', class: "label-input-group" }, index.h("label", { key: 'e17cdec368fd36a041d9d8853f4a82249f1b5d8c', htmlFor: this.inputId, class: index$1.classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (index.h("span", { key: 'b3e003bf972c3ad5b6c5b25f8ee509bd5d8df758', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), index.h("input", { key: '75f192118b7a4c3e507172e13d0ae7e32118aad3', 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 })), index.h("slot", { key: '58a9701259ca92fd7441c1480de741d92bc47bc9', name: "after-input" })), index.h("div", { key: '396b719d080c781f38d736e28e9c048f629d6ffe', id: this.helperId, role: "status" }, this.helperText || null), index.h("div", { key: '9e5c86e6098f58d95c0984348d3da07b9e34e1fb', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
173
|
-
}
|
|
174
|
-
static get formAssociated() { return true; }
|
|
175
|
-
static get watchers() { return {
|
|
176
|
-
"value": [{
|
|
177
|
-
"handleValueChange": 0
|
|
178
|
-
}],
|
|
179
|
-
"disabled": [{
|
|
180
|
-
"handleDisabledChange": 0
|
|
181
|
-
}]
|
|
182
|
-
}; }
|
|
183
|
-
};
|
|
184
|
-
LmvzInput.style = lmvzInputCss();
|
|
185
|
-
|
|
186
|
-
exports.lmvz_input = LmvzInput;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var async_util = require('./async.util-Dnl6c82X.js');
|
|
4
|
-
|
|
5
|
-
const componentOnReady = (stencilEl, callback) => {
|
|
6
|
-
if (hasLazyBuild(stencilEl)) {
|
|
7
|
-
stencilEl.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
async_util.raf(() => callback(stencilEl));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const hasLazyBuild = (stencilEl) => {
|
|
14
|
-
return stencilEl.componentOnReady !== undefined;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.componentOnReady = componentOnReady;
|
package/components/p-DLUsBYJH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./p-zMWemcoB.js";import{r as s,g as i}from"./p-CgK6-SEe.js";function e(t){return Boolean(i(t,"isFocusControllerHost"))}const n={orientation:"both",enableHomeAndEnd:!1,manageTabIndex:!1};class o{host;elements=[];currentElement;config;constructor(t,s={}){this.host=t,this.config={...n,...s}}hostConnected(){s(this.host.el,"isFocusControllerHost",!0),this.host.el.addEventListener("keydown",this.handleKeydown),this.syncManagedFocusTarget()}hostDisconnected(){this.host.el.removeEventListener("keydown",this.handleKeydown)}updateElements(t){const s=this.currentElement??this.getManagedActiveElement()??void 0;this.elements=t.filter((t=>"focus"in t&&1===t.nodeType)),this.syncManagedFocusTarget(s)}setCurrentElement(t){const s=this.currentElement;this.currentElement=null!=t&&"focus"in t&&1===t.nodeType?t:void 0,this.syncManagedFocusTarget(s)}async initFocus(){const t=this.selectManagedElement();t&&this.applyFocusTarget(t,!0)}handleKeydown=t=>{const s=this.getFocusIntent(t.key);if(!s)return;const i=this.getManagedActiveElement(),e=this.getTargetElement(i,s);e&&(t.preventDefault(),this.applyFocusTarget(e,!0))};getFocusIntent(t){return this.config.enableHomeAndEnd&&"Home"===t?"first":this.config.enableHomeAndEnd&&"End"===t?"last":"horizontal"===this.config.orientation?"ArrowRight"===t?"next":"ArrowLeft"===t?"previous":void 0:"vertical"===this.config.orientation?"ArrowDown"===t?"next":"ArrowUp"===t?"previous":void 0:"ArrowDown"===t||"ArrowRight"===t?"next":"ArrowUp"===t||"ArrowLeft"===t?"previous":void 0}getManagedActiveElement(){const s=t(this.host.el.ownerDocument??document);if(s instanceof HTMLElement){const t=this.elements.find((t=>function(t){return function(t){return"function"==typeof t.resolveFocusableElement}(t)?t.resolveFocusableElement()??t:t}(t)===s));if(t&&this.canMoveFocusTo(t))return t}if(this.currentElement&&this.elements.includes(this.currentElement)&&this.canMoveFocusTo(this.currentElement))return this.currentElement}getTargetElement(t,s){if(!this.elements.length)return;if("first"===s)return this.findFocusableFromIndex(-1,"next");if("last"===s)return this.findFocusableFromIndex(this.elements.length,"previous");const i=t?this.elements.indexOf(t):-1;return-1===i?"next"===s?this.findFocusableFromIndex(-1,"next"):this.findFocusableFromIndex(this.elements.length,"previous"):this.findFocusableFromIndex(i,s)}findFocusableFromIndex(t,s){if(!this.elements.length)return;const i="next"===s?1:-1;for(let s=1;s<=this.elements.length;s++){const e=this.elements[(t+i*s+this.elements.length)%this.elements.length];if(this.canMoveFocusTo(e))return e}}syncManagedFocusTarget(t){const s=this.selectManagedElement(t),i=s!==this.currentElement;this.currentElement=s,this.config.manageTabIndex&&this.updateTabIndexes(s),i&&s&&this.config.onFocusTargetChange?.(s)}selectManagedElement(t){const s=this.getManagedActiveElement();if(s)return s;if(this.currentElement&&this.elements.includes(this.currentElement)&&this.canMoveFocusTo(this.currentElement))return this.currentElement;if(t&&this.elements.includes(t))return this.findFocusableFromIndex(this.elements.indexOf(t),"next")??this.findFocusableFromIndex(-1,"next");return this.elements.find((t=>0===t.tabIndex&&this.canMoveFocusTo(t)))||this.findFocusableFromIndex(-1,"next")}updateTabIndexes(t){this.elements.forEach((s=>{s.tabIndex=t&&s===t?0:-1}))}applyFocusTarget(t,s){const i=t!==this.currentElement;this.currentElement=t,this.config.manageTabIndex&&this.updateTabIndexes(t),s&&t.focus(),i&&this.config.onFocusTargetChange?.(t)}canMoveFocusTo(t){return!!t&&(!t.hasAttribute("disabled")&&((!("disabled"in t)||!Boolean(t.disabled))&&("true"!==t.getAttribute("aria-disabled")&&(this.config.isFocusableElement?this.config.isFocusableElement(t):(this.config.manageTabIndex||t.tabIndex>=0)&&"true"!==t.getAttribute("aria-hidden")&&(t.checkVisibility?.()??!0)&&null!==t.offsetParent))))}}export{o as D,e as i}
|
package/components/p-zMWemcoB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"];function e(a){return["LMVZ-BUTTON","BUTTON"].includes(a.tagName.toUpperCase())}function r(a){return"LMVZ-BUTTON"===a?.tagName.toUpperCase()}function i(a){return a.hasAttribute("disabled")||!0===a.disabled}function n(a){return!a.hasAttribute("hidden")}function t(a){const e=a.getAttribute("variant")??a.variant;return"primary"===e||"secondary"===e||"tertiary"===e?e:"secondary"}function o(a){return"primary"===t(a)}function l(a){return"secondary"===t(a)}const s=(e,r)=>{let i=a;return r&&r.length>0&&(i=i.filter((a=>!r.includes(a)))),((a,e=[])=>{const r={};return e.forEach((e=>{a.hasAttribute(e)&&(null!==a.getAttribute(e)&&(r[e]=a.getAttribute(e)),a.removeAttribute(e))})),r})(e,i)};function c(a=document){let e=a.activeElement;if(!e)return null;for(;e?.shadowRoot;){const a=e.shadowRoot.activeElement;if(!a)break;e=a}return e}function u(a,e){if(!a)return;if(e(a))return a;const r=Array.from(a.shadowRoot?a.shadowRoot.children:a.children);for(const a of r){const r=u(a,e);if(r)return r}}function d(a){return!!a&&a instanceof HTMLElement&&a.tabIndex>=0&&!a.hasAttribute("disabled")&&"true"!==a.getAttribute("aria-hidden")&&a.checkVisibility()&&null!==a.offsetParent}function f(a,e){if(a instanceof HTMLFormElement)return a;if("string"==typeof a){const e=document.getElementById(a);return e?e instanceof HTMLFormElement?e:(console.warn(`No Form found with selector: "#${a}". Verify that the element with id exists and is actually a <form> element.`,e),null):(console.warn(`No Form found with selector: "#${a}". Verify that the id is correct and the form is rendered in the DOM.`,e),null)}return void 0!==a?(console.warn('The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.',e),null):e.closest("form")}function m(a){const e=a.tagName.toLowerCase();if(["button","lmvz-button","input","lmvz-input","select","lmvz-select","textarea"].includes(e))return!0;if(["a","lmvz-link"].includes(e)&&a.hasAttribute("href"))return!0;if(a.hasAttribute("tabindex")){const e=parseInt(a.getAttribute("tabindex")??"-1");return(isNaN(e)||e<0)&&console.warn("Interactive element is not keyboard accessible due to negative tabindex!",a),!0}const r=a.getAttribute("role");return!(!r||!["button","link","menuitem","option","combobox","listbox","checkbox","radio","switch","tab"].includes(r))}function b(a){return a instanceof HTMLElement}export{s as a,o as b,n as c,e as d,i as e,l as f,c as g,d as h,r as i,b as j,m as k,f as l,u as w}
|
package/esm/lmvz-input.entry.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { g as getElement, r as registerInstance, c as createEvent, h } from './index-BPeerEwm.js';
|
|
2
|
-
import { c as classNames } from './index-BfTCfPZ1.js';
|
|
3
|
-
import { A as AriaValidationController } from './aria-validation-controller-BvOU1BO8.js';
|
|
4
|
-
import { R as ReactiveControllerHost } from './reactive-controller-host-CICeIanv.js';
|
|
5
|
-
import { c as componentOnReady } from './stencil.util-D2-5rsN3.js';
|
|
6
|
-
import './aria-loader-BfH06m7H.js';
|
|
7
|
-
import './async.util-DZj20TV1.js';
|
|
8
|
-
|
|
9
|
-
const lmvzInputCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #a1a1a1); --input-border-color-focus: var(--lmvz-semantic-color-border-active, #0f8acc); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #a31419); --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } [size='sm'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); --input-padding-x: var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); --input-gap: var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem)); --input-font-size: var(--lmvz-component-body-sm-font-size, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } [size='md'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); } [size='lg'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem)); --input-padding-x: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); --input-gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --input-font-size: var(--lmvz-component-body-lg-font-size, clamp(1rem, 0.97rem + 0.13vw, 1.13rem)); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: var(--input-gap); } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: var(--input-font-size); font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: 1.5; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0.5em; transform: translateY(-100%); transform-origin: left top; font-size: var(--lmvz-component-body-2xs-font-size, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 400; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: var(--input-font-size); outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } div.sc-lmvz-input:empty { display: none; } [role='status'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--helper-text-color); font-weight: 400; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--error-text-color); font-weight: 400; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: var(--lmvz-dimension-6-4, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); --lmvz-button-min-height-override: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); }`;
|
|
10
|
-
|
|
11
|
-
let inputIdCounter = 0;
|
|
12
|
-
const LmvzInput = class extends ReactiveControllerHost {
|
|
13
|
-
get el() { return getElement(this); }
|
|
14
|
-
get validationEl() {
|
|
15
|
-
return this.el;
|
|
16
|
-
}
|
|
17
|
-
lmvzInput;
|
|
18
|
-
internals;
|
|
19
|
-
nativeInputElement;
|
|
20
|
-
inputId = `lmvz-input-${inputIdCounter++}`;
|
|
21
|
-
initialValue = '';
|
|
22
|
-
nativeError = false;
|
|
23
|
-
errorFromProp = false;
|
|
24
|
-
get helperId() {
|
|
25
|
-
return this.helperText ? `${this.inputId}-helper` : undefined;
|
|
26
|
-
}
|
|
27
|
-
get showErrorMessage() {
|
|
28
|
-
return this.error && Boolean(this.errorMessage);
|
|
29
|
-
}
|
|
30
|
-
get errorId() {
|
|
31
|
-
return `${this.inputId}-error`;
|
|
32
|
-
}
|
|
33
|
-
get describedBy() {
|
|
34
|
-
const ids = [];
|
|
35
|
-
if (this.helperId)
|
|
36
|
-
ids.push(this.helperId);
|
|
37
|
-
if (this.showErrorMessage)
|
|
38
|
-
ids.push(this.errorId);
|
|
39
|
-
return ids.length > 0 ? ids.join(' ') : undefined;
|
|
40
|
-
}
|
|
41
|
-
value;
|
|
42
|
-
label;
|
|
43
|
-
helperText;
|
|
44
|
-
placeholder;
|
|
45
|
-
disabled = false;
|
|
46
|
-
readonly = false;
|
|
47
|
-
required = false;
|
|
48
|
-
name;
|
|
49
|
-
type = 'text';
|
|
50
|
-
errorMessage;
|
|
51
|
-
autocomplete;
|
|
52
|
-
inputmode;
|
|
53
|
-
autocorrect;
|
|
54
|
-
autocapitalize;
|
|
55
|
-
spellcheck;
|
|
56
|
-
autofocus = false;
|
|
57
|
-
minlength;
|
|
58
|
-
maxlength;
|
|
59
|
-
pattern;
|
|
60
|
-
min;
|
|
61
|
-
max;
|
|
62
|
-
step;
|
|
63
|
-
form;
|
|
64
|
-
size = 'md';
|
|
65
|
-
get error() {
|
|
66
|
-
return this.errorFromProp || this.nativeError;
|
|
67
|
-
}
|
|
68
|
-
set error(value) {
|
|
69
|
-
this.errorFromProp = value;
|
|
70
|
-
}
|
|
71
|
-
async setValue(newValue) {
|
|
72
|
-
const input = this.nativeInputElement;
|
|
73
|
-
const val = newValue ?? '';
|
|
74
|
-
if (input) {
|
|
75
|
-
input.value = val;
|
|
76
|
-
}
|
|
77
|
-
this.value = val;
|
|
78
|
-
this.internals.setFormValue?.(val);
|
|
79
|
-
this.lmvzInput.emit(val);
|
|
80
|
-
}
|
|
81
|
-
async focusInput() {
|
|
82
|
-
this.nativeInputElement?.focus();
|
|
83
|
-
}
|
|
84
|
-
async blurInput() {
|
|
85
|
-
this.nativeInputElement?.blur();
|
|
86
|
-
}
|
|
87
|
-
async select() {
|
|
88
|
-
this.nativeInputElement?.select();
|
|
89
|
-
}
|
|
90
|
-
async checkValidity() {
|
|
91
|
-
return this.nativeInputElement?.checkValidity?.() ?? false;
|
|
92
|
-
}
|
|
93
|
-
async reportValidity() {
|
|
94
|
-
return this.nativeInputElement?.reportValidity?.() ?? false;
|
|
95
|
-
}
|
|
96
|
-
async getInputElement() {
|
|
97
|
-
if (!this.nativeInputElement) {
|
|
98
|
-
await new Promise((resolve) => componentOnReady(this.el, resolve));
|
|
99
|
-
}
|
|
100
|
-
return Promise.resolve(this.nativeInputElement);
|
|
101
|
-
}
|
|
102
|
-
constructor(hostRef) {
|
|
103
|
-
super();
|
|
104
|
-
registerInstance(this, hostRef);
|
|
105
|
-
this.lmvzInput = createEvent(this, "lmvzInput", 7);
|
|
106
|
-
if (hostRef.$hostElement$["s-ei"]) {
|
|
107
|
-
this.internals = hostRef.$hostElement$["s-ei"];
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
this.internals = hostRef.$hostElement$.attachInternals();
|
|
111
|
-
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
112
|
-
}
|
|
113
|
-
this.addController(new AriaValidationController(this, {
|
|
114
|
-
reValidateOnPropChanges: true,
|
|
115
|
-
}));
|
|
116
|
-
}
|
|
117
|
-
componentWillLoad() {
|
|
118
|
-
this.initialValue = this.value ?? '';
|
|
119
|
-
super.componentWillLoad();
|
|
120
|
-
}
|
|
121
|
-
formAssociatedCallback(form) {
|
|
122
|
-
if (!form)
|
|
123
|
-
return;
|
|
124
|
-
this.internals.setFormValue?.(this.value ?? '');
|
|
125
|
-
}
|
|
126
|
-
formResetCallback() {
|
|
127
|
-
this.internals.setValidity({});
|
|
128
|
-
this.setValue(this.initialValue);
|
|
129
|
-
}
|
|
130
|
-
formStateRestoreCallback(state) {
|
|
131
|
-
this.setValue(state);
|
|
132
|
-
}
|
|
133
|
-
handleValueChange(newValue) {
|
|
134
|
-
if (!this.nativeInputElement)
|
|
135
|
-
return;
|
|
136
|
-
const isInternalChange = this.nativeInputElement.value === newValue;
|
|
137
|
-
if (isInternalChange)
|
|
138
|
-
return;
|
|
139
|
-
this.setValue(newValue);
|
|
140
|
-
}
|
|
141
|
-
handleDisabledChange(disabled) {
|
|
142
|
-
if (disabled && this.nativeInputElement) {
|
|
143
|
-
this.nativeInputElement.blur();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
handleInput = (event) => {
|
|
147
|
-
const input = event.target;
|
|
148
|
-
this.setValue(input.value);
|
|
149
|
-
};
|
|
150
|
-
handleChange = (event) => {
|
|
151
|
-
const input = event.target ?? this.nativeInputElement;
|
|
152
|
-
this.updateNativeError(input);
|
|
153
|
-
};
|
|
154
|
-
handleFocus = () => { };
|
|
155
|
-
handleBlur = (event) => {
|
|
156
|
-
const input = event.target;
|
|
157
|
-
input.checkValidity?.();
|
|
158
|
-
};
|
|
159
|
-
updateNativeError(fromEvent) {
|
|
160
|
-
const input = fromEvent ?? this.nativeInputElement;
|
|
161
|
-
if (!input)
|
|
162
|
-
return;
|
|
163
|
-
this.nativeError = !(input.checkValidity?.() ?? true);
|
|
164
|
-
}
|
|
165
|
-
render() {
|
|
166
|
-
const hasValue = Boolean(this.value);
|
|
167
|
-
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
168
|
-
return (h("div", { key: '693614c334a94373dcef56b461455bf872249a69', class: classNames('input-container', {
|
|
169
|
-
'interaction-filled': hasValue,
|
|
170
|
-
}) }, h("div", { key: '0eb36d76661d70bea71027ca7b30763d89bd6cb6', class: "input-wrapper" }, h("slot", { key: '03adf18ebe01fe70dc821dcea2bb2963df40f8b4', name: "before-input" }), h("div", { key: 'f1254561b53e321d0f2e4cf4ac93936119083f3f', class: "label-input-group" }, h("label", { key: 'e17cdec368fd36a041d9d8853f4a82249f1b5d8c', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (h("span", { key: 'b3e003bf972c3ad5b6c5b25f8ee509bd5d8df758', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), h("input", { key: '75f192118b7a4c3e507172e13d0ae7e32118aad3', 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: '58a9701259ca92fd7441c1480de741d92bc47bc9', name: "after-input" })), h("div", { key: '396b719d080c781f38d736e28e9c048f629d6ffe', id: this.helperId, role: "status" }, this.helperText || null), h("div", { key: '9e5c86e6098f58d95c0984348d3da07b9e34e1fb', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
171
|
-
}
|
|
172
|
-
static get formAssociated() { return true; }
|
|
173
|
-
static get watchers() { return {
|
|
174
|
-
"value": [{
|
|
175
|
-
"handleValueChange": 0
|
|
176
|
-
}],
|
|
177
|
-
"disabled": [{
|
|
178
|
-
"handleDisabledChange": 0
|
|
179
|
-
}]
|
|
180
|
-
}; }
|
|
181
|
-
};
|
|
182
|
-
LmvzInput.style = lmvzInputCss();
|
|
183
|
-
|
|
184
|
-
export { LmvzInput as lmvz_input };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as raf } from './async.util-DZj20TV1.js';
|
|
2
|
-
|
|
3
|
-
const componentOnReady = (stencilEl, callback) => {
|
|
4
|
-
if (hasLazyBuild(stencilEl)) {
|
|
5
|
-
stencilEl.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
raf(() => callback(stencilEl));
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const hasLazyBuild = (stencilEl) => {
|
|
12
|
-
return stencilEl.componentOnReady !== undefined;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { componentOnReady as c };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,g as n,h as o,H as r}from"./p-BPeerEwm.js";import{i}from"./p-BDonpCG8.js";import{i as a}from"./p-BuEA0MWd.js";import{a as s}from"./p-wlMjNjuv.js";import{w as l,a as c}from"./p-DZj20TV1.js";import{e as u,g as f,l as d,w as p,b as m,j as h}from"./p-BFcYfHYq.js";import"./p-CICeIanv.js";const v=Math.min,y=Math.max,w=Math.round,g=t=>({x:t,y:t}),x={left:"right",right:"left",bottom:"top",top:"bottom"};function b(t,e,n){return y(t,v(e,n))}function z(t,e){return"function"==typeof t?t(e):t}function A(t){return t.split("-")[0]}function C(t){return t.split("-")[1]}function k(t){return"x"===t?"y":"x"}function E(t){return"y"===t?"height":"width"}function S(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function j(t){return k(S(t))}function F(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const D=["left","right"],O=["right","left"],P=["top","bottom"],R=["bottom","top"];function M(t){const e=A(t);return x[e]+t.slice(e.length)}function B(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function T(t,e,n){let{reference:o,floating:r}=t;const i=S(e),a=j(e),s=E(a),l=A(e),c="y"===i,u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(C(e)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1)}return p}async function L(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=z(e,t),m=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),h=s[d?"floating"===f?"reference":"floating":f],v=B(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===f?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),g=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},x=B(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:w,strategy:l}):y);return{top:(v.top-x.top+m.top)/g.y,bottom:(x.bottom-v.bottom+m.bottom)/g.y,left:(v.left-x.left+m.left)/g.x,right:(x.right-v.right+m.right)/g.x}}const $=new Set(["left","top"]);function H(){return"undefined"!=typeof window}function N(t){return V(t)?(t.nodeName||"").toLowerCase():"#document"}function I(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Y(t){var e;return null==(e=(V(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function V(t){return!!H()&&(t instanceof Node||t instanceof I(t).Node)}function _(t){return!!H()&&(t instanceof Element||t instanceof I(t).Element)}function q(t){return!!H()&&(t instanceof HTMLElement||t instanceof I(t).HTMLElement)}function G(t){return!(!H()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof I(t).ShadowRoot)}function W(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=ot(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==r&&"contents"!==r}function X(t){return/^(table|td|th)$/.test(N(t))}function Z(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const J=/transform|translate|scale|rotate|perspective|filter/,K=/paint|layout|strict|content/,Q=t=>!!t&&"none"!==t;let U;function tt(t){const e=_(t)?ot(t):t;return Q(e.transform)||Q(e.translate)||Q(e.scale)||Q(e.rotate)||Q(e.perspective)||!et()&&(Q(e.backdropFilter)||Q(e.filter))||J.test(e.willChange||"")||K.test(e.contain||"")}function et(){return null==U&&(U="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),U}function nt(t){return/^(html|body|#document)$/.test(N(t))}function ot(t){return I(t).getComputedStyle(t)}function rt(t){return _(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function it(t){if("html"===N(t))return t;const e=t.assignedSlot||t.parentNode||G(t)&&t.host||Y(t);return G(e)?e.host:e}function at(t){const e=it(t);return nt(e)?t.ownerDocument?t.ownerDocument.body:t.body:q(e)&&W(e)?e:at(e)}function st(t,e){var n;void 0===e&&(e=[]);const o=at(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),i=I(o);return r?e.concat(i,i.visualViewport||[],W(o)?o:[],[]):e.concat(o,st(o,[]))}function lt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ct(t){const e=ot(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=q(t),i=r?t.offsetWidth:n,a=r?t.offsetHeight:o,s=w(n)!==i||w(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function ut(t){return _(t)?t:t.contextElement}function ft(t){const e=ut(t);if(!q(e))return g(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ct(e);let a=(i?w(n.width):n.width)/o,s=(i?w(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const dt=g(0);function pt(t){const e=I(t);return et()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:dt}function mt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=ut(t);let a=g(1);e&&(o?_(o)&&(a=ft(o)):a=ft(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==I(t))&&e}(i,n,o)?pt(i):g(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,f=r.height/a.y;if(i){const t=I(i),e=o&&_(o)?I(o):o;let n=t,r=lt(n);for(;r&&o&&e!==n;){const t=ft(r),e=r.getBoundingClientRect(),o=ot(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,a=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,f*=t.y,l+=i,c+=a,n=I(r),r=lt(n)}}return B({width:u,height:f,x:l,y:c})}function ht(t,e){const n=rt(t).scrollLeft;return e?e.left+n:mt(Y(t)).left+n}function vt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-ht(t,n),y:n.top+e.scrollTop}}function yt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=I(t),o=Y(t),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const t=et();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}const c=ht(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-e.clientWidth-r);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=Y(t),n=rt(t),o=t.ownerDocument.body,r=y(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=y(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+ht(t);const s=-n.scrollTop;return"rtl"===ot(o).direction&&(a+=y(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(Y(t));else if(_(e))o=function(t,e){const n=mt(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=q(t)?ft(t):g(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=pt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return B(o)}function wt(t,e){const n=it(t);return!(n===e||!_(n)||nt(n))&&("fixed"===ot(n).position||wt(n,e))}function gt(t,e,n){const o=q(e),r=Y(e),i="fixed"===n,a=mt(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const l=g(0);function c(){l.x=ht(r)}if(o||!o&&!i)if(("body"!==N(e)||W(r))&&(s=rt(e)),o){const t=mt(e,!0,i,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&c();i&&!o&&r&&c();const u=!r||o||i?g(0):vt(r,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function xt(t){return"static"===ot(t).position}function bt(t,e){if(!q(t)||"fixed"===ot(t).position)return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=I(t);if(Z(t))return n;if(!q(t)){let e=it(t);for(;e&&!nt(e);){if(_(e)&&!xt(e))return e;e=it(e)}return n}let o=bt(t,e);for(;o&&X(o)&&xt(o);)o=bt(o,e);return o&&nt(o)&&xt(o)&&!tt(o)?n:o||function(t){let e=it(t);for(;q(e)&&!nt(e);){if(tt(e))return e;if(Z(e))return null;e=it(e)}return null}(t)||n}const At={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i="fixed"===r,a=Y(o),s=!!e&&Z(e.floating);if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=g(1);const u=g(0),f=q(o);if((f||!f&&!i)&&(("body"!==N(o)||W(a))&&(l=rt(o)),f)){const t=mt(o);c=ft(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!a||f||i?g(0):vt(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}},getDocumentElement:Y,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===n?Z(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=st(t,[]).filter((t=>_(t)&&"body"!==N(t))),r=null;const i="fixed"===ot(t).position;let a=i?it(t):t;for(;_(a)&&!nt(a);){const e=ot(a),n=tt(a);n||"fixed"!==e.position||(r=null),(i?!n&&!r:!n&&"static"===e.position&&r&&("absolute"===r.position||"fixed"===r.position)||W(a)&&!n&&wt(t,a))?o=o.filter((t=>t!==a)):r=e,a=it(a)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=yt(e,i[0],r);let s=a.top,l=a.right,c=a.bottom,u=a.left;for(let t=1;t<i.length;t++){const n=yt(e,i[t],r);s=y(n.top,s),l=v(n.right,l),c=v(n.bottom,c),u=y(n.left,u)}return{width:l-u,height:c-s,x:u,y:s}},getOffsetParent:zt,getElementRects:async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:gt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ct(t);return{width:e,height:n}},getScale:ft,isElement:_,isRTL:function(t){return"rtl"===ot(t).direction}},Ct=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=z(t,e),u={x:n,y:o},f=await i.detectOverflow(e,c),d=S(A(r)),p=k(d);let m=u[p],h=u[d];a&&(m=b(m+f["y"===p?"top":"left"],m,m-f["y"===p?"bottom":"right"])),s&&(h=b(h+f["y"===d?"top":"left"],h,h-f["y"===d?"bottom":"right"]));const v=l.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[p]:a,[d]:s}}}}}},kt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=z(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=A(r),w=S(s),g=A(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=d||(g||!h?[M(s)]:function(t){const e=M(t);return[F(t),e,F(e)]}(s)),k="none"!==m;!d&&k&&b.push(...function(t,e,n,o){const r=C(t);let i=function(t,e,n){switch(t){case"top":case"bottom":return n?e?O:D:e?D:O;case"left":case"right":return e?P:R;default:return[]}}(A(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(F)))),i}(s,h,m,x));const B=[s,...b],T=await l.detectOverflow(e,v),L=[];let $=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&L.push(T[y]),f){const t=function(t,e,n){void 0===n&&(n=!1);const o=C(t),r=j(t),i=E(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=M(a)),[a,M(a)]}(r,a,x);L.push(T[t[0]],T[t[1]])}if($=[...$,{placement:r,overflows:L}],!L.every((t=>t<=0))){var H,N;const t=((null==(H=i.flip)?void 0:H.index)||0)+1,e=B[t];if(e&&("alignment"!==f||w===S(e)||$.every((t=>S(t.placement)!==w||t.overflows[0]>0))))return{data:{index:t,overflows:$},reset:{placement:e}};let n=null==(N=$.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var I;const t=null==(I=$.filter((t=>{if(k){const e=S(t.placement);return e===w||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:I[0];t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Et=class{constructor(n){t(this,n),this.lmvzOpen=e(this,"lmvzOpen",7),this.lmvzClose=e(this,"lmvzClose",7),this.lmvzCancel=e(this,"lmvzCancel",7)}get el(){return n(this)}extEventController=new AbortController;closureController;containerEl;slotEl;previouslyFocusedElement=null;anchorEl;open=!1;anchor;placement="bottom-start";size="sm";autoFocus=!0;label;lmvzOpen;lmvzClose;lmvzCancel;async show(){this.open=!0}async hide(){this.triggerClose()}async toggle(){this.open?await this.hide():await this.show()}componentDidLoad(){jt(this.el)}handleOpenChange(t){t?this.onOpen():this.onClose()}async handleAnchorChange(t){if(!t)return console.warn("anchor property missing for popover",this.el?.id),void(this.anchor=void 0);await l(),this.anchorEl="string"==typeof t?document.getElementById(t):t,this.setupAnchorEl(),this.open&&this.updatePosition()}disconnectedCallback(){this.removeCloseHandlers(),this.extEventController.abort()}setupAnchorEl(){const{anchorEl:t}=this;t?(t.hasAttribute("aria-haspopup")||t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-controls",this.el.getAttribute("id")),u(t)&&s(t,this.toggle.bind(this),this.extEventController.signal),function(t,e,n,o){if(!i())return;const r=!!e,a=t.hasAttribute("aria-labelledby");r||a||console.warn("[lmvz-popover] Host element has no accessible label. Provide a `label` prop or an `aria-labelledby` attribute pointing to a valid element."),n&&(o?m(o)||console.warn("[lmvz-popover] Anchor element is not interactive. Ensure the anchor is a button, link, input, select, textarea, has a `tabindex` attribute, or has an ARIA role that implies interactivity (button, link, menuitem, option, combobox, listbox, checkbox, radio, switch, tab)."):console.warn("[lmvz-popover] Anchor prop is set but resolved to null. Ensure the anchor element exists in the DOM when the component loads."))}(this.el,this.label,this.anchor,t)):console.warn("no anchor element set for",this)}async updatePosition(){const{anchorEl:t}=this,e=this.containerEl;if(!t||!e)return;const n=function(t){return"start"===t?"left":"end"===t?"right":t}(this.placement),{x:o,y:r}=await((t,e,n)=>{const o=new Map,r={platform:At,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:L},l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=T(c,o,l),d=o,p=0;const m={};for(let n=0;n<i.length;n++){const h=i[n];if(!h)continue;const{name:v,fn:y}=h,{x:w,y:g,data:x,reset:b}=await y({x:u,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:m,rects:c,platform:s,elements:{reference:t,floating:e}});u=null!=w?w:u,f=null!=g?g:f,m[v]={...m[v],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):b.rects),({x:u,y:f}=T(c,d,l))),n=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:m}})(t,e,{...r,platform:i})})(t,e,{placement:n,middleware:[(i=4,void 0===i&&(i=0),{name:"offset",options:i,async fn(t){var e,n;const{x:o,y:r,placement:a,middlewareData:s}=t,l=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=A(n),s=C(n),l="y"===S(n),c=$.has(a)?-1:1,u=i&&l?-1:1,f=z(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,i);return a===(null==(e=s.offset)?void 0:e.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:a}}}}),kt(),Ct({padding:8})]});var i;e.style.left=`${o}px`,e.style.top=`${r}px`}async onOpen(){this.previouslyFocusedElement=f(document),this.setupCloseHandlers(),await c(),await this.updatePosition(),jt(this.el),this.applyAnchorAriaOpen(),this.lmvzOpen.emit(),await c(),this.autoFocus&&this.focusFirst()}onClose(){this.removeCloseHandlers(),this.applyAnchorAriaClose(),this.restoreFocus(),this.lmvzClose.emit()}applyAnchorAriaOpen(){this.anchorEl&&this.anchorEl.setAttribute("aria-expanded","true")}applyAnchorAriaClose(){this.anchorEl&&this.anchorEl.setAttribute("aria-expanded","false")}focusFirst(){const{slotEl:t}=this;if(!t)return;const e=t.assignedElements({flatten:!0});for(const t of e){if(!d(t))continue;if(a(t))return void t.initFocus();const e=p(t,h);if(e)return void e.focus()}}restoreFocus(){const t=this.previouslyFocusedElement;t?.isConnected&&t.focus(),this.previouslyFocusedElement=null}triggerClose(){this.lmvzCancel.emit().defaultPrevented||(this.open=!1)}setupCloseHandlers(){this.closureController=new AbortController;const t={signal:this.closureController.signal};document.addEventListener("mousedown",(t=>{this.open&&(this.el.contains(t.target)||this.triggerClose())}),t),document.addEventListener("keydown",(t=>{this.open&&"Escape"===t.key&&this.triggerClose()}),t)}removeCloseHandlers(){this.closureController?.abort()}render(){return o(r,{key:"744dae23d80c1e81a0b8bd2e9fcb02c6669d54cd"},o("div",{key:"7f40e25f1e05738b2bbf900b90613004eb188395",role:"dialog",part:"container",class:`container lmvz-wrapper-card-${this.size}`,"aria-label":this.label||void 0,ref:t=>this.containerEl=t},o("slot",{key:"5a400fd9e697254007973f2dce172588fe3760ee",ref:t=>this.slotEl=t})))}static get watchers(){return{open:[{handleOpenChange:0}],anchor:[{handleAnchorChange:1}]}}};let St=0;function jt(t){t.getAttribute("id")||t.setAttribute("id","lmvz-popover-"+St++)}Et.style="@layer lmvz-ds.reset,lmvz-ds.theme,lmvz-ds.components,lmvz-ds.overrides; @layer lmvz-ds.components{.lmvz-wrapper-card-sm,.lmvz-wrapper-card-md,.lmvz-wrapper-card-lg{background:var(--lmvz-semantic-color-surface-primary, #ffffff);box-shadow:var(--lmvz-ds-shadow-l3-default-strong, 0 2px 32px 0 rgba(120, 120, 128, 0.11))}.lmvz-wrapper-card-sm{padding:var(--lmvz-component-wrapper-sm-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)) var(--lmvz-component-wrapper-sm-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));border-radius:var(--lmvz-component-wrapper-sm-border-radius, 14px)}.lmvz-wrapper-card-md{padding:var(--lmvz-component-wrapper-md-padding-y, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)) var(--lmvz-component-wrapper-md-padding-x, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));border-radius:var(--lmvz-component-wrapper-md-border-radius, 18px)}.lmvz-wrapper-card-lg{padding:var(--lmvz-component-wrapper-lg-padding-y, clamp(2.25rem, 2.19rem + 0.26vw, 2.5rem)) var(--lmvz-component-wrapper-lg-padding-x, clamp(1.5rem, 1.14rem + 1.55vw, 3rem));border-radius:var(--lmvz-component-wrapper-lg-border-radius, 18px)}}:host{--lmvz-popover-z-index-internal:var(--lmvz-popover-z-index, 1);display:contents;.container{position:absolute;top:-9999999999px;left:-9999999999px;max-width:var(--lmvz-popover-max-width, none);max-height:var(--lmvz-popover-max-height, none);z-index:var(--lmvz-popover-z-index-internal);overflow:auto;box-sizing:border-box}}:host(:not([open])) .container{display:none}";export{Et as lmvz_popover}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e,r as t,c as o,h as r,H as a}from"./p-BPeerEwm.js";import{A as l}from"./p-D9PQIBzA.js";import{R as s}from"./p-CICeIanv.js";import{c as i}from"./p-bh9cItsP.js";import"./p-BDonpCG8.js";import"./p-DZj20TV1.js";let c=0;const n=class extends s{get el(){return e(this)}get validationEl(){return this.el}internals;nativeInputElement;toggleId="lmvz-toggle-"+c++;lmvzChange;label;checked=!1;disabled=!1;required=!1;name;value="on";form;constructor(e){super(),t(this,e),this.lmvzChange=o(this,"lmvzChange",7),e.$hostElement$["s-ei"]?this.internals=e.$hostElement$["s-ei"]:(this.internals=e.$hostElement$.attachInternals(),e.$hostElement$["s-ei"]=this.internals),this.addController(new l(this))}formAssociatedCallback(e){this.internals.setFormValue?.(this.checked?this.value:null)}formResetCallback(){this.checked=!1}formStateRestoreCallback(e){this.checked=e===this.value,this.internals.setFormValue?.(this.checked?this.value:null)}handleCheckedChange(e){this.internals.setFormValue?.(e?this.value:null)}handleDisabledChange(e){e&&this.nativeInputElement&&this.nativeInputElement.blur()}async focusToggle(){this.nativeInputElement?.focus()}async blurToggle(){this.nativeInputElement?.blur()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getInputElement(){return this.nativeInputElement||await new Promise((e=>i(this.el,e))),Promise.resolve(this.nativeInputElement)}handleChange=e=>{const t=e.target.checked;this.checked=t,this.lmvzChange.emit(t)};render(){return r(a,{key:"901f821ddae696fe877435bf20d08e4032cd61ee"},r("span",{key:"bbac0ab3e40e426be511cc49a0dcb2497edd7a9a",class:"track"},r("input",{key:"1df7a78df28517189f690c6d453193e30d97d9ea",type:"checkbox",role:"switch",id:this.toggleId,checked:this.checked,disabled:this.disabled,required:this.required,name:this.name,value:this.value,form:this.form,ref:e=>this.nativeInputElement=e,onChange:this.handleChange}),r("span",{key:"e975c1c280983355f2504fba15553a9f19e4216f",class:"thumb","aria-hidden":"true"})),r("label",{key:"09b3305a1d0d6c116310cf88d1f8a92f6856f57e",htmlFor:this.toggleId},this.label))}static get formAssociated(){return!0}static get watchers(){return{checked:[{handleCheckedChange:0}],disabled:[{handleDisabledChange:0}]}}};n.style="@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-toggle-h { display: inline-flex; align-items: center; gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); padding-block: var(--lmvz-dimension-8-2, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem)); padding-inline: var(--lmvz-dimension-10-4, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); border-radius: var(--lmvz-semantic-border-radius-round, 999px); cursor: pointer; background-color: transparent; user-select: none; } .sc-lmvz-toggle-h:not([disabled]):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } [checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f6fbfe); } [disabled][checked].sc-lmvz-toggle-h { background-color: var(--lmvz-semantic-color-status-active, #f6fbfe); } [disabled].sc-lmvz-toggle-h { cursor: not-allowed; opacity: var(--lmvz-component-input-disabled-opacity, 40%); pointer-events: none; } .track.sc-lmvz-toggle { position: relative; flex-shrink: 0; width: var(--lmvz-global-s32, 32px); height: var(--lmvz-global-s20, 20px); border-radius: var(--lmvz-semantic-border-radius-round, 999px); background-color: var(--lmvz-semantic-color-surface-input-primary, #ffffff); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); } .sc-lmvz-toggle-h:not([disabled]):hover .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-hover, #a1a1a1); } [checked].sc-lmvz-toggle-h .track.sc-lmvz-toggle { border-color: var(--lmvz-semantic-color-border-active, #0f8acc); } input.sc-lmvz-toggle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: inherit; } .thumb.sc-lmvz-toggle { position: absolute; width: var(--lmvz-global-s13, 13px); height: var(--lmvz-global-s13, 13px); border-radius: 50%; background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); top: 50%; transform: translateY(-50%); left: var(--lmvz-global-s4, 4px); transition: left 0.2s ease, background-color 0.2s ease; pointer-events: none; } [checked].sc-lmvz-toggle-h .thumb.sc-lmvz-toggle { left: calc(var(--lmvz-global-s4, 4px) + var(--lmvz-global-s11, 11px)); background-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4); } label.sc-lmvz-toggle { font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); cursor: pointer; }.sc-lmvz-toggle-h:focus-within{outline:var(--lmvz-ds-outline, 1px solid #0e7ab4);outline-offset:var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem))}@media (forced-colors: active){.sc-lmvz-toggle-h:focus-within{outline-color:Highlight;box-shadow:none}}";export{n as lmvz_toggle}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,g as e,h as s,H as i}from"./p-BPeerEwm.js";import{a,i as n}from"./p-BDonpCG8.js";import{v as o}from"./p-0ctLESas.js";import{c as r,d as c,e as d,f as h,h as l,i as u,j as f}from"./p-BFcYfHYq.js";const m=class{constructor(e){t(this,e)}get el(){return e(this)}actionsSlot;validationMessageCache=[];actionsStateObserver;stacked=!1;get primaryEnabledAction(){return this.enabledButtons.find(r)??this.enabledButtons[0]}get hasActions(){return this.assignedButtons.some((t=>c(t)&&d(t)&&!h(t)))}componentDidLoad(){this.handleActionsSlotChange()}disconnectedCallback(){this.actionsStateObserver?.disconnect()}get assignedElements(){return this.actionsSlot?.assignedElements({flatten:!0})??[]}get assignedButtons(){return this.assignedElements.filter(d)}get visibleButtons(){return this.assignedButtons.filter(c)}get enabledButtons(){return this.visibleButtons.filter((t=h,(...e)=>{const s=t(...e);return a(s)?s.then((t=>!t)):!s}));var t}getActionValidationResult(){if(!this.visibleButtons.length)return[];const t=this.visibleButtons.filter(r),e=this.visibleButtons.filter(l),s=[],i=this.visibleButtons;if(1!==t.length&&s.push("LmvzButtonGroup actions slot should contain exactly one primary action."),e.length>1&&s.push(`LmvzButtonGroup actions slot should contain at most one secondary action (received ${e.length})`),t.length){const a=e[0];0!==i.indexOf(t[0])&&s.push("Primary action should be the first focusable element in the actions slot (i.e. first child of the actions slot)."),a&&1!==i.indexOf(a)&&s.push("Secondary action should be the second focusable element in the actions slot (i.e. immediately after the primary button).")}else e.length&&0!==i.indexOf(e[0])&&s.push("Secondary action should be the first focusable element in the actions slot when no primary action is present (i.e. first child of the actions slot).");return s}handleActionsSlotChange=()=>{this.observeActionState(),this.syncActionsState()};observeActionState(){"undefined"!=typeof MutationObserver&&(this.actionsStateObserver?.disconnect(),this.assignedButtons.length&&(this.actionsStateObserver=new MutationObserver((()=>{this.syncActionsState()})),this.assignedButtons.forEach((t=>{this.actionsStateObserver?.observe(t,{attributes:!0,attributeFilter:["disabled","hidden","variant"]})}))))}syncActionsState(){this.assignedElements.forEach((t=>{["LMVZ-BUTTON","BUTTON"].includes(t.tagName.toUpperCase())||(t.hasAttribute("hidden")||t.setAttribute("hidden",""),"true"!==t.getAttribute("aria-hidden")&&t.setAttribute("aria-hidden","true"))})),this.checkActions();const t=this.visibleButtons,e=t.length>0&&t.some((t=>r(t)||l(t)));t.length>0&&!e?this.el.setAttribute("data-only-tertiary",""):this.el.removeAttribute("data-only-tertiary"),this.visibleButtons.forEach(((t,e)=>{const s=o[e]??"tertiary";t&&(u(t)?t.getAttribute("variant")||t.variant||t.setAttribute("variant",s):t.classList.add(s))}));const s=this.visibleButtons.find((t=>"tertiary"===t.getAttribute("variant")));this.visibleButtons.forEach((t=>{t===s?t.setAttribute("data-first-tertiary",""):t.removeAttribute("data-first-tertiary")})),this.focusPrimaryAction()}focusPrimaryAction(){const t=this.primaryEnabledAction;t&&"undefined"!=typeof window&&window.requestAnimationFrame((()=>{f(t)&&t.focus()}))}checkActions(){if(!n())return;const t=this.getActionValidationResult();t.length&&t.forEach((t=>{this.validationMessageCache.includes(t)||(console.warn(t),this.validationMessageCache.push(t))}))}render(){return s(i,{key:"3e8ce38f7e83e201e47d31579f22161ff36247b1"},s("slot",{key:"bc953d19b333f51c5f5c5ba86be3a85d155a29d1",ref:t=>this.actionsSlot=t,onSlotchange:this.handleActionsSlotChange}))}};m.style=":host{display:flex;flex-flow:row-reverse wrap;gap:var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));font:var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router);}:host([stacked]){flex-flow:column nowrap;align-items:stretch;padding:0}:host([stacked]) ::slotted(*){display:block;width:100%}::slotted([hidden]){display:none !important}:host(:not([data-only-tertiary],[stacked])) ::slotted([data-first-tertiary]){margin-inline-end:auto}:host([data-only-tertiary]:not([stacked])){justify-content:flex-end}";export{m as lmvz_button_group}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"];function e(a){return["LMVZ-BUTTON","BUTTON"].includes(a.tagName.toUpperCase())}function r(a){return"LMVZ-BUTTON"===a?.tagName.toUpperCase()}function i(a){return a.hasAttribute("disabled")||!0===a.disabled}function n(a){return!a.hasAttribute("hidden")}function t(a){const e=a.getAttribute("variant")??a.variant;return"primary"===e||"secondary"===e||"tertiary"===e?e:"secondary"}function o(a){return"primary"===t(a)}function l(a){return"secondary"===t(a)}const s=(e,r)=>{let i=a;return r&&r.length>0&&(i=i.filter((a=>!r.includes(a)))),((a,e=[])=>{const r={};return e.forEach((e=>{a.hasAttribute(e)&&(null!==a.getAttribute(e)&&(r[e]=a.getAttribute(e)),a.removeAttribute(e))})),r})(e,i)};function c(a=document){let e=a.activeElement;if(!e)return null;for(;e?.shadowRoot;){const a=e.shadowRoot.activeElement;if(!a)break;e=a}return e}function u(a,e){if(!a)return;if(e(a))return a;const r=Array.from(a.shadowRoot?a.shadowRoot.children:a.children);for(const a of r){const r=u(a,e);if(r)return r}}function d(a){return!!a&&a instanceof HTMLElement&&a.tabIndex>=0&&!a.hasAttribute("disabled")&&"true"!==a.getAttribute("aria-hidden")&&a.checkVisibility()&&null!==a.offsetParent}function f(a,e){if(a instanceof HTMLFormElement)return a;if("string"==typeof a){const e=document.getElementById(a);return e?e instanceof HTMLFormElement?e:(console.warn(`No Form found with selector: "#${a}". Verify that the element with id exists and is actually a <form> element.`,e),null):(console.warn(`No Form found with selector: "#${a}". Verify that the id is correct and the form is rendered in the DOM.`,e),null)}return void 0!==a?(console.warn('The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.',e),null):e.closest("form")}function m(a){const e=a.tagName.toLowerCase();if(["button","lmvz-button","input","lmvz-input","select","lmvz-select","textarea"].includes(e))return!0;if(["a","lmvz-link"].includes(e)&&a.hasAttribute("href"))return!0;if(a.hasAttribute("tabindex")){const e=parseInt(a.getAttribute("tabindex")??"-1");return(isNaN(e)||e<0)&&console.warn("Interactive element is not keyboard accessible due to negative tabindex!",a),!0}const r=a.getAttribute("role");return!(!r||!["button","link","menuitem","option","combobox","listbox","checkbox","radio","switch","tab"].includes(r))}function b(a){return a instanceof HTMLElement}export{s as a,m as b,o as c,n as d,e,i as f,c as g,l as h,r as i,d as j,f as k,b as l,u as w}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./p-BFcYfHYq.js";import{r as s,g as i}from"./p-CICeIanv.js";function e(t){return Boolean(i(t,"isFocusControllerHost"))}const n={orientation:"both",enableHomeAndEnd:!1,manageTabIndex:!1};class o{host;elements=[];currentElement;config;constructor(t,s={}){this.host=t,this.config={...n,...s}}hostConnected(){s(this.host.el,"isFocusControllerHost",!0),this.host.el.addEventListener("keydown",this.handleKeydown),this.syncManagedFocusTarget()}hostDisconnected(){this.host.el.removeEventListener("keydown",this.handleKeydown)}updateElements(t){const s=this.currentElement??this.getManagedActiveElement()??void 0;this.elements=t.filter((t=>"focus"in t&&1===t.nodeType)),this.syncManagedFocusTarget(s)}setCurrentElement(t){const s=this.currentElement;this.currentElement=null!=t&&"focus"in t&&1===t.nodeType?t:void 0,this.syncManagedFocusTarget(s)}async initFocus(){const t=this.selectManagedElement();t&&this.applyFocusTarget(t,!0)}handleKeydown=t=>{const s=this.getFocusIntent(t.key);if(!s)return;const i=this.getManagedActiveElement(),e=this.getTargetElement(i,s);e&&(t.preventDefault(),this.applyFocusTarget(e,!0))};getFocusIntent(t){return this.config.enableHomeAndEnd&&"Home"===t?"first":this.config.enableHomeAndEnd&&"End"===t?"last":"horizontal"===this.config.orientation?"ArrowRight"===t?"next":"ArrowLeft"===t?"previous":void 0:"vertical"===this.config.orientation?"ArrowDown"===t?"next":"ArrowUp"===t?"previous":void 0:"ArrowDown"===t||"ArrowRight"===t?"next":"ArrowUp"===t||"ArrowLeft"===t?"previous":void 0}getManagedActiveElement(){const s=t(this.host.el.ownerDocument??document);if(s instanceof HTMLElement){const t=this.elements.find((t=>function(t){return function(t){return"function"==typeof t.resolveFocusableElement}(t)?t.resolveFocusableElement()??t:t}(t)===s));if(t&&this.canMoveFocusTo(t))return t}if(this.currentElement&&this.elements.includes(this.currentElement)&&this.canMoveFocusTo(this.currentElement))return this.currentElement}getTargetElement(t,s){if(!this.elements.length)return;if("first"===s)return this.findFocusableFromIndex(-1,"next");if("last"===s)return this.findFocusableFromIndex(this.elements.length,"previous");const i=t?this.elements.indexOf(t):-1;return-1===i?"next"===s?this.findFocusableFromIndex(-1,"next"):this.findFocusableFromIndex(this.elements.length,"previous"):this.findFocusableFromIndex(i,s)}findFocusableFromIndex(t,s){if(!this.elements.length)return;const i="next"===s?1:-1;for(let s=1;s<=this.elements.length;s++){const e=this.elements[(t+i*s+this.elements.length)%this.elements.length];if(this.canMoveFocusTo(e))return e}}syncManagedFocusTarget(t){const s=this.selectManagedElement(t),i=s!==this.currentElement;this.currentElement=s,this.config.manageTabIndex&&this.updateTabIndexes(s),i&&s&&this.config.onFocusTargetChange?.(s)}selectManagedElement(t){const s=this.getManagedActiveElement();if(s)return s;if(this.currentElement&&this.elements.includes(this.currentElement)&&this.canMoveFocusTo(this.currentElement))return this.currentElement;if(t&&this.elements.includes(t))return this.findFocusableFromIndex(this.elements.indexOf(t),"next")??this.findFocusableFromIndex(-1,"next");return this.elements.find((t=>0===t.tabIndex&&this.canMoveFocusTo(t)))||this.findFocusableFromIndex(-1,"next")}updateTabIndexes(t){this.elements.forEach((s=>{s.tabIndex=t&&s===t?0:-1}))}applyFocusTarget(t,s){const i=t!==this.currentElement;this.currentElement=t,this.config.manageTabIndex&&this.updateTabIndexes(t),s&&t.focus(),i&&this.config.onFocusTargetChange?.(t)}canMoveFocusTo(t){return!!t&&(!t.hasAttribute("disabled")&&((!("disabled"in t)||!Boolean(t.disabled))&&("true"!==t.getAttribute("aria-disabled")&&(this.config.isFocusableElement?this.config.isFocusableElement(t):(this.config.manageTabIndex||t.tabIndex>=0)&&"true"!==t.getAttribute("aria-hidden")&&(t.checkVisibility?.()??!0)&&null!==t.offsetParent))))}}export{o as D,e as i}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=()=>new Promise((e=>setTimeout((()=>e())))),t=async()=>{await e(),await new Promise((e=>requestAnimationFrame((()=>e()))))},n=e=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(e):"function"==typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e);export{t as a,n as r,e as w}
|