@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
package/dist/tt-form.js
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
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 } from "lit/decorators.js";
|
|
9
|
+
/**
|
|
10
|
+
* Groups form controls, validates them, and reports their values.
|
|
11
|
+
*
|
|
12
|
+
* It does NOT render a <form> element, and that is deliberate. A form
|
|
13
|
+
* inside a shadow root cannot own light-DOM controls: form ownership
|
|
14
|
+
* follows the DOM tree, and slotted children are children of the host,
|
|
15
|
+
* not of anything in its shadow root. A wrapped <form> looks correct and
|
|
16
|
+
* silently collects nothing.
|
|
17
|
+
*
|
|
18
|
+
* So this collects from its named children directly. If you want the pure
|
|
19
|
+
* platform behaviour instead, use a native <form>: tt-* controls are
|
|
20
|
+
* form-associated, so they work inside one with no wrapper at all.
|
|
21
|
+
*/
|
|
22
|
+
// Controls where Enter means "done", seen from the form's own tree, where
|
|
23
|
+
// a tt-* control appears as its host element.
|
|
24
|
+
const TEXT_HOSTS = new Set(["TT-INPUT", "TT-COMBOBOX", "TT-QUANTITY"]);
|
|
25
|
+
const NOT_TEXT = new Set([
|
|
26
|
+
"checkbox",
|
|
27
|
+
"radio",
|
|
28
|
+
"button",
|
|
29
|
+
"submit",
|
|
30
|
+
"reset",
|
|
31
|
+
"file",
|
|
32
|
+
"range",
|
|
33
|
+
"color",
|
|
34
|
+
"image",
|
|
35
|
+
]);
|
|
36
|
+
function isTextField(el) {
|
|
37
|
+
if (TEXT_HOSTS.has(el.tagName))
|
|
38
|
+
return true;
|
|
39
|
+
return el instanceof HTMLInputElement && !NOT_TEXT.has(el.type);
|
|
40
|
+
}
|
|
41
|
+
let TTForm = class TTForm extends LitElement {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
this.name = "";
|
|
45
|
+
// Reflected so the :host([layout=...]) and :host([loading]) rules match.
|
|
46
|
+
this.layout = "vertical";
|
|
47
|
+
this.disabled = false;
|
|
48
|
+
this.loading = false;
|
|
49
|
+
// Skip validation before emitting, matching the native attribute.
|
|
50
|
+
this.novalidate = false;
|
|
51
|
+
this.handleButtonClick = (event) => {
|
|
52
|
+
const target = event.target;
|
|
53
|
+
if (target.getAttribute("type") === "submit")
|
|
54
|
+
this.submit();
|
|
55
|
+
};
|
|
56
|
+
// A plain <button type="submit"> works too, not only tt-button.
|
|
57
|
+
this.handleClick = (event) => {
|
|
58
|
+
const target = event.target;
|
|
59
|
+
if (target instanceof HTMLButtonElement && target.type === "submit") {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
this.submit();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
/*
|
|
65
|
+
Enter submits from a TEXT FIELD, and only from one. That is the
|
|
66
|
+
browser's own rule for a native form ("implicit submission").
|
|
67
|
+
|
|
68
|
+
It used to submit from anything that was not a textarea. So Enter on a
|
|
69
|
+
tt-select option chose it AND submitted the form, Enter on a checkbox
|
|
70
|
+
submitted, Enter on a Cancel button submitted, and Enter on the submit
|
|
71
|
+
tt-button submitted twice: once here and once from its click.
|
|
72
|
+
|
|
73
|
+
defaultPrevented is the other half: a combobox that used this Enter to
|
|
74
|
+
pick an option has already handled it, so the form must not.
|
|
75
|
+
*/
|
|
76
|
+
this.handleKeydown = (event) => {
|
|
77
|
+
if (event.key !== "Enter" || event.defaultPrevented)
|
|
78
|
+
return;
|
|
79
|
+
if (!isTextField(event.target))
|
|
80
|
+
return;
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
this.submit();
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
connectedCallback() {
|
|
86
|
+
super.connectedCallback();
|
|
87
|
+
this.addEventListener("keydown", this.handleKeydown);
|
|
88
|
+
this.addEventListener("tt-button-click", this.handleButtonClick);
|
|
89
|
+
this.addEventListener("click", this.handleClick);
|
|
90
|
+
}
|
|
91
|
+
disconnectedCallback() {
|
|
92
|
+
this.removeEventListener("keydown", this.handleKeydown);
|
|
93
|
+
this.removeEventListener("tt-button-click", this.handleButtonClick);
|
|
94
|
+
this.removeEventListener("click", this.handleClick);
|
|
95
|
+
super.disconnectedCallback();
|
|
96
|
+
}
|
|
97
|
+
/** Every named control inside the form, in document order. */
|
|
98
|
+
get controls() {
|
|
99
|
+
return Array.from(this.querySelectorAll("[name]"));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Validates, then emits tt-form-submit with the collected values.
|
|
103
|
+
* Returns false if validation stopped it.
|
|
104
|
+
*/
|
|
105
|
+
submit() {
|
|
106
|
+
if (this.disabled || this.loading)
|
|
107
|
+
return false;
|
|
108
|
+
if (!this.novalidate) {
|
|
109
|
+
for (const control of this.controls) {
|
|
110
|
+
if (control.checkValidity && !control.checkValidity()) {
|
|
111
|
+
// Focuses and shows the browser's own message.
|
|
112
|
+
control.reportValidity?.();
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
this.dispatchEvent(new CustomEvent("tt-form-submit", {
|
|
118
|
+
detail: { formData: this.collect() },
|
|
119
|
+
bubbles: true,
|
|
120
|
+
composed: true,
|
|
121
|
+
}));
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
/** Builds FormData from the named controls. */
|
|
125
|
+
collect() {
|
|
126
|
+
const data = new FormData();
|
|
127
|
+
for (const control of this.controls) {
|
|
128
|
+
const name = control.name || control.getAttribute("name");
|
|
129
|
+
if (!name || control.disabled)
|
|
130
|
+
continue;
|
|
131
|
+
// A control with a checked state contributes nothing when it is
|
|
132
|
+
// off, exactly like a native checkbox: the key is absent, not empty.
|
|
133
|
+
if (typeof control.checked === "boolean" && !control.checked)
|
|
134
|
+
continue;
|
|
135
|
+
data.append(name, String(control.value ?? "on"));
|
|
136
|
+
}
|
|
137
|
+
return data;
|
|
138
|
+
}
|
|
139
|
+
/** Clears every control by calling its form reset callback. */
|
|
140
|
+
reset() {
|
|
141
|
+
for (const control of this.controls) {
|
|
142
|
+
control.formResetCallback?.();
|
|
143
|
+
}
|
|
144
|
+
this.dispatchEvent(new CustomEvent("tt-form-reset", { bubbles: true, composed: true }));
|
|
145
|
+
}
|
|
146
|
+
static { this.styles = css `
|
|
147
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
148
|
+
hidden element would still show. Important, so it always wins. */
|
|
149
|
+
:host([hidden]) {
|
|
150
|
+
display: none !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host {
|
|
154
|
+
display: flex;
|
|
155
|
+
width: 100%;
|
|
156
|
+
gap: var(--tt-space-4);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:host([layout="horizontal"]) {
|
|
160
|
+
flex-direction: row;
|
|
161
|
+
align-items: flex-end;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host(:not([layout="horizontal"])) {
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host([loading]) {
|
|
169
|
+
pointer-events: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@media (max-width: 768px) {
|
|
173
|
+
:host([layout="horizontal"]) {
|
|
174
|
+
flex-direction: column;
|
|
175
|
+
align-items: stretch;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
`; }
|
|
179
|
+
render() {
|
|
180
|
+
return html `<slot></slot>`;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
__decorate([
|
|
184
|
+
property({ type: String })
|
|
185
|
+
], TTForm.prototype, "name", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
property({ type: String, reflect: true })
|
|
188
|
+
], TTForm.prototype, "layout", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
property({ type: Boolean, reflect: true })
|
|
191
|
+
], TTForm.prototype, "disabled", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
property({ type: Boolean, reflect: true })
|
|
194
|
+
], TTForm.prototype, "loading", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
property({ type: Boolean })
|
|
197
|
+
], TTForm.prototype, "novalidate", void 0);
|
|
198
|
+
TTForm = __decorate([
|
|
199
|
+
customElement("tt-form")
|
|
200
|
+
], TTForm);
|
|
201
|
+
export { TTForm };
|
|
202
|
+
//# sourceMappingURL=tt-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-form.js","sourceRoot":"","sources":["../src/tt-form.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAe5D;;;;;;;;;;;;GAYG;AACH,0EAA0E;AAC1E,8CAA8C;AAC9C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;AACvE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB,UAAU;IACV,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAC,CAAC;AAEH,SAAS,WAAW,CAAC,EAAe;IAClC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,OAAO,EAAE,YAAY,gBAAgB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC;AAGM,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QACuB,SAAI,GAAG,EAAE,CAAC;QAEtC,yEAAyE;QAEzE,WAAM,GAAe,UAAU,CAAC;QAEY,aAAQ,GAAG,KAA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O,EAAE,CAAC;0CAAoB;AAZrC,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAmKlB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import type { PropertyValues } from "lit";
|
|
3
|
+
/**
|
|
4
|
+
* Responsive grid. By default it auto-fills as many columns as will fit
|
|
5
|
+
* at `minWidth`, so it reflows without media queries. Set `columns` for a
|
|
6
|
+
* fixed count instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TTGrid extends LitElement {
|
|
9
|
+
minWidth: string;
|
|
10
|
+
gap: string;
|
|
11
|
+
columns: number;
|
|
12
|
+
willUpdate(changed: PropertyValues): void;
|
|
13
|
+
private setVar;
|
|
14
|
+
static styles: import("lit").CSSResult;
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
"tt-grid": TTGrid;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=tt-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-grid.d.ts","sourceRoot":"","sources":["../src/tt-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C;;;;GAIG;AACH,qBACa,MAAO,SAAQ,UAAU;IAGgB,QAAQ,SAAM;IAGtC,GAAG,SAAM;IAGT,OAAO,SAAK;IAExC,UAAU,CAAC,OAAO,EAAE,cAAc;IAelC,OAAO,CAAC,MAAM;IAQd,MAAM,CAAC,MAAM,0BAwCX;IAEF,MAAM;CAOP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
package/dist/tt-grid.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
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 } from "lit/decorators.js";
|
|
9
|
+
/**
|
|
10
|
+
* Responsive grid. By default it auto-fills as many columns as will fit
|
|
11
|
+
* at `minWidth`, so it reflows without media queries. Set `columns` for a
|
|
12
|
+
* fixed count instead.
|
|
13
|
+
*/
|
|
14
|
+
let TTGrid = class TTGrid extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
// Smallest an item may shrink to before the grid drops a column.
|
|
18
|
+
// Any CSS length ("220px", "14rem"). Ignored when `columns` is set.
|
|
19
|
+
this.minWidth = "";
|
|
20
|
+
// Space between items, both axes. Any CSS length or token.
|
|
21
|
+
this.gap = "";
|
|
22
|
+
// Fixed column count. 0 (default) = responsive auto-fill from minWidth.
|
|
23
|
+
this.columns = 0;
|
|
24
|
+
}
|
|
25
|
+
willUpdate(changed) {
|
|
26
|
+
if (changed.has("minWidth")) {
|
|
27
|
+
this.setVar("--tt-grid-min", this.minWidth);
|
|
28
|
+
}
|
|
29
|
+
if (changed.has("gap")) {
|
|
30
|
+
this.setVar("--tt-grid-gap", this.gap);
|
|
31
|
+
}
|
|
32
|
+
if (changed.has("columns")) {
|
|
33
|
+
this.setVar("--tt-grid-columns", this.columns > 0 ? `repeat(${this.columns}, 1fr)` : "");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
setVar(prop, value) {
|
|
37
|
+
if (value) {
|
|
38
|
+
this.style.setProperty(prop, value);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.style.removeProperty(prop);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static { this.styles = css `
|
|
45
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
46
|
+
hidden element would still show. Important, so it always wins. */
|
|
47
|
+
:host([hidden]) {
|
|
48
|
+
display: none !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host {
|
|
52
|
+
display: block;
|
|
53
|
+
width: 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.grid {
|
|
57
|
+
display: grid;
|
|
58
|
+
gap: var(--tt-grid-gap, 24px);
|
|
59
|
+
|
|
60
|
+
grid-template-columns: var(
|
|
61
|
+
--tt-grid-columns,
|
|
62
|
+
repeat(auto-fill, minmax(var(--tt-grid-min, 220px), 1fr))
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
A fixed column count would squash into unreadable slivers on a
|
|
68
|
+
phone, so below the tablet breakpoint it always falls back to
|
|
69
|
+
auto-fill. So columns means "this many, on wide screens".
|
|
70
|
+
*/
|
|
71
|
+
@media (max-width: 768px) {
|
|
72
|
+
.grid {
|
|
73
|
+
grid-template-columns: repeat(
|
|
74
|
+
auto-fill,
|
|
75
|
+
minmax(var(--tt-grid-min, 220px), 1fr)
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* The grid owns the width; cards fill their cell. */
|
|
81
|
+
::slotted(tt-product) {
|
|
82
|
+
--tt-product-width: 100%;
|
|
83
|
+
}
|
|
84
|
+
`; }
|
|
85
|
+
render() {
|
|
86
|
+
return html `
|
|
87
|
+
<div class="grid" part="grid">
|
|
88
|
+
<slot></slot>
|
|
89
|
+
</div>
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: String, attribute: "min-width" })
|
|
95
|
+
], TTGrid.prototype, "minWidth", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
property({ type: String })
|
|
98
|
+
], TTGrid.prototype, "gap", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
property({ type: Number })
|
|
101
|
+
], TTGrid.prototype, "columns", void 0);
|
|
102
|
+
TTGrid = __decorate([
|
|
103
|
+
customElement("tt-grid")
|
|
104
|
+
], TTGrid);
|
|
105
|
+
export { TTGrid };
|
|
106
|
+
//# sourceMappingURL=tt-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-grid.js","sourceRoot":"","sources":["../src/tt-grid.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QACL,iEAAiE;QACjE,oEAAoE;QAChB,aAAQ,GAAG,EAAE,CAAC;QAElE,2DAA2D;QAC/B,QAAG,GAAG,EAAE,CAAC;QAErC,wEAAwE;QAC5C,YAAO,GAAG,CAAC,CAAC;IA0E1C,CAAC;IAxEC,UAAU,CAAC,OAAuB;QAChC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,MAAM,CACT,mBAAmB,EACnB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CACvD,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,IAAY,EAAE,KAAa;QACxC,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;aAEM,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwClB,AAxCY,CAwCX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;;;;KAIV,CAAC;IACJ,CAAC;;AA/EmD;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;wCAAe;AAGtC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCAAU;AAGT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAa;AAT7B,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAmFlB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import type { PropertyValues, SVGTemplateResult } from "lit";
|
|
3
|
+
declare const shapes: Record<string, SVGTemplateResult>;
|
|
4
|
+
export type IconName = keyof typeof shapes;
|
|
5
|
+
/** Every icon name, so a docs page can list them without a second list. */
|
|
6
|
+
export declare const ICON_NAMES: string[];
|
|
7
|
+
export declare class TTIcon extends LitElement {
|
|
8
|
+
name: string;
|
|
9
|
+
size: string;
|
|
10
|
+
willUpdate(changed: PropertyValues): void;
|
|
11
|
+
static styles: import("lit").CSSResult;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
"tt-icon": TTIcon;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=tt-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-icon.d.ts","sourceRoot":"","sources":["../src/tt-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AA0B7D,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAwc7C,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,MAAM,CAAC;AAE3C,2EAA2E;AAC3E,eAAO,MAAM,UAAU,UAA6B,CAAC;AAErD,qBACa,MAAO,SAAQ,UAAU;IACR,IAAI,SAAM;IAYV,IAAI,SAAM;IAEtC,UAAU,CAAC,OAAO,EAAE,cAAc;IAUlC,MAAM,CAAC,MAAM,0BAqCX;IAEF,MAAM;CAuBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|