dynamicformdjx 0.5.0 → 0.6.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.
- package/README.md +173 -2
- package/dist/elementPlus/EleZealCard.d.ts +9 -0
- package/dist/elementPlus/EleZealTableTool.d.ts +90 -8
- package/dist/elementPlus/hooks/useZealTool.d.ts +7 -0
- package/dist/elementPlus/index.cjs +1 -1
- package/dist/elementPlus/index.d.ts +6 -4
- package/dist/elementPlus/index.mjs +473 -371
- package/dist/hooks/useTool.d.ts +1 -1
- package/dist/index-BAqRAwDC.cjs +1 -0
- package/dist/index-BQKYL550.js +213 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +493 -216
- package/dist/naiveUi/NaiZealCard.d.ts +9 -0
- package/dist/naiveUi/NaiZealTableTool.d.ts +54 -1
- package/dist/naiveUi/hooks/useZealTool.d.ts +7 -0
- package/dist/naiveUi/index.cjs +1 -1
- package/dist/naiveUi/index.d.ts +6 -4
- package/dist/naiveUi/index.mjs +432 -337
- package/dist/origin/LoadedScroll.d.ts +180 -0
- package/dist/types/index.d.ts +21 -1
- package/dist/types/slots.d.ts +8 -5
- package/dist/utils/tools.d.ts +5 -2
- package/dist/vite-env.d.ts +6 -0
- package/package.json +2 -1
- package/dist/index-BRJXkpNJ.cjs +0 -1
- package/dist/index-a2ON2stt.js +0 -180
package/dist/naiveUi/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NInput as
|
|
4
|
-
const
|
|
1
|
+
import { t as D, r as $, f as q, p as Q, s as X, d as Y, e as ee, k as te, i as ae, c as ne } from "../index-BQKYL550.js";
|
|
2
|
+
import { defineComponent as F, ref as x, watch as H, toRaw as P, createVNode as a, createTextVNode as N, Fragment as w, nextTick as W, isVNode as M, computed as B, h as C, mergeProps as A, reactive as le, shallowReactive as re, onMounted as oe, toRef as ue } from "vue";
|
|
3
|
+
import { NInput as O, NButton as p, NForm as se, NGrid as ie, NFormItemGridItem as ce, NFormItem as de, NModal as fe, NCard as U, NSelect as ye, NPopselect as me, NTreeSelect as ve, NRadioGroup as E, NRadio as ge, NRadioButton as pe, NCheckboxGroup as be, NSpace as he, NCheckbox as K, NSwitch as Ce, NDatePicker as Se, NTimePicker as ke, NDynamicTags as Ne, NSlider as xe, NInputNumber as we, NDrawer as Te, NDrawerContent as Fe, NPagination as Ie, NDropdown as Be } from "naive-ui";
|
|
4
|
+
const Je = /* @__PURE__ */ F({
|
|
5
5
|
name: "NaiDynamicInput",
|
|
6
6
|
props: {
|
|
7
7
|
size: {
|
|
@@ -34,11 +34,11 @@ const Ke = /* @__PURE__ */ I({
|
|
|
34
34
|
emits: {
|
|
35
35
|
"update:modelValue": (e) => !0,
|
|
36
36
|
onReset: () => !0,
|
|
37
|
-
onMerge: (e,
|
|
37
|
+
onMerge: (e, u) => !0
|
|
38
38
|
},
|
|
39
39
|
slots: Object,
|
|
40
40
|
setup(e, {
|
|
41
|
-
emit:
|
|
41
|
+
emit: u,
|
|
42
42
|
expose: n,
|
|
43
43
|
slots: l
|
|
44
44
|
}) {
|
|
@@ -58,41 +58,41 @@ const Ke = /* @__PURE__ */ I({
|
|
|
58
58
|
}, c = {
|
|
59
59
|
arraySplitSymbol: ",",
|
|
60
60
|
...e.dyListConfigs
|
|
61
|
-
}, t = e.size, i =
|
|
62
|
-
|
|
61
|
+
}, t = e.size, i = x(D(e.modelValue, e.randomFun, c.arraySplitSymbol)), m = x(null);
|
|
62
|
+
H(i, (y) => {
|
|
63
63
|
if (!e.isController) return;
|
|
64
|
-
const S =
|
|
65
|
-
|
|
64
|
+
const S = $(y, c.arraySplitSymbol);
|
|
65
|
+
u("update:modelValue", S), u("onMerge", S, P(i.value));
|
|
66
66
|
}, {
|
|
67
67
|
deep: !0
|
|
68
68
|
}), n({
|
|
69
|
-
onSet: (
|
|
70
|
-
i.value =
|
|
69
|
+
onSet: (y) => {
|
|
70
|
+
i.value = D(y ?? e.modelValue, e.randomFun, c.arraySplitSymbol);
|
|
71
71
|
},
|
|
72
|
-
getResult: (
|
|
72
|
+
getResult: (y = "res") => y === "ori" ? P(i.value) : $(i.value, c.arraySplitSymbol)
|
|
73
73
|
});
|
|
74
|
-
const
|
|
74
|
+
const o = () => i.value.push({
|
|
75
75
|
rId: e.randomFun(),
|
|
76
76
|
key: "",
|
|
77
77
|
value: ""
|
|
78
|
-
}),
|
|
79
|
-
i.value =
|
|
80
|
-
},
|
|
78
|
+
}), f = () => {
|
|
79
|
+
i.value = D(e.modelValue, e.randomFun, c.arraySplitSymbol), u("onReset");
|
|
80
|
+
}, b = () => {
|
|
81
81
|
i.value.sort((S, g) => +S.rId - +g.rId);
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const y = $(i.value, c.arraySplitSymbol);
|
|
83
|
+
u("update:modelValue", y), u("onMerge", y, P(i.value)), i.value = D(y, e.randomFun, c.arraySplitSymbol);
|
|
84
84
|
};
|
|
85
85
|
return () => a("div", {
|
|
86
86
|
class: `dynamicForm ${t} ${e.dyCls}`
|
|
87
87
|
}, [a("div", {
|
|
88
88
|
class: `dyFormList ${i.value.length ? "" : "noList"}`,
|
|
89
|
-
ref:
|
|
89
|
+
ref: m,
|
|
90
90
|
style: {
|
|
91
91
|
maxHeight: r.maxHeight
|
|
92
92
|
}
|
|
93
|
-
}, [i.value.map((
|
|
94
|
-
const
|
|
95
|
-
row:
|
|
93
|
+
}, [i.value.map((y, S, g) => {
|
|
94
|
+
const v = {
|
|
95
|
+
row: y,
|
|
96
96
|
index: S,
|
|
97
97
|
isLast: S === g.length - 1,
|
|
98
98
|
addItem: () => {
|
|
@@ -101,7 +101,7 @@ const Ke = /* @__PURE__ */ I({
|
|
|
101
101
|
key: "",
|
|
102
102
|
value: ""
|
|
103
103
|
}), r.autoScroll && W(() => {
|
|
104
|
-
const h =
|
|
104
|
+
const h = m.value;
|
|
105
105
|
h?.scrollTo({
|
|
106
106
|
top: h.scrollHeight,
|
|
107
107
|
behavior: "smooth"
|
|
@@ -109,93 +109,93 @@ const Ke = /* @__PURE__ */ I({
|
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
removeItem: () => {
|
|
112
|
-
i.value = i.value.filter((h) => h.rId !==
|
|
112
|
+
i.value = i.value.filter((h) => h.rId !== y.rId);
|
|
113
113
|
},
|
|
114
|
-
toggleArray: () =>
|
|
115
|
-
toggleNumber: () =>
|
|
114
|
+
toggleArray: () => y.isArray = !y.isArray,
|
|
115
|
+
toggleNumber: () => y.isNumber = !y.isNumber
|
|
116
116
|
};
|
|
117
117
|
return a("div", {
|
|
118
118
|
class: "dItem",
|
|
119
|
-
key:
|
|
119
|
+
key: y.rId
|
|
120
120
|
}, [a("div", {
|
|
121
121
|
class: "input"
|
|
122
|
-
}, [a(
|
|
122
|
+
}, [a(O, {
|
|
123
123
|
size: t,
|
|
124
|
-
value:
|
|
124
|
+
value: y.key,
|
|
125
125
|
class: "key",
|
|
126
126
|
onInput: (h) => {
|
|
127
|
-
|
|
127
|
+
y.key = h;
|
|
128
128
|
}
|
|
129
|
-
}, null), N(":"), a(
|
|
129
|
+
}, null), N(":"), a(O, {
|
|
130
130
|
size: t,
|
|
131
|
-
value:
|
|
131
|
+
value: y.value,
|
|
132
132
|
class: "value",
|
|
133
133
|
onInput: (h) => {
|
|
134
|
-
r.allowFilter &&
|
|
134
|
+
r.allowFilter && y.isNumber ? y.value = q(h, y.isArray, c.arraySplitSymbol) : y.value = h;
|
|
135
135
|
}
|
|
136
136
|
}, {
|
|
137
|
-
prefix: () => l.typeTools ? l.typeTools(
|
|
138
|
-
type:
|
|
137
|
+
prefix: () => l.typeTools ? l.typeTools(v) : a(w, null, [!r.hideArrayBtn && a(p, {
|
|
138
|
+
type: y.isArray ? "success" : "default",
|
|
139
139
|
size: "tiny",
|
|
140
|
-
onClick:
|
|
140
|
+
onClick: v.toggleArray
|
|
141
141
|
}, {
|
|
142
142
|
default: () => [N("Array")]
|
|
143
|
-
}), N(" "), !r.hideNumberBtn && a(
|
|
144
|
-
type:
|
|
143
|
+
}), N(" "), !r.hideNumberBtn && a(p, {
|
|
144
|
+
type: y.isNumber ? "success" : "default",
|
|
145
145
|
size: "tiny",
|
|
146
|
-
onClick:
|
|
146
|
+
onClick: v.toggleNumber
|
|
147
147
|
}, {
|
|
148
148
|
default: () => [N("Number")]
|
|
149
149
|
})])
|
|
150
150
|
})]), a("div", {
|
|
151
151
|
class: "btn"
|
|
152
|
-
}, [l.rowActions ? l.rowActions(
|
|
152
|
+
}, [l.rowActions ? l.rowActions(v) : a(w, null, [a(p, {
|
|
153
153
|
type: "success",
|
|
154
154
|
size: t,
|
|
155
|
-
disabled: !
|
|
156
|
-
onClick:
|
|
155
|
+
disabled: !v.isLast,
|
|
156
|
+
onClick: v.addItem
|
|
157
157
|
}, {
|
|
158
158
|
default: () => [N("+")]
|
|
159
|
-
}), a(
|
|
159
|
+
}), a(p, {
|
|
160
160
|
size: t,
|
|
161
161
|
type: "error",
|
|
162
|
-
onClick:
|
|
162
|
+
onClick: v.removeItem
|
|
163
163
|
}, {
|
|
164
164
|
default: () => [N("-")]
|
|
165
165
|
})])])]);
|
|
166
166
|
})]), a("div", {
|
|
167
167
|
class: `control ${i.value.length ? "" : "noList"}`
|
|
168
168
|
}, [!i.value.length && (l.newBtn ? l.newBtn({
|
|
169
|
-
newItem:
|
|
170
|
-
}) : a(
|
|
169
|
+
newItem: o
|
|
170
|
+
}) : a(p, {
|
|
171
171
|
size: t,
|
|
172
172
|
type: "success",
|
|
173
|
-
onClick:
|
|
173
|
+
onClick: o
|
|
174
174
|
}, {
|
|
175
175
|
default: () => [s.newTxt]
|
|
176
|
-
})), !e.isController && a(
|
|
177
|
-
reset:
|
|
178
|
-
}) : a(
|
|
176
|
+
})), !e.isController && a(w, null, [!r.hideReset && (l.resetBtn ? l.resetBtn({
|
|
177
|
+
reset: f
|
|
178
|
+
}) : a(p, {
|
|
179
179
|
size: t,
|
|
180
180
|
type: "default",
|
|
181
|
-
onClick:
|
|
181
|
+
onClick: f
|
|
182
182
|
}, {
|
|
183
183
|
default: () => [s.resetTxt]
|
|
184
184
|
})), l.mergeBtn ? l.mergeBtn({
|
|
185
|
-
merge:
|
|
186
|
-
}) : a(
|
|
185
|
+
merge: b
|
|
186
|
+
}) : a(p, {
|
|
187
187
|
size: t,
|
|
188
188
|
type: "info",
|
|
189
|
-
onClick:
|
|
189
|
+
onClick: b
|
|
190
190
|
}, {
|
|
191
191
|
default: () => [s.mergeTxt]
|
|
192
192
|
})])])]);
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
function Re(e) {
|
|
196
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
196
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
197
197
|
}
|
|
198
|
-
const
|
|
198
|
+
const Qe = /* @__PURE__ */ F({
|
|
199
199
|
name: "NaiveUiDynamicCascadeInput",
|
|
200
200
|
props: {
|
|
201
201
|
modelValue: {
|
|
@@ -234,11 +234,11 @@ const Je = /* @__PURE__ */ I({
|
|
|
234
234
|
emits: {
|
|
235
235
|
"update:modelValue": (e) => !0,
|
|
236
236
|
onReset: () => !0,
|
|
237
|
-
onMerge: (e,
|
|
237
|
+
onMerge: (e, u) => !0
|
|
238
238
|
},
|
|
239
239
|
slots: Object,
|
|
240
240
|
setup(e, {
|
|
241
|
-
emit:
|
|
241
|
+
emit: u,
|
|
242
242
|
expose: n,
|
|
243
243
|
slots: l
|
|
244
244
|
}) {
|
|
@@ -261,30 +261,30 @@ const Je = /* @__PURE__ */ I({
|
|
|
261
261
|
}, c = {
|
|
262
262
|
arraySplitSymbol: ",",
|
|
263
263
|
...e.dyListConfigs
|
|
264
|
-
}, t = (g) => ["string", "number"].includes(g), i = (g) => Object.keys(g).map((
|
|
265
|
-
let d = g[
|
|
266
|
-
const
|
|
267
|
-
return t(typeof d) && (d = g[
|
|
264
|
+
}, t = (g) => ["string", "number"].includes(g), i = (g) => Object.keys(g).map((v, h) => {
|
|
265
|
+
let d = g[v];
|
|
266
|
+
const I = Array.isArray(d), V = I ? d.every((j) => typeof j == "number") : typeof d == "number", R = d === null;
|
|
267
|
+
return t(typeof d) && (d = g[v]), R && (d = ""), {
|
|
268
268
|
rId: e.randomFun(h),
|
|
269
|
-
key:
|
|
270
|
-
value: Object.prototype.toString.call(d) === "[object Object]" ? i(g[
|
|
271
|
-
isArray:
|
|
272
|
-
isNumber:
|
|
269
|
+
key: v,
|
|
270
|
+
value: Object.prototype.toString.call(d) === "[object Object]" ? i(g[v]) : I ? d.join(c.arraySplitSymbol) : d,
|
|
271
|
+
isArray: I || void 0,
|
|
272
|
+
isNumber: V || void 0
|
|
273
273
|
};
|
|
274
|
-
}),
|
|
274
|
+
}), m = (g) => g.reduce((v, h) => {
|
|
275
275
|
const d = h.value;
|
|
276
|
-
return h.key.trim().length && (
|
|
277
|
-
}, {}),
|
|
278
|
-
class: [`depth-${
|
|
276
|
+
return h.key.trim().length && (v[h.key] = Array.isArray(d) ? m(d) : Q(h.value, h.isArray, h.isNumber, c.arraySplitSymbol)), v;
|
|
277
|
+
}, {}), o = x(i(e.modelValue)), f = (g, v = 1, h) => a("div", {
|
|
278
|
+
class: [`depth-${v}`, r.showBorder ? "" : "no-border", r.showPad ? "" : "no-pad"],
|
|
279
279
|
style: {
|
|
280
|
-
"--depth":
|
|
281
|
-
["--c" + [
|
|
280
|
+
"--depth": v,
|
|
281
|
+
["--c" + [v]]: X(r.borderColors, v)
|
|
282
282
|
}
|
|
283
|
-
}, [g.map((d,
|
|
284
|
-
const R = Array.isArray(d.value),
|
|
283
|
+
}, [g.map((d, I, V) => {
|
|
284
|
+
const R = Array.isArray(d.value), j = t(typeof d.value), T = {
|
|
285
285
|
row: d,
|
|
286
|
-
index:
|
|
287
|
-
isLast:
|
|
286
|
+
index: I,
|
|
287
|
+
isLast: I === V.length - 1,
|
|
288
288
|
addItem: () => {
|
|
289
289
|
g.push({
|
|
290
290
|
rId: e.randomFun(),
|
|
@@ -293,17 +293,17 @@ const Je = /* @__PURE__ */ I({
|
|
|
293
293
|
});
|
|
294
294
|
},
|
|
295
295
|
addChild: () => {
|
|
296
|
-
|
|
296
|
+
j && (d.value = [], d.isArray = void 0), d.value.push({
|
|
297
297
|
rId: e.randomFun(),
|
|
298
298
|
key: "",
|
|
299
299
|
value: ""
|
|
300
300
|
});
|
|
301
301
|
},
|
|
302
302
|
removeItem: () => {
|
|
303
|
-
if (g.splice(
|
|
304
|
-
if (h === void 0) return
|
|
305
|
-
const k =
|
|
306
|
-
|
|
303
|
+
if (g.splice(I, 1), g.length < 1) {
|
|
304
|
+
if (h === void 0) return m([]);
|
|
305
|
+
const k = o.value.findIndex((J) => J.rId === h?.rId);
|
|
306
|
+
v < 1 ? o.value.splice(k, 1, {
|
|
307
307
|
...h,
|
|
308
308
|
value: ""
|
|
309
309
|
}) : h.value = "";
|
|
@@ -316,17 +316,17 @@ const Je = /* @__PURE__ */ I({
|
|
|
316
316
|
class: "dItem",
|
|
317
317
|
key: d.rId,
|
|
318
318
|
style: {
|
|
319
|
-
marginLeft:
|
|
319
|
+
marginLeft: v > 1 ? `${v * r.retractLen}px` : "0"
|
|
320
320
|
}
|
|
321
321
|
}, [a("div", {
|
|
322
322
|
class: "input"
|
|
323
|
-
}, [!R && a(
|
|
323
|
+
}, [!R && a(w, null, [a(O, {
|
|
324
324
|
value: d.key,
|
|
325
325
|
class: "key",
|
|
326
326
|
onInput: (k) => d.key = k
|
|
327
|
-
}, null), N(":")]), a(
|
|
327
|
+
}, null), N(":")]), a(O, {
|
|
328
328
|
class: `value ${R ? "isKey" : ""}`,
|
|
329
|
-
value:
|
|
329
|
+
value: j ? d.value : d.key,
|
|
330
330
|
onInput: (k) => {
|
|
331
331
|
if (R) {
|
|
332
332
|
d.key = k;
|
|
@@ -335,26 +335,26 @@ const Je = /* @__PURE__ */ I({
|
|
|
335
335
|
r.allowFilter && d.isNumber ? d.value = q(k, d.isArray, c.arraySplitSymbol) : d.value = k;
|
|
336
336
|
}
|
|
337
337
|
}, {
|
|
338
|
-
prefix: Array.isArray(d.value) ? void 0 : () => l.typeTools ? l.typeTools(
|
|
338
|
+
prefix: Array.isArray(d.value) ? void 0 : () => l.typeTools ? l.typeTools(T) : a(w, null, [!r.hideArrayBtn && a(p, {
|
|
339
339
|
type: d.isArray ? "success" : "default",
|
|
340
340
|
size: "tiny",
|
|
341
|
-
onClick:
|
|
341
|
+
onClick: T.toggleArray
|
|
342
342
|
}, {
|
|
343
343
|
default: () => [N("Array")]
|
|
344
|
-
}), N(" "), !r.hideNumberBtn && a(
|
|
344
|
+
}), N(" "), !r.hideNumberBtn && a(p, {
|
|
345
345
|
type: d.isNumber ? "success" : "default",
|
|
346
346
|
size: "tiny",
|
|
347
|
-
onClick:
|
|
347
|
+
onClick: T.toggleNumber
|
|
348
348
|
}, {
|
|
349
349
|
default: () => [N("Number")]
|
|
350
350
|
})]),
|
|
351
351
|
suffix: () => {
|
|
352
352
|
let k;
|
|
353
|
-
return
|
|
353
|
+
return v < e.depth ? !R && (l.newChild ? l.newChild(T) : a(p, {
|
|
354
354
|
type: "success",
|
|
355
355
|
size: "tiny",
|
|
356
356
|
onClick: () => {
|
|
357
|
-
|
|
357
|
+
j && (d.value = [], d.isArray = void 0), d.value.push({
|
|
358
358
|
rId: e.randomFun(),
|
|
359
359
|
key: "",
|
|
360
360
|
value: ""
|
|
@@ -366,74 +366,74 @@ const Je = /* @__PURE__ */ I({
|
|
|
366
366
|
}
|
|
367
367
|
})]), a("div", {
|
|
368
368
|
class: "btn"
|
|
369
|
-
}, [l.rowActions ? l.rowActions(
|
|
369
|
+
}, [l.rowActions ? l.rowActions(T) : a(w, null, [a(p, {
|
|
370
370
|
type: "success",
|
|
371
|
-
disabled: !
|
|
372
|
-
onClick:
|
|
371
|
+
disabled: !T.isLast,
|
|
372
|
+
onClick: T.addItem
|
|
373
373
|
}, {
|
|
374
374
|
default: () => [N("+")]
|
|
375
|
-
}), a(
|
|
375
|
+
}), a(p, {
|
|
376
376
|
type: "error",
|
|
377
|
-
onClick:
|
|
377
|
+
onClick: T.removeItem
|
|
378
378
|
}, {
|
|
379
379
|
default: () => [N("-")]
|
|
380
|
-
})])]), Array.isArray(d.value) &&
|
|
380
|
+
})])]), Array.isArray(d.value) && f(d.value, v + 1, d)]);
|
|
381
381
|
})]);
|
|
382
|
-
|
|
382
|
+
H(o, (g) => {
|
|
383
383
|
if (!e.isController) return;
|
|
384
|
-
const
|
|
385
|
-
|
|
384
|
+
const v = m(g);
|
|
385
|
+
u("update:modelValue", v), u("onMerge", v, P(o.value));
|
|
386
386
|
}, {
|
|
387
387
|
deep: !0
|
|
388
388
|
}), n({
|
|
389
389
|
onSet: (g) => {
|
|
390
|
-
|
|
390
|
+
o.value = i(g ?? e.modelValue);
|
|
391
391
|
},
|
|
392
|
-
getResult: (g = "res") => g === "ori" ?
|
|
392
|
+
getResult: (g = "res") => g === "ori" ? P(o.value) : m(o.value)
|
|
393
393
|
});
|
|
394
|
-
const
|
|
394
|
+
const b = () => o.value.push({
|
|
395
395
|
rId: e.randomFun(),
|
|
396
396
|
key: "",
|
|
397
397
|
value: ""
|
|
398
|
-
}),
|
|
399
|
-
|
|
398
|
+
}), y = () => {
|
|
399
|
+
o.value = i(e.modelValue), u("onReset");
|
|
400
400
|
}, S = () => {
|
|
401
|
-
const g =
|
|
402
|
-
|
|
401
|
+
const g = m(o.value);
|
|
402
|
+
u("update:modelValue", g), u("onMerge", g, P(o.value)), o.value = i(g);
|
|
403
403
|
};
|
|
404
404
|
return () => a("div", {
|
|
405
405
|
class: `dynamicCascadeForm ${e.dyCls}`
|
|
406
406
|
}, [a("div", {
|
|
407
|
-
class: `dyFormList ${
|
|
407
|
+
class: `dyFormList ${o.value.length ? "" : "noObj"}`,
|
|
408
408
|
style: {
|
|
409
409
|
maxHeight: r.maxHeight
|
|
410
410
|
}
|
|
411
|
-
}, [
|
|
412
|
-
class: `control ${
|
|
413
|
-
}, [!
|
|
414
|
-
newItem:
|
|
415
|
-
}) : a(
|
|
411
|
+
}, [f(o.value)]), a("div", {
|
|
412
|
+
class: `control ${o.value.length ? "" : "noObj"}`
|
|
413
|
+
}, [!o.value.length && (l.newBtn ? l.newBtn({
|
|
414
|
+
newItem: b
|
|
415
|
+
}) : a(p, {
|
|
416
416
|
type: "success",
|
|
417
|
-
onClick:
|
|
417
|
+
onClick: b
|
|
418
418
|
}, {
|
|
419
419
|
default: () => [s.newTxt]
|
|
420
|
-
})), !e.isController && a(
|
|
421
|
-
reset:
|
|
422
|
-
}) : a(
|
|
420
|
+
})), !e.isController && a(w, null, [!r.hideReset && (l.resetBtn ? l.resetBtn({
|
|
421
|
+
reset: y
|
|
422
|
+
}) : a(p, {
|
|
423
423
|
type: "default",
|
|
424
|
-
onClick:
|
|
424
|
+
onClick: y
|
|
425
425
|
}, {
|
|
426
426
|
default: () => [s.resetTxt]
|
|
427
427
|
})), l.mergeBtn ? l.mergeBtn({
|
|
428
428
|
merge: S
|
|
429
|
-
}) : a(
|
|
429
|
+
}) : a(p, {
|
|
430
430
|
type: "info",
|
|
431
431
|
onClick: S
|
|
432
432
|
}, {
|
|
433
433
|
default: () => [s.mergeTxt]
|
|
434
434
|
})])])]);
|
|
435
435
|
}
|
|
436
|
-
}),
|
|
436
|
+
}), L = /* @__PURE__ */ F({
|
|
437
437
|
name: "NaiDynamicForm",
|
|
438
438
|
props: {
|
|
439
439
|
formConfig: {
|
|
@@ -466,68 +466,68 @@ const Je = /* @__PURE__ */ I({
|
|
|
466
466
|
},
|
|
467
467
|
slots: Object,
|
|
468
468
|
setup(e, {
|
|
469
|
-
expose:
|
|
469
|
+
expose: u,
|
|
470
470
|
slots: n
|
|
471
471
|
}) {
|
|
472
|
-
const l =
|
|
473
|
-
...s.value?.reduce((
|
|
474
|
-
let
|
|
475
|
-
return
|
|
472
|
+
const l = x(null), s = B(() => (e.items ?? []).filter((o) => !o.hidden)), r = B(() => s.value ? s.value.reduce((o, f) => (o[f.key] = f.value.value, o), {}) : {}), c = B(() => ({
|
|
473
|
+
...s.value?.reduce((f, b) => {
|
|
474
|
+
let y = b.rule;
|
|
475
|
+
return b.required && !b.rule && (y = {
|
|
476
476
|
required: !0,
|
|
477
|
-
message:
|
|
477
|
+
message: b.requiredHint?.(b?.label ?? "") ?? `${b.label}不能为空`,
|
|
478
478
|
trigger: ["blur"]
|
|
479
|
-
}),
|
|
479
|
+
}), f[b.key] = y, f;
|
|
480
480
|
}, {}),
|
|
481
481
|
...e.rules
|
|
482
|
-
})), t =
|
|
483
|
-
const
|
|
484
|
-
return Number(
|
|
482
|
+
})), t = B(() => [...s.value].sort((f, b) => {
|
|
483
|
+
const y = f.sort ?? 1 / 0, S = b.sort ?? 1 / 0;
|
|
484
|
+
return Number(y) - Number(S);
|
|
485
485
|
}));
|
|
486
|
-
function i(
|
|
487
|
-
s.value && s.value.forEach((
|
|
488
|
-
|
|
486
|
+
function i(o = null) {
|
|
487
|
+
s.value && s.value.forEach((f) => {
|
|
488
|
+
f.value.value = o;
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
return new Promise((
|
|
493
|
-
l.value?.validate((
|
|
494
|
-
|
|
491
|
+
function m() {
|
|
492
|
+
return new Promise((o, f) => {
|
|
493
|
+
l.value?.validate((b) => {
|
|
494
|
+
b ? f(b) : o(r.value);
|
|
495
495
|
});
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
|
-
if (
|
|
498
|
+
if (u({
|
|
499
499
|
reset: i,
|
|
500
|
-
validator:
|
|
501
|
-
getResult: (
|
|
500
|
+
validator: m,
|
|
501
|
+
getResult: (o = "res") => o === "ori" ? s.value : r.value
|
|
502
502
|
}), !e.items) throw new Error("prop items must be not null");
|
|
503
503
|
return () => a("div", {
|
|
504
504
|
class: "naiDynamicForm"
|
|
505
505
|
}, [n.header && a("div", {
|
|
506
506
|
class: "header"
|
|
507
|
-
}, [n.header?.()]), a(se,
|
|
507
|
+
}, [n.header?.()]), a(se, A({
|
|
508
508
|
ref: l
|
|
509
509
|
}, e.formConfig, {
|
|
510
510
|
model: r.value,
|
|
511
511
|
rules: c.value
|
|
512
512
|
}), {
|
|
513
513
|
default() {
|
|
514
|
-
const
|
|
514
|
+
const o = t.value;
|
|
515
515
|
return e.preset === "grid" ? C(ie, {
|
|
516
516
|
...e.gridConfig
|
|
517
517
|
}, {
|
|
518
|
-
default: () =>
|
|
519
|
-
label:
|
|
520
|
-
path:
|
|
521
|
-
span:
|
|
522
|
-
offset:
|
|
518
|
+
default: () => o?.map((f) => C(ce, {
|
|
519
|
+
label: f.label,
|
|
520
|
+
path: f.path || f.key,
|
|
521
|
+
span: f.span ?? 24,
|
|
522
|
+
offset: f.offset ?? 0
|
|
523
523
|
}, {
|
|
524
|
-
default: G(
|
|
524
|
+
default: G(f)
|
|
525
525
|
}))
|
|
526
|
-
}) :
|
|
527
|
-
label:
|
|
528
|
-
path:
|
|
526
|
+
}) : o?.map((f) => C(de, {
|
|
527
|
+
label: f.label,
|
|
528
|
+
path: f.path || f.key
|
|
529
529
|
}, {
|
|
530
|
-
default: G(
|
|
530
|
+
default: G(f)
|
|
531
531
|
}));
|
|
532
532
|
}
|
|
533
533
|
}), n.footer && C("div", {
|
|
@@ -540,10 +540,10 @@ function G(e) {
|
|
|
540
540
|
return e.render2 ? e.render2(e) : null;
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
543
|
+
function Z(e) {
|
|
544
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
545
545
|
}
|
|
546
|
-
const
|
|
546
|
+
const Xe = /* @__PURE__ */ F({
|
|
547
547
|
name: "NaiPopupModal",
|
|
548
548
|
props: {
|
|
549
549
|
title: {
|
|
@@ -586,31 +586,31 @@ const Qe = /* @__PURE__ */ I({
|
|
|
586
586
|
submit: () => true,
|
|
587
587
|
},*/
|
|
588
588
|
setup(e, {
|
|
589
|
-
expose:
|
|
589
|
+
expose: u,
|
|
590
590
|
emit: n,
|
|
591
591
|
slots: l
|
|
592
592
|
}) {
|
|
593
|
-
const s =
|
|
593
|
+
const s = B(() => ({
|
|
594
594
|
preset: "card",
|
|
595
595
|
draggable: !0,
|
|
596
596
|
...e.modalProps ?? {}
|
|
597
|
-
})), r =
|
|
597
|
+
})), r = x(!1), c = le({
|
|
598
598
|
c: !1,
|
|
599
599
|
s: !1
|
|
600
|
-
}), t = (
|
|
601
|
-
r.value =
|
|
600
|
+
}), t = (o) => {
|
|
601
|
+
r.value = o ?? !r.value;
|
|
602
602
|
};
|
|
603
|
-
|
|
603
|
+
u({
|
|
604
604
|
toggle: t
|
|
605
605
|
});
|
|
606
606
|
const i = async () => {
|
|
607
607
|
c.c = !0, (await e.onCancel?.() ?? !0) && t(!1), c.c = !1;
|
|
608
|
-
},
|
|
608
|
+
}, m = async () => {
|
|
609
609
|
c.s = !0, (await e.onSubmit?.() ?? !0) && t(!1), c.s = !1;
|
|
610
610
|
};
|
|
611
|
-
return () => a(fe,
|
|
611
|
+
return () => a(fe, A({
|
|
612
612
|
show: r.value,
|
|
613
|
-
"onUpdate:show": (
|
|
613
|
+
"onUpdate:show": (o) => r.value = o,
|
|
614
614
|
style: {
|
|
615
615
|
width: e.width
|
|
616
616
|
},
|
|
@@ -620,35 +620,35 @@ const Qe = /* @__PURE__ */ I({
|
|
|
620
620
|
maskClosable: e.closeOnMask
|
|
621
621
|
}, s.value), {
|
|
622
622
|
footer: () => {
|
|
623
|
-
const [
|
|
624
|
-
c:
|
|
625
|
-
s:
|
|
623
|
+
const [o, f] = e.footerTxt, {
|
|
624
|
+
c: b,
|
|
625
|
+
s: y
|
|
626
626
|
} = c;
|
|
627
627
|
return a("div", {
|
|
628
628
|
class: "flex justify-end align-center sm-gap"
|
|
629
|
-
}, [a(
|
|
629
|
+
}, [a(p, {
|
|
630
630
|
size: "small",
|
|
631
631
|
onClick: i,
|
|
632
|
-
loading:
|
|
633
|
-
},
|
|
634
|
-
default: () => [
|
|
635
|
-
}), a(
|
|
632
|
+
loading: b
|
|
633
|
+
}, Z(o) ? o : {
|
|
634
|
+
default: () => [o]
|
|
635
|
+
}), a(p, {
|
|
636
636
|
size: "small",
|
|
637
637
|
type: "success",
|
|
638
|
-
onClick:
|
|
639
|
-
loading:
|
|
640
|
-
},
|
|
641
|
-
default: () => [
|
|
638
|
+
onClick: m,
|
|
639
|
+
loading: y
|
|
640
|
+
}, Z(f) ? f : {
|
|
641
|
+
default: () => [f]
|
|
642
642
|
})]);
|
|
643
643
|
},
|
|
644
644
|
...l
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
647
|
});
|
|
648
|
-
function
|
|
649
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
648
|
+
function _(e) {
|
|
649
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
650
650
|
}
|
|
651
|
-
const
|
|
651
|
+
const Ye = /* @__PURE__ */ F({
|
|
652
652
|
name: "NaiZealCard",
|
|
653
653
|
props: {
|
|
654
654
|
title: {
|
|
@@ -669,122 +669,130 @@ const Xe = /* @__PURE__ */ I({
|
|
|
669
669
|
checkWindowSize: {
|
|
670
670
|
type: Array,
|
|
671
671
|
default: [756, 500]
|
|
672
|
+
},
|
|
673
|
+
observeDelay: {
|
|
674
|
+
type: Number,
|
|
675
|
+
default: 100
|
|
672
676
|
}
|
|
673
677
|
},
|
|
674
678
|
slots: Object,
|
|
675
679
|
setup(e, {
|
|
676
|
-
slots:
|
|
680
|
+
slots: u,
|
|
681
|
+
expose: n
|
|
677
682
|
}) {
|
|
678
|
-
const
|
|
679
|
-
wrapRef:
|
|
680
|
-
cardRef:
|
|
681
|
-
restRef:
|
|
682
|
-
tableHeight:
|
|
683
|
-
} = ee(
|
|
684
|
-
return (
|
|
685
|
-
|
|
683
|
+
const l = Y(...e.checkWindowSize), {
|
|
684
|
+
wrapRef: s,
|
|
685
|
+
cardRef: r,
|
|
686
|
+
restRef: c,
|
|
687
|
+
tableHeight: t
|
|
688
|
+
} = ee(U, e.observeDelay);
|
|
689
|
+
return n({
|
|
690
|
+
tableHeight: t,
|
|
691
|
+
isMobile: B(() => l.isMobile)
|
|
692
|
+
}), () => {
|
|
693
|
+
const i = te(l);
|
|
686
694
|
return a("div", {
|
|
687
695
|
class: "zealCard",
|
|
688
696
|
style: {
|
|
689
697
|
height: `calc(${e.zealHeight} - ${e.outPadding * 2}px)`
|
|
690
698
|
},
|
|
691
|
-
ref: l
|
|
692
|
-
}, [a(L, {
|
|
693
699
|
ref: s
|
|
700
|
+
}, [a(U, {
|
|
701
|
+
ref: r
|
|
694
702
|
}, {
|
|
695
|
-
default: () => [
|
|
696
|
-
tableHeight:
|
|
697
|
-
...
|
|
703
|
+
default: () => [u.default?.({
|
|
704
|
+
tableHeight: t.value,
|
|
705
|
+
...i
|
|
698
706
|
})],
|
|
699
707
|
header: () => {
|
|
700
|
-
const [
|
|
708
|
+
const [m, o] = e.searchBtnTxt;
|
|
701
709
|
return a("div", {
|
|
702
710
|
class: "header"
|
|
703
|
-
}, [
|
|
711
|
+
}, [u.header?.(i) ?? a(w, null, [a("div", {
|
|
704
712
|
class: "title"
|
|
705
713
|
}, [e.title]), a("div", {
|
|
706
714
|
class: "search"
|
|
707
|
-
}, [
|
|
715
|
+
}, [u.searchForm?.(i), u.searchBtn?.(i) || u.searchForm && a("div", {
|
|
708
716
|
class: "searchBtn"
|
|
709
|
-
}, [a(
|
|
717
|
+
}, [a(p, {
|
|
710
718
|
size: "small"
|
|
711
|
-
},
|
|
712
|
-
default: () => [
|
|
713
|
-
}), a(
|
|
719
|
+
}, _(m) ? m : {
|
|
720
|
+
default: () => [m]
|
|
721
|
+
}), a(p, {
|
|
714
722
|
type: "info",
|
|
715
723
|
size: "small"
|
|
716
|
-
},
|
|
717
|
-
default: () => [
|
|
724
|
+
}, _(o) ? o : {
|
|
725
|
+
default: () => [o]
|
|
718
726
|
})])])]), a("div", {
|
|
719
727
|
class: "controlBtn"
|
|
720
|
-
}, [a("div", null, [
|
|
728
|
+
}, [a("div", null, [u.controlBtn?.(i)]), u.toolBtn?.(i)])]);
|
|
721
729
|
},
|
|
722
|
-
footer: () => a("div", {
|
|
730
|
+
footer: () => u.footer ? a("div", {
|
|
723
731
|
class: "footer"
|
|
724
|
-
}, [
|
|
732
|
+
}, [u.footer?.(i)]) : null
|
|
725
733
|
}), a("div", {
|
|
726
|
-
ref:
|
|
727
|
-
}, [
|
|
734
|
+
ref: c
|
|
735
|
+
}, [u.rest?.(i)])]);
|
|
728
736
|
};
|
|
729
737
|
}
|
|
730
738
|
});
|
|
731
|
-
function
|
|
739
|
+
function ze(e, u = {}, n) {
|
|
732
740
|
const { onChange: l, ...s } = n ?? {};
|
|
733
|
-
return C(
|
|
741
|
+
return C(O, {
|
|
734
742
|
...s,
|
|
735
743
|
value: e.value,
|
|
736
744
|
onUpdateValue: (r) => {
|
|
737
745
|
e.value = r, n?.onChange?.(r, n);
|
|
738
746
|
},
|
|
739
|
-
...
|
|
747
|
+
...u
|
|
740
748
|
});
|
|
741
749
|
}
|
|
742
|
-
function Pe(e,
|
|
750
|
+
function Pe(e, u, n = {}, l) {
|
|
743
751
|
const { onChange: s, ...r } = l ?? {};
|
|
744
752
|
return C(ye, {
|
|
745
753
|
...r,
|
|
746
754
|
value: e.value,
|
|
747
|
-
options:
|
|
755
|
+
options: u,
|
|
748
756
|
onUpdateValue: (c) => {
|
|
749
|
-
e.value = c, l?.onChange?.(c, l,
|
|
757
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
750
758
|
},
|
|
751
759
|
...n
|
|
752
760
|
});
|
|
753
761
|
}
|
|
754
|
-
function
|
|
755
|
-
const { value: r, labelField: c, valueField: t, onChange: i, ...
|
|
762
|
+
function je(e, u, n = {}, l, s) {
|
|
763
|
+
const { value: r, labelField: c, valueField: t, onChange: i, ...m } = l ?? {}, o = c ?? "label", f = t ?? "value", b = m.options ?? u;
|
|
756
764
|
return a(
|
|
757
|
-
|
|
765
|
+
me,
|
|
758
766
|
{
|
|
759
|
-
...
|
|
767
|
+
...m,
|
|
760
768
|
value: e.value,
|
|
761
|
-
onUpdateValue: (
|
|
762
|
-
e.value =
|
|
769
|
+
onUpdateValue: (y) => {
|
|
770
|
+
e.value = y, l?.onChange?.(y, l, b);
|
|
763
771
|
},
|
|
764
|
-
options:
|
|
772
|
+
options: b.map((y) => ({ ...y, label: y[o], value: y[f] })),
|
|
765
773
|
...n
|
|
766
774
|
},
|
|
767
775
|
{
|
|
768
|
-
default: () => s ?? a(
|
|
776
|
+
default: () => s ?? a(p, null, {
|
|
769
777
|
default: () => e.value || "请选择"
|
|
770
778
|
})
|
|
771
779
|
}
|
|
772
780
|
);
|
|
773
781
|
}
|
|
774
|
-
function
|
|
782
|
+
function Ae(e, u, n = {}, l) {
|
|
775
783
|
const { valueField: s = "value", onChange: r, ...c } = l ?? {};
|
|
776
|
-
return C(
|
|
784
|
+
return C(ve, {
|
|
777
785
|
...c,
|
|
778
786
|
value: e.value,
|
|
779
|
-
options:
|
|
787
|
+
options: u,
|
|
780
788
|
onUpdateValue: (t) => {
|
|
781
|
-
e.value = t, l?.onChange?.(t, l,
|
|
789
|
+
e.value = t, l?.onChange?.(t, l, u);
|
|
782
790
|
},
|
|
783
791
|
keyField: s,
|
|
784
792
|
...n
|
|
785
793
|
});
|
|
786
794
|
}
|
|
787
|
-
function
|
|
795
|
+
function Oe(e, u, n = {}, l) {
|
|
788
796
|
const { onChange: s, ...r } = l ?? {};
|
|
789
797
|
return C(
|
|
790
798
|
E,
|
|
@@ -792,19 +800,19 @@ function ze(e, o, n = {}, l) {
|
|
|
792
800
|
...r,
|
|
793
801
|
value: e.value,
|
|
794
802
|
onUpdateValue: (c) => {
|
|
795
|
-
e.value = c, l?.onChange?.(c, l,
|
|
803
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
796
804
|
},
|
|
797
805
|
...n
|
|
798
806
|
},
|
|
799
807
|
{
|
|
800
|
-
default: () => (l?.options ??
|
|
801
|
-
const i = l,
|
|
808
|
+
default: () => (l?.options ?? u).map((t) => {
|
|
809
|
+
const i = l, m = t[i?.labelField ?? "label"], o = t[i?.valueField ?? "value"];
|
|
802
810
|
return C(
|
|
803
811
|
ge,
|
|
804
812
|
{
|
|
805
813
|
...t,
|
|
806
|
-
label:
|
|
807
|
-
value:
|
|
814
|
+
label: m,
|
|
815
|
+
value: o
|
|
808
816
|
},
|
|
809
817
|
{
|
|
810
818
|
default: () => t.label
|
|
@@ -814,7 +822,7 @@ function ze(e, o, n = {}, l) {
|
|
|
814
822
|
}
|
|
815
823
|
);
|
|
816
824
|
}
|
|
817
|
-
function
|
|
825
|
+
function De(e, u, n = {}, l) {
|
|
818
826
|
const { onChange: s, ...r } = l ?? {};
|
|
819
827
|
return a(
|
|
820
828
|
E,
|
|
@@ -822,19 +830,19 @@ function Oe(e, o, n = {}, l) {
|
|
|
822
830
|
...r,
|
|
823
831
|
value: e.value,
|
|
824
832
|
onUpdateValue: (c) => {
|
|
825
|
-
e.value = c, l?.onChange?.(c, l,
|
|
833
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
826
834
|
},
|
|
827
835
|
...n
|
|
828
836
|
},
|
|
829
837
|
{
|
|
830
|
-
default: () => (l?.options ??
|
|
831
|
-
const i = l,
|
|
838
|
+
default: () => (l?.options ?? u).map((t) => {
|
|
839
|
+
const i = l, m = t[i?.labelField ?? "label"], o = t[i?.valueField ?? "value"];
|
|
832
840
|
return a(
|
|
833
841
|
pe,
|
|
834
842
|
{
|
|
835
843
|
...t,
|
|
836
|
-
label:
|
|
837
|
-
value:
|
|
844
|
+
label: m,
|
|
845
|
+
value: o
|
|
838
846
|
},
|
|
839
847
|
{
|
|
840
848
|
default: () => t.label
|
|
@@ -844,7 +852,7 @@ function Oe(e, o, n = {}, l) {
|
|
|
844
852
|
}
|
|
845
853
|
);
|
|
846
854
|
}
|
|
847
|
-
function
|
|
855
|
+
function Me(e, u, n = {}, l) {
|
|
848
856
|
const { onChange: s, ...r } = l ?? {};
|
|
849
857
|
return C(
|
|
850
858
|
be,
|
|
@@ -852,7 +860,7 @@ function De(e, o, n = {}, l) {
|
|
|
852
860
|
...r,
|
|
853
861
|
value: e.value,
|
|
854
862
|
onUpdateValue: (c) => {
|
|
855
|
-
e.value = c, l?.onChange?.(c, l,
|
|
863
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
856
864
|
},
|
|
857
865
|
...n
|
|
858
866
|
},
|
|
@@ -863,11 +871,11 @@ function De(e, o, n = {}, l) {
|
|
|
863
871
|
itemStyle: "display: flex"
|
|
864
872
|
},
|
|
865
873
|
{
|
|
866
|
-
default: () => (l?.options ??
|
|
867
|
-
const i = l,
|
|
874
|
+
default: () => (l?.options ?? u).map((t) => {
|
|
875
|
+
const i = l, m = t[i?.labelField ?? "label"], o = t[i?.valueField ?? "value"];
|
|
868
876
|
return C(K, {
|
|
869
|
-
value:
|
|
870
|
-
label:
|
|
877
|
+
value: o,
|
|
878
|
+
label: m
|
|
871
879
|
});
|
|
872
880
|
})
|
|
873
881
|
}
|
|
@@ -875,7 +883,7 @@ function De(e, o, n = {}, l) {
|
|
|
875
883
|
}
|
|
876
884
|
);
|
|
877
885
|
}
|
|
878
|
-
function
|
|
886
|
+
function Ve(e, u = {}, n) {
|
|
879
887
|
const { onChange: l, ...s } = n ?? {};
|
|
880
888
|
return C(Ce, {
|
|
881
889
|
...s,
|
|
@@ -883,10 +891,10 @@ function Me(e, o = {}, n) {
|
|
|
883
891
|
onUpdateValue: (r) => {
|
|
884
892
|
e.value = r, n?.onChange?.(r, n);
|
|
885
893
|
},
|
|
886
|
-
...
|
|
894
|
+
...u
|
|
887
895
|
});
|
|
888
896
|
}
|
|
889
|
-
function
|
|
897
|
+
function $e(e, u = {}, n) {
|
|
890
898
|
const { onChange: l, ...s } = n ?? {};
|
|
891
899
|
return C(Se, {
|
|
892
900
|
...s,
|
|
@@ -894,10 +902,10 @@ function Ve(e, o = {}, n) {
|
|
|
894
902
|
onUpdateValue: (r) => {
|
|
895
903
|
e.value = r, n?.onChange?.(r, n);
|
|
896
904
|
},
|
|
897
|
-
...
|
|
905
|
+
...u
|
|
898
906
|
});
|
|
899
907
|
}
|
|
900
|
-
function
|
|
908
|
+
function He(e, u = {}, n) {
|
|
901
909
|
const { onChange: l, ...s } = n ?? {};
|
|
902
910
|
return C(ke, {
|
|
903
911
|
...s,
|
|
@@ -905,10 +913,10 @@ function $e(e, o = {}, n) {
|
|
|
905
913
|
onUpdateValue: (r) => {
|
|
906
914
|
e.value = r, n?.onChange?.(r, n);
|
|
907
915
|
},
|
|
908
|
-
...
|
|
916
|
+
...u
|
|
909
917
|
});
|
|
910
918
|
}
|
|
911
|
-
function Ue(e,
|
|
919
|
+
function Ue(e, u = {}, n) {
|
|
912
920
|
const { onChange: l, ...s } = n ?? {};
|
|
913
921
|
return C(
|
|
914
922
|
K,
|
|
@@ -918,14 +926,14 @@ function Ue(e, o = {}, n) {
|
|
|
918
926
|
onUpdateChecked: (r) => {
|
|
919
927
|
e.value = r, n?.onChange?.(r, n);
|
|
920
928
|
},
|
|
921
|
-
...
|
|
929
|
+
...u
|
|
922
930
|
},
|
|
923
931
|
{
|
|
924
|
-
default: () =>
|
|
932
|
+
default: () => u?.label ?? n?.label
|
|
925
933
|
}
|
|
926
934
|
);
|
|
927
935
|
}
|
|
928
|
-
function Le(e,
|
|
936
|
+
function Le(e, u = {}, n) {
|
|
929
937
|
const { onChange: l, ...s } = n ?? {};
|
|
930
938
|
return C(Ne, {
|
|
931
939
|
...s,
|
|
@@ -933,10 +941,10 @@ function Le(e, o = {}, n) {
|
|
|
933
941
|
onUpdateValue: (r) => {
|
|
934
942
|
e.value = r, n?.onChange?.(r, n);
|
|
935
943
|
},
|
|
936
|
-
...
|
|
944
|
+
...u
|
|
937
945
|
});
|
|
938
946
|
}
|
|
939
|
-
function
|
|
947
|
+
function Ge(e, u = {}, n) {
|
|
940
948
|
const { onChange: l, ...s } = n ?? {};
|
|
941
949
|
return C(xe, {
|
|
942
950
|
...s,
|
|
@@ -944,10 +952,10 @@ function He(e, o = {}, n) {
|
|
|
944
952
|
onUpdateValue: (r) => {
|
|
945
953
|
e.value = r, n?.onChange?.(r, n);
|
|
946
954
|
},
|
|
947
|
-
...
|
|
955
|
+
...u
|
|
948
956
|
});
|
|
949
957
|
}
|
|
950
|
-
function
|
|
958
|
+
function Ze(e, u = {}, n) {
|
|
951
959
|
const { onChange: l, ...s } = n ?? {};
|
|
952
960
|
return C(we, {
|
|
953
961
|
...s,
|
|
@@ -955,27 +963,27 @@ function Ge(e, o = {}, n) {
|
|
|
955
963
|
onUpdateValue: (r) => {
|
|
956
964
|
e.value = r, n?.onChange?.(r, n);
|
|
957
965
|
},
|
|
958
|
-
...
|
|
966
|
+
...u
|
|
959
967
|
});
|
|
960
968
|
}
|
|
961
969
|
const _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
962
970
|
__proto__: null,
|
|
963
971
|
renderCheckbox: Ue,
|
|
964
|
-
renderCheckboxGroup:
|
|
965
|
-
renderDatePicker:
|
|
972
|
+
renderCheckboxGroup: Me,
|
|
973
|
+
renderDatePicker: $e,
|
|
966
974
|
renderDynamicTags: Le,
|
|
967
|
-
renderInput:
|
|
968
|
-
renderInputNumber:
|
|
969
|
-
renderPopSelect:
|
|
970
|
-
renderRadioButtonGroup:
|
|
971
|
-
renderRadioGroup:
|
|
975
|
+
renderInput: ze,
|
|
976
|
+
renderInputNumber: Ze,
|
|
977
|
+
renderPopSelect: je,
|
|
978
|
+
renderRadioButtonGroup: De,
|
|
979
|
+
renderRadioGroup: Oe,
|
|
972
980
|
renderSelect: Pe,
|
|
973
|
-
renderSlider:
|
|
974
|
-
renderSwitch:
|
|
975
|
-
renderTimePicker:
|
|
976
|
-
renderTreeSelect:
|
|
981
|
+
renderSlider: Ge,
|
|
982
|
+
renderSwitch: Ve,
|
|
983
|
+
renderTimePicker: He,
|
|
984
|
+
renderTreeSelect: Ae
|
|
977
985
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
978
|
-
function
|
|
986
|
+
function qe(e) {
|
|
979
987
|
return function(n, l = !0) {
|
|
980
988
|
const s = e, r = {
|
|
981
989
|
renderInput: (t) => s.renderInput(t.value, t.renderProps ?? {}, t),
|
|
@@ -998,18 +1006,18 @@ function Ze(e) {
|
|
|
998
1006
|
if (i.value = ae(t.value), typeof t.render2 == "function")
|
|
999
1007
|
i.render2 = t.render2;
|
|
1000
1008
|
else {
|
|
1001
|
-
const
|
|
1002
|
-
|
|
1009
|
+
const m = t.renderType ?? "renderInput", o = r[m];
|
|
1010
|
+
o ? i.render2 = () => o(i) : (console.warn(`[useDecorateForm] unknown renderType: ${t.renderType}`), i.render2 = () => r.renderInput(i));
|
|
1003
1011
|
}
|
|
1004
1012
|
return l ? re(i) : i;
|
|
1005
1013
|
});
|
|
1006
1014
|
};
|
|
1007
1015
|
}
|
|
1008
|
-
const
|
|
1009
|
-
function
|
|
1010
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1016
|
+
const et = qe(_e);
|
|
1017
|
+
function z(e) {
|
|
1018
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
1011
1019
|
}
|
|
1012
|
-
const
|
|
1020
|
+
const tt = /* @__PURE__ */ F({
|
|
1013
1021
|
name: "NaiZealTableSearch",
|
|
1014
1022
|
props: {
|
|
1015
1023
|
title: {
|
|
@@ -1061,39 +1069,39 @@ const et = /* @__PURE__ */ I({
|
|
|
1061
1069
|
},
|
|
1062
1070
|
slots: Object,
|
|
1063
1071
|
setup(e, {
|
|
1064
|
-
emit:
|
|
1072
|
+
emit: u,
|
|
1065
1073
|
slots: n,
|
|
1066
1074
|
expose: l
|
|
1067
1075
|
}) {
|
|
1068
|
-
const s =
|
|
1069
|
-
s.value =
|
|
1076
|
+
const s = x(!1), r = x({}), c = ne(e.searchItems), t = (o) => {
|
|
1077
|
+
s.value = o ?? !s.value;
|
|
1070
1078
|
}, i = () => {
|
|
1071
|
-
e.copyDefault ? c.setValues(r.value) : c.onReset(null),
|
|
1072
|
-
},
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1079
|
+
e.copyDefault ? c.setValues(r.value) : c.onReset(null), u("onReset"), t(!1);
|
|
1080
|
+
}, m = () => {
|
|
1081
|
+
const o = c.getValues();
|
|
1082
|
+
u("onSearch", o), t(!1);
|
|
1075
1083
|
};
|
|
1076
|
-
return
|
|
1077
|
-
e.closeDrawerAuto ||
|
|
1078
|
-
}),
|
|
1084
|
+
return H(() => e.isMobile, (o) => {
|
|
1085
|
+
e.closeDrawerAuto || o || t(!1);
|
|
1086
|
+
}), oe(async () => {
|
|
1079
1087
|
await W(), e.copyDefault && (r.value = c.getValues());
|
|
1080
1088
|
}), l({
|
|
1081
1089
|
onReset: i,
|
|
1082
|
-
onSearch:
|
|
1090
|
+
onSearch: m,
|
|
1083
1091
|
toggleDrawer: t,
|
|
1084
1092
|
getParams: () => c.getValues()
|
|
1085
1093
|
}), () => {
|
|
1086
|
-
const [
|
|
1094
|
+
const [o, f] = e.searchBtnTxt;
|
|
1087
1095
|
return a("div", {
|
|
1088
1096
|
class: "naiZealTableSearch"
|
|
1089
|
-
}, [!e.mobileDrawer || !e.isMobile ? a(
|
|
1097
|
+
}, [!e.mobileDrawer || !e.isMobile ? a(w, null, [n.title?.() ?? a("div", {
|
|
1090
1098
|
class: "naiTitle"
|
|
1091
1099
|
}, [e.title]), a("div", {
|
|
1092
1100
|
class: "searchForm",
|
|
1093
1101
|
style: {
|
|
1094
1102
|
maxHeight: e.searchFormMaxHeight
|
|
1095
1103
|
}
|
|
1096
|
-
}, [a(
|
|
1104
|
+
}, [a(L, {
|
|
1097
1105
|
items: e.searchItems,
|
|
1098
1106
|
preset: "grid",
|
|
1099
1107
|
formConfig: {
|
|
@@ -1101,49 +1109,49 @@ const et = /* @__PURE__ */ I({
|
|
|
1101
1109
|
// showFeedback: false
|
|
1102
1110
|
}
|
|
1103
1111
|
}, null)]), n.searchBtn ? n.searchBtn?.({
|
|
1104
|
-
onSearch:
|
|
1112
|
+
onSearch: m,
|
|
1105
1113
|
onReset: i
|
|
1106
1114
|
}) : a("div", {
|
|
1107
1115
|
class: "searchBtn"
|
|
1108
|
-
}, [a(
|
|
1116
|
+
}, [a(p, {
|
|
1109
1117
|
size: "small",
|
|
1110
1118
|
onClick: i
|
|
1111
|
-
},
|
|
1112
|
-
default: () => [
|
|
1113
|
-
}), a(
|
|
1119
|
+
}, z(o) ? o : {
|
|
1120
|
+
default: () => [o]
|
|
1121
|
+
}), a(p, {
|
|
1114
1122
|
type: "info",
|
|
1115
1123
|
size: "small",
|
|
1116
|
-
onClick:
|
|
1117
|
-
},
|
|
1118
|
-
default: () => [
|
|
1124
|
+
onClick: m
|
|
1125
|
+
}, z(f) ? f : {
|
|
1126
|
+
default: () => [f]
|
|
1119
1127
|
})])]) : a("div", {
|
|
1120
1128
|
class: "drawerSearchBtn"
|
|
1121
1129
|
}, [n.title?.() ?? a("div", {
|
|
1122
1130
|
class: "naiTitle"
|
|
1123
1131
|
}, [e.title]), n.drawerBtn ? n.drawerBtn?.({
|
|
1124
1132
|
openDrawer: () => t(!0)
|
|
1125
|
-
}) : a(
|
|
1133
|
+
}) : a(p, {
|
|
1126
1134
|
size: "small",
|
|
1127
1135
|
onClick: () => {
|
|
1128
1136
|
t(!0);
|
|
1129
1137
|
}
|
|
1130
1138
|
}, {
|
|
1131
1139
|
default: () => [e.drawerOpenTxt]
|
|
1132
|
-
})]), a(
|
|
1140
|
+
})]), a(Te, {
|
|
1133
1141
|
class: "naiZealSearchDrawer",
|
|
1134
1142
|
show: s.value,
|
|
1135
|
-
"onUpdate:show": (
|
|
1143
|
+
"onUpdate:show": (b) => s.value = b,
|
|
1136
1144
|
maxHeight: e.drawerMaxHeight,
|
|
1137
1145
|
trapFocus: !1,
|
|
1138
1146
|
blockScroll: !1,
|
|
1139
1147
|
placement: "top"
|
|
1140
1148
|
}, {
|
|
1141
|
-
default: () => [a(
|
|
1149
|
+
default: () => [a(Fe, {
|
|
1142
1150
|
title: e.drawerTitle ?? e.title
|
|
1143
1151
|
}, {
|
|
1144
1152
|
default: () => [a("div", {
|
|
1145
1153
|
class: "searchForm"
|
|
1146
|
-
}, [a(
|
|
1154
|
+
}, [a(L, {
|
|
1147
1155
|
formConfig: {
|
|
1148
1156
|
labelPlacement: "left",
|
|
1149
1157
|
size: "small"
|
|
@@ -1152,27 +1160,27 @@ const et = /* @__PURE__ */ I({
|
|
|
1152
1160
|
items: e.searchItems
|
|
1153
1161
|
}, null)])],
|
|
1154
1162
|
footer: () => n.searchBtn ? n.searchBtn?.({
|
|
1155
|
-
onSearch:
|
|
1163
|
+
onSearch: m,
|
|
1156
1164
|
onReset: i
|
|
1157
1165
|
}) : a("div", {
|
|
1158
1166
|
class: "searchBtn"
|
|
1159
|
-
}, [a(
|
|
1167
|
+
}, [a(p, {
|
|
1160
1168
|
size: "small",
|
|
1161
1169
|
onClick: i
|
|
1162
|
-
},
|
|
1163
|
-
default: () => [
|
|
1164
|
-
}), a(
|
|
1170
|
+
}, z(o) ? o : {
|
|
1171
|
+
default: () => [o]
|
|
1172
|
+
}), a(p, {
|
|
1165
1173
|
type: "info",
|
|
1166
1174
|
size: "small",
|
|
1167
|
-
onClick:
|
|
1168
|
-
},
|
|
1169
|
-
default: () => [
|
|
1175
|
+
onClick: m
|
|
1176
|
+
}, z(f) ? f : {
|
|
1177
|
+
default: () => [f]
|
|
1170
1178
|
})])
|
|
1171
1179
|
})]
|
|
1172
1180
|
})]);
|
|
1173
1181
|
};
|
|
1174
1182
|
}
|
|
1175
|
-
}),
|
|
1183
|
+
}), at = /* @__PURE__ */ F({
|
|
1176
1184
|
name: "NaiZealTablePaginationControl",
|
|
1177
1185
|
props: {
|
|
1178
1186
|
pagination: {
|
|
@@ -1189,51 +1197,138 @@ const et = /* @__PURE__ */ I({
|
|
|
1189
1197
|
},
|
|
1190
1198
|
slots: Object,
|
|
1191
1199
|
setup(e, {
|
|
1192
|
-
slots:
|
|
1200
|
+
slots: u
|
|
1193
1201
|
}) {
|
|
1194
|
-
const n =
|
|
1202
|
+
const n = ue(e, "pagination");
|
|
1195
1203
|
function l(r) {
|
|
1196
1204
|
n.value.pageNo = r, n.value?.onChange();
|
|
1197
1205
|
}
|
|
1198
1206
|
function s(r) {
|
|
1199
1207
|
n.value.pageNo = 1, n.value.pageSize = r, n.value?.onPageSizeChange();
|
|
1200
1208
|
}
|
|
1201
|
-
return () => a(Ie,
|
|
1209
|
+
return () => a(Ie, A({
|
|
1202
1210
|
page: n.value?.pageNo,
|
|
1203
1211
|
"page-size": n.value?.pageSize,
|
|
1204
1212
|
itemCount: n.value?.total,
|
|
1205
1213
|
pageSizes: n.value?.pageSizes,
|
|
1206
1214
|
pageSlot: n.value?.pageSlot,
|
|
1207
|
-
showSizePicker:
|
|
1215
|
+
showSizePicker: u.prefix && e.isMobile ? !1 : n.value?.showSizePicker,
|
|
1208
1216
|
"onUpdate:page": l,
|
|
1209
1217
|
"onUpdate:pageSize": s
|
|
1210
1218
|
}, e.pageConfig), {
|
|
1211
1219
|
// prefix:({itemCount})=><span>Total {itemCount}</span>
|
|
1212
|
-
...
|
|
1220
|
+
...u
|
|
1213
1221
|
});
|
|
1214
1222
|
}
|
|
1223
|
+
}), nt = /* @__PURE__ */ F({
|
|
1224
|
+
name: "NaiZealTableBtnControl",
|
|
1225
|
+
props: {
|
|
1226
|
+
isMobile: {
|
|
1227
|
+
type: Boolean,
|
|
1228
|
+
default: !1
|
|
1229
|
+
},
|
|
1230
|
+
btnItems: {
|
|
1231
|
+
type: Array,
|
|
1232
|
+
default: () => []
|
|
1233
|
+
},
|
|
1234
|
+
size: {
|
|
1235
|
+
type: String,
|
|
1236
|
+
default: "small"
|
|
1237
|
+
},
|
|
1238
|
+
dropDownProps: {
|
|
1239
|
+
type: Object
|
|
1240
|
+
},
|
|
1241
|
+
dropDownText: {
|
|
1242
|
+
type: String,
|
|
1243
|
+
default: "controls"
|
|
1244
|
+
}
|
|
1245
|
+
},
|
|
1246
|
+
slots: Object,
|
|
1247
|
+
emits: {
|
|
1248
|
+
onSelect: (e) => !0
|
|
1249
|
+
},
|
|
1250
|
+
setup(e, {
|
|
1251
|
+
emit: u,
|
|
1252
|
+
slots: n
|
|
1253
|
+
}) {
|
|
1254
|
+
const l = e.btnItems, {
|
|
1255
|
+
dropDownText: s,
|
|
1256
|
+
size: r
|
|
1257
|
+
} = e, c = (t) => {
|
|
1258
|
+
l.find((i) => i.key === t)?.onSelect?.(t), u("onSelect", t);
|
|
1259
|
+
};
|
|
1260
|
+
return () => a("div", {
|
|
1261
|
+
class: "zealTableBtnControl"
|
|
1262
|
+
}, [e.isMobile ? a(Be, A({
|
|
1263
|
+
size: r,
|
|
1264
|
+
trigger: "click",
|
|
1265
|
+
onSelect: c,
|
|
1266
|
+
options: l.map((t) => ({
|
|
1267
|
+
label: t.title,
|
|
1268
|
+
disabled: t.disabled,
|
|
1269
|
+
key: t.key
|
|
1270
|
+
}))
|
|
1271
|
+
}, e.dropDownProps), {
|
|
1272
|
+
default: () => n.text ? n.text() : a(p, {
|
|
1273
|
+
size: r
|
|
1274
|
+
}, z(s) ? s : {
|
|
1275
|
+
default: () => [s]
|
|
1276
|
+
})
|
|
1277
|
+
}) : l.map((t) => {
|
|
1278
|
+
const {
|
|
1279
|
+
key: i,
|
|
1280
|
+
onSelect: m,
|
|
1281
|
+
title: o,
|
|
1282
|
+
...f
|
|
1283
|
+
} = t;
|
|
1284
|
+
return a(p, A({
|
|
1285
|
+
size: r,
|
|
1286
|
+
key: i,
|
|
1287
|
+
onClick: () => {
|
|
1288
|
+
m?.(i), u("onSelect", i);
|
|
1289
|
+
}
|
|
1290
|
+
}, f), z(o) ? o : {
|
|
1291
|
+
default: () => [o]
|
|
1292
|
+
});
|
|
1293
|
+
})]);
|
|
1294
|
+
}
|
|
1215
1295
|
});
|
|
1296
|
+
function lt(e, u) {
|
|
1297
|
+
const n = x(null), l = B(() => {
|
|
1298
|
+
const s = n.value;
|
|
1299
|
+
return e({
|
|
1300
|
+
isMobile: s?.isMobile ?? x(!1),
|
|
1301
|
+
tableHeight: s?.tableHeight ?? x(0)
|
|
1302
|
+
}).map((r) => ({ ...u, ...r }));
|
|
1303
|
+
});
|
|
1304
|
+
return {
|
|
1305
|
+
naiZealCardRef: n,
|
|
1306
|
+
tableColumns: l
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1216
1309
|
export {
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1310
|
+
Qe as NaiDynamicCascadeInput,
|
|
1311
|
+
L as NaiDynamicForm,
|
|
1312
|
+
Je as NaiDynamicInput,
|
|
1313
|
+
Xe as NaiPopupModal,
|
|
1314
|
+
Ye as NaiZealCard,
|
|
1315
|
+
nt as NaiZealTableBtnControl,
|
|
1316
|
+
at as NaiZealTablePaginationControl,
|
|
1317
|
+
tt as NaiZealTableSearch,
|
|
1224
1318
|
Ue as renderCheckbox,
|
|
1225
|
-
|
|
1226
|
-
|
|
1319
|
+
Me as renderCheckboxGroup,
|
|
1320
|
+
$e as renderDatePicker,
|
|
1227
1321
|
Le as renderDynamicTags,
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1322
|
+
ze as renderInput,
|
|
1323
|
+
Ze as renderInputNumber,
|
|
1324
|
+
je as renderPopSelect,
|
|
1325
|
+
De as renderRadioButtonGroup,
|
|
1326
|
+
Oe as renderRadioGroup,
|
|
1233
1327
|
Pe as renderSelect,
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1328
|
+
Ge as renderSlider,
|
|
1329
|
+
Ve as renderSwitch,
|
|
1330
|
+
He as renderTimePicker,
|
|
1331
|
+
Ae as renderTreeSelect,
|
|
1332
|
+
et as useDecorateForm,
|
|
1333
|
+
lt as useZealColumnTool
|
|
1239
1334
|
};
|