@design.estate/dees-catalog 3.59.0 → 3.60.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.
@@ -156362,7 +156362,67 @@ var demoFunc26 = /* @__PURE__ */ __name(() => b2`
156362
156362
  ></dees-input-list>
156363
156363
  </dees-panel>
156364
156364
 
156365
- <dees-panel .title=${"9. Empty State"} .subtitle=${"How the component looks with no items"}>
156365
+ <dees-panel .title=${"9. Candidates with Tab Completion"} .subtitle=${"Terminal-style autocomplete \u2014 Tab accepts, Shift+Tab cycles"}>
156366
+ <div class="grid-layout">
156367
+ <dees-input-list
156368
+ id="candidate-list"
156369
+ .label=${"Assign Team Members"}
156370
+ .placeholder=${"Type a name... (Tab to complete)"}
156371
+ .candidates=${[
156372
+ { viewKey: "Alice Smith", payload: { id: 1, role: "Engineer", department: "Frontend" } },
156373
+ { viewKey: "Bob Johnson", payload: { id: 2, role: "Designer", department: "UX" } },
156374
+ { viewKey: "Carol Williams", payload: { id: 3, role: "Product Manager", department: "Product" } },
156375
+ { viewKey: "David Brown", payload: { id: 4, role: "Engineer", department: "Backend" } },
156376
+ { viewKey: "Eve Davis", payload: { id: 5, role: "QA Engineer", department: "Quality" } },
156377
+ { viewKey: "Frank Miller", payload: { id: 6, role: "DevOps", department: "Infrastructure" } },
156378
+ { viewKey: "Grace Wilson", payload: { id: 7, role: "Designer", department: "UX" } },
156379
+ { viewKey: "Henry Moore", payload: { id: 8, role: "Engineer", department: "Frontend" } }
156380
+ ]}
156381
+ .value=${["Alice Smith", "Carol Williams"]}
156382
+ .maxItems=${5}
156383
+ .description=${"Type to see ghost completion. Tab to accept, Shift+Tab to cycle, Enter to add."}
156384
+ @change=${(e11) => {
156385
+ const preview = document.querySelector("#candidate-json");
156386
+ if (preview) {
156387
+ const list5 = e11.target;
156388
+ const candidates = list5.getAddedCandidates();
156389
+ preview.textContent = JSON.stringify(candidates, null, 2);
156390
+ }
156391
+ }}
156392
+ ></dees-input-list>
156393
+
156394
+ <div>
156395
+ <div style="font-size: 13px; font-weight: 500; margin-bottom: 8px; color: inherit;">Selected Candidates (with payloads)</div>
156396
+ <div class="output-preview" id="candidate-json">[]</div>
156397
+ <div class="feature-note">
156398
+ Try typing "D" — ghost text shows "avid Brown". Press Shift+Tab to cycle to other D-matches. Tab accepts, Enter adds.
156399
+ </div>
156400
+ </div>
156401
+ </div>
156402
+ </dees-panel>
156403
+
156404
+ <dees-panel .title=${"10. Technology Stack"} .subtitle=${"Larger candidate pool with Shift+Tab cycling"}>
156405
+ <dees-input-list
156406
+ .label=${"Select Technologies"}
156407
+ .placeholder=${"Type to autocomplete..."}
156408
+ .candidates=${[
156409
+ { viewKey: "TypeScript", payload: { category: "language" } },
156410
+ { viewKey: "React", payload: { category: "framework" } },
156411
+ { viewKey: "Vue.js", payload: { category: "framework" } },
156412
+ { viewKey: "Angular", payload: { category: "framework" } },
156413
+ { viewKey: "Node.js", payload: { category: "runtime" } },
156414
+ { viewKey: "Deno", payload: { category: "runtime" } },
156415
+ { viewKey: "Docker", payload: { category: "devops" } },
156416
+ { viewKey: "PostgreSQL", payload: { category: "database" } },
156417
+ { viewKey: "MongoDB", payload: { category: "database" } },
156418
+ { viewKey: "Redis", payload: { category: "database" } },
156419
+ { viewKey: "Kubernetes", payload: { category: "devops" } }
156420
+ ]}
156421
+ .description=${'Try "D" \u2014 cycles through Deno/Docker. "R" \u2014 cycles through React/Redis.'}
156422
+ ></dees-input-list>
156423
+ </dees-panel>
156424
+
156425
+ <dees-panel .title=${"11. Empty State"} .subtitle=${"How the component looks with no items"}>
156366
156426
  <dees-input-list
156367
156427
  .label=${"Your Ideas"}
156368
156428
  .placeholder=${"Share your ideas..."}
@@ -156378,9 +156438,9 @@ var demoFunc26 = /* @__PURE__ */ __name(() => b2`
156378
156438
  init_dist_ts30();
156379
156439
  init_dees_icon();
156380
156440
  init_theme();
156381
- var _itemHeight_dec, _targetIndex_dec, _dragCurrentY_dec, _dragStartY_dec, _dragOverIndex_dec, _draggedIndex_dec, _editingValue_dec, _editingIndex_dec, _inputValue_dec3, _validationText_dec3, _confirmDelete_dec, _sortable_dec, _allowDuplicates_dec, _minItems_dec, _maxItems_dec, _placeholder_dec4, _value_dec12, _a36, _DeesInputList_decorators, _init33, _value12, _placeholder4, _maxItems, _minItems, _allowDuplicates, _sortable, _confirmDelete, _validationText3, _inputValue3, _editingIndex, _editingValue, _draggedIndex, _dragOverIndex, _dragStartY, _dragCurrentY, _targetIndex, _itemHeight;
156441
+ var _itemHeight_dec, _targetIndex_dec, _dragCurrentY_dec, _dragStartY_dec, _dragOverIndex_dec, _draggedIndex_dec, _editingValue_dec, _editingIndex_dec, _currentCandidateIndex_dec, _ghostText_dec, _inputValue_dec3, _validationText_dec3, _candidates_dec, _confirmDelete_dec, _sortable_dec, _allowDuplicates_dec, _minItems_dec, _maxItems_dec, _placeholder_dec4, _value_dec12, _a36, _DeesInputList_decorators, _init33, _value12, _placeholder4, _maxItems, _minItems, _allowDuplicates, _sortable, _confirmDelete, _candidates, _validationText3, _inputValue3, _ghostText, _currentCandidateIndex, _editingIndex, _editingValue, _draggedIndex, _dragOverIndex, _dragStartY, _dragCurrentY, _targetIndex, _itemHeight;
156382
156442
  _DeesInputList_decorators = [customElement("dees-input-list")];
156383
- var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_dec12 = [n5({ type: Array })], _placeholder_dec4 = [n5({ type: String })], _maxItems_dec = [n5({ type: Number })], _minItems_dec = [n5({ type: Number })], _allowDuplicates_dec = [n5({ type: Boolean })], _sortable_dec = [n5({ type: Boolean })], _confirmDelete_dec = [n5({ type: Boolean })], _validationText_dec3 = [n5({ type: String })], _inputValue_dec3 = [r5()], _editingIndex_dec = [r5()], _editingValue_dec = [r5()], _draggedIndex_dec = [r5()], _dragOverIndex_dec = [r5()], _dragStartY_dec = [r5()], _dragCurrentY_dec = [r5()], _targetIndex_dec = [r5()], _itemHeight_dec = [r5()], _a36) {
156443
+ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_dec12 = [n5({ type: Array })], _placeholder_dec4 = [n5({ type: String })], _maxItems_dec = [n5({ type: Number })], _minItems_dec = [n5({ type: Number })], _allowDuplicates_dec = [n5({ type: Boolean })], _sortable_dec = [n5({ type: Boolean })], _confirmDelete_dec = [n5({ type: Boolean })], _candidates_dec = [n5({ type: Array })], _validationText_dec3 = [n5({ type: String })], _inputValue_dec3 = [r5()], _ghostText_dec = [r5()], _currentCandidateIndex_dec = [r5()], _editingIndex_dec = [r5()], _editingValue_dec = [r5()], _draggedIndex_dec = [r5()], _dragOverIndex_dec = [r5()], _dragStartY_dec = [r5()], _dragCurrentY_dec = [r5()], _targetIndex_dec = [r5()], _itemHeight_dec = [r5()], _a36) {
156384
156444
  constructor() {
156385
156445
  super(...arguments);
156386
156446
  __privateAdd(this, _value12, __runInitializers(_init33, 8, this, [])), __runInitializers(_init33, 11, this);
@@ -156390,16 +156450,21 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156390
156450
  __privateAdd(this, _allowDuplicates, __runInitializers(_init33, 24, this, false)), __runInitializers(_init33, 27, this);
156391
156451
  __privateAdd(this, _sortable, __runInitializers(_init33, 28, this, false)), __runInitializers(_init33, 31, this);
156392
156452
  __privateAdd(this, _confirmDelete, __runInitializers(_init33, 32, this, false)), __runInitializers(_init33, 35, this);
156393
- __privateAdd(this, _validationText3, __runInitializers(_init33, 36, this, "")), __runInitializers(_init33, 39, this);
156394
- __privateAdd(this, _inputValue3, __runInitializers(_init33, 40, this, "")), __runInitializers(_init33, 43, this);
156395
- __privateAdd(this, _editingIndex, __runInitializers(_init33, 44, this, -1)), __runInitializers(_init33, 47, this);
156396
- __privateAdd(this, _editingValue, __runInitializers(_init33, 48, this, "")), __runInitializers(_init33, 51, this);
156397
- __privateAdd(this, _draggedIndex, __runInitializers(_init33, 52, this, -1)), __runInitializers(_init33, 55, this);
156398
- __privateAdd(this, _dragOverIndex, __runInitializers(_init33, 56, this, -1)), __runInitializers(_init33, 59, this);
156399
- __privateAdd(this, _dragStartY, __runInitializers(_init33, 60, this, 0)), __runInitializers(_init33, 63, this);
156400
- __privateAdd(this, _dragCurrentY, __runInitializers(_init33, 64, this, 0)), __runInitializers(_init33, 67, this);
156401
- __privateAdd(this, _targetIndex, __runInitializers(_init33, 68, this, -1)), __runInitializers(_init33, 71, this);
156402
- __privateAdd(this, _itemHeight, __runInitializers(_init33, 72, this, 0)), __runInitializers(_init33, 75, this);
156453
+ __privateAdd(this, _candidates, __runInitializers(_init33, 36, this, [])), __runInitializers(_init33, 39, this);
156454
+ __privateAdd(this, _validationText3, __runInitializers(_init33, 40, this, "")), __runInitializers(_init33, 43, this);
156455
+ __publicField(this, "addedCandidatesMap", /* @__PURE__ */ new Map());
156456
+ __publicField(this, "matchingCandidates", []);
156457
+ __privateAdd(this, _inputValue3, __runInitializers(_init33, 44, this, "")), __runInitializers(_init33, 47, this);
156458
+ __privateAdd(this, _ghostText, __runInitializers(_init33, 48, this, "")), __runInitializers(_init33, 51, this);
156459
+ __privateAdd(this, _currentCandidateIndex, __runInitializers(_init33, 52, this, -1)), __runInitializers(_init33, 55, this);
156460
+ __privateAdd(this, _editingIndex, __runInitializers(_init33, 56, this, -1)), __runInitializers(_init33, 59, this);
156461
+ __privateAdd(this, _editingValue, __runInitializers(_init33, 60, this, "")), __runInitializers(_init33, 63, this);
156462
+ __privateAdd(this, _draggedIndex, __runInitializers(_init33, 64, this, -1)), __runInitializers(_init33, 67, this);
156463
+ __privateAdd(this, _dragOverIndex, __runInitializers(_init33, 68, this, -1)), __runInitializers(_init33, 71, this);
156464
+ __privateAdd(this, _dragStartY, __runInitializers(_init33, 72, this, 0)), __runInitializers(_init33, 75, this);
156465
+ __privateAdd(this, _dragCurrentY, __runInitializers(_init33, 76, this, 0)), __runInitializers(_init33, 79, this);
156466
+ __privateAdd(this, _targetIndex, __runInitializers(_init33, 80, this, -1)), __runInitializers(_init33, 83, this);
156467
+ __privateAdd(this, _itemHeight, __runInitializers(_init33, 84, this, 0)), __runInitializers(_init33, 87, this);
156403
156468
  // Bound event handlers for cleanup
156404
156469
  __publicField(this, "boundHandleGlobalDragOver", null);
156405
156470
  __publicField(this, "boundHandleGlobalDragEnd", null);
@@ -156474,15 +156539,22 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156474
156539
 
156475
156540
  ${!this.disabled && (!this.maxItems || this.value.length < this.maxItems) ? b2`
156476
156541
  <div class="add-item-container">
156477
- <input
156478
- type="text"
156479
- class="add-input"
156480
- .placeholder=${this.placeholder}
156481
- .value=${this.inputValue}
156482
- @input=${this.handleInput}
156483
- @keydown=${this.handleAddKeyDown}
156484
- ?disabled=${this.disabled}
156485
- />
156542
+ <div class="autocomplete-wrapper">
156543
+ ${this.ghostText ? b2`
156544
+ <span class="ghost-text">
156545
+ <span class="ghost-typed">${this.inputValue}</span><span class="ghost-completion">${this.ghostText}</span>
156546
+ </span>
156547
+ ` : ""}
156548
+ <input
156549
+ type="text"
156550
+ class="add-input"
156551
+ .placeholder=${this.placeholder}
156552
+ .value=${this.inputValue}
156553
+ @input=${this.handleInput}
156554
+ @keydown=${this.handleAddKeyDown}
156555
+ ?disabled=${this.disabled}
156556
+ />
156557
+ </div>
156486
156558
  <button
156487
156559
  class="add-button"
156488
156560
  @click=${this.addItem}
@@ -156506,10 +156578,62 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156506
156578
  }
156507
156579
  handleInput(e11) {
156508
156580
  this.inputValue = e11.target.value;
156581
+ this.updateGhostText();
156582
+ }
156583
+ updateGhostText() {
156584
+ if (this.candidates.length === 0 || !this.inputValue) {
156585
+ this.ghostText = "";
156586
+ this.currentCandidateIndex = -1;
156587
+ this.matchingCandidates = [];
156588
+ return;
156589
+ }
156590
+ const search2 = this.inputValue.toLowerCase();
156591
+ this.matchingCandidates = this.candidates.filter((c11) => {
156592
+ if (this.value.includes(c11.viewKey)) return false;
156593
+ return c11.viewKey.toLowerCase().startsWith(search2);
156594
+ }).sort((a5, b5) => a5.viewKey.length - b5.viewKey.length);
156595
+ if (this.matchingCandidates.length > 0) {
156596
+ this.currentCandidateIndex = 0;
156597
+ this.ghostText = this.matchingCandidates[0].viewKey.slice(this.inputValue.length);
156598
+ } else {
156599
+ this.currentCandidateIndex = -1;
156600
+ this.ghostText = "";
156601
+ }
156509
156602
  }
156510
156603
  handleAddKeyDown(e11) {
156604
+ if (e11.key === "Tab" && this.candidates.length > 0 && this.inputValue) {
156605
+ e11.preventDefault();
156606
+ if (e11.shiftKey && this.matchingCandidates.length > 0) {
156607
+ this.currentCandidateIndex = (this.currentCandidateIndex + 1) % this.matchingCandidates.length;
156608
+ const candidate = this.matchingCandidates[this.currentCandidateIndex];
156609
+ this.ghostText = candidate.viewKey.slice(this.inputValue.length);
156610
+ } else if (!e11.shiftKey && this.ghostText && this.matchingCandidates.length > 0) {
156611
+ const candidate = this.matchingCandidates[this.currentCandidateIndex];
156612
+ this.inputValue = candidate.viewKey;
156613
+ this.ghostText = "";
156614
+ const input = this.shadowRoot?.querySelector(".add-input");
156615
+ if (input) input.value = candidate.viewKey;
156616
+ }
156617
+ return;
156618
+ }
156619
+ if (e11.key === "Escape" && this.ghostText) {
156620
+ e11.preventDefault();
156621
+ this.ghostText = "";
156622
+ this.currentCandidateIndex = -1;
156623
+ this.matchingCandidates = [];
156624
+ return;
156625
+ }
156511
156626
  if (e11.key === "Enter" && this.inputValue.trim()) {
156512
156627
  e11.preventDefault();
156628
+ if (this.candidates.length > 0) {
156629
+ const match2 = this.candidates.find(
156630
+ (c11) => c11.viewKey.toLowerCase() === this.inputValue.trim().toLowerCase()
156631
+ );
156632
+ if (match2) {
156633
+ this.selectCandidate(match2);
156634
+ }
156635
+ return;
156636
+ }
156513
156637
  this.addItem();
156514
156638
  }
156515
156639
  }
@@ -156522,6 +156646,44 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156522
156646
  this.cancelEdit();
156523
156647
  }
156524
156648
  }
156649
+ selectCandidate(candidate) {
156650
+ if (this.maxItems && this.value.length >= this.maxItems) {
156651
+ this.validationText = `Maximum ${this.maxItems} items allowed`;
156652
+ setTimeout(() => this.validationText = "", 3e3);
156653
+ return;
156654
+ }
156655
+ if (!this.allowDuplicates && this.value.includes(candidate.viewKey)) {
156656
+ this.validationText = "This item already exists in the list";
156657
+ setTimeout(() => this.validationText = "", 3e3);
156658
+ return;
156659
+ }
156660
+ this.addedCandidatesMap.set(candidate.viewKey, candidate);
156661
+ this.value = [...this.value, candidate.viewKey];
156662
+ this.inputValue = "";
156663
+ this.ghostText = "";
156664
+ this.currentCandidateIndex = -1;
156665
+ this.matchingCandidates = [];
156666
+ this.validationText = "";
156667
+ const input = this.shadowRoot?.querySelector(".add-input");
156668
+ if (input) {
156669
+ input.value = "";
156670
+ input.focus();
156671
+ }
156672
+ this.emitChange();
156673
+ }
156674
+ /**
156675
+ * Get the full candidate object for an item by its viewKey.
156676
+ * Returns undefined if the item was added as a plain string.
156677
+ */
156678
+ getCandidateForItem(viewKey) {
156679
+ return this.addedCandidatesMap.get(viewKey);
156680
+ }
156681
+ /**
156682
+ * Get all added candidates with their payloads.
156683
+ */
156684
+ getAddedCandidates() {
156685
+ return this.value.map((v5) => this.addedCandidatesMap.get(v5)).filter((c11) => c11 !== void 0);
156686
+ }
156525
156687
  addItem() {
156526
156688
  const trimmedValue = this.inputValue.trim();
156527
156689
  if (!trimmedValue) return;
@@ -156584,6 +156746,8 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156584
156746
  const confirmed = await this.showConfirmDialog(`Delete "${this.value[index3]}"?`);
156585
156747
  if (!confirmed) return;
156586
156748
  }
156749
+ const removedKey = this.value[index3];
156750
+ this.addedCandidatesMap.delete(removedKey);
156587
156751
  this.value = this.value.filter((_4, i11) => i11 !== index3);
156588
156752
  this.emitChange();
156589
156753
  }
@@ -156834,8 +156998,11 @@ _minItems = new WeakMap();
156834
156998
  _allowDuplicates = new WeakMap();
156835
156999
  _sortable = new WeakMap();
156836
157000
  _confirmDelete = new WeakMap();
157001
+ _candidates = new WeakMap();
156837
157002
  _validationText3 = new WeakMap();
156838
157003
  _inputValue3 = new WeakMap();
157004
+ _ghostText = new WeakMap();
157005
+ _currentCandidateIndex = new WeakMap();
156839
157006
  _editingIndex = new WeakMap();
156840
157007
  _editingValue = new WeakMap();
156841
157008
  _draggedIndex = new WeakMap();
@@ -156851,8 +157018,11 @@ __decorateElement(_init33, 4, "minItems", _minItems_dec, _DeesInputList, _minIte
156851
157018
  __decorateElement(_init33, 4, "allowDuplicates", _allowDuplicates_dec, _DeesInputList, _allowDuplicates);
156852
157019
  __decorateElement(_init33, 4, "sortable", _sortable_dec, _DeesInputList, _sortable);
156853
157020
  __decorateElement(_init33, 4, "confirmDelete", _confirmDelete_dec, _DeesInputList, _confirmDelete);
157021
+ __decorateElement(_init33, 4, "candidates", _candidates_dec, _DeesInputList, _candidates);
156854
157022
  __decorateElement(_init33, 4, "validationText", _validationText_dec3, _DeesInputList, _validationText3);
156855
157023
  __decorateElement(_init33, 4, "inputValue", _inputValue_dec3, _DeesInputList, _inputValue3);
157024
+ __decorateElement(_init33, 4, "ghostText", _ghostText_dec, _DeesInputList, _ghostText);
157025
+ __decorateElement(_init33, 4, "currentCandidateIndex", _currentCandidateIndex_dec, _DeesInputList, _currentCandidateIndex);
156856
157026
  __decorateElement(_init33, 4, "editingIndex", _editingIndex_dec, _DeesInputList, _editingIndex);
156857
157027
  __decorateElement(_init33, 4, "editingValue", _editingValue_dec, _DeesInputList, _editingValue);
156858
157028
  __decorateElement(_init33, 4, "draggedIndex", _draggedIndex_dec, _DeesInputList, _draggedIndex);
@@ -157056,7 +157226,7 @@ __publicField(_DeesInputList, "styles", [
157056
157226
  }
157057
157227
 
157058
157228
  .add-input {
157059
- flex: 1;
157229
+ width: 100%;
157060
157230
  padding: 4px 8px;
157061
157231
  font-size: 13px;
157062
157232
  line-height: 18px;
@@ -157150,6 +157320,38 @@ __publicField(_DeesInputList, "styles", [
157150
157320
  .list-items.dropping .list-item {
157151
157321
  transition: none !important;
157152
157322
  }
157323
+
157324
+ /* ── Terminal-style inline autocomplete ── */
157325
+ .autocomplete-wrapper {
157326
+ position: relative;
157327
+ flex: 1;
157328
+ min-width: 0;
157329
+ overflow: hidden;
157330
+ }
157331
+
157332
+ .ghost-text {
157333
+ position: absolute;
157334
+ top: 0;
157335
+ left: 0;
157336
+ right: 0;
157337
+ bottom: 0;
157338
+ padding: 4px 8px;
157339
+ font-size: 13px;
157340
+ line-height: 18px;
157341
+ font-family: inherit;
157342
+ white-space: nowrap;
157343
+ pointer-events: none;
157344
+ overflow: hidden;
157345
+ }
157346
+
157347
+ .ghost-typed {
157348
+ visibility: hidden;
157349
+ }
157350
+
157351
+ .ghost-completion {
157352
+ color: ${cssManager.bdTheme("hsl(0 0% 63.9%)", "hsl(0 0% 45.1%)")};
157353
+ opacity: 0.5;
157354
+ }
157153
157355
  `
157154
157356
  ]);
157155
157357
  __runInitializers(_init33, 1, _DeesInputList);