mrxy-yk 0.0.1-beta.11

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 (236) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -0
  3. package/dist/@type/components/a-map-canvas/index.d.ts +1 -0
  4. package/dist/@type/components/adaptive-box/AdaptiveBox.d.ts +42 -0
  5. package/dist/@type/components/coordinate-pickup/CoordinatePickup.d.ts +29 -0
  6. package/dist/@type/components/drag-drop-box/DragDropBox.d.ts +33 -0
  7. package/dist/@type/components/drag-drop-container/DragDropContainer.d.ts +39 -0
  8. package/dist/@type/components/drag-drop-container/type.d.ts +3 -0
  9. package/dist/@type/components/echarts-canvas/EChartsCanvas.d.ts +21 -0
  10. package/dist/@type/components/in-body/InBody.d.ts +22 -0
  11. package/dist/@type/components/index.d.ts +12 -0
  12. package/dist/@type/components/position-anchor/PositionAnchor.d.ts +23 -0
  13. package/dist/@type/components/progress-bar/ProgressBar.d.ts +35 -0
  14. package/dist/@type/components/progress-bar/type.d.ts +5 -0
  15. package/dist/@type/components/progress-ring/ProgressRing.d.ts +22 -0
  16. package/dist/@type/components/scroll-container/ScrollContainer.d.ts +35 -0
  17. package/dist/@type/components/show-log/ShowLog.d.ts +25 -0
  18. package/dist/@type/components/ys-video/@type/index.d.ts +151 -0
  19. package/dist/@type/components/ys-video/YsVideo.d.ts +18 -0
  20. package/dist/@type/components/ys-video/components/BtnLineRec.d.ts +7 -0
  21. package/dist/@type/components/ys-video/type.d.ts +9 -0
  22. package/dist/@type/config/index.d.ts +23 -0
  23. package/dist/@type/directive/index.d.ts +1 -0
  24. package/dist/@type/directive/ref-height/index.d.ts +3 -0
  25. package/dist/@type/directive/ref-height/type.d.ts +11 -0
  26. package/dist/@type/directive/table-scroll-carousel/index.d.ts +3 -0
  27. package/dist/@type/element-plus/components/attrs.d.ts +2 -0
  28. package/dist/@type/element-plus/components/date-picker/DatePicker.d.ts +16 -0
  29. package/dist/@type/element-plus/components/date-picker/index.d.ts +22 -0
  30. package/dist/@type/element-plus/components/date-picker/type.d.ts +17 -0
  31. package/dist/@type/element-plus/components/empty/Empty.d.ts +31 -0
  32. package/dist/@type/element-plus/components/empty/config.d.ts +24 -0
  33. package/dist/@type/element-plus/components/empty/hooks/index.d.ts +2 -0
  34. package/dist/@type/element-plus/components/empty/hooks/type.d.ts +12 -0
  35. package/dist/@type/element-plus/components/empty/type.d.ts +9 -0
  36. package/dist/@type/element-plus/components/form-dialog/FormDialog.d.ts +400 -0
  37. package/dist/@type/element-plus/components/form-dialog/type.d.ts +4 -0
  38. package/dist/@type/element-plus/components/images/Images.d.ts +16 -0
  39. package/dist/@type/element-plus/components/images/index.d.ts +9 -0
  40. package/dist/@type/element-plus/components/index.d.ts +9 -0
  41. package/dist/@type/element-plus/components/pagination/Pagination.d.ts +18 -0
  42. package/dist/@type/element-plus/components/table-column/TableColumn.d.ts +27 -0
  43. package/dist/@type/element-plus/components/upload/accept/index.d.ts +1 -0
  44. package/dist/@type/element-plus/components/upload/index.d.ts +42 -0
  45. package/dist/@type/element-plus/components/upload/select-file/SelectFile.d.ts +822 -0
  46. package/dist/@type/element-plus/components/upload/upload-files/UploadFiles.d.ts +844 -0
  47. package/dist/@type/element-plus/components/upload/upload-images/UploadImages.d.ts +842 -0
  48. package/dist/@type/element-plus/hooks/dialog/index.d.ts +2 -0
  49. package/dist/@type/element-plus/hooks/dialog/type.d.ts +20 -0
  50. package/dist/@type/element-plus/hooks/form/index.d.ts +2 -0
  51. package/dist/@type/element-plus/hooks/form/type.d.ts +45 -0
  52. package/dist/@type/element-plus/hooks/form-dialog/index.d.ts +2 -0
  53. package/dist/@type/element-plus/hooks/form-dialog/type.d.ts +70 -0
  54. package/dist/@type/element-plus/hooks/index.d.ts +5 -0
  55. package/dist/@type/element-plus/hooks/table-sort/index.d.ts +20 -0
  56. package/dist/@type/element-plus/hooks/table-sort/type.d.ts +21 -0
  57. package/dist/@type/element-plus/index.d.ts +2 -0
  58. package/dist/@type/element-plus/type.d.ts +15 -0
  59. package/dist/@type/element-plus/utils/form-rule/index.d.ts +4 -0
  60. package/dist/@type/element-plus/utils/form-rule/rule.d.ts +22 -0
  61. package/dist/@type/element-plus/utils/form-rule/type.d.ts +14 -0
  62. package/dist/@type/element-plus/utils/index.d.ts +2 -0
  63. package/dist/@type/element-plus/utils/table-util/index.d.ts +25 -0
  64. package/dist/@type/entity/BigFloat.d.ts +48 -0
  65. package/dist/@type/entity/Pages.d.ts +9 -0
  66. package/dist/@type/entity/RejectError.d.ts +24 -0
  67. package/dist/@type/entity/index.d.ts +3 -0
  68. package/dist/@type/hooks/index.d.ts +1 -0
  69. package/dist/@type/hooks/table-search/index.d.ts +3 -0
  70. package/dist/@type/hooks/table-search/type.d.ts +54 -0
  71. package/dist/@type/icons/index.d.ts +2 -0
  72. package/dist/@type/index.d.ts +13 -0
  73. package/dist/@type/resolver/index.d.ts +3 -0
  74. package/dist/@type/type.d.ts +11 -0
  75. package/dist/@type/typings.d.ts +20 -0
  76. package/dist/@type/utils/amap/@type/AMap.d.ts +24 -0
  77. package/dist/@type/utils/amap/@type/Bounds.d.ts +18 -0
  78. package/dist/@type/utils/amap/@type/Control.d.ts +19 -0
  79. package/dist/@type/utils/amap/@type/Event.d.ts +11 -0
  80. package/dist/@type/utils/amap/@type/Icon.d.ts +12 -0
  81. package/dist/@type/utils/amap/@type/InfoWindow.d.ts +40 -0
  82. package/dist/@type/utils/amap/@type/LngLat.d.ts +34 -0
  83. package/dist/@type/utils/amap/@type/Map.d.ts +218 -0
  84. package/dist/@type/utils/amap/@type/Marker.d.ts +137 -0
  85. package/dist/@type/utils/amap/@type/MarkerCluster.d.ts +65 -0
  86. package/dist/@type/utils/amap/@type/MoveAnimation.d.ts +33 -0
  87. package/dist/@type/utils/amap/@type/Pixel.d.ts +11 -0
  88. package/dist/@type/utils/amap/@type/Polyline.d.ts +80 -0
  89. package/dist/@type/utils/amap/@type/Size.d.ts +9 -0
  90. package/dist/@type/utils/amap/@type/index.d.ts +23 -0
  91. package/dist/@type/utils/amap/@type/other.d.ts +11 -0
  92. package/dist/@type/utils/amap/index.d.ts +3 -0
  93. package/dist/@type/utils/amap/type.d.ts +21 -0
  94. package/dist/@type/utils/amap/utils/coordinates.d.ts +24 -0
  95. package/dist/@type/utils/amap/utils/index.d.ts +12 -0
  96. package/dist/@type/utils/amap/utils/type.d.ts +4 -0
  97. package/dist/@type/utils/echarts/hooks/index.d.ts +76 -0
  98. package/dist/@type/utils/echarts/index.d.ts +3 -0
  99. package/dist/@type/utils/echarts/modules/coordinate/basic.d.ts +27 -0
  100. package/dist/@type/utils/echarts/modules/coordinate/cartesian.d.ts +25 -0
  101. package/dist/@type/utils/echarts/modules/coordinate/polar.d.ts +14 -0
  102. package/dist/@type/utils/echarts/modules/index.d.ts +5 -0
  103. package/dist/@type/utils/echarts/modules/series/bar.d.ts +16 -0
  104. package/dist/@type/utils/echarts/modules/series/line.d.ts +16 -0
  105. package/dist/@type/utils/echarts/modules/series/pie.d.ts +28 -0
  106. package/dist/@type/utils/echarts/modules/type.d.ts +83 -0
  107. package/dist/@type/utils/echarts/type.d.ts +8 -0
  108. package/dist/@type/utils/echarts/utils/assignOption.d.ts +7 -0
  109. package/dist/@type/utils/echarts/utils/index.d.ts +27 -0
  110. package/dist/@type/utils/fn-periodically/FnBatchPeriodically.d.ts +32 -0
  111. package/dist/@type/utils/fn-periodically/FnPeriodically.d.ts +37 -0
  112. package/dist/@type/utils/fn-periodically/index.d.ts +2 -0
  113. package/dist/@type/utils/fn-periodically/type.d.ts +30 -0
  114. package/dist/@type/utils/index.d.ts +6 -0
  115. package/dist/@type/utils/match-unit/dataset.d.ts +8 -0
  116. package/dist/@type/utils/match-unit/index.d.ts +10 -0
  117. package/dist/@type/utils/match-unit/type.d.ts +39 -0
  118. package/dist/@type/utils/mitt/hooks/inject-events/index.d.ts +7 -0
  119. package/dist/@type/utils/mitt/hooks/inject-events/type.d.ts +9 -0
  120. package/dist/@type/utils/prototype/index.d.ts +5 -0
  121. package/dist/@type/utils/prototype/lib/ArrayUtil.d.ts +87 -0
  122. package/dist/@type/utils/prototype/lib/ComponentUtil.d.ts +18 -0
  123. package/dist/@type/utils/prototype/lib/FileUtil.d.ts +19 -0
  124. package/dist/@type/utils/prototype/lib/NumberUtil.d.ts +9 -0
  125. package/dist/@type/utils/prototype/lib/ObjectUtil.d.ts +152 -0
  126. package/dist/@type/utils/prototype/lib/PromiseUtil.d.ts +7 -0
  127. package/dist/@type/utils/prototype/type.d.ts +28 -0
  128. package/dist/@type/utils/sandbox/Sandbox.d.ts +25 -0
  129. package/dist/@type/utils/transition-fade/index.d.ts +32 -0
  130. package/dist/@type/utils/transition-fade/type.d.ts +6 -0
  131. package/dist/_virtual/_plugin-vue_export-helper.es.js +10 -0
  132. package/dist/components/adaptive-box/AdaptiveBox.vue.es.js +7 -0
  133. package/dist/components/adaptive-box/AdaptiveBox.vue.es2.js +170 -0
  134. package/dist/components/coordinate-pickup/CoordinatePickup.vue.es.js +10 -0
  135. package/dist/components/coordinate-pickup/CoordinatePickup.vue.es2.js +302 -0
  136. package/dist/components/drag-drop-box/DragDropBox.vue.es.js +7 -0
  137. package/dist/components/drag-drop-box/DragDropBox.vue.es2.js +59 -0
  138. package/dist/components/drag-drop-container/DragDropContainer.vue.es.js +7 -0
  139. package/dist/components/drag-drop-container/DragDropContainer.vue.es2.js +113 -0
  140. package/dist/components/echarts-canvas/EChartsCanvas.vue.es.js +7 -0
  141. package/dist/components/echarts-canvas/EChartsCanvas.vue.es2.js +73 -0
  142. package/dist/components/in-body/InBody.vue.es.js +24 -0
  143. package/dist/components/in-body/InBody.vue.es2.js +4 -0
  144. package/dist/components/index.es.js +26 -0
  145. package/dist/components/position-anchor/PositionAnchor.vue.es.js +7 -0
  146. package/dist/components/position-anchor/PositionAnchor.vue.es2.js +22 -0
  147. package/dist/components/progress-bar/ProgressBar.vue.es.js +7 -0
  148. package/dist/components/progress-bar/ProgressBar.vue.es2.js +126 -0
  149. package/dist/components/progress-ring/ProgressRing.vue.es.js +7 -0
  150. package/dist/components/progress-ring/ProgressRing.vue.es2.js +87 -0
  151. package/dist/components/scroll-container/ScrollContainer.vue.es.js +7 -0
  152. package/dist/components/scroll-container/ScrollContainer.vue.es2.js +89 -0
  153. package/dist/components/show-log/ShowLog.vue.es.js +7 -0
  154. package/dist/components/show-log/ShowLog.vue.es2.js +61 -0
  155. package/dist/components/ys-video/YsVideo.vue.es.js +7 -0
  156. package/dist/components/ys-video/YsVideo.vue.es2.js +122 -0
  157. package/dist/components/ys-video/components/BtnLineRec.vue.es.js +7 -0
  158. package/dist/components/ys-video/components/BtnLineRec.vue.es2.js +57 -0
  159. package/dist/components/ys-video/images/btn-play.png.es.js +4 -0
  160. package/dist/config/index.es.js +16 -0
  161. package/dist/directive/index.es.js +4 -0
  162. package/dist/directive/ref-height/index.es.js +49 -0
  163. package/dist/element-plus/components/date-picker/DatePicker.vue.es.js +107 -0
  164. package/dist/element-plus/components/date-picker/DatePicker.vue.es2.js +4 -0
  165. package/dist/element-plus/components/date-picker/index.es.js +213 -0
  166. package/dist/element-plus/components/empty/Empty.vue.es.js +92 -0
  167. package/dist/element-plus/components/empty/Empty.vue.es3.js +5 -0
  168. package/dist/element-plus/components/empty/config.es.js +10 -0
  169. package/dist/element-plus/components/empty/hooks/index.es.js +24 -0
  170. package/dist/element-plus/components/form-dialog/FormDialog.vue.es.js +135 -0
  171. package/dist/element-plus/components/form-dialog/FormDialog.vue.es2.js +4 -0
  172. package/dist/element-plus/components/images/Images.vue.es.js +7 -0
  173. package/dist/element-plus/components/images/Images.vue.es2.js +93 -0
  174. package/dist/element-plus/components/images/index.es.js +10 -0
  175. package/dist/element-plus/components/index.es.js +21 -0
  176. package/dist/element-plus/components/pagination/Pagination.vue.es.js +7 -0
  177. package/dist/element-plus/components/pagination/Pagination.vue.es2.js +66 -0
  178. package/dist/element-plus/components/table-column/TableColumn.vue.es.js +34 -0
  179. package/dist/element-plus/components/table-column/TableColumn.vue.es2.js +4 -0
  180. package/dist/element-plus/components/upload/accept/index.es.js +12 -0
  181. package/dist/element-plus/components/upload/index.es.js +35 -0
  182. package/dist/element-plus/components/upload/select-file/SelectFile.vue.es.js +7 -0
  183. package/dist/element-plus/components/upload/select-file/SelectFile.vue.es2.js +66 -0
  184. package/dist/element-plus/components/upload/upload-files/UploadFiles.vue.es.js +7 -0
  185. package/dist/element-plus/components/upload/upload-files/UploadFiles.vue.es2.js +204 -0
  186. package/dist/element-plus/components/upload/upload-images/UploadImages.vue.es.js +7 -0
  187. package/dist/element-plus/components/upload/upload-images/UploadImages.vue.es2.js +212 -0
  188. package/dist/element-plus/hooks/dialog/index.es.js +44 -0
  189. package/dist/element-plus/hooks/form/index.es.js +45 -0
  190. package/dist/element-plus/hooks/form-dialog/index.es.js +53 -0
  191. package/dist/element-plus/hooks/table-sort/index.es.js +30 -0
  192. package/dist/element-plus/index.es.js +51 -0
  193. package/dist/element-plus/utils/form-rule/rule.es.js +107 -0
  194. package/dist/element-plus/utils/table-util/index.es.js +56 -0
  195. package/dist/entity/BigFloat.es.js +102 -0
  196. package/dist/entity/Pages.es.js +11 -0
  197. package/dist/entity/RejectError.es.js +35 -0
  198. package/dist/entity/index.es.js +8 -0
  199. package/dist/hooks/index.es.js +4 -0
  200. package/dist/hooks/table-search/index.es.js +72 -0
  201. package/dist/icons/images/Image.svg.es.js +4 -0
  202. package/dist/icons/images/ImageError.svg.es.js +4 -0
  203. package/dist/icons/index.es.js +12 -0
  204. package/dist/index.es.js +111 -0
  205. package/dist/mrxy-yk.css +1 -0
  206. package/dist/resolver/index.es.js +24 -0
  207. package/dist/styles/plugins/colors/index.scss +52 -0
  208. package/dist/styles/plugins/colors/var.scss +77 -0
  209. package/dist/styles/plugins/template.scss +37 -0
  210. package/dist/utils/amap/index.es.js +21 -0
  211. package/dist/utils/amap/utils/coordinates.es.js +61 -0
  212. package/dist/utils/amap/utils/index.es.js +39 -0
  213. package/dist/utils/echarts/hooks/index.es.js +32 -0
  214. package/dist/utils/echarts/modules/coordinate/basic.es.js +103 -0
  215. package/dist/utils/echarts/modules/coordinate/cartesian.es.js +79 -0
  216. package/dist/utils/echarts/modules/series/bar.es.js +43 -0
  217. package/dist/utils/echarts/modules/series/line.es.js +47 -0
  218. package/dist/utils/echarts/modules/series/pie.es.js +126 -0
  219. package/dist/utils/echarts/utils/assignOption.es.js +40 -0
  220. package/dist/utils/echarts/utils/index.es.js +99 -0
  221. package/dist/utils/fn-periodically/FnBatchPeriodically.es.js +70 -0
  222. package/dist/utils/fn-periodically/FnPeriodically.es.js +85 -0
  223. package/dist/utils/index.es.js +49 -0
  224. package/dist/utils/match-unit/dataset.es.js +143 -0
  225. package/dist/utils/match-unit/index.es.js +56 -0
  226. package/dist/utils/mitt/hooks/inject-events/index.es.js +27 -0
  227. package/dist/utils/prototype/lib/ArrayUtil.es.js +115 -0
  228. package/dist/utils/prototype/lib/ComponentUtil.es.js +45 -0
  229. package/dist/utils/prototype/lib/NumberUtil.es.js +17 -0
  230. package/dist/utils/prototype/lib/ObjectUtil.es.js +277 -0
  231. package/dist/utils/prototype/lib/PromiseUtil.es.js +18 -0
  232. package/dist/utils/transition-fade/index.es.js +79 -0
  233. package/global.d.ts +55 -0
  234. package/package.json +134 -0
  235. package/web-types-mr.json +923 -0
  236. package/web-types-yk.json +923 -0
@@ -0,0 +1,277 @@
1
+ class ObjectUtil {
2
+ /**
3
+ * 限制值在范围之间
4
+ * @param value
5
+ * @param min
6
+ * @param max
7
+ * @param cycle 值溢出时是否从对向开始计数,如小于最小值时返回最大值
8
+ */
9
+ static toBetween(value, min, max, cycle = false) {
10
+ if (value < min) return cycle ? max : min;
11
+ else if (value > max) return cycle ? min : max;
12
+ return value;
13
+ }
14
+ /**
15
+ * 立即执行函数表达式(Immediately Invoked Function Expression,简称 IIFE)。
16
+ * 立即执行函数
17
+ * ``` ts
18
+ * // 解决表达式容易和前一行的代码合并的问题,例如以下代码就会报错
19
+ * const arr = []
20
+ * (function() {
21
+ * // 代码逻辑
22
+ * })();
23
+ * ```
24
+ * @param fn
25
+ */
26
+ static iiFn(fn) {
27
+ return fn();
28
+ }
29
+ /**
30
+ * 立即执行函数
31
+ * 同`iiFn`,无返回值函数
32
+ * @param fn
33
+ */
34
+ static iiFnVoid(fn) {
35
+ fn();
36
+ }
37
+ /**
38
+ * 复制文本到粘贴板
39
+ * @param text
40
+ */
41
+ static async copyToClipboard(text) {
42
+ if (navigator.clipboard) {
43
+ await navigator.clipboard.writeText(text);
44
+ } else {
45
+ const textArea = document.createElement("textarea");
46
+ textArea.value = text;
47
+ document.body.append(textArea);
48
+ textArea.select();
49
+ document.execCommand("copy");
50
+ textArea.remove();
51
+ }
52
+ }
53
+ /**
54
+ * 深层循环,可用于代替一部分递归的使用
55
+ * 常见数据处理:
56
+ * 双数组合并成一个children字段
57
+ * ``` ts
58
+ * deepForEach([{ groupList: [], deviceList: [] }], (item, resolve, parent) => {
59
+ * if (parent) parent.children.unshift(item)
60
+ * item.children = [...item.deviceList]
61
+ * if (item.groupList.length) resolve(item.groupList.reverse())
62
+ * })
63
+ * ```
64
+ */
65
+ static deepForEach(arraySource, callback) {
66
+ const cyclePool = arraySource.map((item) => ({ value: item, parent: null, level: 0 }));
67
+ function createResolveFn(forItem) {
68
+ return (children, parent) => {
69
+ cyclePool.push(...children.map((item) => ({
70
+ value: item,
71
+ parent: parent || forItem.value,
72
+ level: forItem.level + 1
73
+ })));
74
+ };
75
+ }
76
+ for (const item of cyclePool) {
77
+ callback(item.value, createResolveFn(item), item.parent, item.level);
78
+ }
79
+ return arraySource;
80
+ }
81
+ /**
82
+ * 前缘防抖 - 立即触发,多次调用触发第一次
83
+ * @param fn
84
+ * @param delay
85
+ */
86
+ static leadingDebounce(fn, delay = 300) {
87
+ let timer;
88
+ return ((...args) => {
89
+ if (timer) {
90
+ clearTimeout(timer);
91
+ } else {
92
+ fn(...args);
93
+ }
94
+ timer = setTimeout(() => {
95
+ timer = null;
96
+ }, delay);
97
+ });
98
+ }
99
+ /**
100
+ * 延迟
101
+ * @param delay
102
+ */
103
+ static sleep(delay) {
104
+ return new Promise((resolve) => {
105
+ setTimeout(() => {
106
+ resolve();
107
+ }, delay);
108
+ });
109
+ }
110
+ /**
111
+ * 防抖 - 延迟触发,多次调用触发最后一次
112
+ * @param fn
113
+ * @param delay
114
+ */
115
+ static debounce(fn, delay = 300) {
116
+ let timer;
117
+ return ((...arg) => {
118
+ if (timer) {
119
+ clearTimeout(timer);
120
+ }
121
+ timer = setTimeout(() => {
122
+ fn(...arg);
123
+ }, delay);
124
+ });
125
+ }
126
+ /**
127
+ * 节流 - 触发后一段时间内不会再次触发
128
+ * @param fn
129
+ * @param delay
130
+ */
131
+ static throttle(fn, delay = 300) {
132
+ let timer;
133
+ return ((...arg) => {
134
+ if (!timer) {
135
+ fn(...arg);
136
+ timer = setTimeout(() => {
137
+ clearTimeout(timer);
138
+ timer = null;
139
+ }, delay);
140
+ }
141
+ });
142
+ }
143
+ /**
144
+ * 根据地址获取源数据中的值
145
+ * @param source
146
+ * @param address
147
+ * @param char
148
+ */
149
+ static getAttr(source, address, char = "/") {
150
+ const tier = address.split(char);
151
+ try {
152
+ for (const key of tier) {
153
+ source = source[key];
154
+ }
155
+ return source;
156
+ } catch {
157
+ return void 0;
158
+ }
159
+ }
160
+ /**
161
+ * 判断参数是否为null|undefined|''
162
+ * @param value
163
+ */
164
+ static isNotEmpty(value) {
165
+ return value === 0 || Boolean(value);
166
+ }
167
+ /**
168
+ * 判断参数是否为null|undefined|''
169
+ * @param value
170
+ */
171
+ static isEmpty(value) {
172
+ return !this.isNotEmpty(value);
173
+ }
174
+ /**
175
+ * 如果value不为空返回value否则返回arg
176
+ * @param value
177
+ * @param arg
178
+ */
179
+ static isEmptyToVal(value, arg) {
180
+ return this.isNotEmpty(value) ? value : arg;
181
+ }
182
+ /**
183
+ * 根据source更新target中的属性值
184
+ * @param target
185
+ * @param source
186
+ * @param template
187
+ */
188
+ static updateVal(target, source, template) {
189
+ if (!template) template = target;
190
+ for (const key in template) {
191
+ target[key] = source[key];
192
+ }
193
+ }
194
+ /**
195
+ * 初始化对象数据
196
+ * @param target
197
+ * @param source
198
+ */
199
+ static initClassVal(target, source) {
200
+ if (!source) return;
201
+ const prototype = target.constructor.prototype;
202
+ for (const key in source) {
203
+ if (target.hasOwnProperty(key) || prototype.hasOwnProperty(key)) {
204
+ target[key] = source[key];
205
+ }
206
+ }
207
+ }
208
+ /**
209
+ * 深度克隆 - 不会拷贝函数,不能拷贝自引用的对象,无法正确拷贝非JSON的对象如Date
210
+ * 深度:√
211
+ * 自引用:√
212
+ * 非JSON对象:√
213
+ * 函数:Error
214
+ * @param arg
215
+ */
216
+ static copy(arg) {
217
+ return structuredClone(arg);
218
+ }
219
+ /**
220
+ * 将对象转成JSON对象
221
+ * @param arg
222
+ */
223
+ static toJSON(arg) {
224
+ return JSON.parse(JSON.stringify(arg));
225
+ }
226
+ /**
227
+ * 合并两个对象
228
+ * @param target
229
+ * @param source
230
+ * @param option
231
+ */
232
+ static assignDeep(target, source, option = {}) {
233
+ const _option_ = { deep: true, object: true, array: true, ...option };
234
+ this._assignDeep_(target, source, _option_);
235
+ return target;
236
+ }
237
+ /**
238
+ * assignDeep 的递归函数
239
+ * @param target
240
+ * @param source
241
+ * @param option
242
+ * @private
243
+ */
244
+ static _assignDeep_(target, source, option) {
245
+ for (const key in source) {
246
+ const val = source[key];
247
+ if (this.isObject(val) && this.isObject(target[key]) && option.object || Array.isArray(val) && Array.isArray(target[key]) && option.array) {
248
+ this._assignDeep_(target[key], val, option);
249
+ } else {
250
+ if (option.deep || target.hasOwnProperty(key)) {
251
+ target[key] = val;
252
+ }
253
+ }
254
+ }
255
+ }
256
+ static isBoolean(arg) {
257
+ return Object.prototype.toString.call(arg) === "[object Boolean]";
258
+ }
259
+ static isString(arg) {
260
+ return Object.prototype.toString.call(arg) === "[object String]";
261
+ }
262
+ static isNumber(arg) {
263
+ return Object.prototype.toString.call(arg) === "[object Number]";
264
+ }
265
+ static isObject(arg) {
266
+ return Object.prototype.toString.call(arg) === "[object Object]";
267
+ }
268
+ static isDate(arg) {
269
+ return Object.prototype.toString.call(arg) === "[object Date]";
270
+ }
271
+ static isUndefined(arg) {
272
+ return arg === void 0;
273
+ }
274
+ }
275
+ export {
276
+ ObjectUtil
277
+ };
@@ -0,0 +1,18 @@
1
+ class PromiseUtil {
2
+ /**
3
+ * 安全的使用 Promise await,捕获catch的错误,避免使用await的时候报错影响业务
4
+ * @param promise
5
+ */
6
+ static async safe(promise) {
7
+ const result = [];
8
+ try {
9
+ result[0] = await promise;
10
+ } catch (error) {
11
+ result[1] = error;
12
+ }
13
+ return result;
14
+ }
15
+ }
16
+ export {
17
+ PromiseUtil
18
+ };
@@ -0,0 +1,79 @@
1
+ class TransitionFade {
2
+ // 需要监控的DOM列表
3
+ elList = [];
4
+ // 记录DOM和DOM的getBoundingClientRect数据
5
+ elRectMap = /* @__PURE__ */ new Map();
6
+ // 动画过度时间
7
+ duration = 200;
8
+ constructor(option) {
9
+ if (!option) return;
10
+ if (option.updateElListHook) {
11
+ this.autoUpDateElList = true;
12
+ this.updateElListHook = option.updateElListHook;
13
+ }
14
+ if (option.duration) this.duration = option.duration;
15
+ }
16
+ // region 自动更新ElList
17
+ // 是否需要自动更新ElList
18
+ autoUpDateElList = false;
19
+ // 更新ElList的方式
20
+ updateElListHook = null;
21
+ /**
22
+ * 更新ElList
23
+ * @private
24
+ */
25
+ updateElList() {
26
+ if (!this.autoUpDateElList) return;
27
+ this.setElList(this.updateElListHook());
28
+ }
29
+ // endregion
30
+ /**
31
+ * DOM状态修改之前需要先执行ready记录当前状态
32
+ */
33
+ async ready() {
34
+ this.elRectMap.clear();
35
+ this.updateElList();
36
+ const length = this.elList.length;
37
+ for (let index = 0; index < length; index++) {
38
+ const element = this.elList[index];
39
+ this.elRectMap.set(element, element.getBoundingClientRect());
40
+ }
41
+ }
42
+ /**
43
+ * DOM状态修改后执行动画,如果ElList没有新增或者减少可以连续使用go函数,不需要每次执行ready函数
44
+ * @param duration
45
+ */
46
+ go(duration) {
47
+ const length = this.elList.length;
48
+ const goElementRectMap = /* @__PURE__ */ new Map();
49
+ for (let index = 0; index < length; index++) {
50
+ const element = this.elList[index];
51
+ goElementRectMap.set(element, element.getBoundingClientRect());
52
+ }
53
+ for (let index = 0; index < length; index++) {
54
+ const element = this.elList[index];
55
+ const r1 = this.elRectMap.get(element);
56
+ const r2 = goElementRectMap.get(element);
57
+ if (r1 && r2) {
58
+ element.animate([
59
+ { transform: `translateY(${r1.y - r2.y}px) translateX(${r1.x - r2.x}px)` },
60
+ { transform: "translateY(0) translateX(0)" }
61
+ ], {
62
+ duration: duration || this.duration
63
+ });
64
+ }
65
+ }
66
+ this.elRectMap = goElementRectMap;
67
+ }
68
+ /**
69
+ * 手动设置ElList
70
+ * @param elementList
71
+ */
72
+ setElList(elementList) {
73
+ this.elList = elementList;
74
+ this.elRectMap.clear();
75
+ }
76
+ }
77
+ export {
78
+ TransitionFade
79
+ };
package/global.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ export {}
2
+
3
+ declare module 'vue' {
4
+ export interface GlobalComponents {
5
+ YkPositionAnchor: typeof import('mrxy-yk/components')['PositionAnchor']
6
+ MrPositionAnchor: typeof import('mrxy-yk/components')['PositionAnchor']
7
+ YkProgressRing: typeof import('mrxy-yk/components')['ProgressRing']
8
+ MrProgressRing: typeof import('mrxy-yk/components')['ProgressRing']
9
+ YkAdaptiveBox: typeof import('mrxy-yk/components')['AdaptiveBox']
10
+ MrAdaptiveBox: typeof import('mrxy-yk/components')['AdaptiveBox']
11
+ YkCoordinatePickup: typeof import('mrxy-yk/components')['CoordinatePickup']
12
+ MrCoordinatePickup: typeof import('mrxy-yk/components')['CoordinatePickup']
13
+ YkInBody: typeof import('mrxy-yk/components')['InBody']
14
+ MrInBody: typeof import('mrxy-yk/components')['InBody']
15
+ YkDragDropBox: typeof import('mrxy-yk/components')['DragDropBox']
16
+ MrDragDropBox: typeof import('mrxy-yk/components')['DragDropBox']
17
+ YkDragDropContainer: typeof import('mrxy-yk/components')['DragDropContainer']
18
+ MrDragDropContainer: typeof import('mrxy-yk/components')['DragDropContainer']
19
+ YkProgressBar: typeof import('mrxy-yk/components')['ProgressBar']
20
+ MrProgressBar: typeof import('mrxy-yk/components')['ProgressBar']
21
+ YkYsVideo: typeof import('mrxy-yk/components')['YsVideo']
22
+ MrYsVideo: typeof import('mrxy-yk/components')['YsVideo']
23
+ YkShowLog: typeof import('mrxy-yk/components')['ShowLog']
24
+ MrShowLog: typeof import('mrxy-yk/components')['ShowLog']
25
+ YkEChartsCanvas: typeof import('mrxy-yk/components')['EChartsCanvas']
26
+ MrEChartsCanvas: typeof import('mrxy-yk/components')['EChartsCanvas']
27
+ YkScrollContainer: typeof import('mrxy-yk/components')['ScrollContainer']
28
+ MrScrollContainer: typeof import('mrxy-yk/components')['ScrollContainer']
29
+ YkElDatePicker: typeof import('mrxy-yk/components')['ElDatePicker']
30
+ MrElDatePicker: typeof import('mrxy-yk/components')['ElDatePicker']
31
+
32
+ YkElFormDialog: typeof import('mrxy-yk/element-plus/components')['ElFormDialog']
33
+ MrElFormDialog: typeof import('mrxy-yk/element-plus/components')['ElFormDialog']
34
+ YkElPagination: typeof import('mrxy-yk/element-plus/components')['ElPagination']
35
+ MrElPagination: typeof import('mrxy-yk/element-plus/components')['ElPagination']
36
+ YkElUploadImages: typeof import('mrxy-yk/element-plus/components')['ElUploadImages']
37
+ MrElUploadImages: typeof import('mrxy-yk/element-plus/components')['ElUploadImages']
38
+ YkElUploadFiles: typeof import('mrxy-yk/element-plus/components')['ElUploadFiles']
39
+ MrElUploadFiles: typeof import('mrxy-yk/element-plus/components')['ElUploadFiles']
40
+ YkElSelectFile: typeof import('mrxy-yk/element-plus/components')['ElSelectFile']
41
+ MrElSelectFile: typeof import('mrxy-yk/element-plus/components')['ElSelectFile']
42
+ YkElEmpty: typeof import('mrxy-yk/element-plus/components')['ElEmpty']
43
+ MrElEmpty: typeof import('mrxy-yk/element-plus/components')['ElEmpty']
44
+ YkElImages: typeof import('mrxy-yk/element-plus/components')['ElImages']
45
+ MrElImages: typeof import('mrxy-yk/element-plus/components')['ElImages']
46
+ YkElTableColumn: typeof import('mrxy-yk/element-plus/components')['ElTableColumn']
47
+ & typeof import('element-plus/es')['ElTableColumn']
48
+ MrElTableColumn: typeof import('mrxy-yk/element-plus/components')['ElTableColumn']
49
+ & typeof import('element-plus/es')['ElTableColumn']
50
+ }
51
+
52
+ export interface GlobalDirectives {
53
+ vRefHeight: typeof import('mrxy-yk')['RefHeight']
54
+ }
55
+ }
package/package.json ADDED
@@ -0,0 +1,134 @@
1
+ {
2
+ "name": "mrxy-yk",
3
+ "version": "0.0.1-beta.11",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "A collection of Vue 3 components and utilities",
7
+ "keywords": [
8
+ "mrxy",
9
+ "mrxy-yk",
10
+ "vue3",
11
+ "components",
12
+ "utilities",
13
+ "plugin"
14
+ ],
15
+ "author": "Mrxy",
16
+ "license": "MIT",
17
+ "engines": {
18
+ "node": "^20.19.0 || >=22.12.0"
19
+ },
20
+ "main": "./dist/index.es.js",
21
+ "module": "./dist/index.es.js",
22
+ "types": "./dist/@type/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/@type/index.d.ts",
26
+ "import": "./dist/index.es.js"
27
+ },
28
+ "./global": {
29
+ "import": "./global.d.ts"
30
+ },
31
+ "./styles/*": {
32
+ "import": "./dist/styles/*"
33
+ },
34
+ "./config": {
35
+ "types": "./dist/@type/config/index.d.ts",
36
+ "import": "./dist/config/index.es.js"
37
+ },
38
+ "./resolver": {
39
+ "types": "./dist/@type/resolver/index.d.ts",
40
+ "import": "./dist/resolver/index.es.js"
41
+ },
42
+ "./components": {
43
+ "types": "./dist/@type/components/index.d.ts",
44
+ "import": "./dist/components/index.es.js"
45
+ },
46
+ "./element-plus/*": {
47
+ "types": "./dist/@type/element-plus/*",
48
+ "import": "./dist/element-plus/*"
49
+ },
50
+ "./components/*": {
51
+ "types": "./dist/@type/components/*",
52
+ "import": "./dist/components/*"
53
+ },
54
+ "./utils/*": {
55
+ "types": "./dist/@type/utils/*",
56
+ "import": "./dist/utils/*"
57
+ },
58
+ "./dist/*": {
59
+ "types": "./dist/@type/*",
60
+ "import": "./dist/*"
61
+ },
62
+ "./*": "./*"
63
+ },
64
+ "sideEffects": [
65
+ "dist/*",
66
+ "src/**/*.css",
67
+ "src/**/*.scss",
68
+ "src/**/*.vue"
69
+ ],
70
+ "files": [
71
+ "dist",
72
+ "web-types-mr.json",
73
+ "web-types-yk.json",
74
+ "global.d.ts"
75
+ ],
76
+ "style": "dist/styles/index.css",
77
+ "web-types": [
78
+ "web-types-mr.json",
79
+ "web-types-yk.json"
80
+ ],
81
+ "repository": {
82
+ "type": "git",
83
+ "url": "https://gitee.com/cscake/mrxy-yk.git"
84
+ },
85
+ "homepage": "https://gitee.com/cscake/mrxy-yk.git",
86
+ "scripts": {
87
+ "dev": "vite",
88
+ "pack": "npm pack",
89
+ "build": "run-p type-check \"build-only {@}\" --",
90
+ "build-only": "vite build",
91
+ "preview": "vite preview",
92
+ "type-check": "vue-tsc --build",
93
+ "lint": "eslint . --fix"
94
+ },
95
+ "peerDependencies": {
96
+ "element-plus": "^2.5.0",
97
+ "vue": "^3.5.0"
98
+ },
99
+ "dependencies": {
100
+ "@amap/amap-jsapi-loader": "1.0.1",
101
+ "@element-plus/icons-vue": "2.3.2",
102
+ "dayjs": "1.11.19",
103
+ "echarts": "6.0.0",
104
+ "ezuikit-js": "8.2.2",
105
+ "jszip": "3.10.1",
106
+ "mitt": "3.0.1"
107
+ },
108
+ "devDependencies": {
109
+ "@tsconfig/node22": "22.0.5",
110
+ "@types/node": "25.0.3",
111
+ "@vitejs/plugin-vue": "6.0.3",
112
+ "@vue/eslint-config-typescript": "14.6.0",
113
+ "@vue/tsconfig": "0.8.1",
114
+ "eslint": "9.39.2",
115
+ "eslint-plugin-unicorn": "62.0.0",
116
+ "eslint-plugin-vue": "10.6.2",
117
+ "jiti": "2.6.1",
118
+ "npm-run-all2": "8.0.4",
119
+ "sass-embedded": "1.93.3",
120
+ "typescript": "5.9.3",
121
+ "unplugin-auto-import": "20.3.0",
122
+ "unplugin-vue-components": "30.0.0",
123
+ "vite": "7.3.0",
124
+ "vite-plugin-dts": "4.5.4",
125
+ "vite-plugin-static-copy": "^3.1.4",
126
+ "vite-plugin-vue-devtools": "8.0.5",
127
+ "vue-tsc": "3.1.8"
128
+ },
129
+ "browserslist": [
130
+ "> 1%",
131
+ "not ie 11",
132
+ "not op_mini all"
133
+ ]
134
+ }