@lmvz-ds/components 0.36.0 → 0.36.1
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 +8 -0
- package/cjs/aria.constants-DPK5mQEL.js +65 -0
- package/cjs/{stencil.util-TjS8_DoU.js → async.util-Dnl6c82X.js} +1 -13
- package/cjs/{directional-focus-controller-3uDoin45.js → directional-focus-controller-8Xd_7MHT.js} +1 -1
- package/cjs/{element-activation-controller-BWtUKzu2.js → element-activation-controller-DzTUocEO.js} +1 -1
- package/cjs/{element.util-CctmBvUY.js → element.util-BlhcwmfR.js} +2 -62
- package/cjs/lmvz-action-list.cjs.entry.js +3 -2
- package/cjs/lmvz-button-group.cjs.entry.js +2 -1
- package/cjs/lmvz-button_2.cjs.entry.js +3 -2
- package/cjs/lmvz-checkbox.cjs.entry.js +38 -4
- package/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-datepicker.cjs.entry.js +10 -3
- package/cjs/lmvz-header_2.cjs.entry.js +4 -3
- package/cjs/lmvz-input.cjs.entry.js +242 -0
- package/cjs/lmvz-menuitem.cjs.entry.js +3 -2
- package/cjs/lmvz-modal.cjs.entry.js +2 -1
- package/cjs/{lmvz-input_2.cjs.entry.js → lmvz-popover.cjs.entry.js} +24 -228
- package/cjs/lmvz-radio.cjs.entry.js +61 -3
- package/cjs/lmvz-select.cjs.entry.js +423 -16
- package/cjs/lmvz-snackbar.cjs.entry.js +1 -1
- package/cjs/lmvz-spinner.cjs.entry.js +1 -1
- package/cjs/lmvz-tab.cjs.entry.js +1 -1
- package/cjs/lmvz-tabs.cjs.entry.js +4 -3
- package/cjs/lmvz-toggle.cjs.entry.js +7 -3
- package/cjs/loader.cjs.js +1 -1
- package/cjs/stencil.util-CBrPLd-F.js +17 -0
- package/collection/components/lmvz-checkbox/lmvz-checkbox.css +4 -2
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +68 -8
- package/collection/components/lmvz-datepicker/lmvz-datepicker.css +0 -5
- package/collection/components/lmvz-datepicker/lmvz-datepicker.js +17 -3
- package/collection/components/lmvz-input/lmvz-input.css +1 -1
- package/collection/components/lmvz-input/lmvz-input.js +47 -12
- package/collection/components/lmvz-popover/lmvz-popover.css +1 -1
- package/collection/components/lmvz-popover/lmvz-popover.js +45 -5
- package/collection/components/lmvz-radio/lmvz-radio.js +77 -9
- package/collection/components/lmvz-select/lmvz-select.css +96 -34
- package/collection/components/lmvz-select/lmvz-select.js +412 -21
- 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 +21 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/styles/fragments/_focus-within.css +2 -2
- package/collection/utils/aria/listbox-controller.js +154 -0
- package/collection/utils/radio/radio-group-controller.js +17 -0
- package/components/lmvz-checkbox.js +1 -1
- package/components/lmvz-datepicker.js +1 -1
- package/components/lmvz-input.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-BApwCp0R.js +1 -0
- package/components/p-C5gRiLRR.js +1 -0
- package/esm/aria.constants-DIyiticz.js +62 -0
- package/esm/{stencil.util-C3QOYC8E.js → async.util-DZj20TV1.js} +1 -13
- package/esm/{directional-focus-controller-Bhu7RqYE.js → directional-focus-controller-QukTTWBE.js} +1 -1
- package/esm/{element-activation-controller-BuwyVq4A.js → element-activation-controller-dxJZKMag.js} +1 -1
- package/esm/{element.util-Bd9JyKJZ.js → element.util-3ydVsxUW.js} +2 -61
- package/esm/lmvz-action-list.entry.js +3 -2
- package/esm/lmvz-button-group.entry.js +2 -1
- package/esm/lmvz-button_2.entry.js +3 -2
- package/esm/lmvz-checkbox.entry.js +38 -4
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-datepicker.entry.js +10 -3
- package/esm/lmvz-header_2.entry.js +4 -3
- package/esm/lmvz-input.entry.js +240 -0
- package/esm/lmvz-menuitem.entry.js +3 -2
- package/esm/lmvz-modal.entry.js +2 -1
- package/esm/{lmvz-input_2.entry.js → lmvz-popover.entry.js} +23 -226
- package/esm/lmvz-radio.entry.js +61 -3
- package/esm/lmvz-select.entry.js +423 -16
- package/esm/lmvz-snackbar.entry.js +1 -1
- package/esm/lmvz-spinner.entry.js +1 -1
- package/esm/lmvz-tab.entry.js +1 -1
- package/esm/lmvz-tabs.entry.js +4 -3
- package/esm/lmvz-toggle.entry.js +7 -3
- package/esm/loader.js +1 -1
- package/esm/stencil.util-D2-5rsN3.js +15 -0
- package/hydrate/index.js +625 -68
- package/hydrate/index.mjs +625 -68
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-544e3ccb.entry.js → p-0f65d001.entry.js} +1 -1
- package/lmvz-components/p-137b1fe1.entry.js +1 -0
- package/lmvz-components/p-26dd9684.entry.js +1 -0
- package/lmvz-components/p-36f44108.entry.js +1 -0
- package/lmvz-components/p-398b5cf4.entry.js +1 -0
- package/lmvz-components/p-3a396fc8.entry.js +1 -0
- package/lmvz-components/p-40716828.entry.js +1 -0
- package/lmvz-components/p-70f1e31a.entry.js +1 -0
- package/lmvz-components/p-71d06d1d.entry.js +1 -0
- package/lmvz-components/{p-d280d21a.entry.js → p-88661c50.entry.js} +1 -1
- package/lmvz-components/p-91eb71bb.entry.js +1 -0
- package/lmvz-components/p-BA3wizqg.js +1 -0
- package/lmvz-components/{p-GGkwaiT6.js → p-CHxiS3ja.js} +1 -1
- package/lmvz-components/{p-UhNgD4L3.js → p-CPSyM_e-.js} +1 -1
- package/lmvz-components/p-DIyiticz.js +1 -0
- package/lmvz-components/p-DZj20TV1.js +1 -0
- package/lmvz-components/p-a680a7b2.entry.js +1 -0
- package/lmvz-components/{p-d48203f9.entry.js → p-a6fe9b61.entry.js} +1 -1
- package/lmvz-components/{p-dbfbcb74.entry.js → p-a99acb02.entry.js} +1 -1
- package/lmvz-components/p-bh9cItsP.js +1 -0
- package/lmvz-components/p-f16a19fc.entry.js +1 -0
- package/lmvz-components/p-f3f0ed49.entry.js +1 -0
- package/lmvz-components/p-f516a949.entry.js +1 -0
- package/manifest.json +366 -30
- package/package.json +1 -1
- package/types/api/ds.types.d.ts +1 -0
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +9 -1
- package/types/components/lmvz-datepicker/lmvz-datepicker.d.ts +2 -0
- package/types/components/lmvz-input/lmvz-input.d.ts +3 -0
- package/types/components/lmvz-popover/lmvz-popover.d.ts +2 -0
- package/types/components/lmvz-radio/lmvz-radio.d.ts +12 -2
- package/types/components/lmvz-select/lmvz-select.d.ts +53 -4
- package/types/components/lmvz-toggle/lmvz-toggle.d.ts +1 -0
- package/types/components.d.ts +96 -12
- package/types/utils/aria/listbox-controller.d.ts +42 -0
- package/types/utils/radio/radio-group-controller.d.ts +3 -0
- package/components/p-CPuI0_r_.js +0 -1
- package/components/p-CWpl0WaZ.js +0 -1
- package/lmvz-components/p-63f6a596.entry.js +0 -1
- package/lmvz-components/p-8022c6dc.entry.js +0 -1
- package/lmvz-components/p-Bd9JyKJZ.js +0 -1
- package/lmvz-components/p-C3QOYC8E.js +0 -1
- package/lmvz-components/p-a611c110.entry.js +0 -1
- package/lmvz-components/p-b1bb4393.entry.js +0 -1
- package/lmvz-components/p-b50b1cb5.entry.js +0 -1
- package/lmvz-components/p-b932cf91.entry.js +0 -1
- package/lmvz-components/p-bff115d4.entry.js +0 -1
- package/lmvz-components/p-d9aede81.entry.js +0 -1
- package/lmvz-components/p-f0e28f3a.entry.js +0 -1
- package/lmvz-components/p-f853faae.entry.js +0 -1
- package/lmvz-components/p-fa2efc42.entry.js +0 -1
- package/lmvz-components/p-fe6f5bdc.entry.js +0 -1
package/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["lmvz-datepicker.cjs",[[593,"lmvz-datepicker",{"value":[6145],"visibleMonth":[6145,"visible-month"],"min":[1],"max":[1],"locale":[1],"firstDayOfWeek":[2,"first-day-of-week"],"disabled":[516],"readonly":[516],"required":[516],"name":[513],"label":[1],"placeholder":[1],"helperText":[1,"helper-text"],"errorMessage":[1,"error-message"],"open":[1540],"displayFormat":[1,"display-format"],"focusedDate":[32],"valueDate":[32],"visibleMonthDate":[32],"inputText":[32],"hasUnparseableInput":[32],"isInvalid":[32],"checkValidity":[64],"reportValidity":[64]},[[0,"keydown","handleKeydown"],[0,"focusin","handleInputFocus"],[0,"click","handleInputFocus"]],{"required":[{"handleValidityRelevantPropChange":0}],"min":[{"handleValidityRelevantPropChange":0}],"max":[{"handleValidityRelevantPropChange":0}],"locale":[{"handleDisplayFormatChange":0}],"displayFormat":[{"handleDisplayFormatChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-modal.cjs",[[769,"lmvz-modal",{"open":[1540],"closeLabel":[1,"close-label"],"hasHeader":[32]},[[0,"submit","handleFormDialogSubmit"]],{"open":[{"handleOpenChange":0}]}]]],["lmvz-message.cjs",[[769,"lmvz-message",{"type":[513],"live":[1],"leadingIcon":[4,"leading-icon"],"dismissible":[4],"closeLabel":[1,"close-label"],"actionLabel":[1,"action-label"]}]]],["lmvz-snackbar.cjs",[[513,"lmvz-snackbar",{"status":[1537],"message":[1025],"duration":[1026],"priority":[1025],"actionLabel":[1025,"action-label"],"animationClass":[32],"show":[64],"hide":[64]},null,{"status":[{"onStatusChange":0}]}]]],["lmvz-link.cjs",[[785,"lmvz-link",{"href":[513],"target":[513],"rel":[1],"type":[1537],"externalLabel":[1,"external-label"]},null,{"type":[{"normalizeType":0}]}]]],["lmvz-header_2.cjs",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"],"initFocus":[64]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action.cjs",[[257,"lmvz-action"]]],["lmvz-action-list.cjs",[[774,"lmvz-action-list",{"label":[1],"initFocus":[64]}]]],["lmvz-card.cjs",[[774,"lmvz-card",{"cardTitle":[1,"card-title"],"imageUrl":[1,"image-url"],"description":[1],"primaryActionLabel":[1,"primary-action-label"]}]]],["lmvz-checkbox.cjs",[[578,"lmvz-checkbox",{"label":[1],"checked":[1540],"value":[1],"name":[
|
|
9
|
+
return index.bootstrapLazy([["lmvz-datepicker.cjs",[[593,"lmvz-datepicker",{"value":[6145],"visibleMonth":[6145,"visible-month"],"min":[1],"max":[1],"locale":[1],"firstDayOfWeek":[2,"first-day-of-week"],"disabled":[516],"readonly":[516],"required":[516],"name":[513],"label":[1],"placeholder":[1],"helperText":[1,"helper-text"],"errorMessage":[1,"error-message"],"open":[1540],"displayFormat":[1,"display-format"],"focusedDate":[32],"valueDate":[32],"visibleMonthDate":[32],"inputText":[32],"hasUnparseableInput":[32],"isInvalid":[32],"nativeError":[32],"checkValidity":[64],"reportValidity":[64]},[[0,"keydown","handleKeydown"],[0,"focusin","handleInputFocus"],[0,"click","handleInputFocus"],[0,"invalid","handleInvalid"]],{"required":[{"handleValidityRelevantPropChange":0}],"min":[{"handleValidityRelevantPropChange":0}],"max":[{"handleValidityRelevantPropChange":0}],"locale":[{"handleDisplayFormatChange":0}],"displayFormat":[{"handleDisplayFormatChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-modal.cjs",[[769,"lmvz-modal",{"open":[1540],"closeLabel":[1,"close-label"],"hasHeader":[32]},[[0,"submit","handleFormDialogSubmit"]],{"open":[{"handleOpenChange":0}]}]]],["lmvz-message.cjs",[[769,"lmvz-message",{"type":[513],"live":[1],"leadingIcon":[4,"leading-icon"],"dismissible":[4],"closeLabel":[1,"close-label"],"actionLabel":[1,"action-label"]}]]],["lmvz-snackbar.cjs",[[513,"lmvz-snackbar",{"status":[1537],"message":[1025],"duration":[1026],"priority":[1025],"actionLabel":[1025,"action-label"],"animationClass":[32],"show":[64],"hide":[64]},null,{"status":[{"onStatusChange":0}]}]]],["lmvz-link.cjs",[[785,"lmvz-link",{"href":[513],"target":[513],"rel":[1],"type":[1537],"externalLabel":[1,"external-label"]},null,{"type":[{"normalizeType":0}]}]]],["lmvz-select.cjs",[[838,"lmvz-select",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"error":[6660],"errorMessage":[1,"error-message"],"disabled":[516],"required":[516],"name":[513],"size":[513],"highlighted":[516],"nativeError":[32],"selectedLabel":[32],"selectedId":[32],"activeId":[32],"isOpen":[32],"optionGroups":[32],"focusTrigger":[64],"blurTrigger":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64]},[[0,"invalid","handleInvalid"]],{"value":[{"handleValueChange":0}],"required":[{"handleRequiredChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-header_2.cjs",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"],"initFocus":[64]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action.cjs",[[257,"lmvz-action"]]],["lmvz-action-list.cjs",[[774,"lmvz-action-list",{"label":[1],"initFocus":[64]}]]],["lmvz-card.cjs",[[774,"lmvz-card",{"cardTitle":[1,"card-title"],"imageUrl":[1,"image-url"],"description":[1],"primaryActionLabel":[1,"primary-action-label"]}]]],["lmvz-checkbox.cjs",[[578,"lmvz-checkbox",{"label":[1],"checked":[1540],"value":[1],"name":[513],"disabled":[516],"required":[516],"error":[6660],"errorMessage":[1,"error-message"],"helperText":[1,"helper-text"],"form":[1],"autofocus":[4],"nativeError":[32],"checkedState":[32],"focusInput":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64]},[[0,"invalid","handleInvalid"]],{"checked":[{"handleCheckedChange":0}],"required":[{"handleRequiredChange":0}]}]]],["lmvz-chip.cjs",[[769,"lmvz-chip",{"type":[1537],"size":[1537]},null,{"type":[{"normalizeType":0}],"size":[{"normalizeSize":0}]}]]],["lmvz-menuitem.cjs",[[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-radio.cjs",[[578,"lmvz-radio",{"label":[1],"checked":[1540],"value":[1],"name":[513],"disabled":[516],"required":[516],"error":[6660],"helperText":[1,"helper-text"],"form":[513],"autofocus":[4],"nativeError":[32],"focusInput":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64]},[[0,"invalid","handleInvalid"],[0,"keydown","handleKeydown"]],{"checked":[{"handleCheckedChange":0}],"required":[{"handleRequiredChange":0}],"value":[{"handleValueChange":0}],"label":[{"handleLabelChange":0}]}]]],["lmvz-spinner.cjs",[[513,"lmvz-spinner",{"size":[513],"ariaLabel":[513,"aria-label"]}]]],["lmvz-tab.cjs",[[785,"lmvz-tab",{"value":[513],"disabled":[516],"selected":[516],"vertical":[516]}]]],["lmvz-tabs.cjs",[[769,"lmvz-tabs",{"value":[1537],"orientation":[1537],"resolvedValue":[32],"initFocus":[64],"activateTab":[64],"getTabElements":[64],"setTabPanelIds":[64]},null,{"value":[{"handleValueChange":0}],"orientation":[{"handleOrientationChange":0}]}]]],["lmvz-toggle.cjs",[[578,"lmvz-toggle",{"label":[1],"checked":[1540],"disabled":[516],"required":[516],"name":[1],"value":[1],"form":[1],"focusToggle":[64],"blurToggle":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64],"getInputElement":[64]},null,{"checked":[{"handleCheckedChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-button-group.cjs",[[769,"lmvz-button-group",{"stacked":[516],"primaryEnabledAction":[2064],"hasActions":[2052,"has-actions"]}]]],["lmvz-input.cjs",[[838,"lmvz-input",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"placeholder":[1],"disabled":[516],"readonly":[516],"required":[516],"name":[1],"type":[1],"errorMessage":[1,"error-message"],"autocomplete":[1],"inputmode":[1],"autocorrect":[1],"autocapitalize":[1],"spellcheck":[4],"autofocus":[4],"minlength":[2],"maxlength":[2],"pattern":[1],"min":[8],"max":[8],"step":[8],"form":[1],"size":[513],"error":[6660],"nativeError":[32],"setValue":[64],"focusInput":[64],"blurInput":[64],"select":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64],"getInputElement":[64]},null,{"value":[{"handleValueChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-popover.cjs",[[769,"lmvz-popover",{"open":[1540],"anchor":[1],"placement":[1],"size":[1],"autoFocus":[4,"auto-focus"],"containerRole":[1,"container-role"],"label":[1],"anchorEl":[32],"show":[64],"hide":[64],"toggle":[64]},null,{"open":[{"handleOpenChange":0}],"anchor":[{"handleAnchorChange":1}]}]]],["lmvz-button_2.cjs",[[785,"lmvz-button",{"ti":[514,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1],"formMethod":[1,"form-method"],"name":[1],"value":[1],"buttonRole":[1,"button-role"]}],[514,"lmvz-icon",{"icon":[513],"weight":[513],"size":[513],"iconset":[513],"ariaLabel":[513,"aria-label"],"iconData":[32],"visible":[32]},null,{"icon":[{"loadIconPathData":0}],"iconset":[{"loadIconPathData":0}]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -86,6 +86,7 @@ input {
|
|
|
86
86
|
margin: 0;
|
|
87
87
|
cursor: pointer;
|
|
88
88
|
z-index: 1;
|
|
89
|
+
appearance: none;
|
|
89
90
|
}
|
|
90
91
|
.box {
|
|
91
92
|
display: flex;
|
|
@@ -175,7 +176,8 @@ label {
|
|
|
175
176
|
cursor: not-allowed;
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
|
-
:host(:focus-within) .pill {
|
|
179
|
+
/* :host(:focus-within) .pill { */
|
|
180
|
+
:host:has(:focus-visible) .pill {
|
|
179
181
|
outline: var(--lmvz-ds-outline, 1px solid #0e7ab4);
|
|
180
182
|
outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem));
|
|
181
183
|
}
|
|
@@ -200,7 +202,7 @@ label {
|
|
|
200
202
|
color: HighlightText;
|
|
201
203
|
}
|
|
202
204
|
|
|
203
|
-
:host(:focus-
|
|
205
|
+
:host:has(:focus-visible) .pill {
|
|
204
206
|
outline-color: Highlight;
|
|
205
207
|
box-shadow: none;
|
|
206
208
|
}
|
|
@@ -30,7 +30,14 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
30
30
|
name;
|
|
31
31
|
disabled = false;
|
|
32
32
|
required = false;
|
|
33
|
-
|
|
33
|
+
nativeError = false;
|
|
34
|
+
errorFromProp = false;
|
|
35
|
+
get error() {
|
|
36
|
+
return this.errorFromProp || this.nativeError;
|
|
37
|
+
}
|
|
38
|
+
set error(value) {
|
|
39
|
+
this.errorFromProp = value;
|
|
40
|
+
}
|
|
34
41
|
errorMessage;
|
|
35
42
|
helperText;
|
|
36
43
|
form;
|
|
@@ -39,6 +46,10 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
39
46
|
handleCheckedChange(val) {
|
|
40
47
|
this.checkedState = val;
|
|
41
48
|
this.internals.setFormValue?.(val ? (this.value ?? 'on') : null);
|
|
49
|
+
this.updateValidity();
|
|
50
|
+
}
|
|
51
|
+
handleRequiredChange() {
|
|
52
|
+
this.updateValidity();
|
|
42
53
|
}
|
|
43
54
|
lmvzChange;
|
|
44
55
|
async focusInput() {
|
|
@@ -50,6 +61,9 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
50
61
|
async reportValidity() {
|
|
51
62
|
return this.internals?.reportValidity() ?? true;
|
|
52
63
|
}
|
|
64
|
+
async getValidationMessage() {
|
|
65
|
+
return this.internals?.validationMessage ?? '';
|
|
66
|
+
}
|
|
53
67
|
constructor() {
|
|
54
68
|
super();
|
|
55
69
|
this.addController(new AriaValidationController(this, {
|
|
@@ -60,10 +74,15 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
60
74
|
this.initialChecked = this.checked;
|
|
61
75
|
this.checkedState = this.checked;
|
|
62
76
|
this.internals.setFormValue?.(this.checked ? (this.value ?? 'on') : null);
|
|
77
|
+
this.updateValidity();
|
|
63
78
|
super.componentWillLoad();
|
|
64
79
|
}
|
|
80
|
+
componentDidLoad() {
|
|
81
|
+
this.updateValidity();
|
|
82
|
+
super.componentDidLoad();
|
|
83
|
+
}
|
|
65
84
|
componentWillRender() {
|
|
66
|
-
if (this.
|
|
85
|
+
if (this.errorFromProp && !this.errorMessage) {
|
|
67
86
|
console.warn('lmvz-checkbox: error=true set without errorMessage — no visual-only error state is rendered. Provide errorMessage to communicate the error to users.');
|
|
68
87
|
}
|
|
69
88
|
super.componentWillRender();
|
|
@@ -73,6 +92,7 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
73
92
|
}
|
|
74
93
|
formResetCallback() {
|
|
75
94
|
this.checked = this.initialChecked;
|
|
95
|
+
this.updateValidity();
|
|
76
96
|
}
|
|
77
97
|
formStateRestoreCallback(state) {
|
|
78
98
|
this.checked = state === (this.value ?? 'on');
|
|
@@ -85,8 +105,19 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
85
105
|
retargetInnerClicks() {
|
|
86
106
|
this.nativeInput?.click();
|
|
87
107
|
}
|
|
108
|
+
updateValidity() {
|
|
109
|
+
if (this.required && !this.checked) {
|
|
110
|
+
this.internals.setValidity?.({ valueMissing: true }, 'Please check this box.', this.nativeInput);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.internals.setValidity?.({});
|
|
114
|
+
this.nativeError = false;
|
|
115
|
+
}
|
|
116
|
+
handleInvalid() {
|
|
117
|
+
this.nativeError = true;
|
|
118
|
+
}
|
|
88
119
|
render() {
|
|
89
|
-
return (h(Host, { key: '
|
|
120
|
+
return (h(Host, { key: '089b23f8034fa089f358cc37923182c34f528cd2' }, h("div", { key: '0af011ebf062332c330b49fa3076828204433ac4', class: "pill" }, h("input", { key: 'a483a8c5bbe1d6da3cfab63ce32ad2e6392911ff', type: "checkbox", id: this.checkboxId, checked: this.checkedState, disabled: this.disabled, "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": this.ariaDescribedBy, "aria-errormessage": this.error && this.errorId ? this.errorId : undefined, ref: (el) => (this.nativeInput = el), onChange: this.handleChange, autoFocus: this.autofocus }), h("span", { key: 'f21d34ab625c7eef23bd2761b399e8770cd62275', class: "box", "aria-hidden": "true" }, this.checkedState && h("span", { key: 'de2680ea17f34ab0124c529d88d4191c97d0a4c5', class: "indicator", innerHTML: CHECKMARK_SVG })), h("span", { key: '1b2d24e43603033a5a77340164e002de326db11a', class: "content" }, h("label", { key: 'b18f17abb4459b3783dc41d0031f4b26795fdcf5', htmlFor: this.checkboxId }, this.label), this.helperText && (h("span", { key: 'f32591c55fcc88d130815780a9999fcb235afd88', onClick: this.retargetInnerClicks.bind(this), class: "helper-text", id: this.helperId, role: "status" }, this.helperText)))), this.errorMessage && (h("span", { key: '076489f5baadab07d95fc787e9ac71bae0a6ab68', onClick: this.retargetInnerClicks.bind(this), class: "error-text", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
90
121
|
}
|
|
91
122
|
static get is() { return "lmvz-checkbox"; }
|
|
92
123
|
static get encapsulation() { return "scoped"; }
|
|
@@ -184,7 +215,7 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
184
215
|
},
|
|
185
216
|
"getter": false,
|
|
186
217
|
"setter": false,
|
|
187
|
-
"reflect":
|
|
218
|
+
"reflect": true,
|
|
188
219
|
"attribute": "name"
|
|
189
220
|
},
|
|
190
221
|
"disabled": {
|
|
@@ -250,11 +281,10 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
250
281
|
}],
|
|
251
282
|
"text": "Whether the checkbox is in an error state."
|
|
252
283
|
},
|
|
253
|
-
"getter":
|
|
254
|
-
"setter":
|
|
284
|
+
"getter": true,
|
|
285
|
+
"setter": true,
|
|
255
286
|
"reflect": true,
|
|
256
|
-
"attribute": "error"
|
|
257
|
-
"defaultValue": "false"
|
|
287
|
+
"attribute": "error"
|
|
258
288
|
},
|
|
259
289
|
"errorMessage": {
|
|
260
290
|
"type": "string",
|
|
@@ -340,6 +370,7 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
340
370
|
}
|
|
341
371
|
static get states() {
|
|
342
372
|
return {
|
|
373
|
+
"nativeError": {},
|
|
343
374
|
"checkedState": {}
|
|
344
375
|
};
|
|
345
376
|
}
|
|
@@ -413,6 +444,23 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
413
444
|
"text": "Reports validation errors to the user.",
|
|
414
445
|
"tags": []
|
|
415
446
|
}
|
|
447
|
+
},
|
|
448
|
+
"getValidationMessage": {
|
|
449
|
+
"complexType": {
|
|
450
|
+
"signature": "() => Promise<string>",
|
|
451
|
+
"parameters": [],
|
|
452
|
+
"references": {
|
|
453
|
+
"Promise": {
|
|
454
|
+
"location": "global",
|
|
455
|
+
"id": "global::Promise"
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
"return": "Promise<string>"
|
|
459
|
+
},
|
|
460
|
+
"docs": {
|
|
461
|
+
"text": "Returns the current validation message, if any.",
|
|
462
|
+
"tags": []
|
|
463
|
+
}
|
|
416
464
|
}
|
|
417
465
|
};
|
|
418
466
|
}
|
|
@@ -421,6 +469,18 @@ export class LmvzCheckbox extends ReactiveControllerHost {
|
|
|
421
469
|
return [{
|
|
422
470
|
"propName": "checked",
|
|
423
471
|
"methodName": "handleCheckedChange"
|
|
472
|
+
}, {
|
|
473
|
+
"propName": "required",
|
|
474
|
+
"methodName": "handleRequiredChange"
|
|
475
|
+
}];
|
|
476
|
+
}
|
|
477
|
+
static get listeners() {
|
|
478
|
+
return [{
|
|
479
|
+
"name": "invalid",
|
|
480
|
+
"method": "handleInvalid",
|
|
481
|
+
"target": undefined,
|
|
482
|
+
"capture": false,
|
|
483
|
+
"passive": false
|
|
424
484
|
}];
|
|
425
485
|
}
|
|
426
486
|
static get attachInternalsMemberName() { return "internals"; }
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
}
|
|
40
|
-
/* ─── Host / Panel ─────────────────────────────────────────────────────────── */
|
|
41
40
|
:host {
|
|
42
41
|
display: inline-block;
|
|
43
42
|
width: 100%;
|
|
@@ -51,7 +50,6 @@
|
|
|
51
50
|
flex-direction: column;
|
|
52
51
|
gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));
|
|
53
52
|
}
|
|
54
|
-
/* ─── Header ────────────────────────────────────────────────────────────────── */
|
|
55
53
|
.datepicker-header {
|
|
56
54
|
display: flex;
|
|
57
55
|
align-items: center;
|
|
@@ -71,7 +69,6 @@
|
|
|
71
69
|
pointer-events: none;
|
|
72
70
|
user-select: none;
|
|
73
71
|
}
|
|
74
|
-
/* ─── Weekday row ────────────────────────────────────────────────────────────── */
|
|
75
72
|
.datepicker-weekday-row {
|
|
76
73
|
display: flex;
|
|
77
74
|
gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
@@ -88,7 +85,6 @@
|
|
|
88
85
|
min-width: 0;
|
|
89
86
|
text-align: center;
|
|
90
87
|
}
|
|
91
|
-
/* ─── Grid ────────────────────────────────────────────────────────────────────── */
|
|
92
88
|
.datepicker-grid {
|
|
93
89
|
display: flex;
|
|
94
90
|
flex-direction: column;
|
|
@@ -98,7 +94,6 @@
|
|
|
98
94
|
display: flex;
|
|
99
95
|
gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
100
96
|
}
|
|
101
|
-
/* ─── Day cells ────────────────────────────────────────────────────────────────── */
|
|
102
97
|
[part~='day'] {
|
|
103
98
|
/* Reset native button */
|
|
104
99
|
all: unset;
|
|
@@ -333,10 +333,17 @@ export class LmvzDatepicker {
|
|
|
333
333
|
}
|
|
334
334
|
const isInvalid = Object.values(flags).some(Boolean);
|
|
335
335
|
this.isInvalid = isInvalid;
|
|
336
|
+
if (!isInvalid) {
|
|
337
|
+
this.nativeError = false;
|
|
338
|
+
}
|
|
336
339
|
const validationLabels = getValidationLabels(this.locale);
|
|
337
340
|
this.internals.setValidity?.(flags, isInvalid ? this.errorMessage || validationLabels.invalidDateMessage : undefined, isInvalid ? this.el : undefined);
|
|
338
341
|
}
|
|
342
|
+
handleInvalid() {
|
|
343
|
+
this.nativeError = true;
|
|
344
|
+
}
|
|
339
345
|
isInvalid = false;
|
|
346
|
+
nativeError = false;
|
|
340
347
|
get effectivePlaceholder() {
|
|
341
348
|
return this.placeholder ?? derivePatternFromLocale(this.locale).toLowerCase();
|
|
342
349
|
}
|
|
@@ -434,13 +441,13 @@ export class LmvzDatepicker {
|
|
|
434
441
|
render() {
|
|
435
442
|
const validationLabels = getValidationLabels(this.locale);
|
|
436
443
|
const popoverLabel = this.label ? `${this.label} ${validationLabels.popoverSuffix}` : undefined;
|
|
437
|
-
return (h(Host, { key: '
|
|
444
|
+
return (h(Host, { key: 'af9d7f075bf97d7eb58c6557f43cf8a245d5f712' }, h("lmvz-input", { key: 'eef4be58281b8356d443c65c5cf6451192e70f75', ref: (el) => {
|
|
438
445
|
const wasUnset = !this.inputEl;
|
|
439
446
|
this.inputEl = el;
|
|
440
447
|
if (wasUnset && this.inputEl) {
|
|
441
448
|
forceUpdate(this);
|
|
442
449
|
}
|
|
443
|
-
}, label: this.label ?? '', placeholder: this.effectivePlaceholder, helperText: this.helperText, errorMessage: this.errorMessage, error: this.
|
|
450
|
+
}, label: this.label ?? '', placeholder: this.effectivePlaceholder, helperText: this.helperText, errorMessage: this.errorMessage, error: this.nativeError, disabled: this.disabled, readonly: this.readonly, required: this.required, value: this.inputText, autocomplete: "off", onLmvzInput: this.handleInputTextChange, onKeyDown: this.handleInputKeydown }, h("lmvz-icon", { key: 'fc39ef14720522a8089d33321b918e5577a36cc2', slot: "after-input", icon: CALENDAR_ICON, "aria-hidden": "true" })), h("lmvz-popover", { key: '0076c57da02c7c9d0fcb53584f9dc4127317d6a5', anchor: this.inputEl, open: this.open && !this.disabled, autoFocus: false, size: "md", label: popoverLabel, onLmvzOpen: this.handlePopoverOpen, onLmvzClose: this.handlePopoverClose }, h("div", { key: '4c1e716e52a5d9ed75155dded3c2c39649e1e844', part: "panel", class: "datepicker-panel" }, this.renderHeader(), this.renderGrid()))));
|
|
444
451
|
}
|
|
445
452
|
static get is() { return "lmvz-datepicker"; }
|
|
446
453
|
static get encapsulation() { return "shadow"; }
|
|
@@ -823,7 +830,8 @@ export class LmvzDatepicker {
|
|
|
823
830
|
"visibleMonthDate": {},
|
|
824
831
|
"inputText": {},
|
|
825
832
|
"hasUnparseableInput": {},
|
|
826
|
-
"isInvalid": {}
|
|
833
|
+
"isInvalid": {},
|
|
834
|
+
"nativeError": {}
|
|
827
835
|
};
|
|
828
836
|
}
|
|
829
837
|
static get events() {
|
|
@@ -982,6 +990,12 @@ export class LmvzDatepicker {
|
|
|
982
990
|
"target": undefined,
|
|
983
991
|
"capture": false,
|
|
984
992
|
"passive": false
|
|
993
|
+
}, {
|
|
994
|
+
"name": "invalid",
|
|
995
|
+
"method": "handleInvalid",
|
|
996
|
+
"target": undefined,
|
|
997
|
+
"capture": false,
|
|
998
|
+
"passive": false
|
|
985
999
|
}];
|
|
986
1000
|
}
|
|
987
1001
|
static get attachInternalsMemberName() { return "internals"; }
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
cursor: not-allowed;
|
|
108
108
|
pointer-events: none;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
:host:has(:focus-visible) .input-wrapper {
|
|
111
111
|
border-color: var(--input-border-color-focus);
|
|
112
112
|
outline: var(--lmvz-ds-outline, 1px solid #0e7ab4);
|
|
113
113
|
outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem));
|
|
@@ -12,6 +12,7 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
12
12
|
}
|
|
13
13
|
lmvzInput;
|
|
14
14
|
internals;
|
|
15
|
+
inputValidityActive = false;
|
|
15
16
|
nativeInputElement;
|
|
16
17
|
inputId = `lmvz-input-${inputIdCounter++}`;
|
|
17
18
|
initialValue = '';
|
|
@@ -68,7 +69,7 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
68
69
|
async setValue(newValue) {
|
|
69
70
|
const input = this.nativeInputElement;
|
|
70
71
|
const val = newValue ?? '';
|
|
71
|
-
if (input) {
|
|
72
|
+
if (input && input.value !== val) {
|
|
72
73
|
input.value = val;
|
|
73
74
|
}
|
|
74
75
|
this.value = val;
|
|
@@ -90,6 +91,9 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
90
91
|
async reportValidity() {
|
|
91
92
|
return this.nativeInputElement?.reportValidity?.() ?? false;
|
|
92
93
|
}
|
|
94
|
+
async getValidationMessage() {
|
|
95
|
+
return this.nativeInputElement?.validationMessage ?? '';
|
|
96
|
+
}
|
|
93
97
|
async getInputElement() {
|
|
94
98
|
if (!this.nativeInputElement) {
|
|
95
99
|
await new Promise((resolve) => componentOnReady(this.el, resolve));
|
|
@@ -148,8 +152,12 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
148
152
|
this.internals.setFormValue?.(this.value ?? '');
|
|
149
153
|
}
|
|
150
154
|
formResetCallback() {
|
|
155
|
+
this.inputValidityActive = false;
|
|
151
156
|
this.internals.setValidity({});
|
|
152
157
|
this.setValue(this.initialValue);
|
|
158
|
+
if (this.nativeInputElement?.checkValidity?.()) {
|
|
159
|
+
this.nativeError = false;
|
|
160
|
+
}
|
|
153
161
|
}
|
|
154
162
|
formStateRestoreCallback(state) {
|
|
155
163
|
this.setValue(state);
|
|
@@ -163,35 +171,45 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
163
171
|
this.setValue(newValue);
|
|
164
172
|
}
|
|
165
173
|
handleDisabledChange(disabled) {
|
|
166
|
-
if (
|
|
174
|
+
if (!this.nativeInputElement)
|
|
175
|
+
return;
|
|
176
|
+
if (disabled) {
|
|
167
177
|
this.nativeInputElement.blur();
|
|
168
178
|
}
|
|
179
|
+
else {
|
|
180
|
+
this.inputValidityActive = false;
|
|
181
|
+
}
|
|
169
182
|
}
|
|
170
183
|
handleInput = (event) => {
|
|
171
184
|
const input = event.target;
|
|
172
185
|
this.setValue(input.value);
|
|
186
|
+
if (!this.inputValidityActive)
|
|
187
|
+
return;
|
|
188
|
+
this.updateNativeError('input');
|
|
173
189
|
};
|
|
174
190
|
handleChange = (event) => {
|
|
175
|
-
const input = event.target ?? this.nativeInputElement;
|
|
176
|
-
this.updateNativeError(input);
|
|
177
191
|
};
|
|
178
192
|
handleFocus = () => { };
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
193
|
+
handleInvalid = () => this.updateNativeError('invalid');
|
|
194
|
+
handleBlur = () => {
|
|
195
|
+
this.inputValidityActive = true;
|
|
196
|
+
this.updateNativeError('blur');
|
|
182
197
|
};
|
|
183
|
-
updateNativeError(
|
|
184
|
-
const input =
|
|
198
|
+
updateNativeError(sourceEvent) {
|
|
199
|
+
const input = this.nativeInputElement;
|
|
185
200
|
if (!input)
|
|
186
201
|
return;
|
|
187
|
-
|
|
202
|
+
const newState = sourceEvent === 'invalid' ? true : !(input.checkValidity?.() ?? true);
|
|
203
|
+
if (this.nativeError === newState)
|
|
204
|
+
return;
|
|
205
|
+
this.nativeError = newState;
|
|
188
206
|
}
|
|
189
207
|
render() {
|
|
190
208
|
const hasValue = Boolean(this.value);
|
|
191
209
|
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
192
|
-
return (h("div", { key: '
|
|
210
|
+
return (h("div", { key: '626697f00e9ba3ad46e6304d06b04df0f27bb2c2', class: classNames('input-container', {
|
|
193
211
|
'interaction-filled': hasValue,
|
|
194
|
-
}) }, h("div", { key: '
|
|
212
|
+
}) }, h("div", { key: '25ec1f448b689ff80defded1323f321d95d6b197', class: "input-wrapper" }, h("slot", { key: '1d5f301e0327b4cd1714f403615f94658a754466', name: "before-input" }), h("div", { key: 'ef553e6e8f6b74a5bb7cddef003d3b51650c7c9d', class: "label-input-group" }, h("label", { key: '17d92ff7c65598739e8a379680580561936e21dc', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (h("span", { key: 'cd40da3c85cc6cea49d7d8d270bba317534779f5', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), h("input", { key: '3ede0644d383c2a3f702230de2aac6fbcb2c7a06', 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, onInvalid: this.handleInvalid })), h("slot", { key: 'b282c5d9553b72af7fd05ed0f872af0d7b8a5689', name: "after-input" })), h("div", { key: 'da6008e798cb5ee29fa7d1ba3208057c1845a217', id: this.helperId, role: "status" }, this.helperText || null), h("div", { key: '5e7717a2d0dd32c53dd7ba6e170152239f3bfae9', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
195
213
|
}
|
|
196
214
|
static get is() { return "lmvz-input"; }
|
|
197
215
|
static get encapsulation() { return "scoped"; }
|
|
@@ -887,6 +905,23 @@ export class LmvzInput extends ReactiveControllerHost {
|
|
|
887
905
|
"tags": []
|
|
888
906
|
}
|
|
889
907
|
},
|
|
908
|
+
"getValidationMessage": {
|
|
909
|
+
"complexType": {
|
|
910
|
+
"signature": "() => Promise<string>",
|
|
911
|
+
"parameters": [],
|
|
912
|
+
"references": {
|
|
913
|
+
"Promise": {
|
|
914
|
+
"location": "global",
|
|
915
|
+
"id": "global::Promise"
|
|
916
|
+
}
|
|
917
|
+
},
|
|
918
|
+
"return": "Promise<string>"
|
|
919
|
+
},
|
|
920
|
+
"docs": {
|
|
921
|
+
"text": "Returns the current validation message, if any.",
|
|
922
|
+
"tags": []
|
|
923
|
+
}
|
|
924
|
+
},
|
|
890
925
|
"getInputElement": {
|
|
891
926
|
"complexType": {
|
|
892
927
|
"signature": "() => Promise<HTMLInputElement | undefined>",
|
|
@@ -18,6 +18,7 @@ export class LmvzPopover {
|
|
|
18
18
|
placement = 'bottom-start';
|
|
19
19
|
size = 'sm';
|
|
20
20
|
autoFocus = true;
|
|
21
|
+
containerRole = 'dialog';
|
|
21
22
|
label;
|
|
22
23
|
lmvzOpen;
|
|
23
24
|
lmvzClose;
|
|
@@ -38,6 +39,7 @@ export class LmvzPopover {
|
|
|
38
39
|
}
|
|
39
40
|
componentDidLoad() {
|
|
40
41
|
autoAssignId(this.el);
|
|
42
|
+
this.syncContainerId();
|
|
41
43
|
}
|
|
42
44
|
handleOpenChange(isOpen) {
|
|
43
45
|
if (isOpen) {
|
|
@@ -64,16 +66,23 @@ export class LmvzPopover {
|
|
|
64
66
|
this.removeCloseHandlers();
|
|
65
67
|
this.extEventController.abort();
|
|
66
68
|
}
|
|
69
|
+
syncContainerId() {
|
|
70
|
+
const hostId = this.el.getAttribute('id');
|
|
71
|
+
if (!hostId || !this.containerEl)
|
|
72
|
+
return;
|
|
73
|
+
this.containerEl.id = hostId;
|
|
74
|
+
}
|
|
67
75
|
setupAnchorEl() {
|
|
68
76
|
const { anchorEl } = this;
|
|
69
77
|
if (!anchorEl) {
|
|
70
78
|
console.warn('no anchor element set for', this);
|
|
71
79
|
return;
|
|
72
80
|
}
|
|
81
|
+
this.syncContainerId();
|
|
73
82
|
if (!anchorEl.hasAttribute('aria-haspopup')) {
|
|
74
|
-
anchorEl.setAttribute('aria-haspopup', 'dialog');
|
|
83
|
+
anchorEl.setAttribute('aria-haspopup', this.containerRole === 'dialog' ? 'dialog' : this.containerRole);
|
|
75
84
|
}
|
|
76
|
-
anchorEl.setAttribute('aria-controls', this.el.getAttribute('id'));
|
|
85
|
+
anchorEl.setAttribute('aria-controls', this.containerEl?.id || this.el.getAttribute('id'));
|
|
77
86
|
if (!anchorEl.hasAttribute('aria-expanded')) {
|
|
78
87
|
anchorEl.setAttribute('aria-expanded', this.open ? 'true' : 'false');
|
|
79
88
|
}
|
|
@@ -101,10 +110,11 @@ export class LmvzPopover {
|
|
|
101
110
|
await waitFrame();
|
|
102
111
|
await this.updatePosition();
|
|
103
112
|
autoAssignId(this.el);
|
|
113
|
+
this.syncContainerId();
|
|
104
114
|
this.applyAnchorAriaOpen();
|
|
105
115
|
this.lmvzOpen.emit();
|
|
106
116
|
await waitFrame();
|
|
107
|
-
if (this.autoFocus) {
|
|
117
|
+
if (this.autoFocus && this.containerRole === 'dialog') {
|
|
108
118
|
this.focusFirst();
|
|
109
119
|
}
|
|
110
120
|
}
|
|
@@ -179,7 +189,7 @@ export class LmvzPopover {
|
|
|
179
189
|
this.closureController?.abort();
|
|
180
190
|
}
|
|
181
191
|
render() {
|
|
182
|
-
return (h(Host, { key: '
|
|
192
|
+
return (h(Host, { key: '8dadcc766deebc03ea744fd1002078b382bfd48d' }, h("div", { key: 'd332714964212db6f5446afb1b8f38ff031a87b9', role: this.containerRole, part: "container", class: `container lmvz-wrapper-card-${this.size}`, "aria-label": this.label || undefined, ref: (el) => (this.containerEl = el) }, h("slot", { key: '0fa1d214c8c48942751cbd4759ebc992eacc8f72', ref: (el) => (this.slotEl = el) }))));
|
|
183
193
|
}
|
|
184
194
|
static get is() { return "lmvz-popover"; }
|
|
185
195
|
static get encapsulation() { return "shadow"; }
|
|
@@ -317,7 +327,7 @@ export class LmvzPopover {
|
|
|
317
327
|
"name": "default",
|
|
318
328
|
"text": "true"
|
|
319
329
|
}],
|
|
320
|
-
"text": "Whether to move focus to the first focusable element on open."
|
|
330
|
+
"text": "Whether to move focus to the first focusable element on open.\nIgnored (treated as `false`) when `containerRole` is not `'dialog'`, since\nnon-dialog roles (e.g. `'listbox'` for combobox/activedescendant integrations)\nmust keep focus on the anchor/trigger element."
|
|
321
331
|
},
|
|
322
332
|
"getter": false,
|
|
323
333
|
"setter": false,
|
|
@@ -325,6 +335,36 @@ export class LmvzPopover {
|
|
|
325
335
|
"attribute": "auto-focus",
|
|
326
336
|
"defaultValue": "true"
|
|
327
337
|
},
|
|
338
|
+
"containerRole": {
|
|
339
|
+
"type": "string",
|
|
340
|
+
"mutable": false,
|
|
341
|
+
"complexType": {
|
|
342
|
+
"original": "Popover.ContainerRole",
|
|
343
|
+
"resolved": "\"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\"",
|
|
344
|
+
"references": {
|
|
345
|
+
"Popover": {
|
|
346
|
+
"location": "import",
|
|
347
|
+
"path": "../../api",
|
|
348
|
+
"id": "src/api/index.d.ts::Popover",
|
|
349
|
+
"referenceLocation": "Popover"
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"required": false,
|
|
354
|
+
"optional": false,
|
|
355
|
+
"docs": {
|
|
356
|
+
"tags": [{
|
|
357
|
+
"name": "default",
|
|
358
|
+
"text": "'dialog'"
|
|
359
|
+
}],
|
|
360
|
+
"text": "ARIA role applied to the popover container.\nUse `'dialog'` (default) for focus-moving dialog-style popovers.\nUse a non-dialog role such as `'listbox'` to integrate with a `role=\"combobox\"`\ntrigger using the activedescendant model, in which case focus is kept on the\nanchor/trigger element instead of being moved into the popover."
|
|
361
|
+
},
|
|
362
|
+
"getter": false,
|
|
363
|
+
"setter": false,
|
|
364
|
+
"reflect": false,
|
|
365
|
+
"attribute": "container-role",
|
|
366
|
+
"defaultValue": "'dialog'"
|
|
367
|
+
},
|
|
328
368
|
"label": {
|
|
329
369
|
"type": "string",
|
|
330
370
|
"mutable": false,
|