@soybeanjs/ui 0.16.0 → 0.17.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/dist/_virtual/_rolldown/runtime.js +1 -0
- package/dist/components/accordion/accordion.js +1 -1
- package/dist/components/accordion/accordion.vue.d.ts +1 -1
- package/dist/components/accordion/index.d.ts +1 -2
- package/dist/components/accordion/types.d.ts +17 -1
- package/dist/components/affix/affix.js +1 -1
- package/dist/components/affix/index.d.ts +2 -1
- package/dist/components/affix/types.d.ts +10 -1
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/alert/index.d.ts +1 -2
- package/dist/components/alert/types.d.ts +25 -1
- package/dist/components/anchor/anchor.js +1 -1
- package/dist/components/anchor/anchor.vue.d.ts +1 -1
- package/dist/components/anchor/index.d.ts +2 -3
- package/dist/components/anchor/types.d.ts +30 -3
- package/dist/components/autocomplete/autocomplete.js +1 -1
- package/dist/components/autocomplete/autocomplete.vue.d.ts +2 -1
- package/dist/components/autocomplete/index.d.ts +2 -3
- package/dist/components/autocomplete/types.d.ts +18 -4
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar/index.d.ts +1 -2
- package/dist/components/avatar/types.d.ts +23 -1
- package/dist/components/backtop/backtop.vue.d.ts +3 -3
- package/dist/components/backtop/index.d.ts +2 -2
- package/dist/components/backtop/types.d.ts +28 -1
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/index.d.ts +1 -2
- package/dist/components/badge/types.d.ts +26 -1
- package/dist/components/bottom-sheet/bottom-sheet.js +1 -1
- package/dist/components/bottom-sheet/index.d.ts +2 -1
- package/dist/components/bottom-sheet/types.d.ts +17 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumb/index.d.ts +3 -2
- package/dist/components/breadcrumb/types.d.ts +16 -1
- package/dist/components/button/button-group.js +1 -1
- package/dist/components/button/button-icon.vue.d.ts +1 -1
- package/dist/components/button/button-link.vue.d.ts +1 -1
- package/dist/components/button/button-loading.vue.d.ts +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/types.d.ts +40 -3
- package/dist/components/calendar/calendar.js +1 -1
- package/dist/components/calendar/index.d.ts +1 -2
- package/dist/components/calendar/types.d.ts +20 -1
- package/dist/components/card/card-collapsible-trigger.js +1 -1
- package/dist/components/card/card-collapsible-trigger.vue.d.ts +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/index.d.ts +1 -2
- package/dist/components/card/types.d.ts +11 -1
- package/dist/components/carousel/carousel-content.js +1 -1
- package/dist/components/carousel/carousel-content.vue.d.ts +1 -1
- package/dist/components/carousel/carousel-item.js +1 -1
- package/dist/components/carousel/carousel-item.vue.d.ts +1 -1
- package/dist/components/carousel/carousel-next.js +1 -1
- package/dist/components/carousel/carousel-next.vue.d.ts +2 -1
- package/dist/components/carousel/carousel-previous.js +1 -1
- package/dist/components/carousel/carousel-previous.vue.d.ts +2 -1
- package/dist/components/carousel/carousel.js +1 -1
- package/dist/components/carousel/index.d.ts +1 -2
- package/dist/components/carousel/types.d.ts +14 -1
- package/dist/components/checkbox/checkbox-card-group.js +1 -1
- package/dist/components/checkbox/checkbox-card.js +1 -1
- package/dist/components/checkbox/checkbox-group.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox/index.d.ts +2 -1
- package/dist/components/checkbox/types.d.ts +80 -1
- package/dist/components/clipboard/clipboard.js +1 -1
- package/dist/components/clipboard/index.d.ts +2 -1
- package/dist/components/clipboard/types.d.ts +22 -1
- package/dist/components/collapsible/collapsible.js +1 -1
- package/dist/components/collapsible/index.d.ts +3 -2
- package/dist/components/collapsible/types.d.ts +13 -1
- package/dist/components/color-area/color-area.vue.d.ts +2 -2
- package/dist/components/color-area/index.d.ts +1 -2
- package/dist/components/color-area/types.d.ts +23 -1
- package/dist/components/color-field/color-field.js +1 -1
- package/dist/components/color-field/index.d.ts +1 -2
- package/dist/components/color-field/types.d.ts +20 -1
- package/dist/components/color-picker/color-picker.vue.d.ts +8 -8
- package/dist/components/color-picker/index.d.ts +2 -1
- package/dist/components/color-picker/types.d.ts +96 -3
- package/dist/components/color-slider/color-slider.vue.d.ts +3 -3
- package/dist/components/color-slider/index.d.ts +1 -2
- package/dist/components/color-slider/types.d.ts +25 -1
- package/dist/components/color-swatch/index.d.ts +2 -4
- package/dist/components/color-swatch/types.d.ts +22 -1
- package/dist/components/color-swatch-picker/color-swatch-picker.js +1 -1
- package/dist/components/color-swatch-picker/color-swatch-picker.vue.d.ts +2 -2
- package/dist/components/color-swatch-picker/index.d.ts +1 -2
- package/dist/components/color-swatch-picker/types.d.ts +38 -1
- package/dist/components/combobox/combobox.js +1 -1
- package/dist/components/combobox/index.d.ts +1 -2
- package/dist/components/combobox/types.d.ts +19 -1
- package/dist/components/command/command.js +1 -1
- package/dist/components/command/command.vue.d.ts +4 -3
- package/dist/components/command/index.d.ts +2 -3
- package/dist/components/command/types.d.ts +18 -4
- package/dist/components/config-provider/config-provider.js +1 -1
- package/dist/components/config-provider/config-provider.vue.d.ts +7 -10
- package/dist/components/config-provider/index.d.ts +2 -1
- package/dist/components/config-provider/types.d.ts +22 -17
- package/dist/components/context-menu/context-menu-checkbox.js +1 -1
- package/dist/components/context-menu/context-menu-checkbox.vue.d.ts +1 -1
- package/dist/components/context-menu/context-menu-radio.js +1 -1
- package/dist/components/context-menu/context-menu-radio.vue.d.ts +1 -1
- package/dist/components/context-menu/context-menu-wrapper.js +1 -1
- package/dist/components/context-menu/context-menu.js +1 -1
- package/dist/components/context-menu/context-menu.vue.d.ts +1 -1
- package/dist/components/context-menu/index.d.ts +2 -1
- package/dist/components/context-menu/types.d.ts +35 -1
- package/dist/components/date-field/index.d.ts +1 -2
- package/dist/components/date-field/types.d.ts +16 -1
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +3 -1
- package/dist/components/date-picker/index.d.ts +1 -2
- package/dist/components/date-picker/types.d.ts +23 -15
- package/dist/components/date-picker/variants.js +1 -1
- package/dist/components/date-range-field/index.d.ts +1 -2
- package/dist/components/date-range-field/types.d.ts +47 -2
- package/dist/components/date-range-picker/index.d.ts +1 -2
- package/dist/components/date-range-picker/types.d.ts +36 -2
- package/dist/components/dialog/dialog-provider.js +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dialog/dialog.vue.d.ts +4 -4
- package/dist/components/dialog/index.d.ts +2 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/types.d.ts +17 -1
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/drawer/drawer.vue.d.ts +4 -4
- package/dist/components/drawer/types.d.ts +13 -1
- package/dist/components/dropdown-menu/dropdown-menu-checkbox.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-checkbox.vue.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-radio.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-radio.vue.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-wrapper.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.vue.d.ts +1 -1
- package/dist/components/dropdown-menu/index.d.ts +2 -1
- package/dist/components/dropdown-menu/types.d.ts +35 -1
- package/dist/components/editable/editable.js +1 -1
- package/dist/components/editable/index.d.ts +2 -3
- package/dist/components/editable/types.d.ts +42 -2
- package/dist/components/empty/empty.js +1 -1
- package/dist/components/empty/index.d.ts +1 -2
- package/dist/components/empty/types.d.ts +38 -1
- package/dist/components/form/form-field-base.js +1 -1
- package/dist/components/form/index.d.ts +2 -3
- package/dist/components/form/types.d.ts +102 -8
- package/dist/components/form/use-form.d.ts +2 -1
- package/dist/components/form/use-form.js +1 -1
- package/dist/components/hover-card/hover-card.js +1 -1
- package/dist/components/hover-card/index.d.ts +1 -2
- package/dist/components/hover-card/types.d.ts +35 -1
- package/dist/components/icon/types.d.ts +7 -1
- package/dist/components/input/index.d.ts +1 -2
- package/dist/components/input/input.js +1 -1
- package/dist/components/input/types.d.ts +14 -1
- package/dist/components/input-number/index.d.ts +2 -1
- package/dist/components/input-number/input-number.js +1 -1
- package/dist/components/input-number/types.d.ts +26 -1
- 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.js +1 -1
- package/dist/components/input-otp/input-otp.vue.d.ts +2 -2
- package/dist/components/input-otp/types.d.ts +19 -1
- package/dist/components/kbd/index.d.ts +4 -2
- package/dist/components/kbd/kbd.js +1 -1
- package/dist/components/kbd/types.d.ts +18 -2
- package/dist/components/label/label.js +1 -1
- package/dist/components/label/types.d.ts +11 -1
- package/dist/components/layout/index.d.ts +2 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/layout/layout-classic.js +1 -1
- package/dist/components/layout/layout.js +1 -1
- package/dist/components/layout/types.d.ts +38 -1
- package/dist/components/link/index.d.ts +4 -2
- package/dist/components/link/link.js +1 -1
- package/dist/components/link/types.d.ts +8 -1
- package/dist/components/list/index.d.ts +3 -3
- package/dist/components/list/list-item.js +1 -1
- package/dist/components/list/list.js +1 -1
- package/dist/components/list/types.d.ts +32 -1
- package/dist/components/menu/context.js +1 -1
- package/dist/components/menu/index.d.ts +10 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/types.d.ts +14 -1
- package/dist/components/menubar/index.d.ts +2 -1
- package/dist/components/menubar/menubar.js +1 -1
- package/dist/components/menubar/menubar.vue.d.ts +1 -1
- package/dist/components/menubar/types.d.ts +20 -1
- package/dist/components/month-picker/index.d.ts +1 -2
- package/dist/components/month-picker/types.d.ts +44 -2
- package/dist/components/month-range-picker/index.d.ts +1 -2
- package/dist/components/month-range-picker/types.d.ts +44 -2
- package/dist/components/navigation-menu/index.d.ts +1 -2
- package/dist/components/navigation-menu/navigation-menu-option.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-sub-option.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.js +1 -1
- package/dist/components/navigation-menu/types.d.ts +85 -2
- package/dist/components/page-tabs/index.d.ts +2 -1
- package/dist/components/page-tabs/page-tabs.js +1 -1
- package/dist/components/page-tabs/page-tabs.vue.d.ts +1 -1
- package/dist/components/page-tabs/types.d.ts +79 -3
- package/dist/components/pagination/index.d.ts +1 -2
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/pagination/types.d.ts +11 -1
- package/dist/components/password/password.js +1 -1
- package/dist/components/password/types.d.ts +20 -1
- package/dist/components/popconfirm/popconfirm-cancel.js +1 -1
- package/dist/components/popconfirm/popconfirm-confirm.js +1 -1
- package/dist/components/popconfirm/popconfirm.js +1 -1
- package/dist/components/popconfirm/types.d.ts +143 -4
- package/dist/components/popover/index.d.ts +1 -2
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/popover/types.d.ts +39 -2
- package/dist/components/progress/index.d.ts +6 -6
- package/dist/components/progress/progress-circle.js +1 -1
- package/dist/components/progress/progress-provider.js +1 -1
- package/dist/components/progress/progress.js +1 -1
- package/dist/components/progress/types.d.ts +43 -1
- package/dist/components/radio-group/index.d.ts +2 -3
- package/dist/components/radio-group/radio-card-group.js +1 -1
- package/dist/components/radio-group/radio-card-group.vue.d.ts +1 -1
- package/dist/components/radio-group/radio-card.js +1 -1
- package/dist/components/radio-group/radio-group.js +1 -1
- package/dist/components/radio-group/radio-group.vue.d.ts +1 -1
- package/dist/components/radio-group/radio.js +1 -1
- package/dist/components/radio-group/types.d.ts +76 -1
- package/dist/components/range-calendar/index.d.ts +1 -2
- package/dist/components/range-calendar/types.d.ts +127 -1
- package/dist/components/scroll-area/index.d.ts +1 -2
- package/dist/components/scroll-area/scroll-area.js +1 -1
- package/dist/components/scroll-area/types.d.ts +29 -1
- package/dist/components/segment/index.d.ts +2 -1
- package/dist/components/segment/segment.js +1 -1
- package/dist/components/segment/types.d.ts +26 -1
- package/dist/components/select/index.d.ts +2 -3
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.vue.d.ts +1 -1
- package/dist/components/select/types.d.ts +18 -3
- package/dist/components/separator/index.d.ts +1 -2
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/separator/types.d.ts +26 -1
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/skeleton/types.d.ts +14 -1
- package/dist/components/slider/index.d.ts +1 -2
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slider/types.d.ts +29 -1
- package/dist/components/spinner/types.d.ts +16 -1
- package/dist/components/splitter/index.d.ts +2 -3
- package/dist/components/splitter/splitter-group.js +1 -1
- package/dist/components/splitter/splitter-panel.js +1 -1
- package/dist/components/splitter/splitter-panel.vue.d.ts +2 -2
- package/dist/components/splitter/splitter-resize-handle.js +1 -1
- package/dist/components/splitter/splitter-resize-handle.vue.d.ts +1 -1
- package/dist/components/splitter/types.d.ts +43 -2
- package/dist/components/stepper/index.d.ts +1 -2
- package/dist/components/stepper/stepper.js +1 -1
- package/dist/components/stepper/types.d.ts +56 -1
- package/dist/components/switch/index.d.ts +1 -2
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/switch/switch.vue.d.ts +4 -4
- package/dist/components/switch/types.d.ts +29 -1
- package/dist/components/table/hooks.js +1 -1
- package/dist/components/table/index.d.ts +2 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table.js +1 -1
- package/dist/components/table/table.vue.d.ts +2 -2
- package/dist/components/table/types.d.ts +76 -1
- package/dist/components/tabs/index.d.ts +2 -3
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tabs/types.d.ts +19 -1
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/tag/types.d.ts +26 -1
- package/dist/components/tags-input/index.d.ts +3 -2
- package/dist/components/tags-input/tags-input-item-delete.js +1 -1
- package/dist/components/tags-input/tags-input.js +1 -1
- package/dist/components/tags-input/tags-input.vue.d.ts +1 -1
- package/dist/components/tags-input/types.d.ts +17 -1
- package/dist/components/textarea/index.d.ts +1 -2
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/textarea/types.d.ts +23 -1
- package/dist/components/time-field/index.d.ts +1 -2
- package/dist/components/time-field/types.d.ts +38 -2
- package/dist/components/time-picker/index.d.ts +1 -2
- package/dist/components/time-picker/types.d.ts +35 -2
- package/dist/components/time-range-field/index.d.ts +1 -2
- package/dist/components/time-range-field/types.d.ts +47 -2
- package/dist/components/time-range-picker/index.d.ts +1 -2
- package/dist/components/time-range-picker/types.d.ts +35 -2
- package/dist/components/toast/index.d.ts +3 -3
- package/dist/components/toast/toast-provider.js +1 -1
- package/dist/components/toast/types.d.ts +11 -2
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle/toggle.vue.d.ts +3 -3
- package/dist/components/toggle/types.d.ts +20 -1
- package/dist/components/toggle-group/index.d.ts +1 -2
- package/dist/components/toggle-group/toggle-group-item.js +1 -1
- package/dist/components/toggle-group/toggle-group-item.vue.d.ts +1 -1
- package/dist/components/toggle-group/toggle-group.js +1 -1
- package/dist/components/toggle-group/toggle-group.vue.d.ts +1 -1
- package/dist/components/toggle-group/types.d.ts +23 -1
- package/dist/components/toolbar/index.d.ts +3 -2
- package/dist/components/toolbar/toolbar.js +1 -1
- package/dist/components/toolbar/types.d.ts +11 -1
- package/dist/components/tooltip/index.d.ts +1 -2
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/components/tooltip/types.d.ts +38 -1
- package/dist/components/tree/index.d.ts +3 -2
- package/dist/components/tree/tree-virtualizer.js +1 -1
- package/dist/components/tree/tree-virtualizer.vue.d.ts +2 -1
- package/dist/components/tree/tree.js +1 -1
- package/dist/components/tree/tree.vue.d.ts +2 -1
- package/dist/components/tree/types.d.ts +15 -1
- package/dist/components/tree-menu/index.d.ts +2 -1
- package/dist/components/tree-menu/tree-menu-option-slot.js +1 -1
- package/dist/components/tree-menu/tree-menu-option.js +1 -1
- package/dist/components/tree-menu/tree-menu-options.js +1 -1
- package/dist/components/tree-menu/tree-menu.js +1 -1
- package/dist/components/tree-menu/types.d.ts +111 -6
- package/dist/components/virtualizer/index.d.ts +3 -2
- package/dist/components/virtualizer/types.d.ts +10 -1
- package/dist/components/virtualizer/virtualizer.js +1 -1
- package/dist/components/year-picker/index.d.ts +1 -2
- package/dist/components/year-picker/types.d.ts +44 -2
- package/dist/components/year-range-picker/index.d.ts +1 -2
- package/dist/components/year-range-picker/types.d.ts +44 -2
- package/dist/index.d.ts +103 -73
- package/dist/index.js +1 -1
- package/dist/theme/merge.d.ts +1 -1
- package/dist/theme/shared.d.ts +1 -1
- package/package.json +7 -5
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { ThemeSize } from "../../theme/types.js";
|
|
2
2
|
import { IconValue } from "../icon/types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { LinkBaseProps } from "@soybeanjs/headless/link";
|
|
4
|
+
import { NavigationMenuContentEmits, NavigationMenuContentProps, NavigationMenuIndicatorProps, NavigationMenuItemProps, NavigationMenuLinkEmits, NavigationMenuLinkProps, NavigationMenuListProps, NavigationMenuRootEmits, NavigationMenuRootProps, NavigationMenuSubEmits, NavigationMenuTriggerProps, NavigationMenuUiSlot, NavigationMenuViewportProps } from "@soybeanjs/headless/navigation-menu";
|
|
5
|
+
import { ClassValue, UiClass } from "@soybeanjs/headless/types";
|
|
4
6
|
|
|
5
7
|
//#region src/components/navigation-menu/types.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Option data for the navigation menu component.
|
|
10
|
+
*/
|
|
6
11
|
interface NavigationMenuOptionData extends LinkBaseProps {
|
|
7
12
|
/** The value of the option. */
|
|
8
13
|
value: string;
|
|
@@ -21,34 +26,112 @@ interface NavigationMenuOptionData extends LinkBaseProps {
|
|
|
21
26
|
/** The children of the option. */
|
|
22
27
|
children?: NavigationMenuOptionData[];
|
|
23
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Additional UI slots for the navigation menu component.
|
|
31
|
+
*/
|
|
24
32
|
type NavigationMenuExtraUiSlot = 'triggerIcon' | 'linkIcon' | 'arrow' | 'viewportRoot' | 'subItemContent' | 'subLinkContent' | 'subLinkLabel' | 'subLinkDescription';
|
|
33
|
+
/**
|
|
34
|
+
* UI class overrides for the navigation menu component.
|
|
35
|
+
*/
|
|
25
36
|
type NavigationMenuExtraUi = UiClass<NavigationMenuExtraUiSlot>;
|
|
26
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Extended UI class overrides for the navigation menu component.
|
|
39
|
+
*/
|
|
40
|
+
type NavigationMenuExtendedUi = UiClass<NavigationMenuUiSlot | NavigationMenuExtraUiSlot>;
|
|
41
|
+
/**
|
|
42
|
+
* Props for the navigation menu sub option component.
|
|
43
|
+
*/
|
|
27
44
|
interface NavigationMenuSubOptionProps {
|
|
45
|
+
/**
|
|
46
|
+
* Sub item.
|
|
47
|
+
*/
|
|
28
48
|
subItem: NavigationMenuOptionData;
|
|
49
|
+
/**
|
|
50
|
+
* Props forwarded to the sub item element.
|
|
51
|
+
*/
|
|
29
52
|
subItemProps?: NavigationMenuItemProps;
|
|
53
|
+
/**
|
|
54
|
+
* Props forwarded to the link element.
|
|
55
|
+
*/
|
|
30
56
|
linkProps?: NavigationMenuLinkProps;
|
|
31
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Emits for the navigation menu sub option component.
|
|
60
|
+
*/
|
|
32
61
|
type NavigationMenuSubOptionEmits = NavigationMenuLinkEmits;
|
|
62
|
+
/**
|
|
63
|
+
* Props for the navigation menu option component.
|
|
64
|
+
*/
|
|
33
65
|
interface NavigationMenuOptionProps {
|
|
66
|
+
/**
|
|
67
|
+
* Current item data.
|
|
68
|
+
*/
|
|
34
69
|
item: NavigationMenuOptionData;
|
|
70
|
+
/**
|
|
71
|
+
* Props forwarded to the item element.
|
|
72
|
+
*/
|
|
35
73
|
itemProps?: NavigationMenuItemProps;
|
|
74
|
+
/**
|
|
75
|
+
* Props forwarded to the link element.
|
|
76
|
+
*/
|
|
36
77
|
linkProps?: NavigationMenuLinkProps;
|
|
78
|
+
/**
|
|
79
|
+
* Props forwarded to the trigger element.
|
|
80
|
+
*/
|
|
37
81
|
triggerProps?: NavigationMenuTriggerProps;
|
|
82
|
+
/**
|
|
83
|
+
* Props forwarded to the content element.
|
|
84
|
+
*/
|
|
38
85
|
contentProps?: NavigationMenuContentProps;
|
|
86
|
+
/**
|
|
87
|
+
* Props forwarded to the viewport element.
|
|
88
|
+
*/
|
|
39
89
|
viewportProps?: NavigationMenuViewportProps;
|
|
90
|
+
/**
|
|
91
|
+
* Props forwarded to the indicator element.
|
|
92
|
+
*/
|
|
40
93
|
indicatorProps?: NavigationMenuIndicatorProps;
|
|
94
|
+
/**
|
|
95
|
+
* Props forwarded to the list element.
|
|
96
|
+
*/
|
|
41
97
|
listProps?: NavigationMenuListProps;
|
|
98
|
+
/**
|
|
99
|
+
* Props forwarded to the sub list element.
|
|
100
|
+
*/
|
|
42
101
|
subListProps?: NavigationMenuListProps;
|
|
102
|
+
/**
|
|
103
|
+
* Props forwarded to the sub item element.
|
|
104
|
+
*/
|
|
43
105
|
subItemProps?: NavigationMenuItemProps;
|
|
44
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Emits for the navigation menu option component.
|
|
109
|
+
*/
|
|
45
110
|
type NavigationMenuOptionEmits = NavigationMenuSubEmits & NavigationMenuContentEmits & NavigationMenuLinkEmits;
|
|
111
|
+
/**
|
|
112
|
+
* Props for the navigation menu component.
|
|
113
|
+
*/
|
|
46
114
|
interface NavigationMenuProps extends NavigationMenuRootProps, Omit<NavigationMenuOptionProps, 'item'> {
|
|
115
|
+
/**
|
|
116
|
+
* Additional class names applied to the root element.
|
|
117
|
+
*/
|
|
47
118
|
class?: ClassValue;
|
|
119
|
+
/**
|
|
120
|
+
* Visual size of the component.
|
|
121
|
+
*/
|
|
48
122
|
size?: ThemeSize;
|
|
123
|
+
/**
|
|
124
|
+
* Per-slot class overrides for the component.
|
|
125
|
+
*/
|
|
49
126
|
ui?: Partial<NavigationMenuExtendedUi>;
|
|
127
|
+
/**
|
|
128
|
+
* Items rendered by the component.
|
|
129
|
+
*/
|
|
50
130
|
items: NavigationMenuOptionData[];
|
|
51
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Emits for the navigation menu component.
|
|
134
|
+
*/
|
|
52
135
|
type NavigationMenuEmits = NavigationMenuRootEmits & NavigationMenuOptionEmits;
|
|
53
136
|
//#endregion
|
|
54
137
|
export { NavigationMenuEmits, NavigationMenuExtendedUi, NavigationMenuExtraUi, NavigationMenuExtraUiSlot, NavigationMenuOptionData, NavigationMenuOptionEmits, NavigationMenuOptionProps, NavigationMenuProps, NavigationMenuSubOptionEmits, NavigationMenuSubOptionProps };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { PageTabsVariant } from "./variants.js";
|
|
2
2
|
import { PageTabsContextMenuOptionData, PageTabsEmits, PageTabsExtendedUi, PageTabsExtraUiSlot, PageTabsOptionData, PageTabsProps, PageTabsState } from "./types.js";
|
|
3
|
-
import { _default } from "./page-tabs.vue.js";
|
|
3
|
+
import { _default } from "./page-tabs.vue.js";
|
|
4
|
+
export * from "@soybeanjs/headless/page-tabs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import n from"../context-menu/context-menu.js";import{usePageTabsState as r}from"./hooks.js";import{pageTabsVariants as i}from"./variants.js";import{Fragment as a,computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createVNode as d,defineComponent as f,isRef as p,mergeProps as m,normalizeClass as h,openBlock as g,renderList as _,shallowRef as v,toDisplayString as y,unref as b,watchEffect as x,withCtx as S}from"vue";import{useControllableState as C,useOmitProps as w}from"@soybeanjs/headless/composables";import{PageTabsClose as T,PageTabsItem as E,PageTabsPin as D,PageTabsRoot as O,providePageTabsUi as k}from"@soybeanjs/headless";const A=f({name:`SPageTabs`,__name:`page-tabs`,props:{class:{},size:{},variant:{default:`chrome`},ui:{},items:{},menuFactory:{},beforeClose:{type:Function,default:()=>!0},modelValue:{},middleClickClose:{type:Boolean}},emits:[`update:modelValue`,`update:items`,`click`,`close`,`pin`,`contextmenu`,`selectContextMenu`],setup(f,{emit:A}){let j=f,M=A,N=w(j,[`class`,`size`,`variant`,`ui`,`modelValue`,`items`,`menuFactory`,`beforeClose`]),P=C(()=>j.modelValue,e=>{M(`update:modelValue`,e??``)},``),F=C(()=>j.items,e=>{M(`update:items`,e)},[]),{closeTab:I,pinTab:L,sortTabs:R,getState:z}=r({items:F,modelValue:P,beforeClose:j.beforeClose}),B=v(null),V=v(null),H=o(()=>{if(!B.value||!j.menuFactory)return[];let e=z(B.value);return j.menuFactory(B.value,e)}),U=e=>{I(e.value,()=>{M(`close`,e)})},W=(e,t)=>{L(e,t),M(`pin`,e)},G=(e,t)=>{V.value=e.currentTarget,B.value=t,M(`contextmenu`,t)},K=async e=>{B.value&&(await e.action?.(),M(`selectContextMenu`,e,B.value))},q=o(()=>e(i({size:j.size,variant:j.variant}),j.ui,{root:j.class}));return x(()=>{R()}),k(q),(e,r)=>(g(),s(b(O),m(b(N),{modelValue:b(P),"onUpdate:modelValue":r[0]||=e=>p(P)?P.value=e:null}),{default:S(()=>[(g(!0),l(a,null,_(b(F),e=>(g(),s(b(E),{key:e.value,value:e.value,pinned:e.pinned,onClick:t=>M(`click`,e),onClose:t=>U(e),onPin:t=>W(e,t),onPointerenter:t=>G(t,e)},{default:S(()=>[d(t,{icon:e.icon},null,8,[`icon`]),u(`span`,{class:h(q.value.itemText)},y(e.label),3),e.hidePinnedIcon?c(`v-if`,!0):(g(),s(b(D),{key:0,"as-child":``},{default:S(()=>[d(t,{icon:`lucide:pin`})]),_:1})),d(b(T),{"as-child":``},{default:S(()=>[d(t,{icon:`lucide:x`})]),_:1}),f.variant===`chrome`?(g(),l(a,{key:1},[(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgLeft)},[...r[1]||=[u(`path`,{d:`M 0 8 A 8 8 0 0 0 8 0 L 8 8 Z`},null,-1)]],2)),(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgRight)},[...r[2]||=[u(`path`,{d:`M 0 0 A 8 8 0 0 0 8 8 L 0 8 Z`},null,-1)]],2))],64)):c(`v-if`,!0),f.variant===`slider`?(g(),l(`div`,{key:2,class:h(q.value.sliderIndicator)},null,2)):c(`v-if`,!0)]),_:2},1032,[`value`,`pinned`,`onClick`,`onClose`,`onPin`,`onPointerenter`]))),128)),H.value.length?(g(),s(n,{key:0,modal:!1,items:H.value,"trigger-props":{reference:V.value},onSelect:K},null,8,[`items`,`trigger-props`])):c(`v-if`,!0)]),_:1},16,[`modelValue`]))}});export{A as default};
|
|
1
|
+
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import n from"../context-menu/context-menu.js";import{usePageTabsState as r}from"./hooks.js";import{pageTabsVariants as i}from"./variants.js";import{Fragment as a,computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createVNode as d,defineComponent as f,isRef as p,mergeProps as m,normalizeClass as h,openBlock as g,renderList as _,shallowRef as v,toDisplayString as y,unref as b,watchEffect as x,withCtx as S}from"vue";import{useControllableState as C,useOmitProps as w}from"@soybeanjs/headless/composables";import{PageTabsClose as T,PageTabsItem as E,PageTabsPin as D,PageTabsRoot as O,providePageTabsUi as k}from"@soybeanjs/headless/page-tabs";const A=f({name:`SPageTabs`,__name:`page-tabs`,props:{class:{},size:{},variant:{default:`chrome`},ui:{},items:{},menuFactory:{},beforeClose:{type:Function,default:()=>!0},modelValue:{},middleClickClose:{type:Boolean}},emits:[`update:modelValue`,`update:items`,`click`,`close`,`pin`,`contextmenu`,`selectContextMenu`],setup(f,{emit:A}){let j=f,M=A,N=w(j,[`class`,`size`,`variant`,`ui`,`modelValue`,`items`,`menuFactory`,`beforeClose`]),P=C(()=>j.modelValue,e=>{M(`update:modelValue`,e??``)},``),F=C(()=>j.items,e=>{M(`update:items`,e)},[]),{closeTab:I,pinTab:L,sortTabs:R,getState:z}=r({items:F,modelValue:P,beforeClose:j.beforeClose}),B=v(null),V=v(null),H=o(()=>{if(!B.value||!j.menuFactory)return[];let e=z(B.value);return j.menuFactory(B.value,e)}),U=e=>{I(e.value,()=>{M(`close`,e)})},W=(e,t)=>{L(e,t),M(`pin`,e)},G=(e,t)=>{V.value=e.currentTarget,B.value=t,M(`contextmenu`,t)},K=async e=>{B.value&&(await e.action?.(),M(`selectContextMenu`,e,B.value))},q=o(()=>e(i({size:j.size,variant:j.variant}),j.ui,{root:j.class}));return x(()=>{R()}),k(q),(e,r)=>(g(),s(b(O),m(b(N),{modelValue:b(P),"onUpdate:modelValue":r[0]||=e=>p(P)?P.value=e:null}),{default:S(()=>[(g(!0),l(a,null,_(b(F),e=>(g(),s(b(E),{key:e.value,value:e.value,pinned:e.pinned,onClick:t=>M(`click`,e),onClose:t=>U(e),onPin:t=>W(e,t),onPointerenter:t=>G(t,e)},{default:S(()=>[d(t,{icon:e.icon},null,8,[`icon`]),u(`span`,{class:h(q.value.itemText)},y(e.label),3),e.hidePinnedIcon?c(`v-if`,!0):(g(),s(b(D),{key:0,"as-child":``},{default:S(()=>[d(t,{icon:`lucide:pin`})]),_:1})),d(b(T),{"as-child":``},{default:S(()=>[d(t,{icon:`lucide:x`})]),_:1}),f.variant===`chrome`?(g(),l(a,{key:1},[(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgLeft)},[...r[1]||=[u(`path`,{d:`M 0 8 A 8 8 0 0 0 8 0 L 8 8 Z`},null,-1)]],2)),(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgRight)},[...r[2]||=[u(`path`,{d:`M 0 0 A 8 8 0 0 0 8 8 L 0 8 Z`},null,-1)]],2))],64)):c(`v-if`,!0),f.variant===`slider`?(g(),l(`div`,{key:2,class:h(q.value.sliderIndicator)},null,2)):c(`v-if`,!0)]),_:2},1032,[`value`,`pinned`,`onClick`,`onClose`,`onPin`,`onPointerenter`]))),128)),H.value.length?(g(),s(n,{key:0,modal:!1,items:H.value,"trigger-props":{reference:V.value},onSelect:K},null,8,[`items`,`trigger-props`])):c(`v-if`,!0)]),_:1},16,[`modelValue`]))}});export{A as default};
|
|
@@ -5,8 +5,8 @@ import * as _$vue from "vue";
|
|
|
5
5
|
declare const __VLS_export: <T extends PageTabsOptionData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
6
|
props: _$vue.PublicProps & __VLS_PrettifyLocal<PageTabsProps<T> & {
|
|
7
7
|
onContextmenu?: ((tab: T) => any) | undefined;
|
|
8
|
-
onClose?: ((tab: T) => any) | undefined;
|
|
9
8
|
onClick?: ((tab: T) => any) | undefined;
|
|
9
|
+
onClose?: ((tab: T) => any) | undefined;
|
|
10
10
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
11
11
|
"onUpdate:items"?: ((items: T[]) => any) | undefined;
|
|
12
12
|
onPin?: ((tab: T) => any) | undefined;
|
|
@@ -1,48 +1,121 @@
|
|
|
1
1
|
import { ThemeSize } from "../../theme/types.js";
|
|
2
2
|
import { IconValue } from "../icon/types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { index_d_exports } from "../menu/index.js";
|
|
4
4
|
import { PageTabsVariant } from "./variants.js";
|
|
5
|
-
import {
|
|
5
|
+
import { PageTabsItemProps, PageTabsRootEmits, PageTabsRootProps, PageTabsUiSlot } from "@soybeanjs/headless/page-tabs";
|
|
6
|
+
import { ClassValue, MaybePromise } from "@soybeanjs/headless/types";
|
|
6
7
|
|
|
7
8
|
//#region src/components/page-tabs/types.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Option data for the page tabs component.
|
|
11
|
+
*/
|
|
8
12
|
interface PageTabsOptionData extends PageTabsItemProps {
|
|
13
|
+
/**
|
|
14
|
+
* Label text rendered by the component.
|
|
15
|
+
*/
|
|
9
16
|
label: string;
|
|
17
|
+
/**
|
|
18
|
+
* Icon rendered by the component.
|
|
19
|
+
*/
|
|
10
20
|
icon?: IconValue;
|
|
11
21
|
/**
|
|
12
22
|
* Whether to hide the pinned icon on the tab
|
|
13
23
|
*/
|
|
14
24
|
hidePinnedIcon?: boolean;
|
|
15
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Additional UI slots for the page tabs component.
|
|
28
|
+
*/
|
|
16
29
|
type PageTabsExtraUiSlot = 'itemText' | 'chromeBgLeft' | 'chromeBgRight' | 'sliderIndicator';
|
|
30
|
+
/**
|
|
31
|
+
* Extended UI class overrides for the page tabs component.
|
|
32
|
+
*/
|
|
17
33
|
type PageTabsExtendedUi = Record<PageTabsUiSlot | PageTabsExtraUiSlot, ClassValue>;
|
|
34
|
+
/**
|
|
35
|
+
* State values for the page tabs component.
|
|
36
|
+
*/
|
|
18
37
|
interface PageTabsState {
|
|
38
|
+
/**
|
|
39
|
+
* Pin.
|
|
40
|
+
*/
|
|
19
41
|
pin: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Unpin.
|
|
44
|
+
*/
|
|
20
45
|
unpin: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the component can be closed.
|
|
48
|
+
*/
|
|
21
49
|
closable: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Close.
|
|
52
|
+
*/
|
|
22
53
|
close: () => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Whether left closable.
|
|
56
|
+
*/
|
|
23
57
|
leftClosable: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Close left.
|
|
60
|
+
*/
|
|
24
61
|
closeLeft: () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Whether right closable.
|
|
64
|
+
*/
|
|
25
65
|
rightClosable: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Close right.
|
|
68
|
+
*/
|
|
26
69
|
closeRight: () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Whether other closable.
|
|
72
|
+
*/
|
|
27
73
|
otherClosable: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Close other.
|
|
76
|
+
*/
|
|
28
77
|
closeOther: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Whether all closable.
|
|
80
|
+
*/
|
|
29
81
|
allClosable: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Close all.
|
|
84
|
+
*/
|
|
30
85
|
closeAll: () => void;
|
|
31
86
|
}
|
|
32
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Option data for the page tabs context menu component.
|
|
89
|
+
*/
|
|
90
|
+
interface PageTabsContextMenuOptionData extends index_d_exports.MenuOptionData<string> {
|
|
33
91
|
/**
|
|
34
92
|
* Action to perform when the menu item is selected.
|
|
35
93
|
*/
|
|
36
94
|
action?: () => MaybePromise<void>;
|
|
37
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Props for the page tabs component.
|
|
98
|
+
*/
|
|
38
99
|
interface PageTabsProps<T extends PageTabsOptionData> extends PageTabsRootProps {
|
|
39
100
|
/**
|
|
40
101
|
* root element class
|
|
41
102
|
*/
|
|
42
103
|
class?: ClassValue;
|
|
104
|
+
/**
|
|
105
|
+
* Visual size of the component.
|
|
106
|
+
*/
|
|
43
107
|
size?: ThemeSize;
|
|
108
|
+
/**
|
|
109
|
+
* Visual variant of the component.
|
|
110
|
+
*/
|
|
44
111
|
variant?: PageTabsVariant;
|
|
112
|
+
/**
|
|
113
|
+
* Per-slot class overrides for the component.
|
|
114
|
+
*/
|
|
45
115
|
ui?: Partial<PageTabsExtendedUi>;
|
|
116
|
+
/**
|
|
117
|
+
* Items rendered by the component.
|
|
118
|
+
*/
|
|
46
119
|
items: T[];
|
|
47
120
|
/**
|
|
48
121
|
* A factory function to generate context menu options for each tab.
|
|
@@ -56,6 +129,9 @@ interface PageTabsProps<T extends PageTabsOptionData> extends PageTabsRootProps
|
|
|
56
129
|
*/
|
|
57
130
|
beforeClose?: (value: string) => MaybePromise<boolean | void>;
|
|
58
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Emits for the page tabs component.
|
|
134
|
+
*/
|
|
59
135
|
type PageTabsEmits<T> = PageTabsRootEmits & {
|
|
60
136
|
(e: 'update:items', items: T[]): void;
|
|
61
137
|
(e: 'click', tab: T): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { PaginationEmits, PaginationProps } from "./types.js";
|
|
2
2
|
import { _default } from "./pagination.vue.js";
|
|
3
|
-
|
|
4
|
-
export { type PaginationButtonProps, type PaginationEllipsisProps, type PaginationListItemProps, type PaginationListProps, type PaginationRootEmits, type PaginationRootProps };
|
|
3
|
+
export * from "@soybeanjs/headless/pagination";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import{paginationVariants as n}from"./variants.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,guardReactiveProps as u,mergeProps as d,normalizeProps as f,openBlock as p,renderList as m,renderSlot as h,unref as g,withCtx as _}from"vue";import{useOmitProps as v}from"@soybeanjs/headless/composables";import{PaginationEllipsis as y,PaginationFirst as b,PaginationLast as x,PaginationList as S,PaginationListItem as C,PaginationNext as w,PaginationPrev as T,PaginationRoot as E,providePaginationUi as D}from"@soybeanjs/headless";const O=l({name:`SPagination`,__name:`pagination`,props:{class:{},ui:{},size:{},variant:{},shape:{},actionAsSelected:{type:Boolean},showFirstOrLast:{type:Boolean,default:!0},listProps:{},listItemProps:{},ellipsisProps:{},firstProps:{},prevProps:{},nextProps:{},lastProps:{},page:{},defaultPage:{},pageSize:{},defaultPageSize:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean}},emits:[`update:page`,`update:pageSize`],setup(l,{emit:O}){let k=l,A=O,j=v(k,[`class`,`ui`,`size`,`variant`,`shape`,`actionAsSelected`,`showFirstOrLast`,`listProps`,`listItemProps`,`ellipsisProps`,`firstProps`,`prevProps`,`nextProps`,`lastProps`]),M=i(()=>k.actionAsSelected?``:void 0);return D(i(()=>{let t=n({size:k.size,variant:k.variant,shape:k.shape,actionAsSelected:k.actionAsSelected}),{button:r,navigationButton:i}=t;return e({...t,listItem:r,first:i,prev:i,next:i,last:i},k.ui,{root:k.class})})),(e,n)=>(p(),a(g(E),d(g(j),{"onUpdate:page":n[0]||=e=>A(`update:page`,e),"onUpdate:pageSize":n[1]||=e=>A(`update:pageSize`,e)}),{default:_(()=>[h(e.$slots,`leading`),c(g(S),f(u(l.listProps)),{default:_(({items:n})=>[l.showFirstOrLast?(p(),a(g(b),d({key:0},l.firstProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`first`,{},()=>[c(t,{icon:`lucide:chevrons-left`})])]),_:3},16,[`data-selected`])):o(`v-if`,!0),c(g(T),d(l.prevProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`prev`,{},()=>[c(t,{icon:`lucide:chevron-left`})])]),_:3},16,[`data-selected`]),(p(!0),s(r,null,m(n,n=>(p(),s(r,{key:n},[n.type===`page`?(p(),a(g(C),d({key:0,ref_for:!0},l.listItemProps,{value:n.value}),null,16,[`value`])):n.type===`ellipsis`?(p(),a(g(y),d({key:1,ref_for:!0},l.ellipsisProps),{default:_(()=>[h(e.$slots,`ellipsis`,{},()=>[c(t,{icon:`lucide:ellipsis`})])]),_:3},16)):o(`v-if`,!0)],64))),128)),c(g(w),d(l.nextProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`next`,{},()=>[c(t,{icon:`lucide:chevron-right`})])]),_:3},16,[`data-selected`]),l.showFirstOrLast?(p(),a(g(x),d({key:1},l.lastProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`last`,{},()=>[c(t,{icon:`lucide:chevrons-right`})])]),_:3},16,[`data-selected`])):o(`v-if`,!0)]),_:3},16),h(e.$slots,`trailing`)]),_:3},16))}});export{O as default};
|
|
1
|
+
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import{paginationVariants as n}from"./variants.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,guardReactiveProps as u,mergeProps as d,normalizeProps as f,openBlock as p,renderList as m,renderSlot as h,unref as g,withCtx as _}from"vue";import{useOmitProps as v}from"@soybeanjs/headless/composables";import{PaginationEllipsis as y,PaginationFirst as b,PaginationLast as x,PaginationList as S,PaginationListItem as C,PaginationNext as w,PaginationPrev as T,PaginationRoot as E,providePaginationUi as D}from"@soybeanjs/headless/pagination";const O=l({name:`SPagination`,__name:`pagination`,props:{class:{},ui:{},size:{},variant:{},shape:{},actionAsSelected:{type:Boolean},showFirstOrLast:{type:Boolean,default:!0},listProps:{},listItemProps:{},ellipsisProps:{},firstProps:{},prevProps:{},nextProps:{},lastProps:{},page:{},defaultPage:{},pageSize:{},defaultPageSize:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean}},emits:[`update:page`,`update:pageSize`],setup(l,{emit:O}){let k=l,A=O,j=v(k,[`class`,`ui`,`size`,`variant`,`shape`,`actionAsSelected`,`showFirstOrLast`,`listProps`,`listItemProps`,`ellipsisProps`,`firstProps`,`prevProps`,`nextProps`,`lastProps`]),M=i(()=>k.actionAsSelected?``:void 0);return D(i(()=>{let t=n({size:k.size,variant:k.variant,shape:k.shape,actionAsSelected:k.actionAsSelected}),{button:r,navigationButton:i}=t;return e({...t,listItem:r,first:i,prev:i,next:i,last:i},k.ui,{root:k.class})})),(e,n)=>(p(),a(g(E),d(g(j),{"onUpdate:page":n[0]||=e=>A(`update:page`,e),"onUpdate:pageSize":n[1]||=e=>A(`update:pageSize`,e)}),{default:_(()=>[h(e.$slots,`leading`),c(g(S),f(u(l.listProps)),{default:_(({items:n})=>[l.showFirstOrLast?(p(),a(g(b),d({key:0},l.firstProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`first`,{},()=>[c(t,{icon:`lucide:chevrons-left`})])]),_:3},16,[`data-selected`])):o(`v-if`,!0),c(g(T),d(l.prevProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`prev`,{},()=>[c(t,{icon:`lucide:chevron-left`})])]),_:3},16,[`data-selected`]),(p(!0),s(r,null,m(n,n=>(p(),s(r,{key:n},[n.type===`page`?(p(),a(g(C),d({key:0,ref_for:!0},l.listItemProps,{value:n.value}),null,16,[`value`])):n.type===`ellipsis`?(p(),a(g(y),d({key:1,ref_for:!0},l.ellipsisProps),{default:_(()=>[h(e.$slots,`ellipsis`,{},()=>[c(t,{icon:`lucide:ellipsis`})])]),_:3},16)):o(`v-if`,!0)],64))),128)),c(g(w),d(l.nextProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`next`,{},()=>[c(t,{icon:`lucide:chevron-right`})])]),_:3},16,[`data-selected`]),l.showFirstOrLast?(p(),a(g(x),d({key:1},l.lastProps,{"data-selected":M.value}),{default:_(()=>[h(e.$slots,`last`,{},()=>[c(t,{icon:`lucide:chevrons-right`})])]),_:3},16,[`data-selected`])):o(`v-if`,!0)]),_:3},16),h(e.$slots,`trailing`)]),_:3},16))}});export{O as default};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { ThemeSize } from "../../theme/types.js";
|
|
2
2
|
import { PaginationShape, PaginationVariant } from "./variants.js";
|
|
3
|
-
import {
|
|
3
|
+
import { PaginationButtonProps, PaginationEllipsisProps, PaginationListItemProps, PaginationListProps, PaginationRootEmits, PaginationRootProps, PaginationUi } from "@soybeanjs/headless/pagination";
|
|
4
|
+
import { ClassValue } from "@soybeanjs/headless/types";
|
|
4
5
|
|
|
5
6
|
//#region src/components/pagination/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Props for the pagination component.
|
|
9
|
+
*/
|
|
6
10
|
interface PaginationProps extends PaginationRootProps {
|
|
11
|
+
/**
|
|
12
|
+
* Additional class names applied to the root element.
|
|
13
|
+
*/
|
|
7
14
|
class?: ClassValue;
|
|
8
15
|
/** The custom ui class names */
|
|
9
16
|
ui?: Partial<PaginationUi>;
|
|
@@ -32,6 +39,9 @@ interface PaginationProps extends PaginationRootProps {
|
|
|
32
39
|
/** The props for the last button component */
|
|
33
40
|
lastProps?: PaginationButtonProps;
|
|
34
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Emits for the pagination component.
|
|
44
|
+
*/
|
|
35
45
|
type PaginationEmits = PaginationRootEmits;
|
|
36
46
|
//#endregion
|
|
37
47
|
export { PaginationEmits, PaginationProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import{inputVariants as n}from"../input/variants.js";import{computed as r,createBlock as i,createCommentVNode as a,createVNode as o,defineComponent as s,mergeProps as c,normalizeClass as l,openBlock as u,renderSlot as d,unref as f,withCtx as p}from"vue";import{useControllableState as m,useForwardElement as h,useOmitProps as g}from"@soybeanjs/headless/composables";import{InputControl as _,InputRoot as v,provideInputUi as y}from"@soybeanjs/headless";const b=s({name:`SPassword`,__name:`password`,props:{class:{},size:{},ui:{},visible:{type:Boolean,default:void 0},clearable:{type:Boolean},inputRef:{},controlProps:{},defaultValue:{},modelValue:{},id:{},autofocus:{type:Boolean},disabled:{type:Boolean},maxlength:{},minlength:{},pattern:{},placeholder:{},readonly:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`,`update:visible`],setup(s,{emit:b}){let x=s,S=b,[C,w]=h(e=>x.inputRef?.(e)),T=g(x,[`class`,`size`,`ui`,`clearable`,`visible`,`inputRef`,`controlProps`]),E=m(()=>x.visible,e=>{S(`update:visible`,e)},!1),D=()=>{E.value=!E.value},O=r(()=>e(n({size:x.size}),x.ui,{root:x.class}));return y(O),(e,n)=>(u(),i(f(v),c(f(T),{"onUpdate:modelValue":n[0]||=e=>S(`update:modelValue`,e)}),{default:p(({clear:n})=>[d(e.$slots,`leading`),o(f(_),c(s.controlProps,{ref:f(w),type:f(E)?`text`:`password`}),null,16,[`type`]),s.clearable?(u(),i(t,{key:0,icon:`lucide:x`,class:l(O.value.clearable),onClick:n},null,8,[`class`,`onClick`])):a(`v-if`,!0),d(e.$slots,`trailing`),d(e.$slots,`visible`,{visible:f(E),toggle:D},()=>[o(t,{icon:f(E)?`lucide:eye`:`lucide:eye-off`,class:l(O.value.visible),onClick:D},null,8,[`icon`,`class`])])]),_:3},16))}});export{b as default};
|
|
1
|
+
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import{inputVariants as n}from"../input/variants.js";import{computed as r,createBlock as i,createCommentVNode as a,createVNode as o,defineComponent as s,mergeProps as c,normalizeClass as l,openBlock as u,renderSlot as d,unref as f,withCtx as p}from"vue";import{useControllableState as m,useForwardElement as h,useOmitProps as g}from"@soybeanjs/headless/composables";import{InputControl as _,InputRoot as v,provideInputUi as y}from"@soybeanjs/headless/input";const b=s({name:`SPassword`,__name:`password`,props:{class:{},size:{},ui:{},visible:{type:Boolean,default:void 0},clearable:{type:Boolean},inputRef:{},controlProps:{},defaultValue:{},modelValue:{},id:{},autofocus:{type:Boolean},disabled:{type:Boolean},maxlength:{},minlength:{},pattern:{},placeholder:{},readonly:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`,`update:visible`],setup(s,{emit:b}){let x=s,S=b,[C,w]=h(e=>x.inputRef?.(e)),T=g(x,[`class`,`size`,`ui`,`clearable`,`visible`,`inputRef`,`controlProps`]),E=m(()=>x.visible,e=>{S(`update:visible`,e)},!1),D=()=>{E.value=!E.value},O=r(()=>e(n({size:x.size}),x.ui,{root:x.class}));return y(O),(e,n)=>(u(),i(f(v),c(f(T),{"onUpdate:modelValue":n[0]||=e=>S(`update:modelValue`,e)}),{default:p(({clear:n})=>[d(e.$slots,`leading`),o(f(_),c(s.controlProps,{ref:f(w),type:f(E)?`text`:`password`}),null,16,[`type`]),s.clearable?(u(),i(t,{key:0,icon:`lucide:x`,class:l(O.value.clearable),onClick:n},null,8,[`class`,`onClick`])):a(`v-if`,!0),d(e.$slots,`trailing`),d(e.$slots,`visible`,{visible:f(E),toggle:D},()=>[o(t,{icon:f(E)?`lucide:eye`:`lucide:eye-off`,class:l(O.value.visible),onClick:D},null,8,[`icon`,`class`])])]),_:3},16))}});export{b as default};
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { ThemeSize } from "../../theme/types.js";
|
|
2
|
-
import {
|
|
2
|
+
import { InputControlProps, InputRootEmits, InputRootProps, InputUi } from "@soybeanjs/headless/input";
|
|
3
|
+
import { ClassValue } from "@soybeanjs/headless/types";
|
|
3
4
|
|
|
4
5
|
//#region src/components/password/types.d.ts
|
|
5
6
|
type PasswordUiSlot = 'clearable' | 'visible';
|
|
6
7
|
type PasswordUi = InputUi & Record<PasswordUiSlot, ClassValue>;
|
|
8
|
+
/**
|
|
9
|
+
* Props for the password component.
|
|
10
|
+
*/
|
|
7
11
|
interface PasswordProps extends InputRootProps {
|
|
12
|
+
/**
|
|
13
|
+
* Additional class names applied to the root element.
|
|
14
|
+
*/
|
|
8
15
|
class?: ClassValue;
|
|
16
|
+
/**
|
|
17
|
+
* Visual size of the component.
|
|
18
|
+
*/
|
|
9
19
|
size?: ThemeSize;
|
|
20
|
+
/**
|
|
21
|
+
* Per-slot class overrides for the component.
|
|
22
|
+
*/
|
|
10
23
|
ui?: Partial<PasswordUi>;
|
|
11
24
|
/** Whether to show the password */
|
|
12
25
|
visible?: boolean;
|
|
@@ -23,7 +36,13 @@ interface PasswordProps extends InputRootProps {
|
|
|
23
36
|
*/
|
|
24
37
|
controlProps?: InputControlProps;
|
|
25
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Emits for the password component.
|
|
41
|
+
*/
|
|
26
42
|
type PasswordEmits = InputRootEmits & {
|
|
43
|
+
/**
|
|
44
|
+
* Emitted when the visible state changes.
|
|
45
|
+
*/
|
|
27
46
|
'update:visible': [visible: boolean];
|
|
28
47
|
};
|
|
29
48
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{miniSizeMap as e}from"../../theme/config.js";import"../../theme/index.js";import t from"../button/button.js";import{usePopconfirmContext as n}from"./context.js";import{computed as r,createBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,mergeProps as c,openBlock as l,renderSlot as u,toDisplayString as d,unref as f,withCtx as p}from"vue";import{useOmitProps as m}from"@soybeanjs/headless/composables";import{PopoverClose as h}from"@soybeanjs/headless";const g=s({name:`SPopconfirmCancel`,__name:`popconfirm-cancel`,props:{text:{},beforeClose:{},class:{},color:{},size:{},variant:{default:`pure`},shape:{},shadow:{},fitContent:{type:Boolean},type:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`close`],setup(s,{emit:g}){let _=s,v=g,y=m(_,[`text`,`beforeClose`]),{size:b,cancelText:x,cancelProps:S,beforeCancel:C,onClose:w}=n(`PopconfirmCancel`),T=r(()=>({...S.value,...y.value})),E=r(()=>_.text??x.value??`Cancel`),D=r(()=>_.size??e[b.value??`md`]),O=()=>{v(`close`),w()};return(e,n)=>(l(),i(f(h),{"as-child":``,"before-close":s.beforeClose??f(C),onClose:O},{default:p(()=>[o(t,c(T.value,{size:D.value}),{default:p(()=>[u(e.$slots,`default`,{},()=>[a(d(E.value),1)])]),_:3},16,[`size`])]),_:3},8,[`before-close`]))}});export{g as default};
|
|
1
|
+
import{miniSizeMap as e}from"../../theme/config.js";import"../../theme/index.js";import t from"../button/button.js";import{usePopconfirmContext as n}from"./context.js";import{computed as r,createBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,mergeProps as c,openBlock as l,renderSlot as u,toDisplayString as d,unref as f,withCtx as p}from"vue";import{useOmitProps as m}from"@soybeanjs/headless/composables";import{PopoverClose as h}from"@soybeanjs/headless/popover";const g=s({name:`SPopconfirmCancel`,__name:`popconfirm-cancel`,props:{text:{},beforeClose:{},class:{},color:{},size:{},variant:{default:`pure`},shape:{},shadow:{},fitContent:{type:Boolean},type:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`close`],setup(s,{emit:g}){let _=s,v=g,y=m(_,[`text`,`beforeClose`]),{size:b,cancelText:x,cancelProps:S,beforeCancel:C,onClose:w}=n(`PopconfirmCancel`),T=r(()=>({...S.value,...y.value})),E=r(()=>_.text??x.value??`Cancel`),D=r(()=>_.size??e[b.value??`md`]),O=()=>{v(`close`),w()};return(e,n)=>(l(),i(f(h),{"as-child":``,"before-close":s.beforeClose??f(C),onClose:O},{default:p(()=>[o(t,c(T.value,{size:D.value}),{default:p(()=>[u(e.$slots,`default`,{},()=>[a(d(E.value),1)])]),_:3},16,[`size`])]),_:3},8,[`before-close`]))}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{miniSizeMap as e}from"../../theme/config.js";import"../../theme/index.js";import t from"../button/button.js";import{usePopconfirmContext as n}from"./context.js";import{computed as r,createBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,mergeProps as c,openBlock as l,renderSlot as u,toDisplayString as d,unref as f,withCtx as p}from"vue";import{useOmitProps as m}from"@soybeanjs/headless/composables";import{PopoverClose as h}from"@soybeanjs/headless";const g=s({name:`SPopconfirmConfirm`,__name:`popconfirm-confirm`,props:{text:{},beforeClose:{type:Function},class:{},color:{},size:{},variant:{},shape:{},shadow:{},fitContent:{type:Boolean},type:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`close`],setup(s,{emit:g}){let _=s,v=g,y=m(_,[`text`,`beforeClose`]),{size:b,confirmText:x,confirmProps:S,beforeConfirm:C,onClose:w}=n(`PopconfirmConfirm`),T=r(()=>({...S.value,...y.value})),E=r(()=>_.text??x.value??`Confirm`),D=r(()=>_.size??e[b.value??`md`]),O=()=>{v(`close`),w()};return(e,n)=>(l(),i(f(h),{"as-child":``,"before-close":s.beforeClose??f(C),onClose:O},{default:p(()=>[o(t,c(T.value,{size:D.value}),{default:p(()=>[u(e.$slots,`default`,{},()=>[a(d(E.value),1)])]),_:3},16,[`size`])]),_:3},8,[`before-close`]))}});export{g as default};
|
|
1
|
+
import{miniSizeMap as e}from"../../theme/config.js";import"../../theme/index.js";import t from"../button/button.js";import{usePopconfirmContext as n}from"./context.js";import{computed as r,createBlock as i,createTextVNode as a,createVNode as o,defineComponent as s,mergeProps as c,openBlock as l,renderSlot as u,toDisplayString as d,unref as f,withCtx as p}from"vue";import{useOmitProps as m}from"@soybeanjs/headless/composables";import{PopoverClose as h}from"@soybeanjs/headless/popover";const g=s({name:`SPopconfirmConfirm`,__name:`popconfirm-confirm`,props:{text:{},beforeClose:{type:Function},class:{},color:{},size:{},variant:{},shape:{},shadow:{},fitContent:{type:Boolean},type:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`close`],setup(s,{emit:g}){let _=s,v=g,y=m(_,[`text`,`beforeClose`]),{size:b,confirmText:x,confirmProps:S,beforeConfirm:C,onClose:w}=n(`PopconfirmConfirm`),T=r(()=>({...S.value,...y.value})),E=r(()=>_.text??x.value??`Confirm`),D=r(()=>_.size??e[b.value??`md`]),O=()=>{v(`close`),w()};return(e,n)=>(l(),i(f(h),{"as-child":``,"before-close":s.beforeClose??f(C),onClose:O},{default:p(()=>[o(t,c(T.value,{size:D.value}),{default:p(()=>[u(e.$slots,`default`,{},()=>[a(d(E.value),1)])]),_:3},16,[`size`])]),_:3},8,[`before-close`]))}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import{providePopconfirmContext as n}from"./context.js";import{popconfirmVariants as r}from"./variants.js";import i from"./popconfirm-cancel.js";import a from"./popconfirm-confirm.js";import{computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createTextVNode as d,createVNode as f,defineComponent as p,guardReactiveProps as m,mergeProps as h,normalizeClass as g,normalizeProps as _,openBlock as v,renderSlot as y,toDisplayString as b,toHandlers as x,unref as S,useSlots as C,withCtx as w}from"vue";import{useForwardListeners as T,usePickProps as E}from"@soybeanjs/headless/composables";import{
|
|
1
|
+
import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import{providePopconfirmContext as n}from"./context.js";import{popconfirmVariants as r}from"./variants.js";import i from"./popconfirm-cancel.js";import a from"./popconfirm-confirm.js";import{computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createTextVNode as d,createVNode as f,defineComponent as p,guardReactiveProps as m,mergeProps as h,normalizeClass as g,normalizeProps as _,openBlock as v,renderSlot as y,toDisplayString as b,toHandlers as x,unref as S,useSlots as C,withCtx as w}from"vue";import{useForwardListeners as T,usePickProps as E}from"@soybeanjs/headless/composables";import{transformPropsToContext as D}from"@soybeanjs/headless/shared";import{PopoverArrow as O,PopoverClose as k,PopoverPopup as A,PopoverPortal as j,PopoverPositioner as M,PopoverRoot as N,PopoverTrigger as P,providePopoverUi as F}from"@soybeanjs/headless/popover";const I=p({name:`SPopconfirm`,__name:`popconfirm`,props:{class:{},size:{},ui:{},type:{},placement:{},title:{},description:{},content:{},showArrow:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},confirmText:{},cancelText:{},showCancel:{type:[String,Boolean],default:`onlyWarning`},beforeCancel:{},beforeConfirm:{},confirmProps:{},cancelProps:{},positionerProps:{},popupProps:{},triggerProps:{},closeProps:{},portalProps:{},arrowProps:{},headerProps:{},titleProps:{},descriptionProps:{},contentProps:{},footerProps:{},disabled:{type:Boolean},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!1}},emits:[`update:open`,`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`close`],setup(p,{emit:I}){let L=p,R=I,z=C(),B=E(L,[`defaultOpen`,`open`,`modal`]),V=T(R),H=o(()=>e(r({size:L.size}),L.ui,{popup:L.class})),U={destructive:{icon:`lucide:circle-x`,class:`text-destructive`},success:{icon:`lucide:circle-check`,class:`text-success`},warning:{icon:`lucide:circle-alert`,class:`text-warning`},info:{icon:`lucide:info`,class:`text-info`}},W=o(()=>L.type?U[L.type]:null),G=o(()=>({placement:L.placement,...L.positionerProps})),K=o(()=>typeof L.showCancel==`boolean`?L.showCancel:L.type===`warning`),q=()=>{R(`close`)};return F(H),n({...D(L,[`size`,`confirmText`,`cancelText`,`showCancel`,`cancelProps`,`confirmProps`]),beforeConfirm:L.beforeConfirm,beforeCancel:L.beforeCancel,onClose:q}),(e,n)=>(v(),s(S(N),h(S(B),{"onUpdate:open":n[0]||=e=>R(`update:open`,e)}),{default:w(n=>[f(S(P),h(p.triggerProps,{"as-child":``}),{default:w(()=>[y(e.$slots,`trigger`)]),_:3},16),f(S(j),_(m(p.portalProps)),{default:w(()=>[f(S(M),h(G.value,x(S(V))),{default:w(()=>[f(S(A),_(m(p.popupProps)),{default:w(()=>[u(`div`,h(p.headerProps,{class:H.value.header}),[u(`h3`,h(p.titleProps,{class:H.value.title}),[p.showIcon&&W.value?(v(),s(t,{key:0,icon:W.value.icon,class:g(W.value.class)},null,8,[`icon`,`class`])):c(`v-if`,!0),y(e.$slots,`title`,{close:n.close},()=>[d(b(p.title),1)])],16),S(z).description||p.description?(v(),l(`p`,{key:0,class:g(H.value.description)},[y(e.$slots,`description`,{close:n.close},()=>[d(b(p.description),1)])],2)):c(`v-if`,!0)],16),e.$slots.content||p.content?(v(),l(`div`,h({key:0},p.contentProps,{class:H.value.content}),[y(e.$slots,`default`,{close:n.close},()=>[d(b(p.content),1)])],16)):c(`v-if`,!0),u(`div`,{class:g(H.value.footer)},[y(e.$slots,`footer`,{close:n.close},()=>[K.value?(v(),s(i,{key:0})):c(`v-if`,!0),f(a,{text:p.confirmText},null,8,[`text`])])],2),p.showArrow?(v(),s(S(O),_(h({key:1},p.arrowProps)),null,16)):c(`v-if`,!0)]),_:2},1040),e.$slots.close?(v(),s(S(k),{key:0,"as-child":``},{default:w(()=>[y(e.$slots,`close`)]),_:3})):c(`v-if`,!0)]),_:2},1040)]),_:2},1040)]),_:3},16))}});export{I as default};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { ThemeColor, ThemeSize } from "../../theme/types.js";
|
|
2
|
-
import { ButtonProps
|
|
2
|
+
import { ButtonProps } from "../button/types.js";
|
|
3
3
|
import { HTMLAttributes } from "vue";
|
|
4
|
-
import {
|
|
4
|
+
import { PopoverArrowProps, PopoverCloseProps, PopoverPopupProps, PopoverPortalProps, PopoverPositionerEmits, PopoverPositionerProps, PopoverRootEmits, PopoverRootProps, PopoverTriggerProps, PopoverUiSlot } from "@soybeanjs/headless/popover";
|
|
5
|
+
import { ClassValue, MaybePromise, Placement, PropsToContext, UiClass } from "@soybeanjs/headless/types";
|
|
5
6
|
|
|
6
7
|
//#region src/components/popconfirm/types.d.ts
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Props for the popconfirm confirm component.
|
|
10
|
+
*/
|
|
11
|
+
interface PopconfirmConfirmProps extends ButtonProps {
|
|
12
|
+
/**
|
|
13
|
+
* Text.
|
|
14
|
+
*/
|
|
8
15
|
text?: string;
|
|
9
16
|
/**
|
|
10
17
|
* Called before the dialog is closed. Can be used to prevent the dialog from closing.
|
|
@@ -12,10 +19,22 @@ interface PopconfirmConfirmProps extends ButtonProps$1 {
|
|
|
12
19
|
*/
|
|
13
20
|
beforeClose?: () => MaybePromise<boolean | void>;
|
|
14
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Emits for the popconfirm confirm component.
|
|
24
|
+
*/
|
|
15
25
|
type PopconfirmConfirmEmits = {
|
|
26
|
+
/**
|
|
27
|
+
* Emitted when close occurs.
|
|
28
|
+
*/
|
|
16
29
|
close: [];
|
|
17
30
|
};
|
|
18
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Props for the popconfirm cancel component.
|
|
33
|
+
*/
|
|
34
|
+
interface PopconfirmCancelProps extends ButtonProps {
|
|
35
|
+
/**
|
|
36
|
+
* Text.
|
|
37
|
+
*/
|
|
19
38
|
text?: string;
|
|
20
39
|
/**
|
|
21
40
|
* Called before the dialog is closed. Can be used to prevent the dialog from closing.
|
|
@@ -23,30 +42,87 @@ interface PopconfirmCancelProps extends ButtonProps$1 {
|
|
|
23
42
|
*/
|
|
24
43
|
beforeClose?: () => MaybePromise<boolean | void>;
|
|
25
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Emits for the popconfirm cancel component.
|
|
47
|
+
*/
|
|
26
48
|
type PopconfirmCancelEmits = {
|
|
49
|
+
/**
|
|
50
|
+
* Emitted when close occurs.
|
|
51
|
+
*/
|
|
27
52
|
close: [];
|
|
28
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Props for the popconfirm header component.
|
|
56
|
+
*/
|
|
29
57
|
interface PopconfirmHeaderProps extends /** @vue-ignore */HTMLAttributes {}
|
|
58
|
+
/**
|
|
59
|
+
* Props for the popconfirm title component.
|
|
60
|
+
*/
|
|
30
61
|
interface PopconfirmTitleProps extends /** @vue-ignore */HTMLAttributes {}
|
|
62
|
+
/**
|
|
63
|
+
* Props for the popconfirm description component.
|
|
64
|
+
*/
|
|
31
65
|
interface PopconfirmDescriptionProps extends /** @vue-ignore */HTMLAttributes {}
|
|
66
|
+
/**
|
|
67
|
+
* Props for the popconfirm content component.
|
|
68
|
+
*/
|
|
32
69
|
interface PopconfirmContentProps extends /** @vue-ignore */HTMLAttributes {}
|
|
70
|
+
/**
|
|
71
|
+
* Props for the popconfirm footer component.
|
|
72
|
+
*/
|
|
33
73
|
interface PopconfirmFooterProps extends /** @vue-ignore */HTMLAttributes {}
|
|
74
|
+
/**
|
|
75
|
+
* Supported popconfirm values.
|
|
76
|
+
*/
|
|
34
77
|
type PopconfirmType = Extract<ThemeColor, 'destructive' | 'success' | 'warning' | 'info'>;
|
|
35
78
|
type PopconfirmUiSlot = PopoverUiSlot | 'header' | 'icon' | 'header' | 'title' | 'description' | 'content' | 'footer';
|
|
79
|
+
/**
|
|
80
|
+
* UI class overrides for the popconfirm component.
|
|
81
|
+
*/
|
|
36
82
|
type PopconfirmUi = UiClass<PopconfirmUiSlot>;
|
|
83
|
+
/**
|
|
84
|
+
* Props for the popconfirm component.
|
|
85
|
+
*/
|
|
37
86
|
interface PopconfirmProps extends PopoverRootProps {
|
|
38
87
|
/**
|
|
39
88
|
* class of popup
|
|
40
89
|
*/
|
|
41
90
|
class?: ClassValue;
|
|
91
|
+
/**
|
|
92
|
+
* Visual size of the component.
|
|
93
|
+
*/
|
|
42
94
|
size?: ThemeSize;
|
|
95
|
+
/**
|
|
96
|
+
* Per-slot class overrides for the component.
|
|
97
|
+
*/
|
|
43
98
|
ui?: Partial<PopconfirmUi>;
|
|
99
|
+
/**
|
|
100
|
+
* Type.
|
|
101
|
+
*/
|
|
44
102
|
type?: PopconfirmType;
|
|
103
|
+
/**
|
|
104
|
+
* Placement.
|
|
105
|
+
*/
|
|
45
106
|
placement?: Placement;
|
|
107
|
+
/**
|
|
108
|
+
* Title text rendered by the component.
|
|
109
|
+
*/
|
|
46
110
|
title?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Description text rendered by the component.
|
|
113
|
+
*/
|
|
47
114
|
description?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Content.
|
|
117
|
+
*/
|
|
48
118
|
content?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Whether to show an arrow.
|
|
121
|
+
*/
|
|
49
122
|
showArrow?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Whether to show an icon.
|
|
125
|
+
*/
|
|
50
126
|
showIcon?: boolean;
|
|
51
127
|
/**
|
|
52
128
|
* The text of the confirm button.
|
|
@@ -66,28 +142,91 @@ interface PopconfirmProps extends PopoverRootProps {
|
|
|
66
142
|
* @default 'onlyWarning'
|
|
67
143
|
*/
|
|
68
144
|
showCancel?: 'onlyWarning' | boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Before cancel.
|
|
147
|
+
*/
|
|
69
148
|
beforeCancel?: () => MaybePromise<boolean | void>;
|
|
149
|
+
/**
|
|
150
|
+
* Before confirm.
|
|
151
|
+
*/
|
|
70
152
|
beforeConfirm?: () => MaybePromise<boolean | void>;
|
|
153
|
+
/**
|
|
154
|
+
* Props forwarded to the confirm element.
|
|
155
|
+
*/
|
|
71
156
|
confirmProps?: PopconfirmConfirmProps;
|
|
157
|
+
/**
|
|
158
|
+
* Props forwarded to the cancel element.
|
|
159
|
+
*/
|
|
72
160
|
cancelProps?: PopconfirmCancelProps;
|
|
161
|
+
/**
|
|
162
|
+
* Props forwarded to the positioner element.
|
|
163
|
+
*/
|
|
73
164
|
positionerProps?: PopoverPositionerProps;
|
|
165
|
+
/**
|
|
166
|
+
* Props forwarded to the popup element.
|
|
167
|
+
*/
|
|
74
168
|
popupProps?: PopoverPopupProps;
|
|
169
|
+
/**
|
|
170
|
+
* Props forwarded to the trigger element.
|
|
171
|
+
*/
|
|
75
172
|
triggerProps?: PopoverTriggerProps;
|
|
173
|
+
/**
|
|
174
|
+
* Props forwarded to the close element.
|
|
175
|
+
*/
|
|
76
176
|
closeProps?: PopoverCloseProps;
|
|
177
|
+
/**
|
|
178
|
+
* Props forwarded to the portal element.
|
|
179
|
+
*/
|
|
77
180
|
portalProps?: PopoverPortalProps;
|
|
181
|
+
/**
|
|
182
|
+
* Props forwarded to the arrow element.
|
|
183
|
+
*/
|
|
78
184
|
arrowProps?: PopoverArrowProps;
|
|
185
|
+
/**
|
|
186
|
+
* Props forwarded to the header element.
|
|
187
|
+
*/
|
|
79
188
|
headerProps?: PopconfirmHeaderProps;
|
|
189
|
+
/**
|
|
190
|
+
* Props forwarded to the title element.
|
|
191
|
+
*/
|
|
80
192
|
titleProps?: PopconfirmTitleProps;
|
|
193
|
+
/**
|
|
194
|
+
* Props forwarded to the description element.
|
|
195
|
+
*/
|
|
81
196
|
descriptionProps?: PopconfirmDescriptionProps;
|
|
197
|
+
/**
|
|
198
|
+
* Props forwarded to the content element.
|
|
199
|
+
*/
|
|
82
200
|
contentProps?: PopconfirmContentProps;
|
|
201
|
+
/**
|
|
202
|
+
* Props forwarded to the footer element.
|
|
203
|
+
*/
|
|
83
204
|
footerProps?: PopconfirmFooterProps;
|
|
84
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Emits for the popconfirm component.
|
|
208
|
+
*/
|
|
85
209
|
type PopconfirmEmits = PopoverRootEmits & PopoverPositionerEmits & {
|
|
210
|
+
/**
|
|
211
|
+
* Emitted when close occurs.
|
|
212
|
+
*/
|
|
86
213
|
close: [];
|
|
87
214
|
};
|
|
215
|
+
/**
|
|
216
|
+
* Context for the popconfirm component.
|
|
217
|
+
*/
|
|
88
218
|
interface PopconfirmContext extends PropsToContext<PopconfirmProps, 'size' | 'confirmText' | 'cancelText' | 'showCancel' | 'confirmProps' | 'cancelProps'> {
|
|
219
|
+
/**
|
|
220
|
+
* Before confirm used by the component context.
|
|
221
|
+
*/
|
|
89
222
|
beforeConfirm?: () => MaybePromise<boolean | void>;
|
|
223
|
+
/**
|
|
224
|
+
* Before cancel used by the component context.
|
|
225
|
+
*/
|
|
90
226
|
beforeCancel?: () => MaybePromise<boolean | void>;
|
|
227
|
+
/**
|
|
228
|
+
* Callback invoked when the close event fires.
|
|
229
|
+
*/
|
|
91
230
|
onClose: () => void;
|
|
92
231
|
}
|
|
93
232
|
//#endregion
|