@triptease/tt-combobox 5.1.0 → 5.2.1
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/custom-elements.json +48 -2
- package/dist/src/TtCombobox.d.ts +1 -0
- package/dist/src/TtCombobox.js +5 -0
- package/dist/src/TtCombobox.js.map +1 -1
- package/dist/src/styles.js +12 -6
- package/dist/src/styles.js.map +1 -1
- package/dist/src/tt-combobox.js +4 -2
- package/dist/src/tt-combobox.js.map +1 -1
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -114,6 +114,15 @@
|
|
|
114
114
|
},
|
|
115
115
|
"attribute": "select-all-placeholder"
|
|
116
116
|
},
|
|
117
|
+
{
|
|
118
|
+
"kind": "field",
|
|
119
|
+
"name": "openUpward",
|
|
120
|
+
"type": {
|
|
121
|
+
"text": "boolean"
|
|
122
|
+
},
|
|
123
|
+
"default": "false",
|
|
124
|
+
"attribute": "open-upward"
|
|
125
|
+
},
|
|
117
126
|
{
|
|
118
127
|
"kind": "field",
|
|
119
128
|
"name": "form",
|
|
@@ -541,6 +550,14 @@
|
|
|
541
550
|
},
|
|
542
551
|
"fieldName": "selectAllPlaceholder"
|
|
543
552
|
},
|
|
553
|
+
{
|
|
554
|
+
"name": "open-upward",
|
|
555
|
+
"type": {
|
|
556
|
+
"text": "boolean"
|
|
557
|
+
},
|
|
558
|
+
"default": "false",
|
|
559
|
+
"fieldName": "openUpward"
|
|
560
|
+
},
|
|
544
561
|
{
|
|
545
562
|
"name": "value",
|
|
546
563
|
"type": {
|
|
@@ -591,7 +608,7 @@
|
|
|
591
608
|
{
|
|
592
609
|
"kind": "variable",
|
|
593
610
|
"name": "styles",
|
|
594
|
-
"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(--color-surface-100); 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; } } } 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(--color-primary-400); font-weight: var(--font-weight-medium); } [role=\"option\"]:is(:hover, [data-active=\"true\"]) { background-color: var(--color-
|
|
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(--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; } } `"
|
|
595
612
|
}
|
|
596
613
|
],
|
|
597
614
|
"exports": [
|
|
@@ -638,7 +655,7 @@
|
|
|
638
655
|
"type": {
|
|
639
656
|
"text": "object"
|
|
640
657
|
},
|
|
641
|
-
"default": "{ title: 'ComboBox', component: 'tt-combobox', argTypes: { label: { control: 'text' }, id: { control: 'text' }, 'display-select-all': { control: 'boolean' }, options: { control: 'object' } }, tags: ['autodocs'] }"
|
|
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'] }"
|
|
642
659
|
},
|
|
643
660
|
{
|
|
644
661
|
"kind": "variable",
|
|
@@ -765,6 +782,19 @@
|
|
|
765
782
|
"type": {
|
|
766
783
|
"text": "Story<ArgTypes>"
|
|
767
784
|
}
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"kind": "variable",
|
|
788
|
+
"name": "WithSelectAllPlaceholder"
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"kind": "function",
|
|
792
|
+
"name": "OpenUpward",
|
|
793
|
+
"parameters": [
|
|
794
|
+
{
|
|
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}"
|
|
796
|
+
}
|
|
797
|
+
]
|
|
768
798
|
}
|
|
769
799
|
],
|
|
770
800
|
"exports": [
|
|
@@ -911,6 +941,22 @@
|
|
|
911
941
|
"name": "WithHiddenOptions",
|
|
912
942
|
"module": "stories/combobox.stories.ts"
|
|
913
943
|
}
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"kind": "js",
|
|
947
|
+
"name": "WithSelectAllPlaceholder",
|
|
948
|
+
"declaration": {
|
|
949
|
+
"name": "WithSelectAllPlaceholder",
|
|
950
|
+
"module": "stories/combobox.stories.ts"
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
"kind": "js",
|
|
955
|
+
"name": "OpenUpward",
|
|
956
|
+
"declaration": {
|
|
957
|
+
"name": "OpenUpward",
|
|
958
|
+
"module": "stories/combobox.stories.ts"
|
|
959
|
+
}
|
|
914
960
|
}
|
|
915
961
|
]
|
|
916
962
|
}
|
package/dist/src/TtCombobox.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class TtCombobox extends LitElement {
|
|
|
20
20
|
hideCaret: boolean;
|
|
21
21
|
placeholder?: string;
|
|
22
22
|
selectAllPlaceholder?: string;
|
|
23
|
+
openUpward: boolean;
|
|
23
24
|
get form(): HTMLFormElement | null;
|
|
24
25
|
protected _activeOption: number;
|
|
25
26
|
protected _expanded: boolean;
|
package/dist/src/TtCombobox.js
CHANGED
|
@@ -26,6 +26,7 @@ export class TtCombobox extends LitElement {
|
|
|
26
26
|
this.name = '';
|
|
27
27
|
this.ariaLabelledby = nothing;
|
|
28
28
|
this.hideCaret = false;
|
|
29
|
+
this.openUpward = false;
|
|
29
30
|
this._activeOption = -1;
|
|
30
31
|
this._expanded = false;
|
|
31
32
|
this._filter = '';
|
|
@@ -358,6 +359,7 @@ export class TtCombobox extends LitElement {
|
|
|
358
359
|
aria-multiselectable="${this.multiselect}"
|
|
359
360
|
aria-label="${this.labelContent}"
|
|
360
361
|
part="listbox"
|
|
362
|
+
?data-open-upward="${this.openUpward}"
|
|
361
363
|
>
|
|
362
364
|
${this._renderSelectAll()}
|
|
363
365
|
|
|
@@ -411,6 +413,9 @@ __decorate([
|
|
|
411
413
|
__decorate([
|
|
412
414
|
property({ type: String, attribute: 'select-all-placeholder' })
|
|
413
415
|
], TtCombobox.prototype, "selectAllPlaceholder", void 0);
|
|
416
|
+
__decorate([
|
|
417
|
+
property({ type: Boolean, attribute: 'open-upward' })
|
|
418
|
+
], TtCombobox.prototype, "openUpward", void 0);
|
|
414
419
|
__decorate([
|
|
415
420
|
state()
|
|
416
421
|
], TtCombobox.prototype, "_activeOption", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtCombobox.js","sourceRoot":"","sources":["../../src/TtCombobox.ts"],"names":[],"mappings":";AAAA,0DAA0D;AA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;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACN;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;wDAClC;AAOpB;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 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 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 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=${option.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 >\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,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,SAAQ,UAAU;IA2CxC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC7B,CAAC;IA8CD,IAAY,cAAc;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/H,CAAC;IAUD;QACE,KAAK,EAAE,CAAC;QA7F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AAC,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 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 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=${option.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/dist/src/styles.js
CHANGED
|
@@ -29,7 +29,7 @@ export const styles = css `
|
|
|
29
29
|
|
|
30
30
|
:host([invalid]) .tt-combobox-container,
|
|
31
31
|
:host(:state(interacted):invalid) .tt-combobox-container {
|
|
32
|
-
outline: 1px solid var(--color-alert-400,red);
|
|
32
|
+
outline: 1px solid var(--color-alert-400, red);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.errormessage {
|
|
@@ -45,7 +45,7 @@ export const styles = css `
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.errormessage svg path {
|
|
48
|
-
fill:
|
|
48
|
+
fill: var(--color-alert-400, red);
|
|
49
49
|
height: 20px;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -54,7 +54,7 @@ export const styles = css `
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
:has([role="combobox"][aria-invalid="true"]) ::slotted([slot="error"]) {
|
|
57
|
-
color: var(--color-alert-400,darkred);
|
|
57
|
+
color: var(--color-alert-400, darkred);
|
|
58
58
|
font-size: var(--font-size-100);
|
|
59
59
|
margin: 0;
|
|
60
60
|
font-weight: var(--font-weight-regular);
|
|
@@ -144,7 +144,7 @@ export const styles = css `
|
|
|
144
144
|
width: max-content;
|
|
145
145
|
max-width: var(--tt-combobox-list-max-width, 35ch);
|
|
146
146
|
min-width: 100%;
|
|
147
|
-
background-color: var(--color-surface-100);
|
|
147
|
+
background-color: var(--tt-combobox-list-background-color, var(--color-surface-100, white));
|
|
148
148
|
border: 1px solid var(--tt-combobox-border-color, var(--color-border-300));
|
|
149
149
|
border-radius: var(--border-radius);
|
|
150
150
|
box-shadow: var(--box-shadow-lg);
|
|
@@ -213,9 +213,14 @@ export const styles = css `
|
|
|
213
213
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
[role="combobox"][aria-expanded="true"] ~ [role="listbox"][data-open-upward] {
|
|
217
|
+
top: unset;
|
|
218
|
+
bottom: calc(100% + 0.5rem);
|
|
219
|
+
}
|
|
220
|
+
|
|
216
221
|
slot[name="icon"] {
|
|
217
222
|
display: inline-block;
|
|
218
|
-
max-width: var(--tt-combobox-icon-size,1rem);
|
|
223
|
+
max-width: var(--tt-combobox-icon-size, 1rem);
|
|
219
224
|
aspect-ratio: 1;
|
|
220
225
|
}
|
|
221
226
|
|
|
@@ -229,7 +234,8 @@ export const styles = css `
|
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
[role="option"]:is(:hover, [data-active="true"]) {
|
|
232
|
-
background-color: var(--color-
|
|
237
|
+
background-color: var(--tt-combobox-option-background-color-hover, inherit);
|
|
238
|
+
color: var(--tt-combobox-option-color-hover, inherit);
|
|
233
239
|
|
|
234
240
|
&:first-child {
|
|
235
241
|
border-top-left-radius: var(--border-radius);
|
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,GAAE,GAAG,CAAA
|
|
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,GAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuRvB,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\n li {\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\n input[type=\"checkbox\"] {\n width: var(--checkbox-size, var(--space-scale-2));\n aspect-ratio: 1;\n flex: 0 0 auto;\n }\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 &.no-results {\n display: none;\n }\n\n &[aria-hidden=\"true\"] {\n visibility: hidden;\n display: none;\n }\n }\n\n &:not(:has([role=\"option\"]:not([data-value=\"select-all\"]))) {\n .no-results {\n display: flex;\n }\n\n .select-all {\n display: none;\n }\n }\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 [role=\"option\"].select-all {\n border-bottom: 1px solid var(--color-border-300);\n }\n\n [aria-multiselectable=\"false\"] [role=\"option\"][aria-selected=\"true\"] {\n color: var(--color-primary-400);\n font-weight: var(--font-weight-medium);\n }\n\n [role=\"option\"]:is(:hover, [data-active=\"true\"]) {\n background-color: var(--tt-combobox-option-background-color-hover, inherit);\n color: var(--tt-combobox-option-color-hover, inherit);\n\n &:first-child {\n border-top-left-radius: var(--border-radius);\n border-top-right-radius: var(--border-radius);\n }\n\n &:last-child {\n border-bottom-left-radius: var(--border-radius);\n border-bottom-right-radius: var(--border-radius);\n }\n }\n\n [role=\"option\"]:hover {\n cursor: pointer;\n }\n\n [role=\"option\"][aria-disabled=\"true\"] {\n pointer-events: none;\n opacity: 0.5;\n }\n\n [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"] input[type=\"checkbox\"] {\n accent-color: var(--color-primary-400);\n width: var(--checkbox-size, var(--space-scale-2));\n aspect-ratio: 1;\n pointer-events: none;\n }\n\n [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"][aria-disabled=\"true\"] input[type=\"checkbox\"] {\n pointer-events: none;\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`;\n"]}
|
package/dist/src/tt-combobox.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TtCombobox } from './TtCombobox.js';
|
|
2
|
-
if (
|
|
3
|
-
window.customElements.
|
|
2
|
+
if (typeof window !== 'undefined') {
|
|
3
|
+
if (!window.customElements.get('tt-combobox')) {
|
|
4
|
+
window.customElements.define('tt-combobox', TtCombobox);
|
|
5
|
+
}
|
|
4
6
|
}
|
|
5
7
|
export { TtCombobox };
|
|
6
8
|
//# sourceMappingURL=tt-combobox.js.map
|
|
@@ -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;AAE7C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"tt-combobox.js","sourceRoot":"","sources":["../../src/tt-combobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,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';\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"]}
|
package/package.json
CHANGED