@visitwonders/assembly 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/LICENSE.md +9 -0
- package/README.md +26 -0
- package/addon-main.cjs +4 -0
- package/declarations/action/button.d.ts +50 -0
- package/declarations/action/button.d.ts.map +1 -0
- package/declarations/action/index.d.ts +3 -0
- package/declarations/action/index.d.ts.map +1 -0
- package/declarations/action/link.d.ts +16 -0
- package/declarations/action/link.d.ts.map +1 -0
- package/declarations/components/form/checkbox.d.ts +65 -0
- package/declarations/components/form/checkbox.d.ts.map +1 -0
- package/declarations/components/form/control.d.ts +36 -0
- package/declarations/components/form/control.d.ts.map +1 -0
- package/declarations/components/form/error-message.d.ts +22 -0
- package/declarations/components/form/error-message.d.ts.map +1 -0
- package/declarations/components/form/field.d.ts +21 -0
- package/declarations/components/form/field.d.ts.map +1 -0
- package/declarations/components/form/form.d.ts +14 -0
- package/declarations/components/form/form.d.ts.map +1 -0
- package/declarations/components/form/help-text.d.ts +14 -0
- package/declarations/components/form/help-text.d.ts.map +1 -0
- package/declarations/components/form/index.d.ts +15 -0
- package/declarations/components/form/index.d.ts.map +1 -0
- package/declarations/components/form/input.d.ts +80 -0
- package/declarations/components/form/input.d.ts.map +1 -0
- package/declarations/components/form/label.d.ts +34 -0
- package/declarations/components/form/label.d.ts.map +1 -0
- package/declarations/components/form/radio-group.d.ts +43 -0
- package/declarations/components/form/radio-group.d.ts.map +1 -0
- package/declarations/components/form/radio.d.ts +54 -0
- package/declarations/components/form/radio.d.ts.map +1 -0
- package/declarations/components/form/search-input.d.ts +35 -0
- package/declarations/components/form/search-input.d.ts.map +1 -0
- package/declarations/components/form/select.d.ts +36 -0
- package/declarations/components/form/select.d.ts.map +1 -0
- package/declarations/components/form/test.d.ts +11 -0
- package/declarations/components/form/test.d.ts.map +1 -0
- package/declarations/components/form/textarea.d.ts +79 -0
- package/declarations/components/form/textarea.d.ts.map +1 -0
- package/declarations/components/form/toggle.d.ts +23 -0
- package/declarations/components/form/toggle.d.ts.map +1 -0
- package/declarations/components/primitives/grid-item.d.ts +21 -0
- package/declarations/components/primitives/grid-item.d.ts.map +1 -0
- package/declarations/components/primitives/grid.d.ts +49 -0
- package/declarations/components/primitives/grid.d.ts.map +1 -0
- package/declarations/components/primitives/h-stack.d.ts +17 -0
- package/declarations/components/primitives/h-stack.d.ts.map +1 -0
- package/declarations/components/primitives/heading.d.ts +52 -0
- package/declarations/components/primitives/heading.d.ts.map +1 -0
- package/declarations/components/primitives/image.d.ts +24 -0
- package/declarations/components/primitives/image.d.ts.map +1 -0
- package/declarations/components/primitives/index.d.ts +8 -0
- package/declarations/components/primitives/index.d.ts.map +1 -0
- package/declarations/components/primitives/link.d.ts +16 -0
- package/declarations/components/primitives/link.d.ts.map +1 -0
- package/declarations/components/primitives/stack.d.ts +23 -0
- package/declarations/components/primitives/stack.d.ts.map +1 -0
- package/declarations/components/primitives/text.d.ts +50 -0
- package/declarations/components/primitives/text.d.ts.map +1 -0
- package/declarations/components/primitives/v-stack.d.ts +16 -0
- package/declarations/components/primitives/v-stack.d.ts.map +1 -0
- package/declarations/components/ui/badge.d.ts +14 -0
- package/declarations/components/ui/badge.d.ts.map +1 -0
- package/declarations/components/ui/button.d.ts +32 -0
- package/declarations/components/ui/button.d.ts.map +1 -0
- package/declarations/components/ui/card.d.ts +27 -0
- package/declarations/components/ui/card.d.ts.map +1 -0
- package/declarations/components/ui/description-list.d.ts +22 -0
- package/declarations/components/ui/description-list.d.ts.map +1 -0
- package/declarations/components/ui/drawer.d.ts +14 -0
- package/declarations/components/ui/drawer.d.ts.map +1 -0
- package/declarations/components/ui/icon-button.d.ts +21 -0
- package/declarations/components/ui/icon-button.d.ts.map +1 -0
- package/declarations/components/ui/icon.d.ts +21 -0
- package/declarations/components/ui/icon.d.ts.map +1 -0
- package/declarations/components/ui/index.d.ts +17 -0
- package/declarations/components/ui/index.d.ts.map +1 -0
- package/declarations/components/ui/modal.d.ts +14 -0
- package/declarations/components/ui/modal.d.ts.map +1 -0
- package/declarations/components/ui/page-header.d.ts +16 -0
- package/declarations/components/ui/page-header.d.ts.map +1 -0
- package/declarations/components/ui/skeleton-card.d.ts +17 -0
- package/declarations/components/ui/skeleton-card.d.ts.map +1 -0
- package/declarations/components/ui/skeleton-text.d.ts +16 -0
- package/declarations/components/ui/skeleton-text.d.ts.map +1 -0
- package/declarations/components/ui/skeleton.d.ts +20 -0
- package/declarations/components/ui/skeleton.d.ts.map +1 -0
- package/declarations/components/ui/spinner.d.ts +11 -0
- package/declarations/components/ui/spinner.d.ts.map +1 -0
- package/declarations/components/ui/tab-nav/index.d.ts +36 -0
- package/declarations/components/ui/tab-nav/index.d.ts.map +1 -0
- package/declarations/components/ui/table/body.d.ts +11 -0
- package/declarations/components/ui/table/body.d.ts.map +1 -0
- package/declarations/components/ui/table/caption.d.ts +18 -0
- package/declarations/components/ui/table/caption.d.ts.map +1 -0
- package/declarations/components/ui/table/cell.d.ts +31 -0
- package/declarations/components/ui/table/cell.d.ts.map +1 -0
- package/declarations/components/ui/table/footer.d.ts +11 -0
- package/declarations/components/ui/table/footer.d.ts.map +1 -0
- package/declarations/components/ui/table/header-cell.d.ts +35 -0
- package/declarations/components/ui/table/header-cell.d.ts.map +1 -0
- package/declarations/components/ui/table/header.d.ts +11 -0
- package/declarations/components/ui/table/header.d.ts.map +1 -0
- package/declarations/components/ui/table/index.d.ts +0 -0
- package/declarations/components/ui/table/index.d.ts.map +1 -0
- package/declarations/components/ui/table/row.d.ts +21 -0
- package/declarations/components/ui/table/row.d.ts.map +1 -0
- package/declarations/components/ui/table_old.d.ts +29 -0
- package/declarations/components/ui/table_old.d.ts.map +1 -0
- package/declarations/data/index.d.ts +2 -0
- package/declarations/data/index.d.ts.map +1 -0
- package/declarations/data/table.d.ts +147 -0
- package/declarations/data/table.d.ts.map +1 -0
- package/declarations/form/calendar.d.ts +113 -0
- package/declarations/form/calendar.d.ts.map +1 -0
- package/declarations/form/checkbox-group.d.ts +84 -0
- package/declarations/form/checkbox-group.d.ts.map +1 -0
- package/declarations/form/checkbox.d.ts +65 -0
- package/declarations/form/checkbox.d.ts.map +1 -0
- package/declarations/form/control.d.ts +53 -0
- package/declarations/form/control.d.ts.map +1 -0
- package/declarations/form/country-data.d.ts +42 -0
- package/declarations/form/country-data.d.ts.map +1 -0
- package/declarations/form/country-select-field.d.ts +52 -0
- package/declarations/form/country-select-field.d.ts.map +1 -0
- package/declarations/form/country-select.d.ts +117 -0
- package/declarations/form/country-select.d.ts.map +1 -0
- package/declarations/form/date-picker-field.d.ts +69 -0
- package/declarations/form/date-picker-field.d.ts.map +1 -0
- package/declarations/form/date-picker.d.ts +128 -0
- package/declarations/form/date-picker.d.ts.map +1 -0
- package/declarations/form/date-range-picker-field.d.ts +71 -0
- package/declarations/form/date-range-picker-field.d.ts.map +1 -0
- package/declarations/form/date-range-picker.d.ts +146 -0
- package/declarations/form/date-range-picker.d.ts.map +1 -0
- package/declarations/form/error-message.d.ts +22 -0
- package/declarations/form/error-message.d.ts.map +1 -0
- package/declarations/form/field.d.ts +21 -0
- package/declarations/form/field.d.ts.map +1 -0
- package/declarations/form/form.d.ts +61 -0
- package/declarations/form/form.d.ts.map +1 -0
- package/declarations/form/help-text.d.ts +14 -0
- package/declarations/form/help-text.d.ts.map +1 -0
- package/declarations/form/index.d.ts +35 -0
- package/declarations/form/index.d.ts.map +1 -0
- package/declarations/form/input.d.ts +78 -0
- package/declarations/form/input.d.ts.map +1 -0
- package/declarations/form/label.d.ts +34 -0
- package/declarations/form/label.d.ts.map +1 -0
- package/declarations/form/listbox.d.ts +181 -0
- package/declarations/form/listbox.d.ts.map +1 -0
- package/declarations/form/money-field.d.ts +74 -0
- package/declarations/form/money-field.d.ts.map +1 -0
- package/declarations/form/multi-select.d.ts +121 -0
- package/declarations/form/multi-select.d.ts.map +1 -0
- package/declarations/form/number-field.d.ts +86 -0
- package/declarations/form/number-field.d.ts.map +1 -0
- package/declarations/form/option-group.d.ts +2 -0
- package/declarations/form/option-group.d.ts.map +1 -0
- package/declarations/form/option.d.ts +2 -0
- package/declarations/form/option.d.ts.map +1 -0
- package/declarations/form/radio-group.d.ts +43 -0
- package/declarations/form/radio-group.d.ts.map +1 -0
- package/declarations/form/radio.d.ts +54 -0
- package/declarations/form/radio.d.ts.map +1 -0
- package/declarations/form/search-input.d.ts +35 -0
- package/declarations/form/search-input.d.ts.map +1 -0
- package/declarations/form/select-field.d.ts +49 -0
- package/declarations/form/select-field.d.ts.map +1 -0
- package/declarations/form/select.d.ts +145 -0
- package/declarations/form/select.d.ts.map +1 -0
- package/declarations/form/test.d.ts +11 -0
- package/declarations/form/test.d.ts.map +1 -0
- package/declarations/form/text-field.d.ts +95 -0
- package/declarations/form/text-field.d.ts.map +1 -0
- package/declarations/form/textarea.d.ts +81 -0
- package/declarations/form/textarea.d.ts.map +1 -0
- package/declarations/form/time-picker-field.d.ts +61 -0
- package/declarations/form/time-picker-field.d.ts.map +1 -0
- package/declarations/form/time-picker.d.ts +151 -0
- package/declarations/form/time-picker.d.ts.map +1 -0
- package/declarations/form/toggle-field.d.ts +45 -0
- package/declarations/form/toggle-field.d.ts.map +1 -0
- package/declarations/form/toggle-group.d.ts +21 -0
- package/declarations/form/toggle-group.d.ts.map +1 -0
- package/declarations/form/toggle.d.ts +59 -0
- package/declarations/form/toggle.d.ts.map +1 -0
- package/declarations/index.d.ts +1 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/layout/divider.d.ts +21 -0
- package/declarations/layout/divider.d.ts.map +1 -0
- package/declarations/layout/grid-item.d.ts +21 -0
- package/declarations/layout/grid-item.d.ts.map +1 -0
- package/declarations/layout/grid.d.ts +49 -0
- package/declarations/layout/grid.d.ts.map +1 -0
- package/declarations/layout/h-stack.d.ts +17 -0
- package/declarations/layout/h-stack.d.ts.map +1 -0
- package/declarations/layout/index.d.ts +7 -0
- package/declarations/layout/index.d.ts.map +1 -0
- package/declarations/layout/stack.d.ts +23 -0
- package/declarations/layout/stack.d.ts.map +1 -0
- package/declarations/layout/v-stack.d.ts +16 -0
- package/declarations/layout/v-stack.d.ts.map +1 -0
- package/declarations/media/icon.d.ts +34 -0
- package/declarations/media/icon.d.ts.map +1 -0
- package/declarations/media/image.d.ts +24 -0
- package/declarations/media/image.d.ts.map +1 -0
- package/declarations/media/index.d.ts +3 -0
- package/declarations/media/index.d.ts.map +1 -0
- package/declarations/overlay/blanket.d.ts +78 -0
- package/declarations/overlay/blanket.d.ts.map +1 -0
- package/declarations/overlay/drawer.d.ts +140 -0
- package/declarations/overlay/drawer.d.ts.map +1 -0
- package/declarations/overlay/index.d.ts +7 -0
- package/declarations/overlay/index.d.ts.map +1 -0
- package/declarations/overlay/modal.d.ts +138 -0
- package/declarations/overlay/modal.d.ts.map +1 -0
- package/declarations/overlay/popover.d.ts +205 -0
- package/declarations/overlay/popover.d.ts.map +1 -0
- package/declarations/overlay/toast.d.ts +58 -0
- package/declarations/overlay/toast.d.ts.map +1 -0
- package/declarations/overlay/tooltip.d.ts +154 -0
- package/declarations/overlay/tooltip.d.ts.map +1 -0
- package/declarations/primitives/grid-item.d.ts +21 -0
- package/declarations/primitives/grid-item.d.ts.map +1 -0
- package/declarations/primitives/grid.d.ts +49 -0
- package/declarations/primitives/grid.d.ts.map +1 -0
- package/declarations/primitives/h-stack.d.ts +17 -0
- package/declarations/primitives/h-stack.d.ts.map +1 -0
- package/declarations/primitives/heading.d.ts +52 -0
- package/declarations/primitives/heading.d.ts.map +1 -0
- package/declarations/primitives/image.d.ts +24 -0
- package/declarations/primitives/image.d.ts.map +1 -0
- package/declarations/primitives/index.d.ts +4 -0
- package/declarations/primitives/index.d.ts.map +1 -0
- package/declarations/primitives/link.d.ts +16 -0
- package/declarations/primitives/link.d.ts.map +1 -0
- package/declarations/primitives/stack.d.ts +23 -0
- package/declarations/primitives/stack.d.ts.map +1 -0
- package/declarations/primitives/text.d.ts +50 -0
- package/declarations/primitives/text.d.ts.map +1 -0
- package/declarations/primitives/v-stack.d.ts +16 -0
- package/declarations/primitives/v-stack.d.ts.map +1 -0
- package/declarations/services/index.d.ts +3 -0
- package/declarations/services/index.d.ts.map +1 -0
- package/declarations/services/toast.d.ts +81 -0
- package/declarations/services/toast.d.ts.map +1 -0
- package/declarations/status/badge.d.ts +38 -0
- package/declarations/status/badge.d.ts.map +1 -0
- package/declarations/status/index.d.ts +8 -0
- package/declarations/status/index.d.ts.map +1 -0
- package/declarations/status/skeleton-avatar.d.ts +22 -0
- package/declarations/status/skeleton-avatar.d.ts.map +1 -0
- package/declarations/status/skeleton-button.d.ts +21 -0
- package/declarations/status/skeleton-button.d.ts.map +1 -0
- package/declarations/status/skeleton-image.d.ts +21 -0
- package/declarations/status/skeleton-image.d.ts.map +1 -0
- package/declarations/status/skeleton-text.d.ts +24 -0
- package/declarations/status/skeleton-text.d.ts.map +1 -0
- package/declarations/status/skeleton.d.ts +33 -0
- package/declarations/status/skeleton.d.ts.map +1 -0
- package/declarations/status/tag.d.ts +48 -0
- package/declarations/status/tag.d.ts.map +1 -0
- package/declarations/template-registry.d.ts +1 -0
- package/declarations/template-registry.d.ts.map +1 -0
- package/declarations/types/design-system.d.ts +42 -0
- package/declarations/types/design-system.d.ts.map +1 -0
- package/declarations/typography/heading.d.ts +52 -0
- package/declarations/typography/heading.d.ts.map +1 -0
- package/declarations/typography/index.d.ts +3 -0
- package/declarations/typography/index.d.ts.map +1 -0
- package/declarations/typography/link.d.ts +16 -0
- package/declarations/typography/link.d.ts.map +1 -0
- package/declarations/typography/text.d.ts +50 -0
- package/declarations/typography/text.d.ts.map +1 -0
- package/declarations/ui/button.d.ts +50 -0
- package/declarations/ui/button.d.ts.map +1 -0
- package/declarations/ui/icon.d.ts +21 -0
- package/declarations/ui/icon.d.ts.map +1 -0
- package/declarations/ui/index.d.ts +2 -0
- package/declarations/ui/index.d.ts.map +1 -0
- package/dist/_app_/action/button.js +1 -0
- package/dist/_app_/action/link.js +1 -0
- package/dist/_app_/data/table.js +1 -0
- package/dist/_app_/form/calendar.js +1 -0
- package/dist/_app_/form/checkbox-group.js +1 -0
- package/dist/_app_/form/checkbox.js +1 -0
- package/dist/_app_/form/control.js +1 -0
- package/dist/_app_/form/country-data.js +1 -0
- package/dist/_app_/form/country-select-field.js +1 -0
- package/dist/_app_/form/country-select.js +1 -0
- package/dist/_app_/form/date-picker-field.js +1 -0
- package/dist/_app_/form/date-picker.js +1 -0
- package/dist/_app_/form/date-range-picker-field.js +1 -0
- package/dist/_app_/form/date-range-picker.js +1 -0
- package/dist/_app_/form/error-message.js +1 -0
- package/dist/_app_/form/field.js +1 -0
- package/dist/_app_/form/form.js +1 -0
- package/dist/_app_/form/help-text.js +1 -0
- package/dist/_app_/form/input.js +1 -0
- package/dist/_app_/form/label.js +1 -0
- package/dist/_app_/form/listbox.js +1 -0
- package/dist/_app_/form/money-field.js +1 -0
- package/dist/_app_/form/multi-select.js +1 -0
- package/dist/_app_/form/number-field.js +1 -0
- package/dist/_app_/form/option-group.js +1 -0
- package/dist/_app_/form/option.js +1 -0
- package/dist/_app_/form/radio-group.js +1 -0
- package/dist/_app_/form/radio.js +1 -0
- package/dist/_app_/form/search-input.js +1 -0
- package/dist/_app_/form/select-field.js +1 -0
- package/dist/_app_/form/select.js +1 -0
- package/dist/_app_/form/text-field.js +1 -0
- package/dist/_app_/form/textarea.js +1 -0
- package/dist/_app_/form/time-picker-field.js +1 -0
- package/dist/_app_/form/time-picker.js +1 -0
- package/dist/_app_/form/toggle-field.js +1 -0
- package/dist/_app_/form/toggle-group.js +1 -0
- package/dist/_app_/form/toggle.js +1 -0
- package/dist/_app_/layout/divider.js +1 -0
- package/dist/_app_/layout/grid-item.js +1 -0
- package/dist/_app_/layout/grid.js +1 -0
- package/dist/_app_/layout/h-stack.js +1 -0
- package/dist/_app_/layout/stack.js +1 -0
- package/dist/_app_/layout/v-stack.js +1 -0
- package/dist/_app_/media/icon.js +1 -0
- package/dist/_app_/media/image.js +1 -0
- package/dist/_app_/overlay/blanket.js +1 -0
- package/dist/_app_/overlay/drawer.js +1 -0
- package/dist/_app_/overlay/modal.js +1 -0
- package/dist/_app_/overlay/popover.js +1 -0
- package/dist/_app_/overlay/toast.js +1 -0
- package/dist/_app_/overlay/tooltip.js +1 -0
- package/dist/_app_/services/toast.js +1 -0
- package/dist/_app_/status/badge.js +1 -0
- package/dist/_app_/status/skeleton-avatar.js +1 -0
- package/dist/_app_/status/skeleton-button.js +1 -0
- package/dist/_app_/status/skeleton-image.js +1 -0
- package/dist/_app_/status/skeleton-text.js +1 -0
- package/dist/_app_/status/skeleton.js +1 -0
- package/dist/_app_/status/tag.js +1 -0
- package/dist/_app_/typography/heading.js +1 -0
- package/dist/_app_/typography/text.js +1 -0
- package/dist/action/button.css +360 -0
- package/dist/action/button.js +50 -0
- package/dist/action/button.js.map +1 -0
- package/dist/action/index.js +3 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/link-css-2b7265326c02ebb264835b3680b7e81e.css +19 -0
- package/dist/action/link.js +17 -0
- package/dist/action/link.js.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/table.css +270 -0
- package/dist/data/table.js +478 -0
- package/dist/data/table.js.map +1 -0
- package/dist/form/calendar.css +239 -0
- package/dist/form/calendar.js +532 -0
- package/dist/form/calendar.js.map +1 -0
- package/dist/form/checkbox-group.css +47 -0
- package/dist/form/checkbox-group.js +102 -0
- package/dist/form/checkbox-group.js.map +1 -0
- package/dist/form/checkbox.css +193 -0
- package/dist/form/checkbox.js +70 -0
- package/dist/form/checkbox.js.map +1 -0
- package/dist/form/control-css-6c81caf37fd813b36033091d5340bc70.css +20 -0
- package/dist/form/control.js +57 -0
- package/dist/form/control.js.map +1 -0
- package/dist/form/country-data.js +1075 -0
- package/dist/form/country-data.js.map +1 -0
- package/dist/form/country-select-field.js +37 -0
- package/dist/form/country-select-field.js.map +1 -0
- package/dist/form/country-select.css +299 -0
- package/dist/form/country-select.js +336 -0
- package/dist/form/country-select.js.map +1 -0
- package/dist/form/date-picker-field.js +37 -0
- package/dist/form/date-picker-field.js.map +1 -0
- package/dist/form/date-picker.css +177 -0
- package/dist/form/date-picker.js +366 -0
- package/dist/form/date-picker.js.map +1 -0
- package/dist/form/date-range-picker-field.js +37 -0
- package/dist/form/date-range-picker-field.js.map +1 -0
- package/dist/form/date-range-picker.css +259 -0
- package/dist/form/date-range-picker.js +451 -0
- package/dist/form/date-range-picker.js.map +1 -0
- package/dist/form/error-message.css +27 -0
- package/dist/form/error-message.js +27 -0
- package/dist/form/error-message.js.map +1 -0
- package/dist/form/field.css +45 -0
- package/dist/form/field.js +28 -0
- package/dist/form/field.js.map +1 -0
- package/dist/form/form.css +6 -0
- package/dist/form/form.js +120 -0
- package/dist/form/form.js.map +1 -0
- package/dist/form/help-text.css +7 -0
- package/dist/form/help-text.js +13 -0
- package/dist/form/help-text.js.map +1 -0
- package/dist/form/index.js +33 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/input.css +176 -0
- package/dist/form/input.js +43 -0
- package/dist/form/input.js.map +1 -0
- package/dist/form/label.css +59 -0
- package/dist/form/label.js +54 -0
- package/dist/form/label.js.map +1 -0
- package/dist/form/listbox.css +125 -0
- package/dist/form/listbox.js +388 -0
- package/dist/form/listbox.js.map +1 -0
- package/dist/form/money-field.css +9 -0
- package/dist/form/money-field.js +203 -0
- package/dist/form/money-field.js.map +1 -0
- package/dist/form/multi-select.css +343 -0
- package/dist/form/multi-select.js +429 -0
- package/dist/form/multi-select.js.map +1 -0
- package/dist/form/number-field.css +170 -0
- package/dist/form/number-field.js +184 -0
- package/dist/form/number-field.js.map +1 -0
- package/dist/form/option-group.js +2 -0
- package/dist/form/option-group.js.map +1 -0
- package/dist/form/option.js +2 -0
- package/dist/form/option.js.map +1 -0
- package/dist/form/radio-group.css +54 -0
- package/dist/form/radio-group.js +53 -0
- package/dist/form/radio-group.js.map +1 -0
- package/dist/form/radio.css +183 -0
- package/dist/form/radio.js +65 -0
- package/dist/form/radio.js.map +1 -0
- package/dist/form/search-input.css +118 -0
- package/dist/form/search-input.js +87 -0
- package/dist/form/search-input.js.map +1 -0
- package/dist/form/select-field.js +39 -0
- package/dist/form/select-field.js.map +1 -0
- package/dist/form/select.css +201 -0
- package/dist/form/select.js +394 -0
- package/dist/form/select.js.map +1 -0
- package/dist/form/text-field-css-f60360f3f8aaf4da664eaccd1bcc9f8f.css +31 -0
- package/dist/form/text-field.js +141 -0
- package/dist/form/text-field.js.map +1 -0
- package/dist/form/textarea.css +139 -0
- package/dist/form/textarea.js +140 -0
- package/dist/form/textarea.js.map +1 -0
- package/dist/form/time-picker-field.js +37 -0
- package/dist/form/time-picker-field.js.map +1 -0
- package/dist/form/time-picker.css +239 -0
- package/dist/form/time-picker.js +618 -0
- package/dist/form/time-picker.js.map +1 -0
- package/dist/form/toggle-field.css +6 -0
- package/dist/form/toggle-field.js +40 -0
- package/dist/form/toggle-field.js.map +1 -0
- package/dist/form/toggle-group.css +46 -0
- package/dist/form/toggle-group.js +20 -0
- package/dist/form/toggle-group.js.map +1 -0
- package/dist/form/toggle.css +206 -0
- package/dist/form/toggle.js +103 -0
- package/dist/form/toggle.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/divider-css-1ba104b9c606cbd1f542b45640fb5f2b.css +122 -0
- package/dist/layout/divider.js +35 -0
- package/dist/layout/divider.js.map +1 -0
- package/dist/layout/grid-css-086976eb41686e3714554f56c098d3d5.css +155 -0
- package/dist/layout/grid-item-css-8d0f842568d1e8345ac709bdf2ed6745.css +122 -0
- package/dist/layout/grid-item.js +13 -0
- package/dist/layout/grid-item.js.map +1 -0
- package/dist/layout/grid.js +96 -0
- package/dist/layout/grid.js.map +1 -0
- package/dist/layout/h-stack.js +14 -0
- package/dist/layout/h-stack.js.map +1 -0
- package/dist/layout/index.js +7 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/stack-css-f094dc4a0a45b6af2acedca81dcce289.css +77 -0
- package/dist/layout/stack.js +32 -0
- package/dist/layout/stack.js.map +1 -0
- package/dist/layout/v-stack.js +14 -0
- package/dist/layout/v-stack.js.map +1 -0
- package/dist/media/icon.css +43 -0
- package/dist/media/icon.js +71 -0
- package/dist/media/icon.js.map +1 -0
- package/dist/media/image-css-6bc4899d3a8b992c3d4d2f1a796ce0fc.css +78 -0
- package/dist/media/image.js +47 -0
- package/dist/media/image.js.map +1 -0
- package/dist/media/index.js +3 -0
- package/dist/media/index.js.map +1 -0
- package/dist/overlay/blanket.css +67 -0
- package/dist/overlay/blanket.js +139 -0
- package/dist/overlay/blanket.js.map +1 -0
- package/dist/overlay/drawer.css +369 -0
- package/dist/overlay/drawer.js +275 -0
- package/dist/overlay/drawer.js.map +1 -0
- package/dist/overlay/index.js +7 -0
- package/dist/overlay/index.js.map +1 -0
- package/dist/overlay/modal.css +209 -0
- package/dist/overlay/modal.js +269 -0
- package/dist/overlay/modal.js.map +1 -0
- package/dist/overlay/popover.css +210 -0
- package/dist/overlay/popover.js +396 -0
- package/dist/overlay/popover.js.map +1 -0
- package/dist/overlay/toast.css +300 -0
- package/dist/overlay/toast.js +123 -0
- package/dist/overlay/toast.js.map +1 -0
- package/dist/overlay/tooltip.css +246 -0
- package/dist/overlay/tooltip.js +368 -0
- package/dist/overlay/tooltip.js.map +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/toast.js +162 -0
- package/dist/services/toast.js.map +1 -0
- package/dist/skeleton-CL5Pcwrk.js +3 -0
- package/dist/skeleton-CL5Pcwrk.js.map +1 -0
- package/dist/status/badge.css +218 -0
- package/dist/status/badge.js +38 -0
- package/dist/status/badge.js.map +1 -0
- package/dist/status/index.js +8 -0
- package/dist/status/index.js.map +1 -0
- package/dist/status/skeleton-avatar.js +29 -0
- package/dist/status/skeleton-avatar.js.map +1 -0
- package/dist/status/skeleton-button.js +25 -0
- package/dist/status/skeleton-button.js.map +1 -0
- package/dist/status/skeleton-image.js +31 -0
- package/dist/status/skeleton-image.js.map +1 -0
- package/dist/status/skeleton-text.js +41 -0
- package/dist/status/skeleton-text.js.map +1 -0
- package/dist/status/skeleton.css +185 -0
- package/dist/status/skeleton.js +44 -0
- package/dist/status/skeleton.js.map +1 -0
- package/dist/status/tag.css +352 -0
- package/dist/status/tag.js +81 -0
- package/dist/status/tag.js.map +1 -0
- package/dist/styles/animations.css +11 -0
- package/dist/styles/base/typography.css +47 -0
- package/dist/styles/ember-promise-modals.css +43 -0
- package/dist/styles/primitive/colors.css +86 -0
- package/dist/styles/primitive/effects.css +29 -0
- package/dist/styles/primitive/fonts.css +19 -0
- package/dist/styles/primitive/motion.css +18 -0
- package/dist/styles/primitive/shape.css +17 -0
- package/dist/styles/primitive/spacing.css +29 -0
- package/dist/styles/primitive/typography.css +45 -0
- package/dist/styles/primitive/z-index.css +14 -0
- package/dist/styles/semantic/colors.css +155 -0
- package/dist/styles/semantic/component.css +0 -0
- package/dist/styles/semantic/effects.css +17 -0
- package/dist/styles/semantic/motion.css +10 -0
- package/dist/styles/semantic/shape.css +20 -0
- package/dist/styles/semantic/sizing.css +53 -0
- package/dist/styles/semantic/spacing.css +32 -0
- package/dist/styles/semantic/typography.css +32 -0
- package/dist/styles/tokens.css +31 -0
- package/dist/styles.css +710 -0
- package/dist/template-registry.js +2 -0
- package/dist/template-registry.js.map +1 -0
- package/dist/types/design-system.js +2 -0
- package/dist/types/design-system.js.map +1 -0
- package/dist/typography/heading-css-8850735eabc2efb34f15240b852c99e7.css +99 -0
- package/dist/typography/heading.js +80 -0
- package/dist/typography/heading.js.map +1 -0
- package/dist/typography/index.js +3 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/text-css-73e03f1b750b32d7064d4ef87562289c.css +143 -0
- package/dist/typography/text.js +76 -0
- package/dist/typography/text.js.map +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +218 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import "./table.css"
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { guidFor } from '@ember/object/internals';
|
|
5
|
+
import { on } from '@ember/modifier';
|
|
6
|
+
import { modifier } from 'ember-modifier';
|
|
7
|
+
import { fn } from '@ember/helper';
|
|
8
|
+
import Checkbox from '../form/checkbox.js';
|
|
9
|
+
import Skeleton from '../status/skeleton.js';
|
|
10
|
+
import { helper } from '@ember/component/helper';
|
|
11
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
12
|
+
import { setComponentTemplate } from '@ember/component';
|
|
13
|
+
import { g, i } from 'decorator-transforms/runtime';
|
|
14
|
+
|
|
15
|
+
;
|
|
16
|
+
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// Utility Functions
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Safely converts any value to a string for display or comparison.
|
|
22
|
+
*/
|
|
23
|
+
function stringifyValue(value) {
|
|
24
|
+
if (value === null || value === undefined) {
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
if (typeof value === 'string') {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
31
|
+
return String(value);
|
|
32
|
+
}
|
|
33
|
+
if (typeof value === 'object') {
|
|
34
|
+
return JSON.stringify(value);
|
|
35
|
+
}
|
|
36
|
+
// For symbols, functions, etc.
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Types
|
|
41
|
+
// ============================================================================
|
|
42
|
+
|
|
43
|
+
// ============================================================================
|
|
44
|
+
// Component Signature
|
|
45
|
+
// ============================================================================
|
|
46
|
+
|
|
47
|
+
// ============================================================================
|
|
48
|
+
// Main Component
|
|
49
|
+
// ============================================================================
|
|
50
|
+
class Table extends Component {
|
|
51
|
+
static {
|
|
52
|
+
g(this.prototype, "focusedRowIndex", [tracked], function () {
|
|
53
|
+
return null;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
#focusedRowIndex = (i(this, "focusedRowIndex"), void 0);
|
|
57
|
+
static {
|
|
58
|
+
g(this.prototype, "internalSortState", [tracked], function () {
|
|
59
|
+
return null;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
#internalSortState = (i(this, "internalSortState"), void 0);
|
|
63
|
+
static {
|
|
64
|
+
g(this.prototype, "internalSelectedIds", [tracked], function () {
|
|
65
|
+
return [];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
#internalSelectedIds = (i(this, "internalSelectedIds"), void 0);
|
|
69
|
+
static {
|
|
70
|
+
g(this.prototype, "lastSelectedIndex", [tracked], function () {
|
|
71
|
+
return null;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
#lastSelectedIndex = (i(this, "lastSelectedIndex"), void 0);
|
|
75
|
+
static {
|
|
76
|
+
g(this.prototype, "isKeyboardFocused", [tracked], function () {
|
|
77
|
+
return false;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
#isKeyboardFocused = (i(this, "isKeyboardFocused"), void 0);
|
|
81
|
+
elementRef = null;
|
|
82
|
+
pendingMouseFocus = false;
|
|
83
|
+
constructor(owner, args) {
|
|
84
|
+
super(owner, args);
|
|
85
|
+
}
|
|
86
|
+
// ============================================================================
|
|
87
|
+
// Computed Properties
|
|
88
|
+
// ============================================================================
|
|
89
|
+
get componentId() {
|
|
90
|
+
return guidFor(this);
|
|
91
|
+
}
|
|
92
|
+
get visibleColumns() {
|
|
93
|
+
return this.args.columns.filter(col => !col.hidden);
|
|
94
|
+
}
|
|
95
|
+
get isControlledSelection() {
|
|
96
|
+
return this.args.selectedIds !== undefined;
|
|
97
|
+
}
|
|
98
|
+
get selectedIds() {
|
|
99
|
+
return this.isControlledSelection ? this.args.selectedIds ?? [] : this.internalSelectedIds;
|
|
100
|
+
}
|
|
101
|
+
get isControlledSort() {
|
|
102
|
+
return this.args.sortBy !== undefined || this.args.onSortChange !== undefined;
|
|
103
|
+
}
|
|
104
|
+
get sortState() {
|
|
105
|
+
return this.isControlledSort ? this.args.sortBy ?? null : this.internalSortState;
|
|
106
|
+
}
|
|
107
|
+
get sortedData() {
|
|
108
|
+
const data = this.args.data ?? [];
|
|
109
|
+
const sort = this.sortState;
|
|
110
|
+
if (!sort) return data;
|
|
111
|
+
const column = this.args.columns.find(col => col.id === sort.columnId);
|
|
112
|
+
if (!column) return data;
|
|
113
|
+
const sorted = [...data];
|
|
114
|
+
sorted.sort((a, b) => {
|
|
115
|
+
// Use custom sort function if provided
|
|
116
|
+
if (column.sortFn) {
|
|
117
|
+
const result = column.sortFn(a, b);
|
|
118
|
+
return sort.direction === 'desc' ? -result : result;
|
|
119
|
+
}
|
|
120
|
+
// Default sort using accessor
|
|
121
|
+
const aVal = this.getCellValue(a, column);
|
|
122
|
+
const bVal = this.getCellValue(b, column);
|
|
123
|
+
let result = 0;
|
|
124
|
+
if (aVal === bVal) {
|
|
125
|
+
result = 0;
|
|
126
|
+
} else if (aVal === null || aVal === undefined) {
|
|
127
|
+
result = 1;
|
|
128
|
+
} else if (bVal === null || bVal === undefined) {
|
|
129
|
+
result = -1;
|
|
130
|
+
} else if (typeof aVal === 'string' && typeof bVal === 'string') {
|
|
131
|
+
result = aVal.localeCompare(bVal);
|
|
132
|
+
} else if (typeof aVal === 'number' && typeof bVal === 'number') {
|
|
133
|
+
result = aVal - bVal;
|
|
134
|
+
} else {
|
|
135
|
+
// Handle other types by converting to string safely
|
|
136
|
+
const aStr = stringifyValue(aVal);
|
|
137
|
+
const bStr = stringifyValue(bVal);
|
|
138
|
+
result = aStr.localeCompare(bStr);
|
|
139
|
+
}
|
|
140
|
+
return sort.direction === 'desc' ? -result : result;
|
|
141
|
+
});
|
|
142
|
+
return sorted;
|
|
143
|
+
}
|
|
144
|
+
get displayData() {
|
|
145
|
+
if (this.args.isLoading) {
|
|
146
|
+
return [];
|
|
147
|
+
}
|
|
148
|
+
return this.sortedData;
|
|
149
|
+
}
|
|
150
|
+
get isEmpty() {
|
|
151
|
+
return !this.args.isLoading && this.displayData.length === 0;
|
|
152
|
+
}
|
|
153
|
+
get loadingRowCount() {
|
|
154
|
+
return this.args.loadingRows ?? 5;
|
|
155
|
+
}
|
|
156
|
+
get allRowsSelected() {
|
|
157
|
+
if (this.displayData.length === 0) return false;
|
|
158
|
+
return this.displayData.every(row => {
|
|
159
|
+
const id = this.getRowId(row);
|
|
160
|
+
return this.selectedIds.includes(id);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
get someRowsSelected() {
|
|
164
|
+
return this.selectedIds.length > 0 && !this.allRowsSelected;
|
|
165
|
+
}
|
|
166
|
+
get enabledRows() {
|
|
167
|
+
return this.displayData.filter(row => !this.args.isRowDisabled?.(row));
|
|
168
|
+
}
|
|
169
|
+
// ============================================================================
|
|
170
|
+
// Methods
|
|
171
|
+
// ============================================================================
|
|
172
|
+
getRowId = row => {
|
|
173
|
+
if (this.args.getRowId) {
|
|
174
|
+
return this.args.getRowId(row);
|
|
175
|
+
}
|
|
176
|
+
// Fallback: try to use 'id' property or generate from index
|
|
177
|
+
const rowRecord = row;
|
|
178
|
+
if (typeof rowRecord['id'] === 'string') {
|
|
179
|
+
return rowRecord['id'];
|
|
180
|
+
}
|
|
181
|
+
if (typeof rowRecord['id'] === 'number') {
|
|
182
|
+
return String(rowRecord['id']);
|
|
183
|
+
}
|
|
184
|
+
return String(this.args.data.indexOf(row));
|
|
185
|
+
};
|
|
186
|
+
getCellValue = (row, column) => {
|
|
187
|
+
if (column.accessorFn) {
|
|
188
|
+
return column.accessorFn(row);
|
|
189
|
+
}
|
|
190
|
+
if (column.accessorKey) {
|
|
191
|
+
return row[column.accessorKey];
|
|
192
|
+
}
|
|
193
|
+
return undefined;
|
|
194
|
+
};
|
|
195
|
+
formatCellValue = (row, column) => {
|
|
196
|
+
const value = this.getCellValue(row, column);
|
|
197
|
+
return stringifyValue(value);
|
|
198
|
+
};
|
|
199
|
+
getRowElementId = row => {
|
|
200
|
+
return `${this.componentId}-row-${this.getRowId(row)}`;
|
|
201
|
+
};
|
|
202
|
+
isRowSelected = row => {
|
|
203
|
+
const id = this.getRowId(row);
|
|
204
|
+
return this.selectedIds.includes(id);
|
|
205
|
+
};
|
|
206
|
+
isRowFocused = rowIndex => {
|
|
207
|
+
return this.isKeyboardFocused && this.focusedRowIndex === rowIndex;
|
|
208
|
+
};
|
|
209
|
+
isColumnSortable = column => {
|
|
210
|
+
// Column-level sortable overrides table-level
|
|
211
|
+
if (column.sortable !== undefined) {
|
|
212
|
+
return column.sortable;
|
|
213
|
+
}
|
|
214
|
+
return this.args.isSortable ?? false;
|
|
215
|
+
};
|
|
216
|
+
getColumnSortDirection = column => {
|
|
217
|
+
if (this.sortState?.columnId === column.id) {
|
|
218
|
+
return this.sortState.direction;
|
|
219
|
+
}
|
|
220
|
+
return null;
|
|
221
|
+
};
|
|
222
|
+
getAriaSortValue = column => {
|
|
223
|
+
if (!this.isColumnSortable(column)) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
const direction = this.getColumnSortDirection(column);
|
|
227
|
+
if (direction === 'asc') return 'ascending';
|
|
228
|
+
if (direction === 'desc') return 'descending';
|
|
229
|
+
return 'none';
|
|
230
|
+
};
|
|
231
|
+
updateSelection(newIds) {
|
|
232
|
+
if (this.isControlledSelection) {
|
|
233
|
+
this.args.onSelectionChange?.(newIds);
|
|
234
|
+
} else {
|
|
235
|
+
this.internalSelectedIds = newIds;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
updateSort(newSort) {
|
|
239
|
+
if (this.isControlledSort) {
|
|
240
|
+
this.args.onSortChange?.(newSort);
|
|
241
|
+
} else {
|
|
242
|
+
this.internalSortState = newSort;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
moveFocus(direction) {
|
|
246
|
+
const rows = this.displayData;
|
|
247
|
+
if (rows.length === 0) return;
|
|
248
|
+
const currentIndex = this.focusedRowIndex ?? -1;
|
|
249
|
+
let newIndex;
|
|
250
|
+
switch (direction) {
|
|
251
|
+
case 'first':
|
|
252
|
+
newIndex = 0;
|
|
253
|
+
break;
|
|
254
|
+
case 'last':
|
|
255
|
+
newIndex = rows.length - 1;
|
|
256
|
+
break;
|
|
257
|
+
case 'next':
|
|
258
|
+
newIndex = currentIndex < rows.length - 1 ? currentIndex + 1 : currentIndex;
|
|
259
|
+
break;
|
|
260
|
+
case 'prev':
|
|
261
|
+
newIndex = currentIndex > 0 ? currentIndex - 1 : 0;
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
this.focusedRowIndex = newIndex;
|
|
265
|
+
// Scroll into view
|
|
266
|
+
const row = rows[newIndex];
|
|
267
|
+
if (row) {
|
|
268
|
+
const rowId = this.getRowElementId(row);
|
|
269
|
+
const rowElement = document.getElementById(rowId);
|
|
270
|
+
rowElement?.scrollIntoView({
|
|
271
|
+
block: 'nearest'
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// ============================================================================
|
|
276
|
+
// Event Handlers
|
|
277
|
+
// ============================================================================
|
|
278
|
+
handleSort = column => {
|
|
279
|
+
if (!this.isColumnSortable(column)) return;
|
|
280
|
+
const currentSort = this.sortState;
|
|
281
|
+
if (currentSort?.columnId === column.id) {
|
|
282
|
+
// Toggle direction or clear
|
|
283
|
+
if (currentSort.direction === 'asc') {
|
|
284
|
+
this.updateSort({
|
|
285
|
+
columnId: column.id,
|
|
286
|
+
direction: 'desc'
|
|
287
|
+
});
|
|
288
|
+
} else {
|
|
289
|
+
this.updateSort(null);
|
|
290
|
+
}
|
|
291
|
+
} else {
|
|
292
|
+
// New column, start with ascending
|
|
293
|
+
this.updateSort({
|
|
294
|
+
columnId: column.id,
|
|
295
|
+
direction: 'asc'
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
handleSelectAll = () => {
|
|
300
|
+
if (!this.args.isSelectable) return;
|
|
301
|
+
if (this.allRowsSelected) {
|
|
302
|
+
// Deselect all
|
|
303
|
+
this.updateSelection([]);
|
|
304
|
+
} else {
|
|
305
|
+
// Select all enabled rows
|
|
306
|
+
const allIds = this.enabledRows.map(row => this.getRowId(row));
|
|
307
|
+
this.updateSelection(allIds);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
handleRowSelect = (row, event) => {
|
|
311
|
+
if (!this.args.isSelectable) return;
|
|
312
|
+
if (this.args.isRowDisabled?.(row)) return;
|
|
313
|
+
const id = this.getRowId(row);
|
|
314
|
+
const current = [...this.selectedIds];
|
|
315
|
+
const rowIndex = this.displayData.indexOf(row);
|
|
316
|
+
// Shift+click for range selection
|
|
317
|
+
if (event?.shiftKey && this.lastSelectedIndex !== null) {
|
|
318
|
+
const start = Math.min(this.lastSelectedIndex, rowIndex);
|
|
319
|
+
const end = Math.max(this.lastSelectedIndex, rowIndex);
|
|
320
|
+
const rangeIds = this.displayData.slice(start, end + 1).filter(r => !this.args.isRowDisabled?.(r)).map(r => this.getRowId(r));
|
|
321
|
+
// Add range to selection (union)
|
|
322
|
+
const newIds = [...new Set([...current, ...rangeIds])];
|
|
323
|
+
this.updateSelection(newIds);
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
// Ctrl/Cmd+click for toggle
|
|
327
|
+
const isCtrlClick = event?.ctrlKey || event?.metaKey;
|
|
328
|
+
if (isCtrlClick) {
|
|
329
|
+
const index = current.indexOf(id);
|
|
330
|
+
if (index >= 0) {
|
|
331
|
+
current.splice(index, 1);
|
|
332
|
+
} else {
|
|
333
|
+
current.push(id);
|
|
334
|
+
}
|
|
335
|
+
this.updateSelection(current);
|
|
336
|
+
} else {
|
|
337
|
+
// Toggle selection
|
|
338
|
+
const index = current.indexOf(id);
|
|
339
|
+
if (index >= 0) {
|
|
340
|
+
current.splice(index, 1);
|
|
341
|
+
} else {
|
|
342
|
+
current.push(id);
|
|
343
|
+
}
|
|
344
|
+
this.updateSelection(current);
|
|
345
|
+
}
|
|
346
|
+
this.lastSelectedIndex = rowIndex;
|
|
347
|
+
};
|
|
348
|
+
handleRowClick = (row, event) => {
|
|
349
|
+
// Don't trigger row click if clicking on checkbox
|
|
350
|
+
const target = event.target;
|
|
351
|
+
if (target.closest('[data-table-checkbox]')) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
if (this.args.isRowDisabled?.(row)) return;
|
|
355
|
+
this.args.onRowClick?.(row);
|
|
356
|
+
};
|
|
357
|
+
handleKeyDown = event => {
|
|
358
|
+
switch (event.key) {
|
|
359
|
+
case 'ArrowDown':
|
|
360
|
+
event.preventDefault();
|
|
361
|
+
this.moveFocus('next');
|
|
362
|
+
break;
|
|
363
|
+
case 'ArrowUp':
|
|
364
|
+
event.preventDefault();
|
|
365
|
+
this.moveFocus('prev');
|
|
366
|
+
break;
|
|
367
|
+
case 'Home':
|
|
368
|
+
event.preventDefault();
|
|
369
|
+
this.moveFocus('first');
|
|
370
|
+
break;
|
|
371
|
+
case 'End':
|
|
372
|
+
event.preventDefault();
|
|
373
|
+
this.moveFocus('last');
|
|
374
|
+
break;
|
|
375
|
+
case 'Enter':
|
|
376
|
+
case ' ':
|
|
377
|
+
event.preventDefault();
|
|
378
|
+
if (this.focusedRowIndex !== null) {
|
|
379
|
+
const row = this.displayData[this.focusedRowIndex];
|
|
380
|
+
if (row) {
|
|
381
|
+
if (this.args.isSelectable) {
|
|
382
|
+
this.handleRowSelect(row);
|
|
383
|
+
} else if (this.args.onRowClick) {
|
|
384
|
+
this.args.onRowClick(row);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
389
|
+
case 'a':
|
|
390
|
+
case 'A':
|
|
391
|
+
// Ctrl/Cmd+A to select all
|
|
392
|
+
if ((event.ctrlKey || event.metaKey) && this.args.isSelectable) {
|
|
393
|
+
event.preventDefault();
|
|
394
|
+
this.handleSelectAll();
|
|
395
|
+
}
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
handleMouseDown = () => {
|
|
400
|
+
// Mark that focus is coming from a mouse click
|
|
401
|
+
this.pendingMouseFocus = true;
|
|
402
|
+
};
|
|
403
|
+
handleFocus = () => {
|
|
404
|
+
// Only show focus ring when focus is from keyboard, not mouse
|
|
405
|
+
if (this.pendingMouseFocus) {
|
|
406
|
+
this.pendingMouseFocus = false;
|
|
407
|
+
this.isKeyboardFocused = false;
|
|
408
|
+
} else {
|
|
409
|
+
this.isKeyboardFocused = true;
|
|
410
|
+
if (this.focusedRowIndex === null && this.displayData.length > 0) {
|
|
411
|
+
this.focusedRowIndex = 0;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
handleBlur = () => {
|
|
416
|
+
this.focusedRowIndex = null;
|
|
417
|
+
this.isKeyboardFocused = false;
|
|
418
|
+
};
|
|
419
|
+
// ============================================================================
|
|
420
|
+
// Modifiers
|
|
421
|
+
// ============================================================================
|
|
422
|
+
setupRef = modifier(element => {
|
|
423
|
+
this.elementRef = element;
|
|
424
|
+
return () => {
|
|
425
|
+
this.elementRef = null;
|
|
426
|
+
};
|
|
427
|
+
});
|
|
428
|
+
// ============================================================================
|
|
429
|
+
// Template Helpers
|
|
430
|
+
// ============================================================================
|
|
431
|
+
getCellContext = (row, column, rowIndex) => {
|
|
432
|
+
return {
|
|
433
|
+
row,
|
|
434
|
+
value: this.getCellValue(row, column),
|
|
435
|
+
rowIndex,
|
|
436
|
+
column
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
// ============================================================================
|
|
440
|
+
// Template
|
|
441
|
+
// ============================================================================
|
|
442
|
+
static {
|
|
443
|
+
setComponentTemplate(precompileTemplate("<table class=\"table\" data-sticky-header={{if @hasStickyHeader \"true\"}} data-striped={{if @isStriped \"true\"}} data-bordered={{if @isBordered \"true\"}} data-compact={{if @isCompact \"true\"}} data-loading={{if @isLoading \"true\"}} data-test-table tabindex=\"0\" {{this.setupRef}} {{!-- template-lint-disable no-pointer-down-event-binding --}} {{on \"mousedown\" this.handleMouseDown}} {{on \"keydown\" this.handleKeyDown}} {{on \"focus\" this.handleFocus}} {{on \"blur\" this.handleBlur}} ...attributes>\n {{#if @caption}}\n <caption class=\"caption\" data-test-table-caption>\n {{@caption}}\n </caption>\n {{/if}}\n\n <thead class=\"thead\" data-test-table-header>\n <tr class=\"header-row\">\n {{#if @isSelectable}}\n <th class=\"header-cell checkbox-cell\" data-test-table-header-checkbox>\n <Checkbox @isChecked={{this.allRowsSelected}} @isIndeterminate={{this.someRowsSelected}} @isLabelHidden={{true}} @label=\"Select all rows\" @size=\"sm\" data-table-checkbox {{on \"change\" this.handleSelectAll}} />\n </th>\n {{/if}}\n\n {{#each this.visibleColumns as |column|}}\n <th class=\"header-cell\" data-align={{column.align}} data-sortable={{if (this.isColumnSortable column) \"true\"}} data-sorted={{if (this.getColumnSortDirection column) \"true\"}} data-sort-direction={{this.getColumnSortDirection column}} aria-sort={{this.getAriaSortValue column}} style={{if column.width (concat \"width:\" column.width \";\")}} data-test-table-header-cell data-test-column-id={{column.id}}>\n {{#if (this.isColumnSortable column)}}\n <button type=\"button\" class=\"sort-button\" {{on \"click\" (fn this.handleSort column)}} data-test-table-sort-button>\n <span class=\"header-text\">{{column.header}}</span>\n <span class=\"sort-icon\" aria-hidden=\"true\">\n {{#if (this.getColumnSortDirection column)}}\n {{#if (eq (this.getColumnSortDirection column) \"asc\")}}\n <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"icon\">\n <path d=\"M4 10l4-4 4 4\" />\n </svg>\n {{else}}\n <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"icon\">\n <path d=\"M4 6l4 4 4-4\" />\n </svg>\n {{/if}}\n {{else}}\n <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"icon icon-unsorted\">\n <path d=\"M4 6l4-3 4 3M4 10l4 3 4-3\" />\n </svg>\n {{/if}}\n </span>\n </button>\n {{else}}\n <span class=\"header-text\">{{column.header}}</span>\n {{/if}}\n </th>\n {{/each}}\n </tr>\n </thead>\n\n <tbody class=\"tbody\" data-test-table-body>\n {{#if @isLoading}}\n {{#if (has-block \"loading\")}}\n {{yield to=\"loading\"}}\n {{else}}\n {{!-- template-lint-disable no-unused-block-params --}}\n {{#each (repeat this.loadingRowCount)}}\n <tr class=\"row skeleton-row\" data-test-table-skeleton-row>\n {{#if @isSelectable}}\n <td class=\"cell checkbox-cell\">\n <Skeleton @width={{16}} @height={{16}} @radius=\"sm\" />\n </td>\n {{/if}}\n {{#each this.visibleColumns as |column|}}\n <td class=\"cell\" data-align={{column.align}}>\n <Skeleton @width=\"70%\" @height={{16}} />\n </td>\n {{/each}}\n </tr>\n {{/each}}\n {{/if}}\n {{else if this.isEmpty}}\n {{#if (has-block \"empty\")}}\n <tr class=\"empty-row\">\n <td colspan={{if @isSelectable (add (len this.visibleColumns) 1) (len this.visibleColumns)}}>\n {{yield to=\"empty\"}}\n </td>\n </tr>\n {{else}}\n <tr class=\"empty-row\" data-test-table-empty>\n <td class=\"empty-cell\" colspan={{if @isSelectable (add (len this.visibleColumns) 1) (len this.visibleColumns)}}>\n {{#if @emptyMessage}}\n {{@emptyMessage}}\n {{else}}\n No data available\n {{/if}}\n </td>\n </tr>\n {{/if}}\n {{else}}\n {{#each this.displayData as |row rowIndex|}}\n {{!-- template-lint-disable no-invalid-interactive --}}\n <tr id={{this.getRowElementId row}} class=\"row\" data-selected={{if (this.isRowSelected row) \"true\" \"false\"}} data-focused={{if (this.isRowFocused rowIndex) \"true\" \"false\"}} data-disabled={{if (@isRowDisabled row) \"true\" \"false\"}} data-clickable={{if @onRowClick \"true\"}} aria-selected={{if @isSelectable (if (this.isRowSelected row) \"true\" \"false\")}} data-test-table-row data-test-row-id={{this.getRowId row}} {{on \"click\" (fn this.handleRowClick row)}}>\n {{#if @isSelectable}}\n <td class=\"cell checkbox-cell\" data-test-table-row-checkbox>\n <Checkbox @isChecked={{this.isRowSelected row}} @isDisabled={{@isRowDisabled row}} @isLabelHidden={{true}} @label=\"Select row\" @size=\"sm\" data-table-checkbox {{on \"click\" (fn this.handleRowSelect row)}} />\n </td>\n {{/if}}\n\n {{#each this.visibleColumns as |column|}}\n <td class=\"cell\" data-align={{column.align}} data-test-table-cell data-test-column-id={{column.id}}>\n {{#if (has-block \"cell\")}}\n {{yield (this.getCellContext row column rowIndex) to=\"cell\"}}\n {{else}}\n {{this.formatCellValue row column}}\n {{/if}}\n </td>\n {{/each}}\n </tr>\n {{/each}}\n {{/if}}\n </tbody>\n</table>", {
|
|
444
|
+
strictMode: true,
|
|
445
|
+
scope: () => ({
|
|
446
|
+
on,
|
|
447
|
+
Checkbox,
|
|
448
|
+
concat,
|
|
449
|
+
fn,
|
|
450
|
+
eq,
|
|
451
|
+
repeat,
|
|
452
|
+
Skeleton,
|
|
453
|
+
add,
|
|
454
|
+
len
|
|
455
|
+
})
|
|
456
|
+
}), this);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
const repeat = helper(function ([count]) {
|
|
460
|
+
return Array.from({
|
|
461
|
+
length: count
|
|
462
|
+
}, (_, i) => i);
|
|
463
|
+
});
|
|
464
|
+
const len = helper(function ([arr]) {
|
|
465
|
+
return arr?.length ?? 0;
|
|
466
|
+
});
|
|
467
|
+
const add = helper(function ([a, b]) {
|
|
468
|
+
return a + b;
|
|
469
|
+
});
|
|
470
|
+
const eq = helper(function ([a, b]) {
|
|
471
|
+
return a === b;
|
|
472
|
+
});
|
|
473
|
+
const concat = helper(function (parts) {
|
|
474
|
+
return parts.join('');
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
export { Table as default };
|
|
478
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|