@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,441 @@
|
|
|
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
|
+
import "./tt-icon.js";
|
|
10
|
+
import { srOnly } from "./sr-only.js";
|
|
11
|
+
/**
|
|
12
|
+
* Puts several things side by side against the same set of attributes.
|
|
13
|
+
*
|
|
14
|
+
* Most directories make you open two tabs and look back and forth. This
|
|
15
|
+
* is the component that removes that, which the notes call out as a
|
|
16
|
+
* genuine differentiator, and it generalises well beyond suppliers:
|
|
17
|
+
* pricing tiers, product specs, plan features.
|
|
18
|
+
*
|
|
19
|
+
* TWO THINGS MAKE IT ACTUALLY USEFUL rather than just a table turned on
|
|
20
|
+
* its side.
|
|
21
|
+
*
|
|
22
|
+
* First, the ROW LABELS ARE THE FIRST COLUMN and they stick while you
|
|
23
|
+
* scroll sideways. Comparing is a horizontal act, and a comparison where
|
|
24
|
+
* you lose track of which attribute you are reading is worse than two
|
|
25
|
+
* tabs.
|
|
26
|
+
*
|
|
27
|
+
* Second, `differencesOnly` hides every row where all items agree. On a
|
|
28
|
+
* profile with thirty attributes, the four that differ are the entire
|
|
29
|
+
* question, and they are invisible among the twenty-six that do not.
|
|
30
|
+
*
|
|
31
|
+
* Booleans render as a tick or a dash rather than the words true and
|
|
32
|
+
* false, because a column of ticks is scannable and a column of "true" is
|
|
33
|
+
* not.
|
|
34
|
+
*/
|
|
35
|
+
let TTComparisonTable = class TTComparisonTable extends LitElement {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.rows = [];
|
|
39
|
+
this.items = [];
|
|
40
|
+
this.differencesOnly = false;
|
|
41
|
+
// Show a remove control on each column header.
|
|
42
|
+
this.removable = false;
|
|
43
|
+
this.emptyText = "Nothing to compare yet";
|
|
44
|
+
}
|
|
45
|
+
/*
|
|
46
|
+
Rows where every item agrees. Compared as JSON because a value may be
|
|
47
|
+
a number, a boolean or a string and they must compare consistently;
|
|
48
|
+
a TemplateResult never equals another, so any row holding one is
|
|
49
|
+
always treated as differing, which is the safe direction.
|
|
50
|
+
*/
|
|
51
|
+
get visibleRows() {
|
|
52
|
+
if (!this.differencesOnly || this.items.length < 2)
|
|
53
|
+
return this.rows;
|
|
54
|
+
return this.rows.filter((row) => {
|
|
55
|
+
const first = JSON.stringify(this.items[0].values[row.key] ?? null);
|
|
56
|
+
return this.items.some((item) => JSON.stringify(item.values[row.key] ?? null) !== first);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// removeItem, not remove: Element.remove() already exists, and
|
|
60
|
+
// shadowing a built-in DOM member breaks the element type outright.
|
|
61
|
+
removeItem(item, index, event) {
|
|
62
|
+
// Only when the button really had focus. Safari does not focus a
|
|
63
|
+
// clicked button, and focus that is not ours is not ours to move.
|
|
64
|
+
if (this.shadowRoot?.activeElement === event.currentTarget) {
|
|
65
|
+
this.pendingFocus = { id: item.id, index };
|
|
66
|
+
}
|
|
67
|
+
this.dispatchEvent(new CustomEvent("tt-remove", {
|
|
68
|
+
detail: { id: item.id },
|
|
69
|
+
bubbles: true,
|
|
70
|
+
composed: true,
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
/*
|
|
74
|
+
The tick and the dash are drawn for the eye and hidden from the screen
|
|
75
|
+
reader, and the words are the other way round. aria-label on the icon
|
|
76
|
+
or on a plain <span> does nothing: neither has a role, and ARIA does
|
|
77
|
+
not let an element with no role carry a name. tt-icon also hides its
|
|
78
|
+
own SVG. Real text is the only thing that is always read.
|
|
79
|
+
*/
|
|
80
|
+
updated(changed) {
|
|
81
|
+
if (!changed.has("items") || !this.pendingFocus)
|
|
82
|
+
return;
|
|
83
|
+
const { id, index } = this.pendingFocus;
|
|
84
|
+
this.pendingFocus = undefined;
|
|
85
|
+
// The parent kept the column, so the button and its focus are still
|
|
86
|
+
// there. Nothing to repair.
|
|
87
|
+
if (this.items.some((item) => item.id === id))
|
|
88
|
+
return;
|
|
89
|
+
// The column that slid into the removed one's place, or the new last
|
|
90
|
+
// one; with no columns left, the empty message.
|
|
91
|
+
const buttons = this.renderRoot.querySelectorAll(".remove");
|
|
92
|
+
const next = buttons[Math.min(index, buttons.length - 1)] ??
|
|
93
|
+
this.renderRoot.querySelector(".empty");
|
|
94
|
+
next?.focus();
|
|
95
|
+
}
|
|
96
|
+
renderValue(value) {
|
|
97
|
+
if (value === true) {
|
|
98
|
+
return html `<tt-icon class="yes" name="check" size="16px"></tt-icon
|
|
99
|
+
><span class="sr-only">Yes</span>`;
|
|
100
|
+
}
|
|
101
|
+
if (value === false) {
|
|
102
|
+
return html `<span class="no" aria-hidden="true">—</span
|
|
103
|
+
><span class="sr-only">No</span>`;
|
|
104
|
+
}
|
|
105
|
+
// Null and empty mean "not stated", which is different from "no" and
|
|
106
|
+
// should not be dressed up as either.
|
|
107
|
+
if (value === null || value === undefined || value === "") {
|
|
108
|
+
return html `<span class="unknown">Not stated</span>`;
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
static { this.styles = [
|
|
113
|
+
srOnly,
|
|
114
|
+
css `
|
|
115
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
116
|
+
hidden element would still show. Important, so it always wins. */
|
|
117
|
+
:host([hidden]) {
|
|
118
|
+
display: none !important;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host {
|
|
122
|
+
display: block;
|
|
123
|
+
font-family: var(--tt-font-sans);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.wrap {
|
|
127
|
+
width: 100%;
|
|
128
|
+
overflow-x: auto;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
|
|
131
|
+
background: var(--tt-card);
|
|
132
|
+
border: 1px solid var(--tt-border);
|
|
133
|
+
border-radius: var(--tt-radius-lg);
|
|
134
|
+
|
|
135
|
+
-webkit-overflow-scrolling: touch;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
table {
|
|
139
|
+
width: 100%;
|
|
140
|
+
border-collapse: separate;
|
|
141
|
+
border-spacing: 0;
|
|
142
|
+
font-size: var(--tt-text-sm);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
th,
|
|
146
|
+
td {
|
|
147
|
+
padding: var(--tt-space-3) var(--tt-space-4);
|
|
148
|
+
text-align: left;
|
|
149
|
+
vertical-align: top;
|
|
150
|
+
border-bottom: 1px solid var(--tt-border);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
The attribute column sticks. Comparing is a sideways act, and losing
|
|
155
|
+
track of which row you are reading defeats the whole component.
|
|
156
|
+
z-index keeps it above the scrolling cells; the background is
|
|
157
|
+
required or they show through underneath it.
|
|
158
|
+
*/
|
|
159
|
+
.attr {
|
|
160
|
+
position: sticky;
|
|
161
|
+
left: 0;
|
|
162
|
+
z-index: 2;
|
|
163
|
+
|
|
164
|
+
min-width: 140px;
|
|
165
|
+
background: var(--tt-card);
|
|
166
|
+
border-right: 1px solid var(--tt-border);
|
|
167
|
+
|
|
168
|
+
/* Reads as pinned rather than as a column that happens to be
|
|
169
|
+
first, and makes it obvious content is passing underneath. A
|
|
170
|
+
token, because a fixed 8% black vanished on the dark theme. */
|
|
171
|
+
box-shadow: var(--tt-shadow-pinned);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
thead .attr {
|
|
175
|
+
z-index: 3;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Pins only when ::part(wrap) has a max-height. See the same rule in
|
|
179
|
+
tt-data-table for why it cannot pin to the page. */
|
|
180
|
+
thead th {
|
|
181
|
+
position: sticky;
|
|
182
|
+
top: 0;
|
|
183
|
+
z-index: 1;
|
|
184
|
+
|
|
185
|
+
background: var(--tt-muted);
|
|
186
|
+
vertical-align: bottom;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
thead .attr {
|
|
190
|
+
background: var(--tt-muted);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.item-head {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: flex-start;
|
|
196
|
+
gap: var(--tt-space-2);
|
|
197
|
+
min-width: 160px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.item-title {
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
gap: 2px;
|
|
204
|
+
min-width: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.item-label {
|
|
208
|
+
font-size: var(--tt-text-sm);
|
|
209
|
+
font-weight: var(--tt-weight-semibold);
|
|
210
|
+
color: var(--tt-foreground);
|
|
211
|
+
overflow-wrap: anywhere;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.item-meta {
|
|
215
|
+
font-size: var(--tt-text-xs);
|
|
216
|
+
font-weight: var(--tt-weight-regular);
|
|
217
|
+
color: var(--tt-muted-foreground);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.attr-label {
|
|
221
|
+
font-weight: var(--tt-weight-medium);
|
|
222
|
+
color: var(--tt-foreground);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.attr-hint {
|
|
226
|
+
display: block;
|
|
227
|
+
margin-top: 2px;
|
|
228
|
+
font-size: var(--tt-text-xs);
|
|
229
|
+
font-weight: var(--tt-weight-regular);
|
|
230
|
+
color: var(--tt-muted-foreground);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.yes {
|
|
234
|
+
color: var(--tt-success);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.no {
|
|
238
|
+
color: var(--tt-muted-foreground);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* Absent is not the same as no, and should not look like it. */
|
|
242
|
+
.unknown {
|
|
243
|
+
font-size: var(--tt-text-xs);
|
|
244
|
+
font-style: italic;
|
|
245
|
+
color: var(--tt-muted-foreground);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.remove {
|
|
249
|
+
flex: 0 0 auto;
|
|
250
|
+
|
|
251
|
+
display: inline-flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
justify-content: center;
|
|
254
|
+
|
|
255
|
+
/* Same size rule as tt-search's clear button: a square inside a
|
|
256
|
+
small control, so it grows with the touch and density tokens
|
|
257
|
+
instead of staying a 22px target on a phone. */
|
|
258
|
+
width: calc(var(--tt-control-sm) - 8px);
|
|
259
|
+
height: calc(var(--tt-control-sm) - 8px);
|
|
260
|
+
|
|
261
|
+
padding: 0;
|
|
262
|
+
border: none;
|
|
263
|
+
border-radius: var(--tt-radius-full);
|
|
264
|
+
|
|
265
|
+
background: transparent;
|
|
266
|
+
color: var(--tt-muted-foreground);
|
|
267
|
+
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.remove:hover {
|
|
272
|
+
background: var(--tt-accent);
|
|
273
|
+
color: var(--tt-foreground);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.remove:focus-visible {
|
|
277
|
+
outline: var(--tt-ring-width) solid var(--tt-ring);
|
|
278
|
+
outline-offset: var(--tt-ring-offset);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.empty {
|
|
282
|
+
padding: var(--tt-space-8);
|
|
283
|
+
text-align: center;
|
|
284
|
+
font-size: var(--tt-text-sm);
|
|
285
|
+
color: var(--tt-muted-foreground);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/*
|
|
289
|
+
Takes focus when the last column is removed, so it shows the ring
|
|
290
|
+
like anything else with focus. Drawn INSIDE the edge: the scrolling
|
|
291
|
+
.wrap clips anything outside its box, so the usual positive offset
|
|
292
|
+
would be cut off completely.
|
|
293
|
+
*/
|
|
294
|
+
.empty:focus-visible {
|
|
295
|
+
outline: var(--tt-ring-width) solid var(--tt-ring);
|
|
296
|
+
outline-offset: calc(var(--tt-ring-width) * -1);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
tbody tr:last-child th,
|
|
300
|
+
tbody tr:last-child td {
|
|
301
|
+
border-bottom: none;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/*
|
|
305
|
+
MOBILE. The sticky column was eating the screen.
|
|
306
|
+
|
|
307
|
+
At 140px min-width plus space-4 padding on both sides it took about
|
|
308
|
+
172px of a 360px phone, and each item column then wanted 192px - so
|
|
309
|
+
one column filled the remaining space and nothing else was legible.
|
|
310
|
+
A comparison you can only see one side of is not a comparison.
|
|
311
|
+
|
|
312
|
+
Everything here buys horizontal room back: tighter padding, a
|
|
313
|
+
smaller floor on both columns, and smaller type in the attribute
|
|
314
|
+
column, whose labels can wrap onto two lines quite happily. The
|
|
315
|
+
target is that the second item column is partly visible, because a
|
|
316
|
+
half-visible column is what tells you to swipe.
|
|
317
|
+
|
|
318
|
+
768px, the library's tablet breakpoint, not a one-off value.
|
|
319
|
+
*/
|
|
320
|
+
@media (max-width: 768px) {
|
|
321
|
+
th,
|
|
322
|
+
td {
|
|
323
|
+
padding: var(--tt-space-2) var(--tt-space-3);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.attr {
|
|
327
|
+
min-width: 92px;
|
|
328
|
+
width: 92px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.attr-label {
|
|
332
|
+
font-size: var(--tt-text-xs);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.item-head {
|
|
336
|
+
min-width: 118px;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.item-label {
|
|
340
|
+
font-size: var(--tt-text-xs);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
table {
|
|
344
|
+
font-size: var(--tt-text-xs);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
`,
|
|
348
|
+
]; }
|
|
349
|
+
render() {
|
|
350
|
+
if (this.items.length === 0) {
|
|
351
|
+
return html `<div class="wrap">
|
|
352
|
+
<div class="empty" part="empty" tabindex="-1">${this.emptyText}</div>
|
|
353
|
+
</div>`;
|
|
354
|
+
}
|
|
355
|
+
const rows = this.visibleRows;
|
|
356
|
+
return html `
|
|
357
|
+
<div class="wrap" part="wrap">
|
|
358
|
+
<table part="table">
|
|
359
|
+
<thead>
|
|
360
|
+
<tr>
|
|
361
|
+
<th class="attr" scope="col">
|
|
362
|
+
<span class="attr-label">Compare</span>
|
|
363
|
+
</th>
|
|
364
|
+
|
|
365
|
+
${this.items.map((item, index) => html `
|
|
366
|
+
<th scope="col">
|
|
367
|
+
<div class="item-head">
|
|
368
|
+
<span class="item-title">
|
|
369
|
+
<span class="item-label">${item.label}</span>
|
|
370
|
+
${item.meta
|
|
371
|
+
? html `<span class="item-meta">${item.meta}</span>`
|
|
372
|
+
: ""}
|
|
373
|
+
</span>
|
|
374
|
+
|
|
375
|
+
${this.removable
|
|
376
|
+
? html `
|
|
377
|
+
<button
|
|
378
|
+
class="remove"
|
|
379
|
+
type="button"
|
|
380
|
+
aria-label=${`Remove ${item.label}`}
|
|
381
|
+
@click=${(e) => this.removeItem(item, index, e)}
|
|
382
|
+
>
|
|
383
|
+
<tt-icon name="x" size="14px"></tt-icon>
|
|
384
|
+
</button>
|
|
385
|
+
`
|
|
386
|
+
: ""}
|
|
387
|
+
</div>
|
|
388
|
+
</th>
|
|
389
|
+
`)}
|
|
390
|
+
</tr>
|
|
391
|
+
</thead>
|
|
392
|
+
|
|
393
|
+
<tbody>
|
|
394
|
+
${rows.length === 0
|
|
395
|
+
? html `
|
|
396
|
+
<tr>
|
|
397
|
+
<td class="empty" colspan=${this.items.length + 1}>
|
|
398
|
+
These are identical on every attribute.
|
|
399
|
+
</td>
|
|
400
|
+
</tr>
|
|
401
|
+
`
|
|
402
|
+
: rows.map((row) => html `
|
|
403
|
+
<tr>
|
|
404
|
+
<th class="attr" scope="row">
|
|
405
|
+
<span class="attr-label">${row.label}</span>
|
|
406
|
+
${row.hint
|
|
407
|
+
? html `<span class="attr-hint">${row.hint}</span>`
|
|
408
|
+
: ""}
|
|
409
|
+
</th>
|
|
410
|
+
|
|
411
|
+
${this.items.map((item) => html `
|
|
412
|
+
<td>${this.renderValue(item.values[row.key] ?? null)}</td>
|
|
413
|
+
`)}
|
|
414
|
+
</tr>
|
|
415
|
+
`)}
|
|
416
|
+
</tbody>
|
|
417
|
+
</table>
|
|
418
|
+
</div>
|
|
419
|
+
`;
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
__decorate([
|
|
423
|
+
property({ type: Array })
|
|
424
|
+
], TTComparisonTable.prototype, "rows", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
property({ type: Array })
|
|
427
|
+
], TTComparisonTable.prototype, "items", void 0);
|
|
428
|
+
__decorate([
|
|
429
|
+
property({ type: Boolean, attribute: "differences-only" })
|
|
430
|
+
], TTComparisonTable.prototype, "differencesOnly", void 0);
|
|
431
|
+
__decorate([
|
|
432
|
+
property({ type: Boolean })
|
|
433
|
+
], TTComparisonTable.prototype, "removable", void 0);
|
|
434
|
+
__decorate([
|
|
435
|
+
property({ type: String, attribute: "empty-text" })
|
|
436
|
+
], TTComparisonTable.prototype, "emptyText", void 0);
|
|
437
|
+
TTComparisonTable = __decorate([
|
|
438
|
+
customElement("tt-comparison-table")
|
|
439
|
+
], TTComparisonTable);
|
|
440
|
+
export { TTComparisonTable };
|
|
441
|
+
//# sourceMappingURL=tt-comparison-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-comparison-table.js","sourceRoot":"","sources":["../src/tt-comparison-table.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,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC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E4B,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;;;;iBAIpD;YACH,CAAC,CAAC,IAAI,CAAC,GAAG,CACN,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAA;;;mDAGoB,GAAG,CAAC,KAAK;0BAClC,GAAG,CAAC,IAAI;gBACR,CAAC,CAAC,IAAI,CAAA,2BAA2B,GAAG,CAAC,IAAI,SAAS;gBAClD,CAAC,CAAC,EAAE;;;wBAGN,IAAI,CAAC,KAAK,CAAC,GAAG,CACd,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;gCACN,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;yBACrD,CACF;;mBAEJ,CACF;;;;KAIZ,CAAC;IACJ,CAAC;;AAva0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAyB;AAExB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAA2B;AAEO;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;0DAAyB;AAGvD;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAAmB;AAEM;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAAsC;AAV/E,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAya7B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import type { TemplateResult } from "lit";
|
|
3
|
+
import "./tt-page.js";
|
|
4
|
+
import "./tt-section.js";
|
|
5
|
+
import "./tt-preview.js";
|
|
6
|
+
import "./tt-example.js";
|
|
7
|
+
import "./tt-code-block.js";
|
|
8
|
+
import "./tt-table.js";
|
|
9
|
+
import "./tt-icon.js";
|
|
10
|
+
import type { TableRow } from "./tt-table.js";
|
|
11
|
+
export interface DocExample {
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
preview: TemplateResult;
|
|
15
|
+
code: string;
|
|
16
|
+
language?: string;
|
|
17
|
+
align?: "center" | "start" | "stretch";
|
|
18
|
+
}
|
|
19
|
+
export interface DocGuidelines {
|
|
20
|
+
use?: string[];
|
|
21
|
+
avoid?: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface DocKeyBinding {
|
|
24
|
+
keys: string;
|
|
25
|
+
action: string;
|
|
26
|
+
}
|
|
27
|
+
export interface DocAccessibility {
|
|
28
|
+
keys?: DocKeyBinding[];
|
|
29
|
+
notes?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface DocRelated {
|
|
32
|
+
label: string;
|
|
33
|
+
doc: string;
|
|
34
|
+
reason?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare class TTComponentDoc extends LitElement {
|
|
37
|
+
heading: string;
|
|
38
|
+
description: string;
|
|
39
|
+
code: string;
|
|
40
|
+
props: TableRow[];
|
|
41
|
+
events: TableRow[];
|
|
42
|
+
methods: TableRow[];
|
|
43
|
+
slots: TableRow[];
|
|
44
|
+
parts: TableRow[];
|
|
45
|
+
cssProperties: TableRow[];
|
|
46
|
+
importPath: string;
|
|
47
|
+
anatomy: string;
|
|
48
|
+
examples: DocExample[];
|
|
49
|
+
guidelines: DocGuidelines | null;
|
|
50
|
+
accessibility: DocAccessibility | null;
|
|
51
|
+
related: DocRelated[];
|
|
52
|
+
private openDoc;
|
|
53
|
+
static styles: import("lit").CSSResult;
|
|
54
|
+
private renderGuidelines;
|
|
55
|
+
private renderAccessibility;
|
|
56
|
+
render(): TemplateResult<1>;
|
|
57
|
+
}
|
|
58
|
+
declare global {
|
|
59
|
+
interface HTMLElementTagNameMap {
|
|
60
|
+
"tt-component-doc": TTComponentDoc;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=tt-component-doc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-component-doc.d.ts","sourceRoot":"","sources":["../src/tt-component-doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,cAAc,CAAC;AACtB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAe,QAAQ,EAAE,MAAM,eAAe,CAAC;AAO3D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA0CD,qBACa,cAAe,SAAQ,UAAU;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