@triptease/tt-combobox 5.5.1 → 5.5.3
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/CHANGELOG.md +8 -0
- package/README.md +0 -1
- package/custom-elements.json +5 -320
- package/demo/index.html +18 -25
- package/dist/src/TtCombobox.js +83 -61
- package/dist/src/TtCombobox.js.map +1 -1
- package/dist/src/styles.js +15 -17
- package/dist/src/styles.js.map +1 -1
- package/dist/src/tt-combobox.js.map +1 -1
- package/dist/src/tt-option/TtOption.js +2 -3
- package/dist/src/tt-option/TtOption.js.map +1 -1
- package/dist/src/tt-option/styles.js +57 -56
- package/dist/src/tt-option/styles.js.map +1 -1
- package/dist/src/tt-option/tt-option.js.map +1 -1
- package/package.json +6 -47
- package/test/tt-combobox.test.ts +81 -69
package/dist/src/TtCombobox.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
/* eslint-disable lit-a11y/click-events-have-key-events */
|
|
3
2
|
import { html, LitElement, nothing } from 'lit';
|
|
4
3
|
import { property, query, queryAll, queryAssignedElements, state } from 'lit/decorators.js';
|
|
5
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -14,13 +13,14 @@ export class TtCombobox extends LitElement {
|
|
|
14
13
|
return this.internals.form;
|
|
15
14
|
}
|
|
16
15
|
get _isAllSelected() {
|
|
17
|
-
return Boolean(this._visibleOptionsNotSelectAll.length) &&
|
|
16
|
+
return (Boolean(this._visibleOptionsNotSelectAll.length) &&
|
|
17
|
+
Array.from(this._visibleOptionsNotSelectAll).every((option) => this.value.includes(option.value)));
|
|
18
18
|
}
|
|
19
19
|
get _selectedVisibleOptions() {
|
|
20
|
-
return Array.from(this._visibleOptions).filter(option => this.value.includes(option.value));
|
|
20
|
+
return Array.from(this._visibleOptions).filter((option) => this.value.includes(option.value));
|
|
21
21
|
}
|
|
22
22
|
get _selectedOptions() {
|
|
23
|
-
return Array.from(this._visibleOptionsNotSelectAll).filter(option => this.value.includes(option.value));
|
|
23
|
+
return Array.from(this._visibleOptionsNotSelectAll).filter((option) => this.value.includes(option.value));
|
|
24
24
|
}
|
|
25
25
|
constructor() {
|
|
26
26
|
super();
|
|
@@ -38,14 +38,14 @@ export class TtCombobox extends LitElement {
|
|
|
38
38
|
this._filter = '';
|
|
39
39
|
this.value = [];
|
|
40
40
|
this._slotObserver = new MutationObserver((mutations) => {
|
|
41
|
-
mutations.forEach(mutation => {
|
|
41
|
+
mutations.forEach((mutation) => {
|
|
42
42
|
if (mutation.type === 'attributes') {
|
|
43
43
|
this.requestUpdate('options');
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
});
|
|
47
47
|
this._valueChanged = () => {
|
|
48
|
-
this._selectableOptions.forEach(option => {
|
|
48
|
+
this._selectableOptions.forEach((option) => {
|
|
49
49
|
if (this.value.includes(option.value)) {
|
|
50
50
|
this._checkOption(option);
|
|
51
51
|
}
|
|
@@ -56,7 +56,7 @@ export class TtCombobox extends LitElement {
|
|
|
56
56
|
this.internals.setFormValue(JSON.stringify(this.value));
|
|
57
57
|
};
|
|
58
58
|
this._listenForOptionChange = () => {
|
|
59
|
-
this.options.forEach(option => {
|
|
59
|
+
this.options.forEach((option) => {
|
|
60
60
|
this._slotObserver.observe(option, { attributes: true, attributeFilter: ['selected', 'disabled', 'hidden'] });
|
|
61
61
|
});
|
|
62
62
|
};
|
|
@@ -66,17 +66,17 @@ export class TtCombobox extends LitElement {
|
|
|
66
66
|
// If filtering, and all visible options are selected, deselect only visible options
|
|
67
67
|
// Else if filtering, select all visible options
|
|
68
68
|
if (this._filter !== '' && this._isAllSelected) {
|
|
69
|
-
const selectedVisibleValues = this._selectedVisibleOptions.map(option => option.value);
|
|
70
|
-
this.value = this.value.filter(value => !selectedVisibleValues.includes(value));
|
|
69
|
+
const selectedVisibleValues = this._selectedVisibleOptions.map((option) => option.value);
|
|
70
|
+
this.value = this.value.filter((value) => !selectedVisibleValues.includes(value));
|
|
71
71
|
}
|
|
72
72
|
else if (this._filter !== '') {
|
|
73
|
-
this.value = Array.from(new Set([...this.value, ...Array.from(this._selectableVisibleOptions).map(option => option.value)]));
|
|
73
|
+
this.value = Array.from(new Set([...this.value, ...Array.from(this._selectableVisibleOptions).map((option) => option.value)]));
|
|
74
74
|
}
|
|
75
75
|
else if (this.value.length === this._selectableOptions.length) {
|
|
76
76
|
this.value = [];
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
|
-
this.value = Array.from(this._selectableOptions).map(option => option.value);
|
|
79
|
+
this.value = Array.from(this._selectableOptions).map((option) => option.value);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
this._renderSelectAll = () => {
|
|
@@ -86,7 +86,6 @@ export class TtCombobox extends LitElement {
|
|
|
86
86
|
const id = `${this.id}-option-select-all`;
|
|
87
87
|
const active = this._getActiveOptionId() === id;
|
|
88
88
|
const selected = this._isAllSelected;
|
|
89
|
-
// eslint-disable-next-line lit-a11y/click-events-have-key-events
|
|
90
89
|
return html `
|
|
91
90
|
<tt-option
|
|
92
91
|
id="${id}"
|
|
@@ -98,12 +97,21 @@ export class TtCombobox extends LitElement {
|
|
|
98
97
|
exportparts="option, checkbox"
|
|
99
98
|
part="option"
|
|
100
99
|
value="select-all"
|
|
101
|
-
|
|
100
|
+
>Select all</tt-option
|
|
101
|
+
>
|
|
102
102
|
`;
|
|
103
103
|
};
|
|
104
104
|
this._renderChevron = () => html `
|
|
105
|
-
<button
|
|
106
|
-
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
aria-label="Expand"
|
|
108
|
+
@click="${this._onChevronClick}"
|
|
109
|
+
aria-expanded="${this._expanded}"
|
|
110
|
+
aria-controls="${this.id}-list"
|
|
111
|
+
tabindex="-1"
|
|
112
|
+
?disabled=${this.disabled}
|
|
113
|
+
part="arrow"
|
|
114
|
+
>
|
|
107
115
|
${unsafeSVG(chevronDown)}
|
|
108
116
|
</button>
|
|
109
117
|
`;
|
|
@@ -134,7 +142,8 @@ export class TtCombobox extends LitElement {
|
|
|
134
142
|
update(changedProperties) {
|
|
135
143
|
if (changedProperties.has('value')) {
|
|
136
144
|
this._valueChanged();
|
|
137
|
-
if (changedProperties.get('value') !== undefined &&
|
|
145
|
+
if (changedProperties.get('value') !== undefined &&
|
|
146
|
+
JSON.stringify(changedProperties.get('value')) !== JSON.stringify(this.value)) {
|
|
138
147
|
this._dispatchSelectedOptions();
|
|
139
148
|
this._reportValidity();
|
|
140
149
|
}
|
|
@@ -144,8 +153,8 @@ export class TtCombobox extends LitElement {
|
|
|
144
153
|
}
|
|
145
154
|
if (changedProperties.has('options')) {
|
|
146
155
|
this.updateComplete.then(() => {
|
|
147
|
-
const selectedAssignedOptions = Array.from(this.options).filter(option => option.selected);
|
|
148
|
-
this.value = Array.from(new Set([...this.value, ...selectedAssignedOptions.map(option => option.value)]));
|
|
156
|
+
const selectedAssignedOptions = Array.from(this.options).filter((option) => option.selected);
|
|
157
|
+
this.value = Array.from(new Set([...this.value, ...selectedAssignedOptions.map((option) => option.value)]));
|
|
149
158
|
this._listenForOptionChange();
|
|
150
159
|
});
|
|
151
160
|
}
|
|
@@ -155,7 +164,7 @@ export class TtCombobox extends LitElement {
|
|
|
155
164
|
if (this.required && !this.value.length) {
|
|
156
165
|
const errorMessage = this.multiselect ? 'Please select at least one tt-option' : 'Please select an tt-option';
|
|
157
166
|
this.internals.setValidity({
|
|
158
|
-
valueMissing: true
|
|
167
|
+
valueMissing: true,
|
|
159
168
|
}, errorMessage, this._comboboxInput);
|
|
160
169
|
this.internals.states.add('--invalid');
|
|
161
170
|
}
|
|
@@ -173,7 +182,7 @@ export class TtCombobox extends LitElement {
|
|
|
173
182
|
if (this.ariaLabel !== null) {
|
|
174
183
|
return this.ariaLabel;
|
|
175
184
|
}
|
|
176
|
-
return this.labels.map(label => label.innerText).join(', ');
|
|
185
|
+
return this.labels.map((label) => label.innerText).join(', ');
|
|
177
186
|
}
|
|
178
187
|
_onKeyUp(event) {
|
|
179
188
|
switch (event.key) {
|
|
@@ -223,7 +232,7 @@ export class TtCombobox extends LitElement {
|
|
|
223
232
|
}
|
|
224
233
|
_checkOption(option) {
|
|
225
234
|
if (!this.multiselect) {
|
|
226
|
-
this._selectableOptions.forEach(opt => {
|
|
235
|
+
this._selectableOptions.forEach((opt) => {
|
|
227
236
|
this._uncheckOption(opt);
|
|
228
237
|
});
|
|
229
238
|
}
|
|
@@ -258,7 +267,7 @@ export class TtCombobox extends LitElement {
|
|
|
258
267
|
const selectedValue = option.value;
|
|
259
268
|
if (this.multiselect) {
|
|
260
269
|
if (this.value.includes(selectedValue)) {
|
|
261
|
-
this.value = this.value.filter(value => value !== selectedValue);
|
|
270
|
+
this.value = this.value.filter((value) => value !== selectedValue);
|
|
262
271
|
}
|
|
263
272
|
else {
|
|
264
273
|
this.value = [...this.value, selectedValue];
|
|
@@ -281,7 +290,7 @@ export class TtCombobox extends LitElement {
|
|
|
281
290
|
_dispatchSelectedOptions() {
|
|
282
291
|
this.dispatchEvent(new Event('change', {
|
|
283
292
|
bubbles: true,
|
|
284
|
-
composed: true
|
|
293
|
+
composed: true,
|
|
285
294
|
}));
|
|
286
295
|
}
|
|
287
296
|
get _isValid() {
|
|
@@ -299,42 +308,46 @@ export class TtCombobox extends LitElement {
|
|
|
299
308
|
return 'No options selected';
|
|
300
309
|
}
|
|
301
310
|
if (this.value.length === 1) {
|
|
302
|
-
return Array.from(this._selectableVisibleOptions)
|
|
311
|
+
return Array.from(this._selectableVisibleOptions)
|
|
312
|
+
.find((option) => option.value === this.value[0])
|
|
313
|
+
?.textContent?.trim();
|
|
303
314
|
}
|
|
304
315
|
if (this._isAllSelected) {
|
|
305
316
|
return this.selectAllPlaceholder || 'All options selected';
|
|
306
317
|
}
|
|
307
318
|
return `${this._selectedVisibleOptions.length} options selected`;
|
|
308
319
|
});
|
|
309
|
-
return html `
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
/>`;
|
|
320
|
+
return html ` <input
|
|
321
|
+
type="text"
|
|
322
|
+
id="${this.id}"
|
|
323
|
+
name="${this.name}"
|
|
324
|
+
autocomplete="off"
|
|
325
|
+
aria-label="${this.labelContent}"
|
|
326
|
+
aria-labelledby="${this.ariaLabelledby}"
|
|
327
|
+
role="combobox"
|
|
328
|
+
aria-controls="${this.id}-list"
|
|
329
|
+
aria-expanded="${this._expanded}"
|
|
330
|
+
aria-autocomplete="list"
|
|
331
|
+
aria-haspopup="listbox"
|
|
332
|
+
aria-disabled="${this.disabled}"
|
|
333
|
+
aria-invalid="${!this._isValid}"
|
|
334
|
+
aria-errormessage="${!this._isValid ? `error-msg-${this.id}` : nothing}"
|
|
335
|
+
aria-required="${this.required}"
|
|
336
|
+
?disabled=${this.disabled}
|
|
337
|
+
aria-activedescendant="${ifDefined(this._getActiveOptionId())}"
|
|
338
|
+
@input="${this._onInput}"
|
|
339
|
+
.value="${this._filter}"
|
|
340
|
+
.placeholder="${placeHolderValue}"
|
|
341
|
+
@focusout="${this._handleFocusOut}"
|
|
342
|
+
part="input"
|
|
343
|
+
class=${this.hideCaret ? 'hide-caret' : ''}
|
|
344
|
+
/>`;
|
|
335
345
|
}
|
|
336
346
|
_renderOption(option) {
|
|
337
|
-
const hidden = Boolean((this._filter !== '' &&
|
|
347
|
+
const hidden = Boolean((this._filter !== '' &&
|
|
348
|
+
!option.value.toLowerCase().includes(this._filter.toLowerCase()) &&
|
|
349
|
+
!option.innerText.toLowerCase().includes(this._filter.toLowerCase())) ||
|
|
350
|
+
option.hidden);
|
|
338
351
|
const id = `${this.id}-option-${option.value}`;
|
|
339
352
|
const active = this._getActiveOptionId() === id;
|
|
340
353
|
const selected = this.value.includes(option.value);
|
|
@@ -358,11 +371,16 @@ export class TtCombobox extends LitElement {
|
|
|
358
371
|
}
|
|
359
372
|
render() {
|
|
360
373
|
return html `
|
|
361
|
-
<div
|
|
362
|
-
|
|
374
|
+
<div
|
|
375
|
+
class="tt-combobox-container"
|
|
376
|
+
@focus="${this._onFocus}"
|
|
377
|
+
@keydown="${this._onKeyUp}"
|
|
378
|
+
@click="${this._onClick}"
|
|
379
|
+
aria-disabled="${this.disabled}"
|
|
380
|
+
part="container"
|
|
381
|
+
>
|
|
363
382
|
<slot name="icon" part="icon"></slot>
|
|
364
|
-
${this._renderCombobox()}
|
|
365
|
-
${this._renderChevron()}
|
|
383
|
+
${this._renderCombobox()} ${this._renderChevron()}
|
|
366
384
|
<ul
|
|
367
385
|
id="${this.id}-list"
|
|
368
386
|
role="listbox"
|
|
@@ -371,16 +389,20 @@ export class TtCombobox extends LitElement {
|
|
|
371
389
|
part="listbox"
|
|
372
390
|
?data-open-upward="${this.openUpward}"
|
|
373
391
|
>
|
|
374
|
-
${this._renderSelectAll()}
|
|
375
|
-
|
|
376
|
-
${repeat(this.options, opt => opt.value, this._renderOption.bind(this))}
|
|
392
|
+
${this._renderSelectAll()} ${repeat(this.options, (opt) => opt.value, this._renderOption.bind(this))}
|
|
377
393
|
|
|
378
394
|
<li part="no-results" class="no-results">No results</li>
|
|
379
395
|
</ul>
|
|
380
396
|
</div>
|
|
381
397
|
<slot name="option" @slotchange=${() => this.requestUpdate('options')}></slot>
|
|
382
|
-
<div
|
|
383
|
-
|
|
398
|
+
<div
|
|
399
|
+
class="errormessage"
|
|
400
|
+
id="error-msg-${this.id}"
|
|
401
|
+
role="alert"
|
|
402
|
+
aria-atomic="true"
|
|
403
|
+
?data-hidden="${!this._hasErrorContent()}"
|
|
404
|
+
part="error"
|
|
405
|
+
>
|
|
384
406
|
${unsafeSVG(alert)}
|
|
385
407
|
<slot name="error"></slot>
|
|
386
408
|
</div>
|
|
@@ -391,7 +413,7 @@ TtCombobox.styles = styles;
|
|
|
391
413
|
TtCombobox.formAssociated = true;
|
|
392
414
|
TtCombobox.shadowRootOptions = {
|
|
393
415
|
...LitElement.shadowRootOptions,
|
|
394
|
-
delegatesFocus: true
|
|
416
|
+
delegatesFocus: true,
|
|
395
417
|
};
|
|
396
418
|
__decorate([
|
|
397
419
|
property({ type: Boolean })
|
|
@@ -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;AAIrC,MAAM,OAAO,UAAW,SAAQ,UAAU;IA2CxC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC7B,CAAC;IA2CD,IAAY,cAAc;QACxB,OAAO,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,KAAK,CAAC,MAAM,C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AAC,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';\nimport { TtOption } from './tt-option/TtOption.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: 'tt-option:not([disabled])' })\n activeOptions!: Array<HTMLOptionElement>;\n\n @queryAssignedElements({ slot: 'error' })\n protected errorElements!: Array<HTMLElement>;\n\n @queryAll('tt-option:not([hidden], [disabled])')\n protected _visibleOptions!: Array<TtOption>;\n\n @queryAll('tt-option:not([hidden], .select-all')\n protected _visibleOptionsNotSelectAll!: Array<TtOption>;\n\n @queryAll('tt-option:not([disabled], .select-all)')\n protected _selectableOptions!: NodeListOf<TtOption>;\n\n @queryAll('tt-option:not([disabled], [hidden], .select-all)')\n protected _selectableVisibleOptions!: NodeListOf<TtOption>;\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 Boolean(this._visibleOptionsNotSelectAll.length) && Array.from(this._visibleOptionsNotSelectAll).every(option => this.value.includes(option.value));\n }\n\n protected get _selectedVisibleOptions(): Array<TtOption> {\n return Array.from(this._visibleOptions).filter(option => this.value.includes(option.value));\n }\n\n protected get _selectedOptions(): Array<TtOption> {\n return Array.from(this._visibleOptionsNotSelectAll).filter(option => this.value.includes(option.value));\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 const selectedAssignedOptions = Array.from(this.options).filter(option => option.selected);\n this.value = Array.from(new Set([...this.value, ...selectedAssignedOptions.map(option => option.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.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 tt-option' : 'Please select an tt-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\n const option = event.currentTarget as TtOption;\n if (option.disabled) return;\n\n const selectedValue = option.value as string;\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;\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 = this._selectedVisibleOptions.map(option => option.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.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.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.value.length) {\n return 'No options selected';\n }\n if (this.value.length === 1) {\n return Array.from(this._selectableVisibleOptions).find(option => option.value === this.value[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\n return html`\n <tt-option\n id=\"${id}\"\n class=\"select-all\"\n ?selected=${selected}\n ?active=${active}\n include-checkbox\n @click=\"${this._selectAll}\"\n exportparts=\"option, checkbox\"\n part=\"option\"\n value=\"select-all\"\n >Select all</tt-option>\n `;\n };\n\n private _renderOption(option: HTMLOptionElement) {\n const hidden = Boolean((this._filter !== '' && !option.value.toLowerCase().includes(this._filter.toLowerCase()) && !option.innerText.toLowerCase().includes(this._filter.toLowerCase())) || option.hidden);\n\n const id = `${this.id}-option-${option.value}`;\n const active = this._getActiveOptionId() === id;\n const selected = this.value.includes(option.value);\n\n return html`\n <tt-option\n id=\"${id}\"\n value=\"${option.value}\"\n ?selected=${selected}\n ?disabled=${option.disabled}\n ?active=${active}\n ?include-checkbox=${this.multiselect}\n ?hidden=${hidden}\n @click=\"${this._onClickOption}\"\n >\n ${unsafeHTML(option.innerHTML)}\n </tt-option>\n `;\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"]}
|
|
1
|
+
{"version":3,"file":"TtCombobox.js","sourceRoot":"","sources":["../../src/TtCombobox.ts"],"names":[],"mappings":";AAAA,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;AAGr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A2B,EAAE,CAAC;iDACxC;AAG/B;IADT,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACI;AAGnC;IADT,QAAQ,CAAC,qCAAqC,CAAC;mDACJ;AAGlC;IADT,QAAQ,CAAC,qCAAqC,CAAC;+DACQ;AAG9C;IADT,QAAQ,CAAC,wCAAwC,CAAC;sDACC;AAG1C;IADT,QAAQ,CAAC,kDAAkD,CAAC;6DACF;AAGjD;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":["import { 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';\nimport { TtOption } from './tt-option/TtOption.js';\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: 'tt-option:not([disabled])' })\n activeOptions!: Array<HTMLOptionElement>;\n\n @queryAssignedElements({ slot: 'error' })\n protected errorElements!: Array<HTMLElement>;\n\n @queryAll('tt-option:not([hidden], [disabled])')\n protected _visibleOptions!: Array<TtOption>;\n\n @queryAll('tt-option:not([hidden], .select-all')\n protected _visibleOptionsNotSelectAll!: Array<TtOption>;\n\n @queryAll('tt-option:not([disabled], .select-all)')\n protected _selectableOptions!: NodeListOf<TtOption>;\n\n @queryAll('tt-option:not([disabled], [hidden], .select-all)')\n protected _selectableVisibleOptions!: NodeListOf<TtOption>;\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 (\n Boolean(this._visibleOptionsNotSelectAll.length) &&\n Array.from(this._visibleOptionsNotSelectAll).every((option) => this.value.includes(option.value))\n );\n }\n\n protected get _selectedVisibleOptions(): Array<TtOption> {\n return Array.from(this._visibleOptions).filter((option) => this.value.includes(option.value));\n }\n\n protected get _selectedOptions(): Array<TtOption> {\n return Array.from(this._visibleOptionsNotSelectAll).filter((option) => this.value.includes(option.value));\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 (\n changedProperties.get('value') !== undefined &&\n JSON.stringify(changedProperties.get('value')) !== JSON.stringify(this.value)\n ) {\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 const selectedAssignedOptions = Array.from(this.options).filter((option) => option.selected);\n this.value = Array.from(new Set([...this.value, ...selectedAssignedOptions.map((option) => option.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.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 tt-option' : 'Please select an tt-option';\n\n this.internals.setValidity(\n {\n valueMissing: true,\n },\n errorMessage,\n this._comboboxInput\n );\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\n const option = event.currentTarget as TtOption;\n if (option.disabled) return;\n\n const selectedValue = option.value as string;\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;\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(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\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 = this._selectedVisibleOptions.map((option) => option.value);\n this.value = this.value.filter((value) => !selectedVisibleValues.includes(value));\n } else if (this._filter !== '') {\n this.value = Array.from(\n new Set([...this.value, ...Array.from(this._selectableVisibleOptions).map((option) => option.value)])\n );\n } else if (this.value.length === this._selectableOptions.length) {\n this.value = [];\n } else {\n this.value = Array.from(this._selectableOptions).map((option) => option.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.value.length) {\n return 'No options selected';\n }\n if (this.value.length === 1) {\n return Array.from(this._selectableVisibleOptions)\n .find((option) => option.value === this.value[0])\n ?.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\n return html` <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\n return html`\n <tt-option\n id=\"${id}\"\n class=\"select-all\"\n ?selected=${selected}\n ?active=${active}\n include-checkbox\n @click=\"${this._selectAll}\"\n exportparts=\"option, checkbox\"\n part=\"option\"\n value=\"select-all\"\n >Select all</tt-option\n >\n `;\n };\n\n private _renderOption(option: HTMLOptionElement) {\n const hidden = Boolean(\n (this._filter !== '' &&\n !option.value.toLowerCase().includes(this._filter.toLowerCase()) &&\n !option.innerText.toLowerCase().includes(this._filter.toLowerCase())) ||\n option.hidden\n );\n\n const id = `${this.id}-option-${option.value}`;\n const active = this._getActiveOptionId() === id;\n const selected = this.value.includes(option.value);\n\n return html`\n <tt-option\n id=\"${id}\"\n value=\"${option.value}\"\n ?selected=${selected}\n ?disabled=${option.disabled}\n ?active=${active}\n ?include-checkbox=${this.multiselect}\n ?hidden=${hidden}\n @click=\"${this._onClickOption}\"\n >\n ${unsafeHTML(option.innerHTML)}\n </tt-option>\n `;\n }\n\n private _renderChevron = () => html`\n <button\n type=\"button\"\n aria-label=\"Expand\"\n @click=\"${this._onChevronClick}\"\n aria-expanded=\"${this._expanded}\"\n aria-controls=\"${this.id}-list\"\n tabindex=\"-1\"\n ?disabled=${this.disabled}\n part=\"arrow\"\n >\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\n class=\"tt-combobox-container\"\n @focus=\"${this._onFocus}\"\n @keydown=\"${this._onKeyUp}\"\n @click=\"${this._onClick}\"\n aria-disabled=\"${this.disabled}\"\n part=\"container\"\n >\n <slot name=\"icon\" part=\"icon\"></slot>\n ${this._renderCombobox()} ${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()} ${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\n class=\"errormessage\"\n id=\"error-msg-${this.id}\"\n role=\"alert\"\n aria-atomic=\"true\"\n ?data-hidden=\"${!this._hasErrorContent()}\"\n part=\"error\"\n >\n ${unsafeSVG(alert)}\n <slot name=\"error\"></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-combobox': TtCombobox;\n }\n}\n"]}
|
package/dist/src/styles.js
CHANGED
|
@@ -49,11 +49,11 @@ export const styles = css `
|
|
|
49
49
|
height: 20px;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.tt-combobox-container:has([role=
|
|
52
|
+
.tt-combobox-container:has([role='combobox'][aria-invalid='true']) ~ .errormessage {
|
|
53
53
|
visibility: visible;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
:has([role=
|
|
56
|
+
:has([role='combobox'][aria-invalid='true']) ::slotted([slot='error']) {
|
|
57
57
|
color: var(--color-alert-400, darkred);
|
|
58
58
|
font-size: var(--font-size-100);
|
|
59
59
|
margin: 0;
|
|
@@ -61,7 +61,7 @@ export const styles = css `
|
|
|
61
61
|
line-height: 1.2;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
slot[name=
|
|
64
|
+
slot[name='option']::slotted(*) {
|
|
65
65
|
display: none;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -88,11 +88,11 @@ export const styles = css `
|
|
|
88
88
|
//width: 100%;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
[role=
|
|
91
|
+
[role='listbox'] {
|
|
92
92
|
display: none;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
[role=
|
|
95
|
+
[role='combobox'] {
|
|
96
96
|
width: 100%;
|
|
97
97
|
border-style: none;
|
|
98
98
|
background-color: transparent;
|
|
@@ -103,26 +103,26 @@ export const styles = css `
|
|
|
103
103
|
caret-color: transparent;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
[role=
|
|
106
|
+
[role='combobox']::placeholder {
|
|
107
107
|
color: var(--tt-combobox-placeholder-color, var(--color-text-300));
|
|
108
108
|
font-family: var(--font-family-inter);
|
|
109
109
|
font-size: var(--tt-combobox-font-size, var(--font-size-200));
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
:host([disabled]) [role=
|
|
112
|
+
:host([disabled]) [role='combobox']::placeholder {
|
|
113
113
|
color: var(--tt-combobox-disabled-placeholder-color, var(--color-text-200));
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
[role=
|
|
116
|
+
[role='combobox']:placeholder-shown {
|
|
117
117
|
text-overflow: ellipsis;
|
|
118
118
|
overflow: clip;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
[role=
|
|
121
|
+
[role='combobox']:focus {
|
|
122
122
|
outline: none;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
[role=
|
|
125
|
+
[role='combobox'] ~ button {
|
|
126
126
|
appearance: none;
|
|
127
127
|
padding: 0;
|
|
128
128
|
border-width: 0;
|
|
@@ -130,16 +130,16 @@ export const styles = css `
|
|
|
130
130
|
aspect-ratio: 1;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
[role=
|
|
133
|
+
[role='combobox'] ~ button svg {
|
|
134
134
|
transition: transform 0.2s ease-in-out;
|
|
135
135
|
color: var(--tt-combobox-dropdown-color, var(--color-text-400));
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
[role=
|
|
138
|
+
[role='combobox'][aria-expanded='true'] ~ button svg {
|
|
139
139
|
transform: rotate(180deg);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
[role=
|
|
142
|
+
[role='combobox'][aria-expanded='true'] ~ [role='listbox'] {
|
|
143
143
|
display: block;
|
|
144
144
|
width: max-content;
|
|
145
145
|
max-width: var(--tt-combobox-list-max-width, 35ch);
|
|
@@ -160,7 +160,6 @@ export const styles = css `
|
|
|
160
160
|
max-height: var(--tt-combobox-max-height, 400px);
|
|
161
161
|
overflow-y: auto;
|
|
162
162
|
|
|
163
|
-
|
|
164
163
|
.no-results {
|
|
165
164
|
display: none;
|
|
166
165
|
}
|
|
@@ -180,7 +179,6 @@ export const styles = css `
|
|
|
180
179
|
overflow-y: visible;
|
|
181
180
|
flex: 1;
|
|
182
181
|
|
|
183
|
-
|
|
184
182
|
span {
|
|
185
183
|
overflow: hidden;
|
|
186
184
|
text-overflow: ellipsis;
|
|
@@ -196,12 +194,12 @@ export const styles = css `
|
|
|
196
194
|
}
|
|
197
195
|
}
|
|
198
196
|
|
|
199
|
-
[role=
|
|
197
|
+
[role='combobox'][aria-expanded='true'] ~ [role='listbox'][data-open-upward] {
|
|
200
198
|
top: unset;
|
|
201
199
|
bottom: calc(100% + 0.5rem);
|
|
202
200
|
}
|
|
203
201
|
|
|
204
|
-
slot[name=
|
|
202
|
+
slot[name='icon'] {
|
|
205
203
|
display: inline-block;
|
|
206
204
|
max-width: var(--tt-combobox-icon-size, 1rem);
|
|
207
205
|
aspect-ratio: 1;
|
package/dist/src/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2NxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: flex;\n flex-direction: var(--tt-combobox-flex-direction, row);\n align-items: var(--tt-combobox-align-items, center);\n justify-content: var(--tt-combobox-justify-content, initial);\n align-content: var(--tt-combobox-align-content, initial);\n gap: var(--tt-combobox-gap, 0.5rem);\n font-size: var(--tt-combobox-font-size, var(--font-size-200));\n color: var(--tt-combobox-color, var(--color-text-400));\n }\n\n :host([disabled]) .tt-combobox-container {\n border-color: var(--tt-combobox-disabled-border-color, var(--color-border-200));\n color: var(--tt-combobox-disabled-color, var(--color-text-200));\n background-color: var(--tt-combobox-disabled-background-color, var(--color-surface-200));\n pointer-events: none;\n }\n\n .tt-combobox-container:focus-within {\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n .tt-combobox-container:hover {\n background-color: var(--tt-combobox-hover-background-color, var(--color-surface-300));\n }\n\n :host([invalid]) .tt-combobox-container,\n :host(:state(interacted):invalid) .tt-combobox-container {\n outline: 1px solid var(--color-alert-400, red);\n }\n\n .errormessage {\n visibility: hidden;\n display: flex;\n align-items: center;\n gap: var(--space-scale-0-5);\n color: var(--color-alert-400, red);\n\n &[data-hidden] {\n display: none;\n }\n }\n\n .errormessage svg path {\n fill: var(--color-alert-400, red);\n height: 20px;\n }\n\n .tt-combobox-container:has([role='combobox'][aria-invalid='true']) ~ .errormessage {\n visibility: visible;\n }\n\n :has([role='combobox'][aria-invalid='true']) ::slotted([slot='error']) {\n color: var(--color-alert-400, darkred);\n font-size: var(--font-size-100);\n margin: 0;\n font-weight: var(--font-weight-regular);\n line-height: 1.2;\n }\n\n slot[name='option']::slotted(*) {\n display: none;\n }\n\n * {\n box-sizing: border-box;\n font-family: var(--font-family-sans);\n cursor: inherit;\n }\n\n .tt-combobox-container {\n position: relative;\n max-width: var(--tt-combobox-max-width, 300px);\n min-width: var(--tt-combobox-min-width, 250px);\n display: flex;\n flex-direction: row;\n align-items: center;\n border-radius: var(--border-radius);\n border-color: var(--tt-combobox-border-color, var(--color-border-400));\n border-style: solid;\n border-width: var(--tt-combobox-border-width, 1px);\n background-color: var(--tt-combobox-background-color, var(--color-surface-100));\n padding: 0.5rem;\n gap: 0.25rem;\n //width: 100%;\n }\n\n [role='listbox'] {\n display: none;\n }\n\n [role='combobox'] {\n width: 100%;\n border-style: none;\n background-color: transparent;\n font-size: var(--tt-combobox-font-size, var(--font-size-200));\n }\n\n .hide-caret {\n caret-color: transparent;\n }\n\n [role='combobox']::placeholder {\n color: var(--tt-combobox-placeholder-color, var(--color-text-300));\n font-family: var(--font-family-inter);\n font-size: var(--tt-combobox-font-size, var(--font-size-200));\n }\n\n :host([disabled]) [role='combobox']::placeholder {\n color: var(--tt-combobox-disabled-placeholder-color, var(--color-text-200));\n }\n\n [role='combobox']:placeholder-shown {\n text-overflow: ellipsis;\n overflow: clip;\n }\n\n [role='combobox']:focus {\n outline: none;\n }\n\n [role='combobox'] ~ button {\n appearance: none;\n padding: 0;\n border-width: 0;\n background-color: transparent;\n aspect-ratio: 1;\n }\n\n [role='combobox'] ~ button svg {\n transition: transform 0.2s ease-in-out;\n color: var(--tt-combobox-dropdown-color, var(--color-text-400));\n }\n\n [role='combobox'][aria-expanded='true'] ~ button svg {\n transform: rotate(180deg);\n }\n\n [role='combobox'][aria-expanded='true'] ~ [role='listbox'] {\n display: block;\n width: max-content;\n max-width: var(--tt-combobox-list-max-width, 35ch);\n min-width: 100%;\n background-color: var(--tt-combobox-list-background-color, var(--color-surface-100, white));\n border: 1px solid var(--tt-combobox-border-color, var(--color-border-300));\n border-radius: var(--border-radius);\n box-shadow: var(--box-shadow-lg);\n padding: 0;\n position: absolute;\n top: var(--tt-combobox-top, calc(100% + 0.5rem));\n left: var(--tt-combobox-left, 0);\n right: var(--tt-combobox-right, unset);\n bottom: var(--tt-combobox-bottom, unset);\n z-index: 2;\n margin: 0;\n list-style: none;\n max-height: var(--tt-combobox-max-height, 400px);\n overflow-y: auto;\n\n .no-results {\n display: none;\n }\n\n &:not(:has(tt-option:not([hidden], .select-all))) {\n .no-results {\n display: flex;\n padding: 0.5rem;\n box-sizing: border-box;\n text-align: left;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n align-items: center;\n gap: 0.25rem;\n max-width: 100%;\n width: 100%;\n overflow-y: visible;\n flex: 1;\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n line-height: 1.1;\n }\n }\n\n .select-all {\n display: none;\n }\n }\n }\n\n [role='combobox'][aria-expanded='true'] ~ [role='listbox'][data-open-upward] {\n top: unset;\n bottom: calc(100% + 0.5rem);\n }\n\n slot[name='icon'] {\n display: inline-block;\n max-width: var(--tt-combobox-icon-size, 1rem);\n aspect-ratio: 1;\n }\n\n tt-option.select-all::part(option) {\n border-bottom: 1px solid var(--color-border-300);\n }\n\n label {\n font-size: var(--tt-combobox-label-font-size, inherit);\n color: var(--tt-combobox-label-color, inherit);\n font-weight: var(--tt-combobox-label-font-weight, inherit);\n\n &[data-hidden] {\n display: none;\n }\n }\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tt-combobox.js","sourceRoot":"","sources":["../../src/tt-combobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,0BAA0B,CAAC;AAElC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9C,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;
|
|
1
|
+
{"version":3,"file":"tt-combobox.js","sourceRoot":"","sources":["../../src/tt-combobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,0BAA0B,CAAC;AAElC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9C,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { TtCombobox } from './TtCombobox.js';\nimport './tt-option/tt-option.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-combobox')) {\n window.customElements.define('tt-combobox', TtCombobox);\n }\n}\n\nexport { TtCombobox };\n"]}
|
|
@@ -40,8 +40,7 @@ export class TtOption extends LitElement {
|
|
|
40
40
|
part="option"
|
|
41
41
|
>
|
|
42
42
|
${this.includeCheckbox
|
|
43
|
-
? html `<input type="checkbox" ?checked=${this.selected}
|
|
44
|
-
role="presentation" tabindex="-1" part="checkbox">`
|
|
43
|
+
? html `<input type="checkbox" ?checked=${this.selected} role="presentation" tabindex="-1" part="checkbox" />`
|
|
45
44
|
: nothing}
|
|
46
45
|
<span>
|
|
47
46
|
<slot></slot>
|
|
@@ -53,7 +52,7 @@ export class TtOption extends LitElement {
|
|
|
53
52
|
TtOption.styles = styles;
|
|
54
53
|
TtOption.shadowRootOptions = {
|
|
55
54
|
...LitElement.shadowRootOptions,
|
|
56
|
-
delegatesFocus: true
|
|
55
|
+
delegatesFocus: true,
|
|
57
56
|
};
|
|
58
57
|
__decorate([
|
|
59
58
|
property({ type: Boolean })
|