@triptease/tt-combobox 5.3.1 → 5.4.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.
@@ -2,6 +2,321 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "stories/combobox.stories.ts",
8
+ "declarations": [
9
+ {
10
+ "kind": "variable",
11
+ "name": "meta",
12
+ "type": {
13
+ "text": "object"
14
+ },
15
+ "default": "{ title: 'ComboBox', component: 'tt-combobox', argTypes: { label: { control: 'text' }, id: { control: 'text' }, 'display-select-all': { control: 'boolean' }, 'select-all-placeholder': { control: 'text' }, options: { control: 'object' } }, tags: ['autodocs'] }"
16
+ },
17
+ {
18
+ "kind": "variable",
19
+ "name": "SingleSelect"
20
+ },
21
+ {
22
+ "kind": "function",
23
+ "name": "SingleSelectWithDefault",
24
+ "parameters": [
25
+ {
26
+ "name": "{\n label = 'With default options',\n id = 'combobox-13',\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n value = '0'\n }"
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "kind": "variable",
32
+ "name": "MultiSelect"
33
+ },
34
+ {
35
+ "kind": "variable",
36
+ "name": "MultiSelectSelectAll"
37
+ },
38
+ {
39
+ "kind": "variable",
40
+ "name": "WithStyles"
41
+ },
42
+ {
43
+ "kind": "function",
44
+ "name": "WithCustomOptionStyle",
45
+ "parameters": [
46
+ {
47
+ "name": "{\n label = 'Test label',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ "kind": "function",
53
+ "name": "WithIcon",
54
+ "parameters": [
55
+ {
56
+ "name": "{\n label = 'With icon',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "kind": "function",
62
+ "name": "HiddenCaret",
63
+ "parameters": [
64
+ {
65
+ "name": "{\n label = 'With hidden caret',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "kind": "function",
71
+ "name": "WithError",
72
+ "parameters": [
73
+ {
74
+ "name": "{\n label = 'With error',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "kind": "function",
80
+ "name": "WithOptionDisabled",
81
+ "parameters": [
82
+ {
83
+ "name": "{\n label = 'With option disabled',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "kind": "function",
89
+ "name": "DisabledComboBox",
90
+ "parameters": [
91
+ {
92
+ "name": "{\n label = 'Disabled selector',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "kind": "function",
98
+ "name": "InsideForm",
99
+ "parameters": [
100
+ {
101
+ "name": "{\n label = 'Combobox submitted inside a form',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "kind": "function",
107
+ "name": "WithAriaLabel",
108
+ "parameters": [
109
+ {
110
+ "name": "{\n label = 'This label is only visible for screen readers, use with caution',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "kind": "function",
116
+ "name": "WithRequired",
117
+ "parameters": [
118
+ {
119
+ "name": "{\n label = 'Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "kind": "function",
125
+ "name": "MultiSelectWithRequired",
126
+ "parameters": [
127
+ {
128
+ "name": "{\n label = 'MultiSelect Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "kind": "variable",
134
+ "name": "WithCustomPlaceholder"
135
+ },
136
+ {
137
+ "kind": "variable",
138
+ "name": "WithHiddenOptions",
139
+ "type": {
140
+ "text": "Story<ArgTypes>"
141
+ }
142
+ },
143
+ {
144
+ "kind": "variable",
145
+ "name": "WithSelectAllPlaceholder"
146
+ },
147
+ {
148
+ "kind": "function",
149
+ "name": "OpenUpward",
150
+ "parameters": [
151
+ {
152
+ "name": "{\n label = 'Combobox that opens upward',\n id = 'combobox-upward',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' },\n { label: 'Option 4', value: '3' },\n { label: 'Option 5', value: '4' }\n ],\n multiselect = false\n}"
153
+ }
154
+ ]
155
+ }
156
+ ],
157
+ "exports": [
158
+ {
159
+ "kind": "js",
160
+ "name": "default",
161
+ "declaration": {
162
+ "name": "meta",
163
+ "module": "stories/combobox.stories.ts"
164
+ }
165
+ },
166
+ {
167
+ "kind": "js",
168
+ "name": "SingleSelect",
169
+ "declaration": {
170
+ "name": "SingleSelect",
171
+ "module": "stories/combobox.stories.ts"
172
+ }
173
+ },
174
+ {
175
+ "kind": "js",
176
+ "name": "SingleSelectWithDefault",
177
+ "declaration": {
178
+ "name": "SingleSelectWithDefault",
179
+ "module": "stories/combobox.stories.ts"
180
+ }
181
+ },
182
+ {
183
+ "kind": "js",
184
+ "name": "MultiSelect",
185
+ "declaration": {
186
+ "name": "MultiSelect",
187
+ "module": "stories/combobox.stories.ts"
188
+ }
189
+ },
190
+ {
191
+ "kind": "js",
192
+ "name": "MultiSelectSelectAll",
193
+ "declaration": {
194
+ "name": "MultiSelectSelectAll",
195
+ "module": "stories/combobox.stories.ts"
196
+ }
197
+ },
198
+ {
199
+ "kind": "js",
200
+ "name": "WithStyles",
201
+ "declaration": {
202
+ "name": "WithStyles",
203
+ "module": "stories/combobox.stories.ts"
204
+ }
205
+ },
206
+ {
207
+ "kind": "js",
208
+ "name": "WithCustomOptionStyle",
209
+ "declaration": {
210
+ "name": "WithCustomOptionStyle",
211
+ "module": "stories/combobox.stories.ts"
212
+ }
213
+ },
214
+ {
215
+ "kind": "js",
216
+ "name": "WithIcon",
217
+ "declaration": {
218
+ "name": "WithIcon",
219
+ "module": "stories/combobox.stories.ts"
220
+ }
221
+ },
222
+ {
223
+ "kind": "js",
224
+ "name": "HiddenCaret",
225
+ "declaration": {
226
+ "name": "HiddenCaret",
227
+ "module": "stories/combobox.stories.ts"
228
+ }
229
+ },
230
+ {
231
+ "kind": "js",
232
+ "name": "WithError",
233
+ "declaration": {
234
+ "name": "WithError",
235
+ "module": "stories/combobox.stories.ts"
236
+ }
237
+ },
238
+ {
239
+ "kind": "js",
240
+ "name": "WithOptionDisabled",
241
+ "declaration": {
242
+ "name": "WithOptionDisabled",
243
+ "module": "stories/combobox.stories.ts"
244
+ }
245
+ },
246
+ {
247
+ "kind": "js",
248
+ "name": "DisabledComboBox",
249
+ "declaration": {
250
+ "name": "DisabledComboBox",
251
+ "module": "stories/combobox.stories.ts"
252
+ }
253
+ },
254
+ {
255
+ "kind": "js",
256
+ "name": "InsideForm",
257
+ "declaration": {
258
+ "name": "InsideForm",
259
+ "module": "stories/combobox.stories.ts"
260
+ }
261
+ },
262
+ {
263
+ "kind": "js",
264
+ "name": "WithAriaLabel",
265
+ "declaration": {
266
+ "name": "WithAriaLabel",
267
+ "module": "stories/combobox.stories.ts"
268
+ }
269
+ },
270
+ {
271
+ "kind": "js",
272
+ "name": "WithRequired",
273
+ "declaration": {
274
+ "name": "WithRequired",
275
+ "module": "stories/combobox.stories.ts"
276
+ }
277
+ },
278
+ {
279
+ "kind": "js",
280
+ "name": "MultiSelectWithRequired",
281
+ "declaration": {
282
+ "name": "MultiSelectWithRequired",
283
+ "module": "stories/combobox.stories.ts"
284
+ }
285
+ },
286
+ {
287
+ "kind": "js",
288
+ "name": "WithCustomPlaceholder",
289
+ "declaration": {
290
+ "name": "WithCustomPlaceholder",
291
+ "module": "stories/combobox.stories.ts"
292
+ }
293
+ },
294
+ {
295
+ "kind": "js",
296
+ "name": "WithHiddenOptions",
297
+ "declaration": {
298
+ "name": "WithHiddenOptions",
299
+ "module": "stories/combobox.stories.ts"
300
+ }
301
+ },
302
+ {
303
+ "kind": "js",
304
+ "name": "WithSelectAllPlaceholder",
305
+ "declaration": {
306
+ "name": "WithSelectAllPlaceholder",
307
+ "module": "stories/combobox.stories.ts"
308
+ }
309
+ },
310
+ {
311
+ "kind": "js",
312
+ "name": "OpenUpward",
313
+ "declaration": {
314
+ "name": "OpenUpward",
315
+ "module": "stories/combobox.stories.ts"
316
+ }
317
+ }
318
+ ]
319
+ },
5
320
  {
6
321
  "kind": "javascript-module",
7
322
  "path": "src/TtCombobox.ts",
@@ -537,425 +852,110 @@
537
852
  "fieldName": "hideCaret"
538
853
  },
539
854
  {
540
- "name": "placeholder",
541
- "type": {
542
- "text": "string | undefined"
543
- },
544
- "fieldName": "placeholder"
545
- },
546
- {
547
- "name": "select-all-placeholder",
548
- "type": {
549
- "text": "string | undefined"
550
- },
551
- "fieldName": "selectAllPlaceholder"
552
- },
553
- {
554
- "name": "open-upward",
555
- "type": {
556
- "text": "boolean"
557
- },
558
- "default": "false",
559
- "fieldName": "openUpward"
560
- },
561
- {
562
- "name": "value",
563
- "type": {
564
- "text": "string[]"
565
- },
566
- "default": "[]",
567
- "fieldName": "value"
568
- }
569
- ],
570
- "superclass": {
571
- "name": "LitElement",
572
- "package": "lit"
573
- },
574
- "tagName": "tt-combobox",
575
- "customElement": true
576
- }
577
- ],
578
- "exports": [
579
- {
580
- "kind": "js",
581
- "name": "TtCombobox",
582
- "declaration": {
583
- "name": "TtCombobox",
584
- "module": "src/TtCombobox.ts"
585
- }
586
- }
587
- ]
588
- },
589
- {
590
- "kind": "javascript-module",
591
- "path": "src/index.ts",
592
- "declarations": [],
593
- "exports": [
594
- {
595
- "kind": "js",
596
- "name": "TtCombobox",
597
- "declaration": {
598
- "name": "TtCombobox",
599
- "module": "./tt-combobox.js"
600
- }
601
- }
602
- ]
603
- },
604
- {
605
- "kind": "javascript-module",
606
- "path": "src/styles.ts",
607
- "declarations": [
608
- {
609
- "kind": "variable",
610
- "name": "styles",
611
- "default": "css` :host { display: flex; flex-direction: var(--tt-combobox-flex-direction, row); align-items: var(--tt-combobox-align-items, center); justify-content: var(--tt-combobox-justify-content, initial); align-content: var(--tt-combobox-align-content, initial); gap: var(--tt-combobox-gap, 0.5rem); font-size: var(--tt-combobox-font-size, var(--font-size-200)); color: var(--tt-combobox-color, var(--color-text-400)); } :host([disabled]) .tt-combobox-container { border-color: var(--tt-combobox-disabled-border-color, var(--color-border-200)); color: var(--tt-combobox-disabled-color, var(--color-text-200)); background-color: var(--tt-combobox-disabled-background-color, var(--color-surface-200)); pointer-events: none; } .tt-combobox-container:focus-within { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .tt-combobox-container:hover { background-color: var(--tt-combobox-hover-background-color, var(--color-surface-300)); } :host([invalid]) .tt-combobox-container, :host(:state(interacted):invalid) .tt-combobox-container { outline: 1px solid var(--color-alert-400, red); } .errormessage { visibility: hidden; display: flex; align-items: center; gap: var(--space-scale-0-5); color: var(--color-alert-400, red); &[data-hidden] { display: none; } } .errormessage svg path { fill: var(--color-alert-400, red); height: 20px; } .tt-combobox-container:has([role=\"combobox\"][aria-invalid=\"true\"]) ~ .errormessage { visibility: visible; } :has([role=\"combobox\"][aria-invalid=\"true\"]) ::slotted([slot=\"error\"]) { color: var(--color-alert-400, darkred); font-size: var(--font-size-100); margin: 0; font-weight: var(--font-weight-regular); line-height: 1.2; } slot[name=\"option\"]::slotted(*) { display: none; } * { box-sizing: border-box; font-family: var(--font-family-sans); cursor: inherit; } .tt-combobox-container { position: relative; max-width: var(--tt-combobox-max-width, 300px); min-width: var(--tt-combobox-min-width, 250px); display: flex; flex-direction: row; align-items: center; border-radius: var(--border-radius); border-color: var(--tt-combobox-border-color, var(--color-border-400)); border-style: solid; border-width: var(--tt-combobox-border-width, 1px); background-color: var(--tt-combobox-background-color, var(--color-surface-100)); padding: 0.5rem; gap: 0.25rem; //width: 100%; } [role=\"listbox\"] { display: none; } [role=\"combobox\"] { width: 100%; border-style: none; background-color: transparent; font-size: var(--tt-combobox-font-size, var(--font-size-200)); } .hide-caret { caret-color: transparent; } [role=\"combobox\"]::placeholder { color: var(--tt-combobox-placeholder-color, var(--color-text-300)); font-family: var(--font-family-inter); font-size: var(--tt-combobox-font-size, var(--font-size-200)); } :host([disabled]) [role=\"combobox\"]::placeholder { color: var(--tt-combobox-disabled-placeholder-color, var(--color-text-200)); } [role=\"combobox\"]:placeholder-shown { text-overflow: ellipsis; overflow: clip; } [role=\"combobox\"]:focus { outline: none; } [role=\"combobox\"] ~ button { appearance: none; padding: 0; border-width: 0; background-color: transparent; aspect-ratio: 1; } [role=\"combobox\"] ~ button svg { transition: transform 0.2s ease-in-out; color: var(--tt-combobox-dropdown-color, var(--color-text-400)); } [role=\"combobox\"][aria-expanded=\"true\"] ~ button svg { transform: rotate(180deg); } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"] { display: block; width: max-content; max-width: var(--tt-combobox-list-max-width, 35ch); min-width: 100%; background-color: var(--tt-combobox-list-background-color, var(--color-surface-100, white)); border: 1px solid var(--tt-combobox-border-color, var(--color-border-300)); border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); padding: 0; position: absolute; top: var(--tt-combobox-top, calc(100% + 0.5rem)); left: var(--tt-combobox-left, 0); right: var(--tt-combobox-right, unset); bottom: var(--tt-combobox-bottom, unset); z-index: 2; margin: 0; list-style: none; max-height: var(--tt-combobox-max-height, 400px); overflow-y: auto; li { display: flex; padding: 0.5rem; box-sizing: border-box; text-align: left; text-overflow: ellipsis; text-wrap: nowrap; align-items: center; gap: 0.25rem; max-width: 100%; width: 100%; overflow-y: visible; flex: 1; input[type=\"checkbox\"] { width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; flex: 0 0 auto; } span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; line-height: 1.1; } &.no-results { display: none; } &[aria-hidden=\"true\"] { visibility: hidden; display: none; } } &:not(:has([role=\"option\"]:not([data-value=\"select-all\"]))) { .no-results { display: flex; } .select-all { display: none; } } } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"][data-open-upward] { top: unset; bottom: calc(100% + 0.5rem); } slot[name=\"icon\"] { display: inline-block; max-width: var(--tt-combobox-icon-size, 1rem); aspect-ratio: 1; } [role=\"option\"].select-all { border-bottom: 1px solid var(--color-border-300); } [aria-multiselectable=\"false\"] [role=\"option\"][aria-selected=\"true\"] { color: var(--tt-combobox-option-selected-color, var(--color-primary-400)); font-weight: var(--font-weight-medium); } [role=\"option\"]:is(:hover, [data-active=\"true\"]) { background-color: var(--tt-combobox-option-background-color-hover, inherit); color: var(--tt-combobox-option-color-hover, inherit); &:first-child { border-top-left-radius: var(--border-radius); border-top-right-radius: var(--border-radius); } &:last-child { border-bottom-left-radius: var(--border-radius); border-bottom-right-radius: var(--border-radius); } } [role=\"option\"]:hover { cursor: pointer; } [role=\"option\"][aria-disabled=\"true\"] { pointer-events: none; opacity: 0.5; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"] input[type=\"checkbox\"] { accent-color: var(--color-primary-400); width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; pointer-events: none; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"][aria-disabled=\"true\"] input[type=\"checkbox\"] { pointer-events: none; } label { font-size: var(--tt-combobox-label-font-size, inherit); color: var(--tt-combobox-label-color, inherit); font-weight: var(--tt-combobox-label-font-weight, inherit); &[data-hidden] { display: none; } } `"
612
- }
613
- ],
614
- "exports": [
615
- {
616
- "kind": "js",
617
- "name": "styles",
618
- "declaration": {
619
- "name": "styles",
620
- "module": "src/styles.ts"
621
- }
622
- }
623
- ]
624
- },
625
- {
626
- "kind": "javascript-module",
627
- "path": "src/tt-combobox.ts",
628
- "declarations": [],
629
- "exports": [
630
- {
631
- "kind": "custom-element-definition",
632
- "name": "tt-combobox",
633
- "declaration": {
634
- "name": "TtCombobox",
635
- "module": "/src/TtCombobox.js"
636
- }
637
- },
638
- {
639
- "kind": "js",
640
- "name": "TtCombobox",
641
- "declaration": {
642
- "name": "TtCombobox",
643
- "module": "src/tt-combobox.ts"
644
- }
645
- }
646
- ]
647
- },
648
- {
649
- "kind": "javascript-module",
650
- "path": "stories/combobox.stories.ts",
651
- "declarations": [
652
- {
653
- "kind": "variable",
654
- "name": "meta",
655
- "type": {
656
- "text": "object"
657
- },
658
- "default": "{ title: 'ComboBox', component: 'tt-combobox', argTypes: { label: { control: 'text' }, id: { control: 'text' }, 'display-select-all': { control: 'boolean' }, 'select-all-placeholder': { control: 'text' }, options: { control: 'object' } }, tags: ['autodocs'] }"
659
- },
660
- {
661
- "kind": "variable",
662
- "name": "SingleSelect"
663
- },
664
- {
665
- "kind": "function",
666
- "name": "SingleSelectWithDefault",
667
- "parameters": [
668
- {
669
- "name": "{\n label = 'With default options',\n id = 'combobox-13',\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n value = '0'\n }"
670
- }
671
- ]
672
- },
673
- {
674
- "kind": "variable",
675
- "name": "MultiSelect"
676
- },
677
- {
678
- "kind": "variable",
679
- "name": "MultiSelectSelectAll"
680
- },
681
- {
682
- "kind": "variable",
683
- "name": "WithStyles"
684
- },
685
- {
686
- "kind": "function",
687
- "name": "WithCustomOptionStyle",
688
- "parameters": [
689
- {
690
- "name": "{\n label = 'Test label',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
691
- }
692
- ]
693
- },
694
- {
695
- "kind": "function",
696
- "name": "WithIcon",
697
- "parameters": [
698
- {
699
- "name": "{\n label = 'With icon',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
700
- }
701
- ]
702
- },
703
- {
704
- "kind": "function",
705
- "name": "HiddenCaret",
706
- "parameters": [
707
- {
708
- "name": "{\n label = 'With hidden caret',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
709
- }
710
- ]
711
- },
712
- {
713
- "kind": "function",
714
- "name": "WithError",
715
- "parameters": [
716
- {
717
- "name": "{\n label = 'With error',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
718
- }
719
- ]
720
- },
721
- {
722
- "kind": "function",
723
- "name": "WithOptionDisabled",
724
- "parameters": [
725
- {
726
- "name": "{\n label = 'With option disabled',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
727
- }
728
- ]
729
- },
730
- {
731
- "kind": "function",
732
- "name": "DisabledComboBox",
733
- "parameters": [
734
- {
735
- "name": "{\n label = 'Disabled selector',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
736
- }
737
- ]
738
- },
739
- {
740
- "kind": "function",
741
- "name": "InsideForm",
742
- "parameters": [
743
- {
744
- "name": "{\n label = 'Combobox submitted inside a form',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
745
- }
746
- ]
747
- },
748
- {
749
- "kind": "function",
750
- "name": "WithAriaLabel",
751
- "parameters": [
752
- {
753
- "name": "{\n label = 'This label is only visible for screen readers, use with caution',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
754
- }
755
- ]
756
- },
757
- {
758
- "kind": "function",
759
- "name": "WithRequired",
760
- "parameters": [
855
+ "name": "placeholder",
856
+ "type": {
857
+ "text": "string | undefined"
858
+ },
859
+ "fieldName": "placeholder"
860
+ },
761
861
  {
762
- "name": "{\n label = 'Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
763
- }
764
- ]
765
- },
766
- {
767
- "kind": "function",
768
- "name": "MultiSelectWithRequired",
769
- "parameters": [
862
+ "name": "select-all-placeholder",
863
+ "type": {
864
+ "text": "string | undefined"
865
+ },
866
+ "fieldName": "selectAllPlaceholder"
867
+ },
770
868
  {
771
- "name": "{\n label = 'MultiSelect Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
772
- }
773
- ]
774
- },
775
- {
776
- "kind": "variable",
777
- "name": "WithCustomPlaceholder"
778
- },
779
- {
780
- "kind": "variable",
781
- "name": "WithHiddenOptions",
782
- "type": {
783
- "text": "Story<ArgTypes>"
784
- }
785
- },
786
- {
787
- "kind": "variable",
788
- "name": "WithSelectAllPlaceholder"
789
- },
790
- {
791
- "kind": "function",
792
- "name": "OpenUpward",
793
- "parameters": [
869
+ "name": "open-upward",
870
+ "type": {
871
+ "text": "boolean"
872
+ },
873
+ "default": "false",
874
+ "fieldName": "openUpward"
875
+ },
794
876
  {
795
- "name": "{\n label = 'Combobox that opens upward',\n id = 'combobox-upward',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' },\n { label: 'Option 4', value: '3' },\n { label: 'Option 5', value: '4' }\n ],\n multiselect = false\n}"
877
+ "name": "value",
878
+ "type": {
879
+ "text": "string[]"
880
+ },
881
+ "default": "[]",
882
+ "fieldName": "value"
796
883
  }
797
- ]
884
+ ],
885
+ "superclass": {
886
+ "name": "LitElement",
887
+ "package": "lit"
888
+ },
889
+ "tagName": "tt-combobox",
890
+ "customElement": true
798
891
  }
799
892
  ],
800
893
  "exports": [
801
894
  {
802
895
  "kind": "js",
803
- "name": "default",
804
- "declaration": {
805
- "name": "meta",
806
- "module": "stories/combobox.stories.ts"
807
- }
808
- },
809
- {
810
- "kind": "js",
811
- "name": "SingleSelect",
812
- "declaration": {
813
- "name": "SingleSelect",
814
- "module": "stories/combobox.stories.ts"
815
- }
816
- },
817
- {
818
- "kind": "js",
819
- "name": "SingleSelectWithDefault",
820
- "declaration": {
821
- "name": "SingleSelectWithDefault",
822
- "module": "stories/combobox.stories.ts"
823
- }
824
- },
825
- {
826
- "kind": "js",
827
- "name": "MultiSelect",
828
- "declaration": {
829
- "name": "MultiSelect",
830
- "module": "stories/combobox.stories.ts"
831
- }
832
- },
833
- {
834
- "kind": "js",
835
- "name": "MultiSelectSelectAll",
836
- "declaration": {
837
- "name": "MultiSelectSelectAll",
838
- "module": "stories/combobox.stories.ts"
839
- }
840
- },
841
- {
842
- "kind": "js",
843
- "name": "WithStyles",
844
- "declaration": {
845
- "name": "WithStyles",
846
- "module": "stories/combobox.stories.ts"
847
- }
848
- },
849
- {
850
- "kind": "js",
851
- "name": "WithCustomOptionStyle",
852
- "declaration": {
853
- "name": "WithCustomOptionStyle",
854
- "module": "stories/combobox.stories.ts"
855
- }
856
- },
857
- {
858
- "kind": "js",
859
- "name": "WithIcon",
860
- "declaration": {
861
- "name": "WithIcon",
862
- "module": "stories/combobox.stories.ts"
863
- }
864
- },
865
- {
866
- "kind": "js",
867
- "name": "HiddenCaret",
868
- "declaration": {
869
- "name": "HiddenCaret",
870
- "module": "stories/combobox.stories.ts"
871
- }
872
- },
873
- {
874
- "kind": "js",
875
- "name": "WithError",
876
- "declaration": {
877
- "name": "WithError",
878
- "module": "stories/combobox.stories.ts"
879
- }
880
- },
881
- {
882
- "kind": "js",
883
- "name": "WithOptionDisabled",
884
- "declaration": {
885
- "name": "WithOptionDisabled",
886
- "module": "stories/combobox.stories.ts"
887
- }
888
- },
889
- {
890
- "kind": "js",
891
- "name": "DisabledComboBox",
892
- "declaration": {
893
- "name": "DisabledComboBox",
894
- "module": "stories/combobox.stories.ts"
895
- }
896
- },
897
- {
898
- "kind": "js",
899
- "name": "InsideForm",
900
- "declaration": {
901
- "name": "InsideForm",
902
- "module": "stories/combobox.stories.ts"
903
- }
904
- },
905
- {
906
- "kind": "js",
907
- "name": "WithAriaLabel",
908
- "declaration": {
909
- "name": "WithAriaLabel",
910
- "module": "stories/combobox.stories.ts"
911
- }
912
- },
913
- {
914
- "kind": "js",
915
- "name": "WithRequired",
896
+ "name": "TtCombobox",
916
897
  "declaration": {
917
- "name": "WithRequired",
918
- "module": "stories/combobox.stories.ts"
898
+ "name": "TtCombobox",
899
+ "module": "src/TtCombobox.ts"
919
900
  }
920
- },
901
+ }
902
+ ]
903
+ },
904
+ {
905
+ "kind": "javascript-module",
906
+ "path": "src/index.ts",
907
+ "declarations": [],
908
+ "exports": [
921
909
  {
922
910
  "kind": "js",
923
- "name": "MultiSelectWithRequired",
911
+ "name": "TtCombobox",
924
912
  "declaration": {
925
- "name": "MultiSelectWithRequired",
926
- "module": "stories/combobox.stories.ts"
913
+ "name": "TtCombobox",
914
+ "module": "./tt-combobox.js"
927
915
  }
928
- },
916
+ }
917
+ ]
918
+ },
919
+ {
920
+ "kind": "javascript-module",
921
+ "path": "src/styles.ts",
922
+ "declarations": [
929
923
  {
930
- "kind": "js",
931
- "name": "WithCustomPlaceholder",
932
- "declaration": {
933
- "name": "WithCustomPlaceholder",
934
- "module": "stories/combobox.stories.ts"
935
- }
936
- },
924
+ "kind": "variable",
925
+ "name": "styles",
926
+ "default": "css` :host { display: flex; flex-direction: var(--tt-combobox-flex-direction, row); align-items: var(--tt-combobox-align-items, center); justify-content: var(--tt-combobox-justify-content, initial); align-content: var(--tt-combobox-align-content, initial); gap: var(--tt-combobox-gap, 0.5rem); font-size: var(--tt-combobox-font-size, var(--font-size-200)); color: var(--tt-combobox-color, var(--color-text-400)); } :host([disabled]) .tt-combobox-container { border-color: var(--tt-combobox-disabled-border-color, var(--color-border-200)); color: var(--tt-combobox-disabled-color, var(--color-text-200)); background-color: var(--tt-combobox-disabled-background-color, var(--color-surface-200)); pointer-events: none; } .tt-combobox-container:focus-within { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .tt-combobox-container:hover { background-color: var(--tt-combobox-hover-background-color, var(--color-surface-300)); } :host([invalid]) .tt-combobox-container, :host(:state(interacted):invalid) .tt-combobox-container { outline: 1px solid var(--color-alert-400, red); } .errormessage { visibility: hidden; display: flex; align-items: center; gap: var(--space-scale-0-5); color: var(--color-alert-400, red); &[data-hidden] { display: none; } } .errormessage svg path { fill: var(--color-alert-400, red); height: 20px; } .tt-combobox-container:has([role=\"combobox\"][aria-invalid=\"true\"]) ~ .errormessage { visibility: visible; } :has([role=\"combobox\"][aria-invalid=\"true\"]) ::slotted([slot=\"error\"]) { color: var(--color-alert-400, darkred); font-size: var(--font-size-100); margin: 0; font-weight: var(--font-weight-regular); line-height: 1.2; } slot[name=\"option\"]::slotted(*) { display: none; } * { box-sizing: border-box; font-family: var(--font-family-sans); cursor: inherit; } .tt-combobox-container { position: relative; max-width: var(--tt-combobox-max-width, 300px); min-width: var(--tt-combobox-min-width, 250px); display: flex; flex-direction: row; align-items: center; border-radius: var(--border-radius); border-color: var(--tt-combobox-border-color, var(--color-border-400)); border-style: solid; border-width: var(--tt-combobox-border-width, 1px); background-color: var(--tt-combobox-background-color, var(--color-surface-100)); padding: 0.5rem; gap: 0.25rem; //width: 100%; } [role=\"listbox\"] { display: none; } [role=\"combobox\"] { width: 100%; border-style: none; background-color: transparent; font-size: var(--tt-combobox-font-size, var(--font-size-200)); } .hide-caret { caret-color: transparent; } [role=\"combobox\"]::placeholder { color: var(--tt-combobox-placeholder-color, var(--color-text-300)); font-family: var(--font-family-inter); font-size: var(--tt-combobox-font-size, var(--font-size-200)); } :host([disabled]) [role=\"combobox\"]::placeholder { color: var(--tt-combobox-disabled-placeholder-color, var(--color-text-200)); } [role=\"combobox\"]:placeholder-shown { text-overflow: ellipsis; overflow: clip; } [role=\"combobox\"]:focus { outline: none; } [role=\"combobox\"] ~ button { appearance: none; padding: 0; border-width: 0; background-color: transparent; aspect-ratio: 1; } [role=\"combobox\"] ~ button svg { transition: transform 0.2s ease-in-out; color: var(--tt-combobox-dropdown-color, var(--color-text-400)); } [role=\"combobox\"][aria-expanded=\"true\"] ~ button svg { transform: rotate(180deg); } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"] { display: block; width: max-content; max-width: var(--tt-combobox-list-max-width, 35ch); min-width: 100%; background-color: var(--tt-combobox-list-background-color, var(--color-surface-100, white)); border: 1px solid var(--tt-combobox-border-color, var(--color-border-300)); border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); padding: 0; position: absolute; top: var(--tt-combobox-top, calc(100% + 0.5rem)); left: var(--tt-combobox-left, 0); right: var(--tt-combobox-right, unset); bottom: var(--tt-combobox-bottom, unset); z-index: 2; margin: 0; list-style: none; max-height: var(--tt-combobox-max-height, 400px); overflow-y: auto; li { display: flex; padding: 0.5rem; box-sizing: border-box; text-align: left; text-overflow: ellipsis; text-wrap: nowrap; align-items: center; gap: 0.25rem; max-width: 100%; width: 100%; overflow-y: visible; flex: 1; input[type=\"checkbox\"] { width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; flex: 0 0 auto; } span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; line-height: 1.1; } &.no-results { display: none; } &[aria-hidden=\"true\"] { visibility: hidden; display: none; } } &:not(:has([role=\"option\"]:not([data-value=\"select-all\"]))) { .no-results { display: flex; } .select-all { display: none; } } } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"][data-open-upward] { top: unset; bottom: calc(100% + 0.5rem); } slot[name=\"icon\"] { display: inline-block; max-width: var(--tt-combobox-icon-size, 1rem); aspect-ratio: 1; } [role=\"option\"].select-all { border-bottom: 1px solid var(--color-border-300); } [aria-multiselectable=\"false\"] [role=\"option\"][aria-selected=\"true\"] { color: var(--tt-combobox-option-selected-color, var(--color-primary-400)); font-weight: var(--font-weight-medium); } [role=\"option\"]:is(:hover, [data-active=\"true\"]) { background-color: var(--tt-combobox-option-background-color-hover, inherit); color: var(--tt-combobox-option-color-hover, inherit); &:first-child { border-top-left-radius: var(--border-radius); border-top-right-radius: var(--border-radius); } &:last-child { border-bottom-left-radius: var(--border-radius); border-bottom-right-radius: var(--border-radius); } } [role=\"option\"]:hover { cursor: pointer; } [role=\"option\"][aria-disabled=\"true\"] { pointer-events: none; opacity: 0.5; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"] input[type=\"checkbox\"] { accent-color: var(--color-primary-400); width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; pointer-events: none; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"][aria-disabled=\"true\"] input[type=\"checkbox\"] { pointer-events: none; } label { font-size: var(--tt-combobox-label-font-size, inherit); color: var(--tt-combobox-label-color, inherit); font-weight: var(--tt-combobox-label-font-weight, inherit); &[data-hidden] { display: none; } } `"
927
+ }
928
+ ],
929
+ "exports": [
937
930
  {
938
931
  "kind": "js",
939
- "name": "WithHiddenOptions",
932
+ "name": "styles",
940
933
  "declaration": {
941
- "name": "WithHiddenOptions",
942
- "module": "stories/combobox.stories.ts"
934
+ "name": "styles",
935
+ "module": "src/styles.ts"
943
936
  }
944
- },
937
+ }
938
+ ]
939
+ },
940
+ {
941
+ "kind": "javascript-module",
942
+ "path": "src/tt-combobox.ts",
943
+ "declarations": [],
944
+ "exports": [
945
945
  {
946
- "kind": "js",
947
- "name": "WithSelectAllPlaceholder",
946
+ "kind": "custom-element-definition",
947
+ "name": "tt-combobox",
948
948
  "declaration": {
949
- "name": "WithSelectAllPlaceholder",
950
- "module": "stories/combobox.stories.ts"
949
+ "name": "TtCombobox",
950
+ "module": "/src/TtCombobox.js"
951
951
  }
952
952
  },
953
953
  {
954
954
  "kind": "js",
955
- "name": "OpenUpward",
955
+ "name": "TtCombobox",
956
956
  "declaration": {
957
- "name": "OpenUpward",
958
- "module": "stories/combobox.stories.ts"
957
+ "name": "TtCombobox",
958
+ "module": "src/tt-combobox.ts"
959
959
  }
960
960
  }
961
961
  ]
@@ -57,7 +57,16 @@ export class TtCombobox extends LitElement {
57
57
  this._selectAll = (event) => {
58
58
  event.preventDefault();
59
59
  event.stopPropagation();
60
- if (this.value.length === this._selectableOptions.length) {
60
+ // If filtering, and all visible options are selected, deselect only visible options
61
+ // Else if filtering, select all visible options
62
+ if (this._filter !== '' && this._isAllSelected) {
63
+ const selectedVisibleValues = Array.from(this._selectedVisibleOptions).map(option => option.dataset.value);
64
+ this.value = this.value.filter(value => !selectedVisibleValues.includes(value));
65
+ }
66
+ else if (this._filter !== '') {
67
+ this.value = Array.from(new Set([...this.value, ...Array.from(this._selectableVisibleOptions).map(option => option.dataset.value)]));
68
+ }
69
+ else if (this.value.length === this._selectableOptions.length) {
61
70
  this.value = [];
62
71
  }
63
72
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"TtCombobox.js","sourceRoot":"","sources":["../../src/TtCombobox.ts"],"names":[],"mappings":";AAAA,0DAA0D;AAC1D,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,MAAM,OAAO,UAAW,SA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ADC,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,wBAAwB,EAAE,CAAC;iDACrC;AAG/B;IADT,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACI;AAGnC;IADT,QAAQ,CAAC,qEAAqE,CAAC;mDAC3B;AAG3C;IADT,QAAQ,CAAC,0EAA0E,CAAC;sDACxB;AAGnD;IADT,QAAQ,CAAC,gGAAgG,CAAC;6DACvC;AAG1D;IADT,QAAQ,CAAC,wEAAwE,CAAC;oDACxB;AAGjD;IADT,QAAQ,CAAC,8FAA8F,CAAC;2DACvC;AAGxD;IADT,KAAK,CAAC,wBAAwB,CAAC;kDACY;AAGlC;IADT,KAAK,CAAC,iBAAiB,CAAC;kDACoB;AAKtC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAA,KAAa,CAAA,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;yCAC1B","sourcesContent":["/* eslint-disable lit-a11y/click-events-have-key-events */\nimport { html, LitElement, nothing, PropertyValues } from 'lit';\nimport { property, query, queryAll, queryAssignedElements, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { guard } from 'lit/directives/guard.js';\nimport { alert, chevronDown } from '@triptease/icons';\nimport { styles } from './styles.js';\n\n\nexport class TtCombobox extends LitElement {\n static styles = styles;\n\n static formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true\n };\n\n @property({ type: Boolean })\n multiselect = false;\n\n @property({ type: Boolean })\n disabled = false;\n\n @property({ type: Boolean })\n invalid = false;\n\n @property({ type: Boolean, attribute: 'display-select-all' })\n displaySelectAll = false;\n\n @property({ type: Boolean })\n required = false;\n\n @property({ type: String })\n name = '';\n\n @property({ type: String, attribute: 'aria-labelledby' })\n ariaLabelledby = nothing;\n\n @property({ type: Boolean, attribute: 'hide-caret' })\n hideCaret = false;\n\n @property({ type: String })\n placeholder?: string;\n\n @property({ type: String, attribute: 'select-all-placeholder' })\n selectAllPlaceholder?: string;\n\n @property({ type: Boolean, attribute: 'open-upward' })\n openUpward = false;\n\n get form(): HTMLFormElement | null {\n return this.internals.form;\n }\n\n @state()\n protected _activeOption: number = -1;\n\n @state()\n protected _expanded = false;\n\n @state()\n protected _filter: string = '';\n\n @queryAssignedElements({ slot: 'option', selector: 'option' })\n options!: Array<HTMLOptionElement>;\n\n @queryAssignedElements({ slot: 'option', selector: 'option:not([disabled])' })\n activeOptions!: Array<HTMLOptionElement>;\n\n @queryAssignedElements({ slot: 'error' })\n protected errorElements!: Array<HTMLElement>;\n\n @queryAll('li[role=\"option\"]:not([aria-disabled=\"true\"], [aria-hidden=\"true\"])')\n protected _visibleOptions!: Array<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([aria-disabled=\"true\"], [data-value=\"select-all\"])')\n protected _selectableOptions!: NodeListOf<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([aria-disabled=\"true\"], [data-value=\"select-all\"], [aria-hidden=\"true\"])')\n protected _selectableVisibleOptions!: NodeListOf<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([data-value=\"select-all\"])[aria-selected=\"true\"]')\n protected _selectedOptions!: NodeListOf<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([data-value=\"select-all\"], [aria-hidden=\"true\"])[aria-selected=\"true\"]')\n protected _selectedVisibleOptions!: NodeListOf<HTMLOptionElement>;\n\n @query('input[role=\"combobox\"]')\n protected _comboboxInput!: HTMLInputElement;\n\n @query('button:has(svg)')\n protected _chevronButton!: HTMLButtonElement;\n\n public internals: ReturnType<typeof this.attachInternals>;\n\n @property({ type: Array<String>, attribute: 'value' })\n public value: string[] = [];\n\n private get _isAllSelected(): boolean {\n return Array.from(this._selectableVisibleOptions).every(option => Array.from(this._selectedVisibleOptions).includes(option));\n }\n\n private _slotObserver: MutationObserver = new MutationObserver((mutations) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n this.requestUpdate('options');\n }\n });\n });\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n private _handleFocusOut(e: FocusEvent) {\n if (!this.shadowRoot!.contains(e.relatedTarget as Node | null)) {\n this._expanded = false;\n }\n }\n\n private _onFocus() {\n this._comboboxInput.focus();\n }\n\n public connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('focus', this._onFocus);\n }\n\n public disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener('focus', this._onFocus);\n }\n\n protected firstUpdated(changedProperties: PropertyValues) {\n this.internals.setFormValue(JSON.stringify(this.value));\n\n this._reportValidity();\n this._listenForOptionChange();\n\n super.firstUpdated(changedProperties);\n }\n\n protected update(changedProperties: PropertyValues) {\n if (changedProperties.has('value')) {\n this._valueChanged();\n\n if (changedProperties.get('value') !== undefined && JSON.stringify(changedProperties.get('value')) !== JSON.stringify(this.value)) {\n this._dispatchSelectedOptions();\n this._reportValidity();\n }\n }\n\n if (changedProperties.has('_expanded') && changedProperties.get('_expanded') && !this._expanded) {\n this.internals.states.add('interacted');\n }\n\n if (changedProperties.has('options')) {\n this.updateComplete.then(() => {\n this.value = Array.from(new Set([...this.value, ...Array.from(this._selectedOptions).map(option => option.dataset.value!)]));\n this._listenForOptionChange();\n });\n }\n super.update(changedProperties);\n }\n\n private _valueChanged = () => {\n this._selectableOptions.forEach(option => {\n if (this.value.includes(option.dataset.value!)) {\n this._checkOption(option);\n } else {\n this._uncheckOption(option);\n }\n });\n\n this.internals.setFormValue(JSON.stringify(this.value));\n };\n\n private _listenForOptionChange = () => {\n this.options.forEach(option => {\n this._slotObserver.observe(option, { attributes: true, attributeFilter: ['selected', 'disabled', 'hidden'] });\n });\n };\n\n private _reportValidity() {\n if (this.required && !this.value.length) {\n const errorMessage = this.multiselect ? 'Please select at least one option' : 'Please select an option';\n\n this.internals.setValidity({\n valueMissing: true\n }, errorMessage, this._comboboxInput);\n this.internals.states.add('--invalid');\n } else if (!this.internals.validity.valid) {\n this.internals.setValidity({});\n\n if (this.internals.states.has('--invalid')) {\n this.internals.states.delete('--invalid');\n }\n }\n }\n\n private get labels(): Array<HTMLElement> {\n return <Array<HTMLElement>>[...this.internals.labels];\n }\n\n private get labelContent(): string {\n if (this.ariaLabel !== null) {\n return this.ariaLabel;\n }\n\n return this.labels.map(label => label.innerText).join(', ');\n }\n\n private _onKeyUp(event: KeyboardEvent) {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this._expanded) {\n this._expanded = true;\n this._activeOption = -1;\n } else {\n this._activeOption = Math.min(this._visibleOptions.length - 1, this._activeOption + 1);\n }\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this._expanded) {\n this._activeOption = Math.max(0, this._activeOption - 1);\n }\n break;\n case 'Escape':\n event.preventDefault();\n if (this._expanded) {\n this._expanded = false;\n } else if (this._filter !== '') {\n this._filter = '';\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (this._expanded) {\n this._visibleOptions[this._activeOption].click();\n }\n break;\n default:\n break;\n }\n }\n\n private _uncheckOption(option: HTMLElement) {\n if (option.dataset.deselectable !== 'true') return;\n\n option.setAttribute('aria-selected', 'false');\n const checkbox = <HTMLInputElement>option.querySelector('input[type=\"checkbox\"]');\n if (checkbox) {\n checkbox.checked = false;\n }\n }\n\n private _checkOption(option: HTMLElement) {\n if (!this.multiselect) {\n this._selectableOptions.forEach(opt => {\n this._uncheckOption(opt);\n });\n }\n\n option.setAttribute('aria-selected', 'true');\n const checkbox = <HTMLInputElement>option.querySelector('input[type=\"checkbox\"]');\n if (checkbox) {\n checkbox.checked = true;\n }\n }\n\n private _getActiveOptionId(): string | undefined {\n if (this._activeOption === -1 || this._visibleOptions.length === 0) {\n return undefined;\n }\n\n const option = this._visibleOptions[this._activeOption];\n return option.id;\n }\n\n private _onClick() {\n this._expanded = !this._expanded;\n\n if (this._expanded) {\n (<HTMLElement>this.shadowRoot?.querySelector('input[role=\"combobox\"]'))?.focus();\n }\n }\n\n private _onChevronClick() {\n (<HTMLElement>this.shadowRoot?.querySelector('input[role=\"combobox\"]'))?.focus();\n }\n\n private _onClickOption(event: MouseEvent) {\n event.preventDefault();\n event.stopPropagation();\n const option = event.currentTarget as HTMLElement;\n const selectedValue = option.dataset.value as string;\n\n\n if (this.multiselect) {\n if (this.value.includes(selectedValue)) {\n this.value = this.value.filter(value => value !== selectedValue);\n } else {\n this.value = [...this.value, selectedValue];\n }\n } else {\n this.value = [selectedValue];\n this._expanded = false;\n }\n }\n\n private _onInput(event: Event) {\n const input = event.target as HTMLInputElement;\n const filter = input.value.toLowerCase();\n if (filter !== '' && !this._expanded) {\n this._expanded = true;\n }\n this._activeOption = -1;\n this._filter = filter;\n }\n\n private _dispatchSelectedOptions() {\n this.dispatchEvent(new Event('change', {\n bubbles: true,\n composed: true\n }));\n }\n\n private _selectAll = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.value.length === this._selectableOptions.length) {\n this.value = [];\n } else {\n this.value = Array.from(this._selectableOptions).map(option => option.dataset.value!);\n }\n };\n\n private get _isValid(): boolean {\n return this.internals.validity.valid && !this.invalid;\n }\n\n private _renderCombobox() {\n const placeHolderValue = guard(\n [this.placeholder, this.disabled, this.value, this.activeOptions.length, this.selectAllPlaceholder],\n () => {\n if (this.placeholder) {\n return this.placeholder;\n }\n\n if (this.disabled) {\n return 'Disabled';\n }\n if (!this._selectedVisibleOptions.length) {\n return 'No options selected';\n }\n if (this._selectedVisibleOptions.length === 1) {\n return this._selectedVisibleOptions[0].textContent?.trim();\n }\n\n if (this._isAllSelected) {\n return this.selectAllPlaceholder || 'All options selected';\n }\n\n return `${this._selectedVisibleOptions.length} options selected`;\n });\n\n return html`\n <input\n type=\"text\"\n id=\"${this.id}\"\n name=\"${this.name}\"\n autocomplete=\"off\"\n aria-label=\"${this.labelContent}\"\n aria-labelledby=\"${this.ariaLabelledby}\"\n role=\"combobox\"\n aria-controls=\"${this.id}-list\"\n aria-expanded=\"${this._expanded}\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-disabled=\"${this.disabled}\"\n aria-invalid=\"${!this._isValid}\"\n aria-errormessage=\"${!this._isValid ? `error-msg-${this.id}` : nothing}\"\n aria-required=\"${this.required}\"\n ?disabled=${this.disabled}\n aria-activedescendant=\"${ifDefined(this._getActiveOptionId())}\"\n @input=\"${this._onInput}\"\n .value=\"${this._filter}\"\n .placeholder=\"${placeHolderValue}\"\n @focusout=\"${this._handleFocusOut}\"\n part=\"input\"\n class=${this.hideCaret ? 'hide-caret' : ''}\n />`;\n }\n\n private _renderSelectAll = () => {\n if (!this.multiselect || !this.displaySelectAll) {\n return nothing;\n }\n const id = `${this.id}-option-select-all`;\n const active = this._getActiveOptionId() === id;\n const selected = this._isAllSelected;\n // eslint-disable-next-line lit-a11y/click-events-have-key-events\n return html`\n <li\n class=\"select-all\"\n role=\"option\"\n id=\"${this.id}-option-select-all\"\n aria-selected=\"${selected}\"\n data-active=${active}\n @click=\"${this._selectAll}\"\n @mousedown=\"${(evt: MouseEvent) => evt.preventDefault()}\"\n data-value=\"select-all\"\n part=\"option\"\n >\n <input type=\"checkbox\" ?checked=${selected} role=\"presentation\" tabindex=\"-1\" part=\"checkbox\">\n Select all\n </li>`;\n };\n\n private _renderOption(option: HTMLOptionElement) {\n const hidden = Boolean((this._filter !== '' && !option.value.toLowerCase().includes(this._filter) && !option.innerText.toLowerCase().includes(this._filter)) || option.hidden);\n\n // if (this._filter !== '' && !option.value.toLowerCase().includes(this._filter) && !option.innerText.toLowerCase().includes(this._filter)) {\n // return nothing;\n // }\n\n const id = `${this.id}-option-${option.value}`;\n const active = this._getActiveOptionId() === id;\n const selected = Boolean(this.multiselect && option.selected);\n\n return html`\n <li\n role=\"option\"\n id=\"${this.id}-option-${option.value}\"\n aria-selected=${this.multiselect && option.selected}\n data-active=${active}\n @click=\"${this._onClickOption}\"\n @mousedown=\"${(event: MouseEvent) => event.preventDefault()}\"\n data-value=\"${option.value}\"\n aria-disabled=${option.disabled}\n aria-hidden=${hidden || nothing}\n data-deselectable=${!option.selected}\n part=\"option\"\n >\n ${this.multiselect ? html`<input type=\"checkbox\" ?checked=${selected}\n role=\"presentation\" tabindex=\"-1\" part=\"checkbox\">` : nothing}\n <span>${unsafeHTML(option.innerHTML)}</span>\n </li>`;\n }\n\n private _renderChevron = () => html`\n <button type=\"button\" aria-label=\"Expand\" @click=\"${this._onChevronClick}\" aria-expanded=\"${this._expanded}\"\n aria-controls=\"${this.id}-list\" tabindex=\"-1\" ?disabled=${this.disabled} part=\"arrow\">\n ${unsafeSVG(chevronDown)}\n </button>\n `;\n\n private _hasErrorContent(): boolean {\n return this.errorElements?.length > 0;\n }\n\n render() {\n return html`\n <div class=\"tt-combobox-container\" @focus=\"${this._onFocus}\" @keydown=\"${this._onKeyUp}\" @click=\"${this._onClick}\"\n aria-disabled=\"${this.disabled}\" part=\"container\">\n <slot name=\"icon\" part=\"icon\"></slot>\n ${this._renderCombobox()}\n ${this._renderChevron()}\n <ul\n id=\"${this.id}-list\"\n role=\"listbox\"\n aria-multiselectable=\"${this.multiselect}\"\n aria-label=\"${this.labelContent}\"\n part=\"listbox\"\n ?data-open-upward=\"${this.openUpward}\"\n >\n ${this._renderSelectAll()}\n\n ${repeat(this.options, opt => opt.value, this._renderOption.bind(this))}\n\n <li part=\"no-results\" class=\"no-results\">No results</li>\n </ul>\n </div>\n <slot name=\"option\" @slotchange=${() => this.requestUpdate('options')}></slot>\n <div class=\"errormessage\" id=\"error-msg-${this.id}\" role=\"alert\" aria-atomic=\"true\"\n ?data-hidden=\"${!this._hasErrorContent()}\" part=\"error\">\n ${unsafeSVG(alert)}\n <slot name=\"error\"></slot>\n </div>\n `;\n }\n}\n\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-combobox': TtCombobox;\n }\n}\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8CACnC;AAOT;IADT,KAAK,EAAE;iDAC6B;AAG3B;IADT,KAAK,EAAE;6CACoB;AAGlB;IADT,KAAK,EAAE;2CACuB;AAG/B;IADC,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;2CAC3B;AAGnC;IADC,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,wBAAwB,EAAE,CAAC;iDACrC;AAG/B;IADT,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACI;AAGnC;IADT,QAAQ,CAAC,qEAAqE,CAAC;mDAC3B;AAG3C;IADT,QAAQ,CAAC,0EAA0E,CAAC;sDACxB;AAGnD;IADT,QAAQ,CAAC,gGAAgG,CAAC;6DACvC;AAG1D;IADT,QAAQ,CAAC,wEAAwE,CAAC;oDACxB;AAGjD;IADT,QAAQ,CAAC,8FAA8F,CAAC;2DACvC;AAGxD;IADT,KAAK,CAAC,wBAAwB,CAAC;kDACY;AAGlC;IADT,KAAK,CAAC,iBAAiB,CAAC;kDACoB;AAKtC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAA,KAAa,CAAA,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;yCAC1B","sourcesContent":["/* eslint-disable lit-a11y/click-events-have-key-events */\nimport { html, LitElement, nothing, PropertyValues } from 'lit';\nimport { property, query, queryAll, queryAssignedElements, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { guard } from 'lit/directives/guard.js';\nimport { alert, chevronDown } from '@triptease/icons';\nimport { styles } from './styles.js';\n\n\nexport class TtCombobox extends LitElement {\n static styles = styles;\n\n static formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true\n };\n\n @property({ type: Boolean })\n multiselect = false;\n\n @property({ type: Boolean })\n disabled = false;\n\n @property({ type: Boolean })\n invalid = false;\n\n @property({ type: Boolean, attribute: 'display-select-all' })\n displaySelectAll = false;\n\n @property({ type: Boolean })\n required = false;\n\n @property({ type: String })\n name = '';\n\n @property({ type: String, attribute: 'aria-labelledby' })\n ariaLabelledby = nothing;\n\n @property({ type: Boolean, attribute: 'hide-caret' })\n hideCaret = false;\n\n @property({ type: String })\n placeholder?: string;\n\n @property({ type: String, attribute: 'select-all-placeholder' })\n selectAllPlaceholder?: string;\n\n @property({ type: Boolean, attribute: 'open-upward' })\n openUpward = false;\n\n get form(): HTMLFormElement | null {\n return this.internals.form;\n }\n\n @state()\n protected _activeOption: number = -1;\n\n @state()\n protected _expanded = false;\n\n @state()\n protected _filter: string = '';\n\n @queryAssignedElements({ slot: 'option', selector: 'option' })\n options!: Array<HTMLOptionElement>;\n\n @queryAssignedElements({ slot: 'option', selector: 'option:not([disabled])' })\n activeOptions!: Array<HTMLOptionElement>;\n\n @queryAssignedElements({ slot: 'error' })\n protected errorElements!: Array<HTMLElement>;\n\n @queryAll('li[role=\"option\"]:not([aria-disabled=\"true\"], [aria-hidden=\"true\"])')\n protected _visibleOptions!: Array<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([aria-disabled=\"true\"], [data-value=\"select-all\"])')\n protected _selectableOptions!: NodeListOf<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([aria-disabled=\"true\"], [data-value=\"select-all\"], [aria-hidden=\"true\"])')\n protected _selectableVisibleOptions!: NodeListOf<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([data-value=\"select-all\"])[aria-selected=\"true\"]')\n protected _selectedOptions!: NodeListOf<HTMLOptionElement>;\n\n @queryAll('li[role=\"option\"]:not([data-value=\"select-all\"], [aria-hidden=\"true\"])[aria-selected=\"true\"]')\n protected _selectedVisibleOptions!: NodeListOf<HTMLOptionElement>;\n\n @query('input[role=\"combobox\"]')\n protected _comboboxInput!: HTMLInputElement;\n\n @query('button:has(svg)')\n protected _chevronButton!: HTMLButtonElement;\n\n public internals: ReturnType<typeof this.attachInternals>;\n\n @property({ type: Array<String>, attribute: 'value' })\n public value: string[] = [];\n\n private get _isAllSelected(): boolean {\n return Array.from(this._selectableVisibleOptions).every(option => Array.from(this._selectedVisibleOptions).includes(option));\n }\n\n private _slotObserver: MutationObserver = new MutationObserver((mutations) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n this.requestUpdate('options');\n }\n });\n });\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n private _handleFocusOut(e: FocusEvent) {\n if (!this.shadowRoot!.contains(e.relatedTarget as Node | null)) {\n this._expanded = false;\n }\n }\n\n private _onFocus() {\n this._comboboxInput.focus();\n }\n\n public connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('focus', this._onFocus);\n }\n\n public disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener('focus', this._onFocus);\n }\n\n protected firstUpdated(changedProperties: PropertyValues) {\n this.internals.setFormValue(JSON.stringify(this.value));\n\n this._reportValidity();\n this._listenForOptionChange();\n\n super.firstUpdated(changedProperties);\n }\n\n protected update(changedProperties: PropertyValues) {\n if (changedProperties.has('value')) {\n this._valueChanged();\n\n if (changedProperties.get('value') !== undefined && JSON.stringify(changedProperties.get('value')) !== JSON.stringify(this.value)) {\n this._dispatchSelectedOptions();\n this._reportValidity();\n }\n }\n\n if (changedProperties.has('_expanded') && changedProperties.get('_expanded') && !this._expanded) {\n this.internals.states.add('interacted');\n }\n\n if (changedProperties.has('options')) {\n this.updateComplete.then(() => {\n this.value = Array.from(new Set([...this.value, ...Array.from(this._selectedOptions).map(option => option.dataset.value!)]));\n this._listenForOptionChange();\n });\n }\n super.update(changedProperties);\n }\n\n private _valueChanged = () => {\n this._selectableOptions.forEach(option => {\n if (this.value.includes(option.dataset.value!)) {\n this._checkOption(option);\n } else {\n this._uncheckOption(option);\n }\n });\n\n this.internals.setFormValue(JSON.stringify(this.value));\n };\n\n private _listenForOptionChange = () => {\n this.options.forEach(option => {\n this._slotObserver.observe(option, { attributes: true, attributeFilter: ['selected', 'disabled', 'hidden'] });\n });\n };\n\n private _reportValidity() {\n if (this.required && !this.value.length) {\n const errorMessage = this.multiselect ? 'Please select at least one option' : 'Please select an option';\n\n this.internals.setValidity({\n valueMissing: true\n }, errorMessage, this._comboboxInput);\n this.internals.states.add('--invalid');\n } else if (!this.internals.validity.valid) {\n this.internals.setValidity({});\n\n if (this.internals.states.has('--invalid')) {\n this.internals.states.delete('--invalid');\n }\n }\n }\n\n private get labels(): Array<HTMLElement> {\n return <Array<HTMLElement>>[...this.internals.labels];\n }\n\n private get labelContent(): string {\n if (this.ariaLabel !== null) {\n return this.ariaLabel;\n }\n\n return this.labels.map(label => label.innerText).join(', ');\n }\n\n private _onKeyUp(event: KeyboardEvent) {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this._expanded) {\n this._expanded = true;\n this._activeOption = -1;\n } else {\n this._activeOption = Math.min(this._visibleOptions.length - 1, this._activeOption + 1);\n }\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this._expanded) {\n this._activeOption = Math.max(0, this._activeOption - 1);\n }\n break;\n case 'Escape':\n event.preventDefault();\n if (this._expanded) {\n this._expanded = false;\n } else if (this._filter !== '') {\n this._filter = '';\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (this._expanded) {\n this._visibleOptions[this._activeOption].click();\n }\n break;\n default:\n break;\n }\n }\n\n private _uncheckOption(option: HTMLElement) {\n if (option.dataset.deselectable !== 'true') return;\n\n option.setAttribute('aria-selected', 'false');\n const checkbox = <HTMLInputElement>option.querySelector('input[type=\"checkbox\"]');\n if (checkbox) {\n checkbox.checked = false;\n }\n }\n\n private _checkOption(option: HTMLElement) {\n if (!this.multiselect) {\n this._selectableOptions.forEach(opt => {\n this._uncheckOption(opt);\n });\n }\n\n option.setAttribute('aria-selected', 'true');\n const checkbox = <HTMLInputElement>option.querySelector('input[type=\"checkbox\"]');\n if (checkbox) {\n checkbox.checked = true;\n }\n }\n\n private _getActiveOptionId(): string | undefined {\n if (this._activeOption === -1 || this._visibleOptions.length === 0) {\n return undefined;\n }\n\n const option = this._visibleOptions[this._activeOption];\n return option.id;\n }\n\n private _onClick() {\n this._expanded = !this._expanded;\n\n if (this._expanded) {\n (<HTMLElement>this.shadowRoot?.querySelector('input[role=\"combobox\"]'))?.focus();\n }\n }\n\n private _onChevronClick() {\n (<HTMLElement>this.shadowRoot?.querySelector('input[role=\"combobox\"]'))?.focus();\n }\n\n private _onClickOption(event: MouseEvent) {\n event.preventDefault();\n event.stopPropagation();\n const option = event.currentTarget as HTMLElement;\n const selectedValue = option.dataset.value as string;\n\n\n if (this.multiselect) {\n if (this.value.includes(selectedValue)) {\n this.value = this.value.filter(value => value !== selectedValue);\n } else {\n this.value = [...this.value, selectedValue];\n }\n } else {\n this.value = [selectedValue];\n this._expanded = false;\n }\n }\n\n private _onInput(event: Event) {\n const input = event.target as HTMLInputElement;\n const filter = input.value.toLowerCase();\n if (filter !== '' && !this._expanded) {\n this._expanded = true;\n }\n this._activeOption = -1;\n this._filter = filter;\n }\n\n private _dispatchSelectedOptions() {\n this.dispatchEvent(new Event('change', {\n bubbles: true,\n composed: true\n }));\n }\n\n private _selectAll = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n\n // If filtering, and all visible options are selected, deselect only visible options\n // Else if filtering, select all visible options\n\n if (this._filter !== '' && this._isAllSelected) {\n const selectedVisibleValues = Array.from(this._selectedVisibleOptions).map(option => option.dataset.value!);\n this.value = this.value.filter(value => !selectedVisibleValues.includes(value));\n } else if (this._filter !== '') {\n this.value = Array.from(new Set([...this.value, ...Array.from(this._selectableVisibleOptions).map(option => option.dataset.value!)]));\n } else if (this.value.length === this._selectableOptions.length) {\n this.value = [];\n } else {\n this.value = Array.from(this._selectableOptions).map(option => option.dataset.value!);\n }\n };\n\n private get _isValid(): boolean {\n return this.internals.validity.valid && !this.invalid;\n }\n\n private _renderCombobox() {\n const placeHolderValue = guard(\n [this.placeholder, this.disabled, this.value, this.activeOptions.length, this.selectAllPlaceholder],\n () => {\n if (this.placeholder) {\n return this.placeholder;\n }\n\n if (this.disabled) {\n return 'Disabled';\n }\n if (!this._selectedVisibleOptions.length) {\n return 'No options selected';\n }\n if (this._selectedVisibleOptions.length === 1) {\n return this._selectedVisibleOptions[0].textContent?.trim();\n }\n\n if (this._isAllSelected) {\n return this.selectAllPlaceholder || 'All options selected';\n }\n\n return `${this._selectedVisibleOptions.length} options selected`;\n });\n\n return html`\n <input\n type=\"text\"\n id=\"${this.id}\"\n name=\"${this.name}\"\n autocomplete=\"off\"\n aria-label=\"${this.labelContent}\"\n aria-labelledby=\"${this.ariaLabelledby}\"\n role=\"combobox\"\n aria-controls=\"${this.id}-list\"\n aria-expanded=\"${this._expanded}\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-disabled=\"${this.disabled}\"\n aria-invalid=\"${!this._isValid}\"\n aria-errormessage=\"${!this._isValid ? `error-msg-${this.id}` : nothing}\"\n aria-required=\"${this.required}\"\n ?disabled=${this.disabled}\n aria-activedescendant=\"${ifDefined(this._getActiveOptionId())}\"\n @input=\"${this._onInput}\"\n .value=\"${this._filter}\"\n .placeholder=\"${placeHolderValue}\"\n @focusout=\"${this._handleFocusOut}\"\n part=\"input\"\n class=${this.hideCaret ? 'hide-caret' : ''}\n />`;\n }\n\n private _renderSelectAll = () => {\n if (!this.multiselect || !this.displaySelectAll) {\n return nothing;\n }\n const id = `${this.id}-option-select-all`;\n const active = this._getActiveOptionId() === id;\n const selected = this._isAllSelected;\n // eslint-disable-next-line lit-a11y/click-events-have-key-events\n return html`\n <li\n class=\"select-all\"\n role=\"option\"\n id=\"${this.id}-option-select-all\"\n aria-selected=\"${selected}\"\n data-active=${active}\n @click=\"${this._selectAll}\"\n @mousedown=\"${(evt: MouseEvent) => evt.preventDefault()}\"\n data-value=\"select-all\"\n part=\"option\"\n >\n <input type=\"checkbox\" ?checked=${selected} role=\"presentation\" tabindex=\"-1\" part=\"checkbox\">\n Select all\n </li>`;\n };\n\n private _renderOption(option: HTMLOptionElement) {\n const hidden = Boolean((this._filter !== '' && !option.value.toLowerCase().includes(this._filter) && !option.innerText.toLowerCase().includes(this._filter)) || option.hidden);\n\n // if (this._filter !== '' && !option.value.toLowerCase().includes(this._filter) && !option.innerText.toLowerCase().includes(this._filter)) {\n // return nothing;\n // }\n\n const id = `${this.id}-option-${option.value}`;\n const active = this._getActiveOptionId() === id;\n const selected = Boolean(this.multiselect && option.selected);\n\n return html`\n <li\n role=\"option\"\n id=\"${this.id}-option-${option.value}\"\n aria-selected=${this.multiselect && option.selected}\n data-active=${active}\n @click=\"${this._onClickOption}\"\n @mousedown=\"${(event: MouseEvent) => event.preventDefault()}\"\n data-value=\"${option.value}\"\n aria-disabled=${option.disabled}\n aria-hidden=${hidden || nothing}\n data-deselectable=${!option.selected}\n part=\"option\"\n >\n ${this.multiselect ? html`<input type=\"checkbox\" ?checked=${selected}\n role=\"presentation\" tabindex=\"-1\" part=\"checkbox\">` : nothing}\n <span>${unsafeHTML(option.innerHTML)}</span>\n </li>`;\n }\n\n private _renderChevron = () => html`\n <button type=\"button\" aria-label=\"Expand\" @click=\"${this._onChevronClick}\" aria-expanded=\"${this._expanded}\"\n aria-controls=\"${this.id}-list\" tabindex=\"-1\" ?disabled=${this.disabled} part=\"arrow\">\n ${unsafeSVG(chevronDown)}\n </button>\n `;\n\n private _hasErrorContent(): boolean {\n return this.errorElements?.length > 0;\n }\n\n render() {\n return html`\n <div class=\"tt-combobox-container\" @focus=\"${this._onFocus}\" @keydown=\"${this._onKeyUp}\" @click=\"${this._onClick}\"\n aria-disabled=\"${this.disabled}\" part=\"container\">\n <slot name=\"icon\" part=\"icon\"></slot>\n ${this._renderCombobox()}\n ${this._renderChevron()}\n <ul\n id=\"${this.id}-list\"\n role=\"listbox\"\n aria-multiselectable=\"${this.multiselect}\"\n aria-label=\"${this.labelContent}\"\n part=\"listbox\"\n ?data-open-upward=\"${this.openUpward}\"\n >\n ${this._renderSelectAll()}\n\n ${repeat(this.options, opt => opt.value, this._renderOption.bind(this))}\n\n <li part=\"no-results\" class=\"no-results\">No results</li>\n </ul>\n </div>\n <slot name=\"option\" @slotchange=${() => this.requestUpdate('options')}></slot>\n <div class=\"errormessage\" id=\"error-msg-${this.id}\" role=\"alert\" aria-atomic=\"true\"\n ?data-hidden=\"${!this._hasErrorContent()}\" part=\"error\">\n ${unsafeSVG(alert)}\n <slot name=\"error\"></slot>\n </div>\n `;\n }\n}\n\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-combobox': TtCombobox;\n }\n}\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent tt-combobox following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "@triptease",
6
- "version": "5.3.1",
6
+ "version": "5.4.0",
7
7
  "type": "module",
8
8
  "main": "dist/src/index.js",
9
9
  "module": "dist/src/index.js",
@@ -8,6 +8,12 @@ describe('TtCombobox', () => {
8
8
 
9
9
  const comboboxPlaceholderText = (combobox: HTMLInputElement) => combobox.getAttribute('placeholder');
10
10
 
11
+ const filterCombobox = (combobox: HTMLInputElement, text: string) => {
12
+ // eslint-disable-next-line no-param-reassign
13
+ combobox.value = text;
14
+ combobox.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
15
+ }
16
+
11
17
  it('Should render with the default placeholder text', async () => {
12
18
  const el = await fixture<TtCombobox>(html`
13
19
  <tt-combobox id="combobox">
@@ -396,6 +402,75 @@ describe('TtCombobox', () => {
396
402
  expect(selectedOptions).to.have.lengthOf(2);
397
403
  });
398
404
 
405
+ it('should only add the visible options to the value when select all is clicked after filtering', async () => {
406
+ const el = await fixture<TtCombobox>(html`
407
+ <tt-combobox id="combobox" multiselect display-select-all select-all-placeholder="Everything">
408
+ <span slot="label">Test combobox</span>
409
+ <option slot="option" value="1">Option 1</option>
410
+ <option slot="option" value="2">Option 2</option>
411
+ <option slot="option" value="3">Option 3</option>
412
+ </tt-combobox>`);
413
+
414
+ // Open the combobox
415
+ const combobox = getCombobox(el);
416
+ combobox.click();
417
+
418
+ // Filter options by typing "Option 1" to only show that option
419
+ filterCombobox(combobox, 'Option 1');
420
+ await elementUpdated(el);
421
+
422
+ // Only Option 1 should be visible
423
+ const visibleOptions = el.shadowRoot!.querySelectorAll('[role="option"]:not([data-value="select-all"]):not([aria-hidden="true"])');
424
+ await expect(visibleOptions.length).to.equal(1);
425
+ await expect(visibleOptions[0].getAttribute('data-value')).to.equal('1');
426
+
427
+ // Click "Select All"
428
+ const selectAll = el.shadowRoot!.querySelector('[role="option"][data-value="select-all"]') as HTMLLIElement;
429
+ selectAll.click();
430
+ await elementUpdated(el);
431
+
432
+ // Clear the filter
433
+ filterCombobox(combobox, '');
434
+ await elementUpdated(el);
435
+
436
+ // Verify that only "Option 1" is selected
437
+ await expect(el.value).to.deep.equal(['1']);
438
+ });
439
+
440
+ it('should only remove the visible options from the value when deselecting select all after filtering', async () => {
441
+ const el = await fixture<TtCombobox>(html`
442
+ <tt-combobox id="combobox" multiselect display-select-all select-all-placeholder="Everything">
443
+ <span slot="label">Test combobox</span>
444
+ <option slot="option" value="1">Option 1</option>
445
+ <option slot="option" value="2">Option 2</option>
446
+ <option slot="option" value="3">Option 3</option>
447
+ </tt-combobox>`);
448
+
449
+ // Open the combobox
450
+ const combobox = getCombobox(el);
451
+ combobox.click();
452
+
453
+ // Click "Select All"
454
+ const selectAll = el.shadowRoot!.querySelector('[role="option"][data-value="select-all"]') as HTMLLIElement;
455
+ selectAll.click();
456
+ await elementUpdated(el);
457
+
458
+ // Filter options by typing "Option 1" to only show that option
459
+ filterCombobox(combobox, 'Option 1');
460
+ await elementUpdated(el);
461
+
462
+ // Click "Select All" again to deselect visible options
463
+ selectAll.click();
464
+ await elementUpdated(el);
465
+
466
+ // Clear the filter
467
+ filterCombobox(combobox, '');
468
+ await elementUpdated(el);
469
+
470
+ // Verify that only "Option 1" is selected
471
+ await expect(el.value).to.deep.equal(['2', '3']);
472
+ });
473
+
399
474
  describe('Form Integration', () => {
400
475
  it('should include its values in FormData when submitted', async () => {
401
476
  // Create a form with the combobox component