@dazhicheng/ui 1.5.4 → 1.5.6
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/index.js +1423 -1414
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/components/tt-area/TtArea.vue.d.ts +0 -2
- package/dist/components/tt-area/index.d.ts +0 -1
- package/dist/components/tt-button/index.d.ts +0 -1739
- package/dist/components/tt-button/index.vue.d.ts +0 -1004
- package/dist/components/tt-checkbox/index.d.ts +0 -36
- package/dist/components/tt-checkbox/index.vue.d.ts +0 -28
- package/dist/components/tt-checkbox/type.d.ts +0 -9
- package/dist/components/tt-drawer/index.d.ts +0 -3703
- package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +0 -2121
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.d.ts +0 -94
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.d.ts +0 -27
- package/dist/components/tt-drawer/src/hooks/useDrawerRender.d.ts +0 -10
- package/dist/components/tt-drawer/src/hooks/useResizable.d.ts +0 -9
- package/dist/components/tt-drawer/src/index.d.ts +0 -10
- package/dist/components/tt-drawer/src/props.d.ts +0 -99
- package/dist/components/tt-drawer/src/typing.d.ts +0 -154
- package/dist/components/tt-drawer/src/utils/drawer-api.d.ts +0 -87
- package/dist/components/tt-empty/index.d.ts +0 -18
- package/dist/components/tt-form/index.d.ts +0 -13
- package/dist/components/tt-form/src/components/ExpandableArrow.vue.d.ts +0 -33
- package/dist/components/tt-form/src/components/FormActions.vue.d.ts +0 -34
- package/dist/components/tt-form/src/components/Slot.d.ts +0 -7
- package/dist/components/tt-form/src/config.d.ts +0 -6
- package/dist/components/tt-form/src/form/FormControl.vue.d.ts +0 -19
- package/dist/components/tt-form/src/form/FormDescription.vue.d.ts +0 -23
- package/dist/components/tt-form/src/form/FormItem.vue.d.ts +0 -23
- package/dist/components/tt-form/src/form/FormLabel.vue.d.ts +0 -23
- package/dist/components/tt-form/src/form/FormMessage.vue.d.ts +0 -2
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue.d.ts +0 -8
- package/dist/components/tt-form/src/form/FormWarnMessage.vue.d.ts +0 -25
- package/dist/components/tt-form/src/form/RenderContent.vue.d.ts +0 -23
- package/dist/components/tt-form/src/form/index.d.ts +0 -10
- package/dist/components/tt-form/src/form/injectionKeys.d.ts +0 -2
- package/dist/components/tt-form/src/form/useFormField.d.ts +0 -11
- package/dist/components/tt-form/src/form-render/FormField.vue.d.ts +0 -28
- package/dist/components/tt-form/src/form-render/FormLabel.vue.d.ts +0 -27
- package/dist/components/tt-form/src/form-render/context.d.ts +0 -7
- package/dist/components/tt-form/src/form-render/dependencies.d.ts +0 -361
- package/dist/components/tt-form/src/form-render/expandable.d.ts +0 -9
- package/dist/components/tt-form/src/form-render/form.vue.d.ts +0 -38
- package/dist/components/tt-form/src/form-render/helper.d.ts +0 -11
- package/dist/components/tt-form/src/form-render/index.d.ts +0 -3
- package/dist/components/tt-form/src/formApi.d.ts +0 -71
- package/dist/components/tt-form/src/hooks/useEmitAsProps.d.ts +0 -7
- package/dist/components/tt-form/src/hooks/useFormFieldBus.d.ts +0 -14
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.d.ts +0 -14
- package/dist/components/tt-form/src/hooks/useForwardProps.d.ts +0 -7
- package/dist/components/tt-form/src/hooks/useForwardPropsEmits.d.ts +0 -8
- package/dist/components/tt-form/src/index.vue.d.ts +0 -27
- package/dist/components/tt-form/src/shared/createContext.d.ts +0 -8
- package/dist/components/tt-form/src/shared/global-state.d.ts +0 -17
- package/dist/components/tt-form/src/shared/store.d.ts +0 -1
- package/dist/components/tt-form/src/shared/zod-defaults.d.ts +0 -54
- package/dist/components/tt-form/src/types/common.d.ts +0 -11
- package/dist/components/tt-form/src/types/forms.d.ts +0 -280
- package/dist/components/tt-form/src/types/index.d.ts +0 -3
- package/dist/components/tt-form/src/types/paths.d.ts +0 -142
- package/dist/components/tt-form/src/types/shared.d.ts +0 -19
- package/dist/components/tt-form/src/types.d.ts +0 -383
- package/dist/components/tt-form/src/useForm.d.ts +0 -2
- package/dist/components/tt-form/src/useFormContext.d.ts +0 -12
- package/dist/components/tt-form-adapter/component/index.d.ts +0 -13
- package/dist/components/tt-form-adapter/index.d.ts +0 -36
- package/dist/components/tt-form-item-error-tooltip/index.d.ts +0 -1549
- package/dist/components/tt-form-item-error-tooltip/index.vue.d.ts +0 -784
- package/dist/components/tt-icon/index.d.ts +0 -76
- package/dist/components/tt-icon/index.vue.d.ts +0 -32
- package/dist/components/tt-image/index.d.ts +0 -127
- package/dist/components/tt-image/src/components/ImageViewer.d.ts +0 -89
- package/dist/components/tt-image/tt-image.d.ts +0 -126
- package/dist/components/tt-loading/index.d.ts +0 -16
- package/dist/components/tt-loading/src/directive.d.ts +0 -9
- package/dist/components/tt-loading/src/loading.vue.d.ts +0 -12
- package/dist/components/tt-loading/src/service.d.ts +0 -25
- package/dist/components/tt-loading/src/type.d.ts +0 -20
- package/dist/components/tt-modal/index.d.ts +0 -1809
- package/dist/components/tt-modal/src/RenderModal.vue.d.ts +0 -1008
- package/dist/components/tt-modal/src/components/ModalFooter.vue.d.ts +0 -210
- package/dist/components/tt-modal/src/components/ModalHeader.vue.d.ts +0 -31
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.d.ts +0 -224
- package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +0 -110
- package/dist/components/tt-modal/src/index.d.ts +0 -5
- package/dist/components/tt-modal/src/props.d.ts +0 -161
- package/dist/components/tt-modal/src/typing.d.ts +0 -188
- package/dist/components/tt-modal/src/utils/modal-api.d.ts +0 -97
- package/dist/components/tt-part/index.d.ts +0 -398
- package/dist/components/tt-part/index.vue.d.ts +0 -253
- package/dist/components/tt-part/type.d.ts +0 -100
- package/dist/components/tt-part-item/index.d.ts +0 -105
- package/dist/components/tt-part-item/index.vue.d.ts +0 -71
- package/dist/components/tt-part-item/type.d.ts +0 -81
- package/dist/components/tt-select/index.d.ts +0 -7
- package/dist/components/tt-select/src/Select.vue.d.ts +0 -861
- package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +0 -111
- package/dist/components/tt-select/src/components/Table.vue.d.ts +0 -250
- package/dist/components/tt-select/src/const.d.ts +0 -16
- package/dist/components/tt-select/src/hooks/useDataSource.d.ts +0 -115
- package/dist/components/tt-select/src/hooks/useGrid.d.ts +0 -32
- package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +0 -59
- package/dist/components/tt-select/src/hooks/usePagination.d.ts +0 -16
- package/dist/components/tt-select/src/hooks/useSelect.d.ts +0 -87
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +0 -178
- package/dist/components/tt-select/src/props.d.ts +0 -190
- package/dist/components/tt-select/src/types/index.d.ts +0 -142
- package/dist/components/tt-select/src/utils/index.d.ts +0 -9
- package/dist/components/tt-table/index.d.ts +0 -127
- package/dist/components/tt-table/src/Table.vue.d.ts +0 -1691
- package/dist/components/tt-table/src/componentMap.d.ts +0 -8
- package/dist/components/tt-table/src/components/RowContext.d.ts +0 -24
- package/dist/components/tt-table/src/components/TableAction.vue.d.ts +0 -79
- package/dist/components/tt-table/src/components/TableButtons.d.ts +0 -30
- package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts +0 -26
- package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +0 -1537
- package/dist/components/tt-table/src/emits.d.ts +0 -1
- package/dist/components/tt-table/src/enum.d.ts +0 -2
- package/dist/components/tt-table/src/hooks/useCache.d.ts +0 -20
- package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -15
- package/dist/components/tt-table/src/hooks/useColumns.d.ts +0 -27
- package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -20
- package/dist/components/tt-table/src/hooks/useDataSource.d.ts +0 -29
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.d.ts +0 -1082
- package/dist/components/tt-table/src/hooks/usePagination.d.ts +0 -102
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +0 -30
- package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -7
- package/dist/components/tt-table/src/hooks/useTableContext.d.ts +0 -43
- package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -101
- package/dist/components/tt-table/src/hooks/useTableForm.d.ts +0 -15
- package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -10
- package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -15
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts +0 -93
- package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -11
- package/dist/components/tt-table/src/props.d.ts +0 -436
- package/dist/components/tt-table/src/toolProps.d.ts +0 -23
- package/dist/components/tt-table/src/types/table.d.ts +0 -489
- package/dist/components/tt-table/src/types/tableAction.d.ts +0 -26
- package/dist/components/tt-table/src/types/tableForm.d.ts +0 -64
- package/dist/components/tt-table/src/types/tableTools.d.ts +0 -10
- package/dist/components/tt-table/src/utils/context.d.ts +0 -18
- package/dist/components/tt-table/src/utils/filters.d.ts +0 -109
- package/dist/components/tt-table/src/utils/table-api.d.ts +0 -250
- package/dist/components/tt-table/src/utils/table-form-api.d.ts +0 -88
- package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -28
- package/dist/components/tt-text/index.d.ts +0 -76
- package/dist/components/tt-text/index.vue.d.ts +0 -50
- package/dist/components/tt-tree-select/index.d.ts +0 -5
- package/dist/components/tt-tree-select/src/TtTreeSelect.vue.d.ts +0 -6
- package/dist/components/tt-tree-select/src/cache-options.d.ts +0 -35
- package/dist/components/tt-tree-select/src/select.d.ts +0 -10
- package/dist/components/tt-tree-select/src/tree.d.ts +0 -23
- package/dist/components/tt-tree-select/src/utils.d.ts +0 -10
- package/dist/components/tt-validate/index.d.ts +0 -1
- package/dist/components/tt-validate/src/ErrorMessage.d.ts +0 -61
- package/dist/components/tt-validate/src/Field.d.ts +0 -430
- package/dist/components/tt-validate/src/FieldArray.d.ts +0 -47
- package/dist/components/tt-validate/src/Form.d.ts +0 -271
- package/dist/components/tt-validate/src/config.d.ts +0 -14
- package/dist/components/tt-validate/src/defineRule.d.ts +0 -9
- package/dist/components/tt-validate/src/index.d.ts +0 -36
- package/dist/components/tt-validate/src/symbols.d.ts +0 -6
- package/dist/components/tt-validate/src/types/common.d.ts +0 -11
- package/dist/components/tt-validate/src/types/forms.d.ts +0 -280
- package/dist/components/tt-validate/src/types/index.d.ts +0 -3
- package/dist/components/tt-validate/src/types/paths.d.ts +0 -142
- package/dist/components/tt-validate/src/types/shared.d.ts +0 -19
- package/dist/components/tt-validate/src/useField.d.ts +0 -30
- package/dist/components/tt-validate/src/useFieldArray.d.ts +0 -3
- package/dist/components/tt-validate/src/useFieldError.d.ts +0 -5
- package/dist/components/tt-validate/src/useFieldState.d.ts +0 -47
- package/dist/components/tt-validate/src/useFieldValue.d.ts +0 -5
- package/dist/components/tt-validate/src/useForm.d.ts +0 -23
- package/dist/components/tt-validate/src/useFormErrors.d.ts +0 -4
- package/dist/components/tt-validate/src/useFormValues.d.ts +0 -4
- package/dist/components/tt-validate/src/useIsFieldDirty.d.ts +0 -5
- package/dist/components/tt-validate/src/useIsFieldTouched.d.ts +0 -5
- package/dist/components/tt-validate/src/useIsFieldValid.d.ts +0 -5
- package/dist/components/tt-validate/src/useIsFormDirty.d.ts +0 -4
- package/dist/components/tt-validate/src/useIsFormTouched.d.ts +0 -4
- package/dist/components/tt-validate/src/useIsFormValid.d.ts +0 -4
- package/dist/components/tt-validate/src/useIsSubmitting.d.ts +0 -4
- package/dist/components/tt-validate/src/useIsValidating.d.ts +0 -4
- package/dist/components/tt-validate/src/useResetForm.d.ts +0 -2
- package/dist/components/tt-validate/src/useSetFieldError.d.ts +0 -5
- package/dist/components/tt-validate/src/useSetFieldTouched.d.ts +0 -5
- package/dist/components/tt-validate/src/useSetFieldValue.d.ts +0 -5
- package/dist/components/tt-validate/src/useSetFormErrors.d.ts +0 -4
- package/dist/components/tt-validate/src/useSetFormTouched.d.ts +0 -4
- package/dist/components/tt-validate/src/useSetFormValues.d.ts +0 -4
- package/dist/components/tt-validate/src/useSubmitCount.d.ts +0 -4
- package/dist/components/tt-validate/src/useSubmitForm.d.ts +0 -2
- package/dist/components/tt-validate/src/useValidateField.d.ts +0 -6
- package/dist/components/tt-validate/src/useValidateForm.d.ts +0 -5
- package/dist/components/tt-validate/src/utils/assertions.d.ts +0 -54
- package/dist/components/tt-validate/src/utils/common.d.ts +0 -48
- package/dist/components/tt-validate/src/utils/events.d.ts +0 -1
- package/dist/components/tt-validate/src/utils/index.d.ts +0 -5
- package/dist/components/tt-validate/src/utils/rules.d.ts +0 -13
- package/dist/components/tt-validate/src/utils/shared.d.ts +0 -19
- package/dist/components/tt-validate/src/utils/vnode.d.ts +0 -22
- package/dist/components/tt-validate/src/validate.d.ts +0 -21
- package/dist/components/tt-validate/zod/index.d.ts +0 -1
- package/dist/components/types.d.ts +0 -227
- package/dist/directives/auto-tip/index.d.ts +0 -3
- package/dist/directives/dialog-resize/index.d.ts +0 -25
- package/dist/directives/dialog-resize/use-css-variable.d.ts +0 -1
- package/dist/directives/dialog-resize/use-draggable.d.ts +0 -4
- package/dist/directives/dialog-resize/use-fullscreen.d.ts +0 -1
- package/dist/directives/dialog-resize/use-parse-translate.d.ts +0 -4
- package/dist/directives/dialog-resize/use-resizer.d.ts +0 -2
- package/dist/directives/disabled-tip/index.d.ts +0 -17
- package/dist/directives/index.d.ts +0 -3
- package/dist/hooks/useFormat.d.ts +0 -73
- package/dist/hooks/useLoading.d.ts +0 -9
- package/dist/hooks/useSetup.d.ts +0 -8
- package/dist/hooks/useTable.d.ts +0 -5
- package/dist/hooks/useTemplateSlot.d.ts +0 -9
- package/dist/index.d.ts +0 -46
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from 'element-plus';
|
|
2
|
-
import { PropType } from 'vue';
|
|
3
|
-
import { TipConfig } from '../../../directives/disabled-tip';
|
|
4
|
-
export declare const modalProps: {
|
|
5
|
-
/** 测试标识 */
|
|
6
|
-
testId: any;
|
|
7
|
-
/** 是否显示 */
|
|
8
|
-
visible: {
|
|
9
|
-
type: BooleanConstructor;
|
|
10
|
-
};
|
|
11
|
-
/** 标题 */
|
|
12
|
-
title: any;
|
|
13
|
-
/** 取消按钮文本 */
|
|
14
|
-
cancelText: {
|
|
15
|
-
type: StringConstructor;
|
|
16
|
-
default: string;
|
|
17
|
-
};
|
|
18
|
-
/** 确定按钮文本 */
|
|
19
|
-
okText: {
|
|
20
|
-
type: StringConstructor;
|
|
21
|
-
default: string;
|
|
22
|
-
};
|
|
23
|
-
/** 最小高度 */
|
|
24
|
-
minHeight: any;
|
|
25
|
-
/** 高度 */
|
|
26
|
-
height: any;
|
|
27
|
-
/** 是否滚动到顶 */
|
|
28
|
-
scrollTop: {
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
default: boolean;
|
|
31
|
-
};
|
|
32
|
-
/** 取消前的函数 */
|
|
33
|
-
closeFunc: PropType<() => Promise<boolean>>;
|
|
34
|
-
/** 是否允许拖拽 */
|
|
35
|
-
draggable: {
|
|
36
|
-
type: BooleanConstructor;
|
|
37
|
-
default: boolean;
|
|
38
|
-
};
|
|
39
|
-
/** 是否允许放大 */
|
|
40
|
-
fullscreen: {
|
|
41
|
-
type: BooleanConstructor;
|
|
42
|
-
default: boolean;
|
|
43
|
-
};
|
|
44
|
-
/** 是否允许自定义大小 */
|
|
45
|
-
resizer: {
|
|
46
|
-
type: BooleanConstructor;
|
|
47
|
-
default: boolean;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export declare const basicProps: {
|
|
51
|
-
/** 测试标识 */
|
|
52
|
-
testId: any;
|
|
53
|
-
/** 是否显示 */
|
|
54
|
-
visible: {
|
|
55
|
-
type: BooleanConstructor;
|
|
56
|
-
};
|
|
57
|
-
/** 标题 */
|
|
58
|
-
title: any;
|
|
59
|
-
/** 取消按钮文本 */
|
|
60
|
-
cancelText: {
|
|
61
|
-
type: StringConstructor;
|
|
62
|
-
default: string;
|
|
63
|
-
};
|
|
64
|
-
/** 确定按钮文本 */
|
|
65
|
-
okText: {
|
|
66
|
-
type: StringConstructor;
|
|
67
|
-
default: string;
|
|
68
|
-
};
|
|
69
|
-
/** 最小高度 */
|
|
70
|
-
minHeight: any;
|
|
71
|
-
/** 高度 */
|
|
72
|
-
height: any;
|
|
73
|
-
/** 是否滚动到顶 */
|
|
74
|
-
scrollTop: {
|
|
75
|
-
type: BooleanConstructor;
|
|
76
|
-
default: boolean;
|
|
77
|
-
};
|
|
78
|
-
/** 取消前的函数 */
|
|
79
|
-
closeFunc: PropType<() => Promise<boolean>>;
|
|
80
|
-
/** 是否允许拖拽 */
|
|
81
|
-
draggable: {
|
|
82
|
-
type: BooleanConstructor;
|
|
83
|
-
default: boolean;
|
|
84
|
-
};
|
|
85
|
-
/** 是否允许放大 */
|
|
86
|
-
fullscreen: {
|
|
87
|
-
type: BooleanConstructor;
|
|
88
|
-
default: boolean;
|
|
89
|
-
};
|
|
90
|
-
/** 是否允许自定义大小 */
|
|
91
|
-
resizer: {
|
|
92
|
-
type: BooleanConstructor;
|
|
93
|
-
default: boolean;
|
|
94
|
-
};
|
|
95
|
-
} & {
|
|
96
|
-
/** 弹窗的loading */
|
|
97
|
-
loading: {
|
|
98
|
-
type: BooleanConstructor;
|
|
99
|
-
default: boolean;
|
|
100
|
-
};
|
|
101
|
-
/** 弹窗的loading提示 */
|
|
102
|
-
loadingTip: {
|
|
103
|
-
type: StringConstructor;
|
|
104
|
-
};
|
|
105
|
-
/** 是否显示footer */
|
|
106
|
-
showFooter: {
|
|
107
|
-
type: BooleanConstructor;
|
|
108
|
-
default: boolean;
|
|
109
|
-
};
|
|
110
|
-
/** 是否显示取消按钮 */
|
|
111
|
-
showCancelBtn: {
|
|
112
|
-
type: BooleanConstructor;
|
|
113
|
-
default: boolean;
|
|
114
|
-
};
|
|
115
|
-
/** 是否显示确定按钮 */
|
|
116
|
-
showOkBtn: {
|
|
117
|
-
type: BooleanConstructor;
|
|
118
|
-
default: boolean;
|
|
119
|
-
};
|
|
120
|
-
/** 是否显示确定按钮loading */
|
|
121
|
-
confirmLoading: {
|
|
122
|
-
type: BooleanConstructor;
|
|
123
|
-
};
|
|
124
|
-
/** 是否显示取消按钮loading */
|
|
125
|
-
cancelLoading: {
|
|
126
|
-
type: BooleanConstructor;
|
|
127
|
-
};
|
|
128
|
-
/** 宽度 */
|
|
129
|
-
width: PropType<string | number>;
|
|
130
|
-
/** 弹窗距离顶部的距离需要带px单位 */
|
|
131
|
-
top: {
|
|
132
|
-
type: StringConstructor;
|
|
133
|
-
};
|
|
134
|
-
/** 弹大小 */
|
|
135
|
-
size: {
|
|
136
|
-
type: PropType<"medium" | "small" | "mini">;
|
|
137
|
-
default: string;
|
|
138
|
-
};
|
|
139
|
-
/** 确定按钮的样式 */
|
|
140
|
-
okButtonProps: {
|
|
141
|
-
type: PropType<Partial<ButtonProps> & {
|
|
142
|
-
disabledTip?: TipConfig | TipConfig[];
|
|
143
|
-
}>;
|
|
144
|
-
default: Partial<ButtonProps>;
|
|
145
|
-
};
|
|
146
|
-
/** 取消按钮的样式 */
|
|
147
|
-
cancelButtonProps: {
|
|
148
|
-
type: PropType<Partial<ButtonProps>>;
|
|
149
|
-
default: Partial<ButtonProps>;
|
|
150
|
-
};
|
|
151
|
-
/** 是否贴住底部 */
|
|
152
|
-
isBottom: {
|
|
153
|
-
type: BooleanConstructor;
|
|
154
|
-
default: boolean;
|
|
155
|
-
};
|
|
156
|
-
/** 是否显示modal */
|
|
157
|
-
modal: {
|
|
158
|
-
type: BooleanConstructor;
|
|
159
|
-
default: boolean;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { TipConfig } from '../../../directives/disabled-tip';
|
|
2
|
-
import { ButtonProps, DialogProps } from 'element-plus';
|
|
3
|
-
import { Component, ComputedRef, Ref } from 'vue';
|
|
4
|
-
import { default as TtModal } from './RenderModal.vue';
|
|
5
|
-
import { default as TtModalWrapper } from './components/ModalWrapper.vue';
|
|
6
|
-
import { ModalApi } from './utils/modal-api';
|
|
7
|
-
/**
|
|
8
|
-
* @description: 弹窗对外暴露的方法
|
|
9
|
-
*/
|
|
10
|
-
export type ModalMethods = {
|
|
11
|
-
setModalProps: (props: Partial<ModalProps>) => void;
|
|
12
|
-
emitVisible?: (visible: boolean, uid: number) => void;
|
|
13
|
-
redoModalHeight?: () => void;
|
|
14
|
-
scrollToBottom: () => void;
|
|
15
|
-
};
|
|
16
|
-
type RegisterFn = (modalMethods: ModalMethods, uuid: string) => void;
|
|
17
|
-
export type TtModalRegister = [methods: ModalMethods, uuid: string];
|
|
18
|
-
export type ModalReturnMethods = {
|
|
19
|
-
/** 打开弹窗 */
|
|
20
|
-
openModal: <T = any>(props?: boolean, data?: T, openOnSet?: boolean) => void;
|
|
21
|
-
/** 关闭弹窗事件 */
|
|
22
|
-
closeModal: () => void;
|
|
23
|
-
getVisible?: ComputedRef<boolean>;
|
|
24
|
-
} & ModalMethods;
|
|
25
|
-
export type UseModalReturnType = [RegisterFn, ModalReturnMethods];
|
|
26
|
-
export type ModalReturnInnerMethods = {
|
|
27
|
-
/** 关闭弹窗事件 */
|
|
28
|
-
closeModal: () => void;
|
|
29
|
-
/** 改变弹窗loading事件 */
|
|
30
|
-
changeLoading: (loading: boolean) => void;
|
|
31
|
-
/** 改变确定按钮事件 */
|
|
32
|
-
changeOkLoading: (loading: boolean) => void;
|
|
33
|
-
/** 获取visible */
|
|
34
|
-
getVisible?: ComputedRef<boolean>;
|
|
35
|
-
redoModalHeight: () => void;
|
|
36
|
-
} & ModalMethods;
|
|
37
|
-
export type UseModalInnerReturnType = [RegisterFn, ModalReturnInnerMethods];
|
|
38
|
-
export type ModalProps = InstanceType<typeof TtModal>["$props"] & Partial<DialogProps>;
|
|
39
|
-
export type ModalWrapperProps = InstanceType<typeof TtModalWrapper>["$props"];
|
|
40
|
-
export type ModalRenderState = {
|
|
41
|
-
/**
|
|
42
|
-
* 是否显示
|
|
43
|
-
* @default false
|
|
44
|
-
*/
|
|
45
|
-
visible?: boolean;
|
|
46
|
-
/** 测试标识 */
|
|
47
|
-
testId?: string;
|
|
48
|
-
/** 标题 */
|
|
49
|
-
title?: string;
|
|
50
|
-
/**
|
|
51
|
-
* 取消按钮文本
|
|
52
|
-
* @default '取消'
|
|
53
|
-
*/
|
|
54
|
-
cancelText?: string;
|
|
55
|
-
/**
|
|
56
|
-
* 确定按钮文本
|
|
57
|
-
* @default '确定'
|
|
58
|
-
*/
|
|
59
|
-
okText?: string;
|
|
60
|
-
/**
|
|
61
|
-
* 最小高度
|
|
62
|
-
* @default 192
|
|
63
|
-
*/
|
|
64
|
-
minHeight?: number;
|
|
65
|
-
/**
|
|
66
|
-
* 高度
|
|
67
|
-
*/
|
|
68
|
-
height?: number;
|
|
69
|
-
/**
|
|
70
|
-
* 是否滚动到顶
|
|
71
|
-
* @default true
|
|
72
|
-
*/
|
|
73
|
-
scrollTop?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* 取消前的函数
|
|
76
|
-
*/
|
|
77
|
-
closeFunc?: () => Promise<boolean>;
|
|
78
|
-
/**
|
|
79
|
-
* 是否允许拖拽
|
|
80
|
-
* @default true
|
|
81
|
-
*/
|
|
82
|
-
draggable?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* 是否允许放大
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
fullscreen?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* 是否允许自定义大小
|
|
90
|
-
* @default false
|
|
91
|
-
*/
|
|
92
|
-
resizer?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Function 自定义大小改变时触发
|
|
95
|
-
*/
|
|
96
|
-
resizeChange?: () => void;
|
|
97
|
-
/**
|
|
98
|
-
* 弹窗的loading
|
|
99
|
-
* @default false
|
|
100
|
-
*/
|
|
101
|
-
loading?: boolean;
|
|
102
|
-
/** 弹窗的loading提示 */
|
|
103
|
-
loadingTip?: string;
|
|
104
|
-
/**
|
|
105
|
-
* 是否显示footer
|
|
106
|
-
* @default true
|
|
107
|
-
*/
|
|
108
|
-
showFooter?: boolean;
|
|
109
|
-
/**
|
|
110
|
-
* 是否显示取消按钮
|
|
111
|
-
* @default true
|
|
112
|
-
*/
|
|
113
|
-
showCancelBtn?: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* 是否显示确定按钮
|
|
116
|
-
* @default true
|
|
117
|
-
*/
|
|
118
|
-
showOkBtn?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* 是否显示确定按钮loading
|
|
121
|
-
* @default false
|
|
122
|
-
*/
|
|
123
|
-
confirmLoading?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* 是否显示取消按钮loading
|
|
126
|
-
* @default false
|
|
127
|
-
*/
|
|
128
|
-
cancelLoading?: boolean;
|
|
129
|
-
/** 宽度 */
|
|
130
|
-
width?: string | number;
|
|
131
|
-
/** 弹窗距离顶部的距离需要带px单位 */
|
|
132
|
-
top?: string;
|
|
133
|
-
/**
|
|
134
|
-
* 弹窗大小
|
|
135
|
-
* @default 'small'
|
|
136
|
-
*/
|
|
137
|
-
size?: "medium" | "small" | "mini";
|
|
138
|
-
/**
|
|
139
|
-
* 确定按钮的样式
|
|
140
|
-
* @default { type: 'primary' }
|
|
141
|
-
*/
|
|
142
|
-
okButtonProps?: Partial<ButtonProps> & {
|
|
143
|
-
disabledTip?: TipConfig[];
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* 取消按钮的样式
|
|
147
|
-
* @default {}
|
|
148
|
-
*/
|
|
149
|
-
cancelButtonProps?: Partial<ButtonProps>;
|
|
150
|
-
/**
|
|
151
|
-
* 是否贴住底部
|
|
152
|
-
* @default false
|
|
153
|
-
*/
|
|
154
|
-
isBottom?: boolean;
|
|
155
|
-
} & Partial<DialogProps>;
|
|
156
|
-
export type ModalApiOptions = ModalRenderState & Partial<DialogProps> & {
|
|
157
|
-
/**
|
|
158
|
-
* 独立的弹窗组件
|
|
159
|
-
*/
|
|
160
|
-
connectedComponent?: Component;
|
|
161
|
-
/**
|
|
162
|
-
* 点击取消按钮的回调
|
|
163
|
-
*/
|
|
164
|
-
onClose?: () => void;
|
|
165
|
-
/**
|
|
166
|
-
* 弹窗关闭动画结束的回调
|
|
167
|
-
* @returns
|
|
168
|
-
*/
|
|
169
|
-
onClosed?: () => void;
|
|
170
|
-
/**
|
|
171
|
-
* 弹窗状态变化回调
|
|
172
|
-
* @param isOpen
|
|
173
|
-
* @returns
|
|
174
|
-
*/
|
|
175
|
-
onVisibleChange?: (isOpen: boolean) => void;
|
|
176
|
-
/**
|
|
177
|
-
* 点击确定按钮的回调
|
|
178
|
-
*/
|
|
179
|
-
onOk?: () => void;
|
|
180
|
-
/**
|
|
181
|
-
* 监听的方法
|
|
182
|
-
*/
|
|
183
|
-
onReceiveSharedData?: (data: Record<string, any>) => void;
|
|
184
|
-
};
|
|
185
|
-
export type TtModalExtendedModalApi = ModalApi & {
|
|
186
|
-
useStore: <T = NoInfer<ModalRenderState>>(selector?: (state: NoInfer<ModalRenderState>) => T) => Readonly<Ref<T>>;
|
|
187
|
-
};
|
|
188
|
-
export {};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { ModalApiOptions, ModalMethods, ModalRenderState } from '../typing';
|
|
2
|
-
import { Store } from '@tanstack/vue-store';
|
|
3
|
-
export type ApiType = Pick<ModalApiOptions, "onClose" | "onVisibleChange" | "onOk" | "onReceiveSharedData" | "onClosed">;
|
|
4
|
-
/**
|
|
5
|
-
* 弹窗的API类
|
|
6
|
-
* @description 用于管理弹窗的共享数据、状态和API接口
|
|
7
|
-
*/
|
|
8
|
-
export declare class ModalApi {
|
|
9
|
-
/** 共享数据对象,用于在组件间传递数据 */
|
|
10
|
-
sharedData: Record<"payload", any>;
|
|
11
|
-
/** 状态存储对象,使用Store管理弹窗的各种状态 */
|
|
12
|
-
store: Store<ModalRenderState>;
|
|
13
|
-
/** 弹窗的API接口,用于处理外部事件 */
|
|
14
|
-
private api;
|
|
15
|
-
/** 弹窗的当前状态,使用Partial<ModalRenderState>类型 */
|
|
16
|
-
state: ModalRenderState;
|
|
17
|
-
/** 弹窗的实例方法,用于处理弹窗的各种操作 */
|
|
18
|
-
private methods?;
|
|
19
|
-
/** 构造函数,初始化弹窗的API接口和状态 */
|
|
20
|
-
constructor(options?: ModalApiOptions);
|
|
21
|
-
/**
|
|
22
|
-
* 挂载弹窗实例和API接口
|
|
23
|
-
* @param api - 外部传入的API接口
|
|
24
|
-
* @param methods - 外部传入的实例方法
|
|
25
|
-
*/
|
|
26
|
-
mount(api: ApiType, methods: ModalMethods): void;
|
|
27
|
-
/**
|
|
28
|
-
* 关闭弹窗
|
|
29
|
-
*/
|
|
30
|
-
close(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* 取消操作
|
|
33
|
-
*/
|
|
34
|
-
onClosed(): void;
|
|
35
|
-
/**
|
|
36
|
-
* 确认操作
|
|
37
|
-
*/
|
|
38
|
-
onOk: () => void;
|
|
39
|
-
/**
|
|
40
|
-
* 获取共享数据
|
|
41
|
-
* @returns 共享数据对象
|
|
42
|
-
*/
|
|
43
|
-
getData<T extends object = Record<string, any>>(): T;
|
|
44
|
-
/**
|
|
45
|
-
* 设置弹窗的状态
|
|
46
|
-
* @param stateOrFn - 状态对象或状态函数
|
|
47
|
-
* @returns 当前实例
|
|
48
|
-
*/
|
|
49
|
-
setState(stateOrFn: ((prev: Partial<ModalRenderState>) => Partial<ModalRenderState>) | Partial<ModalRenderState>): this;
|
|
50
|
-
/**
|
|
51
|
-
* 打开弹窗
|
|
52
|
-
* @param visible - 是否可见
|
|
53
|
-
* @param data - 共享数据
|
|
54
|
-
*/
|
|
55
|
-
openModal<T>(visible?: boolean, data?: T): void;
|
|
56
|
-
/**
|
|
57
|
-
* 设置弹窗的属性
|
|
58
|
-
* @param props - 属性对象
|
|
59
|
-
* @returns 当前实例
|
|
60
|
-
*/
|
|
61
|
-
setModalProps(props: Partial<ModalRenderState>): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* 设置弹窗的加载状态
|
|
64
|
-
* @param loading - 是否加载中
|
|
65
|
-
* @returns 当前实例
|
|
66
|
-
*/
|
|
67
|
-
changeLoading(loading?: boolean): this;
|
|
68
|
-
/**
|
|
69
|
-
* 设置确认按钮的加载状态
|
|
70
|
-
* @param loading - 是否加载中
|
|
71
|
-
* @returns 当前实例
|
|
72
|
-
*/
|
|
73
|
-
changeOkLoading(loading?: boolean): this;
|
|
74
|
-
/**
|
|
75
|
-
* 设置共享数据
|
|
76
|
-
* @param payload - 共享数据
|
|
77
|
-
* @returns 当前实例
|
|
78
|
-
*/
|
|
79
|
-
setData(payload: any): this;
|
|
80
|
-
/**
|
|
81
|
-
* 关闭弹窗
|
|
82
|
-
*/
|
|
83
|
-
closeModal(): void;
|
|
84
|
-
/**
|
|
85
|
-
* 获取弹窗的可见状态
|
|
86
|
-
* @returns 弹窗的可见状态
|
|
87
|
-
*/
|
|
88
|
-
getVisible: import('vue').ComputedRef<boolean | undefined>;
|
|
89
|
-
/**
|
|
90
|
-
* 重置弹窗高度
|
|
91
|
-
*/
|
|
92
|
-
redoModalHeight(): void;
|
|
93
|
-
/**
|
|
94
|
-
* 滚动到底部
|
|
95
|
-
*/
|
|
96
|
-
scrollToBottom(): void;
|
|
97
|
-
}
|