@tartaguti/ui-components 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +192 -2
- package/THIRD-PARTY-NOTICES.md +29 -0
- package/custom-elements.json +16731 -0
- package/dist/accordion/tt-accordion-item.d.ts +32 -0
- package/dist/accordion/tt-accordion-item.d.ts.map +1 -0
- package/dist/accordion/tt-accordion-item.js +247 -0
- package/dist/accordion/tt-accordion-item.js.map +1 -0
- package/dist/accordion/tt-accordion.d.ts +28 -0
- package/dist/accordion/tt-accordion.d.ts.map +1 -0
- package/dist/accordion/tt-accordion.js +148 -0
- package/dist/accordion/tt-accordion.js.map +1 -0
- package/dist/bento/tt-bento-item.d.ts +35 -0
- package/dist/bento/tt-bento-item.d.ts.map +1 -0
- package/dist/bento/tt-bento-item.js +201 -0
- package/dist/bento/tt-bento-item.js.map +1 -0
- package/dist/bento/tt-bento.d.ts +25 -0
- package/dist/bento/tt-bento.d.ts.map +1 -0
- package/dist/bento/tt-bento.js +314 -0
- package/dist/bento/tt-bento.js.map +1 -0
- package/dist/floating.d.ts +61 -0
- package/dist/floating.d.ts.map +1 -0
- package/dist/floating.js +120 -0
- package/dist/floating.js.map +1 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/tt-draggable.d.ts +29 -0
- package/dist/interaction/tt-draggable.d.ts.map +1 -0
- package/dist/interaction/tt-draggable.js +66 -0
- package/dist/interaction/tt-draggable.js.map +1 -0
- package/dist/interaction/tt-droppable.d.ts +37 -0
- package/dist/interaction/tt-droppable.d.ts.map +1 -0
- package/dist/interaction/tt-droppable.js +108 -0
- package/dist/interaction/tt-droppable.js.map +1 -0
- package/dist/interaction/tt-resizable.d.ts +45 -0
- package/dist/interaction/tt-resizable.d.ts.map +1 -0
- package/dist/interaction/tt-resizable.js +210 -0
- package/dist/interaction/tt-resizable.js.map +1 -0
- package/dist/interaction/tt-reveal.d.ts +54 -0
- package/dist/interaction/tt-reveal.d.ts.map +1 -0
- package/dist/interaction/tt-reveal.js +302 -0
- package/dist/interaction/tt-reveal.js.map +1 -0
- package/dist/motion.d.ts +8 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +49 -0
- package/dist/motion.js.map +1 -0
- package/dist/overlay.d.ts +7 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +121 -0
- package/dist/overlay.js.map +1 -0
- package/dist/safe-url.d.ts +14 -0
- package/dist/safe-url.d.ts.map +1 -0
- package/dist/safe-url.js +46 -0
- package/dist/safe-url.js.map +1 -0
- package/dist/scroll-lock.d.ts +22 -0
- package/dist/scroll-lock.d.ts.map +1 -0
- package/dist/scroll-lock.js +56 -0
- package/dist/scroll-lock.js.map +1 -0
- package/dist/sidebar/tt-menu-group.d.ts +69 -0
- package/dist/sidebar/tt-menu-group.d.ts.map +1 -0
- package/dist/sidebar/tt-menu-group.js +358 -0
- package/dist/sidebar/tt-menu-group.js.map +1 -0
- package/dist/sidebar/tt-menu-item.d.ts +70 -0
- package/dist/sidebar/tt-menu-item.d.ts.map +1 -0
- package/dist/sidebar/tt-menu-item.js +502 -0
- package/dist/sidebar/tt-menu-item.js.map +1 -0
- package/dist/sidebar/tt-sidebar-footer.d.ts +39 -0
- package/dist/sidebar/tt-sidebar-footer.d.ts.map +1 -0
- package/dist/sidebar/tt-sidebar-footer.js +205 -0
- package/dist/sidebar/tt-sidebar-footer.js.map +1 -0
- package/dist/sidebar/tt-sidebar-header.d.ts +31 -0
- package/dist/sidebar/tt-sidebar-header.d.ts.map +1 -0
- package/dist/sidebar/tt-sidebar-header.js +150 -0
- package/dist/sidebar/tt-sidebar-header.js.map +1 -0
- package/dist/sidebar/tt-sidebar.d.ts +72 -0
- package/dist/sidebar/tt-sidebar.d.ts.map +1 -0
- package/dist/sidebar/tt-sidebar.js +539 -0
- package/dist/sidebar/tt-sidebar.js.map +1 -0
- package/dist/sr-only.d.ts +15 -0
- package/dist/sr-only.d.ts.map +1 -0
- package/dist/sr-only.js +27 -0
- package/dist/sr-only.js.map +1 -0
- package/dist/tokens.css +1124 -0
- package/dist/tt-alert.d.ts +26 -0
- package/dist/tt-alert.d.ts.map +1 -0
- package/dist/tt-alert.js +165 -0
- package/dist/tt-alert.js.map +1 -0
- package/dist/tt-aspect-ratio.d.ts +40 -0
- package/dist/tt-aspect-ratio.d.ts.map +1 -0
- package/dist/tt-aspect-ratio.js +98 -0
- package/dist/tt-aspect-ratio.js.map +1 -0
- package/dist/tt-auth.d.ts +75 -0
- package/dist/tt-auth.d.ts.map +1 -0
- package/dist/tt-auth.js +520 -0
- package/dist/tt-auth.js.map +1 -0
- package/dist/tt-avatar.d.ts +26 -0
- package/dist/tt-avatar.d.ts.map +1 -0
- package/dist/tt-avatar.js +169 -0
- package/dist/tt-avatar.js.map +1 -0
- package/dist/tt-badge.d.ts +36 -0
- package/dist/tt-badge.d.ts.map +1 -0
- package/dist/tt-badge.js +135 -0
- package/dist/tt-badge.js.map +1 -0
- package/dist/tt-breadcrumbs.d.ts +22 -0
- package/dist/tt-breadcrumbs.d.ts.map +1 -0
- package/dist/tt-breadcrumbs.js +144 -0
- package/dist/tt-breadcrumbs.js.map +1 -0
- package/dist/tt-button-group.d.ts +32 -0
- package/dist/tt-button-group.d.ts.map +1 -0
- package/dist/tt-button-group.js +132 -0
- package/dist/tt-button-group.js.map +1 -0
- package/dist/tt-button.d.ts +31 -0
- package/dist/tt-button.d.ts.map +1 -0
- package/dist/tt-button.js +483 -0
- package/dist/tt-button.js.map +1 -0
- package/dist/tt-card.d.ts +26 -0
- package/dist/tt-card.d.ts.map +1 -0
- package/dist/tt-card.js +429 -0
- package/dist/tt-card.js.map +1 -0
- package/dist/tt-chart.d.ts +36 -0
- package/dist/tt-chart.d.ts.map +1 -0
- package/dist/tt-chart.js +332 -0
- package/dist/tt-chart.js.map +1 -0
- package/dist/tt-checkbox-group.d.ts +38 -0
- package/dist/tt-checkbox-group.d.ts.map +1 -0
- package/dist/tt-checkbox-group.js +243 -0
- package/dist/tt-checkbox-group.js.map +1 -0
- package/dist/tt-checkbox.d.ts +35 -0
- package/dist/tt-checkbox.d.ts.map +1 -0
- package/dist/tt-checkbox.js +354 -0
- package/dist/tt-checkbox.js.map +1 -0
- package/dist/tt-code-block.d.ts +37 -0
- package/dist/tt-code-block.d.ts.map +1 -0
- package/dist/tt-code-block.js +409 -0
- package/dist/tt-code-block.js.map +1 -0
- package/dist/tt-collapsible.d.ts +71 -0
- package/dist/tt-collapsible.d.ts.map +1 -0
- package/dist/tt-collapsible.js +206 -0
- package/dist/tt-collapsible.js.map +1 -0
- package/dist/tt-combobox.d.ts +107 -0
- package/dist/tt-combobox.d.ts.map +1 -0
- package/dist/tt-combobox.js +816 -0
- package/dist/tt-combobox.js.map +1 -0
- package/dist/tt-company-card.d.ts +30 -0
- package/dist/tt-company-card.d.ts.map +1 -0
- package/dist/tt-company-card.js +382 -0
- package/dist/tt-company-card.js.map +1 -0
- package/dist/tt-comparison-table.d.ts +59 -0
- package/dist/tt-comparison-table.d.ts.map +1 -0
- package/dist/tt-comparison-table.js +441 -0
- package/dist/tt-comparison-table.js.map +1 -0
- package/dist/tt-component-doc.d.ts +63 -0
- package/dist/tt-component-doc.d.ts.map +1 -0
- package/dist/tt-component-doc.js +585 -0
- package/dist/tt-component-doc.js.map +1 -0
- package/dist/tt-confirm.d.ts +45 -0
- package/dist/tt-confirm.d.ts.map +1 -0
- package/dist/tt-confirm.js +151 -0
- package/dist/tt-confirm.js.map +1 -0
- package/dist/tt-contact-list.d.ts +18 -0
- package/dist/tt-contact-list.d.ts.map +1 -0
- package/dist/tt-contact-list.js +101 -0
- package/dist/tt-contact-list.js.map +1 -0
- package/dist/tt-copy-button.d.ts +25 -0
- package/dist/tt-copy-button.d.ts.map +1 -0
- package/dist/tt-copy-button.js +194 -0
- package/dist/tt-copy-button.js.map +1 -0
- package/dist/tt-data-table.d.ts +69 -0
- package/dist/tt-data-table.d.ts.map +1 -0
- package/dist/tt-data-table.js +542 -0
- package/dist/tt-data-table.js.map +1 -0
- package/dist/tt-divider.d.ts +19 -0
- package/dist/tt-divider.d.ts.map +1 -0
- package/dist/tt-divider.js +104 -0
- package/dist/tt-divider.js.map +1 -0
- package/dist/tt-drawer.d.ts +38 -0
- package/dist/tt-drawer.d.ts.map +1 -0
- package/dist/tt-drawer.js +433 -0
- package/dist/tt-drawer.js.map +1 -0
- package/dist/tt-dropdown-menu.d.ts +57 -0
- package/dist/tt-dropdown-menu.d.ts.map +1 -0
- package/dist/tt-dropdown-menu.js +631 -0
- package/dist/tt-dropdown-menu.js.map +1 -0
- package/dist/tt-empty-state.d.ts +13 -0
- package/dist/tt-empty-state.d.ts.map +1 -0
- package/dist/tt-empty-state.js +94 -0
- package/dist/tt-empty-state.js.map +1 -0
- package/dist/tt-example.d.ts +33 -0
- package/dist/tt-example.d.ts.map +1 -0
- package/dist/tt-example.js +250 -0
- package/dist/tt-example.js.map +1 -0
- package/dist/tt-file-upload.d.ts +85 -0
- package/dist/tt-file-upload.d.ts.map +1 -0
- package/dist/tt-file-upload.js +662 -0
- package/dist/tt-file-upload.js.map +1 -0
- package/dist/tt-filter.d.ts +62 -0
- package/dist/tt-filter.d.ts.map +1 -0
- package/dist/tt-filter.js +393 -0
- package/dist/tt-filter.js.map +1 -0
- package/dist/tt-form.d.ts +33 -0
- package/dist/tt-form.d.ts.map +1 -0
- package/dist/tt-form.js +202 -0
- package/dist/tt-form.js.map +1 -0
- package/dist/tt-grid.d.ts +22 -0
- package/dist/tt-grid.d.ts.map +1 -0
- package/dist/tt-grid.js +106 -0
- package/dist/tt-grid.js.map +1 -0
- package/dist/tt-icon.d.ts +20 -0
- package/dist/tt-icon.d.ts.map +1 -0
- package/dist/tt-icon.js +510 -0
- package/dist/tt-icon.js.map +1 -0
- package/dist/tt-image.d.ts +59 -0
- package/dist/tt-image.d.ts.map +1 -0
- package/dist/tt-image.js +314 -0
- package/dist/tt-image.js.map +1 -0
- package/dist/tt-inbox.d.ts +45 -0
- package/dist/tt-inbox.d.ts.map +1 -0
- package/dist/tt-inbox.js +275 -0
- package/dist/tt-inbox.js.map +1 -0
- package/dist/tt-input.d.ts +43 -0
- package/dist/tt-input.d.ts.map +1 -0
- package/dist/tt-input.js +476 -0
- package/dist/tt-input.js.map +1 -0
- package/dist/tt-kbd.d.ts +39 -0
- package/dist/tt-kbd.d.ts.map +1 -0
- package/dist/tt-kbd.js +145 -0
- package/dist/tt-kbd.js.map +1 -0
- package/dist/tt-key-values.d.ts +17 -0
- package/dist/tt-key-values.d.ts.map +1 -0
- package/dist/tt-key-values.js +126 -0
- package/dist/tt-key-values.js.map +1 -0
- package/dist/tt-knowledge-doc.d.ts +24 -0
- package/dist/tt-knowledge-doc.d.ts.map +1 -0
- package/dist/tt-knowledge-doc.js +120 -0
- package/dist/tt-knowledge-doc.js.map +1 -0
- package/dist/tt-layout.d.ts +36 -0
- package/dist/tt-layout.d.ts.map +1 -0
- package/dist/tt-layout.js +318 -0
- package/dist/tt-layout.js.map +1 -0
- package/dist/tt-modal.d.ts +32 -0
- package/dist/tt-modal.d.ts.map +1 -0
- package/dist/tt-modal.js +553 -0
- package/dist/tt-modal.js.map +1 -0
- package/dist/tt-navbar.d.ts +33 -0
- package/dist/tt-navbar.d.ts.map +1 -0
- package/dist/tt-navbar.js +390 -0
- package/dist/tt-navbar.js.map +1 -0
- package/dist/tt-page-header.d.ts +28 -0
- package/dist/tt-page-header.d.ts.map +1 -0
- package/dist/tt-page-header.js +166 -0
- package/dist/tt-page-header.js.map +1 -0
- package/dist/tt-page.d.ts +14 -0
- package/dist/tt-page.d.ts.map +1 -0
- package/dist/tt-page.js +163 -0
- package/dist/tt-page.js.map +1 -0
- package/dist/tt-pagination.d.ts +27 -0
- package/dist/tt-pagination.d.ts.map +1 -0
- package/dist/tt-pagination.js +194 -0
- package/dist/tt-pagination.js.map +1 -0
- package/dist/tt-preview.d.ts +11 -0
- package/dist/tt-preview.d.ts.map +1 -0
- package/dist/tt-preview.js +68 -0
- package/dist/tt-preview.js.map +1 -0
- package/dist/tt-product.d.ts +40 -0
- package/dist/tt-product.d.ts.map +1 -0
- package/dist/tt-product.js +590 -0
- package/dist/tt-product.js.map +1 -0
- package/dist/tt-profile-card.d.ts +23 -0
- package/dist/tt-profile-card.d.ts.map +1 -0
- package/dist/tt-profile-card.js +199 -0
- package/dist/tt-profile-card.js.map +1 -0
- package/dist/tt-progress.d.ts +26 -0
- package/dist/tt-progress.d.ts.map +1 -0
- package/dist/tt-progress.js +156 -0
- package/dist/tt-progress.js.map +1 -0
- package/dist/tt-quantity.d.ts +36 -0
- package/dist/tt-quantity.d.ts.map +1 -0
- package/dist/tt-quantity.js +396 -0
- package/dist/tt-quantity.js.map +1 -0
- package/dist/tt-radio-group.d.ts +50 -0
- package/dist/tt-radio-group.d.ts.map +1 -0
- package/dist/tt-radio-group.js +372 -0
- package/dist/tt-radio-group.js.map +1 -0
- package/dist/tt-rating.d.ts +54 -0
- package/dist/tt-rating.d.ts.map +1 -0
- package/dist/tt-rating.js +312 -0
- package/dist/tt-rating.js.map +1 -0
- package/dist/tt-search.d.ts +47 -0
- package/dist/tt-search.d.ts.map +1 -0
- package/dist/tt-search.js +360 -0
- package/dist/tt-search.js.map +1 -0
- package/dist/tt-section.d.ts +13 -0
- package/dist/tt-section.d.ts.map +1 -0
- package/dist/tt-section.js +98 -0
- package/dist/tt-section.js.map +1 -0
- package/dist/tt-select.d.ts +62 -0
- package/dist/tt-select.d.ts.map +1 -0
- package/dist/tt-select.js +662 -0
- package/dist/tt-select.js.map +1 -0
- package/dist/tt-skeleton.d.ts +20 -0
- package/dist/tt-skeleton.d.ts.map +1 -0
- package/dist/tt-skeleton.js +143 -0
- package/dist/tt-skeleton.js.map +1 -0
- package/dist/tt-slider.d.ts +74 -0
- package/dist/tt-slider.d.ts.map +1 -0
- package/dist/tt-slider.js +426 -0
- package/dist/tt-slider.js.map +1 -0
- package/dist/tt-social-links.d.ts +34 -0
- package/dist/tt-social-links.d.ts.map +1 -0
- package/dist/tt-social-links.js +242 -0
- package/dist/tt-social-links.js.map +1 -0
- package/dist/tt-sparkline.d.ts +19 -0
- package/dist/tt-sparkline.d.ts.map +1 -0
- package/dist/tt-sparkline.js +191 -0
- package/dist/tt-sparkline.js.map +1 -0
- package/dist/tt-spinner.d.ts +19 -0
- package/dist/tt-spinner.d.ts.map +1 -0
- package/dist/tt-spinner.js +93 -0
- package/dist/tt-spinner.js.map +1 -0
- package/dist/tt-stack.d.ts +42 -0
- package/dist/tt-stack.d.ts.map +1 -0
- package/dist/tt-stack.js +158 -0
- package/dist/tt-stack.js.map +1 -0
- package/dist/tt-stat.d.ts +17 -0
- package/dist/tt-stat.d.ts.map +1 -0
- package/dist/tt-stat.js +134 -0
- package/dist/tt-stat.js.map +1 -0
- package/dist/tt-switch.d.ts +39 -0
- package/dist/tt-switch.d.ts.map +1 -0
- package/dist/tt-switch.js +254 -0
- package/dist/tt-switch.js.map +1 -0
- package/dist/tt-switcher.d.ts +23 -0
- package/dist/tt-switcher.d.ts.map +1 -0
- package/dist/tt-switcher.js +203 -0
- package/dist/tt-switcher.js.map +1 -0
- package/dist/tt-table-cell.d.ts +26 -0
- package/dist/tt-table-cell.d.ts.map +1 -0
- package/dist/tt-table-cell.js +121 -0
- package/dist/tt-table-cell.js.map +1 -0
- package/dist/tt-table-row.d.ts +31 -0
- package/dist/tt-table-row.d.ts.map +1 -0
- package/dist/tt-table-row.js +72 -0
- package/dist/tt-table-row.js.map +1 -0
- package/dist/tt-table.d.ts +44 -0
- package/dist/tt-table.d.ts.map +1 -0
- package/dist/tt-table.js +270 -0
- package/dist/tt-table.js.map +1 -0
- package/dist/tt-tabs.d.ts +31 -0
- package/dist/tt-tabs.d.ts.map +1 -0
- package/dist/tt-tabs.js +223 -0
- package/dist/tt-tabs.js.map +1 -0
- package/dist/tt-tag-list.d.ts +19 -0
- package/dist/tt-tag-list.d.ts.map +1 -0
- package/dist/tt-tag-list.js +136 -0
- package/dist/tt-tag-list.js.map +1 -0
- package/dist/tt-text.d.ts +52 -0
- package/dist/tt-text.d.ts.map +1 -0
- package/dist/tt-text.js +337 -0
- package/dist/tt-text.js.map +1 -0
- package/dist/tt-textarea.d.ts +43 -0
- package/dist/tt-textarea.d.ts.map +1 -0
- package/dist/tt-textarea.js +356 -0
- package/dist/tt-textarea.js.map +1 -0
- package/dist/tt-thread.d.ts +62 -0
- package/dist/tt-thread.d.ts.map +1 -0
- package/dist/tt-thread.js +374 -0
- package/dist/tt-thread.js.map +1 -0
- package/dist/tt-toast.d.ts +49 -0
- package/dist/tt-toast.d.ts.map +1 -0
- package/dist/tt-toast.js +440 -0
- package/dist/tt-toast.js.map +1 -0
- package/dist/tt-toggle-group.d.ts +73 -0
- package/dist/tt-toggle-group.d.ts.map +1 -0
- package/dist/tt-toggle-group.js +273 -0
- package/dist/tt-toggle-group.js.map +1 -0
- package/dist/tt-toggle.d.ts +54 -0
- package/dist/tt-toggle.d.ts.map +1 -0
- package/dist/tt-toggle.js +232 -0
- package/dist/tt-toggle.js.map +1 -0
- package/dist/tt-toolbar.d.ts +26 -0
- package/dist/tt-toolbar.d.ts.map +1 -0
- package/dist/tt-toolbar.js +164 -0
- package/dist/tt-toolbar.js.map +1 -0
- package/dist/tt-tooltip.d.ts +42 -0
- package/dist/tt-tooltip.d.ts.map +1 -0
- package/dist/tt-tooltip.js +299 -0
- package/dist/tt-tooltip.js.map +1 -0
- package/package.json +84 -4
- package/vscode.html-custom-data.json +2907 -0
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from "lit";
|
|
8
|
+
import { customElement, property, state, query } from "lit/decorators.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
|
+
import { srOnly } from "./sr-only.js";
|
|
11
|
+
import { trackAnchor, placeBelow } from "./floating.js";
|
|
12
|
+
import "./tt-icon.js";
|
|
13
|
+
let uid = 0;
|
|
14
|
+
let TTSelect = class TTSelect extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.internals = this.attachInternals();
|
|
18
|
+
/*
|
|
19
|
+
Reflected, and it has to be.
|
|
20
|
+
|
|
21
|
+
A form-associated custom element is submitted under its name CONTENT
|
|
22
|
+
ATTRIBUTE, not its JS property. Without reflect, setting .name = "x"
|
|
23
|
+
from script leaves the attribute absent and the field vanishes from
|
|
24
|
+
FormData with no error anywhere. It only appeared to work because
|
|
25
|
+
every call site so far wrote name="x" in markup, which sets the
|
|
26
|
+
attribute directly.
|
|
27
|
+
*/
|
|
28
|
+
this.name = "";
|
|
29
|
+
this.value = "";
|
|
30
|
+
this.placeholder = "Select an option";
|
|
31
|
+
this.options = [];
|
|
32
|
+
this.label = "";
|
|
33
|
+
this.error = "";
|
|
34
|
+
this.disabled = false;
|
|
35
|
+
this.required = false;
|
|
36
|
+
// small | medium | large, as on tt-input (Oct 2026), so a row of
|
|
37
|
+
// fields can share one height. Reflected: the sizes are :host rules.
|
|
38
|
+
this.size = "medium";
|
|
39
|
+
// Named for a screen reader, invisible on screen. Same contract as
|
|
40
|
+
// tt-input and tt-checkbox.
|
|
41
|
+
this.labelHidden = false;
|
|
42
|
+
this.open = false;
|
|
43
|
+
// Where the arrow keys currently are. Not the same as the selection:
|
|
44
|
+
// you can move the cursor without choosing anything.
|
|
45
|
+
this.activeIndex = -1;
|
|
46
|
+
this.instanceId = ++uid;
|
|
47
|
+
this.listId = `tt-select-list-${this.instanceId}`;
|
|
48
|
+
// Arrow function so the reference stays stable and removeEventListener
|
|
49
|
+
// can find it, and so `this` is the component.
|
|
50
|
+
this.handleDocumentClick = (event) => {
|
|
51
|
+
// composedPath sees through shadow boundaries. event.target alone is
|
|
52
|
+
// retargeted to the host and would report our own clicks as outside.
|
|
53
|
+
if (!event.composedPath().includes(this)) {
|
|
54
|
+
this.closeList(false);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
this.handleReposition = () => {
|
|
58
|
+
if (this.open)
|
|
59
|
+
this.positionList();
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static { this.formAssociated = true; }
|
|
63
|
+
get form() {
|
|
64
|
+
return this.internals.form;
|
|
65
|
+
}
|
|
66
|
+
get validity() {
|
|
67
|
+
return this.internals.validity;
|
|
68
|
+
}
|
|
69
|
+
checkValidity() {
|
|
70
|
+
return this.internals.checkValidity();
|
|
71
|
+
}
|
|
72
|
+
reportValidity() {
|
|
73
|
+
return this.internals.reportValidity();
|
|
74
|
+
}
|
|
75
|
+
connectedCallback() {
|
|
76
|
+
super.connectedCallback();
|
|
77
|
+
this.syncFormState();
|
|
78
|
+
}
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
this.removeGlobalListeners();
|
|
81
|
+
super.disconnectedCallback();
|
|
82
|
+
}
|
|
83
|
+
formResetCallback() {
|
|
84
|
+
this.value = "";
|
|
85
|
+
}
|
|
86
|
+
formStateRestoreCallback(state) {
|
|
87
|
+
this.value = state ?? "";
|
|
88
|
+
}
|
|
89
|
+
updated(changed) {
|
|
90
|
+
if (changed.has("value") || changed.has("required")) {
|
|
91
|
+
this.syncFormState();
|
|
92
|
+
}
|
|
93
|
+
if (changed.has("open")) {
|
|
94
|
+
this.syncPopover();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/* ---- form ---- */
|
|
98
|
+
syncFormState() {
|
|
99
|
+
this.internals.setFormValue(this.value);
|
|
100
|
+
const missing = this.required && !this.value;
|
|
101
|
+
if (missing) {
|
|
102
|
+
this.internals.setValidity({ valueMissing: true }, "Please choose an option.", this.trigger ?? undefined);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.internals.setValidity({});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/* ---- data ---- */
|
|
109
|
+
get selectedOption() {
|
|
110
|
+
return this.options.find((o) => o.value === this.value);
|
|
111
|
+
}
|
|
112
|
+
/* ---- open / close ---- */
|
|
113
|
+
openList() {
|
|
114
|
+
if (this.disabled || this.open)
|
|
115
|
+
return;
|
|
116
|
+
this.open = true;
|
|
117
|
+
// Start the cursor on the current selection, or the top of the list.
|
|
118
|
+
const index = this.options.findIndex((o) => o.value === this.value);
|
|
119
|
+
this.activeIndex = index >= 0 ? index : 0;
|
|
120
|
+
// The click that opened this is still propagating, but
|
|
121
|
+
// handleDocumentClick ignores clicks whose path includes this element,
|
|
122
|
+
// so it will not immediately close again.
|
|
123
|
+
document.addEventListener("click", this.handleDocumentClick);
|
|
124
|
+
// See floating.ts: scroll events do not cross shadow boundaries, so a
|
|
125
|
+
// window listener misses the container that is actually scrolling.
|
|
126
|
+
this.untrack = trackAnchor(this, this.handleReposition);
|
|
127
|
+
}
|
|
128
|
+
closeList(refocus = true) {
|
|
129
|
+
if (!this.open)
|
|
130
|
+
return;
|
|
131
|
+
this.open = false;
|
|
132
|
+
this.activeIndex = -1;
|
|
133
|
+
this.removeGlobalListeners();
|
|
134
|
+
if (refocus)
|
|
135
|
+
this.trigger?.focus();
|
|
136
|
+
}
|
|
137
|
+
removeGlobalListeners() {
|
|
138
|
+
document.removeEventListener("click", this.handleDocumentClick);
|
|
139
|
+
this.untrack?.();
|
|
140
|
+
this.untrack = undefined;
|
|
141
|
+
}
|
|
142
|
+
toggleOpen() {
|
|
143
|
+
if (this.open)
|
|
144
|
+
this.closeList();
|
|
145
|
+
else
|
|
146
|
+
this.openList();
|
|
147
|
+
}
|
|
148
|
+
/* ---- selection ---- */
|
|
149
|
+
selectOption(option) {
|
|
150
|
+
if (option.disabled)
|
|
151
|
+
return;
|
|
152
|
+
this.value = option.value;
|
|
153
|
+
this.closeList();
|
|
154
|
+
this.dispatchEvent(new CustomEvent("tt-change", {
|
|
155
|
+
detail: { value: this.value },
|
|
156
|
+
bubbles: true,
|
|
157
|
+
composed: true,
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
/* ---- keyboard ---- */
|
|
161
|
+
moveActive(delta) {
|
|
162
|
+
const count = this.options.length;
|
|
163
|
+
if (count === 0)
|
|
164
|
+
return;
|
|
165
|
+
let next = this.activeIndex;
|
|
166
|
+
// Step until a non-disabled option is found, at most one full lap.
|
|
167
|
+
for (let i = 0; i < count; i++) {
|
|
168
|
+
next = (next + delta + count) % count;
|
|
169
|
+
if (!this.options[next].disabled)
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
this.activeIndex = next;
|
|
173
|
+
this.scrollActiveIntoView();
|
|
174
|
+
}
|
|
175
|
+
scrollActiveIntoView() {
|
|
176
|
+
this.updateComplete.then(() => {
|
|
177
|
+
const items = this.list?.querySelectorAll("li");
|
|
178
|
+
items?.[this.activeIndex]?.scrollIntoView({ block: "nearest" });
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
handleKeydown(event) {
|
|
182
|
+
if (this.disabled)
|
|
183
|
+
return;
|
|
184
|
+
switch (event.key) {
|
|
185
|
+
case "ArrowDown":
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
if (this.open)
|
|
188
|
+
this.moveActive(1);
|
|
189
|
+
else
|
|
190
|
+
this.openList();
|
|
191
|
+
break;
|
|
192
|
+
case "ArrowUp":
|
|
193
|
+
event.preventDefault();
|
|
194
|
+
if (this.open) {
|
|
195
|
+
this.moveActive(-1);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
this.openList();
|
|
199
|
+
this.activeIndex = this.options.length - 1;
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
case "Home":
|
|
203
|
+
if (this.open) {
|
|
204
|
+
event.preventDefault();
|
|
205
|
+
this.activeIndex = -1;
|
|
206
|
+
this.moveActive(1);
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
case "End":
|
|
210
|
+
if (this.open) {
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
this.activeIndex = 0;
|
|
213
|
+
this.moveActive(-1);
|
|
214
|
+
}
|
|
215
|
+
break;
|
|
216
|
+
case "Enter":
|
|
217
|
+
case " ":
|
|
218
|
+
event.preventDefault();
|
|
219
|
+
if (this.open) {
|
|
220
|
+
const option = this.options[this.activeIndex];
|
|
221
|
+
if (option)
|
|
222
|
+
this.selectOption(option);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
this.openList();
|
|
226
|
+
}
|
|
227
|
+
break;
|
|
228
|
+
case "Escape":
|
|
229
|
+
if (this.open) {
|
|
230
|
+
event.preventDefault();
|
|
231
|
+
this.closeList();
|
|
232
|
+
}
|
|
233
|
+
break;
|
|
234
|
+
case "Tab":
|
|
235
|
+
this.closeList(false);
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/* ---- positioning ---- */
|
|
240
|
+
// The list is rendered in the browser's top layer via the popover API,
|
|
241
|
+
// so no ancestor's overflow:hidden can clip it. Its position has to be
|
|
242
|
+
// set from script because the top layer is outside normal flow.
|
|
243
|
+
syncPopover() {
|
|
244
|
+
const list = this.list;
|
|
245
|
+
if (!list)
|
|
246
|
+
return;
|
|
247
|
+
if (this.open) {
|
|
248
|
+
// Shown first: a closed popover is display:none and measures 0x0,
|
|
249
|
+
// and placeBelow needs the list's real height to decide whether it
|
|
250
|
+
// fits below the field. Same order as tt-dropdown-menu.
|
|
251
|
+
if (!list.matches(":popover-open"))
|
|
252
|
+
list.showPopover();
|
|
253
|
+
this.positionList();
|
|
254
|
+
}
|
|
255
|
+
else if (list.matches(":popover-open")) {
|
|
256
|
+
list.hidePopover();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/*
|
|
260
|
+
The shared placeBelow, like tt-combobox, tt-dropdown-menu and
|
|
261
|
+
tt-filter. This used to be its own three lines that always opened
|
|
262
|
+
DOWNWARDS: a select near the bottom of the screen opened its list off
|
|
263
|
+
the bottom edge, and nothing kept it inside the viewport sideways.
|
|
264
|
+
Width first, because the width decides how the options wrap, which
|
|
265
|
+
decides the height placeBelow measures.
|
|
266
|
+
*/
|
|
267
|
+
positionList() {
|
|
268
|
+
const trigger = this.trigger;
|
|
269
|
+
const list = this.list;
|
|
270
|
+
if (!trigger || !list)
|
|
271
|
+
return;
|
|
272
|
+
list.style.width = `${trigger.getBoundingClientRect().width}px`;
|
|
273
|
+
placeBelow(trigger, list, { align: "start" });
|
|
274
|
+
}
|
|
275
|
+
static { this.styles = [srOnly, css `
|
|
276
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
277
|
+
hidden element would still show. Important, so it always wins. */
|
|
278
|
+
:host([hidden]) {
|
|
279
|
+
display: none !important;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:host {
|
|
283
|
+
/* A grid or flex item defaults to min-width: auto, which floors it at
|
|
284
|
+
its MIN-CONTENT width. See tt-input for what that broke. */
|
|
285
|
+
min-width: 0;
|
|
286
|
+
|
|
287
|
+
display: inline-block;
|
|
288
|
+
width: 100%;
|
|
289
|
+
font-family: var(--tt-font-sans);
|
|
290
|
+
-webkit-font-smoothing: antialiased;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.field {
|
|
294
|
+
display: flex;
|
|
295
|
+
flex-direction: column;
|
|
296
|
+
gap: var(--tt-space-2);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.label {
|
|
300
|
+
font-size: var(--tt-text-sm);
|
|
301
|
+
font-weight: var(--tt-weight-medium);
|
|
302
|
+
color: var(--tt-foreground);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.req {
|
|
306
|
+
margin-left: 2px;
|
|
307
|
+
color: var(--tt-destructive);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* Styled to match tt-input, not tt-button: this is a field. */
|
|
311
|
+
button {
|
|
312
|
+
display: flex;
|
|
313
|
+
align-items: center;
|
|
314
|
+
justify-content: space-between;
|
|
315
|
+
gap: var(--tt-space-2);
|
|
316
|
+
|
|
317
|
+
width: 100%;
|
|
318
|
+
box-sizing: border-box;
|
|
319
|
+
min-height: var(--tt-control-md);
|
|
320
|
+
|
|
321
|
+
/* Horizontal only, like tt-input: min-height sets the height. The
|
|
322
|
+
10px of vertical padding this had was ADDED to the text, so a
|
|
323
|
+
select measured 41px beside a 36px input in the same row. */
|
|
324
|
+
padding: 0 13px;
|
|
325
|
+
|
|
326
|
+
border: 1px solid var(--tt-input);
|
|
327
|
+
/* tt-button-group flattens this per position, so controls that
|
|
328
|
+
sit together share one edge instead of stacking two. */
|
|
329
|
+
border-radius: var(--tt-group-radius, var(--tt-radius));
|
|
330
|
+
|
|
331
|
+
background: var(--tt-field);
|
|
332
|
+
color: var(--tt-foreground);
|
|
333
|
+
|
|
334
|
+
font-family: inherit;
|
|
335
|
+
font-size: var(--tt-text-sm);
|
|
336
|
+
text-align: left;
|
|
337
|
+
|
|
338
|
+
cursor: pointer;
|
|
339
|
+
|
|
340
|
+
transition:
|
|
341
|
+
border-color var(--tt-duration-normal) var(--tt-ease),
|
|
342
|
+
box-shadow var(--tt-duration-normal) var(--tt-ease);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* The same three steps as tt-input: height from the control token,
|
|
346
|
+
horizontal padding only. */
|
|
347
|
+
:host([size="small"]) button {
|
|
348
|
+
min-height: var(--tt-control-sm);
|
|
349
|
+
padding: 0 11px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
:host([size="large"]) button {
|
|
353
|
+
min-height: var(--tt-control-lg);
|
|
354
|
+
padding: 0 16px;
|
|
355
|
+
font-size: var(--tt-text-md);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
button:hover:not(:disabled):not(.error) {
|
|
359
|
+
border-color: var(--tt-border-strong);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
button:focus-visible {
|
|
363
|
+
border-color: var(--tt-ring);
|
|
364
|
+
|
|
365
|
+
outline: var(--tt-ring-width) solid var(--tt-ring);
|
|
366
|
+
outline-offset: calc(var(--tt-ring-width) * -1);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/*
|
|
370
|
+
A disabled FIELD does not fade. It takes the muted surface and muted
|
|
371
|
+
text, the same as tt-input and tt-textarea, so a disabled row of
|
|
372
|
+
fields reads as one state. It used to fade the whole host as well,
|
|
373
|
+
which made a disabled select look different from a disabled input
|
|
374
|
+
beside it.
|
|
375
|
+
*/
|
|
376
|
+
button:disabled {
|
|
377
|
+
cursor: not-allowed;
|
|
378
|
+
background: var(--tt-muted);
|
|
379
|
+
color: var(--tt-muted-foreground);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
button.error {
|
|
383
|
+
border-color: var(--tt-destructive);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* The ring carries the error colour too, as on tt-input. */
|
|
387
|
+
button.error:focus-visible {
|
|
388
|
+
border-color: var(--tt-destructive);
|
|
389
|
+
outline-color: var(--tt-destructive);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/*
|
|
393
|
+
One line, cut with an ellipsis. A label longer than the field used
|
|
394
|
+
to WRAP, and two lines of text made the trigger taller than the
|
|
395
|
+
control height: 42px beside a 40px input in a narrow column. An
|
|
396
|
+
<input> never wraps, so a select must not either.
|
|
397
|
+
*/
|
|
398
|
+
.value {
|
|
399
|
+
flex: 1;
|
|
400
|
+
min-width: 0;
|
|
401
|
+
|
|
402
|
+
overflow: hidden;
|
|
403
|
+
white-space: nowrap;
|
|
404
|
+
text-overflow: ellipsis;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.placeholder {
|
|
408
|
+
color: var(--tt-muted-foreground);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.chevron {
|
|
412
|
+
flex: 0 0 auto;
|
|
413
|
+
color: var(--tt-muted-foreground);
|
|
414
|
+
transition: transform var(--tt-duration-normal) var(--tt-ease);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/* aria-expanded, not :host([open]). The open flag is @state, so it never
|
|
418
|
+
reaches the host as an attribute and the old rule never matched:
|
|
419
|
+
the chevron simply did not turn. */
|
|
420
|
+
button[aria-expanded="true"] .chevron {
|
|
421
|
+
transform: rotate(180deg);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* Top layer: position is fixed to the viewport and set from script. */
|
|
425
|
+
ul {
|
|
426
|
+
position: fixed;
|
|
427
|
+
margin: 0;
|
|
428
|
+
padding: var(--tt-space-1);
|
|
429
|
+
|
|
430
|
+
/*
|
|
431
|
+
positionList() assigns this element the field's exact width, and
|
|
432
|
+
without border-box that width described the CONTENT only: the 4px
|
|
433
|
+
padding and 1px border on each side were added on top, so the list
|
|
434
|
+
hung 10px wider than the field it was supposed to line up with.
|
|
435
|
+
A 330px field opened a 340px list.
|
|
436
|
+
|
|
437
|
+
The app's global reset does not reach in here. Shadow DOM does not
|
|
438
|
+
inherit a * selector, so every component sets this for itself.
|
|
439
|
+
*/
|
|
440
|
+
box-sizing: border-box;
|
|
441
|
+
|
|
442
|
+
max-height: 260px;
|
|
443
|
+
overflow-y: auto;
|
|
444
|
+
|
|
445
|
+
list-style: none;
|
|
446
|
+
|
|
447
|
+
background: var(--tt-popover);
|
|
448
|
+
color: var(--tt-popover-foreground);
|
|
449
|
+
|
|
450
|
+
border: 1px solid var(--tt-border);
|
|
451
|
+
border-radius: var(--tt-radius);
|
|
452
|
+
box-shadow: var(--tt-elevation-2);
|
|
453
|
+
|
|
454
|
+
z-index: var(--tt-z-dropdown);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/* In and out of the top layer, as on tt-dropdown-menu: see the note
|
|
458
|
+
there for why display and overlay ride along, and why translate. */
|
|
459
|
+
ul {
|
|
460
|
+
transition:
|
|
461
|
+
opacity var(--tt-duration-fast) var(--tt-ease-in),
|
|
462
|
+
translate var(--tt-duration-fast) var(--tt-ease-in),
|
|
463
|
+
overlay var(--tt-duration-fast) allow-discrete,
|
|
464
|
+
display var(--tt-duration-fast) allow-discrete;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
ul:popover-open {
|
|
468
|
+
transition-duration: var(--tt-duration-slow);
|
|
469
|
+
transition-timing-function: var(--tt-ease-out);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
@starting-style {
|
|
473
|
+
ul:popover-open {
|
|
474
|
+
opacity: 0;
|
|
475
|
+
translate: 0 -4px;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* Closed, and closing: clicks during the fade reach the page. */
|
|
480
|
+
ul:not(:popover-open) {
|
|
481
|
+
display: none;
|
|
482
|
+
opacity: 0;
|
|
483
|
+
translate: 0 -4px;
|
|
484
|
+
pointer-events: none;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
li {
|
|
488
|
+
padding: var(--tt-space-2) var(--tt-space-3);
|
|
489
|
+
border-radius: var(--tt-radius-sm);
|
|
490
|
+
|
|
491
|
+
font-size: var(--tt-text-sm);
|
|
492
|
+
cursor: pointer;
|
|
493
|
+
|
|
494
|
+
user-select: none;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
li[aria-selected="true"] {
|
|
498
|
+
font-weight: var(--tt-weight-semibold);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
li.active {
|
|
502
|
+
background: var(--tt-accent);
|
|
503
|
+
color: var(--tt-accent-foreground);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
li[aria-disabled="true"] {
|
|
507
|
+
opacity: var(--tt-opacity-disabled);
|
|
508
|
+
cursor: not-allowed;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.error-text {
|
|
512
|
+
color: var(--tt-destructive);
|
|
513
|
+
font-size: var(--tt-text-xs);
|
|
514
|
+
font-weight: var(--tt-weight-medium);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
`]; }
|
|
518
|
+
// Focus has to be forwarded: focusing the host focuses nothing, since the
|
|
519
|
+
// control lives in the shadow root. Same as tt-slider and tt-input.
|
|
520
|
+
focus(options) {
|
|
521
|
+
this.renderRoot
|
|
522
|
+
?.querySelector('button[role="combobox"]')
|
|
523
|
+
?.focus(options);
|
|
524
|
+
}
|
|
525
|
+
render() {
|
|
526
|
+
const selected = this.selectedOption;
|
|
527
|
+
const errorId = this.error
|
|
528
|
+
? `tt-select-error-${this.instanceId}`
|
|
529
|
+
: undefined;
|
|
530
|
+
/*
|
|
531
|
+
role="combobox" is NOT a role that takes its name from its content.
|
|
532
|
+
|
|
533
|
+
As a plain <button> the trigger was named by the text inside it.
|
|
534
|
+
Setting role="combobox" silently removed that, because only certain
|
|
535
|
+
roles (button, link, heading, option...) support name-from-content
|
|
536
|
+
and combobox is not one of them. The visible label sits in a
|
|
537
|
+
sibling span, which names nothing on its own, so the control
|
|
538
|
+
reached a screen reader as an unnamed combobox.
|
|
539
|
+
*/
|
|
540
|
+
const labelId = `tt-select-label-${this.instanceId}`;
|
|
541
|
+
return html `
|
|
542
|
+
<div class="field">
|
|
543
|
+
${this.label
|
|
544
|
+
? html `
|
|
545
|
+
<span
|
|
546
|
+
class="label ${this.labelHidden ? "sr-only" : ""}"
|
|
547
|
+
part="label"
|
|
548
|
+
id=${labelId}
|
|
549
|
+
>
|
|
550
|
+
${this.label}
|
|
551
|
+
${this.required
|
|
552
|
+
? html `<span class="req" aria-hidden="true">*</span>`
|
|
553
|
+
: ""}
|
|
554
|
+
</span>
|
|
555
|
+
`
|
|
556
|
+
: ""}
|
|
557
|
+
|
|
558
|
+
<button
|
|
559
|
+
part="trigger"
|
|
560
|
+
type="button"
|
|
561
|
+
class=${this.error ? "error" : ""}
|
|
562
|
+
role="combobox"
|
|
563
|
+
aria-labelledby=${ifDefined(this.label ? labelId : undefined)}
|
|
564
|
+
aria-haspopup="listbox"
|
|
565
|
+
aria-expanded=${this.open ? "true" : "false"}
|
|
566
|
+
aria-controls=${this.listId}
|
|
567
|
+
aria-activedescendant=${this.open && this.activeIndex >= 0
|
|
568
|
+
? `${this.listId}-${this.activeIndex}`
|
|
569
|
+
: ""}
|
|
570
|
+
aria-required=${this.required ? "true" : "false"}
|
|
571
|
+
aria-invalid=${this.error ? "true" : "false"}
|
|
572
|
+
aria-describedby=${errorId ?? ""}
|
|
573
|
+
?disabled=${this.disabled}
|
|
574
|
+
@click=${this.toggleOpen}
|
|
575
|
+
@keydown=${this.handleKeydown}
|
|
576
|
+
>
|
|
577
|
+
<span class="value ${selected ? "" : "placeholder"}">
|
|
578
|
+
${selected?.label ?? this.placeholder}
|
|
579
|
+
</span>
|
|
580
|
+
|
|
581
|
+
<tt-icon class="chevron" name="chevron-down" size="16px"></tt-icon>
|
|
582
|
+
</button>
|
|
583
|
+
|
|
584
|
+
<ul
|
|
585
|
+
part="list"
|
|
586
|
+
id=${this.listId}
|
|
587
|
+
popover="manual"
|
|
588
|
+
role="listbox"
|
|
589
|
+
>
|
|
590
|
+
${this.options.map((option, index) => html `
|
|
591
|
+
<li
|
|
592
|
+
id=${`${this.listId}-${index}`}
|
|
593
|
+
role="option"
|
|
594
|
+
class=${index === this.activeIndex ? "active" : ""}
|
|
595
|
+
aria-selected=${option.value === this.value ? "true" : "false"}
|
|
596
|
+
aria-disabled=${option.disabled ? "true" : "false"}
|
|
597
|
+
@click=${() => this.selectOption(option)}
|
|
598
|
+
@mousemove=${() => (this.activeIndex = index)}
|
|
599
|
+
>
|
|
600
|
+
${option.label}
|
|
601
|
+
</li>
|
|
602
|
+
`)}
|
|
603
|
+
</ul>
|
|
604
|
+
|
|
605
|
+
${this.error
|
|
606
|
+
? html `
|
|
607
|
+
<span id=${ifDefined(errorId)} class="error-text" role="alert">
|
|
608
|
+
${this.error}
|
|
609
|
+
</span>
|
|
610
|
+
`
|
|
611
|
+
: ""}
|
|
612
|
+
</div>
|
|
613
|
+
`;
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
__decorate([
|
|
617
|
+
property({ type: String, reflect: true })
|
|
618
|
+
], TTSelect.prototype, "name", void 0);
|
|
619
|
+
__decorate([
|
|
620
|
+
property({ type: String })
|
|
621
|
+
], TTSelect.prototype, "value", void 0);
|
|
622
|
+
__decorate([
|
|
623
|
+
property({ type: String })
|
|
624
|
+
], TTSelect.prototype, "placeholder", void 0);
|
|
625
|
+
__decorate([
|
|
626
|
+
property({ type: Array })
|
|
627
|
+
], TTSelect.prototype, "options", void 0);
|
|
628
|
+
__decorate([
|
|
629
|
+
property({ type: String })
|
|
630
|
+
], TTSelect.prototype, "label", void 0);
|
|
631
|
+
__decorate([
|
|
632
|
+
property({ type: String })
|
|
633
|
+
], TTSelect.prototype, "error", void 0);
|
|
634
|
+
__decorate([
|
|
635
|
+
property({ type: Boolean, reflect: true })
|
|
636
|
+
], TTSelect.prototype, "disabled", void 0);
|
|
637
|
+
__decorate([
|
|
638
|
+
property({ type: Boolean })
|
|
639
|
+
], TTSelect.prototype, "required", void 0);
|
|
640
|
+
__decorate([
|
|
641
|
+
property({ type: String, reflect: true })
|
|
642
|
+
], TTSelect.prototype, "size", void 0);
|
|
643
|
+
__decorate([
|
|
644
|
+
property({ type: Boolean, attribute: "label-hidden", reflect: true })
|
|
645
|
+
], TTSelect.prototype, "labelHidden", void 0);
|
|
646
|
+
__decorate([
|
|
647
|
+
state()
|
|
648
|
+
], TTSelect.prototype, "open", void 0);
|
|
649
|
+
__decorate([
|
|
650
|
+
state()
|
|
651
|
+
], TTSelect.prototype, "activeIndex", void 0);
|
|
652
|
+
__decorate([
|
|
653
|
+
query("button")
|
|
654
|
+
], TTSelect.prototype, "trigger", void 0);
|
|
655
|
+
__decorate([
|
|
656
|
+
query("ul")
|
|
657
|
+
], TTSelect.prototype, "list", void 0);
|
|
658
|
+
TTSelect = __decorate([
|
|
659
|
+
customElement("tt-select")
|
|
660
|
+
], TTSelect);
|
|
661
|
+
export { TTSelect };
|
|
662
|
+
//# sourceMappingURL=tt-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-select.js","sourceRoot":"","sources":["../src/tt-select.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,cAAc,CAAC;AAEtB,IAAI,GAAG,GAAG,CAAC,CAAC;AAWL,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAGG,cAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAE3C;;;;;;;;;UASE;QACyC,SAAI,GAAG,EAAE,CAAC;QACzB,UAAK,GAAG,EAAE,CAAC;QACX,gBAAW,GAAG,kBAAkB,CAAC;QAClC,YAAO,GAAmB,EAAE,CAAC;QAC5B,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;QACK,aAAQ,GAAG,KAAK,CAAC;QAChC,aAAQ,GAAG,KAAK,CAAC;QAE9C,iEAAiE;QACjE,qEAAqE;QAC1B,SAAI,GAAe,QAAQ,CAAC;QAEvE,mEAAmE;QACnE,4BAA4B;QAE5B,gBAAW,GAAG,KAAK,CAAC;QAEH,SAAI,GAAG,KA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
|
+
* Placeholder shape shown while data loads. Use it in the same layout as
|
|
4
|
+
* the real content so nothing jumps when the data arrives: a skeleton
|
|
5
|
+
* that is a different size than what replaces it is worse than a spinner.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TTSkeleton extends LitElement {
|
|
8
|
+
variant: "text" | "title" | "circle" | "rect";
|
|
9
|
+
width: string;
|
|
10
|
+
height: string;
|
|
11
|
+
lines: number;
|
|
12
|
+
static styles: import("lit").CSSResult;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"tt-skeleton": TTSkeleton;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=tt-skeleton.d.ts.map
|