@f-ewald/components 1.46.1 → 1.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/custom-elements.json +4520 -2463
- package/dist/address-autocomplete.d.ts +9 -44
- package/dist/address-autocomplete.d.ts.map +1 -1
- package/dist/address-autocomplete.js +16 -597
- package/dist/address-autocomplete.js.map +1 -1
- package/dist/app-shell.d.ts.map +1 -1
- package/dist/app-shell.js +8 -5
- package/dist/app-shell.js.map +1 -1
- package/dist/autocomplete-base.d.ts +79 -0
- package/dist/autocomplete-base.d.ts.map +1 -0
- package/dist/autocomplete-base.js +679 -0
- package/dist/autocomplete-base.js.map +1 -0
- package/dist/autocomplete-input.d.ts +9 -44
- package/dist/autocomplete-input.d.ts.map +1 -1
- package/dist/autocomplete-input.js +18 -647
- package/dist/autocomplete-input.js.map +1 -1
- package/dist/calendar-month.d.ts +3 -2
- package/dist/calendar-month.d.ts.map +1 -1
- package/dist/calendar-month.js +5 -3
- package/dist/calendar-month.js.map +1 -1
- package/dist/calendar-timeline-base.d.ts +3 -2
- package/dist/calendar-timeline-base.d.ts.map +1 -1
- package/dist/calendar-timeline-base.js +5 -3
- package/dist/calendar-timeline-base.js.map +1 -1
- package/dist/drop-zone.d.ts +78 -0
- package/dist/drop-zone.d.ts.map +1 -0
- package/dist/drop-zone.js +479 -0
- package/dist/drop-zone.js.map +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +2 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +13 -10
- package/dist/mcp-server.js.map +1 -1
- package/dist/utils/calendar.d.ts +5 -0
- package/dist/utils/calendar.d.ts.map +1 -1
- package/dist/utils/calendar.js +17 -0
- package/dist/utils/calendar.js.map +1 -1
- package/docs/address-autocomplete.md +7 -7
- package/docs/autocomplete-input.md +5 -5
- package/docs/drop-zone.md +87 -0
- package/docs/icons.md +1 -0
- package/llms.txt +42 -2
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocomplete-base.js","sourceRoot":"","sources":["../src/autocomplete-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,gBAAgB,GAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,IAAI,aAAa,GAAG,CAAC,CAAC;AAStB,kGAAkG;AAClG,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyPpC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,OAAgB,gBAAoB,SAAQ,UAAU;IAA5D;;QAGE,mFAAmF;QACvE,UAAK,GAAG,EAAE,CAAC;QACvB,sDAAsD;QAC1C,gBAAW,GAAG,EAAE,CAAC;QAC7B,8DAA8D;QACjC,aAAQ,GAAG,KAAK,CAAC;QAC9C,0DAA0D;QACd,aAAQ,GAAG,KAAK,CAAC;QAC7D,oEAAoE;QACxB,cAAS,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IACJ,CAAC;CACF;AAtXa;IAAX,QAAQ,EAAE;+CAAY;AAEX;IAAX,QAAQ,EAAE;qDAAkB;AAEA;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAkB;AAEF;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAkB;AAEjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAmB;AAElC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAgB;AAEU;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;mDAAe;AAElD;IAAhB,KAAK,EAAE;sDAAgC;AACvB;IAAhB,KAAK,EAAE;+CAAuB;AACd;IAAhB,KAAK,EAAE;sDAA2B;AAClB;IAAhB,KAAK,EAAE;uDAA+B;AACtB;IAAhB,KAAK,EAAE;0DAAgE;AAEhD;IAAvB,KAAK,CAAC,OAAO,CAAC;gDAAmC","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues, type TemplateResult } from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport {\n formFieldControl,\n type FormFieldControlConfig,\n} from \"./utils/form-field-control.js\";\nimport { submitWithDefaultButton } from \"./utils/form.js\";\n\nlet instanceCount = 0;\n\n/** How one candidate is shown: its value text plus an optional icon and description line. */\nexport interface AutocompleteItemView {\n text: string;\n icon?: TemplateResult;\n description?: string;\n}\n\n/** Shared styles for every `AutocompleteBase` subclass; use as `[tokens, autocompleteStyles]`. */\nexport const autocompleteStyles = css`\n :host {\n display: block;\n position: relative;\n }\n .field-shell {\n position: relative;\n }\n input {\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n padding: 0.5rem 0.75rem;\n border: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n }\n .field-shell.clearable input {\n padding-right: 2rem;\n }\n .field-shell.has-icon input {\n padding-left: 2rem;\n }\n .field-icon {\n position: absolute;\n top: 50%;\n left: 0.75rem;\n display: inline-flex;\n line-height: 0;\n transform: translateY(-50%);\n color: var(--ui-text-muted, #64748b);\n pointer-events: none;\n }\n .clear-button {\n position: absolute;\n top: 0;\n right: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 2rem;\n height: 2rem;\n /* Insets the hover/focus background by the input's 1px border so it\n stays fully inside the field instead of painting over the border. */\n padding: 1px;\n background-clip: content-box;\n border: 0;\n border-radius: var(--ui-radius-sm, 0.25rem);\n color: var(--ui-text-muted, #64748b);\n background-color: transparent;\n cursor: pointer;\n line-height: 0;\n }\n .clear-button:hover {\n color: var(--ui-text, #0f172a);\n background-color: var(--ui-surface-muted, #f8fafc);\n }\n .clear-button:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .floating-label {\n position: absolute;\n top: 50%;\n left: 0.75rem;\n right: 0.75rem;\n z-index: 1;\n display: flex;\n align-items: baseline;\n gap: 0.25rem;\n overflow: hidden;\n transform: translateY(-50%);\n color: var(--ui-text-muted, #64748b);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-regular, 400);\n line-height: var(--ui-line-height-tight, 1.25);\n white-space: nowrap;\n text-overflow: ellipsis;\n cursor: text;\n transition:\n top 150ms ease,\n transform 150ms ease,\n font-size 150ms ease;\n }\n .field-shell.clearable .floating-label {\n right: 2rem;\n }\n .field-shell.floating input {\n height: 3rem;\n padding-top: 1.25rem;\n padding-bottom: 0.25rem;\n }\n .field-shell.floating .clear-button {\n top: 0.5rem;\n }\n .field-shell.floating .field-icon {\n top: 2rem;\n }\n .field-shell.has-icon .floating-label {\n left: 2rem;\n }\n .field-shell.floating.has-value .floating-label,\n .field-shell.floating:focus-within .floating-label {\n top: 0.25rem;\n transform: none;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n .field-shell.floating:not(.has-value):not(:focus-within) input::placeholder {\n opacity: 0;\n }\n .field-shell.disabled .floating-label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .required-mark {\n flex: 0 0 auto;\n color: var(--ui-danger, #dc2626);\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n input:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n input:focus-visible {\n outline: none;\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .suggestions {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n z-index: 10;\n max-height: 40vh;\n overflow-y: auto;\n margin: 0.25rem 0 0;\n padding: 0.25rem 0;\n list-style: none;\n background: var(--ui-surface, #ffffff);\n border: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));\n }\n .suggestion {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n cursor: pointer;\n }\n .suggestion-icon {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n /* Centers the icon on the value's first line rather than the whole row. */\n min-height: calc(1em * var(--ui-line-height-tight, 1.25));\n color: var(--ui-text-muted, #64748b);\n }\n .suggestion-text {\n display: flex;\n min-width: 0;\n flex-direction: column;\n line-height: var(--ui-line-height-tight, 1.25);\n }\n .suggestion-description {\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n .suggestion.active,\n .suggestion:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .no-suggestions {\n padding: 0.5rem 0.75rem;\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-style: italic;\n }\n @media (forced-colors: active) {\n input:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n input:disabled {\n color: GrayText;\n opacity: 1;\n }\n .clear-button:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: -2px;\n box-shadow: none;\n }\n .field-shell.disabled .floating-label {\n color: GrayText;\n opacity: 1;\n }\n .suggestion.active,\n .suggestion:hover {\n color: HighlightText;\n background: Highlight;\n }\n .suggestion.active :is(.suggestion-icon, .suggestion-description),\n .suggestion:hover :is(.suggestion-icon, .suggestion-description) {\n color: HighlightText;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .floating-label {\n transition: none;\n }\n }\n`;\n\n/**\n * Shared form-associated combobox behind `autocomplete-input` and\n * `address-autocomplete` — not a registered custom element itself. Owns the\n * input, debounced local filtering or fetching, keyboard and IME handling,\n * the clear action, and the form contract. Subclasses supply the item type\n * `T` and how to filter, fetch, show, and announce it.\n */\nexport abstract class AutocompleteBase<T> extends LitElement {\n static formAssociated = true;\n\n /** Current input value; also the form-associated value submitted with the form. */\n @property() value = \"\";\n /** Placeholder text shown when the input is empty. */\n @property() placeholder = \"\";\n /** Marks the input as required for native form validation. */\n @property({ type: Boolean }) required = false;\n /** Disables the input and closes its suggestion popup. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n /** Shows an in-field clear action while the control has a value. */\n @property({ type: Boolean, reflect: true }) clearable = false;\n /** Debounce delay (ms) before firing a request/filter after typing. */\n @property({ type: Number }) debounce = 300;\n /** Minimum query length before suggestions are shown. */\n @property({ type: Number, attribute: \"min-length\" }) minLength = 3;\n\n @state() private _suggestions: T[] = [];\n @state() private _open = false;\n @state() private _activeIndex = -1;\n @state() private _formDisabled = false;\n @state() private _formFieldConfig: FormFieldControlConfig | null = null;\n\n @query(\"input\") private _input?: HTMLInputElement;\n\n /** Accessible name of the suggestion list. */\n protected readonly listboxLabel: string = \"Suggestions\";\n /** Accessible name and tooltip of the clear action. */\n protected readonly clearLabel: string = \"Clear input\";\n /** The last item picked from the list; cleared on reset and clear. */\n protected lastPicked: T | null = null;\n\n #internals = this.attachInternals();\n #debounceTimer: ReturnType<typeof setTimeout> | null = null;\n #abortController: AbortController | null = null;\n #isComposing = false;\n #compositionJustEnded = false;\n #compositionEndTimer: ReturnType<typeof setTimeout> | null = null;\n readonly #inputId = `${this.localName}-field-${++instanceCount}`;\n readonly #listboxId = `${this.localName}-listbox-${instanceCount}`;\n\n /** The fixed candidate list to filter locally, or null to fetch instead. */\n protected abstract localItems(): T[] | null;\n /** How `item` is matched, shown, and written into the field. */\n protected abstract view(item: T): AutocompleteItemView;\n /** The request URL for `query` in fetch mode. */\n protected abstract requestUrl(query: string): string;\n /** Turns a fetch response's JSON body into candidates. */\n protected abstract parseItems(body: unknown): T[];\n /** Runs after `item` was picked and written into the field, e.g. to fire an event. */\n protected abstract onSelect(item: T): void;\n\n /** Icon shown inside the field, if any. */\n protected fieldIcon(): TemplateResult | undefined {\n return undefined;\n }\n\n /** Whether the host or an ancestor fieldset currently disables the control. */\n get #isDisabled(): boolean {\n return this.disabled || this._formDisabled;\n }\n\n /**\n * Applies or clears label configuration supplied by a wrapping `form-field`.\n * @private\n */\n [formFieldControl](config: FormFieldControlConfig | null): void {\n this._formFieldConfig = config;\n }\n\n protected override willUpdate(changed: PropertyValues) {\n if (changed.has(\"disabled\") && this.#isDisabled) {\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n this._open = false;\n this._activeIndex = -1;\n }\n }\n\n protected override updated(changed: PropertyValues) {\n if (changed.has(\"value\")) this.#internals.setFormValue(this.value);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n }\n\n /** Resets to empty on `form.reset()`, per the form-associated custom element contract. */\n formResetCallback() {\n this.value = \"\";\n this._suggestions = [];\n this._open = false;\n this.lastPicked = null;\n }\n\n /** Mirrors ancestor fieldset disabled state onto the native input. */\n formDisabledCallback(disabled: boolean) {\n this._formDisabled = disabled;\n if (!disabled) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n this._open = false;\n this._activeIndex = -1;\n }\n\n private onInput(e: InputEvent) {\n if (this.#isDisabled) return;\n this.value = (e.target as HTMLInputElement).value;\n this.lastPicked = null;\n this.#scheduleFetch(this.value);\n }\n\n #scheduleFetch(query: string) {\n if (this.#isDisabled) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n // Any response still in flight is for older text now.\n this.#abortController?.abort();\n this.#abortController = null;\n if (query.trim().length < this.minLength) {\n this._suggestions = [];\n this._open = false;\n this._activeIndex = -1;\n return;\n }\n if (this.localItems()) {\n // Local mode: filtering is synchronous and cheap, but keep the same\n // debounce as the API mode so the UX doesn't shift between sources.\n this.#debounceTimer = setTimeout(() => this.#filterLocalItems(query), this.debounce);\n return;\n }\n this.#debounceTimer = setTimeout(() => void this.#fetchItems(query), this.debounce);\n }\n\n /** Filters the local candidate list for `query`, case-insensitively. */\n #filterLocalItems(query: string) {\n const needle = query.trim().toLowerCase();\n this._suggestions = (this.localItems() ?? [])\n .filter((item) => this.view(item).text.toLowerCase().includes(needle))\n .slice(0, 5);\n this._activeIndex = -1;\n this._open = !this.#isDisabled;\n }\n\n /** Fetches candidates for `query`, cancelling any request still in flight. */\n async #fetchItems(query: string) {\n this.#abortController?.abort();\n const controller = new AbortController();\n this.#abortController = controller;\n try {\n const res = await fetch(this.requestUrl(query), { signal: controller.signal });\n if (!res.ok) throw new Error(`autocomplete request failed: ${res.status}`);\n const body: unknown = await res.json();\n if (controller.signal.aborted || this.#isDisabled) return;\n this._suggestions = this.parseItems(body).slice(0, 5);\n this._activeIndex = -1;\n this._open = true;\n } catch {\n // Aborted (superseded by newer keystroke) or a network failure while\n // typing — fail silently and just close the list.\n if (!controller.signal.aborted) {\n this._suggestions = [];\n this._open = false;\n }\n }\n }\n\n private onKeydown(e: KeyboardEvent) {\n if (this.#isDisabled) return;\n if (e.isComposing || e.keyCode === 229 || this.#isComposing || this.#compositionJustEnded) {\n return;\n }\n if (e.key === \"ArrowDown\") this.#moveActive(1, e);\n else if (e.key === \"ArrowUp\") this.#moveActive(-1, e);\n else if (e.key === \"Enter\") this.#handleEnter(e);\n else if (e.key === \"Escape\") this.#handleEscape(e);\n }\n\n #moveActive(delta: number, e: KeyboardEvent) {\n if (!this._open || this._suggestions.length === 0) return;\n e.preventDefault();\n const n = this._suggestions.length;\n this._activeIndex = (this._activeIndex + delta + n) % n;\n }\n\n #handleEnter(e: KeyboardEvent) {\n const pick = this._suggestions[this._activeIndex] ?? this._suggestions[0];\n if (this._open && pick) {\n e.preventDefault();\n this.#select(pick);\n return;\n }\n if (this.#internals.form) {\n const form = this.#internals.form;\n window.setTimeout(() => {\n if (!e.defaultPrevented && form.isConnected) submitWithDefaultButton(form);\n });\n }\n }\n\n #handleEscape(e: KeyboardEvent) {\n if (!this._open) return;\n e.preventDefault();\n this._open = false;\n }\n\n private onBlur() {\n this._open = false;\n }\n\n private onCompositionStart(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#compositionJustEnded = false;\n this.#isComposing = true;\n }\n\n private onCompositionEnd(): void {\n this.#isComposing = false;\n this.#compositionJustEnded = true;\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = setTimeout(() => {\n this.#compositionJustEnded = false;\n this.#compositionEndTimer = null;\n });\n }\n\n /** Clears composition state when the control can no longer receive keys. */\n #resetComposition(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#isComposing = false;\n this.#compositionJustEnded = false;\n }\n\n #select(item: T) {\n this.value = this.view(item).text;\n this.lastPicked = item;\n this._open = false;\n this._suggestions = [];\n this.onSelect(item);\n }\n\n /** Clears the field and all pending autocomplete state, then restores input focus. */\n #clear(): void {\n if (this.#isDisabled || !this.value) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#debounceTimer = null;\n this.#abortController?.abort();\n this.#abortController = null;\n this.#resetComposition();\n this.value = \"\";\n this.lastPicked = null;\n this._suggestions = [];\n this._activeIndex = -1;\n this._open = false;\n this.#internals.setFormValue(\"\");\n this.dispatchEvent(\n new InputEvent(\"input\", {\n bubbles: true,\n composed: true,\n inputType: \"deleteContentBackward\",\n }),\n );\n this._input?.focus({ preventScroll: true });\n }\n\n /** Selects on mousedown (not click) so it wins over the input's blur, which closes the list. */\n #onSuggestionMousedown(e: MouseEvent, item: T) {\n e.preventDefault();\n this.#select(item);\n }\n\n private renderSuggestions() {\n if (!this._open || this.#isDisabled) return nothing;\n return html`\n <ul id=${this.#listboxId} class=\"suggestions\" role=\"listbox\" aria-label=${this.listboxLabel}>\n ${this._suggestions.map((item, i) => {\n const { text, icon, description } = this.view(item);\n return html`\n <li\n id=${`${this.#listboxId}-option-${i}`}\n role=\"option\"\n aria-selected=${i === this._activeIndex}\n class=\"suggestion ${i === this._activeIndex ? \"active\" : \"\"}\"\n @mousedown=${(e: MouseEvent) => this.#onSuggestionMousedown(e, item)}\n >\n ${icon ? html`<span class=\"suggestion-icon\" aria-hidden=\"true\">${icon}</span>` : nothing}\n <span class=\"suggestion-text\">\n <span class=\"suggestion-value\">${text}</span>\n ${description ? html`<span class=\"suggestion-description\">${description}</span>` : nothing}\n </span>\n </li>\n `;\n })}\n ${this._suggestions.length === 0\n ? html`<li class=\"no-suggestions\" role=\"presentation\">\n <span role=\"status\">No suggestions found</span>\n </li>`\n : nothing}\n </ul>\n `;\n }\n\n override render() {\n const activeDescendant =\n this._open && !this.#isDisabled && this._activeIndex >= 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n const expanded = this._open && !this.#isDisabled;\n const floating =\n Boolean(this._formFieldConfig?.floating) && Boolean(this._formFieldConfig?.label);\n const showClear = this.clearable && Boolean(this.value) && !this.#isDisabled;\n const icon = this.fieldIcon();\n return html`\n <div\n class=\"field-shell ${this.clearable ? \"clearable\" : \"\"} ${floating\n ? \"floating\"\n : \"\"} ${this.value ? \"has-value\" : \"\"} ${this.#isDisabled ? \"disabled\" : \"\"} ${icon\n ? \"has-icon\"\n : \"\"}\"\n >\n ${icon ? html`<span class=\"field-icon\" aria-hidden=\"true\">${icon}</span>` : nothing}\n ${floating\n ? html`\n <label class=\"floating-label\" for=${this.#inputId}>\n <span>${this._formFieldConfig!.label}</span>\n ${this._formFieldConfig!.required\n ? html`\n <span class=\"required-mark\" aria-hidden=\"true\">*</span>\n <span class=\"sr-only\"> (required)</span>\n `\n : nothing}\n </label>\n `\n : nothing}\n <input\n id=${this.#inputId}\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=${expanded}\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n .value=${this.value}\n placeholder=${this.placeholder}\n ?required=${this.required}\n ?disabled=${this.#isDisabled}\n autocomplete=\"off\"\n @input=${this.onInput}\n @compositionstart=${this.onCompositionStart}\n @compositionend=${this.onCompositionEnd}\n @keydown=${this.onKeydown}\n @blur=${this.onBlur}\n />\n ${showClear\n ? html`\n <button\n type=\"button\"\n class=\"clear-button\"\n aria-label=${this.clearLabel}\n title=${this.clearLabel}\n @mousedown=${(event: MouseEvent) => event.preventDefault()}\n @click=${() => this.#clear()}\n >\n ${iconX(18)}\n </button>\n `\n : nothing}\n ${this.renderSuggestions()}\n </div>\n `;\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { TemplateResult } from "lit";
|
|
2
|
+
import { AutocompleteBase, type AutocompleteItemView } from "./autocomplete-base.js";
|
|
3
3
|
/** A single autocomplete candidate: an opaque `key` plus its display `value`. */
|
|
4
4
|
export interface AutocompleteOption {
|
|
5
5
|
key: string;
|
|
@@ -42,28 +42,12 @@ export interface AutocompleteOption {
|
|
|
42
42
|
* @fires option-select - An option was picked; detail: AutocompleteOption.
|
|
43
43
|
* @fires input - Native-compatible input event fired while editing or clearing.
|
|
44
44
|
*/
|
|
45
|
-
export declare class AutocompleteInput extends
|
|
46
|
-
#private;
|
|
47
|
-
static formAssociated: boolean;
|
|
45
|
+
export declare class AutocompleteInput extends AutocompleteBase<AutocompleteOption> {
|
|
48
46
|
static styles: import("lit").CSSResult[];
|
|
49
|
-
/** Current input value; also the form-associated value submitted with the form. */
|
|
50
|
-
value: string;
|
|
51
|
-
/** Placeholder text shown when the input is empty. */
|
|
52
|
-
placeholder: string;
|
|
53
|
-
/** Marks the input as required for native form validation. */
|
|
54
|
-
required: boolean;
|
|
55
|
-
/** Disables the input and closes its suggestion popup. */
|
|
56
|
-
disabled: boolean;
|
|
57
|
-
/** Shows an in-field clear action while the control has a value. */
|
|
58
|
-
clearable: boolean;
|
|
59
47
|
/** API endpoint queried in API mode. Ignored when `options` is set. */
|
|
60
48
|
endpoint: string;
|
|
61
49
|
/** Query string parameter name the current input text is sent under. */
|
|
62
50
|
queryParam: string;
|
|
63
|
-
/** Debounce delay (ms) before firing a request/filter after typing. */
|
|
64
|
-
debounce: number;
|
|
65
|
-
/** Minimum query length before suggestions are shown. */
|
|
66
|
-
minLength: number;
|
|
67
51
|
/**
|
|
68
52
|
* Fixed candidate list to filter locally instead of fetching from
|
|
69
53
|
* `endpoint`. When set (non-null), no network request is ever made —
|
|
@@ -72,33 +56,14 @@ export declare class AutocompleteInput extends LitElement {
|
|
|
72
56
|
options: AutocompleteOption[] | null;
|
|
73
57
|
/** Key of the selected option: set by picking one, or by the caller together with `value`. */
|
|
74
58
|
selectedKey: string | null;
|
|
75
|
-
private _suggestions;
|
|
76
|
-
private _open;
|
|
77
|
-
private _activeIndex;
|
|
78
|
-
private _formDisabled;
|
|
79
|
-
private _formFieldConfig;
|
|
80
|
-
private _input?;
|
|
81
59
|
/** Selected option (picked, or matching `selectedKey`), or null once the input diverges from it. */
|
|
82
60
|
get selectedOption(): AutocompleteOption | null;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
protected
|
|
89
|
-
protected updated(changed: PropertyValues): void;
|
|
90
|
-
disconnectedCallback(): void;
|
|
91
|
-
/** Resets to empty on `form.reset()`, per the form-associated custom element contract. */
|
|
92
|
-
formResetCallback(): void;
|
|
93
|
-
/** Mirrors ancestor fieldset disabled state onto the native input. */
|
|
94
|
-
formDisabledCallback(disabled: boolean): void;
|
|
95
|
-
private onInput;
|
|
96
|
-
private onKeydown;
|
|
97
|
-
private onBlur;
|
|
98
|
-
private onCompositionStart;
|
|
99
|
-
private onCompositionEnd;
|
|
100
|
-
private renderSuggestions;
|
|
101
|
-
render(): TemplateResult<1>;
|
|
61
|
+
protected localItems(): AutocompleteOption[] | null;
|
|
62
|
+
protected view(option: AutocompleteOption): AutocompleteItemView;
|
|
63
|
+
protected requestUrl(query: string): string;
|
|
64
|
+
protected parseItems(body: unknown): AutocompleteOption[];
|
|
65
|
+
protected onSelect(option: AutocompleteOption): void;
|
|
66
|
+
protected fieldIcon(): TemplateResult | undefined;
|
|
102
67
|
}
|
|
103
68
|
declare global {
|
|
104
69
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.d.ts","sourceRoot":"","sources":["../src/autocomplete-input.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"autocomplete-input.d.ts","sourceRoot":"","sources":["../src/autocomplete-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAsB,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGzG,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,8HAA8H;IAC9H,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBACa,iBAAkB,SAAQ,gBAAgB,CAAC,kBAAkB,CAAC;IACzE,OAAgB,MAAM,4BAAgC;IAEtD,uEAAuE;IAC3D,QAAQ,SAAM;IAC1B,wEAAwE;IAChC,UAAU,SAAO;IACzD;;;;OAIG;IAC6B,OAAO,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAQ;IAC5E,8FAA8F;IACrD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE3E,oGAAoG;IACpG,IAAI,cAAc,IAAI,kBAAkB,GAAG,IAAI,CAG9C;IAED,UAAmB,UAAU,IAAI,kBAAkB,EAAE,GAAG,IAAI,CAE3D;IAED,UAAmB,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,oBAAoB,CAExE;IAED,UAAmB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGnD;IAED,UAAmB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