dynamicformdjx 0.6.1 → 0.6.2
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/dist/elementPlus/EleZealTableTool.d.ts +11 -2
- package/dist/elementPlus/index.cjs +1 -1
- package/dist/elementPlus/index.mjs +313 -301
- package/dist/{index-BQKYL550.js → index-Bsj3F9SM.js} +9 -9
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.mjs +347 -320
- package/dist/naiveUi/index.cjs +1 -1
- package/dist/naiveUi/index.mjs +306 -300
- package/dist/origin/LoadedScroll.d.ts +9 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { t as
|
|
3
|
-
import { D as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as I, watch as j, toRaw as L, createVNode as n, createTextVNode as k, Fragment as B, nextTick as F, computed as O, onMounted as M, onBeforeUnmount as V, reactive as P } from "vue";
|
|
2
|
+
import { t as D, r as R, f as $, p as z, s as Y, g as E, a as q } from "./index-Bsj3F9SM.js";
|
|
3
|
+
import { D as ae, O as re, h as ue, e as oe, j as ie, i as se, k as ce, b as de, d as fe, u as ve, c as me } from "./index-Bsj3F9SM.js";
|
|
4
|
+
const _ = /* @__PURE__ */ H({
|
|
5
5
|
name: "DynamicInput",
|
|
6
6
|
props: {
|
|
7
7
|
size: {
|
|
@@ -39,15 +39,15 @@ const K = /* @__PURE__ */ R({
|
|
|
39
39
|
slots: Object,
|
|
40
40
|
setup(e, {
|
|
41
41
|
emit: o,
|
|
42
|
-
expose:
|
|
43
|
-
slots:
|
|
42
|
+
expose: h,
|
|
43
|
+
slots: u
|
|
44
44
|
}) {
|
|
45
|
-
const
|
|
45
|
+
const d = {
|
|
46
46
|
resetTxt: "重置",
|
|
47
47
|
newTxt: "添加项",
|
|
48
48
|
mergeTxt: "合并",
|
|
49
49
|
...e.btnConfigs
|
|
50
|
-
},
|
|
50
|
+
}, i = {
|
|
51
51
|
hideReset: !1,
|
|
52
52
|
maxHeight: "300px",
|
|
53
53
|
autoScroll: !0,
|
|
@@ -58,122 +58,122 @@ const K = /* @__PURE__ */ R({
|
|
|
58
58
|
}, m = {
|
|
59
59
|
arraySplitSymbol: ",",
|
|
60
60
|
...e.dyListConfigs
|
|
61
|
-
},
|
|
62
|
-
j(
|
|
61
|
+
}, g = e.size, r = I(D(e.modelValue, e.randomFun, m.arraySplitSymbol)), b = I(null);
|
|
62
|
+
j(r, (l) => {
|
|
63
63
|
if (!e.isController) return;
|
|
64
|
-
const
|
|
65
|
-
o("update:modelValue",
|
|
64
|
+
const x = R(l, m.arraySplitSymbol);
|
|
65
|
+
o("update:modelValue", x), o("onMerge", x, L(r.value));
|
|
66
66
|
}, {
|
|
67
67
|
deep: !0
|
|
68
|
-
}),
|
|
69
|
-
onSet: (
|
|
70
|
-
|
|
68
|
+
}), h({
|
|
69
|
+
onSet: (l) => {
|
|
70
|
+
r.value = D(l ?? e.modelValue, e.randomFun, m.arraySplitSymbol);
|
|
71
71
|
},
|
|
72
|
-
getResult: (
|
|
72
|
+
getResult: (l = "res") => l === "ori" ? L(r.value) : R(r.value, m.arraySplitSymbol)
|
|
73
73
|
});
|
|
74
|
-
const f = () =>
|
|
74
|
+
const f = () => r.value.push({
|
|
75
75
|
rId: e.randomFun(),
|
|
76
76
|
key: "",
|
|
77
77
|
value: ""
|
|
78
78
|
}), T = () => {
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
o("update:modelValue",
|
|
79
|
+
r.value = D(e.modelValue, e.randomFun, m.arraySplitSymbol), o("onReset");
|
|
80
|
+
}, y = () => {
|
|
81
|
+
r.value.sort((x, c) => +x.rId - +c.rId);
|
|
82
|
+
const l = R(r.value, m.arraySplitSymbol);
|
|
83
|
+
o("update:modelValue", l), o("onMerge", l, L(r.value)), r.value = D(l, e.randomFun, m.arraySplitSymbol);
|
|
84
84
|
};
|
|
85
|
-
return () =>
|
|
86
|
-
class: `dynamicForm ${
|
|
87
|
-
}, [
|
|
88
|
-
class: `dyFormList ${
|
|
89
|
-
ref:
|
|
85
|
+
return () => n("div", {
|
|
86
|
+
class: `dynamicForm ${g} ${e.dyCls}`
|
|
87
|
+
}, [n("div", {
|
|
88
|
+
class: `dyFormList ${r.value.length ? "" : "noList"}`,
|
|
89
|
+
ref: b,
|
|
90
90
|
style: {
|
|
91
|
-
maxHeight:
|
|
91
|
+
maxHeight: i.maxHeight
|
|
92
92
|
}
|
|
93
|
-
}, [
|
|
94
|
-
const
|
|
95
|
-
row:
|
|
96
|
-
index:
|
|
97
|
-
isLast:
|
|
93
|
+
}, [r.value.map((l, x, c) => {
|
|
94
|
+
const s = {
|
|
95
|
+
row: l,
|
|
96
|
+
index: x,
|
|
97
|
+
isLast: x === c.length - 1,
|
|
98
98
|
addItem: () => {
|
|
99
|
-
|
|
99
|
+
r.value.push({
|
|
100
100
|
rId: e.randomFun(),
|
|
101
101
|
key: "",
|
|
102
102
|
value: ""
|
|
103
|
-
}),
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
top:
|
|
103
|
+
}), i.autoScroll && F(() => {
|
|
104
|
+
const v = b.value;
|
|
105
|
+
v?.scrollTo({
|
|
106
|
+
top: v.scrollHeight,
|
|
107
107
|
behavior: "smooth"
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
removeItem: () => {
|
|
112
|
-
|
|
112
|
+
r.value = r.value.filter((v) => v.rId !== l.rId);
|
|
113
113
|
},
|
|
114
|
-
toggleArray: () =>
|
|
115
|
-
toggleNumber: () =>
|
|
114
|
+
toggleArray: () => l.isArray = !l.isArray,
|
|
115
|
+
toggleNumber: () => l.isNumber = !l.isNumber
|
|
116
116
|
};
|
|
117
|
-
return
|
|
117
|
+
return n("div", {
|
|
118
118
|
class: "dItem",
|
|
119
|
-
key:
|
|
120
|
-
}, [
|
|
119
|
+
key: l.rId
|
|
120
|
+
}, [n("div", {
|
|
121
121
|
class: "input"
|
|
122
|
-
}, [
|
|
123
|
-
size:
|
|
124
|
-
value:
|
|
122
|
+
}, [n("input", {
|
|
123
|
+
size: g,
|
|
124
|
+
value: l.key,
|
|
125
125
|
class: "key nativeInput",
|
|
126
|
-
onInput: (
|
|
127
|
-
|
|
126
|
+
onInput: (v) => {
|
|
127
|
+
l.key = v.target.value;
|
|
128
128
|
}
|
|
129
|
-
}, null),
|
|
129
|
+
}, null), k(":"), n("div", {
|
|
130
130
|
class: "vInput"
|
|
131
|
-
}, [
|
|
131
|
+
}, [n("div", {
|
|
132
132
|
class: "slot"
|
|
133
|
-
}, [
|
|
134
|
-
class: [
|
|
135
|
-
onClick:
|
|
136
|
-
}, [
|
|
137
|
-
class: [
|
|
138
|
-
onClick:
|
|
139
|
-
}, [
|
|
140
|
-
size:
|
|
141
|
-
value:
|
|
133
|
+
}, [u.typeTools ? u.typeTools(s) : n(B, null, [!i.hideArrayBtn && n("button", {
|
|
134
|
+
class: [l.isArray ? "success" : "default", "small", "bt"],
|
|
135
|
+
onClick: s.toggleArray
|
|
136
|
+
}, [k("Array")]), !i.hideNumberBtn && n("button", {
|
|
137
|
+
class: [l.isNumber ? "success" : "default", "small", "bt"],
|
|
138
|
+
onClick: s.toggleNumber
|
|
139
|
+
}, [k("Number")])])]), n("input", {
|
|
140
|
+
size: g,
|
|
141
|
+
value: l.value,
|
|
142
142
|
class: "value nativeV",
|
|
143
|
-
onInput: (
|
|
144
|
-
const
|
|
145
|
-
|
|
143
|
+
onInput: (v) => {
|
|
144
|
+
const t = v.target.value;
|
|
145
|
+
i.allowFilter && l.isNumber ? l.value = $(t, l.isArray, m.arraySplitSymbol) : l.value = t;
|
|
146
146
|
}
|
|
147
|
-
}, null)])]),
|
|
147
|
+
}, null)])]), n("div", {
|
|
148
148
|
class: "btn"
|
|
149
|
-
}, [
|
|
150
|
-
class: [
|
|
151
|
-
disabled: !
|
|
152
|
-
onClick:
|
|
153
|
-
}, [
|
|
154
|
-
class: ["danger",
|
|
155
|
-
onClick:
|
|
156
|
-
}, [
|
|
157
|
-
})]),
|
|
158
|
-
class: `control ${
|
|
159
|
-
}, [!
|
|
149
|
+
}, [u.rowActions ? u.rowActions(s) : n(B, null, [n("button", {
|
|
150
|
+
class: [g, "success", "bt"],
|
|
151
|
+
disabled: !s.isLast,
|
|
152
|
+
onClick: s.addItem
|
|
153
|
+
}, [k("+")]), n("button", {
|
|
154
|
+
class: ["danger", g, "bt"],
|
|
155
|
+
onClick: s.removeItem
|
|
156
|
+
}, [k("-")])])])]);
|
|
157
|
+
})]), n("div", {
|
|
158
|
+
class: `control ${r.value.length ? "" : "noList"}`
|
|
159
|
+
}, [!r.value.length && (u.newBtn ? u.newBtn({
|
|
160
160
|
newItem: f
|
|
161
|
-
}) :
|
|
162
|
-
class: ["success",
|
|
161
|
+
}) : n("button", {
|
|
162
|
+
class: ["success", g, "bt"],
|
|
163
163
|
onClick: f
|
|
164
|
-
}, [
|
|
164
|
+
}, [d.newTxt])), !e.isController && n(B, null, [!i.hideReset && (u.resetBtn ? u.resetBtn({
|
|
165
165
|
reset: T
|
|
166
|
-
}) :
|
|
167
|
-
class: ["default",
|
|
166
|
+
}) : n("button", {
|
|
167
|
+
class: ["default", g, "bt"],
|
|
168
168
|
onClick: T
|
|
169
|
-
}, [
|
|
170
|
-
merge:
|
|
171
|
-
}) :
|
|
172
|
-
class: ["info",
|
|
173
|
-
onClick:
|
|
174
|
-
}, [
|
|
169
|
+
}, [d.resetTxt])), u.mergeBtn ? u.mergeBtn({
|
|
170
|
+
merge: y
|
|
171
|
+
}) : n("button", {
|
|
172
|
+
class: ["info", g, "bt"],
|
|
173
|
+
onClick: y
|
|
174
|
+
}, [d.mergeTxt])])])]);
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
176
|
+
}), K = /* @__PURE__ */ H({
|
|
177
177
|
name: "DynamicCascadeInput",
|
|
178
178
|
props: {
|
|
179
179
|
modelValue: {
|
|
@@ -217,15 +217,15 @@ const K = /* @__PURE__ */ R({
|
|
|
217
217
|
slots: Object,
|
|
218
218
|
setup(e, {
|
|
219
219
|
emit: o,
|
|
220
|
-
expose:
|
|
221
|
-
slots:
|
|
220
|
+
expose: h,
|
|
221
|
+
slots: u
|
|
222
222
|
}) {
|
|
223
|
-
const
|
|
223
|
+
const d = {
|
|
224
224
|
resetTxt: "重置",
|
|
225
225
|
newTxt: "添加项",
|
|
226
226
|
mergeTxt: "合并",
|
|
227
227
|
...e.btnConfigs
|
|
228
|
-
},
|
|
228
|
+
}, i = {
|
|
229
229
|
hideReset: !1,
|
|
230
230
|
maxHeight: "600px",
|
|
231
231
|
allowFilter: !0,
|
|
@@ -239,155 +239,155 @@ const K = /* @__PURE__ */ R({
|
|
|
239
239
|
}, m = {
|
|
240
240
|
arraySplitSymbol: ",",
|
|
241
241
|
...e.dyListConfigs
|
|
242
|
-
},
|
|
243
|
-
let
|
|
244
|
-
const C = Array.isArray(
|
|
245
|
-
return
|
|
246
|
-
rId: e.randomFun(
|
|
247
|
-
key:
|
|
248
|
-
value: Object.prototype.toString.call(
|
|
242
|
+
}, g = (c) => ["string", "number"].includes(c), r = (c) => Object.keys(c).map((s, v) => {
|
|
243
|
+
let t = c[s];
|
|
244
|
+
const C = Array.isArray(t), a = C ? t.every((p) => typeof p == "number") : typeof t == "number", S = t === null;
|
|
245
|
+
return g(typeof t) && (t = c[s]), S && (t = ""), {
|
|
246
|
+
rId: e.randomFun(v),
|
|
247
|
+
key: s,
|
|
248
|
+
value: Object.prototype.toString.call(t) === "[object Object]" ? r(c[s]) : C ? t.join(m.arraySplitSymbol) : t,
|
|
249
249
|
isArray: C || void 0,
|
|
250
|
-
isNumber:
|
|
250
|
+
isNumber: a || void 0
|
|
251
251
|
};
|
|
252
|
-
}),
|
|
253
|
-
const
|
|
254
|
-
return
|
|
255
|
-
}, {}), f = I(
|
|
256
|
-
class: [`depth-${
|
|
252
|
+
}), b = (c) => c.reduce((s, v) => {
|
|
253
|
+
const t = v.value;
|
|
254
|
+
return v.key.trim().length && (s[v.key] = Array.isArray(t) ? b(t) : z(v.value, v.isArray, v.isNumber, m.arraySplitSymbol)), s;
|
|
255
|
+
}, {}), f = I(r(e.modelValue)), T = (c, s = 1, v) => n("div", {
|
|
256
|
+
class: [`depth-${s}`, i.showBorder ? "" : "no-border", i.showPad ? "" : "no-pad"],
|
|
257
257
|
style: {
|
|
258
|
-
"--depth":
|
|
259
|
-
["--c" + [
|
|
258
|
+
"--depth": s,
|
|
259
|
+
["--c" + [s]]: Y(i.borderColors, s)
|
|
260
260
|
}
|
|
261
|
-
}, [
|
|
262
|
-
const
|
|
263
|
-
row:
|
|
261
|
+
}, [c.map((t, C, a) => {
|
|
262
|
+
const S = Array.isArray(t.value), p = g(typeof t.value), w = {
|
|
263
|
+
row: t,
|
|
264
264
|
index: C,
|
|
265
|
-
isLast: C ===
|
|
265
|
+
isLast: C === a.length - 1,
|
|
266
266
|
addItem: () => {
|
|
267
|
-
|
|
267
|
+
c.push({
|
|
268
268
|
rId: e.randomFun(),
|
|
269
269
|
key: "",
|
|
270
270
|
value: ""
|
|
271
271
|
});
|
|
272
272
|
},
|
|
273
273
|
addChild: () => {
|
|
274
|
-
|
|
274
|
+
p && (t.value = [], t.isArray = void 0), t.value.push({
|
|
275
275
|
rId: e.randomFun(),
|
|
276
276
|
key: "",
|
|
277
277
|
value: ""
|
|
278
278
|
});
|
|
279
279
|
},
|
|
280
280
|
removeItem: () => {
|
|
281
|
-
if (
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
...
|
|
281
|
+
if (c.splice(C, 1), c.length < 1) {
|
|
282
|
+
if (v === void 0) return b([]);
|
|
283
|
+
const A = f.value.findIndex((N) => N.rId === v?.rId);
|
|
284
|
+
s < 1 ? f.value.splice(A, 1, {
|
|
285
|
+
...v,
|
|
286
286
|
value: ""
|
|
287
|
-
}) :
|
|
287
|
+
}) : v.value = "";
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
|
-
toggleArray: () =>
|
|
291
|
-
toggleNumber: () =>
|
|
290
|
+
toggleArray: () => t.isArray = !t.isArray,
|
|
291
|
+
toggleNumber: () => t.isNumber = !t.isNumber
|
|
292
292
|
};
|
|
293
|
-
return
|
|
293
|
+
return n("div", {
|
|
294
294
|
class: "dItem",
|
|
295
|
-
key:
|
|
295
|
+
key: t.rId,
|
|
296
296
|
style: {
|
|
297
|
-
marginLeft:
|
|
297
|
+
marginLeft: s > 1 ? `${s * i.retractLen}px` : "0"
|
|
298
298
|
}
|
|
299
|
-
}, [
|
|
299
|
+
}, [n("div", {
|
|
300
300
|
class: "input"
|
|
301
|
-
}, [!
|
|
302
|
-
value:
|
|
301
|
+
}, [!S && n(B, null, [n("input", {
|
|
302
|
+
value: t.key,
|
|
303
303
|
class: "key nativeInput",
|
|
304
|
-
onInput: (
|
|
305
|
-
}, null),
|
|
304
|
+
onInput: (A) => t.key = A.target.value
|
|
305
|
+
}, null), k(":")]), n("div", {
|
|
306
306
|
class: "vInput"
|
|
307
|
-
}, [
|
|
307
|
+
}, [n("div", {
|
|
308
308
|
class: "slot"
|
|
309
|
-
}, [Array.isArray(
|
|
310
|
-
class: [
|
|
311
|
-
onClick:
|
|
312
|
-
}, [
|
|
313
|
-
class: [
|
|
314
|
-
onClick:
|
|
315
|
-
}, [
|
|
316
|
-
class: `value nativeV ${
|
|
317
|
-
value:
|
|
318
|
-
onInput: (
|
|
319
|
-
const N =
|
|
320
|
-
if (
|
|
321
|
-
|
|
309
|
+
}, [Array.isArray(t.value) ? void 0 : u.typeTools ? u.typeTools(w) : n(B, null, [!i.hideArrayBtn && n("button", {
|
|
310
|
+
class: [t.isArray ? "success" : "default", "small", "bt"],
|
|
311
|
+
onClick: w.toggleArray
|
|
312
|
+
}, [k("Array")]), !i.hideNumberBtn && n("button", {
|
|
313
|
+
class: [t.isNumber ? "success" : "default", "small", "bt"],
|
|
314
|
+
onClick: w.toggleNumber
|
|
315
|
+
}, [k("Number")])])]), n("input", {
|
|
316
|
+
class: `value nativeV ${S ? "isKey" : ""}`,
|
|
317
|
+
value: p ? t.value : t.key,
|
|
318
|
+
onInput: (A) => {
|
|
319
|
+
const N = A.target.value;
|
|
320
|
+
if (S) {
|
|
321
|
+
t.key = N;
|
|
322
322
|
return;
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
i.allowFilter && t.isNumber ? t.value = $(N, t.isArray, m.arraySplitSymbol) : t.value = N;
|
|
325
325
|
}
|
|
326
|
-
}, null),
|
|
326
|
+
}, null), n("div", {
|
|
327
327
|
class: "surSlot"
|
|
328
|
-
}, [
|
|
328
|
+
}, [s < e.depth ? !S && (u.newChild ? u.newChild(w) : n("button", {
|
|
329
329
|
class: ["success", "bt"],
|
|
330
|
-
onClick:
|
|
331
|
-
}, [e.newChildTxt(
|
|
330
|
+
onClick: w.addChild
|
|
331
|
+
}, [e.newChildTxt(t)])) : null])])]), n("div", {
|
|
332
332
|
class: "btn"
|
|
333
|
-
}, [
|
|
333
|
+
}, [u.rowActions ? u.rowActions(w) : n(B, null, [n("button", {
|
|
334
334
|
class: ["success", "bt"],
|
|
335
|
-
disabled: !
|
|
336
|
-
onClick:
|
|
337
|
-
}, [
|
|
335
|
+
disabled: !w.isLast,
|
|
336
|
+
onClick: w.addItem
|
|
337
|
+
}, [k("+")]), n("button", {
|
|
338
338
|
class: ["danger", "bt"],
|
|
339
|
-
onClick:
|
|
340
|
-
}, [
|
|
339
|
+
onClick: w.removeItem
|
|
340
|
+
}, [k("-")])])]), Array.isArray(t.value) && T(t.value, s + 1, t)]);
|
|
341
341
|
})]);
|
|
342
|
-
j(f, (
|
|
342
|
+
j(f, (c) => {
|
|
343
343
|
if (!e.isController) return;
|
|
344
|
-
const
|
|
345
|
-
o("update:modelValue",
|
|
344
|
+
const s = b(c);
|
|
345
|
+
o("update:modelValue", s), o("onMerge", s, L(f.value));
|
|
346
346
|
}, {
|
|
347
347
|
deep: !0
|
|
348
|
-
}),
|
|
349
|
-
onSet: (
|
|
350
|
-
f.value =
|
|
348
|
+
}), h({
|
|
349
|
+
onSet: (c) => {
|
|
350
|
+
f.value = r(c ?? e.modelValue);
|
|
351
351
|
},
|
|
352
|
-
getResult: (
|
|
352
|
+
getResult: (c = "res") => c === "ori" ? L(f.value) : b(f.value)
|
|
353
353
|
});
|
|
354
|
-
const
|
|
354
|
+
const y = () => f.value.push({
|
|
355
355
|
rId: e.randomFun(),
|
|
356
356
|
key: "",
|
|
357
357
|
value: ""
|
|
358
|
-
}),
|
|
359
|
-
f.value =
|
|
360
|
-
},
|
|
361
|
-
const
|
|
362
|
-
o("update:modelValue",
|
|
358
|
+
}), l = () => {
|
|
359
|
+
f.value = r(e.modelValue), o("onReset");
|
|
360
|
+
}, x = () => {
|
|
361
|
+
const c = b(f.value);
|
|
362
|
+
o("update:modelValue", c), o("onMerge", c, L(f.value)), f.value = r(c);
|
|
363
363
|
};
|
|
364
|
-
return () =>
|
|
364
|
+
return () => n("div", {
|
|
365
365
|
class: `dynamicCascadeForm ${e.dyCls}`
|
|
366
|
-
}, [
|
|
366
|
+
}, [n("div", {
|
|
367
367
|
class: `dyFormList ${f.value.length ? "" : "noObj"}`,
|
|
368
368
|
style: {
|
|
369
|
-
maxHeight:
|
|
369
|
+
maxHeight: i.maxHeight
|
|
370
370
|
}
|
|
371
|
-
}, [T(f.value)]),
|
|
371
|
+
}, [T(f.value)]), n("div", {
|
|
372
372
|
class: `control ${f.value.length ? "" : "noObj"}`
|
|
373
|
-
}, [!f.value.length && (
|
|
374
|
-
newItem:
|
|
375
|
-
}) :
|
|
373
|
+
}, [!f.value.length && (u.newBtn ? u.newBtn({
|
|
374
|
+
newItem: y
|
|
375
|
+
}) : n("button", {
|
|
376
376
|
class: ["success", "bt"],
|
|
377
|
-
onClick:
|
|
378
|
-
}, [
|
|
379
|
-
reset:
|
|
380
|
-
}) :
|
|
377
|
+
onClick: y
|
|
378
|
+
}, [d.newTxt])), !e.isController && n(B, null, [!i.hideReset && (u.resetBtn ? u.resetBtn({
|
|
379
|
+
reset: l
|
|
380
|
+
}) : n("button", {
|
|
381
381
|
class: ["default", "bt"],
|
|
382
|
-
onClick:
|
|
383
|
-
}, [
|
|
384
|
-
merge:
|
|
385
|
-
}) :
|
|
382
|
+
onClick: l
|
|
383
|
+
}, [d.resetTxt])), u.mergeBtn ? u.mergeBtn({
|
|
384
|
+
merge: x
|
|
385
|
+
}) : n("button", {
|
|
386
386
|
class: ["info", "bt"],
|
|
387
|
-
onClick:
|
|
388
|
-
}, [
|
|
387
|
+
onClick: x
|
|
388
|
+
}, [d.mergeTxt])])])]);
|
|
389
389
|
}
|
|
390
|
-
}),
|
|
390
|
+
}), U = {
|
|
391
391
|
loading: {
|
|
392
392
|
type: Boolean,
|
|
393
393
|
default: !1
|
|
@@ -458,216 +458,243 @@ const K = /* @__PURE__ */ R({
|
|
|
458
458
|
refreshLoading: {
|
|
459
459
|
type: Boolean,
|
|
460
460
|
default: !0
|
|
461
|
+
},
|
|
462
|
+
stackStatus: {
|
|
463
|
+
// true 时常驻展示结束/错误提示,false 时仅在滚动底部展示
|
|
464
|
+
type: Boolean,
|
|
465
|
+
default: !0
|
|
461
466
|
}
|
|
462
|
-
},
|
|
467
|
+
}, W = {
|
|
463
468
|
"update:loading": (e) => !0,
|
|
464
469
|
"update:isError": (e) => !0
|
|
465
|
-
},
|
|
470
|
+
}, Z = /* @__PURE__ */ H({
|
|
466
471
|
name: "LoadedScroll",
|
|
467
|
-
props:
|
|
468
|
-
emits:
|
|
472
|
+
props: U,
|
|
473
|
+
emits: W,
|
|
469
474
|
slots: Object,
|
|
470
475
|
setup(e, {
|
|
471
476
|
slots: o,
|
|
472
|
-
emit:
|
|
477
|
+
emit: h
|
|
473
478
|
}) {
|
|
474
|
-
const
|
|
475
|
-
let
|
|
476
|
-
const {
|
|
477
|
-
ignoreScroll:
|
|
478
|
-
botHintRef:
|
|
479
|
-
hintHeight:
|
|
480
|
-
handleScroll:
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
479
|
+
const u = I(null);
|
|
480
|
+
let d = null;
|
|
481
|
+
const i = I(!1), {
|
|
482
|
+
ignoreScroll: m,
|
|
483
|
+
botHintRef: g,
|
|
484
|
+
hintHeight: r,
|
|
485
|
+
handleScroll: b,
|
|
486
|
+
updateBottomStatus: f,
|
|
487
|
+
bindHintHeight: T,
|
|
488
|
+
fetchData: y
|
|
489
|
+
} = G(e, h, (a) => {
|
|
490
|
+
i.value = a;
|
|
491
|
+
}), {
|
|
492
|
+
pullY: l,
|
|
493
|
+
pullText: x,
|
|
494
|
+
touching: c,
|
|
495
|
+
bindLoaded: s,
|
|
496
|
+
unbindLoaded: v
|
|
497
|
+
} = J(e, h, u, C), t = O(() => e.stackStatus || i.value);
|
|
498
|
+
j(() => [e.loading, e.finished, e.isError], () => {
|
|
499
|
+
d && f(d);
|
|
500
|
+
}, {
|
|
501
|
+
flush: "post"
|
|
502
|
+
});
|
|
503
|
+
async function C() {
|
|
504
|
+
m.value = !0, await F();
|
|
505
|
+
const a = u.value?.querySelector(e.scrollNode);
|
|
506
|
+
d?.removeEventListener("scroll", b), d = a, d ? (e.memoryScroll || (d.scrollTop = 0), f(d), d.addEventListener("scroll", b)) : i.value = !1, setTimeout(() => {
|
|
507
|
+
m.value = !1;
|
|
495
508
|
});
|
|
496
509
|
}
|
|
497
|
-
return
|
|
498
|
-
await
|
|
499
|
-
}),
|
|
500
|
-
|
|
501
|
-
}), () =>
|
|
502
|
-
ref:
|
|
510
|
+
return M(async () => {
|
|
511
|
+
await T(), await y(), await C(), s();
|
|
512
|
+
}), V(() => {
|
|
513
|
+
d && d.removeEventListener("scroll", b), v();
|
|
514
|
+
}), () => n("div", {
|
|
515
|
+
ref: u,
|
|
503
516
|
class: "loadedScroll"
|
|
504
|
-
}, [e.pullRefresh &&
|
|
517
|
+
}, [e.pullRefresh && n("div", {
|
|
505
518
|
class: "pullRefreshHint",
|
|
506
519
|
style: {
|
|
507
|
-
height: `${
|
|
508
|
-
lineHeight: `${
|
|
509
|
-
transition:
|
|
520
|
+
height: `${l.value}px`,
|
|
521
|
+
lineHeight: `${l.value}px`,
|
|
522
|
+
transition: c.value ? "none" : "height .25s",
|
|
510
523
|
overflow: "hidden",
|
|
511
524
|
textAlign: "center"
|
|
512
525
|
}
|
|
513
|
-
}, [
|
|
514
|
-
hintHeight:
|
|
515
|
-
}),
|
|
516
|
-
ref:
|
|
517
|
-
|
|
526
|
+
}, [x.value]), o.default?.({
|
|
527
|
+
hintHeight: r.value
|
|
528
|
+
}), n("div", {
|
|
529
|
+
ref: g,
|
|
530
|
+
style: {
|
|
531
|
+
display: "flow-root"
|
|
532
|
+
}
|
|
533
|
+
}, [o.bottomHint ? o.bottomHint?.() : n(B, null, [e.loading && n("div", {
|
|
518
534
|
class: "hintText"
|
|
519
|
-
}, [o.
|
|
535
|
+
}, [o.loadingTxt?.() ?? e.loadingTxt]), t.value && e.finished && n("div", {
|
|
520
536
|
class: "hintText"
|
|
521
|
-
}, [o.
|
|
537
|
+
}, [o.finishedTxt?.() ?? e.finishedTxt]), t.value && e.isError && !e.loading && n("div", {
|
|
522
538
|
class: "hintText errorTxt",
|
|
523
539
|
"data-no-pull": !0,
|
|
524
|
-
onPointerDown: (
|
|
525
|
-
onTouchStart: (
|
|
540
|
+
onPointerDown: (a) => a.stopPropagation(),
|
|
541
|
+
onTouchStart: (a) => a.stopPropagation(),
|
|
526
542
|
onClick: () => {
|
|
527
|
-
|
|
543
|
+
h("update:loading", !0), h("update:isError", !1), y();
|
|
528
544
|
}
|
|
529
545
|
}, [o.errorTxt?.() ?? e.errorTxt])])])]);
|
|
530
546
|
}
|
|
531
547
|
});
|
|
532
|
-
function
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
|
|
548
|
+
function G(e, o, h) {
|
|
549
|
+
const u = I(!0), d = I(0), i = I(null), m = d;
|
|
550
|
+
let g;
|
|
551
|
+
function r(y) {
|
|
552
|
+
const l = y.scrollTop + y.clientHeight >= y.scrollHeight - e.offset;
|
|
553
|
+
return h(y.scrollTop + y.clientHeight + m.value >= y.scrollHeight - e.offset), l;
|
|
554
|
+
}
|
|
555
|
+
function b(y) {
|
|
556
|
+
const l = r(y.target);
|
|
557
|
+
u.value || e.loading || e.finished || e.isError || !l || (o("update:loading", !0), T());
|
|
538
558
|
}
|
|
539
|
-
async function
|
|
540
|
-
|
|
541
|
-
|
|
559
|
+
async function f() {
|
|
560
|
+
await F();
|
|
561
|
+
const y = i.value;
|
|
562
|
+
if (!y) return;
|
|
563
|
+
const l = () => {
|
|
564
|
+
d.value = y.getBoundingClientRect().height;
|
|
565
|
+
};
|
|
566
|
+
l(), g?.disconnect(), g = new ResizeObserver(l), g.observe(y);
|
|
542
567
|
}
|
|
543
|
-
|
|
544
|
-
|
|
568
|
+
V(() => g?.disconnect());
|
|
569
|
+
async function T() {
|
|
570
|
+
return e.loadData?.().then((y) => {
|
|
545
571
|
o("update:loading", !1);
|
|
546
|
-
}).catch((
|
|
572
|
+
}).catch((y) => {
|
|
547
573
|
o("update:loading", !1), o("update:isError", !0);
|
|
548
574
|
});
|
|
549
575
|
}
|
|
550
576
|
return {
|
|
551
|
-
ignoreScroll:
|
|
552
|
-
hintHeight:
|
|
553
|
-
botHeight:
|
|
554
|
-
botHintRef:
|
|
555
|
-
handleScroll:
|
|
556
|
-
|
|
557
|
-
|
|
577
|
+
ignoreScroll: u,
|
|
578
|
+
hintHeight: m,
|
|
579
|
+
botHeight: d,
|
|
580
|
+
botHintRef: i,
|
|
581
|
+
handleScroll: b,
|
|
582
|
+
updateBottomStatus: r,
|
|
583
|
+
bindHintHeight: f,
|
|
584
|
+
fetchData: T
|
|
558
585
|
};
|
|
559
586
|
}
|
|
560
|
-
function
|
|
561
|
-
const
|
|
587
|
+
function J(e, o, h, u) {
|
|
588
|
+
const d = I(null), i = I(!1), m = I(!1), g = I(0), r = I(0), b = O(() => m.value ? e.refreshingTxt : r.value >= e.pullDistance ? e.releaseTxt : e.pullTxt);
|
|
562
589
|
function f() {
|
|
563
|
-
return !
|
|
590
|
+
return !h.value || h.value.scrollTop <= 2;
|
|
564
591
|
}
|
|
565
592
|
function T() {
|
|
566
593
|
return e.pullRefresh && f() && !m.value;
|
|
567
594
|
}
|
|
568
|
-
function
|
|
569
|
-
|
|
595
|
+
function y(a) {
|
|
596
|
+
v(a) || (i.value = !1, e.pullRefresh && f() && (m.value || (i.value = !0, g.value = E(a), d.value = q(a), "pointerId" in a && a.currentTarget.setPointerCapture?.(a.pointerId))));
|
|
570
597
|
}
|
|
571
|
-
function
|
|
572
|
-
if (!
|
|
573
|
-
const
|
|
574
|
-
|
|
598
|
+
function l(a) {
|
|
599
|
+
if (!i.value || "pointerId" in a && d.value !== a.pointerId || !T()) return;
|
|
600
|
+
const p = E(a) - g.value;
|
|
601
|
+
p <= 0 || (a.preventDefault(), r.value = Math.min(p * 0.45, e.pullDistance + 30));
|
|
575
602
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
603
|
+
function x(a) {
|
|
604
|
+
i.value && ("pointerId" in a && d.value !== a.pointerId || (i.value = !1, "pointerId" in a && a.currentTarget.releasePointerCapture?.(a.pointerId), d.value = null, r.value >= e.pullDistance ? c() : r.value = 0));
|
|
578
605
|
}
|
|
579
|
-
async function
|
|
606
|
+
async function c() {
|
|
580
607
|
if (!m.value) {
|
|
581
|
-
m.value = !0, e.refreshLoading && o("update:loading", !0),
|
|
608
|
+
m.value = !0, e.refreshLoading && o("update:loading", !0), r.value = e.pullDistance;
|
|
582
609
|
try {
|
|
583
610
|
o("update:isError", !1), await e.refreshData?.();
|
|
584
611
|
} catch {
|
|
585
612
|
o("update:isError", !0);
|
|
586
613
|
} finally {
|
|
587
|
-
m.value = !1, await
|
|
588
|
-
|
|
614
|
+
m.value = !1, await F(), await u(), e.refreshLoading && o("update:loading", !1), setTimeout(() => {
|
|
615
|
+
r.value = 0;
|
|
589
616
|
});
|
|
590
617
|
}
|
|
591
618
|
}
|
|
592
619
|
}
|
|
593
|
-
async function
|
|
594
|
-
await
|
|
595
|
-
name:
|
|
596
|
-
handler:
|
|
597
|
-
options:
|
|
620
|
+
async function s() {
|
|
621
|
+
await F(), t(), !(!h.value || !e.pullRefresh) && C().forEach(({
|
|
622
|
+
name: a,
|
|
623
|
+
handler: S,
|
|
624
|
+
options: p
|
|
598
625
|
}) => {
|
|
599
|
-
|
|
626
|
+
h.value?.addEventListener(a, S, p);
|
|
600
627
|
});
|
|
601
628
|
}
|
|
602
|
-
function
|
|
603
|
-
return !!
|
|
629
|
+
function v(a) {
|
|
630
|
+
return !!a.target?.closest("[data-no-pull]");
|
|
604
631
|
}
|
|
605
|
-
function
|
|
632
|
+
function t() {
|
|
606
633
|
C().forEach(({
|
|
607
|
-
name:
|
|
608
|
-
handler:
|
|
609
|
-
options:
|
|
634
|
+
name: a,
|
|
635
|
+
handler: S,
|
|
636
|
+
options: p
|
|
610
637
|
}) => {
|
|
611
|
-
|
|
638
|
+
h.value?.removeEventListener(a, S, p);
|
|
612
639
|
});
|
|
613
640
|
}
|
|
614
641
|
function C() {
|
|
615
|
-
const
|
|
642
|
+
const a = y, S = l, p = x, w = [{
|
|
616
643
|
name: "pointerdown",
|
|
617
|
-
handler:
|
|
644
|
+
handler: a
|
|
618
645
|
}, {
|
|
619
646
|
name: "pointermove",
|
|
620
|
-
handler:
|
|
647
|
+
handler: S
|
|
621
648
|
}, {
|
|
622
649
|
name: "pointerup",
|
|
623
|
-
handler:
|
|
650
|
+
handler: p
|
|
624
651
|
}, {
|
|
625
652
|
name: "pointercancel",
|
|
626
|
-
handler:
|
|
627
|
-
}],
|
|
653
|
+
handler: p
|
|
654
|
+
}], A = [{
|
|
628
655
|
name: "touchstart",
|
|
629
|
-
handler:
|
|
656
|
+
handler: a,
|
|
630
657
|
options: {
|
|
631
658
|
passive: !0
|
|
632
659
|
}
|
|
633
660
|
}, {
|
|
634
661
|
name: "touchmove",
|
|
635
|
-
handler:
|
|
662
|
+
handler: S,
|
|
636
663
|
options: {
|
|
637
664
|
passive: !1
|
|
638
665
|
}
|
|
639
666
|
}, {
|
|
640
667
|
name: "touchend",
|
|
641
|
-
handler:
|
|
668
|
+
handler: p
|
|
642
669
|
}, {
|
|
643
670
|
name: "touchcancel",
|
|
644
|
-
handler:
|
|
671
|
+
handler: p
|
|
645
672
|
}];
|
|
646
673
|
switch (e.supportMode) {
|
|
647
674
|
case "pc":
|
|
648
|
-
return
|
|
675
|
+
return w;
|
|
649
676
|
case "mobile":
|
|
650
|
-
return
|
|
677
|
+
return A;
|
|
651
678
|
default:
|
|
652
|
-
return [...
|
|
679
|
+
return [...w, ...A];
|
|
653
680
|
}
|
|
654
681
|
}
|
|
655
682
|
return {
|
|
656
|
-
pullY:
|
|
657
|
-
touching:
|
|
658
|
-
pullText:
|
|
659
|
-
bindLoaded:
|
|
660
|
-
unbindLoaded:
|
|
683
|
+
pullY: r,
|
|
684
|
+
touching: i,
|
|
685
|
+
pullText: b,
|
|
686
|
+
bindLoaded: s,
|
|
687
|
+
unbindLoaded: t
|
|
661
688
|
};
|
|
662
689
|
}
|
|
663
|
-
const
|
|
664
|
-
function
|
|
690
|
+
const ee = function(e, o) {
|
|
691
|
+
function h() {
|
|
665
692
|
e?.();
|
|
666
693
|
}
|
|
667
|
-
function
|
|
694
|
+
function u() {
|
|
668
695
|
e?.();
|
|
669
696
|
}
|
|
670
|
-
const
|
|
697
|
+
const d = P({
|
|
671
698
|
pageNo: 1,
|
|
672
699
|
pageSize: 25,
|
|
673
700
|
showSizePicker: !0,
|
|
@@ -675,41 +702,41 @@ const te = function(e, o) {
|
|
|
675
702
|
pageSlot: 5,
|
|
676
703
|
total: 0,
|
|
677
704
|
layout: "total, prev, pager, next, sizes, jumper",
|
|
678
|
-
onChange:
|
|
679
|
-
onPageSizeChange:
|
|
680
|
-
setTotalSize(
|
|
681
|
-
|
|
705
|
+
onChange: h,
|
|
706
|
+
onPageSizeChange: u,
|
|
707
|
+
setTotalSize(i) {
|
|
708
|
+
d.total = i;
|
|
682
709
|
},
|
|
683
710
|
...o
|
|
684
711
|
});
|
|
685
|
-
return
|
|
686
|
-
},
|
|
712
|
+
return d;
|
|
713
|
+
}, te = {
|
|
687
714
|
install(e) {
|
|
688
|
-
e.component("DynamicInput",
|
|
715
|
+
e.component("DynamicInput", _), e.component("DynamicCascadeInput", K);
|
|
689
716
|
}
|
|
690
717
|
};
|
|
691
718
|
export {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
719
|
+
ae as Debounce,
|
|
720
|
+
K as DynamicCascadeInput,
|
|
721
|
+
_ as DynamicInput,
|
|
722
|
+
te as DynamicInputPlugin,
|
|
723
|
+
Z as LoadedScroll,
|
|
724
|
+
re as OmitValue,
|
|
725
|
+
ue as ensureRef,
|
|
726
|
+
$ as formatNumberInput,
|
|
700
727
|
E as getClientY,
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
728
|
+
oe as getDepthColor,
|
|
729
|
+
q as getEventId,
|
|
730
|
+
ie as getMarginY,
|
|
704
731
|
se as getPadY,
|
|
705
732
|
z as parseValue,
|
|
706
|
-
|
|
733
|
+
R as resetObj,
|
|
707
734
|
Y as saferRepairColor,
|
|
708
|
-
|
|
735
|
+
D as tranArr,
|
|
709
736
|
ce as unwrapObj,
|
|
710
737
|
de as useDyForm,
|
|
711
738
|
fe as useObserverSize,
|
|
712
|
-
|
|
739
|
+
ee as usePagination,
|
|
713
740
|
ve as useReactiveForm,
|
|
714
741
|
me as useWindowSize
|
|
715
742
|
};
|