@web-utils/component 3.0.6 → 3.1.0

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 (172) hide show
  1. package/address-input/index.mjs +20 -57
  2. package/affix/index.mjs +26 -47
  3. package/aside-menu/index.mjs +18 -43
  4. package/avatar/index.mjs +27 -49
  5. package/awesome-button/index.mjs +35 -43
  6. package/capsule-tab/index.mjs +16 -34
  7. package/card/index.mjs +21 -76
  8. package/carousel/index.mjs +14 -49
  9. package/chat/index.mjs +104 -414
  10. package/chunk-file-uploader/index.mjs +21 -38
  11. package/chunks/FormTemp.aa57efb4.mjs +125 -0
  12. package/code-mirror-editor/index.mjs +69 -79
  13. package/color-picker/index.mjs +29 -60
  14. package/comment/index.mjs +17 -48
  15. package/confirm-button/index.mjs +11 -19
  16. package/confirmable/index.mjs +12 -20
  17. package/context-menu/index.mjs +42 -144
  18. package/count-up/index.mjs +18 -25
  19. package/custom-scrollbar/index.mjs +13 -22
  20. package/data-box/index.mjs +15 -66
  21. package/data-card/index.mjs +16 -65
  22. package/data-cardtext/index.mjs +16 -52
  23. package/data-display/index.mjs +18 -62
  24. package/data-icons/index.mjs +16 -68
  25. package/data-imgtext/index.mjs +18 -79
  26. package/data-operatext/index.mjs +18 -75
  27. package/data-panel/index.mjs +16 -63
  28. package/data-pay/index.mjs +20 -122
  29. package/data-price/index.mjs +18 -60
  30. package/data-progress/index.mjs +16 -67
  31. package/data-rotate/index.mjs +16 -66
  32. package/data-table-picker/index.mjs +25 -88
  33. package/data-tabs/index.mjs +16 -64
  34. package/dialog-form/index.mjs +48 -94
  35. package/dynamic-table/index.mjs +43 -127
  36. package/e-charts/index.mjs +21 -34
  37. package/easy-popup/index.mjs +35 -61
  38. package/editable-progress/index.mjs +22 -77
  39. package/editable-tree/index.mjs +235 -546
  40. package/egd-collapse/index.mjs +13 -26
  41. package/egd-collapse-item/index.mjs +27 -87
  42. package/element-dialog/index.mjs +69 -133
  43. package/empty-view/index.mjs +13 -33
  44. package/error-view/index.mjs +14 -34
  45. package/flex-column/index.mjs +15 -23
  46. package/flex-item/index.mjs +18 -26
  47. package/flex-row/index.mjs +23 -31
  48. package/flex-scroller/index.mjs +16 -27
  49. package/flow/index.mjs +70 -110
  50. package/flow-designer/index.mjs +1215 -4804
  51. package/flow-node/index.mjs +15 -51
  52. package/flow-viewer/index.mjs +64 -89
  53. package/form-block/index.mjs +43 -62
  54. package/form-button/index.mjs +10 -18
  55. package/form-cascader/index.mjs +49 -100
  56. package/form-checkbox-group/index.mjs +43 -110
  57. package/form-date-picker/index.mjs +51 -97
  58. package/form-holder/index.mjs +25 -42
  59. package/form-input/index.mjs +40 -90
  60. package/form-input-email/index.mjs +35 -79
  61. package/form-input-id-card/index.mjs +40 -87
  62. package/form-input-number/index.mjs +42 -102
  63. package/form-input-phone-number/index.mjs +34 -75
  64. package/form-input-tag/index.mjs +31 -73
  65. package/form-input-time/index.mjs +42 -87
  66. package/form-item/index.mjs +70 -89
  67. package/form-item-config-provider/index.mjs +12 -20
  68. package/form-item-group/index.mjs +46 -65
  69. package/form-radio-group/index.mjs +50 -108
  70. package/form-select/index.mjs +44 -95
  71. package/form-switch/index.mjs +38 -85
  72. package/form-textarea/index.mjs +31 -75
  73. package/form-view/index.mjs +112 -260
  74. package/fy-array/index.mjs +35 -121
  75. package/fy-article/index.mjs +12 -43
  76. package/fy-cascader/index.mjs +26 -67
  77. package/fy-checkbox/index.mjs +27 -77
  78. package/fy-code/index.mjs +19 -33
  79. package/fy-curd/index.mjs +810 -2017
  80. package/fy-date/index.mjs +18 -59
  81. package/fy-draggable/index.mjs +81 -140
  82. package/fy-dynamic/index.mjs +85 -204
  83. package/fy-empty/index.mjs +14 -35
  84. package/fy-form/index.mjs +254 -571
  85. package/fy-form-design/index.mjs +1489 -6084
  86. package/fy-form-design/style.css +1 -1
  87. package/fy-input/index.mjs +34 -104
  88. package/fy-input-color/index.mjs +22 -67
  89. package/fy-input-icon/index.mjs +37 -122
  90. package/fy-input-map/index.mjs +57 -149
  91. package/fy-input-number/index.mjs +18 -53
  92. package/fy-input-table/index.mjs +36 -102
  93. package/fy-input-tree/index.mjs +51 -138
  94. package/fy-progress/index.mjs +12 -31
  95. package/fy-radio/index.mjs +20 -51
  96. package/fy-rate/index.mjs +18 -51
  97. package/fy-select/index.mjs +49 -134
  98. package/fy-slider/index.mjs +19 -52
  99. package/fy-switch/index.mjs +18 -48
  100. package/fy-tabs/index.mjs +19 -51
  101. package/fy-time/index.mjs +22 -62
  102. package/fy-title/index.mjs +14 -25
  103. package/fy-tree/index.mjs +74 -216
  104. package/fy-u-editor/index.mjs +50 -64
  105. package/fy-upload/index.mjs +167 -338
  106. package/guide-steps/index.mjs +33 -53
  107. package/highlight-j-s/index.mjs +13 -27
  108. package/icon-card/index.mjs +12 -36
  109. package/icon-temp/index.mjs +12 -34
  110. package/iframe-window/index.mjs +13 -40
  111. package/image-cropper/index.mjs +46 -171
  112. package/image-preview/index.mjs +54 -168
  113. package/image-viewer/index.mjs +24 -50
  114. package/index.css +1 -0
  115. package/index.mjs +3973 -501
  116. package/input-number/index.mjs +84 -173
  117. package/input-number-range/index.mjs +20 -70
  118. package/j-s-x-component/index.mjs +3 -3
  119. package/keep-view-alive/index.mjs +47 -55
  120. package/keyboard/index.mjs +100 -113
  121. package/license/index.mjs +34 -51
  122. package/loading-view/index.mjs +14 -34
  123. package/login/index.mjs +33 -161
  124. package/monaco-editor/index.mjs +13 -21
  125. package/name-avatar/index.mjs +13 -32
  126. package/nav-bar/index.mjs +12 -31
  127. package/not-implement/index.mjs +14 -25
  128. package/notice/index.mjs +32 -80
  129. package/package.json +1 -1
  130. package/page/index.mjs +11 -23
  131. package/page-header/index.mjs +16 -37
  132. package/page-index/index.mjs +42 -93
  133. package/page-index-top/index.mjs +42 -84
  134. package/page-skeleton/index.mjs +24 -39
  135. package/page-skeleton-new/index.mjs +21 -68
  136. package/pageable-table/index.mjs +105 -227
  137. package/pageable-view/index.mjs +30 -83
  138. package/photo-swipe/index.mjs +62 -87
  139. package/present-view/index.mjs +114 -267
  140. package/queue/index.mjs +14 -29
  141. package/record-video/index.mjs +29 -66
  142. package/resize-observer/index.mjs +18 -30
  143. package/search/index.mjs +47 -81
  144. package/search-popover/index.mjs +57 -329
  145. package/sign/index.mjs +43 -60
  146. package/sign-panel/index.mjs +40 -151
  147. package/skeleton/index.mjs +18 -44
  148. package/split-pane/index.mjs +45 -129
  149. package/stateful/index.mjs +18 -26
  150. package/static-pageable-table/index.mjs +18 -44
  151. package/swiper/index.mjs +53 -94
  152. package/tab/index.mjs +13 -39
  153. package/tab-item/index.mjs +23 -37
  154. package/table-column/index.mjs +27 -35
  155. package/table-view/index.mjs +89 -209
  156. package/tag-render/index.mjs +34 -69
  157. package/text-ellipsis/index.mjs +22 -47
  158. package/tinymce-editor/index.mjs +174 -285
  159. package/toolbar/index.mjs +21 -42
  160. package/toolbar-button/index.mjs +25 -54
  161. package/verify/index.mjs +16 -29
  162. package/vue-cron/index.mjs +272 -1089
  163. package/vue-qr-code/index.mjs +19 -27
  164. package/vue-quill-editor/index.mjs +15 -27
  165. package/vue-tags-input/index.mjs +104 -224
  166. package/vue-tree-select/index.mjs +595 -742
  167. package/vue-video-player/index.mjs +42 -57
  168. package/watermark/index.mjs +27 -35
  169. package/web-types.json +1 -1
  170. package/x-input-tag/index.mjs +50 -112
  171. package/chunks/FormTemp.7f91629d.mjs +0 -165
  172. /package/chunks/{vueComponentNormalizer.446f5dc4.mjs → _plugin-vue2_normalizer.446f5dc4.mjs} +0 -0
@@ -1,385 +1,37 @@
1
- var b = Object.defineProperty, _ = Object.defineProperties;
2
- var k = Object.getOwnPropertyDescriptors;
1
+ var $ = Object.defineProperty, b = Object.defineProperties;
2
+ var _ = Object.getOwnPropertyDescriptors;
3
3
  var x = Object.getOwnPropertySymbols;
4
- var B = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
5
- var w = (e, i, t) => i in e ? b(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, c = (e, i) => {
6
- for (var t in i || (i = {}))
7
- B.call(i, t) && w(e, t, i[t]);
4
+ var k = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;
5
+ var w = (t, e, i) => e in t ? $(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, c = (t, e) => {
6
+ for (var i in e || (e = {}))
7
+ k.call(e, i) && w(t, i, e[i]);
8
8
  if (x)
9
- for (var t of x(i))
10
- T.call(i, t) && w(e, t, i[t]);
11
- return e;
12
- }, h = (e, i) => _(e, k(i));
13
- var r = (e, i, t) => new Promise((s, o) => {
14
- var n = (d) => {
9
+ for (var i of x(e))
10
+ B.call(e, i) && w(t, i, e[i]);
11
+ return t;
12
+ }, h = (t, e) => b(t, _(e));
13
+ var a = (t, e, i) => new Promise((s, n) => {
14
+ var o = (d) => {
15
15
  try {
16
- l(t.next(d));
16
+ l(i.next(d));
17
17
  } catch (f) {
18
- o(f);
18
+ n(f);
19
19
  }
20
- }, a = (d) => {
20
+ }, r = (d) => {
21
21
  try {
22
- l(t.throw(d));
22
+ l(i.throw(d));
23
23
  } catch (f) {
24
- o(f);
24
+ n(f);
25
25
  }
26
- }, l = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(n, a);
27
- l((t = t.apply(e, i)).next());
26
+ }, l = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(o, r);
27
+ l((i = i.apply(t, e)).next());
28
28
  });
29
- import { hasOwn as m, isVerticalScrollbarVisible as M, scrollbarWidth as K, computePosition as P, isPlainObject as u, isFunction as N, isUndefined as p, isNotEmpty as E, fastClone as D, delay as L, findTreeChildren as R } from "@web-utils/core";
30
- import { addResizeListener as C, removeResizeListener as v } from "@web-utils/integrations/resize";
31
- import { cloneDeep as g } from "@web-utils/integrations/lodash";
32
- import { a as z, b as S, c as y } from "../chunks/index.57f871af.mjs";
33
- import { n as V } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
34
- var A = function() {
35
- var e = this, i = e.$createElement, t = e._self._c || i;
36
- return t("div", {
37
- staticClass: "editable-tree"
38
- }, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? t("ElButton", {
39
- staticStyle: {
40
- position: "absolute",
41
- top: "4px",
42
- "z-index": "1"
43
- },
44
- style: {
45
- right: `${e.right}px`
46
- },
47
- attrs: {
48
- type: "primary",
49
- size: "mini",
50
- icon: "el-icon-plus",
51
- circle: "",
52
- plain: ""
53
- },
54
- on: {
55
- click: function(s) {
56
- return s.stopPropagation(), e.$emit("add-root-node");
57
- }
58
- }
59
- }) : e._e(), t("div", {
60
- ref: "treeWrapper",
61
- staticClass: "et-tree-wrapper"
62
- }, [!e.readonly && e.addRootNodeButtonStyle === "top" ? t("div", {
63
- staticStyle: {
64
- "padding-left": "24px"
65
- }
66
- }, [t("ElButton", {
67
- attrs: {
68
- disabled: e.loading,
69
- size: "mini",
70
- type: "text"
71
- },
72
- on: {
73
- click: e.appendRootNode
74
- }
75
- }, [t("i", {
76
- staticClass: "el-icon-lx-add"
77
- }), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), t("ElTree", e._g(e._b({
78
- key: e.treeKey,
79
- ref: "tree",
80
- staticClass: "flex-item",
81
- attrs: {
82
- "default-expanded-keys": e.expandedKeys,
83
- "expand-on-click-node": !1,
84
- "highlight-current": "",
85
- load: e.loadNode,
86
- data: e.innerTreeData,
87
- props: e.treeProps,
88
- lazy: e.lazy,
89
- "node-key": e.nodeKey
90
- },
91
- on: {
92
- "node-click": e.nodeClick,
93
- "node-contextmenu": e.showContextMenu,
94
- "node-expand": e.addExpandKey,
95
- "node-collapse": e.removeExpandKey
96
- },
97
- scopedSlots: e._u([{
98
- key: "default",
99
- fn: function(s) {
100
- var o = s.node, n = s.data;
101
- return [e._t("default", function() {
102
- return [n.edit ? [t("span", {
103
- staticClass: "custom-tree-node flex-row flex-item oh",
104
- attrs: {
105
- "data-id": n.id
106
- }
107
- }, [e.icon ? t("i", {
108
- staticClass: "node-icon shrink-0",
109
- class: n.loading ? "el-icon-loading" : "el-icon-edit-outline"
110
- }) : e._e(), t("ElInput", {
111
- ref: "labelTxt",
112
- staticClass: "node-input flex-item",
113
- attrs: {
114
- size: "mini",
115
- placeholder: e.defaultOptions.inputPlaceholder
116
- },
117
- on: {
118
- blur: function(a) {
119
- return e.inputBlur(a, o, n);
120
- }
121
- },
122
- nativeOn: {
123
- keyup: function(a) {
124
- return function(l) {
125
- return e.inputKeyup(l, o, n);
126
- }.apply(null, arguments);
127
- },
128
- click: function(a) {
129
- a.stopPropagation();
130
- }
131
- },
132
- model: {
133
- value: e.text,
134
- callback: function(a) {
135
- e.text = a;
136
- },
137
- expression: "text"
138
- }
139
- }), e.confirmButton ? [t("ElButton", {
140
- directives: [{
141
- name: "show",
142
- rawName: "v-show",
143
- value: !n.loading,
144
- expression: "!data.loading"
145
- }],
146
- staticClass: "shrink-0",
147
- attrs: {
148
- size: "mini",
149
- type: "text"
150
- },
151
- on: {
152
- click: function(a) {
153
- return a.stopPropagation(), e.onConfirm(o, n);
154
- }
155
- }
156
- }, [e._v("确定")]), t("ElButton", {
157
- directives: [{
158
- name: "show",
159
- rawName: "v-show",
160
- value: !n.loading,
161
- expression: "!data.loading"
162
- }],
163
- staticClass: "shrink-0",
164
- attrs: {
165
- size: "mini",
166
- type: "text"
167
- },
168
- on: {
169
- click: function(a) {
170
- return a.stopPropagation(), e.onCancel(o, n);
171
- }
172
- }
173
- }, [e._v("取消")])] : e._e()], 2)] : [t("span", {
174
- staticClass: "custom-tree-node",
175
- attrs: {
176
- "data-id": n.id
177
- }
178
- }, [t("span", {
179
- staticClass: "node-label flex-row flex-item oh ellipsis-1"
180
- }, [e.icon ? t("i", {
181
- staticClass: "node-icon",
182
- class: n.loading ? "el-icon-loading" : e.icon(n, o)
183
- }) : e._e(), t("span", {
184
- staticClass: "flex-item-relative",
185
- staticStyle: {
186
- height: "21px"
187
- }
188
- }, [t("span", {
189
- staticClass: "ellipsis-1 absolute-box et-tree-label",
190
- attrs: {
191
- title: o.label
192
- }
193
- }, [e._t("label", function() {
194
- return [e._v(e._s(o.label))];
195
- }, {
196
- data: n,
197
- node: o
198
- })], 2)]), e._t("label-suffix", null, {
199
- node: o,
200
- data: n
201
- })], 2), !e.contextMenu && !e.readonly ? t("span", {
202
- directives: [{
203
- name: "show",
204
- rawName: "v-show",
205
- value: !n.loading && !e.loading,
206
- expression: "!data.loading && !loading"
207
- }],
208
- staticClass: "handle-actions"
209
- }, [t("ElButton", {
210
- attrs: {
211
- size: "mini",
212
- type: "text"
213
- },
214
- on: {
215
- click: function(a) {
216
- return a.stopPropagation(), e.appendChildNode(o, n);
217
- }
218
- }
219
- }, [e._v("添加")]), t("ElButton", {
220
- attrs: {
221
- size: "mini",
222
- type: "text"
223
- },
224
- on: {
225
- click: function(a) {
226
- return a.stopPropagation(), e.editNode(o, n);
227
- }
228
- }
229
- }, [e._v("修改")]), t("ElPopconfirm", {
230
- staticClass: "pop-confirm",
231
- attrs: {
232
- "icon-color": "red",
233
- title: "你确定要删除吗?"
234
- },
235
- on: {
236
- confirm: function(a) {
237
- return e.removeNode(o, n);
238
- }
239
- },
240
- scopedSlots: e._u([{
241
- key: "reference",
242
- fn: function() {
243
- return [t("ElButton", {
244
- directives: [{
245
- name: "show",
246
- rawName: "v-show",
247
- value: o.isLeaf,
248
- expression: "node.isLeaf"
249
- }],
250
- staticStyle: {
251
- "margin-left": "4px"
252
- },
253
- attrs: {
254
- size: "mini",
255
- type: "text"
256
- },
257
- on: {
258
- click: function(a) {
259
- a.stopPropagation();
260
- }
261
- }
262
- }, [e._v("删除")])];
263
- },
264
- proxy: !0
265
- }], null, !0)
266
- })], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? t("span", {
267
- directives: [{
268
- name: "show",
269
- rawName: "v-show",
270
- value: !n.loading && !e.loading,
271
- expression: "!data.loading && !loading"
272
- }],
273
- staticClass: "handle-actions",
274
- staticStyle: {
275
- display: "inline-block"
276
- }
277
- }, [t("ElButton", {
278
- staticStyle: {
279
- padding: "6px 10px 0"
280
- },
281
- attrs: {
282
- size: "mini",
283
- type: "text"
284
- },
285
- on: {
286
- click: function(a) {
287
- return a.stopPropagation(), e.showContextMenu(a, n, o);
288
- }
289
- }
290
- }, [e._v(". . .")])], 1) : e._e()])]];
291
- }, {
292
- node: o,
293
- data: n
294
- })];
295
- }
296
- }], null, !0)
297
- }, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? t("div", {
298
- directives: [{
299
- name: "show",
300
- rawName: "v-show",
301
- value: e.showMenu,
302
- expression: "showMenu"
303
- }],
304
- ref: "contextMenu",
305
- staticClass: "menu",
306
- style: e.position
307
- }, [t("ul", {
308
- staticClass: "menu-list"
309
- }, [e._t("context-menu", function() {
310
- return [t("li", {
311
- directives: [{
312
- name: "show",
313
- rawName: "v-show",
314
- value: e.curData.id > -1,
315
- expression: "curData.id > -1"
316
- }],
317
- staticClass: "menu-item",
318
- on: {
319
- click: function(s) {
320
- return e.appendPeerNode(e.curNode, e.curData);
321
- }
322
- }
323
- }, [t("i", {
324
- staticClass: "menu-item-icon el-icon-lx-add",
325
- staticStyle: {
326
- color: "#228b22"
327
- }
328
- }), e._v(e._s(e.menuLabel.appendPeer) + " ")]), t("li", {
329
- staticClass: "menu-item",
330
- on: {
331
- click: function(s) {
332
- return e.appendChildNode(e.curNode, e.curData);
333
- }
334
- }
335
- }, [t("i", {
336
- staticClass: "menu-item-icon el-icon-lx-add",
337
- staticStyle: {
338
- color: "#228b22"
339
- }
340
- }), e._v(e._s(e.menuLabel.appendChild) + " ")]), t("li", {
341
- directives: [{
342
- name: "show",
343
- rawName: "v-show",
344
- value: e.curData.id > -1,
345
- expression: "curData.id > -1"
346
- }],
347
- staticClass: "menu-item",
348
- on: {
349
- click: function(s) {
350
- return e.editNode(e.curNode, e.curData);
351
- }
352
- }
353
- }, [t("i", {
354
- staticClass: "menu-item-icon el-icon-edit-outline",
355
- staticStyle: {
356
- color: "#ffa500"
357
- }
358
- }), e._v(e._s(e.menuLabel.editNode) + " ")]), t("li", {
359
- directives: [{
360
- name: "show",
361
- rawName: "v-show",
362
- value: e.curNode.isLeaf,
363
- expression: "curNode.isLeaf"
364
- }],
365
- staticClass: "menu-item",
366
- on: {
367
- click: function(s) {
368
- return e.removeNodeModal(e.curNode, e.curData);
369
- }
370
- }
371
- }, [t("i", {
372
- staticClass: "menu-item-icon el-icon-delete",
373
- staticStyle: {
374
- color: "#f00"
375
- }
376
- }), e._v(e._s(e.menuLabel.removeNode) + " ")])];
377
- }, {
378
- curNode: e.curNode,
379
- curData: e.curData
380
- })], 2)]) : e._e()], 1)], 1);
381
- }, I = [];
382
- const O = {
29
+ import { hasOwn as m, isVerticalScrollbarVisible as T, scrollbarWidth as M, computePosition as K, isPlainObject as u, isFunction as N, isUndefined as p, isNotEmpty as P, fastClone as E, delay as D, findTreeChildren as L } from "@web-utils/core";
30
+ import { addResizeListener as C, removeResizeListener as g } from "@web-utils/integrations/resize";
31
+ import { cloneDeep as v } from "@web-utils/integrations/lodash";
32
+ import { a as R, b as z, c as y } from "../chunks/index.57f871af.mjs";
33
+ import { n as S } from "../chunks/_plugin-vue2_normalizer.446f5dc4.mjs";
34
+ const V = {
383
35
  name: "EditableTree",
384
36
  props: {
385
37
  label: {
@@ -395,9 +47,9 @@ const O = {
395
47
  },
396
48
  newNodeBuilder: {
397
49
  type: Function,
398
- default: (e, i) => ({
399
- name: e,
400
- parentId: i.id
50
+ default: (t, e) => ({
51
+ name: t,
52
+ parentId: e.id
401
53
  })
402
54
  },
403
55
  contextMenu: Boolean,
@@ -438,7 +90,7 @@ const O = {
438
90
  default: () => ({
439
91
  children: "children",
440
92
  label: "name",
441
- isLeaf: (e) => m(e, "hasChildren") ? !e.hasChildren : m(e, "hasChild") ? !e.hasChild : m(e, "children") && e.children ? e.children.length === 0 : !0
93
+ isLeaf: (t) => m(t, "hasChildren") ? !t.hasChildren : m(t, "hasChild") ? !t.hasChild : m(t, "children") && t.children ? t.children.length === 0 : !0
442
94
  })
443
95
  },
444
96
  menuLabel: {
@@ -492,19 +144,19 @@ const O = {
492
144
  modal: !0,
493
145
  inputErrorMessage: `${this.label}名不能为空!`,
494
146
  inputPlaceholder: `请输入${this.label}名...`,
495
- inputValidator: (e) => e != null && e.trim().length > 0
147
+ inputValidator: (t) => t != null && t.trim().length > 0
496
148
  };
497
149
  },
498
150
  innerTreeData() {
499
- var e;
500
- return (e = this.$attrs.data) != null && e.length ? this.$attrs.data : this.treeData;
151
+ var t;
152
+ return (t = this.$attrs.data) != null && t.length ? this.$attrs.data : this.treeData;
501
153
  }
502
154
  },
503
155
  watch: {
504
156
  defaultExpandedKeys: {
505
157
  immediate: !0,
506
- handler(e) {
507
- this.expandedKeys = [...e];
158
+ handler(t) {
159
+ this.expandedKeys = [...t];
508
160
  }
509
161
  }
510
162
  },
@@ -515,63 +167,63 @@ const O = {
515
167
  C(this.$refs.tree.$el, this.resize), C(this.$refs.treeWrapper, this.resize);
516
168
  },
517
169
  beforeDestroy() {
518
- v(this.$refs.tree.$el, this.resize), v(this.$refs.treeWrapper, this.resize);
170
+ g(this.$refs.tree.$el, this.resize), g(this.$refs.treeWrapper, this.resize);
519
171
  },
520
172
  methods: {
521
- filterTreeProperties: z,
522
- filterTreeEvents: S,
523
- addExpandKey(e) {
524
- this.reserveExpandKey && this.expandedKeys.push(e[this.nodeKey]);
173
+ filterTreeProperties: R,
174
+ filterTreeEvents: z,
175
+ addExpandKey(t) {
176
+ this.reserveExpandKey && this.expandedKeys.push(t[this.nodeKey]);
525
177
  },
526
- removeExpandKey(e) {
527
- this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((i) => i !== e[this.nodeKey]));
178
+ removeExpandKey(t) {
179
+ this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((e) => e !== t[this.nodeKey]));
528
180
  },
529
181
  resize() {
530
- M(this.$refs.treeWrapper) ? this.right = 4 + K : this.right = 4;
182
+ T(this.$refs.treeWrapper) ? this.right = 4 + M : this.right = 4;
531
183
  },
532
- showContextMenu(e, i, t) {
533
- return r(this, null, function* () {
534
- i.contextmenu === !1 || i.id === -1 || i.id === 0 || i.edit === !0 || this.contextMenu && (this.curNode = t, this.curData = i, this.showMenu = !0, this.$refs.tree.setCurrentKey(i.id), yield this.$nextTick(), this.position = P(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
184
+ showContextMenu(t, e, i) {
185
+ return a(this, null, function* () {
186
+ e.contextmenu === !1 || e.id === -1 || e.id === 0 || e.edit === !0 || this.contextMenu && (this.curNode = i, this.curData = e, this.showMenu = !0, this.$refs.tree.setCurrentKey(e.id), yield this.$nextTick(), this.position = K(t, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
535
187
  });
536
188
  },
537
189
  hideContextMenu() {
538
190
  this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
539
191
  },
540
192
  tryFetch() {
541
- return r(this, null, function* () {
542
- var e, i;
193
+ return a(this, null, function* () {
194
+ var t, e;
543
195
  if (this.lazy === !1 && this.fetchApi) {
544
- const t = yield this.fetchApi((i = (e = this.rootNode) == null ? void 0 : e.id) != null ? i : -1, {});
545
- if (u(t.data) && (t.data = [t.data]), t.data = t.data || [], this.empty = t.data.length === 0, u(this.customRootNode)) {
546
- const s = g(this.customRootNode);
547
- s[this.treeProps.children || "children"] = t.data, this.treeData = [s];
196
+ const i = yield this.fetchApi((e = (t = this.rootNode) == null ? void 0 : t.id) != null ? e : -1, {});
197
+ if (u(i.data) && (i.data = [i.data]), i.data = i.data || [], this.empty = i.data.length === 0, u(this.customRootNode)) {
198
+ const s = v(this.customRootNode);
199
+ s[this.treeProps.children || "children"] = i.data, this.treeData = [s];
548
200
  } else if (N(this.customRootNode)) {
549
- const s = this.customRootNode(t.data);
550
- s[this.treeProps.children || "children"] = t.data, this.treeData = u(s) ? [s] : s;
201
+ const s = this.customRootNode(i.data);
202
+ s[this.treeProps.children || "children"] = i.data, this.treeData = u(s) ? [s] : s;
551
203
  } else
552
- this.treeData = t.data;
204
+ this.treeData = i.data;
553
205
  }
554
206
  });
555
207
  },
556
- loadNode(e, i) {
557
- return r(this, null, function* () {
558
- var t, s, o, n;
559
- if (e.level === 0) {
560
- const a = yield this.fetchApi((s = (t = this.rootNode) == null ? void 0 : t.id) != null ? s : -1, e);
561
- if (this.empty = a.data.length === 0, u(this.customRootNode)) {
562
- const l = g(this.customRootNode);
563
- l[this.treeProps.children || "children"] = a.data, i([l]);
208
+ loadNode(t, e) {
209
+ return a(this, null, function* () {
210
+ var i, s, n, o;
211
+ if (t.level === 0) {
212
+ const r = yield this.fetchApi((s = (i = this.rootNode) == null ? void 0 : i.id) != null ? s : -1, t);
213
+ if (this.empty = r.data.length === 0, u(this.customRootNode)) {
214
+ const l = v(this.customRootNode);
215
+ l[this.treeProps.children || "children"] = r.data, e([l]);
564
216
  } else if (N(this.customRootNode)) {
565
- const l = this.customRootNode(a.data);
566
- l[this.treeProps.children || "children"] = a.data, this.treeData = u(l) ? [l] : l;
217
+ const l = this.customRootNode(r.data);
218
+ l[this.treeProps.children || "children"] = r.data, this.treeData = u(l) ? [l] : l;
567
219
  } else
568
- i(a.data);
569
- yield this.$nextTick(), this.$emit("root-node-loaded", a.data), this.defaultExpandedKeys ? this.expandedKeys = [(o = a == null ? void 0 : a.data[0]) == null ? void 0 : o.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(n = a == null ? void 0 : a.data[0]) == null ? void 0 : n.id]);
220
+ e(r.data);
221
+ yield this.$nextTick(), this.$emit("root-node-loaded", r.data), this.defaultExpandedKeys ? this.expandedKeys = [(n = r == null ? void 0 : r.data[0]) == null ? void 0 : n.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(o = r == null ? void 0 : r.data[0]) == null ? void 0 : o.id]);
570
222
  } else {
571
- if (e.leaf || e.data.isTempNode)
572
- return i([]);
573
- const a = yield this.fetchApi(e.data.id, e);
574
- i(a.data), yield this.$nextTick(), this.$emit("node-loaded", a.data);
223
+ if (t.leaf || t.data.isTempNode)
224
+ return e([]);
225
+ const r = yield this.fetchApi(t.data.id, t);
226
+ e(r.data), yield this.$nextTick(), this.$emit("node-loaded", r.data);
575
227
  }
576
228
  });
577
229
  },
@@ -587,121 +239,121 @@ const O = {
587
239
  cancelEdit() {
588
240
  this.editData && (p(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
589
241
  },
590
- editNode(e, i) {
591
- return r(this, null, function* () {
592
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = i, this.text = i[this.treeProps.label], p(i.edit) ? this.$set(i, "edit", !0) : i.edit = !0, yield this.$nextTick(), this.$refs.labelTxt.focus()) : yield this.$prompt(`请输入新的${this.label}名:`, h(c({}, this.defaultOptions), {
593
- inputValue: i[this.treeProps.label],
594
- beforeClose: (t, s, o) => r(this, null, function* () {
595
- if (t === "confirm") {
242
+ editNode(t, e) {
243
+ return a(this, null, function* () {
244
+ !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = e, this.text = e[this.treeProps.label], p(e.edit) ? this.$set(e, "edit", !0) : e.edit = !0, yield this.$nextTick(), this.$refs.labelTxt.focus()) : yield this.$prompt(`请输入新的${this.label}名:`, h(c({}, this.defaultOptions), {
245
+ inputValue: e[this.treeProps.label],
246
+ beforeClose: (i, s, n) => a(this, null, function* () {
247
+ if (i === "confirm") {
596
248
  try {
597
- s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...", this.text = s.inputValue, yield this.onConfirm(this.curNode, this.curData), o();
598
- } catch (n) {
249
+ s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...", this.text = s.inputValue, yield this.onConfirm(this.curNode, this.curData), n();
250
+ } catch (o) {
599
251
  s.confirmButtonText = "确定";
600
252
  }
601
253
  s.confirmButtonLoading = !1;
602
254
  } else
603
- o();
255
+ n();
604
256
  })
605
- })).catch((t) => t);
257
+ })).catch((i) => i);
606
258
  });
607
259
  },
608
260
  appendRootNode() {
609
- return r(this, null, function* () {
261
+ return a(this, null, function* () {
610
262
  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}名:`, h(c({}, this.defaultOptions), {
611
- beforeClose: (e, i, t) => r(this, null, function* () {
612
- if (e === "confirm") {
263
+ beforeClose: (t, e, i) => a(this, null, function* () {
264
+ if (t === "confirm") {
613
265
  try {
614
- this.createNewChild(-1), i.confirmButtonLoading = !0, i.confirmButtonText = "处理中...";
615
- const s = yield this.saveApi(this.newNodeBuilder(i.inputValue, { id: -1 }));
616
- this.newChild[this.treeProps.label] = i.inputValue, this.newChild.edit = !1, y(this.newChild, s.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.locateView(), t();
266
+ this.createNewChild(-1), e.confirmButtonLoading = !0, e.confirmButtonText = "处理中...";
267
+ const s = yield this.saveApi(this.newNodeBuilder(e.inputValue, { id: -1 }));
268
+ this.newChild[this.treeProps.label] = e.inputValue, this.newChild.edit = !1, y(this.newChild, s.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.locateView(), i();
617
269
  } catch (s) {
618
- i.confirmButtonText = "确定";
270
+ e.confirmButtonText = "确定";
619
271
  }
620
- i.confirmButtonLoading = !1;
272
+ e.confirmButtonLoading = !1;
621
273
  } else
622
- t();
274
+ i();
623
275
  })
624
- })).catch((e) => e);
276
+ })).catch((t) => t);
625
277
  });
626
278
  },
627
- appendChildNode(e) {
279
+ appendChildNode(t) {
628
280
  this.text = "";
629
- const i = e.expanded;
630
- e.expand(() => r(this, null, function* () {
631
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), yield this.scrollIntoView(i)) : yield this.$prompt(`请输入${this.label}名:`, h(c({}, this.defaultOptions), {
632
- beforeClose: (t, s, o) => r(this, null, function* () {
633
- if (t === "confirm") {
281
+ const e = t.expanded;
282
+ t.expand(() => a(this, null, function* () {
283
+ !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(t.data.id), this.$refs.tree.append(this.newChild, t), yield this.scrollIntoView(e)) : yield this.$prompt(`请输入${this.label}名:`, h(c({}, this.defaultOptions), {
284
+ beforeClose: (i, s, n) => a(this, null, function* () {
285
+ if (i === "confirm") {
634
286
  try {
635
- this.createNewChild(e.data.id), s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...";
636
- const n = yield this.saveApi(this.newNodeBuilder(s.inputValue, e.data));
637
- this.newChild[this.treeProps.label] = s.inputValue, this.newChild.edit = !1, y(this.newChild, n.data), this.$refs.tree.append(this.newChild, e), yield this.locateView(), o();
638
- } catch (n) {
287
+ this.createNewChild(t.data.id), s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...";
288
+ const o = yield this.saveApi(this.newNodeBuilder(s.inputValue, t.data));
289
+ this.newChild[this.treeProps.label] = s.inputValue, this.newChild.edit = !1, y(this.newChild, o.data), this.$refs.tree.append(this.newChild, t), yield this.locateView(), n();
290
+ } catch (o) {
639
291
  s.confirmButtonText = "确定";
640
292
  }
641
293
  s.confirmButtonLoading = !1;
642
294
  } else
643
- o();
295
+ n();
644
296
  })
645
- })).catch((t) => t);
297
+ })).catch((i) => i);
646
298
  }));
647
299
  },
648
- appendChildNodeWithData(e, i, t) {
300
+ appendChildNodeWithData(t, e, i) {
649
301
  this.text = "";
650
- const s = e.expanded;
651
- e.expand(() => r(this, null, function* () {
302
+ const s = t.expanded;
303
+ t.expand(() => a(this, null, function* () {
652
304
  this.clear(), this.newChild = {
653
305
  id: -1,
654
- parentId: i,
655
- [this.treeProps.label]: t,
306
+ parentId: e,
307
+ [this.treeProps.label]: i,
656
308
  edit: !1,
657
309
  isTempNode: !0,
658
310
  hasChildren: !1
659
- }, this.$refs.tree.append(this.newChild, e), yield this.scrollIntoView(s);
311
+ }, this.$refs.tree.append(this.newChild, t), yield this.scrollIntoView(s);
660
312
  }));
661
313
  },
662
- appendPeerNode(e) {
663
- e.parent && e.parent.level !== 0 ? this.appendChildNode(e.parent) : this.appendRootNode();
314
+ appendPeerNode(t) {
315
+ t.parent && t.parent.level !== 0 ? this.appendChildNode(t.parent) : this.appendRootNode();
664
316
  },
665
- addRootNode(e) {
666
- return r(this, null, function* () {
667
- this.$refs.tree.remove(e), yield this.$nextTick(), this.$refs.tree.root.insertChild({ data: e }, void 0, !0);
317
+ addRootNode(t) {
318
+ return a(this, null, function* () {
319
+ this.$refs.tree.remove(t), yield this.$nextTick(), this.$refs.tree.root.insertChild({ data: t }, void 0, !0);
668
320
  });
669
321
  },
670
- addChildNode(e) {
671
- return r(this, null, function* () {
672
- this.curNode && this.curNode.level !== 0 ? this.curNode.expand(() => r(this, null, function* () {
673
- this.$refs.tree.remove(e), yield this.$nextTick(), this.$refs.tree.append(e, this.curNode);
674
- })) : yield this.addRootNode(e);
322
+ addChildNode(t) {
323
+ return a(this, null, function* () {
324
+ this.curNode && this.curNode.level !== 0 ? this.curNode.expand(() => a(this, null, function* () {
325
+ this.$refs.tree.remove(t), yield this.$nextTick(), this.$refs.tree.append(t, this.curNode);
326
+ })) : yield this.addRootNode(t);
675
327
  });
676
328
  },
677
- addPeerNode(e) {
678
- return r(this, null, function* () {
679
- this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(() => r(this, null, function* () {
680
- this.$refs.tree.remove(e), yield this.$nextTick(), this.$refs.tree.append(e, this.curNode.parent);
681
- })) : yield this.addRootNode(e);
329
+ addPeerNode(t) {
330
+ return a(this, null, function* () {
331
+ this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(() => a(this, null, function* () {
332
+ this.$refs.tree.remove(t), yield this.$nextTick(), this.$refs.tree.append(t, this.curNode.parent);
333
+ })) : yield this.addRootNode(t);
682
334
  });
683
335
  },
684
- updateNode(e) {
685
- const i = this.$refs.tree.getNode(e);
686
- i && (i.data = e);
336
+ updateNode(t) {
337
+ const e = this.$refs.tree.getNode(t);
338
+ e && (e.data = t);
687
339
  },
688
- setCurrentKey(e) {
689
- this.$refs.tree && this.$refs.tree.setCurrentKey(e);
340
+ setCurrentKey(t) {
341
+ this.$refs.tree && this.$refs.tree.setCurrentKey(t);
690
342
  },
691
- createNewChild(e) {
343
+ createNewChild(t) {
692
344
  this.newChild = {
693
345
  id: -1,
694
- parentId: e,
346
+ parentId: t,
695
347
  [this.treeProps.label]: "",
696
348
  edit: !0,
697
349
  isTempNode: !0,
698
350
  hasChildren: !1
699
351
  }, this.$emit("create-new-node", this.newChild);
700
352
  },
701
- removeNodeModal(e) {
702
- return r(this, null, function* () {
353
+ removeNodeModal(t) {
354
+ return a(this, null, function* () {
703
355
  yield this.$confirm(
704
- `你确定要删除${this.label}[<span class="break-word" style="color: orange">${e.data[this.treeProps.label]}</span>]吗?`,
356
+ `你确定要删除${this.label}[<span class="break-word" style="color: orange">${t.data[this.treeProps.label]}</span>]吗?`,
705
357
  "系统提示",
706
358
  {
707
359
  type: "warning",
@@ -711,134 +363,171 @@ const O = {
711
363
  closeOnClickModal: !1,
712
364
  confirmButtonClass: "el-button--danger",
713
365
  cancelButtonClass: "el-button--primary is-plain",
714
- beforeClose: (i, t, s) => r(this, null, function* () {
715
- if (i === "confirm") {
366
+ beforeClose: (e, i, s) => a(this, null, function* () {
367
+ if (e === "confirm") {
716
368
  try {
717
- t.confirmButtonLoading = !0, t.confirmButtonText = "删除...";
718
- const o = e.parent, n = yield this.deleteApi(e.data.id);
719
- n.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", o, e.data), s()) : this.$message.error(n.message);
720
- } catch (o) {
369
+ i.confirmButtonLoading = !0, i.confirmButtonText = "删除...";
370
+ const n = t.parent, o = yield this.deleteApi(t.data.id);
371
+ o.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(t), this.$emit("node-deleted", n, t.data), s()) : this.$message.error(o.message);
372
+ } catch (n) {
721
373
  }
722
- t.confirmButtonText = "确定", t.confirmButtonLoading = !1;
374
+ i.confirmButtonText = "确定", i.confirmButtonLoading = !1;
723
375
  } else
724
376
  s();
725
377
  })
726
378
  }
727
- ).catch((i) => i);
379
+ ).catch((e) => e);
728
380
  });
729
381
  },
730
- removeNode(e) {
731
- return r(this, null, function* () {
382
+ removeNode(t) {
383
+ return a(this, null, function* () {
732
384
  try {
733
- const i = e.parent;
385
+ const e = t.parent;
734
386
  if (this.deleteApi) {
735
- const t = yield this.deleteApi(e.data.id);
736
- t.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", i, e.data)) : this.$message.error(t.message);
387
+ const i = yield this.deleteApi(t.data.id);
388
+ i.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(t), this.$emit("node-deleted", e, t.data)) : this.$message.error(i.message);
737
389
  } else
738
- this.$refs.tree.remove(e);
739
- } catch (i) {
390
+ this.$refs.tree.remove(t);
391
+ } catch (e) {
740
392
  }
741
393
  });
742
394
  },
743
- onConfirm(e, i) {
744
- return r(this, null, function* () {
745
- if (i[this.treeProps.label] === this.text || !E(this.text)) {
395
+ onConfirm(t, e) {
396
+ return a(this, null, function* () {
397
+ if (e[this.treeProps.label] === this.text || !P(this.text)) {
746
398
  this.clear();
747
399
  return;
748
400
  }
749
- p(i.loading) ? this.$set(i, "loading", !0) : i.loading = !0;
401
+ p(e.loading) ? this.$set(e, "loading", !0) : e.loading = !0;
750
402
  try {
751
- if (this.loading = !0, i.id === -1) {
752
- const t = yield this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), s = D(i);
753
- y(i, h(c({}, t.data), { isTempNode: !1 })), this.$emit("node-added", i, s, e), this.registerNode(e);
403
+ if (this.loading = !0, e.id === -1) {
404
+ const i = yield this.saveApi(this.newNodeBuilder(this.text, t.parent.data || { id: -1 })), s = E(e);
405
+ y(e, h(c({}, i.data), { isTempNode: !1 })), this.$emit("node-added", e, s, t), this.registerNode(t);
754
406
  } else
755
- yield this.updateApi(h(c({}, i), { [this.treeProps.label]: this.text }));
756
- i[this.treeProps.label] = this.text, i.edit = !1, this.$emit("node-updated", i, e), this.text = "";
757
- } catch (t) {
407
+ yield this.updateApi(h(c({}, e), { [this.treeProps.label]: this.text }));
408
+ e[this.treeProps.label] = this.text, e.edit = !1, this.$emit("node-updated", e, t), this.text = "";
409
+ } catch (i) {
758
410
  }
759
- i.loading = !1, this.loading = !1;
411
+ e.loading = !1, this.loading = !1;
760
412
  });
761
413
  },
762
- onCancel(e, i) {
763
- i.id === -1 ? this.$refs.tree.remove(e) : i.edit = !1, this.text = "";
414
+ onCancel(t, e) {
415
+ e.id === -1 ? this.$refs.tree.remove(t) : e.edit = !1, this.text = "";
764
416
  },
765
- nodeClick(e, i, t) {
766
- this.hideContextMenu(), (p(e.loading) || !e.loading) && (this.curNode = i, this.curData = e, this.$emit("on-node-click", e, i, t));
417
+ nodeClick(t, e, i) {
418
+ this.hideContextMenu(), (p(t.loading) || !t.loading) && (this.curNode = e, this.curData = t, this.$emit("on-node-click", t, e, i));
767
419
  },
768
420
  getCurrentNode() {
769
421
  return this.$refs.tree.getCurrentNode();
770
422
  },
771
423
  locateView() {
772
- return r(this, null, function* () {
424
+ return a(this, null, function* () {
773
425
  yield this.$nextTick();
774
- const e = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
775
- e && e.scrollIntoView();
426
+ const t = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
427
+ t && t.scrollIntoView();
776
428
  });
777
429
  },
778
- scrollIntoView(e) {
779
- return r(this, null, function* () {
780
- var i, t;
781
- yield this.$nextTick(), e || (yield L(300)), (t = (i = this.$refs) == null ? void 0 : i.labelTxt) == null || t.focus();
430
+ scrollIntoView(t) {
431
+ return a(this, null, function* () {
432
+ var e, i;
433
+ yield this.$nextTick(), t || (yield D(300)), (i = (e = this.$refs) == null ? void 0 : e.labelTxt) == null || i.focus();
782
434
  });
783
435
  },
784
- inputKeyup(e, i, t) {
785
- e.keyCode === 13 && this.onConfirm(i, t), e.keyCode === 27 && this.clear();
436
+ inputKeyup(t, e, i) {
437
+ t.keyCode === 13 && this.onConfirm(e, i), t.keyCode === 27 && this.clear();
786
438
  },
787
- inputBlur(e, i, t) {
788
- this.confirmButton || this.onConfirm(i, t);
439
+ inputBlur(t, e, i) {
440
+ this.confirmButton || this.onConfirm(e, i);
789
441
  },
790
442
  getCheckedKeys() {
791
443
  return this.$refs.tree.getCheckedKeys();
792
444
  },
793
- setCheckedKeys(e) {
794
- this.$refs.tree.setCheckedKeys(e);
445
+ setCheckedKeys(t) {
446
+ this.$refs.tree.setCheckedKeys(t);
795
447
  },
796
448
  getCheckedNodes() {
797
449
  return this.$refs.tree.getCheckedNodes();
798
450
  },
799
- setCheckedNodes(e) {
800
- this.$refs.tree.setCheckedNodes(e);
451
+ setCheckedNodes(t) {
452
+ this.$refs.tree.setCheckedNodes(t);
801
453
  },
802
- getNode(e) {
803
- return this.$refs.tree.getNode(e);
454
+ getNode(t) {
455
+ return this.$refs.tree.getNode(t);
804
456
  },
805
457
  getRootNode() {
806
458
  return this.$refs.tree.root;
807
459
  },
808
- findTreeNode(e) {
809
- return R(
460
+ findTreeNode(t) {
461
+ return L(
810
462
  this.$refs.tree.root.childNodes,
811
- (i) => i.data === e || i.data.id === e,
463
+ (e) => e.data === t || e.data.id === t,
812
464
  "childNodes"
813
465
  );
814
466
  },
815
- registerNode(e) {
816
- e.store.registerNode(e), delete e.store.nodesMap[-1];
467
+ registerNode(t) {
468
+ t.store.registerNode(t), delete t.store.nodesMap[-1];
817
469
  },
818
470
  reloadTree() {
819
- return r(this, null, function* () {
471
+ return a(this, null, function* () {
820
472
  this.lazy ? this.treeKey = Date.now() : yield this.tryFetch();
821
473
  });
822
474
  }
823
475
  }
824
- }, $ = {};
825
- var F = /* @__PURE__ */ V(
826
- O,
476
+ };
477
+ var A = function() {
478
+ var e = this, i = e._self._c;
479
+ return i("div", { staticClass: "editable-tree" }, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? i("ElButton", { staticStyle: { position: "absolute", top: "4px", "z-index": "1" }, style: { right: `${e.right}px` }, attrs: { type: "primary", size: "mini", icon: "el-icon-plus", circle: "", plain: "" }, on: { click: function(s) {
480
+ return s.stopPropagation(), e.$emit("add-root-node");
481
+ } } }) : e._e(), i("div", { ref: "treeWrapper", staticClass: "et-tree-wrapper" }, [!e.readonly && e.addRootNodeButtonStyle === "top" ? i("div", { staticStyle: { "padding-left": "24px" } }, [i("ElButton", { attrs: { disabled: e.loading, size: "mini", type: "text" }, on: { click: e.appendRootNode } }, [i("i", { staticClass: "el-icon-lx-add" }), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), i("ElTree", e._g(e._b({ key: e.treeKey, ref: "tree", staticClass: "flex-item", attrs: { "default-expanded-keys": e.expandedKeys, "expand-on-click-node": !1, "highlight-current": "", load: e.loadNode, data: e.innerTreeData, props: e.treeProps, lazy: e.lazy, "node-key": e.nodeKey }, on: { "node-click": e.nodeClick, "node-contextmenu": e.showContextMenu, "node-expand": e.addExpandKey, "node-collapse": e.removeExpandKey }, scopedSlots: e._u([{ key: "default", fn: function({ node: s, data: n }) {
482
+ return [e._t("default", function() {
483
+ return [n.edit ? [i("span", { staticClass: "custom-tree-node flex-row flex-item oh", attrs: { "data-id": n.id } }, [e.icon ? i("i", { staticClass: "node-icon shrink-0", class: n.loading ? "el-icon-loading" : "el-icon-edit-outline" }) : e._e(), i("ElInput", { ref: "labelTxt", staticClass: "node-input flex-item", attrs: { size: "mini", placeholder: e.defaultOptions.inputPlaceholder }, on: { blur: (o) => e.inputBlur(o, s, n) }, nativeOn: { keyup: function(o) {
484
+ return ((r) => e.inputKeyup(r, s, n)).apply(null, arguments);
485
+ }, click: function(o) {
486
+ o.stopPropagation();
487
+ } }, model: { value: e.text, callback: function(o) {
488
+ e.text = o;
489
+ }, expression: "text" } }), e.confirmButton ? [i("ElButton", { directives: [{ name: "show", rawName: "v-show", value: !n.loading, expression: "!data.loading" }], staticClass: "shrink-0", attrs: { size: "mini", type: "text" }, on: { click: function(o) {
490
+ return o.stopPropagation(), e.onConfirm(s, n);
491
+ } } }, [e._v("确定")]), i("ElButton", { directives: [{ name: "show", rawName: "v-show", value: !n.loading, expression: "!data.loading" }], staticClass: "shrink-0", attrs: { size: "mini", type: "text" }, on: { click: function(o) {
492
+ return o.stopPropagation(), e.onCancel(s, n);
493
+ } } }, [e._v("取消")])] : e._e()], 2)] : [i("span", { staticClass: "custom-tree-node", attrs: { "data-id": n.id } }, [i("span", { staticClass: "node-label flex-row flex-item oh ellipsis-1" }, [e.icon ? i("i", { staticClass: "node-icon", class: n.loading ? "el-icon-loading" : e.icon(n, s) }) : e._e(), i("span", { staticClass: "flex-item-relative", staticStyle: { height: "21px" } }, [i("span", { staticClass: "ellipsis-1 absolute-box et-tree-label", attrs: { title: s.label } }, [e._t("label", function() {
494
+ return [e._v(e._s(s.label))];
495
+ }, { data: n, node: s })], 2)]), e._t("label-suffix", null, { node: s, data: n })], 2), !e.contextMenu && !e.readonly ? i("span", { directives: [{ name: "show", rawName: "v-show", value: !n.loading && !e.loading, expression: "!data.loading && !loading" }], staticClass: "handle-actions" }, [i("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(o) {
496
+ return o.stopPropagation(), e.appendChildNode(s, n);
497
+ } } }, [e._v("添加")]), i("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(o) {
498
+ return o.stopPropagation(), e.editNode(s, n);
499
+ } } }, [e._v("修改")]), i("ElPopconfirm", { staticClass: "pop-confirm", attrs: { "icon-color": "red", title: "你确定要删除吗?" }, on: { confirm: function(o) {
500
+ return e.removeNode(s, n);
501
+ } }, scopedSlots: e._u([{ key: "reference", fn: function() {
502
+ return [i("ElButton", { directives: [{ name: "show", rawName: "v-show", value: s.isLeaf, expression: "node.isLeaf" }], staticStyle: { "margin-left": "4px" }, attrs: { size: "mini", type: "text" }, on: { click: function(o) {
503
+ o.stopPropagation();
504
+ } } }, [e._v("删除")])];
505
+ }, proxy: !0 }], null, !0) })], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? i("span", { directives: [{ name: "show", rawName: "v-show", value: !n.loading && !e.loading, expression: "!data.loading && !loading" }], staticClass: "handle-actions", staticStyle: { display: "inline-block" } }, [i("ElButton", { staticStyle: { padding: "6px 10px 0" }, attrs: { size: "mini", type: "text" }, on: { click: function(o) {
506
+ return o.stopPropagation(), e.showContextMenu(o, n, s);
507
+ } } }, [e._v(". . .")])], 1) : e._e()])]];
508
+ }, { node: s, data: n })];
509
+ } }], null, !0) }, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? i("div", { directives: [{ name: "show", rawName: "v-show", value: e.showMenu, expression: "showMenu" }], ref: "contextMenu", staticClass: "menu", style: e.position }, [i("ul", { staticClass: "menu-list" }, [e._t("context-menu", function() {
510
+ return [i("li", { directives: [{ name: "show", rawName: "v-show", value: e.curData.id > -1, expression: "curData.id > -1" }], staticClass: "menu-item", on: { click: function(s) {
511
+ return e.appendPeerNode(e.curNode, e.curData);
512
+ } } }, [i("i", { staticClass: "menu-item-icon el-icon-lx-add", staticStyle: { color: "#228b22" } }), e._v(e._s(e.menuLabel.appendPeer) + " ")]), i("li", { staticClass: "menu-item", on: { click: function(s) {
513
+ return e.appendChildNode(e.curNode, e.curData);
514
+ } } }, [i("i", { staticClass: "menu-item-icon el-icon-lx-add", staticStyle: { color: "#228b22" } }), e._v(e._s(e.menuLabel.appendChild) + " ")]), i("li", { directives: [{ name: "show", rawName: "v-show", value: e.curData.id > -1, expression: "curData.id > -1" }], staticClass: "menu-item", on: { click: function(s) {
515
+ return e.editNode(e.curNode, e.curData);
516
+ } } }, [i("i", { staticClass: "menu-item-icon el-icon-edit-outline", staticStyle: { color: "#ffa500" } }), e._v(e._s(e.menuLabel.editNode) + " ")]), i("li", { directives: [{ name: "show", rawName: "v-show", value: e.curNode.isLeaf, expression: "curNode.isLeaf" }], staticClass: "menu-item", on: { click: function(s) {
517
+ return e.removeNodeModal(e.curNode, e.curData);
518
+ } } }, [i("i", { staticClass: "menu-item-icon el-icon-delete", staticStyle: { color: "#f00" } }), e._v(e._s(e.menuLabel.removeNode) + " ")])];
519
+ }, { curNode: e.curNode, curData: e.curData })], 2)]) : e._e()], 1)], 1);
520
+ }, I = [], O = /* @__PURE__ */ S(
521
+ V,
827
522
  A,
828
523
  I,
829
524
  !1,
830
- j,
525
+ null,
831
526
  null,
832
527
  null,
833
528
  null
834
529
  );
835
- function j(e) {
836
- for (let i in $)
837
- this[i] = $[i];
838
- }
839
- const Q = /* @__PURE__ */ function() {
840
- return F.exports;
841
- }();
530
+ const G = O.exports;
842
531
  export {
843
- Q as default
532
+ G as default
844
533
  };