minerva-design 1.19.0 → 1.19.2
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 +18 -0
- package/dist/angular/fesm2022/minerva-angular.mjs +10 -14
- package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
- package/dist/angular/types/minerva-angular.d.ts +8 -2
- package/dist/core/decimal-places.d.cts +6 -0
- package/dist/core/decimal-places.d.ts +6 -0
- package/dist/core/index.cjs +21 -21
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +590 -580
- package/dist/core/index.js.map +1 -1
- package/dist/core/keyboard-navigation.d.cts +14 -0
- package/dist/core/keyboard-navigation.d.ts +14 -0
- package/dist/core/number-input.d.cts +4 -1
- package/dist/core/number-input.d.ts +4 -1
- package/dist/core/slider.d.cts +1 -1
- package/dist/core/slider.d.ts +1 -1
- package/dist/react/components/AutoComplete/AutoComplete.cjs +1 -1
- package/dist/react/components/AutoComplete/AutoComplete.cjs.map +1 -1
- package/dist/react/components/AutoComplete/AutoComplete.js +91 -90
- package/dist/react/components/AutoComplete/AutoComplete.js.map +1 -1
- package/dist/react/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/react/components/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/react/components/DatePicker/DatePicker.js +3 -2
- package/dist/react/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/vue/components/AutoComplete/AutoComplete.vue.js.map +1 -1
- package/dist/vue/components/AutoComplete/AutoComplete.vue_vue_type_script_setup_true_lang.js +58 -57
- package/dist/vue/components/AutoComplete/AutoComplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/weapp/controls.js +24 -12
- package/dist/web-components/cdn/minerva.js +532 -532
- package/dist/web-components/cdn/minerva.js.map +1 -1
- package/dist/web-components/components/autocomplete/autocomplete.d.ts +7 -1
- package/dist/web-components/components/autocomplete/autocomplete.js +29 -24
- package/dist/web-components/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/web-components/components/date-picker/date-picker.js +11 -5
- package/dist/web-components/components/date-picker/date-picker.js.map +1 -1
- package/package.json +1 -1
|
@@ -126,7 +126,8 @@ export declare class MinervaAutocomplete extends FormAssociatedElement {
|
|
|
126
126
|
renderOption?: (option: AutoCompleteOption) => AutoCompleteRenderResult;
|
|
127
127
|
/** Custom content shown when no option matches */
|
|
128
128
|
renderEmpty?: () => AutoCompleteRenderResult;
|
|
129
|
-
|
|
129
|
+
/** Keyboard highlight, by option identity (survives option updates). */
|
|
130
|
+
private focusedValue;
|
|
130
131
|
private hoveredIndex;
|
|
131
132
|
private input?;
|
|
132
133
|
private container?;
|
|
@@ -154,6 +155,11 @@ export declare class MinervaAutocomplete extends FormAssociatedElement {
|
|
|
154
155
|
private groupOptions;
|
|
155
156
|
/** Options in display order; keyboard / hover indexes refer to this list. */
|
|
156
157
|
private get navigableOptions();
|
|
158
|
+
/**
|
|
159
|
+
* Active option index: the highlighted option while it is listed and
|
|
160
|
+
* enabled, else the autoHighlight fallback; none while loading (the
|
|
161
|
+
* options are hidden).
|
|
162
|
+
*/
|
|
157
163
|
private activeIndex;
|
|
158
164
|
/** Asks to open / close; listeners can cancel `minerva-open-change`. */
|
|
159
165
|
private requestOpen;
|
|
@@ -16,19 +16,20 @@ import { property as y, query as b, state as x } from "lit/decorators.js";
|
|
|
16
16
|
import { classMap as S } from "lit/directives/class-map.js";
|
|
17
17
|
import { styleMap as C } from "lit/directives/style-map.js";
|
|
18
18
|
import { parsePlacement as w } from "../../../dom/index.js";
|
|
19
|
-
import {
|
|
19
|
+
import { resolveActiveOptionIndex as T } from "../../../core/index.js";
|
|
20
|
+
import { live as E } from "lit/directives/live.js";
|
|
20
21
|
//#region src/components/autocomplete/autocomplete.ts
|
|
21
|
-
var
|
|
22
|
+
var D = {
|
|
22
23
|
top: "top-start",
|
|
23
24
|
bottom: "bottom-start",
|
|
24
25
|
left: "left-start",
|
|
25
26
|
right: "right-start"
|
|
26
|
-
},
|
|
27
|
+
}, O = class u extends h {
|
|
27
28
|
constructor(...t) {
|
|
28
29
|
super(...t), this.value = "", this.defaultValue = "", this.options = [], this.open = !1, this.label = "", this.placeholder = "", this.mode = "basic", this.size = "medium", this.variant = "outline", this.invalid = !1, this.readOnly = !1, this.loading = !1, this.placement = "bottom", this.offset = {
|
|
29
30
|
x: 0,
|
|
30
31
|
y: 4
|
|
31
|
-
}, this.noAnimation = !1, this.autoHighlight = !1, this.noFillOnSelect = !1, this.groupMode = "first", this.
|
|
32
|
+
}, this.noAnimation = !1, this.autoHighlight = !1, this.noFillOnSelect = !1, this.groupMode = "first", this.focusedValue = null, this.hoveredIndex = -1, this.locale = new a(this), this.aria = new e(this, () => this.labels), this.slots = new c(this), this.floating = new d(this, () => {
|
|
32
33
|
let e = this.placement === "top" || this.placement === "bottom", t = this.offset ?? {
|
|
33
34
|
x: 0,
|
|
34
35
|
y: 4
|
|
@@ -36,7 +37,7 @@ var E = {
|
|
|
36
37
|
return {
|
|
37
38
|
anchor: () => this.container,
|
|
38
39
|
floating: () => this.popup,
|
|
39
|
-
placement:
|
|
40
|
+
placement: D[this.placement] ?? "bottom-start",
|
|
40
41
|
offset: {
|
|
41
42
|
mainAxis: e ? t.y : t.x,
|
|
42
43
|
crossAxis: e ? t.x : t.y
|
|
@@ -125,7 +126,7 @@ animation: none;
|
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
128
|
resetFormValue() {
|
|
128
|
-
this.dirty = !1, this.value = this.defaultValue, this.
|
|
129
|
+
this.dirty = !1, this.value = this.defaultValue, this.focusedValue = null;
|
|
129
130
|
}
|
|
130
131
|
restoreFormState(e) {
|
|
131
132
|
typeof e == "string" && (this.value = e);
|
|
@@ -157,7 +158,7 @@ animation: none;
|
|
|
157
158
|
return t ? t.flatMap(([, e]) => e) : e;
|
|
158
159
|
}
|
|
159
160
|
activeIndex(e) {
|
|
160
|
-
return this.
|
|
161
|
+
return T(this.loading ? [] : e, this.focusedValue, this.autoHighlight && this.shown);
|
|
161
162
|
}
|
|
162
163
|
requestOpen(e) {
|
|
163
164
|
if (e === this.open) return !0;
|
|
@@ -168,17 +169,17 @@ animation: none;
|
|
|
168
169
|
this.blocked || this.requestOpen(!0);
|
|
169
170
|
}
|
|
170
171
|
close() {
|
|
171
|
-
this.requestOpen(!1), this.
|
|
172
|
+
this.requestOpen(!1), this.focusedValue = null;
|
|
172
173
|
}
|
|
173
174
|
setText(e, t) {
|
|
174
175
|
e !== this.value && (this.value = e, this.emit("minerva-input", { value: e }), t && this.emit("minerva-change", { value: e }));
|
|
175
176
|
}
|
|
176
177
|
moveFocus(e) {
|
|
177
|
-
let t = this.navigableOptions, n = t.length;
|
|
178
|
+
let t = this.loading ? [] : this.navigableOptions, n = t.length;
|
|
178
179
|
if (n === 0) return;
|
|
179
180
|
let r = this.activeIndex(t), i = r >= 0 ? r : e === 1 ? -1 : n;
|
|
180
181
|
for (let r = 0; r < n; r += 1) if (i = (i + e + n) % n, !t[i].disabled) {
|
|
181
|
-
this.
|
|
182
|
+
this.focusedValue = t[i].value;
|
|
182
183
|
return;
|
|
183
184
|
}
|
|
184
185
|
}
|
|
@@ -199,11 +200,11 @@ animation: none;
|
|
|
199
200
|
n ? (e.preventDefault(), this.selectOption(n)) : r && (e.preventDefault(), this.emit("minerva-submit", { value: r }), this.close());
|
|
200
201
|
break;
|
|
201
202
|
}
|
|
202
|
-
case "Escape": !this.shown && !this.floating.isOpen && this.value !== "" && (e.preventDefault(), this.setText("", !0), this.
|
|
203
|
+
case "Escape": !this.shown && !this.floating.isOpen && this.value !== "" && (e.preventDefault(), this.setText("", !0), this.focusedValue = null);
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
206
|
handleInput() {
|
|
206
|
-
this.setText(this.input.value, !1), this.
|
|
207
|
+
this.setText(this.input.value, !1), this.focusedValue = null, this.openDropdown();
|
|
207
208
|
}
|
|
208
209
|
handleChange() {
|
|
209
210
|
this.value = this.input.value, this.dispatchEvent(new Event("change", { bubbles: !0 })), this.emit("minerva-change", { value: this.value });
|
|
@@ -216,7 +217,7 @@ animation: none;
|
|
|
216
217
|
e.disabled || this.composing || (this.selectOption(e), this.input?.focus());
|
|
217
218
|
}
|
|
218
219
|
willUpdate(e) {
|
|
219
|
-
e.has("value") && e.get("value") !== void 0 && (this.dirty = this.value !== this.defaultValue || this.dirty), e.has("defaultValue") && !this.dirty && (this.hasUpdated || this.hasAttribute("value")) && (this.value = this.defaultValue), this.open && this.blocked && (this.open = !1, this.
|
|
220
|
+
e.has("value") && e.get("value") !== void 0 && (this.dirty = this.value !== this.defaultValue || this.dirty), e.has("defaultValue") && !this.dirty && (this.hasUpdated || this.hasAttribute("value")) && (this.value = this.defaultValue), this.open && this.blocked && (this.open = !1, this.focusedValue = null);
|
|
220
221
|
}
|
|
221
222
|
hookStates() {
|
|
222
223
|
let e = this.shown && this.floating.isOpen ? this.floating.position.placement : void 0, { side: t, align: n } = e ? w(e) : {
|
|
@@ -234,7 +235,11 @@ animation: none;
|
|
|
234
235
|
};
|
|
235
236
|
}
|
|
236
237
|
updated(e) {
|
|
237
|
-
if (super.updated(e), this.floating.sync(this.shown), e.has("
|
|
238
|
+
if (super.updated(e), this.floating.sync(this.shown), e.has("focusedValue") && this.focusedValue !== null) {
|
|
239
|
+
let e = this.activeIndex(this.navigableOptions);
|
|
240
|
+
this.shadowRoot?.getElementById(`option-${e}`)?.scrollIntoView?.({ block: "nearest" });
|
|
241
|
+
}
|
|
242
|
+
if (t && e.has("options")) {
|
|
238
243
|
let e = /* @__PURE__ */ new Set();
|
|
239
244
|
for (let t of this.options ?? []) {
|
|
240
245
|
if (e.has(t.value)) {
|
|
@@ -345,7 +350,7 @@ aria-required=${this.required ? "true" : v}
|
|
|
345
350
|
aria-invalid=${this.invalid || this.aria.attr("aria-invalid") === "true" ? "true" : v}
|
|
346
351
|
data-minerva-escape-consumer=${!e && this.value !== "" ? "" : v}
|
|
347
352
|
autocomplete="off"
|
|
348
|
-
.value=${
|
|
353
|
+
.value=${E(this.value)}
|
|
349
354
|
placeholder=${this.placeholder || v}
|
|
350
355
|
?disabled=${t}
|
|
351
356
|
?readonly=${this.readOnly}
|
|
@@ -382,30 +387,30 @@ ${this.renderList()}
|
|
|
382
387
|
</div>`;
|
|
383
388
|
}
|
|
384
389
|
};
|
|
385
|
-
u([y({ attribute: !1 })],
|
|
390
|
+
u([y({ attribute: !1 })], O.prototype, "value", void 0), u([y({ attribute: "value" })], O.prototype, "defaultValue", void 0), u([y({ attribute: !1 })], O.prototype, "options", void 0), u([y({
|
|
386
391
|
type: Boolean,
|
|
387
392
|
reflect: !0
|
|
388
|
-
})],
|
|
393
|
+
})], O.prototype, "open", void 0), u([y()], O.prototype, "label", void 0), u([y()], O.prototype, "placeholder", void 0), u([y({ reflect: !0 })], O.prototype, "mode", void 0), u([y({ reflect: !0 })], O.prototype, "size", void 0), u([y({ reflect: !0 })], O.prototype, "variant", void 0), u([y({
|
|
389
394
|
type: Boolean,
|
|
390
395
|
reflect: !0
|
|
391
|
-
})],
|
|
396
|
+
})], O.prototype, "invalid", void 0), u([y({
|
|
392
397
|
type: Boolean,
|
|
393
398
|
reflect: !0,
|
|
394
399
|
attribute: "readonly"
|
|
395
|
-
})],
|
|
400
|
+
})], O.prototype, "readOnly", void 0), u([y({
|
|
396
401
|
type: Boolean,
|
|
397
402
|
reflect: !0
|
|
398
|
-
})],
|
|
403
|
+
})], O.prototype, "loading", void 0), u([y({ reflect: !0 })], O.prototype, "placement", void 0), u([y({ attribute: !1 })], O.prototype, "offset", void 0), u([y({
|
|
399
404
|
type: Boolean,
|
|
400
405
|
attribute: "no-animation"
|
|
401
|
-
})],
|
|
406
|
+
})], O.prototype, "noAnimation", void 0), u([y({
|
|
402
407
|
type: Boolean,
|
|
403
408
|
attribute: "auto-highlight"
|
|
404
|
-
})],
|
|
409
|
+
})], O.prototype, "autoHighlight", void 0), u([y({
|
|
405
410
|
type: Boolean,
|
|
406
411
|
attribute: "no-fill-on-select"
|
|
407
|
-
})],
|
|
412
|
+
})], O.prototype, "noFillOnSelect", void 0), u([y({ attribute: "group-mode" })], O.prototype, "groupMode", void 0), u([y({ attribute: !1 })], O.prototype, "filterOption", void 0), u([y({ attribute: !1 })], O.prototype, "sortOption", void 0), u([y({ attribute: !1 })], O.prototype, "groupBy", void 0), u([y({ attribute: !1 })], O.prototype, "renderOption", void 0), u([y({ attribute: !1 })], O.prototype, "renderEmpty", void 0), u([x()], O.prototype, "focusedValue", void 0), u([x()], O.prototype, "hoveredIndex", void 0), u([b("input")], O.prototype, "input", void 0), u([b(".autoComplete")], O.prototype, "container", void 0), u([b(".popup")], O.prototype, "popup", void 0);
|
|
408
413
|
//#endregion
|
|
409
|
-
export {
|
|
414
|
+
export { O as MinervaAutocomplete };
|
|
410
415
|
|
|
411
416
|
//# sourceMappingURL=autocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","names":["inputStyles","styles","_decorate","__decorate","input_module_default","autoComplete_module_default","PLACEMENT","MinervaAutocomplete","FormAssociatedElement","_args","LocaleController","AriaController","HasSlotController","FloatingLayerController","vertical","offset","event","hostStyles","popoverResetStyles","sharedStyles","options","state","text","search","result","option","groupBy","runs","group","last","groups","list","processed","grouped","navigable","open","allowed","next","commit","count","active","index","step","i","changed","placement","parsePlacement","DEV","seen","nothing","activeIndex","highlighted","disabled","itemParts","classMap","styleMap","t","IconSpinner","IconInbox","items","shown","activeId","label","live","property","query"],"sources":["../../../../../web-components/src/components/autocomplete/autocomplete.ts"],"sourcesContent":["import {\n css,\n html,\n nothing,\n type PropertyValues,\n type TemplateResult,\n} from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { parsePlacement } from \"@minerva/dom\";\nimport { live } from \"lit/directives/live.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport inputStyles from \"@react-styles/components/Input/input.module.scss?inline\";\nimport styles from \"@react-styles/components/AutoComplete/autoComplete.module.scss?inline\";\nimport {\n FloatingLayerController,\n popoverResetStyles,\n} from \"../../controllers/floating-layer\";\nimport { AriaController } from \"../../internal/aria\";\nimport { DEV, devWarn } from \"../../internal/dev\";\nimport {\n FormAssociatedElement,\n type ValidityResult,\n} from \"../../internal/form\";\nimport { IconInbox, IconSpinner } from \"../../internal/icons\";\nimport { LocaleController } from \"../../internal/locale\";\nimport { hostStyles } from \"../../internal/minerva-element\";\nimport { HasSlotController } from \"../../internal/slots\";\nimport { itemParts } from \"../../internal/styling-hooks\";\nimport { sharedStyles } from \"../../internal/styles\";\n\n/** Content a render callback may return */\nexport type AutoCompleteRenderResult = string | Node | TemplateResult;\n\n/** An option of the AutoComplete dropdown */\nexport interface AutoCompleteOption {\n /** Text displayed for the option and written to the input when selected */\n label: string;\n /** Unique value of the option */\n value: string | number;\n /** Prevents the option from being selected */\n disabled?: boolean;\n /** Highlights the option (e.g. as a recommendation) */\n highlight?: boolean;\n /** Icon displayed before the label (basic mode) */\n icon?: AutoCompleteRenderResult;\n /** Secondary text displayed under the label (basic mode) */\n description?: string;\n /** Free-form group identifier, typically read by groupBy */\n group?: string;\n /** Inline styles of the option */\n style?: Record<string, string>;\n}\n\nexport type AutoCompleteMode = \"basic\" | \"custom\";\nexport type AutoCompletePlacement = \"top\" | \"bottom\" | \"left\" | \"right\";\nexport type AutoCompleteGroupMode = \"first\" | \"adjacent\";\nexport type AutoCompleteSize = \"small\" | \"medium\" | \"large\";\nexport type AutoCompleteVariant = \"outline\" | \"filled\" | \"unstyled\";\n\nconst PLACEMENT = {\n top: \"top-start\",\n bottom: \"bottom-start\",\n left: \"left-start\",\n right: \"right-start\",\n} as const;\n\n/**\n * Text input (combobox) suggesting options from a list (`<AutoComplete>` of\n * React): filtering, grouping, custom rendering and async loading.\n * Focus stays in the input; the active option is exposed with\n * `aria-activedescendant` (the listbox lives in the same shadow root).\n *\n * Keyboard (WAI-ARIA combobox): ArrowDown / ArrowUp open the list and move\n * the active option (wrapping, disabled options skipped), Enter picks the\n * active option (or fires `minerva-submit` with the typed text when none is\n * active), Escape closes the open list (topmost layer only) and, on a\n * closed list, clears the text (without closing an enclosing modal).\n *\n * Form-associated: submits the input text under `name`; `required` makes an\n * empty text invalid; `form.reset()` restores the `value` attribute.\n *\n * @summary Text input with a filtered suggestion list.\n * @tag minerva-autocomplete\n * @slot prefix - Content before the text (icon)\n * @slot suffix - Content after the text\n * @csspart root - The root wrapper (label, field and anchor of the dropdown)\n * @csspart label - The visible label\n * @csspart field - The input box\n * @csspart input - The native `<input role=combobox>`\n * @csspart content - The positioned dropdown\n * @csspart list - The `role=listbox` list\n * @csspart item - An option\n * @csspart item--highlighted - Item state of `item`: highlighted\n * @csspart item--disabled - Item state of `item`: disabled\n * @csspart group-label - A group heading\n * @csspart empty - The empty state (no matching option)\n * @csspart loading - The loading state (while loading)\n * @fires minerva-input - The input text changed (typing, picking an option, Escape clearing) (`detail: { value }`)\n * @fires minerva-change - The text was committed: an option filled it in, Escape cleared it, or the native change (blur) (`detail: { value }`)\n * @fires minerva-select - An option was picked with the mouse or the keyboard (`detail: { value, option }`)\n * @fires minerva-submit - Enter was pressed with no active option and non-blank text (`detail: { value }`, trimmed)\n * @fires minerva-open-change - The dropdown opens / closes (`detail: { open }`); cancelable: `preventDefault()` keeps the current state\n */\nexport class MinervaAutocomplete extends FormAssociatedElement {\n static override tagName = \"minerva-autocomplete\";\n static override shadowRootOptions = {\n ...FormAssociatedElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static override styles = [\n hostStyles,\n popoverResetStyles,\n sharedStyles(inputStyles),\n sharedStyles(styles),\n css`\n:host{\ndisplay: block;\nwidth: 100%;\n}\n\n.optionItem.disabled:not(.active):not(.highlight){\nbackground-color: transparent;\n}\n.popup .dropdown .optionList .loading svg{\nfont-size: 1.5em;\nanimation: minerva-autocomplete-spin 1s linear infinite;\n}\n.empty svg{\ndisplay: block;\nmargin: 0 auto var(--space-2);\nfont-size: 40px;\ncolor: var(--text-muted-color);\n}\n@keyframes minerva-autocomplete-spin{\nto{\ntransform: rotate(360deg);\n}\n}\n@media (prefers-reduced-motion: reduce){\n.popup .dropdown .optionList .loading svg{\nanimation: none;\n}\n}\n`,\n ];\n\n /** Input text (property; the `value` attribute sets `defaultValue`) */\n @property({ attribute: false })\n value = \"\";\n\n /** Initial text, restored by `form.reset()` (the `value` attribute) */\n @property({ attribute: \"value\" })\n defaultValue = \"\";\n\n /** Options to suggest */\n @property({ attribute: false })\n options: AutoCompleteOption[] = [];\n\n /** Whether the dropdown is open */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /** Visible label of the input (also names the listbox) */\n @property()\n label = \"\";\n\n /** Placeholder of the input */\n @property()\n placeholder = \"\";\n\n /** \"basic\" renders icon / label / description; \"custom\" uses `renderOption` */\n @property({ reflect: true })\n mode: AutoCompleteMode = \"basic\";\n\n /** Size of the input */\n @property({ reflect: true })\n size: AutoCompleteSize = \"medium\";\n\n /** Visual style of the input */\n @property({ reflect: true })\n variant: AutoCompleteVariant = \"outline\";\n\n /** Error state; sets aria-invalid */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /** Read-only: focusable and submitted, no dropdown */\n @property({ type: Boolean, reflect: true, attribute: \"readonly\" })\n readOnly = false;\n\n /** Shows a loading indicator instead of the options */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /** Preferred dropdown side (aligned with the input's start edge) */\n @property({ reflect: true })\n placement: AutoCompletePlacement = \"bottom\";\n\n /**\n * Dropdown offset in px: for top / bottom `y` is the gap and `x` the\n * shift, for left / right the reverse\n */\n @property({ attribute: false })\n offset: { x: number; y: number } = { x: 0, y: 4 };\n\n /** Disables the opening animation */\n @property({ type: Boolean, attribute: \"no-animation\" })\n noAnimation = false;\n\n /** Makes the first enabled option active whenever the dropdown opens */\n @property({ type: Boolean, attribute: \"auto-highlight\" })\n autoHighlight = false;\n\n /** Keeps the typed text when an option is picked (no fill-in) */\n @property({ type: Boolean, attribute: \"no-fill-on-select\" })\n noFillOnSelect = false;\n\n /** How `groupBy` groups options: at first appearance, or runs of adjacent options */\n @property({ attribute: \"group-mode\" })\n groupMode: AutoCompleteGroupMode = \"first\";\n\n /** Custom filter (default: label contains the text, case-insensitive) */\n @property({ attribute: false })\n filterOption?: (inputValue: string, option: AutoCompleteOption) => boolean;\n\n /** Compare function sorting the filtered options */\n @property({ attribute: false })\n sortOption?: (a: AutoCompleteOption, b: AutoCompleteOption) => number;\n\n /** Group name of an option; options are grouped under headings (\"\" = none) */\n @property({ attribute: false })\n groupBy?: (option: AutoCompleteOption) => string;\n\n /** Custom option renderer (used when `mode` is \"custom\") */\n @property({ attribute: false })\n renderOption?: (option: AutoCompleteOption) => AutoCompleteRenderResult;\n\n /** Custom content shown when no option matches */\n @property({ attribute: false })\n renderEmpty?: () => AutoCompleteRenderResult;\n\n @state()\n private focusedIndex = -1;\n\n @state()\n private hoveredIndex = -1;\n\n @query(\"input\")\n private input?: HTMLInputElement;\n\n @query(\".autoComplete\")\n private container?: HTMLElement;\n\n @query(\".popup\")\n private popup?: HTMLElement;\n\n private readonly locale = new LocaleController(this);\n private readonly aria = new AriaController(this, () => this.labels);\n private readonly slots = new HasSlotController(this);\n private readonly floating = new FloatingLayerController(this, () => {\n const vertical = this.placement === \"top\" || this.placement === \"bottom\";\n const offset = this.offset ?? { x: 0, y: 4 };\n return {\n anchor: () => this.container,\n floating: () => this.popup,\n placement: PLACEMENT[this.placement] ?? \"bottom-start\",\n offset: {\n mainAxis: vertical ? offset.y : offset.x,\n crossAxis: vertical ? offset.x : offset.y,\n },\n matchAnchorWidth: \"min\",\n // the field (label, input, suffix) is part of the dropdown layer\n branches: () => [this.container],\n onEscapeKeyDown: (event) => {\n // Escape during IME composition cancels the composition only\n if (this.composing || event.isComposing) event.preventDefault();\n },\n onDismiss: () => this.close(),\n returnFocusOnEscape: () => this.input,\n onPosition: () => this.syncHookStates(),\n };\n });\n /** IME composition in progress: Enter / arrows belong to the IME. */\n private composing = false;\n private dirty = false;\n\n override focus(options?: FocusOptions): void {\n this.input?.focus(options);\n }\n\n override blur(): void {\n this.input?.blur();\n }\n\n /** Whether the input accepts no interaction (disabled / read-only). */\n private get blocked(): boolean {\n return this.isDisabled || this.readOnly;\n }\n\n /** The dropdown is rendered (open and interactive). */\n private get shown(): boolean {\n return this.open && !this.blocked;\n }\n\n protected getFormValue(): string {\n return this.value;\n }\n\n protected override getValidity(): ValidityResult {\n return this.required && this.value === \"\"\n ? {\n flags: { valueMissing: true },\n message: this.locale.t(\"validation.valueMissing\"),\n anchor: this.input,\n }\n : { flags: {}, message: \"\" };\n }\n\n protected resetFormValue(): void {\n this.dirty = false;\n this.value = this.defaultValue;\n this.focusedIndex = -1;\n }\n\n protected override restoreFormState(state: unknown): void {\n if (typeof state === \"string\") this.value = state;\n }\n\n /** Filtered (and sorted) options. */\n private get processedOptions(): AutoCompleteOption[] {\n const text = this.value;\n const search = text.toLowerCase();\n const result = (this.options ?? []).filter((option) =>\n this.filterOption\n ? this.filterOption(text, option)\n : option.label.toLowerCase().includes(search),\n );\n return this.sortOption ? [...result].sort(this.sortOption) : result;\n }\n\n /** Groups in order of first appearance, or runs of adjacent options. */\n private groupOptions(\n options: AutoCompleteOption[],\n ): Array<[string, AutoCompleteOption[]]> | null {\n const groupBy = this.groupBy;\n if (!groupBy) return null;\n if (this.groupMode === \"adjacent\") {\n const runs: Array<[string, AutoCompleteOption[]]> = [];\n for (const option of options) {\n const group = groupBy(option);\n const last = runs[runs.length - 1];\n if (last && last[0] === group) last[1].push(option);\n else runs.push([group, [option]]);\n }\n return runs;\n }\n const groups = new Map<string, AutoCompleteOption[]>();\n for (const option of options) {\n const group = groupBy(option);\n const list = groups.get(group);\n if (list) list.push(option);\n else groups.set(group, [option]);\n }\n return Array.from(groups.entries());\n }\n\n /** Options in display order; keyboard / hover indexes refer to this list. */\n private get navigableOptions(): AutoCompleteOption[] {\n const processed = this.processedOptions;\n const grouped = this.groupOptions(processed);\n return grouped ? grouped.flatMap(([, list]) => list) : processed;\n }\n\n private activeIndex(navigable: AutoCompleteOption[]): number {\n if (this.focusedIndex >= 0) return this.focusedIndex;\n return this.autoHighlight && this.shown\n ? navigable.findIndex((option) => !option.disabled)\n : -1;\n }\n\n /** Asks to open / close; listeners can cancel `minerva-open-change`. */\n private requestOpen(open: boolean): boolean {\n if (open === this.open) return true;\n const allowed = this.emit(\n \"minerva-open-change\",\n { open },\n { cancelable: true },\n );\n if (allowed) this.open = open;\n return allowed;\n }\n\n private openDropdown() {\n if (!this.blocked) this.requestOpen(true);\n }\n\n private close() {\n this.requestOpen(false);\n this.focusedIndex = -1;\n }\n\n private setText(next: string, commit: boolean) {\n if (next === this.value) return;\n this.value = next;\n this.emit(\"minerva-input\", { value: next });\n if (commit) this.emit(\"minerva-change\", { value: next });\n }\n\n private moveFocus(step: 1 | -1) {\n const navigable = this.navigableOptions;\n const count = navigable.length;\n if (count === 0) return;\n // from \"nothing focused\", ArrowDown starts at the first option and\n // ArrowUp at the last one\n const active = this.activeIndex(navigable);\n let index = active >= 0 ? active : step === 1 ? -1 : count;\n for (let i = 0; i < count; i += 1) {\n index = (index + step + count) % count;\n if (!navigable[index].disabled) {\n this.focusedIndex = index;\n return;\n }\n }\n }\n\n private selectOption(option: AutoCompleteOption) {\n if (option.disabled) return;\n if (!this.noFillOnSelect) this.setText(option.label, true);\n this.close();\n this.emit(\"minerva-select\", { value: option.value, option });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (\n this.blocked ||\n this.composing ||\n event.isComposing ||\n event.keyCode === 229\n ) {\n return;\n }\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\": {\n event.preventDefault();\n // open first: the active index depends on the open state\n if (!this.open) this.openDropdown();\n this.moveFocus(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n }\n case \"Enter\": {\n const navigable = this.navigableOptions;\n const option = this.shown\n ? navigable[this.activeIndex(navigable)]\n : undefined;\n const text = this.value.trim();\n if (option) {\n event.preventDefault();\n this.selectOption(option);\n } else if (text) {\n // No active option: submit the typed text (e.g. a search).\n event.preventDefault();\n this.emit(\"minerva-submit\", { value: text });\n this.close();\n }\n break;\n }\n case \"Escape\":\n // Open: the dropdown's dismissable layer closes it (topmost only).\n // Closed: clears the text (APG combobox). The layer's document\n // listener may already have closed it during this very keydown.\n if (!this.shown && !this.floating.isOpen && this.value !== \"\") {\n event.preventDefault();\n this.setText(\"\", true);\n this.focusedIndex = -1;\n }\n break;\n default:\n break;\n }\n }\n\n private handleInput() {\n this.setText(this.input!.value, false);\n this.focusedIndex = -1;\n this.openDropdown();\n }\n\n private handleChange() {\n this.value = this.input!.value;\n // `change` is not composed: re-dispatch it from the host\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\n this.emit(\"minerva-change\", { value: this.value });\n }\n\n private handleBlur(event: FocusEvent) {\n const next = event.relatedTarget as Node | null;\n if (\n next &&\n (this.popup?.contains(next) || this.container?.contains(next))\n ) {\n return;\n }\n this.close();\n }\n\n private handleOptionClick(option: AutoCompleteOption) {\n if (option.disabled || this.composing) return;\n this.selectOption(option);\n this.input?.focus();\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has(\"value\") && changed.get(\"value\") !== undefined) {\n this.dirty = this.value !== this.defaultValue || this.dirty;\n }\n // first update: a value set before connecting wins over the default\n // unless the value attribute is present\n if (\n changed.has(\"defaultValue\") &&\n !this.dirty &&\n (this.hasUpdated || this.hasAttribute(\"value\"))\n ) {\n this.value = this.defaultValue;\n }\n // A disabled / read-only field never keeps the dropdown.\n if (this.open && this.blocked) {\n this.open = false;\n this.focusedIndex = -1;\n }\n }\n\n protected override hookStates() {\n const placement =\n this.shown && this.floating.isOpen\n ? this.floating.position.placement\n : undefined;\n const { side, align } = placement\n ? parsePlacement(placement)\n : { side: undefined, align: undefined };\n return {\n state: this.shown ? \"open\" : \"closed\",\n disabled: this.isDisabled,\n readonly: this.readOnly,\n loading: this.loading,\n side,\n align,\n placement,\n };\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n this.floating.sync(this.shown);\n // Keep the keyboard-focused option scrolled into view\n if (changed.has(\"focusedIndex\") && this.focusedIndex >= 0) {\n this.shadowRoot\n ?.getElementById(`option-${this.focusedIndex}`)\n ?.scrollIntoView?.({ block: \"nearest\" });\n }\n if (DEV && changed.has(\"options\")) {\n const seen = new Set<string | number>();\n for (const option of this.options ?? []) {\n if (seen.has(option.value)) {\n devWarn(\n MinervaAutocomplete.tagName,\n `several options have the value \"${option.value}\"; option values must be unique.`,\n );\n break;\n }\n seen.add(option.value);\n }\n }\n }\n\n private renderOptionContent(option: AutoCompleteOption) {\n if (this.mode === \"custom\" && this.renderOption) {\n return this.renderOption(option);\n }\n return html`<div class=\"basicOption\">\n${option.icon ? html`<span class=\"icon\">${option.icon}</span>` : nothing}\n<div class=\"content\">\n<div class=\"label\">${option.label}</div>\n${\n option.description\n ? html`<div class=\"description\">${option.description}</div>`\n : nothing\n }\n</div>\n</div>`;\n }\n\n private renderOptionItem(\n option: AutoCompleteOption,\n index: number,\n activeIndex: number,\n ) {\n const active = activeIndex === index;\n const highlighted = this.hoveredIndex === index || active;\n const disabled = !!option.disabled;\n return html`<div\npart=${itemParts(\"item\", { highlighted, disabled })}\nclass=${classMap({\n optionItem: true,\n disabled,\n highlight: !!option.highlight,\n active: highlighted,\n })}\nstyle=${option.style ? styleMap(option.style) : nothing}\nrole=\"option\"\ntabindex=\"-1\"\nid=${`option-${index}`}\naria-selected=${String(active)}\naria-disabled=${option.disabled ? \"true\" : nothing}\n@mousedown=${(event: MouseEvent) => event.preventDefault()}\n@click=${() => this.handleOptionClick(option)}\n@keydown=${(event: KeyboardEvent) => {\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n event.stopPropagation();\n this.handleOptionClick(option);\n }}\n@mouseenter=${() => (this.hoveredIndex = index)}\n@mouseleave=${() => (this.hoveredIndex = -1)}\n>\n${this.renderOptionContent(option)}\n</div>`;\n }\n\n private renderList() {\n const { t } = this.locale;\n if (this.loading) {\n return html`<div role=\"presentation\" class=\"loading\" part=\"loading\">\n<span role=\"progressbar\" aria-label=${t(\"common.loading\")}\n>${IconSpinner}</span\n>\n</div>`;\n }\n const processed = this.processedOptions;\n if (processed.length === 0) {\n return html`<div role=\"presentation\" class=\"empty\" part=\"empty\">\n${\n this.renderEmpty?.() ||\n html`${IconInbox}<span>${t(\"empty.description\")}</span>`\n }\n</div>`;\n }\n const grouped = this.groupOptions(processed);\n const navigable = grouped ? grouped.flatMap(([, list]) => list) : processed;\n const activeIndex = this.activeIndex(navigable);\n if (!grouped) {\n return processed.map((option, index) =>\n this.renderOptionItem(option, index, activeIndex),\n );\n }\n return grouped.map(([group, list]) => {\n const items = list.map((option) =>\n this.renderOptionItem(option, navigable.indexOf(option), activeIndex),\n );\n return group === \"\"\n ? items\n : html`<div class=\"optionGroup\" role=\"group\" aria-label=${group}>\n<div class=\"groupLabel\" part=\"group-label\" aria-hidden=\"true\">\n${group}\n</div>\n${items}\n</div>`;\n });\n }\n\n protected override render() {\n const shown = this.shown;\n const disabled = this.isDisabled;\n const navigable = shown ? this.navigableOptions : [];\n const activeIndex = shown ? this.activeIndex(navigable) : -1;\n const activeId =\n shown && activeIndex >= 0 && activeIndex < navigable.length\n ? `option-${activeIndex}`\n : undefined;\n const label = this.label ? undefined : this.aria.label;\n // data-minerva-escape-consumer (core's ESCAPE_CONSUMER_ATTRIBUTE): on a\n // closed list with text, Escape clears it instead of closing an\n // enclosing modal / drawer / popover.\n return html`<div\npart=\"root\"\nclass=\"autoComplete\"\n@compositionstart=${() => (this.composing = true)}\n@compositionend=${() => (this.composing = false)}\n>\n${\n this.label\n ? html`<label for=\"input\" class=\"label\" part=\"label\"\n>${this.label}</label\n>`\n : nothing\n }\n<div\npart=\"field\"\nclass=${classMap({\n root: true,\n [this.variant]: true,\n [this.size]: true,\n invalid: this.invalid,\n disabled,\n })}\ndata-component=\"input\"\n>\n${\n this.slots.test(\"prefix\")\n ? html`<span class=\"addon start\"><slot name=\"prefix\"></slot></span>`\n : nothing\n }\n<input\nid=\"input\"\npart=\"input\"\nclass=\"field\"\ntype=\"text\"\nrole=\"combobox\"\naria-autocomplete=\"list\"\naria-expanded=${String(shown)}\naria-controls=${shown ? \"listbox\" : nothing}\naria-activedescendant=${activeId ?? nothing}\naria-label=${label ?? nothing}\naria-description=${this.aria.description ?? nothing}\naria-required=${this.required ? \"true\" : nothing}\naria-invalid=${\n this.invalid || this.aria.attr(\"aria-invalid\") === \"true\"\n ? \"true\"\n : nothing\n }\ndata-minerva-escape-consumer=${\n !shown && this.value !== \"\" ? \"\" : nothing\n }\nautocomplete=\"off\"\n.value=${live(this.value)}\nplaceholder=${this.placeholder || nothing}\n?disabled=${disabled}\n?readonly=${this.readOnly}\n@input=${this.handleInput}\n@change=${this.handleChange}\n@focus=${() => this.openDropdown()}\n@click=${() => {\n if (!this.open) this.openDropdown();\n }}\n@blur=${this.handleBlur}\n@keydown=${this.handleKeyDown}\n/>\n${\n this.slots.test(\"suffix\")\n ? html`<span class=\"addon end\"><slot name=\"suffix\"></slot></span>`\n : nothing\n }\n</div>\n${\n shown\n ? html`<div class=\"popup\" part=\"content\" popover=\"manual\">\n<div\nclass=${classMap({\n dropdown: true,\n animated: !this.noAnimation,\n })}\n>\n<div\nclass=\"optionList\"\npart=\"list\"\nrole=\"listbox\"\nid=\"listbox\"\naria-label=${this.label || label || nothing}\naria-busy=${this.loading ? \"true\" : nothing}\n>\n${this.renderList()}\n</div>\n</div>\n</div>`\n : nothing\n }\n</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-autocomplete\": MinervaAutocomplete;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4DA,IAAMM,IAAY;CAChB,KAAK;CACL,QAAQ;CACR,MAAM;CACN,OAAO;AACT,GAuCaC,IAAb,MAAaA,UAA4BC,EAAsB;;EAqL7C,aAxIR,KAAA,QAAA,IAIO,KAAA,eAAA,IAIiB,KAAA,UAAA,CAAC,GAI1B,KAAA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}
|
|
1
|
+
{"version":3,"file":"autocomplete.js","names":["inputStyles","styles","_decorate","__decorate","input_module_default","autoComplete_module_default","PLACEMENT","MinervaAutocomplete","FormAssociatedElement","_args","LocaleController","AriaController","HasSlotController","FloatingLayerController","vertical","offset","event","hostStyles","popoverResetStyles","sharedStyles","options","state","text","search","result","option","groupBy","runs","group","last","groups","list","processed","grouped","resolveActiveOptionIndex","navigable","open","allowed","next","commit","count","active","index","step","i","changed","placement","parsePlacement","DEV","seen","nothing","activeIndex","highlighted","disabled","itemParts","classMap","styleMap","t","IconSpinner","IconInbox","items","shown","activeId","label","live","property","query"],"sources":["../../../../../web-components/src/components/autocomplete/autocomplete.ts"],"sourcesContent":["import {\n css,\n html,\n nothing,\n type PropertyValues,\n type TemplateResult,\n} from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { parsePlacement } from \"@minerva/dom\";\nimport { resolveActiveOptionIndex } from \"@minerva/core\";\nimport { live } from \"lit/directives/live.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport inputStyles from \"@react-styles/components/Input/input.module.scss?inline\";\nimport styles from \"@react-styles/components/AutoComplete/autoComplete.module.scss?inline\";\nimport {\n FloatingLayerController,\n popoverResetStyles,\n} from \"../../controllers/floating-layer\";\nimport { AriaController } from \"../../internal/aria\";\nimport { DEV, devWarn } from \"../../internal/dev\";\nimport {\n FormAssociatedElement,\n type ValidityResult,\n} from \"../../internal/form\";\nimport { IconInbox, IconSpinner } from \"../../internal/icons\";\nimport { LocaleController } from \"../../internal/locale\";\nimport { hostStyles } from \"../../internal/minerva-element\";\nimport { HasSlotController } from \"../../internal/slots\";\nimport { itemParts } from \"../../internal/styling-hooks\";\nimport { sharedStyles } from \"../../internal/styles\";\n\n/** Content a render callback may return */\nexport type AutoCompleteRenderResult = string | Node | TemplateResult;\n\n/** An option of the AutoComplete dropdown */\nexport interface AutoCompleteOption {\n /** Text displayed for the option and written to the input when selected */\n label: string;\n /** Unique value of the option */\n value: string | number;\n /** Prevents the option from being selected */\n disabled?: boolean;\n /** Highlights the option (e.g. as a recommendation) */\n highlight?: boolean;\n /** Icon displayed before the label (basic mode) */\n icon?: AutoCompleteRenderResult;\n /** Secondary text displayed under the label (basic mode) */\n description?: string;\n /** Free-form group identifier, typically read by groupBy */\n group?: string;\n /** Inline styles of the option */\n style?: Record<string, string>;\n}\n\nexport type AutoCompleteMode = \"basic\" | \"custom\";\nexport type AutoCompletePlacement = \"top\" | \"bottom\" | \"left\" | \"right\";\nexport type AutoCompleteGroupMode = \"first\" | \"adjacent\";\nexport type AutoCompleteSize = \"small\" | \"medium\" | \"large\";\nexport type AutoCompleteVariant = \"outline\" | \"filled\" | \"unstyled\";\n\nconst PLACEMENT = {\n top: \"top-start\",\n bottom: \"bottom-start\",\n left: \"left-start\",\n right: \"right-start\",\n} as const;\n\n/**\n * Text input (combobox) suggesting options from a list (`<AutoComplete>` of\n * React): filtering, grouping, custom rendering and async loading.\n * Focus stays in the input; the active option is exposed with\n * `aria-activedescendant` (the listbox lives in the same shadow root).\n *\n * Keyboard (WAI-ARIA combobox): ArrowDown / ArrowUp open the list and move\n * the active option (wrapping, disabled options skipped), Enter picks the\n * active option (or fires `minerva-submit` with the typed text when none is\n * active), Escape closes the open list (topmost layer only) and, on a\n * closed list, clears the text (without closing an enclosing modal).\n *\n * Form-associated: submits the input text under `name`; `required` makes an\n * empty text invalid; `form.reset()` restores the `value` attribute.\n *\n * @summary Text input with a filtered suggestion list.\n * @tag minerva-autocomplete\n * @slot prefix - Content before the text (icon)\n * @slot suffix - Content after the text\n * @csspart root - The root wrapper (label, field and anchor of the dropdown)\n * @csspart label - The visible label\n * @csspart field - The input box\n * @csspart input - The native `<input role=combobox>`\n * @csspart content - The positioned dropdown\n * @csspart list - The `role=listbox` list\n * @csspart item - An option\n * @csspart item--highlighted - Item state of `item`: highlighted\n * @csspart item--disabled - Item state of `item`: disabled\n * @csspart group-label - A group heading\n * @csspart empty - The empty state (no matching option)\n * @csspart loading - The loading state (while loading)\n * @fires minerva-input - The input text changed (typing, picking an option, Escape clearing) (`detail: { value }`)\n * @fires minerva-change - The text was committed: an option filled it in, Escape cleared it, or the native change (blur) (`detail: { value }`)\n * @fires minerva-select - An option was picked with the mouse or the keyboard (`detail: { value, option }`)\n * @fires minerva-submit - Enter was pressed with no active option and non-blank text (`detail: { value }`, trimmed)\n * @fires minerva-open-change - The dropdown opens / closes (`detail: { open }`); cancelable: `preventDefault()` keeps the current state\n */\nexport class MinervaAutocomplete extends FormAssociatedElement {\n static override tagName = \"minerva-autocomplete\";\n static override shadowRootOptions = {\n ...FormAssociatedElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static override styles = [\n hostStyles,\n popoverResetStyles,\n sharedStyles(inputStyles),\n sharedStyles(styles),\n css`\n:host{\ndisplay: block;\nwidth: 100%;\n}\n\n.optionItem.disabled:not(.active):not(.highlight){\nbackground-color: transparent;\n}\n.popup .dropdown .optionList .loading svg{\nfont-size: 1.5em;\nanimation: minerva-autocomplete-spin 1s linear infinite;\n}\n.empty svg{\ndisplay: block;\nmargin: 0 auto var(--space-2);\nfont-size: 40px;\ncolor: var(--text-muted-color);\n}\n@keyframes minerva-autocomplete-spin{\nto{\ntransform: rotate(360deg);\n}\n}\n@media (prefers-reduced-motion: reduce){\n.popup .dropdown .optionList .loading svg{\nanimation: none;\n}\n}\n`,\n ];\n\n /** Input text (property; the `value` attribute sets `defaultValue`) */\n @property({ attribute: false })\n value = \"\";\n\n /** Initial text, restored by `form.reset()` (the `value` attribute) */\n @property({ attribute: \"value\" })\n defaultValue = \"\";\n\n /** Options to suggest */\n @property({ attribute: false })\n options: AutoCompleteOption[] = [];\n\n /** Whether the dropdown is open */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /** Visible label of the input (also names the listbox) */\n @property()\n label = \"\";\n\n /** Placeholder of the input */\n @property()\n placeholder = \"\";\n\n /** \"basic\" renders icon / label / description; \"custom\" uses `renderOption` */\n @property({ reflect: true })\n mode: AutoCompleteMode = \"basic\";\n\n /** Size of the input */\n @property({ reflect: true })\n size: AutoCompleteSize = \"medium\";\n\n /** Visual style of the input */\n @property({ reflect: true })\n variant: AutoCompleteVariant = \"outline\";\n\n /** Error state; sets aria-invalid */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /** Read-only: focusable and submitted, no dropdown */\n @property({ type: Boolean, reflect: true, attribute: \"readonly\" })\n readOnly = false;\n\n /** Shows a loading indicator instead of the options */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /** Preferred dropdown side (aligned with the input's start edge) */\n @property({ reflect: true })\n placement: AutoCompletePlacement = \"bottom\";\n\n /**\n * Dropdown offset in px: for top / bottom `y` is the gap and `x` the\n * shift, for left / right the reverse\n */\n @property({ attribute: false })\n offset: { x: number; y: number } = { x: 0, y: 4 };\n\n /** Disables the opening animation */\n @property({ type: Boolean, attribute: \"no-animation\" })\n noAnimation = false;\n\n /** Makes the first enabled option active whenever the dropdown opens */\n @property({ type: Boolean, attribute: \"auto-highlight\" })\n autoHighlight = false;\n\n /** Keeps the typed text when an option is picked (no fill-in) */\n @property({ type: Boolean, attribute: \"no-fill-on-select\" })\n noFillOnSelect = false;\n\n /** How `groupBy` groups options: at first appearance, or runs of adjacent options */\n @property({ attribute: \"group-mode\" })\n groupMode: AutoCompleteGroupMode = \"first\";\n\n /** Custom filter (default: label contains the text, case-insensitive) */\n @property({ attribute: false })\n filterOption?: (inputValue: string, option: AutoCompleteOption) => boolean;\n\n /** Compare function sorting the filtered options */\n @property({ attribute: false })\n sortOption?: (a: AutoCompleteOption, b: AutoCompleteOption) => number;\n\n /** Group name of an option; options are grouped under headings (\"\" = none) */\n @property({ attribute: false })\n groupBy?: (option: AutoCompleteOption) => string;\n\n /** Custom option renderer (used when `mode` is \"custom\") */\n @property({ attribute: false })\n renderOption?: (option: AutoCompleteOption) => AutoCompleteRenderResult;\n\n /** Custom content shown when no option matches */\n @property({ attribute: false })\n renderEmpty?: () => AutoCompleteRenderResult;\n\n /** Keyboard highlight, by option identity (survives option updates). */\n @state()\n private focusedValue: string | number | null = null;\n\n @state()\n private hoveredIndex = -1;\n\n @query(\"input\")\n private input?: HTMLInputElement;\n\n @query(\".autoComplete\")\n private container?: HTMLElement;\n\n @query(\".popup\")\n private popup?: HTMLElement;\n\n private readonly locale = new LocaleController(this);\n private readonly aria = new AriaController(this, () => this.labels);\n private readonly slots = new HasSlotController(this);\n private readonly floating = new FloatingLayerController(this, () => {\n const vertical = this.placement === \"top\" || this.placement === \"bottom\";\n const offset = this.offset ?? { x: 0, y: 4 };\n return {\n anchor: () => this.container,\n floating: () => this.popup,\n placement: PLACEMENT[this.placement] ?? \"bottom-start\",\n offset: {\n mainAxis: vertical ? offset.y : offset.x,\n crossAxis: vertical ? offset.x : offset.y,\n },\n matchAnchorWidth: \"min\",\n // the field (label, input, suffix) is part of the dropdown layer\n branches: () => [this.container],\n onEscapeKeyDown: (event) => {\n // Escape during IME composition cancels the composition only\n if (this.composing || event.isComposing) event.preventDefault();\n },\n onDismiss: () => this.close(),\n returnFocusOnEscape: () => this.input,\n onPosition: () => this.syncHookStates(),\n };\n });\n /** IME composition in progress: Enter / arrows belong to the IME. */\n private composing = false;\n private dirty = false;\n\n override focus(options?: FocusOptions): void {\n this.input?.focus(options);\n }\n\n override blur(): void {\n this.input?.blur();\n }\n\n /** Whether the input accepts no interaction (disabled / read-only). */\n private get blocked(): boolean {\n return this.isDisabled || this.readOnly;\n }\n\n /** The dropdown is rendered (open and interactive). */\n private get shown(): boolean {\n return this.open && !this.blocked;\n }\n\n protected getFormValue(): string {\n return this.value;\n }\n\n protected override getValidity(): ValidityResult {\n return this.required && this.value === \"\"\n ? {\n flags: { valueMissing: true },\n message: this.locale.t(\"validation.valueMissing\"),\n anchor: this.input,\n }\n : { flags: {}, message: \"\" };\n }\n\n protected resetFormValue(): void {\n this.dirty = false;\n this.value = this.defaultValue;\n this.focusedValue = null;\n }\n\n protected override restoreFormState(state: unknown): void {\n if (typeof state === \"string\") this.value = state;\n }\n\n /** Filtered (and sorted) options. */\n private get processedOptions(): AutoCompleteOption[] {\n const text = this.value;\n const search = text.toLowerCase();\n const result = (this.options ?? []).filter((option) =>\n this.filterOption\n ? this.filterOption(text, option)\n : option.label.toLowerCase().includes(search),\n );\n return this.sortOption ? [...result].sort(this.sortOption) : result;\n }\n\n /** Groups in order of first appearance, or runs of adjacent options. */\n private groupOptions(\n options: AutoCompleteOption[],\n ): Array<[string, AutoCompleteOption[]]> | null {\n const groupBy = this.groupBy;\n if (!groupBy) return null;\n if (this.groupMode === \"adjacent\") {\n const runs: Array<[string, AutoCompleteOption[]]> = [];\n for (const option of options) {\n const group = groupBy(option);\n const last = runs[runs.length - 1];\n if (last && last[0] === group) last[1].push(option);\n else runs.push([group, [option]]);\n }\n return runs;\n }\n const groups = new Map<string, AutoCompleteOption[]>();\n for (const option of options) {\n const group = groupBy(option);\n const list = groups.get(group);\n if (list) list.push(option);\n else groups.set(group, [option]);\n }\n return Array.from(groups.entries());\n }\n\n /** Options in display order; keyboard / hover indexes refer to this list. */\n private get navigableOptions(): AutoCompleteOption[] {\n const processed = this.processedOptions;\n const grouped = this.groupOptions(processed);\n return grouped ? grouped.flatMap(([, list]) => list) : processed;\n }\n\n /**\n * Active option index: the highlighted option while it is listed and\n * enabled, else the autoHighlight fallback; none while loading (the\n * options are hidden).\n */\n private activeIndex(navigable: AutoCompleteOption[]): number {\n return resolveActiveOptionIndex(\n this.loading ? [] : navigable,\n this.focusedValue,\n this.autoHighlight && this.shown,\n );\n }\n\n /** Asks to open / close; listeners can cancel `minerva-open-change`. */\n private requestOpen(open: boolean): boolean {\n if (open === this.open) return true;\n const allowed = this.emit(\n \"minerva-open-change\",\n { open },\n { cancelable: true },\n );\n if (allowed) this.open = open;\n return allowed;\n }\n\n private openDropdown() {\n if (!this.blocked) this.requestOpen(true);\n }\n\n private close() {\n this.requestOpen(false);\n this.focusedValue = null;\n }\n\n private setText(next: string, commit: boolean) {\n if (next === this.value) return;\n this.value = next;\n this.emit(\"minerva-input\", { value: next });\n if (commit) this.emit(\"minerva-change\", { value: next });\n }\n\n private moveFocus(step: 1 | -1) {\n const navigable = this.loading ? [] : this.navigableOptions;\n const count = navigable.length;\n if (count === 0) return;\n // from \"nothing focused\", ArrowDown starts at the first option and\n // ArrowUp at the last one\n const active = this.activeIndex(navigable);\n let index = active >= 0 ? active : step === 1 ? -1 : count;\n for (let i = 0; i < count; i += 1) {\n index = (index + step + count) % count;\n if (!navigable[index].disabled) {\n this.focusedValue = navigable[index].value;\n return;\n }\n }\n }\n\n private selectOption(option: AutoCompleteOption) {\n if (option.disabled) return;\n if (!this.noFillOnSelect) this.setText(option.label, true);\n this.close();\n this.emit(\"minerva-select\", { value: option.value, option });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (\n this.blocked ||\n this.composing ||\n event.isComposing ||\n event.keyCode === 229\n ) {\n return;\n }\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\": {\n event.preventDefault();\n // open first: the active index depends on the open state\n if (!this.open) this.openDropdown();\n this.moveFocus(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n }\n case \"Enter\": {\n const navigable = this.navigableOptions;\n const option = this.shown\n ? navigable[this.activeIndex(navigable)]\n : undefined;\n const text = this.value.trim();\n if (option) {\n event.preventDefault();\n this.selectOption(option);\n } else if (text) {\n // No active option: submit the typed text (e.g. a search).\n event.preventDefault();\n this.emit(\"minerva-submit\", { value: text });\n this.close();\n }\n break;\n }\n case \"Escape\":\n // Open: the dropdown's dismissable layer closes it (topmost only).\n // Closed: clears the text (APG combobox). The layer's document\n // listener may already have closed it during this very keydown.\n if (!this.shown && !this.floating.isOpen && this.value !== \"\") {\n event.preventDefault();\n this.setText(\"\", true);\n this.focusedValue = null;\n }\n break;\n default:\n break;\n }\n }\n\n private handleInput() {\n this.setText(this.input!.value, false);\n this.focusedValue = null;\n this.openDropdown();\n }\n\n private handleChange() {\n this.value = this.input!.value;\n // `change` is not composed: re-dispatch it from the host\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\n this.emit(\"minerva-change\", { value: this.value });\n }\n\n private handleBlur(event: FocusEvent) {\n const next = event.relatedTarget as Node | null;\n if (\n next &&\n (this.popup?.contains(next) || this.container?.contains(next))\n ) {\n return;\n }\n this.close();\n }\n\n private handleOptionClick(option: AutoCompleteOption) {\n if (option.disabled || this.composing) return;\n this.selectOption(option);\n this.input?.focus();\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has(\"value\") && changed.get(\"value\") !== undefined) {\n this.dirty = this.value !== this.defaultValue || this.dirty;\n }\n // first update: a value set before connecting wins over the default\n // unless the value attribute is present\n if (\n changed.has(\"defaultValue\") &&\n !this.dirty &&\n (this.hasUpdated || this.hasAttribute(\"value\"))\n ) {\n this.value = this.defaultValue;\n }\n // A disabled / read-only field never keeps the dropdown.\n if (this.open && this.blocked) {\n this.open = false;\n this.focusedValue = null;\n }\n }\n\n protected override hookStates() {\n const placement =\n this.shown && this.floating.isOpen\n ? this.floating.position.placement\n : undefined;\n const { side, align } = placement\n ? parsePlacement(placement)\n : { side: undefined, align: undefined };\n return {\n state: this.shown ? \"open\" : \"closed\",\n disabled: this.isDisabled,\n readonly: this.readOnly,\n loading: this.loading,\n side,\n align,\n placement,\n };\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n this.floating.sync(this.shown);\n // Keep the keyboard-focused option scrolled into view\n if (changed.has(\"focusedValue\") && this.focusedValue !== null) {\n const active = this.activeIndex(this.navigableOptions);\n this.shadowRoot\n ?.getElementById(`option-${active}`)\n ?.scrollIntoView?.({ block: \"nearest\" });\n }\n if (DEV && changed.has(\"options\")) {\n const seen = new Set<string | number>();\n for (const option of this.options ?? []) {\n if (seen.has(option.value)) {\n devWarn(\n MinervaAutocomplete.tagName,\n `several options have the value \"${option.value}\"; option values must be unique.`,\n );\n break;\n }\n seen.add(option.value);\n }\n }\n }\n\n private renderOptionContent(option: AutoCompleteOption) {\n if (this.mode === \"custom\" && this.renderOption) {\n return this.renderOption(option);\n }\n return html`<div class=\"basicOption\">\n${option.icon ? html`<span class=\"icon\">${option.icon}</span>` : nothing}\n<div class=\"content\">\n<div class=\"label\">${option.label}</div>\n${\n option.description\n ? html`<div class=\"description\">${option.description}</div>`\n : nothing\n }\n</div>\n</div>`;\n }\n\n private renderOptionItem(\n option: AutoCompleteOption,\n index: number,\n activeIndex: number,\n ) {\n const active = activeIndex === index;\n const highlighted = this.hoveredIndex === index || active;\n const disabled = !!option.disabled;\n return html`<div\npart=${itemParts(\"item\", { highlighted, disabled })}\nclass=${classMap({\n optionItem: true,\n disabled,\n highlight: !!option.highlight,\n active: highlighted,\n })}\nstyle=${option.style ? styleMap(option.style) : nothing}\nrole=\"option\"\ntabindex=\"-1\"\nid=${`option-${index}`}\naria-selected=${String(active)}\naria-disabled=${option.disabled ? \"true\" : nothing}\n@mousedown=${(event: MouseEvent) => event.preventDefault()}\n@click=${() => this.handleOptionClick(option)}\n@keydown=${(event: KeyboardEvent) => {\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n event.stopPropagation();\n this.handleOptionClick(option);\n }}\n@mouseenter=${() => (this.hoveredIndex = index)}\n@mouseleave=${() => (this.hoveredIndex = -1)}\n>\n${this.renderOptionContent(option)}\n</div>`;\n }\n\n private renderList() {\n const { t } = this.locale;\n if (this.loading) {\n return html`<div role=\"presentation\" class=\"loading\" part=\"loading\">\n<span role=\"progressbar\" aria-label=${t(\"common.loading\")}\n>${IconSpinner}</span\n>\n</div>`;\n }\n const processed = this.processedOptions;\n if (processed.length === 0) {\n return html`<div role=\"presentation\" class=\"empty\" part=\"empty\">\n${\n this.renderEmpty?.() ||\n html`${IconInbox}<span>${t(\"empty.description\")}</span>`\n }\n</div>`;\n }\n const grouped = this.groupOptions(processed);\n const navigable = grouped ? grouped.flatMap(([, list]) => list) : processed;\n const activeIndex = this.activeIndex(navigable);\n if (!grouped) {\n return processed.map((option, index) =>\n this.renderOptionItem(option, index, activeIndex),\n );\n }\n return grouped.map(([group, list]) => {\n const items = list.map((option) =>\n this.renderOptionItem(option, navigable.indexOf(option), activeIndex),\n );\n return group === \"\"\n ? items\n : html`<div class=\"optionGroup\" role=\"group\" aria-label=${group}>\n<div class=\"groupLabel\" part=\"group-label\" aria-hidden=\"true\">\n${group}\n</div>\n${items}\n</div>`;\n });\n }\n\n protected override render() {\n const shown = this.shown;\n const disabled = this.isDisabled;\n const navigable = shown ? this.navigableOptions : [];\n const activeIndex = shown ? this.activeIndex(navigable) : -1;\n const activeId =\n shown && activeIndex >= 0 && activeIndex < navigable.length\n ? `option-${activeIndex}`\n : undefined;\n const label = this.label ? undefined : this.aria.label;\n // data-minerva-escape-consumer (core's ESCAPE_CONSUMER_ATTRIBUTE): on a\n // closed list with text, Escape clears it instead of closing an\n // enclosing modal / drawer / popover.\n return html`<div\npart=\"root\"\nclass=\"autoComplete\"\n@compositionstart=${() => (this.composing = true)}\n@compositionend=${() => (this.composing = false)}\n>\n${\n this.label\n ? html`<label for=\"input\" class=\"label\" part=\"label\"\n>${this.label}</label\n>`\n : nothing\n }\n<div\npart=\"field\"\nclass=${classMap({\n root: true,\n [this.variant]: true,\n [this.size]: true,\n invalid: this.invalid,\n disabled,\n })}\ndata-component=\"input\"\n>\n${\n this.slots.test(\"prefix\")\n ? html`<span class=\"addon start\"><slot name=\"prefix\"></slot></span>`\n : nothing\n }\n<input\nid=\"input\"\npart=\"input\"\nclass=\"field\"\ntype=\"text\"\nrole=\"combobox\"\naria-autocomplete=\"list\"\naria-expanded=${String(shown)}\naria-controls=${shown ? \"listbox\" : nothing}\naria-activedescendant=${activeId ?? nothing}\naria-label=${label ?? nothing}\naria-description=${this.aria.description ?? nothing}\naria-required=${this.required ? \"true\" : nothing}\naria-invalid=${\n this.invalid || this.aria.attr(\"aria-invalid\") === \"true\"\n ? \"true\"\n : nothing\n }\ndata-minerva-escape-consumer=${\n !shown && this.value !== \"\" ? \"\" : nothing\n }\nautocomplete=\"off\"\n.value=${live(this.value)}\nplaceholder=${this.placeholder || nothing}\n?disabled=${disabled}\n?readonly=${this.readOnly}\n@input=${this.handleInput}\n@change=${this.handleChange}\n@focus=${() => this.openDropdown()}\n@click=${() => {\n if (!this.open) this.openDropdown();\n }}\n@blur=${this.handleBlur}\n@keydown=${this.handleKeyDown}\n/>\n${\n this.slots.test(\"suffix\")\n ? html`<span class=\"addon end\"><slot name=\"suffix\"></slot></span>`\n : nothing\n }\n</div>\n${\n shown\n ? html`<div class=\"popup\" part=\"content\" popover=\"manual\">\n<div\nclass=${classMap({\n dropdown: true,\n animated: !this.noAnimation,\n })}\n>\n<div\nclass=\"optionList\"\npart=\"list\"\nrole=\"listbox\"\nid=\"listbox\"\naria-label=${this.label || label || nothing}\naria-busy=${this.loading ? \"true\" : nothing}\n>\n${this.renderList()}\n</div>\n</div>\n</div>`\n : nothing\n }\n</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-autocomplete\": MinervaAutocomplete;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6DA,IAAMM,IAAY;CAChB,KAAK;CACL,QAAQ;CACR,MAAM;CACN,OAAO;AACT,GAuCaC,IAAb,MAAaA,UAA4BC,EAAsB;;EAsL7C,aAzIR,KAAA,QAAA,IAIO,KAAA,eAAA,IAIiB,KAAA,UAAA,CAAC,GAI1B,KAAA,OAAA,IAIC,KAAA,QAAA,IAIM,KAAA,cAAA,IAIW,KAAA,OAAA,SAIA,KAAA,OAAA,UAIM,KAAA,UAAA,WAIrB,KAAA,UAAA,IAIC,KAAA,WAAA,IAID,KAAA,UAAA,IAIyB,KAAA,YAAA,UAOA,KAAA,SAAA;GAAE,GAAG;GAAG,GAAG;EAAE,GAIlC,KAAA,cAAA,IAIE,KAAA,gBAAA,IAIC,KAAA,iBAAA,IAIkB,KAAA,YAAA,SAwBY,KAAA,eAAA,MAGxB,KAAA,eAAA,IAWG,KAAA,SAAA,IAAIE,EAA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,EAAS,EAAE,WAAW,aAAa,CAAC,CAAA,GAAA1D,EAAA,WAAA,aAAA,KAAA,CAAA,GAIpCL,EAAA,CAAA+D,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA1D,EAAA,WAAA,gBAAA,KAAA,CAAA,GAI7BL,EAAA,CAAA+D,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA1D,EAAA,WAAA,cAAA,KAAA,CAAA,GAI7BL,EAAA,CAAA+D,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA1D,EAAA,WAAA,WAAA,KAAA,CAAA,GAI7BL,EAAA,CAAA+D,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA1D,EAAA,WAAA,gBAAA,KAAA,CAAA,GAI7BL,EAAA,CAAA+D,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA1D,EAAA,WAAA,eAAA,KAAA,CAAA,GAI7BL,EAAA,CAAAmB,EAAM,CAAA,GAAAd,EAAA,WAAA,gBAAA,KAAA,CAAA,GAGNL,EAAA,CAAAmB,EAAM,CAAA,GAAAd,EAAA,WAAA,gBAAA,KAAA,CAAA,GAGNL,EAAA,CAAAgE,EAAM,OAAO,CAAA,GAAA3D,EAAA,WAAA,SAAA,KAAA,CAAA,GAGbL,EAAA,CAAAgE,EAAM,eAAe,CAAA,GAAA3D,EAAA,WAAA,aAAA,KAAA,CAAA,GAGrBL,EAAA,CAAAgE,EAAM,QAAQ,CAAA,GAAA3D,EAAA,WAAA,SAAA,KAAA,CAAA"}
|
|
@@ -175,14 +175,20 @@ width: 100%;
|
|
|
175
175
|
e.preventDefault(), this.focusedKey = D(i), this.month = k(i), this.pendingFocus = !0;
|
|
176
176
|
}
|
|
177
177
|
renderPanel(e) {
|
|
178
|
-
let t = this.i18n.t, i = k(this.month), a = E(i, -((i.getDay() + 6) % 7)), o = Array.from({ length: 42 }, (e, t) => E(a, t)), s = o.map(D)
|
|
178
|
+
let t = this.i18n.t, i = k(this.month), a = E(i, -((i.getDay() + 6) % 7)), o = Array.from({ length: 42 }, (e, t) => E(a, t)), s = o.map(D), c = [
|
|
179
|
+
this.focusedKey,
|
|
180
|
+
this.valueAsDate ? D(this.valueAsDate) : "",
|
|
181
|
+
D(/* @__PURE__ */ new Date()),
|
|
182
|
+
D(i),
|
|
183
|
+
...s
|
|
184
|
+
].find((e) => e && s.includes(e) && this.allowed(e)) ?? "", l;
|
|
179
185
|
try {
|
|
180
|
-
|
|
186
|
+
l = new Intl.DateTimeFormat(this.locale ?? this.i18n.language, {
|
|
181
187
|
month: "long",
|
|
182
188
|
year: "numeric"
|
|
183
189
|
}).format(i);
|
|
184
190
|
} catch {
|
|
185
|
-
|
|
191
|
+
l = D(i).slice(0, 7);
|
|
186
192
|
}
|
|
187
193
|
return g`<div
|
|
188
194
|
part="content"
|
|
@@ -195,7 +201,7 @@ aria-label=${e}
|
|
|
195
201
|
>
|
|
196
202
|
<div class="panel">
|
|
197
203
|
<div class="header">
|
|
198
|
-
<h2 id="heading" class="heading" aria-live="polite">${
|
|
204
|
+
<h2 id="heading" class="heading" aria-live="polite">${l}</h2>
|
|
199
205
|
<div class="navGroup">
|
|
200
206
|
<button
|
|
201
207
|
type="button"
|
|
@@ -236,7 +242,7 @@ aria-label=${t}
|
|
|
236
242
|
aria-selected=${String(t === this.value)}
|
|
237
243
|
aria-disabled=${this.allowed(t) ? _ : "true"}
|
|
238
244
|
aria-current=${t === D(/* @__PURE__ */ new Date()) ? "date" : _}
|
|
239
|
-
tabindex=${t ===
|
|
245
|
+
tabindex=${t === c && this.allowed(t) ? "0" : "-1"}
|
|
240
246
|
@focus=${() => {
|
|
241
247
|
this.focusedKey = t;
|
|
242
248
|
}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","names":["inputStyles","iconButtonStyles","styles","_decorate","__decorate","iconButton_module_default","input_module_default","datePicker_module_default","WEEKDAYS","MinervaDatePicker","FormAssociatedElement","_args","monthStart","LocaleController","AriaController","FloatingLayerController","hostStyles","popoverResetStyles","sharedStyles","parseDayKey","options","value","dayKey","state","changed","open","allowed","text","event","parsed","next","date","key","logicalArrowKey","weekday","target","addDays","localDate","first","start","days","i","active","heading","name","IconChevronLeft","IconChevronRight","d","week","sameMonth","nothing","e","placement","parsePlacement","panel","input","focused","tabbables","getTabbables","all","last","contains","el","disabled","readonly","current","t","displayValue","showClear","classMap","live","IconX","IconCalendar","property","query"],"sources":["../../../../../web-components/src/components/date-picker/date-picker.ts"],"sourcesContent":["import { css, html, nothing, type PropertyValues } from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport {\n addDays,\n dayKey,\n localDate,\n monthStart,\n parseDayKey,\n sameMonth,\n} from \"@minerva/core\";\nimport {\n contains,\n getTabbables,\n logicalArrowKey,\n parsePlacement,\n} from \"@minerva/dom\";\nimport inputStyles from \"@react-styles/components/Input/input.module.scss?inline\";\nimport iconButtonStyles from \"@react-styles/components/IconButton/iconButton.module.scss?inline\";\nimport styles from \"@react-styles/components/DatePicker/datePicker.module.scss?inline\";\nimport {\n FloatingLayerController,\n popoverResetStyles,\n} from \"../../controllers/floating-layer\";\nimport { AriaController } from \"../../internal/aria\";\nimport {\n FormAssociatedElement,\n type ValidityResult,\n} from \"../../internal/form\";\nimport {\n IconCalendar,\n IconChevronLeft,\n IconChevronRight,\n IconX,\n} from \"../../internal/icons\";\nimport { LocaleController } from \"../../internal/locale\";\nimport { hostStyles } from \"../../internal/minerva-element\";\nimport { sharedStyles } from \"../../internal/styles\";\n\nconst WEEKDAYS = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"] as const;\n\n/**\n * Type a calendar date or choose it from an accessible popup month grid.\n * Form-associated: submits YYYY-MM-DD, supports required, reset and disabled fieldsets.\n * @summary Date field with a keyboard-accessible popup calendar and inclusive date bounds.\n * @tag minerva-date-picker\n * @csspart root - Field wrapper\n * @csspart control - Input box\n * @csspart input - Native text input\n * @csspart clear-button - Clear action\n * @csspart icon - Calendar icon\n * @csspart content - Popup dialog\n * @csspart day - Calendar day cell\n * @fires minerva-change - Committed date, detail: { value }; empty string when cleared\n * @fires minerva-input - Draft input text, detail: { value }\n * @fires minerva-open-change - Cancelable popup change, detail: { open }\n * @fires minerva-clear - Cleared date\n * @fires change - Native-like bubbling change after a committed date\n */\nexport class MinervaDatePicker extends FormAssociatedElement {\n static override tagName = \"minerva-date-picker\";\n static override shadowRootOptions = {\n ...FormAssociatedElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static override styles = [\n hostStyles,\n popoverResetStyles,\n css`\n:host{\ndisplay: inline-block;\nvertical-align: middle;\n}\n.datePicker .root{\nwidth: 100%;\n}\n`,\n sharedStyles(inputStyles),\n sharedStyles(iconButtonStyles),\n sharedStyles(styles),\n ];\n /** Name submitted with form data. */\n @property({ reflect: true }) override name = \"date-picker\";\n /** Current date (YYYY-MM-DD), or empty; property assignment controls the current value. */\n @property({ attribute: false }) value = \"\";\n /** Initial date, restored by form reset. */\n @property({ attribute: \"value\" }) defaultValue = \"\";\n /** Whether the calendar is open. */\n @property({ type: Boolean, reflect: true }) open = false;\n /** Accessible field and popup label. */\n @property() label?: string;\n /** Input placeholder; localized by default. */\n @property() placeholder?: string;\n /** Calendar heading locale. */\n @property() locale?: string;\n /** Input control size. */\n @property({ reflect: true }) size: \"small\" | \"medium\" | \"large\" = \"medium\";\n /** Error state. */\n @property({ type: Boolean, reflect: true }) invalid = false;\n /** Prevents typing, selection and clearing. */\n @property({ type: Boolean, reflect: true, attribute: \"readonly\" }) readOnly =\n false;\n /** Hides the clear action. */\n @property({ type: Boolean, attribute: \"hide-clear-button\" }) hideClearButton =\n false;\n /** Earliest selectable date, inclusive (YYYY-MM-DD). */\n @property({ attribute: \"min-date\" }) minDate?: string;\n /** Latest selectable date, inclusive (YYYY-MM-DD). */\n @property({ attribute: \"max-date\" }) maxDate?: string;\n @state() private draft: string | null = null;\n @state() private month = monthStart(new Date());\n @state() private focusedKey = \"\";\n @query(\"input\") private input?: HTMLInputElement;\n @query(\".datePicker\") private field?: HTMLElement;\n @query(\".popup\") private popup?: HTMLElement;\n private dirty = false;\n private pendingFocus = false;\n private readonly i18n = new LocaleController(this);\n private readonly aria = new AriaController(this, () => this.labels);\n private readonly floating = new FloatingLayerController(this, () => ({\n anchor: () => this.input,\n floating: () => this.popup,\n placement: \"bottom-start\",\n branches: () => [this.field],\n onDismiss: () => this.requestOpenChange(false),\n returnFocusOnEscape: () => this.input,\n focusable: true,\n }));\n /** Current date as a local Date, null when empty or invalid. */\n get valueAsDate() {\n return parseDayKey(this.value || \"\", true);\n }\n override focus(options?: FocusOptions) {\n this.input?.focus(options);\n }\n override blur() {\n this.input?.blur();\n }\n private get interactive() {\n return !this.isDisabled && !this.readOnly;\n }\n private allowed(value: string) {\n return (\n !!parseDayKey(value, true) &&\n (!this.minDate || value >= this.minDate) &&\n (!this.maxDate || value <= this.maxDate)\n );\n }\n protected getFormValue() {\n return this.valueAsDate ? dayKey(this.valueAsDate) : \"\";\n }\n protected override getValidity(): ValidityResult {\n if (this.required && !this.valueAsDate)\n return {\n flags: { valueMissing: true },\n message: this.i18n.t(\"validation.valueMissing\"),\n anchor: this.input,\n };\n if (this.valueAsDate && !this.allowed(this.value))\n return {\n flags: { customError: true },\n message: [this.minDate, this.maxDate].filter(Boolean).join(\" – \"),\n anchor: this.input,\n };\n return { flags: {}, message: \"\" };\n }\n protected resetFormValue() {\n this.dirty = false;\n this.draft = null;\n this.value = this.defaultValue;\n this.open = false;\n }\n protected override restoreFormState(state: unknown) {\n if (typeof state === \"string\") this.value = state;\n }\n protected override willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"value\") && changed.get(\"value\") !== undefined)\n this.dirty = this.value !== this.defaultValue || this.dirty;\n if (\n changed.has(\"defaultValue\") &&\n !this.dirty &&\n (this.hasUpdated || this.hasAttribute(\"value\"))\n )\n this.value = this.defaultValue;\n if (changed.has(\"open\") && this.open) {\n this.month = monthStart(this.valueAsDate ?? new Date());\n this.focusedKey = dayKey(this.valueAsDate ?? new Date());\n }\n }\n protected override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n this.floating.sync(this.open && this.interactive);\n if (this.open && this.pendingFocus) {\n this.popup\n ?.querySelector<HTMLElement>(`[data-date=\"${this.focusedKey}\"]`)\n ?.focus();\n this.pendingFocus = false;\n }\n }\n private requestOpenChange(open: boolean) {\n if (open && !this.interactive) return false;\n if (open === this.open) return true;\n const allowed = this.emit(\n \"minerva-open-change\",\n { open },\n { cancelable: true },\n );\n if (allowed) this.open = open;\n return allowed;\n }\n private commit(value: string) {\n if (!this.interactive || (value && !this.allowed(value))) return;\n this.dirty = true;\n this.value = value;\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\n this.emit(\"minerva-change\", { value });\n }\n private handleInput(event: Event) {\n if (!this.interactive) return;\n const text = (event.target as HTMLInputElement).value;\n this.draft = text;\n this.emit(\"minerva-input\", { value: text });\n if (!text || this.allowed(text)) {\n this.commit(text);\n if (text) this.month = monthStart(parseDayKey(text)!);\n }\n }\n private handleBlur() {\n if (this.draft === null) return;\n const parsed = parseDayKey(this.draft.trim(), false);\n const next = parsed ? dayKey(parsed) : \"\";\n if (!this.draft.trim()) {\n if (this.value) this.commit(\"\");\n } else if (parsed && this.allowed(next) && next !== this.value) {\n this.commit(next);\n this.month = monthStart(parsed);\n }\n this.draft = null;\n }\n private handleClear() {\n if (!this.interactive) return;\n this.draft = null;\n this.commit(\"\");\n this.emit(\"minerva-clear\");\n this.input?.focus();\n }\n private handleInputClick() {\n this.requestOpenChange(!this.open);\n }\n private handleInputKeyDown(event: KeyboardEvent) {\n if (event.key !== \"ArrowDown\" || !this.interactive) return;\n event.preventDefault();\n this.pendingFocus = true;\n if (this.open) {\n this.requestUpdate();\n } else if (!this.requestOpenChange(true)) this.pendingFocus = false;\n }\n private select(date: Date) {\n if (!this.interactive || !this.allowed(dayKey(date))) return;\n this.draft = null;\n this.commit(dayKey(date));\n this.requestOpenChange(false);\n this.input?.focus();\n }\n private handleDayKeyDown(event: KeyboardEvent, date: Date) {\n if (!this.interactive) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (!event.repeat) this.select(date);\n return;\n }\n const key = logicalArrowKey(event.key, this);\n const weekday = (date.getDay() + 6) % 7;\n let target: Date;\n switch (key) {\n case \"ArrowLeft\":\n target = addDays(date, -1);\n break;\n case \"ArrowRight\":\n target = addDays(date, 1);\n break;\n case \"ArrowUp\":\n target = addDays(date, -7);\n break;\n case \"ArrowDown\":\n target = addDays(date, 7);\n break;\n case \"Home\":\n target = addDays(date, -weekday);\n break;\n case \"End\":\n target = addDays(date, 6 - weekday);\n break;\n case \"PageUp\":\n case \"PageDown\": {\n const next = monthStart(\n date,\n (key === \"PageUp\" ? -1 : 1) * (event.shiftKey ? 12 : 1),\n );\n target = localDate(\n next.getFullYear(),\n next.getMonth(),\n Math.min(date.getDate(), addDays(monthStart(next, 1), -1).getDate()),\n );\n break;\n }\n default:\n return;\n }\n event.preventDefault();\n this.focusedKey = dayKey(target);\n this.month = monthStart(target);\n this.pendingFocus = true;\n }\n private renderPanel(name: string) {\n const t = this.i18n.t;\n const first = monthStart(this.month);\n const start = addDays(first, -((first.getDay() + 6) % 7));\n const days = Array.from({ length: 42 }, (_, i) => addDays(start, i));\n const keys = days.map(dayKey);\n const active = keys.includes(this.focusedKey)\n ? this.focusedKey\n : dayKey(first);\n let heading: string;\n try {\n heading = new Intl.DateTimeFormat(this.locale ?? this.i18n.language, {\n month: \"long\",\n year: \"numeric\",\n }).format(first);\n } catch {\n heading = dayKey(first).slice(0, 7);\n }\n return html`<div\npart=\"content\"\nclass=\"popup\"\npopover=\"manual\"\nrole=\"dialog\"\ntabindex=\"-1\"\naria-label=${name}\n@keydown=${this.handlePanelKeyDown}\n>\n<div class=\"panel\">\n<div class=\"header\">\n<h2 id=\"heading\" class=\"heading\" aria-live=\"polite\">${heading}</h2>\n<div class=\"navGroup\">\n<button\ntype=\"button\"\nclass=\"navButton\"\naria-label=${t(\"monthCalendar.previousMonth\")}\n@click=${() => {\n this.month = monthStart(first, -1);\n }}\n>\n${IconChevronLeft}\n</button>\n<button\ntype=\"button\"\nclass=\"navButton\"\naria-label=${t(\"monthCalendar.nextMonth\")}\n@click=${() => {\n this.month = monthStart(first, 1);\n }}\n>\n${IconChevronRight}\n</button>\n</div>\n</div>\n<div class=\"grid\" role=\"grid\" aria-labelledby=\"heading\">\n<div class=\"week\" role=\"row\">\n${WEEKDAYS.map((d) => html`<div class=\"weekday\" role=\"columnheader\">${t(`monthCalendar.weekdays.${d}`)}</div>`)}\n</div>\n${Array.from(\n { length: 6 },\n (_, week) =>\n html`<div class=\"week\" role=\"row\">\n${days.slice(week * 7, week * 7 + 7).map((date) => {\n const key = dayKey(date);\n return html`<div\npart=\"day\"\nclass=\"day\"\nrole=\"gridcell\"\ndata-date=${key}\n?data-outside=${!sameMonth(date, first)}\naria-label=${key}\naria-selected=${String(key === this.value)}\naria-disabled=${this.allowed(key) ? nothing : \"true\"}\naria-current=${key === dayKey(new Date()) ? \"date\" : nothing}\ntabindex=${key === active && this.allowed(key) ? \"0\" : \"-1\"}\n@focus=${() => {\n this.focusedKey = key;\n }}\n@click=${() => this.select(date)}\n@keydown=${(e: KeyboardEvent) => this.handleDayKeyDown(e, date)}\n>\n${date.getDate()}\n</div>`;\n })}\n</div>`,\n )}\n</div>\n<div class=\"footer\">\n${\n !this.hideClearButton && this.value\n ? html`<button\nclass=\"footerButton\"\ntype=\"button\"\n@click=${() => {\n this.handleClear();\n this.requestOpenChange(false);\n }}\n>\n${t(\"datePicker.clear\")}\n</button>`\n : nothing\n }\n<button\nclass=\"footerButton\"\ntype=\"button\"\n?disabled=${!this.allowed(dayKey(new Date()))}\n@click=${() => this.select(new Date())}\n>\n${t(\"monthCalendar.today\")}</button\n><button\nclass=\"footerButton\"\ntype=\"button\"\n@click=${() => {\n this.requestOpenChange(false);\n this.input?.focus();\n }}\n>\n${t(\"modal.close\")}\n</button>\n</div>\n</div>\n</div>`;\n }\n protected override hookStates() {\n const placement =\n this.open && this.floating.isOpen\n ? this.floating.position.placement\n : undefined;\n const { side, align } = placement\n ? parsePlacement(placement)\n : { side: undefined, align: undefined };\n return {\n placement,\n side,\n align,\n state: this.open && this.interactive ? \"open\" : \"closed\",\n disabled: this.isDisabled,\n readonly: this.readOnly,\n invalid: this.invalid,\n size: this.size,\n };\n }\n private handlePanelKeyDown(event: KeyboardEvent) {\n const panel = event.currentTarget as HTMLElement;\n const input = this.input;\n if (\n !input ||\n event.key !== \"Tab\" ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey\n )\n return;\n const focused = this.shadowRoot?.activeElement ?? null;\n if (!focused || !panel.contains(focused)) return;\n const tabbables = getTabbables(panel);\n const leaves =\n tabbables.length === 0 ||\n (event.shiftKey\n ? focused === panel || focused === tabbables[0]\n : focused === tabbables[tabbables.length - 1]);\n if (!leaves) return;\n event.preventDefault();\n const next = event.shiftKey\n ? input\n : (this.shadowRoot?.querySelector<HTMLElement>(\".clearButton\") ??\n this.tabbableAfter() ??\n input);\n next.focus();\n this.requestOpenChange(false);\n }\n\n /** The first tabbable element of the page after this element. */\n private tabbableAfter(): HTMLElement | null {\n const all = getTabbables(this.ownerDocument.body);\n let last = -1;\n all.forEach((el, i) => {\n if (contains(this, el)) last = i;\n });\n if (last === -1) {\n return (\n all.find(\n (el) =>\n !!(\n this.compareDocumentPosition(el) &\n Node.DOCUMENT_POSITION_FOLLOWING\n ),\n ) ?? null\n );\n }\n return all.slice(last + 1).find((el) => !contains(this, el)) ?? null;\n }\n\n protected override render() {\n const { t } = this.i18n;\n const disabled = this.isDisabled;\n const readonly = this.readOnly;\n const current = this.valueAsDate;\n const name = this.label || this.aria.label || t(\"datePicker.label\");\n const displayValue = this.draft ?? (current ? dayKey(current) : \"\");\n const showClear =\n !this.hideClearButton && !!current && !disabled && !readonly;\n\n return html`<div part=\"root\" class=\"datePicker\">\n<div\npart=\"control\"\nclass=${classMap({\n root: true,\n outline: true,\n [this.size]: true,\n invalid: this.invalid,\n disabled,\n })}\ndata-component=\"input\"\n>\n<input\npart=\"input\"\nclass=\"field\"\n.value=${live(displayValue)}\nplaceholder=${this.placeholder ?? t(\"datePicker.placeholder\")}\n?disabled=${disabled}\n?readonly=${readonly}\n?required=${this.required}\nautocomplete=\"off\"\naria-label=${name}\naria-description=${this.aria.description ?? nothing}\naria-invalid=${\n this.invalid || this.aria.attr(\"aria-invalid\") === \"true\"\n ? \"true\"\n : nothing\n }\naria-readonly=${readonly ? \"true\" : nothing}\n@input=${this.handleInput}\n@blur=${this.handleBlur}\n@click=${this.handleInputClick}\n@keydown=${this.handleInputKeyDown}\n/>\n<span class=\"addon end\">\n${\n showClear\n ? html`<button\npart=\"clear-button\"\ntype=\"button\"\nclass=\"iconButton neutral variant-ghost small circle clearButton\"\naria-label=${t(\"datePicker.clear\")}\n@click=${this.handleClear}\n>\n${IconX}\n</button>`\n : html`<span part=\"icon\" class=\"calendarIcon\" aria-hidden=\"true\"\n>${IconCalendar}</span\n>`\n }\n</span>\n</div>\n</div>\n${this.open && !disabled && !readonly ? this.renderPanel(name) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-date-picker\": MinervaDatePicker;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwCA,IAAMQ,IAAW;CAAC;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK,GAoBpDC,IAAb,cAAuCC,EAAsB;;EA4D/B,aArCiB,KAAA,OAAA,eAEL,KAAA,QAAA,IAES,KAAA,eAAA,IAEE,KAAA,OAAA,IAQe,KAAA,OAAA,UAEZ,KAAA,UAAA,IAGpD,KAAA,WAAA,IAGA,KAAA,kBAAA,IAKsC,KAAA,QAAA,MACf,KAAA,QAAAE,kBAAW,IAAI,KAAK,CAAC,GAChB,KAAA,aAAA,IAId,KAAA,QAAA,IACO,KAAA,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AAA,GAAAhE,EAAA,WAAA,YAAA,KAAA,CAAA,GAGhEN,EAAA,CAAAsE,EAAS;CAAE,MAAM;CAAS,WAAW;AAAoB,CAAC,CAAA,GAAAhE,EAAA,WAAA,mBAAA,KAAA,CAAA,GAG1DN,EAAA,CAAAsE,EAAS,EAAE,WAAW,WAAW,CAAC,CAAA,GAAAhE,EAAA,WAAA,WAAA,KAAA,CAAA,GAElCN,EAAA,CAAAsE,EAAS,EAAE,WAAW,WAAW,CAAC,CAAA,GAAAhE,EAAA,WAAA,WAAA,KAAA,CAAA,GAClCN,EAAA,CAAAoB,EAAM,CAAA,GAAAd,EAAA,WAAA,SAAA,KAAA,CAAA,GACNN,EAAA,CAAAoB,EAAM,CAAA,GAAAd,EAAA,WAAA,SAAA,KAAA,CAAA,GACNN,EAAA,CAAAoB,EAAM,CAAA,GAAAd,EAAA,WAAA,cAAA,KAAA,CAAA,GACNN,EAAA,CAAAuE,EAAM,OAAO,CAAA,GAAAjE,EAAA,WAAA,SAAA,KAAA,CAAA,GACbN,EAAA,CAAAuE,EAAM,aAAa,CAAA,GAAAjE,EAAA,WAAA,SAAA,KAAA,CAAA,GACnBN,EAAA,CAAAuE,EAAM,QAAQ,CAAA,GAAAjE,EAAA,WAAA,SAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"date-picker.js","names":["inputStyles","iconButtonStyles","styles","_decorate","__decorate","iconButton_module_default","input_module_default","datePicker_module_default","WEEKDAYS","MinervaDatePicker","FormAssociatedElement","_args","monthStart","LocaleController","AriaController","FloatingLayerController","hostStyles","popoverResetStyles","sharedStyles","parseDayKey","options","value","dayKey","state","changed","open","allowed","text","event","parsed","next","date","key","logicalArrowKey","weekday","target","addDays","localDate","first","start","days","i","keys","active","heading","name","IconChevronLeft","IconChevronRight","d","week","sameMonth","nothing","e","placement","parsePlacement","panel","input","focused","tabbables","getTabbables","all","last","contains","el","disabled","readonly","current","t","displayValue","showClear","classMap","live","IconX","IconCalendar","property","query"],"sources":["../../../../../web-components/src/components/date-picker/date-picker.ts"],"sourcesContent":["import { css, html, nothing, type PropertyValues } from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport {\n addDays,\n dayKey,\n localDate,\n monthStart,\n parseDayKey,\n sameMonth,\n} from \"@minerva/core\";\nimport {\n contains,\n getTabbables,\n logicalArrowKey,\n parsePlacement,\n} from \"@minerva/dom\";\nimport inputStyles from \"@react-styles/components/Input/input.module.scss?inline\";\nimport iconButtonStyles from \"@react-styles/components/IconButton/iconButton.module.scss?inline\";\nimport styles from \"@react-styles/components/DatePicker/datePicker.module.scss?inline\";\nimport {\n FloatingLayerController,\n popoverResetStyles,\n} from \"../../controllers/floating-layer\";\nimport { AriaController } from \"../../internal/aria\";\nimport {\n FormAssociatedElement,\n type ValidityResult,\n} from \"../../internal/form\";\nimport {\n IconCalendar,\n IconChevronLeft,\n IconChevronRight,\n IconX,\n} from \"../../internal/icons\";\nimport { LocaleController } from \"../../internal/locale\";\nimport { hostStyles } from \"../../internal/minerva-element\";\nimport { sharedStyles } from \"../../internal/styles\";\n\nconst WEEKDAYS = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"] as const;\n\n/**\n * Type a calendar date or choose it from an accessible popup month grid.\n * Form-associated: submits YYYY-MM-DD, supports required, reset and disabled fieldsets.\n * @summary Date field with a keyboard-accessible popup calendar and inclusive date bounds.\n * @tag minerva-date-picker\n * @csspart root - Field wrapper\n * @csspart control - Input box\n * @csspart input - Native text input\n * @csspart clear-button - Clear action\n * @csspart icon - Calendar icon\n * @csspart content - Popup dialog\n * @csspart day - Calendar day cell\n * @fires minerva-change - Committed date, detail: { value }; empty string when cleared\n * @fires minerva-input - Draft input text, detail: { value }\n * @fires minerva-open-change - Cancelable popup change, detail: { open }\n * @fires minerva-clear - Cleared date\n * @fires change - Native-like bubbling change after a committed date\n */\nexport class MinervaDatePicker extends FormAssociatedElement {\n static override tagName = \"minerva-date-picker\";\n static override shadowRootOptions = {\n ...FormAssociatedElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static override styles = [\n hostStyles,\n popoverResetStyles,\n css`\n:host{\ndisplay: inline-block;\nvertical-align: middle;\n}\n.datePicker .root{\nwidth: 100%;\n}\n`,\n sharedStyles(inputStyles),\n sharedStyles(iconButtonStyles),\n sharedStyles(styles),\n ];\n /** Name submitted with form data. */\n @property({ reflect: true }) override name = \"date-picker\";\n /** Current date (YYYY-MM-DD), or empty; property assignment controls the current value. */\n @property({ attribute: false }) value = \"\";\n /** Initial date, restored by form reset. */\n @property({ attribute: \"value\" }) defaultValue = \"\";\n /** Whether the calendar is open. */\n @property({ type: Boolean, reflect: true }) open = false;\n /** Accessible field and popup label. */\n @property() label?: string;\n /** Input placeholder; localized by default. */\n @property() placeholder?: string;\n /** Calendar heading locale. */\n @property() locale?: string;\n /** Input control size. */\n @property({ reflect: true }) size: \"small\" | \"medium\" | \"large\" = \"medium\";\n /** Error state. */\n @property({ type: Boolean, reflect: true }) invalid = false;\n /** Prevents typing, selection and clearing. */\n @property({ type: Boolean, reflect: true, attribute: \"readonly\" }) readOnly =\n false;\n /** Hides the clear action. */\n @property({ type: Boolean, attribute: \"hide-clear-button\" }) hideClearButton =\n false;\n /** Earliest selectable date, inclusive (YYYY-MM-DD). */\n @property({ attribute: \"min-date\" }) minDate?: string;\n /** Latest selectable date, inclusive (YYYY-MM-DD). */\n @property({ attribute: \"max-date\" }) maxDate?: string;\n @state() private draft: string | null = null;\n @state() private month = monthStart(new Date());\n @state() private focusedKey = \"\";\n @query(\"input\") private input?: HTMLInputElement;\n @query(\".datePicker\") private field?: HTMLElement;\n @query(\".popup\") private popup?: HTMLElement;\n private dirty = false;\n private pendingFocus = false;\n private readonly i18n = new LocaleController(this);\n private readonly aria = new AriaController(this, () => this.labels);\n private readonly floating = new FloatingLayerController(this, () => ({\n anchor: () => this.input,\n floating: () => this.popup,\n placement: \"bottom-start\",\n branches: () => [this.field],\n onDismiss: () => this.requestOpenChange(false),\n returnFocusOnEscape: () => this.input,\n focusable: true,\n }));\n /** Current date as a local Date, null when empty or invalid. */\n get valueAsDate() {\n return parseDayKey(this.value || \"\", true);\n }\n override focus(options?: FocusOptions) {\n this.input?.focus(options);\n }\n override blur() {\n this.input?.blur();\n }\n private get interactive() {\n return !this.isDisabled && !this.readOnly;\n }\n private allowed(value: string) {\n return (\n !!parseDayKey(value, true) &&\n (!this.minDate || value >= this.minDate) &&\n (!this.maxDate || value <= this.maxDate)\n );\n }\n protected getFormValue() {\n return this.valueAsDate ? dayKey(this.valueAsDate) : \"\";\n }\n protected override getValidity(): ValidityResult {\n if (this.required && !this.valueAsDate)\n return {\n flags: { valueMissing: true },\n message: this.i18n.t(\"validation.valueMissing\"),\n anchor: this.input,\n };\n if (this.valueAsDate && !this.allowed(this.value))\n return {\n flags: { customError: true },\n message: [this.minDate, this.maxDate].filter(Boolean).join(\" – \"),\n anchor: this.input,\n };\n return { flags: {}, message: \"\" };\n }\n protected resetFormValue() {\n this.dirty = false;\n this.draft = null;\n this.value = this.defaultValue;\n this.open = false;\n }\n protected override restoreFormState(state: unknown) {\n if (typeof state === \"string\") this.value = state;\n }\n protected override willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"value\") && changed.get(\"value\") !== undefined)\n this.dirty = this.value !== this.defaultValue || this.dirty;\n if (\n changed.has(\"defaultValue\") &&\n !this.dirty &&\n (this.hasUpdated || this.hasAttribute(\"value\"))\n )\n this.value = this.defaultValue;\n if (changed.has(\"open\") && this.open) {\n this.month = monthStart(this.valueAsDate ?? new Date());\n this.focusedKey = dayKey(this.valueAsDate ?? new Date());\n }\n }\n protected override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n this.floating.sync(this.open && this.interactive);\n if (this.open && this.pendingFocus) {\n this.popup\n ?.querySelector<HTMLElement>(`[data-date=\"${this.focusedKey}\"]`)\n ?.focus();\n this.pendingFocus = false;\n }\n }\n private requestOpenChange(open: boolean) {\n if (open && !this.interactive) return false;\n if (open === this.open) return true;\n const allowed = this.emit(\n \"minerva-open-change\",\n { open },\n { cancelable: true },\n );\n if (allowed) this.open = open;\n return allowed;\n }\n private commit(value: string) {\n if (!this.interactive || (value && !this.allowed(value))) return;\n this.dirty = true;\n this.value = value;\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\n this.emit(\"minerva-change\", { value });\n }\n private handleInput(event: Event) {\n if (!this.interactive) return;\n const text = (event.target as HTMLInputElement).value;\n this.draft = text;\n this.emit(\"minerva-input\", { value: text });\n if (!text || this.allowed(text)) {\n this.commit(text);\n if (text) this.month = monthStart(parseDayKey(text)!);\n }\n }\n private handleBlur() {\n if (this.draft === null) return;\n const parsed = parseDayKey(this.draft.trim(), false);\n const next = parsed ? dayKey(parsed) : \"\";\n if (!this.draft.trim()) {\n if (this.value) this.commit(\"\");\n } else if (parsed && this.allowed(next) && next !== this.value) {\n this.commit(next);\n this.month = monthStart(parsed);\n }\n this.draft = null;\n }\n private handleClear() {\n if (!this.interactive) return;\n this.draft = null;\n this.commit(\"\");\n this.emit(\"minerva-clear\");\n this.input?.focus();\n }\n private handleInputClick() {\n this.requestOpenChange(!this.open);\n }\n private handleInputKeyDown(event: KeyboardEvent) {\n if (event.key !== \"ArrowDown\" || !this.interactive) return;\n event.preventDefault();\n this.pendingFocus = true;\n if (this.open) {\n this.requestUpdate();\n } else if (!this.requestOpenChange(true)) this.pendingFocus = false;\n }\n private select(date: Date) {\n if (!this.interactive || !this.allowed(dayKey(date))) return;\n this.draft = null;\n this.commit(dayKey(date));\n this.requestOpenChange(false);\n this.input?.focus();\n }\n private handleDayKeyDown(event: KeyboardEvent, date: Date) {\n if (!this.interactive) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (!event.repeat) this.select(date);\n return;\n }\n const key = logicalArrowKey(event.key, this);\n const weekday = (date.getDay() + 6) % 7;\n let target: Date;\n switch (key) {\n case \"ArrowLeft\":\n target = addDays(date, -1);\n break;\n case \"ArrowRight\":\n target = addDays(date, 1);\n break;\n case \"ArrowUp\":\n target = addDays(date, -7);\n break;\n case \"ArrowDown\":\n target = addDays(date, 7);\n break;\n case \"Home\":\n target = addDays(date, -weekday);\n break;\n case \"End\":\n target = addDays(date, 6 - weekday);\n break;\n case \"PageUp\":\n case \"PageDown\": {\n const next = monthStart(\n date,\n (key === \"PageUp\" ? -1 : 1) * (event.shiftKey ? 12 : 1),\n );\n target = localDate(\n next.getFullYear(),\n next.getMonth(),\n Math.min(date.getDate(), addDays(monthStart(next, 1), -1).getDate()),\n );\n break;\n }\n default:\n return;\n }\n event.preventDefault();\n this.focusedKey = dayKey(target);\n this.month = monthStart(target);\n this.pendingFocus = true;\n }\n private renderPanel(name: string) {\n const t = this.i18n.t;\n const first = monthStart(this.month);\n const start = addDays(first, -((first.getDay() + 6) % 7));\n const days = Array.from({ length: 42 }, (_, i) => addDays(start, i));\n const keys = days.map(dayKey);\n // Roving Tab stop: never a disabled day while the view has an enabled one\n // (e.g. a month cut by minDate), else the grid has no Tab entry.\n const active =\n [\n this.focusedKey,\n this.valueAsDate ? dayKey(this.valueAsDate) : \"\",\n dayKey(new Date()),\n dayKey(first),\n ...keys,\n ].find((key) => key && keys.includes(key) && this.allowed(key)) ?? \"\";\n let heading: string;\n try {\n heading = new Intl.DateTimeFormat(this.locale ?? this.i18n.language, {\n month: \"long\",\n year: \"numeric\",\n }).format(first);\n } catch {\n heading = dayKey(first).slice(0, 7);\n }\n return html`<div\npart=\"content\"\nclass=\"popup\"\npopover=\"manual\"\nrole=\"dialog\"\ntabindex=\"-1\"\naria-label=${name}\n@keydown=${this.handlePanelKeyDown}\n>\n<div class=\"panel\">\n<div class=\"header\">\n<h2 id=\"heading\" class=\"heading\" aria-live=\"polite\">${heading}</h2>\n<div class=\"navGroup\">\n<button\ntype=\"button\"\nclass=\"navButton\"\naria-label=${t(\"monthCalendar.previousMonth\")}\n@click=${() => {\n this.month = monthStart(first, -1);\n }}\n>\n${IconChevronLeft}\n</button>\n<button\ntype=\"button\"\nclass=\"navButton\"\naria-label=${t(\"monthCalendar.nextMonth\")}\n@click=${() => {\n this.month = monthStart(first, 1);\n }}\n>\n${IconChevronRight}\n</button>\n</div>\n</div>\n<div class=\"grid\" role=\"grid\" aria-labelledby=\"heading\">\n<div class=\"week\" role=\"row\">\n${WEEKDAYS.map((d) => html`<div class=\"weekday\" role=\"columnheader\">${t(`monthCalendar.weekdays.${d}`)}</div>`)}\n</div>\n${Array.from(\n { length: 6 },\n (_, week) =>\n html`<div class=\"week\" role=\"row\">\n${days.slice(week * 7, week * 7 + 7).map((date) => {\n const key = dayKey(date);\n return html`<div\npart=\"day\"\nclass=\"day\"\nrole=\"gridcell\"\ndata-date=${key}\n?data-outside=${!sameMonth(date, first)}\naria-label=${key}\naria-selected=${String(key === this.value)}\naria-disabled=${this.allowed(key) ? nothing : \"true\"}\naria-current=${key === dayKey(new Date()) ? \"date\" : nothing}\ntabindex=${key === active && this.allowed(key) ? \"0\" : \"-1\"}\n@focus=${() => {\n this.focusedKey = key;\n }}\n@click=${() => this.select(date)}\n@keydown=${(e: KeyboardEvent) => this.handleDayKeyDown(e, date)}\n>\n${date.getDate()}\n</div>`;\n })}\n</div>`,\n )}\n</div>\n<div class=\"footer\">\n${\n !this.hideClearButton && this.value\n ? html`<button\nclass=\"footerButton\"\ntype=\"button\"\n@click=${() => {\n this.handleClear();\n this.requestOpenChange(false);\n }}\n>\n${t(\"datePicker.clear\")}\n</button>`\n : nothing\n }\n<button\nclass=\"footerButton\"\ntype=\"button\"\n?disabled=${!this.allowed(dayKey(new Date()))}\n@click=${() => this.select(new Date())}\n>\n${t(\"monthCalendar.today\")}</button\n><button\nclass=\"footerButton\"\ntype=\"button\"\n@click=${() => {\n this.requestOpenChange(false);\n this.input?.focus();\n }}\n>\n${t(\"modal.close\")}\n</button>\n</div>\n</div>\n</div>`;\n }\n protected override hookStates() {\n const placement =\n this.open && this.floating.isOpen\n ? this.floating.position.placement\n : undefined;\n const { side, align } = placement\n ? parsePlacement(placement)\n : { side: undefined, align: undefined };\n return {\n placement,\n side,\n align,\n state: this.open && this.interactive ? \"open\" : \"closed\",\n disabled: this.isDisabled,\n readonly: this.readOnly,\n invalid: this.invalid,\n size: this.size,\n };\n }\n private handlePanelKeyDown(event: KeyboardEvent) {\n const panel = event.currentTarget as HTMLElement;\n const input = this.input;\n if (\n !input ||\n event.key !== \"Tab\" ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey\n )\n return;\n const focused = this.shadowRoot?.activeElement ?? null;\n if (!focused || !panel.contains(focused)) return;\n const tabbables = getTabbables(panel);\n const leaves =\n tabbables.length === 0 ||\n (event.shiftKey\n ? focused === panel || focused === tabbables[0]\n : focused === tabbables[tabbables.length - 1]);\n if (!leaves) return;\n event.preventDefault();\n const next = event.shiftKey\n ? input\n : (this.shadowRoot?.querySelector<HTMLElement>(\".clearButton\") ??\n this.tabbableAfter() ??\n input);\n next.focus();\n this.requestOpenChange(false);\n }\n\n /** The first tabbable element of the page after this element. */\n private tabbableAfter(): HTMLElement | null {\n const all = getTabbables(this.ownerDocument.body);\n let last = -1;\n all.forEach((el, i) => {\n if (contains(this, el)) last = i;\n });\n if (last === -1) {\n return (\n all.find(\n (el) =>\n !!(\n this.compareDocumentPosition(el) &\n Node.DOCUMENT_POSITION_FOLLOWING\n ),\n ) ?? null\n );\n }\n return all.slice(last + 1).find((el) => !contains(this, el)) ?? null;\n }\n\n protected override render() {\n const { t } = this.i18n;\n const disabled = this.isDisabled;\n const readonly = this.readOnly;\n const current = this.valueAsDate;\n const name = this.label || this.aria.label || t(\"datePicker.label\");\n const displayValue = this.draft ?? (current ? dayKey(current) : \"\");\n const showClear =\n !this.hideClearButton && !!current && !disabled && !readonly;\n\n return html`<div part=\"root\" class=\"datePicker\">\n<div\npart=\"control\"\nclass=${classMap({\n root: true,\n outline: true,\n [this.size]: true,\n invalid: this.invalid,\n disabled,\n })}\ndata-component=\"input\"\n>\n<input\npart=\"input\"\nclass=\"field\"\n.value=${live(displayValue)}\nplaceholder=${this.placeholder ?? t(\"datePicker.placeholder\")}\n?disabled=${disabled}\n?readonly=${readonly}\n?required=${this.required}\nautocomplete=\"off\"\naria-label=${name}\naria-description=${this.aria.description ?? nothing}\naria-invalid=${\n this.invalid || this.aria.attr(\"aria-invalid\") === \"true\"\n ? \"true\"\n : nothing\n }\naria-readonly=${readonly ? \"true\" : nothing}\n@input=${this.handleInput}\n@blur=${this.handleBlur}\n@click=${this.handleInputClick}\n@keydown=${this.handleInputKeyDown}\n/>\n<span class=\"addon end\">\n${\n showClear\n ? html`<button\npart=\"clear-button\"\ntype=\"button\"\nclass=\"iconButton neutral variant-ghost small circle clearButton\"\naria-label=${t(\"datePicker.clear\")}\n@click=${this.handleClear}\n>\n${IconX}\n</button>`\n : html`<span part=\"icon\" class=\"calendarIcon\" aria-hidden=\"true\"\n>${IconCalendar}</span\n>`\n }\n</span>\n</div>\n</div>\n${this.open && !disabled && !readonly ? this.renderPanel(name) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-date-picker\": MinervaDatePicker;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwCA,IAAMQ,IAAW;CAAC;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK,GAoBpDC,IAAb,cAAuCC,EAAsB;;EA4D/B,aArCiB,KAAA,OAAA,eAEL,KAAA,QAAA,IAES,KAAA,eAAA,IAEE,KAAA,OAAA,IAQe,KAAA,OAAA,UAEZ,KAAA,UAAA,IAGpD,KAAA,WAAA,IAGA,KAAA,kBAAA,IAKsC,KAAA,QAAA,MACf,KAAA,QAAAE,kBAAW,IAAI,KAAK,CAAC,GAChB,KAAA,aAAA,IAId,KAAA,QAAA,IACO,KAAA,eAAA,IACC,KAAA,OAAA,IAAIC,EAAiB,IAAI,GACzB,KAAA,OAAA,IAAIC,EAAe,YAAY,KAAK,MAAM,GACtC,KAAA,WAAA,IAAIC,EAA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AE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAW,CAAC,CAAA,GAAAjE,EAAA,WAAA,YAAA,KAAA,CAAA,GAGhEN,EAAA,CAAAuE,EAAS;CAAE,MAAM;CAAS,WAAW;AAAoB,CAAC,CAAA,GAAAjE,EAAA,WAAA,mBAAA,KAAA,CAAA,GAG1DN,EAAA,CAAAuE,EAAS,EAAE,WAAW,WAAW,CAAC,CAAA,GAAAjE,EAAA,WAAA,WAAA,KAAA,CAAA,GAElCN,EAAA,CAAAuE,EAAS,EAAE,WAAW,WAAW,CAAC,CAAA,GAAAjE,EAAA,WAAA,WAAA,KAAA,CAAA,GAClCN,EAAA,CAAAoB,EAAM,CAAA,GAAAd,EAAA,WAAA,SAAA,KAAA,CAAA,GACNN,EAAA,CAAAoB,EAAM,CAAA,GAAAd,EAAA,WAAA,SAAA,KAAA,CAAA,GACNN,EAAA,CAAAoB,EAAM,CAAA,GAAAd,EAAA,WAAA,cAAA,KAAA,CAAA,GACNN,EAAA,CAAAwE,EAAM,OAAO,CAAA,GAAAlE,EAAA,WAAA,SAAA,KAAA,CAAA,GACbN,EAAA,CAAAwE,EAAM,aAAa,CAAA,GAAAlE,EAAA,WAAA,SAAA,KAAA,CAAA,GACnBN,EAAA,CAAAwE,EAAM,QAAQ,CAAA,GAAAlE,EAAA,WAAA,SAAA,KAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minerva-design",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.2",
|
|
4
4
|
"description": "Minerva Design: React, Vue, Angular, Web Components and native platform components with shared design tokens and contracts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "fwx5618177 <fwx5618177@gmail.com>",
|