@web-utils/component 2.7.21 → 2.7.28

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 (310) hide show
  1. package/dist/chunks/confirmable-mixin.35bd1934.js +104 -0
  2. package/dist/chunks/{detail.6619700c.js → detail.544c52b0.js} +1 -1
  3. package/dist/chunks/{form-input-mixin.df413ca8.js → form-input-mixin.760cd65d.js} +1 -1
  4. package/dist/chunks/{form-item-mixin.b850e028.js → form-item-mixin.fa314b67.js} +14 -3
  5. package/dist/chunks/{tab-mixin.51886d91.js → tab-mixin.9d568df9.js} +1 -1
  6. package/dist/chunks/{vueComponentNormalizer.bf552d98.js → vueComponentNormalizer.77ec6792.js} +1 -1
  7. package/dist/components/address-input/index.js +1 -1
  8. package/dist/components/address-input/style.css +1 -10
  9. package/dist/components/affix/index.js +1 -1
  10. package/dist/components/affix/style.css +1 -4
  11. package/dist/components/aside-menu/index.js +1 -1
  12. package/dist/components/aside-menu/style.css +1 -3
  13. package/dist/components/avatar/index.js +1 -1
  14. package/dist/components/avatar/style.css +1 -51
  15. package/dist/components/awesome-button/index.js +42 -12
  16. package/dist/components/base.css +1 -536
  17. package/dist/components/capsule-tab/index.js +1 -1
  18. package/dist/components/capsule-tab/style.css +1 -26
  19. package/dist/components/card/index.js +1 -1
  20. package/dist/components/card/style.css +1 -84
  21. package/dist/components/carousel/index.js +1 -1
  22. package/dist/components/carousel/style.css +1 -35
  23. package/dist/components/chat/index.js +2 -2
  24. package/dist/components/chat/style.css +1 -277
  25. package/dist/components/chunk-file-uploader/index.js +1 -1
  26. package/dist/components/chunk-file-uploader/style.css +1 -3
  27. package/dist/components/chunk-file-uploader-button/index.js +1 -1
  28. package/dist/components/chunk-file-uploader-button/style.css +1 -16
  29. package/dist/components/chunk-file-uploader-drop/index.js +23 -5
  30. package/dist/components/chunk-file-uploader-drop/style.css +1 -11
  31. package/dist/components/chunk-file-uploader-file/index.js +2 -2
  32. package/dist/components/chunk-file-uploader-file/style.css +1 -124
  33. package/dist/components/chunk-file-uploader-files/index.js +1 -1
  34. package/dist/components/chunk-file-uploader-files/style.css +1 -8
  35. package/dist/components/chunk-file-uploader-list/index.js +1 -1
  36. package/dist/components/chunk-file-uploader-list/style.css +1 -8
  37. package/dist/components/chunk-file-uploader-un-support/index.js +1 -1
  38. package/dist/components/chunk-file-uploader-un-support/style.css +1 -5
  39. package/dist/components/code-mirror-editor/index.js +7 -7
  40. package/dist/components/code-mirror-editor/style.css +1 -11
  41. package/dist/components/color-picker/index.js +21 -3
  42. package/dist/components/column/index.js +1 -1
  43. package/dist/components/column-default/index.js +1 -1
  44. package/dist/components/column-dynamic/index.js +1 -1
  45. package/dist/components/column-menu/index.js +1 -1
  46. package/dist/components/column-slot/index.js +2 -2
  47. package/dist/components/comment/index.js +1 -1
  48. package/dist/components/comment/style.css +1 -110
  49. package/dist/components/confirm-button/index.js +2 -2
  50. package/dist/components/confirmable/index.js +2 -2
  51. package/dist/components/context-menu/index.js +1 -1
  52. package/dist/components/context-menu/style.css +1 -84
  53. package/dist/components/count-up/index.js +15 -4
  54. package/dist/components/custom-scrollbar/index.js +18 -5
  55. package/dist/components/data-box/index.js +1 -1
  56. package/dist/components/data-box/style.css +1 -52
  57. package/dist/components/data-card/index.js +1 -1
  58. package/dist/components/data-card/style.css +1 -35
  59. package/dist/components/data-cardtext/index.js +1 -1
  60. package/dist/components/data-cardtext/style.css +1 -30
  61. package/dist/components/data-display/index.js +1 -1
  62. package/dist/components/data-display/style.css +1 -31
  63. package/dist/components/data-icons/index.js +1 -1
  64. package/dist/components/data-icons/style.css +1 -47
  65. package/dist/components/data-imgtext/index.js +1 -1
  66. package/dist/components/data-imgtext/style.css +1 -65
  67. package/dist/components/data-operatext/index.js +1 -1
  68. package/dist/components/data-operatext/style.css +1 -72
  69. package/dist/components/data-panel/index.js +1 -1
  70. package/dist/components/data-panel/style.css +1 -31
  71. package/dist/components/data-pay/index.js +1 -1
  72. package/dist/components/data-pay/style.css +1 -96
  73. package/dist/components/data-price/index.js +1 -1
  74. package/dist/components/data-price/style.css +1 -75
  75. package/dist/components/data-progress/index.js +1 -1
  76. package/dist/components/data-progress/style.css +1 -24
  77. package/dist/components/data-rotate/index.js +1 -1
  78. package/dist/components/data-rotate/style.css +1 -44
  79. package/dist/components/data-table-picker/index.js +2 -100
  80. package/dist/components/data-tabs/index.js +1 -1
  81. package/dist/components/data-tabs/style.css +1 -64
  82. package/dist/components/dialog-column/index.js +1 -1
  83. package/dist/components/dialog-excel/index.js +2 -2
  84. package/dist/components/dialog-filter/index.js +1 -1
  85. package/dist/components/dialog-form/index.js +1 -1
  86. package/dist/components/dynamic-table/index.js +1 -1
  87. package/dist/components/dynamic-table/style.css +1 -24
  88. package/dist/components/e-charts/index.js +1 -1
  89. package/dist/components/e-charts/style.css +1 -4
  90. package/dist/components/easy-popup/index.js +1 -1
  91. package/dist/components/easy-popup/style.css +1 -12
  92. package/dist/components/editable-progress/index.js +1 -1
  93. package/dist/components/editable-progress/style.css +1 -33
  94. package/dist/components/editable-tree/index.js +206 -451
  95. package/dist/components/editable-tree/style.css +1 -79
  96. package/dist/components/egd-collapse/index.js +1 -1
  97. package/dist/components/egd-collapse-item/index.js +1 -1
  98. package/dist/components/element-dialog/index.js +2 -11
  99. package/dist/components/element-dialog/style.css +1 -82
  100. package/dist/components/empty-view/index.js +1 -1
  101. package/dist/components/empty-view/style.css +1 -11
  102. package/dist/components/error-view/index.js +1 -1
  103. package/dist/components/error-view/style.css +1 -11
  104. package/dist/components/flex-column/index.js +14 -2
  105. package/dist/components/flex-item/index.js +15 -3
  106. package/dist/components/flex-row/index.js +14 -2
  107. package/dist/components/flex-scroller/index.js +1 -1
  108. package/dist/components/flex-scroller/style.css +1 -14
  109. package/dist/components/flow/index.js +1 -1
  110. package/dist/components/flow/style.css +1 -38
  111. package/dist/components/flow-node/index.js +1 -1
  112. package/dist/components/flow-viewer/index.js +34 -7
  113. package/dist/components/flow-viewer/style.css +1 -13
  114. package/dist/components/form-button/index.js +2 -2
  115. package/dist/components/form-cascader/index.js +14 -3
  116. package/dist/components/form-checkbox-group/index.js +14 -3
  117. package/dist/components/form-checkbox-group/style.css +1 -45
  118. package/dist/components/form-date-picker/index.js +20 -11
  119. package/dist/components/form-group/index.js +1 -1
  120. package/dist/components/form-group/style.css +1 -76
  121. package/dist/components/form-holder/index.js +21 -3
  122. package/dist/components/form-input/index.js +14 -3
  123. package/dist/components/form-input-email/index.js +14 -3
  124. package/dist/components/form-input-id-card/index.js +14 -3
  125. package/dist/components/form-input-number/index.js +14 -3
  126. package/dist/components/form-input-number/style.css +1 -6
  127. package/dist/components/form-input-phone-number/index.js +14 -3
  128. package/dist/components/form-input-time/index.js +14 -3
  129. package/dist/components/form-item/index.js +43 -15
  130. package/dist/components/form-item/style.css +1 -5
  131. package/dist/components/form-item-config-provider/index.js +1 -1
  132. package/dist/components/form-item-group/index.js +1 -1
  133. package/dist/components/form-item-group/style.css +1 -25
  134. package/dist/components/form-radio-group/index.js +14 -3
  135. package/dist/components/form-radio-group/style.css +1 -47
  136. package/dist/components/form-select/index.js +14 -3
  137. package/dist/components/form-switch/index.js +14 -3
  138. package/dist/components/form-temp/index.js +1 -1
  139. package/dist/components/form-textarea/index.js +14 -3
  140. package/dist/components/form-view/index.js +35 -13
  141. package/dist/components/form-view/style.css +1 -155
  142. package/dist/components/fy-array/index.js +1 -1
  143. package/dist/components/fy-array/style.css +1 -12
  144. package/dist/components/fy-article/index.js +1 -1
  145. package/dist/components/fy-article/style.css +1 -56
  146. package/dist/components/fy-cascader/index.js +1 -1
  147. package/dist/components/fy-checkbox/index.js +1 -1
  148. package/dist/components/fy-checkbox/style.css +1 -9
  149. package/dist/components/fy-code/index.js +1 -1
  150. package/dist/components/fy-curd/index.js +1 -1
  151. package/dist/components/fy-curd/style.css +1 -236
  152. package/dist/components/fy-date/index.js +1 -1
  153. package/dist/components/fy-date/style.css +1 -15
  154. package/dist/components/fy-dialog-form/index.js +1 -1
  155. package/dist/components/fy-dialog-form/style.css +1 -0
  156. package/dist/components/fy-draggable/index.js +1 -1
  157. package/dist/components/fy-draggable/style.css +1 -136
  158. package/dist/components/fy-dynamic/index.js +1 -1
  159. package/dist/components/fy-dynamic/style.css +1 -29
  160. package/dist/components/fy-empty/index.js +1 -1
  161. package/dist/components/fy-empty/style.css +1 -18
  162. package/dist/components/fy-form/index.js +23 -5
  163. package/dist/components/fy-form/style.css +1 -73
  164. package/dist/components/fy-form-design/index.js +73 -49
  165. package/dist/components/fy-form-design/style.css +1 -560
  166. package/dist/components/fy-form-menu/index.js +1 -1
  167. package/dist/components/fy-input/index.js +1 -1
  168. package/dist/components/fy-input-color/index.js +1 -1
  169. package/dist/components/fy-input-icon/index.js +1 -1
  170. package/dist/components/fy-input-icon/style.css +1 -33
  171. package/dist/components/fy-input-map/index.js +1 -1
  172. package/dist/components/fy-input-map/style.css +1 -44
  173. package/dist/components/fy-input-number/index.js +1 -1
  174. package/dist/components/fy-input-table/index.js +1 -1
  175. package/dist/components/fy-input-table/style.css +1 -4
  176. package/dist/components/fy-input-tree/index.js +1 -1
  177. package/dist/components/fy-input-tree/style.css +1 -19
  178. package/dist/components/fy-progress/index.js +1 -1
  179. package/dist/components/fy-radio/index.js +1 -1
  180. package/dist/components/fy-radio/style.css +1 -6
  181. package/dist/components/fy-rate/index.js +1 -1
  182. package/dist/components/fy-rate/style.css +1 -3
  183. package/dist/components/fy-select/index.js +1 -1
  184. package/dist/components/fy-select/style.css +1 -19
  185. package/dist/components/fy-slider/index.js +1 -1
  186. package/dist/components/fy-switch/index.js +1 -1
  187. package/dist/components/fy-tabs/index.js +1 -1
  188. package/dist/components/fy-time/index.js +1 -1
  189. package/dist/components/fy-title/index.js +1 -1
  190. package/dist/components/fy-title/style.css +1 -5
  191. package/dist/components/fy-tree/index.js +1 -1
  192. package/dist/components/fy-tree/style.css +1 -39
  193. package/dist/components/fy-u-editor/index.js +47 -14
  194. package/dist/components/fy-u-editor/style.css +1 -9
  195. package/dist/components/fy-upload/index.js +1 -1
  196. package/dist/components/fy-upload/style.css +1 -55
  197. package/dist/components/guide-steps/index.js +1 -1
  198. package/dist/components/guide-steps/style.css +1 -28
  199. package/dist/components/header-menu/index.js +1 -1
  200. package/dist/components/header-search/index.js +1 -1
  201. package/dist/components/highlight-j-s/index.js +1 -1
  202. package/dist/components/highlight-j-s/style.css +1 -18
  203. package/dist/components/icon-card/index.js +1 -1
  204. package/dist/components/icon-card/style.css +1 -50
  205. package/dist/components/icon-temp/index.js +1 -1
  206. package/dist/components/icon-temp/style.css +1 -17
  207. package/dist/components/iframe-window/index.js +1 -1
  208. package/dist/components/iframe-window/style.css +1 -14
  209. package/dist/components/image-cropper/index.js +15 -6
  210. package/dist/components/image-cropper/style.css +1 -28
  211. package/dist/components/image-preview/index.js +15 -5
  212. package/dist/components/image-preview/style.css +1 -66
  213. package/dist/components/image-viewer/index.js +1 -1
  214. package/dist/components/image-viewer/style.css +1 -15
  215. package/dist/components/input-number/index.js +1 -1
  216. package/dist/components/input-number/style.css +1 -9
  217. package/dist/components/input-number-range/index.js +1 -1
  218. package/dist/components/input-number-range/style.css +1 -6
  219. package/dist/components/keep-view-alive/index.js +1 -1
  220. package/dist/components/keyboard/index.js +1 -1
  221. package/dist/components/keyboard/style.css +1 -473
  222. package/dist/components/license/index.js +1 -1
  223. package/dist/components/loading-view/index.js +1 -1
  224. package/dist/components/loading-view/style.css +1 -11
  225. package/dist/components/login/index.js +1 -1
  226. package/dist/components/login/style.css +1 -19
  227. package/dist/components/name-avatar/index.js +1 -1
  228. package/dist/components/name-avatar/style.css +1 -30
  229. package/dist/components/nav-bar/index.js +1 -1
  230. package/dist/components/nav-bar/style.css +1 -11
  231. package/dist/components/not-implement/index.js +1 -1
  232. package/dist/components/not-implement/style.css +1 -9
  233. package/dist/components/notice/index.js +1 -1
  234. package/dist/components/notice/style.css +1 -48
  235. package/dist/components/page/index.js +1 -1
  236. package/dist/components/page/style.css +1 -6
  237. package/dist/components/page-header/index.js +1 -1
  238. package/dist/components/page-header/style.css +1 -8
  239. package/dist/components/page-index/index.js +42 -18
  240. package/dist/components/page-index/style.css +1 -17
  241. package/dist/components/page-index-top/index.js +38 -16
  242. package/dist/components/page-skeleton/index.js +1 -1
  243. package/dist/components/page-skeleton/style.css +1 -17
  244. package/dist/components/page-skeleton-new/index.js +1 -1
  245. package/dist/components/page-skeleton-new/style.css +1 -36
  246. package/dist/components/pageable-table/index.js +78 -34
  247. package/dist/components/pageable-table/style.css +1 -66
  248. package/dist/components/pageable-view/index.js +78 -34
  249. package/dist/components/pageable-view/style.css +1 -63
  250. package/dist/components/photo-swipe/index.js +46 -24
  251. package/dist/components/process-designer/index.js +80 -50
  252. package/dist/components/process-designer/style.css +1 -1648
  253. package/dist/components/properties-panel/index.js +77 -51
  254. package/dist/components/properties-panel/style.css +1 -106
  255. package/dist/components/queue/index.js +1 -1
  256. package/dist/components/record-video/index.js +1 -1
  257. package/dist/components/record-video/style.css +1 -47
  258. package/dist/components/resize-observer/index.js +1 -1
  259. package/dist/components/resize-observer/style.css +1 -25
  260. package/dist/components/search/index.js +1 -1
  261. package/dist/components/search/style.css +1 -51
  262. package/dist/components/search-popover/index.js +29 -9
  263. package/dist/components/search-popover/style.css +1 -90
  264. package/dist/components/sign/index.js +2 -2
  265. package/dist/components/sign/style.css +1 -6
  266. package/dist/components/sign-panel/index.js +1 -1
  267. package/dist/components/sign-panel/style.css +1 -91
  268. package/dist/components/skeleton/index.js +1 -1
  269. package/dist/components/skeleton/style.css +1 -55
  270. package/dist/components/split-pane/index.js +21 -3
  271. package/dist/components/split-pane/style.css +1 -98
  272. package/dist/components/stateful/index.js +1 -1
  273. package/dist/components/stateful/style.css +1 -27
  274. package/dist/components/static-pageable-table/index.js +1 -1
  275. package/dist/components/static-pageable-table/style.css +1 -3
  276. package/dist/components/swiper/index.js +25 -5
  277. package/dist/components/swiper/style.css +1 -37
  278. package/dist/components/tab/index.js +2 -2
  279. package/dist/components/tab/style.css +1 -108
  280. package/dist/components/tab-item/index.js +3 -3
  281. package/dist/components/table-column/index.js +17 -7
  282. package/dist/components/table-page/index.js +1 -1
  283. package/dist/components/table-view/index.js +62 -36
  284. package/dist/components/table-view/style.css +1 -90
  285. package/dist/components/tag-render/index.js +13 -2
  286. package/dist/components/tag-render/style.css +1 -27
  287. package/dist/components/text-ellipsis/index.js +1 -1
  288. package/dist/components/text-ellipsis/style.css +1 -3
  289. package/dist/components/tinymce-editor/index.js +27 -9
  290. package/dist/components/tinymce-editor/style.css +1 -37
  291. package/dist/components/tinymce-wrapper/index.js +17 -7
  292. package/dist/components/tinymce-wrapper/style.css +1 -30
  293. package/dist/components/toolbar/index.js +4 -4
  294. package/dist/components/toolbar/style.css +1 -35
  295. package/dist/components/toolbar-button/index.js +28 -10
  296. package/dist/components/toolbar-button/style.css +1 -15
  297. package/dist/components/trigger/index.js +1 -1
  298. package/dist/components/verify/index.js +1 -1
  299. package/dist/components/verify/style.css +1 -9
  300. package/dist/components/vue-tags-input/index.js +1 -1
  301. package/dist/components/vue-tags-input/style.css +1 -102
  302. package/dist/components/watermark/index.js +15 -5
  303. package/dist/components/watermark/style.css +1 -10
  304. package/dist/index.css +26 -68
  305. package/dist/index.es.js +780 -1310
  306. package/package.json +4 -4
  307. package/web-types.json +1 -1
  308. package/dist/chunks/confirmable-mixin.7112b769.js +0 -75
  309. package/dist/chunks/dayjs.b0f2f7d9.js +0 -247
  310. package/dist/components/dialog-form/style.css +0 -5
@@ -1,306 +1,36 @@
1
- import { hasOwn, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
2
- import { cloneDeep } from "@web-utils/integrations/lodash";
3
- import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.d7f73f8d.js";
4
- import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.bf552d98.js";
5
- var MapShim = function() {
6
- if (typeof Map < "u")
7
- return Map;
8
- function getIndex(arr, key) {
9
- var result = -1;
10
- return arr.some(function(entry, index2) {
11
- return entry[0] === key ? (result = index2, !0) : !1;
12
- }), result;
13
- }
14
- return (
15
- /** @class */
16
- function() {
17
- function class_1() {
18
- this.__entries__ = [];
19
- }
20
- return Object.defineProperty(class_1.prototype, "size", {
21
- /**
22
- * @returns {boolean}
23
- */
24
- get: function() {
25
- return this.__entries__.length;
26
- },
27
- enumerable: !0,
28
- configurable: !0
29
- }), class_1.prototype.get = function(key) {
30
- var index2 = getIndex(this.__entries__, key), entry = this.__entries__[index2];
31
- return entry && entry[1];
32
- }, class_1.prototype.set = function(key, value) {
33
- var index2 = getIndex(this.__entries__, key);
34
- ~index2 ? this.__entries__[index2][1] = value : this.__entries__.push([key, value]);
35
- }, class_1.prototype.delete = function(key) {
36
- var entries = this.__entries__, index2 = getIndex(entries, key);
37
- ~index2 && entries.splice(index2, 1);
38
- }, class_1.prototype.has = function(key) {
39
- return !!~getIndex(this.__entries__, key);
40
- }, class_1.prototype.clear = function() {
41
- this.__entries__.splice(0);
42
- }, class_1.prototype.forEach = function(callback, ctx) {
43
- ctx === void 0 && (ctx = null);
44
- for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
45
- var entry = _a[_i];
46
- callback.call(ctx, entry[1], entry[0]);
47
- }
48
- }, class_1;
49
- }()
50
- );
51
- }(), isBrowser = typeof window < "u" && typeof document < "u" && window.document === document, global$1 = function() {
52
- return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
53
- }(), requestAnimationFrame$1 = function() {
54
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(global$1) : function(callback) {
55
- return setTimeout(function() {
56
- return callback(Date.now());
57
- }, 1e3 / 60);
58
- };
59
- }(), trailingTimeout = 2;
60
- function throttle(callback, delay2) {
61
- var leadingCall = !1, trailingCall = !1, lastCallTime = 0;
62
- function resolvePending() {
63
- leadingCall && (leadingCall = !1, callback()), trailingCall && proxy();
64
- }
65
- function timeoutCallback() {
66
- requestAnimationFrame$1(resolvePending);
67
- }
68
- function proxy() {
69
- var timeStamp = Date.now();
70
- if (leadingCall) {
71
- if (timeStamp - lastCallTime < trailingTimeout)
72
- return;
73
- trailingCall = !0;
74
- } else
75
- leadingCall = !0, trailingCall = !1, setTimeout(timeoutCallback, delay2);
76
- lastCallTime = timeStamp;
77
- }
78
- return proxy;
79
- }
80
- var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], mutationObserverSupported = typeof MutationObserver < "u", ResizeObserverController = (
81
- /** @class */
82
- function() {
83
- function ResizeObserverController2() {
84
- this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
1
+ var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
2
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
6
+ for (var prop in b || (b = {}))
7
+ __hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
8
+ if (__getOwnPropSymbols)
9
+ for (var prop of __getOwnPropSymbols(b))
10
+ __propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
11
+ return a;
12
+ }, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13
+ var __async = (__this, __arguments, generator) => new Promise((resolve, reject) => {
14
+ var fulfilled = (value) => {
15
+ try {
16
+ step(generator.next(value));
17
+ } catch (e) {
18
+ reject(e);
85
19
  }
86
- return ResizeObserverController2.prototype.addObserver = function(observer) {
87
- ~this.observers_.indexOf(observer) || this.observers_.push(observer), this.connected_ || this.connect_();
88
- }, ResizeObserverController2.prototype.removeObserver = function(observer) {
89
- var observers2 = this.observers_, index2 = observers2.indexOf(observer);
90
- ~index2 && observers2.splice(index2, 1), !observers2.length && this.connected_ && this.disconnect_();
91
- }, ResizeObserverController2.prototype.refresh = function() {
92
- var changesDetected = this.updateObservers_();
93
- changesDetected && this.refresh();
94
- }, ResizeObserverController2.prototype.updateObservers_ = function() {
95
- var activeObservers = this.observers_.filter(function(observer) {
96
- return observer.gatherActive(), observer.hasActive();
97
- });
98
- return activeObservers.forEach(function(observer) {
99
- return observer.broadcastActive();
100
- }), activeObservers.length > 0;
101
- }, ResizeObserverController2.prototype.connect_ = function() {
102
- !isBrowser || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), mutationObserverSupported ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
103
- attributes: !0,
104
- childList: !0,
105
- characterData: !0,
106
- subtree: !0
107
- })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
108
- }, ResizeObserverController2.prototype.disconnect_ = function() {
109
- !isBrowser || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
110
- }, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
111
- var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
112
- return !!~propertyName.indexOf(key);
113
- });
114
- isReflowProperty && this.refresh();
115
- }, ResizeObserverController2.getInstance = function() {
116
- return this.instance_ || (this.instance_ = new ResizeObserverController2()), this.instance_;
117
- }, ResizeObserverController2.instance_ = null, ResizeObserverController2;
118
- }()
119
- ), defineConfigurable = function(target, props) {
120
- for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
121
- var key = _a[_i];
122
- Object.defineProperty(target, key, {
123
- value: props[key],
124
- enumerable: !1,
125
- writable: !1,
126
- configurable: !0
127
- });
128
- }
129
- return target;
130
- }, getWindowOf = function(target) {
131
- var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
132
- return ownerGlobal || global$1;
133
- }, emptyRect = createRectInit(0, 0, 0, 0);
134
- function toFloat(value) {
135
- return parseFloat(value) || 0;
136
- }
137
- function getBordersSize(styles) {
138
- for (var positions = [], _i = 1; _i < arguments.length; _i++)
139
- positions[_i - 1] = arguments[_i];
140
- return positions.reduce(function(size, position) {
141
- var value = styles["border-" + position + "-width"];
142
- return size + toFloat(value);
143
- }, 0);
144
- }
145
- function getPaddings(styles) {
146
- for (var positions = ["top", "right", "bottom", "left"], paddings = {}, _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
147
- var position = positions_1[_i], value = styles["padding-" + position];
148
- paddings[position] = toFloat(value);
149
- }
150
- return paddings;
151
- }
152
- function getSVGContentRect(target) {
153
- var bbox = target.getBBox();
154
- return createRectInit(0, 0, bbox.width, bbox.height);
155
- }
156
- function getHTMLElementContentRect(target) {
157
- var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
158
- if (!clientWidth && !clientHeight)
159
- return emptyRect;
160
- var styles = getWindowOf(target).getComputedStyle(target), paddings = getPaddings(styles), horizPad = paddings.left + paddings.right, vertPad = paddings.top + paddings.bottom, width = toFloat(styles.width), height = toFloat(styles.height);
161
- if (styles.boxSizing === "border-box" && (Math.round(width + horizPad) !== clientWidth && (width -= getBordersSize(styles, "left", "right") + horizPad), Math.round(height + vertPad) !== clientHeight && (height -= getBordersSize(styles, "top", "bottom") + vertPad)), !isDocumentElement(target)) {
162
- var vertScrollbar = Math.round(width + horizPad) - clientWidth, horizScrollbar = Math.round(height + vertPad) - clientHeight;
163
- Math.abs(vertScrollbar) !== 1 && (width -= vertScrollbar), Math.abs(horizScrollbar) !== 1 && (height -= horizScrollbar);
164
- }
165
- return createRectInit(paddings.left, paddings.top, width, height);
166
- }
167
- var isSVGGraphicsElement = function() {
168
- return typeof SVGGraphicsElement < "u" ? function(target) {
169
- return target instanceof getWindowOf(target).SVGGraphicsElement;
170
- } : function(target) {
171
- return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox == "function";
172
- };
173
- }();
174
- function isDocumentElement(target) {
175
- return target === getWindowOf(target).document.documentElement;
176
- }
177
- function getContentRect(target) {
178
- return isBrowser ? isSVGGraphicsElement(target) ? getSVGContentRect(target) : getHTMLElementContentRect(target) : emptyRect;
179
- }
180
- function createReadOnlyRect(_a) {
181
- var x = _a.x, y = _a.y, width = _a.width, height = _a.height, Constr = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
182
- return defineConfigurable(rect, {
183
- x,
184
- y,
185
- width,
186
- height,
187
- top: y,
188
- right: x + width,
189
- bottom: height + y,
190
- left: x
191
- }), rect;
192
- }
193
- function createRectInit(x, y, width, height) {
194
- return { x, y, width, height };
195
- }
196
- var ResizeObservation = (
197
- /** @class */
198
- function() {
199
- function ResizeObservation2(target) {
200
- this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = createRectInit(0, 0, 0, 0), this.target = target;
20
+ }, rejected = (value) => {
21
+ try {
22
+ step(generator.throw(value));
23
+ } catch (e) {
24
+ reject(e);
201
25
  }
202
- return ResizeObservation2.prototype.isActive = function() {
203
- var rect = getContentRect(this.target);
204
- return this.contentRect_ = rect, rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
205
- }, ResizeObservation2.prototype.broadcastRect = function() {
206
- var rect = this.contentRect_;
207
- return this.broadcastWidth = rect.width, this.broadcastHeight = rect.height, rect;
208
- }, ResizeObservation2;
209
- }()
210
- ), ResizeObserverEntry = (
211
- /** @class */
212
- function() {
213
- function ResizeObserverEntry2(target, rectInit) {
214
- var contentRect = createReadOnlyRect(rectInit);
215
- defineConfigurable(this, { target, contentRect });
216
- }
217
- return ResizeObserverEntry2;
218
- }()
219
- ), ResizeObserverSPI = (
220
- /** @class */
221
- function() {
222
- function ResizeObserverSPI2(callback, controller, callbackCtx) {
223
- if (this.activeObservations_ = [], this.observations_ = new MapShim(), typeof callback != "function")
224
- throw new TypeError("The callback provided as parameter 1 is not a function.");
225
- this.callback_ = callback, this.controller_ = controller, this.callbackCtx_ = callbackCtx;
226
- }
227
- return ResizeObserverSPI2.prototype.observe = function(target) {
228
- if (!arguments.length)
229
- throw new TypeError("1 argument required, but only 0 present.");
230
- if (!(typeof Element > "u" || !(Element instanceof Object))) {
231
- if (!(target instanceof getWindowOf(target).Element))
232
- throw new TypeError('parameter 1 is not of type "Element".');
233
- var observations = this.observations_;
234
- observations.has(target) || (observations.set(target, new ResizeObservation(target)), this.controller_.addObserver(this), this.controller_.refresh());
235
- }
236
- }, ResizeObserverSPI2.prototype.unobserve = function(target) {
237
- if (!arguments.length)
238
- throw new TypeError("1 argument required, but only 0 present.");
239
- if (!(typeof Element > "u" || !(Element instanceof Object))) {
240
- if (!(target instanceof getWindowOf(target).Element))
241
- throw new TypeError('parameter 1 is not of type "Element".');
242
- var observations = this.observations_;
243
- observations.has(target) && (observations.delete(target), observations.size || this.controller_.removeObserver(this));
244
- }
245
- }, ResizeObserverSPI2.prototype.disconnect = function() {
246
- this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
247
- }, ResizeObserverSPI2.prototype.gatherActive = function() {
248
- var _this = this;
249
- this.clearActive(), this.observations_.forEach(function(observation) {
250
- observation.isActive() && _this.activeObservations_.push(observation);
251
- });
252
- }, ResizeObserverSPI2.prototype.broadcastActive = function() {
253
- if (this.hasActive()) {
254
- var ctx = this.callbackCtx_, entries = this.activeObservations_.map(function(observation) {
255
- return new ResizeObserverEntry(observation.target, observation.broadcastRect());
256
- });
257
- this.callback_.call(ctx, entries, ctx), this.clearActive();
258
- }
259
- }, ResizeObserverSPI2.prototype.clearActive = function() {
260
- this.activeObservations_.splice(0);
261
- }, ResizeObserverSPI2.prototype.hasActive = function() {
262
- return this.activeObservations_.length > 0;
263
- }, ResizeObserverSPI2;
264
- }()
265
- ), observers = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new MapShim(), ResizeObserver = (
266
- /** @class */
267
- function() {
268
- function ResizeObserver2(callback) {
269
- if (!(this instanceof ResizeObserver2))
270
- throw new TypeError("Cannot call a class as a function.");
271
- if (!arguments.length)
272
- throw new TypeError("1 argument required, but only 0 present.");
273
- var controller = ResizeObserverController.getInstance(), observer = new ResizeObserverSPI(callback, controller, this);
274
- observers.set(this, observer);
275
- }
276
- return ResizeObserver2;
277
- }()
278
- );
279
- [
280
- "observe",
281
- "unobserve",
282
- "disconnect"
283
- ].forEach(function(method) {
284
- ResizeObserver.prototype[method] = function() {
285
- var _a;
286
- return (_a = observers.get(this))[method].apply(_a, arguments);
287
- };
26
+ }, step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
27
+ step((generator = generator.apply(__this, __arguments)).next());
288
28
  });
289
- var index = function() {
290
- return typeof global$1.ResizeObserver < "u" ? global$1.ResizeObserver : ResizeObserver;
291
- }();
292
- const isServer = typeof window > "u", resizeHandler = (entries) => {
293
- for (const entry of entries) {
294
- const listeners = entry.target.__resizeListeners__ || [];
295
- listeners.length && listeners.forEach((fn) => {
296
- fn();
297
- });
298
- }
299
- }, addResizeListener = (element, fn) => {
300
- isServer || (element.__resizeListeners__ || (element.__resizeListeners__ = [], element.__ro__ = new index(resizeHandler), element.__ro__.observe(element)), element.__resizeListeners__.push(fn));
301
- }, removeResizeListener = (element, fn) => {
302
- !element || !element.__resizeListeners__ || (element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1), element.__resizeListeners__.length || element.__ro__.disconnect());
303
- };
29
+ import { hasOwn, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
30
+ import { addResizeListener, removeResizeListener } from "@web-utils/integrations/resize";
31
+ import { cloneDeep } from "@web-utils/integrations/lodash";
32
+ import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.d7f73f8d.js";
33
+ import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
304
34
  var render = function() {
305
35
  var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
306
36
  return _c("div", {
@@ -799,45 +529,51 @@ const __vue2_script = {
799
529
  resize() {
800
530
  isVerticalScrollbarVisible(this.$refs.treeWrapper) ? this.right = 4 + scrollbarWidth : this.right = 4;
801
531
  },
802
- async showContextMenu(event, data, node) {
803
- data.contextmenu === !1 || data.id === -1 || data.id === 0 || data.edit === !0 || this.contextMenu && (this.curNode = node, this.curData = data, this.showMenu = !0, this.$refs.tree.setCurrentKey(data.id), await this.$nextTick(), this.position = computePosition(event, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
532
+ showContextMenu(event, data, node) {
533
+ return __async(this, null, function* () {
534
+ data.contextmenu === !1 || data.id === -1 || data.id === 0 || data.edit === !0 || this.contextMenu && (this.curNode = node, this.curData = data, this.showMenu = !0, this.$refs.tree.setCurrentKey(data.id), yield this.$nextTick(), this.position = computePosition(event, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
535
+ });
804
536
  },
805
537
  hideContextMenu() {
806
538
  this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
807
539
  },
808
- async tryFetch() {
809
- var _a;
810
- if (this.lazy === !1 && this.fetchApi) {
811
- const res = await this.fetchApi(((_a = this.rootNode) == null ? void 0 : _a.id) ?? -1, {});
812
- if (isPlainObject(res.data) && (res.data = [res.data]), res.data = res.data || [], this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
813
- const data = cloneDeep(this.customRootNode);
814
- data[this.treeProps.children || "children"] = res.data, this.treeData = [data];
815
- } else if (isFunction(this.customRootNode)) {
816
- const data = this.customRootNode(res.data);
817
- data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
818
- } else
819
- this.treeData = res.data;
820
- }
540
+ tryFetch() {
541
+ return __async(this, null, function* () {
542
+ var _a, _b;
543
+ if (this.lazy === !1 && this.fetchApi) {
544
+ const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, {});
545
+ if (isPlainObject(res.data) && (res.data = [res.data]), res.data = res.data || [], this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
546
+ const data = cloneDeep(this.customRootNode);
547
+ data[this.treeProps.children || "children"] = res.data, this.treeData = [data];
548
+ } else if (isFunction(this.customRootNode)) {
549
+ const data = this.customRootNode(res.data);
550
+ data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
551
+ } else
552
+ this.treeData = res.data;
553
+ }
554
+ });
821
555
  },
822
- async loadNode(node, resolve) {
823
- var _a, _b, _c;
824
- if (node.level === 0) {
825
- const res = await this.fetchApi(((_a = this.rootNode) == null ? void 0 : _a.id) ?? -1, node);
826
- if (this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
827
- const data = cloneDeep(this.customRootNode);
828
- data[this.treeProps.children || "children"] = res.data, resolve([data]);
829
- } else if (isFunction(this.customRootNode)) {
830
- const data = this.customRootNode(res.data);
831
- data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
832
- } else
833
- resolve(res.data);
834
- await this.$nextTick(), this.$emit("root-node-loaded", res.data), this.defaultExpandedKeys ? this.expandedKeys = [(_b = res == null ? void 0 : res.data[0]) == null ? void 0 : _b.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id]);
835
- } else {
836
- if (node.leaf || node.data.isTempNode)
837
- return resolve([]);
838
- const res = await this.fetchApi(node.data.id, node);
839
- resolve(res.data), await this.$nextTick(), this.$emit("node-loaded", res.data);
840
- }
556
+ loadNode(node, resolve) {
557
+ return __async(this, null, function* () {
558
+ var _a, _b, _c, _d;
559
+ if (node.level === 0) {
560
+ const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, node);
561
+ if (this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
562
+ const data = cloneDeep(this.customRootNode);
563
+ data[this.treeProps.children || "children"] = res.data, resolve([data]);
564
+ } else if (isFunction(this.customRootNode)) {
565
+ const data = this.customRootNode(res.data);
566
+ data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
567
+ } else
568
+ resolve(res.data);
569
+ yield this.$nextTick(), this.$emit("root-node-loaded", res.data), this.defaultExpandedKeys ? this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(_d = res == null ? void 0 : res.data[0]) == null ? void 0 : _d.id]);
570
+ } else {
571
+ if (node.leaf || node.data.isTempNode)
572
+ return resolve([]);
573
+ const res = yield this.fetchApi(node.data.id, node);
574
+ resolve(res.data), yield this.$nextTick(), this.$emit("node-loaded", res.data);
575
+ }
576
+ });
841
577
  },
842
578
  clear() {
843
579
  this.cancelEdit(), this.removeNewNode();
@@ -851,67 +587,68 @@ const __vue2_script = {
851
587
  cancelEdit() {
852
588
  this.editData && (isUndefined(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
853
589
  },
854
- async editNode(node, data) {
855
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = data, this.text = data[this.treeProps.label], isUndefined(data.edit) ? this.$set(data, "edit", !0) : data.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await this.$prompt(`请输入新的${this.label}名:`, {
856
- ...this.defaultOptions,
857
- inputValue: data[this.treeProps.label],
858
- beforeClose: async (action, instance, done) => {
859
- if (action === "confirm") {
860
- try {
861
- instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...", this.text = instance.inputValue, await this.onConfirm(this.curNode, this.curData), done();
862
- } catch {
863
- instance.confirmButtonText = "确定";
864
- }
865
- instance.confirmButtonLoading = !1;
866
- } else
867
- done();
868
- }
869
- }).catch((_) => _);
870
- },
871
- async appendRootNode() {
872
- this.text = "", !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(void 0), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.scrollIntoView(!0)) : await this.$prompt(`请输入${this.label}名:`, {
873
- ...this.defaultOptions,
874
- beforeClose: async (action, instance, done) => {
875
- if (action === "confirm") {
876
- try {
877
- this.createNewChild(-1), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
878
- const res = await this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
879
- this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.locateView(), done();
880
- } catch {
881
- instance.confirmButtonText = "确定";
882
- }
883
- instance.confirmButtonLoading = !1;
884
- } else
885
- done();
886
- }
887
- }).catch((_) => _);
590
+ editNode(node, data) {
591
+ return __async(this, null, function* () {
592
+ !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = data, this.text = data[this.treeProps.label], isUndefined(data.edit) ? this.$set(data, "edit", !0) : data.edit = !0, yield this.$nextTick(), this.$refs.labelTxt.focus()) : yield this.$prompt(`请输入新的${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
593
+ inputValue: data[this.treeProps.label],
594
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
595
+ if (action === "confirm") {
596
+ try {
597
+ instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...", this.text = instance.inputValue, yield this.onConfirm(this.curNode, this.curData), done();
598
+ } catch (e) {
599
+ instance.confirmButtonText = "确定";
600
+ }
601
+ instance.confirmButtonLoading = !1;
602
+ } else
603
+ done();
604
+ })
605
+ })).catch((_) => _);
606
+ });
607
+ },
608
+ appendRootNode() {
609
+ return __async(this, null, function* () {
610
+ this.text = "", !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(void 0), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.scrollIntoView(!0)) : yield this.$prompt(`请输入${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
611
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
612
+ if (action === "confirm") {
613
+ try {
614
+ this.createNewChild(-1), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
615
+ const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
616
+ this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.locateView(), done();
617
+ } catch (e) {
618
+ instance.confirmButtonText = "确定";
619
+ }
620
+ instance.confirmButtonLoading = !1;
621
+ } else
622
+ done();
623
+ })
624
+ })).catch((_) => _);
625
+ });
888
626
  },
889
627
  appendChildNode(node) {
890
628
  this.text = "";
891
629
  const expanded = node.expanded;
892
- node.expand(async () => {
893
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(node.data.id), this.$refs.tree.append(this.newChild, node), await this.scrollIntoView(expanded)) : await this.$prompt(`请输入${this.label}名:`, {
894
- ...this.defaultOptions,
895
- beforeClose: async (action, instance, done) => {
630
+ node.expand(() => __async(this, null, function* () {
631
+ !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(node.data.id), this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded)) : yield this.$prompt(`请输入${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
632
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
896
633
  if (action === "confirm") {
897
634
  try {
898
635
  this.createNewChild(node.data.id), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
899
- const res = await this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
900
- this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.append(this.newChild, node), await this.locateView(), done();
901
- } catch {
636
+ const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
637
+ this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.append(this.newChild, node), yield this.locateView(), done();
638
+ } catch (e) {
902
639
  instance.confirmButtonText = "确定";
903
640
  }
904
641
  instance.confirmButtonLoading = !1;
905
642
  } else
906
643
  done();
907
- }
908
- }).catch((_) => _);
909
- });
644
+ })
645
+ })).catch((_) => _);
646
+ }));
910
647
  },
911
648
  appendChildNodeWithData(node, parentId, label) {
912
649
  this.text = "";
913
650
  const expanded = node.expanded;
914
- node.expand(async () => {
651
+ node.expand(() => __async(this, null, function* () {
915
652
  this.clear(), this.newChild = {
916
653
  id: -1,
917
654
  parentId,
@@ -919,24 +656,30 @@ const __vue2_script = {
919
656
  edit: !1,
920
657
  isTempNode: !0,
921
658
  hasChildren: !1
922
- }, this.$refs.tree.append(this.newChild, node), await this.scrollIntoView(expanded);
923
- });
659
+ }, this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded);
660
+ }));
924
661
  },
925
662
  appendPeerNode(node) {
926
663
  node.parent && node.parent.level !== 0 ? this.appendChildNode(node.parent) : this.appendRootNode();
927
664
  },
928
- async addRootNode(data) {
929
- this.$refs.tree.remove(data), await this.$nextTick(), this.$refs.tree.root.insertChild({ data }, void 0, !0);
665
+ addRootNode(data) {
666
+ return __async(this, null, function* () {
667
+ this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.root.insertChild({ data }, void 0, !0);
668
+ });
930
669
  },
931
- async addChildNode(data) {
932
- this.curNode && this.curNode.level !== 0 ? this.curNode.expand(async () => {
933
- this.$refs.tree.remove(data), await this.$nextTick(), this.$refs.tree.append(data, this.curNode);
934
- }) : await this.addRootNode(data);
670
+ addChildNode(data) {
671
+ return __async(this, null, function* () {
672
+ this.curNode && this.curNode.level !== 0 ? this.curNode.expand(() => __async(this, null, function* () {
673
+ this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode);
674
+ })) : yield this.addRootNode(data);
675
+ });
935
676
  },
936
- async addPeerNode(data) {
937
- this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(async () => {
938
- this.$refs.tree.remove(data), await this.$nextTick(), this.$refs.tree.append(data, this.curNode.parent);
939
- }) : await this.addRootNode(data);
677
+ addPeerNode(data) {
678
+ return __async(this, null, function* () {
679
+ this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(() => __async(this, null, function* () {
680
+ this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode.parent);
681
+ })) : yield this.addRootNode(data);
682
+ });
940
683
  },
941
684
  updateNode(data) {
942
685
  const node = this.$refs.tree.getNode(data);
@@ -955,60 +698,66 @@ const __vue2_script = {
955
698
  hasChildren: !1
956
699
  }, this.$emit("create-new-node", this.newChild);
957
700
  },
958
- async removeNodeModal(node) {
959
- await this.$confirm(
960
- `你确定要删除${this.label}[<span class="break-word" style="color: orange">${node.data[this.treeProps.label]}</span>]吗?`,
961
- "系统提示",
962
- {
963
- type: "warning",
964
- modal: !0,
965
- dangerouslyUseHTMLString: !0,
966
- iconClass: "el-icon-question",
967
- closeOnClickModal: !1,
968
- confirmButtonClass: "el-button--danger",
969
- cancelButtonClass: "el-button--primary is-plain",
970
- beforeClose: async (action, instance, done) => {
971
- if (action === "confirm") {
972
- try {
973
- instance.confirmButtonLoading = !0, instance.confirmButtonText = "删除...";
974
- const parentNode = node.parent, res = await this.deleteApi(node.data.id);
975
- res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data), done()) : this.$message.error(res.message);
976
- } catch {
977
- }
978
- instance.confirmButtonText = "确定", instance.confirmButtonLoading = !1;
979
- } else
980
- done();
701
+ removeNodeModal(node) {
702
+ return __async(this, null, function* () {
703
+ yield this.$confirm(
704
+ `你确定要删除${this.label}[<span class="break-word" style="color: orange">${node.data[this.treeProps.label]}</span>]吗?`,
705
+ "系统提示",
706
+ {
707
+ type: "warning",
708
+ modal: !0,
709
+ dangerouslyUseHTMLString: !0,
710
+ iconClass: "el-icon-question",
711
+ closeOnClickModal: !1,
712
+ confirmButtonClass: "el-button--danger",
713
+ cancelButtonClass: "el-button--primary is-plain",
714
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
715
+ if (action === "confirm") {
716
+ try {
717
+ instance.confirmButtonLoading = !0, instance.confirmButtonText = "删除...";
718
+ const parentNode = node.parent, res = yield this.deleteApi(node.data.id);
719
+ res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data), done()) : this.$message.error(res.message);
720
+ } catch (_) {
721
+ }
722
+ instance.confirmButtonText = "确定", instance.confirmButtonLoading = !1;
723
+ } else
724
+ done();
725
+ })
981
726
  }
727
+ ).catch((_) => _);
728
+ });
729
+ },
730
+ removeNode(node) {
731
+ return __async(this, null, function* () {
732
+ try {
733
+ const parentNode = node.parent;
734
+ if (this.deleteApi) {
735
+ const res = yield this.deleteApi(node.data.id);
736
+ res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
737
+ } else
738
+ this.$refs.tree.remove(node);
739
+ } catch (e) {
982
740
  }
983
- ).catch((_) => _);
984
- },
985
- async removeNode(node) {
986
- try {
987
- const parentNode = node.parent;
988
- if (this.deleteApi) {
989
- const res = await this.deleteApi(node.data.id);
990
- res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
991
- } else
992
- this.$refs.tree.remove(node);
993
- } catch {
994
- }
741
+ });
995
742
  },
996
- async onConfirm(node, data) {
997
- if (data[this.treeProps.label] === this.text || !isNotEmpty(this.text)) {
998
- this.clear();
999
- return;
1000
- }
1001
- isUndefined(data.loading) ? this.$set(data, "loading", !0) : data.loading = !0;
1002
- try {
1003
- if (this.loading = !0, data.id === -1) {
1004
- const res = await this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 })), old = fastClone(data);
1005
- assignReactiveProperties(data, { ...res.data, isTempNode: !1 }), this.$emit("node-added", data, old, node), this.registerNode(node);
1006
- } else
1007
- await this.updateApi({ ...data, [this.treeProps.label]: this.text });
1008
- data[this.treeProps.label] = this.text, data.edit = !1, this.$emit("node-updated", data, node), this.text = "";
1009
- } catch {
1010
- }
1011
- data.loading = !1, this.loading = !1;
743
+ onConfirm(node, data) {
744
+ return __async(this, null, function* () {
745
+ if (data[this.treeProps.label] === this.text || !isNotEmpty(this.text)) {
746
+ this.clear();
747
+ return;
748
+ }
749
+ isUndefined(data.loading) ? this.$set(data, "loading", !0) : data.loading = !0;
750
+ try {
751
+ if (this.loading = !0, data.id === -1) {
752
+ const res = yield this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 })), old = fastClone(data);
753
+ assignReactiveProperties(data, __spreadProps(__spreadValues({}, res.data), { isTempNode: !1 })), this.$emit("node-added", data, old, node), this.registerNode(node);
754
+ } else
755
+ yield this.updateApi(__spreadProps(__spreadValues({}, data), { [this.treeProps.label]: this.text }));
756
+ data[this.treeProps.label] = this.text, data.edit = !1, this.$emit("node-updated", data, node), this.text = "";
757
+ } catch (e) {
758
+ }
759
+ data.loading = !1, this.loading = !1;
760
+ });
1012
761
  },
1013
762
  onCancel(node, data) {
1014
763
  data.id === -1 ? this.$refs.tree.remove(node) : data.edit = !1, this.text = "";
@@ -1019,14 +768,18 @@ const __vue2_script = {
1019
768
  getCurrentNode() {
1020
769
  return this.$refs.tree.getCurrentNode();
1021
770
  },
1022
- async locateView() {
1023
- await this.$nextTick();
1024
- const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
1025
- el && el.scrollIntoView();
771
+ locateView() {
772
+ return __async(this, null, function* () {
773
+ yield this.$nextTick();
774
+ const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
775
+ el && el.scrollIntoView();
776
+ });
1026
777
  },
1027
- async scrollIntoView(expanded) {
1028
- var _a, _b;
1029
- await this.$nextTick(), expanded || await delay(300), (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null || _b.focus();
778
+ scrollIntoView(expanded) {
779
+ return __async(this, null, function* () {
780
+ var _a, _b;
781
+ yield this.$nextTick(), expanded || (yield delay(300)), (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null || _b.focus();
782
+ });
1030
783
  },
1031
784
  inputKeyup(event, node, data) {
1032
785
  event.keyCode === 13 && this.onConfirm(node, data), event.keyCode === 27 && this.clear();
@@ -1062,8 +815,10 @@ const __vue2_script = {
1062
815
  registerNode(node) {
1063
816
  node.store.registerNode(node), delete node.store.nodesMap[-1];
1064
817
  },
1065
- async reloadTree() {
1066
- this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
818
+ reloadTree() {
819
+ return __async(this, null, function* () {
820
+ this.lazy ? this.treeKey = Date.now() : yield this.tryFetch();
821
+ });
1067
822
  }
1068
823
  }
1069
824
  }, __cssModules = {};