hys-ui 0.2.0 → 0.3.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/CHANGELOG.md +38 -0
- package/README.md +15 -1
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
- package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
- package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
- package/dist/components/HysCascader/HysCascader.vue.js +2 -2
- package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +112 -100
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +490 -85
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +730 -594
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
- package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
- package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +389 -368
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +46 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
- package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +195 -184
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +19 -17
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +110 -76
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/index.js +27 -24
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +1 -1
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -1
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +13 -4
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +2 -2
- package/dist/types/components/HysTable/HysTable.vue.d.ts +4 -4
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -1
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
- package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +3 -0
- package/dist/types/composables/avatar.d.ts +3 -0
- package/dist/types/composables/cascader.d.ts +3 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +3 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +183 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/selectOptions.d.ts +2 -0
- package/dist/types/composables/table.d.ts +3 -0
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/transfer.d.ts +7 -0
- package/dist/types/composables/tree.d.ts +3 -0
- package/dist/types/composables/treeSelect.d.ts +3 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +1 -1
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +21 -2
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/index.d.ts +17 -2
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HysPopupTransition } from '../motion/popup';
|
|
1
2
|
import type { CSSProperties } from "vue";
|
|
2
3
|
import type { Placement } from "./useFloating";
|
|
3
4
|
export type HysDateScalar = string | Date | number;
|
|
@@ -82,6 +83,8 @@ export interface HysDatePickerLocale {
|
|
|
82
83
|
limit: string;
|
|
83
84
|
}
|
|
84
85
|
export interface HysDatePickerProps<V extends HysDatePickerValue = HysDatePickerValue> {
|
|
86
|
+
popupTransition?: HysPopupTransition;
|
|
87
|
+
popupTransitionDuration?: number;
|
|
85
88
|
modelValue?: V;
|
|
86
89
|
defaultValue?: V;
|
|
87
90
|
clearValue?: V;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
|
+
import type { HysModalProps, HysModalActionContext, HysModalCloseReason, HysModalInitialFocus, HysModalSectionSize } from "./modal";
|
|
3
|
+
export type HysDrawerPlacement = "left" | "right" | "top" | "bottom";
|
|
4
|
+
export type HysDrawerSizeName = "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
5
|
+
export type HysDrawerCloseReason = HysModalCloseReason;
|
|
6
|
+
export type HysDrawerActionContext = HysModalActionContext;
|
|
7
|
+
export type HysDrawerInitialFocus = HysModalInitialFocus;
|
|
8
|
+
export type HysDrawerSectionSize = HysModalSectionSize;
|
|
9
|
+
export type HysDrawerBeforeClose = Function & {
|
|
10
|
+
invoke(reason: HysDrawerCloseReason, context: HysDrawerActionContext): boolean | void | Promise<boolean | void>;
|
|
11
|
+
}["invoke"];
|
|
12
|
+
export interface HysDrawerResizeOptions {
|
|
13
|
+
minSize?: number | string;
|
|
14
|
+
maxSize?: number | string;
|
|
15
|
+
step?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface HysDrawerResizeInfo {
|
|
18
|
+
placement: HysDrawerPlacement;
|
|
19
|
+
cancelled: boolean;
|
|
20
|
+
accepted: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface HysDrawerPushOptions {
|
|
23
|
+
distance?: number | string;
|
|
24
|
+
}
|
|
25
|
+
export interface HysDrawerProps extends Pick<HysModalProps, "open" | "modelValue" | "defaultOpen" | "title" | "description" | "opacity" | "maskOpacity" | "width" | "height" | "fullscreen" | "defaultFullscreen" | "showFullscreen" | "closeOnMask" | "closeOnEscape" | "showClose" | "destroyOnClose" | "forceRender" | "modal" | "modalPenetrable" | "appendTo" | "lockScroll" | "trapFocus" | "restoreFocus" | "initialFocus" | "openDelay" | "closeDelay" | "transitionDuration" | "zIndex" | "headerClass" | "headerSize" | "footerSize" | "headerHeight" | "footerHeight" | "titleFontSize" | "bodyClass" | "footerClass" | "overlayClass" | "headerStyle" | "bodyStyle" | "footerStyle" | "maskStyle" | "ariaLabel" | "ariaLabelledby" | "ariaDescribedby" | "role" | "headerAriaLevel" | "closeText" | "fullscreenText" | "restoreText" | "footer" | "footerAlign" | "showCancel" | "okText" | "cancelText" | "okVariant" | "okButtonProps" | "cancelButtonProps" | "confirmLoading" | "confirmDisabled" | "cancelDisabled" | "closeWhileConfirming" | "loading" | "loadingText" | "showError" | "errorText" | "confirmOnCtrlEnter" | "closeOnConfirm"> {
|
|
26
|
+
beforeClose?: HysDrawerBeforeClose;
|
|
27
|
+
beforeConfirm?: (context: HysDrawerActionContext) => boolean | void | Promise<boolean | void>;
|
|
28
|
+
placement?: HysDrawerPlacement;
|
|
29
|
+
size?: HysDrawerSizeName | number | (string & {});
|
|
30
|
+
drawerClass?: string;
|
|
31
|
+
drawerStyle?: CSSProperties;
|
|
32
|
+
overlayStyle?: CSSProperties;
|
|
33
|
+
bodyTabindex?: number;
|
|
34
|
+
contained?: boolean;
|
|
35
|
+
withHeader?: boolean;
|
|
36
|
+
autofocus?: boolean;
|
|
37
|
+
transition?: "slide" | "fade" | "slide-fade" | "none" | false;
|
|
38
|
+
push?: boolean | HysDrawerPushOptions;
|
|
39
|
+
resizable?: boolean | HysDrawerResizeOptions;
|
|
40
|
+
resizeValue?: number | null;
|
|
41
|
+
defaultResizeValue?: number | null;
|
|
42
|
+
resetSizeOnClose?: boolean;
|
|
43
|
+
resizeText?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface HysDrawerSlotContext {
|
|
46
|
+
close: (reasonOrEvent?: HysDrawerCloseReason | Event, event?: Event) => Promise<boolean>;
|
|
47
|
+
cancel: (event?: Event) => Promise<boolean>;
|
|
48
|
+
confirm: (event?: Event) => Promise<boolean>;
|
|
49
|
+
closing: boolean;
|
|
50
|
+
confirming: boolean;
|
|
51
|
+
busy: boolean;
|
|
52
|
+
error: string;
|
|
53
|
+
titleId: string;
|
|
54
|
+
descriptionId: string;
|
|
55
|
+
fullscreen: boolean;
|
|
56
|
+
toggleFullscreen: () => Promise<boolean>;
|
|
57
|
+
resizing: boolean;
|
|
58
|
+
size: number;
|
|
59
|
+
resetSize: () => Promise<boolean>;
|
|
60
|
+
pushed: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface HysDrawerSlots {
|
|
63
|
+
default?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
64
|
+
header?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
65
|
+
title?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
66
|
+
extra?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
67
|
+
footer?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
68
|
+
loading?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
69
|
+
"close-icon"?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
70
|
+
"fullscreen-icon"?: (scope: HysDrawerSlotContext) => VNodeChild;
|
|
71
|
+
}
|
|
72
|
+
export interface HysDrawerInstance {
|
|
73
|
+
readonly element: HTMLElement | undefined;
|
|
74
|
+
readonly body: HTMLElement | undefined;
|
|
75
|
+
readonly open: boolean;
|
|
76
|
+
readonly closing: boolean;
|
|
77
|
+
readonly confirming: boolean;
|
|
78
|
+
readonly fullscreen: boolean;
|
|
79
|
+
readonly resizing: boolean;
|
|
80
|
+
readonly size: number;
|
|
81
|
+
readonly pushed: boolean;
|
|
82
|
+
focus: () => void;
|
|
83
|
+
show: () => Promise<boolean>;
|
|
84
|
+
close: (reasonOrEvent?: HysDrawerCloseReason | Event, event?: Event) => Promise<boolean>;
|
|
85
|
+
hide: () => Promise<boolean>;
|
|
86
|
+
cancel: (event?: Event) => Promise<boolean>;
|
|
87
|
+
confirm: (event?: Event) => Promise<boolean>;
|
|
88
|
+
setFullscreen: (value: boolean) => Promise<boolean>;
|
|
89
|
+
toggleFullscreen: () => Promise<boolean>;
|
|
90
|
+
resizeTo: (value: number | string) => Promise<boolean>;
|
|
91
|
+
resetSize: () => Promise<boolean>;
|
|
92
|
+
}
|
|
93
|
+
export declare const drawerSizes: {
|
|
94
|
+
readonly xs: 280;
|
|
95
|
+
readonly sm: 360;
|
|
96
|
+
readonly md: 520;
|
|
97
|
+
readonly lg: 736;
|
|
98
|
+
readonly xl: 960;
|
|
99
|
+
readonly full: "100%";
|
|
100
|
+
};
|
|
101
|
+
export declare const drawerVertical: (placement?: HysDrawerPlacement) => placement is "top" | "bottom";
|
|
102
|
+
export declare function drawerSize(props: HysDrawerProps): string | number;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
|
+
export type HysAlertTone = "info" | "primary" | "success" | "warning" | "danger";
|
|
3
|
+
export type HysAlertEffect = "light" | "dark" | "outline";
|
|
4
|
+
export type HysAlertTransition = "fade" | "slide" | "collapse" | "none";
|
|
5
|
+
export interface HysAlertCloseContext {
|
|
6
|
+
reason: "button" | "api";
|
|
7
|
+
event?: Event;
|
|
8
|
+
signal: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export interface HysAlertProps {
|
|
11
|
+
tone?: HysAlertTone;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
closable?: boolean;
|
|
15
|
+
showIcon?: boolean;
|
|
16
|
+
center?: boolean;
|
|
17
|
+
visible?: boolean;
|
|
18
|
+
modelValue?: boolean;
|
|
19
|
+
defaultVisible?: boolean;
|
|
20
|
+
effect?: HysAlertEffect;
|
|
21
|
+
banner?: boolean;
|
|
22
|
+
bordered?: boolean;
|
|
23
|
+
size?: "sm" | "md" | "lg";
|
|
24
|
+
closeText?: string;
|
|
25
|
+
closeLabel?: string;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
beforeClose?: (context: HysAlertCloseContext) => boolean | void | Promise<boolean | void>;
|
|
28
|
+
transition?: HysAlertTransition;
|
|
29
|
+
transitionDuration?: number;
|
|
30
|
+
appear?: boolean;
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
ariaLive?: "off" | "polite" | "assertive";
|
|
33
|
+
ariaAtomic?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface HysAlertSlotContext {
|
|
36
|
+
tone: HysAlertTone;
|
|
37
|
+
visible: boolean;
|
|
38
|
+
closing: boolean;
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
close: () => Promise<boolean>;
|
|
41
|
+
}
|
|
42
|
+
export interface HysAlertSlots {
|
|
43
|
+
default?: (context: HysAlertSlotContext) => VNodeChild;
|
|
44
|
+
title?: (context: HysAlertSlotContext) => VNodeChild;
|
|
45
|
+
description?: (context: HysAlertSlotContext) => VNodeChild;
|
|
46
|
+
icon?: (context: HysAlertSlotContext) => VNodeChild;
|
|
47
|
+
action?: (context: HysAlertSlotContext) => VNodeChild;
|
|
48
|
+
"close-icon"?: (context: HysAlertSlotContext) => VNodeChild;
|
|
49
|
+
}
|
|
50
|
+
export interface HysAlertInstance {
|
|
51
|
+
readonly element: HTMLElement | undefined;
|
|
52
|
+
readonly visible: boolean;
|
|
53
|
+
readonly closing: boolean;
|
|
54
|
+
close: () => Promise<boolean>;
|
|
55
|
+
show: () => Promise<boolean>;
|
|
56
|
+
}
|
|
57
|
+
export type HysEmptyIllustration = "inbox" | "simple" | "default";
|
|
58
|
+
export interface HysEmptyProps {
|
|
59
|
+
title?: string | false;
|
|
60
|
+
description?: string | false;
|
|
61
|
+
image?: string | false;
|
|
62
|
+
imageSize?: number;
|
|
63
|
+
imageStyle?: CSSProperties;
|
|
64
|
+
imageFit?: "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
65
|
+
imageAlt?: string;
|
|
66
|
+
imageLoading?: "eager" | "lazy";
|
|
67
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
68
|
+
referrerPolicy?: ReferrerPolicy;
|
|
69
|
+
illustration?: HysEmptyIllustration;
|
|
70
|
+
size?: "sm" | "md" | "lg";
|
|
71
|
+
showImageLoading?: boolean;
|
|
72
|
+
ariaLabel?: string;
|
|
73
|
+
ariaLive?: "off" | "polite" | "assertive";
|
|
74
|
+
}
|
|
75
|
+
export interface HysEmptySlotContext {
|
|
76
|
+
title: string | false;
|
|
77
|
+
description: string | false;
|
|
78
|
+
imageLoading: boolean;
|
|
79
|
+
imageError: boolean;
|
|
80
|
+
retryImage: () => boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface HysEmptySlots {
|
|
83
|
+
default?: (context: HysEmptySlotContext) => VNodeChild;
|
|
84
|
+
image?: (context: HysEmptySlotContext) => VNodeChild;
|
|
85
|
+
title?: (context: HysEmptySlotContext) => VNodeChild;
|
|
86
|
+
description?: (context: HysEmptySlotContext) => VNodeChild;
|
|
87
|
+
action?: (context: HysEmptySlotContext) => VNodeChild;
|
|
88
|
+
fallback?: (context: HysEmptySlotContext) => VNodeChild;
|
|
89
|
+
}
|
|
90
|
+
export interface HysEmptyInstance {
|
|
91
|
+
readonly element: HTMLElement | undefined;
|
|
92
|
+
readonly imageElement: HTMLImageElement | undefined;
|
|
93
|
+
readonly loadingImage: boolean;
|
|
94
|
+
readonly failedImage: boolean;
|
|
95
|
+
retryImage: () => boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare function feedbackImage(value: string | false | undefined): string | undefined;
|
|
98
|
+
export declare const feedbackNumber: (value: number | undefined, fallback: number, min: number, max: number) => number;
|
|
@@ -123,6 +123,8 @@ export interface HysFieldContext {
|
|
|
123
123
|
invalid?: ComputedRef<boolean>;
|
|
124
124
|
status?: ComputedRef<HysFormStatus>;
|
|
125
125
|
validate?: (trigger?: HysFormTrigger) => Promise<boolean>;
|
|
126
|
+
/** Temporarily defer model-watch validation during a continuous control gesture. */
|
|
127
|
+
deferChangeValidation?: () => () => void;
|
|
126
128
|
disabled?: ComputedRef<boolean>;
|
|
127
129
|
size?: ComputedRef<"sm" | "md" | "lg">;
|
|
128
130
|
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { HysPopupMotionProps } from "../motion/popup";
|
|
2
|
+
import { type Component, type CSSProperties, type VNodeChild } from "vue";
|
|
3
|
+
import type { Placement } from "./useFloating";
|
|
4
|
+
export type HysMenuKey = string | number;
|
|
5
|
+
export type HysContextMenuTrigger = "contextmenu" | "click" | "hover" | "focus";
|
|
6
|
+
export interface HysContextMenuItem {
|
|
7
|
+
label: string;
|
|
8
|
+
value?: HysMenuKey;
|
|
9
|
+
type?: "item" | "divider" | "group" | "checkbox" | "radio";
|
|
10
|
+
children?: readonly HysContextMenuItem[];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
danger?: boolean;
|
|
14
|
+
icon?: Component;
|
|
15
|
+
description?: string;
|
|
16
|
+
shortcut?: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
rel?: string;
|
|
20
|
+
checked?: boolean;
|
|
21
|
+
radioGroup?: HysMenuKey;
|
|
22
|
+
closeOnSelect?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface HysMenuFieldNames {
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
children: string;
|
|
28
|
+
disabled: string;
|
|
29
|
+
hidden: string;
|
|
30
|
+
type: string;
|
|
31
|
+
icon: string;
|
|
32
|
+
description: string;
|
|
33
|
+
shortcut: string;
|
|
34
|
+
href: string;
|
|
35
|
+
target: string;
|
|
36
|
+
rel: string;
|
|
37
|
+
danger: string;
|
|
38
|
+
checked: string;
|
|
39
|
+
radioGroup: string;
|
|
40
|
+
closeOnSelect: string;
|
|
41
|
+
}
|
|
42
|
+
export interface HysMenuSelectInfo<N extends object = HysContextMenuItem> {
|
|
43
|
+
item: N;
|
|
44
|
+
path: readonly N[];
|
|
45
|
+
keys: readonly HysMenuKey[];
|
|
46
|
+
event: MouseEvent | KeyboardEvent | undefined;
|
|
47
|
+
checked?: boolean;
|
|
48
|
+
checkedKeys: readonly HysMenuKey[];
|
|
49
|
+
selectedKeys: readonly HysMenuKey[];
|
|
50
|
+
}
|
|
51
|
+
export interface HysMenuShowOptions {
|
|
52
|
+
x?: number;
|
|
53
|
+
y?: number;
|
|
54
|
+
focus?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface HysContextMenuProps<N extends object = HysContextMenuItem> extends HysPopupMotionProps {
|
|
57
|
+
items: readonly N[];
|
|
58
|
+
fieldNames?: Partial<HysMenuFieldNames>;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
loading?: boolean;
|
|
61
|
+
size?: "sm" | "md" | "lg";
|
|
62
|
+
trigger?: HysContextMenuTrigger | readonly HysContextMenuTrigger[];
|
|
63
|
+
open?: boolean;
|
|
64
|
+
defaultOpen?: boolean;
|
|
65
|
+
openPath?: readonly HysMenuKey[];
|
|
66
|
+
defaultOpenPath?: readonly HysMenuKey[];
|
|
67
|
+
checkedKeys?: readonly HysMenuKey[];
|
|
68
|
+
defaultCheckedKeys?: readonly HysMenuKey[];
|
|
69
|
+
selectedKeys?: readonly HysMenuKey[];
|
|
70
|
+
defaultSelectedKeys?: readonly HysMenuKey[];
|
|
71
|
+
selectable?: boolean;
|
|
72
|
+
multiple?: boolean;
|
|
73
|
+
hideOnClick?: boolean;
|
|
74
|
+
autofocus?: boolean;
|
|
75
|
+
loopNavigation?: boolean;
|
|
76
|
+
showDelay?: number;
|
|
77
|
+
hideDelay?: number;
|
|
78
|
+
submenuDelay?: number;
|
|
79
|
+
submenuTrigger?: "hover" | "click";
|
|
80
|
+
placement?: Placement;
|
|
81
|
+
appendTo?: string | HTMLElement | false;
|
|
82
|
+
width?: string | number;
|
|
83
|
+
minWidth?: number;
|
|
84
|
+
maxWidth?: number;
|
|
85
|
+
maxHeight?: number;
|
|
86
|
+
arrow?: boolean;
|
|
87
|
+
popupClass?: string;
|
|
88
|
+
popupStyle?: CSSProperties;
|
|
89
|
+
direction?: "ltr" | "rtl";
|
|
90
|
+
ariaLabel?: string;
|
|
91
|
+
emptyText?: string;
|
|
92
|
+
loadingText?: string;
|
|
93
|
+
backText?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface HysContextMenuInstance<N extends object = HysContextMenuItem> {
|
|
96
|
+
readonly element: HTMLElement | undefined;
|
|
97
|
+
readonly open: boolean;
|
|
98
|
+
readonly checkedKeys: HysMenuKey[];
|
|
99
|
+
readonly selectedKeys: HysMenuKey[];
|
|
100
|
+
readonly openPath: HysMenuKey[];
|
|
101
|
+
focus: () => void;
|
|
102
|
+
blur: () => void;
|
|
103
|
+
show: (event?: MouseEvent | KeyboardEvent | HysMenuShowOptions) => Promise<boolean>;
|
|
104
|
+
showAt: (x: number, y: number, focus?: boolean) => Promise<boolean>;
|
|
105
|
+
hide: (restoreFocus?: boolean) => Promise<boolean>;
|
|
106
|
+
handleOpen: () => Promise<boolean>;
|
|
107
|
+
handleClose: () => Promise<boolean>;
|
|
108
|
+
toggle: () => Promise<boolean>;
|
|
109
|
+
focusItem: (key: HysMenuKey) => Promise<boolean>;
|
|
110
|
+
openSubmenu: (key: HysMenuKey) => Promise<boolean>;
|
|
111
|
+
closeSubmenus: () => Promise<boolean>;
|
|
112
|
+
setCheckedKeys: (keys: readonly HysMenuKey[]) => Promise<boolean>;
|
|
113
|
+
setSelectedKeys: (keys: readonly HysMenuKey[]) => Promise<boolean>;
|
|
114
|
+
getItems: () => N[];
|
|
115
|
+
}
|
|
116
|
+
export interface HysMenuItemContext<N extends object = HysContextMenuItem> {
|
|
117
|
+
item: N;
|
|
118
|
+
value: HysMenuKey | undefined;
|
|
119
|
+
label: string;
|
|
120
|
+
path: readonly N[];
|
|
121
|
+
keys: readonly HysMenuKey[];
|
|
122
|
+
level: number;
|
|
123
|
+
disabled: boolean;
|
|
124
|
+
checked: boolean;
|
|
125
|
+
selected: boolean;
|
|
126
|
+
expanded: boolean;
|
|
127
|
+
submenu: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface HysContextMenuSlots<N extends object = HysContextMenuItem> {
|
|
130
|
+
default?: (scope: {
|
|
131
|
+
open: boolean;
|
|
132
|
+
show: HysContextMenuInstance<N>["show"];
|
|
133
|
+
hide: HysContextMenuInstance<N>["hide"];
|
|
134
|
+
toggle: HysContextMenuInstance<N>["toggle"];
|
|
135
|
+
attrs: Record<string, unknown>;
|
|
136
|
+
}) => VNodeChild;
|
|
137
|
+
item?: (scope: HysMenuItemContext<N>) => VNodeChild;
|
|
138
|
+
icon?: (scope: HysMenuItemContext<N>) => VNodeChild;
|
|
139
|
+
link?: (scope: HysMenuItemContext<N> & {
|
|
140
|
+
attrs: Record<string, unknown>;
|
|
141
|
+
}) => VNodeChild;
|
|
142
|
+
header?: (scope: {
|
|
143
|
+
close: () => Promise<boolean>;
|
|
144
|
+
}) => VNodeChild;
|
|
145
|
+
footer?: (scope: {
|
|
146
|
+
close: () => Promise<boolean>;
|
|
147
|
+
}) => VNodeChild;
|
|
148
|
+
empty?: () => VNodeChild;
|
|
149
|
+
loading?: () => VNodeChild;
|
|
150
|
+
}
|
|
151
|
+
export interface MenuRow<N extends object> {
|
|
152
|
+
id: string;
|
|
153
|
+
raw: N;
|
|
154
|
+
key?: HysMenuKey;
|
|
155
|
+
label: string;
|
|
156
|
+
type: NonNullable<HysContextMenuItem["type"]>;
|
|
157
|
+
disabled: boolean;
|
|
158
|
+
danger: boolean;
|
|
159
|
+
icon?: Component;
|
|
160
|
+
description: string;
|
|
161
|
+
shortcut: string;
|
|
162
|
+
href?: string;
|
|
163
|
+
target?: string;
|
|
164
|
+
rel?: string;
|
|
165
|
+
radioGroup?: HysMenuKey;
|
|
166
|
+
checked: boolean;
|
|
167
|
+
closeOnSelect?: boolean;
|
|
168
|
+
children: MenuRow<N>[];
|
|
169
|
+
parents: MenuRow<N>[];
|
|
170
|
+
path: N[];
|
|
171
|
+
keys: HysMenuKey[];
|
|
172
|
+
level: number;
|
|
173
|
+
}
|
|
174
|
+
export declare const menuToken: (key: HysMenuKey) => string;
|
|
175
|
+
export declare function menuKeys(keys: readonly HysMenuKey[] | undefined): HysMenuKey[];
|
|
176
|
+
export declare const menuKeysEqual: (a: readonly HysMenuKey[], b: readonly HysMenuKey[]) => boolean;
|
|
177
|
+
export declare function menuField(item: object, path: string): unknown;
|
|
178
|
+
export declare const menuSafeRel: (target?: string, rel?: string) => string | undefined;
|
|
179
|
+
export declare function menuRows<N extends object>(items: readonly N[], fields?: Partial<HysMenuFieldNames>): {
|
|
180
|
+
roots: MenuRow<N>[];
|
|
181
|
+
all: MenuRow<N>[];
|
|
182
|
+
byKey: Map<string, MenuRow<N>>;
|
|
183
|
+
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { Component, CSSProperties, TransitionProps, VNodeChild } from "vue";
|
|
2
|
+
import type { HysButtonProps, HysButtonVariant } from "../components/HysButton/HysButton.vue";
|
|
3
|
+
export type HysModalCloseReason = "mask" | "escape" | "button" | "cancel" | "confirm" | "api";
|
|
4
|
+
export type HysModalType = "default" | "confirm" | "info" | "success" | "warning" | "error";
|
|
5
|
+
export type HysModalInitialFocus = "auto" | "dialog" | "confirm" | "cancel" | false | string | InstanceType<typeof HTMLElement>;
|
|
6
|
+
export type HysModalSizeName = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
7
|
+
export declare const modalWidths: {
|
|
8
|
+
readonly xs: 360;
|
|
9
|
+
readonly sm: 440;
|
|
10
|
+
readonly md: 560;
|
|
11
|
+
readonly lg: 720;
|
|
12
|
+
readonly xl: 960;
|
|
13
|
+
readonly "2xl": 1200;
|
|
14
|
+
readonly full: "100%";
|
|
15
|
+
};
|
|
16
|
+
export declare const modalWidth: (props: HysModalProps) => string | number;
|
|
17
|
+
export type HysModalSectionSize = "sm" | "md" | "lg";
|
|
18
|
+
export type HysModalDragEffect = "lift" | "outline" | "glow" | "shadow" | "ghost" | "none";
|
|
19
|
+
export interface HysModalActionContext {
|
|
20
|
+
reason: HysModalCloseReason;
|
|
21
|
+
event?: Event;
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
}
|
|
24
|
+
export interface HysModalPosition {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}
|
|
28
|
+
export interface HysModalSize {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}
|
|
32
|
+
export type HysModalBeforeClose = {
|
|
33
|
+
invoke(reason: HysModalCloseReason, context: HysModalActionContext): boolean | void | Promise<boolean | void>;
|
|
34
|
+
}["invoke"];
|
|
35
|
+
export interface HysModalProps {
|
|
36
|
+
open?: boolean;
|
|
37
|
+
modelValue?: boolean;
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
type?: HysModalType;
|
|
42
|
+
showIcon?: boolean;
|
|
43
|
+
/** Background opacity from 0 to 1; does not fade text or controls. */
|
|
44
|
+
opacity?: number;
|
|
45
|
+
/** Mask opacity from 0 to 1; omitted keeps the default mask style. */
|
|
46
|
+
maskOpacity?: number;
|
|
47
|
+
icon?: Component;
|
|
48
|
+
width?: string | number;
|
|
49
|
+
height?: string | number;
|
|
50
|
+
maxHeight?: string | number;
|
|
51
|
+
minWidth?: number;
|
|
52
|
+
minHeight?: number;
|
|
53
|
+
maxWidth?: number;
|
|
54
|
+
size?: HysModalSizeName;
|
|
55
|
+
centered?: boolean;
|
|
56
|
+
top?: string | number;
|
|
57
|
+
center?: boolean;
|
|
58
|
+
fullscreen?: boolean;
|
|
59
|
+
defaultFullscreen?: boolean;
|
|
60
|
+
showFullscreen?: boolean;
|
|
61
|
+
closeOnMask?: boolean;
|
|
62
|
+
closeOnEscape?: boolean;
|
|
63
|
+
showClose?: boolean;
|
|
64
|
+
destroyOnClose?: boolean;
|
|
65
|
+
forceRender?: boolean;
|
|
66
|
+
modal?: boolean;
|
|
67
|
+
modalPenetrable?: boolean;
|
|
68
|
+
appendTo?: string | InstanceType<typeof HTMLElement> | false;
|
|
69
|
+
lockScroll?: boolean;
|
|
70
|
+
trapFocus?: boolean;
|
|
71
|
+
restoreFocus?: boolean;
|
|
72
|
+
initialFocus?: HysModalInitialFocus;
|
|
73
|
+
openDelay?: number;
|
|
74
|
+
closeDelay?: number;
|
|
75
|
+
transition?: string | TransitionProps | false;
|
|
76
|
+
transitionDuration?: number;
|
|
77
|
+
zIndex?: number;
|
|
78
|
+
headerClass?: string;
|
|
79
|
+
headerSize?: HysModalSectionSize;
|
|
80
|
+
footerSize?: HysModalSectionSize;
|
|
81
|
+
/** Minimum height. Content may expand the region to avoid clipping. */
|
|
82
|
+
headerHeight?: string | number;
|
|
83
|
+
footerHeight?: string | number;
|
|
84
|
+
titleFontSize?: string | number;
|
|
85
|
+
bodyClass?: string;
|
|
86
|
+
footerClass?: string;
|
|
87
|
+
overlayClass?: string;
|
|
88
|
+
modalClass?: string;
|
|
89
|
+
headerStyle?: CSSProperties;
|
|
90
|
+
bodyStyle?: CSSProperties;
|
|
91
|
+
footerStyle?: CSSProperties;
|
|
92
|
+
maskStyle?: CSSProperties;
|
|
93
|
+
modalStyle?: CSSProperties;
|
|
94
|
+
ariaLabel?: string;
|
|
95
|
+
ariaLabelledby?: string;
|
|
96
|
+
ariaDescribedby?: string;
|
|
97
|
+
role?: "dialog" | "alertdialog";
|
|
98
|
+
headerAriaLevel?: number;
|
|
99
|
+
closeText?: string;
|
|
100
|
+
fullscreenText?: string;
|
|
101
|
+
restoreText?: string;
|
|
102
|
+
footer?: boolean;
|
|
103
|
+
footerAlign?: "start" | "center" | "end";
|
|
104
|
+
showCancel?: boolean;
|
|
105
|
+
okText?: string;
|
|
106
|
+
cancelText?: string;
|
|
107
|
+
okVariant?: HysButtonVariant;
|
|
108
|
+
okButtonProps?: HysButtonProps;
|
|
109
|
+
cancelButtonProps?: HysButtonProps;
|
|
110
|
+
confirmLoading?: boolean;
|
|
111
|
+
confirmDisabled?: boolean;
|
|
112
|
+
cancelDisabled?: boolean;
|
|
113
|
+
closeWhileConfirming?: boolean;
|
|
114
|
+
loading?: boolean;
|
|
115
|
+
loadingText?: string;
|
|
116
|
+
showError?: boolean;
|
|
117
|
+
errorText?: string | ((error: unknown, action: "confirm" | "close") => string);
|
|
118
|
+
confirmOnCtrlEnter?: boolean;
|
|
119
|
+
closeOnConfirm?: boolean;
|
|
120
|
+
beforeClose?(reason: HysModalCloseReason, context: HysModalActionContext): boolean | void | Promise<boolean | void>;
|
|
121
|
+
beforeConfirm?: (context: HysModalActionContext) => boolean | void | Promise<boolean | void>;
|
|
122
|
+
draggable?: boolean;
|
|
123
|
+
dragHandlePosition?: "center" | "left" | "right" | "both";
|
|
124
|
+
dragMode?: "live" | "preview";
|
|
125
|
+
/** Pointer movement in pixels before a header press becomes a drag. */
|
|
126
|
+
dragThreshold?: number;
|
|
127
|
+
/** Lightweight gesture feedback, activated only at drag start/end. */
|
|
128
|
+
dragEffect?: HysModalDragEffect;
|
|
129
|
+
overflow?: boolean;
|
|
130
|
+
/** Keep the move handle reachable even when the panel may overflow. */
|
|
131
|
+
keepHandleVisible?: boolean;
|
|
132
|
+
resizable?: boolean;
|
|
133
|
+
resetPositionOnClose?: boolean;
|
|
134
|
+
resetSizeOnClose?: boolean;
|
|
135
|
+
/** Retained legacy setting; position in a modal is controlled by centered/top. */
|
|
136
|
+
placement?: "left" | "right" | "top" | "bottom";
|
|
137
|
+
}
|
|
138
|
+
export interface HysModalSlotContext {
|
|
139
|
+
close: (reason?: HysModalCloseReason | Event) => Promise<boolean>;
|
|
140
|
+
cancel: (event?: Event) => Promise<boolean>;
|
|
141
|
+
confirm: (event?: Event) => Promise<boolean>;
|
|
142
|
+
closing: boolean;
|
|
143
|
+
confirming: boolean;
|
|
144
|
+
busy: boolean;
|
|
145
|
+
error: string;
|
|
146
|
+
titleId: string;
|
|
147
|
+
descriptionId: string;
|
|
148
|
+
fullscreen: boolean;
|
|
149
|
+
toggleFullscreen: () => Promise<boolean>;
|
|
150
|
+
}
|
|
151
|
+
export interface HysModalSlots {
|
|
152
|
+
default?: (context: HysModalSlotContext) => VNodeChild;
|
|
153
|
+
header?: (context: HysModalSlotContext) => VNodeChild;
|
|
154
|
+
footer?: (context: HysModalSlotContext) => VNodeChild;
|
|
155
|
+
icon?: (context: HysModalSlotContext) => VNodeChild;
|
|
156
|
+
loading?: (context: HysModalSlotContext) => VNodeChild;
|
|
157
|
+
"close-icon"?: (context: HysModalSlotContext) => VNodeChild;
|
|
158
|
+
"fullscreen-icon"?: (context: HysModalSlotContext) => VNodeChild;
|
|
159
|
+
}
|
|
160
|
+
export interface HysModalInstance {
|
|
161
|
+
readonly element: HTMLElement | undefined;
|
|
162
|
+
readonly open: boolean;
|
|
163
|
+
readonly closing: boolean;
|
|
164
|
+
readonly confirming: boolean;
|
|
165
|
+
readonly fullscreen: boolean;
|
|
166
|
+
readonly position: HysModalPosition;
|
|
167
|
+
readonly dimensions: HysModalSize | undefined;
|
|
168
|
+
show: () => Promise<boolean>;
|
|
169
|
+
hide: () => Promise<boolean>;
|
|
170
|
+
close: (reason?: HysModalCloseReason) => Promise<boolean>;
|
|
171
|
+
handleOpen: () => Promise<boolean>;
|
|
172
|
+
handleClose: () => Promise<boolean>;
|
|
173
|
+
confirm: (event?: Event) => Promise<boolean>;
|
|
174
|
+
cancel: (event?: Event) => Promise<boolean>;
|
|
175
|
+
focus: () => void;
|
|
176
|
+
toggleFullscreen: () => Promise<boolean>;
|
|
177
|
+
setFullscreen: (value: boolean) => Promise<boolean>;
|
|
178
|
+
resetPosition: () => void;
|
|
179
|
+
resetSize: () => void;
|
|
180
|
+
setPosition: (position: HysModalPosition) => void;
|
|
181
|
+
setSize: (size: HysModalSize) => void;
|
|
182
|
+
}
|
|
183
|
+
export declare const modalLength: (value: string | number | undefined) => string | undefined;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare
|
|
1
|
+
/** Shared, deterministic overlay stack. Only the topmost layer responds to Escape. */
|
|
2
|
+
import { type InjectionKey, type Ref } from "vue";
|
|
3
|
+
export declare const overlayOwnerKey: InjectionKey<Readonly<Ref<boolean>>>;
|
|
4
|
+
export type OverlayKind = "floating" | "dialog";
|
|
5
|
+
export declare const overlayCount: Ref<number, number>;
|
|
6
|
+
export declare function registerOverlay(kind: OverlayKind, dismiss: () => void, base?: () => number | undefined): {
|
|
4
7
|
id: symbol;
|
|
8
|
+
zIndex: import("vue").ComputedRef<number>;
|
|
5
9
|
isTop: () => boolean;
|
|
6
10
|
unregister: () => void;
|
|
7
11
|
};
|