@triptease/tt-combobox 5.5.2 → 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 +5 -46
- package/test/tt-combobox.test.ts +81 -69
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
package/custom-elements.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"text": "object"
|
|
28
28
|
},
|
|
29
29
|
"static": true,
|
|
30
|
-
"default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true }"
|
|
30
|
+
"default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true, }"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"kind": "field",
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
"text": "MutationObserver"
|
|
281
281
|
},
|
|
282
282
|
"privacy": "private",
|
|
283
|
-
"default": "new MutationObserver((mutations) => { mutations.forEach(mutation => { if (mutation.type === 'attributes') { this.requestUpdate('options'); } }); })"
|
|
283
|
+
"default": "new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === 'attributes') { this.requestUpdate('options'); } }); })"
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
286
|
"kind": "method",
|
|
@@ -618,7 +618,7 @@
|
|
|
618
618
|
{
|
|
619
619
|
"kind": "variable",
|
|
620
620
|
"name": "styles",
|
|
621
|
-
"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
|
|
621
|
+
"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; .no-results { display: none; } &:not(:has(tt-option:not([hidden], .select-all))) { .no-results { 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; span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; line-height: 1.1; } } .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; } tt-option.select-all::part(option) { border-bottom: 1px solid var(--color-border-300); } 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; } } `"
|
|
622
622
|
}
|
|
623
623
|
],
|
|
624
624
|
"exports": [
|
|
@@ -655,321 +655,6 @@
|
|
|
655
655
|
}
|
|
656
656
|
]
|
|
657
657
|
},
|
|
658
|
-
{
|
|
659
|
-
"kind": "javascript-module",
|
|
660
|
-
"path": "stories/combobox.stories.ts",
|
|
661
|
-
"declarations": [
|
|
662
|
-
{
|
|
663
|
-
"kind": "variable",
|
|
664
|
-
"name": "meta",
|
|
665
|
-
"type": {
|
|
666
|
-
"text": "object"
|
|
667
|
-
},
|
|
668
|
-
"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'] }"
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
"kind": "variable",
|
|
672
|
-
"name": "SingleSelect"
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
"kind": "function",
|
|
676
|
-
"name": "SingleSelectWithDefault",
|
|
677
|
-
"parameters": [
|
|
678
|
-
{
|
|
679
|
-
"name": "{\n label = 'With default options',\n id = 'combobox-13',\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n value = '0'\n }"
|
|
680
|
-
}
|
|
681
|
-
]
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
"kind": "variable",
|
|
685
|
-
"name": "MultiSelect"
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
"kind": "variable",
|
|
689
|
-
"name": "MultiSelectSelectAll"
|
|
690
|
-
},
|
|
691
|
-
{
|
|
692
|
-
"kind": "variable",
|
|
693
|
-
"name": "WithStyles"
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
"kind": "function",
|
|
697
|
-
"name": "WithCustomOptionStyle",
|
|
698
|
-
"parameters": [
|
|
699
|
-
{
|
|
700
|
-
"name": "{\n label = 'Test label',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
701
|
-
}
|
|
702
|
-
]
|
|
703
|
-
},
|
|
704
|
-
{
|
|
705
|
-
"kind": "function",
|
|
706
|
-
"name": "WithIcon",
|
|
707
|
-
"parameters": [
|
|
708
|
-
{
|
|
709
|
-
"name": "{\n label = 'With icon',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
710
|
-
}
|
|
711
|
-
]
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
"kind": "function",
|
|
715
|
-
"name": "HiddenCaret",
|
|
716
|
-
"parameters": [
|
|
717
|
-
{
|
|
718
|
-
"name": "{\n label = 'With hidden caret',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
719
|
-
}
|
|
720
|
-
]
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
"kind": "function",
|
|
724
|
-
"name": "WithError",
|
|
725
|
-
"parameters": [
|
|
726
|
-
{
|
|
727
|
-
"name": "{\n label = 'With error',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
728
|
-
}
|
|
729
|
-
]
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
"kind": "function",
|
|
733
|
-
"name": "WithOptionDisabled",
|
|
734
|
-
"parameters": [
|
|
735
|
-
{
|
|
736
|
-
"name": "{\n label = 'With option disabled',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
|
|
737
|
-
}
|
|
738
|
-
]
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
"kind": "function",
|
|
742
|
-
"name": "DisabledComboBox",
|
|
743
|
-
"parameters": [
|
|
744
|
-
{
|
|
745
|
-
"name": "{\n label = 'Disabled selector',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
746
|
-
}
|
|
747
|
-
]
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
"kind": "function",
|
|
751
|
-
"name": "InsideForm",
|
|
752
|
-
"parameters": [
|
|
753
|
-
{
|
|
754
|
-
"name": "{\n label = 'Combobox submitted inside a form',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
755
|
-
}
|
|
756
|
-
]
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
"kind": "function",
|
|
760
|
-
"name": "WithAriaLabel",
|
|
761
|
-
"parameters": [
|
|
762
|
-
{
|
|
763
|
-
"name": "{\n label = 'This label is only visible for screen readers, use with caution',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
764
|
-
}
|
|
765
|
-
]
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
"kind": "function",
|
|
769
|
-
"name": "WithRequired",
|
|
770
|
-
"parameters": [
|
|
771
|
-
{
|
|
772
|
-
"name": "{\n label = 'Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
|
|
773
|
-
}
|
|
774
|
-
]
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
"kind": "function",
|
|
778
|
-
"name": "MultiSelectWithRequired",
|
|
779
|
-
"parameters": [
|
|
780
|
-
{
|
|
781
|
-
"name": "{\n label = 'MultiSelect Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
|
|
782
|
-
}
|
|
783
|
-
]
|
|
784
|
-
},
|
|
785
|
-
{
|
|
786
|
-
"kind": "variable",
|
|
787
|
-
"name": "WithCustomPlaceholder"
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
"kind": "variable",
|
|
791
|
-
"name": "WithHiddenOptions",
|
|
792
|
-
"type": {
|
|
793
|
-
"text": "Story<ArgTypes>"
|
|
794
|
-
}
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
"kind": "variable",
|
|
798
|
-
"name": "WithSelectAllPlaceholder"
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
"kind": "function",
|
|
802
|
-
"name": "OpenUpward",
|
|
803
|
-
"parameters": [
|
|
804
|
-
{
|
|
805
|
-
"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}"
|
|
806
|
-
}
|
|
807
|
-
]
|
|
808
|
-
}
|
|
809
|
-
],
|
|
810
|
-
"exports": [
|
|
811
|
-
{
|
|
812
|
-
"kind": "js",
|
|
813
|
-
"name": "default",
|
|
814
|
-
"declaration": {
|
|
815
|
-
"name": "meta",
|
|
816
|
-
"module": "stories/combobox.stories.ts"
|
|
817
|
-
}
|
|
818
|
-
},
|
|
819
|
-
{
|
|
820
|
-
"kind": "js",
|
|
821
|
-
"name": "SingleSelect",
|
|
822
|
-
"declaration": {
|
|
823
|
-
"name": "SingleSelect",
|
|
824
|
-
"module": "stories/combobox.stories.ts"
|
|
825
|
-
}
|
|
826
|
-
},
|
|
827
|
-
{
|
|
828
|
-
"kind": "js",
|
|
829
|
-
"name": "SingleSelectWithDefault",
|
|
830
|
-
"declaration": {
|
|
831
|
-
"name": "SingleSelectWithDefault",
|
|
832
|
-
"module": "stories/combobox.stories.ts"
|
|
833
|
-
}
|
|
834
|
-
},
|
|
835
|
-
{
|
|
836
|
-
"kind": "js",
|
|
837
|
-
"name": "MultiSelect",
|
|
838
|
-
"declaration": {
|
|
839
|
-
"name": "MultiSelect",
|
|
840
|
-
"module": "stories/combobox.stories.ts"
|
|
841
|
-
}
|
|
842
|
-
},
|
|
843
|
-
{
|
|
844
|
-
"kind": "js",
|
|
845
|
-
"name": "MultiSelectSelectAll",
|
|
846
|
-
"declaration": {
|
|
847
|
-
"name": "MultiSelectSelectAll",
|
|
848
|
-
"module": "stories/combobox.stories.ts"
|
|
849
|
-
}
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
"kind": "js",
|
|
853
|
-
"name": "WithStyles",
|
|
854
|
-
"declaration": {
|
|
855
|
-
"name": "WithStyles",
|
|
856
|
-
"module": "stories/combobox.stories.ts"
|
|
857
|
-
}
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
"kind": "js",
|
|
861
|
-
"name": "WithCustomOptionStyle",
|
|
862
|
-
"declaration": {
|
|
863
|
-
"name": "WithCustomOptionStyle",
|
|
864
|
-
"module": "stories/combobox.stories.ts"
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
"kind": "js",
|
|
869
|
-
"name": "WithIcon",
|
|
870
|
-
"declaration": {
|
|
871
|
-
"name": "WithIcon",
|
|
872
|
-
"module": "stories/combobox.stories.ts"
|
|
873
|
-
}
|
|
874
|
-
},
|
|
875
|
-
{
|
|
876
|
-
"kind": "js",
|
|
877
|
-
"name": "HiddenCaret",
|
|
878
|
-
"declaration": {
|
|
879
|
-
"name": "HiddenCaret",
|
|
880
|
-
"module": "stories/combobox.stories.ts"
|
|
881
|
-
}
|
|
882
|
-
},
|
|
883
|
-
{
|
|
884
|
-
"kind": "js",
|
|
885
|
-
"name": "WithError",
|
|
886
|
-
"declaration": {
|
|
887
|
-
"name": "WithError",
|
|
888
|
-
"module": "stories/combobox.stories.ts"
|
|
889
|
-
}
|
|
890
|
-
},
|
|
891
|
-
{
|
|
892
|
-
"kind": "js",
|
|
893
|
-
"name": "WithOptionDisabled",
|
|
894
|
-
"declaration": {
|
|
895
|
-
"name": "WithOptionDisabled",
|
|
896
|
-
"module": "stories/combobox.stories.ts"
|
|
897
|
-
}
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
"kind": "js",
|
|
901
|
-
"name": "DisabledComboBox",
|
|
902
|
-
"declaration": {
|
|
903
|
-
"name": "DisabledComboBox",
|
|
904
|
-
"module": "stories/combobox.stories.ts"
|
|
905
|
-
}
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
"kind": "js",
|
|
909
|
-
"name": "InsideForm",
|
|
910
|
-
"declaration": {
|
|
911
|
-
"name": "InsideForm",
|
|
912
|
-
"module": "stories/combobox.stories.ts"
|
|
913
|
-
}
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
"kind": "js",
|
|
917
|
-
"name": "WithAriaLabel",
|
|
918
|
-
"declaration": {
|
|
919
|
-
"name": "WithAriaLabel",
|
|
920
|
-
"module": "stories/combobox.stories.ts"
|
|
921
|
-
}
|
|
922
|
-
},
|
|
923
|
-
{
|
|
924
|
-
"kind": "js",
|
|
925
|
-
"name": "WithRequired",
|
|
926
|
-
"declaration": {
|
|
927
|
-
"name": "WithRequired",
|
|
928
|
-
"module": "stories/combobox.stories.ts"
|
|
929
|
-
}
|
|
930
|
-
},
|
|
931
|
-
{
|
|
932
|
-
"kind": "js",
|
|
933
|
-
"name": "MultiSelectWithRequired",
|
|
934
|
-
"declaration": {
|
|
935
|
-
"name": "MultiSelectWithRequired",
|
|
936
|
-
"module": "stories/combobox.stories.ts"
|
|
937
|
-
}
|
|
938
|
-
},
|
|
939
|
-
{
|
|
940
|
-
"kind": "js",
|
|
941
|
-
"name": "WithCustomPlaceholder",
|
|
942
|
-
"declaration": {
|
|
943
|
-
"name": "WithCustomPlaceholder",
|
|
944
|
-
"module": "stories/combobox.stories.ts"
|
|
945
|
-
}
|
|
946
|
-
},
|
|
947
|
-
{
|
|
948
|
-
"kind": "js",
|
|
949
|
-
"name": "WithHiddenOptions",
|
|
950
|
-
"declaration": {
|
|
951
|
-
"name": "WithHiddenOptions",
|
|
952
|
-
"module": "stories/combobox.stories.ts"
|
|
953
|
-
}
|
|
954
|
-
},
|
|
955
|
-
{
|
|
956
|
-
"kind": "js",
|
|
957
|
-
"name": "WithSelectAllPlaceholder",
|
|
958
|
-
"declaration": {
|
|
959
|
-
"name": "WithSelectAllPlaceholder",
|
|
960
|
-
"module": "stories/combobox.stories.ts"
|
|
961
|
-
}
|
|
962
|
-
},
|
|
963
|
-
{
|
|
964
|
-
"kind": "js",
|
|
965
|
-
"name": "OpenUpward",
|
|
966
|
-
"declaration": {
|
|
967
|
-
"name": "OpenUpward",
|
|
968
|
-
"module": "stories/combobox.stories.ts"
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
]
|
|
972
|
-
},
|
|
973
658
|
{
|
|
974
659
|
"kind": "javascript-module",
|
|
975
660
|
"path": "src/tt-option/TtOption.ts",
|
|
@@ -986,7 +671,7 @@
|
|
|
986
671
|
"text": "object"
|
|
987
672
|
},
|
|
988
673
|
"static": true,
|
|
989
|
-
"default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true }"
|
|
674
|
+
"default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true, }"
|
|
990
675
|
},
|
|
991
676
|
{
|
|
992
677
|
"kind": "field",
|
|
@@ -1107,7 +792,7 @@
|
|
|
1107
792
|
{
|
|
1108
793
|
"kind": "variable",
|
|
1109
794
|
"name": "styles",
|
|
1110
|
-
"default": "css` li { cursor: pointer; 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
|
|
795
|
+
"default": "css` li { cursor: pointer; 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; accent-color: var(--color-primary-400); pointer-events: none; } span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; line-height: 1.1; } &[aria-hidden='true'] { visibility: hidden; display: none; } &[aria-disabled='true'] { pointer-events: none; opacity: 0.5; } &[aria-selected='true']:not(:has(input[type='checkbox'])) { color: var(--tt-combobox-option-selected-color, var(--color-primary-400)); font-weight: var(--font-weight-medium); } } :host([active]), :host(:hover) { li { background-color: var(--tt-combobox-option-background-color-hover, var(--color-surface-300)); color: var(--tt-combobox-option-color-hover, inherit); } &:first-child li { border-top-left-radius: var(--border-radius); border-top-right-radius: var(--border-radius); } &:last-child li { border-bottom-left-radius: var(--border-radius); border-bottom-right-radius: var(--border-radius); } } :host([disabled]) { pointer-events: none; } `"
|
|
1111
796
|
}
|
|
1112
797
|
],
|
|
1113
798
|
"exports": [
|
package/demo/index.html
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
background: #fafafa;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="demo"></div>
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<script type="module">
|
|
16
|
+
import { html, render } from 'lit';
|
|
17
|
+
import '../dist/src/tt-combobox.js';
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
some light-dom
|
|
24
|
-
</tt-combobox>
|
|
25
|
-
`,
|
|
26
|
-
document.querySelector('#demo')
|
|
27
|
-
);
|
|
28
|
-
</script>
|
|
29
|
-
</body>
|
|
19
|
+
const header = 'Hello owc World!';
|
|
20
|
+
render(html` <tt-combobox .header=${header}> some light-dom </tt-combobox> `, document.querySelector('#demo'));
|
|
21
|
+
</script>
|
|
22
|
+
</body>
|
|
30
23
|
</html>
|