@soybeanjs/headless 0.16.0 → 0.18.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/README.md +10 -5
- package/README.zh-CN.md +10 -5
- package/dist/components/_icon/types.d.ts +9 -0
- package/dist/components/accordion/types.d.ts +87 -0
- package/dist/components/affix/types.d.ts +39 -0
- package/dist/components/alert/types.d.ts +78 -0
- package/dist/components/anchor/anchor-compact.js +1 -1
- package/dist/components/anchor/{anchor-compact-item.js → anchor-item-compact.js} +1 -1
- package/dist/components/anchor/anchor-item-compact.vue.d.ts +8 -0
- package/dist/components/anchor/anchor-link.js +1 -1
- package/dist/components/anchor/index.d.ts +5 -4
- package/dist/components/anchor/index.js +1 -1
- package/dist/components/anchor/types.d.ts +122 -10
- package/dist/components/arrow/types.d.ts +3 -0
- package/dist/components/aspect-ratio/types.d.ts +3 -0
- package/dist/components/autocomplete/autocomplete-root.vue.d.ts +1 -1
- package/dist/components/autocomplete/types.d.ts +141 -0
- package/dist/components/avatar/avatar-compact.js +1 -0
- package/dist/components/avatar/avatar-compact.vue.d.ts +20 -0
- package/dist/components/avatar/avatar-fallback.js +1 -1
- package/dist/components/avatar/avatar-image.js +1 -1
- package/dist/components/avatar/avatar-root.js +1 -1
- package/dist/components/avatar/index.d.ts +6 -5
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/types.d.ts +50 -1
- package/dist/components/backtop/backtop.vue.d.ts +10 -4
- package/dist/components/backtop/index.d.ts +2 -2
- package/dist/components/backtop/types.d.ts +19 -12
- package/dist/components/badge/badge-compact.js +1 -0
- package/dist/components/badge/badge-compact.vue.d.ts +21 -0
- package/dist/components/badge/badge-content.js +1 -1
- package/dist/components/badge/badge-root.js +1 -1
- package/dist/components/badge/index.d.ts +5 -4
- package/dist/components/badge/index.js +1 -1
- package/dist/components/badge/types.d.ts +42 -1
- package/dist/components/bottom-sheet/bottom-sheet-compact.js +1 -1
- package/dist/components/bottom-sheet/bottom-sheet-root-nested.js +1 -1
- package/dist/components/bottom-sheet/bottom-sheet-root.js +1 -1
- package/dist/components/bottom-sheet/types.d.ts +99 -0
- package/dist/components/breadcrumb/index.d.ts +2 -2
- package/dist/components/breadcrumb/types.d.ts +103 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/button.vue.d.ts +2 -2
- package/dist/components/button/types.d.ts +18 -3
- package/dist/components/calendar/calendar-root.js +1 -1
- package/dist/components/calendar/types.d.ts +363 -0
- package/dist/components/card/card-root.vue.d.ts +1 -1
- package/dist/components/card/types.d.ts +90 -0
- package/dist/components/carousel/carousel-compact.js +1 -0
- package/dist/components/carousel/carousel-compact.vue.d.ts +23 -0
- package/dist/components/carousel/carousel-container.js +1 -0
- package/dist/components/carousel/carousel-container.vue.d.ts +18 -0
- package/dist/components/carousel/carousel-content.js +1 -1
- package/dist/components/carousel/carousel-control.js +1 -0
- package/dist/components/carousel/carousel-control.vue.d.ts +18 -0
- package/dist/components/carousel/carousel-item.js +1 -1
- package/dist/components/carousel/carousel-navigation.js +1 -0
- package/dist/components/carousel/carousel-navigation.vue.d.ts +18 -0
- package/dist/components/carousel/carousel-next.js +1 -1
- package/dist/components/carousel/carousel-next.vue.d.ts +2 -12
- package/dist/components/carousel/carousel-previous.js +1 -1
- package/dist/components/carousel/carousel-previous.vue.d.ts +2 -12
- package/dist/components/carousel/carousel-root.js +1 -1
- package/dist/components/carousel/carousel-root.vue.d.ts +6 -28
- package/dist/components/carousel/context.d.ts +0 -1
- package/dist/components/carousel/context.js +1 -1
- package/dist/components/carousel/hooks.js +1 -0
- package/dist/components/carousel/index.d.ts +11 -9
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/carousel/types.d.ts +146 -12
- package/dist/components/checkbox/types.d.ts +111 -0
- package/dist/components/clipboard/clipboard.vue.d.ts +2 -2
- package/dist/components/clipboard/types.d.ts +43 -1
- package/dist/components/collapsible/collapsible-root.vue.d.ts +1 -1
- package/dist/components/collapsible/types.d.ts +18 -0
- package/dist/components/color-area/color-area-root.vue.d.ts +2 -2
- package/dist/components/color-area/types.d.ts +60 -0
- package/dist/components/color-field/color-field-root.vue.d.ts +2 -2
- package/dist/components/color-field/types.d.ts +51 -0
- package/dist/components/color-picker/color-picker-root.vue.d.ts +1 -1
- package/dist/components/color-picker/types.d.ts +39 -0
- package/dist/components/color-slider/color-slider-root.vue.d.ts +2 -2
- package/dist/components/color-slider/types.d.ts +60 -0
- package/dist/components/color-swatch/types.d.ts +9 -0
- package/dist/components/color-swatch-picker/color-swatch-picker-root.vue.d.ts +2 -2
- package/dist/components/color-swatch-picker/types.d.ts +27 -0
- package/dist/components/combobox/combobox-compact.vue.d.ts +2 -2
- package/dist/components/combobox/combobox-content.vue.d.ts +1 -1
- package/dist/components/combobox/types.d.ts +237 -0
- package/dist/components/command/command-compact.vue.d.ts +2 -2
- package/dist/components/command/types.d.ts +147 -0
- package/dist/components/config-provider/config-provider.js +12 -0
- package/dist/components/config-provider/types.d.ts +3 -0
- package/dist/components/context-menu/context-menu-checkbox-compact.js +1 -1
- package/dist/components/context-menu/context-menu-checkbox-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-compact.js +1 -1
- package/dist/components/context-menu/context-menu-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-content.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-radio-compact.js +1 -1
- package/dist/components/context-menu/context-menu-radio-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-root.js +1 -1
- package/dist/components/context-menu/context-menu-wrapper-compact.js +1 -1
- package/dist/components/context-menu/context-menu-wrapper-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/types.d.ts +78 -0
- package/dist/components/date-field/types.d.ts +147 -0
- package/dist/components/date-picker/context.js +1 -1
- package/dist/components/date-picker/date-picker-compact.js +1 -0
- package/dist/components/date-picker/date-picker-compact.vue.d.ts +27 -0
- package/dist/components/date-picker/date-picker-content.js +1 -0
- package/dist/components/date-picker/date-picker-content.vue.d.ts +33 -0
- package/dist/components/date-picker/date-picker-root.js +1 -1
- package/dist/components/date-picker/date-picker-root.vue.d.ts +3 -8
- package/dist/components/date-picker/index.d.ts +8 -5
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-picker/types.d.ts +236 -10
- package/dist/components/date-range-field/types.d.ts +192 -0
- package/dist/components/date-range-picker/date-range-picker-compact.vue.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker-root.vue.d.ts +3 -3
- package/dist/components/date-range-picker/types.d.ts +189 -0
- package/dist/components/dialog/dialog-compact.js +1 -1
- package/dist/components/dialog/dialog-compact.vue.d.ts +1 -1
- package/dist/components/dialog/dialog-root.js +1 -1
- package/dist/components/dialog/types.d.ts +196 -2
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-content.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-radio-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-radio-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-root.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-wrapper-compact.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-wrapper-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/types.d.ts +84 -0
- package/dist/components/editable/types.d.ts +123 -0
- package/dist/components/empty/empty-compact.js +1 -0
- package/dist/components/empty/empty-compact.vue.d.ts +15 -0
- package/dist/components/empty/empty-content.js +1 -1
- package/dist/components/empty/empty-description.js +1 -1
- package/dist/components/empty/empty-header.js +1 -1
- package/dist/components/empty/empty-media.js +1 -1
- package/dist/components/empty/empty-root.js +1 -1
- package/dist/components/empty/empty-title.js +1 -1
- package/dist/components/empty/index.d.ts +9 -8
- package/dist/components/empty/index.js +1 -1
- package/dist/components/empty/types.d.ts +88 -1
- package/dist/components/form/context.d.ts +3 -2
- package/dist/components/form/context.js +1 -1
- package/dist/components/form/core/types.d.ts +399 -16
- package/dist/components/form/core/use-form.js +1 -1
- package/dist/components/form/form-compact.js +1 -0
- package/dist/components/form/form-compact.vue.d.ts +21 -0
- package/dist/components/form/form-control.js +1 -1
- package/dist/components/form/form-description.js +1 -1
- package/dist/components/form/form-error.js +1 -1
- package/dist/components/form/form-field-array-compact.js +1 -0
- package/dist/components/form/form-field-array-compact.vue.d.ts +16 -0
- package/dist/components/form/form-field-base-compact.js +1 -0
- package/dist/components/form/form-field-base-compact.vue.d.ts +26 -0
- package/dist/components/form/form-field-compact.js +1 -0
- package/dist/components/form/form-field-compact.vue.d.ts +16 -0
- package/dist/components/form/form-field.js +1 -1
- package/dist/components/form/form-label.js +1 -1
- package/dist/components/form/index.d.ts +14 -10
- package/dist/components/form/index.js +1 -1
- package/dist/components/form/shared.js +1 -0
- package/dist/components/form/types.d.ts +149 -3
- package/dist/components/form/use-form.d.ts +8 -0
- package/dist/components/form/use-form.js +1 -0
- package/dist/components/hover-card/hover-card-compact.vue.d.ts +1 -1
- package/dist/components/hover-card/hover-card-positioner-impl.js +1 -1
- package/dist/components/hover-card/hover-card-root.vue.d.ts +1 -1
- package/dist/components/hover-card/types.d.ts +57 -0
- package/dist/components/input/index.d.ts +6 -4
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/input-clear.js +1 -0
- package/dist/components/input/input-clear.vue.d.ts +22 -0
- package/dist/components/input/input-compact.js +1 -0
- package/dist/components/input/input-compact.vue.d.ts +21 -0
- package/dist/components/input/input-control.js +1 -1
- package/dist/components/input/input-root.js +1 -1
- package/dist/components/input/types.d.ts +94 -2
- package/dist/components/input-number/input-number-root.vue.d.ts +1 -1
- package/dist/components/input-number/types.d.ts +30 -0
- package/dist/components/input-otp/index.d.ts +1 -2
- package/dist/components/input-otp/index.js +1 -1
- package/dist/components/input-otp/input-otp-root.vue.d.ts +1 -1
- package/dist/components/input-otp/types.d.ts +186 -0
- package/dist/components/kbd/types.d.ts +6 -0
- package/dist/components/label/types.d.ts +3 -0
- package/dist/components/layout/layout-classic-compact.vue.d.ts +1 -1
- package/dist/components/layout/layout-compact.vue.d.ts +1 -1
- package/dist/components/layout/layout-root.vue.d.ts +2 -2
- package/dist/components/layout/types.d.ts +124 -10
- package/dist/components/link/types.d.ts +12 -0
- package/dist/components/list/types.d.ts +21 -0
- package/dist/components/listbox/listbox-root.vue.d.ts +2 -2
- package/dist/components/listbox/types.d.ts +66 -0
- package/dist/components/menu/menu-content.vue.d.ts +2 -2
- package/dist/components/menu/menu-option-compact.js +1 -1
- package/dist/components/menu/menu-option-compact.vue.d.ts +2 -2
- package/dist/components/menu/menu-options-compact.js +1 -1
- package/dist/components/menu/menu-options-compact.vue.d.ts +2 -2
- package/dist/components/menu/menu-root.js +1 -1
- package/dist/components/menu/menu-sub-content.vue.d.ts +2 -2
- package/dist/components/menu/types.d.ts +266 -2
- package/dist/components/menubar/menubar-compact.js +1 -1
- package/dist/components/menubar/menubar-compact.vue.d.ts +2 -2
- package/dist/components/menubar/menubar-content.vue.d.ts +2 -2
- package/dist/components/menubar/menubar-sub-content.vue.d.ts +2 -2
- package/dist/components/menubar/types.d.ts +72 -0
- package/dist/components/month-picker/month-picker-root.vue.d.ts +1 -1
- package/dist/components/month-picker/types.d.ts +141 -0
- package/dist/components/month-range-picker/month-range-picker-root.vue.d.ts +3 -3
- package/dist/components/month-range-picker/types.d.ts +165 -0
- package/dist/components/navigation-menu/types.d.ts +96 -9
- package/dist/components/page-tabs/types.d.ts +24 -0
- package/dist/components/pagination/types.d.ts +96 -0
- package/dist/components/popover/context.d.ts +9 -0
- package/dist/components/popover/context.js +1 -1
- package/dist/components/popover/index.d.ts +6 -6
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover-compact.js +1 -1
- package/dist/components/popover/popover-compact.vue.d.ts +1 -1
- package/dist/components/popover/popover-root.js +1 -1
- package/dist/components/popover/popover-root.vue.d.ts +0 -2
- package/dist/components/popover/popover-trigger.js +1 -1
- package/dist/components/popover/types.d.ts +94 -6
- package/dist/components/popper/popper-positioner.vue.d.ts +1 -1
- package/dist/components/popper/types.d.ts +21 -0
- package/dist/components/portal/types.d.ts +3 -0
- package/dist/components/primitive/types.d.ts +6 -0
- package/dist/components/progress/types.d.ts +81 -0
- package/dist/components/radio-group/types.d.ts +66 -0
- package/dist/components/range-calendar/types.d.ts +330 -0
- package/dist/components/roving-focus/types.d.ts +18 -0
- package/dist/components/scroll-area/types.d.ts +33 -0
- package/dist/components/segment/types.d.ts +36 -0
- package/dist/components/select/select-content.vue.d.ts +1 -1
- package/dist/components/select/types.d.ts +240 -0
- package/dist/components/separator/types.d.ts +12 -0
- package/dist/components/skeleton/types.d.ts +3 -0
- package/dist/components/slider/slider-root.vue.d.ts +2 -2
- package/dist/components/slider/types.d.ts +90 -0
- package/dist/components/splitter/splitter-group.vue.d.ts +1 -1
- package/dist/components/splitter/types.d.ts +114 -0
- package/dist/components/stepper/stepper-root.vue.d.ts +1 -1
- package/dist/components/stepper/types.d.ts +96 -0
- package/dist/components/switch/types.d.ts +21 -0
- package/dist/components/table/types.d.ts +819 -0
- package/dist/components/tabs/tabs-root.vue.d.ts +1 -1
- package/dist/components/tabs/types.d.ts +75 -0
- package/dist/components/tag/types.d.ts +12 -0
- package/dist/components/tags-input/types.d.ts +63 -0
- package/dist/components/textarea/types.d.ts +27 -0
- package/dist/components/time-field/types.d.ts +138 -0
- package/dist/components/time-picker/time-picker-root.vue.d.ts +1 -1
- package/dist/components/time-picker/types.d.ts +156 -0
- package/dist/components/time-range-field/time-range-field-root.vue.d.ts +1 -1
- package/dist/components/time-range-field/types.d.ts +192 -0
- package/dist/components/time-range-picker/time-range-picker-compact.vue.d.ts +2 -2
- package/dist/components/time-range-picker/time-range-picker-root.vue.d.ts +3 -3
- package/dist/components/time-range-picker/types.d.ts +201 -0
- package/dist/components/toast/toaster.vue.d.ts +2 -2
- package/dist/components/toast/types.d.ts +224 -4
- package/dist/components/toggle/types.d.ts +9 -0
- package/dist/components/toggle-group/types.d.ts +15 -0
- package/dist/components/toolbar/toolbar-button.vue.d.ts +2 -2
- package/dist/components/toolbar/types.d.ts +48 -0
- package/dist/components/tooltip/tooltip-root.vue.d.ts +1 -1
- package/dist/components/tooltip/types.d.ts +27 -0
- package/dist/components/tree/types.d.ts +75 -0
- package/dist/components/tree-menu/types.d.ts +60 -0
- package/dist/components/virtualizer/types.d.ts +33 -0
- package/dist/components/visually-hidden/types.d.ts +30 -0
- package/dist/components/year-picker/types.d.ts +144 -0
- package/dist/components/year-picker/year-picker-root.vue.d.ts +1 -1
- package/dist/components/year-range-picker/types.d.ts +168 -0
- package/dist/components/year-range-picker/year-range-picker-root.vue.d.ts +3 -3
- package/dist/composables/use-collection.js +1 -1
- package/dist/constants/components.d.ts +5 -5
- package/dist/constants/components.js +1 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.js +1 -1
- package/dist/{components/input-otp → constants}/regexp.d.ts +1 -1
- package/dist/date/parts.d.ts +1 -1
- package/dist/index.d.ts +440 -428
- package/dist/index.js +1 -1
- package/dist/namespaced/index.d.ts +903 -872
- package/dist/namespaced/index.js +1 -1
- package/dist/node_modules/.pnpm/@soybeanjs_utils@0.1.1/node_modules/@soybeanjs/utils/dist/index.js +1 -1
- package/dist/resolver/index.js +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/shared/string.d.ts +1 -34
- package/dist/shared/string.js +1 -1
- package/dist/types/common.d.ts +10 -2
- package/dist/types/dom.d.ts +3 -1
- package/dist/types/event.d.ts +10 -1
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.js +0 -0
- package/dist/types/vue.d.ts +4 -1
- package/package.json +9 -2
- package/dist/components/date-picker/date-picker-popup.js +0 -1
- package/dist/components/date-picker/date-picker-popup.vue.d.ts +0 -21
- package/dist/components/date-picker/date-picker-trigger.js +0 -1
- package/dist/components/date-picker/date-picker-trigger.vue.d.ts +0 -21
- package/dist/components/form/core/use-form.d.ts +0 -7
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Alignment.d.ts +0 -4
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Animations.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Axis.d.ts +0 -16
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Counter.d.ts +0 -9
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragHandler.d.ts +0 -13
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragTracker.d.ts +0 -4
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EmblaCarousel.d.ts +0 -31
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Engine.d.ts +0 -67
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventHandler.d.ts +0 -29
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventStore.d.ts +0 -10
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Limit.d.ts +0 -13
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/NodeRects.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Options.d.ts +0 -43
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/OptionsHandler.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/PercentOfView.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Plugins.d.ts +0 -20
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ResizeHandler.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBody.d.ts +0 -14
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBounds.d.ts +0 -8
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollContain.d.ts +0 -4
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollLooper.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollProgress.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTarget.d.ts +0 -12
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTo.d.ts +0 -7
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideFocus.d.ts +0 -10
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideLooper.d.ts +0 -19
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideRegistry.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesHandler.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesInView.d.ts +0 -9
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesToScroll.d.ts +0 -7
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Translate.d.ts +0 -8
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Vector1d.d.ts +0 -9
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/utils.d.ts +0 -4
- /package/dist/{components/input-otp → constants}/regexp.js +0 -0
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ A collection of unstyled, accessible UI primitives for Vue 3.
|
|
|
13
13
|
|
|
14
14
|
Some multi-slot components also expose `Compact` aggregators, such as `AccordionCompact` and `TableCompact`. These headless entry points own item iteration and default content/icon composition, while styled wrappers stay focused on classes and prop forwarding.
|
|
15
15
|
|
|
16
|
+
Current Compact coverage also includes stable structures such as card, date-field, dialog, editable, hover-card, layout, navigation-menu, pagination, popover, and stepper.
|
|
17
|
+
|
|
16
18
|
## 📦 Installation
|
|
17
19
|
|
|
18
20
|
```bash
|
|
@@ -63,27 +65,30 @@ import {
|
|
|
63
65
|
|
|
64
66
|
```
|
|
65
67
|
headless/src/
|
|
66
|
-
├── components/ #
|
|
67
|
-
├── composables/ #
|
|
68
|
+
├── components/ # 95 component dirs (accordion, dialog, select…)
|
|
69
|
+
├── composables/ # 25 shared hooks (state, focus, floating, selection…)
|
|
68
70
|
├── shared/ # Pure TS utilities (DOM, focus, tree, form, guard)
|
|
69
71
|
├── constants/ # ARIA attributes, component keys
|
|
72
|
+
├── date/ # Shared date and calendar helpers
|
|
70
73
|
├── types/ # Global types (ClassValue, UiClass, PropsToContext…)
|
|
71
|
-
└── index.ts
|
|
74
|
+
└── index.ts # Main barrel export
|
|
72
75
|
```
|
|
73
76
|
|
|
74
77
|
### Sub-path Exports
|
|
75
78
|
|
|
76
79
|
```ts
|
|
77
80
|
import { AccordionRoot } from '@soybeanjs/headless'; // components + types
|
|
78
|
-
import { useControllableState } from '@soybeanjs/headless/composables'; //
|
|
81
|
+
import { useControllableState } from '@soybeanjs/headless/composables'; // 25 composables
|
|
79
82
|
import { transformPropsToContext } from '@soybeanjs/headless/shared'; // pure TS utils
|
|
83
|
+
import { createMonth } from '@soybeanjs/headless/date'; // shared date helpers
|
|
80
84
|
import * as H from '@soybeanjs/headless/namespaced'; // namespace object
|
|
81
85
|
import type { AccordionUiSlot } from '@soybeanjs/headless/accordion'; // per-component
|
|
86
|
+
import type { UiClass } from '@soybeanjs/headless/types'; // shared type surface
|
|
82
87
|
```
|
|
83
88
|
|
|
84
89
|
## 🧩 Composables
|
|
85
90
|
|
|
86
|
-
|
|
91
|
+
25 hooks organized by category:
|
|
87
92
|
|
|
88
93
|
| Category | Composables |
|
|
89
94
|
| ------------- | -------------------------------------------------------------- |
|
package/README.zh-CN.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
部分多插槽组件还会暴露 `Compact` 聚合层,例如 `AccordionCompact` 和 `TableCompact`。这些 headless 入口负责条目遍历以及默认内容 / 图标组合,而样式包装层只专注于类名和 props 转发。
|
|
15
15
|
|
|
16
|
+
目前这类 Compact 约定式组合还覆盖了 card、date-field、dialog、editable、hover-card、layout、navigation-menu、pagination、popover、stepper 等稳定结构。
|
|
17
|
+
|
|
16
18
|
## 📦 安装
|
|
17
19
|
|
|
18
20
|
```bash
|
|
@@ -63,27 +65,30 @@ import {
|
|
|
63
65
|
|
|
64
66
|
```
|
|
65
67
|
headless/src/
|
|
66
|
-
├── components/ #
|
|
67
|
-
├── composables/ #
|
|
68
|
+
├── components/ # 95 个组件目录(accordion、dialog、select…)
|
|
69
|
+
├── composables/ # 25 个共享 hook(状态、焦点、浮层、选择…)
|
|
68
70
|
├── shared/ # 纯 TS 工具函数(DOM、焦点、树、表单、守卫)
|
|
69
71
|
├── constants/ # ARIA 属性常量、组件标识键
|
|
72
|
+
├── date/ # 共享日期与日历工具
|
|
70
73
|
├── types/ # 全局类型(ClassValue、UiClass、PropsToContext…)
|
|
71
|
-
└── index.ts
|
|
74
|
+
└── index.ts # 主 barrel 导出
|
|
72
75
|
```
|
|
73
76
|
|
|
74
77
|
### 子路径导出
|
|
75
78
|
|
|
76
79
|
```ts
|
|
77
80
|
import { AccordionRoot } from '@soybeanjs/headless'; // 组件 + 类型
|
|
78
|
-
import { useControllableState } from '@soybeanjs/headless/composables'; //
|
|
81
|
+
import { useControllableState } from '@soybeanjs/headless/composables'; // 25 个 composable
|
|
79
82
|
import { transformPropsToContext } from '@soybeanjs/headless/shared'; // 纯 TS 工具
|
|
83
|
+
import { createMonth } from '@soybeanjs/headless/date'; // 日期工具
|
|
80
84
|
import * as H from '@soybeanjs/headless/namespaced'; // 命名空间导入
|
|
81
85
|
import type { AccordionUiSlot } from '@soybeanjs/headless/accordion'; // 单组件类型
|
|
86
|
+
import type { UiClass } from '@soybeanjs/headless/types'; // 共享类型导出
|
|
82
87
|
```
|
|
83
88
|
|
|
84
89
|
## 🧩 Composables
|
|
85
90
|
|
|
86
|
-
|
|
91
|
+
25 个 hook,按功能分类:
|
|
87
92
|
|
|
88
93
|
| 分类 | Composables |
|
|
89
94
|
| -------- | -------------------------------------------------------------- |
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { Component, VNode } from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/components/_icon/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Type information for IconValue.
|
|
6
|
+
*/
|
|
4
7
|
type IconValue = VNode | Component | string | null | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Properties for the Icon component.
|
|
10
|
+
*/
|
|
5
11
|
interface IconProps {
|
|
12
|
+
/**
|
|
13
|
+
* Icon rendered by the component.
|
|
14
|
+
*/
|
|
6
15
|
icon: IconValue;
|
|
7
16
|
}
|
|
8
17
|
//#endregion
|
|
@@ -4,6 +4,9 @@ import { CollapsibleContentProps, CollapsibleRootProps, CollapsibleTriggerProps
|
|
|
4
4
|
import { ComputedRef, HTMLAttributes, ShallowRef } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/accordion/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Properties for the AccordionRoot component.
|
|
9
|
+
*/
|
|
7
10
|
interface AccordionRootProps<M extends boolean = false> extends SelectionProps<M>, /** @vue-ignore */HTMLAttributes {
|
|
8
11
|
/**
|
|
9
12
|
* When type is "single", allows closing content when clicking trigger for an open item.
|
|
@@ -38,15 +41,36 @@ interface AccordionRootProps<M extends boolean = false> extends SelectionProps<M
|
|
|
38
41
|
*/
|
|
39
42
|
unmountOnHide?: boolean;
|
|
40
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Events for the AccordionRoot component.
|
|
46
|
+
*/
|
|
41
47
|
type AccordionRootEmits<M extends boolean = false> = SelectionEmits<M>;
|
|
48
|
+
/**
|
|
49
|
+
* Properties for the AccordionItem component.
|
|
50
|
+
*/
|
|
42
51
|
interface AccordionItemProps extends Omit<CollapsibleRootProps, 'open' | 'defaultOpen' | 'onOpenChange'> {
|
|
43
52
|
/** Value of the accordion item. All items within an accordion should use a unique value. */
|
|
44
53
|
value: string;
|
|
45
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Properties for the AccordionHeader component.
|
|
57
|
+
*/
|
|
46
58
|
interface AccordionHeaderProps extends /** @vue-ignore */HTMLAttributes {}
|
|
59
|
+
/**
|
|
60
|
+
* Properties for the AccordionTrigger component.
|
|
61
|
+
*/
|
|
47
62
|
interface AccordionTriggerProps extends CollapsibleTriggerProps {}
|
|
63
|
+
/**
|
|
64
|
+
* Properties for the AccordionContent component.
|
|
65
|
+
*/
|
|
48
66
|
interface AccordionContentProps extends CollapsibleContentProps {}
|
|
67
|
+
/**
|
|
68
|
+
* Properties for the AccordionDescription component.
|
|
69
|
+
*/
|
|
49
70
|
interface AccordionDescriptionProps extends /** @vue-ignore */HTMLAttributes {}
|
|
71
|
+
/**
|
|
72
|
+
* Option data for the Accordion component.
|
|
73
|
+
*/
|
|
50
74
|
interface AccordionOptionData extends Pick<AccordionItemProps, 'value' | 'disabled'> {
|
|
51
75
|
/** The title of the accordion item. */
|
|
52
76
|
title?: string;
|
|
@@ -57,29 +81,92 @@ interface AccordionOptionData extends Pick<AccordionItemProps, 'value' | 'disabl
|
|
|
57
81
|
*/
|
|
58
82
|
icon?: IconValue;
|
|
59
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Properties for the AccordionCompact component.
|
|
86
|
+
*/
|
|
60
87
|
interface AccordionCompactProps<T extends AccordionOptionData = AccordionOptionData, M extends boolean = false> extends AccordionRootProps<M> {
|
|
88
|
+
/**
|
|
89
|
+
* Items rendered by the component.
|
|
90
|
+
*/
|
|
61
91
|
items: T[];
|
|
92
|
+
/**
|
|
93
|
+
* Properties forwarded to the item element.
|
|
94
|
+
*/
|
|
62
95
|
itemProps?: AccordionItemProps;
|
|
96
|
+
/**
|
|
97
|
+
* Properties forwarded to the header element.
|
|
98
|
+
*/
|
|
63
99
|
headerProps?: AccordionHeaderProps;
|
|
100
|
+
/**
|
|
101
|
+
* Properties forwarded to the trigger element.
|
|
102
|
+
*/
|
|
64
103
|
triggerProps?: AccordionTriggerProps;
|
|
104
|
+
/**
|
|
105
|
+
* Properties forwarded to the content element.
|
|
106
|
+
*/
|
|
65
107
|
contentProps?: AccordionContentProps;
|
|
108
|
+
/**
|
|
109
|
+
* Properties forwarded to the description element.
|
|
110
|
+
*/
|
|
66
111
|
descriptionProps?: AccordionDescriptionProps;
|
|
67
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Events for the AccordionCompact component.
|
|
115
|
+
*/
|
|
68
116
|
type AccordionCompactEmits<M extends boolean = false> = AccordionRootEmits<M>;
|
|
117
|
+
/**
|
|
118
|
+
* Slot properties for the AccordionCompact component.
|
|
119
|
+
*/
|
|
69
120
|
interface AccordionCompactSlotProps<T extends AccordionOptionData = AccordionOptionData, M extends boolean = false> {
|
|
121
|
+
/**
|
|
122
|
+
* Current item data.
|
|
123
|
+
*/
|
|
70
124
|
item: T;
|
|
125
|
+
/**
|
|
126
|
+
* Index of the current item.
|
|
127
|
+
*/
|
|
71
128
|
index: number;
|
|
129
|
+
/**
|
|
130
|
+
* Current model value.
|
|
131
|
+
*/
|
|
72
132
|
modelValue: (M extends true ? string[] : string) | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Whether the component is open.
|
|
135
|
+
*/
|
|
73
136
|
open: boolean;
|
|
74
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Slots for the AccordionCompact component.
|
|
140
|
+
*/
|
|
75
141
|
type AccordionCompactSlots<T extends AccordionOptionData = AccordionOptionData, M extends boolean = false> = {
|
|
142
|
+
/**
|
|
143
|
+
* Custom content for the item slot.
|
|
144
|
+
*/
|
|
76
145
|
item?: (props: AccordionCompactSlotProps<T, M>) => any;
|
|
146
|
+
/**
|
|
147
|
+
* Custom content for the leading slot.
|
|
148
|
+
*/
|
|
77
149
|
leading?: (props: AccordionCompactSlotProps<T, M>) => any;
|
|
150
|
+
/**
|
|
151
|
+
* Custom content for the title slot.
|
|
152
|
+
*/
|
|
78
153
|
title?: (props: AccordionCompactSlotProps<T, M>) => any;
|
|
154
|
+
/**
|
|
155
|
+
* Custom content for the trigger icon slot.
|
|
156
|
+
*/
|
|
79
157
|
'trigger-icon'?: (props: AccordionCompactSlotProps<T, M>) => any;
|
|
158
|
+
/**
|
|
159
|
+
* Custom content for the content slot.
|
|
160
|
+
*/
|
|
80
161
|
content?: (props: AccordionCompactSlotProps<T, M>) => any;
|
|
81
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* Available UI slots for the Accordion component.
|
|
165
|
+
*/
|
|
82
166
|
type AccordionUiSlot = 'root' | 'item' | 'header' | 'trigger' | 'content' | 'description' | 'triggerLeadingIcon' | 'triggerIcon';
|
|
167
|
+
/**
|
|
168
|
+
* UI class overrides for the Accordion component.
|
|
169
|
+
*/
|
|
83
170
|
type AccordionUi = UiClass<AccordionUiSlot>;
|
|
84
171
|
//#endregion
|
|
85
172
|
export { AccordionCompactEmits, AccordionCompactProps, AccordionCompactSlotProps, AccordionCompactSlots, AccordionContentProps, AccordionDescriptionProps, AccordionHeaderProps, AccordionItemProps, AccordionOptionData, AccordionRootEmits, AccordionRootProps, AccordionTriggerProps, AccordionUi, AccordionUiSlot };
|
|
@@ -2,8 +2,17 @@ import { UiClass } from "../../types/common.js";
|
|
|
2
2
|
import { ComputedRef, HTMLAttributes, ShallowRef } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/affix/types.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Type information for AffixTarget.
|
|
7
|
+
*/
|
|
5
8
|
type AffixTarget = string | Window | HTMLElement | (() => HTMLElement);
|
|
9
|
+
/**
|
|
10
|
+
* State values for AffixState.
|
|
11
|
+
*/
|
|
6
12
|
type AffixState = 'fixed' | 'static';
|
|
13
|
+
/**
|
|
14
|
+
* Properties for the AffixRoot component.
|
|
15
|
+
*/
|
|
7
16
|
interface AffixRootProps extends /** @vue-ignore */Omit<HTMLAttributes, 'onChange'> {
|
|
8
17
|
/**
|
|
9
18
|
* The offset from the top of the target container when the element becomes affixed.
|
|
@@ -22,17 +31,47 @@ interface AffixRootProps extends /** @vue-ignore */Omit<HTMLAttributes, 'onChang
|
|
|
22
31
|
*/
|
|
23
32
|
target?: AffixTarget | null;
|
|
24
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Events for the AffixRoot component.
|
|
36
|
+
*/
|
|
25
37
|
type AffixRootEmits = {
|
|
38
|
+
/**
|
|
39
|
+
* Emitted when change occurs.
|
|
40
|
+
*/
|
|
26
41
|
change: [affixed: boolean];
|
|
27
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Properties for the AffixPlaceholder component.
|
|
45
|
+
*/
|
|
28
46
|
interface AffixPlaceholderProps extends /** @vue-ignore */HTMLAttributes {}
|
|
47
|
+
/**
|
|
48
|
+
* Properties for the AffixContent component.
|
|
49
|
+
*/
|
|
29
50
|
interface AffixContentProps extends /** @vue-ignore */HTMLAttributes {}
|
|
51
|
+
/**
|
|
52
|
+
* Properties for the AffixCompact component.
|
|
53
|
+
*/
|
|
30
54
|
interface AffixCompactProps extends AffixRootProps {
|
|
55
|
+
/**
|
|
56
|
+
* Properties forwarded to the placeholder element.
|
|
57
|
+
*/
|
|
31
58
|
placeholderProps?: AffixPlaceholderProps;
|
|
59
|
+
/**
|
|
60
|
+
* Properties forwarded to the content element.
|
|
61
|
+
*/
|
|
32
62
|
contentProps?: AffixContentProps;
|
|
33
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Events for the AffixCompact component.
|
|
66
|
+
*/
|
|
34
67
|
type AffixCompactEmits = AffixRootEmits;
|
|
68
|
+
/**
|
|
69
|
+
* Available UI slots for the Affix component.
|
|
70
|
+
*/
|
|
35
71
|
type AffixUiSlot = 'root' | 'placeholder' | 'content';
|
|
72
|
+
/**
|
|
73
|
+
* UI class overrides for the Affix component.
|
|
74
|
+
*/
|
|
36
75
|
type AffixUi = UiClass<AffixUiSlot>;
|
|
37
76
|
//#endregion
|
|
38
77
|
export { AffixCompactEmits, AffixCompactProps, AffixContentProps, AffixPlaceholderProps, AffixRootEmits, AffixRootProps, AffixState, AffixTarget, AffixUi, AffixUiSlot };
|
|
@@ -4,6 +4,9 @@ import { PrimitiveProps } from "../primitive/types.js";
|
|
|
4
4
|
import { ButtonHTMLAttributes, HTMLAttributes, ShallowRef } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/alert/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Properties for the AlertRoot component.
|
|
9
|
+
*/
|
|
7
10
|
interface AlertRootProps extends /** @vue-ignore */HTMLAttributes {
|
|
8
11
|
/**
|
|
9
12
|
* The controlled open state of the alert. Can be bound with `v-model:open`.
|
|
@@ -12,33 +15,108 @@ interface AlertRootProps extends /** @vue-ignore */HTMLAttributes {
|
|
|
12
15
|
*/
|
|
13
16
|
open?: boolean;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Events for the AlertRoot component.
|
|
20
|
+
*/
|
|
15
21
|
type AlertRootEmits = {
|
|
22
|
+
/**
|
|
23
|
+
* Emitted when the open changes.
|
|
24
|
+
*/
|
|
16
25
|
'update:open': [open: boolean];
|
|
17
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Properties for the AlertContent component.
|
|
29
|
+
*/
|
|
18
30
|
interface AlertContentProps extends /** @vue-ignore */HTMLAttributes {}
|
|
31
|
+
/**
|
|
32
|
+
* Properties for the AlertTitle component.
|
|
33
|
+
*/
|
|
19
34
|
interface AlertTitleProps extends /** @vue-ignore */HTMLAttributes {}
|
|
35
|
+
/**
|
|
36
|
+
* Properties for the AlertDescription component.
|
|
37
|
+
*/
|
|
20
38
|
interface AlertDescriptionProps extends /** @vue-ignore */HTMLAttributes {}
|
|
39
|
+
/**
|
|
40
|
+
* Properties for the AlertClose component.
|
|
41
|
+
*/
|
|
21
42
|
interface AlertCloseProps extends PrimitiveProps, /** @vue-ignore */ButtonHTMLAttributes {}
|
|
43
|
+
/**
|
|
44
|
+
* Properties for the AlertCompact component.
|
|
45
|
+
*/
|
|
22
46
|
interface AlertCompactProps extends AlertRootProps {
|
|
47
|
+
/**
|
|
48
|
+
* Title text rendered by the component.
|
|
49
|
+
*/
|
|
23
50
|
title?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Description text rendered by the component.
|
|
53
|
+
*/
|
|
24
54
|
description?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Icon rendered by the component.
|
|
57
|
+
*/
|
|
25
58
|
icon?: IconValue;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the component can be closed.
|
|
61
|
+
*/
|
|
26
62
|
closable?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Properties forwarded to the content element.
|
|
65
|
+
*/
|
|
27
66
|
contentProps?: AlertContentProps;
|
|
67
|
+
/**
|
|
68
|
+
* Properties forwarded to the title element.
|
|
69
|
+
*/
|
|
28
70
|
titleProps?: AlertTitleProps;
|
|
71
|
+
/**
|
|
72
|
+
* Properties forwarded to the description element.
|
|
73
|
+
*/
|
|
29
74
|
descriptionProps?: AlertDescriptionProps;
|
|
75
|
+
/**
|
|
76
|
+
* Properties forwarded to the close element.
|
|
77
|
+
*/
|
|
30
78
|
closeProps?: AlertCloseProps;
|
|
31
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Events for the AlertCompact component.
|
|
82
|
+
*/
|
|
32
83
|
type AlertCompactEmits = AlertRootEmits;
|
|
84
|
+
/**
|
|
85
|
+
* Slots for the AlertCompact component.
|
|
86
|
+
*/
|
|
33
87
|
type AlertCompactSlots = {
|
|
88
|
+
/**
|
|
89
|
+
* Custom content for the default slot.
|
|
90
|
+
*/
|
|
34
91
|
default?: () => any;
|
|
92
|
+
/**
|
|
93
|
+
* Custom content for the leading slot.
|
|
94
|
+
*/
|
|
35
95
|
leading?: () => any;
|
|
96
|
+
/**
|
|
97
|
+
* Custom content for the title slot.
|
|
98
|
+
*/
|
|
36
99
|
title?: () => any;
|
|
100
|
+
/**
|
|
101
|
+
* Custom content for the description slot.
|
|
102
|
+
*/
|
|
37
103
|
description?: () => any;
|
|
104
|
+
/**
|
|
105
|
+
* Custom content for the trailing slot.
|
|
106
|
+
*/
|
|
38
107
|
trailing?: () => any;
|
|
108
|
+
/**
|
|
109
|
+
* Custom content for the close slot.
|
|
110
|
+
*/
|
|
39
111
|
close?: () => any;
|
|
40
112
|
};
|
|
113
|
+
/**
|
|
114
|
+
* Available UI slots for the Alert component.
|
|
115
|
+
*/
|
|
41
116
|
type AlertUiSlot = 'root' | 'icon' | 'title' | 'description' | 'content' | 'close';
|
|
117
|
+
/**
|
|
118
|
+
* UI class overrides for the Alert component.
|
|
119
|
+
*/
|
|
42
120
|
type AlertUi = UiClass<AlertUiSlot>;
|
|
43
121
|
//#endregion
|
|
44
122
|
export { AlertCloseProps, AlertCompactEmits, AlertCompactProps, AlertCompactSlots, AlertContentProps, AlertDescriptionProps, AlertRootEmits, AlertRootProps, AlertTitleProps, AlertUi, AlertUiSlot };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useOmitProps as e}from"../../composables/use-props.js";import"../../composables/index.js";import t from"./anchor-compact
|
|
1
|
+
import{useOmitProps as e}from"../../composables/use-props.js";import"../../composables/index.js";import t from"./anchor-item-compact.js";import n from"./anchor-root.js";import{Fragment as r,createBlock as i,createElementBlock as a,defineComponent as o,mergeProps as s,openBlock as c,renderList as l,unref as u,withCtx as d}from"vue";const f=o({name:`AnchorCompact`,__name:`anchor-compact`,props:{items:{},linkProps:{},indicatorProps:{},titleProps:{},subProps:{},bounds:{},dir:{},getContainer:{type:Function},getCurrentAnchor:{type:Function},modelValue:{},offsetTop:{},orientation:{},replace:{type:Boolean},targetOffset:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`,`activeChange`,`itemSelect`],setup(o,{emit:f}){let p=o,m=f,h=e(p,[`items`,`linkProps`,`indicatorProps`,`titleProps`,`subProps`]),g=e=>{m(`update:modelValue`,e)},_=e=>{m(`activeChange`,e)},v=(e,t)=>{m(`itemSelect`,e,t)};return(e,f)=>(c(),i(n,s(u(h),{onActiveChange:_,onItemSelect:v,"onUpdate:modelValue":g}),{default:d(({modelValue:e})=>[(c(!0),a(r,null,l(o.items,n=>(c(),i(t,{key:n.href,item:n,"model-value":e,"link-props":o.linkProps,"indicator-props":o.indicatorProps,"title-props":o.titleProps,"sub-props":o.subProps},null,8,[`item`,`model-value`,`link-props`,`indicator-props`,`title-props`,`sub-props`]))),128))]),_:1},16))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useAnchorUi as e}from"./context.js";import t from"./anchor-link.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createVNode as c,defineComponent as l,mergeProps as u,normalizeClass as d,openBlock as f,renderList as p,resolveComponent as m,toDisplayString as h,unref as g,withCtx as _}from"vue";const v=[`data-state`],y=l({name:`
|
|
1
|
+
import{useAnchorUi as e}from"./context.js";import t from"./anchor-link.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createVNode as c,defineComponent as l,mergeProps as u,normalizeClass as d,openBlock as f,renderList as p,resolveComponent as m,toDisplayString as h,unref as g,withCtx as _}from"vue";const v=[`data-state`],y=l({name:`AnchorItemCompact`,__name:`anchor-item-compact`,props:{modelValue:{},item:{},linkProps:{},indicatorProps:{},titleProps:{},subProps:{}},setup(l){let y=l,b=e();function x(e,t){return e.href===t?!0:e.children?.some(e=>x(e,t))??!1}let S=r(()=>x(y.item,y.modelValue??``)?`active`:`inactive`);return(e,r)=>{let y=m(`AnchorItemCompact`,!0);return f(),o(`div`,{class:d(g(b).item),"data-state":S.value},[c(t,u(l.linkProps,{href:l.item.href,target:l.item.target,disabled:l.item.disabled}),{default:_(()=>[s(`span`,u(l.indicatorProps,{class:g(b).indicator,"aria-hidden":`true`}),null,16),s(`span`,u(l.titleProps,{class:g(b).title}),h(l.item.title||l.item.href),17)]),_:1},16,[`href`,`target`,`disabled`]),l.item.children?.length?(f(),o(`div`,u({key:0},l.subProps,{class:g(b).sub}),[(f(!0),o(n,null,p(l.item.children,e=>(f(),i(y,{key:e.href,"model-value":l.modelValue,item:e,"link-props":l.linkProps,"indicator-props":l.indicatorProps,"title-props":l.titleProps,"sub-props":l.subProps},null,8,[`model-value`,`item`,`link-props`,`indicator-props`,`title-props`,`sub-props`]))),128))],16)):a(`v-if`,!0)],10,v)}}});export{y as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnchorItemCompactProps } from "./types.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/anchor/anchor-item-compact.vue.d.ts
|
|
5
|
+
declare const __VLS_export: _$vue.DefineComponent<AnchorItemCompactProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<AnchorItemCompactProps> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Primitive as e}from"../primitive/primitive.js";import"../primitive/index.js";import{useAnchorRootContext as t,useAnchorUi as n}from"./context.js";import{computed as r,createBlock as i,defineComponent as a,normalizeClass as o,onWatcherCleanup as s,openBlock as c,renderSlot as l,unref as u,watch as d,withCtx as f}from"vue";const p=a({name:`AnchorLink`,__name:`anchor-link`,props:{href:{},asChild:{type:Boolean},as:{default:`a`},
|
|
1
|
+
import{Primitive as e}from"../primitive/primitive.js";import"../primitive/index.js";import{useAnchorRootContext as t,useAnchorUi as n}from"./context.js";import{computed as r,createBlock as i,defineComponent as a,normalizeClass as o,onWatcherCleanup as s,openBlock as c,renderSlot as l,unref as u,watch as d,withCtx as f}from"vue";const p=a({name:`AnchorLink`,__name:`anchor-link`,props:{href:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`a`},to:{},external:{type:Boolean},target:{}},setup(a){let p=a,m=n(`link`),{activeHref:h,onLinkClick:g,registerLink:_,scrollTo:v,unregisterLink:y}=t(`AnchorLink`),b=r(()=>h.value===p.href),x=r(()=>p.disabled?``:void 0),S=r(()=>b.value?`active`:`inactive`),C=e=>{if(g(e,{href:p.href}),p.disabled){e.preventDefault(),e.stopPropagation();return}!p.href.startsWith(`#`)||e.defaultPrevented||(e.preventDefault(),v(p.href))};return d(()=>p.href,e=>{_(e),s(()=>{y(e)})},{immediate:!0}),(t,n)=>(c(),i(u(e),{as:a.as,"as-child":a.asChild,href:a.href,class:o(u(m)),target:a.target,"aria-current":b.value?`location`:void 0,"aria-disabled":a.disabled?`true`:void 0,"data-disabled":x.value,"data-state":S.value,tabindex:a.disabled?-1:void 0,onClick:C},{default:f(()=>[l(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`href`,`class`,`target`,`aria-current`,`aria-disabled`,`data-disabled`,`data-state`,`tabindex`]))}});export{p as default};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AnchorCompactEmits,
|
|
1
|
+
import { AnchorCompactEmits, AnchorCompactProps, AnchorContainer, AnchorItemCompactProps, AnchorLinkProps, AnchorOptionData, AnchorRootEmits, AnchorRootProps, AnchorUi, AnchorUiSlot } from "./types.js";
|
|
2
2
|
import { _default } from "./anchor-compact.vue.js";
|
|
3
|
-
import { _default as _default$1 } from "./anchor-
|
|
4
|
-
import { _default as _default$2 } from "./anchor-
|
|
3
|
+
import { _default as _default$1 } from "./anchor-item-compact.vue.js";
|
|
4
|
+
import { _default as _default$2 } from "./anchor-link.vue.js";
|
|
5
|
+
import { _default as _default$3 } from "./anchor-root.vue.js";
|
|
5
6
|
import { provideAnchorUi } from "./context.js";
|
|
6
|
-
export { _default as AnchorCompact, type AnchorCompactEmits, type
|
|
7
|
+
export { _default as AnchorCompact, type AnchorCompactEmits, type AnchorCompactProps, type AnchorContainer, _default$1 as AnchorItemCompact, type AnchorItemCompactProps, _default$2 as AnchorLink, type AnchorLinkProps, type AnchorOptionData, _default$3 as AnchorRoot, type AnchorRootEmits, type AnchorRootProps, type AnchorUi, type AnchorUiSlot, provideAnchorUi };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{provideAnchorUi as e}from"./context.js";import t from"./anchor-link.js";import n from"./anchor-
|
|
1
|
+
import{provideAnchorUi as e}from"./context.js";import t from"./anchor-link.js";import n from"./anchor-item-compact.js";import r from"./anchor-root.js";import i from"./anchor-compact.js";export{i as AnchorCompact,n as AnchorItemCompact,t as AnchorLink,r as AnchorRoot,e as provideAnchorUi};
|
|
@@ -1,52 +1,164 @@
|
|
|
1
1
|
import { DataOrientation, Direction, UiClass } from "../../types/common.js";
|
|
2
2
|
import { PrimitiveProps } from "../primitive/types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { LinkBaseProps } from "../link/types.js";
|
|
4
4
|
import { HTMLAttributes, ShallowRef } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/anchor/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Type information for AnchorContainer.
|
|
9
|
+
*/
|
|
7
10
|
type AnchorContainer = HTMLElement | Window;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
11
|
+
/**
|
|
12
|
+
* Properties for the AnchorRoot component.
|
|
13
|
+
*/
|
|
12
14
|
interface AnchorRootProps extends PrimitiveProps, /** @vue-ignore */HTMLAttributes {
|
|
15
|
+
/**
|
|
16
|
+
* Bounds.
|
|
17
|
+
*/
|
|
13
18
|
bounds?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Reading direction of the component.
|
|
21
|
+
*/
|
|
14
22
|
dir?: Direction;
|
|
23
|
+
/**
|
|
24
|
+
* Get container.
|
|
25
|
+
*/
|
|
15
26
|
getContainer?: () => AnchorContainer | null;
|
|
27
|
+
/**
|
|
28
|
+
* Get current anchor.
|
|
29
|
+
*/
|
|
16
30
|
getCurrentAnchor?: (activeHref: string) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Current model value.
|
|
33
|
+
*/
|
|
17
34
|
modelValue?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Offset top.
|
|
37
|
+
*/
|
|
18
38
|
offsetTop?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Orientation of the component.
|
|
41
|
+
*/
|
|
19
42
|
orientation?: DataOrientation;
|
|
43
|
+
/**
|
|
44
|
+
* Whether replace.
|
|
45
|
+
*/
|
|
20
46
|
replace?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Target offset.
|
|
49
|
+
*/
|
|
21
50
|
targetOffset?: number;
|
|
22
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Events for the AnchorRoot component.
|
|
54
|
+
*/
|
|
23
55
|
type AnchorRootEmits = {
|
|
56
|
+
/**
|
|
57
|
+
* Emitted when the model value changes.
|
|
58
|
+
*/
|
|
24
59
|
'update:modelValue': [value: string];
|
|
60
|
+
/**
|
|
61
|
+
* Emitted when active change occurs.
|
|
62
|
+
*/
|
|
25
63
|
activeChange: [value: string];
|
|
64
|
+
/**
|
|
65
|
+
* Emitted when item select occurs.
|
|
66
|
+
*/
|
|
26
67
|
itemSelect: [event: MouseEvent, payload: {
|
|
27
68
|
href: string;
|
|
28
69
|
}];
|
|
29
70
|
};
|
|
30
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Properties for the AnchorLink component.
|
|
73
|
+
*/
|
|
74
|
+
interface AnchorLinkProps extends PrimitiveProps, LinkBaseProps, /** @vue-ignore */HTMLAttributes {
|
|
75
|
+
/**
|
|
76
|
+
* The link of anchor
|
|
77
|
+
*/
|
|
31
78
|
href: string;
|
|
79
|
+
/**
|
|
80
|
+
* Whether the component is disabled.
|
|
81
|
+
*/
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Option data for the Anchor component.
|
|
86
|
+
*/
|
|
87
|
+
interface AnchorOptionData extends Pick<AnchorLinkProps, 'disabled' | 'href' | 'target'> {
|
|
88
|
+
/**
|
|
89
|
+
* Nested child items.
|
|
90
|
+
*/
|
|
91
|
+
children?: AnchorOptionData[];
|
|
92
|
+
/**
|
|
93
|
+
* Title text rendered by the component.
|
|
94
|
+
*/
|
|
95
|
+
title?: string;
|
|
32
96
|
}
|
|
33
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Properties for the AnchorItemCompact component.
|
|
99
|
+
*/
|
|
100
|
+
interface AnchorItemCompactProps extends /** @vue-ignore */HTMLAttributes {
|
|
101
|
+
/**
|
|
102
|
+
* Current model value.
|
|
103
|
+
*/
|
|
34
104
|
modelValue?: string;
|
|
35
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Current item data.
|
|
107
|
+
*/
|
|
108
|
+
item: AnchorOptionData;
|
|
109
|
+
/**
|
|
110
|
+
* Properties forwarded to the link element.
|
|
111
|
+
*/
|
|
36
112
|
linkProps?: AnchorLinkProps;
|
|
113
|
+
/**
|
|
114
|
+
* Properties forwarded to the indicator element.
|
|
115
|
+
*/
|
|
37
116
|
indicatorProps?: HTMLAttributes;
|
|
117
|
+
/**
|
|
118
|
+
* Properties forwarded to the title element.
|
|
119
|
+
*/
|
|
38
120
|
titleProps?: HTMLAttributes;
|
|
121
|
+
/**
|
|
122
|
+
* Properties forwarded to the sub element.
|
|
123
|
+
*/
|
|
39
124
|
subProps?: HTMLAttributes;
|
|
40
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Properties for the AnchorCompact component.
|
|
128
|
+
*/
|
|
41
129
|
interface AnchorCompactProps extends AnchorRootProps {
|
|
42
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Items rendered by the component.
|
|
132
|
+
*/
|
|
133
|
+
items: AnchorOptionData[];
|
|
134
|
+
/**
|
|
135
|
+
* Properties forwarded to the link element.
|
|
136
|
+
*/
|
|
43
137
|
linkProps?: AnchorLinkProps;
|
|
138
|
+
/**
|
|
139
|
+
* Properties forwarded to the indicator element.
|
|
140
|
+
*/
|
|
44
141
|
indicatorProps?: HTMLAttributes;
|
|
142
|
+
/**
|
|
143
|
+
* Properties forwarded to the title element.
|
|
144
|
+
*/
|
|
45
145
|
titleProps?: HTMLAttributes;
|
|
146
|
+
/**
|
|
147
|
+
* Properties forwarded to the sub element.
|
|
148
|
+
*/
|
|
46
149
|
subProps?: HTMLAttributes;
|
|
47
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Events for the AnchorCompact component.
|
|
153
|
+
*/
|
|
48
154
|
type AnchorCompactEmits = AnchorRootEmits;
|
|
155
|
+
/**
|
|
156
|
+
* Available UI slots for the Anchor component.
|
|
157
|
+
*/
|
|
49
158
|
type AnchorUiSlot = 'root' | 'link' | 'sub' | 'item' | 'indicator' | 'title';
|
|
159
|
+
/**
|
|
160
|
+
* UI class overrides for the Anchor component.
|
|
161
|
+
*/
|
|
50
162
|
type AnchorUi = UiClass<AnchorUiSlot>;
|
|
51
163
|
//#endregion
|
|
52
|
-
export { AnchorCompactEmits,
|
|
164
|
+
export { AnchorCompactEmits, AnchorCompactProps, AnchorContainer, AnchorItemCompactProps, AnchorLinkProps, AnchorOptionData, AnchorRootEmits, AnchorRootProps, AnchorUi, AnchorUiSlot };
|