yuang-framework-ui-pc 1.1.42 → 1.1.43

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 (226) hide show
  1. package/es/utils/chart-theme-dark.d.ts +373 -0
  2. package/es/utils/chart-theme-dark.js +397 -0
  3. package/es/utils/chart-theme.d.ts +368 -0
  4. package/es/utils/chart-theme.js +392 -0
  5. package/es/utils/menu-util.d.ts +14 -0
  6. package/es/utils/menu-util.js +78 -0
  7. package/es/utils/message-box.d.ts +25 -0
  8. package/es/utils/message-box.js +98 -0
  9. package/es/utils/message.d.ts +66 -0
  10. package/es/utils/message.js +267 -0
  11. package/es/utils/resolvers.d.ts +18 -0
  12. package/es/utils/resolvers.js +50 -0
  13. package/es/utils/theme-util.d.ts +6 -0
  14. package/es/utils/theme-util.js +42 -0
  15. package/es/utils/validate.d.ts +182 -0
  16. package/es/utils/validate.js +197 -0
  17. package/lib/core.d.ts +3 -0
  18. package/lib/ele-admin-layout/components/layout-tabs.d.ts +5646 -0
  19. package/lib/ele-admin-layout/components/layout-tool.d.ts +2 -0
  20. package/lib/ele-admin-layout/style/index.d.ts +1 -0
  21. package/lib/ele-admin-layout/types.d.ts +54 -0
  22. package/lib/ele-alert/index.d.ts +131 -0
  23. package/lib/ele-alert/props.d.ts +58 -0
  24. package/lib/ele-app/el.d.ts +304 -0
  25. package/lib/ele-app/style/common/index.d.ts +1 -0
  26. package/lib/ele-app/style/overwrite/backtop/index.d.ts +1 -0
  27. package/lib/ele-app/style/overwrite/checkbox/index.d.ts +1 -0
  28. package/lib/ele-app/style/overwrite/date-picker/index.d.ts +1 -0
  29. package/lib/ele-app/style/overwrite/message-box/index.d.ts +1 -0
  30. package/lib/ele-app/style/overwrite/popper/index.d.ts +1 -0
  31. package/lib/ele-app/style/overwrite/select/index.d.ts +1 -0
  32. package/lib/ele-app/style/overwrite/tag/index.d.ts +1 -0
  33. package/lib/ele-app/style/overwrite/tree/index.d.ts +1 -0
  34. package/lib/ele-app/style/scrollbar/index.d.ts +1 -0
  35. package/lib/ele-app/types.d.ts +48 -0
  36. package/lib/ele-avatar-group/props.d.ts +56 -0
  37. package/lib/ele-avatar-group/style/index.d.ts +1 -0
  38. package/lib/ele-avatar-group/types.d.ts +21 -0
  39. package/lib/ele-backtop/props.d.ts +36 -0
  40. package/lib/ele-bar-code/index.d.ts +26 -0
  41. package/lib/ele-bottom-bar/index.d.ts +15 -0
  42. package/lib/ele-bottom-bar/props.d.ts +15 -0
  43. package/lib/ele-breadcrumb/index.d.ts +278 -0
  44. package/lib/ele-breadcrumb/props.d.ts +24 -0
  45. package/lib/ele-breadcrumb/style/index.d.ts +1 -0
  46. package/lib/ele-card/index.d.ts +106 -0
  47. package/lib/ele-card/style/index.d.ts +1 -0
  48. package/lib/ele-check-card/components/card-item.d.ts +37 -0
  49. package/lib/ele-check-card/props.d.ts +49 -0
  50. package/lib/ele-check-card/style/index.d.ts +1 -0
  51. package/lib/ele-check-card/types.d.ts +37 -0
  52. package/lib/ele-config-provider/components/receiver-view.d.ts +71 -0
  53. package/lib/ele-config-provider/props.d.ts +26 -0
  54. package/lib/ele-config-provider/style/index.d.ts +0 -0
  55. package/lib/ele-config-provider/types.d.ts +103 -0
  56. package/lib/ele-copyable/style/index.d.ts +1 -0
  57. package/lib/ele-copyable/types.d.ts +14 -0
  58. package/lib/ele-count-up/style/index.d.ts +0 -0
  59. package/lib/ele-cropper/index.d.ts +2824 -0
  60. package/lib/ele-cropper/props.d.ts +68 -0
  61. package/lib/ele-cropper/style/index.d.ts +1 -0
  62. package/lib/ele-cropper-modal/props.d.ts +58 -0
  63. package/lib/ele-cropper-modal/style/index.d.ts +1 -0
  64. package/lib/ele-dashboard/index.d.ts +14 -0
  65. package/lib/ele-dashboard/style/index.d.ts +1 -0
  66. package/lib/ele-dashboard/types.d.ts +4 -0
  67. package/lib/ele-data-table/props.d.ts +272 -0
  68. package/lib/ele-data-table/style/index.d.ts +1 -0
  69. package/lib/ele-data-table/types.d.ts +253 -0
  70. package/lib/ele-data-table/util.d.ts +172 -0
  71. package/lib/ele-dialog/index.d.ts +1074 -0
  72. package/lib/ele-dialog/style/index.d.ts +1 -0
  73. package/lib/ele-dialog/util.d.ts +52 -0
  74. package/lib/ele-dot/index.d.ts +29 -0
  75. package/lib/ele-dot/props.d.ts +25 -0
  76. package/lib/ele-dot/style/index.d.ts +1 -0
  77. package/lib/ele-drawer/index.d.ts +1170 -0
  78. package/lib/ele-drawer/props.d.ts +184 -0
  79. package/lib/ele-drawer/style/index.d.ts +1 -0
  80. package/lib/ele-dropdown/components/dropdown-menu-item.d.ts +97 -0
  81. package/lib/ele-dropdown/index.d.ts +4846 -0
  82. package/lib/ele-dropdown/types.d.ts +22 -0
  83. package/lib/ele-edit-tag/props.d.ts +55 -0
  84. package/lib/ele-edit-tag/style/index.d.ts +1 -0
  85. package/lib/ele-edit-tag/types.d.ts +9 -0
  86. package/lib/ele-ellipsis/index.d.ts +1660 -0
  87. package/lib/ele-icon-select/types.d.ts +16 -0
  88. package/lib/ele-image-viewer/index.d.ts +635 -0
  89. package/lib/ele-loading/props.d.ts +33 -0
  90. package/lib/ele-loading/types.d.ts +19 -0
  91. package/lib/ele-map-picker/style/index.d.ts +1 -0
  92. package/lib/ele-menus/components/item-title.d.ts +323 -0
  93. package/lib/ele-menus/types.d.ts +107 -0
  94. package/lib/ele-pagination/style/index.d.ts +1 -0
  95. package/lib/ele-pagination/types.d.ts +9 -0
  96. package/lib/ele-printer/index.d.ts +111 -0
  97. package/lib/ele-printer/util.d.ts +25 -0
  98. package/lib/ele-pro-layout/components/pro-iframe.d.ts +39 -0
  99. package/lib/ele-pro-layout/style/index.d.ts +1 -0
  100. package/lib/ele-pro-layout/util.d.ts +88 -0
  101. package/lib/ele-pro-table/components/tool-column.d.ts +3722 -0
  102. package/lib/ele-pro-table/components/tool-print-header-cell.d.ts +39 -0
  103. package/lib/ele-pro-table/style/index.d.ts +1 -0
  104. package/lib/ele-pro-table/types.d.ts +489 -0
  105. package/lib/ele-qr-code/components/canvas-render.d.ts +67 -0
  106. package/lib/ele-qr-code/qrcodegen.d.ts +95 -0
  107. package/lib/ele-qr-code/style/index.d.ts +0 -0
  108. package/lib/ele-qr-code/util.d.ts +27 -0
  109. package/lib/ele-segmented/index.d.ts +485 -0
  110. package/lib/ele-segmented/style/index.d.ts +1 -0
  111. package/lib/ele-split-panel/index.d.ts +192 -0
  112. package/lib/ele-split-panel/props.d.ts +47 -0
  113. package/lib/ele-steps/index.d.ts +638 -0
  114. package/lib/ele-steps/style/index.d.ts +1 -0
  115. package/lib/ele-steps/types.d.ts +14 -0
  116. package/lib/ele-tab-tool/index.d.ts +75 -0
  117. package/lib/ele-tab-tool/props.d.ts +14 -0
  118. package/lib/ele-tab-wrap/components/tab-dropdown.d.ts +5006 -0
  119. package/lib/ele-tab-wrap/props.d.ts +13 -0
  120. package/lib/ele-tab-wrap/style/index.d.ts +0 -0
  121. package/lib/ele-table/index.d.ts +28 -0
  122. package/lib/ele-table/style/index.d.ts +1 -0
  123. package/lib/ele-table-select/props.d.ts +120 -0
  124. package/lib/ele-table-select/style/index.d.ts +1 -0
  125. package/lib/ele-tabs/props.d.ts +88 -0
  126. package/lib/ele-test/index.d.ts +2 -0
  127. package/lib/ele-test/style/index.d.ts +1 -0
  128. package/lib/ele-text/index.d.ts +93 -0
  129. package/lib/ele-text/style/index.d.ts +1 -0
  130. package/lib/ele-text/types.d.ts +35 -0
  131. package/lib/ele-toolbar/index.d.ts +1633 -0
  132. package/lib/ele-tooltip/props.d.ts +187 -0
  133. package/lib/ele-tooltip/style/index.d.ts +1 -0
  134. package/lib/ele-tour/types.d.ts +42 -0
  135. package/lib/ele-tour/util.d.ts +20 -0
  136. package/lib/ele-tree-select/style/index.d.ts +1 -0
  137. package/lib/ele-upload-list/components/list-item.d.ts +902 -0
  138. package/lib/ele-upload-list/props.d.ts +81 -0
  139. package/lib/ele-upload-list/types.d.ts +71 -0
  140. package/lib/ele-virtual-table/components/body-row.d.ts +984 -0
  141. package/lib/ele-virtual-table/components/expand-row.d.ts +19 -0
  142. package/lib/ele-virtual-table/components/footer-row.d.ts +65 -0
  143. package/lib/ele-virtual-table/components/header-cell.d.ts +3929 -0
  144. package/lib/ele-virtual-table/index.d.ts +7882 -0
  145. package/lib/ele-virtual-table/util.d.ts +229 -0
  146. package/lib/ele-watermark/index.d.ts +57 -0
  147. package/lib/ele-watermark/types.d.ts +39 -0
  148. package/lib/ele-xg-player/index.d.ts +22 -0
  149. package/lib/ele-xg-player/style/index.d.ts +1 -0
  150. package/lib/icons/AppstoreAddOutlined.d.ts +2 -0
  151. package/lib/icons/AppstoreOutlined.d.ts +2 -0
  152. package/lib/icons/ArrowLeft.d.ts +2 -0
  153. package/lib/icons/ArrowLeftOutlined.d.ts +2 -0
  154. package/lib/icons/ArrowRight.d.ts +2 -0
  155. package/lib/icons/ArrowRightOutlined.d.ts +2 -0
  156. package/lib/icons/ArrowUp.d.ts +2 -0
  157. package/lib/icons/ArrowUpOutlined.d.ts +2 -0
  158. package/lib/icons/BellOutlined.d.ts +2 -0
  159. package/lib/icons/BookOutlined.d.ts +2 -0
  160. package/lib/icons/CaretDownFilled.d.ts +2 -0
  161. package/lib/icons/CaretUpFilled.d.ts +2 -0
  162. package/lib/icons/CheckOutlined.d.ts +2 -0
  163. package/lib/icons/ClockCircleOutlined.d.ts +2 -0
  164. package/lib/icons/CloudUploadOutlined.d.ts +2 -0
  165. package/lib/icons/ClusterOutlined.d.ts +2 -0
  166. package/lib/icons/CodeOutlined.d.ts +2 -0
  167. package/lib/icons/CompassOutlined.d.ts +2 -0
  168. package/lib/icons/ConnectionOutlined.d.ts +2 -0
  169. package/lib/icons/ControlOutlined.d.ts +2 -0
  170. package/lib/icons/CornerRightFilled.d.ts +2 -0
  171. package/lib/icons/DashboardOutlined.d.ts +2 -0
  172. package/lib/icons/DesktopOutlined.d.ts +2 -0
  173. package/lib/icons/DragOutlined.d.ts +2 -0
  174. package/lib/icons/EditOutlined.d.ts +2 -0
  175. package/lib/icons/EnvironmentOutlined.d.ts +2 -0
  176. package/lib/icons/FileOutlined.d.ts +2 -0
  177. package/lib/icons/FilterFilled.d.ts +2 -0
  178. package/lib/icons/GlobalOutlined.d.ts +2 -0
  179. package/lib/icons/HomeOutlined.d.ts +2 -0
  180. package/lib/icons/LoadingDotOutlined.d.ts +2 -0
  181. package/lib/icons/LoadingOutlined.d.ts +2 -0
  182. package/lib/icons/LockOutlined.d.ts +2 -0
  183. package/lib/icons/LogOutlined.d.ts +2 -0
  184. package/lib/icons/MailOutlined.d.ts +2 -0
  185. package/lib/icons/MenuFoldOutlined.d.ts +2 -0
  186. package/lib/icons/MenuOutlined.d.ts +2 -0
  187. package/lib/icons/MenuUnfoldOutlined.d.ts +2 -0
  188. package/lib/icons/MessageOutlined.d.ts +2 -0
  189. package/lib/icons/MinusCircleOutlined.d.ts +2 -0
  190. package/lib/icons/MoonOutlined.d.ts +2 -0
  191. package/lib/icons/MoreOutlined.d.ts +2 -0
  192. package/lib/icons/PauseFilled.d.ts +2 -0
  193. package/lib/icons/PieChartOutlined.d.ts +2 -0
  194. package/lib/icons/PlusOutlined.d.ts +2 -0
  195. package/lib/icons/ProtectOutlined.d.ts +2 -0
  196. package/lib/icons/QuestionCircleOutlined.d.ts +2 -0
  197. package/lib/icons/ReloadOutlined.d.ts +2 -0
  198. package/lib/icons/SortOutlined.d.ts +2 -0
  199. package/lib/icons/StarFilled.d.ts +2 -0
  200. package/lib/icons/StepForwardFilled.d.ts +2 -0
  201. package/lib/icons/UndoOutlined.d.ts +2 -0
  202. package/lib/icons/UnlockOutlined.d.ts +2 -0
  203. package/lib/icons/VerticalLeftOutlined.d.ts +2 -0
  204. package/lib/icons/WarningOutlined.d.ts +2 -0
  205. package/lib/icons/ZoomOutOutlined.d.ts +2 -0
  206. package/lib/index.d.ts +4 -0
  207. package/lib/installer.d.ts +3 -0
  208. package/lib/lang/en_US.d.ts +4 -0
  209. package/lib/lang/zh_CN.d.ts +4 -0
  210. package/lib/utils/chart-theme-dark.d.ts +373 -0
  211. package/lib/utils/chart-theme.d.ts +368 -0
  212. package/lib/utils/core.cjs +318 -0
  213. package/lib/utils/core.d.ts +168 -0
  214. package/lib/utils/hook.cjs +264 -0
  215. package/lib/utils/hook.d.ts +113 -0
  216. package/lib/utils/menu-util.d.ts +14 -0
  217. package/lib/utils/message-box.d.ts +25 -0
  218. package/lib/utils/message.d.ts +66 -0
  219. package/lib/utils/resolvers.cjs +50 -0
  220. package/lib/utils/resolvers.d.ts +18 -0
  221. package/lib/utils/theme-util.d.ts +6 -0
  222. package/lib/utils/validate.cjs +197 -0
  223. package/lib/utils/validate.d.ts +182 -0
  224. package/lib/yu-framework-slider-captcha-dialog/SliderCaptcha.d.ts +67 -0
  225. package/lib/yu-framework-slider-captcha-dialog/index.d.ts +14 -0
  226. package/package.json +1 -1
@@ -0,0 +1,168 @@
1
+ import { Mutable } from '../ele-app/types';
2
+
3
+ /**
4
+ * toTree 方法参数
5
+ */
6
+ export interface ToTreeOption<T> {
7
+ /** 数据 */
8
+ data?: T[] | null;
9
+ /** id 字段名称 */
10
+ idField?: string | null;
11
+ /** parentId 字段名称 */
12
+ parentIdField?: string | null;
13
+ /** 生成的 children 字段名称 */
14
+ childrenField?: string | null;
15
+ /** 最顶级的 parentId 值 */
16
+ parentId?: number | string | (number | string)[] | null;
17
+ /** 是否添加包含所有父级 id 的字段 */
18
+ addParentIds?: boolean | null;
19
+ /** 包含所有父级 id 字段的名称 */
20
+ parentIdsField?: string | null;
21
+ /** 所有父级的 id */
22
+ parentIds?: (number | string)[] | null;
23
+ }
24
+ /**
25
+ * parentId 形式数据转 children 形式
26
+ * @param option ToTreeOption
27
+ */
28
+ export declare function toTree<T>(option: ToTreeOption<T>): T[];
29
+ /**
30
+ * 遍历 children 形式数据
31
+ * @param data 数据
32
+ * @param callback 回调
33
+ * @param childrenField children 字段名
34
+ * @param parent 当前的父级
35
+ */
36
+ export declare function eachTree<T>(data?: T[], callback?: (item: T, index: number, parent?: T) => void | boolean, childrenField?: string, parent?: T): void;
37
+ /**
38
+ * 格式化 children 形式数据
39
+ * @param data 数据
40
+ * @param formatter 格式器
41
+ * @param childrenField children 字段名
42
+ * @param resultChildrenField 返回后的 children 字段名
43
+ * @param parent 当前的父级
44
+ */
45
+ export declare function mapTree<T, K>(data: T[] | undefined | null, formatter: (item: T, index?: number, parent?: K) => K | void | undefined, childrenField?: string, resultChildrenField?: string, parent?: K): K[];
46
+ /**
47
+ * 查找树形数据
48
+ * @param data 数据
49
+ * @param predicate 查找条件
50
+ * @param childrenField children 字段名
51
+ */
52
+ export declare function findTree<T>(data: T[] | undefined, predicate: (value: T, index: number) => unknown, childrenField?: string): T | undefined;
53
+ /**
54
+ * 生成 m 到 n 的随机数
55
+ * @param m 最小值(包含)
56
+ * @param n 最大值(不包含)
57
+ */
58
+ export declare function random(m: number, n: number): number;
59
+ /**
60
+ * 生成随机字符串
61
+ * @param length 长度
62
+ * @param radix 基数
63
+ */
64
+ export declare function uuid(length?: number, radix?: number): string;
65
+ /**
66
+ * 数字千分位
67
+ * @param num 数字
68
+ */
69
+ export declare function formatNumber(num?: number | null): string;
70
+ /**
71
+ * 赋值不改变原字段
72
+ * @param target 目标对象
73
+ * @param source 源对象
74
+ * @param excludes 排除的字段
75
+ */
76
+ export declare function assignObject<T extends {}, K extends {}>(target: T, source: K, excludes?: string[]): T;
77
+ /**
78
+ * 判断是否是外链
79
+ * @param url 地址
80
+ */
81
+ export declare function isExternalLink(url?: string | null): boolean;
82
+ /**
83
+ * 查找直接子元素
84
+ * @param parentEl 父元素
85
+ * @param className 类名
86
+ * @param attr 属性
87
+ */
88
+ export declare function queryChild(parentEl?: Element, className?: string, attr?: string[]): Element | undefined;
89
+ /**
90
+ * 获取节点样式
91
+ * @param el 节点
92
+ */
93
+ export declare function getCurrentStyle(el: Element): CSSStyleDeclaration;
94
+ /**
95
+ * 判断元素内容是否溢出省略
96
+ * @param el 元素节点
97
+ * @param direction 只判断单个方向是否溢出
98
+ */
99
+ export declare function contentIsEllipsis(el: HTMLElement, direction?: 'horizontal' | 'vertical'): boolean;
100
+ /**
101
+ * 检查是否全屏
102
+ */
103
+ export declare function checkFullscreen(): boolean;
104
+ /**
105
+ * 退出全屏
106
+ */
107
+ export declare function exitFullscreen(): void;
108
+ /**
109
+ * 全屏
110
+ * @param el HTMLElement
111
+ */
112
+ export declare function requestFullscreen(el?: HTMLElement): void;
113
+ /**
114
+ * 经纬度坐标
115
+ */
116
+ export interface Point {
117
+ /** 经度 */
118
+ lng: number;
119
+ /** 纬度 */
120
+ lat: number;
121
+ }
122
+ /**
123
+ * 百度地图坐标转高德地图坐标
124
+ * @param point 坐标
125
+ */
126
+ export declare function bd09ToGcj02(point: Point): Point;
127
+ /**
128
+ * 高德地图坐标转百度地图坐标
129
+ * @param point 坐标
130
+ */
131
+ export declare function gcj02ToBd09(point: Point): Point;
132
+ /**
133
+ * 复制字符串
134
+ * @param text 字符串
135
+ */
136
+ export declare function copyText(text: string): Promise<undefined>;
137
+ /**
138
+ * 根据字段路径获取值
139
+ * @param data 数据
140
+ * @param path 字段路径
141
+ * @param defaultValue 默认值
142
+ */
143
+ export declare function getValue<T, K>(data?: K | null, path?: string | string[] | ((d: K) => T), defaultValue?: T): T | undefined;
144
+ /**
145
+ * 防抖函数
146
+ * @param func 函数
147
+ * @param wait 等待时间
148
+ */
149
+ export declare function debounce<T extends (...args: any) => any>(func: T, wait: number): (this: any) => void;
150
+ /**
151
+ * 节流函数
152
+ * @param func 函数
153
+ * @param wait 等待时间
154
+ * @param trailing 是否在节流结束后调用
155
+ */
156
+ export declare function throttle<T extends (...args: any) => any>(func: T, wait: number, trailing?: boolean): (this: any) => void;
157
+ /**
158
+ * 忽略对象属性
159
+ * @param obj 来源对象
160
+ * @param fields 忽略的属性
161
+ */
162
+ export declare function omit<T extends {}, K extends keyof T>(obj: T | null | undefined, fields: K[]): Mutable<Omit<T, K>>;
163
+ /**
164
+ * 摘选对象属性
165
+ * @param obj 来源对象
166
+ * @param fields 摘选的属性
167
+ */
168
+ export declare function pick<T extends object, K extends keyof T>(obj: T, fields: K[]): Mutable<Pick<T, K>>;
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ function useTimer(ms, cb) {
5
+ let timer = null;
6
+ const waiting = vue.ref(false);
7
+ const stopTimer = () => {
8
+ if (timer != null) {
9
+ clearTimeout(timer);
10
+ timer = null;
11
+ }
12
+ waiting.value = false;
13
+ };
14
+ const startTimer = (callback, timeout) => {
15
+ stopTimer();
16
+ waiting.value = true;
17
+ const to = timeout ?? (typeof ms === "function" ? ms() : ms);
18
+ timer = setTimeout(() => {
19
+ const func = callback ?? cb;
20
+ func && func();
21
+ waiting.value = false;
22
+ }, to);
23
+ };
24
+ vue.onBeforeUnmount(() => {
25
+ stopTimer();
26
+ });
27
+ return [startTimer, stopTimer, waiting];
28
+ }
29
+ function useMediaQuery(query, onChange) {
30
+ const mediaQuery = window.matchMedia(query);
31
+ const handleChange = () => {
32
+ onChange && onChange();
33
+ };
34
+ const startWatch = () => {
35
+ stopWatch();
36
+ mediaQuery.addEventListener("change", handleChange);
37
+ };
38
+ const stopWatch = () => {
39
+ mediaQuery.removeEventListener("change", handleChange);
40
+ handleChange();
41
+ };
42
+ vue.onBeforeUnmount(() => {
43
+ stopWatch();
44
+ });
45
+ return [mediaQuery, startWatch, stopWatch];
46
+ }
47
+ function useWindowListener(event, listener) {
48
+ const eventName = typeof event === "string" ? event : "resize";
49
+ const callback = typeof event === "function" ? event : listener;
50
+ if (callback != null) {
51
+ window.addEventListener(eventName, callback);
52
+ }
53
+ vue.onBeforeUnmount(() => {
54
+ if (callback != null) {
55
+ window.removeEventListener(eventName, callback);
56
+ }
57
+ });
58
+ }
59
+ function useCollapseAnim() {
60
+ let enterHeight = 0;
61
+ const getHeight = (el, isEnter) => {
62
+ if (!isEnter) {
63
+ return Math.max(el.offsetHeight, el.scrollHeight);
64
+ }
65
+ return Math.max(el.offsetHeight, el.scrollHeight, enterHeight);
66
+ };
67
+ const handleBeforeEnter = (el) => {
68
+ el.dataset.oldPaddingTop = el.style.paddingTop;
69
+ el.dataset.oldPaddingBottom = el.style.paddingBottom;
70
+ el.style.maxHeight = "0px";
71
+ el.style.paddingTop = "0px";
72
+ el.style.paddingBottom = "0px";
73
+ };
74
+ const handleEnter = (el) => {
75
+ el.dataset.oldOverflow = el.style.overflow;
76
+ el.style.maxHeight = `${getHeight(el, true)}px`;
77
+ el.style.paddingTop = el.dataset.oldPaddingTop ?? "";
78
+ el.style.paddingBottom = el.dataset.oldPaddingBottom ?? "";
79
+ el.style.overflow = "hidden";
80
+ };
81
+ const handleAfterEnter = (el) => {
82
+ el.style.maxHeight = "";
83
+ el.style.overflow = el.dataset.oldOverflow ?? "";
84
+ };
85
+ const handleBeforeLeave = (el) => {
86
+ el.dataset.oldPaddingTop = el.style.paddingTop;
87
+ el.dataset.oldPaddingBottom = el.style.paddingBottom;
88
+ el.dataset.oldOverflow = el.style.overflow;
89
+ enterHeight = getHeight(el);
90
+ el.style.maxHeight = `${enterHeight}px`;
91
+ el.style.overflow = "hidden";
92
+ };
93
+ const handleLeave = (el) => {
94
+ el.style.maxHeight = "0px";
95
+ el.style.paddingTop = "0px";
96
+ el.style.paddingBottom = "0px";
97
+ };
98
+ const handleAfterLeave = (el) => {
99
+ el.style.maxHeight = "";
100
+ el.style.overflow = el.dataset.oldOverflow ?? "";
101
+ el.style.paddingTop = el.dataset.oldPaddingTop ?? "";
102
+ el.style.paddingBottom = el.dataset.oldPaddingBottom ?? "";
103
+ };
104
+ return {
105
+ handleBeforeEnter,
106
+ handleEnter,
107
+ handleAfterEnter,
108
+ handleBeforeLeave,
109
+ handleLeave,
110
+ handleAfterLeave
111
+ };
112
+ }
113
+ function useMousewheel(cb) {
114
+ const handleMousewheel = (e) => {
115
+ const delta = e.wheelDelta || e.detail;
116
+ cb && cb({ e, direction: delta > 0 ? "up" : "down" });
117
+ };
118
+ const handleFirefoxMousewheel = (e) => {
119
+ const delta = e.wheelDelta || e.detail;
120
+ cb && cb({ e, direction: delta < 0 ? "up" : "down" });
121
+ };
122
+ const bindMousewheel = (el) => {
123
+ el.addEventListener("mousewheel", handleMousewheel, { passive: false });
124
+ el.addEventListener("DOMMouseScroll", handleFirefoxMousewheel);
125
+ };
126
+ const unbindMousewheel = (el) => {
127
+ el.removeEventListener("mousewheel", handleMousewheel);
128
+ el.removeEventListener("DOMMouseScroll", handleFirefoxMousewheel);
129
+ };
130
+ return {
131
+ handleMousewheel,
132
+ handleFirefoxMousewheel,
133
+ bindMousewheel,
134
+ unbindMousewheel
135
+ };
136
+ }
137
+ function useTouchEvent(option) {
138
+ let startX = null;
139
+ let startY = null;
140
+ let distanceX = null;
141
+ let distanceY = null;
142
+ const handleTouchStart = (e) => {
143
+ startX = e.touches[0].clientX;
144
+ startY = e.touches[0].clientY;
145
+ if (option && option.start) {
146
+ option.start({ e, startX, startY });
147
+ }
148
+ };
149
+ const handleTouchMove = (e) => {
150
+ if (startX != null && startY != null) {
151
+ const currentX = e.touches[0].clientX;
152
+ const currentY = e.touches[0].clientY;
153
+ distanceX = currentX - startX;
154
+ distanceY = currentY - startY;
155
+ if (option && option.move) {
156
+ option.move({ e, startX, startY, distanceX, distanceY });
157
+ }
158
+ }
159
+ };
160
+ const handleTouchEnd = (e) => {
161
+ if (option && option.end) {
162
+ option.end({ e, startX, startY, distanceX, distanceY });
163
+ }
164
+ startX = null;
165
+ startY = null;
166
+ distanceX = null;
167
+ distanceY = null;
168
+ };
169
+ const bindTouchEvent = (el) => {
170
+ el.addEventListener("touchstart", handleTouchStart);
171
+ el.addEventListener("touchmove", handleTouchMove);
172
+ el.addEventListener("touchend", handleTouchEnd);
173
+ };
174
+ const unbindTouchEvent = (el) => {
175
+ el.removeEventListener("touchstart", handleTouchStart);
176
+ el.removeEventListener("touchmove", handleTouchMove);
177
+ el.removeEventListener("touchend", handleTouchEnd);
178
+ };
179
+ return {
180
+ handleTouchStart,
181
+ handleTouchMove,
182
+ handleTouchEnd,
183
+ bindTouchEvent,
184
+ unbindTouchEvent
185
+ };
186
+ }
187
+ function useMoveEvent(option) {
188
+ let startX = null;
189
+ let startY = null;
190
+ let distanceX = null;
191
+ let distanceY = null;
192
+ const unbindEvent = () => {
193
+ document.removeEventListener("mousemove", mousemoveFn);
194
+ document.removeEventListener("mouseup", mouseupFn);
195
+ document.removeEventListener("touchmove", touchmoveFn);
196
+ document.removeEventListener("touchend", touchendFn);
197
+ };
198
+ const emitStart = (clientX, clientY, e) => {
199
+ startX = clientX;
200
+ startY = clientY;
201
+ if (option && option.start) {
202
+ option.start({ e, startX, startY });
203
+ }
204
+ };
205
+ const emitMove = (currentX, currentY, e) => {
206
+ if (startX != null && startY != null) {
207
+ distanceX = currentX - startX;
208
+ distanceY = currentY - startY;
209
+ if (option && option.move) {
210
+ option.move({ e, startX, startY, distanceX, distanceY });
211
+ }
212
+ }
213
+ };
214
+ const emitEnd = (e) => {
215
+ unbindEvent();
216
+ if (option && option.end) {
217
+ option.end({ e, startX, startY, distanceX, distanceY });
218
+ }
219
+ startX = null;
220
+ startY = null;
221
+ distanceX = null;
222
+ distanceY = null;
223
+ };
224
+ const mousemoveFn = function(e) {
225
+ emitMove(e.clientX, e.clientY, e);
226
+ };
227
+ const touchmoveFn = function(e) {
228
+ emitMove(e.touches[0].clientX, e.touches[0].clientY, e);
229
+ };
230
+ const mouseupFn = (e) => {
231
+ emitEnd(e);
232
+ };
233
+ const touchendFn = (e) => {
234
+ emitEnd(e);
235
+ };
236
+ const handleMousedown = (e) => {
237
+ emitStart(e.clientX, e.clientY, e);
238
+ document.addEventListener("mousemove", mousemoveFn);
239
+ document.addEventListener("mouseup", mouseupFn);
240
+ };
241
+ const handleTouchstart = (e) => {
242
+ emitStart(e.touches[0].clientX, e.touches[0].clientY, e);
243
+ document.addEventListener(
244
+ "touchmove",
245
+ touchmoveFn,
246
+ option == null ? void 0 : option.touchmoveOptions
247
+ );
248
+ document.addEventListener("touchend", touchendFn);
249
+ };
250
+ vue.onBeforeUnmount(() => {
251
+ unbindEvent();
252
+ });
253
+ return {
254
+ handleMousedown,
255
+ handleTouchstart
256
+ };
257
+ }
258
+ exports.useCollapseAnim = useCollapseAnim;
259
+ exports.useMediaQuery = useMediaQuery;
260
+ exports.useMousewheel = useMousewheel;
261
+ exports.useMoveEvent = useMoveEvent;
262
+ exports.useTimer = useTimer;
263
+ exports.useTouchEvent = useTouchEvent;
264
+ exports.useWindowListener = useWindowListener;
@@ -0,0 +1,113 @@
1
+ import { Ref } from 'vue';
2
+
3
+ /**
4
+ * useTimer 返回结果
5
+ */
6
+ export type UseTimerResult = [
7
+ (callback?: () => void, timeout?: number) => void,
8
+ () => void,
9
+ Ref<boolean>
10
+ ];
11
+ /**
12
+ * 定时器
13
+ * @param ms 等待时间
14
+ * @param cb 执行方法
15
+ */
16
+ export declare function useTimer(ms?: number | (() => number), cb?: () => void): UseTimerResult;
17
+ /**
18
+ * useMediaQuery 返回结果
19
+ */
20
+ export type UseMediaQueryResult = [MediaQueryList, () => void, () => void];
21
+ /**
22
+ * 媒体查询
23
+ * @param query 媒体查询字符串
24
+ * @param onChange 改变回调
25
+ */
26
+ export declare function useMediaQuery(query: string, onChange?: () => void): UseMediaQueryResult;
27
+ /**
28
+ * 窗口事件监听
29
+ * @param event 事件
30
+ * @param listener 回调
31
+ */
32
+ export declare function useWindowListener(event: string | EventListenerOrEventListenerObject, listener?: EventListenerOrEventListenerObject): void;
33
+ /**
34
+ * 折叠展开动画
35
+ */
36
+ export declare function useCollapseAnim(): {
37
+ handleBeforeEnter: (el: HTMLElement) => void;
38
+ handleEnter: (el: HTMLElement) => void;
39
+ handleAfterEnter: (el: HTMLElement) => void;
40
+ handleBeforeLeave: (el: HTMLElement) => void;
41
+ handleLeave: (el: HTMLElement) => void;
42
+ handleAfterLeave: (el: HTMLElement) => void;
43
+ };
44
+ /**
45
+ * 鼠标滚轮事件回调方法参数
46
+ */
47
+ export interface UseMousewheelCallbackParam {
48
+ /** 事件对象 */
49
+ e: MouseEvent;
50
+ /** 方向 */
51
+ direction: 'up' | 'down';
52
+ }
53
+ /**
54
+ * 鼠标滚轮事件
55
+ * @param cb 回调
56
+ */
57
+ export declare function useMousewheel(cb?: (p: UseMousewheelCallbackParam) => void): {
58
+ handleMousewheel: (e: MouseEvent) => void;
59
+ handleFirefoxMousewheel: (e: MouseEvent) => void;
60
+ bindMousewheel: (el: HTMLElement) => void;
61
+ unbindMousewheel: (el: HTMLElement) => void;
62
+ };
63
+ /**
64
+ * 触摸事件回调参数
65
+ */
66
+ export interface UseTouchEventCallbackParam<T> {
67
+ /** 事件对象 */
68
+ e: T;
69
+ /** 开始横向位置 */
70
+ startX: number | null;
71
+ /** 开始纵向位置 */
72
+ startY: number | null;
73
+ /** 横向移动距离 */
74
+ distanceX?: number | null;
75
+ /** 纵向移动距离 */
76
+ distanceY?: number | null;
77
+ }
78
+ /**
79
+ * 触摸事件参数
80
+ */
81
+ export interface UseTouchEventOption<T> {
82
+ /** 触摸开始的回调 */
83
+ start?: (param: UseTouchEventCallbackParam<T>) => void;
84
+ /** 触摸移动的回调 */
85
+ move?: (param: UseTouchEventCallbackParam<T>) => void;
86
+ /** 触摸结束的回调 */
87
+ end?: (param: UseTouchEventCallbackParam<T>) => void;
88
+ /** touchmove 事件参数 */
89
+ touchmoveOptions?: any;
90
+ }
91
+ /**
92
+ * 触摸事件
93
+ * @param option 参数
94
+ */
95
+ export declare function useTouchEvent(option?: UseTouchEventOption<TouchEvent>): {
96
+ handleTouchStart: (e: TouchEvent) => void;
97
+ handleTouchMove: (e: TouchEvent) => void;
98
+ handleTouchEnd: (e: TouchEvent) => void;
99
+ bindTouchEvent: (el: HTMLElement) => void;
100
+ unbindTouchEvent: (el: HTMLElement) => void;
101
+ };
102
+ /**
103
+ * 移动事件对象
104
+ */
105
+ export type MoveEvent = MouseEvent | TouchEvent;
106
+ /**
107
+ * 鼠标移动事件或触摸移动事件
108
+ * @param option 参数
109
+ */
110
+ export declare function useMoveEvent(option?: UseTouchEventOption<MoveEvent>): {
111
+ handleMousedown: (e: MouseEvent) => void;
112
+ handleTouchstart: (e: TouchEvent) => void;
113
+ };
@@ -0,0 +1,14 @@
1
+ import { RouteRecordRaw, _RouteRecordBase, RouteComponent } from 'vue-router';
2
+ import { MenuItem } from '../ele-pro-layout/types';
3
+
4
+ /**
5
+ * 获取路由组件方法
6
+ */
7
+ export type GetComponent = (component?: string, menu?: MenuItem, name?: string) => (() => Promise<RouteComponent>) | RouteComponent | undefined;
8
+ /**
9
+ * 菜单数据转为路由数据
10
+ * @param menus 菜单数据
11
+ * @param getComponent 加载组件的方法
12
+ * @param added 已添加的路由
13
+ */
14
+ export declare function menuToRoutes(menus: MenuItem[] | undefined, getComponent: GetComponent, added?: _RouteRecordBase[]): RouteRecordRaw[] | undefined;
@@ -0,0 +1,25 @@
1
+ import { AppContext } from 'vue';
2
+ import { ElMessageBoxOptions, MessageBoxData as ElMessageBoxData } from 'element-plus';
3
+
4
+ /**
5
+ * 消息弹窗配置
6
+ */
7
+ export interface MessageBoxOptions extends ElMessageBoxOptions {
8
+ /** 是否限制在主体内部 */
9
+ inner?: boolean;
10
+ }
11
+ /**
12
+ * 消息弹窗方法
13
+ */
14
+ export type MessageBoxMethod = (message: ElMessageBoxOptions['message'], title: ElMessageBoxOptions['title'], options?: MessageBoxOptions, context?: AppContext | null) => Promise<ElMessageBoxData>;
15
+ /**
16
+ * 消息弹窗
17
+ */
18
+ export interface MessageBox {
19
+ (options?: MessageBoxOptions, context?: AppContext | null): Promise<ElMessageBoxData>;
20
+ alert: MessageBoxMethod;
21
+ confirm: MessageBoxMethod;
22
+ prompt: MessageBoxMethod;
23
+ close: () => void;
24
+ }
25
+ export declare function useMessageBox(globalOpt?: MessageBoxOptions): MessageBox;
@@ -0,0 +1,66 @@
1
+ import { AppContext, InjectionKey } from 'vue';
2
+ import { MessageHandler as ElMessageHandler, MessageOptions as ElMessageOptions, MessageFn as ElMessageFn } from 'element-plus/es/components/message';
3
+
4
+ /**
5
+ * 消息提示配置
6
+ */
7
+ export interface MessageOptions extends ElMessageOptions {
8
+ /** 是否为原始风格 */
9
+ original?: boolean | 'plain';
10
+ /** 是否显示遮罩层 */
11
+ mask?: boolean;
12
+ /** 是否居中显示 */
13
+ centered?: boolean;
14
+ /** 是否限制在主体内部 */
15
+ inner?: boolean;
16
+ /** 限制在主体内部的分组标识 */
17
+ groupKey?: string;
18
+ }
19
+ /**
20
+ * 消息提示方法参数
21
+ */
22
+ export type MessageParams = MessageOptions | ElMessageOptions['message'];
23
+ /**
24
+ * 消息提示方法
25
+ */
26
+ export type MessageFn = (options?: MessageParams, context?: null | AppContext) => ElMessageHandler;
27
+ /**
28
+ * 消息提示
29
+ */
30
+ export interface Message extends MessageFn {
31
+ closeAll: ElMessageFn['closeAll'];
32
+ success: MessageFn;
33
+ warning: MessageFn;
34
+ error: MessageFn;
35
+ info: MessageFn;
36
+ loading: MessageFn;
37
+ }
38
+ /**
39
+ * 消息提示依赖注入
40
+ */
41
+ interface MessageProvide {
42
+ /** 限制在主体内部的分组标识 */
43
+ groupKey: string;
44
+ /** 获取限制在主体内部的容器 */
45
+ getInnerWrap: () => HTMLElement;
46
+ }
47
+ /**
48
+ * 消息提示依赖注入key
49
+ */
50
+ type MessageKey = InjectionKey<MessageProvide>;
51
+ /**
52
+ * 提供各种调用方法
53
+ * @param options 参数
54
+ * @param context 上下文
55
+ */
56
+ declare const EleMessage: Message;
57
+ export { EleMessage };
58
+ /**
59
+ * 消息提示依赖注入key
60
+ */
61
+ export declare const MESSAGE_KEY: MessageKey;
62
+ /**
63
+ * 带当前上下文的消息提示
64
+ * @param options 参数
65
+ */
66
+ export declare function useMessage(globalOpt?: MessageOptions): Message;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function getSideEffects(path, options) {
4
+ const importStyle = options == null ? void 0 : options.importStyle;
5
+ if (!importStyle) {
6
+ return;
7
+ }
8
+ if (importStyle === "css") {
9
+ return `${path}/style/css`;
10
+ }
11
+ return `${path}/style/index`;
12
+ }
13
+ function getStylePath(namePath, packageName, path) {
14
+ if (!path) {
15
+ return `${packageName}/es/${namePath}`;
16
+ }
17
+ if (path === "/es/core") {
18
+ return `${packageName}/es/${namePath}`;
19
+ }
20
+ if (path === "/lib/core") {
21
+ return `${packageName}/lib/${namePath}`;
22
+ }
23
+ return `${packageName}${path}/${namePath}`;
24
+ }
25
+ function EleAdminResolver(options) {
26
+ return {
27
+ type: "component",
28
+ resolve: (name) => {
29
+ var _a;
30
+ const { path, exclude } = options || {};
31
+ if ((name.match(/^Ele[A-Z]/) || name.match(/^Yu[A-Z]/)) && !((_a = exclude == null ? void 0 : exclude.includes) == null ? void 0 : _a.call(exclude, name))) {
32
+ const packageName = "yuang-framework-ui-pc";
33
+ const namePath = name.replace(/([A-Z])/g, " $1").trim().split(" ").join("-").toLowerCase();
34
+ const stylePath = getStylePath(namePath, packageName, path);
35
+ if (!path || path === "/es/core" || path === "/lib/core") {
36
+ return {
37
+ name,
38
+ from: `${packageName}${path ?? "/es"}`,
39
+ sideEffects: getSideEffects(stylePath, options)
40
+ };
41
+ }
42
+ return {
43
+ from: `${packageName}${path}/${namePath}/index`,
44
+ sideEffects: getSideEffects(stylePath, options)
45
+ };
46
+ }
47
+ }
48
+ };
49
+ }
50
+ exports.EleAdminResolver = EleAdminResolver;