@f-ewald/components 1.41.0 → 1.43.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 +5 -1
- package/custom-elements.json +2102 -332
- package/dist/autocomplete-input.d.ts +10 -2
- package/dist/autocomplete-input.d.ts.map +1 -1
- package/dist/autocomplete-input.js +34 -1
- package/dist/autocomplete-input.js.map +1 -1
- package/dist/dag-graph.d.ts +161 -0
- package/dist/dag-graph.d.ts.map +1 -0
- package/dist/dag-graph.js +724 -0
- package/dist/dag-graph.js.map +1 -0
- package/dist/data-table.d.ts +11 -2
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +31 -3
- package/dist/data-table.js.map +1 -1
- package/dist/icons.d.ts +16 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +16 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/kind-icon.d.ts +38 -0
- package/dist/kind-icon.d.ts.map +1 -0
- package/dist/kind-icon.js +87 -0
- package/dist/kind-icon.js.map +1 -0
- package/dist/tokens.css +4 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +10 -0
- package/dist/tokens.js.map +1 -1
- package/dist/ui-tooltip.d.ts +49 -0
- package/dist/ui-tooltip.d.ts.map +1 -0
- package/dist/ui-tooltip.js +317 -0
- package/dist/ui-tooltip.js.map +1 -0
- package/dist/utils/dag-layout.d.ts +60 -0
- package/dist/utils/dag-layout.d.ts.map +1 -0
- package/dist/utils/dag-layout.js +80 -0
- package/dist/utils/dag-layout.js.map +1 -0
- package/docs/autocomplete-input.md +9 -2
- package/docs/dag-graph.md +101 -0
- package/docs/data-table.md +18 -0
- package/docs/design-language.md +4 -1
- package/docs/icons.md +8 -0
- package/docs/kind-icon.md +53 -0
- package/docs/ui-tooltip.md +70 -0
- package/llms.txt +150 -2
- package/package.json +2 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { LitElement, type PropertyValues } from "lit";
|
|
1
|
+
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
2
2
|
import { formFieldControl, type FormFieldControlConfig } from "./utils/form-field-control.js";
|
|
3
3
|
/** A single autocomplete candidate: an opaque `key` plus its display `value`. */
|
|
4
4
|
export interface AutocompleteOption {
|
|
5
5
|
key: string;
|
|
6
6
|
value: string;
|
|
7
|
+
/** Optional pre-rendered icon shown before the value, e.g. `iconServer(14)`. Local `options` only — not JSON-serializable. */
|
|
8
|
+
icon?: TemplateResult;
|
|
9
|
+
/** Optional secondary line shown under the value in smaller, muted text. Not matched when filtering. */
|
|
10
|
+
description?: string;
|
|
7
11
|
}
|
|
8
12
|
/**
|
|
9
13
|
* Generic form-associated text input with a suggestion dropdown, for any
|
|
@@ -24,6 +28,10 @@ export interface AutocompleteOption {
|
|
|
24
28
|
* request. Useful for small/fixed lists, offline use, or tests. Takes
|
|
25
29
|
* priority over `endpoint` whenever it's non-null.
|
|
26
30
|
*
|
|
31
|
+
* Each option may also carry a pre-rendered `icon` (shown before the value)
|
|
32
|
+
* and a `description` (a smaller, muted line under the value); options
|
|
33
|
+
* without them render as a plain value.
|
|
34
|
+
*
|
|
27
35
|
* Set `clearable` to show an in-field clear action whenever a value is
|
|
28
36
|
* present.
|
|
29
37
|
*
|
|
@@ -85,7 +93,7 @@ export declare class AutocompleteInput extends LitElement {
|
|
|
85
93
|
private onCompositionStart;
|
|
86
94
|
private onCompositionEnd;
|
|
87
95
|
private renderSuggestions;
|
|
88
|
-
render():
|
|
96
|
+
render(): TemplateResult<1>;
|
|
89
97
|
}
|
|
90
98
|
declare global {
|
|
91
99
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.d.ts","sourceRoot":"","sources":["../src/autocomplete-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,K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I,cAAc,IAAI,kBAAkB,GAAG,IAAI,CAG9C;IAED;;;OAGG;IACH,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAE9D;IAED,UAAmB,UAAU,CAAC,OAAO,EAAE,cAAc,QAQpD;IAED,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,QAEjD;IAEQ,oBAAoB,SAK5B;IAED,0FAA0F;IAC1F,iBAAiB,SAKhB;IAED,sEAAsE;IACtE,oBAAoB,CAAC,QAAQ,EAAE,OAAO,QAQrC;IAED,OAAO,CAAC,OAAO;IA8Df,OAAO,CAAC,SAAS;IAuCjB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,gBAAgB;IAwDxB,OAAO,CAAC,iBAAiB;IA8BhB,MAAM,sBAgEd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,iBAAiB,CAAC;KACzC;CACF"}
|
|
@@ -30,6 +30,10 @@ let instanceCount = 0;
|
|
|
30
30
|
* request. Useful for small/fixed lists, offline use, or tests. Takes
|
|
31
31
|
* priority over `endpoint` whenever it's non-null.
|
|
32
32
|
*
|
|
33
|
+
* Each option may also carry a pre-rendered `icon` (shown before the value)
|
|
34
|
+
* and a `description` (a smaller, muted line under the value); options
|
|
35
|
+
* without them render as a plain value.
|
|
36
|
+
*
|
|
33
37
|
* Set `clearable` to show an in-field clear action whenever a value is
|
|
34
38
|
* present.
|
|
35
39
|
*
|
|
@@ -243,10 +247,31 @@ let AutocompleteInput = class AutocompleteInput extends LitElement {
|
|
|
243
247
|
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));
|
|
244
248
|
}
|
|
245
249
|
.suggestion {
|
|
250
|
+
display: flex;
|
|
251
|
+
align-items: flex-start;
|
|
252
|
+
gap: 0.5rem;
|
|
246
253
|
padding: 0.5rem 0.75rem;
|
|
247
254
|
font-size: var(--ui-font-size-sm, 0.75rem);
|
|
248
255
|
cursor: pointer;
|
|
249
256
|
}
|
|
257
|
+
.suggestion-icon {
|
|
258
|
+
display: inline-flex;
|
|
259
|
+
flex: 0 0 auto;
|
|
260
|
+
align-items: center;
|
|
261
|
+
/* Centers the icon on the value's first line rather than the whole row. */
|
|
262
|
+
min-height: calc(1em * var(--ui-line-height-tight, 1.25));
|
|
263
|
+
color: var(--ui-text-muted, #64748b);
|
|
264
|
+
}
|
|
265
|
+
.suggestion-text {
|
|
266
|
+
display: flex;
|
|
267
|
+
min-width: 0;
|
|
268
|
+
flex-direction: column;
|
|
269
|
+
line-height: var(--ui-line-height-tight, 1.25);
|
|
270
|
+
}
|
|
271
|
+
.suggestion-description {
|
|
272
|
+
color: var(--ui-text-muted, #64748b);
|
|
273
|
+
font-size: var(--ui-font-size-xs, 0.6875rem);
|
|
274
|
+
}
|
|
250
275
|
.suggestion.active,
|
|
251
276
|
.suggestion:hover {
|
|
252
277
|
background: var(--ui-surface-muted, #f8fafc);
|
|
@@ -281,6 +306,10 @@ let AutocompleteInput = class AutocompleteInput extends LitElement {
|
|
|
281
306
|
color: HighlightText;
|
|
282
307
|
background: Highlight;
|
|
283
308
|
}
|
|
309
|
+
.suggestion.active :is(.suggestion-icon, .suggestion-description),
|
|
310
|
+
.suggestion:hover :is(.suggestion-icon, .suggestion-description) {
|
|
311
|
+
color: HighlightText;
|
|
312
|
+
}
|
|
284
313
|
}
|
|
285
314
|
@media (prefers-reduced-motion: reduce) {
|
|
286
315
|
.floating-label {
|
|
@@ -537,7 +566,11 @@ let AutocompleteInput = class AutocompleteInput extends LitElement {
|
|
|
537
566
|
class="suggestion ${i === this._activeIndex ? "active" : ""}"
|
|
538
567
|
@mousedown=${(e) => this.#onSuggestionMousedown(e, o)}
|
|
539
568
|
>
|
|
540
|
-
${o.
|
|
569
|
+
${o.icon ? html `<span class="suggestion-icon" aria-hidden="true">${o.icon}</span>` : nothing}
|
|
570
|
+
<span class="suggestion-text">
|
|
571
|
+
<span class="suggestion-value">${o.value}</span>
|
|
572
|
+
${o.description ? html `<span class="suggestion-description">${o.description}</span>` : nothing}
|
|
573
|
+
</span>
|
|
541
574
|
</li>
|
|
542
575
|
`)}
|
|
543
576
|
${this._suggestions.length === 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.js","sourceRoot":"","sources":["../src/autocomplete-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,gBAAgB,GAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,IAAI,aAAa,GAAG,CAAC,CAAC;AAQtB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QAqNL,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,GAAG,KAAK,CAAC;QAC9D,uEAAuE;QAC3D,aAAQ,GAAG,EAAE,CAAC;QAC1B,wEAAwE;QAChC,eAAU,GAAG,GAAG,CAAC;QACzD,uEAAuE;QAC3C,aAAQ,GAAG,GAAG,CAAC;QAC3C,yDAAyD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O,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAkB;AAEjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAmB;AAElD;IAAX,QAAQ,EAAE;mDAAe;AAEc;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;qDAAkB;AAE7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAgB;AAEU;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAAe;AAMnC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;kDAA6C;AAE3D;IAAhB,KAAK,EAAE;uDAAiD;AACxC;IAAhB,KAAK,EAAE;gDAAuB;AACd;IAAhB,KAAK,EAAE;uDAA2B;AAClB;IAAhB,KAAK,EAAE;wDAA+B;AACtB;IAAhB,KAAK,EAAE;2DAAgE;AAEhD;IAAvB,KAAK,CAAC,OAAO,CAAC;iDAAmC;AApPvC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CA8jB7B","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.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/** A single autocomplete candidate: an opaque `key` plus its display `value`. */\nexport interface AutocompleteOption {\n key: string;\n value: string;\n}\n\n/**\n * Generic form-associated text input with a suggestion dropdown, for any\n * \"type to filter a list of `{key, value}` options\" use case. Works as a\n * drop-in replacement for a plain `<input>` inside a `<form>`: set `name` on\n * the element itself and consumers keep reading\n * `new FormData(form).get(name)` and calling `form.reset()` unchanged — the\n * submitted value is the picked option's `value`, while `key` is available\n * via the `option-select` event and the `selectedOption` getter for cases\n * that need the underlying id rather than the display text.\n *\n * Supports two suggestion sources:\n * - **API**: set `endpoint` to a URL that, given a `?<query-param>=<text>`\n * query string, responds with a JSON array of `{key, value}` objects.\n * Requests are debounced as the user types.\n * - **Local array**: set `options` to a fixed `AutocompleteOption[]` and the\n * component filters it client-side instead of making any network\n * request. Useful for small/fixed lists, offline use, or tests. Takes\n * priority over `endpoint` whenever it's non-null.\n *\n * Set `clearable` to show an in-field clear action whenever a value is\n * present.\n *\n * @element autocomplete-input\n * @fires option-select - An option was picked; detail: AutocompleteOption.\n * @fires input - Native-compatible input event fired while editing or clearing.\n */\n@customElement(\"autocomplete-input\")\nexport class AutocompleteInput extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n 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 .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.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 padding: 0.5rem 0.75rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n cursor: pointer;\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 }\n @media (prefers-reduced-motion: reduce) {\n .floating-label {\n transition: none;\n }\n }\n `,\n ];\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 /** API endpoint queried in API mode. Ignored when `options` is set. */\n @property() endpoint = \"\";\n /** Query string parameter name the current input text is sent under. */\n @property({ attribute: \"query-param\" }) queryParam = \"q\";\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 * Fixed candidate list to filter locally instead of fetching from\n * `endpoint`. When set (non-null), no network request is ever made —\n * this takes priority over the API mode.\n */\n @property({ attribute: false }) options: AutocompleteOption[] | null = null;\n\n @state() private _suggestions: AutocompleteOption[] = [];\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 #internals = this.attachInternals();\n #lastPicked: AutocompleteOption | null = null;\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 = `autocomplete-input-field-${++instanceCount}`;\n readonly #listboxId = `autocomplete-input-listbox-${instanceCount}`;\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 /** Last-picked option, or null once the input diverges from it. */\n get selectedOption(): AutocompleteOption | null {\n if (this.#lastPicked && this.#lastPicked.value === this.value) return this.#lastPicked;\n return null;\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 if (query.trim().length < this.minLength) {\n this._suggestions = [];\n this._open = false;\n this._activeIndex = -1;\n return;\n }\n if (this.options) {\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.#filterLocalOptions(query), this.debounce);\n return;\n }\n this.#debounceTimer = setTimeout(() => void this.#fetchOptions(query), this.debounce);\n }\n\n /** Filters the locally-supplied `options` list for `query`, case-insensitively. */\n #filterLocalOptions(query: string) {\n const needle = query.trim().toLowerCase();\n this._suggestions = (this.options ?? [])\n .filter((o) => o.value.toLowerCase().includes(needle))\n .slice(0, 5);\n this._activeIndex = -1;\n this._open = !this.#isDisabled;\n }\n\n /** Fetches options for `query` from `endpoint`, cancelling any request still in flight. */\n async #fetchOptions(query: string) {\n this.#abortController?.abort();\n const controller = new AbortController();\n this.#abortController = controller;\n try {\n const res = await fetch(this.#buildUrl(query), { signal: controller.signal });\n if (!res.ok) throw new Error(`autocomplete request failed: ${res.status}`);\n if (this.#isDisabled) return;\n this._suggestions = ((await res.json()) as AutocompleteOption[]).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 #buildUrl(query: string): string {\n const params = new URLSearchParams({ [this.queryParam]: query });\n return `${this.endpoint}?${params.toString()}`;\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.#selectOption(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 #selectOption(o: AutocompleteOption) {\n this.value = o.value;\n this.#lastPicked = o;\n this._open = false;\n this._suggestions = [];\n this.dispatchEvent(new CustomEvent<AutocompleteOption>(\"option-select\", { detail: o, bubbles: true, composed: true }));\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, o: AutocompleteOption) {\n e.preventDefault();\n this.#selectOption(o);\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=\"Suggestions\">\n ${this._suggestions.map(\n (o, i) => 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, o)}\n >\n ${o.value}\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 return html`\n <div\n class=\"field-shell ${this.clearable ? \"clearable\" : \"\"} ${floating\n ? \"floating\"\n : \"\"} ${this.value ? \"has-value\" : \"\"} ${this.#isDisabled ? \"disabled\" : \"\"}\"\n >\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=\"Clear input\"\n title=\"Clear input\"\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\ndeclare global {\n interface HTMLElementTagNameMap {\n \"autocomplete-input\": AutocompleteInput;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"autocomplete-input.js","sourceRoot":"","sources":["../src/autocomplete-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,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O,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAmB;AAElD;IAAX,QAAQ,EAAE;mDAAe;AAEc;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;qDAAkB;AAE7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAgB;AAEU;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAAe;AAMnC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;kDAA6C;AAE3D;IAAhB,KAAK,EAAE;uDAAiD;AACxC;IAAhB,KAAK,EAAE;gDAAuB;AACd;IAAhB,KAAK,EAAE;uDAA2B;AAClB;IAAhB,KAAK,EAAE;wDAA+B;AACtB;IAAhB,KAAK,EAAE;2DAAgE;AAEhD;IAAvB,KAAK,CAAC,OAAO,CAAC;iDAAmC;AA7QvC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CA2lB7B","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues, type TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.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/** A single autocomplete candidate: an opaque `key` plus its display `value`. */\nexport interface AutocompleteOption {\n key: string;\n value: string;\n /** Optional pre-rendered icon shown before the value, e.g. `iconServer(14)`. Local `options` only — not JSON-serializable. */\n icon?: TemplateResult;\n /** Optional secondary line shown under the value in smaller, muted text. Not matched when filtering. */\n description?: string;\n}\n\n/**\n * Generic form-associated text input with a suggestion dropdown, for any\n * \"type to filter a list of `{key, value}` options\" use case. Works as a\n * drop-in replacement for a plain `<input>` inside a `<form>`: set `name` on\n * the element itself and consumers keep reading\n * `new FormData(form).get(name)` and calling `form.reset()` unchanged — the\n * submitted value is the picked option's `value`, while `key` is available\n * via the `option-select` event and the `selectedOption` getter for cases\n * that need the underlying id rather than the display text.\n *\n * Supports two suggestion sources:\n * - **API**: set `endpoint` to a URL that, given a `?<query-param>=<text>`\n * query string, responds with a JSON array of `{key, value}` objects.\n * Requests are debounced as the user types.\n * - **Local array**: set `options` to a fixed `AutocompleteOption[]` and the\n * component filters it client-side instead of making any network\n * request. Useful for small/fixed lists, offline use, or tests. Takes\n * priority over `endpoint` whenever it's non-null.\n *\n * Each option may also carry a pre-rendered `icon` (shown before the value)\n * and a `description` (a smaller, muted line under the value); options\n * without them render as a plain value.\n *\n * Set `clearable` to show an in-field clear action whenever a value is\n * present.\n *\n * @element autocomplete-input\n * @fires option-select - An option was picked; detail: AutocompleteOption.\n * @fires input - Native-compatible input event fired while editing or clearing.\n */\n@customElement(\"autocomplete-input\")\nexport class AutocompleteInput extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n 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 .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.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 /** 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 /** API endpoint queried in API mode. Ignored when `options` is set. */\n @property() endpoint = \"\";\n /** Query string parameter name the current input text is sent under. */\n @property({ attribute: \"query-param\" }) queryParam = \"q\";\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 * Fixed candidate list to filter locally instead of fetching from\n * `endpoint`. When set (non-null), no network request is ever made —\n * this takes priority over the API mode.\n */\n @property({ attribute: false }) options: AutocompleteOption[] | null = null;\n\n @state() private _suggestions: AutocompleteOption[] = [];\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 #internals = this.attachInternals();\n #lastPicked: AutocompleteOption | null = null;\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 = `autocomplete-input-field-${++instanceCount}`;\n readonly #listboxId = `autocomplete-input-listbox-${instanceCount}`;\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 /** Last-picked option, or null once the input diverges from it. */\n get selectedOption(): AutocompleteOption | null {\n if (this.#lastPicked && this.#lastPicked.value === this.value) return this.#lastPicked;\n return null;\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 if (query.trim().length < this.minLength) {\n this._suggestions = [];\n this._open = false;\n this._activeIndex = -1;\n return;\n }\n if (this.options) {\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.#filterLocalOptions(query), this.debounce);\n return;\n }\n this.#debounceTimer = setTimeout(() => void this.#fetchOptions(query), this.debounce);\n }\n\n /** Filters the locally-supplied `options` list for `query`, case-insensitively. */\n #filterLocalOptions(query: string) {\n const needle = query.trim().toLowerCase();\n this._suggestions = (this.options ?? [])\n .filter((o) => o.value.toLowerCase().includes(needle))\n .slice(0, 5);\n this._activeIndex = -1;\n this._open = !this.#isDisabled;\n }\n\n /** Fetches options for `query` from `endpoint`, cancelling any request still in flight. */\n async #fetchOptions(query: string) {\n this.#abortController?.abort();\n const controller = new AbortController();\n this.#abortController = controller;\n try {\n const res = await fetch(this.#buildUrl(query), { signal: controller.signal });\n if (!res.ok) throw new Error(`autocomplete request failed: ${res.status}`);\n if (this.#isDisabled) return;\n this._suggestions = ((await res.json()) as AutocompleteOption[]).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 #buildUrl(query: string): string {\n const params = new URLSearchParams({ [this.queryParam]: query });\n return `${this.endpoint}?${params.toString()}`;\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.#selectOption(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 #selectOption(o: AutocompleteOption) {\n this.value = o.value;\n this.#lastPicked = o;\n this._open = false;\n this._suggestions = [];\n this.dispatchEvent(new CustomEvent<AutocompleteOption>(\"option-select\", { detail: o, bubbles: true, composed: true }));\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, o: AutocompleteOption) {\n e.preventDefault();\n this.#selectOption(o);\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=\"Suggestions\">\n ${this._suggestions.map(\n (o, i) => 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, o)}\n >\n ${o.icon ? html`<span class=\"suggestion-icon\" aria-hidden=\"true\">${o.icon}</span>` : nothing}\n <span class=\"suggestion-text\">\n <span class=\"suggestion-value\">${o.value}</span>\n ${o.description ? html`<span class=\"suggestion-description\">${o.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 return html`\n <div\n class=\"field-shell ${this.clearable ? \"clearable\" : \"\"} ${floating\n ? \"floating\"\n : \"\"} ${this.value ? \"has-value\" : \"\"} ${this.#isDisabled ? \"disabled\" : \"\"}\"\n >\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=\"Clear input\"\n title=\"Clear input\"\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\ndeclare global {\n interface HTMLElementTagNameMap {\n \"autocomplete-input\": AutocompleteInput;\n }\n}\n"]}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues, type SVGTemplateResult } from "lit";
|
|
2
|
+
import "./icon-button.js";
|
|
3
|
+
import { type DagDirection } from "./utils/dag-layout.js";
|
|
4
|
+
export type { DagDirection } from "./utils/dag-layout.js";
|
|
5
|
+
/** One node of a `dag-graph`. */
|
|
6
|
+
export interface DagNode {
|
|
7
|
+
/** Unique id, referenced by edges and by `selected`. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Text shown on the node; long labels are shortened with an ellipsis (the full text is the tooltip). */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Key into `kinds`, which supplies the node's icon, color, and border style. */
|
|
12
|
+
kind?: string;
|
|
13
|
+
/** Draws the node faded with a dotted border, e.g. for data that is incomplete or unavailable. */
|
|
14
|
+
muted?: boolean;
|
|
15
|
+
/** Emphasizes the node, e.g. as part of a highlighted path or cycle. */
|
|
16
|
+
highlighted?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** One directed edge of a `dag-graph`, pointing from `source` to `target`. */
|
|
19
|
+
export interface DagEdge {
|
|
20
|
+
source: string;
|
|
21
|
+
target: string;
|
|
22
|
+
/** Emphasizes the edge, e.g. as part of a highlighted path or cycle. */
|
|
23
|
+
highlighted?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Presentation of one node kind. */
|
|
26
|
+
export interface DagNodeKind {
|
|
27
|
+
/** Name shown in the legend and appended to the node tooltip. */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** Accent color (any CSS color) for the icon and border; defaults to `--ui-primary`. */
|
|
30
|
+
color?: string;
|
|
31
|
+
/** Icon factory, called with the icon size in pixels — e.g. one of the package's `icon*` exports. */
|
|
32
|
+
icon?: (size: number) => SVGTemplateResult;
|
|
33
|
+
/** Draws the node with a dashed border. */
|
|
34
|
+
dashed?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** A built-in toolbar control: `zoom` (in and out), `fit`, `center` (on the selected node), or `direction`. */
|
|
37
|
+
export type DagControl = "zoom" | "fit" | "center" | "direction";
|
|
38
|
+
/** Detail of the `direction-change` event. */
|
|
39
|
+
export interface DagDirectionChangeDetail {
|
|
40
|
+
direction: DagDirection;
|
|
41
|
+
}
|
|
42
|
+
/** Detail of the `node-select` event. */
|
|
43
|
+
export interface DagNodeSelectDetail {
|
|
44
|
+
id: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Interactive layered drawing of a directed graph — dependencies, pipelines, or any node-link data.
|
|
48
|
+
*
|
|
49
|
+
* Nodes are placed in layers (via dagre) so edges flow left to right (or top to bottom with
|
|
50
|
+
* `direction="TB"`); cycles are allowed, and the edges closing them are drawn dashed and point backward.
|
|
51
|
+
* Each node is a compact card sized to its label, with an optional icon, color, and border style from
|
|
52
|
+
* `kinds`. The whole graph is shown when it fits at a readable zoom; otherwise the selected node is centered at
|
|
53
|
+
* 100%. Drag to pan; pinch or Ctrl/⌘ + wheel to zoom (a plain wheel scrolls the page). With keyboard
|
|
54
|
+
* focus on the graph, arrow keys pan, `+`/`-` zoom, and `0` fits the graph. Clicking a node, or pressing
|
|
55
|
+
* Enter/Space on it, selects it. A toolbar in the top-right corner offers the `controls` you enable.
|
|
56
|
+
*
|
|
57
|
+
* Set `static` to present a fixed picture: the graph is always fitted into view, panning and zooming
|
|
58
|
+
* are off, and the toolbar is hidden; nodes can still be selected.
|
|
59
|
+
*
|
|
60
|
+
* Colors can be changed with these custom properties: `--dag-node-background`, `--dag-node-text`,
|
|
61
|
+
* `--dag-edge-color`, `--dag-selected-color`, and `--dag-highlight-color`; `--dag-graph-height` sets the
|
|
62
|
+
* height (default `24rem`).
|
|
63
|
+
*
|
|
64
|
+
* @element dag-graph
|
|
65
|
+
* @fires node-select - A node was clicked or activated with the keyboard; `detail` is `{ id }`.
|
|
66
|
+
* @fires direction-change - The toolbar's direction control flipped `direction`; `detail` is `{ direction }`.
|
|
67
|
+
* @slot empty - Shown when there are no nodes.
|
|
68
|
+
*/
|
|
69
|
+
export declare class DagGraph extends LitElement {
|
|
70
|
+
/** Nodes to draw. */
|
|
71
|
+
nodes: DagNode[];
|
|
72
|
+
/** Directed edges between `nodes`; edges with an unknown endpoint or to the node itself are ignored. */
|
|
73
|
+
edges: DagEdge[];
|
|
74
|
+
/** Presentation per node `kind`: legend label, color, icon, and border style. */
|
|
75
|
+
kinds: Record<string, DagNodeKind>;
|
|
76
|
+
/**
|
|
77
|
+
* Id of the selected node. Selecting a node updates it; when it changes to a node outside the visible area,
|
|
78
|
+
* the view follows.
|
|
79
|
+
*/
|
|
80
|
+
selected: string | null;
|
|
81
|
+
/** Layer direction: `LR` (left to right) or `TB` (top to bottom). */
|
|
82
|
+
direction: DagDirection;
|
|
83
|
+
/** Accessible name of the graph; the node and edge counts are appended. */
|
|
84
|
+
label: string;
|
|
85
|
+
/** Shows a legend of `kinds` below the graph. */
|
|
86
|
+
legend: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Space-separated toolbar controls to show: any of `zoom`, `fit`, `center`, and `direction`, in that
|
|
89
|
+
* order. An empty value hides the toolbar.
|
|
90
|
+
*/
|
|
91
|
+
controls: string;
|
|
92
|
+
/** Presents a static picture: always fitted, with panning, zooming, and the toolbar turned off. */
|
|
93
|
+
isStatic: boolean;
|
|
94
|
+
private _view;
|
|
95
|
+
private _hovered;
|
|
96
|
+
private _panning;
|
|
97
|
+
private _svg;
|
|
98
|
+
private _layout;
|
|
99
|
+
private _positions;
|
|
100
|
+
private _size;
|
|
101
|
+
private _viewReady;
|
|
102
|
+
private _lastSelected;
|
|
103
|
+
private _lastDirection;
|
|
104
|
+
private _measure;
|
|
105
|
+
private _measureFont;
|
|
106
|
+
private _resizeObserver;
|
|
107
|
+
private _drag;
|
|
108
|
+
private _suppressClick;
|
|
109
|
+
static styles: import("lit").CSSResult[];
|
|
110
|
+
connectedCallback(): void;
|
|
111
|
+
disconnectedCallback(): void;
|
|
112
|
+
protected firstUpdated(): void;
|
|
113
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
114
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
115
|
+
/** Fits the whole graph into view, never enlarging it beyond 100%. */
|
|
116
|
+
fit(): void;
|
|
117
|
+
/** Centers the view on a node (the selected one by default) at 100% zoom. */
|
|
118
|
+
center(id?: string | null): void;
|
|
119
|
+
/** Zooms by `factor` (e.g. `1.25` or `0.8`) around the center of the view. */
|
|
120
|
+
zoomBy(factor: number): void;
|
|
121
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
122
|
+
/** The enabled `controls`, in their fixed order; none in static mode or without nodes. */
|
|
123
|
+
private get _controls();
|
|
124
|
+
private _renderToolbar;
|
|
125
|
+
private _toggleDirection;
|
|
126
|
+
private _renderEdges;
|
|
127
|
+
private _renderNode;
|
|
128
|
+
private _renderLegend;
|
|
129
|
+
private _edgeKey;
|
|
130
|
+
private _layoutChanged;
|
|
131
|
+
/** Lays the graph out again, keeping the selected node where it was on screen. */
|
|
132
|
+
private _relayout;
|
|
133
|
+
private _initView;
|
|
134
|
+
/**
|
|
135
|
+
* Shows the whole graph when it fits at a readable zoom (always, when static); otherwise centers the selected
|
|
136
|
+
* node at 100%.
|
|
137
|
+
*/
|
|
138
|
+
private _frame;
|
|
139
|
+
/** Brings the selected node into view if it is outside the visible area. */
|
|
140
|
+
private _revealSelected;
|
|
141
|
+
/** Measures labels with the host's actual font, so themes with other fonts still size cards correctly. */
|
|
142
|
+
private _updateMeasure;
|
|
143
|
+
private _resize;
|
|
144
|
+
private _clamp;
|
|
145
|
+
private _centerOn;
|
|
146
|
+
private _zoomAround;
|
|
147
|
+
private _activate;
|
|
148
|
+
private _onNodeKey;
|
|
149
|
+
private _onPointerDown;
|
|
150
|
+
private _onPointerMove;
|
|
151
|
+
private _onPointerUp;
|
|
152
|
+
/** Pinch gestures and Ctrl/⌘ + wheel zoom; a plain wheel is left to the page so it can scroll. */
|
|
153
|
+
private _onWheel;
|
|
154
|
+
private _onKeyDown;
|
|
155
|
+
}
|
|
156
|
+
declare global {
|
|
157
|
+
interface HTMLElementTagNameMap {
|
|
158
|
+
"dag-graph": DagGraph;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=dag-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dag-graph.d.ts","sourceRoot":"","sources":["../src/dag-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA2B,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAYvG,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAML,KAAK,YAAY,EAKlB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,iCAAiC;AACjC,MAAM,WAAW,OAAO;IACtB,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KA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