@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,388 @@
|
|
|
1
|
+
import "./listbox.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 { hash } from '@ember/helper';
|
|
8
|
+
import { eq } from 'ember-truth-helpers';
|
|
9
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
10
|
+
import { setComponentTemplate } from '@ember/component';
|
|
11
|
+
import { g, i } from 'decorator-transforms/runtime';
|
|
12
|
+
|
|
13
|
+
;
|
|
14
|
+
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Sub-components
|
|
17
|
+
// ============================================================================
|
|
18
|
+
class ListboxOptionComponent extends Component {
|
|
19
|
+
handleClick = () => {
|
|
20
|
+
if (!this.args.disabled) {
|
|
21
|
+
this.args.onselect?.(this.args.value);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
handleMouseEnter = () => {
|
|
25
|
+
if (!this.args.disabled) {
|
|
26
|
+
this.args.onhover?.(this.args.value);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
static {
|
|
30
|
+
setComponentTemplate(precompileTemplate("<div role=\"option\" id={{@id}} class=\"listbox-option_efb584ef0\" aria-selected={{if @selected \"true\" \"false\"}} aria-disabled={{if @disabled \"true\"}} data-selected={{if @selected \"true\" \"false\"}} data-focused={{if @focused \"true\" \"false\"}} data-disabled={{if @disabled \"true\" \"false\"}} data-test-listbox-option data-test-listbox-option-value={{@value}} {{on \"click\" this.handleClick}} {{on \"mouseenter\" this.handleMouseEnter}} ...attributes>\n {{yield}}\n</div>", {
|
|
31
|
+
strictMode: true,
|
|
32
|
+
scope: () => ({
|
|
33
|
+
on
|
|
34
|
+
})
|
|
35
|
+
}), this);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
class ListboxGroupComponent extends Component {
|
|
39
|
+
labelId = `${guidFor(this)}-label`;
|
|
40
|
+
static {
|
|
41
|
+
setComponentTemplate(precompileTemplate("<div role=\"group\" aria-labelledby={{this.labelId}} class=\"listbox-group_efb584ef0\" data-test-listbox-group ...attributes>\n <div role=\"presentation\" id={{this.labelId}} class=\"listbox-group-label_efb584ef0\" data-test-listbox-group-label>\n {{@label}}\n </div>\n {{yield}}\n</div>", {
|
|
42
|
+
strictMode: true
|
|
43
|
+
}), this);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class ListboxGroupLabelComponent extends Component {
|
|
47
|
+
// Explicit role as presentation element
|
|
48
|
+
get role() {
|
|
49
|
+
return 'presentation';
|
|
50
|
+
}
|
|
51
|
+
static {
|
|
52
|
+
setComponentTemplate(precompileTemplate("<div role={{this.role}} class=\"listbox-group-label_efb584ef0\" data-test-listbox-group-label ...attributes>\n {{yield}}\n</div>", {
|
|
53
|
+
strictMode: true
|
|
54
|
+
}), this);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
class ListboxEmptyComponent extends Component {
|
|
58
|
+
// Semantic class name for empty state
|
|
59
|
+
get className() {
|
|
60
|
+
return 'listbox-empty';
|
|
61
|
+
}
|
|
62
|
+
static {
|
|
63
|
+
setComponentTemplate(precompileTemplate("<div class={{this.className}} data-test-listbox-empty ...attributes>\n {{yield}}\n</div>", {
|
|
64
|
+
strictMode: true
|
|
65
|
+
}), this);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// ============================================================================
|
|
69
|
+
// Main Component
|
|
70
|
+
// ============================================================================
|
|
71
|
+
|
|
72
|
+
class Listbox extends Component {
|
|
73
|
+
static {
|
|
74
|
+
g(this.prototype, "focusedValue", [tracked], function () {
|
|
75
|
+
return null;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
#focusedValue = (i(this, "focusedValue"), void 0);
|
|
79
|
+
static {
|
|
80
|
+
g(this.prototype, "typeaheadBuffer", [tracked], function () {
|
|
81
|
+
return '';
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
#typeaheadBuffer = (i(this, "typeaheadBuffer"), void 0);
|
|
85
|
+
typeaheadTimeout = null;
|
|
86
|
+
elementRef = null;
|
|
87
|
+
// ============================================================================
|
|
88
|
+
// Lifecycle
|
|
89
|
+
// ============================================================================
|
|
90
|
+
willDestroy() {
|
|
91
|
+
super.willDestroy();
|
|
92
|
+
if (this.typeaheadTimeout) {
|
|
93
|
+
clearTimeout(this.typeaheadTimeout);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// ============================================================================
|
|
97
|
+
// Computed Properties
|
|
98
|
+
// ============================================================================
|
|
99
|
+
get componentId() {
|
|
100
|
+
return guidFor(this);
|
|
101
|
+
}
|
|
102
|
+
get mode() {
|
|
103
|
+
return this.args.mode ?? 'single';
|
|
104
|
+
}
|
|
105
|
+
get selectedValue() {
|
|
106
|
+
if (this.mode === 'multiple') {
|
|
107
|
+
return this.args.value ?? [];
|
|
108
|
+
}
|
|
109
|
+
return this.args.value ?? '';
|
|
110
|
+
}
|
|
111
|
+
get loop() {
|
|
112
|
+
return this.args.loop ?? false;
|
|
113
|
+
}
|
|
114
|
+
get typeaheadEnabled() {
|
|
115
|
+
return this.args.typeahead ?? true;
|
|
116
|
+
}
|
|
117
|
+
get typeaheadTimeoutMs() {
|
|
118
|
+
return this.args.typeaheadTimeout ?? 500;
|
|
119
|
+
}
|
|
120
|
+
get focusOnHover() {
|
|
121
|
+
return this.args.focusOnHover ?? true;
|
|
122
|
+
}
|
|
123
|
+
/** Normalize options to consistent format */
|
|
124
|
+
get normalizedOptions() {
|
|
125
|
+
const options = this.args.options ?? [];
|
|
126
|
+
return options.map(option => {
|
|
127
|
+
if (typeof option === 'string') {
|
|
128
|
+
return {
|
|
129
|
+
value: option,
|
|
130
|
+
label: option,
|
|
131
|
+
disabled: false
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const getValue = this.args.getOptionValue ?? (o => o.value);
|
|
135
|
+
const getLabel = this.args.getOptionLabel ?? (o => o.label);
|
|
136
|
+
const isDisabled = this.args.isOptionDisabled ?? (o => o.disabled ?? false);
|
|
137
|
+
const getGroup = this.args.groupBy;
|
|
138
|
+
return {
|
|
139
|
+
value: getValue(option),
|
|
140
|
+
label: getLabel(option),
|
|
141
|
+
disabled: isDisabled(option),
|
|
142
|
+
group: getGroup ? getGroup(option) : undefined
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/** Get enabled (non-disabled) options for navigation */
|
|
147
|
+
get enabledOptions() {
|
|
148
|
+
return this.normalizedOptions.filter(opt => !opt.disabled);
|
|
149
|
+
}
|
|
150
|
+
/** Group options by group key */
|
|
151
|
+
get groupedOptions() {
|
|
152
|
+
const groups = new Map();
|
|
153
|
+
for (const option of this.normalizedOptions) {
|
|
154
|
+
const groupKey = option.group ?? null;
|
|
155
|
+
const existing = groups.get(groupKey) ?? [];
|
|
156
|
+
existing.push(option);
|
|
157
|
+
groups.set(groupKey, existing);
|
|
158
|
+
}
|
|
159
|
+
const result = [];
|
|
160
|
+
for (const [group, options] of groups) {
|
|
161
|
+
result.push({
|
|
162
|
+
group,
|
|
163
|
+
options
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
get hasGroups() {
|
|
169
|
+
return this.groupedOptions.some(g => g.group !== null);
|
|
170
|
+
}
|
|
171
|
+
get isEmpty() {
|
|
172
|
+
return this.normalizedOptions.length === 0;
|
|
173
|
+
}
|
|
174
|
+
get activedescendant() {
|
|
175
|
+
if (this.focusedValue) {
|
|
176
|
+
return this.getOptionId(this.focusedValue);
|
|
177
|
+
}
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
get tabIndex() {
|
|
181
|
+
return this.args.isDisabled ? -1 : 0;
|
|
182
|
+
}
|
|
183
|
+
// ============================================================================
|
|
184
|
+
// Methods
|
|
185
|
+
// ============================================================================
|
|
186
|
+
getOptionId = value => {
|
|
187
|
+
// Sanitize value to ensure valid HTML ID (replace non-alphanumeric chars)
|
|
188
|
+
const sanitizedValue = value.replace(/[^a-zA-Z0-9-_]/g, '_');
|
|
189
|
+
return `${this.componentId}-option-${sanitizedValue}`;
|
|
190
|
+
};
|
|
191
|
+
getGroupId = groupName => {
|
|
192
|
+
// Sanitize group name to ensure valid HTML ID (replace non-alphanumeric chars)
|
|
193
|
+
const sanitizedGroup = groupName.replace(/[^a-zA-Z0-9-_]/g, '_');
|
|
194
|
+
return `${this.componentId}-group-${sanitizedGroup}`;
|
|
195
|
+
};
|
|
196
|
+
isSelected = value => {
|
|
197
|
+
if (this.mode === 'multiple') {
|
|
198
|
+
const selected = this.selectedValue;
|
|
199
|
+
return selected.includes(value);
|
|
200
|
+
}
|
|
201
|
+
return this.selectedValue === value;
|
|
202
|
+
};
|
|
203
|
+
isFocused = value => {
|
|
204
|
+
return this.focusedValue === value;
|
|
205
|
+
};
|
|
206
|
+
selectValue = value => {
|
|
207
|
+
const option = this.normalizedOptions.find(o => o.value === value);
|
|
208
|
+
if (!option || option.disabled) return;
|
|
209
|
+
this.args.onSelect?.(value);
|
|
210
|
+
if (this.mode === 'multiple') {
|
|
211
|
+
const current = this.selectedValue.slice();
|
|
212
|
+
const index = current.indexOf(value);
|
|
213
|
+
let newValue;
|
|
214
|
+
if (index >= 0) {
|
|
215
|
+
// Remove if already selected (toggle)
|
|
216
|
+
current.splice(index, 1);
|
|
217
|
+
newValue = current;
|
|
218
|
+
} else {
|
|
219
|
+
// Add to selection
|
|
220
|
+
newValue = [...current, value];
|
|
221
|
+
}
|
|
222
|
+
this.args.onChange?.(newValue);
|
|
223
|
+
} else {
|
|
224
|
+
this.args.onChange?.(value);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
moveFocus(direction) {
|
|
228
|
+
const enabled = this.enabledOptions;
|
|
229
|
+
if (enabled.length === 0) return;
|
|
230
|
+
const currentIndex = this.focusedValue ? enabled.findIndex(o => o.value === this.focusedValue) : -1;
|
|
231
|
+
let newIndex;
|
|
232
|
+
switch (direction) {
|
|
233
|
+
case 'first':
|
|
234
|
+
newIndex = 0;
|
|
235
|
+
break;
|
|
236
|
+
case 'last':
|
|
237
|
+
newIndex = enabled.length - 1;
|
|
238
|
+
break;
|
|
239
|
+
case 'next':
|
|
240
|
+
if (currentIndex < 0) {
|
|
241
|
+
newIndex = 0;
|
|
242
|
+
} else if (currentIndex >= enabled.length - 1) {
|
|
243
|
+
newIndex = this.loop ? 0 : enabled.length - 1;
|
|
244
|
+
} else {
|
|
245
|
+
newIndex = currentIndex + 1;
|
|
246
|
+
}
|
|
247
|
+
break;
|
|
248
|
+
case 'prev':
|
|
249
|
+
if (currentIndex < 0) {
|
|
250
|
+
newIndex = enabled.length - 1;
|
|
251
|
+
} else if (currentIndex <= 0) {
|
|
252
|
+
newIndex = this.loop ? enabled.length - 1 : 0;
|
|
253
|
+
} else {
|
|
254
|
+
newIndex = currentIndex - 1;
|
|
255
|
+
}
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
const newOption = enabled[newIndex];
|
|
259
|
+
if (newOption) {
|
|
260
|
+
this.setFocusedValue(newOption.value);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
setFocusedValue(value) {
|
|
264
|
+
this.focusedValue = value;
|
|
265
|
+
this.args.onFocusChange?.(value);
|
|
266
|
+
// Scroll the focused option into view
|
|
267
|
+
if (value) {
|
|
268
|
+
const optionId = this.getOptionId(value);
|
|
269
|
+
const optionElement = document.getElementById(optionId);
|
|
270
|
+
optionElement?.scrollIntoView({
|
|
271
|
+
block: 'nearest'
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
handleTypeahead(char) {
|
|
276
|
+
if (!this.typeaheadEnabled) return;
|
|
277
|
+
// Clear existing timeout
|
|
278
|
+
if (this.typeaheadTimeout) {
|
|
279
|
+
clearTimeout(this.typeaheadTimeout);
|
|
280
|
+
}
|
|
281
|
+
// Append character to buffer
|
|
282
|
+
this.typeaheadBuffer += char.toLowerCase();
|
|
283
|
+
// Find matching option
|
|
284
|
+
const match = this.enabledOptions.find(option => option.label.toLowerCase().startsWith(this.typeaheadBuffer));
|
|
285
|
+
if (match) {
|
|
286
|
+
this.setFocusedValue(match.value);
|
|
287
|
+
}
|
|
288
|
+
// Set timeout to clear buffer
|
|
289
|
+
this.typeaheadTimeout = setTimeout(() => {
|
|
290
|
+
this.typeaheadBuffer = '';
|
|
291
|
+
this.typeaheadTimeout = null;
|
|
292
|
+
}, this.typeaheadTimeoutMs);
|
|
293
|
+
}
|
|
294
|
+
// ============================================================================
|
|
295
|
+
// Event Handlers
|
|
296
|
+
// ============================================================================
|
|
297
|
+
handleKeyDown = event => {
|
|
298
|
+
if (this.args.isDisabled) return;
|
|
299
|
+
switch (event.key) {
|
|
300
|
+
case 'ArrowDown':
|
|
301
|
+
event.preventDefault();
|
|
302
|
+
this.moveFocus('next');
|
|
303
|
+
break;
|
|
304
|
+
case 'ArrowUp':
|
|
305
|
+
event.preventDefault();
|
|
306
|
+
this.moveFocus('prev');
|
|
307
|
+
break;
|
|
308
|
+
case 'Home':
|
|
309
|
+
event.preventDefault();
|
|
310
|
+
this.moveFocus('first');
|
|
311
|
+
break;
|
|
312
|
+
case 'End':
|
|
313
|
+
event.preventDefault();
|
|
314
|
+
this.moveFocus('last');
|
|
315
|
+
break;
|
|
316
|
+
case 'Enter':
|
|
317
|
+
case ' ':
|
|
318
|
+
event.preventDefault();
|
|
319
|
+
if (this.focusedValue) {
|
|
320
|
+
this.selectValue(this.focusedValue);
|
|
321
|
+
}
|
|
322
|
+
break;
|
|
323
|
+
default:
|
|
324
|
+
// Typeahead: single printable character
|
|
325
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
326
|
+
this.handleTypeahead(event.key);
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
handleFocus = () => {
|
|
332
|
+
// Focus first selected option, or first enabled option
|
|
333
|
+
if (!this.focusedValue) {
|
|
334
|
+
if (this.mode === 'single' && this.selectedValue) {
|
|
335
|
+
this.setFocusedValue(this.selectedValue);
|
|
336
|
+
} else if (this.mode === 'multiple') {
|
|
337
|
+
const selected = this.selectedValue;
|
|
338
|
+
if (selected.length > 0) {
|
|
339
|
+
this.setFocusedValue(selected[0]);
|
|
340
|
+
} else if (this.enabledOptions.length > 0) {
|
|
341
|
+
this.setFocusedValue(this.enabledOptions[0].value);
|
|
342
|
+
}
|
|
343
|
+
} else if (this.enabledOptions.length > 0) {
|
|
344
|
+
this.setFocusedValue(this.enabledOptions[0].value);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
handleBlur = () => {
|
|
349
|
+
this.setFocusedValue(null);
|
|
350
|
+
};
|
|
351
|
+
handleOptionMouseEnter = value => {
|
|
352
|
+
if (this.focusOnHover && !this.args.isDisabled) {
|
|
353
|
+
this.setFocusedValue(value);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
// ============================================================================
|
|
357
|
+
// Modifiers
|
|
358
|
+
// ============================================================================
|
|
359
|
+
setupRef = modifier(element => {
|
|
360
|
+
this.elementRef = element;
|
|
361
|
+
if (this.args.autoFocus) {
|
|
362
|
+
element.focus();
|
|
363
|
+
}
|
|
364
|
+
return () => {
|
|
365
|
+
this.elementRef = null;
|
|
366
|
+
};
|
|
367
|
+
});
|
|
368
|
+
// ============================================================================
|
|
369
|
+
// Template
|
|
370
|
+
// ============================================================================
|
|
371
|
+
static {
|
|
372
|
+
setComponentTemplate(precompileTemplate("{{!-- tabindex=\"0\" is required for focusable listbox, -1 when disabled --}}\n{{!-- template-lint-disable no-positive-tabindex require-aria-activedescendant-tabindex --}}\n<div role=\"listbox\" tabindex={{this.tabIndex}} class=\"listbox_efb584ef0\" aria-multiselectable={{if (eq this.mode \"multiple\") \"true\"}} aria-activedescendant={{this.activedescendant}} aria-disabled={{if @isDisabled \"true\"}} data-disabled={{if @isDisabled \"true\" \"false\"}} data-test-listbox {{this.setupRef}} {{on \"keydown\" this.handleKeyDown}} {{on \"focus\" this.handleFocus}} {{on \"blur\" this.handleBlur}} ...attributes>\n {{#if (has-block)}}\n {{yield (hash option=ListboxOptionComponent group=ListboxGroupComponent groupLabel=ListboxGroupLabelComponent empty=ListboxEmptyComponent isSelected=this.isSelected isFocused=this.isFocused focusedValue=this.focusedValue select=this.selectValue getOptionId=this.getOptionId onOptionMouseEnter=this.handleOptionMouseEnter)}}\n {{else if this.isEmpty}}\n {{#if (has-block \"empty\")}}\n {{yield to=\"empty\"}}\n {{else}}\n <div class=\"listbox-empty_efb584ef0\" data-test-listbox-empty>\n No options available\n </div>\n {{/if}}\n {{else if this.hasGroups}}\n {{#each this.groupedOptions as |group|}}\n {{#if group.group}}\n <div role=\"group\" aria-labelledby={{this.getGroupId group.group}} class=\"listbox-group_efb584ef0\" data-test-listbox-group>\n <div role=\"presentation\" id={{this.getGroupId group.group}} class=\"listbox-group-label_efb584ef0\" data-test-listbox-group-label>\n {{group.group}}\n </div>\n {{#each group.options as |option|}}\n <ListboxOptionComponent @value={{option.value}} @disabled={{option.disabled}} @selected={{this.isSelected option.value}} @focused={{this.isFocused option.value}} @id={{this.getOptionId option.value}} @onselect={{this.selectValue}} @onhover={{this.handleOptionMouseEnter}}>\n {{option.label}}\n </ListboxOptionComponent>\n {{/each}}\n </div>\n {{else}}\n {{#each group.options as |option|}}\n <ListboxOptionComponent @value={{option.value}} @disabled={{option.disabled}} @selected={{this.isSelected option.value}} @focused={{this.isFocused option.value}} @id={{this.getOptionId option.value}} @onselect={{this.selectValue}} @onhover={{this.handleOptionMouseEnter}}>\n {{option.label}}\n </ListboxOptionComponent>\n {{/each}}\n {{/if}}\n {{/each}}\n {{else}}\n {{#each this.normalizedOptions as |option|}}\n <ListboxOptionComponent @value={{option.value}} @disabled={{option.disabled}} @selected={{this.isSelected option.value}} @focused={{this.isFocused option.value}} @id={{this.getOptionId option.value}} @onselect={{this.selectValue}} @onhover={{this.handleOptionMouseEnter}}>\n {{option.label}}\n </ListboxOptionComponent>\n {{/each}}\n {{/if}}\n</div>", {
|
|
373
|
+
strictMode: true,
|
|
374
|
+
scope: () => ({
|
|
375
|
+
eq,
|
|
376
|
+
on,
|
|
377
|
+
hash,
|
|
378
|
+
ListboxOptionComponent,
|
|
379
|
+
ListboxGroupComponent,
|
|
380
|
+
ListboxGroupLabelComponent,
|
|
381
|
+
ListboxEmptyComponent
|
|
382
|
+
})
|
|
383
|
+
}), this);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export { Listbox as default };
|
|
388
|
+
//# sourceMappingURL=listbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listbox.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import "./money-field.css"
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { on } from '@ember/modifier';
|
|
6
|
+
import { array } from '@ember/helper';
|
|
7
|
+
import Control from './control.js';
|
|
8
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
|
+
import { setComponentTemplate } from '@ember/component';
|
|
10
|
+
import { g, i, n } from 'decorator-transforms/runtime';
|
|
11
|
+
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
const CURRENCY_CONFIG = {
|
|
15
|
+
GBP: {
|
|
16
|
+
symbol: '£',
|
|
17
|
+
decimals: 2,
|
|
18
|
+
position: 'prefix'
|
|
19
|
+
},
|
|
20
|
+
USD: {
|
|
21
|
+
symbol: '$',
|
|
22
|
+
decimals: 2,
|
|
23
|
+
position: 'prefix'
|
|
24
|
+
},
|
|
25
|
+
EUR: {
|
|
26
|
+
symbol: '€',
|
|
27
|
+
decimals: 2,
|
|
28
|
+
position: 'prefix'
|
|
29
|
+
},
|
|
30
|
+
JPY: {
|
|
31
|
+
symbol: '¥',
|
|
32
|
+
decimals: 0,
|
|
33
|
+
position: 'prefix'
|
|
34
|
+
},
|
|
35
|
+
CHF: {
|
|
36
|
+
symbol: 'CHF',
|
|
37
|
+
decimals: 2,
|
|
38
|
+
position: 'prefix'
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
class MoneyField extends Component {
|
|
42
|
+
static {
|
|
43
|
+
g(this.prototype, "internalDisplayValue", [tracked], function () {
|
|
44
|
+
return '';
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
#internalDisplayValue = (i(this, "internalDisplayValue"), void 0);
|
|
48
|
+
get currencyConfig() {
|
|
49
|
+
return CURRENCY_CONFIG[this.args.currency] ?? {
|
|
50
|
+
symbol: this.args.currency,
|
|
51
|
+
decimals: 2,
|
|
52
|
+
position: 'prefix'
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
get showCurrencySymbol() {
|
|
56
|
+
return this.args.showCurrencySymbol ?? true;
|
|
57
|
+
}
|
|
58
|
+
get currencyPosition() {
|
|
59
|
+
return this.args.currencyPosition ?? this.currencyConfig.position;
|
|
60
|
+
}
|
|
61
|
+
get currencySymbol() {
|
|
62
|
+
return this.currencyConfig.symbol;
|
|
63
|
+
}
|
|
64
|
+
get showPrefix() {
|
|
65
|
+
return this.showCurrencySymbol && this.currencyPosition === 'prefix';
|
|
66
|
+
}
|
|
67
|
+
get showSuffix() {
|
|
68
|
+
return this.showCurrencySymbol && this.currencyPosition === 'suffix';
|
|
69
|
+
}
|
|
70
|
+
get isLabelHidden() {
|
|
71
|
+
return this.args.labelVisibility === 'hidden';
|
|
72
|
+
}
|
|
73
|
+
get isInvalid() {
|
|
74
|
+
return !!this.args.error;
|
|
75
|
+
}
|
|
76
|
+
get isControlled() {
|
|
77
|
+
return this.args.value !== undefined;
|
|
78
|
+
}
|
|
79
|
+
get displayValue() {
|
|
80
|
+
if (this.isControlled) {
|
|
81
|
+
return this.formatMinorToDisplay(this.args.value);
|
|
82
|
+
}
|
|
83
|
+
return this.internalDisplayValue;
|
|
84
|
+
}
|
|
85
|
+
get placeholder() {
|
|
86
|
+
if (this.args.placeholder) {
|
|
87
|
+
return this.args.placeholder;
|
|
88
|
+
}
|
|
89
|
+
const {
|
|
90
|
+
decimals
|
|
91
|
+
} = this.currencyConfig;
|
|
92
|
+
if (decimals === 0) {
|
|
93
|
+
return '0';
|
|
94
|
+
}
|
|
95
|
+
return `0.${'0'.repeat(decimals)}`;
|
|
96
|
+
}
|
|
97
|
+
formatMinorToDisplay(minorUnits) {
|
|
98
|
+
if (minorUnits === undefined || minorUnits === null) {
|
|
99
|
+
return '';
|
|
100
|
+
}
|
|
101
|
+
const {
|
|
102
|
+
decimals
|
|
103
|
+
} = this.currencyConfig;
|
|
104
|
+
if (decimals === 0) {
|
|
105
|
+
return String(minorUnits);
|
|
106
|
+
}
|
|
107
|
+
const majorUnits = minorUnits / Math.pow(10, decimals);
|
|
108
|
+
return majorUnits.toFixed(decimals);
|
|
109
|
+
}
|
|
110
|
+
parseDisplayToMinor(displayValue) {
|
|
111
|
+
if (!displayValue || displayValue.trim() === '') {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
const {
|
|
115
|
+
decimals
|
|
116
|
+
} = this.currencyConfig;
|
|
117
|
+
const parsed = parseFloat(displayValue);
|
|
118
|
+
if (isNaN(parsed)) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return Math.round(parsed * Math.pow(10, decimals));
|
|
122
|
+
}
|
|
123
|
+
clampValue(value) {
|
|
124
|
+
const min = this.args.min ?? -Infinity;
|
|
125
|
+
const max = this.args.max ?? Infinity;
|
|
126
|
+
return Math.max(min, Math.min(max, value));
|
|
127
|
+
}
|
|
128
|
+
handleInput(event) {
|
|
129
|
+
const input = event.target;
|
|
130
|
+
const rawValue = input.value;
|
|
131
|
+
// Allow only valid characters for decimal input
|
|
132
|
+
const {
|
|
133
|
+
decimals
|
|
134
|
+
} = this.currencyConfig;
|
|
135
|
+
const validPattern = decimals > 0 ? /^-?\d*\.?\d*$/ : /^-?\d*$/;
|
|
136
|
+
if (!validPattern.test(rawValue)) {
|
|
137
|
+
// Revert to previous value if invalid characters
|
|
138
|
+
input.value = this.displayValue;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
// Check decimal places
|
|
142
|
+
if (decimals > 0 && rawValue.includes('.')) {
|
|
143
|
+
const parts = rawValue.split('.');
|
|
144
|
+
if (parts[1] && parts[1].length > decimals) {
|
|
145
|
+
input.value = this.displayValue;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!this.isControlled) {
|
|
150
|
+
this.internalDisplayValue = rawValue;
|
|
151
|
+
}
|
|
152
|
+
const minorValue = this.parseDisplayToMinor(rawValue);
|
|
153
|
+
this.args.onInput?.(minorValue, event);
|
|
154
|
+
}
|
|
155
|
+
static {
|
|
156
|
+
n(this.prototype, "handleInput", [action]);
|
|
157
|
+
}
|
|
158
|
+
handleBlur(event) {
|
|
159
|
+
const input = event.target;
|
|
160
|
+
const minorValue = this.parseDisplayToMinor(input.value);
|
|
161
|
+
if (minorValue !== null) {
|
|
162
|
+
const clampedValue = this.clampValue(minorValue);
|
|
163
|
+
const formattedDisplay = this.formatMinorToDisplay(clampedValue);
|
|
164
|
+
if (!this.isControlled) {
|
|
165
|
+
this.internalDisplayValue = formattedDisplay;
|
|
166
|
+
}
|
|
167
|
+
// Set DOM value directly for immediate visual feedback of formatted value.
|
|
168
|
+
// In controlled mode, the parent should update @value in response to onChange,
|
|
169
|
+
// which will sync the displayValue getter on the next render.
|
|
170
|
+
input.value = formattedDisplay;
|
|
171
|
+
this.args.onChange?.(clampedValue, event);
|
|
172
|
+
} else {
|
|
173
|
+
if (!this.isControlled) {
|
|
174
|
+
this.internalDisplayValue = '';
|
|
175
|
+
}
|
|
176
|
+
input.value = '';
|
|
177
|
+
this.args.onChange?.(null, event);
|
|
178
|
+
}
|
|
179
|
+
this.args.onBlur?.(event);
|
|
180
|
+
}
|
|
181
|
+
static {
|
|
182
|
+
n(this.prototype, "handleBlur", [action]);
|
|
183
|
+
}
|
|
184
|
+
handleFocus(event) {
|
|
185
|
+
this.args.onFocus?.(event);
|
|
186
|
+
}
|
|
187
|
+
static {
|
|
188
|
+
n(this.prototype, "handleFocus", [action]);
|
|
189
|
+
}
|
|
190
|
+
static {
|
|
191
|
+
setComponentTemplate(precompileTemplate("<Control @isInvalid={{this.isInvalid}} @isDisabled={{@isDisabled}} @isRequired={{@isRequired}} @isReadOnly={{@isReadOnly}} data-currency={{@currency}} data-test-money-field ...attributes as |ctrl|>\n <ctrl.Label @isVisuallyHidden={{this.isLabelHidden}}>\n {{@label}}\n </ctrl.Label>\n\n <ctrl.Input @prefix={{if this.showPrefix this.currencySymbol}} @suffix={{if this.showSuffix this.currencySymbol}} @inputMode=\"decimal\" @placeholder={{this.placeholder}} @name={{@name}} @value={{this.displayValue}} data-money-field {{on \"input\" this.handleInput}} {{on \"blur\" this.handleBlur}} {{on \"focus\" this.handleFocus}} />\n\n {{#if @helpText}}\n <ctrl.HelpText>{{@helpText}}</ctrl.HelpText>\n {{/if}}\n\n {{#if @error}}\n <ctrl.ErrorMessage @errors={{array @error}} />\n {{/if}}\n</Control>", {
|
|
192
|
+
strictMode: true,
|
|
193
|
+
scope: () => ({
|
|
194
|
+
Control,
|
|
195
|
+
on,
|
|
196
|
+
array
|
|
197
|
+
})
|
|
198
|
+
}), this);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export { MoneyField as default };
|
|
203
|
+
//# sourceMappingURL=money-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money-field.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|