@soybeanjs/headless 0.0.1-beta.3
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/README.md +143 -0
- package/dist/components/accordion/accordion-content.js +1 -0
- package/dist/components/accordion/accordion-content.vue.d.ts +19 -0
- package/dist/components/accordion/accordion-header.js +1 -0
- package/dist/components/accordion/accordion-header.vue.d.ts +18 -0
- package/dist/components/accordion/accordion-item.js +1 -0
- package/dist/components/accordion/accordion-item.vue.d.ts +23 -0
- package/dist/components/accordion/accordion-root.js +1 -0
- package/dist/components/accordion/accordion-root.vue.d.ts +23 -0
- package/dist/components/accordion/accordion-trigger.js +1 -0
- package/dist/components/accordion/accordion-trigger.vue.d.ts +19 -0
- package/dist/components/accordion/context.d.ts +10 -0
- package/dist/components/accordion/context.js +1 -0
- package/dist/components/accordion/index.d.ts +9 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/shared.js +1 -0
- package/dist/components/accordion/types.d.ts +53 -0
- package/dist/components/alert/alert-close.js +1 -0
- package/dist/components/alert/alert-close.vue.d.ts +18 -0
- package/dist/components/alert/alert-content.js +1 -0
- package/dist/components/alert/alert-content.vue.d.ts +18 -0
- package/dist/components/alert/alert-description.js +1 -0
- package/dist/components/alert/alert-description.vue.d.ts +18 -0
- package/dist/components/alert/alert-root.js +1 -0
- package/dist/components/alert/alert-root.vue.d.ts +24 -0
- package/dist/components/alert/alert-title.js +1 -0
- package/dist/components/alert/alert-title.vue.d.ts +18 -0
- package/dist/components/alert/context.d.ts +8 -0
- package/dist/components/alert/context.js +1 -0
- package/dist/components/alert/index.d.ts +8 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/alert/types.d.ts +28 -0
- package/dist/components/alert-dialog/alert-dialog-close.js +1 -0
- package/dist/components/alert-dialog/alert-dialog-close.vue.d.ts +19 -0
- package/dist/components/alert-dialog/alert-dialog-content.js +1 -0
- package/dist/components/alert-dialog/alert-dialog-content.vue.d.ts +35 -0
- package/dist/components/alert-dialog/alert-dialog-root.js +1 -0
- package/dist/components/alert-dialog/alert-dialog-root.vue.d.ts +28 -0
- package/dist/components/alert-dialog/context.js +1 -0
- package/dist/components/alert-dialog/index.d.ts +16 -0
- package/dist/components/alert-dialog/index.js +1 -0
- package/dist/components/alert-dialog/types.d.ts +7 -0
- package/dist/components/arrow/arrow.js +1 -0
- package/dist/components/arrow/arrow.vue.d.ts +24 -0
- package/dist/components/arrow/context.d.ts +8 -0
- package/dist/components/arrow/context.js +1 -0
- package/dist/components/arrow/index.d.ts +4 -0
- package/dist/components/arrow/index.js +1 -0
- package/dist/components/arrow/types.d.ts +20 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.vue.d.ts +22 -0
- package/dist/components/aspect-ratio/index.d.ts +3 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/aspect-ratio/types.d.ts +14 -0
- package/dist/components/avatar/avatar-fallback.js +1 -0
- package/dist/components/avatar/avatar-fallback.vue.d.ts +18 -0
- package/dist/components/avatar/avatar-image.js +1 -0
- package/dist/components/avatar/avatar-image.vue.d.ts +14 -0
- package/dist/components/avatar/avatar-root.js +1 -0
- package/dist/components/avatar/avatar-root.vue.d.ts +18 -0
- package/dist/components/avatar/context.d.ts +9 -0
- package/dist/components/avatar/context.js +1 -0
- package/dist/components/avatar/index.d.ts +6 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/avatar/types.d.ts +37 -0
- package/dist/components/badge/badge-content.js +1 -0
- package/dist/components/badge/badge-content.vue.d.ts +18 -0
- package/dist/components/badge/badge-root.js +1 -0
- package/dist/components/badge/badge-root.vue.d.ts +24 -0
- package/dist/components/badge/context.d.ts +6 -0
- package/dist/components/badge/context.js +1 -0
- package/dist/components/badge/index.d.ts +5 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/badge/types.d.ts +19 -0
- package/dist/components/breadcrumb/breadcrumb-ellipsis.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-ellipsis.vue.d.ts +18 -0
- package/dist/components/breadcrumb/breadcrumb-item.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-item.vue.d.ts +18 -0
- package/dist/components/breadcrumb/breadcrumb-link.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-link.vue.d.ts +18 -0
- package/dist/components/breadcrumb/breadcrumb-list.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-list.vue.d.ts +18 -0
- package/dist/components/breadcrumb/breadcrumb-page.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-page.vue.d.ts +18 -0
- package/dist/components/breadcrumb/breadcrumb-root.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-root.vue.d.ts +18 -0
- package/dist/components/breadcrumb/breadcrumb-separator.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-separator.vue.d.ts +18 -0
- package/dist/components/breadcrumb/context.d.ts +6 -0
- package/dist/components/breadcrumb/context.js +1 -0
- package/dist/components/breadcrumb/index.d.ts +10 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/breadcrumb/types.d.ts +20 -0
- package/dist/components/button/button.js +1 -0
- package/dist/components/button/button.vue.d.ts +26 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button/types.d.ts +12 -0
- package/dist/components/card/card-content.js +1 -0
- package/dist/components/card/card-content.vue.d.ts +18 -0
- package/dist/components/card/card-description.js +1 -0
- package/dist/components/card/card-description.vue.d.ts +18 -0
- package/dist/components/card/card-footer.js +1 -0
- package/dist/components/card/card-footer.vue.d.ts +18 -0
- package/dist/components/card/card-header.js +1 -0
- package/dist/components/card/card-header.vue.d.ts +18 -0
- package/dist/components/card/card-root.js +1 -0
- package/dist/components/card/card-root.vue.d.ts +18 -0
- package/dist/components/card/card-title-root.js +1 -0
- package/dist/components/card/card-title-root.vue.d.ts +18 -0
- package/dist/components/card/card-title.js +1 -0
- package/dist/components/card/card-title.vue.d.ts +18 -0
- package/dist/components/card/context.d.ts +6 -0
- package/dist/components/card/context.js +1 -0
- package/dist/components/card/index.d.ts +10 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/types.d.ts +19 -0
- package/dist/components/checkbox/checkbox-control.js +1 -0
- package/dist/components/checkbox/checkbox-control.vue.d.ts +23 -0
- package/dist/components/checkbox/checkbox-group-root.js +1 -0
- package/dist/components/checkbox/checkbox-group-root.vue.d.ts +23 -0
- package/dist/components/checkbox/checkbox-indicator.js +1 -0
- package/dist/components/checkbox/checkbox-indicator.vue.d.ts +22 -0
- package/dist/components/checkbox/checkbox-label.js +1 -0
- package/dist/components/checkbox/checkbox-label.vue.d.ts +19 -0
- package/dist/components/checkbox/checkbox-root.js +1 -0
- package/dist/components/checkbox/checkbox-root.vue.d.ts +31 -0
- package/dist/components/checkbox/context.d.ts +9 -0
- package/dist/components/checkbox/context.js +1 -0
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/types.d.ts +65 -0
- package/dist/components/collapsible/collapsible-content.js +1 -0
- package/dist/components/collapsible/collapsible-content.vue.d.ts +18 -0
- package/dist/components/collapsible/collapsible-root.js +1 -0
- package/dist/components/collapsible/collapsible-root.vue.d.ts +30 -0
- package/dist/components/collapsible/collapsible-trigger.js +1 -0
- package/dist/components/collapsible/collapsible-trigger.vue.d.ts +22 -0
- package/dist/components/collapsible/context.d.ts +9 -0
- package/dist/components/collapsible/context.js +1 -0
- package/dist/components/collapsible/index.d.ts +6 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/collapsible/shared.js +1 -0
- package/dist/components/collapsible/types.d.ts +34 -0
- package/dist/components/config-provider/config-provider.js +1 -0
- package/dist/components/config-provider/config-provider.vue.d.ts +27 -0
- package/dist/components/config-provider/context.js +1 -0
- package/dist/components/config-provider/index.d.ts +3 -0
- package/dist/components/config-provider/index.js +1 -0
- package/dist/components/config-provider/types.d.ts +47 -0
- package/dist/components/context-menu/context-menu-content.js +1 -0
- package/dist/components/context-menu/context-menu-content.vue.d.ts +38 -0
- package/dist/components/context-menu/context-menu-root.js +1 -0
- package/dist/components/context-menu/context-menu-root.vue.d.ts +27 -0
- package/dist/components/context-menu/context-menu-trigger.js +1 -0
- package/dist/components/context-menu/context-menu-trigger.vue.d.ts +23 -0
- package/dist/components/context-menu/context.js +1 -0
- package/dist/components/context-menu/index.d.ts +26 -0
- package/dist/components/context-menu/index.js +1 -0
- package/dist/components/context-menu/types.d.ts +18 -0
- package/dist/components/dialog/context.d.ts +10 -0
- package/dist/components/dialog/context.js +1 -0
- package/dist/components/dialog/dialog-close.js +1 -0
- package/dist/components/dialog/dialog-close.vue.d.ts +18 -0
- package/dist/components/dialog/dialog-content-impl.js +1 -0
- package/dist/components/dialog/dialog-content.js +1 -0
- package/dist/components/dialog/dialog-content.vue.d.ts +34 -0
- package/dist/components/dialog/dialog-description.js +1 -0
- package/dist/components/dialog/dialog-description.vue.d.ts +18 -0
- package/dist/components/dialog/dialog-footer.js +1 -0
- package/dist/components/dialog/dialog-footer.vue.d.ts +18 -0
- package/dist/components/dialog/dialog-header.js +1 -0
- package/dist/components/dialog/dialog-header.vue.d.ts +18 -0
- package/dist/components/dialog/dialog-overlay.js +1 -0
- package/dist/components/dialog/dialog-overlay.vue.d.ts +18 -0
- package/dist/components/dialog/dialog-root.js +1 -0
- package/dist/components/dialog/dialog-root.vue.d.ts +29 -0
- package/dist/components/dialog/dialog-title.js +1 -0
- package/dist/components/dialog/dialog-title.vue.d.ts +18 -0
- package/dist/components/dialog/dialog-trigger.js +1 -0
- package/dist/components/dialog/dialog-trigger.vue.d.ts +18 -0
- package/dist/components/dialog/index.d.ts +14 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/dialog/shared.js +1 -0
- package/dist/components/dialog/types.d.ts +50 -0
- package/dist/components/dropdown-menu/context.js +1 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.js +1 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.vue.d.ts +42 -0
- package/dist/components/dropdown-menu/dropdown-menu-root.js +1 -0
- package/dist/components/dropdown-menu/dropdown-menu-root.vue.d.ts +30 -0
- package/dist/components/dropdown-menu/dropdown-menu-trigger.js +1 -0
- package/dist/components/dropdown-menu/dropdown-menu-trigger.vue.d.ts +23 -0
- package/dist/components/dropdown-menu/index.d.ts +26 -0
- package/dist/components/dropdown-menu/index.js +1 -0
- package/dist/components/dropdown-menu/shared.js +1 -0
- package/dist/components/dropdown-menu/types.d.ts +33 -0
- package/dist/components/form/context.d.ts +7 -0
- package/dist/components/form/context.js +1 -0
- package/dist/components/form/form-description.js +1 -0
- package/dist/components/form/form-description.vue.d.ts +18 -0
- package/dist/components/form/form-error.js +1 -0
- package/dist/components/form/form-error.vue.d.ts +18 -0
- package/dist/components/form/form-field-array.js +1 -0
- package/dist/components/form/form-field-array.vue.d.ts +36 -0
- package/dist/components/form/form-field.js +1 -0
- package/dist/components/form/form-field.vue.d.ts +32 -0
- package/dist/components/form/form-label.js +1 -0
- package/dist/components/form/form-label.vue.d.ts +18 -0
- package/dist/components/form/index.d.ts +8 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/types.d.ts +22 -0
- package/dist/components/input/context.d.ts +6 -0
- package/dist/components/input/context.js +1 -0
- package/dist/components/input/index.d.ts +5 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/input-control.js +1 -0
- package/dist/components/input/input-control.vue.d.ts +8 -0
- package/dist/components/input/input-root.js +1 -0
- package/dist/components/input/input-root.vue.d.ts +27 -0
- package/dist/components/input/types.d.ts +41 -0
- package/dist/components/kbd/index.d.ts +3 -0
- package/dist/components/kbd/index.js +1 -0
- package/dist/components/kbd/kbd.js +1 -0
- package/dist/components/kbd/kbd.vue.d.ts +18 -0
- package/dist/components/kbd/types.d.ts +20 -0
- package/dist/components/label/index.d.ts +3 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/label/label.js +1 -0
- package/dist/components/label/label.vue.d.ts +18 -0
- package/dist/components/label/types.d.ts +9 -0
- package/dist/components/layout/context.d.ts +8 -0
- package/dist/components/layout/context.js +1 -0
- package/dist/components/layout/index.d.ts +12 -0
- package/dist/components/layout/index.js +1 -0
- package/dist/components/layout/layout-footer.js +1 -0
- package/dist/components/layout/layout-footer.vue.d.ts +18 -0
- package/dist/components/layout/layout-header.js +1 -0
- package/dist/components/layout/layout-header.vue.d.ts +18 -0
- package/dist/components/layout/layout-main.js +1 -0
- package/dist/components/layout/layout-main.vue.d.ts +18 -0
- package/dist/components/layout/layout-mobile.js +1 -0
- package/dist/components/layout/layout-mobile.vue.d.ts +18 -0
- package/dist/components/layout/layout-rail.js +1 -0
- package/dist/components/layout/layout-rail.vue.d.ts +18 -0
- package/dist/components/layout/layout-root.js +1 -0
- package/dist/components/layout/layout-root.vue.d.ts +33 -0
- package/dist/components/layout/layout-sidebar.js +1 -0
- package/dist/components/layout/layout-sidebar.vue.d.ts +20 -0
- package/dist/components/layout/layout-tab.js +1 -0
- package/dist/components/layout/layout-tab.vue.d.ts +18 -0
- package/dist/components/layout/layout-trigger.js +1 -0
- package/dist/components/layout/layout-trigger.vue.d.ts +20 -0
- package/dist/components/layout/shared.js +1 -0
- package/dist/components/layout/types.d.ts +75 -0
- package/dist/components/link/index.d.ts +3 -0
- package/dist/components/link/index.js +1 -0
- package/dist/components/link/link.js +1 -0
- package/dist/components/link/link.vue.d.ts +32 -0
- package/dist/components/link/types.d.ts +65 -0
- package/dist/components/list/context.d.ts +6 -0
- package/dist/components/list/context.js +1 -0
- package/dist/components/list/index.d.ts +8 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/list/list-content.js +1 -0
- package/dist/components/list/list-content.vue.d.ts +18 -0
- package/dist/components/list/list-description.js +1 -0
- package/dist/components/list/list-description.vue.d.ts +18 -0
- package/dist/components/list/list-item.js +1 -0
- package/dist/components/list/list-item.vue.d.ts +18 -0
- package/dist/components/list/list-root.js +1 -0
- package/dist/components/list/list-root.vue.d.ts +18 -0
- package/dist/components/list/list-title.js +1 -0
- package/dist/components/list/list-title.vue.d.ts +18 -0
- package/dist/components/list/types.d.ts +17 -0
- package/dist/components/listbox/context.d.ts +11 -0
- package/dist/components/listbox/context.js +1 -0
- package/dist/components/listbox/index.d.ts +11 -0
- package/dist/components/listbox/index.js +1 -0
- package/dist/components/listbox/listbox-content.js +1 -0
- package/dist/components/listbox/listbox-content.vue.d.ts +18 -0
- package/dist/components/listbox/listbox-filter.js +1 -0
- package/dist/components/listbox/listbox-filter.vue.d.ts +28 -0
- package/dist/components/listbox/listbox-group-label.js +1 -0
- package/dist/components/listbox/listbox-group-label.vue.d.ts +18 -0
- package/dist/components/listbox/listbox-group.js +1 -0
- package/dist/components/listbox/listbox-group.vue.d.ts +18 -0
- package/dist/components/listbox/listbox-item-indicator.js +1 -0
- package/dist/components/listbox/listbox-item-indicator.vue.d.ts +22 -0
- package/dist/components/listbox/listbox-item.js +1 -0
- package/dist/components/listbox/listbox-item.vue.d.ts +28 -0
- package/dist/components/listbox/listbox-root.js +1 -0
- package/dist/components/listbox/listbox-root.vue.d.ts +34 -0
- package/dist/components/listbox/listbox-virtualizer.js +1 -0
- package/dist/components/listbox/listbox-virtualizer.vue.d.ts +15 -0
- package/dist/components/listbox/shared.js +1 -0
- package/dist/components/listbox/types.d.ts +94 -0
- package/dist/components/menu/context.d.ts +10 -0
- package/dist/components/menu/context.js +1 -0
- package/dist/components/menu/index.d.ts +24 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/menu/menu-checkbox-group.js +1 -0
- package/dist/components/menu/menu-checkbox-group.vue.d.ts +25 -0
- package/dist/components/menu/menu-checkbox-item.js +1 -0
- package/dist/components/menu/menu-checkbox-item.vue.d.ts +28 -0
- package/dist/components/menu/menu-content-impl.js +1 -0
- package/dist/components/menu/menu-content.js +1 -0
- package/dist/components/menu/menu-content.vue.d.ts +37 -0
- package/dist/components/menu/menu-group-label.js +1 -0
- package/dist/components/menu/menu-group-label.vue.d.ts +18 -0
- package/dist/components/menu/menu-group.js +1 -0
- package/dist/components/menu/menu-group.vue.d.ts +18 -0
- package/dist/components/menu/menu-item-impl.js +1 -0
- package/dist/components/menu/menu-item-indicator.js +1 -0
- package/dist/components/menu/menu-item-indicator.vue.d.ts +22 -0
- package/dist/components/menu/menu-item.js +1 -0
- package/dist/components/menu/menu-item.vue.d.ts +22 -0
- package/dist/components/menu/menu-radio-group.js +1 -0
- package/dist/components/menu/menu-radio-group.vue.d.ts +25 -0
- package/dist/components/menu/menu-radio-item.js +1 -0
- package/dist/components/menu/menu-radio-item.vue.d.ts +24 -0
- package/dist/components/menu/menu-root.js +1 -0
- package/dist/components/menu/menu-root.vue.d.ts +27 -0
- package/dist/components/menu/menu-sub-content.js +1 -0
- package/dist/components/menu/menu-sub-content.vue.d.ts +39 -0
- package/dist/components/menu/menu-sub-trigger.js +1 -0
- package/dist/components/menu/menu-sub-trigger.vue.d.ts +18 -0
- package/dist/components/menu/menu-sub.js +1 -0
- package/dist/components/menu/menu-sub.vue.d.ts +24 -0
- package/dist/components/menu/shared.js +1 -0
- package/dist/components/menu/types.d.ts +116 -0
- package/dist/components/navigation-menu/context.d.ts +10 -0
- package/dist/components/navigation-menu/context.js +1 -0
- package/dist/components/navigation-menu/index.d.ts +12 -0
- package/dist/components/navigation-menu/index.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-content-impl.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-content.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-content.vue.d.ts +30 -0
- package/dist/components/navigation-menu/navigation-menu-indicator.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-indicator.vue.d.ts +18 -0
- package/dist/components/navigation-menu/navigation-menu-item.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-item.vue.d.ts +18 -0
- package/dist/components/navigation-menu/navigation-menu-link.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-link.vue.d.ts +26 -0
- package/dist/components/navigation-menu/navigation-menu-list.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-list.vue.d.ts +18 -0
- package/dist/components/navigation-menu/navigation-menu-root.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-root.vue.d.ts +31 -0
- package/dist/components/navigation-menu/navigation-menu-sub-list.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-sub-list.vue.d.ts +18 -0
- package/dist/components/navigation-menu/navigation-menu-trigger.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-trigger.vue.d.ts +22 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.js +1 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.vue.d.ts +22 -0
- package/dist/components/navigation-menu/shared.js +1 -0
- package/dist/components/navigation-menu/types.d.ts +100 -0
- package/dist/components/number-input/context.d.ts +9 -0
- package/dist/components/number-input/context.js +1 -0
- package/dist/components/number-input/index.d.ts +7 -0
- package/dist/components/number-input/index.js +1 -0
- package/dist/components/number-input/number-input-control.js +1 -0
- package/dist/components/number-input/number-input-control.vue.d.ts +8 -0
- package/dist/components/number-input/number-input-decrement.js +1 -0
- package/dist/components/number-input/number-input-decrement.vue.d.ts +22 -0
- package/dist/components/number-input/number-input-increment.js +1 -0
- package/dist/components/number-input/number-input-increment.vue.d.ts +22 -0
- package/dist/components/number-input/number-input-root.js +1 -0
- package/dist/components/number-input/number-input-root.vue.d.ts +29 -0
- package/dist/components/number-input/shared.js +1 -0
- package/dist/components/number-input/types.d.ts +50 -0
- package/dist/components/pagination/context.d.ts +8 -0
- package/dist/components/pagination/context.js +1 -0
- package/dist/components/pagination/index.d.ts +11 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/pagination-ellipsis.js +1 -0
- package/dist/components/pagination/pagination-ellipsis.vue.d.ts +18 -0
- package/dist/components/pagination/pagination-first.js +1 -0
- package/dist/components/pagination/pagination-first.vue.d.ts +18 -0
- package/dist/components/pagination/pagination-last.js +1 -0
- package/dist/components/pagination/pagination-last.vue.d.ts +18 -0
- package/dist/components/pagination/pagination-list-item.js +1 -0
- package/dist/components/pagination/pagination-list-item.vue.d.ts +18 -0
- package/dist/components/pagination/pagination-list.js +1 -0
- package/dist/components/pagination/pagination-list.vue.d.ts +20 -0
- package/dist/components/pagination/pagination-next.js +1 -0
- package/dist/components/pagination/pagination-next.vue.d.ts +18 -0
- package/dist/components/pagination/pagination-prev.js +1 -0
- package/dist/components/pagination/pagination-prev.vue.d.ts +18 -0
- package/dist/components/pagination/pagination-root.js +1 -0
- package/dist/components/pagination/pagination-root.vue.d.ts +30 -0
- package/dist/components/pagination/shared.js +1 -0
- package/dist/components/pagination/types.d.ts +50 -0
- package/dist/components/popover/context.js +1 -0
- package/dist/components/popover/index.d.ts +13 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover-anchor.js +1 -0
- package/dist/components/popover/popover-anchor.vue.d.ts +19 -0
- package/dist/components/popover/popover-close.js +1 -0
- package/dist/components/popover/popover-close.vue.d.ts +22 -0
- package/dist/components/popover/popover-content-impl.js +1 -0
- package/dist/components/popover/popover-content.js +1 -0
- package/dist/components/popover/popover-content.vue.d.ts +34 -0
- package/dist/components/popover/popover-root.js +1 -0
- package/dist/components/popover/popover-root.vue.d.ts +28 -0
- package/dist/components/popover/popover-trigger.js +1 -0
- package/dist/components/popover/popover-trigger.vue.d.ts +22 -0
- package/dist/components/popover/shared.js +1 -0
- package/dist/components/popover/types.d.ts +17 -0
- package/dist/components/popper/context.d.ts +21 -0
- package/dist/components/popper/context.js +1 -0
- package/dist/components/popper/index.d.ts +8 -0
- package/dist/components/popper/index.js +1 -0
- package/dist/components/popper/popper-anchor.js +1 -0
- package/dist/components/popper/popper-anchor.vue.d.ts +18 -0
- package/dist/components/popper/popper-arrow.js +1 -0
- package/dist/components/popper/popper-arrow.vue.d.ts +19 -0
- package/dist/components/popper/popper-content.js +1 -0
- package/dist/components/popper/popper-content.vue.d.ts +229 -0
- package/dist/components/popper/popper-root.js +1 -0
- package/dist/components/popper/popper-root.vue.d.ts +17 -0
- package/dist/components/popper/shared.js +1 -0
- package/dist/components/popper/types.d.ts +145 -0
- package/dist/components/portal/index.d.ts +3 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/portal/portal.js +1 -0
- package/dist/components/portal/portal.vue.d.ts +20 -0
- package/dist/components/portal/types.d.ts +26 -0
- package/dist/components/primitive/index.d.ts +3 -0
- package/dist/components/primitive/index.js +1 -0
- package/dist/components/primitive/primitive.d.ts +7 -0
- package/dist/components/primitive/primitive.js +1 -0
- package/dist/components/primitive/types.d.ts +16 -0
- package/dist/components/radio-group/context.d.ts +9 -0
- package/dist/components/radio-group/context.js +1 -0
- package/dist/components/radio-group/index.d.ts +9 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/radio-group/radio-group-control.js +1 -0
- package/dist/components/radio-group/radio-group-control.vue.d.ts +22 -0
- package/dist/components/radio-group/radio-group-indicator.js +1 -0
- package/dist/components/radio-group/radio-group-indicator.vue.d.ts +22 -0
- package/dist/components/radio-group/radio-group-item.js +1 -0
- package/dist/components/radio-group/radio-group-item.vue.d.ts +24 -0
- package/dist/components/radio-group/radio-group-label.js +1 -0
- package/dist/components/radio-group/radio-group-label.vue.d.ts +19 -0
- package/dist/components/radio-group/radio-group-root.js +1 -0
- package/dist/components/radio-group/radio-group-root.vue.d.ts +25 -0
- package/dist/components/radio-group/types.d.ts +55 -0
- package/dist/components/roving-focus/context.js +1 -0
- package/dist/components/roving-focus/index.d.ts +4 -0
- package/dist/components/roving-focus/index.js +1 -0
- package/dist/components/roving-focus/roving-focus-group.js +1 -0
- package/dist/components/roving-focus/roving-focus-group.vue.d.ts +34 -0
- package/dist/components/roving-focus/roving-focus-item.js +1 -0
- package/dist/components/roving-focus/roving-focus-item.vue.d.ts +20 -0
- package/dist/components/roving-focus/types.d.ts +49 -0
- package/dist/components/select/bubble-select.js +1 -0
- package/dist/components/select/context.d.ts +11 -0
- package/dist/components/select/context.js +1 -0
- package/dist/components/select/index.d.ts +21 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/select-arrow.js +1 -0
- package/dist/components/select/select-arrow.vue.d.ts +19 -0
- package/dist/components/select/select-content-impl.js +1 -0
- package/dist/components/select/select-content.js +1 -0
- package/dist/components/select/select-content.vue.d.ts +35 -0
- package/dist/components/select/select-group-label.js +1 -0
- package/dist/components/select/select-group-label.vue.d.ts +18 -0
- package/dist/components/select/select-group.js +1 -0
- package/dist/components/select/select-group.vue.d.ts +18 -0
- package/dist/components/select/select-item-aligned-position.js +1 -0
- package/dist/components/select/select-item-indicator.js +1 -0
- package/dist/components/select/select-item-indicator.vue.d.ts +22 -0
- package/dist/components/select/select-item-text.js +1 -0
- package/dist/components/select/select-item-text.vue.d.ts +18 -0
- package/dist/components/select/select-item.js +1 -0
- package/dist/components/select/select-item.vue.d.ts +24 -0
- package/dist/components/select/select-popper-position.js +1 -0
- package/dist/components/select/select-root.js +1 -0
- package/dist/components/select/select-root.vue.d.ts +27 -0
- package/dist/components/select/select-scroll-button-impl.js +1 -0
- package/dist/components/select/select-scroll-down-button.js +1 -0
- package/dist/components/select/select-scroll-down-button.vue.d.ts +18 -0
- package/dist/components/select/select-scroll-up-button.js +1 -0
- package/dist/components/select/select-scroll-up-button.vue.d.ts +18 -0
- package/dist/components/select/select-separator.js +1 -0
- package/dist/components/select/select-separator.vue.d.ts +18 -0
- package/dist/components/select/select-teleport-provider.js +1 -0
- package/dist/components/select/select-trigger-icon.js +1 -0
- package/dist/components/select/select-trigger-icon.vue.d.ts +18 -0
- package/dist/components/select/select-trigger.js +1 -0
- package/dist/components/select/select-trigger.vue.d.ts +22 -0
- package/dist/components/select/select-value.js +1 -0
- package/dist/components/select/select-value.vue.d.ts +26 -0
- package/dist/components/select/select-viewport.js +9 -0
- package/dist/components/select/select-viewport.vue.d.ts +18 -0
- package/dist/components/select/shared.js +1 -0
- package/dist/components/select/types.d.ts +104 -0
- package/dist/components/separator/context.d.ts +6 -0
- package/dist/components/separator/context.js +1 -0
- package/dist/components/separator/index.d.ts +5 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/separator/separator-label.js +1 -0
- package/dist/components/separator/separator-label.vue.d.ts +18 -0
- package/dist/components/separator/separator-root.js +1 -0
- package/dist/components/separator/separator-root.vue.d.ts +23 -0
- package/dist/components/separator/types.d.ts +26 -0
- package/dist/components/slot/index.d.ts +2 -0
- package/dist/components/slot/index.js +1 -0
- package/dist/components/slot/slot.d.ts +6 -0
- package/dist/components/slot/slot.js +1 -0
- package/dist/components/switch/context.d.ts +9 -0
- package/dist/components/switch/context.js +1 -0
- package/dist/components/switch/index.d.ts +6 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/switch-control.js +1 -0
- package/dist/components/switch/switch-control.vue.d.ts +22 -0
- package/dist/components/switch/switch-root.js +1 -0
- package/dist/components/switch/switch-root.vue.d.ts +25 -0
- package/dist/components/switch/switch-thumb.js +1 -0
- package/dist/components/switch/switch-thumb.vue.d.ts +22 -0
- package/dist/components/switch/types.d.ts +47 -0
- package/dist/components/tabs/context.d.ts +10 -0
- package/dist/components/tabs/context.js +1 -0
- package/dist/components/tabs/index.d.ts +8 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/shared.js +1 -0
- package/dist/components/tabs/tabs-content.js +1 -0
- package/dist/components/tabs/tabs-content.vue.d.ts +20 -0
- package/dist/components/tabs/tabs-indicator.js +1 -0
- package/dist/components/tabs/tabs-indicator.vue.d.ts +18 -0
- package/dist/components/tabs/tabs-list.js +1 -0
- package/dist/components/tabs/tabs-list.vue.d.ts +18 -0
- package/dist/components/tabs/tabs-root.js +1 -0
- package/dist/components/tabs/tabs-root.vue.d.ts +33 -0
- package/dist/components/tabs/tabs-trigger.js +1 -0
- package/dist/components/tabs/tabs-trigger.vue.d.ts +25 -0
- package/dist/components/tabs/types.d.ts +53 -0
- package/dist/components/tag/index.d.ts +3 -0
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/tag.js +1 -0
- package/dist/components/tag/tag.vue.d.ts +27 -0
- package/dist/components/tag/types.d.ts +11 -0
- package/dist/components/textarea/context.d.ts +6 -0
- package/dist/components/textarea/context.js +1 -0
- package/dist/components/textarea/index.d.ts +6 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/shared.js +1 -0
- package/dist/components/textarea/textarea-control.js +1 -0
- package/dist/components/textarea/textarea-control.vue.d.ts +8 -0
- package/dist/components/textarea/textarea-counter.js +1 -0
- package/dist/components/textarea/textarea-counter.vue.d.ts +21 -0
- package/dist/components/textarea/textarea-root.js +1 -0
- package/dist/components/textarea/textarea-root.vue.d.ts +27 -0
- package/dist/components/textarea/types.d.ts +48 -0
- package/dist/components/tooltip/context.js +1 -0
- package/dist/components/tooltip/index.d.ts +11 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/shared.js +1 -0
- package/dist/components/tooltip/tooltip-content-impl.js +1 -0
- package/dist/components/tooltip/tooltip-content.js +1 -0
- package/dist/components/tooltip/tooltip-content.vue.d.ts +26 -0
- package/dist/components/tooltip/tooltip-root.js +1 -0
- package/dist/components/tooltip/tooltip-root.vue.d.ts +27 -0
- package/dist/components/tooltip/tooltip-trigger.js +1 -0
- package/dist/components/tooltip/tooltip-trigger.vue.d.ts +23 -0
- package/dist/components/tooltip/types.d.ts +71 -0
- package/dist/components/tree/context.js +1 -0
- package/dist/components/tree/hooks.js +1 -0
- package/dist/components/tree/index.d.ts +6 -0
- package/dist/components/tree/index.js +1 -0
- package/dist/components/tree/shared.js +1 -0
- package/dist/components/tree/tree-item.js +1 -0
- package/dist/components/tree/tree-item.vue.d.ts +34 -0
- package/dist/components/tree/tree-root.js +1 -0
- package/dist/components/tree/tree-root.vue.d.ts +30 -0
- package/dist/components/tree/tree-virtualizer-item.js +1 -0
- package/dist/components/tree/tree-virtualizer-item.vue.d.ts +30 -0
- package/dist/components/tree/tree-virtualizer-root.js +1 -0
- package/dist/components/tree/tree-virtualizer-root.vue.d.ts +30 -0
- package/dist/components/tree/types.d.ts +101 -0
- package/dist/components/virtualizer/context.js +1 -0
- package/dist/components/virtualizer/index.d.ts +5 -0
- package/dist/components/virtualizer/index.js +1 -0
- package/dist/components/virtualizer/shared.js +1 -0
- package/dist/components/virtualizer/types.d.ts +27 -0
- package/dist/components/virtualizer/virtualizer-content.js +1 -0
- package/dist/components/virtualizer/virtualizer-content.vue.d.ts +20 -0
- package/dist/components/virtualizer/virtualizer-item.js +1 -0
- package/dist/components/virtualizer/virtualizer-item.vue.d.ts +18 -0
- package/dist/components/virtualizer/virtualizer-root.js +1 -0
- package/dist/components/virtualizer/virtualizer-root.vue.d.ts +23 -0
- package/dist/components/visually-hidden/index.d.ts +4 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/components/visually-hidden/types.d.ts +18 -0
- package/dist/components/visually-hidden/visually-hidden-input-bubble.js +1 -0
- package/dist/components/visually-hidden/visually-hidden-input.js +1 -0
- package/dist/components/visually-hidden/visually-hidden-input.vue.d.ts +17 -0
- package/dist/components/visually-hidden/visually-hidden.js +1 -0
- package/dist/components/visually-hidden/visually-hidden.vue.d.ts +23 -0
- package/dist/composables/index.d.ts +26 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-arrow-navigation.d.ts +71 -0
- package/dist/composables/use-arrow-navigation.js +1 -0
- package/dist/composables/use-body-scroll-lock.d.ts +9 -0
- package/dist/composables/use-body-scroll-lock.js +18 -0
- package/dist/composables/use-collection.d.ts +54 -0
- package/dist/composables/use-collection.js +1 -0
- package/dist/composables/use-context.d.ts +4 -0
- package/dist/composables/use-context.js +1 -0
- package/dist/composables/use-controllable-state.d.ts +6 -0
- package/dist/composables/use-controllable-state.js +1 -0
- package/dist/composables/use-direction.d.ts +9 -0
- package/dist/composables/use-direction.js +1 -0
- package/dist/composables/use-dismissable-layer.d.ts +60 -0
- package/dist/composables/use-dismissable-layer.js +1 -0
- package/dist/composables/use-escape-key-down.d.ts +6 -0
- package/dist/composables/use-escape-key-down.js +1 -0
- package/dist/composables/use-exposed-element.d.ts +9 -0
- package/dist/composables/use-exposed-element.js +1 -0
- package/dist/composables/use-focus-guards.d.ts +4 -0
- package/dist/composables/use-focus-guards.js +1 -0
- package/dist/composables/use-focus-scope.d.ts +29 -0
- package/dist/composables/use-focus-scope.js +1 -0
- package/dist/composables/use-forward-element.d.ts +14 -0
- package/dist/composables/use-forward-element.js +1 -0
- package/dist/composables/use-forward-listeners.d.ts +4 -0
- package/dist/composables/use-forward-listeners.js +1 -0
- package/dist/composables/use-grace-area.d.ts +39 -0
- package/dist/composables/use-grace-area.js +1 -0
- package/dist/composables/use-hide-others.d.ts +15 -0
- package/dist/composables/use-hide-others.js +1 -0
- package/dist/composables/use-image-loading-status.d.ts +20 -0
- package/dist/composables/use-image-loading-status.js +1 -0
- package/dist/composables/use-is-using-keyboard.d.ts +6 -0
- package/dist/composables/use-is-using-keyboard.js +1 -0
- package/dist/composables/use-kbd.d.ts +13 -0
- package/dist/composables/use-kbd.js +1 -0
- package/dist/composables/use-locale.d.ts +7 -0
- package/dist/composables/use-locale.js +1 -0
- package/dist/composables/use-nonce.d.ts +7 -0
- package/dist/composables/use-nonce.js +1 -0
- package/dist/composables/use-presence.d.ts +7 -0
- package/dist/composables/use-presence.js +1 -0
- package/dist/composables/use-props.d.ts +8 -0
- package/dist/composables/use-props.js +1 -0
- package/dist/composables/use-selection.d.ts +13 -0
- package/dist/composables/use-selection.js +1 -0
- package/dist/composables/use-state-machine.d.ts +14 -0
- package/dist/composables/use-state-machine.js +1 -0
- package/dist/composables/use-typeahead.d.ts +11 -0
- package/dist/composables/use-typeahead.js +1 -0
- package/dist/constants/attr.d.ts +5 -0
- package/dist/constants/attr.js +1 -0
- package/dist/constants/common.d.ts +11 -0
- package/dist/constants/common.js +1 -0
- package/dist/constants/components.d.ts +50 -0
- package/dist/constants/components.js +1 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +1 -0
- package/dist/forms/core/context.d.ts +21 -0
- package/dist/forms/core/context.js +1 -0
- package/dist/forms/core/hooks.d.ts +6 -0
- package/dist/forms/core/hooks.js +1 -0
- package/dist/forms/core/index.d.ts +3 -0
- package/dist/forms/core/shared.js +1 -0
- package/dist/forms/core/types.d.ts +88 -0
- package/dist/forms/index.d.ts +8 -0
- package/dist/forms/index.js +1 -0
- package/dist/forms/resolvers/index.d.ts +2 -0
- package/dist/forms/resolvers/valibot/index.d.ts +8 -0
- package/dist/forms/resolvers/valibot/index.js +1 -0
- package/dist/forms/resolvers/zod/index.d.ts +8 -0
- package/dist/forms/resolvers/zod/index.js +1 -0
- package/dist/index.d.ts +306 -0
- package/dist/index.js +1 -0
- package/dist/namespaced/index.d.ts +473 -0
- package/dist/namespaced/index.js +1 -0
- package/dist/nuxt/index.d.ts +11 -0
- package/dist/nuxt/index.js +1 -0
- package/dist/resolver/index.d.ts +18 -0
- package/dist/resolver/index.js +1 -0
- package/dist/shared/comparison.d.ts +15 -0
- package/dist/shared/comparison.js +1 -0
- package/dist/shared/dom.d.ts +19 -0
- package/dist/shared/dom.js +1 -0
- package/dist/shared/env.d.ts +7 -0
- package/dist/shared/env.js +1 -0
- package/dist/shared/event.d.ts +7 -0
- package/dist/shared/event.js +1 -0
- package/dist/shared/focus.d.ts +38 -0
- package/dist/shared/focus.js +1 -0
- package/dist/shared/form.d.ts +67 -0
- package/dist/shared/form.js +1 -0
- package/dist/shared/geometry.d.ts +39 -0
- package/dist/shared/geometry.js +1 -0
- package/dist/shared/guard.d.ts +51 -0
- package/dist/shared/guard.js +1 -0
- package/dist/shared/index.d.ts +13 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/object.d.ts +73 -0
- package/dist/shared/object.js +1 -0
- package/dist/shared/string.d.ts +50 -0
- package/dist/shared/string.js +1 -0
- package/dist/shared/value.d.ts +65 -0
- package/dist/shared/value.js +1 -0
- package/dist/shared/vue.d.ts +12 -0
- package/dist/shared/vue.js +1 -0
- package/dist/types/common.d.ts +57 -0
- package/dist/types/component.d.ts +58 -0
- package/dist/types/dom.d.ts +5 -0
- package/dist/types/event.d.ts +27 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/path.d.ts +12 -0
- package/dist/types/vue.d.ts +9 -0
- package/package.json +131 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VNode } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/shared/dom.d.ts
|
|
4
|
+
declare function removeLinks(items: HTMLElement[]): HTMLElement[];
|
|
5
|
+
declare function getActiveElement<T extends Element = HTMLElement>(): T | null;
|
|
6
|
+
declare function isElementHasAttribute(element: HTMLElement, attribute: string): boolean;
|
|
7
|
+
declare function getCollectionItemElements(element: HTMLElement): HTMLElement[];
|
|
8
|
+
declare function getAriaLabel(element?: HTMLElement | null, id?: string, ariaLabel?: string): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Extract text content from VNode for generating aria-label. Use iteration instead of recursion to avoid stack
|
|
11
|
+
* overflow.
|
|
12
|
+
*
|
|
13
|
+
* @param node VNode node
|
|
14
|
+
* @returns Extracted text content
|
|
15
|
+
*/
|
|
16
|
+
declare function getAriaLabelByVNode(node?: VNode | null): string;
|
|
17
|
+
declare function getAriaLabelByVNodeList(nodes?: VNode[] | null): string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { getActiveElement, getAriaLabel, getAriaLabelByVNode, getAriaLabelByVNodeList, getCollectionItemElements, isElementHasAttribute, removeLinks };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{COLLECTION_ITEM_ATTRIBUTE as e}from"../constants/attr.js";import{Comment as t}from"vue";function n(e){return e.filter(e=>e.tagName!==`A`)}function r(){let e=document.activeElement;if(e===null)return null;for(;e!==null&&e.shadowRoot!==null&&e.shadowRoot.activeElement!==null;)e=e.shadowRoot.activeElement;return e}function i(e,t){return[e.getAttribute(t),e.getAttribute(`data-${t}`)].some(e=>e===``||e===`true`)}function a(t){return Array.from(t.querySelectorAll(`[${e}]`))}function o(e,t,n){if(n)return n;if(!(!t||!e))return document.querySelector(`[for="${t}"]`)?.textContent??void 0}function s(e){if(!e)return``;let n=[],r=[e];for(;r.length>0;){let e=r.pop();if(e.type!==t){if(typeof e.children==`string`){let t=e.children.trim();t&&n.push(t);continue}if(Array.isArray(e.children))for(let t=e.children.length-1;t>=0;t--){let n=e.children[t];n&&typeof n==`object`&&`type`in n&&r.push(n)}}}return n.join(` `).replace(/\s+/g,` `).trim()}function c(e){return e?.length?e.map(e=>s(e)).join(` `).replace(/\s+/g,` `).trim():``}export{r as getActiveElement,o as getAriaLabel,s as getAriaLabelByVNode,c as getAriaLabelByVNodeList,a as getCollectionItemElements,i as isElementHasAttribute,n as removeLinks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=typeof document<`u`,t=typeof window<`u`&&typeof document<`u`;let n=null;function r(){return!t||!window?.navigator?.userAgent?!1:/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||window.navigator.maxTouchPoints>2&&/iPad|Macintosh/.test(window.navigator.userAgent)}function i(){return n===null&&(n=r()),n}function a(){return n=null,i()}export{e as isBrowser,t as isClient,i as isIOS,a as refreshIOSDetection};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/shared/event.d.ts
|
|
2
|
+
declare function handleAndDispatchCustomEvent<E extends CustomEvent, OriginalEvent extends Event>(name: string, handler: ((event: E) => void) | undefined, detail: {
|
|
3
|
+
originalEvent: OriginalEvent;
|
|
4
|
+
} & (E extends CustomEvent<infer D> ? D : never)): void;
|
|
5
|
+
declare function isMouseEvent(event: PointerEvent): boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { handleAndDispatchCustomEvent, isMouseEvent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function t(e){return e.pointerType===`mouse`}export{e as handleAndDispatchCustomEvent,t as isMouseEvent};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DataOrientation, Direction, FocusIntent } from "../types/common.js";
|
|
2
|
+
import "../types/index.js";
|
|
3
|
+
import "../index.js";
|
|
4
|
+
|
|
5
|
+
//#region src/shared/focus.d.ts
|
|
6
|
+
type FocusableTarget = HTMLElement | {
|
|
7
|
+
focus: () => void;
|
|
8
|
+
};
|
|
9
|
+
/** Attempts focusing the first element in a list of candidates. Stops when focus has actually moved. */
|
|
10
|
+
declare function focusFirstAndSelect(candidates: HTMLElement[], {
|
|
11
|
+
select
|
|
12
|
+
}?: {
|
|
13
|
+
select?: boolean | undefined;
|
|
14
|
+
}): void;
|
|
15
|
+
declare function tryFocusFirst(candidates: HTMLElement[], preventScroll?: boolean): boolean;
|
|
16
|
+
declare function removeFromTabOrder(candidates: HTMLElement[]): () => void;
|
|
17
|
+
/** Returns the first and last tabbable elements inside a container. */
|
|
18
|
+
declare function getTabbableEdges(container: HTMLElement): readonly [HTMLElement | undefined, HTMLElement | undefined];
|
|
19
|
+
/**
|
|
20
|
+
* Returns a list of potential tabbable candidates.
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when elements are not
|
|
23
|
+
* visible. This cannot be worked out easily by just reading a property, but rather necessitate runtime knowledge
|
|
24
|
+
* (computed styles, etc). We deal with these cases separately.
|
|
25
|
+
*
|
|
26
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker Credit:
|
|
27
|
+
* https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
28
|
+
*/
|
|
29
|
+
declare function getTabbableCandidates(container: HTMLElement): HTMLElement[];
|
|
30
|
+
declare function focus(element?: FocusableTarget | null, {
|
|
31
|
+
select
|
|
32
|
+
}?: {
|
|
33
|
+
select?: boolean | undefined;
|
|
34
|
+
}): void;
|
|
35
|
+
declare function getDirectionAwareKey(key: string, dir?: Direction): string;
|
|
36
|
+
declare function getFocusIntent(event: KeyboardEvent, orientation?: DataOrientation, dir?: Direction): FocusIntent | undefined;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { focus, focusFirstAndSelect, getDirectionAwareKey, getFocusIntent, getTabbableCandidates, getTabbableEdges, removeFromTabOrder, tryFocusFirst };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MAP_KEY_TO_FOCUS_INTENT as e}from"../constants/common.js";import{getActiveElement as t}from"./dom.js";function n(e,{select:n=!1}={}){let r=t();for(let i of e)if(u(i,{select:n}),t()!==r)return}function r(e,n=!1){let r=t();return e.some(e=>e===r?!0:(e.focus({preventScroll:n}),t()!==r))}function i(e){return e.forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)}),()=>{e.forEach(e=>{let t=e.dataset.tabindex;e.setAttribute(`tabindex`,t)})}}function a(e){let t=o(e);return[s(t,e),s(t.reverse(),e)]}function o(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function s(e,t){return e.find(e=>!c(e,{upTo:t}))}function c(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;let n=e;for(;n;){if(t!==void 0&&n===t)return!1;if(getComputedStyle(n).display===`none`)return!0;n=n.parentElement}return!1}function l(e){return e instanceof HTMLInputElement&&`select`in e}function u(e,{select:n=!1}={}){if(!e||!e.focus)return;let r=t();e.focus({preventScroll:!0}),n&&e!==r&&l(e)&&e.select()}function d(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function f(t,n,r){let i=d(t.key,r);if(!(n===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(i))&&!(n===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(i)))return e[i]}export{u as focus,n as focusFirstAndSelect,d as getDirectionAwareKey,f as getFocusIntent,o as getTabbableCandidates,a as getTabbableEdges,i as removeFromTabOrder,r as tryFocusFirst};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { FormNameValueProps } from "../types/component.js";
|
|
2
|
+
import "../types/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/form.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Generate form field names, supporting nested structures
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* createFieldName('user', 0, 'name'); // 'user[0][name]'
|
|
11
|
+
* createFieldName('form', 'profile', 'email'); // 'form[profile][email]'
|
|
12
|
+
*
|
|
13
|
+
* @param baseName - Base field name
|
|
14
|
+
* @param paths - Nested paths (can be string or number)
|
|
15
|
+
* @returns Formatted field name, e.g., "user[0][name]"
|
|
16
|
+
*/
|
|
17
|
+
declare function createFieldName(baseName: string, ...paths: (string | number)[]): string;
|
|
18
|
+
/**
|
|
19
|
+
* Parse primitive values into form fields
|
|
20
|
+
*
|
|
21
|
+
* @param name - Field name
|
|
22
|
+
* @param value - Primitive value
|
|
23
|
+
* @returns Array of form fields
|
|
24
|
+
*/
|
|
25
|
+
declare function parsePrimitiveValue(name: string, value: string | number | boolean | null | undefined): FormNameValueProps[];
|
|
26
|
+
/**
|
|
27
|
+
* Parse array values into form fields
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* parseArrayValue('items', ['a', 'b']);
|
|
31
|
+
* // [{ name: 'items[0]', value: 'a' }, { name: 'items[1]', value: 'b' }]
|
|
32
|
+
*
|
|
33
|
+
* parseArrayValue('users', [{ name: 'John', age: 30 }]);
|
|
34
|
+
* // [{ name: 'users[0][name]', value: 'John' }, { name: 'users[0][age]', value: 30 }]
|
|
35
|
+
*
|
|
36
|
+
* @param baseName - Base field name
|
|
37
|
+
* @param array - Array value
|
|
38
|
+
* @returns Array of form fields
|
|
39
|
+
*/
|
|
40
|
+
declare function parseArrayValue(baseName: string, array: unknown[]): FormNameValueProps[];
|
|
41
|
+
/**
|
|
42
|
+
* Parse object values into form fields
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* parseObjectValue('user', { name: 'John', age: 30 });
|
|
46
|
+
* // [{ name: 'user[name]', value: 'John' }, { name: 'user[age]', value: 30 }]
|
|
47
|
+
*
|
|
48
|
+
* @param baseName - Base field name
|
|
49
|
+
* @param obj - Object value
|
|
50
|
+
* @returns Array of form fields
|
|
51
|
+
*/
|
|
52
|
+
declare function parseObjectValue(baseName: string, obj: Record<string, unknown>): FormNameValueProps[];
|
|
53
|
+
/**
|
|
54
|
+
* Parse any value into form field array
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* parseFormValue('test', 'hello'); // [{ name: 'test', value: 'hello' }]
|
|
58
|
+
* parseFormValue('items', [1, 2, 3]); // [{ name: 'items[0]', value: 1 }, ...]
|
|
59
|
+
* parseFormValue('user', { name: 'John' }); // [{ name: 'user[name]', value: 'John' }]
|
|
60
|
+
*
|
|
61
|
+
* @param name - Field name
|
|
62
|
+
* @param value - Value to parse
|
|
63
|
+
* @returns Array of form fields
|
|
64
|
+
*/
|
|
65
|
+
declare function parseFormValue(name: string, value: unknown): FormNameValueProps[];
|
|
66
|
+
//#endregion
|
|
67
|
+
export { createFieldName, parseArrayValue, parseFormValue, parseObjectValue, parsePrimitiveValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isArrayValue as e,isNonNullObject as t,isPrimitive as n}from"./guard.js";function r(e,...t){return t.reduce((e,t)=>`${e}[${String(t)}]`,e)}function i(e,t){return[{name:e,value:t}]}function a(e,n){return n.flatMap((n,i)=>t(n)?Object.entries(n).map(([t,n])=>({name:r(e,i,t),value:n})):{name:r(e,i),value:n})}function o(e,t){return Object.entries(t).map(([t,n])=>({name:r(e,t),value:n}))}function s(r,s){return r?n(s)?i(r,s):e(s)?a(r,s):t(s)?o(r,s):s==null?[]:[{name:r,value:String(s)}]:[]}export{r as createFieldName,a as parseArrayValue,s as parseFormValue,o as parseObjectValue,i as parsePrimitiveValue};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Point, Polygon, Side } from "../types/common.js";
|
|
2
|
+
import "../types/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/geometry.d.ts
|
|
5
|
+
declare function isPointerInGraceArea(event: PointerEvent, area?: Polygon): boolean;
|
|
6
|
+
declare function isPointInPolygon(point: Point, polygon: Polygon): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Determine which side of the rectangle the point is closest to
|
|
9
|
+
*
|
|
10
|
+
* @param point Target point
|
|
11
|
+
* @param rect DOM rectangle
|
|
12
|
+
* @returns The closest side
|
|
13
|
+
*/
|
|
14
|
+
declare function getExitSideFromRect(point: Point, rect: DOMRect): Side;
|
|
15
|
+
/**
|
|
16
|
+
* Create padded points based on exit point and exit side
|
|
17
|
+
*
|
|
18
|
+
* @param exitPoint Exit point
|
|
19
|
+
* @param exitSide Exit side
|
|
20
|
+
* @param padding Padding distance, default 5
|
|
21
|
+
* @returns Array of padded points
|
|
22
|
+
*/
|
|
23
|
+
declare function getPaddedExitPoints(exitPoint: Point, exitSide: Side, padding?: number): Point[];
|
|
24
|
+
/**
|
|
25
|
+
* Get four corner points from DOMRect
|
|
26
|
+
*
|
|
27
|
+
* @param rect DOM rectangle
|
|
28
|
+
* @returns Array of points (clockwise starting from top-left)
|
|
29
|
+
*/
|
|
30
|
+
declare function getPointsFromRect(rect: DOMRect): Point[];
|
|
31
|
+
/**
|
|
32
|
+
* Calculate convex hull using Graham scan algorithm - optimized version with better performance
|
|
33
|
+
*
|
|
34
|
+
* @param points Point collection
|
|
35
|
+
* @returns Array of convex hull points
|
|
36
|
+
*/
|
|
37
|
+
declare function getHull<P extends Point>(points: Readonly<Array<P>>): Array<P>;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { getExitSideFromRect, getHull, getPaddedExitPoints, getPointsFromRect, isPointInPolygon, isPointerInGraceArea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,n){if(!n)return!1;let{clientX:r,clientY:i}=e;return t({x:r,y:i},n)}function t(e,t){let{x:n,y:r}=e;if(t.length<3)return!1;let{x:i,y:a}=t[0],{x:o,y:s}=t[0];for(let e=1;e<t.length;e++){let n=t[e];i=Math.min(i,n.x),o=Math.max(o,n.x),a=Math.min(a,n.y),s=Math.max(s,n.y)}if(n<i||n>o||r<a||r>s)return!1;let c=0;for(let e=0;e<t.length;e++){let i=t[e],a=t[(e+1)%t.length],{x:o,y:s}=i,{x:l,y:u}=a;s>r!=u>r&&n<o+(r-s)*(l-o)/(u-s)&&c++}return c%2==1}function n(e,t){let{x:n,y:r}=e,{top:i,right:a,bottom:o,left:s}=t,c=Math.abs(i-r),l=Math.abs(o-r),u=Math.abs(s-n),d=Math.abs(a-n);return Math.min(u,d)<Math.min(c,l)?u<d?`left`:`right`:c<l?`top`:`bottom`}function r(e,t,n=5){let{x:r,y:i}=e;return{top:[{x:r-n,y:i+n},{x:r+n,y:i+n}],bottom:[{x:r-n,y:i-n},{x:r+n,y:i-n}],left:[{x:r+n,y:i-n},{x:r+n,y:i+n}],right:[{x:r-n,y:i-n},{x:r-n,y:i+n}]}[t]}function i(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function a(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function o(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function s(e){if(e.length<=1||e.length===2)return[...e];if(e.length===3){let[t,n,r]=e,i=o(t,n,r);if(Math.abs(i)<1e-10){let e=a(t,n),i=a(t,r),o=a(n,r),s=Math.max(e,i,o);return s===e?[t,n]:s===i?[t,r]:[n,r]}return[...e]}return c([...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x))}function c(e){if(e.length<=1)return[...e];let t=[];for(let n of e){for(;t.length>=2&&o(t[t.length-2],t[t.length-1],n)<=0;)t.pop();t.push(n)}let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2&&o(n[n.length-2],n[n.length-1],r)<=0;)n.pop();n.push(r)}return t.pop(),n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}export{n as getExitSideFromRect,s as getHull,r as getPaddedExitPoints,i as getPointsFromRect,t as isPointInPolygon,e as isPointerInGraceArea};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/shared/guard.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Type guard: check if value is a string
|
|
4
|
+
*
|
|
5
|
+
* @param value
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function isString(value: unknown): value is string;
|
|
9
|
+
/**
|
|
10
|
+
* Type guard: check if value is a primitive type
|
|
11
|
+
*
|
|
12
|
+
* @param value - The value to check
|
|
13
|
+
* @returns Whether the value is string | number | boolean
|
|
14
|
+
*/
|
|
15
|
+
declare function isPrimitive(value: unknown): value is string | number | boolean | null | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Type guard: check if value is a non-null object (excluding arrays)
|
|
18
|
+
*
|
|
19
|
+
* @param value - The value to check
|
|
20
|
+
* @returns Whether the value is a non-null object
|
|
21
|
+
*/
|
|
22
|
+
declare function isNonNullObject(value: unknown): value is Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Type guard: check if value is an array
|
|
25
|
+
*
|
|
26
|
+
* @param value - The value to check
|
|
27
|
+
* @returns Whether the value is an array
|
|
28
|
+
*/
|
|
29
|
+
declare function isArrayValue(value: unknown): value is unknown[];
|
|
30
|
+
/**
|
|
31
|
+
* Type guard: check if value is null or undefined
|
|
32
|
+
*
|
|
33
|
+
* @param value - The value to check
|
|
34
|
+
* @returns Whether the value is null or undefined
|
|
35
|
+
*/
|
|
36
|
+
declare function isNullish(value: unknown): value is null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Type guard: check if value is an empty string
|
|
39
|
+
*
|
|
40
|
+
* @param value - The value to check
|
|
41
|
+
* @returns Whether the value is an empty string
|
|
42
|
+
*/
|
|
43
|
+
declare function isBlankString(value: unknown | undefined): value is string;
|
|
44
|
+
declare function isDateObject(value: unknown): value is Date;
|
|
45
|
+
declare function isObjectType(value: unknown): value is object | null;
|
|
46
|
+
declare function isFunction(value: unknown): value is (...args: any[]) => any;
|
|
47
|
+
declare function isObject(value: unknown): boolean;
|
|
48
|
+
declare function isPromise(value: any): value is PromiseLike<any>;
|
|
49
|
+
declare function keysOf<TRecord extends Record<string, unknown>>(record: TRecord): (keyof TRecord)[];
|
|
50
|
+
//#endregion
|
|
51
|
+
export { isArrayValue, isBlankString, isDateObject, isFunction, isNonNullObject, isNullish, isObject, isObjectType, isPrimitive, isPromise, isString, keysOf };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return typeof e==`string`}function t(e){let t=typeof e;return t===`string`||t===`number`||t===`boolean`||i(e)}function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function r(e){return typeof e==`object`&&Array.isArray(e)}function i(e){return e==null}function a(e){return typeof e==`string`&&e===``}function o(e){return e instanceof Date}function s(e){return typeof e==`object`}function c(e){return typeof e==`function`}function l(e){return!i(e)&&!Array.isArray(e)&&s(e)&&!o(e)}function u(e){return l(e)&&c(e?.then)}function d(e){return Object.keys(e)}export{r as isArrayValue,a as isBlankString,o as isDateObject,c as isFunction,n as isNonNullObject,i as isNullish,l as isObject,s as isObjectType,t as isPrimitive,u as isPromise,e as isString,d as keysOf};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isArrayValue, isBlankString, isDateObject, isFunction, isNonNullObject, isNullish, isObject, isObjectType, isPrimitive, isPromise, isString, keysOf } from "./guard.js";
|
|
2
|
+
import { appendAt, arrayRemove, compact, findValuesBetween, flattenChildren, getNextMatch, insertAt, moveAt, omit, pick, prependAt, removeAt, swapAt, updateAt, wrapArray } from "./object.js";
|
|
3
|
+
import { isKey, stringToPath, toCamelCase, toKebabCase, toPascalCase } from "./string.js";
|
|
4
|
+
import { isValueEqualOrExist } from "./comparison.js";
|
|
5
|
+
import { clamp, getBinaryCheckedState, getCheckedState, getDisclosureState, getOpenFromSingleOrMultiple, getValue, isIndeterminate, roundToStepPrecision, setValue, snapValueToStep } from "./value.js";
|
|
6
|
+
import { createFieldName, parseArrayValue, parseFormValue, parseObjectValue, parsePrimitiveValue } from "./form.js";
|
|
7
|
+
import { getActiveElement, getAriaLabel, getAriaLabelByVNode, getAriaLabelByVNodeList, getCollectionItemElements, isElementHasAttribute, removeLinks } from "./dom.js";
|
|
8
|
+
import { focus, focusFirstAndSelect, getDirectionAwareKey, getFocusIntent, getTabbableCandidates, getTabbableEdges, removeFromTabOrder, tryFocusFirst } from "./focus.js";
|
|
9
|
+
import { getElFromTemplateRef, getLifeCycleTarget, getRawChildren, isFormControl, transformPropsToContext } from "./vue.js";
|
|
10
|
+
import { isBrowser, isClient, isIOS, refreshIOSDetection } from "./env.js";
|
|
11
|
+
import { handleAndDispatchCustomEvent, isMouseEvent } from "./event.js";
|
|
12
|
+
import { getExitSideFromRect, getHull, getPaddedExitPoints, getPointsFromRect, isPointInPolygon, isPointerInGraceArea } from "./geometry.js";
|
|
13
|
+
export { appendAt, arrayRemove, clamp, compact, createFieldName, findValuesBetween, flattenChildren, focus, focusFirstAndSelect, getActiveElement, getAriaLabel, getAriaLabelByVNode, getAriaLabelByVNodeList, getBinaryCheckedState, getCheckedState, getCollectionItemElements, getDirectionAwareKey, getDisclosureState, getElFromTemplateRef, getExitSideFromRect, getFocusIntent, getHull, getLifeCycleTarget, getNextMatch, getOpenFromSingleOrMultiple, getPaddedExitPoints, getPointsFromRect, getRawChildren, getTabbableCandidates, getTabbableEdges, getValue, handleAndDispatchCustomEvent, insertAt, isArrayValue, isBlankString, isBrowser, isClient, isDateObject, isElementHasAttribute, isFormControl, isFunction, isIOS, isIndeterminate, isKey, isMouseEvent, isNonNullObject, isNullish, isObject, isObjectType, isPointInPolygon, isPointerInGraceArea, isPrimitive, isPromise, isString, isValueEqualOrExist, keysOf, moveAt, omit, parseArrayValue, parseFormValue, parseObjectValue, parsePrimitiveValue, pick, prependAt, refreshIOSDetection, removeAt, removeFromTabOrder, removeLinks, roundToStepPrecision, setValue, snapValueToStep, stringToPath, swapAt, toCamelCase, toKebabCase, toPascalCase, transformPropsToContext, tryFocusFirst, updateAt, wrapArray };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isArrayValue as e,isBlankString as t,isDateObject as n,isFunction as r,isNonNullObject as i,isNullish as a,isObject as o,isObjectType as s,isPrimitive as c,isPromise as l,isString as u,keysOf as d}from"./guard.js";import{appendAt as f,arrayRemove as p,compact as m,findValuesBetween as h,flattenChildren as g,getNextMatch as _,insertAt as v,moveAt as y,omit as b,pick as x,prependAt as S,removeAt as C,swapAt as w,updateAt as T,wrapArray as E}from"./object.js";import{isKey as D,stringToPath as O,toCamelCase as k,toKebabCase as A,toPascalCase as j}from"./string.js";import{isValueEqualOrExist as M}from"./comparison.js";import{clamp as N,getBinaryCheckedState as P,getCheckedState as F,getDisclosureState as I,getOpenFromSingleOrMultiple as L,getValue as R,isIndeterminate as z,roundToStepPrecision as B,setValue as V,snapValueToStep as H}from"./value.js";import{createFieldName as U,parseArrayValue as W,parseFormValue as G,parseObjectValue as K,parsePrimitiveValue as q}from"./form.js";import{getActiveElement as J,getAriaLabel as Y,getAriaLabelByVNode as X,getAriaLabelByVNodeList as Z,getCollectionItemElements as Q,isElementHasAttribute as $,removeLinks as ee}from"./dom.js";import{focus as te,focusFirstAndSelect as ne,getDirectionAwareKey as re,getFocusIntent as ie,getTabbableCandidates as ae,getTabbableEdges as oe,removeFromTabOrder as se,tryFocusFirst as ce}from"./focus.js";import{getElFromTemplateRef as le,getLifeCycleTarget as ue,getRawChildren as de,isFormControl as fe,transformPropsToContext as pe}from"./vue.js";import{isBrowser as me,isClient as he,isIOS as ge,refreshIOSDetection as _e}from"./env.js";import{handleAndDispatchCustomEvent as ve,isMouseEvent as ye}from"./event.js";import{getExitSideFromRect as be,getHull as xe,getPaddedExitPoints as Se,getPointsFromRect as Ce,isPointInPolygon as we,isPointerInGraceArea as Te}from"./geometry.js";export{f as appendAt,p as arrayRemove,N as clamp,m as compact,U as createFieldName,h as findValuesBetween,g as flattenChildren,te as focus,ne as focusFirstAndSelect,J as getActiveElement,Y as getAriaLabel,X as getAriaLabelByVNode,Z as getAriaLabelByVNodeList,P as getBinaryCheckedState,F as getCheckedState,Q as getCollectionItemElements,re as getDirectionAwareKey,I as getDisclosureState,le as getElFromTemplateRef,be as getExitSideFromRect,ie as getFocusIntent,xe as getHull,ue as getLifeCycleTarget,_ as getNextMatch,L as getOpenFromSingleOrMultiple,Se as getPaddedExitPoints,Ce as getPointsFromRect,de as getRawChildren,ae as getTabbableCandidates,oe as getTabbableEdges,R as getValue,ve as handleAndDispatchCustomEvent,v as insertAt,e as isArrayValue,t as isBlankString,me as isBrowser,he as isClient,n as isDateObject,$ as isElementHasAttribute,fe as isFormControl,r as isFunction,ge as isIOS,z as isIndeterminate,D as isKey,ye as isMouseEvent,i as isNonNullObject,a as isNullish,o as isObject,s as isObjectType,we as isPointInPolygon,Te as isPointerInGraceArea,c as isPrimitive,l as isPromise,u as isString,M as isValueEqualOrExist,d as keysOf,y as moveAt,b as omit,W as parseArrayValue,G as parseFormValue,K as parseObjectValue,q as parsePrimitiveValue,x as pick,S as prependAt,_e as refreshIOSDetection,C as removeAt,se as removeFromTabOrder,ee as removeLinks,B as roundToStepPrecision,V as setValue,H as snapValueToStep,O as stringToPath,w as swapAt,k as toCamelCase,A as toKebabCase,j as toPascalCase,pe as transformPropsToContext,ce as tryFocusFirst,T as updateAt,E as wrapArray};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/shared/object.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Select specified properties from an object
|
|
4
|
+
*
|
|
5
|
+
* @param obj - Source object
|
|
6
|
+
* @param keys - Array of property keys to select
|
|
7
|
+
* @returns New object containing specified properties
|
|
8
|
+
*/
|
|
9
|
+
declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
10
|
+
/**
|
|
11
|
+
* Exclude specified properties from an object
|
|
12
|
+
*
|
|
13
|
+
* @param obj - Source object
|
|
14
|
+
* @param keys - Array of property keys to exclude
|
|
15
|
+
* @returns New object with specified properties excluded
|
|
16
|
+
*/
|
|
17
|
+
declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
|
|
18
|
+
declare function compact<T>(value: T[]): T[];
|
|
19
|
+
/**
|
|
20
|
+
* Remove specified element from an array
|
|
21
|
+
*
|
|
22
|
+
* @param array - Source array
|
|
23
|
+
* @param item - Element to remove
|
|
24
|
+
* @returns New array with element removed
|
|
25
|
+
*/
|
|
26
|
+
declare function arrayRemove<T>(array: T[], item: T): T[];
|
|
27
|
+
/**
|
|
28
|
+
* Wraps an array around itself at a given start index Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a',
|
|
29
|
+
* 'b']`
|
|
30
|
+
*/
|
|
31
|
+
declare function wrapArray<T>(array: T[], startIndex: number): T[];
|
|
32
|
+
declare function appendAt<T>(data: T[], value: T): T[];
|
|
33
|
+
declare function prependAt<T>(data: T[], value: T): T[];
|
|
34
|
+
declare function removeAt<T>(data: T[], index?: number): T[];
|
|
35
|
+
declare function swapAt<T>(data: T[], indexA: number, indexB: number): void;
|
|
36
|
+
declare function moveAt<T>(data: T[], from: number, to: number): void;
|
|
37
|
+
declare function insertAt<T>(data: T[], index: number, value: T): T[];
|
|
38
|
+
declare function updateAt<T>(data: T[], index: number, value: T): T[];
|
|
39
|
+
/**
|
|
40
|
+
* This is the "meat" of the typeahead matching logic. It takes in all the values, the search and the current match, and
|
|
41
|
+
* returns the next match (or `undefined`).
|
|
42
|
+
*
|
|
43
|
+
* We normalize the search because if a user has repeatedly pressed a character, we want the exact same behavior as if
|
|
44
|
+
* we only had that one character (ie. cycle through options starting with that character)
|
|
45
|
+
*
|
|
46
|
+
* We also reorder the values by wrapping the array around the current match. This is so we always look forward from the
|
|
47
|
+
* current match, and picking the first match will always be the correct one.
|
|
48
|
+
*
|
|
49
|
+
* Finally, if the normalized search is exactly one character, we exclude the current match from the values because
|
|
50
|
+
* otherwise it would be the first to match always and focus would never move. This is as opposed to the regular case,
|
|
51
|
+
* where we don't want focus to move if the current match still matches.
|
|
52
|
+
*/
|
|
53
|
+
declare function getNextMatch(values?: string[], search?: string, currentMatch?: string): string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* The function `findValuesBetween` takes an array and two values, then returns a subarray containing elements between
|
|
56
|
+
* the first occurrence of the start value and the first occurrence of the end value in the array.
|
|
57
|
+
*
|
|
58
|
+
* @param {T[]} array - The `array` parameter is an array of values of type `T`.
|
|
59
|
+
* @param {T} start - The `start` parameter is the value that marks the beginning of the range you want to find in the
|
|
60
|
+
* array.
|
|
61
|
+
* @param {T} end - The `end` parameter in the `findValuesBetween` function represents the end value that you want to
|
|
62
|
+
* find in the array. This function will return a subarray of values that are between the `start` and `end` values in
|
|
63
|
+
* the original array.
|
|
64
|
+
* @returns The `findValuesBetween` function returns an array of values from the input array that are between the
|
|
65
|
+
* `start` and `end` values (inclusive). If either the `start` or `end` values are not found in the input array, an
|
|
66
|
+
* empty array is returned.
|
|
67
|
+
*/
|
|
68
|
+
declare function findValuesBetween<T>(array: T[], start: T, end: T): T[];
|
|
69
|
+
declare function flattenChildren<T extends {
|
|
70
|
+
children?: any[];
|
|
71
|
+
}>(items?: T[]): Omit<T, "children">[];
|
|
72
|
+
//#endregion
|
|
73
|
+
export { appendAt, arrayRemove, compact, findValuesBetween, flattenChildren, getNextMatch, insertAt, moveAt, omit, pick, prependAt, removeAt, swapAt, updateAt, wrapArray };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isEqual as e}from"ohash";function t(e,t){let n={};for(let r of t)n[r]=e[r];return n}function n(e,t){let n={};for(let r in e){let i=r;t.includes(i)||(n[i]=e[i])}return n}function r(e){return Array.isArray(e)?e.filter(Boolean):[]}function i(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function a(e,t){if(e.length===0)return[];let n=(t%e.length+e.length)%e.length;return e.map((t,r)=>e[(n+r)%e.length])}function o(e,t){return[...e,t]}function s(e,t){return[t,...e]}function c(e,t){if(t===void 0)return[];let n=[...e];return n.splice(t,1),n}function l(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function u(e,t,n){let[r]=e.splice(t,1);e.splice(n,0,r)}function d(e,t,n){return[...e.slice(0,t),n,...e.slice(t)]}function f(e,t,n){let r=[...e];return r[t]=n,r}function p(e,t,n){if(!e?.length||!t)return;let r=t.length>1&&t[0]?.repeat(t.length)===t?t[0]:t,i=r.toLowerCase(),a=r.length===1,o=n?e.indexOf(n):-1,s=Math.max(o,0),c=e.length;for(let t=0;t<c;t++){let r=e[(s+t)%c];if((!a||r!==n)&&r?.toLowerCase().startsWith(i))return r===n?void 0:r}}function m(t,n,r){let i=t.findIndex(t=>e(t,n)),a=t.findIndex(t=>e(t,r));if(i===-1||a===-1)return[];let[o,s]=[i,a].sort((e,t)=>e-t);return t.slice(o,s+1)}function h(e){return e?e.reduce((e,t)=>(e.push(t),t.children&&e.push(...h(t.children)),e),[]):[]}export{o as appendAt,i as arrayRemove,r as compact,m as findValuesBetween,h as flattenChildren,p as getNextMatch,d as insertAt,u as moveAt,n as omit,t as pick,s as prependAt,c as removeAt,l as swapAt,f as updateAt,a as wrapArray};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region src/shared/string.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Convert string to kebab-case format
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* toKebabCase('helloWorld'); // 'hello-world'
|
|
7
|
+
* toKebabCase('HelloWorld'); // 'hello-world'
|
|
8
|
+
*
|
|
9
|
+
* @param str - The string to convert
|
|
10
|
+
* @returns String in kebab-case format
|
|
11
|
+
*/
|
|
12
|
+
declare function toKebabCase(str: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Convert string to PascalCase format
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* toPascalCase('hello-world'); // 'HelloWorld'
|
|
18
|
+
* toPascalCase('hello_world'); // 'HelloWorld'
|
|
19
|
+
*
|
|
20
|
+
* @param str - The string to convert
|
|
21
|
+
* @returns String in PascalCase format
|
|
22
|
+
*/
|
|
23
|
+
declare function toPascalCase(str: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Convert string to camelCase format
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* toCamelCase('hello-world'); // 'helloWorld'
|
|
29
|
+
* toCamelCase('hello_world'); // 'helloWorld'
|
|
30
|
+
*
|
|
31
|
+
* @param str - The string to convert
|
|
32
|
+
* @returns String in camelCase format
|
|
33
|
+
*/
|
|
34
|
+
declare function toCamelCase(str: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Convert string to path
|
|
37
|
+
*
|
|
38
|
+
* @param str - The string to convert
|
|
39
|
+
* @returns Path
|
|
40
|
+
*/
|
|
41
|
+
declare function stringToPath(str: string): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Check if string is a key
|
|
44
|
+
*
|
|
45
|
+
* @param str - The string to check
|
|
46
|
+
* @returns Whether the string is a key
|
|
47
|
+
*/
|
|
48
|
+
declare function isKey(str: string): boolean;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { isKey, stringToPath, toCamelCase, toKebabCase, toPascalCase };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{compact as e}from"./object.js";function t(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function n(e){return e.replace(/(^\w|-\w)/g,e=>e.replace(`-`,``).toUpperCase())}function r(e){return e.replace(/(-\w)/g,e=>e.replace(`-`,``).toUpperCase())}function i(t){return e(t.replace(/["|']|\]/g,``).split(/\.|\[/))}function a(e){return/^\w*$/.test(e)}export{a as isKey,i as stringToPath,r as toCamelCase,t as toKebabCase,n as toPascalCase};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CheckedState, DefinedValue, MaybeArray } from "../types/common.js";
|
|
2
|
+
import "../types/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/value.d.ts
|
|
5
|
+
declare function isIndeterminate(checked?: CheckedState | null): checked is 'indeterminate';
|
|
6
|
+
declare function getCheckedState(checked?: CheckedState | null): "indeterminate" | "checked" | "unchecked";
|
|
7
|
+
declare function getBinaryCheckedState(checked?: CheckedState | null): "checked" | "unchecked";
|
|
8
|
+
/**
|
|
9
|
+
* Check if value is enabled based on single or multiple selection mode
|
|
10
|
+
*
|
|
11
|
+
* @param value - The value to check
|
|
12
|
+
* @param modelValue - The model value (can be a single value or array)
|
|
13
|
+
* @param isSingle - Whether it's single selection mode
|
|
14
|
+
* @returns Whether it's enabled
|
|
15
|
+
*/
|
|
16
|
+
declare function getOpenFromSingleOrMultiple(value: DefinedValue, modelValue: MaybeArray<DefinedValue> | undefined, isMultiple: boolean): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Return corresponding string based on open state
|
|
19
|
+
*
|
|
20
|
+
* @param open - Whether it's open
|
|
21
|
+
* @returns 'open' or 'closed'
|
|
22
|
+
*/
|
|
23
|
+
declare function getDisclosureState(open?: boolean): "open" | "closed";
|
|
24
|
+
/**
|
|
25
|
+
* The `clamp` function restricts a number within a specified range by returning the value itself if it falls within the
|
|
26
|
+
* range, or the closest boundary value if it exceeds the range.
|
|
27
|
+
*
|
|
28
|
+
* @param {number} value - The `value` parameter represents the number that you want to clamp within the specified range
|
|
29
|
+
* defined by `min` and `max` values.
|
|
30
|
+
* @param {number} min - If the `value` parameter is less than the `min` value, the function will return the `min`
|
|
31
|
+
* value.
|
|
32
|
+
* @param {number} max - If the `value` parameter is greater than the `max` value, the function will return `max`.
|
|
33
|
+
* @returns The `clamp` function returns the value of `value` constrained within the range defined by `min` and `max`.
|
|
34
|
+
*/
|
|
35
|
+
declare function clamp(value: number, min?: number, max?: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* The function `roundToStepPrecision` rounds a number to a specified precision step.
|
|
38
|
+
*
|
|
39
|
+
* @param {number} value - The `value` parameter is the number that you want to round to a specific precision based on
|
|
40
|
+
* the `step` parameter.
|
|
41
|
+
* @param {number} step - The `step` parameter in the `roundToStepPrecision` function represents the interval at which
|
|
42
|
+
* you want to round the `value`. For example, if `step` is 0.5, the `value` will be rounded to the nearest half.
|
|
43
|
+
* @returns the `roundedValue` after rounding it to the precision specified by the `step`.
|
|
44
|
+
*/
|
|
45
|
+
declare function roundToStepPrecision(value: number, step: number): number;
|
|
46
|
+
/**
|
|
47
|
+
* The function `snapValueToStep` snaps a given value to the nearest step within a specified range.
|
|
48
|
+
*
|
|
49
|
+
* @param {number} value - The `value` parameter represents the number that you want to snap to the nearest step value.
|
|
50
|
+
* @param {number | undefined} min - The `min` parameter represents the minimum value that the `value` should be snapped
|
|
51
|
+
* to. If `value` is less than `min`, it will be snapped to `min`. If `min` is not provided (undefined), then the
|
|
52
|
+
* snapping will not consider a minimum value.
|
|
53
|
+
* @param {number | undefined} max - The `max` parameter represents the maximum value that the `value` should be snapped
|
|
54
|
+
* to. It ensures that the snapped value does not exceed this maximum value.
|
|
55
|
+
* @param {number} step - The `step` parameter in the `snapValueToStep` function represents the interval at which the
|
|
56
|
+
* `value` should be snapped to. It determines the granularity of the snapping operation. For example, if `step` is 5,
|
|
57
|
+
* the `value` will be snapped to the nearest multiple of
|
|
58
|
+
* @returns a number that has been snapped to the nearest step value within the specified range of minimum and maximum
|
|
59
|
+
* values.
|
|
60
|
+
*/
|
|
61
|
+
declare function snapValueToStep(value: number, min: number | undefined, max: number | undefined, step: number): number;
|
|
62
|
+
declare function setValue(obj: Record<string, any>, path: string, value?: any): Record<string, any>;
|
|
63
|
+
declare function getValue<T>(obj: T, path: string, defaultValue?: unknown): any;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { clamp, getBinaryCheckedState, getCheckedState, getDisclosureState, getOpenFromSingleOrMultiple, getValue, isIndeterminate, roundToStepPrecision, setValue, snapValueToStep };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isNullish as e,isObject as t}from"./guard.js";import{compact as n}from"./object.js";import{isKey as r,stringToPath as i}from"./string.js";function a(e){return e===`indeterminate`}function o(e){return a(e)?`indeterminate`:e?`checked`:`unchecked`}function s(e){return e===!0?`checked`:`unchecked`}function c(e,t,n){return n?Array.isArray(t)&&t.includes(e):e===t}function l(e){return e?`open`:`closed`}function u(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function d(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function f(e,t,n,r){let i=Number(t),a=Number(n),o=(e-(Number.isNaN(i)?0:i))%r,s=d(Math.abs(o)*2>=r?e+Math.sign(o)*(r-Math.abs(o)):e-o,r);return Number.isNaN(i)?!Number.isNaN(a)&&s>a&&(s=Math.floor(d(a/r,r))*r):s<i?s=i:!Number.isNaN(a)&&s>a&&(s=i+Math.floor(d((a-i)/r,r))*r),s=d(s,r),s}function p(e,n,a){let o=-1,s=r(n)?[n]:i(n),c=s.length,l=c-1;for(;++o<c;){let n=s[o],r=a;if(n){if(o!==l){let i=e[n];r=t(i)||Array.isArray(i)?i:Number.isNaN(Number(s[o+1]))?{}:[]}e[n]=r,e=e[n]}}return e}function m(r,i,a){if(!i||!t(r))return a;let o=n(i.split(/[,[\].]+?/)).reduce((t,n)=>e(t)?t:t[n],r);if(o===void 0||o===r){let e=r[i];return e===void 0?a:e}return o}export{u as clamp,s as getBinaryCheckedState,o as getCheckedState,l as getDisclosureState,c as getOpenFromSingleOrMultiple,m as getValue,a as isIndeterminate,d as roundToStepPrecision,p as setValue,f as snapValueToStep};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsToContext, VNodeRef } from "../types/vue.js";
|
|
2
|
+
import "../types/index.js";
|
|
3
|
+
import { VNode } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/shared/vue.d.ts
|
|
6
|
+
declare function getLifeCycleTarget(target?: any): any;
|
|
7
|
+
declare function getRawChildren(children: VNode[]): VNode[];
|
|
8
|
+
declare function getElFromTemplateRef<T extends HTMLElement>(nodeRef: VNodeRef): T | undefined;
|
|
9
|
+
declare function transformPropsToContext<T extends Record<string, any>, K extends keyof T = keyof T>(props: T, keys?: K[]): PropsToContext<T, K>;
|
|
10
|
+
declare function isFormControl(el?: HTMLElement | null): boolean;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getElFromTemplateRef, getLifeCycleTarget, getRawChildren, isFormControl, transformPropsToContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Comment as e,Fragment as t,computed as n,getCurrentInstance as r}from"vue";import{PatchFlags as i}from"@vue/shared";function a(e){return e||r()}function o(n){let r=[],a=0;for(let s=0;s<n.length;s++){let c=n[s];c.type===t?((c.patchFlag??0)===i.KEYED_FRAGMENT&&a++,r=r.concat(o(c.children))):c.type!==e&&r.push(c)}if(a>1)for(let e=0;e<r.length;e++)r[e].patchFlag=i.BAIL;return r}function s(e){let t=e?.$el??e;return t&&t.nodeType!==1&&(t=void 0),t}function c(e,t){return(t??Object.keys(e)).reduce((t,r)=>(t[r]=n(()=>typeof e[r]==`function`?e[r]():e[r]),t),{})}function l(e){return e?e.classList.contains(`form`):!0}export{s as getElFromTemplateRef,a as getLifeCycleTarget,o as getRawChildren,l as isFormControl,c as transformPropsToContext};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region src/types/common.d.ts
|
|
2
|
+
type PrimitiveType = null | undefined | string | number | boolean | symbol | bigint;
|
|
3
|
+
type ClassValue = string | null | undefined | Record<string, boolean> | ClassValue[];
|
|
4
|
+
type DefinedValue = string | number;
|
|
5
|
+
type AcceptableValue = DefinedValue | null | undefined;
|
|
6
|
+
type AcceptableBooleanValue = AcceptableValue | boolean;
|
|
7
|
+
type MaybeArray<T> = T | Array<T>;
|
|
8
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
9
|
+
type DataOrientation = 'vertical' | 'horizontal';
|
|
10
|
+
type Direction = 'ltr' | 'rtl';
|
|
11
|
+
type DisclosureState = 'open' | 'closed';
|
|
12
|
+
type FocusIntent = 'first' | 'last' | 'prev' | 'next';
|
|
13
|
+
type CheckedState = boolean | 'indeterminate';
|
|
14
|
+
type NavigationKey = 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'End' | 'Home' | 'PageDown' | 'PageUp';
|
|
15
|
+
type KbdKey = 'meta' | 'ctrl' | 'alt' | 'win' | 'command' | 'shift' | 'option' | 'enter' | 'delete' | 'backspace' | 'escape' | 'tab' | 'capslock' | 'arrowup' | 'arrowright' | 'arrowdown' | 'arrowleft' | 'pageup' | 'pagedown' | 'home' | 'end';
|
|
16
|
+
type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
17
|
+
type HorizontalSide = Extract<Side, 'left' | 'right'>;
|
|
18
|
+
type Align = 'start' | 'center' | 'end';
|
|
19
|
+
type Placement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
20
|
+
type Point = {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
type Polygon = Point[];
|
|
25
|
+
/**
|
|
26
|
+
* if padding or margin is number, it will be in px if padding or margin is true, it will be var(--scrollbar-width)
|
|
27
|
+
* otherwise, it will be passed string
|
|
28
|
+
*/
|
|
29
|
+
type ScrollBodyOption = {
|
|
30
|
+
padding?: boolean | number | string;
|
|
31
|
+
margin?: boolean | number | string;
|
|
32
|
+
};
|
|
33
|
+
interface SelectionProps<M extends boolean = false, N extends DefinedValue = string> {
|
|
34
|
+
/**
|
|
35
|
+
* The controlled value of the selected item(s).
|
|
36
|
+
*
|
|
37
|
+
* Use this when you need to control the state of the items. Can be bound with `v-model`
|
|
38
|
+
*/
|
|
39
|
+
modelValue?: M extends true ? N[] : N;
|
|
40
|
+
/**
|
|
41
|
+
* The default value of the selected item(s).
|
|
42
|
+
*
|
|
43
|
+
* Use this when you need to set the initial state of the items.
|
|
44
|
+
*/
|
|
45
|
+
defaultValue?: M extends true ? N[] : N;
|
|
46
|
+
/**
|
|
47
|
+
* Determines whether a "single" or "multiple" items can be selected at a time.
|
|
48
|
+
*
|
|
49
|
+
* This prop will overwrite the inferred type from `modelValue` and `defaultValue`.
|
|
50
|
+
*/
|
|
51
|
+
multiple?: M;
|
|
52
|
+
}
|
|
53
|
+
type SelectionEmits<M extends boolean = false, N extends DefinedValue = string> = {
|
|
54
|
+
'update:modelValue': [value: M extends true ? N[] : N];
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { AcceptableBooleanValue, AcceptableValue, Align, CheckedState, ClassValue, DataOrientation, DefinedValue, Direction, DisclosureState, FocusIntent, HorizontalSide, KbdKey, MaybeArray, MaybePromise, NavigationKey, Placement, Point, Polygon, PrimitiveType, ScrollBodyOption, SelectionEmits, SelectionProps, Side };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FocusOutsideEvent, PointerDownOutsideEvent } from "./event.js";
|
|
2
|
+
|
|
3
|
+
//#region src/types/component.d.ts
|
|
4
|
+
interface ForceMountProps {
|
|
5
|
+
/**
|
|
6
|
+
* Used to force mounting when more control is needed.
|
|
7
|
+
*
|
|
8
|
+
* Useful when controlling animation with Vue animation libraries.
|
|
9
|
+
*/
|
|
10
|
+
forceMount?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface TrapFocusProps {
|
|
13
|
+
/**
|
|
14
|
+
* When `true`, focus cannot escape the content via keyboard, pointer, or a programmatic focus.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
18
|
+
trapFocus?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface DismissableLayerProps {
|
|
21
|
+
/**
|
|
22
|
+
* When `true`, hover/focus/click interactions will be disabled on elements outside the `DismissableLayer`. Users will
|
|
23
|
+
* need to click twice on outside elements to interact with them: once to close the `DismissableLayer`, and again to
|
|
24
|
+
* trigger the element.
|
|
25
|
+
*/
|
|
26
|
+
disableOutsidePointerEvents?: boolean;
|
|
27
|
+
}
|
|
28
|
+
type DismissableLayerEmits = {
|
|
29
|
+
/** Event handler called when the escape key is down. Can be prevented. */
|
|
30
|
+
escapeKeyDown: [event: KeyboardEvent];
|
|
31
|
+
/** Event handler called when a `pointerdown` event happens outside of the `DismissableLayer`. Can be prevented. */
|
|
32
|
+
pointerDownOutside: [event: PointerDownOutsideEvent];
|
|
33
|
+
/** Event handler called when the focus moves outside of the `DismissableLayer`. Can be prevented. */
|
|
34
|
+
focusOutside: [event: FocusOutsideEvent];
|
|
35
|
+
/**
|
|
36
|
+
* Event handler called when an interaction happens outside the `DismissableLayer`. Specifically, when a `pointerdown`
|
|
37
|
+
* event happens outside or focus moves outside of it. Can be prevented.
|
|
38
|
+
*/
|
|
39
|
+
interactOutside: [event: PointerDownOutsideEvent | FocusOutsideEvent];
|
|
40
|
+
};
|
|
41
|
+
type FocusScopeEmits = {
|
|
42
|
+
/** Event handler called when auto-focusing on open. Can be prevented. */
|
|
43
|
+
openAutoFocus: [event: Event];
|
|
44
|
+
/** Event handler called when auto-focusing on close. Can be prevented. */
|
|
45
|
+
closeAutoFocus: [event: Event];
|
|
46
|
+
};
|
|
47
|
+
interface FormNameValueProps<T = unknown> {
|
|
48
|
+
name: string;
|
|
49
|
+
value: T;
|
|
50
|
+
}
|
|
51
|
+
interface FormFieldCommonProps {
|
|
52
|
+
/** The name of the field. Submitted with its owning form as part of a name/value pair. */
|
|
53
|
+
name?: string;
|
|
54
|
+
/** When `true`, indicates that the user must set the value before the owning form can be submitted. */
|
|
55
|
+
required?: boolean;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { DismissableLayerEmits, DismissableLayerProps, FocusScopeEmits, ForceMountProps, FormFieldCommonProps, FormNameValueProps, TrapFocusProps };
|