diff --git a/changelog.md b/changelog.md index 40b5ec5..d9f5d9a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-04-05 - 3.60.0 - feat(dees-input-list) +add candidate autocomplete with tab completion and payload retrieval + +- Adds terminal-style inline autocomplete with ghost text, Tab accept, Shift+Tab cycling, and Escape clearing for candidate-based input. +- Introduces candidate payload support with APIs to retrieve selected candidate objects after items are added. +- Updates the dees-input-list demo with candidate selection examples for team members and technology stacks. + ## 2026-04-05 - 3.59.1 - fix(project) no changes to commit diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 288a7c1..0436c01 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@design.estate/dees-catalog', - version: '3.59.1', + version: '3.60.0', description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.' } diff --git a/ts_web/elements/00group-input/dees-input-list/dees-input-list.demo.ts b/ts_web/elements/00group-input/dees-input-list/dees-input-list.demo.ts index 3d2ae96..26c4a0a 100644 --- a/ts_web/elements/00group-input/dees-input-list/dees-input-list.demo.ts +++ b/ts_web/elements/00group-input/dees-input-list/dees-input-list.demo.ts @@ -262,7 +262,67 @@ export const demoFunc = () => html` > - + +
+ { + const preview = document.querySelector('#candidate-json'); + if (preview) { + const list = (e.target as any); + const candidates = list.getAddedCandidates(); + preview.textContent = JSON.stringify(candidates, null, 2); + } + }} + > + +
+
Selected Candidates (with payloads)
+
[]
+
+ Try typing "D" — ghost text shows "avid Brown". Press Shift+Tab to cycle to other D-matches. Tab accepts, Enter adds. +
+
+
+
+ + + + + + { @property({ type: Boolean }) accessor confirmDelete: boolean = false; + @property({ type: Array }) + accessor candidates: IListCandidate[] = []; + @property({ type: String }) accessor validationText: string = ''; + private addedCandidatesMap: Map = new Map(); + private matchingCandidates: IListCandidate[] = []; + @state() accessor inputValue: string = ''; + @state() + accessor ghostText: string = ''; + + @state() + accessor currentCandidateIndex: number = -1; + @state() accessor editingIndex: number = -1; @@ -274,7 +291,7 @@ export class DeesInputList extends DeesInputBase { } .add-input { - flex: 1; + width: 100%; padding: 4px 8px; font-size: 13px; line-height: 18px; @@ -368,6 +385,38 @@ export class DeesInputList extends DeesInputBase { .list-items.dropping .list-item { transition: none !important; } + + /* ── Terminal-style inline autocomplete ── */ + .autocomplete-wrapper { + position: relative; + flex: 1; + min-width: 0; + overflow: hidden; + } + + .ghost-text { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + padding: 4px 8px; + font-size: 13px; + line-height: 18px; + font-family: inherit; + white-space: nowrap; + pointer-events: none; + overflow: hidden; + } + + .ghost-typed { + visibility: hidden; + } + + .ghost-completion { + color: ${cssManager.bdTheme('hsl(0 0% 63.9%)', 'hsl(0 0% 45.1%)')}; + opacity: 0.5; + } `, ]; @@ -439,15 +488,22 @@ export class DeesInputList extends DeesInputBase { ${!this.disabled && (!this.maxItems || this.value.length < this.maxItems) ? html`
- +
+ ${this.ghostText ? html` + + ${this.inputValue}${this.ghostText} + + ` : ''} + +