@web-utils/form-ui 1.0.0-beta36 → 1.0.0-beta37
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.
- package/chunks/{iWQD3xvX.mjs → B17LMtNG.mjs} +11 -16
- package/chunks/{DFsI7Y6h.mjs → B2HO8aAj.mjs} +11 -11
- package/chunks/{axr9InkL.mjs → BC0gfvsl.mjs} +9 -13
- package/chunks/{DQxPzCsy.mjs → BMAsNnWL.mjs} +11 -15
- package/chunks/{DQJyNm1V.mjs → Bd1UFJic.mjs} +135 -131
- package/chunks/{D5_ctQqL.mjs → BeBtvo7Q.mjs} +1 -1
- package/chunks/{Cr1vBYne.mjs → BeyC-b9n.mjs} +12 -15
- package/chunks/{A3sHIRQ_.mjs → BiIR7j9T.mjs} +15 -42
- package/chunks/{_dm2lLNL.mjs → BrXlRZbl.mjs} +2 -2
- package/chunks/{BTS_zTkz.mjs → BufIRDd0.mjs} +35 -39
- package/chunks/{Buc52aVh.mjs → Byr79NWq.mjs} +11 -29
- package/chunks/{BLWwTutr.mjs → C81uwgZb.mjs} +14 -33
- package/chunks/{CNskrN5I.mjs → C95McWbI.mjs} +2 -2
- package/chunks/CE8bze--.mjs +231 -0
- package/chunks/{DcbnHU8K.mjs → CGmMqCP6.mjs} +19 -23
- package/chunks/{D7hD-ppq.mjs → CRrdgtwT.mjs} +1 -1
- package/chunks/{DistOy_O.mjs → CUvhHVXq.mjs} +27 -19
- package/chunks/{DJKE5P39.mjs → CZ6kuiWf.mjs} +2 -2
- package/chunks/{Dgyjc3LT.mjs → Cab-ZjRx.mjs} +29 -45
- package/chunks/{ZXCLnZFa.mjs → Ce5K-XbN.mjs} +111 -144
- package/chunks/{CLn0r4lV.mjs → CszLlvRH.mjs} +15 -17
- package/chunks/{CGJkMYZ4.mjs → D0M61zlJ.mjs} +11 -20
- package/chunks/DjX-fB-E.mjs +35 -0
- package/chunks/{BwdWZEjT.mjs → DkXSvAFI.mjs} +12 -18
- package/chunks/{DQKi5eEl.mjs → XqRTtFfp.mjs} +2 -2
- package/chunks/{BX-cVxlK.mjs → cmuHpsX6.mjs} +21 -14
- package/chunks/{1cDNhlSV.mjs → h0Y7oZ-O.mjs} +2 -2
- package/editable-tree/index.d.ts +1 -1
- package/editable-tree/index.mjs +1 -1
- package/element-dialog/index.d.ts +1 -1
- package/element-dialog/index.mjs +1 -1
- package/form-cascader/index.d.ts +0 -14
- package/form-cascader/index.mjs +1 -1
- package/form-check-box-group/index.d.ts +0 -2
- package/form-check-box-group/index.mjs +1 -1
- package/form-checkbox/index.d.ts +36 -10
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +2 -6
- package/form-holder/index.mjs +1 -1
- package/form-image/index.d.ts +2 -14
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +0 -24
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +0 -6
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +1 -1
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +0 -2
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +0 -2
- package/form-rate/index.mjs +1 -1
- package/form-select/index.d.ts +0 -14
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +0 -4
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +0 -2
- package/form-switch/index.mjs +1 -1
- package/form-text/index.mjs +1 -1
- package/helper/dictionary.mjs +1 -1
- package/iframe-window/index.mjs +1 -1
- package/index.mjs +25 -25
- package/package.json +1 -1
- package/pageable-table/index.d.ts +0 -38
- package/pageable-table/index.mjs +1 -1
- package/table-column/index.mjs +1 -1
- package/table-view/index.mjs +6 -6
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.mjs +1 -1
- package/web-types.json +1 -1
- package/chunks/BLRY0zkF.mjs +0 -51
- package/chunks/BvsmTC3G.mjs +0 -229
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import { computePosition as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { ElMessageBox as
|
|
7
|
-
import { cloneDeep as
|
|
8
|
-
import { ElInput as
|
|
9
|
-
import { addResizeListener as
|
|
1
|
+
import { t as e, u as t } from "./cmuHpsX6.mjs";
|
|
2
|
+
import { t as n } from "./XqRTtFfp.mjs";
|
|
3
|
+
import { t as r } from "./B1MSrc6f.mjs";
|
|
4
|
+
import { computePosition as i, delay as a, fastClone as o, findTreeChildren as s, hasOwn as c, isFunction as l, isNotEmpty as u, isPlainObject as d, isUndefined as f, isVerticalScrollbarVisible as p, patch as m, scrollbarWidth as h } from "@web-utils/core";
|
|
5
|
+
import { Fragment as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createTextVNode as x, createVNode as S, mergeProps as C, normalizeClass as w, normalizeStyle as T, openBlock as E, renderSlot as D, toDisplayString as O, toHandlers as k, vShow as A, withCtx as j, withDirectives as M, withModifiers as N } from "vue";
|
|
6
|
+
import { ElMessageBox as P } from "element-plus";
|
|
7
|
+
import { cloneDeep as F } from "@web-utils/integrations/lodash";
|
|
8
|
+
import { ElInput as I, ElPopconfirm as L, ElTree as R } from "element-plus/es";
|
|
9
|
+
import { addResizeListener as z, removeResizeListener as B } from "@web-utils/integrations/resize";
|
|
10
10
|
//#region src/components/form/props/tree.ts
|
|
11
|
-
var
|
|
11
|
+
var V = {
|
|
12
12
|
label: {
|
|
13
13
|
type: String,
|
|
14
14
|
default: "书签"
|
|
@@ -48,7 +48,7 @@ var H = {
|
|
|
48
48
|
default: () => ({
|
|
49
49
|
children: "children",
|
|
50
50
|
label: "name",
|
|
51
|
-
isLeaf: (e) =>
|
|
51
|
+
isLeaf: (e) => c(e, "hasChildren") ? !e.hasChildren : c(e, "hasChild") ? !e.hasChild : c(e, "children") && e.children ? e.children.length === 0 : !0
|
|
52
52
|
})
|
|
53
53
|
},
|
|
54
54
|
menuLabel: {
|
|
@@ -78,9 +78,9 @@ var H = {
|
|
|
78
78
|
default: "id"
|
|
79
79
|
},
|
|
80
80
|
defaultExpandAll: Boolean
|
|
81
|
-
},
|
|
81
|
+
}, H = { icon: !0 }, U = (e) => H[e] !== !0, W = {
|
|
82
82
|
name: "EditableTree",
|
|
83
|
-
props: { ...
|
|
83
|
+
props: { ...V },
|
|
84
84
|
emits: {
|
|
85
85
|
"remove-new-node": null,
|
|
86
86
|
"node-loaded": null,
|
|
@@ -130,20 +130,24 @@ var H = {
|
|
|
130
130
|
this.expandedKeys = [...e];
|
|
131
131
|
}
|
|
132
132
|
} },
|
|
133
|
-
setup(
|
|
133
|
+
setup(e) {
|
|
134
|
+
let { autoBindProps: n, listeners: r } = t(e, {
|
|
135
|
+
predicate: U,
|
|
136
|
+
removeOn: !0
|
|
137
|
+
});
|
|
134
138
|
return {
|
|
135
|
-
|
|
136
|
-
listeners:
|
|
139
|
+
autoBindProps: n,
|
|
140
|
+
listeners: r
|
|
137
141
|
};
|
|
138
142
|
},
|
|
139
143
|
created() {
|
|
140
144
|
this.tryFetch();
|
|
141
145
|
},
|
|
142
146
|
mounted() {
|
|
143
|
-
|
|
147
|
+
z(this.$refs.tree.$el, this.resize), z(this.$refs.treeWrapper, this.resize);
|
|
144
148
|
},
|
|
145
149
|
beforeUnmount() {
|
|
146
|
-
|
|
150
|
+
B(this.$refs.tree.$el, this.resize), B(this.$refs.treeWrapper, this.resize);
|
|
147
151
|
},
|
|
148
152
|
methods: {
|
|
149
153
|
addExpandKey(e) {
|
|
@@ -153,10 +157,10 @@ var H = {
|
|
|
153
157
|
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((t) => t !== e[this.nodeKey]));
|
|
154
158
|
},
|
|
155
159
|
resize() {
|
|
156
|
-
|
|
160
|
+
p(this.$refs.treeWrapper) ? this.right = 4 + h : this.right = 4;
|
|
157
161
|
},
|
|
158
162
|
async showContextMenu(e, t, n) {
|
|
159
|
-
t.contextmenu === !1 || t.id === -1 || t.id === 0 || t.edit === !0 || this.readonly || this.contextMenu && (this.curNode = n, this.curData = t, this.showMenu = !0, this.$refs.tree.setCurrentKey(t.id), await this.$nextTick(), this.position =
|
|
163
|
+
t.contextmenu === !1 || t.id === -1 || t.id === 0 || t.edit === !0 || this.readonly || this.contextMenu && (this.curNode = n, this.curData = t, this.showMenu = !0, this.$refs.tree.setCurrentKey(t.id), await this.$nextTick(), this.position = i(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
|
|
160
164
|
},
|
|
161
165
|
hideContextMenu() {
|
|
162
166
|
this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
|
|
@@ -172,14 +176,14 @@ var H = {
|
|
|
172
176
|
return;
|
|
173
177
|
}
|
|
174
178
|
let i = r.data.data;
|
|
175
|
-
|
|
179
|
+
d(i) && (i = [i]), i = i || [];
|
|
176
180
|
let a = [];
|
|
177
|
-
if (this.empty = i.length === 0,
|
|
178
|
-
let e =
|
|
181
|
+
if (this.empty = i.length === 0, d(this.customRootNode)) {
|
|
182
|
+
let e = F(this.customRootNode);
|
|
179
183
|
e[this.treeProps.children || "children"] = i, a = [e];
|
|
180
|
-
} else if (
|
|
184
|
+
} else if (l(this.customRootNode)) {
|
|
181
185
|
let e = this.customRootNode(i);
|
|
182
|
-
e[this.treeProps.children || "children"] = i, a =
|
|
186
|
+
e[this.treeProps.children || "children"] = i, a = d(e) ? [e] : e;
|
|
183
187
|
} else a = i;
|
|
184
188
|
if ((e = this.defaultExpandedKeys) != null && e.length) this.expandedKeys = [...this.defaultExpandedKeys];
|
|
185
189
|
else if (this.expandFirstNode) {
|
|
@@ -193,12 +197,12 @@ var H = {
|
|
|
193
197
|
if (e.level === 0) {
|
|
194
198
|
var n, r;
|
|
195
199
|
let o = (await this.fetchApi(((n = this.rootNode) == null ? void 0 : n.id) ?? -1, e)).data.data;
|
|
196
|
-
if (this.empty = o.length === 0,
|
|
197
|
-
let e =
|
|
200
|
+
if (this.empty = o.length === 0, d(this.customRootNode)) {
|
|
201
|
+
let e = F(this.customRootNode);
|
|
198
202
|
e[this.treeProps.children || "children"] = o, o = [e], t(o);
|
|
199
|
-
} else if (
|
|
203
|
+
} else if (l(this.customRootNode)) {
|
|
200
204
|
let e = this.customRootNode(o);
|
|
201
|
-
e[this.treeProps.children || "children"] = o, o =
|
|
205
|
+
e[this.treeProps.children || "children"] = o, o = d(e) ? [e] : e;
|
|
202
206
|
} else t(o);
|
|
203
207
|
if (await this.$nextTick(), this.$emit("root-node-loaded", o), (r = this.defaultExpandedKeys) != null && r.length) {
|
|
204
208
|
var i;
|
|
@@ -223,10 +227,10 @@ var H = {
|
|
|
223
227
|
this.newChild && this.newChild.id === -1 && (this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
|
|
224
228
|
},
|
|
225
229
|
cancelEdit() {
|
|
226
|
-
this.editData && (
|
|
230
|
+
this.editData && (f(this.editData.edit) ? this.editData.edit = !0 : this.editData.edit = !1);
|
|
227
231
|
},
|
|
228
232
|
async editNode(e, t) {
|
|
229
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label],
|
|
233
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label], f(t.edit), t.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await P.prompt(`请输入新的${this.label}名:`, {
|
|
230
234
|
...this.defaultOptions,
|
|
231
235
|
inputValue: t[this.treeProps.label],
|
|
232
236
|
beforeClose: async (e, t, n) => {
|
|
@@ -242,14 +246,14 @@ var H = {
|
|
|
242
246
|
}).catch((e) => e);
|
|
243
247
|
},
|
|
244
248
|
async appendRootNode() {
|
|
245
|
-
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
|
|
249
|
+
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 P.prompt(`请输入${this.label}名:`, {
|
|
246
250
|
...this.defaultOptions,
|
|
247
|
-
beforeClose: async (
|
|
248
|
-
if (
|
|
251
|
+
beforeClose: async (t, n, r) => {
|
|
252
|
+
if (t === "confirm") {
|
|
249
253
|
try {
|
|
250
254
|
this.createNewChild(-1), n.confirmButtonLoading = !0, n.confirmButtonText = "处理中...";
|
|
251
|
-
let
|
|
252
|
-
this.newChild[this.treeProps.label] = n.inputValue, this.newChild.edit = !1,
|
|
255
|
+
let t = await this.saveApi(this.newNodeBuilder(n.inputValue, { id: -1 }));
|
|
256
|
+
this.newChild[this.treeProps.label] = n.inputValue, this.newChild.edit = !1, e(this.newChild, t.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.locateView(), r();
|
|
253
257
|
} catch {
|
|
254
258
|
n.confirmButtonText = "确定";
|
|
255
259
|
}
|
|
@@ -258,18 +262,18 @@ var H = {
|
|
|
258
262
|
}
|
|
259
263
|
}).catch((e) => e);
|
|
260
264
|
},
|
|
261
|
-
appendChildNode(
|
|
265
|
+
appendChildNode(t) {
|
|
262
266
|
this.text = "";
|
|
263
|
-
let n =
|
|
264
|
-
|
|
265
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(
|
|
267
|
+
let n = t.expanded;
|
|
268
|
+
t.expand(async () => {
|
|
269
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(t.data.id), this.$refs.tree.append(this.newChild, t), await this.scrollIntoView(n)) : await P.prompt(`请输入${this.label}名:`, {
|
|
266
270
|
...this.defaultOptions,
|
|
267
271
|
beforeClose: async (n, r, i) => {
|
|
268
272
|
if (n === "confirm") {
|
|
269
273
|
try {
|
|
270
|
-
this.createNewChild(
|
|
271
|
-
let n = await this.saveApi(this.newNodeBuilder(r.inputValue,
|
|
272
|
-
this.newChild[this.treeProps.label] = r.inputValue, this.newChild.edit = !1,
|
|
274
|
+
this.createNewChild(t.data.id), r.confirmButtonLoading = !0, r.confirmButtonText = "处理中...";
|
|
275
|
+
let n = await this.saveApi(this.newNodeBuilder(r.inputValue, t.data));
|
|
276
|
+
this.newChild[this.treeProps.label] = r.inputValue, this.newChild.edit = !1, e(this.newChild, n.data), this.$refs.tree.append(this.newChild, t), await this.locateView(), i();
|
|
273
277
|
} catch {
|
|
274
278
|
r.confirmButtonText = "确定";
|
|
275
279
|
}
|
|
@@ -311,7 +315,7 @@ var H = {
|
|
|
311
315
|
},
|
|
312
316
|
updateNode(e) {
|
|
313
317
|
let t = this.$refs.tree.getNode(e);
|
|
314
|
-
t &&
|
|
318
|
+
t && m(t.data, e, !0);
|
|
315
319
|
},
|
|
316
320
|
setCurrentKey(e) {
|
|
317
321
|
var t;
|
|
@@ -357,24 +361,24 @@ var H = {
|
|
|
357
361
|
} else this.$refs.tree.remove(e);
|
|
358
362
|
} catch {}
|
|
359
363
|
},
|
|
360
|
-
async onConfirm(
|
|
361
|
-
if (n[this.treeProps.label] === this.text || !
|
|
364
|
+
async onConfirm(t, n) {
|
|
365
|
+
if (n[this.treeProps.label] === this.text || !u(this.text)) {
|
|
362
366
|
this.clear();
|
|
363
367
|
return;
|
|
364
368
|
}
|
|
365
|
-
|
|
369
|
+
f(n.loading), n.loading = !0;
|
|
366
370
|
try {
|
|
367
371
|
if (this.loading = !0, n.id === -1) {
|
|
368
|
-
let r = await this.saveApi(this.newNodeBuilder(this.text,
|
|
369
|
-
|
|
372
|
+
let r = await this.saveApi(this.newNodeBuilder(this.text, t.parent.data || { id: -1 })), i = o(n);
|
|
373
|
+
e(n, {
|
|
370
374
|
...r.data,
|
|
371
375
|
isTempNode: !1
|
|
372
|
-
}), this.$emit("node-added", n, i,
|
|
376
|
+
}), this.$emit("node-added", n, i, t), this.registerNode(t);
|
|
373
377
|
} else await this.updateApi({
|
|
374
378
|
...n,
|
|
375
379
|
[this.treeProps.label]: this.text
|
|
376
380
|
});
|
|
377
|
-
n[this.treeProps.label] = this.text, n.edit = !1, this.$emit("node-updated", n,
|
|
381
|
+
n[this.treeProps.label] = this.text, n.edit = !1, this.$emit("node-updated", n, t), this.text = "";
|
|
378
382
|
} catch {}
|
|
379
383
|
n.loading = !1, this.loading = !1;
|
|
380
384
|
},
|
|
@@ -382,7 +386,7 @@ var H = {
|
|
|
382
386
|
t.id === -1 ? this.$refs.tree.remove(e) : t.edit = !1, this.text = "";
|
|
383
387
|
},
|
|
384
388
|
nodeClick(e, t, n) {
|
|
385
|
-
this.hideContextMenu(), (
|
|
389
|
+
this.hideContextMenu(), (f(e.loading) || !e.loading) && (this.curNode = t, this.curData = e, this.$emit("on-node-click", e, t, n));
|
|
386
390
|
},
|
|
387
391
|
getCurrentNode() {
|
|
388
392
|
return this.$refs.tree.getCurrentNode();
|
|
@@ -394,7 +398,7 @@ var H = {
|
|
|
394
398
|
},
|
|
395
399
|
async scrollIntoView(e) {
|
|
396
400
|
var t;
|
|
397
|
-
await this.$nextTick(), e || await
|
|
401
|
+
await this.$nextTick(), e || await a(300), (t = this.$refs) == null || (t = t.labelTxt) == null || t.focus();
|
|
398
402
|
},
|
|
399
403
|
inputKeyup(e, t, n) {
|
|
400
404
|
e.keyCode === 13 && this.onConfirm(t, n), e.keyCode === 27 && this.clear();
|
|
@@ -421,7 +425,7 @@ var H = {
|
|
|
421
425
|
return this.$refs.tree.root;
|
|
422
426
|
},
|
|
423
427
|
findTreeNode(e) {
|
|
424
|
-
return
|
|
428
|
+
return s(this.$refs.tree.root.childNodes, (t) => t.data === e || t.data.id === e, "childNodes");
|
|
425
429
|
},
|
|
426
430
|
registerNode(e) {
|
|
427
431
|
e.store.registerNode(e), delete e.store.nodesMap[-1];
|
|
@@ -430,32 +434,32 @@ var H = {
|
|
|
430
434
|
this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
|
|
431
435
|
}
|
|
432
436
|
}
|
|
433
|
-
},
|
|
437
|
+
}, G = { class: "editable-tree" }, K = {
|
|
434
438
|
ref: "treeWrapper",
|
|
435
439
|
class: "et-tree-wrapper"
|
|
436
|
-
},
|
|
440
|
+
}, q = {
|
|
437
441
|
key: 0,
|
|
438
442
|
style: { "padding-left": "24px" }
|
|
439
|
-
},
|
|
443
|
+
}, J = ["data-id"], Y = {
|
|
440
444
|
class: "node-label flex-row flex-item ellipsis-1",
|
|
441
445
|
style: { overflow: "hidden" }
|
|
442
|
-
},
|
|
446
|
+
}, X = {
|
|
443
447
|
class: "flex-item-relative",
|
|
444
448
|
style: { height: "21px" }
|
|
445
|
-
},
|
|
449
|
+
}, Z = ["title"], Q = {
|
|
446
450
|
key: 0,
|
|
447
451
|
class: "handle-actions"
|
|
448
|
-
},
|
|
452
|
+
}, $ = {
|
|
449
453
|
key: 1,
|
|
450
454
|
class: "handle-actions",
|
|
451
455
|
style: { display: "inline-block" }
|
|
452
|
-
},
|
|
453
|
-
function
|
|
454
|
-
let s =
|
|
455
|
-
return
|
|
456
|
+
}, ee = ["data-id"], te = { class: "menu-list" };
|
|
457
|
+
function ne(e, t, r, i, a, o) {
|
|
458
|
+
let s = n, c = L, l = I, u = R;
|
|
459
|
+
return E(), y("div", G, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? (E(), _(s, {
|
|
456
460
|
key: 0,
|
|
457
461
|
type: "primary",
|
|
458
|
-
style:
|
|
462
|
+
style: T([{
|
|
459
463
|
position: "absolute",
|
|
460
464
|
top: "4px",
|
|
461
465
|
"z-index": "1"
|
|
@@ -463,17 +467,17 @@ function re(e, t, n, i, a, o) {
|
|
|
463
467
|
icon: "el-icon-plus",
|
|
464
468
|
circle: "",
|
|
465
469
|
plain: "",
|
|
466
|
-
onClick: t[0] || (t[0] =
|
|
467
|
-
}, null, 8, ["style"])) :
|
|
468
|
-
!e.readonly && e.addRootNodeButtonStyle === "top" ? (
|
|
470
|
+
onClick: t[0] || (t[0] = N((t) => e.$emit("add-root-node"), ["stop"]))
|
|
471
|
+
}, null, 8, ["style"])) : v("v-if", !0), b("div", K, [
|
|
472
|
+
!e.readonly && e.addRootNodeButtonStyle === "top" ? (E(), y("div", q, [S(s, {
|
|
469
473
|
disabled: a.loading,
|
|
470
474
|
type: "text",
|
|
471
475
|
onClick: o.appendRootNode
|
|
472
476
|
}, {
|
|
473
|
-
default:
|
|
477
|
+
default: j(() => [t[8] || (t[8] = b("i", { class: "el-icon-lx-add" }, null, -1)), x(" " + O(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`), 1)]),
|
|
474
478
|
_: 1
|
|
475
|
-
}, 8, ["disabled", "onClick"])])) :
|
|
476
|
-
(
|
|
479
|
+
}, 8, ["disabled", "onClick"])])) : v("v-if", !0),
|
|
480
|
+
(E(), _(u, C(i.autoBindProps, {
|
|
477
481
|
key: a.treeKey,
|
|
478
482
|
ref: "tree",
|
|
479
483
|
"default-expand-all": e.defaultExpandAll,
|
|
@@ -486,25 +490,25 @@ function re(e, t, n, i, a, o) {
|
|
|
486
490
|
props: e.treeProps,
|
|
487
491
|
lazy: e.lazy,
|
|
488
492
|
"node-key": e.nodeKey
|
|
489
|
-
},
|
|
493
|
+
}, k(i.listeners), {
|
|
490
494
|
onNodeClick: o.nodeClick,
|
|
491
495
|
onNodeContextmenu: o.showContextMenu,
|
|
492
496
|
onNodeExpand: o.addExpandKey,
|
|
493
497
|
onNodeCollapse: o.removeExpandKey
|
|
494
498
|
}), {
|
|
495
|
-
default:
|
|
499
|
+
default: j(({ node: n, data: r }) => [D(e.$slots, "default", {
|
|
496
500
|
node: n,
|
|
497
501
|
data: r
|
|
498
|
-
}, () => [
|
|
502
|
+
}, () => [v("非编辑模式"), r.edit ? (E(), y(g, { key: 1 }, [v("编辑模式"), b("span", {
|
|
499
503
|
"data-id": r.id,
|
|
500
504
|
class: "custom-tree-node flex-row flex-item",
|
|
501
505
|
style: { overflow: "hidden" }
|
|
502
506
|
}, [
|
|
503
|
-
e.icon ? (
|
|
507
|
+
e.icon ? (E(), y("i", {
|
|
504
508
|
key: 0,
|
|
505
|
-
class:
|
|
506
|
-
}, null, 2)) :
|
|
507
|
-
|
|
509
|
+
class: w([r.loading ? "el-icon-loading" : "el-icon-edit-outline", "node-icon flex-not-shrink"])
|
|
510
|
+
}, null, 2)) : v("v-if", !0),
|
|
511
|
+
S(l, {
|
|
508
512
|
ref: "labelTxt",
|
|
509
513
|
modelValue: a.text,
|
|
510
514
|
"onUpdate:modelValue": t[2] || (t[2] = (e) => a.text = e),
|
|
@@ -512,91 +516,91 @@ function re(e, t, n, i, a, o) {
|
|
|
512
516
|
placeholder: o.defaultOptions.inputPlaceholder,
|
|
513
517
|
onKeyup: (e) => o.inputKeyup(e, n, r),
|
|
514
518
|
onBlur: (e) => o.inputBlur(e, n, r),
|
|
515
|
-
onClick: t[3] || (t[3] =
|
|
519
|
+
onClick: t[3] || (t[3] = N(() => {}, ["stop"]))
|
|
516
520
|
}, null, 8, [
|
|
517
521
|
"modelValue",
|
|
518
522
|
"placeholder",
|
|
519
523
|
"onKeyup",
|
|
520
524
|
"onBlur"
|
|
521
525
|
]),
|
|
522
|
-
e.confirmButton ? (
|
|
526
|
+
e.confirmButton ? (E(), y(g, { key: 1 }, [M(S(s, {
|
|
523
527
|
class: "flex-not-shrink",
|
|
524
528
|
type: "text",
|
|
525
|
-
onClick:
|
|
529
|
+
onClick: N((e) => o.onConfirm(n, r), ["stop"])
|
|
526
530
|
}, {
|
|
527
|
-
default:
|
|
531
|
+
default: j(() => [...t[13] || (t[13] = [x(" 确定 ", -1)])]),
|
|
528
532
|
_: 1
|
|
529
|
-
}, 8, ["onClick"]), [[
|
|
533
|
+
}, 8, ["onClick"]), [[A, !r.loading]]), M(S(s, {
|
|
530
534
|
class: "flex-not-shrink",
|
|
531
535
|
type: "text",
|
|
532
|
-
onClick:
|
|
536
|
+
onClick: N((e) => o.onCancel(n, r), ["stop"])
|
|
533
537
|
}, {
|
|
534
|
-
default:
|
|
538
|
+
default: j(() => [...t[14] || (t[14] = [x(" 取消 ", -1)])]),
|
|
535
539
|
_: 1
|
|
536
|
-
}, 8, ["onClick"]), [[
|
|
537
|
-
], 8,
|
|
540
|
+
}, 8, ["onClick"]), [[A, !r.loading]])], 64)) : v("v-if", !0)
|
|
541
|
+
], 8, ee)], 64)) : (E(), y("span", {
|
|
538
542
|
key: 0,
|
|
539
543
|
"data-id": r.id,
|
|
540
544
|
class: "custom-tree-node"
|
|
541
545
|
}, [
|
|
542
|
-
|
|
543
|
-
e.icon ? (
|
|
546
|
+
b("span", Y, [
|
|
547
|
+
e.icon ? (E(), y("i", {
|
|
544
548
|
key: 0,
|
|
545
|
-
class:
|
|
546
|
-
}, null, 2)) :
|
|
547
|
-
|
|
549
|
+
class: w([r.loading ? "el-icon-loading" : e.icon(r, n), "node-icon"])
|
|
550
|
+
}, null, 2)) : v("v-if", !0),
|
|
551
|
+
b("span", X, [b("span", {
|
|
548
552
|
class: "ellipsis-1 absolute-box et-tree-label",
|
|
549
553
|
title: n.label
|
|
550
|
-
}, [
|
|
554
|
+
}, [D(e.$slots, "label", {
|
|
551
555
|
data: r,
|
|
552
556
|
node: n
|
|
553
|
-
}, () => [
|
|
554
|
-
|
|
557
|
+
}, () => [x(O(n.label), 1)])], 8, Z)]),
|
|
558
|
+
D(e.$slots, "label-suffix", {
|
|
555
559
|
node: n,
|
|
556
560
|
data: r
|
|
557
561
|
})
|
|
558
562
|
]),
|
|
559
|
-
!e.contextMenu && !e.readonly ?
|
|
560
|
-
|
|
563
|
+
!e.contextMenu && !e.readonly ? M((E(), y("span", Q, [
|
|
564
|
+
S(s, {
|
|
561
565
|
type: "text",
|
|
562
|
-
onClick:
|
|
566
|
+
onClick: N((e) => o.appendChildNode(n, r), ["stop"])
|
|
563
567
|
}, {
|
|
564
|
-
default:
|
|
568
|
+
default: j(() => [...t[9] || (t[9] = [x("添加", -1)])]),
|
|
565
569
|
_: 1
|
|
566
570
|
}, 8, ["onClick"]),
|
|
567
|
-
|
|
571
|
+
S(s, {
|
|
568
572
|
type: "text",
|
|
569
|
-
onClick:
|
|
573
|
+
onClick: N((e) => o.editNode(n, r), ["stop"])
|
|
570
574
|
}, {
|
|
571
|
-
default:
|
|
575
|
+
default: j(() => [...t[10] || (t[10] = [x("修改", -1)])]),
|
|
572
576
|
_: 1
|
|
573
577
|
}, 8, ["onClick"]),
|
|
574
|
-
|
|
578
|
+
S(c, {
|
|
575
579
|
class: "pop-confirm",
|
|
576
580
|
"icon-color": "red",
|
|
577
581
|
title: "你确定要删除吗?",
|
|
578
582
|
onConfirm: (e) => o.removeNode(n, r)
|
|
579
583
|
}, {
|
|
580
|
-
reference:
|
|
584
|
+
reference: j(() => [M(S(s, {
|
|
581
585
|
style: { "margin-left": "4px" },
|
|
582
586
|
type: "text",
|
|
583
|
-
onClick: t[1] || (t[1] =
|
|
587
|
+
onClick: t[1] || (t[1] = N(() => {}, ["stop"]))
|
|
584
588
|
}, {
|
|
585
|
-
default:
|
|
589
|
+
default: j(() => [...t[11] || (t[11] = [x(" 删除 ", -1)])]),
|
|
586
590
|
_: 1
|
|
587
|
-
}, 512), [[
|
|
591
|
+
}, 512), [[A, n.isLeaf]])]),
|
|
588
592
|
_: 2
|
|
589
593
|
}, 1032, ["onConfirm"])
|
|
590
|
-
], 512)), [[
|
|
591
|
-
e.contextMenuIcon && e.contextMenu && !e.readonly ?
|
|
594
|
+
], 512)), [[A, !r.loading && !a.loading]]) : v("v-if", !0),
|
|
595
|
+
e.contextMenuIcon && e.contextMenu && !e.readonly ? M((E(), y("span", $, [S(s, {
|
|
592
596
|
style: { padding: "6px 10px 0" },
|
|
593
597
|
type: "text",
|
|
594
|
-
onClick:
|
|
598
|
+
onClick: N((e) => o.showContextMenu(e, r, n), ["stop"])
|
|
595
599
|
}, {
|
|
596
|
-
default:
|
|
600
|
+
default: j(() => [...t[12] || (t[12] = [x(" . . . ", -1)])]),
|
|
597
601
|
_: 1
|
|
598
|
-
}, 8, ["onClick"])], 512)), [[
|
|
599
|
-
], 8,
|
|
602
|
+
}, 8, ["onClick"])], 512)), [[A, !r.loading && !a.loading]]) : v("v-if", !0)
|
|
603
|
+
], 8, J))])]),
|
|
600
604
|
_: 3
|
|
601
605
|
}, 16, [
|
|
602
606
|
"default-expand-all",
|
|
@@ -611,46 +615,46 @@ function re(e, t, n, i, a, o) {
|
|
|
611
615
|
"onNodeExpand",
|
|
612
616
|
"onNodeCollapse"
|
|
613
617
|
])),
|
|
614
|
-
e.contextMenu && !e.readonly ?
|
|
618
|
+
e.contextMenu && !e.readonly ? M((E(), y("div", {
|
|
615
619
|
key: 1,
|
|
616
620
|
ref: "contextMenu",
|
|
617
|
-
style:
|
|
621
|
+
style: T(a.position),
|
|
618
622
|
class: "menu"
|
|
619
|
-
}, [
|
|
623
|
+
}, [b("ul", te, [D(e.$slots, "context-menu", {
|
|
620
624
|
curNode: a.curNode,
|
|
621
625
|
curData: a.curData
|
|
622
626
|
}, () => [
|
|
623
|
-
|
|
627
|
+
M(b("li", {
|
|
624
628
|
class: "menu-item",
|
|
625
629
|
onClick: t[4] || (t[4] = (e) => o.appendPeerNode(a.curNode, a.curData))
|
|
626
|
-
}, [t[15] || (t[15] =
|
|
630
|
+
}, [t[15] || (t[15] = b("i", {
|
|
627
631
|
class: "menu-item-icon el-icon-lx-add",
|
|
628
632
|
style: { color: "#228b22" }
|
|
629
|
-
}, null, -1)),
|
|
630
|
-
|
|
633
|
+
}, null, -1)), x(" " + O(e.menuLabel.appendPeer), 1)], 512), [[A, a.curData.id > -1]]),
|
|
634
|
+
b("li", {
|
|
631
635
|
class: "menu-item",
|
|
632
636
|
onClick: t[5] || (t[5] = (e) => o.appendChildNode(a.curNode, a.curData))
|
|
633
|
-
}, [t[16] || (t[16] =
|
|
637
|
+
}, [t[16] || (t[16] = b("i", {
|
|
634
638
|
class: "menu-item-icon el-icon-lx-add",
|
|
635
639
|
style: { color: "#228b22" }
|
|
636
|
-
}, null, -1)),
|
|
637
|
-
|
|
640
|
+
}, null, -1)), x(" " + O(e.menuLabel.appendChild), 1)]),
|
|
641
|
+
M(b("li", {
|
|
638
642
|
class: "menu-item",
|
|
639
643
|
onClick: t[6] || (t[6] = (e) => o.editNode(a.curNode, a.curData))
|
|
640
|
-
}, [t[17] || (t[17] =
|
|
644
|
+
}, [t[17] || (t[17] = b("i", {
|
|
641
645
|
class: "menu-item-icon el-icon-edit-outline",
|
|
642
646
|
style: { color: "#ffa500" }
|
|
643
|
-
}, null, -1)),
|
|
644
|
-
|
|
647
|
+
}, null, -1)), x(" " + O(e.menuLabel.editNode), 1)], 512), [[A, a.curData.id > -1]]),
|
|
648
|
+
M(b("li", {
|
|
645
649
|
class: "menu-item",
|
|
646
650
|
onClick: t[7] || (t[7] = (e) => o.removeNodeModal(a.curNode, a.curData))
|
|
647
|
-
}, [t[18] || (t[18] =
|
|
651
|
+
}, [t[18] || (t[18] = b("i", {
|
|
648
652
|
class: "menu-item-icon el-icon-delete",
|
|
649
653
|
style: { color: "#f00" }
|
|
650
|
-
}, null, -1)),
|
|
651
|
-
])])], 4)), [[
|
|
654
|
+
}, null, -1)), x(" " + O(e.menuLabel.removeNode), 1)], 512), [[A, a.curNode.isLeaf]])
|
|
655
|
+
])])], 4)), [[A, a.showMenu]]) : v("v-if", !0)
|
|
652
656
|
], 512)]);
|
|
653
657
|
}
|
|
654
|
-
var
|
|
658
|
+
var re = /* @__PURE__ */ r(W, [["render", ne]]);
|
|
655
659
|
//#endregion
|
|
656
|
-
export {
|
|
660
|
+
export { re as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n } from "./
|
|
1
|
+
import { i as e, n as t } from "./CE8bze--.mjs";
|
|
2
|
+
import { n } from "./CRrdgtwT.mjs";
|
|
3
3
|
import { createVNode as r, mergeProps as i, useModel as a } from "vue";
|
|
4
4
|
import { ElSwitch as o } from "element-plus/es";
|
|
5
5
|
//#region src/components/form/props/switch.ts
|
|
@@ -75,25 +75,22 @@ var s = {
|
|
|
75
75
|
type: String,
|
|
76
76
|
default: ""
|
|
77
77
|
}
|
|
78
|
-
}, c = { modelValue: !0 }, l =
|
|
78
|
+
}, c = { modelValue: !0 }, l = (e) => n[e] === void 0 && c[e] !== !0, u = {
|
|
79
79
|
name: "FormSwitch",
|
|
80
80
|
inheritAttrs: !1,
|
|
81
81
|
props: { ...s },
|
|
82
|
-
emits: {
|
|
83
|
-
...t,
|
|
84
|
-
change: null
|
|
85
|
-
},
|
|
82
|
+
emits: { ...t },
|
|
86
83
|
setup(t, { emit: n, slots: s, attrs: c }) {
|
|
87
|
-
let
|
|
84
|
+
let u = a(t, "modelValue"), { render: d, disabled: f, listeners: p, inputProps: m } = e(t, {
|
|
88
85
|
emit: n,
|
|
86
|
+
attrs: c,
|
|
89
87
|
slots: s,
|
|
90
|
-
|
|
91
|
-
predicate: u
|
|
88
|
+
predicate: l
|
|
92
89
|
});
|
|
93
|
-
return () =>
|
|
94
|
-
modelValue:
|
|
95
|
-
"onUpdate:modelValue": (e) =>
|
|
96
|
-
disabled:
|
|
90
|
+
return () => d({ vNodes: r(o, i(p.value, m.value, {
|
|
91
|
+
modelValue: u.value,
|
|
92
|
+
"onUpdate:modelValue": (e) => u.value = e,
|
|
93
|
+
disabled: f.value
|
|
97
94
|
}), {
|
|
98
95
|
"active-action": s["active-action"],
|
|
99
96
|
"inactive-action": s["inactive-action"],
|
|
@@ -103,4 +100,4 @@ var s = {
|
|
|
103
100
|
}
|
|
104
101
|
};
|
|
105
102
|
//#endregion
|
|
106
|
-
export {
|
|
103
|
+
export { u as t };
|