@web-utils/component 2.7.20 → 2.7.22

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 (290) hide show
  1. package/dist/chunks/{config.46422d7f.js → config.7dec2bf2.js} +2 -2
  2. package/dist/chunks/confirmable-mixin.35bd1934.js +104 -0
  3. package/dist/chunks/dataformat.9cc4428a.js +158 -0
  4. package/dist/chunks/dayjs.ed2e1b73.js +247 -0
  5. package/dist/chunks/detail.d47a021c.js +29 -0
  6. package/dist/chunks/dic.9de2fe5a.js +135 -0
  7. package/dist/chunks/{event.dd6f522d.js → event.fc358074.js} +31 -31
  8. package/dist/chunks/{form-input-mixin.ff5b58f7.js → form-input-mixin.760cd65d.js} +6 -6
  9. package/dist/chunks/form-item-mixin.fa314b67.js +139 -0
  10. package/dist/chunks/{form-pick-mixin.61ad06b2.js → form-pick-mixin.c4e0391b.js} +2 -2
  11. package/dist/chunks/init.e0133910.js +122 -0
  12. package/dist/chunks/{input-number-mixin.41a066be.js → input-number-mixin.6849fa63.js} +4 -4
  13. package/dist/chunks/{mixins.5a78e0db.js → mixins.6a394a6c.js} +4 -4
  14. package/dist/chunks/{packages.1fc9ccba.js → packages.419bde01.js} +7 -7
  15. package/dist/chunks/permission.07c49abf.js +16 -0
  16. package/dist/chunks/slot.a7387ecc.js +27 -0
  17. package/dist/chunks/tab-mixin.9d568df9.js +81 -0
  18. package/dist/chunks/util.89913643.js +261 -0
  19. package/dist/chunks/utils.d7f73f8d.js +185 -0
  20. package/dist/chunks/utils.f44207f4.js +26 -0
  21. package/dist/chunks/vueComponentNormalizer.77ec6792.js +32 -0
  22. package/dist/components/address-input/index.js +36 -36
  23. package/dist/components/affix/index.js +39 -39
  24. package/dist/components/aside-menu/index.js +29 -29
  25. package/dist/components/avatar/index.js +43 -43
  26. package/dist/components/awesome-button/index.js +64 -34
  27. package/dist/components/base.css +1 -1
  28. package/dist/components/capsule-tab/index.js +26 -26
  29. package/dist/components/card/index.js +49 -49
  30. package/dist/components/carousel/index.js +35 -35
  31. package/dist/components/chat/index.js +203 -203
  32. package/dist/components/chunk-file-uploader/index.js +46 -46
  33. package/dist/components/chunk-file-uploader-button/index.js +22 -22
  34. package/dist/components/chunk-file-uploader-drop/index.js +47 -29
  35. package/dist/components/chunk-file-uploader-file/index.js +119 -119
  36. package/dist/components/chunk-file-uploader-files/index.js +27 -27
  37. package/dist/components/chunk-file-uploader-list/index.js +27 -27
  38. package/dist/components/chunk-file-uploader-un-support/index.js +27 -27
  39. package/dist/components/code-mirror-editor/index.js +136 -136
  40. package/dist/components/color-picker/index.js +57 -39
  41. package/dist/components/column/index.js +66 -66
  42. package/dist/components/column-default/index.js +54 -54
  43. package/dist/components/column-dynamic/index.js +54 -54
  44. package/dist/components/column-menu/index.js +128 -128
  45. package/dist/components/column-slot/index.js +168 -168
  46. package/dist/components/comment/index.js +33 -33
  47. package/dist/components/confirm-button/index.js +18 -18
  48. package/dist/components/confirmable/index.js +17 -17
  49. package/dist/components/context-menu/index.js +89 -89
  50. package/dist/components/count-up/index.js +50 -39
  51. package/dist/components/custom-scrollbar/index.js +62 -49
  52. package/dist/components/data-box/index.js +41 -41
  53. package/dist/components/data-card/index.js +38 -38
  54. package/dist/components/data-cardtext/index.js +33 -33
  55. package/dist/components/data-display/index.js +37 -37
  56. package/dist/components/data-icons/index.js +40 -40
  57. package/dist/components/data-imgtext/index.js +44 -44
  58. package/dist/components/data-operatext/index.js +44 -44
  59. package/dist/components/data-panel/index.js +38 -38
  60. package/dist/components/data-pay/index.js +60 -60
  61. package/dist/components/data-price/index.js +38 -38
  62. package/dist/components/data-progress/index.js +39 -39
  63. package/dist/components/data-rotate/index.js +39 -39
  64. package/dist/components/data-table-picker/index.js +151 -53
  65. package/dist/components/data-tabs/index.js +39 -39
  66. package/dist/components/data-tabs/style.css +1 -1
  67. package/dist/components/dialog-column/index.js +50 -50
  68. package/dist/components/dialog-excel/index.js +68 -68
  69. package/dist/components/dialog-filter/index.js +84 -84
  70. package/dist/components/dialog-form/index.js +89 -89
  71. package/dist/components/dynamic-table/index.js +71 -71
  72. package/dist/components/e-charts/index.js +95 -94
  73. package/dist/components/easy-popup/index.js +87 -0
  74. package/dist/components/easy-popup/style.css +1 -0
  75. package/dist/components/editable-progress/index.js +48 -48
  76. package/dist/components/editable-tree/index.js +701 -348
  77. package/dist/components/egd-collapse/index.js +29 -29
  78. package/dist/components/egd-collapse-item/index.js +51 -51
  79. package/dist/components/element-dialog/index.js +74 -65
  80. package/dist/components/empty-view/index.js +26 -26
  81. package/dist/components/error-view/index.js +25 -25
  82. package/dist/components/flex-column/index.js +31 -19
  83. package/dist/components/flex-item/index.js +32 -20
  84. package/dist/components/flex-row/index.js +31 -19
  85. package/dist/components/flex-scroller/index.js +24 -24
  86. package/dist/components/flex-scroller/style.css +1 -1
  87. package/dist/components/flow/index.js +100 -100
  88. package/dist/components/flow-node/index.js +37 -37
  89. package/dist/components/flow-viewer/index.js +162 -0
  90. package/dist/components/flow-viewer/style.css +1 -0
  91. package/dist/components/form-button/index.js +32 -32
  92. package/dist/components/form-cascader/index.js +73 -61
  93. package/dist/components/form-checkbox-group/index.js +72 -61
  94. package/dist/components/form-date-picker/index.js +71 -62
  95. package/dist/components/form-group/index.js +38 -38
  96. package/dist/components/form-holder/index.js +50 -32
  97. package/dist/components/form-input/index.js +61 -50
  98. package/dist/components/form-input-email/index.js +55 -44
  99. package/dist/components/form-input-id-card/index.js +60 -49
  100. package/dist/components/form-input-number/index.js +60 -49
  101. package/dist/components/form-input-phone-number/index.js +56 -45
  102. package/dist/components/form-input-time/index.js +59 -48
  103. package/dist/components/form-item/index.js +107 -79
  104. package/dist/components/form-item-config-provider/index.js +19 -19
  105. package/dist/components/form-item-group/index.js +65 -65
  106. package/dist/components/form-radio-group/index.js +72 -61
  107. package/dist/components/form-select/index.js +63 -52
  108. package/dist/components/form-switch/index.js +56 -45
  109. package/dist/components/form-temp/index.js +50 -50
  110. package/dist/components/form-textarea/index.js +55 -44
  111. package/dist/components/form-view/index.js +172 -149
  112. package/dist/components/fy-array/index.js +64 -64
  113. package/dist/components/fy-article/index.js +34 -34
  114. package/dist/components/fy-cascader/index.js +52 -52
  115. package/dist/components/fy-checkbox/index.js +52 -52
  116. package/dist/components/fy-code/index.js +30 -30
  117. package/dist/components/fy-curd/index.js +317 -317
  118. package/dist/components/fy-date/index.js +45 -45
  119. package/dist/components/fy-dialog-form/index.js +115 -115
  120. package/dist/components/fy-draggable/index.js +120 -120
  121. package/dist/components/fy-draggable/style.css +1 -1
  122. package/dist/components/fy-dynamic/index.js +126 -126
  123. package/dist/components/fy-empty/index.js +26 -26
  124. package/dist/components/fy-form/index.js +384 -366
  125. package/dist/components/fy-form-design/index.js +6956 -459
  126. package/dist/components/fy-form-design/style.css +1 -1
  127. package/dist/components/fy-form-menu/index.js +45 -45
  128. package/dist/components/fy-input/index.js +61 -61
  129. package/dist/components/fy-input-color/index.js +41 -41
  130. package/dist/components/fy-input-icon/index.js +70 -70
  131. package/dist/components/fy-input-map/index.js +102 -102
  132. package/dist/components/fy-input-number/index.js +39 -39
  133. package/dist/components/fy-input-table/index.js +70 -70
  134. package/dist/components/fy-input-tree/index.js +105 -105
  135. package/dist/components/fy-progress/index.js +25 -25
  136. package/dist/components/fy-radio/index.js +36 -36
  137. package/dist/components/fy-rate/index.js +40 -40
  138. package/dist/components/fy-select/index.js +101 -101
  139. package/dist/components/fy-slider/index.js +42 -42
  140. package/dist/components/fy-switch/index.js +37 -37
  141. package/dist/components/fy-tabs/index.js +35 -35
  142. package/dist/components/fy-time/index.js +47 -47
  143. package/dist/components/fy-title/index.js +23 -23
  144. package/dist/components/fy-tree/index.js +157 -157
  145. package/dist/components/fy-u-editor/index.js +138 -105
  146. package/dist/components/fy-upload/index.js +270 -270
  147. package/dist/components/guide-steps/index.js +41 -41
  148. package/dist/components/header-menu/index.js +94 -94
  149. package/dist/components/header-search/index.js +121 -121
  150. package/dist/components/highlight-j-s/index.js +76 -0
  151. package/dist/components/highlight-j-s/style.css +1 -0
  152. package/dist/components/icon-card/index.js +28 -28
  153. package/dist/components/icon-temp/index.js +24 -24
  154. package/dist/components/iframe-window/index.js +24 -24
  155. package/dist/components/iframe-window/style.css +1 -1
  156. package/dist/components/image-cropper/index.js +128 -119
  157. package/dist/components/image-preview/index.js +140 -130
  158. package/dist/components/image-viewer/index.js +35 -35
  159. package/dist/components/input-number/index.js +116 -116
  160. package/dist/components/input-number-range/index.js +37 -37
  161. package/dist/components/j-s-x-component/index.js +4 -4
  162. package/dist/components/keep-view-alive/index.js +71 -71
  163. package/dist/components/keyboard/index.js +182 -182
  164. package/dist/components/keyboard/style.css +1 -1
  165. package/dist/components/license/index.js +54 -54
  166. package/dist/components/loading-view/index.js +25 -25
  167. package/dist/components/login/index.js +94 -94
  168. package/dist/components/name-avatar/index.js +26 -26
  169. package/dist/components/nav-bar/index.js +22 -22
  170. package/dist/components/not-implement/index.js +22 -22
  171. package/dist/components/notice/index.js +55 -55
  172. package/dist/components/page/index.js +20 -20
  173. package/dist/components/page-header/index.js +28 -28
  174. package/dist/components/page-index/index.js +86 -62
  175. package/dist/components/page-index-top/index.js +73 -51
  176. package/dist/components/page-skeleton/index.js +28 -28
  177. package/dist/components/page-skeleton-new/index.js +38 -38
  178. package/dist/components/pageable-table/index.js +206 -161
  179. package/dist/components/pageable-table/style.css +1 -1
  180. package/dist/components/pageable-view/index.js +169 -124
  181. package/dist/components/pageable-view/style.css +1 -1
  182. package/dist/components/photo-swipe/index.js +88 -66
  183. package/dist/components/process-designer/index.js +4668 -0
  184. package/dist/components/process-designer/style.css +1 -0
  185. package/dist/components/properties-panel/index.js +4791 -0
  186. package/dist/components/properties-panel/style.css +1 -0
  187. package/dist/components/queue/index.js +24 -24
  188. package/dist/components/record-video/index.js +55 -55
  189. package/dist/components/resize-observer/index.js +26 -26
  190. package/dist/components/search/index.js +64 -64
  191. package/dist/components/search-popover/index.js +119 -99
  192. package/dist/components/sign/index.js +66 -66
  193. package/dist/components/sign-panel/index.js +78 -78
  194. package/dist/components/sign-panel/style.css +1 -1
  195. package/dist/components/skeleton/index.js +35 -35
  196. package/dist/components/split-pane/index.js +108 -90
  197. package/dist/components/stateful/index.js +29 -29
  198. package/dist/components/static-pageable-table/index.js +30 -30
  199. package/dist/components/swiper/index.js +93 -73
  200. package/dist/components/tab/index.js +47 -47
  201. package/dist/components/tab-item/index.js +29 -29
  202. package/dist/components/table-column/index.js +37 -27
  203. package/dist/components/table-page/index.js +51 -51
  204. package/dist/components/table-view/index.js +175 -148
  205. package/dist/components/tag-render/index.js +50 -39
  206. package/dist/components/text-ellipsis/index.js +40 -40
  207. package/dist/components/tinymce-editor/index.js +85 -67
  208. package/dist/components/tinymce-wrapper/index.js +88 -78
  209. package/dist/components/toolbar/index.js +52 -52
  210. package/dist/components/toolbar-button/index.js +56 -38
  211. package/dist/components/trigger/index.js +27 -27
  212. package/dist/components/verify/index.js +33 -33
  213. package/dist/components/vue-tags-input/index.js +137 -137
  214. package/dist/components/watermark/index.js +37 -27
  215. package/dist/components/watermark/style.css +1 -1
  216. package/dist/index.css +1983 -228
  217. package/dist/index.es.js +23132 -12684
  218. package/package.json +18 -6
  219. package/web-types.json +307 -1
  220. package/dist/chunks/AfdColumn.vue_vue_type_template_lang.768f2ed2.js +0 -302
  221. package/dist/chunks/ConfigArray.vue_vue_type_template_lang.66483daa.js +0 -51
  222. package/dist/chunks/ConfigColor.vue_vue_type_template_lang.cd880091.js +0 -24
  223. package/dist/chunks/ConfigCustom.vue_vue_type_template_lang.6e03d7fd.js +0 -52
  224. package/dist/chunks/ConfigDate.vue_vue_type_template_lang.116fbad4.js +0 -104
  225. package/dist/chunks/ConfigDynamic.vue_vue_type_template_lang.99082e47.js +0 -133
  226. package/dist/chunks/ConfigEvent.vue_vue_type_template_lang.5e8ed6cc.js +0 -96
  227. package/dist/chunks/ConfigGroup.vue_vue_type_template_lang.44117322.js +0 -48
  228. package/dist/chunks/ConfigInput.vue_vue_type_template_lang.cc1eb052.js +0 -96
  229. package/dist/chunks/ConfigMap.vue_vue_type_template_lang.daee4d38.js +0 -31
  230. package/dist/chunks/ConfigNumber.vue_vue_type_template_lang.d60231d7.js +0 -130
  231. package/dist/chunks/ConfigRate.vue_vue_type_style_index_0_scoped_true_lang.cf5d437d.js +0 -125
  232. package/dist/chunks/ConfigSelect.vue_vue_type_template_lang.dfc91f07.js +0 -488
  233. package/dist/chunks/ConfigSlider.vue_vue_type_template_lang.27b8cc7b.js +0 -99
  234. package/dist/chunks/ConfigSwitch.vue_vue_type_style_index_0_scoped_true_lang.4caf1bd0.js +0 -54
  235. package/dist/chunks/ConfigTable.vue_vue_type_template_lang.b27540fd.js +0 -344
  236. package/dist/chunks/ConfigTextarea.vue_vue_type_template_lang.5cddf41c.js +0 -88
  237. package/dist/chunks/ConfigTitle.vue_vue_type_template_lang.57d9deb5.js +0 -87
  238. package/dist/chunks/ConfigTree.vue_vue_type_style_index_0_scoped_true_lang.89ec5376.js +0 -465
  239. package/dist/chunks/ConfigUEditor.vue_vue_type_template_lang.9726b4f5.js +0 -240
  240. package/dist/chunks/ConfigUpload.vue_vue_type_template_lang.129c0ced.js +0 -476
  241. package/dist/chunks/FormConfig.vue_vue_type_template_lang.82463ce5.js +0 -220
  242. package/dist/chunks/WidgetConfig.vue_vue_type_template_lang.3cc74fe8.js +0 -1821
  243. package/dist/chunks/WidgetForm.vue_vue_type_template_lang.d4b05679.js +0 -247
  244. package/dist/chunks/WidgetFormGroup.vue_vue_type_template_lang.bdcb6d37.js +0 -271
  245. package/dist/chunks/WidgetFormItem.vue_vue_type_template_lang.48d55a5c.js +0 -24
  246. package/dist/chunks/WidgetFormTable.vue_vue_type_template_lang.e2b788ba.js +0 -229
  247. package/dist/chunks/confirmable-mixin.3a79781b.js +0 -75
  248. package/dist/chunks/dataformat.65b92bfe.js +0 -158
  249. package/dist/chunks/detail.d67573b1.js +0 -28
  250. package/dist/chunks/dic.70feb9b4.js +0 -135
  251. package/dist/chunks/form-item-mixin.79f6eaff.js +0 -128
  252. package/dist/chunks/init.7c58eb34.js +0 -122
  253. package/dist/chunks/monaco.cefcb9f5.js +0 -290
  254. package/dist/chunks/permission.ce5d2121.js +0 -16
  255. package/dist/chunks/slot.4b391395.js +0 -27
  256. package/dist/chunks/tab-mixin.8c0142e0.js +0 -81
  257. package/dist/chunks/util.23fe58fb.js +0 -261
  258. package/dist/chunks/utils.97652d86.js +0 -26
  259. package/dist/chunks/utils.fa73de78.js +0 -185
  260. package/dist/chunks/vueComponentNormalizer.71e2aa87.js +0 -32
  261. package/dist/components/afd-column/index.js +0 -57
  262. package/dist/components/config-array/index.js +0 -28
  263. package/dist/components/config-color/index.js +0 -28
  264. package/dist/components/config-custom/index.js +0 -62
  265. package/dist/components/config-date/index.js +0 -28
  266. package/dist/components/config-dynamic/index.js +0 -28
  267. package/dist/components/config-event/index.js +0 -74
  268. package/dist/components/config-group/index.js +0 -36
  269. package/dist/components/config-input/index.js +0 -29
  270. package/dist/components/config-map/index.js +0 -28
  271. package/dist/components/config-number/index.js +0 -28
  272. package/dist/components/config-rate/index.js +0 -71
  273. package/dist/components/config-rate/style.css +0 -1
  274. package/dist/components/config-select/index.js +0 -90
  275. package/dist/components/config-slider/index.js +0 -28
  276. package/dist/components/config-switch/index.js +0 -33
  277. package/dist/components/config-switch/style.css +0 -1
  278. package/dist/components/config-table/index.js +0 -122
  279. package/dist/components/config-textarea/index.js +0 -28
  280. package/dist/components/config-title/index.js +0 -33
  281. package/dist/components/config-tree/index.js +0 -122
  282. package/dist/components/config-tree/style.css +0 -1
  283. package/dist/components/config-u-editor/index.js +0 -34
  284. package/dist/components/config-upload/index.js +0 -58
  285. package/dist/components/form-config/index.js +0 -28
  286. package/dist/components/widget-config/index.js +0 -110
  287. package/dist/components/widget-form/index.js +0 -71
  288. package/dist/components/widget-form-group/index.js +0 -96
  289. package/dist/components/widget-form-item/index.js +0 -71
  290. package/dist/components/widget-form-table/index.js +0 -95
@@ -1,18 +1,346 @@
1
- import { hasOwn as d, addResizeListener as h, removeResizeListener as u, isVerticalScrollbarVisible as x, scrollbarWidth as w, computePosition as N, isPlainObject as r, cloneDeep as p, isFunction as f, isUndefined as l, isNotEmpty as C, fastClone as v, delay as g, findTreeChildren as $ } from "@web-utils/core";
2
- import { a as b, b as _, c } from "../../chunks/utils.fa73de78.js";
3
- import { n as k } from "../../chunks/vueComponentNormalizer.71e2aa87.js";
4
- var B = function() {
5
- var e = this, t = e.$createElement, i = e._self._c || t;
6
- return i("div", {
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);
19
+ }
20
+ }, rejected = (value) => {
21
+ try {
22
+ step(generator.throw(value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }, step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
27
+ step((generator = generator.apply(__this, __arguments)).next());
28
+ });
29
+ import { hasOwn, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
30
+ import { cloneDeep } from "@web-utils/integrations/lodash";
31
+ import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.d7f73f8d.js";
32
+ import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
33
+ var MapShim = function() {
34
+ if (typeof Map != "undefined")
35
+ return Map;
36
+ function getIndex(arr, key) {
37
+ var result = -1;
38
+ return arr.some(function(entry, index2) {
39
+ return entry[0] === key ? (result = index2, !0) : !1;
40
+ }), result;
41
+ }
42
+ return (
43
+ /** @class */
44
+ function() {
45
+ function class_1() {
46
+ this.__entries__ = [];
47
+ }
48
+ return Object.defineProperty(class_1.prototype, "size", {
49
+ /**
50
+ * @returns {boolean}
51
+ */
52
+ get: function() {
53
+ return this.__entries__.length;
54
+ },
55
+ enumerable: !0,
56
+ configurable: !0
57
+ }), class_1.prototype.get = function(key) {
58
+ var index2 = getIndex(this.__entries__, key), entry = this.__entries__[index2];
59
+ return entry && entry[1];
60
+ }, class_1.prototype.set = function(key, value) {
61
+ var index2 = getIndex(this.__entries__, key);
62
+ ~index2 ? this.__entries__[index2][1] = value : this.__entries__.push([key, value]);
63
+ }, class_1.prototype.delete = function(key) {
64
+ var entries = this.__entries__, index2 = getIndex(entries, key);
65
+ ~index2 && entries.splice(index2, 1);
66
+ }, class_1.prototype.has = function(key) {
67
+ return !!~getIndex(this.__entries__, key);
68
+ }, class_1.prototype.clear = function() {
69
+ this.__entries__.splice(0);
70
+ }, class_1.prototype.forEach = function(callback, ctx) {
71
+ ctx === void 0 && (ctx = null);
72
+ for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
73
+ var entry = _a[_i];
74
+ callback.call(ctx, entry[1], entry[0]);
75
+ }
76
+ }, class_1;
77
+ }()
78
+ );
79
+ }(), isBrowser = typeof window != "undefined" && typeof document != "undefined" && window.document === document, global$1 = function() {
80
+ return typeof global != "undefined" && global.Math === Math ? global : typeof self != "undefined" && self.Math === Math ? self : typeof window != "undefined" && window.Math === Math ? window : Function("return this")();
81
+ }(), requestAnimationFrame$1 = function() {
82
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(global$1) : function(callback) {
83
+ return setTimeout(function() {
84
+ return callback(Date.now());
85
+ }, 1e3 / 60);
86
+ };
87
+ }(), trailingTimeout = 2;
88
+ function throttle(callback, delay2) {
89
+ var leadingCall = !1, trailingCall = !1, lastCallTime = 0;
90
+ function resolvePending() {
91
+ leadingCall && (leadingCall = !1, callback()), trailingCall && proxy();
92
+ }
93
+ function timeoutCallback() {
94
+ requestAnimationFrame$1(resolvePending);
95
+ }
96
+ function proxy() {
97
+ var timeStamp = Date.now();
98
+ if (leadingCall) {
99
+ if (timeStamp - lastCallTime < trailingTimeout)
100
+ return;
101
+ trailingCall = !0;
102
+ } else
103
+ leadingCall = !0, trailingCall = !1, setTimeout(timeoutCallback, delay2);
104
+ lastCallTime = timeStamp;
105
+ }
106
+ return proxy;
107
+ }
108
+ var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], mutationObserverSupported = typeof MutationObserver != "undefined", ResizeObserverController = (
109
+ /** @class */
110
+ function() {
111
+ function ResizeObserverController2() {
112
+ 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);
113
+ }
114
+ return ResizeObserverController2.prototype.addObserver = function(observer) {
115
+ ~this.observers_.indexOf(observer) || this.observers_.push(observer), this.connected_ || this.connect_();
116
+ }, ResizeObserverController2.prototype.removeObserver = function(observer) {
117
+ var observers2 = this.observers_, index2 = observers2.indexOf(observer);
118
+ ~index2 && observers2.splice(index2, 1), !observers2.length && this.connected_ && this.disconnect_();
119
+ }, ResizeObserverController2.prototype.refresh = function() {
120
+ var changesDetected = this.updateObservers_();
121
+ changesDetected && this.refresh();
122
+ }, ResizeObserverController2.prototype.updateObservers_ = function() {
123
+ var activeObservers = this.observers_.filter(function(observer) {
124
+ return observer.gatherActive(), observer.hasActive();
125
+ });
126
+ return activeObservers.forEach(function(observer) {
127
+ return observer.broadcastActive();
128
+ }), activeObservers.length > 0;
129
+ }, ResizeObserverController2.prototype.connect_ = function() {
130
+ !isBrowser || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), mutationObserverSupported ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
131
+ attributes: !0,
132
+ childList: !0,
133
+ characterData: !0,
134
+ subtree: !0
135
+ })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
136
+ }, ResizeObserverController2.prototype.disconnect_ = function() {
137
+ !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);
138
+ }, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
139
+ var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
140
+ return !!~propertyName.indexOf(key);
141
+ });
142
+ isReflowProperty && this.refresh();
143
+ }, ResizeObserverController2.getInstance = function() {
144
+ return this.instance_ || (this.instance_ = new ResizeObserverController2()), this.instance_;
145
+ }, ResizeObserverController2.instance_ = null, ResizeObserverController2;
146
+ }()
147
+ ), defineConfigurable = function(target, props) {
148
+ for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
149
+ var key = _a[_i];
150
+ Object.defineProperty(target, key, {
151
+ value: props[key],
152
+ enumerable: !1,
153
+ writable: !1,
154
+ configurable: !0
155
+ });
156
+ }
157
+ return target;
158
+ }, getWindowOf = function(target) {
159
+ var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
160
+ return ownerGlobal || global$1;
161
+ }, emptyRect = createRectInit(0, 0, 0, 0);
162
+ function toFloat(value) {
163
+ return parseFloat(value) || 0;
164
+ }
165
+ function getBordersSize(styles) {
166
+ for (var positions = [], _i = 1; _i < arguments.length; _i++)
167
+ positions[_i - 1] = arguments[_i];
168
+ return positions.reduce(function(size, position) {
169
+ var value = styles["border-" + position + "-width"];
170
+ return size + toFloat(value);
171
+ }, 0);
172
+ }
173
+ function getPaddings(styles) {
174
+ for (var positions = ["top", "right", "bottom", "left"], paddings = {}, _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
175
+ var position = positions_1[_i], value = styles["padding-" + position];
176
+ paddings[position] = toFloat(value);
177
+ }
178
+ return paddings;
179
+ }
180
+ function getSVGContentRect(target) {
181
+ var bbox = target.getBBox();
182
+ return createRectInit(0, 0, bbox.width, bbox.height);
183
+ }
184
+ function getHTMLElementContentRect(target) {
185
+ var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
186
+ if (!clientWidth && !clientHeight)
187
+ return emptyRect;
188
+ 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);
189
+ 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)) {
190
+ var vertScrollbar = Math.round(width + horizPad) - clientWidth, horizScrollbar = Math.round(height + vertPad) - clientHeight;
191
+ Math.abs(vertScrollbar) !== 1 && (width -= vertScrollbar), Math.abs(horizScrollbar) !== 1 && (height -= horizScrollbar);
192
+ }
193
+ return createRectInit(paddings.left, paddings.top, width, height);
194
+ }
195
+ var isSVGGraphicsElement = function() {
196
+ return typeof SVGGraphicsElement != "undefined" ? function(target) {
197
+ return target instanceof getWindowOf(target).SVGGraphicsElement;
198
+ } : function(target) {
199
+ return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox == "function";
200
+ };
201
+ }();
202
+ function isDocumentElement(target) {
203
+ return target === getWindowOf(target).document.documentElement;
204
+ }
205
+ function getContentRect(target) {
206
+ return isBrowser ? isSVGGraphicsElement(target) ? getSVGContentRect(target) : getHTMLElementContentRect(target) : emptyRect;
207
+ }
208
+ function createReadOnlyRect(_a) {
209
+ var x = _a.x, y = _a.y, width = _a.width, height = _a.height, Constr = typeof DOMRectReadOnly != "undefined" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
210
+ return defineConfigurable(rect, {
211
+ x,
212
+ y,
213
+ width,
214
+ height,
215
+ top: y,
216
+ right: x + width,
217
+ bottom: height + y,
218
+ left: x
219
+ }), rect;
220
+ }
221
+ function createRectInit(x, y, width, height) {
222
+ return { x, y, width, height };
223
+ }
224
+ var ResizeObservation = (
225
+ /** @class */
226
+ function() {
227
+ function ResizeObservation2(target) {
228
+ this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = createRectInit(0, 0, 0, 0), this.target = target;
229
+ }
230
+ return ResizeObservation2.prototype.isActive = function() {
231
+ var rect = getContentRect(this.target);
232
+ return this.contentRect_ = rect, rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
233
+ }, ResizeObservation2.prototype.broadcastRect = function() {
234
+ var rect = this.contentRect_;
235
+ return this.broadcastWidth = rect.width, this.broadcastHeight = rect.height, rect;
236
+ }, ResizeObservation2;
237
+ }()
238
+ ), ResizeObserverEntry = (
239
+ /** @class */
240
+ function() {
241
+ function ResizeObserverEntry2(target, rectInit) {
242
+ var contentRect = createReadOnlyRect(rectInit);
243
+ defineConfigurable(this, { target, contentRect });
244
+ }
245
+ return ResizeObserverEntry2;
246
+ }()
247
+ ), ResizeObserverSPI = (
248
+ /** @class */
249
+ function() {
250
+ function ResizeObserverSPI2(callback, controller, callbackCtx) {
251
+ if (this.activeObservations_ = [], this.observations_ = new MapShim(), typeof callback != "function")
252
+ throw new TypeError("The callback provided as parameter 1 is not a function.");
253
+ this.callback_ = callback, this.controller_ = controller, this.callbackCtx_ = callbackCtx;
254
+ }
255
+ return ResizeObserverSPI2.prototype.observe = function(target) {
256
+ if (!arguments.length)
257
+ throw new TypeError("1 argument required, but only 0 present.");
258
+ if (!(typeof Element == "undefined" || !(Element instanceof Object))) {
259
+ if (!(target instanceof getWindowOf(target).Element))
260
+ throw new TypeError('parameter 1 is not of type "Element".');
261
+ var observations = this.observations_;
262
+ observations.has(target) || (observations.set(target, new ResizeObservation(target)), this.controller_.addObserver(this), this.controller_.refresh());
263
+ }
264
+ }, ResizeObserverSPI2.prototype.unobserve = function(target) {
265
+ if (!arguments.length)
266
+ throw new TypeError("1 argument required, but only 0 present.");
267
+ if (!(typeof Element == "undefined" || !(Element instanceof Object))) {
268
+ if (!(target instanceof getWindowOf(target).Element))
269
+ throw new TypeError('parameter 1 is not of type "Element".');
270
+ var observations = this.observations_;
271
+ observations.has(target) && (observations.delete(target), observations.size || this.controller_.removeObserver(this));
272
+ }
273
+ }, ResizeObserverSPI2.prototype.disconnect = function() {
274
+ this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
275
+ }, ResizeObserverSPI2.prototype.gatherActive = function() {
276
+ var _this = this;
277
+ this.clearActive(), this.observations_.forEach(function(observation) {
278
+ observation.isActive() && _this.activeObservations_.push(observation);
279
+ });
280
+ }, ResizeObserverSPI2.prototype.broadcastActive = function() {
281
+ if (this.hasActive()) {
282
+ var ctx = this.callbackCtx_, entries = this.activeObservations_.map(function(observation) {
283
+ return new ResizeObserverEntry(observation.target, observation.broadcastRect());
284
+ });
285
+ this.callback_.call(ctx, entries, ctx), this.clearActive();
286
+ }
287
+ }, ResizeObserverSPI2.prototype.clearActive = function() {
288
+ this.activeObservations_.splice(0);
289
+ }, ResizeObserverSPI2.prototype.hasActive = function() {
290
+ return this.activeObservations_.length > 0;
291
+ }, ResizeObserverSPI2;
292
+ }()
293
+ ), observers = typeof WeakMap != "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim(), ResizeObserver = (
294
+ /** @class */
295
+ function() {
296
+ function ResizeObserver2(callback) {
297
+ if (!(this instanceof ResizeObserver2))
298
+ throw new TypeError("Cannot call a class as a function.");
299
+ if (!arguments.length)
300
+ throw new TypeError("1 argument required, but only 0 present.");
301
+ var controller = ResizeObserverController.getInstance(), observer = new ResizeObserverSPI(callback, controller, this);
302
+ observers.set(this, observer);
303
+ }
304
+ return ResizeObserver2;
305
+ }()
306
+ );
307
+ [
308
+ "observe",
309
+ "unobserve",
310
+ "disconnect"
311
+ ].forEach(function(method) {
312
+ ResizeObserver.prototype[method] = function() {
313
+ var _a;
314
+ return (_a = observers.get(this))[method].apply(_a, arguments);
315
+ };
316
+ });
317
+ var index = function() {
318
+ return typeof global$1.ResizeObserver != "undefined" ? global$1.ResizeObserver : ResizeObserver;
319
+ }();
320
+ const isServer = typeof window == "undefined", resizeHandler = (entries) => {
321
+ for (const entry of entries) {
322
+ const listeners = entry.target.__resizeListeners__ || [];
323
+ listeners.length && listeners.forEach((fn) => {
324
+ fn();
325
+ });
326
+ }
327
+ }, addResizeListener = (element, fn) => {
328
+ isServer || (element.__resizeListeners__ || (element.__resizeListeners__ = [], element.__ro__ = new index(resizeHandler), element.__ro__.observe(element)), element.__resizeListeners__.push(fn));
329
+ }, removeResizeListener = (element, fn) => {
330
+ !element || !element.__resizeListeners__ || (element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1), element.__resizeListeners__.length || element.__ro__.disconnect());
331
+ };
332
+ var render = function() {
333
+ var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
334
+ return _c("div", {
7
335
  staticClass: "editable-tree"
8
- }, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? i("ElButton", {
336
+ }, [!_vm.readonly && _vm.addRootNodeButtonStyle === "top-right" ? _c("ElButton", {
9
337
  staticStyle: {
10
338
  position: "absolute",
11
339
  top: "4px",
12
340
  "z-index": "1"
13
341
  },
14
342
  style: {
15
- right: `${e.right}px`
343
+ right: `${_vm.right}px`
16
344
  },
17
345
  attrs: {
18
346
  type: "primary",
@@ -22,95 +350,95 @@ var B = function() {
22
350
  plain: ""
23
351
  },
24
352
  on: {
25
- click: function(a) {
26
- return a.stopPropagation(), e.$emit("add-root-node");
353
+ click: function($event) {
354
+ return $event.stopPropagation(), _vm.$emit("add-root-node");
27
355
  }
28
356
  }
29
- }) : e._e(), i("div", {
357
+ }) : _vm._e(), _c("div", {
30
358
  ref: "treeWrapper",
31
359
  staticClass: "et-tree-wrapper"
32
- }, [!e.readonly && e.addRootNodeButtonStyle === "top" ? i("div", {
360
+ }, [!_vm.readonly && _vm.addRootNodeButtonStyle === "top" ? _c("div", {
33
361
  staticStyle: {
34
362
  "padding-left": "24px"
35
363
  }
36
- }, [i("ElButton", {
364
+ }, [_c("ElButton", {
37
365
  attrs: {
38
- disabled: e.loading,
366
+ disabled: _vm.loading,
39
367
  size: "mini",
40
368
  type: "text"
41
369
  },
42
370
  on: {
43
- click: e.appendRootNode
371
+ click: _vm.appendRootNode
44
372
  }
45
- }, [i("i", {
373
+ }, [_c("i", {
46
374
  staticClass: "el-icon-lx-add"
47
- }), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), i("ElTree", e._g(e._b({
48
- key: e.treeKey,
375
+ }), _vm._v(" " + _vm._s(_vm.addRootNodeLabel ? _vm.addRootNodeLabel : `添加${_vm.label}`) + " ")])], 1) : _vm._e(), _c("ElTree", _vm._g(_vm._b({
376
+ key: _vm.treeKey,
49
377
  ref: "tree",
50
378
  staticClass: "flex-item",
51
379
  attrs: {
52
- "default-expanded-keys": e.expandedKeys,
380
+ "default-expanded-keys": _vm.expandedKeys,
53
381
  "expand-on-click-node": !1,
54
382
  "highlight-current": "",
55
- load: e.loadNode,
56
- data: e.innerTreeData,
57
- props: e.treeProps,
58
- lazy: e.lazy,
59
- "node-key": e.nodeKey
383
+ load: _vm.loadNode,
384
+ data: _vm.innerTreeData,
385
+ props: _vm.treeProps,
386
+ lazy: _vm.lazy,
387
+ "node-key": _vm.nodeKey
60
388
  },
61
389
  on: {
62
- "node-click": e.nodeClick,
63
- "node-contextmenu": e.showContextMenu,
64
- "node-expand": e.addExpandKey,
65
- "node-collapse": e.removeExpandKey
390
+ "node-click": _vm.nodeClick,
391
+ "node-contextmenu": _vm.showContextMenu,
392
+ "node-expand": _vm.addExpandKey,
393
+ "node-collapse": _vm.removeExpandKey
66
394
  },
67
- scopedSlots: e._u([{
395
+ scopedSlots: _vm._u([{
68
396
  key: "default",
69
- fn: function(a) {
70
- var o = a.node, s = a.data;
71
- return [e._t("default", function() {
72
- return [s.edit ? [i("span", {
397
+ fn: function(_ref) {
398
+ var node = _ref.node, data = _ref.data;
399
+ return [_vm._t("default", function() {
400
+ return [data.edit ? [_c("span", {
73
401
  staticClass: "custom-tree-node flex-row flex-item oh",
74
402
  attrs: {
75
- "data-id": s.id
403
+ "data-id": data.id
76
404
  }
77
- }, [e.icon ? i("i", {
405
+ }, [_vm.icon ? _c("i", {
78
406
  staticClass: "node-icon shrink-0",
79
- class: s.loading ? "el-icon-loading" : "el-icon-edit-outline"
80
- }) : e._e(), i("ElInput", {
407
+ class: data.loading ? "el-icon-loading" : "el-icon-edit-outline"
408
+ }) : _vm._e(), _c("ElInput", {
81
409
  ref: "labelTxt",
82
410
  staticClass: "node-input flex-item",
83
411
  attrs: {
84
412
  size: "mini",
85
- placeholder: e.defaultOptions.inputPlaceholder
413
+ placeholder: _vm.defaultOptions.inputPlaceholder
86
414
  },
87
415
  on: {
88
- blur: function(n) {
89
- return e.inputBlur(n, o, s);
416
+ blur: function(event) {
417
+ return _vm.inputBlur(event, node, data);
90
418
  }
91
419
  },
92
420
  nativeOn: {
93
- keyup: function(n) {
94
- return function(y) {
95
- return e.inputKeyup(y, o, s);
421
+ keyup: function($event) {
422
+ return function(event) {
423
+ return _vm.inputKeyup(event, node, data);
96
424
  }.apply(null, arguments);
97
425
  },
98
- click: function(n) {
99
- n.stopPropagation();
426
+ click: function($event) {
427
+ $event.stopPropagation();
100
428
  }
101
429
  },
102
430
  model: {
103
- value: e.text,
104
- callback: function(n) {
105
- e.text = n;
431
+ value: _vm.text,
432
+ callback: function($$v) {
433
+ _vm.text = $$v;
106
434
  },
107
435
  expression: "text"
108
436
  }
109
- }), e.confirmButton ? [i("ElButton", {
437
+ }), _vm.confirmButton ? [_c("ElButton", {
110
438
  directives: [{
111
439
  name: "show",
112
440
  rawName: "v-show",
113
- value: !s.loading,
441
+ value: !data.loading,
114
442
  expression: "!data.loading"
115
443
  }],
116
444
  staticClass: "shrink-0",
@@ -119,15 +447,15 @@ var B = function() {
119
447
  type: "text"
120
448
  },
121
449
  on: {
122
- click: function(n) {
123
- return n.stopPropagation(), e.onConfirm(o, s);
450
+ click: function($event) {
451
+ return $event.stopPropagation(), _vm.onConfirm(node, data);
124
452
  }
125
453
  }
126
- }, [e._v("确定")]), i("ElButton", {
454
+ }, [_vm._v("确定")]), _c("ElButton", {
127
455
  directives: [{
128
456
  name: "show",
129
457
  rawName: "v-show",
130
- value: !s.loading,
458
+ value: !data.loading,
131
459
  expression: "!data.loading"
132
460
  }],
133
461
  staticClass: "shrink-0",
@@ -136,85 +464,85 @@ var B = function() {
136
464
  type: "text"
137
465
  },
138
466
  on: {
139
- click: function(n) {
140
- return n.stopPropagation(), e.onCancel(o, s);
467
+ click: function($event) {
468
+ return $event.stopPropagation(), _vm.onCancel(node, data);
141
469
  }
142
470
  }
143
- }, [e._v("取消")])] : e._e()], 2)] : [i("span", {
471
+ }, [_vm._v("取消")])] : _vm._e()], 2)] : [_c("span", {
144
472
  staticClass: "custom-tree-node",
145
473
  attrs: {
146
- "data-id": s.id
474
+ "data-id": data.id
147
475
  }
148
- }, [i("span", {
476
+ }, [_c("span", {
149
477
  staticClass: "node-label flex-row flex-item oh ellipsis-1"
150
- }, [e.icon ? i("i", {
478
+ }, [_vm.icon ? _c("i", {
151
479
  staticClass: "node-icon",
152
- class: s.loading ? "el-icon-loading" : e.icon(s, o)
153
- }) : e._e(), i("span", {
480
+ class: data.loading ? "el-icon-loading" : _vm.icon(data, node)
481
+ }) : _vm._e(), _c("span", {
154
482
  staticClass: "flex-item-relative",
155
483
  staticStyle: {
156
484
  height: "21px"
157
485
  }
158
- }, [i("span", {
486
+ }, [_c("span", {
159
487
  staticClass: "ellipsis-1 absolute-box et-tree-label",
160
488
  attrs: {
161
- title: o.label
489
+ title: node.label
162
490
  }
163
- }, [e._t("label", function() {
164
- return [e._v(e._s(o.label))];
491
+ }, [_vm._t("label", function() {
492
+ return [_vm._v(_vm._s(node.label))];
165
493
  }, {
166
- data: s,
167
- node: o
168
- })], 2)]), e._t("label-suffix", null, {
169
- node: o,
170
- data: s
171
- })], 2), !e.contextMenu && !e.readonly ? i("span", {
494
+ data,
495
+ node
496
+ })], 2)]), _vm._t("label-suffix", null, {
497
+ node,
498
+ data
499
+ })], 2), !_vm.contextMenu && !_vm.readonly ? _c("span", {
172
500
  directives: [{
173
501
  name: "show",
174
502
  rawName: "v-show",
175
- value: !s.loading && !e.loading,
503
+ value: !data.loading && !_vm.loading,
176
504
  expression: "!data.loading && !loading"
177
505
  }],
178
506
  staticClass: "handle-actions"
179
- }, [i("ElButton", {
507
+ }, [_c("ElButton", {
180
508
  attrs: {
181
509
  size: "mini",
182
510
  type: "text"
183
511
  },
184
512
  on: {
185
- click: function(n) {
186
- return n.stopPropagation(), e.appendChildNode(o, s);
513
+ click: function($event) {
514
+ return $event.stopPropagation(), _vm.appendChildNode(node, data);
187
515
  }
188
516
  }
189
- }, [e._v("添加")]), i("ElButton", {
517
+ }, [_vm._v("添加")]), _c("ElButton", {
190
518
  attrs: {
191
519
  size: "mini",
192
520
  type: "text"
193
521
  },
194
522
  on: {
195
- click: function(n) {
196
- return n.stopPropagation(), e.editNode(o, s);
523
+ click: function($event) {
524
+ return $event.stopPropagation(), _vm.editNode(node, data);
197
525
  }
198
526
  }
199
- }, [e._v("修改")]), i("ElPopconfirm", {
527
+ }, [_vm._v("修改")]), _c("ElPopconfirm", {
200
528
  staticClass: "pop-confirm",
201
529
  attrs: {
202
530
  "icon-color": "red",
203
531
  title: "你确定要删除吗?"
204
532
  },
205
533
  on: {
206
- confirm: function(n) {
207
- return e.removeNode(o, s);
534
+ confirm: function($event) {
535
+ return _vm.removeNode(node, data);
208
536
  }
209
537
  },
210
- scopedSlots: e._u([{
538
+ scopedSlots: _vm._u([{
211
539
  key: "reference",
212
540
  fn: function() {
213
- return [i("ElButton", {
541
+ return [_c("ElButton", {
214
542
  directives: [{
215
543
  name: "show",
216
544
  rawName: "v-show",
217
- value: o.isLeaf,
545
+ value: node.isLeaf,
218
546
  expression: "node.isLeaf"
219
547
  }],
220
548
  staticStyle: {
@@ -225,26 +553,26 @@ var B = function() {
225
553
  type: "text"
226
554
  },
227
555
  on: {
228
- click: function(n) {
229
- n.stopPropagation();
556
+ click: function($event) {
557
+ $event.stopPropagation();
230
558
  }
231
559
  }
232
- }, [e._v("删除")])];
560
+ }, [_vm._v("删除")])];
233
561
  },
234
562
  proxy: !0
235
563
  }], null, !0)
236
- })], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? i("span", {
564
+ })], 1) : _vm._e(), _vm.contextMenuIcon && _vm.contextMenu && !_vm.readonly ? _c("span", {
237
565
  directives: [{
238
566
  name: "show",
239
567
  rawName: "v-show",
240
- value: !s.loading && !e.loading,
568
+ value: !data.loading && !_vm.loading,
241
569
  expression: "!data.loading && !loading"
242
570
  }],
243
571
  staticClass: "handle-actions",
244
572
  staticStyle: {
245
573
  display: "inline-block"
246
574
  }
247
- }, [i("ElButton", {
575
+ }, [_c("ElButton", {
248
576
  staticStyle: {
249
577
  padding: "6px 10px 0"
250
578
  },
@@ -253,103 +581,103 @@ var B = function() {
253
581
  type: "text"
254
582
  },
255
583
  on: {
256
- click: function(n) {
257
- return n.stopPropagation(), e.showContextMenu(n, s, o);
584
+ click: function($event) {
585
+ return $event.stopPropagation(), _vm.showContextMenu($event, data, node);
258
586
  }
259
587
  }
260
- }, [e._v(". . .")])], 1) : e._e()])]];
588
+ }, [_vm._v(". . .")])], 1) : _vm._e()])]];
261
589
  }, {
262
- node: o,
263
- data: s
590
+ node,
591
+ data
264
592
  })];
265
593
  }
266
594
  }], null, !0)
267
- }, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? i("div", {
595
+ }, "ElTree", _vm.filterTreeProperties(_vm.$attrs), !1), _vm.filterTreeEvents(_vm.$listeners))), _vm.contextMenu && !_vm.readonly ? _c("div", {
268
596
  directives: [{
269
597
  name: "show",
270
598
  rawName: "v-show",
271
- value: e.showMenu,
599
+ value: _vm.showMenu,
272
600
  expression: "showMenu"
273
601
  }],
274
602
  ref: "contextMenu",
275
603
  staticClass: "menu",
276
- style: e.position
277
- }, [i("ul", {
604
+ style: _vm.position
605
+ }, [_c("ul", {
278
606
  staticClass: "menu-list"
279
- }, [e._t("context-menu", function() {
280
- return [i("li", {
607
+ }, [_vm._t("context-menu", function() {
608
+ return [_c("li", {
281
609
  directives: [{
282
610
  name: "show",
283
611
  rawName: "v-show",
284
- value: e.curData.id > -1,
612
+ value: _vm.curData.id > -1,
285
613
  expression: "curData.id > -1"
286
614
  }],
287
615
  staticClass: "menu-item",
288
616
  on: {
289
- click: function(a) {
290
- return e.appendPeerNode(e.curNode, e.curData);
617
+ click: function($event) {
618
+ return _vm.appendPeerNode(_vm.curNode, _vm.curData);
291
619
  }
292
620
  }
293
- }, [i("i", {
621
+ }, [_c("i", {
294
622
  staticClass: "menu-item-icon el-icon-lx-add",
295
623
  staticStyle: {
296
624
  color: "#228b22"
297
625
  }
298
- }), e._v(e._s(e.menuLabel.appendPeer) + " ")]), i("li", {
626
+ }), _vm._v(_vm._s(_vm.menuLabel.appendPeer) + " ")]), _c("li", {
299
627
  staticClass: "menu-item",
300
628
  on: {
301
- click: function(a) {
302
- return e.appendChildNode(e.curNode, e.curData);
629
+ click: function($event) {
630
+ return _vm.appendChildNode(_vm.curNode, _vm.curData);
303
631
  }
304
632
  }
305
- }, [i("i", {
633
+ }, [_c("i", {
306
634
  staticClass: "menu-item-icon el-icon-lx-add",
307
635
  staticStyle: {
308
636
  color: "#228b22"
309
637
  }
310
- }), e._v(e._s(e.menuLabel.appendChild) + " ")]), i("li", {
638
+ }), _vm._v(_vm._s(_vm.menuLabel.appendChild) + " ")]), _c("li", {
311
639
  directives: [{
312
640
  name: "show",
313
641
  rawName: "v-show",
314
- value: e.curData.id > -1,
642
+ value: _vm.curData.id > -1,
315
643
  expression: "curData.id > -1"
316
644
  }],
317
645
  staticClass: "menu-item",
318
646
  on: {
319
- click: function(a) {
320
- return e.editNode(e.curNode, e.curData);
647
+ click: function($event) {
648
+ return _vm.editNode(_vm.curNode, _vm.curData);
321
649
  }
322
650
  }
323
- }, [i("i", {
651
+ }, [_c("i", {
324
652
  staticClass: "menu-item-icon el-icon-edit-outline",
325
653
  staticStyle: {
326
654
  color: "#ffa500"
327
655
  }
328
- }), e._v(e._s(e.menuLabel.editNode) + " ")]), i("li", {
656
+ }), _vm._v(_vm._s(_vm.menuLabel.editNode) + " ")]), _c("li", {
329
657
  directives: [{
330
658
  name: "show",
331
659
  rawName: "v-show",
332
- value: e.curNode.isLeaf,
660
+ value: _vm.curNode.isLeaf,
333
661
  expression: "curNode.isLeaf"
334
662
  }],
335
663
  staticClass: "menu-item",
336
664
  on: {
337
- click: function(a) {
338
- return e.removeNodeModal(e.curNode, e.curData);
665
+ click: function($event) {
666
+ return _vm.removeNodeModal(_vm.curNode, _vm.curData);
339
667
  }
340
668
  }
341
- }, [i("i", {
669
+ }, [_c("i", {
342
670
  staticClass: "menu-item-icon el-icon-delete",
343
671
  staticStyle: {
344
672
  color: "#f00"
345
673
  }
346
- }), e._v(e._s(e.menuLabel.removeNode) + " ")])];
674
+ }), _vm._v(_vm._s(_vm.menuLabel.removeNode) + " ")])];
347
675
  }, {
348
- curNode: e.curNode,
349
- curData: e.curData
350
- })], 2)]) : e._e()], 1)], 1);
351
- }, T = [];
352
- const M = {
676
+ curNode: _vm.curNode,
677
+ curData: _vm.curData
678
+ })], 2)]) : _vm._e()], 1)], 1);
679
+ }, staticRenderFns = [];
680
+ const __vue2_script = {
353
681
  name: "EditableTree",
354
682
  props: {
355
683
  label: {
@@ -365,9 +693,9 @@ const M = {
365
693
  },
366
694
  newNodeBuilder: {
367
695
  type: Function,
368
- default: (e, t) => ({
369
- name: e,
370
- parentId: t.id
696
+ default: (name, parent) => ({
697
+ name,
698
+ parentId: parent.id
371
699
  })
372
700
  },
373
701
  contextMenu: Boolean,
@@ -408,7 +736,7 @@ const M = {
408
736
  default: () => ({
409
737
  children: "children",
410
738
  label: "name",
411
- isLeaf: (e) => d(e, "hasChildren") ? !e.hasChildren : d(e, "hasChild") ? !e.hasChild : d(e, "children") && e.children ? e.children.length === 0 : !0
739
+ isLeaf: (data) => hasOwn(data, "hasChildren") ? !data.hasChildren : hasOwn(data, "hasChild") ? !data.hasChild : hasOwn(data, "children") && data.children ? data.children.length === 0 : !0
412
740
  })
413
741
  },
414
742
  menuLabel: {
@@ -462,19 +790,19 @@ const M = {
462
790
  modal: !0,
463
791
  inputErrorMessage: `${this.label}名不能为空!`,
464
792
  inputPlaceholder: `请输入${this.label}名...`,
465
- inputValidator: (e) => e != null && e.trim().length > 0
793
+ inputValidator: (value) => value != null && value.trim().length > 0
466
794
  };
467
795
  },
468
796
  innerTreeData() {
469
- var e;
470
- return (e = this.$attrs.data) != null && e.length ? this.$attrs.data : this.treeData;
797
+ var _a;
798
+ return (_a = this.$attrs.data) != null && _a.length ? this.$attrs.data : this.treeData;
471
799
  }
472
800
  },
473
801
  watch: {
474
802
  defaultExpandedKeys: {
475
803
  immediate: !0,
476
- handler(e) {
477
- this.expandedKeys = [...e];
804
+ handler(newVal) {
805
+ this.expandedKeys = [...newVal];
478
806
  }
479
807
  }
480
808
  },
@@ -482,62 +810,68 @@ const M = {
482
810
  this.tryFetch();
483
811
  },
484
812
  mounted() {
485
- h(this.$refs.tree.$el, this.resize), h(this.$refs.treeWrapper, this.resize);
813
+ addResizeListener(this.$refs.tree.$el, this.resize), addResizeListener(this.$refs.treeWrapper, this.resize);
486
814
  },
487
815
  beforeDestroy() {
488
- u(this.$refs.tree.$el, this.resize), u(this.$refs.treeWrapper, this.resize);
816
+ removeResizeListener(this.$refs.tree.$el, this.resize), removeResizeListener(this.$refs.treeWrapper, this.resize);
489
817
  },
490
818
  methods: {
491
- filterTreeProperties: b,
492
- filterTreeEvents: _,
493
- addExpandKey(e) {
494
- this.reserveExpandKey && this.expandedKeys.push(e[this.nodeKey]);
819
+ filterTreeProperties,
820
+ filterTreeEvents,
821
+ addExpandKey(data) {
822
+ this.reserveExpandKey && this.expandedKeys.push(data[this.nodeKey]);
495
823
  },
496
- removeExpandKey(e) {
497
- this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((t) => t !== e[this.nodeKey]));
824
+ removeExpandKey(data) {
825
+ this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((key) => key !== data[this.nodeKey]));
498
826
  },
499
827
  resize() {
500
- x(this.$refs.treeWrapper) ? this.right = 4 + w : this.right = 4;
828
+ isVerticalScrollbarVisible(this.$refs.treeWrapper) ? this.right = 4 + scrollbarWidth : this.right = 4;
501
829
  },
502
- async showContextMenu(e, t, i) {
503
- t.contextmenu === !1 || t.id === -1 || t.id === 0 || t.edit === !0 || this.contextMenu && (this.curNode = i, this.curData = t, this.showMenu = !0, this.$refs.tree.setCurrentKey(t.id), await this.$nextTick(), this.position = N(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
830
+ showContextMenu(event, data, node) {
831
+ return __async(this, null, function* () {
832
+ 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));
833
+ });
504
834
  },
505
835
  hideContextMenu() {
506
836
  this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
507
837
  },
508
- async tryFetch() {
509
- var e;
510
- if (this.lazy === !1 && this.fetchApi) {
511
- const t = await this.fetchApi(((e = this.rootNode) == null ? void 0 : e.id) ?? -1, {});
512
- if (r(t.data) && (t.data = [t.data]), t.data = t.data || [], this.empty = t.data.length === 0, r(this.customRootNode)) {
513
- const i = p(this.customRootNode);
514
- i[this.treeProps.children || "children"] = t.data, this.treeData = [i];
515
- } else if (f(this.customRootNode)) {
516
- const i = this.customRootNode(t.data);
517
- i[this.treeProps.children || "children"] = t.data, this.treeData = r(i) ? [i] : i;
518
- } else
519
- this.treeData = t.data;
520
- }
838
+ tryFetch() {
839
+ return __async(this, null, function* () {
840
+ var _a, _b;
841
+ if (this.lazy === !1 && this.fetchApi) {
842
+ const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, {});
843
+ if (isPlainObject(res.data) && (res.data = [res.data]), res.data = res.data || [], this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
844
+ const data = cloneDeep(this.customRootNode);
845
+ data[this.treeProps.children || "children"] = res.data, this.treeData = [data];
846
+ } else if (isFunction(this.customRootNode)) {
847
+ const data = this.customRootNode(res.data);
848
+ data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
849
+ } else
850
+ this.treeData = res.data;
851
+ }
852
+ });
521
853
  },
522
- async loadNode(e, t) {
523
- var i, a, o;
524
- if (e.level === 0) {
525
- const s = await this.fetchApi(((i = this.rootNode) == null ? void 0 : i.id) ?? -1, e);
526
- if (this.empty = s.data.length === 0, r(this.customRootNode)) {
527
- const n = p(this.customRootNode);
528
- n[this.treeProps.children || "children"] = s.data, t([n]);
529
- } else if (f(this.customRootNode)) {
530
- const n = this.customRootNode(s.data);
531
- n[this.treeProps.children || "children"] = s.data, this.treeData = r(n) ? [n] : n;
532
- } else
533
- t(s.data);
534
- await this.$nextTick(), this.$emit("root-node-loaded", s.data), this.defaultExpandedKeys ? this.expandedKeys = [(a = s == null ? void 0 : s.data[0]) == null ? void 0 : a.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(o = s == null ? void 0 : s.data[0]) == null ? void 0 : o.id]);
535
- } else {
536
- if (e.leaf || e.data.isTempNode)
537
- return t([]);
538
- const s = await this.fetchApi(e.data.id, e);
539
- t(s.data), await this.$nextTick(), this.$emit("node-loaded", s.data);
540
- }
854
+ loadNode(node, resolve) {
855
+ return __async(this, null, function* () {
856
+ var _a, _b, _c, _d;
857
+ if (node.level === 0) {
858
+ const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, node);
859
+ if (this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
860
+ const data = cloneDeep(this.customRootNode);
861
+ data[this.treeProps.children || "children"] = res.data, resolve([data]);
862
+ } else if (isFunction(this.customRootNode)) {
863
+ const data = this.customRootNode(res.data);
864
+ data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
865
+ } else
866
+ resolve(res.data);
867
+ 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]);
868
+ } else {
869
+ if (node.leaf || node.data.isTempNode)
870
+ return resolve([]);
871
+ const res = yield this.fetchApi(node.data.id, node);
872
+ resolve(res.data), yield this.$nextTick(), this.$emit("node-loaded", res.data);
873
+ }
874
+ });
541
875
  },
542
876
  clear() {
543
877
  this.cancelEdit(), this.removeNewNode();
@@ -549,241 +883,260 @@ const M = {
549
883
  this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
550
884
  },
551
885
  cancelEdit() {
552
- this.editData && (l(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
553
- },
554
- async editNode(e, t) {
555
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label], l(t.edit) ? this.$set(t, "edit", !0) : t.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await this.$prompt(`请输入新的${this.label}名:`, {
556
- ...this.defaultOptions,
557
- inputValue: t[this.treeProps.label],
558
- beforeClose: async (i, a, o) => {
559
- if (i === "confirm") {
560
- try {
561
- a.confirmButtonLoading = !0, a.confirmButtonText = "处理中...", this.text = a.inputValue, await this.onConfirm(this.curNode, this.curData), o();
562
- } catch {
563
- a.confirmButtonText = "确定";
564
- }
565
- a.confirmButtonLoading = !1;
566
- } else
567
- o();
568
- }
569
- }).catch((i) => i);
570
- },
571
- async appendRootNode() {
572
- 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}名:`, {
573
- ...this.defaultOptions,
574
- beforeClose: async (e, t, i) => {
575
- if (e === "confirm") {
576
- try {
577
- this.createNewChild(-1), t.confirmButtonLoading = !0, t.confirmButtonText = "处理中...";
578
- const a = await this.saveApi(this.newNodeBuilder(t.inputValue, { id: -1 }));
579
- this.newChild[this.treeProps.label] = t.inputValue, this.newChild.edit = !1, c(this.newChild, a.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.locateView(), i();
580
- } catch {
581
- t.confirmButtonText = "确定";
582
- }
583
- t.confirmButtonLoading = !1;
584
- } else
585
- i();
586
- }
587
- }).catch((e) => e);
886
+ this.editData && (isUndefined(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
887
+ },
888
+ editNode(node, data) {
889
+ return __async(this, null, function* () {
890
+ !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), {
891
+ inputValue: data[this.treeProps.label],
892
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
893
+ if (action === "confirm") {
894
+ try {
895
+ instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...", this.text = instance.inputValue, yield this.onConfirm(this.curNode, this.curData), done();
896
+ } catch (e) {
897
+ instance.confirmButtonText = "确定";
898
+ }
899
+ instance.confirmButtonLoading = !1;
900
+ } else
901
+ done();
902
+ })
903
+ })).catch((_) => _);
904
+ });
588
905
  },
589
- appendChildNode(e) {
590
- this.text = "";
591
- const t = e.expanded;
592
- e.expand(async () => {
593
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(t)) : await this.$prompt(`请输入${this.label}名:`, {
594
- ...this.defaultOptions,
595
- beforeClose: async (i, a, o) => {
596
- if (i === "confirm") {
906
+ appendRootNode() {
907
+ return __async(this, null, function* () {
908
+ 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), {
909
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
910
+ if (action === "confirm") {
597
911
  try {
598
- this.createNewChild(e.data.id), a.confirmButtonLoading = !0, a.confirmButtonText = "处理中...";
599
- const s = await this.saveApi(this.newNodeBuilder(a.inputValue, e.data));
600
- this.newChild[this.treeProps.label] = a.inputValue, this.newChild.edit = !1, c(this.newChild, s.data), this.$refs.tree.append(this.newChild, e), await this.locateView(), o();
601
- } catch {
602
- a.confirmButtonText = "确定";
912
+ this.createNewChild(-1), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
913
+ const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
914
+ 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();
915
+ } catch (e) {
916
+ instance.confirmButtonText = "确定";
603
917
  }
604
- a.confirmButtonLoading = !1;
918
+ instance.confirmButtonLoading = !1;
605
919
  } else
606
- o();
607
- }
608
- }).catch((i) => i);
920
+ done();
921
+ })
922
+ })).catch((_) => _);
609
923
  });
610
924
  },
611
- appendChildNodeWithData(e, t, i) {
925
+ appendChildNode(node) {
612
926
  this.text = "";
613
- const a = e.expanded;
614
- e.expand(async () => {
927
+ const expanded = node.expanded;
928
+ node.expand(() => __async(this, null, function* () {
929
+ !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), {
930
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
931
+ if (action === "confirm") {
932
+ try {
933
+ this.createNewChild(node.data.id), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
934
+ const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
935
+ 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();
936
+ } catch (e) {
937
+ instance.confirmButtonText = "确定";
938
+ }
939
+ instance.confirmButtonLoading = !1;
940
+ } else
941
+ done();
942
+ })
943
+ })).catch((_) => _);
944
+ }));
945
+ },
946
+ appendChildNodeWithData(node, parentId, label) {
947
+ this.text = "";
948
+ const expanded = node.expanded;
949
+ node.expand(() => __async(this, null, function* () {
615
950
  this.clear(), this.newChild = {
616
951
  id: -1,
617
- parentId: t,
618
- [this.treeProps.label]: i,
952
+ parentId,
953
+ [this.treeProps.label]: label,
619
954
  edit: !1,
620
955
  isTempNode: !0,
621
956
  hasChildren: !1
622
- }, this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(a);
623
- });
957
+ }, this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded);
958
+ }));
624
959
  },
625
- appendPeerNode(e) {
626
- e.parent && e.parent.level !== 0 ? this.appendChildNode(e.parent) : this.appendRootNode();
960
+ appendPeerNode(node) {
961
+ node.parent && node.parent.level !== 0 ? this.appendChildNode(node.parent) : this.appendRootNode();
627
962
  },
628
- async addRootNode(e) {
629
- this.$refs.tree.remove(e), await this.$nextTick(), this.$refs.tree.root.insertChild({ data: e }, void 0, !0);
963
+ addRootNode(data) {
964
+ return __async(this, null, function* () {
965
+ this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.root.insertChild({ data }, void 0, !0);
966
+ });
630
967
  },
631
- async addChildNode(e) {
632
- this.curNode && this.curNode.level !== 0 ? this.curNode.expand(async () => {
633
- this.$refs.tree.remove(e), await this.$nextTick(), this.$refs.tree.append(e, this.curNode);
634
- }) : await this.addRootNode(e);
968
+ addChildNode(data) {
969
+ return __async(this, null, function* () {
970
+ this.curNode && this.curNode.level !== 0 ? this.curNode.expand(() => __async(this, null, function* () {
971
+ this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode);
972
+ })) : yield this.addRootNode(data);
973
+ });
635
974
  },
636
- async addPeerNode(e) {
637
- this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(async () => {
638
- this.$refs.tree.remove(e), await this.$nextTick(), this.$refs.tree.append(e, this.curNode.parent);
639
- }) : await this.addRootNode(e);
975
+ addPeerNode(data) {
976
+ return __async(this, null, function* () {
977
+ this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(() => __async(this, null, function* () {
978
+ this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode.parent);
979
+ })) : yield this.addRootNode(data);
980
+ });
640
981
  },
641
- updateNode(e) {
642
- const t = this.$refs.tree.getNode(e);
643
- t && (t.data = e);
982
+ updateNode(data) {
983
+ const node = this.$refs.tree.getNode(data);
984
+ node && (node.data = data);
644
985
  },
645
- setCurrentKey(e) {
646
- this.$refs.tree && this.$refs.tree.setCurrentKey(e);
986
+ setCurrentKey(key) {
987
+ this.$refs.tree && this.$refs.tree.setCurrentKey(key);
647
988
  },
648
- createNewChild(e) {
989
+ createNewChild(parentId) {
649
990
  this.newChild = {
650
991
  id: -1,
651
- parentId: e,
992
+ parentId,
652
993
  [this.treeProps.label]: "",
653
994
  edit: !0,
654
995
  isTempNode: !0,
655
996
  hasChildren: !1
656
997
  }, this.$emit("create-new-node", this.newChild);
657
998
  },
658
- async removeNodeModal(e) {
659
- await this.$confirm(
660
- `你确定要删除${this.label}[<span class="break-word" style="color: orange">${e.data[this.treeProps.label]}</span>]吗?`,
661
- "系统提示",
662
- {
663
- type: "warning",
664
- modal: !0,
665
- dangerouslyUseHTMLString: !0,
666
- iconClass: "el-icon-question",
667
- closeOnClickModal: !1,
668
- confirmButtonClass: "el-button--danger",
669
- cancelButtonClass: "el-button--primary is-plain",
670
- beforeClose: async (t, i, a) => {
671
- if (t === "confirm") {
672
- try {
673
- i.confirmButtonLoading = !0, i.confirmButtonText = "删除...";
674
- const o = e.parent, s = await this.deleteApi(e.data.id);
675
- s.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", o, e.data), a()) : this.$message.error(s.message);
676
- } catch {
677
- }
678
- i.confirmButtonText = "确定", i.confirmButtonLoading = !1;
679
- } else
680
- a();
999
+ removeNodeModal(node) {
1000
+ return __async(this, null, function* () {
1001
+ yield this.$confirm(
1002
+ `你确定要删除${this.label}[<span class="break-word" style="color: orange">${node.data[this.treeProps.label]}</span>]吗?`,
1003
+ "系统提示",
1004
+ {
1005
+ type: "warning",
1006
+ modal: !0,
1007
+ dangerouslyUseHTMLString: !0,
1008
+ iconClass: "el-icon-question",
1009
+ closeOnClickModal: !1,
1010
+ confirmButtonClass: "el-button--danger",
1011
+ cancelButtonClass: "el-button--primary is-plain",
1012
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
1013
+ if (action === "confirm") {
1014
+ try {
1015
+ instance.confirmButtonLoading = !0, instance.confirmButtonText = "删除...";
1016
+ const parentNode = node.parent, res = yield this.deleteApi(node.data.id);
1017
+ res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data), done()) : this.$message.error(res.message);
1018
+ } catch (_) {
1019
+ }
1020
+ instance.confirmButtonText = "确定", instance.confirmButtonLoading = !1;
1021
+ } else
1022
+ done();
1023
+ })
681
1024
  }
1025
+ ).catch((_) => _);
1026
+ });
1027
+ },
1028
+ removeNode(node) {
1029
+ return __async(this, null, function* () {
1030
+ try {
1031
+ const parentNode = node.parent;
1032
+ if (this.deleteApi) {
1033
+ const res = yield this.deleteApi(node.data.id);
1034
+ res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
1035
+ } else
1036
+ this.$refs.tree.remove(node);
1037
+ } catch (e) {
682
1038
  }
683
- ).catch((t) => t);
684
- },
685
- async removeNode(e) {
686
- try {
687
- const t = e.parent;
688
- if (this.deleteApi) {
689
- const i = await this.deleteApi(e.data.id);
690
- i.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", t, e.data)) : this.$message.error(i.message);
691
- } else
692
- this.$refs.tree.remove(e);
693
- } catch {
694
- }
1039
+ });
695
1040
  },
696
- async onConfirm(e, t) {
697
- if (t[this.treeProps.label] === this.text || !C(this.text)) {
698
- this.clear();
699
- return;
700
- }
701
- l(t.loading) ? this.$set(t, "loading", !0) : t.loading = !0;
702
- try {
703
- if (this.loading = !0, t.id === -1) {
704
- const i = await this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), a = v(t);
705
- c(t, { ...i.data, isTempNode: !1 }), this.$emit("node-added", t, a, e), this.registerNode(e);
706
- } else
707
- await this.updateApi({ ...t, [this.treeProps.label]: this.text });
708
- t[this.treeProps.label] = this.text, t.edit = !1, this.$emit("node-updated", t, e), this.text = "";
709
- } catch {
710
- }
711
- t.loading = !1, this.loading = !1;
1041
+ onConfirm(node, data) {
1042
+ return __async(this, null, function* () {
1043
+ if (data[this.treeProps.label] === this.text || !isNotEmpty(this.text)) {
1044
+ this.clear();
1045
+ return;
1046
+ }
1047
+ isUndefined(data.loading) ? this.$set(data, "loading", !0) : data.loading = !0;
1048
+ try {
1049
+ if (this.loading = !0, data.id === -1) {
1050
+ const res = yield this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 })), old = fastClone(data);
1051
+ assignReactiveProperties(data, __spreadProps(__spreadValues({}, res.data), { isTempNode: !1 })), this.$emit("node-added", data, old, node), this.registerNode(node);
1052
+ } else
1053
+ yield this.updateApi(__spreadProps(__spreadValues({}, data), { [this.treeProps.label]: this.text }));
1054
+ data[this.treeProps.label] = this.text, data.edit = !1, this.$emit("node-updated", data, node), this.text = "";
1055
+ } catch (e) {
1056
+ }
1057
+ data.loading = !1, this.loading = !1;
1058
+ });
712
1059
  },
713
- onCancel(e, t) {
714
- t.id === -1 ? this.$refs.tree.remove(e) : t.edit = !1, this.text = "";
1060
+ onCancel(node, data) {
1061
+ data.id === -1 ? this.$refs.tree.remove(node) : data.edit = !1, this.text = "";
715
1062
  },
716
- nodeClick(e, t, i) {
717
- this.hideContextMenu(), (l(e.loading) || !e.loading) && (this.curNode = t, this.curData = e, this.$emit("on-node-click", e, t, i));
1063
+ nodeClick(data, node, tree) {
1064
+ this.hideContextMenu(), (isUndefined(data.loading) || !data.loading) && (this.curNode = node, this.curData = data, this.$emit("on-node-click", data, node, tree));
718
1065
  },
719
1066
  getCurrentNode() {
720
1067
  return this.$refs.tree.getCurrentNode();
721
1068
  },
722
- async locateView() {
723
- await this.$nextTick();
724
- const e = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
725
- e && e.scrollIntoView();
1069
+ locateView() {
1070
+ return __async(this, null, function* () {
1071
+ yield this.$nextTick();
1072
+ const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
1073
+ el && el.scrollIntoView();
1074
+ });
726
1075
  },
727
- async scrollIntoView(e) {
728
- var t, i;
729
- await this.$nextTick(), e || await g(300), (i = (t = this.$refs) == null ? void 0 : t.labelTxt) == null || i.focus();
1076
+ scrollIntoView(expanded) {
1077
+ return __async(this, null, function* () {
1078
+ var _a, _b;
1079
+ yield this.$nextTick(), expanded || (yield delay(300)), (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null || _b.focus();
1080
+ });
730
1081
  },
731
- inputKeyup(e, t, i) {
732
- e.keyCode === 13 && this.onConfirm(t, i), e.keyCode === 27 && this.clear();
1082
+ inputKeyup(event, node, data) {
1083
+ event.keyCode === 13 && this.onConfirm(node, data), event.keyCode === 27 && this.clear();
733
1084
  },
734
- inputBlur(e, t, i) {
735
- this.confirmButton || this.onConfirm(t, i);
1085
+ inputBlur(event, node, data) {
1086
+ this.confirmButton || this.onConfirm(node, data);
736
1087
  },
737
1088
  getCheckedKeys() {
738
1089
  return this.$refs.tree.getCheckedKeys();
739
1090
  },
740
- setCheckedKeys(e) {
741
- this.$refs.tree.setCheckedKeys(e);
1091
+ setCheckedKeys(keys) {
1092
+ this.$refs.tree.setCheckedKeys(keys);
742
1093
  },
743
1094
  getCheckedNodes() {
744
1095
  return this.$refs.tree.getCheckedNodes();
745
1096
  },
746
- setCheckedNodes(e) {
747
- this.$refs.tree.setCheckedNodes(e);
1097
+ setCheckedNodes(nodes) {
1098
+ this.$refs.tree.setCheckedNodes(nodes);
748
1099
  },
749
- getNode(e) {
750
- return this.$refs.tree.getNode(e);
1100
+ getNode(data) {
1101
+ return this.$refs.tree.getNode(data);
751
1102
  },
752
1103
  getRootNode() {
753
1104
  return this.$refs.tree.root;
754
1105
  },
755
- findTreeNode(e) {
756
- return $(
1106
+ findTreeNode(data) {
1107
+ return findTreeChildren(
757
1108
  this.$refs.tree.root.childNodes,
758
- (t) => t.data === e || t.data.id === e,
1109
+ (node) => node.data === data || node.data.id === data,
759
1110
  "childNodes"
760
1111
  );
761
1112
  },
762
- registerNode(e) {
763
- e.store.registerNode(e), delete e.store.nodesMap[-1];
1113
+ registerNode(node) {
1114
+ node.store.registerNode(node), delete node.store.nodesMap[-1];
764
1115
  },
765
- async reloadTree() {
766
- this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
1116
+ reloadTree() {
1117
+ return __async(this, null, function* () {
1118
+ this.lazy ? this.treeKey = Date.now() : yield this.tryFetch();
1119
+ });
767
1120
  }
768
1121
  }
769
- }, m = {};
770
- var K = /* @__PURE__ */ k(
771
- M,
772
- B,
773
- T,
1122
+ }, __cssModules = {};
1123
+ var __component__ = /* @__PURE__ */ normalizeComponent(
1124
+ __vue2_script,
1125
+ render,
1126
+ staticRenderFns,
774
1127
  !1,
775
- P,
1128
+ __vue2_injectStyles,
776
1129
  null,
777
1130
  null,
778
1131
  null
779
1132
  );
780
- function P(e) {
781
- for (let t in m)
782
- this[t] = m[t];
1133
+ function __vue2_injectStyles(context) {
1134
+ for (let o in __cssModules)
1135
+ this[o] = __cssModules[o];
783
1136
  }
784
- const R = /* @__PURE__ */ function() {
785
- return K.exports;
1137
+ const EditableTree = /* @__PURE__ */ function() {
1138
+ return __component__.exports;
786
1139
  }();
787
1140
  export {
788
- R as default
1141
+ EditableTree as default
789
1142
  };