@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.
- package/dist_bundle/bundle.js +65 -17
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-input/dees-input-list/dees-input-list.d.ts +1 -0
- package/dist_ts_web/elements/00group-input/dees-input-list/dees-input-list.demo.js +20 -2
- package/dist_ts_web/elements/00group-input/dees-input-list/dees-input-list.js +40 -3
- package/dist_watch/bundle.js +63 -15
- package/dist_watch/bundle.js.map +3 -3
- package/package.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-input/dees-input-list/dees-input-list.demo.ts +19 -1
- package/ts_web/elements/00group-input/dees-input-list/dees-input-list.ts +32 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-catalog",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.61.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
|
6
6
|
"main": "dist_ts_web/index.js",
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-catalog',
|
|
6
|
-
version: '3.
|
|
6
|
+
version: '3.61.0',
|
|
7
7
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
|
8
8
|
}
|
|
@@ -322,7 +322,25 @@ export const demoFunc = () => html`
|
|
|
322
322
|
></dees-input-list>
|
|
323
323
|
</dees-panel>
|
|
324
324
|
|
|
325
|
-
<dees-panel .title=${'11.
|
|
325
|
+
<dees-panel .title=${'11. Freeform + Candidates'} .subtitle=${'Allow adding items not in the candidate list (shown with a question mark)'}>
|
|
326
|
+
<dees-input-list
|
|
327
|
+
.label=${'Tags'}
|
|
328
|
+
.placeholder=${'Type a tag... (freeform allowed)'}
|
|
329
|
+
.allowFreeform=${true}
|
|
330
|
+
.candidates=${[
|
|
331
|
+
{ viewKey: 'bug', payload: { color: 'red' } },
|
|
332
|
+
{ viewKey: 'feature', payload: { color: 'blue' } },
|
|
333
|
+
{ viewKey: 'docs', payload: { color: 'green' } },
|
|
334
|
+
{ viewKey: 'refactor', payload: { color: 'purple' } },
|
|
335
|
+
{ viewKey: 'performance', payload: { color: 'orange' } },
|
|
336
|
+
{ viewKey: 'security', payload: { color: 'red' } },
|
|
337
|
+
]}
|
|
338
|
+
.value=${['bug', 'my-custom-tag', 'feature']}
|
|
339
|
+
.description=${'Known tags get a checkmark, custom tags get a question mark. Tab to complete, Enter to add freeform.'}
|
|
340
|
+
></dees-input-list>
|
|
341
|
+
</dees-panel>
|
|
342
|
+
|
|
343
|
+
<dees-panel .title=${'12. Empty State'} .subtitle=${'How the component looks with no items'}>
|
|
326
344
|
<dees-input-list
|
|
327
345
|
.label=${'Your Ideas'}
|
|
328
346
|
.placeholder=${'Share your ideas...'}
|
|
@@ -54,6 +54,9 @@ export class DeesInputList extends DeesInputBase<DeesInputList> {
|
|
|
54
54
|
@property({ type: Array })
|
|
55
55
|
accessor candidates: IListCandidate[] = [];
|
|
56
56
|
|
|
57
|
+
@property({ type: Boolean })
|
|
58
|
+
accessor allowFreeform: boolean = false;
|
|
59
|
+
|
|
57
60
|
@property({ type: String })
|
|
58
61
|
accessor validationText: string = '';
|
|
59
62
|
|
|
@@ -184,6 +187,20 @@ export class DeesInputList extends DeesInputBase<DeesInputList> {
|
|
|
184
187
|
}
|
|
185
188
|
|
|
186
189
|
|
|
190
|
+
.candidate-check {
|
|
191
|
+
width: 14px;
|
|
192
|
+
height: 14px;
|
|
193
|
+
color: ${cssManager.bdTheme('hsl(142.1 76.2% 36.3%)', 'hsl(142.1 70.6% 45.3%)')};
|
|
194
|
+
flex-shrink: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.candidate-unknown {
|
|
198
|
+
width: 14px;
|
|
199
|
+
height: 14px;
|
|
200
|
+
color: ${cssManager.bdTheme('hsl(45 93% 47%)', 'hsl(45 93% 58%)')};
|
|
201
|
+
flex-shrink: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
187
204
|
.drag-handle {
|
|
188
205
|
display: flex;
|
|
189
206
|
align-items: center;
|
|
@@ -442,6 +459,14 @@ export class DeesInputList extends DeesInputBase<DeesInputList> {
|
|
|
442
459
|
</div>
|
|
443
460
|
` : ''}
|
|
444
461
|
|
|
462
|
+
${this.candidates.length > 0 ? html`
|
|
463
|
+
${this.candidates.some(c => c.viewKey === item) ? html`
|
|
464
|
+
<dees-icon class="candidate-check" .icon=${'lucide:check'}></dees-icon>
|
|
465
|
+
` : html`
|
|
466
|
+
<dees-icon class="candidate-unknown" .icon=${'lucide:helpCircle'}></dees-icon>
|
|
467
|
+
`}
|
|
468
|
+
` : ''}
|
|
469
|
+
|
|
445
470
|
<div class="item-content">
|
|
446
471
|
${this.editingIndex === index ? html`
|
|
447
472
|
<input
|
|
@@ -589,12 +614,18 @@ export class DeesInputList extends DeesInputBase<DeesInputList> {
|
|
|
589
614
|
if (e.key === 'Enter' && this.inputValue.trim()) {
|
|
590
615
|
e.preventDefault();
|
|
591
616
|
if (this.candidates.length > 0) {
|
|
592
|
-
//
|
|
617
|
+
// Try exact candidate match first
|
|
593
618
|
const match = this.candidates.find(
|
|
594
619
|
c => c.viewKey.toLowerCase() === this.inputValue.trim().toLowerCase()
|
|
595
620
|
);
|
|
596
621
|
if (match) {
|
|
597
622
|
this.selectCandidate(match);
|
|
623
|
+
} else if (this.allowFreeform) {
|
|
624
|
+
// Allow freeform entry (won't have a candidate checkmark)
|
|
625
|
+
this.ghostText = '';
|
|
626
|
+
this.currentCandidateIndex = -1;
|
|
627
|
+
this.matchingCandidates = [];
|
|
628
|
+
this.addItem();
|
|
598
629
|
}
|
|
599
630
|
return;
|
|
600
631
|
}
|