frontile 0.18.0-alpha.2 → 0.18.0-alpha.20
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/declarations/-private/control-blur.d.ts +63 -0
- package/declarations/-private/dialog.d.ts +15 -0
- package/declarations/-private/dom.d.ts +3 -0
- package/declarations/-private/get-config.d.ts +2 -0
- package/declarations/-private/intent-icons.d.ts +9 -0
- package/declarations/-private/manager.d.ts +20 -0
- package/declarations/-private/notification-stack.d.ts +76 -0
- package/declarations/-private/notification.d.ts +40 -0
- package/declarations/-private/timer.d.ts +12 -0
- package/declarations/-private/types.d.ts +126 -0
- package/declarations/buttons.d.ts +1 -0
- package/declarations/collections.d.ts +1 -0
- package/declarations/components/buttons/button-group.d.ts +24 -0
- package/declarations/components/buttons/button.d.ts +88 -0
- package/declarations/components/buttons/chip.d.ts +85 -0
- package/declarations/components/buttons/close-button.d.ts +55 -0
- package/declarations/components/buttons/index.d.ts +6 -0
- package/declarations/components/buttons/segmented-control/item.d.ts +50 -0
- package/declarations/components/buttons/segmented-control/segmented-control.d.ts +210 -0
- package/declarations/components/buttons/segmented-control.d.ts +3 -0
- package/declarations/components/buttons/toggle-button.d.ts +28 -0
- package/declarations/components/collections/calendar/calendar.d.ts +585 -0
- package/declarations/components/collections/calendar/day-cell.d.ts +19 -0
- package/declarations/components/collections/calendar/header.d.ts +56 -0
- package/declarations/components/collections/calendar/icons.d.ts +14 -0
- package/declarations/components/collections/calendar/month-grid.d.ts +36 -0
- package/declarations/components/collections/calendar/types.d.ts +94 -0
- package/declarations/components/collections/calendar/utils.d.ts +51 -0
- package/declarations/components/collections/calendar/year-grid.d.ts +32 -0
- package/declarations/components/collections/calendar.d.ts +3 -0
- package/declarations/components/collections/command/command.d.ts +195 -0
- package/declarations/components/collections/command/dialog.d.ts +44 -0
- package/declarations/components/collections/command/footer.d.ts +61 -0
- package/declarations/components/collections/command/index.d.ts +6 -0
- package/declarations/components/collections/command/input.d.ts +131 -0
- package/declarations/components/collections/command/list.d.ts +135 -0
- package/declarations/components/collections/command.d.ts +2 -0
- package/declarations/components/collections/dropdown/dropdown.d.ts +190 -0
- package/declarations/components/collections/dropdown/menu-context.d.ts +64 -0
- package/declarations/components/collections/dropdown/sub.d.ts +195 -0
- package/declarations/components/collections/dropdown.d.ts +2 -0
- package/declarations/components/collections/index.d.ts +5 -0
- package/declarations/components/collections/listbox/group.d.ts +62 -0
- package/declarations/components/collections/listbox/item.d.ts +140 -0
- package/declarations/components/collections/listbox/listbox.d.ts +102 -0
- package/declarations/components/collections/listbox.d.ts +2 -0
- package/declarations/components/collections/simple-table/body.d.ts +481 -0
- package/declarations/components/collections/simple-table/cell.d.ts +479 -0
- package/declarations/components/collections/simple-table/column.d.ts +471 -0
- package/declarations/components/collections/simple-table/footer.d.ts +482 -0
- package/declarations/components/collections/simple-table/header.d.ts +482 -0
- package/declarations/components/collections/simple-table/index.d.ts +498 -0
- package/declarations/components/collections/simple-table/row.d.ts +483 -0
- package/declarations/components/collections/table/cell-default.d.ts +43 -0
- package/declarations/components/collections/table/cell-for.d.ts +38 -0
- package/declarations/components/collections/table/cell-rendering-context.d.ts +24 -0
- package/declarations/components/collections/table/checkbox.d.ts +50 -0
- package/declarations/components/collections/table/column-visibility.d.ts +468 -0
- package/declarations/components/collections/table/icons.d.ts +11 -0
- package/declarations/components/collections/table/index.d.ts +4 -0
- package/declarations/components/collections/table/sort-button.d.ts +465 -0
- package/declarations/components/collections/table/table.d.ts +627 -0
- package/declarations/components/collections/table/types.d.ts +58 -0
- package/declarations/components/collections/table/utils.d.ts +6 -0
- package/declarations/components/collections/table.d.ts +2 -0
- package/declarations/components/disclosure/accordion/accordion.d.ts +247 -0
- package/declarations/components/disclosure/accordion/item.d.ts +96 -0
- package/declarations/components/disclosure/accordion.d.ts +3 -0
- package/declarations/components/disclosure/icons.d.ts +9 -0
- package/declarations/components/disclosure/index.d.ts +1 -0
- package/declarations/components/forms/autocomplete.d.ts +446 -0
- package/declarations/components/forms/checkbox-group.d.ts +62 -0
- package/declarations/components/forms/checkbox.d.ts +62 -0
- package/declarations/components/forms/field-types.d.ts +14 -0
- package/declarations/components/forms/field.d.ts +87 -0
- package/declarations/components/forms/form-control.d.ts +101 -0
- package/declarations/components/forms/form-description.d.ts +30 -0
- package/declarations/components/forms/form-feedback.d.ts +64 -0
- package/declarations/components/forms/form.d.ts +255 -0
- package/declarations/components/forms/icons.d.ts +7 -0
- package/declarations/components/forms/index.d.ts +20 -0
- package/declarations/components/forms/input-otp.d.ts +321 -0
- package/declarations/components/forms/input.d.ts +188 -0
- package/declarations/components/forms/label.d.ts +53 -0
- package/declarations/components/forms/native-select.d.ts +251 -0
- package/declarations/components/forms/radio-group.d.ts +64 -0
- package/declarations/components/forms/radio.d.ts +68 -0
- package/declarations/components/forms/select/end-content.d.ts +31 -0
- package/declarations/components/forms/select/native-mirror.d.ts +44 -0
- package/declarations/components/forms/select/select.d.ts +454 -0
- package/declarations/components/forms/select/selected-items.d.ts +80 -0
- package/declarations/components/forms/select/trigger.d.ts +81 -0
- package/declarations/components/forms/select/types.d.ts +431 -0
- package/declarations/components/forms/select.d.ts +2 -0
- package/declarations/components/forms/switch.d.ts +152 -0
- package/declarations/components/forms/textarea.d.ts +104 -0
- package/declarations/components/navigation/external-link.d.ts +94 -0
- package/declarations/components/navigation/index.d.ts +4 -0
- package/declarations/components/navigation/pagination/icons.d.ts +13 -0
- package/declarations/components/navigation/pagination/pagination.d.ts +279 -0
- package/declarations/components/navigation/pagination/range.d.ts +34 -0
- package/declarations/components/navigation/pagination.d.ts +3 -0
- package/declarations/components/navigation/tab-nav/item.d.ts +79 -0
- package/declarations/components/navigation/tab-nav/tab-nav.d.ts +165 -0
- package/declarations/components/navigation/tab-nav.d.ts +3 -0
- package/declarations/components/navigation/tabs/panel.d.ts +28 -0
- package/declarations/components/navigation/tabs/tab.d.ts +46 -0
- package/declarations/components/navigation/tabs/tabs.d.ts +227 -0
- package/declarations/components/navigation/tabs.d.ts +4 -0
- package/declarations/components/notifications/icons.d.ts +9 -0
- package/declarations/components/notifications/index.d.ts +12 -0
- package/declarations/components/notifications/notification-card.d.ts +100 -0
- package/declarations/components/notifications/notifications-container.d.ts +148 -0
- package/declarations/components/overlays/backdrop.d.ts +39 -0
- package/declarations/components/overlays/drawer/body.d.ts +17 -0
- package/declarations/components/overlays/drawer/drag-handle.d.ts +26 -0
- package/declarations/components/overlays/drawer/footer.d.ts +17 -0
- package/declarations/components/overlays/drawer/header.d.ts +140 -0
- package/declarations/components/overlays/drawer/selectors.d.ts +22 -0
- package/declarations/components/overlays/drawer.d.ts +293 -0
- package/declarations/components/overlays/index.d.ts +14 -0
- package/declarations/components/overlays/modal/body.d.ts +17 -0
- package/declarations/components/overlays/modal/footer.d.ts +17 -0
- package/declarations/components/overlays/modal/header.d.ts +35 -0
- package/declarations/components/overlays/modal.d.ts +146 -0
- package/declarations/components/overlays/mount-animation.d.ts +81 -0
- package/declarations/components/overlays/overlay.d.ts +218 -0
- package/declarations/components/overlays/popover.d.ts +452 -0
- package/declarations/components/overlays/portal-target.d.ts +19 -0
- package/declarations/components/overlays/portal.d.ts +38 -0
- package/declarations/components/overlays/tooltip.d.ts +401 -0
- package/declarations/components/status/alert.d.ts +134 -0
- package/declarations/components/status/index.d.ts +2 -0
- package/declarations/components/status/progress-bar.d.ts +115 -0
- package/declarations/components/utilities/avatar.d.ts +90 -0
- package/declarations/components/utilities/collapsible.d.ts +64 -0
- package/declarations/components/utilities/divider.d.ts +25 -0
- package/declarations/components/utilities/index.d.ts +15 -0
- package/declarations/components/utilities/kbd.d.ts +92 -0
- package/declarations/components/utilities/skeleton.d.ts +31 -0
- package/declarations/components/utilities/spinner.d.ts +26 -0
- package/declarations/components/utilities/visually-hidden.d.ts +9 -0
- package/declarations/disclosure.d.ts +1 -0
- package/declarations/forms.d.ts +1 -0
- package/declarations/index.d.ts +9 -7
- package/declarations/modifiers/drag-to-dismiss.d.ts +22 -0
- package/declarations/modifiers/press.d.ts +55 -0
- package/declarations/navigation.d.ts +1 -0
- package/declarations/notifications.d.ts +1 -0
- package/declarations/overlays.d.ts +1 -0
- package/declarations/services/notifications.d.ts +20 -0
- package/declarations/status.d.ts +1 -0
- package/declarations/template-registry.d.ts +55 -2
- package/declarations/test-support.d.ts +3 -0
- package/declarations/utilities.d.ts +1 -0
- package/declarations/utils/deferred-work.d.ts +24 -0
- package/declarations/utils/filter.d.ts +87 -0
- package/declarations/utils/forms-utils-index.d.ts +3 -0
- package/declarations/utils/keys.d.ts +52 -0
- package/declarations/utils/listManager.d.ts +158 -0
- package/declarations/utils/nested-data.d.ts +44 -0
- package/declarations/utils/prefers-reduced-motion.d.ts +3 -0
- package/declarations/utils/ref.d.ts +14 -0
- package/declarations/utils/roving-focus.d.ts +66 -0
- package/declarations/utils/safe-area.d.ts +52 -0
- package/declarations/utils/safe-styles.d.ts +2 -0
- package/declarations/utils/selection-indicator.d.ts +65 -0
- package/declarations/utils/standard-validator.d.ts +176 -0
- package/declarations/utils/toggle.d.ts +9 -0
- package/dist/_app_/services/notifications.js +1 -0
- package/dist/buttons.js +8 -0
- package/dist/buttons.js.map +1 -0
- package/dist/collections.js +13 -0
- package/dist/collections.js.map +1 -0
- package/dist/components/buttons/button-group.js +31 -0
- package/dist/components/buttons/button-group.js.map +1 -0
- package/dist/components/buttons/button.js +120 -0
- package/dist/components/buttons/button.js.map +1 -0
- package/dist/components/buttons/chip.js +44 -0
- package/dist/components/buttons/chip.js.map +1 -0
- package/dist/components/buttons/close-button.js +84 -0
- package/dist/components/buttons/close-button.js.map +1 -0
- package/dist/components/buttons/index.js +8 -0
- package/dist/components/buttons/index.js.map +1 -0
- package/dist/components/buttons/segmented-control/item.js +55 -0
- package/dist/components/buttons/segmented-control/item.js.map +1 -0
- package/dist/components/buttons/segmented-control/segmented-control.js +175 -0
- package/dist/components/buttons/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/buttons/segmented-control.js +3 -0
- package/dist/components/buttons/segmented-control.js.map +1 -0
- package/dist/components/buttons/toggle-button.js +40 -0
- package/dist/components/buttons/toggle-button.js.map +1 -0
- package/dist/components/collections/calendar/calendar.js +808 -0
- package/dist/components/collections/calendar/calendar.js.map +1 -0
- package/dist/components/collections/calendar/day-cell.js +16 -0
- package/dist/components/collections/calendar/day-cell.js.map +1 -0
- package/dist/components/collections/calendar/header.js +48 -0
- package/dist/components/collections/calendar/header.js.map +1 -0
- package/dist/components/collections/calendar/icons.js +23 -0
- package/dist/components/collections/calendar/icons.js.map +1 -0
- package/dist/components/collections/calendar/month-grid.js +14 -0
- package/dist/components/collections/calendar/month-grid.js.map +1 -0
- package/dist/components/collections/calendar/types.js +2 -0
- package/dist/components/collections/calendar/types.js.map +1 -0
- package/dist/components/collections/calendar/utils.js +199 -0
- package/dist/components/collections/calendar/utils.js.map +1 -0
- package/dist/components/collections/calendar/year-grid.js +117 -0
- package/dist/components/collections/calendar/year-grid.js.map +1 -0
- package/dist/components/collections/calendar.js +2 -0
- package/dist/components/collections/calendar.js.map +1 -0
- package/dist/components/collections/command/command.js +263 -0
- package/dist/components/collections/command/command.js.map +1 -0
- package/dist/components/collections/command/dialog.js +100 -0
- package/dist/components/collections/command/dialog.js.map +1 -0
- package/dist/components/collections/command/footer.js +60 -0
- package/dist/components/collections/command/footer.js.map +1 -0
- package/dist/components/collections/command/index.js +6 -0
- package/dist/components/collections/command/index.js.map +1 -0
- package/dist/components/collections/command/input.js +45 -0
- package/dist/components/collections/command/input.js.map +1 -0
- package/dist/components/collections/command/list.js +70 -0
- package/dist/components/collections/command/list.js.map +1 -0
- package/dist/components/collections/command.js +6 -0
- package/dist/components/collections/command.js.map +1 -0
- package/dist/components/collections/dropdown/dropdown.js +206 -0
- package/dist/components/collections/dropdown/dropdown.js.map +1 -0
- package/dist/components/collections/dropdown/menu-context.js +62 -0
- package/dist/components/collections/dropdown/menu-context.js.map +1 -0
- package/dist/components/collections/dropdown/sub.js +256 -0
- package/dist/components/collections/dropdown/sub.js.map +1 -0
- package/dist/components/collections/dropdown.js +2 -0
- package/dist/components/collections/dropdown.js.map +1 -0
- package/dist/components/collections/index.js +13 -0
- package/dist/components/collections/index.js.map +1 -0
- package/dist/components/collections/listbox/group.js +60 -0
- package/dist/components/collections/listbox/group.js.map +1 -0
- package/dist/components/collections/listbox/item.js +197 -0
- package/dist/components/collections/listbox/item.js.map +1 -0
- package/dist/components/collections/listbox/listbox.js +187 -0
- package/dist/components/collections/listbox/listbox.js.map +1 -0
- package/dist/components/collections/listbox.js +4 -0
- package/dist/components/collections/listbox.js.map +1 -0
- package/dist/components/collections/simple-table/body.js +32 -0
- package/dist/components/collections/simple-table/body.js.map +1 -0
- package/dist/components/collections/simple-table/cell.js +27 -0
- package/dist/components/collections/simple-table/cell.js.map +1 -0
- package/dist/components/collections/simple-table/column.js +26 -0
- package/dist/components/collections/simple-table/column.js.map +1 -0
- package/dist/components/collections/simple-table/footer.js +44 -0
- package/dist/components/collections/simple-table/footer.js.map +1 -0
- package/dist/components/collections/simple-table/header.js +44 -0
- package/dist/components/collections/simple-table/header.js.map +1 -0
- package/dist/components/collections/simple-table/index.js +60 -0
- package/dist/components/collections/simple-table/index.js.map +1 -0
- package/dist/components/collections/simple-table/row.js +33 -0
- package/dist/components/collections/simple-table/row.js.map +1 -0
- package/dist/components/collections/table/cell-default.js +39 -0
- package/dist/components/collections/table/cell-default.js.map +1 -0
- package/dist/components/collections/table/cell-for.js +34 -0
- package/dist/components/collections/table/cell-for.js.map +1 -0
- package/dist/components/collections/table/cell-rendering-context.js +39 -0
- package/dist/components/collections/table/cell-rendering-context.js.map +1 -0
- package/dist/components/collections/table/checkbox.js +53 -0
- package/dist/components/collections/table/checkbox.js.map +1 -0
- package/dist/components/collections/table/column-visibility.js +58 -0
- package/dist/components/collections/table/column-visibility.js.map +1 -0
- package/dist/components/collections/table/icons.js +19 -0
- package/dist/components/collections/table/icons.js.map +1 -0
- package/dist/components/collections/table/index.js +3 -0
- package/dist/components/collections/table/index.js.map +1 -0
- package/dist/components/collections/table/sort-button.js +32 -0
- package/dist/components/collections/table/sort-button.js.map +1 -0
- package/dist/components/collections/table/table.js +488 -0
- package/dist/components/collections/table/table.js.map +1 -0
- package/dist/components/collections/table/types.js +2 -0
- package/dist/components/collections/table/types.js.map +1 -0
- package/dist/components/collections/table/utils.js +19 -0
- package/dist/components/collections/table/utils.js.map +1 -0
- package/dist/components/collections/table.js +3 -0
- package/dist/components/collections/table.js.map +1 -0
- package/dist/components/disclosure/accordion/accordion.js +225 -0
- package/dist/components/disclosure/accordion/accordion.js.map +1 -0
- package/dist/components/disclosure/accordion/item.js +86 -0
- package/dist/components/disclosure/accordion/item.js.map +1 -0
- package/dist/components/disclosure/accordion.js +3 -0
- package/dist/components/disclosure/accordion.js.map +1 -0
- package/dist/components/disclosure/icons.js +13 -0
- package/dist/components/disclosure/icons.js.map +1 -0
- package/dist/components/disclosure/index.js +3 -0
- package/dist/components/disclosure/index.js.map +1 -0
- package/dist/components/forms/autocomplete.js +351 -0
- package/dist/components/forms/autocomplete.js.map +1 -0
- package/dist/components/forms/checkbox-group.js +29 -0
- package/dist/components/forms/checkbox-group.js.map +1 -0
- package/dist/components/forms/checkbox.js +50 -0
- package/dist/components/forms/checkbox.js.map +1 -0
- package/dist/components/forms/field-types.js +2 -0
- package/dist/components/forms/field-types.js.map +1 -0
- package/dist/components/forms/field.js +105 -0
- package/dist/components/forms/field.js.map +1 -0
- package/dist/components/forms/form-control.js +70 -0
- package/dist/components/forms/form-control.js.map +1 -0
- package/dist/components/forms/form-description.js +24 -0
- package/dist/components/forms/form-description.js.map +1 -0
- package/dist/components/forms/form-feedback.js +53 -0
- package/dist/components/forms/form-feedback.js.map +1 -0
- package/dist/components/forms/form.js +397 -0
- package/dist/components/forms/form.js.map +1 -0
- package/dist/components/forms/icons.js +13 -0
- package/dist/components/forms/icons.js.map +1 -0
- package/dist/components/forms/index.js +20 -0
- package/dist/components/forms/index.js.map +1 -0
- package/dist/components/forms/input-otp.js +407 -0
- package/dist/components/forms/input-otp.js.map +1 -0
- package/dist/components/forms/input.js +137 -0
- package/dist/components/forms/input.js.map +1 -0
- package/dist/components/forms/label.js +23 -0
- package/dist/components/forms/label.js.map +1 -0
- package/dist/components/forms/native-select.js +134 -0
- package/dist/components/forms/native-select.js.map +1 -0
- package/dist/components/forms/radio-group.js +29 -0
- package/dist/components/forms/radio-group.js.map +1 -0
- package/dist/components/forms/radio.js +49 -0
- package/dist/components/forms/radio.js.map +1 -0
- package/dist/components/forms/select/end-content.js +24 -0
- package/dist/components/forms/select/end-content.js.map +1 -0
- package/dist/components/forms/select/native-mirror.js +29 -0
- package/dist/components/forms/select/native-mirror.js.map +1 -0
- package/dist/components/forms/select/select.js +629 -0
- package/dist/components/forms/select/select.js.map +1 -0
- package/dist/components/forms/select/selected-items.js +63 -0
- package/dist/components/forms/select/selected-items.js.map +1 -0
- package/dist/components/forms/select/trigger.js +30 -0
- package/dist/components/forms/select/trigger.js.map +1 -0
- package/dist/components/forms/select/types.js +2 -0
- package/dist/components/forms/select/types.js.map +1 -0
- package/dist/components/forms/select.js +2 -0
- package/dist/components/forms/select.js.map +1 -0
- package/dist/components/forms/switch.js +63 -0
- package/dist/components/forms/switch.js.map +1 -0
- package/dist/components/forms/textarea.js +53 -0
- package/dist/components/forms/textarea.js.map +1 -0
- package/dist/components/navigation/external-link.js +107 -0
- package/dist/components/navigation/external-link.js.map +1 -0
- package/dist/components/navigation/index.js +9 -0
- package/dist/components/navigation/index.js.map +1 -0
- package/dist/components/navigation/pagination/icons.js +23 -0
- package/dist/components/navigation/pagination/icons.js.map +1 -0
- package/dist/components/navigation/pagination/pagination.js +216 -0
- package/dist/components/navigation/pagination/pagination.js.map +1 -0
- package/dist/components/navigation/pagination/range.js +58 -0
- package/dist/components/navigation/pagination/range.js.map +1 -0
- package/dist/components/navigation/pagination.js +3 -0
- package/dist/components/navigation/pagination.js.map +1 -0
- package/dist/components/navigation/tab-nav/item.js +90 -0
- package/dist/components/navigation/tab-nav/item.js.map +1 -0
- package/dist/components/navigation/tab-nav/tab-nav.js +79 -0
- package/dist/components/navigation/tab-nav/tab-nav.js.map +1 -0
- package/dist/components/navigation/tab-nav.js +3 -0
- package/dist/components/navigation/tab-nav.js.map +1 -0
- package/dist/components/navigation/tabs/panel.js +23 -0
- package/dist/components/navigation/tabs/panel.js.map +1 -0
- package/dist/components/navigation/tabs/tab.js +45 -0
- package/dist/components/navigation/tabs/tab.js.map +1 -0
- package/dist/components/navigation/tabs/tabs.js +156 -0
- package/dist/components/navigation/tabs/tabs.js.map +1 -0
- package/dist/components/navigation/tabs.js +4 -0
- package/dist/components/navigation/tabs.js.map +1 -0
- package/dist/components/notifications/index.js +5 -0
- package/dist/components/notifications/index.js.map +1 -0
- package/dist/components/notifications/notification-card.js +16 -0
- package/dist/components/notifications/notification-card.js.map +1 -0
- package/dist/components/notifications/notifications-container.js +269 -0
- package/dist/components/notifications/notifications-container.js.map +1 -0
- package/dist/components/overlays/backdrop.js +44 -0
- package/dist/components/overlays/backdrop.js.map +1 -0
- package/dist/components/overlays/drawer/body.js +18 -0
- package/dist/components/overlays/drawer/body.js.map +1 -0
- package/dist/components/overlays/drawer/drag-handle.js +18 -0
- package/dist/components/overlays/drawer/drag-handle.js.map +1 -0
- package/dist/components/overlays/drawer/footer.js +18 -0
- package/dist/components/overlays/drawer/footer.js.map +1 -0
- package/dist/components/overlays/drawer/header.js +61 -0
- package/dist/components/overlays/drawer/header.js.map +1 -0
- package/dist/components/overlays/drawer/selectors.js +29 -0
- package/dist/components/overlays/drawer/selectors.js.map +1 -0
- package/dist/components/overlays/drawer.js +175 -0
- package/dist/components/overlays/drawer.js.map +1 -0
- package/dist/components/overlays/index.js +15 -0
- package/dist/components/overlays/index.js.map +1 -0
- package/dist/components/overlays/modal/body.js +18 -0
- package/dist/components/overlays/modal/body.js.map +1 -0
- package/dist/components/overlays/modal/footer.js +18 -0
- package/dist/components/overlays/modal/footer.js.map +1 -0
- package/dist/components/overlays/modal/header.js +25 -0
- package/dist/components/overlays/modal/header.js.map +1 -0
- package/dist/components/overlays/modal.js +129 -0
- package/dist/components/overlays/modal.js.map +1 -0
- package/dist/components/overlays/mount-animation.js +146 -0
- package/dist/components/overlays/mount-animation.js.map +1 -0
- package/dist/components/overlays/overlay.js +321 -0
- package/dist/components/overlays/overlay.js.map +1 -0
- package/dist/components/overlays/popover.js +647 -0
- package/dist/components/overlays/popover.js.map +1 -0
- package/dist/components/overlays/portal-target.js +10 -0
- package/dist/components/overlays/portal-target.js.map +1 -0
- package/dist/components/overlays/portal.js +111 -0
- package/dist/components/overlays/portal.js.map +1 -0
- package/dist/components/overlays/tooltip.js +377 -0
- package/dist/components/overlays/tooltip.js.map +1 -0
- package/dist/components/status/alert.js +146 -0
- package/dist/components/status/alert.js.map +1 -0
- package/dist/components/status/index.js +3 -0
- package/dist/components/status/index.js.map +1 -0
- package/dist/components/status/progress-bar.js +126 -0
- package/dist/components/status/progress-bar.js.map +1 -0
- package/dist/components/utilities/avatar.js +48 -0
- package/dist/components/utilities/avatar.js.map +1 -0
- package/dist/components/utilities/collapsible.js +210 -0
- package/dist/components/utilities/collapsible.js.map +1 -0
- package/dist/components/utilities/divider.js +37 -0
- package/dist/components/utilities/divider.js.map +1 -0
- package/dist/components/utilities/index.js +16 -0
- package/dist/components/utilities/index.js.map +1 -0
- package/dist/components/utilities/kbd.js +88 -0
- package/dist/components/utilities/kbd.js.map +1 -0
- package/dist/components/utilities/skeleton.js +14 -0
- package/dist/components/utilities/skeleton.js.map +1 -0
- package/dist/components/utilities/spinner.js +14 -0
- package/dist/components/utilities/spinner.js.map +1 -0
- package/dist/components/utilities/visually-hidden.js +10 -0
- package/dist/components/utilities/visually-hidden.js.map +1 -0
- package/dist/control-blur-C8OnSQR5.js +124 -0
- package/dist/control-blur-C8OnSQR5.js.map +1 -0
- package/dist/dialog-CreV7aPQ.js +27 -0
- package/dist/dialog-CreV7aPQ.js.map +1 -0
- package/dist/disclosure.js +3 -0
- package/dist/disclosure.js.map +1 -0
- package/dist/dom-cKWVvtkd.js +116 -0
- package/dist/dom-cKWVvtkd.js.map +1 -0
- package/dist/forms.js +20 -0
- package/dist/forms.js.map +1 -0
- package/dist/index.js +83 -7
- package/dist/index.js.map +1 -1
- package/dist/intent-icons-DpEViO8C.js +19 -0
- package/dist/intent-icons-DpEViO8C.js.map +1 -0
- package/dist/manager-CDIZzrQ9.js +388 -0
- package/dist/manager-CDIZzrQ9.js.map +1 -0
- package/dist/modifiers/drag-to-dismiss.js +392 -0
- package/dist/modifiers/drag-to-dismiss.js.map +1 -0
- package/dist/modifiers/press.js +321 -0
- package/dist/modifiers/press.js.map +1 -0
- package/dist/navigation.js +9 -0
- package/dist/navigation.js.map +1 -0
- package/dist/notification-card-D5fd-Sxa.js +330 -0
- package/dist/notification-card-D5fd-Sxa.js.map +1 -0
- package/dist/notifications.js +5 -0
- package/dist/notifications.js.map +1 -0
- package/dist/overlays.js +15 -0
- package/dist/overlays.js.map +1 -0
- package/dist/runtime--fcdnjmJ-BOdRhmsS.js +67 -0
- package/dist/runtime--fcdnjmJ-BOdRhmsS.js.map +1 -0
- package/dist/services/notifications.js +38 -0
- package/dist/services/notifications.js.map +1 -0
- package/dist/status.js +3 -0
- package/dist/status.js.map +1 -0
- package/dist/test-support.js +1316 -0
- package/dist/test-support.js.map +1 -0
- package/dist/utilities.js +16 -0
- package/dist/utilities.js.map +1 -0
- package/dist/utils/deferred-work.js +66 -0
- package/dist/utils/deferred-work.js.map +1 -0
- package/dist/utils/filter.js +166 -0
- package/dist/utils/filter.js.map +1 -0
- package/dist/utils/forms-utils-index.js +24 -0
- package/dist/utils/forms-utils-index.js.map +1 -0
- package/dist/utils/keys.js +259 -0
- package/dist/utils/keys.js.map +1 -0
- package/dist/utils/listManager.js +759 -0
- package/dist/utils/listManager.js.map +1 -0
- package/dist/utils/nested-data.js +196 -0
- package/dist/utils/nested-data.js.map +1 -0
- package/dist/utils/prefers-reduced-motion.js +21 -0
- package/dist/utils/prefers-reduced-motion.js.map +1 -0
- package/dist/utils/ref.js +32 -0
- package/dist/utils/ref.js.map +1 -0
- package/dist/utils/roving-focus.js +206 -0
- package/dist/utils/roving-focus.js.map +1 -0
- package/dist/utils/safe-area.js +133 -0
- package/dist/utils/safe-area.js.map +1 -0
- package/dist/utils/safe-styles.js +15 -0
- package/dist/utils/safe-styles.js.map +1 -0
- package/dist/utils/selection-indicator.js +189 -0
- package/dist/utils/selection-indicator.js.map +1 -0
- package/dist/utils/standard-validator.js +232 -0
- package/dist/utils/standard-validator.js.map +1 -0
- package/dist/utils/toggle.js +46 -0
- package/dist/utils/toggle.js.map +1 -0
- package/package.json +77 -21
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { on } from '@ember/modifier';
|
|
4
|
+
import { useStyles } from '@frontile/theme';
|
|
5
|
+
import { ListManager, keyAndLabelForItem } from '../../../utils/listManager.js';
|
|
6
|
+
import { ListboxItem } from './item.js';
|
|
7
|
+
import { ListboxGroup } from './group.js';
|
|
8
|
+
import { modifier } from 'ember-modifier';
|
|
9
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
10
|
+
import { setComponentTemplate } from '@ember/component';
|
|
11
|
+
|
|
12
|
+
const isInputElement = target => {
|
|
13
|
+
return target instanceof HTMLInputElement;
|
|
14
|
+
};
|
|
15
|
+
const isUndefined = a => typeof a === 'undefined';
|
|
16
|
+
const NAVIGATION_KEYS = ['ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Home', 'End'];
|
|
17
|
+
/**
|
|
18
|
+
* Whether a command-style modifier is held.
|
|
19
|
+
*
|
|
20
|
+
* Enter, Space and type-ahead moved here from the deprecated `keypress`,
|
|
21
|
+
* which largely did not deliver modifier combinations at all. `keydown` does,
|
|
22
|
+
* and it reports an unchanged `key`: Cmd+K arrives as `key === 'k'`, Cmd+Space
|
|
23
|
+
* (Spotlight) as `key === ' '`. Acting on those would swallow the user's and
|
|
24
|
+
* the OS's shortcuts -- typing them into the search buffer, or selecting an
|
|
25
|
+
* option nobody asked for -- so a modifier combo is not ours to handle.
|
|
26
|
+
*
|
|
27
|
+
* Shift is deliberately absent: a capital letter is legitimate type-ahead.
|
|
28
|
+
* `Popover`'s open-on-letter handler makes the same check for the same
|
|
29
|
+
* reason.
|
|
30
|
+
*
|
|
31
|
+
* Arrow and Home/End navigation is exempt, because it always lived on
|
|
32
|
+
* `keydown` and so already had to tolerate these combinations.
|
|
33
|
+
*/
|
|
34
|
+
const hasCommandModifier = event => {
|
|
35
|
+
return event.metaKey || event.ctrlKey || event.altKey;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Whether a keystroke should extend the type-ahead search buffer.
|
|
39
|
+
*
|
|
40
|
+
* Any single printable character qualifies. Unlike `Popover`'s letter check
|
|
41
|
+
* this deliberately does not require `event.code === 'Key' + key`, which
|
|
42
|
+
* restricts matching to A-Z: a listbox types ahead with digits and
|
|
43
|
+
* punctuation too, and the WAI-ARIA APG requires Space to extend an active
|
|
44
|
+
* search.
|
|
45
|
+
*
|
|
46
|
+
* Autorepeat is dropped. `search()` accumulates a prefix rather than cycling
|
|
47
|
+
* between same-initial items, so a leaned-on 'a' would build "aaaa" and match
|
|
48
|
+
* nothing -- a hazard `keypress` never surfaced here. Keystrokes mid-IME
|
|
49
|
+
* composition belong to the input method, not to type-ahead.
|
|
50
|
+
*/
|
|
51
|
+
const isTypeAheadKey = event => {
|
|
52
|
+
return event.key.length === 1 && !event.repeat && !event.isComposing;
|
|
53
|
+
};
|
|
54
|
+
class Listbox extends Component {
|
|
55
|
+
listManager = new ListManager({
|
|
56
|
+
selectionMode: this.args.selectionMode,
|
|
57
|
+
selectedKeys: this.args.selectedKeys,
|
|
58
|
+
disabledKeys: this.args.disabledKeys,
|
|
59
|
+
allowEmpty: this.args.allowEmpty,
|
|
60
|
+
onSelectionChange: this.args.onSelectionChange,
|
|
61
|
+
onAction: this.args.onAction,
|
|
62
|
+
onActiveItemChange: this.args.onActiveItemChange,
|
|
63
|
+
autoActivateMode: isUndefined(this.args.autoActivateMode) ? 'first' : this.args.autoActivateMode
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* All keyboard behaviour lands on `keydown`.
|
|
67
|
+
*
|
|
68
|
+
* Selection and type-ahead used to live on a separate `keypress` listener.
|
|
69
|
+
* A browser fires `keypress` only when the preceding `keydown` was not
|
|
70
|
+
* canceled, so any co-located `keydown` handler calling `preventDefault()`
|
|
71
|
+
* -- `Dropdown`'s submenu keys, a consuming app's shortcut handler --
|
|
72
|
+
* silently deleted the event this component depended on, and Enter
|
|
73
|
+
* selection stopped working with no error at all. `keypress` is also absent
|
|
74
|
+
* from current spec guidance and inconsistent for non-printable keys.
|
|
75
|
+
*/
|
|
76
|
+
handleKeyDown = event => {
|
|
77
|
+
if (NAVIGATION_KEYS.includes(event.key)) {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
if (event.key === 'ArrowDown') {
|
|
80
|
+
this.listManager.setNextOptionActive();
|
|
81
|
+
} else if (event.key === 'ArrowUp') {
|
|
82
|
+
this.listManager.setPreviousOptionActive();
|
|
83
|
+
} else if (event.key === 'Home' || event.key === 'PageUp') {
|
|
84
|
+
this.listManager.setFirstOptionActive();
|
|
85
|
+
} else if (event.key === 'End' || event.key === 'PageDown') {
|
|
86
|
+
this.listManager.setLastOptionActive();
|
|
87
|
+
}
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (hasCommandModifier(event)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
// Navigation above applies wherever the keystroke came from, but text
|
|
94
|
+
// entry does not: when the events are forwarded from a real input (an
|
|
95
|
+
// Autocomplete or Select trigger), the input owns the typing and only
|
|
96
|
+
// Enter is ours to act on.
|
|
97
|
+
if (isInputElement(event.target)) {
|
|
98
|
+
if (event.key === 'Enter') {
|
|
99
|
+
this.listManager.selectActiveItem();
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (event.key === 'Enter') {
|
|
104
|
+
// Enter always selects the active item, even mid-search — unlike
|
|
105
|
+
// Space, Enter is never itself a type-ahead character (its length is
|
|
106
|
+
// 5, not 1), so gating it on an empty search buffer just drops the
|
|
107
|
+
// keystroke while `search()`'s 500ms debounce is still pending. Do
|
|
108
|
+
// not fold this back into the Space branch below.
|
|
109
|
+
this.listManager.selectActiveItem();
|
|
110
|
+
this.listManager.clearSearch();
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
event.stopPropagation();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (event.key === ' ' && this.listManager.searchKeys == '') {
|
|
116
|
+
this.listManager.selectActiveItem();
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
event.stopPropagation();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (isTypeAheadKey(event)) {
|
|
122
|
+
if (event.key === ' ') {
|
|
123
|
+
// Space extends an active search rather than selecting, but it must
|
|
124
|
+
// still not scroll the page. Only `keydown` can prevent that; the
|
|
125
|
+
// old `keypress` listener fired too late to stop it.
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
}
|
|
128
|
+
this.listManager.search(event.key);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
onKeyDown = event => {
|
|
132
|
+
if (this.args.isKeyboardEventsEnabled) {
|
|
133
|
+
this.handleKeyDown(event);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
setupEvents = modifier((_el, _, args) => {
|
|
137
|
+
if (args.elementToAddKeyboardEvents) {
|
|
138
|
+
args.elementToAddKeyboardEvents.addEventListener('keydown', this.handleKeyDown);
|
|
139
|
+
}
|
|
140
|
+
return () => {
|
|
141
|
+
if (args.elementToAddKeyboardEvents) {
|
|
142
|
+
args.elementToAddKeyboardEvents.removeEventListener('keydown', this.handleKeyDown);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
get classNames() {
|
|
147
|
+
const {
|
|
148
|
+
listbox
|
|
149
|
+
} = useStyles();
|
|
150
|
+
return listbox({
|
|
151
|
+
class: this.args.class
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
get role() {
|
|
155
|
+
if (this.args.type === 'menu') {
|
|
156
|
+
return this.args.type;
|
|
157
|
+
}
|
|
158
|
+
return 'listbox';
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* A listbox that accepts more than one selection has to say so, otherwise a
|
|
162
|
+
* screen reader presents it as a single-choice list. Only meaningful on
|
|
163
|
+
* `role="listbox"`; a `menu` conveys multi-select through its item roles.
|
|
164
|
+
*/
|
|
165
|
+
get ariaMultiselectable() {
|
|
166
|
+
if (this.role !== 'listbox') {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
return this.args.selectionMode === 'multiple' ? 'true' : undefined;
|
|
170
|
+
}
|
|
171
|
+
static {
|
|
172
|
+
setComponentTemplate(precompileTemplate("<ul tabindex=\"0\" role={{this.role}} aria-multiselectable={{this.ariaMultiselectable}} {{!-- The callbacks travel through setup, not only through the manager's\n field initializer above: that initializer runs once, so an onAction\n rebuilt on a later render would otherwise never reach the manager. --}} {{this.listManager.setup selectedKeys=@selectedKeys disabledKeys=@disabledKeys selectionMode=@selectionMode allowEmpty=@allowEmpty onAction=@onAction onSelectionChange=@onSelectionChange onActiveItemChange=@onActiveItemChange autoActivateMode=(if (isUndefined @autoActivateMode) \"first\" @autoActivateMode)}} {{on \"keydown\" this.onKeyDown}} {{this.setupEvents elementToAddKeyboardEvents=@elementToAddKeyboardEvents}} data-test-id=\"listbox\" data-component=\"listbox\" class={{this.classNames}} ...attributes>\n {{#each @items as |item|}}\n {{#let (keyAndLabelForItem item) as |keyLabel|}}\n {{#if (has-block \"item\")}}\n {{yield (hash item=item key=keyLabel.key label=keyLabel.label Item=(component ListboxItem manager=this.listManager appearance=@appearance intent=@intent shortcutAppearance=@shortcutAppearance type=this.role key=keyLabel.key item=item)) to=\"item\"}}\n {{else}}\n <ListboxItem @manager={{this.listManager}} @key={{keyLabel.key}} @item={{item}} @appearance={{@appearance}} @intent={{@intent}} @shortcutAppearance={{@shortcutAppearance}} @type={{this.role}}>\n {{keyLabel.label}}\n </ListboxItem>\n {{/if}}\n {{/let}}\n {{/each}}\n\n {{yield (hash Item=(component ListboxItem manager=this.listManager appearance=@appearance intent=@intent shortcutAppearance=@shortcutAppearance type=this.role) Group=(component ListboxGroup manager=this.listManager appearance=@appearance intent=@intent shortcutAppearance=@shortcutAppearance type=this.role))}}\n</ul>", {
|
|
173
|
+
strictMode: true,
|
|
174
|
+
scope: () => ({
|
|
175
|
+
isUndefined,
|
|
176
|
+
on,
|
|
177
|
+
keyAndLabelForItem,
|
|
178
|
+
hash,
|
|
179
|
+
ListboxItem,
|
|
180
|
+
ListboxGroup
|
|
181
|
+
})
|
|
182
|
+
}), this);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { Listbox, ListboxGroup, ListboxItem, Listbox as default };
|
|
187
|
+
//# sourceMappingURL=listbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listbox.js","sources":["../../../../src/components/collections/listbox/listbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nimport {\n ListManager,\n keyAndLabelForItem,\n type SelectionMode,\n type ListItem\n} from '../../../utils/listManager';\nimport { ListboxItem, type ListboxItemSignature } from './item';\nimport { ListboxGroup, type ListboxGroupSignature } from './group';\nimport { modifier } from 'ember-modifier';\nimport type { WithBoundArgs } from '@glint/template';\n\ntype ItemCompBounded = WithBoundArgs<typeof ListboxItem, 'manager'>;\ntype GroupCompBounded = WithBoundArgs<typeof ListboxGroup, 'manager'>;\ntype ItemCompBoundedWithItem = WithBoundArgs<\n typeof ListboxItem,\n 'manager' | 'item'\n>;\n\ninterface ListboxSignature<T> {\n Args: {\n /**\n * @default 'listbox'\n */\n type?: 'menu' | 'listbox';\n selectionMode?: SelectionMode;\n selectedKeys?: string[];\n disabledKeys?: string[];\n allowEmpty?: boolean;\n items?: T[];\n class?: string;\n isKeyboardEventsEnabled?: boolean;\n\n /** The element to add keyboard events to.\n *\n * This does not respect the option `iskeyboardEventsEnabled`.\n * @defaultValue null\n */\n elementToAddKeyboardEvents?: HTMLElement;\n\n /**\n * @defaultValue 'first'\n */\n autoActivateMode?: 'none' | 'first' | 'selected';\n\n onAction?: (key: string) => void;\n onSelectionChange?: (key: string[]) => void;\n onActiveItemChange?: (key?: string, item?: ListItem) => void;\n\n /**\n * The appearance of each item\n *\n * @defaultValue 'default'\n */\n appearance?: 'default' | 'outlined' | 'faded';\n\n /**\n * The intent of each item\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The appearance of the keycap rendered for each item's `@shortcut`.\n *\n * @defaultValue 'inherit'\n */\n shortcutAppearance?: ListboxItemSignature['Args']['shortcutAppearance'];\n };\n Element: HTMLUListElement;\n Blocks: {\n item: [\n { item: T; key: string; label: string; Item: ItemCompBoundedWithItem }\n ];\n default: [{ Item: ItemCompBounded; Group: GroupCompBounded }];\n };\n}\n\nconst isInputElement = (\n target: EventTarget | null\n): target is HTMLInputElement => {\n return target instanceof HTMLInputElement;\n};\n\nconst isUndefined = (a: unknown) => typeof a === 'undefined';\n\nconst NAVIGATION_KEYS = [\n 'ArrowUp',\n 'ArrowDown',\n 'PageUp',\n 'PageDown',\n 'Home',\n 'End'\n];\n\n/**\n * Whether a command-style modifier is held.\n *\n * Enter, Space and type-ahead moved here from the deprecated `keypress`,\n * which largely did not deliver modifier combinations at all. `keydown` does,\n * and it reports an unchanged `key`: Cmd+K arrives as `key === 'k'`, Cmd+Space\n * (Spotlight) as `key === ' '`. Acting on those would swallow the user's and\n * the OS's shortcuts -- typing them into the search buffer, or selecting an\n * option nobody asked for -- so a modifier combo is not ours to handle.\n *\n * Shift is deliberately absent: a capital letter is legitimate type-ahead.\n * `Popover`'s open-on-letter handler makes the same check for the same\n * reason.\n *\n * Arrow and Home/End navigation is exempt, because it always lived on\n * `keydown` and so already had to tolerate these combinations.\n */\nconst hasCommandModifier = (event: KeyboardEvent): boolean => {\n return event.metaKey || event.ctrlKey || event.altKey;\n};\n\n/**\n * Whether a keystroke should extend the type-ahead search buffer.\n *\n * Any single printable character qualifies. Unlike `Popover`'s letter check\n * this deliberately does not require `event.code === 'Key' + key`, which\n * restricts matching to A-Z: a listbox types ahead with digits and\n * punctuation too, and the WAI-ARIA APG requires Space to extend an active\n * search.\n *\n * Autorepeat is dropped. `search()` accumulates a prefix rather than cycling\n * between same-initial items, so a leaned-on 'a' would build \"aaaa\" and match\n * nothing -- a hazard `keypress` never surfaced here. Keystrokes mid-IME\n * composition belong to the input method, not to type-ahead.\n */\nconst isTypeAheadKey = (event: KeyboardEvent): boolean => {\n return event.key.length === 1 && !event.repeat && !event.isComposing;\n};\n\nclass Listbox<T = unknown> extends Component<ListboxSignature<T>> {\n listManager = new ListManager({\n selectionMode: this.args.selectionMode,\n selectedKeys: this.args.selectedKeys,\n disabledKeys: this.args.disabledKeys,\n allowEmpty: this.args.allowEmpty,\n onSelectionChange: this.args.onSelectionChange,\n onAction: this.args.onAction,\n onActiveItemChange: this.args.onActiveItemChange,\n autoActivateMode: isUndefined(this.args.autoActivateMode)\n ? 'first'\n : this.args.autoActivateMode\n });\n\n /**\n * All keyboard behaviour lands on `keydown`.\n *\n * Selection and type-ahead used to live on a separate `keypress` listener.\n * A browser fires `keypress` only when the preceding `keydown` was not\n * canceled, so any co-located `keydown` handler calling `preventDefault()`\n * -- `Dropdown`'s submenu keys, a consuming app's shortcut handler --\n * silently deleted the event this component depended on, and Enter\n * selection stopped working with no error at all. `keypress` is also absent\n * from current spec guidance and inconsistent for non-printable keys.\n */\n handleKeyDown = (event: KeyboardEvent) => {\n if (NAVIGATION_KEYS.includes(event.key)) {\n event.preventDefault();\n\n if (event.key === 'ArrowDown') {\n this.listManager.setNextOptionActive();\n } else if (event.key === 'ArrowUp') {\n this.listManager.setPreviousOptionActive();\n } else if (event.key === 'Home' || event.key === 'PageUp') {\n this.listManager.setFirstOptionActive();\n } else if (event.key === 'End' || event.key === 'PageDown') {\n this.listManager.setLastOptionActive();\n }\n\n return;\n }\n\n if (hasCommandModifier(event)) {\n return;\n }\n\n // Navigation above applies wherever the keystroke came from, but text\n // entry does not: when the events are forwarded from a real input (an\n // Autocomplete or Select trigger), the input owns the typing and only\n // Enter is ours to act on.\n if (isInputElement(event.target)) {\n if (event.key === 'Enter') {\n this.listManager.selectActiveItem();\n }\n return;\n }\n\n if (event.key === 'Enter') {\n // Enter always selects the active item, even mid-search — unlike\n // Space, Enter is never itself a type-ahead character (its length is\n // 5, not 1), so gating it on an empty search buffer just drops the\n // keystroke while `search()`'s 500ms debounce is still pending. Do\n // not fold this back into the Space branch below.\n this.listManager.selectActiveItem();\n this.listManager.clearSearch();\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (event.key === ' ' && this.listManager.searchKeys == '') {\n this.listManager.selectActiveItem();\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (isTypeAheadKey(event)) {\n if (event.key === ' ') {\n // Space extends an active search rather than selecting, but it must\n // still not scroll the page. Only `keydown` can prevent that; the\n // old `keypress` listener fired too late to stop it.\n event.preventDefault();\n }\n\n this.listManager.search(event.key);\n }\n };\n\n onKeyDown = (event: KeyboardEvent) => {\n if (this.args.isKeyboardEventsEnabled) {\n this.handleKeyDown(event);\n }\n };\n\n setupEvents = modifier(\n (\n _el: HTMLElement,\n _: unknown[],\n args: { elementToAddKeyboardEvents?: HTMLElement }\n ) => {\n if (args.elementToAddKeyboardEvents) {\n args.elementToAddKeyboardEvents.addEventListener(\n 'keydown',\n this.handleKeyDown\n );\n }\n\n return () => {\n if (args.elementToAddKeyboardEvents) {\n args.elementToAddKeyboardEvents.removeEventListener(\n 'keydown',\n this.handleKeyDown\n );\n }\n };\n }\n );\n\n get classNames() {\n const { listbox } = useStyles();\n return listbox({ class: this.args.class });\n }\n\n get role() {\n if (this.args.type === 'menu') {\n return this.args.type;\n }\n return 'listbox';\n }\n\n /**\n * A listbox that accepts more than one selection has to say so, otherwise a\n * screen reader presents it as a single-choice list. Only meaningful on\n * `role=\"listbox\"`; a `menu` conveys multi-select through its item roles.\n */\n get ariaMultiselectable(): 'true' | undefined {\n if (this.role !== 'listbox') {\n return undefined;\n }\n return this.args.selectionMode === 'multiple' ? 'true' : undefined;\n }\n\n <template>\n <ul\n tabindex=\"0\"\n role={{this.role}}\n aria-multiselectable={{this.ariaMultiselectable}}\n {{! The callbacks travel through setup, not only through the manager's\n field initializer above: that initializer runs once, so an onAction\n rebuilt on a later render would otherwise never reach the manager. }}\n {{this.listManager.setup\n selectedKeys=@selectedKeys\n disabledKeys=@disabledKeys\n selectionMode=@selectionMode\n allowEmpty=@allowEmpty\n onAction=@onAction\n onSelectionChange=@onSelectionChange\n onActiveItemChange=@onActiveItemChange\n autoActivateMode=(if\n (isUndefined @autoActivateMode) \"first\" @autoActivateMode\n )\n }}\n {{on \"keydown\" this.onKeyDown}}\n {{this.setupEvents\n elementToAddKeyboardEvents=@elementToAddKeyboardEvents\n }}\n data-test-id=\"listbox\"\n data-component=\"listbox\"\n class={{this.classNames}}\n ...attributes\n >\n {{#each @items as |item|}}\n {{#let (keyAndLabelForItem item) as |keyLabel|}}\n {{#if (has-block \"item\")}}\n {{yield\n (hash\n item=item\n key=keyLabel.key\n label=keyLabel.label\n Item=(component\n ListboxItem\n manager=this.listManager\n appearance=@appearance\n intent=@intent\n shortcutAppearance=@shortcutAppearance\n type=this.role\n key=keyLabel.key\n item=item\n )\n )\n to=\"item\"\n }}\n {{else}}\n <ListboxItem\n @manager={{this.listManager}}\n @key={{keyLabel.key}}\n @item={{item}}\n @appearance={{@appearance}}\n @intent={{@intent}}\n @shortcutAppearance={{@shortcutAppearance}}\n @type={{this.role}}\n >\n {{keyLabel.label}}\n </ListboxItem>\n {{/if}}\n {{/let}}\n {{/each}}\n\n {{yield\n (hash\n Item=(component\n ListboxItem\n manager=this.listManager\n appearance=@appearance\n intent=@intent\n shortcutAppearance=@shortcutAppearance\n type=this.role\n )\n Group=(component\n ListboxGroup\n manager=this.listManager\n appearance=@appearance\n intent=@intent\n shortcutAppearance=@shortcutAppearance\n type=this.role\n )\n )\n }}\n </ul>\n </template>\n}\n\nexport {\n Listbox,\n ListboxItem,\n ListboxGroup,\n type ListboxSignature,\n type ListboxItemSignature,\n type ListboxGroupSignature,\n type ListItem\n};\nexport default Listbox;\n"],"names":["isInputElement","target","HTMLInputElement","isUndefined","a","NAVIGATION_KEYS","hasCommandModifier","event","metaKey","ctrlKey","altKey","isTypeAheadKey","key","length","repeat","isComposing","Listbox","Component","listManager","ListManager","selectionMode","args","selectedKeys","disabledKeys","allowEmpty","onSelectionChange","onAction","onActiveItemChange","autoActivateMode","handleKeyDown","includes","preventDefault","setNextOptionActive","setPreviousOptionActive","setFirstOptionActive","setLastOptionActive","selectActiveItem","clearSearch","stopPropagation","searchKeys","search","onKeyDown","isKeyboardEventsEnabled","setupEvents","modifier","_el","_","elementToAddKeyboardEvents","addEventListener","removeEventListener","classNames","listbox","useStyles","class","role","type","ariaMultiselectable","undefined","setComponentTemplate","precompileTemplate","strictMode","scope","on","keyAndLabelForItem","hash","ListboxItem","ListboxGroup"],"mappings":";;;;;;;;;;;AAuFA,MAAMA,iBACJC,MAA0B,IACf;EACX,OAAOA,MAAA,YAAkBC,gBAAA;AAC3B,CAAA;AAEA,MAAMC,cAAeC,CAAU,IAAK,OAAOA,CAAA,KAAM,WAAA;AAEjD,MAAMC,eAAA,GAAkB,CACtB,SAAA,EACA,WAAA,EACA,QAAA,EACA,UAAA,EACA,MAAA,EACA,KAAA,CACD;AAED;;;;;;;;;;;;;;;;AAgBC;AACD,MAAMC,kBAAA,GAAsBC,SAA8B;EACxD,OAAOA,MAA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,IAAA,IAAI,IAAI,CAACF,IAAI,KAAK,SAAA,EAAW;AAC3B,MAAA,OAAOG,SAAA;AACT,IAAA;IACA,OAAO,IAAI,CAACpC,IAAI,CAACD,aAAa,KAAK,aAAa,MAAA,GAASqC,SAAA;AAC3D,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,6yDAAA,EAuFA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAA1D,WAAA;QAAA2D,EAAA;QAAAC,kBAAA;QAAAC,IAAA;QAAAC,WAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listbox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { useStyles, twMerge } from '@frontile/theme';
|
|
4
|
+
import { SimpleTableRow } from './row.js';
|
|
5
|
+
import { SimpleTableCell } from './cell.js';
|
|
6
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
|
+
import { setComponentTemplate } from '@ember/component';
|
|
8
|
+
|
|
9
|
+
class SimpleTableBody extends Component {
|
|
10
|
+
get styles() {
|
|
11
|
+
return this.args.styleFns || useStyles().table();
|
|
12
|
+
}
|
|
13
|
+
get classNames() {
|
|
14
|
+
const mergedClass = twMerge(this.args.class, this.args.classes?.tbody);
|
|
15
|
+
return this.styles.tbody({
|
|
16
|
+
class: mergedClass
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
static {
|
|
20
|
+
setComponentTemplate(precompileTemplate("<tbody class={{this.classNames}} data-test-id=\"table-body\" data-component=\"table-body\" ...attributes>\n {{yield (hash Row=(component SimpleTableRow styleFns=this.styles classes=@classes) Cell=(component SimpleTableCell styleFns=this.styles classes=@classes))}}\n</tbody>", {
|
|
21
|
+
strictMode: true,
|
|
22
|
+
scope: () => ({
|
|
23
|
+
hash,
|
|
24
|
+
SimpleTableRow,
|
|
25
|
+
SimpleTableCell
|
|
26
|
+
})
|
|
27
|
+
}), this);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { SimpleTableBody, SimpleTableBody as default };
|
|
32
|
+
//# sourceMappingURL=body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body.js","sources":["../../../../src/components/collections/simple-table/body.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableRow } from './row';\nimport { SimpleTableCell } from './cell';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableBodySignature {\n Args: {\n /** Additional CSS class to apply to the body section */\n class?: string;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Row: WithBoundArgs<typeof SimpleTableRow, 'styleFns' | 'classes'>;\n Cell: WithBoundArgs<typeof SimpleTableCell, 'styleFns' | 'classes'>;\n }\n ];\n };\n}\n\nclass SimpleTableBody extends Component<SimpleTableBodySignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const mergedClass = twMerge(this.args.class, this.args.classes?.tbody);\n return this.styles.tbody({ class: mergedClass });\n }\n\n <template>\n <tbody\n class={{this.classNames}}\n data-test-id=\"table-body\"\n data-component=\"table-body\"\n ...attributes\n >\n {{yield\n (hash\n Row=(component SimpleTableRow styleFns=this.styles classes=@classes)\n Cell=(component SimpleTableCell styleFns=this.styles classes=@classes)\n )\n }}\n </tbody>\n </template>\n}\n\nexport { SimpleTableBody, type SimpleTableBodySignature };\nexport default SimpleTableBody;\n"],"names":["SimpleTableBody","Component","styles","args","styleFns","useStyles","table","classNames","mergedClass","twMerge","class","classes","tbody","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;AAkCA,MAAMA,wBAAwBC,SAAA,CAAU;EACtC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,WAAA,GAAcC,OAAA,CAAQ,IAAI,CAACN,IAAI,CAACO,KAAK,EAAE,IAAI,CAACP,IAAI,CAACQ,OAAO,EAAEC,KAAA,CAAA;AAChE,IAAA,OAAO,IAAI,CAACV,MAAM,CAACU,KAAK,CAAC;AAAEF,MAAAA,KAAA,EAAOF;AAAY,KAAA,CAAA;AAChD,EAAA;AAEA,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAAA,qRAAA,EAcA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,cAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { useStyles, twMerge } from '@frontile/theme';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
class SimpleTableCell extends Component {
|
|
7
|
+
get styles() {
|
|
8
|
+
return this.args.styleFns || useStyles().table();
|
|
9
|
+
}
|
|
10
|
+
get classNames() {
|
|
11
|
+
const options = {
|
|
12
|
+
isSticky: this.args.isSticky || false,
|
|
13
|
+
stickyPosition: this.args.isSticky ? this.args.stickyPosition || 'left' : undefined,
|
|
14
|
+
isInStickyRow: this.args.isInStickyRow || false,
|
|
15
|
+
class: twMerge(this.args.class || '', this.args.classes?.td || '')
|
|
16
|
+
};
|
|
17
|
+
return this.styles.td(options);
|
|
18
|
+
}
|
|
19
|
+
static {
|
|
20
|
+
setComponentTemplate(precompileTemplate("<td class={{this.classNames}} data-test-id=\"table-cell\" data-component=\"table-cell\" ...attributes>\n {{yield}}\n</td>", {
|
|
21
|
+
strictMode: true
|
|
22
|
+
}), this);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { SimpleTableCell, SimpleTableCell as default };
|
|
27
|
+
//# sourceMappingURL=cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell.js","sources":["../../../../src/components/collections/simple-table/cell.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableCellSignature {\n Args: {\n /** Additional CSS class to apply to the cell */\n class?: string;\n /** Whether this cell should be sticky during horizontal scrolling */\n isSticky?: boolean;\n /** Position where the sticky cell should stick. @default 'left' */\n stickyPosition?: 'left' | 'right';\n /** Whether this cell is part of a sticky row (used for intersection styling) */\n isInStickyRow?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableCellElement;\n Blocks: {\n default: [];\n };\n}\n\nclass SimpleTableCell extends Component<SimpleTableCellSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky\n ? (this.args.stickyPosition as 'left' | 'right') || 'left'\n : undefined,\n isInStickyRow: this.args.isInStickyRow || false,\n class: twMerge(this.args.class || '', this.args.classes?.td || '')\n };\n\n return this.styles.td(options);\n }\n\n <template>\n <td\n class={{this.classNames}}\n data-test-id=\"table-cell\"\n data-component=\"table-cell\"\n ...attributes\n >\n {{yield}}\n </td>\n </template>\n}\n\nexport { SimpleTableCell, type SimpleTableCellSignature };\nexport default SimpleTableCell;\n"],"names":["SimpleTableCell","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","isInStickyRow","class","twMerge","classes","td","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AA+BA,MAAMA,wBAAwBC,SAAA,CAAU;EACtC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;AAChCC,MAAAA,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAC7B,IAAI,CAACN,IAAI,CAACO,cAAc,IAAyB,MAAA,GAClDC,SAAA;AACJC,MAAAA,aAAA,EAAe,IAAI,CAACT,IAAI,CAACS,aAAa,IAAI,KAAA;AAC1CC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACX,IAAI,CAACU,KAAK,IAAI,EAAA,EAAI,IAAI,CAACV,IAAI,CAACY,OAAO,EAAEC,EAAA,IAAM,EAAA;KACjE;AAEA,IAAA,OAAO,IAAI,CAACd,MAAM,CAACc,EAAE,CAACR,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,4HAAA,EASA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { useStyles } from '@frontile/theme';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
class SimpleTableColumn extends Component {
|
|
7
|
+
get styles() {
|
|
8
|
+
return this.args.styleFns || useStyles().table();
|
|
9
|
+
}
|
|
10
|
+
get classNames() {
|
|
11
|
+
const options = {
|
|
12
|
+
isSticky: this.args.isSticky || false,
|
|
13
|
+
stickyPosition: this.args.isSticky ? this.args.stickyPosition || 'left' : undefined,
|
|
14
|
+
class: this.args.class
|
|
15
|
+
};
|
|
16
|
+
return this.styles.th(options);
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
setComponentTemplate(precompileTemplate("<th scope=\"col\" class={{this.classNames}} data-test-id=\"table-column\" data-component=\"table-column\" ...attributes>\n {{yield}}\n</th>", {
|
|
20
|
+
strictMode: true
|
|
21
|
+
}), this);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { SimpleTableColumn, SimpleTableColumn as default };
|
|
26
|
+
//# sourceMappingURL=column.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column.js","sources":["../../../../src/components/collections/simple-table/column.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface SimpleTableColumnSignature {\n Args: {\n /** Additional CSS class to apply to the header cell */\n class?: string;\n /** Whether this column should be sticky during horizontal scrolling */\n isSticky?: boolean;\n /** Position where the sticky column should stick. @default 'left' */\n stickyPosition?: 'left' | 'right';\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n };\n Element: HTMLTableCellElement;\n Blocks: {\n default: [];\n };\n}\n\nclass SimpleTableColumn extends Component<SimpleTableColumnSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky\n ? (this.args.stickyPosition as 'left' | 'right') || 'left'\n : undefined,\n class: this.args.class\n };\n\n return this.styles.th(options);\n }\n\n <template>\n <th\n scope=\"col\"\n class={{this.classNames}}\n data-test-id=\"table-column\"\n data-component=\"table-column\"\n ...attributes\n >\n {{yield}}\n </th>\n </template>\n}\n\nexport { SimpleTableColumn, type SimpleTableColumnSignature };\nexport default SimpleTableColumn;\n"],"names":["SimpleTableColumn","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","th","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAuBA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;AAChCC,MAAAA,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAC7B,IAAI,CAACN,IAAI,CAACO,cAAc,IAAyB,MAAA,GAClDC,SAAA;AACJC,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACS;KACnB;AAEA,IAAA,OAAO,IAAI,CAACV,MAAM,CAACW,EAAE,CAACL,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,8IAAA,EAUA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { useStyles, twMerge } from '@frontile/theme';
|
|
4
|
+
import { SimpleTableColumn } from './column.js';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
|
|
8
|
+
class SimpleTableFooter extends Component {
|
|
9
|
+
get styles() {
|
|
10
|
+
return this.args.styleFns || useStyles().table();
|
|
11
|
+
}
|
|
12
|
+
get classNames() {
|
|
13
|
+
const options = {
|
|
14
|
+
isSticky: this.args.isSticky || false,
|
|
15
|
+
stickyPosition: this.args.isSticky ? 'bottom' : undefined,
|
|
16
|
+
class: twMerge(this.args.class, this.args.classes?.tfoot)
|
|
17
|
+
};
|
|
18
|
+
return this.styles.tfoot(options);
|
|
19
|
+
}
|
|
20
|
+
get rowClassNames() {
|
|
21
|
+
const options = {
|
|
22
|
+
class: twMerge('', this.args.classes?.tr || ''),
|
|
23
|
+
isSticky: false
|
|
24
|
+
};
|
|
25
|
+
return this.styles.tr(options);
|
|
26
|
+
}
|
|
27
|
+
get separatorClassNames() {
|
|
28
|
+
return this.styles.separator({
|
|
29
|
+
class: this.args.classes?.separator
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
static {
|
|
33
|
+
setComponentTemplate(precompileTemplate("<tfoot class={{this.classNames}} data-test-id=\"table-footer\" data-component=\"table-footer\" ...attributes>\n <tr class={{this.separatorClassNames}} />\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n</tfoot>", {
|
|
34
|
+
strictMode: true,
|
|
35
|
+
scope: () => ({
|
|
36
|
+
hash,
|
|
37
|
+
SimpleTableColumn
|
|
38
|
+
})
|
|
39
|
+
}), this);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { SimpleTableFooter, SimpleTableFooter as default };
|
|
44
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../../src/components/collections/simple-table/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableColumn } from './column';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableFooterSignature {\n Args: {\n /** Additional CSS class to apply to the footer element */\n class?: string;\n /** Whether this footer should be sticky during vertical scrolling */\n isSticky?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Column: typeof SimpleTableColumn;\n }\n ];\n };\n}\n\nclass SimpleTableFooter extends Component<SimpleTableFooterSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('bottom' as const) : undefined,\n class: twMerge(this.args.class, this.args.classes?.tfoot)\n };\n\n return this.styles.tfoot(options);\n }\n\n get rowClassNames() {\n const options = {\n class: twMerge('', this.args.classes?.tr || ''),\n isSticky: false\n };\n return this.styles.tr(options);\n }\n\n get separatorClassNames() {\n return this.styles.separator({\n class: this.args.classes?.separator\n });\n }\n\n <template>\n <tfoot\n class={{this.classNames}}\n data-test-id=\"table-footer\"\n data-component=\"table-footer\"\n ...attributes\n >\n <tr class={{this.separatorClassNames}} />\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n </tfoot>\n </template>\n}\n\nexport { SimpleTableFooter, type SimpleTableFooterSignature };\nexport default SimpleTableFooter;\n"],"names":["SimpleTableFooter","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","twMerge","classes","tfoot","rowClassNames","tr","separatorClassNames","separator","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableColumn"],"mappings":";;;;;;;AAiCA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,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/helper';
|
|
3
|
+
import { useStyles, twMerge } from '@frontile/theme';
|
|
4
|
+
import { SimpleTableColumn } from './column.js';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
|
|
8
|
+
class SimpleTableHeader extends Component {
|
|
9
|
+
get styles() {
|
|
10
|
+
return this.args.styleFns || useStyles().table();
|
|
11
|
+
}
|
|
12
|
+
get classNames() {
|
|
13
|
+
const options = {
|
|
14
|
+
isSticky: this.args.isSticky || false,
|
|
15
|
+
stickyPosition: this.args.isSticky ? 'top' : undefined,
|
|
16
|
+
class: twMerge(this.args.class, this.args.classes?.thead)
|
|
17
|
+
};
|
|
18
|
+
return this.styles.thead(options);
|
|
19
|
+
}
|
|
20
|
+
get rowClassNames() {
|
|
21
|
+
const options = {
|
|
22
|
+
class: twMerge('', this.args.classes?.tr || ''),
|
|
23
|
+
isSticky: false
|
|
24
|
+
};
|
|
25
|
+
return this.styles.tr(options);
|
|
26
|
+
}
|
|
27
|
+
get separatorClassNames() {
|
|
28
|
+
return this.styles.separator({
|
|
29
|
+
class: this.args.classes?.separator
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
static {
|
|
33
|
+
setComponentTemplate(precompileTemplate("<thead class={{this.classNames}} data-test-id=\"table-header\" data-component=\"table-header\" ...attributes>\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n <tr class={{this.separatorClassNames}} />\n</thead>", {
|
|
34
|
+
strictMode: true,
|
|
35
|
+
scope: () => ({
|
|
36
|
+
hash,
|
|
37
|
+
SimpleTableColumn
|
|
38
|
+
})
|
|
39
|
+
}), this);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { SimpleTableHeader, SimpleTableHeader as default };
|
|
44
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/collections/simple-table/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableColumn } from './column';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableHeaderSignature {\n Args: {\n /** Additional CSS class to apply to the header section */\n class?: string;\n /** Whether the header should be sticky during vertical scrolling */\n isSticky?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Column: typeof SimpleTableColumn;\n }\n ];\n };\n}\n\nclass SimpleTableHeader extends Component<SimpleTableHeaderSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('top' as const) : undefined,\n class: twMerge(this.args.class, this.args.classes?.thead)\n };\n\n return this.styles.thead(options);\n }\n\n get rowClassNames() {\n const options = {\n class: twMerge('', this.args.classes?.tr || ''),\n isSticky: false\n };\n return this.styles.tr(options);\n }\n\n get separatorClassNames() {\n return this.styles.separator({\n class: this.args.classes?.separator\n });\n }\n\n <template>\n <thead\n class={{this.classNames}}\n data-test-id=\"table-header\"\n data-component=\"table-header\"\n ...attributes\n >\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n <tr class={{this.separatorClassNames}} />\n </thead>\n </template>\n}\n\nexport { SimpleTableHeader, type SimpleTableHeaderSignature };\nexport default SimpleTableHeader;\n"],"names":["SimpleTableHeader","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","twMerge","classes","thead","rowClassNames","tr","separatorClassNames","separator","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableColumn"],"mappings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
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { useStyles } from '@frontile/theme';
|
|
4
|
+
import { SimpleTableHeader } from './header.js';
|
|
5
|
+
import { SimpleTableBody } from './body.js';
|
|
6
|
+
import { SimpleTableFooter } from './footer.js';
|
|
7
|
+
import { SimpleTableColumn } from './column.js';
|
|
8
|
+
import { SimpleTableRow } from './row.js';
|
|
9
|
+
import { SimpleTableCell } from './cell.js';
|
|
10
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
11
|
+
import { setComponentTemplate } from '@ember/component';
|
|
12
|
+
|
|
13
|
+
class SimpleTable extends Component {
|
|
14
|
+
get hasWrapper() {
|
|
15
|
+
return this.args.hasWrapper ?? true;
|
|
16
|
+
}
|
|
17
|
+
get styles() {
|
|
18
|
+
const {
|
|
19
|
+
table
|
|
20
|
+
} = useStyles();
|
|
21
|
+
return table({
|
|
22
|
+
size: this.args.size,
|
|
23
|
+
layout: this.args.layout,
|
|
24
|
+
striped: this.args.isStriped,
|
|
25
|
+
isScrollable: this.args.isScrollable || false,
|
|
26
|
+
hasStickyHeader: false,
|
|
27
|
+
isLoading: this.args.hasCustomLoading ? false : this.args.isLoading || false,
|
|
28
|
+
loadingColor: this.args.loadingColor,
|
|
29
|
+
selectionColor: this.args.selectionColor,
|
|
30
|
+
class: this.args.classes?.base
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
get wrapperClassNames() {
|
|
34
|
+
return this.styles.wrapper({
|
|
35
|
+
class: this.args.classes?.wrapper
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
get tableClassNames() {
|
|
39
|
+
return this.styles.table({
|
|
40
|
+
class: this.args.classes?.table
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
static {
|
|
44
|
+
setComponentTemplate(precompileTemplate("{{#if this.hasWrapper}}\n <div class={{this.wrapperClassNames}} data-component=\"table-wrapper\">\n <table class={{this.tableClassNames}} data-test-id=\"table\" data-component=\"table\" data-loading={{if this.args.isLoading \"true\" \"false\"}} ...attributes>\n {{yield (hash Header=(component SimpleTableHeader styleFns=this.styles classes=this.args.classes) Body=(component SimpleTableBody styleFns=this.styles classes=this.args.classes) Footer=(component SimpleTableFooter styleFns=this.styles classes=this.args.classes) Column=(component SimpleTableColumn styleFns=this.styles) Row=(component SimpleTableRow styleFns=this.styles classes=this.args.classes) Cell=(component SimpleTableCell styleFns=this.styles classes=this.args.classes))}}\n </table>\n </div>\n{{else}}\n <table class={{this.tableClassNames}} data-test-id=\"table\" data-component=\"table\" data-loading={{if this.args.isLoading \"true\" \"false\"}} ...attributes>\n {{yield (hash Header=(component SimpleTableHeader styleFns=this.styles classes=this.args.classes) Body=(component SimpleTableBody styleFns=this.styles classes=this.args.classes) Footer=(component SimpleTableFooter styleFns=this.styles classes=this.args.classes) Column=(component SimpleTableColumn styleFns=this.styles) Row=(component SimpleTableRow styleFns=this.styles classes=this.args.classes) Cell=(component SimpleTableCell styleFns=this.styles classes=this.args.classes))}}\n </table>\n{{/if}}", {
|
|
45
|
+
strictMode: true,
|
|
46
|
+
scope: () => ({
|
|
47
|
+
hash,
|
|
48
|
+
SimpleTableHeader,
|
|
49
|
+
SimpleTableBody,
|
|
50
|
+
SimpleTableFooter,
|
|
51
|
+
SimpleTableColumn,
|
|
52
|
+
SimpleTableRow,
|
|
53
|
+
SimpleTableCell
|
|
54
|
+
})
|
|
55
|
+
}), this);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { SimpleTable, SimpleTable as default };
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/collections/simple-table/index.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { SimpleTableHeader, type SimpleTableHeaderSignature } from './header';\nimport { SimpleTableBody, type SimpleTableBodySignature } from './body';\nimport { SimpleTableFooter, type SimpleTableFooterSignature } from './footer';\nimport { SimpleTableColumn, type SimpleTableColumnSignature } from './column';\nimport { SimpleTableRow, type SimpleTableRowSignature } from './row';\nimport { SimpleTableCell, type SimpleTableCellSignature } from './cell';\n\nimport type { TableVariants, TableSlots, SlotsToClasses } from '../table/types';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableSignature {\n Args: {\n /** Custom CSS classes for different table elements (wrapper, table, th, td, etc.) */\n classes?: SlotsToClasses<TableSlots>;\n /** Size variant for table cells and headers. @defaultValue 'md' */\n size?: TableVariants['size'];\n /** Table layout algorithm - 'auto' sizes columns by content, 'fixed' uses first row for sizing. @defaultValue 'auto' */\n layout?: TableVariants['layout'];\n /** Enable striped rows (alternating background colors) */\n isStriped?: TableVariants['striped'];\n /** Enable scrolling for the table container */\n isScrollable?: boolean;\n /** Whether to render the wrapper div. @defaultValue true */\n hasWrapper?: boolean;\n /** Enable loading state styling and behavior */\n isLoading?: boolean;\n /** Color variant for loading animation. @defaultValue 'default' */\n loadingColor?: TableVariants['loadingColor'];\n /** Color variant for selection highlight. @defaultValue 'primary' */\n selectionColor?: TableVariants['selectionColor'];\n /** Whether a custom loading block is provided (disables CSS loading indicator) */\n hasCustomLoading?: boolean;\n };\n Element: HTMLTableElement;\n Blocks: {\n default: [\n {\n Header: WithBoundArgs<\n ComponentLike<SimpleTableHeaderSignature>,\n 'styleFns' | 'classes'\n >;\n Body: WithBoundArgs<\n ComponentLike<SimpleTableBodySignature>,\n 'styleFns' | 'classes'\n >;\n Footer: WithBoundArgs<\n ComponentLike<SimpleTableFooterSignature>,\n 'styleFns' | 'classes'\n >;\n Column: WithBoundArgs<\n ComponentLike<SimpleTableColumnSignature>,\n 'styleFns'\n >;\n Row: WithBoundArgs<\n ComponentLike<SimpleTableRowSignature>,\n 'styleFns' | 'classes'\n >;\n Cell: WithBoundArgs<\n ComponentLike<SimpleTableCellSignature>,\n 'styleFns' | 'classes'\n >;\n }\n ];\n };\n}\n\nclass SimpleTable extends Component<SimpleTableSignature> {\n get hasWrapper() {\n return this.args.hasWrapper ?? true;\n }\n\n get styles() {\n const { table } = useStyles();\n return table({\n size: this.args.size,\n layout: this.args.layout,\n striped: this.args.isStriped,\n isScrollable: this.args.isScrollable || false,\n hasStickyHeader: false, // Will be determined by header component\n isLoading: this.args.hasCustomLoading\n ? false\n : this.args.isLoading || false,\n loadingColor: this.args.loadingColor,\n selectionColor: this.args.selectionColor,\n class: this.args.classes?.base\n });\n }\n\n get wrapperClassNames() {\n return this.styles.wrapper({\n class: this.args.classes?.wrapper\n });\n }\n\n get tableClassNames() {\n return this.styles.table({ class: this.args.classes?.table });\n }\n\n <template>\n {{#if this.hasWrapper}}\n <div class={{this.wrapperClassNames}} data-component=\"table-wrapper\">\n <table\n class={{this.tableClassNames}}\n data-test-id=\"table\"\n data-component=\"table\"\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n </div>\n {{else}}\n <table\n class={{this.tableClassNames}}\n data-test-id=\"table\"\n data-component=\"table\"\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n {{/if}}\n </template>\n}\n\nexport { SimpleTable, type SimpleTableSignature };\nexport default SimpleTable;\n"],"names":["SimpleTable","Component","hasWrapper","args","styles","table","useStyles","size","layout","striped","isStriped","isScrollable","hasStickyHeader","isLoading","hasCustomLoading","loadingColor","selectionColor","class","classes","base","wrapperClassNames","wrapper","tableClassNames","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableHeader","SimpleTableBody","SimpleTableFooter","SimpleTableColumn","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;;;;;AAqEA,MAAMA,oBAAoBC,SAAA,CAAU;EAClC,IAAIC,UAAAA,GAAa;AACf,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,UAAU,IAAI,IAAA;AACjC,EAAA;EAEA,IAAIE,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;AAClB,IAAA,OAAOD,KAAA,CAAM;AACXE,MAAAA,IAAA,EAAM,IAAI,CAACJ,IAAI,CAACI,IAAI;AACpBC,MAAAA,MAAA,EAAQ,IAAI,CAACL,IAAI,CAACK,MAAM;AACxBC,MAAAA,OAAA,EAAS,IAAI,CAACN,IAAI,CAACO,SAAS;AAC5BC,MAAAA,YAAA,EAAc,IAAI,CAACR,IAAI,CAACQ,YAAY,IAAI,KAAA;AACxCC,MAAAA,eAAA,EAAiB,KAAA;AACjBC,MAAAA,SAAA,EAAW,IAAI,CAACV,IAAI,CAACW,gBAAgB,GACjC,KAAA,GACA,IAAI,CAACX,IAAI,CAACU,SAAS,IAAI,KAAA;AAC3BE,MAAAA,YAAA,EAAc,IAAI,CAACZ,IAAI,CAACY,YAAY;AACpCC,MAAAA,cAAA,EAAgB,IAAI,CAACb,IAAI,CAACa,cAAc;AACxCC,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEC;AAC5B,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,iBAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAAChB,MAAM,CAACiB,OAAO,CAAC;AACzBJ,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEG;AAC5B,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,eAAAA,GAAkB;AACpB,IAAA,OAAO,IAAI,CAAClB,MAAM,CAACC,KAAK,CAAC;AAAEY,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEb;AAAM,KAAA,CAAA;AAC7D,EAAA;AAEA,EAAA;IAAAkB,oBAAA,CAAAC,kBAAA,CAAA,i7CAAA,EA8DA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,iBAAA;QAAAC,eAAA;QAAAC,iBAAA;QAAAC,iBAAA;QAAAC,cAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { useStyles, twMerge } from '@frontile/theme';
|
|
4
|
+
import { SimpleTableCell } from './cell.js';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
|
|
8
|
+
class SimpleTableRow extends Component {
|
|
9
|
+
get styles() {
|
|
10
|
+
return this.args.styleFns || useStyles().table();
|
|
11
|
+
}
|
|
12
|
+
get classNames() {
|
|
13
|
+
const options = {
|
|
14
|
+
isSticky: this.args.isSticky || false,
|
|
15
|
+
stickyPosition: this.args.isSticky ? 'top' : undefined,
|
|
16
|
+
hasStickyHeader: this.args.hasStickyHeader || false,
|
|
17
|
+
class: twMerge(this.args.class || '', this.args.classes?.tr || '')
|
|
18
|
+
};
|
|
19
|
+
return this.styles.tr(options);
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
setComponentTemplate(precompileTemplate("<tr class={{this.classNames}} data-test-id=\"table-row\" data-component=\"table-row\" ...attributes>\n {{yield (hash Cell=(component SimpleTableCell styleFns=this.styles classes=@classes))}}\n</tr>", {
|
|
23
|
+
strictMode: true,
|
|
24
|
+
scope: () => ({
|
|
25
|
+
hash,
|
|
26
|
+
SimpleTableCell
|
|
27
|
+
})
|
|
28
|
+
}), this);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { SimpleTableRow, SimpleTableRow as default };
|
|
33
|
+
//# sourceMappingURL=row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.js","sources":["../../../../src/components/collections/simple-table/row.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableCell } from './cell';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableRowSignature {\n Args: {\n /** Additional CSS class to apply to the row */\n class?: string;\n /** Whether this row should be sticky during vertical scrolling */\n isSticky?: boolean;\n /** Whether the table has a sticky header (affects positioning of sticky rows) */\n hasStickyHeader?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableRowElement;\n Blocks: {\n default: [\n {\n Cell: WithBoundArgs<typeof SimpleTableCell, 'styleFns' | 'classes'>;\n }\n ];\n };\n}\n\nclass SimpleTableRow extends Component<SimpleTableRowSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('top' as const) : undefined,\n hasStickyHeader: this.args.hasStickyHeader || false,\n class: twMerge(this.args.class || '', this.args.classes?.tr || '')\n };\n\n return this.styles.tr(options);\n }\n\n <template>\n <tr\n class={{this.classNames}}\n data-test-id=\"table-row\"\n data-component=\"table-row\"\n ...attributes\n >\n {{yield\n (hash\n Cell=(component SimpleTableCell styleFns=this.styles classes=@classes)\n )\n }}\n </tr>\n </template>\n}\n\nexport { SimpleTableRow, type SimpleTableRowSignature };\nexport default SimpleTableRow;\n"],"names":["SimpleTableRow","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","hasStickyHeader","class","twMerge","classes","tr","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableCell"],"mappings":";;;;;;;AAoCA,MAAMA,uBAAuBC,SAAA,CAAU;EACrC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;MAChCC,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAAI,QAAkBE,SAAA;AACxDC,MAAAA,eAAA,EAAiB,IAAI,CAACT,IAAI,CAACS,eAAe,IAAI,KAAA;AAC9CC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACX,IAAI,CAACU,KAAK,IAAI,EAAA,EAAI,IAAI,CAACV,IAAI,CAACY,OAAO,EAAEC,EAAA,IAAM,EAAA;KACjE;AAEA,IAAA,OAAO,IAAI,CAACd,MAAM,CAACc,EAAE,CAACR,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,wMAAA,EAaA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Default/fallback rendering component for table cells. Only renders its content
|
|
7
|
+
* when no CellForComponent has claimed the current column key.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* ```hbs
|
|
11
|
+
* <c.Default>
|
|
12
|
+
* Default: {{c.value}}
|
|
13
|
+
* </c.Default>
|
|
14
|
+
*
|
|
15
|
+
* <!-- Or with explicit exclusions -->
|
|
16
|
+
* <c.Default @except={{array "status" "actions"}}>
|
|
17
|
+
* {{c.value}}
|
|
18
|
+
* </c.Default>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
class CellDefaultComponent extends Component {
|
|
22
|
+
get shouldRender() {
|
|
23
|
+
const currentKey = this.args.column.key;
|
|
24
|
+
// Check explicit exclusions first
|
|
25
|
+
if (this.args.except?.includes(currentKey)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
// Check if any CellForComponent has claimed this key
|
|
29
|
+
return !this.args.registry.isKeyClaimed(currentKey);
|
|
30
|
+
}
|
|
31
|
+
static {
|
|
32
|
+
setComponentTemplate(precompileTemplate("{{#if this.shouldRender}}\n {{yield}}\n{{/if}}", {
|
|
33
|
+
strictMode: true
|
|
34
|
+
}), this);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { CellDefaultComponent as default };
|
|
39
|
+
//# sourceMappingURL=cell-default.js.map
|