@design.estate/dees-catalog 3.60.0 → 3.61.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.
@@ -156422,7 +156422,25 @@ var demoFunc26 = /* @__PURE__ */ __name(() => b2`
156422
156422
  ></dees-input-list>
156423
156423
  </dees-panel>
156424
156424
 
156425
- <dees-panel .title=${"11. Empty State"} .subtitle=${"How the component looks with no items"}>
156425
+ <dees-panel .title=${"11. Freeform + Candidates"} .subtitle=${"Allow adding items not in the candidate list (shown with a question mark)"}>
156426
+ <dees-input-list
156427
+ .label=${"Tags"}
156428
+ .placeholder=${"Type a tag... (freeform allowed)"}
156429
+ .allowFreeform=${true}
156430
+ .candidates=${[
156431
+ { viewKey: "bug", payload: { color: "red" } },
156432
+ { viewKey: "feature", payload: { color: "blue" } },
156433
+ { viewKey: "docs", payload: { color: "green" } },
156434
+ { viewKey: "refactor", payload: { color: "purple" } },
156435
+ { viewKey: "performance", payload: { color: "orange" } },
156436
+ { viewKey: "security", payload: { color: "red" } }
156437
+ ]}
156438
+ .value=${["bug", "my-custom-tag", "feature"]}
156439
+ .description=${"Known tags get a checkmark, custom tags get a question mark. Tab to complete, Enter to add freeform."}
156440
+ ></dees-input-list>
156441
+ </dees-panel>
156442
+
156443
+ <dees-panel .title=${"12. Empty State"} .subtitle=${"How the component looks with no items"}>
156426
156444
  <dees-input-list
156427
156445
  .label=${"Your Ideas"}
156428
156446
  .placeholder=${"Share your ideas..."}
@@ -156438,9 +156456,9 @@ var demoFunc26 = /* @__PURE__ */ __name(() => b2`
156438
156456
  init_dist_ts30();
156439
156457
  init_dees_icon();
156440
156458
  init_theme();
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;
156459
+ 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, _allowFreeform_dec, _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, _allowFreeform, _validationText3, _inputValue3, _ghostText, _currentCandidateIndex, _editingIndex, _editingValue, _draggedIndex, _dragOverIndex, _dragStartY, _dragCurrentY, _targetIndex, _itemHeight;
156442
156460
  _DeesInputList_decorators = [customElement("dees-input-list")];
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) {
156461
+ 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 })], _allowFreeform_dec = [n5({ type: Boolean })], _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) {
156444
156462
  constructor() {
156445
156463
  super(...arguments);
156446
156464
  __privateAdd(this, _value12, __runInitializers(_init33, 8, this, [])), __runInitializers(_init33, 11, this);
@@ -156451,20 +156469,21 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156451
156469
  __privateAdd(this, _sortable, __runInitializers(_init33, 28, this, false)), __runInitializers(_init33, 31, this);
156452
156470
  __privateAdd(this, _confirmDelete, __runInitializers(_init33, 32, this, false)), __runInitializers(_init33, 35, this);
156453
156471
  __privateAdd(this, _candidates, __runInitializers(_init33, 36, this, [])), __runInitializers(_init33, 39, this);
156454
- __privateAdd(this, _validationText3, __runInitializers(_init33, 40, this, "")), __runInitializers(_init33, 43, this);
156472
+ __privateAdd(this, _allowFreeform, __runInitializers(_init33, 40, this, false)), __runInitializers(_init33, 43, this);
156473
+ __privateAdd(this, _validationText3, __runInitializers(_init33, 44, this, "")), __runInitializers(_init33, 47, this);
156455
156474
  __publicField(this, "addedCandidatesMap", /* @__PURE__ */ new Map());
156456
156475
  __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);
156476
+ __privateAdd(this, _inputValue3, __runInitializers(_init33, 48, this, "")), __runInitializers(_init33, 51, this);
156477
+ __privateAdd(this, _ghostText, __runInitializers(_init33, 52, this, "")), __runInitializers(_init33, 55, this);
156478
+ __privateAdd(this, _currentCandidateIndex, __runInitializers(_init33, 56, this, -1)), __runInitializers(_init33, 59, this);
156479
+ __privateAdd(this, _editingIndex, __runInitializers(_init33, 60, this, -1)), __runInitializers(_init33, 63, this);
156480
+ __privateAdd(this, _editingValue, __runInitializers(_init33, 64, this, "")), __runInitializers(_init33, 67, this);
156481
+ __privateAdd(this, _draggedIndex, __runInitializers(_init33, 68, this, -1)), __runInitializers(_init33, 71, this);
156482
+ __privateAdd(this, _dragOverIndex, __runInitializers(_init33, 72, this, -1)), __runInitializers(_init33, 75, this);
156483
+ __privateAdd(this, _dragStartY, __runInitializers(_init33, 76, this, 0)), __runInitializers(_init33, 79, this);
156484
+ __privateAdd(this, _dragCurrentY, __runInitializers(_init33, 80, this, 0)), __runInitializers(_init33, 83, this);
156485
+ __privateAdd(this, _targetIndex, __runInitializers(_init33, 84, this, -1)), __runInitializers(_init33, 87, this);
156486
+ __privateAdd(this, _itemHeight, __runInitializers(_init33, 88, this, 0)), __runInitializers(_init33, 91, this);
156468
156487
  // Bound event handlers for cleanup
156469
156488
  __publicField(this, "boundHandleGlobalDragOver", null);
156470
156489
  __publicField(this, "boundHandleGlobalDragEnd", null);
@@ -156493,6 +156512,14 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156493
156512
  </div>
156494
156513
  ` : ""}
156495
156514
 
156515
+ ${this.candidates.length > 0 ? b2`
156516
+ ${this.candidates.some((c11) => c11.viewKey === item) ? b2`
156517
+ <dees-icon class="candidate-check" .icon=${"lucide:check"}></dees-icon>
156518
+ ` : b2`
156519
+ <dees-icon class="candidate-unknown" .icon=${"lucide:helpCircle"}></dees-icon>
156520
+ `}
156521
+ ` : ""}
156522
+
156496
156523
  <div class="item-content">
156497
156524
  ${this.editingIndex === index3 ? b2`
156498
156525
  <input
@@ -156631,6 +156658,11 @@ var _DeesInputList = class _DeesInputList extends (_a36 = DeesInputBase, _value_
156631
156658
  );
156632
156659
  if (match2) {
156633
156660
  this.selectCandidate(match2);
156661
+ } else if (this.allowFreeform) {
156662
+ this.ghostText = "";
156663
+ this.currentCandidateIndex = -1;
156664
+ this.matchingCandidates = [];
156665
+ this.addItem();
156634
156666
  }
156635
156667
  return;
156636
156668
  }
@@ -156999,6 +157031,7 @@ _allowDuplicates = new WeakMap();
156999
157031
  _sortable = new WeakMap();
157000
157032
  _confirmDelete = new WeakMap();
157001
157033
  _candidates = new WeakMap();
157034
+ _allowFreeform = new WeakMap();
157002
157035
  _validationText3 = new WeakMap();
157003
157036
  _inputValue3 = new WeakMap();
157004
157037
  _ghostText = new WeakMap();
@@ -157019,6 +157052,7 @@ __decorateElement(_init33, 4, "allowDuplicates", _allowDuplicates_dec, _DeesInpu
157019
157052
  __decorateElement(_init33, 4, "sortable", _sortable_dec, _DeesInputList, _sortable);
157020
157053
  __decorateElement(_init33, 4, "confirmDelete", _confirmDelete_dec, _DeesInputList, _confirmDelete);
157021
157054
  __decorateElement(_init33, 4, "candidates", _candidates_dec, _DeesInputList, _candidates);
157055
+ __decorateElement(_init33, 4, "allowFreeform", _allowFreeform_dec, _DeesInputList, _allowFreeform);
157022
157056
  __decorateElement(_init33, 4, "validationText", _validationText_dec3, _DeesInputList, _validationText3);
157023
157057
  __decorateElement(_init33, 4, "inputValue", _inputValue_dec3, _DeesInputList, _inputValue3);
157024
157058
  __decorateElement(_init33, 4, "ghostText", _ghostText_dec, _DeesInputList, _ghostText);
@@ -157119,6 +157153,20 @@ __publicField(_DeesInputList, "styles", [
157119
157153
  }
157120
157154
 
157121
157155
 
157156
+ .candidate-check {
157157
+ width: 14px;
157158
+ height: 14px;
157159
+ color: ${cssManager.bdTheme("hsl(142.1 76.2% 36.3%)", "hsl(142.1 70.6% 45.3%)")};
157160
+ flex-shrink: 0;
157161
+ }
157162
+
157163
+ .candidate-unknown {
157164
+ width: 14px;
157165
+ height: 14px;
157166
+ color: ${cssManager.bdTheme("hsl(45 93% 47%)", "hsl(45 93% 58%)")};
157167
+ flex-shrink: 0;
157168
+ }
157169
+
157122
157170
  .drag-handle {
157123
157171
  display: flex;
157124
157172
  align-items: center;