zjh-web-ui 1.0.10

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.
Files changed (175) hide show
  1. package/README.md +1 -0
  2. package/config/resolver.js +21 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  4. package/dist/components/AMapConfig.js +23 -0
  5. package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.js +82 -0
  6. package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue2.js +4 -0
  7. package/dist/components/HuiAMapMassMarkers/index.js +7 -0
  8. package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.js +7 -0
  9. package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue2.js +190 -0
  10. package/dist/components/HuiAMapSearchAddress/index.js +7 -0
  11. package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.js +83 -0
  12. package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue2.js +4 -0
  13. package/dist/components/HuiAMapSearchAddressDialog/index.js +7 -0
  14. package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.js +7 -0
  15. package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue2.js +178 -0
  16. package/dist/components/HuiAMapSelectAddress/index.js +7 -0
  17. package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.js +83 -0
  18. package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue2.js +4 -0
  19. package/dist/components/HuiAMapSelectAddressDialog/index.js +7 -0
  20. package/dist/components/HuiCountDownButton/HuiCountDownButton.vue.js +63 -0
  21. package/dist/components/HuiCountDownButton/HuiCountDownButton.vue2.js +4 -0
  22. package/dist/components/HuiCountDownButton/index.js +7 -0
  23. package/dist/components/HuiDataView/HuiDataView.vue.js +7 -0
  24. package/dist/components/HuiDataView/HuiDataView.vue2.js +84 -0
  25. package/dist/components/HuiDataView/index.js +7 -0
  26. package/dist/components/HuiGridForm/HuiGridForm.vue.js +7 -0
  27. package/dist/components/HuiGridForm/HuiGridForm.vue2.js +223 -0
  28. package/dist/components/HuiGridForm/HuiGridFormHooks.js +21 -0
  29. package/dist/components/HuiGridForm/index.js +7 -0
  30. package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue.js +7 -0
  31. package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue2.js +167 -0
  32. package/dist/components/HuiLineEditDialog/index.js +7 -0
  33. package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue.js +7 -0
  34. package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue2.js +128 -0
  35. package/dist/components/HuiLineEditPopover/index.js +7 -0
  36. package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.js +65 -0
  37. package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue2.js +4 -0
  38. package/dist/components/HuiPreviewRichTextDialog/index.js +7 -0
  39. package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.js +118 -0
  40. package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue2.js +4 -0
  41. package/dist/components/HuiRegionTreeDialog/index.js +7 -0
  42. package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.js +7 -0
  43. package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue2.js +59 -0
  44. package/dist/components/HuiRegionTreeSelect/index.js +7 -0
  45. package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.js +44 -0
  46. package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue2.js +4 -0
  47. package/dist/components/HuiSelectLoadStatus/index.js +7 -0
  48. package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.js +50 -0
  49. package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue2.js +4 -0
  50. package/dist/components/HuiShowUrlDialog/index.js +7 -0
  51. package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.js +118 -0
  52. package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue2.js +4 -0
  53. package/dist/components/HuiStringArrayInputDialog/index.js +7 -0
  54. package/dist/components/HuiTags/HuiTags.vue.js +7 -0
  55. package/dist/components/HuiTags/HuiTags.vue2.js +28 -0
  56. package/dist/components/HuiTags/index.js +7 -0
  57. package/dist/components/HuiTagsMore/HuiTagsMore.vue.js +188 -0
  58. package/dist/components/HuiTagsMore/HuiTagsMore.vue2.js +4 -0
  59. package/dist/components/HuiTagsMore/index.js +7 -0
  60. package/dist/components/HuiTinymce/HuiTinymce.vue.js +37 -0
  61. package/dist/components/HuiTinymce/HuiTinymce.vue3.js +5 -0
  62. package/dist/components/HuiTinymce/HuiTinymceLinkHooks.js +99 -0
  63. package/dist/components/HuiTinymce/HuiTinymceSettingHooks.js +104 -0
  64. package/dist/components/HuiTinymce/index.js +8 -0
  65. package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue.js +96 -0
  66. package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue2.js +4 -0
  67. package/dist/components/HuiTinymceDialog/index.js +7 -0
  68. package/dist/components/HuiTip/HuiTip.vue.js +52 -0
  69. package/dist/components/HuiTip/HuiTip.vue2.js +4 -0
  70. package/dist/components/HuiTip/index.js +7 -0
  71. package/dist/components-install-list.js +47 -0
  72. package/dist/delegate.js +13 -0
  73. package/dist/directives/install-loadmore.js +7 -0
  74. package/dist/directives/select-loadmore.js +25 -0
  75. package/dist/hooks/useHuiDialog/useHuiDialog.js +20 -0
  76. package/dist/hooks/useHuiFormDialog/formDialogPropsDef.js +6 -0
  77. package/dist/hooks/useHuiFormDialog/useHuiFormDialog.js +109 -0
  78. package/dist/index.js +62 -0
  79. package/dist/install-helper/install.js +21 -0
  80. package/dist/style.css +1 -0
  81. package/dist/utils/hui-rules.js +142 -0
  82. package/dist/utils/hui-tool/index.js +7 -0
  83. package/dist/utils/hui-tool/message-box/index.js +33 -0
  84. package/dist/utils/hui-tool/message-box/message-box.vue.js +112 -0
  85. package/dist/utils/hui-tool/message-box/message-box.vue3.js +5 -0
  86. package/dist/utils/hui-tool/msg-tool.js +39 -0
  87. package/global.d.ts +40 -0
  88. package/package.json +44 -0
  89. package/src/css/common-font.scss +104 -0
  90. package/src/css/index.scss +1 -0
  91. package/types/components/AMapConfig.d.ts +2 -0
  92. package/types/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.d.ts +105 -0
  93. package/types/components/HuiAMapMassMarkers/index.d.ts +107 -0
  94. package/types/components/HuiAMapMassMarkers/type.d.ts +58 -0
  95. package/types/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.d.ts +76 -0
  96. package/types/components/HuiAMapSearchAddress/index.d.ts +77 -0
  97. package/types/components/HuiAMapSearchAddress/type.d.ts +19 -0
  98. package/types/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.d.ts +38 -0
  99. package/types/components/HuiAMapSearchAddressDialog/index.d.ts +71 -0
  100. package/types/components/HuiAMapSearchAddressDialog/type.d.ts +17 -0
  101. package/types/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.d.ts +76 -0
  102. package/types/components/HuiAMapSelectAddress/index.d.ts +77 -0
  103. package/types/components/HuiAMapSelectAddress/type.d.ts +19 -0
  104. package/types/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.d.ts +38 -0
  105. package/types/components/HuiAMapSelectAddressDialog/index.d.ts +71 -0
  106. package/types/components/HuiAMapSelectAddressDialog/type.d.ts +17 -0
  107. package/types/components/HuiCountDownButton/HuiCountDownButton.vue.d.ts +44 -0
  108. package/types/components/HuiCountDownButton/index.d.ts +76 -0
  109. package/types/components/HuiCountDownButton/type.d.ts +20 -0
  110. package/types/components/HuiDataView/HuiDataView.vue.d.ts +60 -0
  111. package/types/components/HuiDataView/index.d.ts +109 -0
  112. package/types/components/HuiDataView/type.d.ts +49 -0
  113. package/types/components/HuiGridForm/HuiGridForm.vue.d.ts +77 -0
  114. package/types/components/HuiGridForm/HuiGridFormHooks.d.ts +4 -0
  115. package/types/components/HuiGridForm/index.d.ts +175 -0
  116. package/types/components/HuiGridForm/type.d.ts +67 -0
  117. package/types/components/HuiLineEditDialog/HuiLineEditDialog.vue.d.ts +75 -0
  118. package/types/components/HuiLineEditDialog/index.d.ts +173 -0
  119. package/types/components/HuiLineEditDialog/type.d.ts +86 -0
  120. package/types/components/HuiLineEditPopover/HuiLineEditPopover.vue.d.ts +74 -0
  121. package/types/components/HuiLineEditPopover/index.d.ts +133 -0
  122. package/types/components/HuiLineEditPopover/type.d.ts +23 -0
  123. package/types/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.d.ts +31 -0
  124. package/types/components/HuiPreviewRichTextDialog/index.d.ts +22 -0
  125. package/types/components/HuiPreviewRichTextDialog/type.d.ts +4 -0
  126. package/types/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.d.ts +53 -0
  127. package/types/components/HuiRegionTreeDialog/index.d.ts +68 -0
  128. package/types/components/HuiRegionTreeDialog/type.d.ts +24 -0
  129. package/types/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.d.ts +25 -0
  130. package/types/components/HuiRegionTreeSelect/index.d.ts +29 -0
  131. package/types/components/HuiRegionTreeSelect/type.d.ts +6 -0
  132. package/types/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.d.ts +14 -0
  133. package/types/components/HuiSelectLoadStatus/index.d.ts +33 -0
  134. package/types/components/HuiSelectLoadStatus/type.d.ts +11 -0
  135. package/types/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.d.ts +37 -0
  136. package/types/components/HuiShowUrlDialog/index.d.ts +40 -0
  137. package/types/components/HuiShowUrlDialog/type.d.ts +11 -0
  138. package/types/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.d.ts +44 -0
  139. package/types/components/HuiStringArrayInputDialog/index.d.ts +67 -0
  140. package/types/components/HuiStringArrayInputDialog/type.d.ts +33 -0
  141. package/types/components/HuiTags/HuiTags.vue.d.ts +37 -0
  142. package/types/components/HuiTags/index.d.ts +36 -0
  143. package/types/components/HuiTagsMore/HuiTagsMore.vue.d.ts +93 -0
  144. package/types/components/HuiTagsMore/index.d.ts +92 -0
  145. package/types/components/HuiTinymce/HuiTinymce.vue.d.ts +62 -0
  146. package/types/components/HuiTinymce/HuiTinymceLinkHooks.d.ts +3 -0
  147. package/types/components/HuiTinymce/HuiTinymceSettingHooks.d.ts +3 -0
  148. package/types/components/HuiTinymce/index.d.ts +66 -0
  149. package/types/components/HuiTinymce/type.d.ts +51 -0
  150. package/types/components/HuiTinymceDialog/HuiTinymceDialog.vue.d.ts +53 -0
  151. package/types/components/HuiTinymceDialog/index.d.ts +78 -0
  152. package/types/components/HuiTinymceDialog/type.d.ts +12 -0
  153. package/types/components/HuiTip/HuiTip.vue.d.ts +22 -0
  154. package/types/components/HuiTip/index.d.ts +99 -0
  155. package/types/components/HuiTip/type.d.ts +14 -0
  156. package/types/components-install-list.d.ts +3328 -0
  157. package/types/components.d.ts +21 -0
  158. package/types/delegate.d.ts +41 -0
  159. package/types/directives/index.d.ts +4 -0
  160. package/types/directives/install-loadmore.d.ts +7 -0
  161. package/types/directives/select-loadmore.d.ts +7 -0
  162. package/types/hooks/index.d.ts +3 -0
  163. package/types/hooks/useHuiDialog/useHuiDialog.d.ts +18 -0
  164. package/types/hooks/useHuiFormDialog/formDialogPropsDef.d.ts +3 -0
  165. package/types/hooks/useHuiFormDialog/type.d.ts +90 -0
  166. package/types/hooks/useHuiFormDialog/useHuiFormDialog.d.ts +32 -0
  167. package/types/index.d.ts +13 -0
  168. package/types/install-helper/install.d.ts +18 -0
  169. package/types/install-helper/typescript.d.ts +14 -0
  170. package/types/utils/hui-rules.d.ts +80 -0
  171. package/types/utils/hui-tool/index.d.ts +8 -0
  172. package/types/utils/hui-tool/message-box/index.d.ts +18 -0
  173. package/types/utils/hui-tool/message-box/message-box.vue.d.ts +36 -0
  174. package/types/utils/hui-tool/msg-tool.d.ts +26 -0
  175. package/types/utils/index.d.ts +2 -0
@@ -0,0 +1,21 @@
1
+ export * from './components/HuiLineEditDialog';
2
+ export * from './components/HuiPreviewRichTextDialog';
3
+ export * from './components/HuiShowUrlDialog';
4
+ export * from './components/HuiStringArrayInputDialog';
5
+ export * from './components/HuiCountDownButton';
6
+ export * from './components/HuiRegionTreeDialog';
7
+ export * from './components/HuiTinymceDialog';
8
+ export * from './components/HuiTinymce';
9
+ export * from './components/HuiSelectLoadStatus';
10
+ export * from './components/HuiLineEditPopover';
11
+ export * from './components/HuiAMapSelectAddress';
12
+ export * from './components/HuiAMapSelectAddressDialog';
13
+ export * from './components/HuiAMapSearchAddress';
14
+ export * from './components/HuiAMapSearchAddressDialog';
15
+ export * from './components/HuiGridForm';
16
+ export * from './components/HuiDataView';
17
+ export * from './components/HuiRegionTreeSelect';
18
+ export * from './components/HuiAMapMassMarkers';
19
+ export * from './components/HuiTags';
20
+ export * from './components/HuiTagsMore';
21
+ export * from './components/HuiTip';
@@ -0,0 +1,41 @@
1
+ export interface HuiDelegate {
2
+ /**
3
+ * 地区的所有数据
4
+ * @returns
5
+ */
6
+ getRegionTree?: () => any[] | Promise<any[]>;
7
+ /**
8
+ * 上传oss
9
+ * @param file 文件信息
10
+ * @returns {Promise<[any, any]>} 上传后的结果
11
+ */
12
+ putOss?: (file: File | Blob | any) => Promise<[any, any]>;
13
+ /**
14
+ * 地图相关配置
15
+ */
16
+ amapConfig?: {
17
+ key: string;
18
+ serviceHost: string;
19
+ };
20
+ /**
21
+ * 获取按钮权限
22
+ * @returns
23
+ */
24
+ getBtnPermission?: () => {
25
+ [key: string]: any;
26
+ };
27
+ /**
28
+ * 其他配置
29
+ */
30
+ [key: string]: any;
31
+ }
32
+ /**
33
+ * window 全局变量声明
34
+ */
35
+ declare global {
36
+ interface Window {
37
+ /** 依赖外部传入的delegate */
38
+ huiDelegate: HuiDelegate;
39
+ }
40
+ }
41
+ export declare const defaultDelegate: HuiDelegate;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 按需引入的指令,不需全局挂载,
3
+ */
4
+ export { selectLoadmore } from './select-loadmore';
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+
3
+ /**
4
+ * 需全局挂载的指令
5
+ * @param app
6
+ */
7
+ export declare function installDirective(app: App): void;
@@ -0,0 +1,7 @@
1
+ import { Directive, App } from 'vue';
2
+
3
+ export declare const selectLoadmore: Directive;
4
+ declare const _default: {
5
+ install(app: App): void;
6
+ };
7
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export * from './useHuiDialog/useHuiDialog';
2
+ export * from './useHuiFormDialog/useHuiFormDialog';
3
+ export * from './useHuiFormDialog/formDialogPropsDef.ts';
@@ -0,0 +1,18 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * 普通弹框通用逻辑
4
+ * 集成 el-dialog 组件 的hooks,props 透传到 el-dialog
5
+ * @returns
6
+ * @example
7
+ * normalDialogTest.value?.open(id, payload)
8
+ * <NormalDialogTest ref="formDialogTest" top="40vh" width="60vw" @open="beforeOpen" @close="beforeClose" />
9
+ */
10
+ export declare const useHuiDialog: () => {
11
+ id: Ref<string, string>;
12
+ show: Ref<boolean, boolean>;
13
+ payload: Ref<{}, {}>;
14
+ dialogLoading: Ref<boolean, boolean>;
15
+ confirmLoading: Ref<boolean, boolean>;
16
+ open: (dataId?: string, info?: {}) => void;
17
+ close: () => void;
18
+ };
@@ -0,0 +1,3 @@
1
+ export declare const formDialogPropsDef: {
2
+ permission: ObjectConstructor;
3
+ };
@@ -0,0 +1,90 @@
1
+ import { Ref } from 'vue';
2
+
3
+ export interface UseHuiFormDialogForm {
4
+ id?: string | number;
5
+ [key: string]: any;
6
+ }
7
+ export interface UseHuiFormDialogConfirm {
8
+ message: string;
9
+ payload?: PayLoadType;
10
+ }
11
+ export interface PayLoadType {
12
+ /** 控制图标展示类型 info:叹号 success:钩 question:问号 */
13
+ iconType?: 'info' | 'success' | 'question';
14
+ /** 控制图标展示的颜色 */
15
+ type?: "info" | "success" | "danger" | "warning";
16
+ /** 取消按钮的文本 */
17
+ cancelText?: string;
18
+ /** 确定按钮的文本 */
19
+ confirmText?: string;
20
+ /** 弹窗宽度 */
21
+ width?: number;
22
+ }
23
+ export interface HuiFormDialogParamsPermission {
24
+ /**
25
+ * 新增接口需要的权限code
26
+ */
27
+ postCode?: string;
28
+ /**
29
+ * 编辑接口需要的权限code
30
+ */
31
+ putCode?: string;
32
+ /**
33
+ * 新增接口没有权限的时候提示的文字
34
+ */
35
+ postCodeTip?: string;
36
+ /**
37
+ * 编辑接口没有权限的时候提示的文字
38
+ */
39
+ putCodeTip?: string;
40
+ /**
41
+ * 权限处理方法
42
+ */
43
+ checkRight?: (type: string) => boolean;
44
+ }
45
+ export interface UseHuiFormDialogParams {
46
+ /**
47
+ * 编辑接口
48
+ */
49
+ put?: any | null;
50
+ /**
51
+ * 新增接口
52
+ */
53
+ post?: any | null;
54
+ /**
55
+ * 权限相关配置
56
+ */
57
+ permission?: HuiFormDialogParamsPermission;
58
+ /**
59
+ * 表单格式
60
+ */
61
+ formModel: UseHuiFormDialogForm;
62
+ /**
63
+ * 是否显示提交成功提示
64
+ */
65
+ showSuccessTip?: boolean;
66
+ /**
67
+ * 提交之前的处理,可用于转化提交的表单
68
+ */
69
+ beforeSubmit?: (submitForm: UseHuiFormDialogForm) => UseHuiFormDialogForm;
70
+ /**
71
+ * 提交之前的检查
72
+ */
73
+ submitCheck?: (submitForm: UseHuiFormDialogForm) => boolean;
74
+ /**
75
+ * 提交成功之后的处理
76
+ */
77
+ afterSubmit?: (submitForm: UseHuiFormDialogForm) => void;
78
+ /**
79
+ * 是否需要二次确认
80
+ */
81
+ isNeedDoubleConfirm?: boolean | Ref<boolean> | any;
82
+ /**
83
+ * 二次确认弹框配置,不传使用默认值
84
+ */
85
+ doubleConfirmConfig?: UseHuiFormDialogConfirm;
86
+ /**
87
+ * 二次确认方法,优先级高于配置, submitForm:要提交的表单; submitAction:提交吹; cancelAction: 取消提交处理
88
+ */
89
+ doubleConfirmAction?: (submitForm: UseHuiFormDialogForm, submitAction: (submitForm: UseHuiFormDialogForm) => void, cancelAction: () => void) => void;
90
+ }
@@ -0,0 +1,32 @@
1
+ import { UseHuiFormDialogForm, UseHuiFormDialogParams } from './type';
2
+ import { Ref } from 'vue';
3
+
4
+ /**
5
+ * 表单弹框通用逻辑
6
+ * 集成 el-dialog 组件 的hooks, props 透传到 el-dialog
7
+ * @param {*} UseHuiFormDialogParams
8
+ * @returns
9
+ * @example
10
+ * formDialogTest.value?.open()
11
+ * <FormDialogTest ref="formDialogTest" top="20vh" width="40vw" @open="beforeOpen" @close="beforeClose" />
12
+ */
13
+ export declare const useHuiFormDialog: ({ formModel, showSuccessTip, isNeedDoubleConfirm, doubleConfirmConfig, beforeSubmit, submitCheck, afterSubmit, doubleConfirmAction, put, post, permission, }: UseHuiFormDialogParams) => {
14
+ show: Ref<boolean, boolean>;
15
+ form: Ref<{
16
+ [x: string]: any;
17
+ id?: string | number;
18
+ }, UseHuiFormDialogForm | {
19
+ [x: string]: any;
20
+ id?: string | number;
21
+ }>;
22
+ formRef: Ref<any, any>;
23
+ formLoading: Ref<boolean, boolean>;
24
+ confirmLoading: Ref<boolean, boolean>;
25
+ open: (id?: string, defaultFormValue?: {}) => void;
26
+ close: () => void;
27
+ resetLoading: () => void;
28
+ resetFormFields: () => void;
29
+ handleSubmit: () => void;
30
+ handleCancel: () => void;
31
+ checkPermission: () => any;
32
+ };
@@ -0,0 +1,13 @@
1
+ import { App } from 'vue';
2
+ import { HuiOptions } from './install-helper/typescript';
3
+
4
+ export * from './utils/index';
5
+ export * from './hooks';
6
+ export * from './components';
7
+ export * from './directives';
8
+ export type { HuiDelegate } from './delegate';
9
+ export type { HuiOptions } from './install-helper/typescript';
10
+ declare const _default: {
11
+ install: (app: App<any>, opt?: HuiOptions) => void;
12
+ };
13
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { App, Plugin } from 'vue';
2
+ import { SFCWithInstall, HuiOptions } from './typescript';
3
+
4
+ /**
5
+ * hua5-web-ui install
6
+ * @param components
7
+ * @returns
8
+ */
9
+ export declare const makeInstaller: (components?: Plugin[]) => {
10
+ install: (app: App, opt?: HuiOptions) => void;
11
+ };
12
+ /**
13
+ * 来源于 element-plus 中, 给每个组件添加 install 方法
14
+ * @param main
15
+ * @param extra
16
+ * @returns
17
+ */
18
+ export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
@@ -0,0 +1,14 @@
1
+ import { HuiDelegate } from '../delegate';
2
+ import { AppContext, Plugin } from 'vue';
3
+
4
+ /**
5
+ * option选项
6
+ */
7
+ export type HuiOptions = {
8
+ isInstallComponents?: boolean;
9
+ delegate?: HuiDelegate;
10
+ };
11
+ export type SFCWithInstall<T> = T & Plugin;
12
+ export type SFCInstallWithContext<T> = SFCWithInstall<T> & {
13
+ _context: AppContext | null;
14
+ };
@@ -0,0 +1,80 @@
1
+ export declare const HuiRules: {
2
+ /**
3
+ * 校验必传
4
+ * @param {string} tips 错误提示
5
+ */
6
+ required: (tips?: string) => {
7
+ validator: (rule: any, value: any, callback: any) => any;
8
+ trigger: string;
9
+ };
10
+ /**
11
+ * 是否url
12
+ * @param {string} tips 错误提示
13
+ */
14
+ urlRule: (tips?: string) => {
15
+ validator: (rule: any, value: any, callback: any) => any;
16
+ trigger: string;
17
+ };
18
+ /**
19
+ * 是否版本号
20
+ * @param {string} tips 错误提示
21
+ */
22
+ versionRule: (tips?: string) => {
23
+ validator: (rule: any, value: any, callback: any) => any;
24
+ trigger: string;
25
+ };
26
+ /**
27
+ * 是否json
28
+ * @param {string} tips 错误提示
29
+ */
30
+ jsonRule: (tips?: string) => {
31
+ validator: (rule: any, value: any, callback: any) => any;
32
+ trigger: string;
33
+ };
34
+ /**
35
+ * 验证整数
36
+ * @param {boolean} isCanZero 是否能输0
37
+ * @param {boolean} isCanNegative 是否能输负数
38
+ */
39
+ intNumRule: (isCanZero?: boolean, isCanNegative?: boolean) => {
40
+ validator: (rule: any, value: any, callback: any) => any;
41
+ trigger: string;
42
+ };
43
+ /**
44
+ * 验证小数
45
+ * @param {number} digit 小数位数
46
+ * @param {boolean} isCanZero 是否能输0
47
+ * @param {boolean} isCanNegative 是否能输负数
48
+ */
49
+ digitNumRule: (digit?: number, isCanZero?: boolean, isCanNegative?: boolean) => {
50
+ validator: (rule: any, value: any, callback: any) => any;
51
+ trigger: string;
52
+ };
53
+ /**
54
+ * 验证码验证
55
+ * @param {string} tips 错误提示
56
+ * @param {number} codeLength 验证码长度
57
+ */
58
+ codeRule: (tips?: string, codeLength?: number) => {
59
+ validator: (rule: any, value: any, callback: any) => any;
60
+ trigger: string;
61
+ };
62
+ /**
63
+ * 电话号码验证
64
+ * @param {string} tips 错误提示
65
+ */
66
+ phoneNumRule: (tips?: string) => {
67
+ validator: (rule: any, value: any, callback: any) => any;
68
+ trigger: string;
69
+ };
70
+ /**
71
+ * 验证数字范围
72
+ * @param {number | string} min 最小值
73
+ * @param {number | string} max 最大值
74
+ * @param {string} tips 错误提示
75
+ */
76
+ numRangeRule: (min: any, max: any, tips?: string) => {
77
+ validator: (rule: any, value: any, callback: any) => any;
78
+ trigger: string;
79
+ };
80
+ };
@@ -0,0 +1,8 @@
1
+ import { PayLoadType } from './message-box';
2
+ export declare const HuiTool: {
3
+ ok: (msg: any) => void;
4
+ err: (msg: any) => void;
5
+ msgBox: (title: string, payLoad?: PayLoadType) => any;
6
+ msgBoxSuccess: (content: string, payload?: PayLoadType) => any;
7
+ msgBoxQues: (content: string, payload?: PayLoadType) => any;
8
+ };
@@ -0,0 +1,18 @@
1
+ export interface PayLoadType {
2
+ /** 弹窗提示文字内容· */
3
+ tip?: string;
4
+ /** 控制图标展示类型 info:叹号 success:钩 question:问号 */
5
+ iconType?: 'info' | 'success' | 'question';
6
+ /** 控制图标展示的颜色 */
7
+ type?: "info" | "success" | "danger" | "warning";
8
+ /** 取消按钮的文本 */
9
+ cancelText?: string;
10
+ /** 确定按钮的文本 */
11
+ confirmText?: string;
12
+ /** 弹窗宽度 */
13
+ width?: number;
14
+ /** 弹窗样式类名 */
15
+ className?: string;
16
+ }
17
+ export declare const hua5MsgBox: (title: string, payLoad?: PayLoadType) => Promise<unknown>;
18
+ export declare const msgBox: (title: string, payLoad?: PayLoadType) => any;
@@ -0,0 +1,36 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ export interface HuiMsgBoxProp {
3
+ /** 控制图标展示类型 info:叹号 success:钩 question:问号 */
4
+ iconType: 'info' | 'success' | 'question';
5
+ /** 控制图标展示的颜色 */
6
+ type: 'info' | 'warning' | 'success' | 'danger';
7
+ /** 弹窗显示的标题 */
8
+ title: string;
9
+ /** 弹窗显示的提示文本 */
10
+ tip: '';
11
+ /** 取消按钮的文本 */
12
+ cancelText: string;
13
+ /** 确定按钮的文本 */
14
+ confirmText: string;
15
+ /** 弹窗宽度 */
16
+ width: number;
17
+ /** 弹窗样式类名 */
18
+ className: string;
19
+ /** 关闭事件 */
20
+ closeBox: () => void;
21
+ /** 确定事件事件 */
22
+ confirmHandler: () => void;
23
+ /** 取消事件 */
24
+ cancelHandler: () => void;
25
+ }
26
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<HuiMsgBoxProp>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<HuiMsgBoxProp>>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
27
+ export default _default;
28
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
29
+ type __VLS_TypePropsToRuntimeProps<T> = {
30
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
31
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
32
+ } : {
33
+ type: PropType<T[K]>;
34
+ required: true;
35
+ };
36
+ };
@@ -0,0 +1,26 @@
1
+ import { PayLoadType } from './message-box/index.ts';
2
+
3
+ export declare const msgTool: {
4
+ /**
5
+ * 成功消息提示
6
+ * @param msg
7
+ */
8
+ ok: (msg: any) => void;
9
+ /**
10
+ * 成功消息提示
11
+ * @param msg
12
+ */
13
+ err: (msg: any) => void;
14
+ /**
15
+ * 二次确定弹窗
16
+ */
17
+ msgBox: (title: string, payLoad?: PayLoadType) => any;
18
+ /**
19
+ * 图标为钩的二次确定弹窗
20
+ */
21
+ msgBoxSuccess: (content: string, payload?: PayLoadType) => any;
22
+ /**
23
+ * 图标为问号的二次确定弹窗
24
+ */
25
+ msgBoxQues: (content: string, payload?: PayLoadType) => any;
26
+ };
@@ -0,0 +1,2 @@
1
+ export * from './hui-tool/index';
2
+ export * from './hui-rules';