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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
|
+
import type { HysPopupMotionProps } from "../motion/popup";
|
|
3
|
+
import type { Placement } from "./useFloating";
|
|
4
|
+
export type HysPopupPlacement = Placement;
|
|
5
|
+
export type HysPopupTrigger = "hover" | "focus" | "click" | "contextmenu" | "manual";
|
|
6
|
+
export interface HysPopupVirtualReference {
|
|
7
|
+
getBoundingClientRect: () => DOMRect;
|
|
8
|
+
contextElement?: HTMLElement;
|
|
9
|
+
}
|
|
10
|
+
export type HysPopupReference = HTMLElement | HysPopupVirtualReference;
|
|
11
|
+
export interface HysPopupSurfaceProps extends HysPopupMotionProps {
|
|
12
|
+
open?: boolean;
|
|
13
|
+
modelValue?: boolean;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
trigger?: HysPopupTrigger | readonly HysPopupTrigger[];
|
|
17
|
+
triggerKeys?: readonly string[];
|
|
18
|
+
triggerTabindex?: number;
|
|
19
|
+
placement?: HysPopupPlacement;
|
|
20
|
+
offset?: number;
|
|
21
|
+
autoAdjustOverflow?: boolean;
|
|
22
|
+
showDelay?: number;
|
|
23
|
+
hideDelay?: number;
|
|
24
|
+
autoClose?: number;
|
|
25
|
+
enterable?: boolean;
|
|
26
|
+
closeOnEscape?: boolean;
|
|
27
|
+
closeOnOutside?: boolean;
|
|
28
|
+
destroyOnHide?: boolean;
|
|
29
|
+
forceRender?: boolean;
|
|
30
|
+
appendTo?: string | HTMLElement | false;
|
|
31
|
+
reference?: HysPopupReference | (() => HysPopupReference | undefined);
|
|
32
|
+
width?: string | number;
|
|
33
|
+
maxWidth?: string | number;
|
|
34
|
+
maxHeight?: string | number;
|
|
35
|
+
showArrow?: boolean;
|
|
36
|
+
arrowOffset?: number;
|
|
37
|
+
effect?: "light" | "dark";
|
|
38
|
+
color?: string;
|
|
39
|
+
textColor?: string;
|
|
40
|
+
overlayClass?: string;
|
|
41
|
+
overlayStyle?: CSSProperties;
|
|
42
|
+
contentClass?: string;
|
|
43
|
+
contentStyle?: CSSProperties;
|
|
44
|
+
zIndex?: number;
|
|
45
|
+
ariaLabel?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface HysTooltipProps extends HysPopupSurfaceProps {
|
|
48
|
+
text?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface HysPopoverProps extends HysPopupSurfaceProps {
|
|
51
|
+
title?: string;
|
|
52
|
+
content?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface HysPopupSurfaceContext {
|
|
55
|
+
open: boolean;
|
|
56
|
+
show: () => Promise<boolean>;
|
|
57
|
+
close: () => Promise<boolean>;
|
|
58
|
+
toggle: () => Promise<boolean>;
|
|
59
|
+
updatePosition: () => void;
|
|
60
|
+
}
|
|
61
|
+
export interface HysTooltipSlots {
|
|
62
|
+
default?: (scope: HysPopupSurfaceContext) => VNodeChild;
|
|
63
|
+
content?: (scope: HysPopupSurfaceContext) => VNodeChild;
|
|
64
|
+
}
|
|
65
|
+
export interface HysPopoverSlots {
|
|
66
|
+
trigger?: (scope: HysPopupSurfaceContext) => VNodeChild;
|
|
67
|
+
default?: (scope: HysPopupSurfaceContext) => VNodeChild;
|
|
68
|
+
title?: (scope: HysPopupSurfaceContext) => VNodeChild;
|
|
69
|
+
}
|
|
70
|
+
export interface HysPopupSurfaceInstance {
|
|
71
|
+
readonly element: HTMLElement | undefined;
|
|
72
|
+
readonly referenceElement: HTMLElement | undefined;
|
|
73
|
+
readonly open: boolean;
|
|
74
|
+
readonly placement: HysPopupPlacement;
|
|
75
|
+
show: () => Promise<boolean>;
|
|
76
|
+
hide: () => Promise<boolean>;
|
|
77
|
+
close: () => Promise<boolean>;
|
|
78
|
+
toggle: () => Promise<boolean>;
|
|
79
|
+
updatePosition: () => void;
|
|
80
|
+
focus: () => void;
|
|
81
|
+
}
|
|
82
|
+
export type HysTooltipInstance = HysPopupSurfaceInstance;
|
|
83
|
+
export type HysPopoverInstance = HysPopupSurfaceInstance;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { VNodeChild } from "vue";
|
|
2
|
+
export type HysProgressType = "line" | "circle" | "dashboard";
|
|
3
|
+
export type HysProgressStatus = "normal" | "success" | "warning" | "error" | "active";
|
|
4
|
+
export type HysProgressSize = "sm" | "md" | "lg";
|
|
5
|
+
export type HysProgressLinecap = "round" | "butt" | "square";
|
|
6
|
+
export type HysProgressGapPosition = "top" | "right" | "bottom" | "left";
|
|
7
|
+
export type HysProgressGradientDirection = number | "to right" | "to left" | "to top" | "to bottom" | "to top right" | "to top left" | "to bottom right" | "to bottom left";
|
|
8
|
+
export interface HysProgressGradientStop {
|
|
9
|
+
offset: number;
|
|
10
|
+
color: string;
|
|
11
|
+
}
|
|
12
|
+
export interface HysProgressGradient {
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
direction?: HysProgressGradientDirection;
|
|
16
|
+
stops?: readonly HysProgressGradientStop[];
|
|
17
|
+
}
|
|
18
|
+
export interface HysProgressColorStop {
|
|
19
|
+
value: number;
|
|
20
|
+
color: string;
|
|
21
|
+
}
|
|
22
|
+
export type HysProgressColor = string | ((value: number) => string) | readonly HysProgressColorStop[] | readonly string[] | HysProgressGradient;
|
|
23
|
+
export interface HysProgressSuccess {
|
|
24
|
+
value: number;
|
|
25
|
+
color?: HysProgressColor;
|
|
26
|
+
}
|
|
27
|
+
export interface HysProgressLabelContext {
|
|
28
|
+
value: number;
|
|
29
|
+
successValue: number;
|
|
30
|
+
status: HysProgressStatus;
|
|
31
|
+
indeterminate: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface HysProgressProps {
|
|
34
|
+
value: number;
|
|
35
|
+
showLabel?: boolean;
|
|
36
|
+
color?: HysProgressColor;
|
|
37
|
+
status?: HysProgressStatus;
|
|
38
|
+
strokeWidth?: number;
|
|
39
|
+
type?: HysProgressType;
|
|
40
|
+
width?: number | string;
|
|
41
|
+
format?: (value: number, successValue: number) => VNodeChild;
|
|
42
|
+
indeterminate?: boolean;
|
|
43
|
+
size?: HysProgressSize;
|
|
44
|
+
textInside?: boolean;
|
|
45
|
+
textColor?: string;
|
|
46
|
+
precision?: number;
|
|
47
|
+
showStatusIcon?: boolean;
|
|
48
|
+
trailColor?: string;
|
|
49
|
+
strokeLinecap?: HysProgressLinecap;
|
|
50
|
+
success?: HysProgressSuccess;
|
|
51
|
+
steps?: number;
|
|
52
|
+
stepGap?: number;
|
|
53
|
+
gapDegree?: number;
|
|
54
|
+
gapPosition?: HysProgressGapPosition;
|
|
55
|
+
striped?: boolean;
|
|
56
|
+
stripedFlow?: boolean;
|
|
57
|
+
animated?: boolean;
|
|
58
|
+
duration?: number;
|
|
59
|
+
flowDuration?: number;
|
|
60
|
+
ariaLabel?: string;
|
|
61
|
+
ariaValueText?: string | ((context: HysProgressLabelContext) => string);
|
|
62
|
+
}
|
|
63
|
+
export interface HysProgressSlots {
|
|
64
|
+
default?: (context: HysProgressLabelContext) => VNodeChild;
|
|
65
|
+
icon?: (context: HysProgressLabelContext) => VNodeChild;
|
|
66
|
+
}
|
|
67
|
+
export interface HysProgressInstance {
|
|
68
|
+
readonly element: HTMLElement | undefined;
|
|
69
|
+
readonly value: number;
|
|
70
|
+
readonly successValue: number;
|
|
71
|
+
readonly status: HysProgressStatus;
|
|
72
|
+
}
|
|
73
|
+
export declare const progressPercent: (value: number | undefined) => number;
|
|
74
|
+
export declare const progressNumber: (value: number | undefined, fallback: number, min: number, max: number) => number;
|
|
75
|
+
export declare const progressStatusColor: (status: HysProgressStatus) => string;
|
|
76
|
+
export type ProgressPaint = {
|
|
77
|
+
color: string;
|
|
78
|
+
gradient?: {
|
|
79
|
+
stops: HysProgressGradientStop[];
|
|
80
|
+
angle: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export declare function progressPaint(color: HysProgressColor | undefined, value: number, fallback: string): ProgressPaint;
|
|
84
|
+
export declare function progressCssPaint(paint: ProgressPaint): string;
|
|
85
|
+
export declare function progressGradientCoordinates(degrees: number): {
|
|
86
|
+
x1: number;
|
|
87
|
+
y1: number;
|
|
88
|
+
x2: number;
|
|
89
|
+
y2: number;
|
|
90
|
+
};
|
|
91
|
+
export declare function progressArc(radius: number, start: number, degrees: number): string;
|
|
92
|
+
export declare const progressId: () => string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HysPopupTransition } from '../motion/popup';
|
|
1
2
|
import type { CSSProperties, HTMLAttributes, VNodeChild } from "vue";
|
|
2
3
|
import type { Placement } from "./useFloating";
|
|
3
4
|
export type HysTableKey = string | number;
|
|
@@ -147,6 +148,8 @@ export interface HysTableLocale {
|
|
|
147
148
|
}>;
|
|
148
149
|
}
|
|
149
150
|
export interface HysTableProps<T extends object> {
|
|
151
|
+
popupTransition?: HysPopupTransition;
|
|
152
|
+
popupTransitionDuration?: number;
|
|
150
153
|
locale?: Partial<HysTableLocale>;
|
|
151
154
|
columns: readonly HysTableColumn<T>[];
|
|
152
155
|
rows: readonly T[];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Component, VNodeChild } from "vue";
|
|
2
|
+
import type { HysPopupMotionProps } from "../motion/popup";
|
|
3
|
+
export type HysTagInputReason = "keyboard" | "blur" | "separator" | "paste" | "api";
|
|
4
|
+
export interface HysTagInputAddContext {
|
|
5
|
+
signal: AbortSignal;
|
|
6
|
+
values: readonly string[];
|
|
7
|
+
reason: HysTagInputReason;
|
|
8
|
+
}
|
|
9
|
+
export interface HysTagInputInvalid {
|
|
10
|
+
value: string;
|
|
11
|
+
reason: "duplicate" | "max" | "guard" | "error" | "maxlength" | "minlength";
|
|
12
|
+
error?: Error;
|
|
13
|
+
}
|
|
14
|
+
export interface HysTagInputProps extends HysPopupMotionProps {
|
|
15
|
+
modelValue?: readonly string[];
|
|
16
|
+
defaultValue?: readonly string[];
|
|
17
|
+
max?: number;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
readonly?: boolean;
|
|
21
|
+
size?: "sm" | "md" | "lg";
|
|
22
|
+
addOnBlur?: boolean;
|
|
23
|
+
separator?: string;
|
|
24
|
+
delimiters?: string | readonly string[] | RegExp;
|
|
25
|
+
trigger?: "Enter" | "Space" | "Tab" | readonly string[];
|
|
26
|
+
beforeAdd?: (value: string, context: HysTagInputAddContext) => boolean | void | Promise<boolean | void>;
|
|
27
|
+
allowDuplicates?: boolean;
|
|
28
|
+
caseSensitive?: boolean;
|
|
29
|
+
trim?: boolean;
|
|
30
|
+
clearable?: boolean;
|
|
31
|
+
clearIcon?: Component;
|
|
32
|
+
tagTone?: "primary" | "success" | "warning" | "danger" | "neutral";
|
|
33
|
+
tagEffect?: "light" | "dark" | "outline";
|
|
34
|
+
tagRound?: boolean;
|
|
35
|
+
draggable?: boolean;
|
|
36
|
+
collapseTags?: boolean;
|
|
37
|
+
maxCollapseTags?: number;
|
|
38
|
+
collapseTagsTooltip?: boolean;
|
|
39
|
+
overflowHeight?: number;
|
|
40
|
+
maxTagTextLength?: number;
|
|
41
|
+
maxlength?: number;
|
|
42
|
+
minlength?: number;
|
|
43
|
+
ariaLabel?: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
form?: string;
|
|
47
|
+
autocomplete?: string;
|
|
48
|
+
autofocus?: boolean;
|
|
49
|
+
tabindex?: number;
|
|
50
|
+
status?: "error" | "warning" | "success";
|
|
51
|
+
error?: string;
|
|
52
|
+
validateEvent?: boolean;
|
|
53
|
+
inputProps?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export interface HysTagInputSlotContext {
|
|
56
|
+
values: readonly string[];
|
|
57
|
+
draft: string;
|
|
58
|
+
disabled: boolean;
|
|
59
|
+
readonly: boolean;
|
|
60
|
+
pending: boolean;
|
|
61
|
+
add: (value?: string | string[]) => Promise<boolean>;
|
|
62
|
+
clear: () => Promise<boolean>;
|
|
63
|
+
}
|
|
64
|
+
export interface HysTagInputTagContext {
|
|
65
|
+
value: string;
|
|
66
|
+
index: number;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
readonly: boolean;
|
|
69
|
+
remove: () => Promise<boolean>;
|
|
70
|
+
}
|
|
71
|
+
export interface HysTagInputSlots {
|
|
72
|
+
tag?: (context: HysTagInputTagContext) => VNodeChild;
|
|
73
|
+
prefix?: (context: HysTagInputSlotContext) => VNodeChild;
|
|
74
|
+
suffix?: (context: HysTagInputSlotContext) => VNodeChild;
|
|
75
|
+
"clear-icon"?: (context: HysTagInputSlotContext) => VNodeChild;
|
|
76
|
+
"remove-icon"?: (context: HysTagInputTagContext) => VNodeChild;
|
|
77
|
+
"collapse-tag"?: (context: {
|
|
78
|
+
count: number;
|
|
79
|
+
values: readonly string[];
|
|
80
|
+
}) => VNodeChild;
|
|
81
|
+
}
|
|
82
|
+
export interface HysTagInputInstance {
|
|
83
|
+
readonly element: HTMLElement | undefined;
|
|
84
|
+
readonly input: HTMLInputElement | undefined;
|
|
85
|
+
readonly values: readonly string[];
|
|
86
|
+
readonly draft: string;
|
|
87
|
+
readonly pending: boolean;
|
|
88
|
+
focus: (options?: FocusOptions) => void;
|
|
89
|
+
blur: () => void;
|
|
90
|
+
add: (value?: string | string[]) => Promise<boolean>;
|
|
91
|
+
remove: (index: number) => Promise<boolean>;
|
|
92
|
+
clear: () => Promise<boolean>;
|
|
93
|
+
move: (from: number, to: number) => Promise<boolean>;
|
|
94
|
+
setDraft: (value: string) => void;
|
|
95
|
+
}
|
|
96
|
+
export declare function splitTags(value: string, separator?: string | readonly string[] | RegExp): string[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Component, VNodeChild } from "vue";
|
|
2
|
+
export type HysTimelineKey = string | number;
|
|
3
|
+
export type HysTimelineMode = "left" | "right" | "alternate" | "alternate-reverse";
|
|
4
|
+
export type HysTimelinePosition = "left" | "right";
|
|
5
|
+
export type HysTimelineSize = "sm" | "md" | "lg";
|
|
6
|
+
export type HysTimelineTone = "primary" | "success" | "warning" | "danger" | "info" | "neutral";
|
|
7
|
+
export interface HysTimelineItem {
|
|
8
|
+
id?: HysTimelineKey;
|
|
9
|
+
key?: HysTimelineKey;
|
|
10
|
+
title: string;
|
|
11
|
+
time?: string;
|
|
12
|
+
dateTime?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
status?: "done" | "current" | "pending";
|
|
15
|
+
color?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
position?: HysTimelinePosition;
|
|
18
|
+
tone?: HysTimelineTone;
|
|
19
|
+
size?: HysTimelineSize | number;
|
|
20
|
+
hollow?: boolean;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
icon?: Component;
|
|
23
|
+
hideTime?: boolean;
|
|
24
|
+
timePlacement?: "top" | "bottom";
|
|
25
|
+
}
|
|
26
|
+
export type HysTimelineFieldNames = Partial<Record<keyof HysTimelineItem, string>>;
|
|
27
|
+
export interface HysTimelineProps<T extends object = HysTimelineItem> {
|
|
28
|
+
items: readonly T[];
|
|
29
|
+
reverse?: boolean;
|
|
30
|
+
pending?: string | boolean;
|
|
31
|
+
mode?: HysTimelineMode;
|
|
32
|
+
itemKey?: string | ((item: T, index: number) => HysTimelineKey);
|
|
33
|
+
fieldNames?: HysTimelineFieldNames;
|
|
34
|
+
size?: HysTimelineSize;
|
|
35
|
+
hollow?: boolean;
|
|
36
|
+
showTime?: boolean;
|
|
37
|
+
timePlacement?: "top" | "bottom";
|
|
38
|
+
responsive?: boolean;
|
|
39
|
+
lineStyle?: "solid" | "dashed" | "dotted";
|
|
40
|
+
lineColor?: string;
|
|
41
|
+
pendingPosition?: "start" | "end";
|
|
42
|
+
pendingLoading?: boolean;
|
|
43
|
+
pendingText?: string;
|
|
44
|
+
emptyText?: string;
|
|
45
|
+
ariaLabel?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface HysTimelineItemContext<T extends object = HysTimelineItem> {
|
|
48
|
+
item: T;
|
|
49
|
+
index: number;
|
|
50
|
+
sourceIndex: number;
|
|
51
|
+
key: HysTimelineKey;
|
|
52
|
+
title: string;
|
|
53
|
+
time: string;
|
|
54
|
+
description: string;
|
|
55
|
+
label: string;
|
|
56
|
+
position: HysTimelinePosition;
|
|
57
|
+
status: HysTimelineItem["status"];
|
|
58
|
+
tone: HysTimelineTone;
|
|
59
|
+
loading: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface HysTimelinePendingContext {
|
|
62
|
+
pending: string | boolean | undefined;
|
|
63
|
+
loading: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface HysTimelineSlots<T extends object = HysTimelineItem> {
|
|
66
|
+
item?: (context: HysTimelineItemContext<T>) => VNodeChild;
|
|
67
|
+
title?: (context: HysTimelineItemContext<T>) => VNodeChild;
|
|
68
|
+
description?: (context: HysTimelineItemContext<T>) => VNodeChild;
|
|
69
|
+
time?: (context: HysTimelineItemContext<T>) => VNodeChild;
|
|
70
|
+
label?: (context: HysTimelineItemContext<T>) => VNodeChild;
|
|
71
|
+
dot?: (context: HysTimelineItemContext<T>) => VNodeChild;
|
|
72
|
+
pending?: (context: HysTimelinePendingContext) => VNodeChild;
|
|
73
|
+
"pending-dot"?: (context: HysTimelinePendingContext) => VNodeChild;
|
|
74
|
+
empty?: () => VNodeChild;
|
|
75
|
+
}
|
|
76
|
+
export interface HysTimelineInstance<T extends object = HysTimelineItem> {
|
|
77
|
+
readonly element: HTMLOListElement | undefined;
|
|
78
|
+
getItems: () => T[];
|
|
79
|
+
}
|
|
80
|
+
export declare function timelineRead(item: object, path: string): unknown;
|
|
81
|
+
export declare const timelineText: (value: unknown) => string;
|
|
82
|
+
export declare const timelineTone: (tone: HysTimelineTone) => string;
|
|
@@ -32,6 +32,8 @@ export interface HysTransferLocale {
|
|
|
32
32
|
moveLeft: string;
|
|
33
33
|
dragRight: string;
|
|
34
34
|
dragLeft: string;
|
|
35
|
+
doubleClickRight?: string;
|
|
36
|
+
doubleClickLeft?: string;
|
|
35
37
|
dragCount: string;
|
|
36
38
|
moved: string;
|
|
37
39
|
added: string;
|
|
@@ -78,7 +80,12 @@ export interface HysTransferProps<T extends object, K extends HysTransferKey> {
|
|
|
78
80
|
oneWay?: boolean;
|
|
79
81
|
draggable?: boolean;
|
|
80
82
|
dragChecked?: boolean;
|
|
83
|
+
moveOnDoubleClick?: boolean;
|
|
81
84
|
animated?: boolean;
|
|
85
|
+
moveAnimation?: "flight" | "fade" | "none";
|
|
86
|
+
moveDuration?: number;
|
|
87
|
+
maxAnimatedItems?: number;
|
|
88
|
+
highlightOnArrival?: boolean;
|
|
82
89
|
size?: "sm" | "md" | "lg";
|
|
83
90
|
listHeight?: number;
|
|
84
91
|
listStyle?: CSSProperties;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HysPopupTransition } from '../motion/popup';
|
|
1
2
|
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
3
|
export type HysTreeKey = string | number;
|
|
3
4
|
export type HysTreeValue = HysTreeKey | readonly HysTreeKey[] | null;
|
|
@@ -104,6 +105,8 @@ export interface HysTreeNodeContext<N extends object> {
|
|
|
104
105
|
leaf: boolean;
|
|
105
106
|
}
|
|
106
107
|
export interface HysTreeProps<N extends object = TreeNode, V extends HysTreeValue = HysTreeValue> {
|
|
108
|
+
popupTransition?: HysPopupTransition;
|
|
109
|
+
popupTransitionDuration?: number;
|
|
107
110
|
nodes: readonly N[];
|
|
108
111
|
modelValue?: V;
|
|
109
112
|
defaultValue?: V;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HysPopupTransition } from '../motion/popup';
|
|
1
2
|
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
3
|
import { type HysTreeKey, type HysTreeFieldNames, type HysTreeLoadContext, type HysTreeLocale } from "./tree";
|
|
3
4
|
import type { Placement } from "./useFloating";
|
|
@@ -44,6 +45,8 @@ export interface HysTreeSelectChange<N extends object = HysTreeSelectNode> {
|
|
|
44
45
|
event?: Event;
|
|
45
46
|
}
|
|
46
47
|
export interface HysTreeSelectProps<N extends object = HysTreeSelectNode, V extends HysTreeSelectValue = HysTreeSelectValue> {
|
|
48
|
+
popupTransition?: HysPopupTransition;
|
|
49
|
+
popupTransitionDuration?: number;
|
|
47
50
|
modelValue?: V;
|
|
48
51
|
defaultValue?: V;
|
|
49
52
|
nodes: readonly N[];
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
|
+
export type HysUploadStatus = "ready" | "uploading" | "success" | "error";
|
|
3
|
+
export type HysUploadListType = "text" | "picture" | "picture-card";
|
|
4
|
+
export interface HysUploadItem {
|
|
5
|
+
uid: string;
|
|
6
|
+
name: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
raw?: File;
|
|
9
|
+
status?: HysUploadStatus;
|
|
10
|
+
percentage?: number;
|
|
11
|
+
response?: unknown;
|
|
12
|
+
error?: Error;
|
|
13
|
+
url?: string;
|
|
14
|
+
thumbUrl?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
relativePath?: string;
|
|
17
|
+
}
|
|
18
|
+
/** The original local-file contract remains the default generic. */
|
|
19
|
+
export interface HysUploadFile extends HysUploadItem {
|
|
20
|
+
size: number;
|
|
21
|
+
raw: File;
|
|
22
|
+
}
|
|
23
|
+
export type HysUploadChangeType = "select" | "remove" | "clear" | "reset" | "start" | "progress" | "success" | "error" | "abort" | "retry";
|
|
24
|
+
export interface HysUploadChange<T extends HysUploadItem = HysUploadFile> {
|
|
25
|
+
type: HysUploadChangeType;
|
|
26
|
+
files: readonly T[];
|
|
27
|
+
changed: readonly T[];
|
|
28
|
+
}
|
|
29
|
+
export interface HysUploadContext<T extends HysUploadItem = HysUploadFile> {
|
|
30
|
+
signal: AbortSignal;
|
|
31
|
+
files: readonly T[];
|
|
32
|
+
}
|
|
33
|
+
export interface HysUploadInvalid<T extends HysUploadItem = HysUploadFile> {
|
|
34
|
+
reason: "type" | "size" | "validation" | "identity";
|
|
35
|
+
file: File;
|
|
36
|
+
message: string;
|
|
37
|
+
files: readonly T[];
|
|
38
|
+
}
|
|
39
|
+
export interface HysUploadError extends Error {
|
|
40
|
+
status?: number;
|
|
41
|
+
response?: unknown;
|
|
42
|
+
url?: string;
|
|
43
|
+
method?: string;
|
|
44
|
+
kind?: "http" | "network" | "timeout" | "configuration" | "custom";
|
|
45
|
+
}
|
|
46
|
+
export type HysUploadDataScalar = string | number | boolean | Blob | null | undefined;
|
|
47
|
+
export type HysUploadData = Record<string, HysUploadDataScalar | readonly HysUploadDataScalar[]>;
|
|
48
|
+
export interface HysUploadRequestOptions<T extends HysUploadItem = HysUploadFile> extends HysUploadContext<T> {
|
|
49
|
+
file: T;
|
|
50
|
+
body: Blob;
|
|
51
|
+
action: string;
|
|
52
|
+
method: string;
|
|
53
|
+
name: string;
|
|
54
|
+
headers: Record<string, string>;
|
|
55
|
+
data: HysUploadData;
|
|
56
|
+
withCredentials: boolean;
|
|
57
|
+
timeout: number;
|
|
58
|
+
onProgress: (percentage: number) => void;
|
|
59
|
+
onSuccess: (response: unknown) => void;
|
|
60
|
+
onError: (error: unknown) => void;
|
|
61
|
+
}
|
|
62
|
+
export type HysUploadRequestResult = void | Promise<unknown> | (() => void) | {
|
|
63
|
+
abort?: () => void;
|
|
64
|
+
promise?: Promise<unknown>;
|
|
65
|
+
};
|
|
66
|
+
export interface HysUploadLocale {
|
|
67
|
+
choose: string;
|
|
68
|
+
drag: string;
|
|
69
|
+
checking: string;
|
|
70
|
+
localHint: string;
|
|
71
|
+
uploadHint: string;
|
|
72
|
+
files: string;
|
|
73
|
+
ready: string;
|
|
74
|
+
uploading: string;
|
|
75
|
+
success: string;
|
|
76
|
+
error: string;
|
|
77
|
+
queued: string;
|
|
78
|
+
removing: string;
|
|
79
|
+
submit: string;
|
|
80
|
+
abort: string;
|
|
81
|
+
retry: string;
|
|
82
|
+
clear: string;
|
|
83
|
+
remove: string;
|
|
84
|
+
preview: string;
|
|
85
|
+
download: string;
|
|
86
|
+
empty: string;
|
|
87
|
+
}
|
|
88
|
+
export declare const uploadLocale: HysUploadLocale;
|
|
89
|
+
export interface HysUploadProps<T extends HysUploadItem = HysUploadFile> {
|
|
90
|
+
fileList?: readonly T[];
|
|
91
|
+
modelValue?: readonly T[];
|
|
92
|
+
defaultFileList?: readonly T[];
|
|
93
|
+
defaultValue?: readonly T[];
|
|
94
|
+
accept?: string;
|
|
95
|
+
multiple?: boolean;
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
readonly?: boolean;
|
|
98
|
+
loading?: boolean;
|
|
99
|
+
limit?: number;
|
|
100
|
+
maxSize?: number;
|
|
101
|
+
drag?: boolean;
|
|
102
|
+
paste?: boolean;
|
|
103
|
+
directory?: boolean;
|
|
104
|
+
showFileList?: boolean;
|
|
105
|
+
listType?: HysUploadListType;
|
|
106
|
+
listHeight?: number | string;
|
|
107
|
+
size?: "sm" | "md" | "lg";
|
|
108
|
+
showToolbar?: boolean;
|
|
109
|
+
showPreview?: boolean;
|
|
110
|
+
showDownload?: boolean;
|
|
111
|
+
showRemove?: boolean;
|
|
112
|
+
showRetry?: boolean;
|
|
113
|
+
openFileDialogOnClick?: boolean;
|
|
114
|
+
autoUpload?: boolean;
|
|
115
|
+
concurrency?: number;
|
|
116
|
+
action?: string | ((file: T, context: HysUploadContext<T>) => string | Promise<string>);
|
|
117
|
+
method?: string;
|
|
118
|
+
name?: string;
|
|
119
|
+
headers?: Record<string, string> | ((file: T, context: HysUploadContext<T>) => Record<string, string> | Promise<Record<string, string>>);
|
|
120
|
+
data?: HysUploadData | ((file: T, context: HysUploadContext<T>) => HysUploadData | Promise<HysUploadData>);
|
|
121
|
+
withCredentials?: boolean;
|
|
122
|
+
timeout?: number;
|
|
123
|
+
customRequest?: (options: HysUploadRequestOptions<T>) => HysUploadRequestResult;
|
|
124
|
+
beforeUpload?: (file: File, context: HysUploadContext<T>) => boolean | void | File | Blob | Promise<boolean | void | File | Blob>;
|
|
125
|
+
beforeRemove?: (file: T, files: readonly T[], context: HysUploadContext<T>) => boolean | void | Promise<boolean | void>;
|
|
126
|
+
createFile?: (raw: File, uid: string) => T;
|
|
127
|
+
previewFile?: (file: T, context: HysUploadContext<T>) => string | false | Promise<string | false>;
|
|
128
|
+
downloadFile?: (file: T, context: HysUploadContext<T>) => void | boolean | string | Promise<void | boolean | string>;
|
|
129
|
+
locale?: Partial<HysUploadLocale>;
|
|
130
|
+
ariaLabel?: string;
|
|
131
|
+
triggerLabel?: string;
|
|
132
|
+
error?: string;
|
|
133
|
+
validateEvent?: boolean;
|
|
134
|
+
listStyle?: CSSProperties;
|
|
135
|
+
}
|
|
136
|
+
export interface HysUploadActions {
|
|
137
|
+
preview: () => Promise<boolean>;
|
|
138
|
+
download: () => Promise<boolean>;
|
|
139
|
+
remove: () => Promise<boolean>;
|
|
140
|
+
retry: () => Promise<boolean>;
|
|
141
|
+
abort: () => number;
|
|
142
|
+
}
|
|
143
|
+
export interface HysUploadFileContext<T extends HysUploadItem = HysUploadFile> {
|
|
144
|
+
file: T;
|
|
145
|
+
status: HysUploadStatus;
|
|
146
|
+
percentage: number;
|
|
147
|
+
queued: boolean;
|
|
148
|
+
busy: boolean;
|
|
149
|
+
actions: HysUploadActions;
|
|
150
|
+
thumbnail?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface HysUploadSlotContext<T extends HysUploadItem = HysUploadFile> {
|
|
153
|
+
files: readonly T[];
|
|
154
|
+
busy: boolean;
|
|
155
|
+
disabled: boolean;
|
|
156
|
+
uploading: number;
|
|
157
|
+
queued: number;
|
|
158
|
+
open: (event?: Event) => void;
|
|
159
|
+
submit: () => Promise<number>;
|
|
160
|
+
abort: () => number;
|
|
161
|
+
clear: () => Promise<boolean>;
|
|
162
|
+
}
|
|
163
|
+
export interface HysUploadSlots<T extends HysUploadItem = HysUploadFile> {
|
|
164
|
+
default?: (scope: HysUploadSlotContext<T>) => VNodeChild;
|
|
165
|
+
trigger?: (scope: HysUploadSlotContext<T>) => VNodeChild;
|
|
166
|
+
tip?: (scope: HysUploadSlotContext<T>) => VNodeChild;
|
|
167
|
+
toolbar?: (scope: HysUploadSlotContext<T>) => VNodeChild;
|
|
168
|
+
file?: (scope: HysUploadFileContext<T>) => VNodeChild;
|
|
169
|
+
item?: (scope: HysUploadFileContext<T>) => VNodeChild;
|
|
170
|
+
empty?: (scope: HysUploadSlotContext<T>) => VNodeChild;
|
|
171
|
+
progress?: (scope: HysUploadFileContext<T>) => VNodeChild;
|
|
172
|
+
preview?: (scope: {
|
|
173
|
+
file: T;
|
|
174
|
+
url: string;
|
|
175
|
+
close: () => void;
|
|
176
|
+
}) => VNodeChild;
|
|
177
|
+
}
|
|
178
|
+
export interface HysUploadInstance<T extends HysUploadItem = HysUploadFile> {
|
|
179
|
+
readonly element: HTMLElement | undefined;
|
|
180
|
+
readonly input: HTMLInputElement | undefined;
|
|
181
|
+
readonly files: readonly T[];
|
|
182
|
+
readonly busy: boolean;
|
|
183
|
+
readonly uploading: number;
|
|
184
|
+
readonly queued: number;
|
|
185
|
+
open: (event?: Event) => void;
|
|
186
|
+
focus: () => void;
|
|
187
|
+
addFiles: (files: readonly File[]) => Promise<T[]>;
|
|
188
|
+
getFiles: () => T[];
|
|
189
|
+
clearFiles: (statuses?: readonly HysUploadStatus[]) => Promise<boolean>;
|
|
190
|
+
remove: (file: T | string) => Promise<boolean>;
|
|
191
|
+
submit: (file?: T | string) => Promise<number>;
|
|
192
|
+
retry: (file: T | string) => Promise<boolean>;
|
|
193
|
+
abort: (file?: T | string) => number;
|
|
194
|
+
preview: (file: T | string) => Promise<boolean>;
|
|
195
|
+
download: (file: T | string) => Promise<boolean>;
|
|
196
|
+
}
|
|
197
|
+
export declare const uploadStatus: (file: HysUploadItem) => HysUploadStatus;
|
|
198
|
+
export declare const uploadPercent: (file: HysUploadItem) => number;
|
|
199
|
+
export declare const uploadImage: (file: HysUploadItem) => boolean;
|
|
200
|
+
export declare function uploadSize(value?: number): string;
|
|
201
|
+
export declare function uploadFailure(error: unknown, kind?: HysUploadError["kind"]): HysUploadError;
|
|
202
|
+
export declare function uploadUrl(value: string | undefined, image?: boolean): string | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type HysUploadItem, type HysUploadRequestOptions } from "./upload";
|
|
2
|
+
/** A cancellable multipart transport. The browser supplies the multipart boundary. */
|
|
3
|
+
export declare function uploadRequest<T extends HysUploadItem>(options: HysUploadRequestOptions<T>): () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
import { type HysAlertProps, type HysAlertSlotContext } from "./feedback";
|
|
3
|
+
export declare function useAlert(props: HysAlertProps, emit: (name: string, ...args: any[]) => void): {
|
|
4
|
+
skin: ComputedRef<{
|
|
5
|
+
'data-hys-ui': string;
|
|
6
|
+
'data-hys-theme': import("..").HysTheme;
|
|
7
|
+
'data-hys-motion': import("..").HysMotion;
|
|
8
|
+
}>;
|
|
9
|
+
element: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
10
|
+
live: import("vue").Ref<boolean, boolean>;
|
|
11
|
+
visible: ComputedRef<boolean>;
|
|
12
|
+
tone: ComputedRef<import("./feedback").HysAlertTone>;
|
|
13
|
+
duration: ComputedRef<number>;
|
|
14
|
+
closing: import("vue").Ref<boolean, boolean>;
|
|
15
|
+
scope: ComputedRef<HysAlertSlotContext>;
|
|
16
|
+
close: (reason?: "button" | "api", event?: Event) => Promise<false>;
|
|
17
|
+
show: () => Promise<boolean>;
|
|
18
|
+
beforeLeave: (node: Element) => void;
|
|
19
|
+
afterLeave: (node: Element) => void;
|
|
20
|
+
restore: (node: Element) => void;
|
|
21
|
+
};
|
|
@@ -110,7 +110,7 @@ export declare function useCascader<N extends object>(props: HysCascaderProps<N>
|
|
|
110
110
|
filter: (text: string) => void;
|
|
111
111
|
clear: () => Promise<boolean>;
|
|
112
112
|
removeTag: (key: HysTreeKey) => Promise<boolean>;
|
|
113
|
-
request: (keys: readonly HysTreeKey[], reason: "clear" | "select" | "
|
|
113
|
+
request: (keys: readonly HysTreeKey[], reason: "clear" | "select" | "api" | "check" | "remove", node?: CascaderEntry<N> | undefined, event?: Event, provided?: HysTreeSelectValue, halfKeys?: HysTreeKey[]) => Promise<boolean>;
|
|
114
114
|
project: (keys: readonly HysTreeKey[]) => HysTreeKey[];
|
|
115
115
|
retrySearch: () => Promise<void>;
|
|
116
116
|
setValue: (value: HysTreeSelectValue) => Promise<boolean>;
|