@sunny-base-web/ui 0.0.0 → 0.0.1
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/data/upload/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1122 -999
- package/dist/ui.css +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { getCurrentInstance as Tt, inject as
|
|
2
|
-
import { Modal as
|
|
3
|
-
import { IconifyIcon as
|
|
4
|
-
import { isString as ie, isHttpUrl as
|
|
5
|
-
import { patterns as
|
|
6
|
-
import { ScrollAreaScrollbar as
|
|
7
|
-
import
|
|
8
|
-
import { useStore as
|
|
9
|
-
import { Store as
|
|
10
|
-
import { useBreakpoints as
|
|
11
|
-
import { useForm as
|
|
12
|
-
import { toTypedSchema as
|
|
13
|
-
import * as
|
|
14
|
-
import { VxeGrid as
|
|
15
|
-
import { VxeSelect as
|
|
16
|
-
const Co = /* @__PURE__ */ Symbol("ArcoConfigProvider"),
|
|
1
|
+
import { getCurrentInstance as Tt, inject as Le, defineComponent as O, computed as y, openBlock as w, createElementBlock as A, normalizeStyle as H, normalizeClass as L, createElementVNode as $, useAttrs as pt, ref as T, createBlock as V, unref as p, mergeProps as N, withCtx as _, renderSlot as R, createTextVNode as D, toDisplayString as z, createCommentVNode as M, createVNode as B, withModifiers as Ee, reactive as mt, h as ye, resolveDynamicComponent as ht, normalizeProps as Q, watch as U, withDirectives as Ke, vShow as Xe, Fragment as ce, renderList as ee, resolveComponent as G, createSlots as de, guardReactiveProps as fe, isRef as Ze, toRaw as q, provide as Ne, useSlots as Mt, nextTick as ge, onMounted as Ie, onBeforeUnmount as vt, withKeys as yt, isReactive as Lt } from "vue";
|
|
2
|
+
import { Modal as je, Button as ae, Tooltip as Nt, Upload as ze, Checkbox as ve, Progress as It, Message as W, Select as Re, Option as Dt, TimePicker as Qe, DatePicker as Je, Switch as et, Radio as tt, TreeSelect as Ut, Cascader as Ht, Slider as Wt, Rate as Gt, RangePicker as qt, RadioGroup as Yt, CheckboxGroup as Kt, Textarea as Xt, InputNumber as Zt, InputPassword as Qt, Input as Jt } from "@arco-design/web-vue";
|
|
3
|
+
import { IconifyIcon as eo, IconDefault as to } from "@sunny-base-web/icons";
|
|
4
|
+
import { isString as ie, isHttpUrl as oo, isObject as Y, isFunction as I, cn as De, cloneDeep as me, isBoolean as ke, get as ot, isEqual as no, set as ro } from "@sunny-base-web/utils";
|
|
5
|
+
import { patterns as ll } from "@sunny-base-web/utils";
|
|
6
|
+
import { ScrollAreaScrollbar as so, ScrollAreaThumb as lo, ScrollAreaRoot as ao, ScrollAreaViewport as io, ScrollAreaCorner as co } from "reka-ui";
|
|
7
|
+
import Ce from "axios";
|
|
8
|
+
import { useStore as uo } from "@tanstack/vue-store";
|
|
9
|
+
import { Store as fo } from "@tanstack/store";
|
|
10
|
+
import { useBreakpoints as po, useDebounceFn as mo } from "@vueuse/core";
|
|
11
|
+
import { useForm as gt, defineRule as ho, useFormValues as bt, Field as vo, useFormContext as yo } from "vee-validate";
|
|
12
|
+
import { toTypedSchema as go } from "@vee-validate/zod";
|
|
13
|
+
import * as Is from "zod";
|
|
14
|
+
import { VxeGrid as wt, VxeUI as bo } from "vxe-table";
|
|
15
|
+
import { VxeSelect as wo, VxeInput as So, VxeButton as Te, VxePager as ko } from "vxe-pc-ui";
|
|
16
|
+
const Co = /* @__PURE__ */ Symbol("ArcoConfigProvider"), xo = "arco", $o = "$arco", K = (e) => {
|
|
17
17
|
var t, o, n;
|
|
18
|
-
const r = Tt(),
|
|
19
|
-
return `${(n = (o =
|
|
20
|
-
},
|
|
21
|
-
function
|
|
22
|
-
return
|
|
18
|
+
const r = Tt(), l = Le(Co, void 0);
|
|
19
|
+
return `${(n = (o = l?.prefixCls) != null ? o : (t = r?.appContext.config.globalProperties[$o]) == null ? void 0 : t.classPrefix) != null ? n : xo}-${e}`;
|
|
20
|
+
}, _o = Object.prototype.toString;
|
|
21
|
+
function X(e) {
|
|
22
|
+
return _o.call(e) === "[object Number]" && e === e;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var Z = (e, t) => {
|
|
25
25
|
for (const [o, n] of t)
|
|
26
26
|
e[o] = n;
|
|
27
27
|
return e;
|
|
28
28
|
};
|
|
29
|
-
const
|
|
29
|
+
const Fo = O({
|
|
30
30
|
name: "IconClose",
|
|
31
31
|
props: {
|
|
32
32
|
size: {
|
|
@@ -53,41 +53,41 @@ const Po = O({
|
|
|
53
53
|
click: (e) => !0
|
|
54
54
|
},
|
|
55
55
|
setup(e, { emit: t }) {
|
|
56
|
-
const o =
|
|
57
|
-
const
|
|
58
|
-
return e.size && (
|
|
56
|
+
const o = K("icon"), n = y(() => [o, `${o}-close`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
57
|
+
const s = {};
|
|
58
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
59
59
|
});
|
|
60
60
|
return {
|
|
61
61
|
cls: n,
|
|
62
62
|
innerStyle: r,
|
|
63
|
-
onClick: (
|
|
64
|
-
t("click",
|
|
63
|
+
onClick: (s) => {
|
|
64
|
+
t("click", s);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
}),
|
|
69
|
-
function
|
|
70
|
-
return w(),
|
|
68
|
+
}), Po = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
69
|
+
function Vo(e, t, o, n, r, l) {
|
|
70
|
+
return w(), A("svg", {
|
|
71
71
|
viewBox: "0 0 48 48",
|
|
72
72
|
fill: "none",
|
|
73
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
74
74
|
stroke: "currentColor",
|
|
75
|
-
class:
|
|
76
|
-
style:
|
|
75
|
+
class: L(e.cls),
|
|
76
|
+
style: H(e.innerStyle),
|
|
77
77
|
"stroke-width": e.strokeWidth,
|
|
78
78
|
"stroke-linecap": e.strokeLinecap,
|
|
79
79
|
"stroke-linejoin": e.strokeLinejoin,
|
|
80
|
-
onClick: t[0] || (t[0] = (...
|
|
80
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
81
81
|
}, t[1] || (t[1] = [
|
|
82
|
-
|
|
83
|
-
]), 14,
|
|
82
|
+
$("path", { d: "M9.857 9.858 24 24m0 0 14.142 14.142M24 24 38.142 9.858M24 24 9.857 38.142" }, null, -1)
|
|
83
|
+
]), 14, Po);
|
|
84
84
|
}
|
|
85
|
-
var
|
|
86
|
-
const
|
|
85
|
+
var xe = /* @__PURE__ */ Z(Fo, [["render", Vo]]);
|
|
86
|
+
const Oo = Object.assign(xe, {
|
|
87
87
|
install: (e, t) => {
|
|
88
88
|
var o;
|
|
89
89
|
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
90
|
-
e.component(n +
|
|
90
|
+
e.component(n + xe.name, xe);
|
|
91
91
|
}
|
|
92
92
|
}), Bo = O({
|
|
93
93
|
name: "IconQuestionCircle",
|
|
@@ -116,44 +116,44 @@ const Eo = Object.assign(Ce, {
|
|
|
116
116
|
click: (e) => !0
|
|
117
117
|
},
|
|
118
118
|
setup(e, { emit: t }) {
|
|
119
|
-
const o =
|
|
120
|
-
const
|
|
121
|
-
return e.size && (
|
|
119
|
+
const o = K("icon"), n = y(() => [o, `${o}-question-circle`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
120
|
+
const s = {};
|
|
121
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
122
122
|
});
|
|
123
123
|
return {
|
|
124
124
|
cls: n,
|
|
125
125
|
innerStyle: r,
|
|
126
|
-
onClick: (
|
|
127
|
-
t("click",
|
|
126
|
+
onClick: (s) => {
|
|
127
|
+
t("click", s);
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
}), Ao = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
132
|
-
function
|
|
133
|
-
return w(),
|
|
132
|
+
function Eo(e, t, o, n, r, l) {
|
|
133
|
+
return w(), A("svg", {
|
|
134
134
|
viewBox: "0 0 48 48",
|
|
135
135
|
fill: "none",
|
|
136
136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
137
137
|
stroke: "currentColor",
|
|
138
|
-
class:
|
|
139
|
-
style:
|
|
138
|
+
class: L(e.cls),
|
|
139
|
+
style: H(e.innerStyle),
|
|
140
140
|
"stroke-width": e.strokeWidth,
|
|
141
141
|
"stroke-linecap": e.strokeLinecap,
|
|
142
142
|
"stroke-linejoin": e.strokeLinejoin,
|
|
143
|
-
onClick: t[0] || (t[0] = (...
|
|
143
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
144
144
|
}, t[1] || (t[1] = [
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
$("path", { d: "M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6s18 8.059 18 18Z" }, null, -1),
|
|
146
|
+
$("path", { d: "M24.006 31v4.008m0-6.008L24 28c0-3 3-4 4.78-6.402C30.558 19.195 28.288 15 23.987 15c-4.014 0-5.382 2.548-5.388 4.514v.465" }, null, -1)
|
|
147
147
|
]), 14, Ao);
|
|
148
148
|
}
|
|
149
|
-
var $e = /* @__PURE__ */
|
|
150
|
-
const
|
|
149
|
+
var $e = /* @__PURE__ */ Z(Bo, [["render", Eo]]);
|
|
150
|
+
const St = Object.assign($e, {
|
|
151
151
|
install: (e, t) => {
|
|
152
152
|
var o;
|
|
153
153
|
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
154
154
|
e.component(n + $e.name, $e);
|
|
155
155
|
}
|
|
156
|
-
}),
|
|
156
|
+
}), jo = O({
|
|
157
157
|
name: "IconSearch",
|
|
158
158
|
props: {
|
|
159
159
|
size: {
|
|
@@ -180,44 +180,44 @@ const wt = Object.assign($e, {
|
|
|
180
180
|
click: (e) => !0
|
|
181
181
|
},
|
|
182
182
|
setup(e, { emit: t }) {
|
|
183
|
-
const o =
|
|
184
|
-
const
|
|
185
|
-
return e.size && (
|
|
183
|
+
const o = K("icon"), n = y(() => [o, `${o}-search`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
184
|
+
const s = {};
|
|
185
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
186
186
|
});
|
|
187
187
|
return {
|
|
188
188
|
cls: n,
|
|
189
189
|
innerStyle: r,
|
|
190
|
-
onClick: (
|
|
191
|
-
t("click",
|
|
190
|
+
onClick: (s) => {
|
|
191
|
+
t("click", s);
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
}),
|
|
196
|
-
function
|
|
197
|
-
return w(),
|
|
195
|
+
}), zo = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
196
|
+
function Ro(e, t, o, n, r, l) {
|
|
197
|
+
return w(), A("svg", {
|
|
198
198
|
viewBox: "0 0 48 48",
|
|
199
199
|
fill: "none",
|
|
200
200
|
xmlns: "http://www.w3.org/2000/svg",
|
|
201
201
|
stroke: "currentColor",
|
|
202
|
-
class:
|
|
203
|
-
style:
|
|
202
|
+
class: L(e.cls),
|
|
203
|
+
style: H(e.innerStyle),
|
|
204
204
|
"stroke-width": e.strokeWidth,
|
|
205
205
|
"stroke-linecap": e.strokeLinecap,
|
|
206
206
|
"stroke-linejoin": e.strokeLinejoin,
|
|
207
|
-
onClick: t[0] || (t[0] = (...
|
|
207
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
208
208
|
}, t[1] || (t[1] = [
|
|
209
|
-
|
|
210
|
-
]), 14,
|
|
209
|
+
$("path", { d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485" }, null, -1)
|
|
210
|
+
]), 14, zo);
|
|
211
211
|
}
|
|
212
|
-
var _e = /* @__PURE__ */
|
|
213
|
-
const
|
|
212
|
+
var _e = /* @__PURE__ */ Z(jo, [["render", Ro]]);
|
|
213
|
+
const To = Object.assign(_e, {
|
|
214
214
|
install: (e, t) => {
|
|
215
215
|
var o;
|
|
216
216
|
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
217
217
|
e.component(n + _e.name, _e);
|
|
218
218
|
}
|
|
219
|
-
}),
|
|
220
|
-
name: "
|
|
219
|
+
}), Mo = O({
|
|
220
|
+
name: "IconUpload",
|
|
221
221
|
props: {
|
|
222
222
|
size: {
|
|
223
223
|
type: [Number, String]
|
|
@@ -243,43 +243,169 @@ const zo = Object.assign(_e, {
|
|
|
243
243
|
click: (e) => !0
|
|
244
244
|
},
|
|
245
245
|
setup(e, { emit: t }) {
|
|
246
|
-
const o =
|
|
247
|
-
const
|
|
248
|
-
return e.size && (
|
|
246
|
+
const o = K("icon"), n = y(() => [o, `${o}-upload`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
247
|
+
const s = {};
|
|
248
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
249
249
|
});
|
|
250
250
|
return {
|
|
251
251
|
cls: n,
|
|
252
252
|
innerStyle: r,
|
|
253
|
-
onClick: (
|
|
254
|
-
t("click",
|
|
253
|
+
onClick: (s) => {
|
|
254
|
+
t("click", s);
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
}),
|
|
259
|
-
function
|
|
260
|
-
return w(),
|
|
258
|
+
}), Lo = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
259
|
+
function No(e, t, o, n, r, l) {
|
|
260
|
+
return w(), A("svg", {
|
|
261
261
|
viewBox: "0 0 48 48",
|
|
262
262
|
fill: "none",
|
|
263
263
|
xmlns: "http://www.w3.org/2000/svg",
|
|
264
264
|
stroke: "currentColor",
|
|
265
|
-
class:
|
|
266
|
-
style:
|
|
265
|
+
class: L(e.cls),
|
|
266
|
+
style: H(e.innerStyle),
|
|
267
267
|
"stroke-width": e.strokeWidth,
|
|
268
268
|
"stroke-linecap": e.strokeLinecap,
|
|
269
269
|
"stroke-linejoin": e.strokeLinejoin,
|
|
270
|
-
onClick: t[0] || (t[0] = (...
|
|
270
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
271
271
|
}, t[1] || (t[1] = [
|
|
272
|
-
|
|
273
|
-
]), 14,
|
|
272
|
+
$("path", { d: "M14.93 17.071 24.001 8l9.071 9.071m-9.07 16.071v-25M40 35v6H8v-6" }, null, -1)
|
|
273
|
+
]), 14, Lo);
|
|
274
274
|
}
|
|
275
|
-
var Fe = /* @__PURE__ */
|
|
276
|
-
const
|
|
275
|
+
var Fe = /* @__PURE__ */ Z(Mo, [["render", No]]);
|
|
276
|
+
const Io = Object.assign(Fe, {
|
|
277
277
|
install: (e, t) => {
|
|
278
278
|
var o;
|
|
279
279
|
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
280
280
|
e.component(n + Fe.name, Fe);
|
|
281
281
|
}
|
|
282
|
-
}),
|
|
282
|
+
}), Do = O({
|
|
283
|
+
name: "IconAttachment",
|
|
284
|
+
props: {
|
|
285
|
+
size: {
|
|
286
|
+
type: [Number, String]
|
|
287
|
+
},
|
|
288
|
+
strokeWidth: {
|
|
289
|
+
type: Number,
|
|
290
|
+
default: 4
|
|
291
|
+
},
|
|
292
|
+
strokeLinecap: {
|
|
293
|
+
type: String,
|
|
294
|
+
default: "butt",
|
|
295
|
+
validator: (e) => ["butt", "round", "square"].includes(e)
|
|
296
|
+
},
|
|
297
|
+
strokeLinejoin: {
|
|
298
|
+
type: String,
|
|
299
|
+
default: "miter",
|
|
300
|
+
validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
|
|
301
|
+
},
|
|
302
|
+
rotate: Number,
|
|
303
|
+
spin: Boolean
|
|
304
|
+
},
|
|
305
|
+
emits: {
|
|
306
|
+
click: (e) => !0
|
|
307
|
+
},
|
|
308
|
+
setup(e, { emit: t }) {
|
|
309
|
+
const o = K("icon"), n = y(() => [o, `${o}-attachment`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
310
|
+
const s = {};
|
|
311
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
312
|
+
});
|
|
313
|
+
return {
|
|
314
|
+
cls: n,
|
|
315
|
+
innerStyle: r,
|
|
316
|
+
onClick: (s) => {
|
|
317
|
+
t("click", s);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
}), Uo = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
322
|
+
function Ho(e, t, o, n, r, l) {
|
|
323
|
+
return w(), A("svg", {
|
|
324
|
+
viewBox: "0 0 48 48",
|
|
325
|
+
fill: "none",
|
|
326
|
+
stroke: "currentColor",
|
|
327
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
328
|
+
class: L(e.cls),
|
|
329
|
+
style: H(e.innerStyle),
|
|
330
|
+
"stroke-width": e.strokeWidth,
|
|
331
|
+
"stroke-linecap": e.strokeLinecap,
|
|
332
|
+
"stroke-linejoin": e.strokeLinejoin,
|
|
333
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
334
|
+
}, t[1] || (t[1] = [
|
|
335
|
+
$("path", { d: "M29.037 15.236s-9.174 9.267-11.48 11.594c-2.305 2.327-1.646 4.987-.329 6.316 1.317 1.33 3.994 1.953 6.258-.332L37.32 18.851c3.623-3.657 2.092-8.492 0-10.639-2.093-2.147-6.916-3.657-10.54 0L11.3 23.838c-3.623 3.657-3.953 10.638.329 14.96 4.282 4.322 11.115 4.105 14.821.333 3.706-3.773 8.74-8.822 11.224-11.33" }, null, -1)
|
|
336
|
+
]), 14, Uo);
|
|
337
|
+
}
|
|
338
|
+
var Pe = /* @__PURE__ */ Z(Do, [["render", Ho]]);
|
|
339
|
+
const Wo = Object.assign(Pe, {
|
|
340
|
+
install: (e, t) => {
|
|
341
|
+
var o;
|
|
342
|
+
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
343
|
+
e.component(n + Pe.name, Pe);
|
|
344
|
+
}
|
|
345
|
+
}), Go = O({
|
|
346
|
+
name: "IconDelete",
|
|
347
|
+
props: {
|
|
348
|
+
size: {
|
|
349
|
+
type: [Number, String]
|
|
350
|
+
},
|
|
351
|
+
strokeWidth: {
|
|
352
|
+
type: Number,
|
|
353
|
+
default: 4
|
|
354
|
+
},
|
|
355
|
+
strokeLinecap: {
|
|
356
|
+
type: String,
|
|
357
|
+
default: "butt",
|
|
358
|
+
validator: (e) => ["butt", "round", "square"].includes(e)
|
|
359
|
+
},
|
|
360
|
+
strokeLinejoin: {
|
|
361
|
+
type: String,
|
|
362
|
+
default: "miter",
|
|
363
|
+
validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
|
|
364
|
+
},
|
|
365
|
+
rotate: Number,
|
|
366
|
+
spin: Boolean
|
|
367
|
+
},
|
|
368
|
+
emits: {
|
|
369
|
+
click: (e) => !0
|
|
370
|
+
},
|
|
371
|
+
setup(e, { emit: t }) {
|
|
372
|
+
const o = K("icon"), n = y(() => [o, `${o}-delete`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
373
|
+
const s = {};
|
|
374
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
375
|
+
});
|
|
376
|
+
return {
|
|
377
|
+
cls: n,
|
|
378
|
+
innerStyle: r,
|
|
379
|
+
onClick: (s) => {
|
|
380
|
+
t("click", s);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
}), qo = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
385
|
+
function Yo(e, t, o, n, r, l) {
|
|
386
|
+
return w(), A("svg", {
|
|
387
|
+
viewBox: "0 0 48 48",
|
|
388
|
+
fill: "none",
|
|
389
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
390
|
+
stroke: "currentColor",
|
|
391
|
+
class: L(e.cls),
|
|
392
|
+
style: H(e.innerStyle),
|
|
393
|
+
"stroke-width": e.strokeWidth,
|
|
394
|
+
"stroke-linecap": e.strokeLinecap,
|
|
395
|
+
"stroke-linejoin": e.strokeLinejoin,
|
|
396
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
397
|
+
}, t[1] || (t[1] = [
|
|
398
|
+
$("path", { d: "M5 11h5.5m0 0v29a1 1 0 0 0 1 1h25a1 1 0 0 0 1-1V11m-27 0H16m21.5 0H43m-5.5 0H32m-16 0V7h16v4m-16 0h16M20 18v15m8-15v15" }, null, -1)
|
|
399
|
+
]), 14, qo);
|
|
400
|
+
}
|
|
401
|
+
var Ve = /* @__PURE__ */ Z(Go, [["render", Yo]]);
|
|
402
|
+
const kt = Object.assign(Ve, {
|
|
403
|
+
install: (e, t) => {
|
|
404
|
+
var o;
|
|
405
|
+
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
406
|
+
e.component(n + Ve.name, Ve);
|
|
407
|
+
}
|
|
408
|
+
}), Ko = O({
|
|
283
409
|
name: "IconFullscreenExit",
|
|
284
410
|
props: {
|
|
285
411
|
size: {
|
|
@@ -306,43 +432,43 @@ const Do = Object.assign(Fe, {
|
|
|
306
432
|
click: (e) => !0
|
|
307
433
|
},
|
|
308
434
|
setup(e, { emit: t }) {
|
|
309
|
-
const o =
|
|
310
|
-
const
|
|
311
|
-
return e.size && (
|
|
435
|
+
const o = K("icon"), n = y(() => [o, `${o}-fullscreen-exit`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
436
|
+
const s = {};
|
|
437
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
312
438
|
});
|
|
313
439
|
return {
|
|
314
440
|
cls: n,
|
|
315
441
|
innerStyle: r,
|
|
316
|
-
onClick: (
|
|
317
|
-
t("click",
|
|
442
|
+
onClick: (s) => {
|
|
443
|
+
t("click", s);
|
|
318
444
|
}
|
|
319
445
|
};
|
|
320
446
|
}
|
|
321
|
-
}),
|
|
322
|
-
function
|
|
323
|
-
return w(),
|
|
447
|
+
}), Xo = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
448
|
+
function Zo(e, t, o, n, r, l) {
|
|
449
|
+
return w(), A("svg", {
|
|
324
450
|
viewBox: "0 0 48 48",
|
|
325
451
|
fill: "none",
|
|
326
452
|
xmlns: "http://www.w3.org/2000/svg",
|
|
327
453
|
stroke: "currentColor",
|
|
328
|
-
class:
|
|
329
|
-
style:
|
|
454
|
+
class: L(e.cls),
|
|
455
|
+
style: H(e.innerStyle),
|
|
330
456
|
"stroke-width": e.strokeWidth,
|
|
331
457
|
"stroke-linecap": e.strokeLinecap,
|
|
332
458
|
"stroke-linejoin": e.strokeLinejoin,
|
|
333
|
-
onClick: t[0] || (t[0] = (...
|
|
459
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
334
460
|
}, t[1] || (t[1] = [
|
|
335
|
-
|
|
336
|
-
]), 14,
|
|
461
|
+
$("path", { d: "M35 6v8a1 1 0 0 0 1 1h8M13 6v8a1 1 0 0 1-1 1H4m31 27v-8a1 1 0 0 1 1-1h8m-31 9v-8a1 1 0 0 0-1-1H4" }, null, -1)
|
|
462
|
+
]), 14, Xo);
|
|
337
463
|
}
|
|
338
|
-
var
|
|
339
|
-
const
|
|
464
|
+
var Oe = /* @__PURE__ */ Z(Ko, [["render", Zo]]);
|
|
465
|
+
const Qo = Object.assign(Oe, {
|
|
340
466
|
install: (e, t) => {
|
|
341
467
|
var o;
|
|
342
468
|
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
343
|
-
e.component(n +
|
|
469
|
+
e.component(n + Oe.name, Oe);
|
|
344
470
|
}
|
|
345
|
-
}),
|
|
471
|
+
}), Jo = O({
|
|
346
472
|
name: "IconFullscreen",
|
|
347
473
|
props: {
|
|
348
474
|
size: {
|
|
@@ -369,46 +495,46 @@ const Go = Object.assign(Pe, {
|
|
|
369
495
|
click: (e) => !0
|
|
370
496
|
},
|
|
371
497
|
setup(e, { emit: t }) {
|
|
372
|
-
const o =
|
|
373
|
-
const
|
|
374
|
-
return e.size && (
|
|
498
|
+
const o = K("icon"), n = y(() => [o, `${o}-fullscreen`, { [`${o}-spin`]: e.spin }]), r = y(() => {
|
|
499
|
+
const s = {};
|
|
500
|
+
return e.size && (s.fontSize = X(e.size) ? `${e.size}px` : e.size), e.rotate && (s.transform = `rotate(${e.rotate}deg)`), s;
|
|
375
501
|
});
|
|
376
502
|
return {
|
|
377
503
|
cls: n,
|
|
378
504
|
innerStyle: r,
|
|
379
|
-
onClick: (
|
|
380
|
-
t("click",
|
|
505
|
+
onClick: (s) => {
|
|
506
|
+
t("click", s);
|
|
381
507
|
}
|
|
382
508
|
};
|
|
383
509
|
}
|
|
384
|
-
}),
|
|
385
|
-
function
|
|
386
|
-
return w(),
|
|
510
|
+
}), en = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
|
|
511
|
+
function tn(e, t, o, n, r, l) {
|
|
512
|
+
return w(), A("svg", {
|
|
387
513
|
viewBox: "0 0 48 48",
|
|
388
514
|
fill: "none",
|
|
389
515
|
xmlns: "http://www.w3.org/2000/svg",
|
|
390
516
|
stroke: "currentColor",
|
|
391
|
-
class:
|
|
392
|
-
style:
|
|
517
|
+
class: L(e.cls),
|
|
518
|
+
style: H(e.innerStyle),
|
|
393
519
|
"stroke-width": e.strokeWidth,
|
|
394
520
|
"stroke-linecap": e.strokeLinecap,
|
|
395
521
|
"stroke-linejoin": e.strokeLinejoin,
|
|
396
|
-
onClick: t[0] || (t[0] = (...
|
|
522
|
+
onClick: t[0] || (t[0] = (...s) => e.onClick && e.onClick(...s))
|
|
397
523
|
}, t[1] || (t[1] = [
|
|
398
|
-
|
|
399
|
-
]), 14,
|
|
524
|
+
$("path", { d: "M42 17V9a1 1 0 0 0-1-1h-8M6 17V9a1 1 0 0 1 1-1h8m27 23v8a1 1 0 0 1-1 1h-8M6 31v8a1 1 0 0 0 1 1h8" }, null, -1)
|
|
525
|
+
]), 14, en);
|
|
400
526
|
}
|
|
401
|
-
var
|
|
402
|
-
const
|
|
527
|
+
var Be = /* @__PURE__ */ Z(Jo, [["render", tn]]);
|
|
528
|
+
const on = Object.assign(Be, {
|
|
403
529
|
install: (e, t) => {
|
|
404
530
|
var o;
|
|
405
531
|
const n = (o = t?.iconPrefix) != null ? o : "";
|
|
406
|
-
e.component(n +
|
|
532
|
+
e.component(n + Be.name, Be);
|
|
407
533
|
}
|
|
408
|
-
}),
|
|
534
|
+
}), nn = { class: "flex-1 font-semibold text-base text-[var(--color-text-1)] overflow-hidden text-ellipsis whitespace-nowrap" }, rn = { class: "flex items-center gap-3 ml-3" }, sn = { class: "cursor-pointer text-[var(--color-text-2)] flex items-center justify-center transition-colors duration-200 text-base hover:text-[var(--color-text-1)]" }, ln = {
|
|
409
535
|
key: 1,
|
|
410
536
|
class: "flex items-center justify-end gap-2"
|
|
411
|
-
},
|
|
537
|
+
}, an = /* @__PURE__ */ O({
|
|
412
538
|
__name: "Modal",
|
|
413
539
|
props: {
|
|
414
540
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -434,109 +560,109 @@ const Xo = Object.assign(Ve, {
|
|
|
434
560
|
},
|
|
435
561
|
emits: ["update:modelValue", "close", "ok"],
|
|
436
562
|
setup(e, { emit: t }) {
|
|
437
|
-
const o = e, n = t, r =
|
|
563
|
+
const o = e, n = t, r = pt(), l = T(!1), s = y({
|
|
438
564
|
get: () => o.modelValue,
|
|
439
565
|
set: (u) => n("update:modelValue", u)
|
|
440
|
-
}),
|
|
441
|
-
|
|
442
|
-
},
|
|
566
|
+
}), a = T(!1), m = () => {
|
|
567
|
+
a.value = !a.value;
|
|
568
|
+
}, g = async () => {
|
|
443
569
|
const u = o.onBeforeCancel;
|
|
444
|
-
typeof u == "function" && await u() === !1 || (
|
|
445
|
-
}, v =
|
|
570
|
+
typeof u == "function" && await u() === !1 || (s.value = !1, n("close"));
|
|
571
|
+
}, v = g, i = async () => {
|
|
446
572
|
const u = o.onBeforeOk;
|
|
447
573
|
if (typeof u == "function")
|
|
448
574
|
try {
|
|
449
|
-
|
|
575
|
+
l.value = !0, await u() !== !1 && (n("ok"), s.value = !1);
|
|
450
576
|
} catch (c) {
|
|
451
577
|
console.error(c);
|
|
452
578
|
} finally {
|
|
453
|
-
|
|
579
|
+
l.value = !1;
|
|
454
580
|
}
|
|
455
581
|
else
|
|
456
|
-
n("ok"),
|
|
582
|
+
n("ok"), s.value = !1;
|
|
457
583
|
};
|
|
458
|
-
return (u, c) => (w(), V(p(
|
|
459
|
-
visible:
|
|
460
|
-
"onUpdate:visible": c[0] || (c[0] = (h) =>
|
|
584
|
+
return (u, c) => (w(), V(p(je), N({
|
|
585
|
+
visible: s.value,
|
|
586
|
+
"onUpdate:visible": c[0] || (c[0] = (h) => s.value = h),
|
|
461
587
|
title: e.title,
|
|
462
588
|
width: e.width,
|
|
463
589
|
top: e.top,
|
|
464
590
|
"z-index": e.zIndex,
|
|
465
591
|
"mask-closable": e.closeOnClickModal,
|
|
466
592
|
"esc-to-close": e.closeOnEsc,
|
|
467
|
-
fullscreen:
|
|
593
|
+
fullscreen: a.value,
|
|
468
594
|
closable: !1
|
|
469
595
|
}, u.$attrs, { class: "k-modal-custom" }), {
|
|
470
|
-
title:
|
|
471
|
-
|
|
596
|
+
title: _(() => [
|
|
597
|
+
$("div", {
|
|
472
598
|
class: "flex items-center justify-between w-full",
|
|
473
599
|
onDblclick: m
|
|
474
600
|
}, [
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
D(
|
|
601
|
+
$("div", nn, [
|
|
602
|
+
R(u.$slots, "title", {}, () => [
|
|
603
|
+
D(z(e.title), 1)
|
|
478
604
|
])
|
|
479
605
|
]),
|
|
480
|
-
|
|
481
|
-
e.helpMessage ? (w(), V(p(
|
|
606
|
+
$("div", rn, [
|
|
607
|
+
e.helpMessage ? (w(), V(p(Nt), {
|
|
482
608
|
key: 0,
|
|
483
609
|
content: e.helpMessage
|
|
484
610
|
}, {
|
|
485
|
-
default:
|
|
486
|
-
|
|
487
|
-
|
|
611
|
+
default: _(() => [
|
|
612
|
+
$("div", sn, [
|
|
613
|
+
B(p(St))
|
|
488
614
|
])
|
|
489
615
|
]),
|
|
490
616
|
_: 1
|
|
491
|
-
}, 8, ["content"])) :
|
|
492
|
-
|
|
617
|
+
}, 8, ["content"])) : M("", !0),
|
|
618
|
+
$("div", {
|
|
493
619
|
class: "cursor-pointer text-[var(--color-text-2)] flex items-center justify-center transition-colors duration-200 text-base hover:text-[var(--color-text-1)]",
|
|
494
620
|
onClick: Ee(m, ["stop"])
|
|
495
621
|
}, [
|
|
496
|
-
|
|
622
|
+
a.value ? (w(), V(p(Qo), { key: 0 })) : (w(), V(p(on), { key: 1 }))
|
|
497
623
|
]),
|
|
498
|
-
|
|
624
|
+
$("div", {
|
|
499
625
|
class: "cursor-pointer text-[var(--color-text-2)] flex items-center justify-center transition-colors duration-200 text-base hover:text-[rgb(var(--red-6))]",
|
|
500
|
-
onClick: Ee(
|
|
626
|
+
onClick: Ee(g, ["stop"])
|
|
501
627
|
}, [
|
|
502
|
-
|
|
628
|
+
B(p(Oo))
|
|
503
629
|
])
|
|
504
630
|
])
|
|
505
631
|
], 32)
|
|
506
632
|
]),
|
|
507
|
-
footer:
|
|
508
|
-
u.$slots.footer ?
|
|
509
|
-
|
|
510
|
-
p(r).hideCancel ?
|
|
511
|
-
default:
|
|
512
|
-
D(
|
|
633
|
+
footer: _(() => [
|
|
634
|
+
u.$slots.footer ? R(u.$slots, "footer", { key: 0 }) : (w(), A("div", ln, [
|
|
635
|
+
R(u.$slots, "insertFooter"),
|
|
636
|
+
p(r).hideCancel ? M("", !0) : (w(), V(p(ae), N({ key: 0 }, p(r).cancelButtonProps, { onClick: p(v) }), {
|
|
637
|
+
default: _(() => [
|
|
638
|
+
D(z(p(r).cancelText || "取消"), 1)
|
|
513
639
|
]),
|
|
514
640
|
_: 1
|
|
515
641
|
}, 16, ["onClick"])),
|
|
516
|
-
|
|
517
|
-
|
|
642
|
+
R(u.$slots, "centerFooter"),
|
|
643
|
+
B(p(ae), N({
|
|
518
644
|
type: "primary",
|
|
519
|
-
loading:
|
|
645
|
+
loading: l.value || p(r).okLoading || p(r).confirmLoading
|
|
520
646
|
}, p(r).okButtonProps, { onClick: i }), {
|
|
521
|
-
default:
|
|
522
|
-
D(
|
|
647
|
+
default: _(() => [
|
|
648
|
+
D(z(p(r).okText || "确定"), 1)
|
|
523
649
|
]),
|
|
524
650
|
_: 1
|
|
525
651
|
}, 16, ["loading"]),
|
|
526
|
-
|
|
652
|
+
R(u.$slots, "appendFooter")
|
|
527
653
|
]))
|
|
528
654
|
]),
|
|
529
|
-
default:
|
|
530
|
-
|
|
655
|
+
default: _(() => [
|
|
656
|
+
R(u.$slots, "default")
|
|
531
657
|
]),
|
|
532
658
|
_: 3
|
|
533
659
|
}, 16, ["visible", "title", "width", "top", "z-index", "mask-closable", "esc-to-close", "fullscreen"]));
|
|
534
660
|
}
|
|
535
661
|
});
|
|
536
|
-
class
|
|
662
|
+
class cn {
|
|
537
663
|
state;
|
|
538
664
|
constructor(t = {}) {
|
|
539
|
-
this.state =
|
|
665
|
+
this.state = mt({
|
|
540
666
|
modelValue: !1,
|
|
541
667
|
...t
|
|
542
668
|
});
|
|
@@ -556,47 +682,47 @@ class on {
|
|
|
556
682
|
return this;
|
|
557
683
|
}
|
|
558
684
|
}
|
|
559
|
-
function
|
|
560
|
-
const t = new
|
|
685
|
+
function Hs(e = {}) {
|
|
686
|
+
const t = new cn(e);
|
|
561
687
|
return [O({
|
|
562
688
|
name: "SunnyConnectedModal",
|
|
563
689
|
inheritAttrs: !1,
|
|
564
|
-
setup(n, { attrs: r, slots:
|
|
690
|
+
setup(n, { attrs: r, slots: l }) {
|
|
565
691
|
return () => ye(
|
|
566
|
-
|
|
692
|
+
an,
|
|
567
693
|
{
|
|
568
694
|
...t.state,
|
|
569
695
|
...r,
|
|
570
|
-
"onUpdate:modelValue": (
|
|
571
|
-
t.setState({ modelValue:
|
|
696
|
+
"onUpdate:modelValue": (s) => {
|
|
697
|
+
t.setState({ modelValue: s }), t.state.onVisibleChange?.(s), typeof r["onUpdate:modelValue"] == "function" && r["onUpdate:modelValue"](s);
|
|
572
698
|
}
|
|
573
699
|
},
|
|
574
|
-
|
|
700
|
+
l
|
|
575
701
|
);
|
|
576
702
|
}
|
|
577
703
|
}), t];
|
|
578
704
|
}
|
|
579
|
-
const
|
|
705
|
+
const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
580
706
|
__proto__: null
|
|
581
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
707
|
+
}, Symbol.toStringTag, { value: "Module" })), un = ["src"], dn = /* @__PURE__ */ O({
|
|
582
708
|
__name: "icon",
|
|
583
709
|
props: {
|
|
584
710
|
fallback: { type: Boolean },
|
|
585
711
|
icon: { type: [Function, String] }
|
|
586
712
|
},
|
|
587
713
|
setup(e) {
|
|
588
|
-
const t = e, o =
|
|
714
|
+
const t = e, o = y(() => ie(t.icon) && oo(t.icon)), n = y(() => {
|
|
589
715
|
const { icon: r } = t;
|
|
590
|
-
return !ie(r) && (
|
|
716
|
+
return !ie(r) && (Y(r) || I(r));
|
|
591
717
|
});
|
|
592
|
-
return (r,
|
|
718
|
+
return (r, l) => n.value ? (w(), V(ht(e.icon), Q(N({ key: 0 }, r.$attrs)), null, 16)) : o.value ? (w(), A("img", N({
|
|
593
719
|
key: 1,
|
|
594
720
|
src: e.icon
|
|
595
|
-
}, r.$attrs), null, 16,
|
|
721
|
+
}, r.$attrs), null, 16, un)) : e.icon ? (w(), V(p(eo), N({ key: 2 }, r.$attrs, {
|
|
596
722
|
icon: e.icon
|
|
597
|
-
}), null, 16, ["icon"])) : e.fallback ? (w(), V(p(
|
|
723
|
+
}), null, 16, ["icon"])) : e.fallback ? (w(), V(p(to), Q(N({ key: 3 }, r.$attrs)), null, 16)) : M("", !0);
|
|
598
724
|
}
|
|
599
|
-
}),
|
|
725
|
+
}), Ct = /* @__PURE__ */ O({
|
|
600
726
|
__name: "ScrollBar",
|
|
601
727
|
props: {
|
|
602
728
|
orientation: { default: "vertical" },
|
|
@@ -606,25 +732,25 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
606
732
|
class: {}
|
|
607
733
|
},
|
|
608
734
|
setup(e) {
|
|
609
|
-
const t = e, o =
|
|
735
|
+
const t = e, o = y(() => {
|
|
610
736
|
const { class: n, ...r } = t;
|
|
611
737
|
return r;
|
|
612
738
|
});
|
|
613
|
-
return (n, r) => (w(), V(p(
|
|
614
|
-
class: p(
|
|
739
|
+
return (n, r) => (w(), V(p(so), N(o.value, {
|
|
740
|
+
class: p(De)(
|
|
615
741
|
"flex touch-none select-none transition-colors",
|
|
616
742
|
e.orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-px",
|
|
617
743
|
e.orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-px",
|
|
618
744
|
t.class
|
|
619
745
|
)
|
|
620
746
|
}), {
|
|
621
|
-
default:
|
|
622
|
-
|
|
747
|
+
default: _(() => [
|
|
748
|
+
B(p(lo), { class: "relative flex-1 rounded-full bg-border" })
|
|
623
749
|
]),
|
|
624
750
|
_: 1
|
|
625
751
|
}, 16, ["class"]));
|
|
626
752
|
}
|
|
627
|
-
}),
|
|
753
|
+
}), fn = /* @__PURE__ */ O({
|
|
628
754
|
__name: "ScrollArea",
|
|
629
755
|
props: {
|
|
630
756
|
type: {},
|
|
@@ -638,31 +764,31 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
638
764
|
viewportProps: {}
|
|
639
765
|
},
|
|
640
766
|
setup(e) {
|
|
641
|
-
const t = e, o =
|
|
767
|
+
const t = e, o = y(() => {
|
|
642
768
|
const { class: n, ...r } = t;
|
|
643
769
|
return r;
|
|
644
770
|
});
|
|
645
|
-
return (n, r) => (w(), V(p(
|
|
646
|
-
class: p(
|
|
771
|
+
return (n, r) => (w(), V(p(ao), N(o.value, {
|
|
772
|
+
class: p(De)("relative overflow-hidden", t.class)
|
|
647
773
|
}), {
|
|
648
|
-
default:
|
|
649
|
-
|
|
774
|
+
default: _(() => [
|
|
775
|
+
B(p(io), {
|
|
650
776
|
"as-child": "",
|
|
651
777
|
class: "h-full w-full rounded-[inherit] focus:outline-none",
|
|
652
778
|
onScroll: e.onScroll
|
|
653
779
|
}, {
|
|
654
|
-
default:
|
|
655
|
-
|
|
780
|
+
default: _(() => [
|
|
781
|
+
R(n.$slots, "default")
|
|
656
782
|
]),
|
|
657
783
|
_: 3
|
|
658
784
|
}, 8, ["onScroll"]),
|
|
659
|
-
|
|
660
|
-
|
|
785
|
+
B(Ct),
|
|
786
|
+
B(p(co))
|
|
661
787
|
]),
|
|
662
788
|
_: 3
|
|
663
789
|
}, 16, ["class"]));
|
|
664
790
|
}
|
|
665
|
-
}),
|
|
791
|
+
}), nt = 1, pn = /* @__PURE__ */ O({
|
|
666
792
|
__name: "scrollbar",
|
|
667
793
|
props: {
|
|
668
794
|
class: { default: "" },
|
|
@@ -677,55 +803,55 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
677
803
|
},
|
|
678
804
|
emits: ["scrollAt"],
|
|
679
805
|
setup(e, { emit: t }) {
|
|
680
|
-
const o = e, n = t, r =
|
|
681
|
-
"both-shadow": !
|
|
682
|
-
"left-shadow": !
|
|
683
|
-
"right-shadow": !
|
|
806
|
+
const o = e, n = t, r = T(!0), l = T(!1), s = T(!1), a = T(!0), m = y(() => o.shadow && o.shadowTop), g = y(() => o.shadow && o.shadowBottom), v = y(() => o.shadow && o.shadowLeft), i = y(() => o.shadow && o.shadowRight), u = y(() => ({
|
|
807
|
+
"both-shadow": !a.value && !l.value && v.value && i.value,
|
|
808
|
+
"left-shadow": !a.value && v.value,
|
|
809
|
+
"right-shadow": !l.value && i.value
|
|
684
810
|
}));
|
|
685
811
|
function c(h) {
|
|
686
|
-
const
|
|
687
|
-
r.value = S <= 0,
|
|
688
|
-
bottom:
|
|
689
|
-
left:
|
|
690
|
-
right:
|
|
812
|
+
const b = h.target, S = b?.scrollTop ?? 0, F = b?.scrollLeft ?? 0, x = b?.clientHeight ?? 0, C = b?.clientWidth ?? 0, E = b?.scrollHeight ?? 0, d = b?.scrollWidth ?? 0;
|
|
813
|
+
r.value = S <= 0, a.value = F <= 0, s.value = Math.abs(S) + x >= E - nt, l.value = Math.abs(F) + C >= d - nt, n("scrollAt", {
|
|
814
|
+
bottom: s.value,
|
|
815
|
+
left: a.value,
|
|
816
|
+
right: l.value,
|
|
691
817
|
top: r.value
|
|
692
818
|
});
|
|
693
819
|
}
|
|
694
|
-
return (h,
|
|
695
|
-
class:
|
|
820
|
+
return (h, b) => (w(), V(p(fn), {
|
|
821
|
+
class: L([[p(De)(o.class), u.value], "sunny-scrollbar relative"]),
|
|
696
822
|
"on-scroll": c
|
|
697
823
|
}, {
|
|
698
|
-
default:
|
|
699
|
-
m.value ? (w(),
|
|
824
|
+
default: _(() => [
|
|
825
|
+
m.value ? (w(), A("div", {
|
|
700
826
|
key: 0,
|
|
701
|
-
class:
|
|
827
|
+
class: L([{
|
|
702
828
|
"opacity-100": !r.value,
|
|
703
829
|
"border-t border-border": e.shadowBorder && !r.value
|
|
704
830
|
}, "scrollbar-top-shadow pointer-events-none absolute top-0 z-10 h-12 w-full opacity-0 transition-opacity duration-300 ease-in-out will-change-[opacity]"])
|
|
705
|
-
}, null, 2)) :
|
|
706
|
-
|
|
707
|
-
|
|
831
|
+
}, null, 2)) : M("", !0),
|
|
832
|
+
R(h.$slots, "default", {}, void 0, !0),
|
|
833
|
+
g.value ? (w(), A("div", {
|
|
708
834
|
key: 1,
|
|
709
|
-
class:
|
|
710
|
-
"opacity-100": !r.value && !
|
|
711
|
-
"border-b border-border": e.shadowBorder && !r.value && !
|
|
835
|
+
class: L([{
|
|
836
|
+
"opacity-100": !r.value && !s.value,
|
|
837
|
+
"border-b border-border": e.shadowBorder && !r.value && !s.value
|
|
712
838
|
}, "scrollbar-bottom-shadow pointer-events-none absolute bottom-0 z-10 h-12 w-full opacity-0 transition-opacity duration-300 ease-in-out will-change-[opacity]"])
|
|
713
|
-
}, null, 2)) :
|
|
714
|
-
e.horizontal ? (w(), V(p(
|
|
839
|
+
}, null, 2)) : M("", !0),
|
|
840
|
+
e.horizontal ? (w(), V(p(Ct), {
|
|
715
841
|
key: 2,
|
|
716
|
-
class:
|
|
842
|
+
class: L(e.scrollBarClass),
|
|
717
843
|
orientation: "horizontal"
|
|
718
|
-
}, null, 8, ["class"])) :
|
|
844
|
+
}, null, 8, ["class"])) : M("", !0)
|
|
719
845
|
]),
|
|
720
846
|
_: 3
|
|
721
847
|
}, 8, ["class"]));
|
|
722
848
|
}
|
|
723
|
-
}),
|
|
849
|
+
}), xt = (e, t) => {
|
|
724
850
|
const o = e.__vccOpts || e;
|
|
725
851
|
for (const [n, r] of t)
|
|
726
852
|
o[n] = r;
|
|
727
853
|
return o;
|
|
728
|
-
},
|
|
854
|
+
}, Gs = /* @__PURE__ */ xt(pn, [["__scopeId", "data-v-913bc4ec"]]), mn = { class: "sunny-file-upload" }, hn = { class: "font-bold text-gray-700 mb-2" }, vn = { class: "flex flex-wrap items-center text-sm mb-3 select-none" }, yn = { class: "cursor-pointer text-blue-600 hover:text-blue-700 flex items-center mr-4 transition-colors" }, gn = { class: "text-xs text-blue-600" }, bn = { class: "text-xs text-gray-400" }, wn = { class: "border border-dashed border-gray-300 rounded-lg p-4 transition-all duration-300" }, Sn = { class: "grid grid-cols-1 sm:grid-cols-2 gap-4" }, kn = { class: "flex-1 min-w-0 pr-8" }, Cn = ["title"], xn = { class: "flex items-center text-xs text-gray-500" }, $n = { class: "mr-3 min-w-[3em]" }, _n = { class: "ml-2 w-8 text-right" }, rt = 1024, qs = /* @__PURE__ */ O({
|
|
729
855
|
__name: "index",
|
|
730
856
|
props: {
|
|
731
857
|
modelValue: { default: "" },
|
|
@@ -743,20 +869,20 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
743
869
|
},
|
|
744
870
|
emits: ["update:modelValue", "change"],
|
|
745
871
|
setup(e, { emit: t }) {
|
|
746
|
-
const o = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], n = e, r = t,
|
|
872
|
+
const o = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], n = e, r = t, l = T(!0), s = T(!1), a = T([]), m = T(!1), g = y(() => a.value.every((d) => !!d.url)), v = y(() => a.value.filter((d) => d.checked).length);
|
|
747
873
|
U(() => n.modelValue, (d) => {
|
|
748
874
|
try {
|
|
749
|
-
|
|
875
|
+
a.value = JSON.parse(d || "[]");
|
|
750
876
|
} catch (f) {
|
|
751
|
-
console.warn("Failed to parse modelValue:", f),
|
|
877
|
+
console.warn("Failed to parse modelValue:", f), a.value = [];
|
|
752
878
|
}
|
|
753
879
|
}, { immediate: !0, deep: !0 });
|
|
754
880
|
const i = (d) => d, u = (d) => {
|
|
755
881
|
if (d === 0) return "0 B";
|
|
756
|
-
const f = Math.floor(Math.log(d) / Math.log(
|
|
757
|
-
return (d / Math.pow(
|
|
882
|
+
const f = Math.floor(Math.log(d) / Math.log(rt));
|
|
883
|
+
return (d / Math.pow(rt, f)).toPrecision(3) + " " + o[f];
|
|
758
884
|
}, c = (d) => {
|
|
759
|
-
const f = d.type || "", P = (d.name || "").split(".").pop()?.toLowerCase() || "",
|
|
885
|
+
const f = d.type || "", P = (d.name || "").split(".").pop()?.toLowerCase() || "", j = {
|
|
760
886
|
"vscode-icons:file-type-excel": ["xls", "xlsx", "csv"],
|
|
761
887
|
"vscode-icons:file-type-powerpoint": ["ppt", "pptx"],
|
|
762
888
|
"vscode-icons:file-type-text": ["txt"],
|
|
@@ -764,25 +890,25 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
764
890
|
"vscode-icons:file-type-zip": ["zip", "rar", "7z", "tar", "gz"],
|
|
765
891
|
"vscode-icons:file-type-pdf": ["pdf"]
|
|
766
892
|
};
|
|
767
|
-
for (const [re, pe] of Object.entries(
|
|
893
|
+
for (const [re, pe] of Object.entries(j))
|
|
768
894
|
if (pe.includes(P) || pe.some((Rt) => f.includes(Rt)))
|
|
769
895
|
return re;
|
|
770
896
|
return f.includes("excel") || f.includes("spreadsheet") ? "vscode-icons:file-type-excel" : f.includes("powerpoint") || f.includes("presentation") ? "vscode-icons:file-type-powerpoint" : f.includes("text/plain") ? "vscode-icons:file-type-text" : f.includes("word") || f.includes("document") ? "vscode-icons:file-type-word" : f.includes("zip") || f.includes("compressed") ? "vscode-icons:file-type-zip" : f.includes("pdf") ? "vscode-icons:file-type-pdf" : "vscode-icons:default-file";
|
|
771
897
|
}, h = () => {
|
|
772
|
-
const d = JSON.stringify(
|
|
898
|
+
const d = JSON.stringify(a.value);
|
|
773
899
|
r("update:modelValue", d), r("change", d);
|
|
774
|
-
},
|
|
900
|
+
}, b = (d, f) => {
|
|
775
901
|
if (f.status !== "init") return;
|
|
776
|
-
if (
|
|
777
|
-
|
|
902
|
+
if (a.value.length >= n.limit) {
|
|
903
|
+
W.error(`最多上传${n.limit}个文件`);
|
|
778
904
|
return;
|
|
779
905
|
}
|
|
780
906
|
const k = n.maxSize * 1024 * 1024;
|
|
781
907
|
if (f.file.size > k) {
|
|
782
|
-
|
|
908
|
+
W.error(`文件最大限制${u(k)}`);
|
|
783
909
|
return;
|
|
784
910
|
}
|
|
785
|
-
|
|
911
|
+
a.value.push({
|
|
786
912
|
uid: f.uid,
|
|
787
913
|
name: f.name,
|
|
788
914
|
size: f.file?.size,
|
|
@@ -792,167 +918,164 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
792
918
|
checked: !1
|
|
793
919
|
});
|
|
794
920
|
}, S = async () => {
|
|
795
|
-
if (
|
|
796
|
-
const d =
|
|
921
|
+
if (a.value.length === 0) return;
|
|
922
|
+
const d = a.value.filter((f) => !f.url);
|
|
797
923
|
for (const f of d) {
|
|
798
924
|
const k = new FormData();
|
|
799
|
-
k.append("fileName", f.file), k.append("encryptFile",
|
|
925
|
+
k.append("fileName", f.file), k.append("encryptFile", s.value ? "1" : "0"), n.storeType && k.append("storeType", n.storeType), n.s3FileDir && k.append("s3FileDir", n.s3FileDir), n.preSigned && k.append("preSigned", n.preSigned), n.preSignedExpire && k.append("preSignedExpire", n.preSignedExpire);
|
|
800
926
|
try {
|
|
801
|
-
const P = await
|
|
927
|
+
const P = await Ce.post(n.action, k, {
|
|
802
928
|
onUploadProgress: (re) => {
|
|
803
929
|
if (re.total) {
|
|
804
930
|
const pe = Math.floor(re.loaded / re.total * 100);
|
|
805
931
|
f.percentage = pe;
|
|
806
932
|
}
|
|
807
933
|
}
|
|
808
|
-
}), { data:
|
|
809
|
-
|
|
934
|
+
}), { data: j } = P;
|
|
935
|
+
j.code === 200 ? (Object.assign(f, j.result), W.success(j.message || "上传成功")) : (W.error(j.message || "上传失败"), F(f.uid));
|
|
810
936
|
} catch {
|
|
811
|
-
|
|
937
|
+
W.error("上传失败"), F(f.uid);
|
|
812
938
|
}
|
|
813
939
|
}
|
|
814
940
|
h();
|
|
815
941
|
}, F = (d) => {
|
|
816
|
-
const f =
|
|
817
|
-
f > -1 &&
|
|
818
|
-
},
|
|
819
|
-
d.url ?
|
|
942
|
+
const f = a.value.findIndex((k) => k.uid === d);
|
|
943
|
+
f > -1 && a.value.splice(f, 1);
|
|
944
|
+
}, x = (d, f) => {
|
|
945
|
+
d.url ? je.confirm({
|
|
820
946
|
title: i("提示"),
|
|
821
947
|
content: i("是否删除该文件?"),
|
|
822
948
|
onOk: () => {
|
|
823
|
-
|
|
949
|
+
Ce.post(n.delAction, {
|
|
824
950
|
filePathList: [d.url],
|
|
825
951
|
storeType: n.storeType
|
|
826
952
|
}).then((k) => {
|
|
827
953
|
const { data: P } = k;
|
|
828
|
-
|
|
954
|
+
W[P.success ? "success" : "error"](P.message), P.code === 200 && (a.value.splice(f, 1), h());
|
|
829
955
|
});
|
|
830
956
|
}
|
|
831
|
-
}) : (
|
|
832
|
-
},
|
|
833
|
-
const d =
|
|
834
|
-
|
|
835
|
-
},
|
|
836
|
-
const d =
|
|
837
|
-
d.length !== 0 &&
|
|
957
|
+
}) : (a.value.splice(f, 1), h());
|
|
958
|
+
}, C = () => {
|
|
959
|
+
const d = a.value.every((f) => f.checked);
|
|
960
|
+
a.value.forEach((f) => f.checked = !d);
|
|
961
|
+
}, E = () => {
|
|
962
|
+
const d = a.value.filter((f) => f.checked);
|
|
963
|
+
d.length !== 0 && je.confirm({
|
|
838
964
|
title: i("提示"),
|
|
839
965
|
content: i("是否删除选中的文件?"),
|
|
840
966
|
onOk: () => {
|
|
841
967
|
m.value = !0;
|
|
842
968
|
const f = d.map((k) => k.url).filter(Boolean);
|
|
843
|
-
f.length > 0 ?
|
|
969
|
+
f.length > 0 ? Ce.post(n.delAction, {
|
|
844
970
|
filePathList: f,
|
|
845
971
|
storeType: n.storeType
|
|
846
972
|
}).then((k) => {
|
|
847
973
|
const { data: P } = k;
|
|
848
|
-
|
|
974
|
+
W[P.success ? "success" : "error"](P.message), P.code === 200 && (a.value = a.value.filter((j) => !j.checked), h());
|
|
849
975
|
}).finally(() => {
|
|
850
976
|
m.value = !1;
|
|
851
|
-
}) : (
|
|
977
|
+
}) : (a.value = a.value.filter((k) => !k.checked), h(), m.value = !1);
|
|
852
978
|
}
|
|
853
979
|
});
|
|
854
980
|
};
|
|
855
|
-
return (d, f) => (w(),
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
981
|
+
return (d, f) => (w(), A("div", mn, [
|
|
982
|
+
$("div", hn, z(i("附件")), 1),
|
|
983
|
+
Ke($("div", vn, [
|
|
984
|
+
B(p(ze), {
|
|
859
985
|
"show-file-list": !1,
|
|
860
986
|
"auto-upload": !1,
|
|
861
987
|
multiple: "",
|
|
862
988
|
accept: e.accept,
|
|
863
|
-
onChange:
|
|
989
|
+
onChange: b
|
|
864
990
|
}, {
|
|
865
|
-
"upload-button":
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
D(" " +
|
|
991
|
+
"upload-button": _(() => [
|
|
992
|
+
$("span", yn, [
|
|
993
|
+
B(p(Wo), { class: "mr-1 w-4 h-4" }),
|
|
994
|
+
D(" " + z(i("选择附件")), 1)
|
|
869
995
|
])
|
|
870
996
|
]),
|
|
871
997
|
_: 1
|
|
872
998
|
}, 8, ["accept"]),
|
|
873
|
-
|
|
874
|
-
class:
|
|
875
|
-
onClick: f[0] || (f[0] = (k) => !
|
|
999
|
+
$("span", {
|
|
1000
|
+
class: L(["flex items-center mr-4 transition-colors", g.value ? "text-gray-300 cursor-not-allowed" : "cursor-pointer text-gray-600 hover:text-gray-800"]),
|
|
1001
|
+
onClick: f[0] || (f[0] = (k) => !g.value && S())
|
|
876
1002
|
}, [
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
class: "mr-1 w-4 h-4"
|
|
880
|
-
}, null, 8, ["icon"]),
|
|
881
|
-
D(" " + T(i("上传附件")), 1)
|
|
1003
|
+
B(p(Io), { class: "mr-1 w-4 h-4" }),
|
|
1004
|
+
D(" " + z(i("上传附件")), 1)
|
|
882
1005
|
], 2),
|
|
883
|
-
|
|
1006
|
+
$("span", {
|
|
884
1007
|
class: "cursor-pointer text-blue-600 hover:text-blue-700 mr-4 transition-colors",
|
|
885
|
-
onClick:
|
|
886
|
-
},
|
|
887
|
-
|
|
888
|
-
class:
|
|
889
|
-
onClick:
|
|
890
|
-
},
|
|
1008
|
+
onClick: C
|
|
1009
|
+
}, z(i("全选")), 1),
|
|
1010
|
+
$("span", {
|
|
1011
|
+
class: L(["mr-4 transition-colors", v.value === 0 ? "text-gray-300 cursor-not-allowed" : "cursor-pointer text-gray-500 hover:text-red-500"]),
|
|
1012
|
+
onClick: E
|
|
1013
|
+
}, z(i("删除")), 3),
|
|
891
1014
|
e.showEncrypt ? (w(), V(p(ve), {
|
|
892
1015
|
key: 0,
|
|
893
|
-
modelValue:
|
|
894
|
-
"onUpdate:modelValue": f[1] || (f[1] = (k) =>
|
|
1016
|
+
modelValue: s.value,
|
|
1017
|
+
"onUpdate:modelValue": f[1] || (f[1] = (k) => s.value = k),
|
|
895
1018
|
class: "mr-4"
|
|
896
1019
|
}, {
|
|
897
|
-
default:
|
|
898
|
-
|
|
1020
|
+
default: _(() => [
|
|
1021
|
+
$("span", gn, z(i("是否加密")), 1)
|
|
899
1022
|
]),
|
|
900
1023
|
_: 1
|
|
901
|
-
}, 8, ["modelValue"])) :
|
|
902
|
-
|
|
903
|
-
|
|
1024
|
+
}, 8, ["modelValue"])) : M("", !0),
|
|
1025
|
+
$("span", bn, " (" + z(i("单个文件最大")) + z(e.maxSize) + "MB," + z(i("最多上传")) + z(e.limit) + z(i("个")) + ") ", 1),
|
|
1026
|
+
$("span", {
|
|
904
1027
|
class: "ml-auto cursor-pointer text-blue-600 text-xs hover:text-blue-700 transition-colors",
|
|
905
|
-
onClick: f[2] || (f[2] = (k) =>
|
|
906
|
-
},
|
|
1028
|
+
onClick: f[2] || (f[2] = (k) => l.value = !l.value)
|
|
1029
|
+
}, z(l.value ? i("隐藏") : i("展开")), 1)
|
|
907
1030
|
], 512), [
|
|
908
|
-
[
|
|
1031
|
+
[Xe, !e.readonly]
|
|
909
1032
|
]),
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
(w(!0),
|
|
1033
|
+
Ke($("div", wn, [
|
|
1034
|
+
$("div", Sn, [
|
|
1035
|
+
(w(!0), A(ce, null, ee(a.value, (k, P) => (w(), A("div", {
|
|
913
1036
|
key: k.uid || P,
|
|
914
1037
|
class: "bg-gray-50 hover:bg-gray-100 rounded p-3 relative flex items-center border border-transparent hover:border-gray-200 transition-colors group"
|
|
915
1038
|
}, [
|
|
916
|
-
|
|
1039
|
+
B(p(dn), {
|
|
917
1040
|
icon: c(k),
|
|
918
1041
|
class: "w-10 h-10 mr-3 flex-shrink-0"
|
|
919
1042
|
}, null, 8, ["icon"]),
|
|
920
|
-
|
|
921
|
-
|
|
1043
|
+
$("div", kn, [
|
|
1044
|
+
$("div", {
|
|
922
1045
|
class: "text-sm truncate font-medium text-gray-700 mb-1",
|
|
923
1046
|
title: k.name
|
|
924
|
-
},
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1047
|
+
}, z(k.name), 9, Cn),
|
|
1048
|
+
$("div", xn, [
|
|
1049
|
+
$("span", $n, z(u(k.size)), 1),
|
|
1050
|
+
B(p(It), {
|
|
928
1051
|
percent: k.percentage / 100,
|
|
929
1052
|
size: "small",
|
|
930
1053
|
"show-text": !1,
|
|
931
1054
|
color: k.percentage === 100 ? "#00b42a" : "#165dff",
|
|
932
1055
|
class: "flex-1"
|
|
933
1056
|
}, null, 8, ["percent", "color"]),
|
|
934
|
-
|
|
1057
|
+
$("span", _n, z(k.percentage) + "%", 1)
|
|
935
1058
|
])
|
|
936
1059
|
]),
|
|
937
|
-
e.readonly ?
|
|
1060
|
+
e.readonly ? M("", !0) : (w(), V(p(ve), {
|
|
938
1061
|
key: 0,
|
|
939
1062
|
modelValue: k.checked,
|
|
940
|
-
"onUpdate:modelValue": (
|
|
1063
|
+
"onUpdate:modelValue": (j) => k.checked = j,
|
|
941
1064
|
class: "absolute top-3 right-3"
|
|
942
1065
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])),
|
|
943
|
-
e.readonly ?
|
|
1066
|
+
e.readonly ? M("", !0) : (w(), V(p(kt), {
|
|
944
1067
|
key: 1,
|
|
945
1068
|
class: "absolute bottom-3 right-3 w-4 h-4 cursor-pointer text-gray-400 hover:text-red-500 transition-colors",
|
|
946
|
-
onClick: (
|
|
1069
|
+
onClick: (j) => x(k, P)
|
|
947
1070
|
}, null, 8, ["onClick"]))
|
|
948
1071
|
]))), 128))
|
|
949
1072
|
])
|
|
950
1073
|
], 512), [
|
|
951
|
-
[
|
|
1074
|
+
[Xe, a.value.length > 0 && l.value]
|
|
952
1075
|
])
|
|
953
1076
|
]));
|
|
954
1077
|
}
|
|
955
|
-
}),
|
|
1078
|
+
}), Fn = O({
|
|
956
1079
|
name: "SunnySelect",
|
|
957
1080
|
inheritAttrs: !1,
|
|
958
1081
|
props: {
|
|
@@ -971,49 +1094,49 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
971
1094
|
},
|
|
972
1095
|
emits: ["update:modelValue"],
|
|
973
1096
|
setup(e, { emit: t, slots: o, attrs: n }) {
|
|
974
|
-
const r = (
|
|
975
|
-
const m =
|
|
976
|
-
return !m || Object.keys(m).length === 0 ? !0 : !e.filterModel || Object.keys(e.filterModel).length === 0 ? !1 : Object.entries(m).every(([
|
|
977
|
-
const i = e.filterModel[
|
|
1097
|
+
const r = (a) => {
|
|
1098
|
+
const m = a.cMeta;
|
|
1099
|
+
return !m || Object.keys(m).length === 0 ? !0 : !e.filterModel || Object.keys(e.filterModel).length === 0 ? !1 : Object.entries(m).every(([g, v]) => {
|
|
1100
|
+
const i = e.filterModel[g];
|
|
978
1101
|
return i == null ? !1 : String(i) === String(v);
|
|
979
1102
|
});
|
|
980
|
-
},
|
|
981
|
-
const
|
|
982
|
-
if (
|
|
983
|
-
return
|
|
984
|
-
const m = (
|
|
985
|
-
if (Array.isArray(
|
|
986
|
-
const
|
|
987
|
-
return
|
|
1103
|
+
}, l = y(() => {
|
|
1104
|
+
const a = e.modelValue;
|
|
1105
|
+
if (a == null || a === "" || n["allow-create"] === !0 || n["allow-create"] === "")
|
|
1106
|
+
return a;
|
|
1107
|
+
const m = (g) => e.options.some((v) => r(v) ? v.value == g || typeof g == "object" && g !== null && "value" in g && v.value == g.value : !1);
|
|
1108
|
+
if (Array.isArray(a)) {
|
|
1109
|
+
const g = a.filter((v) => m(v));
|
|
1110
|
+
return g.length === a.length ? a : g;
|
|
988
1111
|
} else
|
|
989
|
-
return m(
|
|
1112
|
+
return m(a) ? a : void 0;
|
|
990
1113
|
});
|
|
991
|
-
U(
|
|
992
|
-
|
|
1114
|
+
U(l, (a) => {
|
|
1115
|
+
a !== e.modelValue && t("update:modelValue", a);
|
|
993
1116
|
});
|
|
994
|
-
const
|
|
995
|
-
t("update:modelValue",
|
|
1117
|
+
const s = (a) => {
|
|
1118
|
+
t("update:modelValue", a);
|
|
996
1119
|
};
|
|
997
1120
|
return () => /* @__PURE__ */ React.createElement(
|
|
998
1121
|
Re,
|
|
999
1122
|
{
|
|
1000
1123
|
...n,
|
|
1001
|
-
modelValue:
|
|
1002
|
-
"onUpdate:modelValue":
|
|
1124
|
+
modelValue: l.value,
|
|
1125
|
+
"onUpdate:modelValue": s
|
|
1003
1126
|
},
|
|
1004
1127
|
{
|
|
1005
|
-
default: () => e.options.map((
|
|
1006
|
-
default: () => o.option ? o.option({ data:
|
|
1128
|
+
default: () => e.options.map((a) => r(a) ? /* @__PURE__ */ React.createElement(Dt, { key: a.value, ...a }, {
|
|
1129
|
+
default: () => o.option ? o.option({ data: a }) : a.label
|
|
1007
1130
|
}) : null),
|
|
1008
1131
|
...Object.fromEntries(
|
|
1009
1132
|
Object.entries(o).filter(
|
|
1010
|
-
([
|
|
1133
|
+
([a]) => a !== "option" && a !== "default"
|
|
1011
1134
|
)
|
|
1012
1135
|
)
|
|
1013
1136
|
}
|
|
1014
1137
|
);
|
|
1015
1138
|
}
|
|
1016
|
-
}),
|
|
1139
|
+
}), Pn = { class: "flex items-center justify-between px-3 py-2 border-b border-[var(--color-neutral-3)] bg-[var(--color-bg-popup)] select-none" }, Vn = { class: "flex items-center gap-1" }, On = { class: "w-6 h-6 flex items-center justify-center rounded cursor-help text-[var(--color-text-3)] hover:text-[var(--color-text-1)] hover:bg-[var(--color-fill-3)] transition-all" }, Ys = /* @__PURE__ */ O({
|
|
1017
1140
|
name: "SunnyBatchSelect",
|
|
1018
1141
|
inheritAttrs: !1,
|
|
1019
1142
|
__name: "BatchSelect",
|
|
@@ -1025,33 +1148,33 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1025
1148
|
},
|
|
1026
1149
|
emits: ["update:modelValue", "change"],
|
|
1027
1150
|
setup(e, { emit: t }) {
|
|
1028
|
-
const o = e, n = t, r =
|
|
1151
|
+
const o = e, n = t, r = y(
|
|
1029
1152
|
() => o.options.filter((i) => !i.disabled)
|
|
1030
|
-
),
|
|
1153
|
+
), l = y(() => r.value.length === 0 ? !1 : r.value.every(
|
|
1031
1154
|
(i) => o.modelValue.includes(i.value)
|
|
1032
|
-
)),
|
|
1155
|
+
)), s = y(() => {
|
|
1033
1156
|
if (r.value.length === 0) return !1;
|
|
1034
1157
|
const i = r.value.filter(
|
|
1035
1158
|
(u) => o.modelValue.includes(u.value)
|
|
1036
1159
|
).length;
|
|
1037
1160
|
return i > 0 && i < r.value.length;
|
|
1038
|
-
}),
|
|
1161
|
+
}), a = (i) => {
|
|
1039
1162
|
n("update:modelValue", i), n("change", i);
|
|
1040
1163
|
}, m = (i) => {
|
|
1041
1164
|
if (i === !0) {
|
|
1042
1165
|
const c = r.value.map((S) => S.value), h = o.modelValue.filter((S) => {
|
|
1043
|
-
const F = o.options.find((
|
|
1166
|
+
const F = o.options.find((x) => x.value === S);
|
|
1044
1167
|
return F && F.disabled;
|
|
1045
|
-
}),
|
|
1046
|
-
n("update:modelValue",
|
|
1168
|
+
}), b = Array.from(/* @__PURE__ */ new Set([...h, ...c]));
|
|
1169
|
+
n("update:modelValue", b), n("change", b);
|
|
1047
1170
|
} else {
|
|
1048
1171
|
const c = o.modelValue.filter((h) => {
|
|
1049
|
-
const
|
|
1050
|
-
return
|
|
1172
|
+
const b = o.options.find((S) => S.value === h);
|
|
1173
|
+
return b && b.disabled;
|
|
1051
1174
|
});
|
|
1052
1175
|
n("update:modelValue", c), n("change", c);
|
|
1053
1176
|
}
|
|
1054
|
-
},
|
|
1177
|
+
}, g = () => {
|
|
1055
1178
|
const i = o.modelValue.filter((u) => {
|
|
1056
1179
|
const c = o.options.find((h) => h.value === u);
|
|
1057
1180
|
return c && c.disabled;
|
|
@@ -1062,79 +1185,79 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1062
1185
|
if (!u) return;
|
|
1063
1186
|
const c = u.getData("text");
|
|
1064
1187
|
if (!c) return;
|
|
1065
|
-
const h = c.split(/\r?\n/).map((
|
|
1188
|
+
const h = c.split(/\r?\n/).map((x) => x.trim()).filter((x) => x);
|
|
1066
1189
|
if (h.length === 0) return;
|
|
1067
|
-
const
|
|
1190
|
+
const b = [];
|
|
1068
1191
|
let S = 0;
|
|
1069
|
-
const F = (
|
|
1070
|
-
const
|
|
1071
|
-
return !
|
|
1072
|
-
const f = o.filterModel[
|
|
1192
|
+
const F = (x) => {
|
|
1193
|
+
const C = x.cMeta;
|
|
1194
|
+
return !C || Object.keys(C).length === 0 ? !0 : !o.filterModel || Object.keys(o.filterModel).length === 0 ? !1 : Object.entries(C).every(([E, d]) => {
|
|
1195
|
+
const f = o.filterModel[E];
|
|
1073
1196
|
return f == null ? !1 : String(f) === String(d);
|
|
1074
1197
|
});
|
|
1075
1198
|
};
|
|
1076
|
-
if (h.forEach((
|
|
1199
|
+
if (h.forEach((x) => {
|
|
1077
1200
|
if (o.matchStrategy === "value" || o.matchStrategy === "both") {
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
|
|
1201
|
+
const C = o.options.find((E) => String(E.value) === x);
|
|
1202
|
+
if (C && !C.disabled && F(C)) {
|
|
1203
|
+
b.push(C.value), S++;
|
|
1081
1204
|
return;
|
|
1082
1205
|
}
|
|
1083
1206
|
}
|
|
1084
1207
|
if (o.matchStrategy === "label" || o.matchStrategy === "both") {
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1208
|
+
const C = o.options.find((E) => E.label === x);
|
|
1209
|
+
C && !C.disabled && F(C) && (b.push(C.value), S++);
|
|
1087
1210
|
}
|
|
1088
|
-
}),
|
|
1211
|
+
}), b.length > 0) {
|
|
1089
1212
|
i.preventDefault();
|
|
1090
|
-
const
|
|
1091
|
-
n("update:modelValue",
|
|
1213
|
+
const x = Array.from(/* @__PURE__ */ new Set([...o.modelValue, ...b]));
|
|
1214
|
+
n("update:modelValue", x), n("change", x), W.success(`成功识别并选中 ${S} 项 (Matched ${S} items)`);
|
|
1092
1215
|
}
|
|
1093
1216
|
};
|
|
1094
1217
|
return (i, u) => {
|
|
1095
|
-
const c =
|
|
1096
|
-
return w(), V(p(
|
|
1218
|
+
const c = G("a-checkbox"), h = G("a-tooltip");
|
|
1219
|
+
return w(), V(p(Fn), N(i.$attrs, {
|
|
1097
1220
|
"model-value": e.modelValue,
|
|
1098
1221
|
options: e.options,
|
|
1099
1222
|
"filter-model": e.filterModel,
|
|
1100
1223
|
multiple: "",
|
|
1101
1224
|
"allow-search": "",
|
|
1102
|
-
"onUpdate:modelValue":
|
|
1225
|
+
"onUpdate:modelValue": a,
|
|
1103
1226
|
onPaste: v
|
|
1104
1227
|
}), de({
|
|
1105
|
-
header:
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
"model-value":
|
|
1109
|
-
indeterminate:
|
|
1228
|
+
header: _(() => [
|
|
1229
|
+
$("div", Pn, [
|
|
1230
|
+
B(c, {
|
|
1231
|
+
"model-value": l.value,
|
|
1232
|
+
indeterminate: s.value,
|
|
1110
1233
|
onChange: m,
|
|
1111
1234
|
class: "pl-1"
|
|
1112
1235
|
}, {
|
|
1113
|
-
default:
|
|
1114
|
-
|
|
1236
|
+
default: _(() => [...u[0] || (u[0] = [
|
|
1237
|
+
$("span", { class: "text-[var(--color-text-1)]" }, "全选", -1)
|
|
1115
1238
|
])]),
|
|
1116
1239
|
_: 1
|
|
1117
1240
|
}, 8, ["model-value", "indeterminate"]),
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
default:
|
|
1121
|
-
|
|
1241
|
+
$("div", Vn, [
|
|
1242
|
+
B(h, { content: "清除所有选中项" }, {
|
|
1243
|
+
default: _(() => [
|
|
1244
|
+
$("div", {
|
|
1122
1245
|
class: "w-6 h-6 flex items-center justify-center rounded cursor-pointer text-[var(--color-text-3)] hover:bg-[var(--color-fill-3)] transition-all",
|
|
1123
|
-
onClick:
|
|
1246
|
+
onClick: g
|
|
1124
1247
|
}, [
|
|
1125
|
-
|
|
1248
|
+
B(p(kt))
|
|
1126
1249
|
])
|
|
1127
1250
|
]),
|
|
1128
1251
|
_: 1
|
|
1129
1252
|
}),
|
|
1130
|
-
u[1] || (u[1] =
|
|
1131
|
-
|
|
1253
|
+
u[1] || (u[1] = $("div", { class: "w-[1px] h-3 bg-[var(--color-neutral-3)] mx-1" }, null, -1)),
|
|
1254
|
+
B(h, {
|
|
1132
1255
|
content: "支持从 Excel 或文本编辑器(↓列数据)复制多行数据,粘贴至搜索框即可自动匹配并选中。",
|
|
1133
1256
|
position: "left"
|
|
1134
1257
|
}, {
|
|
1135
|
-
default:
|
|
1136
|
-
|
|
1137
|
-
|
|
1258
|
+
default: _(() => [
|
|
1259
|
+
$("div", On, [
|
|
1260
|
+
B(p(St))
|
|
1138
1261
|
])
|
|
1139
1262
|
]),
|
|
1140
1263
|
_: 1
|
|
@@ -1144,16 +1267,16 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1144
1267
|
]),
|
|
1145
1268
|
_: 2
|
|
1146
1269
|
}, [
|
|
1147
|
-
|
|
1270
|
+
ee(i.$slots, (b, S) => ({
|
|
1148
1271
|
name: S,
|
|
1149
|
-
fn:
|
|
1150
|
-
|
|
1272
|
+
fn: _((F) => [
|
|
1273
|
+
R(i.$slots, S, Q(fe(F || {})))
|
|
1151
1274
|
])
|
|
1152
1275
|
}))
|
|
1153
1276
|
]), 1040, ["model-value", "options", "filter-model"]);
|
|
1154
1277
|
};
|
|
1155
1278
|
}
|
|
1156
|
-
}),
|
|
1279
|
+
}), Ks = /* @__PURE__ */ O({
|
|
1157
1280
|
name: "SunnySearchInputTag",
|
|
1158
1281
|
inheritAttrs: !1,
|
|
1159
1282
|
__name: "SearchInputTag",
|
|
@@ -1166,26 +1289,26 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1166
1289
|
},
|
|
1167
1290
|
emits: ["update:modelValue", "search", "change", "clear"],
|
|
1168
1291
|
setup(e, { emit: t }) {
|
|
1169
|
-
const o = e, n = t, r =
|
|
1292
|
+
const o = e, n = t, r = y(() => o.fieldNames?.label || "label"), l = y(() => o.fieldNames?.value || "value"), s = y(() => o.modelValue.map((i) => ({
|
|
1170
1293
|
label: i[r.value],
|
|
1171
|
-
value: i[
|
|
1294
|
+
value: i[l.value],
|
|
1172
1295
|
closable: !o.disabled,
|
|
1173
1296
|
tagProps: i.tagProps
|
|
1174
1297
|
// 透传可能存在的 tagProps
|
|
1175
|
-
}))),
|
|
1298
|
+
}))), a = (i) => {
|
|
1176
1299
|
o.disabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(i.key) || i.preventDefault();
|
|
1177
1300
|
}, m = (i, u) => {
|
|
1178
1301
|
const c = [...o.modelValue];
|
|
1179
1302
|
c.splice(u, 1), n("update:modelValue", c), n("change", c);
|
|
1180
|
-
},
|
|
1303
|
+
}, g = () => {
|
|
1181
1304
|
n("update:modelValue", []), n("change", []), n("clear");
|
|
1182
1305
|
}, v = () => {
|
|
1183
1306
|
o.disabled || n("search");
|
|
1184
1307
|
};
|
|
1185
1308
|
return (i, u) => {
|
|
1186
|
-
const c =
|
|
1187
|
-
return w(), V(c,
|
|
1188
|
-
"model-value":
|
|
1309
|
+
const c = G("a-input-tag");
|
|
1310
|
+
return w(), V(c, N(i.$attrs, {
|
|
1311
|
+
"model-value": s.value,
|
|
1189
1312
|
"input-value": "",
|
|
1190
1313
|
disabled: e.disabled,
|
|
1191
1314
|
placeholder: e.placeholder,
|
|
@@ -1193,32 +1316,32 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1193
1316
|
"allow-create": !1,
|
|
1194
1317
|
class: "w-full group",
|
|
1195
1318
|
onRemove: m,
|
|
1196
|
-
onClear:
|
|
1197
|
-
onKeydown:
|
|
1319
|
+
onClear: g,
|
|
1320
|
+
onKeydown: a
|
|
1198
1321
|
}), de({
|
|
1199
|
-
suffix:
|
|
1200
|
-
|
|
1201
|
-
class:
|
|
1322
|
+
suffix: _(() => [
|
|
1323
|
+
$("div", {
|
|
1324
|
+
class: L(["flex items-center h-full px-2 border-l border-[var(--color-neutral-3)] group-hover:border-[var(--color-neutral-4)] -mr-3", [
|
|
1202
1325
|
e.disabled ? "cursor-not-allowed text-[var(--color-text-4)]" : "cursor-pointer text-[var(--color-text-2)] group"
|
|
1203
1326
|
]]),
|
|
1204
1327
|
onClick: Ee(v, ["stop"])
|
|
1205
1328
|
}, [
|
|
1206
|
-
|
|
1329
|
+
B(p(To), { class: "transition-colors group-hover:text-[var(--color-primary-6)]" })
|
|
1207
1330
|
], 2)
|
|
1208
1331
|
]),
|
|
1209
1332
|
_: 2
|
|
1210
1333
|
}, [
|
|
1211
|
-
|
|
1212
|
-
name:
|
|
1213
|
-
fn:
|
|
1214
|
-
|
|
1334
|
+
ee(i.$slots, (h, b) => ({
|
|
1335
|
+
name: b,
|
|
1336
|
+
fn: _((S) => [
|
|
1337
|
+
R(i.$slots, b, Q(fe(S || {})))
|
|
1215
1338
|
])
|
|
1216
1339
|
}))
|
|
1217
1340
|
]), 1040, ["model-value", "disabled", "placeholder", "max-tag-count"]);
|
|
1218
1341
|
};
|
|
1219
1342
|
}
|
|
1220
1343
|
});
|
|
1221
|
-
class
|
|
1344
|
+
class Bn {
|
|
1222
1345
|
// 核心 TanStack Store 实例 / Core TanStack Store instance
|
|
1223
1346
|
store;
|
|
1224
1347
|
/**
|
|
@@ -1229,7 +1352,7 @@ class Cn {
|
|
|
1229
1352
|
* @param options 配置项 / Configuration options
|
|
1230
1353
|
*/
|
|
1231
1354
|
constructor(t, o) {
|
|
1232
|
-
this.store = new
|
|
1355
|
+
this.store = new fo(t), o?.onUpdate && this.store.subscribe(() => {
|
|
1233
1356
|
o.onUpdate?.();
|
|
1234
1357
|
});
|
|
1235
1358
|
}
|
|
@@ -1258,31 +1381,31 @@ class Cn {
|
|
|
1258
1381
|
return this.store.state;
|
|
1259
1382
|
}
|
|
1260
1383
|
}
|
|
1261
|
-
function
|
|
1384
|
+
function st(e, t = "YYYY-MM-DD") {
|
|
1262
1385
|
if (!e) return e;
|
|
1263
1386
|
if (I(e.format))
|
|
1264
1387
|
return e.format(t);
|
|
1265
1388
|
if (e instanceof Date) {
|
|
1266
|
-
const o = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"),
|
|
1267
|
-
return t.replace("YYYY", String(o)).replace("MM", n).replace("DD", r).replace("HH",
|
|
1389
|
+
const o = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"), l = String(e.getHours()).padStart(2, "0"), s = String(e.getMinutes()).padStart(2, "0"), a = String(e.getSeconds()).padStart(2, "0");
|
|
1390
|
+
return t.replace("YYYY", String(o)).replace("MM", n).replace("DD", r).replace("HH", l).replace("mm", s).replace("ss", a);
|
|
1268
1391
|
}
|
|
1269
1392
|
return String(e);
|
|
1270
1393
|
}
|
|
1271
|
-
function
|
|
1394
|
+
function lt(e) {
|
|
1272
1395
|
return is(e, "Date");
|
|
1273
1396
|
}
|
|
1274
1397
|
function at(e) {
|
|
1275
|
-
return
|
|
1398
|
+
return Y(e) && "$d" in e && "$y" in e && "$M" in e;
|
|
1276
1399
|
}
|
|
1277
1400
|
function he(e, t) {
|
|
1278
|
-
if (!
|
|
1401
|
+
if (!Y(e) || !Y(t) || Array.isArray(t)) return t;
|
|
1279
1402
|
const o = { ...e };
|
|
1280
1403
|
return Object.keys(t).forEach((n) => {
|
|
1281
|
-
const r = o[n],
|
|
1282
|
-
|
|
1404
|
+
const r = o[n], l = t[n];
|
|
1405
|
+
Y(r) && Y(l) ? o[n] = he(r, l) : o[n] = l;
|
|
1283
1406
|
}), o;
|
|
1284
1407
|
}
|
|
1285
|
-
class
|
|
1408
|
+
class An {
|
|
1286
1409
|
condition = !1;
|
|
1287
1410
|
resolveFn = null;
|
|
1288
1411
|
promise = null;
|
|
@@ -1298,14 +1421,14 @@ class $n {
|
|
|
1298
1421
|
})), await this.promise);
|
|
1299
1422
|
}
|
|
1300
1423
|
}
|
|
1301
|
-
function
|
|
1424
|
+
function En(e) {
|
|
1302
1425
|
const t = Object.getPrototypeOf(e), o = Object.getOwnPropertyNames(t);
|
|
1303
1426
|
for (const n of o) {
|
|
1304
1427
|
const r = e[n];
|
|
1305
1428
|
n !== "constructor" && typeof r == "function" && (e[n] = r.bind(e));
|
|
1306
1429
|
}
|
|
1307
1430
|
}
|
|
1308
|
-
function
|
|
1431
|
+
function jn() {
|
|
1309
1432
|
return {
|
|
1310
1433
|
actionWrapperClass: "",
|
|
1311
1434
|
collapsed: !1,
|
|
@@ -1329,7 +1452,7 @@ function Fn() {
|
|
|
1329
1452
|
values: {}
|
|
1330
1453
|
};
|
|
1331
1454
|
}
|
|
1332
|
-
class
|
|
1455
|
+
class zn {
|
|
1333
1456
|
// vee-validate 表单上下文
|
|
1334
1457
|
form = {};
|
|
1335
1458
|
// 是否已挂载
|
|
@@ -1351,8 +1474,8 @@ class Pn {
|
|
|
1351
1474
|
// 上一次的状态 (用于 Diff)
|
|
1352
1475
|
prevState = null;
|
|
1353
1476
|
constructor(t = {}) {
|
|
1354
|
-
const { ...o } = t, n =
|
|
1355
|
-
this.store = new
|
|
1477
|
+
const { ...o } = t, n = jn();
|
|
1478
|
+
this.store = new Bn(
|
|
1356
1479
|
{
|
|
1357
1480
|
...n,
|
|
1358
1481
|
...o
|
|
@@ -1362,7 +1485,7 @@ class Pn {
|
|
|
1362
1485
|
this.prevState = this.state, this.state = this.store.getState(), this.updateState();
|
|
1363
1486
|
}
|
|
1364
1487
|
}
|
|
1365
|
-
), this.state = this.store.getState(), this.stateHandler = new
|
|
1488
|
+
), this.state = this.store.getState(), this.stateHandler = new An(), En(this);
|
|
1366
1489
|
}
|
|
1367
1490
|
/**
|
|
1368
1491
|
* 获取字段组件实例
|
|
@@ -1375,7 +1498,7 @@ class Pn {
|
|
|
1375
1498
|
let o = this.componentRefMap.has(t) ? this.componentRefMap.get(t) : void 0;
|
|
1376
1499
|
if (o && o.$ && o.$.type && o.$.type.name === "AsyncComponentWrapper" && o.$.subTree && o.$.subTree.ref) {
|
|
1377
1500
|
const n = o.$.subTree.ref;
|
|
1378
|
-
Array.isArray(n) ? n.length > 0 && n[0] &&
|
|
1501
|
+
Array.isArray(n) ? n.length > 0 && n[0] && Ze(n[0].r) && (o = n[0].r.value) : Ze(n.r) && (o = n.r.value);
|
|
1379
1502
|
}
|
|
1380
1503
|
return o;
|
|
1381
1504
|
}
|
|
@@ -1432,17 +1555,17 @@ class Pn {
|
|
|
1432
1555
|
*/
|
|
1433
1556
|
merge(t) {
|
|
1434
1557
|
const o = [this, t], n = new Proxy(t, {
|
|
1435
|
-
get(r,
|
|
1436
|
-
return
|
|
1558
|
+
get(r, l) {
|
|
1559
|
+
return l === "merge" ? (s) => (o.push(s), n) : l === "submitAllForm" ? async (s = !0) => {
|
|
1437
1560
|
try {
|
|
1438
|
-
const
|
|
1439
|
-
o.map(async (m) => (await m.validate()).valid ?
|
|
1561
|
+
const a = await Promise.all(
|
|
1562
|
+
o.map(async (m) => (await m.validate()).valid ? q(await m.getValues() || {}) : void 0)
|
|
1440
1563
|
);
|
|
1441
|
-
return
|
|
1442
|
-
} catch (
|
|
1443
|
-
console.error("Validation error:",
|
|
1564
|
+
return a.some((m) => !m) ? void 0 : s ? Object.assign({}, ...a) : a;
|
|
1565
|
+
} catch (a) {
|
|
1566
|
+
console.error("Validation error:", a);
|
|
1444
1567
|
}
|
|
1445
|
-
} : r[
|
|
1568
|
+
} : r[l];
|
|
1446
1569
|
}
|
|
1447
1570
|
});
|
|
1448
1571
|
return n;
|
|
@@ -1456,7 +1579,7 @@ class Pn {
|
|
|
1456
1579
|
*/
|
|
1457
1580
|
mount(t, o) {
|
|
1458
1581
|
this.isMounted || (Object.assign(this.form, t), this.stateHandler.setConditionTrue(), this.setLatestSubmissionValues({
|
|
1459
|
-
...
|
|
1582
|
+
...q(this.handleRangeTimeValue(this.form.values))
|
|
1460
1583
|
}), o && (this.componentRefMap = o), this.isMounted = !0);
|
|
1461
1584
|
}
|
|
1462
1585
|
/**
|
|
@@ -1464,7 +1587,7 @@ class Pn {
|
|
|
1464
1587
|
* Remove schema by fields
|
|
1465
1588
|
*/
|
|
1466
1589
|
async removeSchemaByFields(t) {
|
|
1467
|
-
const o = new Set(t), r = (this.state?.schema ?? []).filter((
|
|
1590
|
+
const o = new Set(t), r = (this.state?.schema ?? []).filter((l) => !o.has(l.fieldName));
|
|
1468
1591
|
this.setState({
|
|
1469
1592
|
schema: r
|
|
1470
1593
|
});
|
|
@@ -1519,7 +1642,7 @@ class Pn {
|
|
|
1519
1642
|
* Set latest submission values
|
|
1520
1643
|
*/
|
|
1521
1644
|
setLatestSubmissionValues(t) {
|
|
1522
|
-
this.latestSubmissionValues = { ...
|
|
1645
|
+
this.latestSubmissionValues = { ...q(t) };
|
|
1523
1646
|
}
|
|
1524
1647
|
/**
|
|
1525
1648
|
* 更新状态
|
|
@@ -1542,16 +1665,16 @@ class Pn {
|
|
|
1542
1665
|
r.setValues(t, n);
|
|
1543
1666
|
return;
|
|
1544
1667
|
}
|
|
1545
|
-
const
|
|
1668
|
+
const l = r.values || {}, s = (m, g) => {
|
|
1546
1669
|
const v = {};
|
|
1547
1670
|
for (const i in m)
|
|
1548
|
-
if (Object.prototype.hasOwnProperty.call(m, i) && i in
|
|
1549
|
-
const u = m[i], c =
|
|
1550
|
-
|
|
1671
|
+
if (Object.prototype.hasOwnProperty.call(m, i) && i in g) {
|
|
1672
|
+
const u = m[i], c = g[i];
|
|
1673
|
+
Y(u) && !Array.isArray(u) && !lt(u) && !at(u) && Y(c) && !Array.isArray(c) && !lt(c) && !at(c) ? v[i] = s(u, c) : v[i] = u;
|
|
1551
1674
|
}
|
|
1552
1675
|
return v;
|
|
1553
|
-
},
|
|
1554
|
-
r.setValues(
|
|
1676
|
+
}, a = s(t, l);
|
|
1677
|
+
r.setValues(a, n);
|
|
1555
1678
|
}
|
|
1556
1679
|
/**
|
|
1557
1680
|
* 提交表单
|
|
@@ -1559,8 +1682,8 @@ class Pn {
|
|
|
1559
1682
|
*/
|
|
1560
1683
|
async submitForm(t) {
|
|
1561
1684
|
t?.preventDefault(), t?.stopPropagation();
|
|
1562
|
-
const o = await this.getForm(), { valid: n, errors: r } = await o.validate(),
|
|
1563
|
-
return n ? await this.state?.handleSubmit?.(
|
|
1685
|
+
const o = await this.getForm(), { valid: n, errors: r } = await o.validate(), l = q(await this.getValues());
|
|
1686
|
+
return n ? await this.state?.handleSubmit?.(l) : this.state?.scrollToFirstError && this.scrollToFirstError(r), { valid: n, values: l, errors: r };
|
|
1564
1687
|
}
|
|
1565
1688
|
/**
|
|
1566
1689
|
* 卸载表单
|
|
@@ -1576,20 +1699,20 @@ class Pn {
|
|
|
1576
1699
|
updateSchema(t) {
|
|
1577
1700
|
const o = [...t];
|
|
1578
1701
|
if (!o.every(
|
|
1579
|
-
(
|
|
1702
|
+
(s) => Reflect.has(s, "fieldName") && s.fieldName
|
|
1580
1703
|
)) {
|
|
1581
1704
|
console.error(
|
|
1582
1705
|
"All items in the schema array must have a valid `fieldName` property to be updated"
|
|
1583
1706
|
);
|
|
1584
1707
|
return;
|
|
1585
1708
|
}
|
|
1586
|
-
const r = me(this.state?.schema ?? []),
|
|
1587
|
-
o.forEach((
|
|
1588
|
-
|
|
1589
|
-
}), r.forEach((
|
|
1590
|
-
const m = s
|
|
1591
|
-
m && (r[
|
|
1592
|
-
|
|
1709
|
+
const r = me(this.state?.schema ?? []), l = {};
|
|
1710
|
+
o.forEach((s) => {
|
|
1711
|
+
s.fieldName && (l[s.fieldName] = s);
|
|
1712
|
+
}), r.forEach((s, a) => {
|
|
1713
|
+
const m = l[s.fieldName];
|
|
1714
|
+
m && (r[a] = he(
|
|
1715
|
+
s,
|
|
1593
1716
|
m
|
|
1594
1717
|
));
|
|
1595
1718
|
}), this.setState({ schema: r });
|
|
@@ -1642,37 +1765,37 @@ class Pn {
|
|
|
1642
1765
|
const o = this.state?.arrayToStringFields;
|
|
1643
1766
|
if (!o || !Array.isArray(o))
|
|
1644
1767
|
return;
|
|
1645
|
-
const n = (r,
|
|
1646
|
-
this.processFields(r,
|
|
1647
|
-
if (Array.isArray(
|
|
1648
|
-
return
|
|
1649
|
-
if (typeof
|
|
1650
|
-
if (
|
|
1768
|
+
const n = (r, l = ",") => {
|
|
1769
|
+
this.processFields(r, l, t, (s, a) => {
|
|
1770
|
+
if (Array.isArray(s))
|
|
1771
|
+
return s.join(a);
|
|
1772
|
+
if (typeof s == "string") {
|
|
1773
|
+
if (s === "")
|
|
1651
1774
|
return [];
|
|
1652
|
-
const m =
|
|
1775
|
+
const m = a.replaceAll(
|
|
1653
1776
|
/[.*+?^${}()|[\]\\]/g,
|
|
1654
1777
|
String.raw`\$&`
|
|
1655
1778
|
);
|
|
1656
|
-
return
|
|
1779
|
+
return s.split(new RegExp(m));
|
|
1657
1780
|
} else
|
|
1658
|
-
return
|
|
1781
|
+
return s;
|
|
1659
1782
|
});
|
|
1660
1783
|
};
|
|
1661
1784
|
if (o.every((r) => typeof r == "string")) {
|
|
1662
|
-
const r = o[o.length - 1] || "",
|
|
1663
|
-
n(
|
|
1785
|
+
const r = o[o.length - 1] || "", l = r.length === 1 ? o.slice(0, -1) : o, s = r.length === 1 ? r : ",";
|
|
1786
|
+
n(l, s);
|
|
1664
1787
|
return;
|
|
1665
1788
|
}
|
|
1666
1789
|
o.forEach((r) => {
|
|
1667
1790
|
if (Array.isArray(r)) {
|
|
1668
|
-
const [
|
|
1669
|
-
if (!Array.isArray(
|
|
1791
|
+
const [l, s = ","] = r;
|
|
1792
|
+
if (!Array.isArray(l)) {
|
|
1670
1793
|
console.warn(
|
|
1671
|
-
`Invalid field configuration: fields should be an array of strings, got ${typeof
|
|
1794
|
+
`Invalid field configuration: fields should be an array of strings, got ${typeof l}`
|
|
1672
1795
|
);
|
|
1673
1796
|
return;
|
|
1674
1797
|
}
|
|
1675
|
-
n(
|
|
1798
|
+
n(l, s);
|
|
1676
1799
|
}
|
|
1677
1800
|
});
|
|
1678
1801
|
};
|
|
@@ -1683,19 +1806,19 @@ class Pn {
|
|
|
1683
1806
|
handleRangeTimeValue = (t) => {
|
|
1684
1807
|
const o = { ...t }, n = this.state?.fieldMappingTime;
|
|
1685
1808
|
return this.handleMultiFields(o), !n || !Array.isArray(n) || n.forEach(
|
|
1686
|
-
([r, [
|
|
1687
|
-
if (
|
|
1809
|
+
([r, [l, s], a = "YYYY-MM-DD"]) => {
|
|
1810
|
+
if (l && s && o[r] === null && (Reflect.deleteProperty(o, l), Reflect.deleteProperty(o, s)), !o[r]) {
|
|
1688
1811
|
Reflect.deleteProperty(o, r);
|
|
1689
1812
|
return;
|
|
1690
1813
|
}
|
|
1691
|
-
const [m,
|
|
1692
|
-
if (
|
|
1693
|
-
o[
|
|
1694
|
-
else if (I(
|
|
1695
|
-
o[
|
|
1814
|
+
const [m, g] = o[r];
|
|
1815
|
+
if (a === null)
|
|
1816
|
+
o[l] = m, o[s] = g;
|
|
1817
|
+
else if (I(a))
|
|
1818
|
+
o[l] = a(m), o[s] = a(g);
|
|
1696
1819
|
else {
|
|
1697
|
-
const [v, i] = Array.isArray(
|
|
1698
|
-
o[
|
|
1820
|
+
const [v, i] = Array.isArray(a) ? a : [a, a];
|
|
1821
|
+
o[l] = m ? st(m, v) : void 0, o[s] = g ? st(g, i) : void 0;
|
|
1699
1822
|
}
|
|
1700
1823
|
Reflect.deleteProperty(o, r);
|
|
1701
1824
|
}
|
|
@@ -1706,9 +1829,9 @@ class Pn {
|
|
|
1706
1829
|
* Process fields helper
|
|
1707
1830
|
*/
|
|
1708
1831
|
processFields = (t, o, n, r) => {
|
|
1709
|
-
t.forEach((
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1832
|
+
t.forEach((l) => {
|
|
1833
|
+
const s = n[l];
|
|
1834
|
+
s != null && (n[l] = r(s, o));
|
|
1712
1835
|
});
|
|
1713
1836
|
};
|
|
1714
1837
|
/**
|
|
@@ -1719,31 +1842,31 @@ class Pn {
|
|
|
1719
1842
|
const t = this.state?.schema ?? [], o = this.prevState?.schema ?? [];
|
|
1720
1843
|
if (t.length < o.length) {
|
|
1721
1844
|
const n = new Set(
|
|
1722
|
-
t.map((
|
|
1845
|
+
t.map((l) => l.fieldName)
|
|
1723
1846
|
), r = o.filter(
|
|
1724
|
-
(
|
|
1847
|
+
(l) => !n.has(l.fieldName)
|
|
1725
1848
|
);
|
|
1726
|
-
for (const
|
|
1727
|
-
this.form?.setFieldValue?.(
|
|
1849
|
+
for (const l of r)
|
|
1850
|
+
this.form?.setFieldValue?.(l.fieldName, void 0);
|
|
1728
1851
|
}
|
|
1729
1852
|
}
|
|
1730
1853
|
// 类型定义占位,实际在 useSunnyForm 中注入实现
|
|
1731
1854
|
// Type definition placeholder, actual implementation injected in useSunnyForm
|
|
1732
1855
|
useStore;
|
|
1733
1856
|
}
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1736
|
-
},
|
|
1737
|
-
const e =
|
|
1857
|
+
const $t = /* @__PURE__ */ Symbol("FormRenderProps"), Rn = /* @__PURE__ */ Symbol("ComponentRefMap"), Tn = (e) => {
|
|
1858
|
+
Ne($t, e);
|
|
1859
|
+
}, Ue = () => {
|
|
1860
|
+
const e = Le($t);
|
|
1738
1861
|
if (!e)
|
|
1739
1862
|
throw new Error(
|
|
1740
1863
|
"injectRenderFormProps must be used within provideFormRenderProps"
|
|
1741
1864
|
);
|
|
1742
1865
|
return e;
|
|
1743
|
-
},
|
|
1744
|
-
|
|
1745
|
-
},
|
|
1746
|
-
const e =
|
|
1866
|
+
}, Mn = (e) => {
|
|
1867
|
+
Ne(Rn, e);
|
|
1868
|
+
}, _t = () => {
|
|
1869
|
+
const e = Ue(), t = y(
|
|
1747
1870
|
() => e.layout === "vertical"
|
|
1748
1871
|
);
|
|
1749
1872
|
return {
|
|
@@ -1751,71 +1874,71 @@ const xt = /* @__PURE__ */ Symbol("FormRenderProps"), Vn = /* @__PURE__ */ Symbo
|
|
|
1751
1874
|
isVertical: t,
|
|
1752
1875
|
// 转发配置中的映射,方便子组件使用
|
|
1753
1876
|
// Forward mappings from config for child components
|
|
1754
|
-
componentBindEventMap:
|
|
1877
|
+
componentBindEventMap: y(() => e.config?.modelPropNameMap)
|
|
1755
1878
|
// 这里如果需要 componentMap,通常从 config.ts 或 props 传递,
|
|
1756
1879
|
// 但在原参考代码中是通过 import 的。为了解耦,这里可以不返回,
|
|
1757
1880
|
// 或者在 Form.vue 中处理。
|
|
1758
1881
|
// In reference code, componentMap is imported. We can stick to that.
|
|
1759
1882
|
};
|
|
1760
|
-
},
|
|
1761
|
-
function
|
|
1762
|
-
|
|
1883
|
+
}, Ft = /* @__PURE__ */ Symbol("FormPropsKey");
|
|
1884
|
+
function Pt(e) {
|
|
1885
|
+
Ne(Ft, e);
|
|
1763
1886
|
}
|
|
1764
|
-
function
|
|
1765
|
-
const e =
|
|
1887
|
+
function Ln() {
|
|
1888
|
+
const e = Le(Ft);
|
|
1766
1889
|
if (!e)
|
|
1767
1890
|
throw new Error("Form context not found (表单上下文未找到,请确保在 SunnyForm 或 SunnyUseForm 内部使用)");
|
|
1768
1891
|
return e;
|
|
1769
1892
|
}
|
|
1770
|
-
function
|
|
1771
|
-
const t =
|
|
1772
|
-
const
|
|
1773
|
-
return (
|
|
1774
|
-
|
|
1775
|
-
}),
|
|
1776
|
-
}), n =
|
|
1893
|
+
function Nn(e) {
|
|
1894
|
+
const t = Mt(), o = y(() => {
|
|
1895
|
+
const l = p(e), s = {};
|
|
1896
|
+
return (l.schema || []).forEach((a) => {
|
|
1897
|
+
a.defaultValue !== void 0 && (s[a.fieldName] = a.defaultValue);
|
|
1898
|
+
}), l.values && Object.assign(s, l.values), s;
|
|
1899
|
+
}), n = gt({
|
|
1777
1900
|
initialValues: o.value
|
|
1778
|
-
}), r =
|
|
1779
|
-
const
|
|
1780
|
-
for (const
|
|
1781
|
-
|
|
1782
|
-
return
|
|
1901
|
+
}), r = y(() => {
|
|
1902
|
+
const l = [];
|
|
1903
|
+
for (const s of Object.keys(t))
|
|
1904
|
+
s !== "default" && l.push(s);
|
|
1905
|
+
return l;
|
|
1783
1906
|
});
|
|
1784
1907
|
return {
|
|
1785
1908
|
form: n,
|
|
1786
1909
|
delegatedSlots: r
|
|
1787
1910
|
};
|
|
1788
1911
|
}
|
|
1789
|
-
const
|
|
1790
|
-
Input:
|
|
1791
|
-
InputPassword:
|
|
1792
|
-
InputNumber:
|
|
1793
|
-
Textarea:
|
|
1912
|
+
const In = {
|
|
1913
|
+
Input: Jt,
|
|
1914
|
+
InputPassword: Qt,
|
|
1915
|
+
InputNumber: Zt,
|
|
1916
|
+
Textarea: Xt,
|
|
1794
1917
|
Select: Re,
|
|
1795
1918
|
Checkbox: ve,
|
|
1796
|
-
CheckboxGroup:
|
|
1797
|
-
Radio:
|
|
1798
|
-
RadioGroup:
|
|
1799
|
-
Switch:
|
|
1800
|
-
DatePicker:
|
|
1801
|
-
RangePicker:
|
|
1802
|
-
TimePicker:
|
|
1803
|
-
Upload:
|
|
1804
|
-
Rate:
|
|
1805
|
-
Slider:
|
|
1806
|
-
Cascader:
|
|
1807
|
-
TreeSelect:
|
|
1919
|
+
CheckboxGroup: Kt,
|
|
1920
|
+
Radio: tt,
|
|
1921
|
+
RadioGroup: Yt,
|
|
1922
|
+
Switch: et,
|
|
1923
|
+
DatePicker: Je,
|
|
1924
|
+
RangePicker: qt,
|
|
1925
|
+
TimePicker: Qe,
|
|
1926
|
+
Upload: ze,
|
|
1927
|
+
Rate: Gt,
|
|
1928
|
+
Slider: Wt,
|
|
1929
|
+
Cascader: Ht,
|
|
1930
|
+
TreeSelect: Ut,
|
|
1808
1931
|
// Mentions,
|
|
1809
1932
|
// Alias for prefix if needed, or map to same
|
|
1810
1933
|
SunnySelect: Re,
|
|
1811
1934
|
SunnyCheckbox: ve,
|
|
1812
|
-
SunnyRadio:
|
|
1813
|
-
SunnySwitch:
|
|
1814
|
-
SunnyDatePicker:
|
|
1815
|
-
SunnyTimePicker:
|
|
1816
|
-
SunnyUpload:
|
|
1817
|
-
},
|
|
1818
|
-
function
|
|
1935
|
+
SunnyRadio: tt,
|
|
1936
|
+
SunnySwitch: et,
|
|
1937
|
+
SunnyDatePicker: Je,
|
|
1938
|
+
SunnyTimePicker: Qe,
|
|
1939
|
+
SunnyUpload: ze
|
|
1940
|
+
}, Dn = {};
|
|
1941
|
+
function Xs(e) {
|
|
1819
1942
|
const { config: t, defineRules: o } = e, {
|
|
1820
1943
|
// 默认禁用 change 事件监听 (Arco 组件通常不需要手动监听 change)
|
|
1821
1944
|
// Default disable change listener (Arco components usually don't need manual change listener)
|
|
@@ -1825,22 +1948,22 @@ function Us(e) {
|
|
|
1825
1948
|
disabledOnInputListener: r = !0,
|
|
1826
1949
|
// 空状态时的默认值 (通常为 undefined)
|
|
1827
1950
|
// Default value for empty state (Usually undefined)
|
|
1828
|
-
emptyStateValue:
|
|
1951
|
+
emptyStateValue: l = void 0
|
|
1829
1952
|
} = t || {};
|
|
1830
|
-
if (Object.assign(
|
|
1953
|
+
if (Object.assign(Dn, {
|
|
1831
1954
|
disabledOnChangeListener: n,
|
|
1832
1955
|
disabledOnInputListener: r,
|
|
1833
|
-
emptyStateValue:
|
|
1956
|
+
emptyStateValue: l
|
|
1834
1957
|
}), o)
|
|
1835
|
-
for (const
|
|
1836
|
-
|
|
1958
|
+
for (const s of Object.keys(o))
|
|
1959
|
+
ho(s, o[s]);
|
|
1837
1960
|
}
|
|
1838
|
-
function
|
|
1839
|
-
const t =
|
|
1961
|
+
function Un(e) {
|
|
1962
|
+
const t = bt(), n = Ue().form;
|
|
1840
1963
|
if (!t)
|
|
1841
1964
|
throw new Error("useDependencies should be used within <SunnyForm> (VeeValidate Form)");
|
|
1842
|
-
const r =
|
|
1843
|
-
|
|
1965
|
+
const r = T(!0), l = T(!1), s = T(!0), a = T(!1), m = T({}), g = T(), v = y(() => (e()?.triggerFields ?? []).map((c) => t.value[c])), i = () => {
|
|
1966
|
+
l.value = !1, r.value = !0, s.value = !0, a.value = !1, g.value = void 0, m.value = {};
|
|
1844
1967
|
};
|
|
1845
1968
|
return U(
|
|
1846
1969
|
[v, e],
|
|
@@ -1850,57 +1973,57 @@ function jn(e) {
|
|
|
1850
1973
|
i();
|
|
1851
1974
|
const {
|
|
1852
1975
|
componentProps: h,
|
|
1853
|
-
disabled:
|
|
1976
|
+
disabled: b,
|
|
1854
1977
|
if: S,
|
|
1855
1978
|
required: F,
|
|
1856
|
-
rules:
|
|
1857
|
-
show:
|
|
1858
|
-
trigger:
|
|
1979
|
+
rules: x,
|
|
1980
|
+
show: C,
|
|
1981
|
+
trigger: E
|
|
1859
1982
|
// 自定义触发器
|
|
1860
1983
|
} = c, d = t.value;
|
|
1861
1984
|
if (I(S)) {
|
|
1862
1985
|
if (r.value = !!await S(d, n), !r.value) return;
|
|
1863
1986
|
} else if (ke(S) && (r.value = S, !r.value))
|
|
1864
1987
|
return;
|
|
1865
|
-
if (I(
|
|
1866
|
-
if (
|
|
1867
|
-
} else if (ke(
|
|
1988
|
+
if (I(C)) {
|
|
1989
|
+
if (s.value = !!await C(d, n), !s.value) return;
|
|
1990
|
+
} else if (ke(C) && (s.value = C, !s.value))
|
|
1868
1991
|
return;
|
|
1869
|
-
I(h) && (m.value = await h(d, n)), I(
|
|
1992
|
+
I(h) && (m.value = await h(d, n)), I(x) && (g.value = await x(d, n)), I(b) ? l.value = !!await b(d, n) : ke(b) && (l.value = b), I(F) && (a.value = !!await F(d, n)), I(E) && await E(d, n);
|
|
1870
1993
|
},
|
|
1871
1994
|
{ deep: !0, immediate: !0 }
|
|
1872
1995
|
), {
|
|
1873
1996
|
dynamicComponentProps: m,
|
|
1874
|
-
dynamicRules:
|
|
1875
|
-
isDisabled:
|
|
1997
|
+
dynamicRules: g,
|
|
1998
|
+
isDisabled: l,
|
|
1876
1999
|
isIf: r,
|
|
1877
|
-
isRequired:
|
|
1878
|
-
isShow:
|
|
2000
|
+
isRequired: a,
|
|
2001
|
+
isShow: s
|
|
1879
2002
|
};
|
|
1880
2003
|
}
|
|
1881
|
-
const
|
|
2004
|
+
const Hn = /* @__PURE__ */ O({
|
|
1882
2005
|
__name: "FormField",
|
|
1883
2006
|
props: {
|
|
1884
2007
|
schema: {}
|
|
1885
2008
|
},
|
|
1886
2009
|
setup(e) {
|
|
1887
|
-
const t = e, o =
|
|
1888
|
-
dynamicComponentProps:
|
|
2010
|
+
const t = e, o = bt(), n = Ue(), { isVertical: r } = _t(), l = n.form, {
|
|
2011
|
+
dynamicComponentProps: s,
|
|
1889
2012
|
// 动态组件属性
|
|
1890
|
-
dynamicRules:
|
|
2013
|
+
dynamicRules: a,
|
|
1891
2014
|
// 动态验证规则
|
|
1892
2015
|
isDisabled: m,
|
|
1893
2016
|
// 是否禁用
|
|
1894
|
-
isIf:
|
|
2017
|
+
isIf: g,
|
|
1895
2018
|
// 是否渲染 (v-if)
|
|
1896
2019
|
isRequired: v,
|
|
1897
2020
|
// 是否必填
|
|
1898
2021
|
isShow: i
|
|
1899
2022
|
// 是否显示 (v-show)
|
|
1900
|
-
} =
|
|
2023
|
+
} = Un(() => t.schema.dependencies), u = y(() => {
|
|
1901
2024
|
const { component: d } = t.schema;
|
|
1902
|
-
return ie(d) &&
|
|
1903
|
-
}), c =
|
|
2025
|
+
return ie(d) && In[d] || d;
|
|
2026
|
+
}), c = y(() => t.schema.hidden ? !1 : g.value && i.value), h = y(() => a.value || t.schema.rules), b = y(() => {
|
|
1904
2027
|
if (!c.value)
|
|
1905
2028
|
return !1;
|
|
1906
2029
|
if (!h.value)
|
|
@@ -1911,32 +2034,32 @@ const Mn = /* @__PURE__ */ O({
|
|
|
1911
2034
|
return h.value.split("|").some(
|
|
1912
2035
|
(P) => ["required", "selectRequired"].includes(P)
|
|
1913
2036
|
);
|
|
1914
|
-
const d =
|
|
2037
|
+
const d = q(h.value);
|
|
1915
2038
|
let f = d?.isOptional?.();
|
|
1916
2039
|
if (d?._def?.typeName === "ZodDefault") {
|
|
1917
2040
|
const P = d?._def.innerType;
|
|
1918
2041
|
P && (f = P.isOptional?.());
|
|
1919
2042
|
}
|
|
1920
2043
|
return !f;
|
|
1921
|
-
}), S =
|
|
2044
|
+
}), S = y(() => {
|
|
1922
2045
|
if (!c.value)
|
|
1923
2046
|
return null;
|
|
1924
|
-
let d =
|
|
2047
|
+
let d = q(h.value);
|
|
1925
2048
|
if (!d)
|
|
1926
2049
|
return v.value ? "required" : null;
|
|
1927
2050
|
if (ie(d))
|
|
1928
2051
|
return d;
|
|
1929
|
-
if (!!
|
|
2052
|
+
if (!!b.value) {
|
|
1930
2053
|
const k = d?.unwrap?.();
|
|
1931
2054
|
k && (d = k);
|
|
1932
2055
|
}
|
|
1933
|
-
return
|
|
1934
|
-
}), F =
|
|
1935
|
-
const { componentProps: d, commonComponentProps: f } = t.schema, k = I(d) ? d(o.value,
|
|
2056
|
+
return go(d);
|
|
2057
|
+
}), F = y(() => {
|
|
2058
|
+
const { componentProps: d, commonComponentProps: f } = t.schema, k = I(d) ? d(o.value, l) : d;
|
|
1936
2059
|
return {
|
|
1937
2060
|
...f,
|
|
1938
2061
|
...k,
|
|
1939
|
-
...
|
|
2062
|
+
...s.value
|
|
1940
2063
|
};
|
|
1941
2064
|
});
|
|
1942
2065
|
U(
|
|
@@ -1947,14 +2070,14 @@ const Mn = /* @__PURE__ */ O({
|
|
|
1947
2070
|
},
|
|
1948
2071
|
{ immediate: !0 }
|
|
1949
2072
|
);
|
|
1950
|
-
const
|
|
2073
|
+
const x = y(() => m.value || t.schema.disabled || F.value?.disabled), C = y(() => {
|
|
1951
2074
|
if (!(r.value || !t.schema.labelWidth))
|
|
1952
2075
|
return {
|
|
1953
2076
|
style: {
|
|
1954
2077
|
flex: 1
|
|
1955
2078
|
}
|
|
1956
2079
|
};
|
|
1957
|
-
}),
|
|
2080
|
+
}), E = y(() => {
|
|
1958
2081
|
if (r.value || !t.schema.labelWidth)
|
|
1959
2082
|
return;
|
|
1960
2083
|
const d = t.schema.labelWidth, f = typeof d == "number" ? `${d}px` : d;
|
|
@@ -1968,25 +2091,25 @@ const Mn = /* @__PURE__ */ O({
|
|
|
1968
2091
|
};
|
|
1969
2092
|
});
|
|
1970
2093
|
return (d, f) => {
|
|
1971
|
-
const k =
|
|
1972
|
-
return c.value ? (w(), V(p(
|
|
2094
|
+
const k = G("a-form-item");
|
|
2095
|
+
return c.value ? (w(), V(p(vo), {
|
|
1973
2096
|
key: 0,
|
|
1974
2097
|
name: e.schema.fieldName,
|
|
1975
2098
|
rules: S.value,
|
|
1976
2099
|
label: e.schema.label
|
|
1977
2100
|
}, {
|
|
1978
|
-
default:
|
|
1979
|
-
|
|
2101
|
+
default: _(({ field: P, errorMessage: j }) => [
|
|
2102
|
+
B(k, N({
|
|
1980
2103
|
label: e.schema.label,
|
|
1981
|
-
help:
|
|
1982
|
-
"validate-status":
|
|
1983
|
-
required:
|
|
1984
|
-
"label-col-props":
|
|
1985
|
-
"wrapper-col-props":
|
|
2104
|
+
help: j || e.schema.help,
|
|
2105
|
+
"validate-status": j ? "error" : void 0,
|
|
2106
|
+
required: b.value,
|
|
2107
|
+
"label-col-props": E.value,
|
|
2108
|
+
"wrapper-col-props": C.value
|
|
1986
2109
|
}, e.schema.formFieldProps), {
|
|
1987
|
-
default:
|
|
1988
|
-
(w(), V(
|
|
1989
|
-
disabled:
|
|
2110
|
+
default: _(() => [
|
|
2111
|
+
(w(), V(ht(u.value), N({ ...F.value, ...P }, {
|
|
2112
|
+
disabled: x.value,
|
|
1990
2113
|
"model-value": P.value,
|
|
1991
2114
|
"onUpdate:modelValue": P.onInput
|
|
1992
2115
|
}), null, 16, ["disabled", "model-value", "onUpdate:modelValue"]))
|
|
@@ -1995,10 +2118,10 @@ const Mn = /* @__PURE__ */ O({
|
|
|
1995
2118
|
}, 1040, ["label", "help", "validate-status", "required", "label-col-props", "wrapper-col-props"])
|
|
1996
2119
|
]),
|
|
1997
2120
|
_: 1
|
|
1998
|
-
}, 8, ["name", "rules", "label"])) :
|
|
2121
|
+
}, 8, ["name", "rules", "label"])) : M("", !0);
|
|
1999
2122
|
};
|
|
2000
2123
|
}
|
|
2001
|
-
}),
|
|
2124
|
+
}), Me = /* @__PURE__ */ O({
|
|
2002
2125
|
__name: "form-actions",
|
|
2003
2126
|
props: {
|
|
2004
2127
|
modelValue: { type: Boolean },
|
|
@@ -2006,53 +2129,53 @@ const Mn = /* @__PURE__ */ O({
|
|
|
2006
2129
|
},
|
|
2007
2130
|
emits: ["update:modelValue"],
|
|
2008
2131
|
setup(e, { expose: t, emit: o }) {
|
|
2009
|
-
const n = e, r = o, { props:
|
|
2132
|
+
const n = e, r = o, { props: l } = _t(), s = yo(), a = y({
|
|
2010
2133
|
get: () => n.modelValue ?? !1,
|
|
2011
2134
|
set: (c) => r("update:modelValue", c)
|
|
2012
|
-
}), m =
|
|
2135
|
+
}), m = y(() => ({
|
|
2013
2136
|
content: "重置",
|
|
2014
2137
|
show: !0,
|
|
2015
2138
|
type: "outline",
|
|
2016
|
-
...p(
|
|
2017
|
-
})),
|
|
2139
|
+
...p(l).resetButtonOptions
|
|
2140
|
+
})), g = y(() => ({
|
|
2018
2141
|
content: "查询",
|
|
2019
2142
|
show: !0,
|
|
2020
2143
|
// 如果有 formApi,使用普通按钮类型,手动触发提交逻辑
|
|
2021
2144
|
// 否则使用 submit 类型,利用表单的原生提交机制
|
|
2022
2145
|
htmlType: n.formApi ? "button" : "submit",
|
|
2023
|
-
...p(
|
|
2146
|
+
...p(l).submitButtonOptions
|
|
2024
2147
|
}));
|
|
2025
2148
|
async function v(c) {
|
|
2026
2149
|
if (n.formApi) {
|
|
2027
2150
|
c?.preventDefault(), c?.stopPropagation();
|
|
2028
|
-
const h = p(
|
|
2029
|
-
if (!
|
|
2151
|
+
const h = p(l), { valid: b } = await n.formApi.validate();
|
|
2152
|
+
if (!b)
|
|
2030
2153
|
return;
|
|
2031
|
-
const S =
|
|
2154
|
+
const S = q(await n.formApi.getValues()) ?? {};
|
|
2032
2155
|
await h.handleSubmit?.(S);
|
|
2033
2156
|
}
|
|
2034
2157
|
}
|
|
2035
2158
|
async function i(c) {
|
|
2036
2159
|
c?.preventDefault(), c?.stopPropagation();
|
|
2037
|
-
const h = p(
|
|
2160
|
+
const h = p(l);
|
|
2038
2161
|
if (n.formApi) {
|
|
2039
|
-
const
|
|
2040
|
-
h.handleReset ? await h.handleReset(
|
|
2041
|
-
} else if (
|
|
2162
|
+
const b = q(await n.formApi.getValues()) ?? {};
|
|
2163
|
+
h.handleReset ? await h.handleReset(b) : n.formApi.resetForm();
|
|
2164
|
+
} else if (s)
|
|
2042
2165
|
if (h.handleReset) {
|
|
2043
|
-
const
|
|
2044
|
-
await h.handleReset(
|
|
2166
|
+
const b = s.values;
|
|
2167
|
+
await h.handleReset(b);
|
|
2045
2168
|
} else
|
|
2046
|
-
|
|
2169
|
+
s.resetForm();
|
|
2047
2170
|
}
|
|
2048
2171
|
U(
|
|
2049
|
-
() =>
|
|
2172
|
+
() => a.value,
|
|
2050
2173
|
() => {
|
|
2051
|
-
p(
|
|
2174
|
+
p(l).collapseTriggerResize && window.dispatchEvent(new Event("resize"));
|
|
2052
2175
|
}
|
|
2053
2176
|
);
|
|
2054
|
-
const u =
|
|
2055
|
-
const c = p(
|
|
2177
|
+
const u = y(() => {
|
|
2178
|
+
const c = p(l), h = c.actionPosition || "right", b = [
|
|
2056
2179
|
"flex",
|
|
2057
2180
|
"items-center",
|
|
2058
2181
|
"gap-3",
|
|
@@ -2065,155 +2188,155 @@ const Mn = /* @__PURE__ */ O({
|
|
|
2065
2188
|
];
|
|
2066
2189
|
switch (h) {
|
|
2067
2190
|
case "center": {
|
|
2068
|
-
|
|
2191
|
+
b.push("justify-center");
|
|
2069
2192
|
break;
|
|
2070
2193
|
}
|
|
2071
2194
|
case "left": {
|
|
2072
|
-
|
|
2195
|
+
b.push("justify-start");
|
|
2073
2196
|
break;
|
|
2074
2197
|
}
|
|
2075
2198
|
default: {
|
|
2076
|
-
|
|
2199
|
+
b.push("justify-end");
|
|
2077
2200
|
break;
|
|
2078
2201
|
}
|
|
2079
2202
|
}
|
|
2080
|
-
return
|
|
2203
|
+
return b.join(" ");
|
|
2081
2204
|
});
|
|
2082
2205
|
return t({
|
|
2083
2206
|
handleReset: i,
|
|
2084
2207
|
handleSubmit: v
|
|
2085
|
-
}), (c, h) => (w(),
|
|
2086
|
-
class:
|
|
2208
|
+
}), (c, h) => (w(), A("div", {
|
|
2209
|
+
class: L(u.value)
|
|
2087
2210
|
}, [
|
|
2088
|
-
p(p(
|
|
2089
|
-
|
|
2090
|
-
|
|
2211
|
+
p(p(l)).actionButtonsReverse ? M("", !0) : (w(), A(ce, { key: 0 }, [
|
|
2212
|
+
R(c.$slots, "submit-before"),
|
|
2213
|
+
g.value.show ? (w(), V(p(ae), N({
|
|
2091
2214
|
key: 0,
|
|
2092
2215
|
type: "primary",
|
|
2093
|
-
size: p(p(
|
|
2216
|
+
size: p(p(l)).size,
|
|
2094
2217
|
onClick: v
|
|
2095
|
-
},
|
|
2096
|
-
default:
|
|
2097
|
-
D(
|
|
2218
|
+
}, g.value), {
|
|
2219
|
+
default: _(() => [
|
|
2220
|
+
D(z(g.value.content), 1)
|
|
2098
2221
|
]),
|
|
2099
2222
|
_: 1
|
|
2100
|
-
}, 16, ["size"])) :
|
|
2223
|
+
}, 16, ["size"])) : M("", !0)
|
|
2101
2224
|
], 64)),
|
|
2102
|
-
|
|
2103
|
-
m.value.show ? (w(), V(p(
|
|
2225
|
+
R(c.$slots, "reset-before"),
|
|
2226
|
+
m.value.show ? (w(), V(p(ae), N({
|
|
2104
2227
|
key: 1,
|
|
2105
|
-
size: p(p(
|
|
2228
|
+
size: p(p(l)).size,
|
|
2106
2229
|
onClick: i
|
|
2107
2230
|
}, m.value), {
|
|
2108
|
-
default:
|
|
2109
|
-
D(
|
|
2231
|
+
default: _(() => [
|
|
2232
|
+
D(z(m.value.content), 1)
|
|
2110
2233
|
]),
|
|
2111
2234
|
_: 1
|
|
2112
|
-
}, 16, ["size"])) :
|
|
2113
|
-
p(p(
|
|
2114
|
-
|
|
2115
|
-
|
|
2235
|
+
}, 16, ["size"])) : M("", !0),
|
|
2236
|
+
p(p(l)).actionButtonsReverse ? (w(), A(ce, { key: 2 }, [
|
|
2237
|
+
R(c.$slots, "submit-before"),
|
|
2238
|
+
g.value.show ? (w(), V(p(ae), N({
|
|
2116
2239
|
key: 0,
|
|
2117
2240
|
type: "primary",
|
|
2118
|
-
size: p(p(
|
|
2241
|
+
size: p(p(l)).size,
|
|
2119
2242
|
onClick: v
|
|
2120
|
-
},
|
|
2121
|
-
default:
|
|
2122
|
-
D(
|
|
2243
|
+
}, g.value), {
|
|
2244
|
+
default: _(() => [
|
|
2245
|
+
D(z(g.value.content), 1)
|
|
2123
2246
|
]),
|
|
2124
2247
|
_: 1
|
|
2125
|
-
}, 16, ["size"])) :
|
|
2126
|
-
], 64)) :
|
|
2127
|
-
|
|
2128
|
-
p(p(
|
|
2248
|
+
}, 16, ["size"])) : M("", !0)
|
|
2249
|
+
], 64)) : M("", !0),
|
|
2250
|
+
R(c.$slots, "expand-before"),
|
|
2251
|
+
p(p(l)).showCollapseButton ? (w(), A("div", {
|
|
2129
2252
|
key: 3,
|
|
2130
2253
|
class: "cursor-pointer ml-2 text-primary hover:opacity-80 transition-opacity select-none",
|
|
2131
|
-
onClick: h[0] || (h[0] = (
|
|
2254
|
+
onClick: h[0] || (h[0] = (b) => a.value = !a.value)
|
|
2132
2255
|
}, [
|
|
2133
|
-
|
|
2134
|
-
])) :
|
|
2135
|
-
|
|
2256
|
+
$("span", null, z(a.value ? "展开" : "收起"), 1)
|
|
2257
|
+
])) : M("", !0),
|
|
2258
|
+
R(c.$slots, "expand-after")
|
|
2136
2259
|
], 2));
|
|
2137
2260
|
}
|
|
2138
2261
|
});
|
|
2139
|
-
function
|
|
2140
|
-
const o =
|
|
2262
|
+
function Wn(e) {
|
|
2263
|
+
const o = po({
|
|
2141
2264
|
xs: 576,
|
|
2142
2265
|
sm: 576,
|
|
2143
2266
|
md: 768,
|
|
2144
2267
|
lg: 992,
|
|
2145
2268
|
xl: 1200,
|
|
2146
2269
|
xxl: 1600
|
|
2147
|
-
}), n =
|
|
2148
|
-
const
|
|
2270
|
+
}), n = y(() => {
|
|
2271
|
+
const a = {}, m = e.schema || [], g = l(), v = e.commonConfig?.colProps;
|
|
2149
2272
|
return m.forEach((i) => {
|
|
2150
2273
|
if (!i.fieldName) return;
|
|
2151
2274
|
const u = i.colProps || v;
|
|
2152
|
-
|
|
2153
|
-
}),
|
|
2154
|
-
}), r =
|
|
2155
|
-
const
|
|
2275
|
+
a[i.fieldName] = s(u, i.colSpan, g);
|
|
2276
|
+
}), a;
|
|
2277
|
+
}), r = y(() => {
|
|
2278
|
+
const a = l();
|
|
2156
2279
|
if (e.layout !== "inline") {
|
|
2157
2280
|
if (e.actionColProps)
|
|
2158
|
-
return
|
|
2281
|
+
return s(e.actionColProps, void 0, a);
|
|
2159
2282
|
if (e.showCollapseButton) {
|
|
2160
2283
|
const m = e.commonConfig?.colProps;
|
|
2161
|
-
return
|
|
2284
|
+
return s(m || { xs: 12, sm: 12, md: 8, lg: 6 }, void 0, a);
|
|
2162
2285
|
}
|
|
2163
2286
|
return 24;
|
|
2164
2287
|
}
|
|
2165
2288
|
});
|
|
2166
|
-
function
|
|
2289
|
+
function l() {
|
|
2167
2290
|
return o.greaterOrEqual("xxl").value ? "xxl" : o.greaterOrEqual("xl").value ? "xl" : o.greaterOrEqual("lg").value ? "lg" : o.greaterOrEqual("md").value ? "md" : o.greaterOrEqual("sm").value ? "sm" : "xs";
|
|
2168
2291
|
}
|
|
2169
|
-
function a
|
|
2170
|
-
if (
|
|
2171
|
-
const v = ["xxl", "xl", "lg", "md", "sm", "xs"], i = v.indexOf(
|
|
2292
|
+
function s(a, m, g) {
|
|
2293
|
+
if (a) {
|
|
2294
|
+
const v = ["xxl", "xl", "lg", "md", "sm", "xs"], i = v.indexOf(g);
|
|
2172
2295
|
for (let u = i; u < v.length; u++) {
|
|
2173
|
-
const c = v[u], h =
|
|
2296
|
+
const c = v[u], h = a[c];
|
|
2174
2297
|
if (h !== void 0)
|
|
2175
2298
|
return typeof h == "object" ? h.span ?? 24 : h;
|
|
2176
2299
|
}
|
|
2177
|
-
if (
|
|
2178
|
-
return
|
|
2300
|
+
if (a.span !== void 0)
|
|
2301
|
+
return a.span;
|
|
2179
2302
|
}
|
|
2180
2303
|
return m !== void 0 ? m : 24;
|
|
2181
2304
|
}
|
|
2182
2305
|
return { spans: n, actionSpan: r };
|
|
2183
2306
|
}
|
|
2184
|
-
const
|
|
2307
|
+
const Vt = /* @__PURE__ */ O({
|
|
2185
2308
|
__name: "Form",
|
|
2186
2309
|
props: {
|
|
2187
2310
|
formApi: {},
|
|
2188
2311
|
form: {}
|
|
2189
2312
|
},
|
|
2190
2313
|
setup(e) {
|
|
2191
|
-
const t = e, o =
|
|
2314
|
+
const t = e, o = Ln(), n = mt({ ...o.value });
|
|
2192
2315
|
U(
|
|
2193
2316
|
() => o.value,
|
|
2194
|
-
(
|
|
2195
|
-
Object.assign(n,
|
|
2317
|
+
(x) => {
|
|
2318
|
+
Object.assign(n, x);
|
|
2196
2319
|
},
|
|
2197
2320
|
{ deep: !0 }
|
|
2198
2321
|
// 深度监听,确保对象内部属性变化也能捕获
|
|
2199
|
-
),
|
|
2200
|
-
const { spans: r, actionSpan:
|
|
2322
|
+
), Tn(n);
|
|
2323
|
+
const { spans: r, actionSpan: l } = Wn(n), s = y(() => {
|
|
2201
2324
|
const {
|
|
2202
|
-
commonConfig:
|
|
2203
|
-
labelWidth:
|
|
2204
|
-
schema:
|
|
2325
|
+
commonConfig: x = {},
|
|
2326
|
+
labelWidth: C,
|
|
2327
|
+
schema: E = []
|
|
2205
2328
|
} = n, {
|
|
2206
2329
|
componentProps: d = {},
|
|
2207
2330
|
formFieldProps: f = {},
|
|
2208
2331
|
...k
|
|
2209
|
-
} =
|
|
2210
|
-
return
|
|
2332
|
+
} = x, P = { ...k };
|
|
2333
|
+
return C !== void 0 && Object.assign(P, { labelWidth: C }), E.map((j) => ({
|
|
2211
2334
|
// 合并策略:全局配置 (Global) < 表单项自身配置 (Item)
|
|
2212
2335
|
...P,
|
|
2213
|
-
...
|
|
2336
|
+
...j,
|
|
2214
2337
|
// 显隐逻辑:只处理 Item 自身配置的 hide 属性
|
|
2215
2338
|
// (v-if/v-show 的动态逻辑由 dependencies.ts 处理)
|
|
2216
|
-
hidden:
|
|
2339
|
+
hidden: j.hide,
|
|
2217
2340
|
// 注入通用组件属性
|
|
2218
2341
|
// 注意:这里只是透传,最终合并逻辑在 FormField 组件内部进行
|
|
2219
2342
|
commonComponentProps: d,
|
|
@@ -2221,19 +2344,19 @@ const Ft = /* @__PURE__ */ O({
|
|
|
2221
2344
|
// 直接在此处合并全局配置和局部配置,减少下层组件的计算负担
|
|
2222
2345
|
formFieldProps: {
|
|
2223
2346
|
...f,
|
|
2224
|
-
...
|
|
2347
|
+
...j.formFieldProps || {}
|
|
2225
2348
|
},
|
|
2226
2349
|
// 显式保留组件原本的 props,防止在合并过程中被意外覆盖
|
|
2227
|
-
componentProps:
|
|
2350
|
+
componentProps: j.componentProps
|
|
2228
2351
|
}));
|
|
2229
|
-
}),
|
|
2352
|
+
}), a = y(() => n.layout === "inline"), { handleSubmit: m, resetForm: g, setValues: v, values: i, validate: u, errors: c, meta: h } = t.form || gt({
|
|
2230
2353
|
// 提取默认值构建初始状态
|
|
2231
|
-
initialValues:
|
|
2354
|
+
initialValues: s.value.reduce((x, C) => ({ ...x, [C.fieldName]: C.defaultValue }), {})
|
|
2232
2355
|
});
|
|
2233
|
-
|
|
2356
|
+
Ie(() => {
|
|
2234
2357
|
t.formApi && t.formApi.mount({
|
|
2235
2358
|
handleSubmit: m,
|
|
2236
|
-
resetForm:
|
|
2359
|
+
resetForm: g,
|
|
2237
2360
|
setValues: v,
|
|
2238
2361
|
values: i,
|
|
2239
2362
|
validate: u,
|
|
@@ -2241,65 +2364,65 @@ const Ft = /* @__PURE__ */ O({
|
|
|
2241
2364
|
meta: h
|
|
2242
2365
|
});
|
|
2243
2366
|
});
|
|
2244
|
-
const
|
|
2245
|
-
n.handleSubmit ? n.handleSubmit(
|
|
2246
|
-
}), S = (
|
|
2247
|
-
n.collapsed =
|
|
2248
|
-
}, F =
|
|
2249
|
-
const { compact:
|
|
2367
|
+
const b = m((x) => {
|
|
2368
|
+
n.handleSubmit ? n.handleSubmit(x) : console.log("Form submitted:", x);
|
|
2369
|
+
}), S = (x) => {
|
|
2370
|
+
n.collapsed = x, n.handleCollapsedChange?.(x), t.formApi && t.formApi.setState({ collapsed: x });
|
|
2371
|
+
}, F = y(() => {
|
|
2372
|
+
const { compact: x, gridProps: C } = n, E = x ? 8 : 16, d = C?.xGap ?? C?.["x-gap"] ?? E, f = C?.yGap ?? C?.["y-gap"] ?? E;
|
|
2250
2373
|
return { x: d, y: f };
|
|
2251
2374
|
});
|
|
2252
|
-
return (
|
|
2253
|
-
const
|
|
2375
|
+
return (x, C) => {
|
|
2376
|
+
const E = G("a-col"), d = G("a-form-item"), f = G("a-row"), k = G("a-form");
|
|
2254
2377
|
return w(), V(k, {
|
|
2255
2378
|
model: {},
|
|
2256
2379
|
layout: p(o).layout || "horizontal",
|
|
2257
2380
|
size: p(o).size,
|
|
2258
2381
|
class: "arco-form",
|
|
2259
|
-
onSubmit:
|
|
2382
|
+
onSubmit: C[0] || (C[0] = (P, j) => p(b)(j))
|
|
2260
2383
|
}, {
|
|
2261
|
-
default:
|
|
2262
|
-
|
|
2384
|
+
default: _(() => [
|
|
2385
|
+
B(f, {
|
|
2263
2386
|
gutter: [F.value.x, F.value.y],
|
|
2264
|
-
class:
|
|
2387
|
+
class: L(n.wrapperClass)
|
|
2265
2388
|
}, {
|
|
2266
|
-
default:
|
|
2267
|
-
(w(!0),
|
|
2389
|
+
default: _(() => [
|
|
2390
|
+
(w(!0), A(ce, null, ee(s.value, (P, j) => (w(), A(ce, {
|
|
2268
2391
|
key: P.fieldName
|
|
2269
2392
|
}, [
|
|
2270
|
-
!P.hidden && (!n.collapsed ||
|
|
2393
|
+
!P.hidden && (!n.collapsed || j < 24 / (p(r)[P.fieldName] ?? 24) * (n.collapsedRows ?? 1) - 1) ? (w(), V(E, {
|
|
2271
2394
|
key: 0,
|
|
2272
|
-
span: p(r)[P.fieldName] ?? (
|
|
2395
|
+
span: p(r)[P.fieldName] ?? (a.value ? void 0 : 24)
|
|
2273
2396
|
}, {
|
|
2274
|
-
default:
|
|
2275
|
-
|
|
2397
|
+
default: _(() => [
|
|
2398
|
+
B(Hn, { schema: P }, null, 8, ["schema"])
|
|
2276
2399
|
]),
|
|
2277
2400
|
_: 2
|
|
2278
|
-
}, 1032, ["span"])) :
|
|
2401
|
+
}, 1032, ["span"])) : M("", !0)
|
|
2279
2402
|
], 64))), 128)),
|
|
2280
|
-
n.showDefaultActions ? (w(), V(
|
|
2403
|
+
n.showDefaultActions ? (w(), V(E, {
|
|
2281
2404
|
key: 0,
|
|
2282
|
-
span: p(
|
|
2283
|
-
style:
|
|
2405
|
+
span: p(l),
|
|
2406
|
+
style: H(a.value ? { marginLeft: "16px" } : { flex: 1, textAlign: "right", marginBottom: F.value.y + "px" })
|
|
2284
2407
|
}, {
|
|
2285
|
-
default:
|
|
2408
|
+
default: _(() => [
|
|
2286
2409
|
(n.layout || "horizontal") === "vertical" ? (w(), V(d, {
|
|
2287
2410
|
key: 0,
|
|
2288
2411
|
class: "mb-0",
|
|
2289
2412
|
"hide-asterisk": !0
|
|
2290
2413
|
}, {
|
|
2291
|
-
label:
|
|
2292
|
-
|
|
2414
|
+
label: _(() => [...C[1] || (C[1] = [
|
|
2415
|
+
$("span", { style: { display: "inline-block", width: "100%" } }, " ", -1)
|
|
2293
2416
|
])]),
|
|
2294
|
-
default:
|
|
2295
|
-
|
|
2417
|
+
default: _(() => [
|
|
2418
|
+
B(Me, {
|
|
2296
2419
|
"model-value": n.collapsed,
|
|
2297
2420
|
"onUpdate:modelValue": S,
|
|
2298
2421
|
"form-api": t.formApi
|
|
2299
2422
|
}, null, 8, ["model-value", "form-api"])
|
|
2300
2423
|
]),
|
|
2301
2424
|
_: 1
|
|
2302
|
-
})) : (w(), V(
|
|
2425
|
+
})) : (w(), V(Me, {
|
|
2303
2426
|
key: 1,
|
|
2304
2427
|
"model-value": n.collapsed,
|
|
2305
2428
|
"onUpdate:modelValue": S,
|
|
@@ -2307,7 +2430,7 @@ const Ft = /* @__PURE__ */ O({
|
|
|
2307
2430
|
}, null, 8, ["model-value", "form-api"]))
|
|
2308
2431
|
]),
|
|
2309
2432
|
_: 1
|
|
2310
|
-
}, 8, ["span", "style"])) :
|
|
2433
|
+
}, 8, ["span", "style"])) : M("", !0)
|
|
2311
2434
|
]),
|
|
2312
2435
|
_: 1
|
|
2313
2436
|
}, 8, ["gutter", "class"])
|
|
@@ -2316,7 +2439,7 @@ const Ft = /* @__PURE__ */ O({
|
|
|
2316
2439
|
}, 8, ["layout", "size"]);
|
|
2317
2440
|
};
|
|
2318
2441
|
}
|
|
2319
|
-
}),
|
|
2442
|
+
}), Gn = /* @__PURE__ */ O({
|
|
2320
2443
|
__name: "SunnyUseForm",
|
|
2321
2444
|
props: {
|
|
2322
2445
|
layout: {},
|
|
@@ -2351,25 +2474,25 @@ const Ft = /* @__PURE__ */ O({
|
|
|
2351
2474
|
formApi: {}
|
|
2352
2475
|
},
|
|
2353
2476
|
setup(e) {
|
|
2354
|
-
const t = e, o = t.formApi.useStore?.() ||
|
|
2477
|
+
const t = e, o = t.formApi.useStore?.() || y(() => ({})), n = y(() => {
|
|
2355
2478
|
const v = Object.entries(t).reduce((i, [u, c]) => (c !== void 0 && (i[u] = c), i), {});
|
|
2356
2479
|
return { ...o.value, ...v };
|
|
2357
|
-
}), r = /* @__PURE__ */ new Map(), { delegatedSlots:
|
|
2358
|
-
|
|
2480
|
+
}), r = /* @__PURE__ */ new Map(), { delegatedSlots: l, form: s } = Nn(n);
|
|
2481
|
+
Pt(n), Mn(r), vt(() => {
|
|
2359
2482
|
t.formApi.unmount();
|
|
2360
2483
|
});
|
|
2361
|
-
const
|
|
2362
|
-
|
|
2363
|
-
t.formApi.mount(
|
|
2364
|
-
() =>
|
|
2484
|
+
const a = {};
|
|
2485
|
+
Ie(async () => {
|
|
2486
|
+
t.formApi.mount(s, r), t.formApi.setState({ values: me(s.values) }), await ge(), U(
|
|
2487
|
+
() => s.values,
|
|
2365
2488
|
async (v) => {
|
|
2366
2489
|
if (t.formApi.setState({ values: me(v) }), m(), !n.value.handleValuesChange) return;
|
|
2367
2490
|
const i = n.value.schema?.map((c) => c.fieldName) || [];
|
|
2368
2491
|
if (i.length === 0) return;
|
|
2369
2492
|
const u = [];
|
|
2370
2493
|
for (const c of i) {
|
|
2371
|
-
const h =
|
|
2372
|
-
|
|
2494
|
+
const h = ot(v, c), b = ot(a, c);
|
|
2495
|
+
no(h, b) || (u.push(c), ro(a, c, h));
|
|
2373
2496
|
}
|
|
2374
2497
|
if (u.length > 0) {
|
|
2375
2498
|
const c = await t.formApi.getValues();
|
|
@@ -2382,36 +2505,36 @@ const Ft = /* @__PURE__ */ O({
|
|
|
2382
2505
|
{ deep: !0 }
|
|
2383
2506
|
);
|
|
2384
2507
|
});
|
|
2385
|
-
const m =
|
|
2508
|
+
const m = mo(async () => {
|
|
2386
2509
|
o.value.submitOnChange && await t.formApi.submitForm();
|
|
2387
2510
|
}, 300);
|
|
2388
|
-
function
|
|
2511
|
+
function g(v) {
|
|
2389
2512
|
o.value.submitOnEnter && (v.target instanceof HTMLTextAreaElement || (v.preventDefault(), t.formApi.submitForm()));
|
|
2390
2513
|
}
|
|
2391
|
-
return (v, i) => (w(),
|
|
2392
|
-
class:
|
|
2514
|
+
return (v, i) => (w(), A("div", {
|
|
2515
|
+
class: L(n.value.wrapperClass)
|
|
2393
2516
|
}, [
|
|
2394
|
-
|
|
2395
|
-
form: p(
|
|
2517
|
+
B(Vt, N(n.value, {
|
|
2518
|
+
form: p(s),
|
|
2396
2519
|
"form-api": t.formApi,
|
|
2397
|
-
onKeydown:
|
|
2520
|
+
onKeydown: yt(g, ["enter"])
|
|
2398
2521
|
}), de({
|
|
2399
|
-
default:
|
|
2522
|
+
default: _(() => []),
|
|
2400
2523
|
_: 2
|
|
2401
2524
|
}, [
|
|
2402
|
-
|
|
2525
|
+
ee(p(l), (u) => ({
|
|
2403
2526
|
name: u,
|
|
2404
|
-
fn:
|
|
2405
|
-
|
|
2527
|
+
fn: _((c) => [
|
|
2528
|
+
R(v.$slots, u, Q(fe(c)))
|
|
2406
2529
|
])
|
|
2407
2530
|
}))
|
|
2408
2531
|
]), 1040, ["form", "form-api"])
|
|
2409
2532
|
], 2));
|
|
2410
2533
|
}
|
|
2411
2534
|
});
|
|
2412
|
-
function
|
|
2413
|
-
const t = new
|
|
2414
|
-
return t.useStore = (n) =>
|
|
2535
|
+
function Zs(e = {}) {
|
|
2536
|
+
const t = new zn(e);
|
|
2537
|
+
return t.useStore = (n) => uo(t.store.store, n), Lt(e) && U(
|
|
2415
2538
|
() => e.schema,
|
|
2416
2539
|
() => {
|
|
2417
2540
|
e.schema && t.setState({ schema: e.schema });
|
|
@@ -2428,8 +2551,8 @@ function Hs(e = {}) {
|
|
|
2428
2551
|
}
|
|
2429
2552
|
), [O({
|
|
2430
2553
|
name: "useSunnyFormWrapper",
|
|
2431
|
-
setup(n, { attrs: r, slots:
|
|
2432
|
-
return t.setState({ ...n, ...r }), () => ye(
|
|
2554
|
+
setup(n, { attrs: r, slots: l }) {
|
|
2555
|
+
return t.setState({ ...n, ...r }), () => ye(Gn, {
|
|
2433
2556
|
// 1. ...props & ...attrs: 注入组件接收到的属性
|
|
2434
2557
|
// Inject props and attrs received by the component
|
|
2435
2558
|
...n,
|
|
@@ -2437,11 +2560,11 @@ function Hs(e = {}) {
|
|
|
2437
2560
|
// 2. formApi: 注入 API 实例,供子组件调用
|
|
2438
2561
|
// Inject API instance for child components to call
|
|
2439
2562
|
formApi: t
|
|
2440
|
-
},
|
|
2563
|
+
}, l);
|
|
2441
2564
|
}
|
|
2442
2565
|
}), t];
|
|
2443
2566
|
}
|
|
2444
|
-
const
|
|
2567
|
+
const Qs = /* @__PURE__ */ O({
|
|
2445
2568
|
__name: "SunnyForm",
|
|
2446
2569
|
props: {
|
|
2447
2570
|
layout: {},
|
|
@@ -2476,44 +2599,44 @@ const Ws = /* @__PURE__ */ O({
|
|
|
2476
2599
|
},
|
|
2477
2600
|
emits: ["submit", "reset", "update:collapsed"],
|
|
2478
2601
|
setup(e, { emit: t }) {
|
|
2479
|
-
const o = e, n = t, r =
|
|
2480
|
-
|
|
2481
|
-
const
|
|
2482
|
-
n("update:collapsed",
|
|
2483
|
-
},
|
|
2484
|
-
n("submit",
|
|
2602
|
+
const o = e, n = t, r = y(() => o);
|
|
2603
|
+
Pt(r);
|
|
2604
|
+
const l = (a) => {
|
|
2605
|
+
n("update:collapsed", a), o.handleCollapsedChange?.(a);
|
|
2606
|
+
}, s = (a) => {
|
|
2607
|
+
n("submit", a), o.handleSubmit?.(a);
|
|
2485
2608
|
};
|
|
2486
|
-
return (
|
|
2487
|
-
class:
|
|
2609
|
+
return (a, m) => (w(), A("div", {
|
|
2610
|
+
class: L(o.wrapperClass)
|
|
2488
2611
|
}, [
|
|
2489
|
-
|
|
2490
|
-
default:
|
|
2491
|
-
o.showDefaultActions ? (w(), V(
|
|
2612
|
+
B(Vt, { onSubmit: s }, {
|
|
2613
|
+
default: _(() => [
|
|
2614
|
+
o.showDefaultActions ? (w(), V(Me, {
|
|
2492
2615
|
key: 0,
|
|
2493
2616
|
"model-value": o.collapsed,
|
|
2494
|
-
"onUpdate:modelValue":
|
|
2617
|
+
"onUpdate:modelValue": l
|
|
2495
2618
|
}, {
|
|
2496
|
-
"reset-before":
|
|
2497
|
-
|
|
2619
|
+
"reset-before": _(() => [
|
|
2620
|
+
R(a.$slots, "reset-before")
|
|
2498
2621
|
]),
|
|
2499
|
-
"submit-before":
|
|
2500
|
-
|
|
2622
|
+
"submit-before": _(() => [
|
|
2623
|
+
R(a.$slots, "submit-before")
|
|
2501
2624
|
]),
|
|
2502
|
-
"expand-before":
|
|
2503
|
-
|
|
2625
|
+
"expand-before": _(() => [
|
|
2626
|
+
R(a.$slots, "expand-before")
|
|
2504
2627
|
]),
|
|
2505
|
-
"expand-after":
|
|
2506
|
-
|
|
2628
|
+
"expand-after": _(() => [
|
|
2629
|
+
R(a.$slots, "expand-after")
|
|
2507
2630
|
]),
|
|
2508
2631
|
_: 3
|
|
2509
|
-
}, 8, ["model-value"])) :
|
|
2632
|
+
}, 8, ["model-value"])) : M("", !0)
|
|
2510
2633
|
]),
|
|
2511
2634
|
_: 3
|
|
2512
2635
|
})
|
|
2513
2636
|
], 2));
|
|
2514
2637
|
}
|
|
2515
2638
|
});
|
|
2516
|
-
let
|
|
2639
|
+
let qn = class {
|
|
2517
2640
|
gridRef;
|
|
2518
2641
|
options;
|
|
2519
2642
|
constructor(t, o) {
|
|
@@ -2530,8 +2653,8 @@ let Nn = class {
|
|
|
2530
2653
|
async addEvent(t = {}) {
|
|
2531
2654
|
const o = this.grid;
|
|
2532
2655
|
if (o) {
|
|
2533
|
-
const { record: n = {}, index: r = -1 } = t, { row:
|
|
2534
|
-
await ge(), o.setEditRow(
|
|
2656
|
+
const { record: n = {}, index: r = -1 } = t, { row: l } = await o.insertAt(n, r);
|
|
2657
|
+
await ge(), o.setEditRow(l);
|
|
2535
2658
|
}
|
|
2536
2659
|
}
|
|
2537
2660
|
/**
|
|
@@ -2545,38 +2668,38 @@ let Nn = class {
|
|
|
2545
2668
|
}
|
|
2546
2669
|
}
|
|
2547
2670
|
};
|
|
2548
|
-
const
|
|
2671
|
+
const Yn = /* @__PURE__ */ O({
|
|
2549
2672
|
__name: "use-vxe-grid",
|
|
2550
2673
|
setup(e, { expose: t }) {
|
|
2551
|
-
const o =
|
|
2674
|
+
const o = T();
|
|
2552
2675
|
return t({
|
|
2553
2676
|
getGrid: () => o.value
|
|
2554
|
-
}), (n, r) => (w(), V(p(
|
|
2677
|
+
}), (n, r) => (w(), V(p(wt), N({
|
|
2555
2678
|
ref_key: "gridRef",
|
|
2556
2679
|
ref: o
|
|
2557
2680
|
}, n.$attrs), de({ _: 2 }, [
|
|
2558
|
-
|
|
2559
|
-
name:
|
|
2560
|
-
fn:
|
|
2561
|
-
|
|
2681
|
+
ee(n.$slots, (l, s) => ({
|
|
2682
|
+
name: s,
|
|
2683
|
+
fn: _((a) => [
|
|
2684
|
+
R(n.$slots, s, Q(fe(a || {})))
|
|
2562
2685
|
])
|
|
2563
2686
|
}))
|
|
2564
2687
|
]), 1040));
|
|
2565
2688
|
}
|
|
2566
2689
|
});
|
|
2567
|
-
function
|
|
2568
|
-
const t =
|
|
2690
|
+
function el(e) {
|
|
2691
|
+
const t = T(), o = new qn(t, e);
|
|
2569
2692
|
return [O(
|
|
2570
|
-
(r, { attrs:
|
|
2571
|
-
const { gridEvents:
|
|
2693
|
+
(r, { attrs: l, slots: s }) => {
|
|
2694
|
+
const { gridEvents: a, gridOptions: m } = e, g = Object.entries(a || {}).reduce((v, [i, u]) => {
|
|
2572
2695
|
const c = `on${i.charAt(0).toUpperCase() + i.slice(1)}`;
|
|
2573
2696
|
return v[c] = u, v;
|
|
2574
2697
|
}, {});
|
|
2575
|
-
return () => ye(
|
|
2698
|
+
return () => ye(Yn, { ref: t, ...r, ...l, ...m, ...g }, s);
|
|
2576
2699
|
}
|
|
2577
2700
|
), o];
|
|
2578
2701
|
}
|
|
2579
|
-
class
|
|
2702
|
+
class Kn {
|
|
2580
2703
|
gridRef;
|
|
2581
2704
|
options;
|
|
2582
2705
|
constructor(t, o) {
|
|
@@ -2593,8 +2716,8 @@ class Dn {
|
|
|
2593
2716
|
async addEvent(t = {}) {
|
|
2594
2717
|
const o = this.grid;
|
|
2595
2718
|
if (o) {
|
|
2596
|
-
const { record: n = {}, index: r = -1 } = t, { row:
|
|
2597
|
-
await ge(), o.setEditRow(
|
|
2719
|
+
const { record: n = {}, index: r = -1 } = t, { row: l } = await o.insertAt(n, r);
|
|
2720
|
+
await ge(), o.setEditRow(l);
|
|
2598
2721
|
}
|
|
2599
2722
|
}
|
|
2600
2723
|
/**
|
|
@@ -2608,11 +2731,11 @@ class Dn {
|
|
|
2608
2731
|
}
|
|
2609
2732
|
}
|
|
2610
2733
|
}
|
|
2611
|
-
function
|
|
2612
|
-
let o = null, n = null, r = null,
|
|
2613
|
-
const
|
|
2614
|
-
if (!
|
|
2615
|
-
let S =
|
|
2734
|
+
function Xn(e, t) {
|
|
2735
|
+
let o = null, n = null, r = null, l = null, s = null, a = !1, m = !1;
|
|
2736
|
+
const g = (b) => {
|
|
2737
|
+
if (!b) return window;
|
|
2738
|
+
let S = b.parentElement;
|
|
2616
2739
|
for (; S; ) {
|
|
2617
2740
|
const F = window.getComputedStyle(S);
|
|
2618
2741
|
if (/(auto|scroll)/.test(F.overflow + F.overflowY + F.overflowX))
|
|
@@ -2621,114 +2744,114 @@ function Un(e, t) {
|
|
|
2621
2744
|
}
|
|
2622
2745
|
return window;
|
|
2623
2746
|
}, v = () => {
|
|
2624
|
-
o && o.classList.contains("is-sticky") && (o.style.position = "", o.style.top = "", o.style.left = "", o.style.zIndex = "", o.style.width = "", o.classList.remove("is-sticky"), n && n.parentNode && (n.parentNode.removeChild(n), n = null)),
|
|
2625
|
-
}, i = (
|
|
2626
|
-
m ||
|
|
2627
|
-
|
|
2747
|
+
o && o.classList.contains("is-sticky") && (o.style.position = "", o.style.top = "", o.style.left = "", o.style.zIndex = "", o.style.width = "", o.classList.remove("is-sticky"), n && n.parentNode && (n.parentNode.removeChild(n), n = null)), l && (l.style.display = "none");
|
|
2748
|
+
}, i = (b) => {
|
|
2749
|
+
m || l && r && (a = !0, l.scrollLeft = r.scrollLeft, requestAnimationFrame(() => {
|
|
2750
|
+
a = !1;
|
|
2628
2751
|
}));
|
|
2629
|
-
}, u = (
|
|
2630
|
-
|
|
2752
|
+
}, u = (b) => {
|
|
2753
|
+
a || l && r && (m = !0, r.scrollLeft = l.scrollLeft, requestAnimationFrame(() => {
|
|
2631
2754
|
m = !1;
|
|
2632
2755
|
}));
|
|
2633
2756
|
}, c = () => {
|
|
2634
|
-
!e.value ||
|
|
2757
|
+
!e.value || l || (l = document.createElement("div"), l.className = "vxe-table--sticky-scrollbar", l.style.position = "fixed", l.style.bottom = "0", l.style.overflowX = "auto", l.style.overflowY = "hidden", l.style.zIndex = "101", l.style.display = "none", s = document.createElement("div"), l.appendChild(s), l.addEventListener("scroll", u), document.body.appendChild(l), r = e.value.$el.querySelector(".vxe-table--body-wrapper"), r && r.addEventListener("scroll", i));
|
|
2635
2758
|
}, h = () => {
|
|
2636
2759
|
if (!e.value || !o) return;
|
|
2637
2760
|
if (!t.sticky) {
|
|
2638
2761
|
v();
|
|
2639
2762
|
return;
|
|
2640
2763
|
}
|
|
2641
|
-
const
|
|
2642
|
-
let
|
|
2643
|
-
if (
|
|
2644
|
-
const d = Math.max(0,
|
|
2764
|
+
const b = e.value.$el, S = b.getBoundingClientRect(), F = o.getBoundingClientRect(), x = g(b);
|
|
2765
|
+
let C = { top: 0, bottom: window.innerHeight };
|
|
2766
|
+
if (x !== window && x instanceof HTMLElement && (C = x.getBoundingClientRect()), C.bottom > 0 && C.top < window.innerHeight && S.top < C.top && S.bottom > F.height) {
|
|
2767
|
+
const d = Math.max(0, C.top);
|
|
2645
2768
|
S.bottom - F.height > d ? (!o.classList.contains("is-sticky") || o.style.top !== `${d}px` || o.style.left !== `${S.left}px`) && (o.style.position = "fixed", o.style.top = `${d}px`, o.style.left = `${S.left}px`, o.style.width = `${S.width}px`, o.style.zIndex = "100", o.classList.add("is-sticky"), n || (n = document.createElement("div"), o.parentNode?.insertBefore(n, o)), n.style.height = `${F.height}px`) : v();
|
|
2646
2769
|
} else
|
|
2647
2770
|
o.classList.contains("is-sticky") && (o.style.position = "", o.style.top = "", o.style.left = "", o.style.width = "", o.classList.remove("is-sticky"), n && n.parentNode && (n.parentNode.removeChild(n), n = null));
|
|
2648
|
-
if ((!
|
|
2771
|
+
if ((!l || !r) && c(), l && r && s) {
|
|
2649
2772
|
const d = r.scrollWidth, f = r.clientWidth;
|
|
2650
2773
|
if (d > f) {
|
|
2651
2774
|
const k = window.innerHeight;
|
|
2652
|
-
S.bottom > k && S.top < k ? (
|
|
2775
|
+
S.bottom > k && S.top < k ? (l.style.display = "block", l.style.width = `${S.width}px`, l.style.left = `${S.left}px`, s.style.width = `${d}px`, Math.abs(l.scrollLeft - r.scrollLeft) > 1 && (l.scrollLeft = r.scrollLeft)) : l.style.display = "none";
|
|
2653
2776
|
} else
|
|
2654
|
-
|
|
2777
|
+
l.style.display = "none";
|
|
2655
2778
|
}
|
|
2656
2779
|
};
|
|
2657
2780
|
U(() => t.sticky, () => {
|
|
2658
2781
|
h();
|
|
2659
|
-
}),
|
|
2782
|
+
}), Ie(() => {
|
|
2660
2783
|
setTimeout(() => {
|
|
2661
2784
|
e.value && (o = e.value.$el.querySelector(".vxe-table--header-wrapper"), o && (window.addEventListener("scroll", h, !0), window.addEventListener("resize", h)), c());
|
|
2662
2785
|
}, 100);
|
|
2663
|
-
}),
|
|
2664
|
-
window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h), n && n.parentNode && n.parentNode.removeChild(n),
|
|
2786
|
+
}), vt(() => {
|
|
2787
|
+
window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h), n && n.parentNode && n.parentNode.removeChild(n), l && l.parentNode && l.parentNode.removeChild(l), r && r.removeEventListener("scroll", i);
|
|
2665
2788
|
});
|
|
2666
2789
|
}
|
|
2667
|
-
var
|
|
2668
|
-
function
|
|
2669
|
-
var t =
|
|
2790
|
+
var Zn = typeof global == "object" && global && global.Object === Object && global, Qn = typeof self == "object" && self && self.Object === Object && self, He = Zn || Qn || Function("return this")(), oe = He.Symbol, Ot = Object.prototype, Jn = Ot.hasOwnProperty, er = Ot.toString, se = oe ? oe.toStringTag : void 0;
|
|
2791
|
+
function tr(e) {
|
|
2792
|
+
var t = Jn.call(e, se), o = e[se];
|
|
2670
2793
|
try {
|
|
2671
2794
|
e[se] = void 0;
|
|
2672
2795
|
var n = !0;
|
|
2673
2796
|
} catch {
|
|
2674
2797
|
}
|
|
2675
|
-
var r =
|
|
2798
|
+
var r = er.call(e);
|
|
2676
2799
|
return n && (t ? e[se] = o : delete e[se]), r;
|
|
2677
2800
|
}
|
|
2678
|
-
var
|
|
2679
|
-
function
|
|
2680
|
-
return
|
|
2801
|
+
var or = Object.prototype, nr = or.toString;
|
|
2802
|
+
function rr(e) {
|
|
2803
|
+
return nr.call(e);
|
|
2681
2804
|
}
|
|
2682
|
-
var
|
|
2683
|
-
function
|
|
2684
|
-
return e == null ? e === void 0 ?
|
|
2805
|
+
var sr = "[object Null]", lr = "[object Undefined]", it = oe ? oe.toStringTag : void 0;
|
|
2806
|
+
function We(e) {
|
|
2807
|
+
return e == null ? e === void 0 ? lr : sr : it && it in Object(e) ? tr(e) : rr(e);
|
|
2685
2808
|
}
|
|
2686
|
-
function
|
|
2809
|
+
function Ge(e) {
|
|
2687
2810
|
return e != null && typeof e == "object";
|
|
2688
2811
|
}
|
|
2689
|
-
var
|
|
2690
|
-
function
|
|
2691
|
-
return typeof e == "symbol" ||
|
|
2812
|
+
var ar = "[object Symbol]";
|
|
2813
|
+
function qe(e) {
|
|
2814
|
+
return typeof e == "symbol" || Ge(e) && We(e) == ar;
|
|
2692
2815
|
}
|
|
2693
|
-
function
|
|
2816
|
+
function ir(e, t) {
|
|
2694
2817
|
for (var o = -1, n = e == null ? 0 : e.length, r = Array(n); ++o < n; )
|
|
2695
2818
|
r[o] = t(e[o], o, e);
|
|
2696
2819
|
return r;
|
|
2697
2820
|
}
|
|
2698
|
-
var be = Array.isArray,
|
|
2699
|
-
function
|
|
2821
|
+
var be = Array.isArray, ct = oe ? oe.prototype : void 0, ut = ct ? ct.toString : void 0;
|
|
2822
|
+
function Bt(e) {
|
|
2700
2823
|
if (typeof e == "string")
|
|
2701
2824
|
return e;
|
|
2702
2825
|
if (be(e))
|
|
2703
|
-
return
|
|
2704
|
-
if (
|
|
2705
|
-
return
|
|
2826
|
+
return ir(e, Bt) + "";
|
|
2827
|
+
if (qe(e))
|
|
2828
|
+
return ut ? ut.call(e) : "";
|
|
2706
2829
|
var t = e + "";
|
|
2707
2830
|
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
2708
2831
|
}
|
|
2709
|
-
function
|
|
2832
|
+
function At(e) {
|
|
2710
2833
|
var t = typeof e;
|
|
2711
2834
|
return e != null && (t == "object" || t == "function");
|
|
2712
2835
|
}
|
|
2713
|
-
var
|
|
2714
|
-
function
|
|
2715
|
-
if (!
|
|
2836
|
+
var cr = "[object AsyncFunction]", ur = "[object Function]", dr = "[object GeneratorFunction]", fr = "[object Proxy]";
|
|
2837
|
+
function pr(e) {
|
|
2838
|
+
if (!At(e))
|
|
2716
2839
|
return !1;
|
|
2717
|
-
var t =
|
|
2718
|
-
return t ==
|
|
2840
|
+
var t = We(e);
|
|
2841
|
+
return t == ur || t == dr || t == cr || t == fr;
|
|
2719
2842
|
}
|
|
2720
|
-
var
|
|
2721
|
-
var e = /[^.]+$/.exec(
|
|
2843
|
+
var Ae = He["__core-js_shared__"], dt = (function() {
|
|
2844
|
+
var e = /[^.]+$/.exec(Ae && Ae.keys && Ae.keys.IE_PROTO || "");
|
|
2722
2845
|
return e ? "Symbol(src)_1." + e : "";
|
|
2723
2846
|
})();
|
|
2724
|
-
function
|
|
2725
|
-
return !!
|
|
2847
|
+
function mr(e) {
|
|
2848
|
+
return !!dt && dt in e;
|
|
2726
2849
|
}
|
|
2727
|
-
var
|
|
2728
|
-
function
|
|
2850
|
+
var hr = Function.prototype, vr = hr.toString;
|
|
2851
|
+
function yr(e) {
|
|
2729
2852
|
if (e != null) {
|
|
2730
2853
|
try {
|
|
2731
|
-
return
|
|
2854
|
+
return vr.call(e);
|
|
2732
2855
|
} catch {
|
|
2733
2856
|
}
|
|
2734
2857
|
try {
|
|
@@ -2738,113 +2861,113 @@ function ur(e) {
|
|
|
2738
2861
|
}
|
|
2739
2862
|
return "";
|
|
2740
2863
|
}
|
|
2741
|
-
var
|
|
2742
|
-
"^" +
|
|
2864
|
+
var gr = /[\\^$.*+?()[\]{}|]/g, br = /^\[object .+?Constructor\]$/, wr = Function.prototype, Sr = Object.prototype, kr = wr.toString, Cr = Sr.hasOwnProperty, xr = RegExp(
|
|
2865
|
+
"^" + kr.call(Cr).replace(gr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2743
2866
|
);
|
|
2744
|
-
function
|
|
2745
|
-
if (!
|
|
2867
|
+
function $r(e) {
|
|
2868
|
+
if (!At(e) || mr(e))
|
|
2746
2869
|
return !1;
|
|
2747
|
-
var t =
|
|
2748
|
-
return t.test(
|
|
2870
|
+
var t = pr(e) ? xr : br;
|
|
2871
|
+
return t.test(yr(e));
|
|
2749
2872
|
}
|
|
2750
|
-
function
|
|
2873
|
+
function _r(e, t) {
|
|
2751
2874
|
return e?.[t];
|
|
2752
2875
|
}
|
|
2753
2876
|
function Et(e, t) {
|
|
2754
|
-
var o =
|
|
2755
|
-
return
|
|
2877
|
+
var o = _r(e, t);
|
|
2878
|
+
return $r(o) ? o : void 0;
|
|
2756
2879
|
}
|
|
2757
|
-
var
|
|
2758
|
-
function
|
|
2880
|
+
var Fr = 9007199254740991, Pr = /^(?:0|[1-9]\d*)$/;
|
|
2881
|
+
function Vr(e, t) {
|
|
2759
2882
|
var o = typeof e;
|
|
2760
|
-
return t = t ??
|
|
2883
|
+
return t = t ?? Fr, !!t && (o == "number" || o != "symbol" && Pr.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
2761
2884
|
}
|
|
2762
|
-
function
|
|
2885
|
+
function Or(e, t) {
|
|
2763
2886
|
return e === t || e !== e && t !== t;
|
|
2764
2887
|
}
|
|
2765
|
-
var
|
|
2766
|
-
function
|
|
2767
|
-
return typeof e == "number" && e > -1 && e % 1 == 0 && e <=
|
|
2888
|
+
var Br = 9007199254740991;
|
|
2889
|
+
function Ar(e) {
|
|
2890
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Br;
|
|
2768
2891
|
}
|
|
2769
|
-
var
|
|
2770
|
-
function
|
|
2771
|
-
return
|
|
2892
|
+
var Er = "[object Arguments]";
|
|
2893
|
+
function ft(e) {
|
|
2894
|
+
return Ge(e) && We(e) == Er;
|
|
2772
2895
|
}
|
|
2773
|
-
var
|
|
2896
|
+
var jt = Object.prototype, jr = jt.hasOwnProperty, zr = jt.propertyIsEnumerable, Rr = ft(/* @__PURE__ */ (function() {
|
|
2774
2897
|
return arguments;
|
|
2775
|
-
})()) ?
|
|
2776
|
-
return
|
|
2777
|
-
},
|
|
2778
|
-
function
|
|
2898
|
+
})()) ? ft : function(e) {
|
|
2899
|
+
return Ge(e) && jr.call(e, "callee") && !zr.call(e, "callee");
|
|
2900
|
+
}, Tr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mr = /^\w*$/;
|
|
2901
|
+
function Lr(e, t) {
|
|
2779
2902
|
if (be(e))
|
|
2780
2903
|
return !1;
|
|
2781
2904
|
var o = typeof e;
|
|
2782
|
-
return o == "number" || o == "symbol" || o == "boolean" || e == null ||
|
|
2905
|
+
return o == "number" || o == "symbol" || o == "boolean" || e == null || qe(e) ? !0 : Mr.test(e) || !Tr.test(e) || t != null && e in Object(t);
|
|
2783
2906
|
}
|
|
2784
2907
|
var ue = Et(Object, "create");
|
|
2785
|
-
function
|
|
2908
|
+
function Nr() {
|
|
2786
2909
|
this.__data__ = ue ? ue(null) : {}, this.size = 0;
|
|
2787
2910
|
}
|
|
2788
|
-
function
|
|
2911
|
+
function Ir(e) {
|
|
2789
2912
|
var t = this.has(e) && delete this.__data__[e];
|
|
2790
2913
|
return this.size -= t ? 1 : 0, t;
|
|
2791
2914
|
}
|
|
2792
|
-
var
|
|
2793
|
-
function
|
|
2915
|
+
var Dr = "__lodash_hash_undefined__", Ur = Object.prototype, Hr = Ur.hasOwnProperty;
|
|
2916
|
+
function Wr(e) {
|
|
2794
2917
|
var t = this.__data__;
|
|
2795
2918
|
if (ue) {
|
|
2796
2919
|
var o = t[e];
|
|
2797
|
-
return o ===
|
|
2920
|
+
return o === Dr ? void 0 : o;
|
|
2798
2921
|
}
|
|
2799
|
-
return
|
|
2922
|
+
return Hr.call(t, e) ? t[e] : void 0;
|
|
2800
2923
|
}
|
|
2801
|
-
var
|
|
2802
|
-
function
|
|
2924
|
+
var Gr = Object.prototype, qr = Gr.hasOwnProperty;
|
|
2925
|
+
function Yr(e) {
|
|
2803
2926
|
var t = this.__data__;
|
|
2804
|
-
return ue ? t[e] !== void 0 :
|
|
2927
|
+
return ue ? t[e] !== void 0 : qr.call(t, e);
|
|
2805
2928
|
}
|
|
2806
|
-
var
|
|
2807
|
-
function
|
|
2929
|
+
var Kr = "__lodash_hash_undefined__";
|
|
2930
|
+
function Xr(e, t) {
|
|
2808
2931
|
var o = this.__data__;
|
|
2809
|
-
return this.size += this.has(e) ? 0 : 1, o[e] = ue && t === void 0 ?
|
|
2932
|
+
return this.size += this.has(e) ? 0 : 1, o[e] = ue && t === void 0 ? Kr : t, this;
|
|
2810
2933
|
}
|
|
2811
|
-
function
|
|
2934
|
+
function J(e) {
|
|
2812
2935
|
var t = -1, o = e == null ? 0 : e.length;
|
|
2813
2936
|
for (this.clear(); ++t < o; ) {
|
|
2814
2937
|
var n = e[t];
|
|
2815
2938
|
this.set(n[0], n[1]);
|
|
2816
2939
|
}
|
|
2817
2940
|
}
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
function
|
|
2941
|
+
J.prototype.clear = Nr;
|
|
2942
|
+
J.prototype.delete = Ir;
|
|
2943
|
+
J.prototype.get = Wr;
|
|
2944
|
+
J.prototype.has = Yr;
|
|
2945
|
+
J.prototype.set = Xr;
|
|
2946
|
+
function Zr() {
|
|
2824
2947
|
this.__data__ = [], this.size = 0;
|
|
2825
2948
|
}
|
|
2826
2949
|
function we(e, t) {
|
|
2827
2950
|
for (var o = e.length; o--; )
|
|
2828
|
-
if (
|
|
2951
|
+
if (Or(e[o][0], t))
|
|
2829
2952
|
return o;
|
|
2830
2953
|
return -1;
|
|
2831
2954
|
}
|
|
2832
|
-
var
|
|
2833
|
-
function
|
|
2955
|
+
var Qr = Array.prototype, Jr = Qr.splice;
|
|
2956
|
+
function es(e) {
|
|
2834
2957
|
var t = this.__data__, o = we(t, e);
|
|
2835
2958
|
if (o < 0)
|
|
2836
2959
|
return !1;
|
|
2837
2960
|
var n = t.length - 1;
|
|
2838
|
-
return o == n ? t.pop() :
|
|
2961
|
+
return o == n ? t.pop() : Jr.call(t, o, 1), --this.size, !0;
|
|
2839
2962
|
}
|
|
2840
|
-
function
|
|
2963
|
+
function ts(e) {
|
|
2841
2964
|
var t = this.__data__, o = we(t, e);
|
|
2842
2965
|
return o < 0 ? void 0 : t[o][1];
|
|
2843
2966
|
}
|
|
2844
|
-
function
|
|
2967
|
+
function os(e) {
|
|
2845
2968
|
return we(this.__data__, e) > -1;
|
|
2846
2969
|
}
|
|
2847
|
-
function
|
|
2970
|
+
function ns(e, t) {
|
|
2848
2971
|
var o = this.__data__, n = we(o, e);
|
|
2849
2972
|
return n < 0 ? (++this.size, o.push([e, t])) : o[n][1] = t, this;
|
|
2850
2973
|
}
|
|
@@ -2855,119 +2978,119 @@ function ne(e) {
|
|
|
2855
2978
|
this.set(n[0], n[1]);
|
|
2856
2979
|
}
|
|
2857
2980
|
}
|
|
2858
|
-
ne.prototype.clear =
|
|
2859
|
-
ne.prototype.delete =
|
|
2860
|
-
ne.prototype.get =
|
|
2861
|
-
ne.prototype.has =
|
|
2862
|
-
ne.prototype.set =
|
|
2863
|
-
var
|
|
2864
|
-
function
|
|
2981
|
+
ne.prototype.clear = Zr;
|
|
2982
|
+
ne.prototype.delete = es;
|
|
2983
|
+
ne.prototype.get = ts;
|
|
2984
|
+
ne.prototype.has = os;
|
|
2985
|
+
ne.prototype.set = ns;
|
|
2986
|
+
var rs = Et(He, "Map");
|
|
2987
|
+
function ss() {
|
|
2865
2988
|
this.size = 0, this.__data__ = {
|
|
2866
|
-
hash: new
|
|
2867
|
-
map: new (
|
|
2868
|
-
string: new
|
|
2989
|
+
hash: new J(),
|
|
2990
|
+
map: new (rs || ne)(),
|
|
2991
|
+
string: new J()
|
|
2869
2992
|
};
|
|
2870
2993
|
}
|
|
2871
|
-
function
|
|
2994
|
+
function ls(e) {
|
|
2872
2995
|
var t = typeof e;
|
|
2873
2996
|
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
2874
2997
|
}
|
|
2875
2998
|
function Se(e, t) {
|
|
2876
2999
|
var o = e.__data__;
|
|
2877
|
-
return
|
|
3000
|
+
return ls(t) ? o[typeof t == "string" ? "string" : "hash"] : o.map;
|
|
2878
3001
|
}
|
|
2879
|
-
function
|
|
3002
|
+
function as(e) {
|
|
2880
3003
|
var t = Se(this, e).delete(e);
|
|
2881
3004
|
return this.size -= t ? 1 : 0, t;
|
|
2882
3005
|
}
|
|
2883
|
-
function
|
|
3006
|
+
function cs(e) {
|
|
2884
3007
|
return Se(this, e).get(e);
|
|
2885
3008
|
}
|
|
2886
|
-
function
|
|
3009
|
+
function us(e) {
|
|
2887
3010
|
return Se(this, e).has(e);
|
|
2888
3011
|
}
|
|
2889
|
-
function
|
|
3012
|
+
function ds(e, t) {
|
|
2890
3013
|
var o = Se(this, e), n = o.size;
|
|
2891
3014
|
return o.set(e, t), this.size += o.size == n ? 0 : 1, this;
|
|
2892
3015
|
}
|
|
2893
|
-
function
|
|
3016
|
+
function te(e) {
|
|
2894
3017
|
var t = -1, o = e == null ? 0 : e.length;
|
|
2895
3018
|
for (this.clear(); ++t < o; ) {
|
|
2896
3019
|
var n = e[t];
|
|
2897
3020
|
this.set(n[0], n[1]);
|
|
2898
3021
|
}
|
|
2899
3022
|
}
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
var
|
|
2906
|
-
function
|
|
3023
|
+
te.prototype.clear = ss;
|
|
3024
|
+
te.prototype.delete = as;
|
|
3025
|
+
te.prototype.get = cs;
|
|
3026
|
+
te.prototype.has = us;
|
|
3027
|
+
te.prototype.set = ds;
|
|
3028
|
+
var fs = "Expected a function";
|
|
3029
|
+
function Ye(e, t) {
|
|
2907
3030
|
if (typeof e != "function" || t != null && typeof t != "function")
|
|
2908
|
-
throw new TypeError(
|
|
3031
|
+
throw new TypeError(fs);
|
|
2909
3032
|
var o = function() {
|
|
2910
|
-
var n = arguments, r = t ? t.apply(this, n) : n[0],
|
|
2911
|
-
if (
|
|
2912
|
-
return
|
|
2913
|
-
var
|
|
2914
|
-
return o.cache =
|
|
3033
|
+
var n = arguments, r = t ? t.apply(this, n) : n[0], l = o.cache;
|
|
3034
|
+
if (l.has(r))
|
|
3035
|
+
return l.get(r);
|
|
3036
|
+
var s = e.apply(this, n);
|
|
3037
|
+
return o.cache = l.set(r, s) || l, s;
|
|
2915
3038
|
};
|
|
2916
|
-
return o.cache = new (
|
|
3039
|
+
return o.cache = new (Ye.Cache || te)(), o;
|
|
2917
3040
|
}
|
|
2918
|
-
|
|
2919
|
-
var
|
|
2920
|
-
function
|
|
2921
|
-
var t =
|
|
2922
|
-
return o.size ===
|
|
3041
|
+
Ye.Cache = te;
|
|
3042
|
+
var ps = 500;
|
|
3043
|
+
function ms(e) {
|
|
3044
|
+
var t = Ye(e, function(n) {
|
|
3045
|
+
return o.size === ps && o.clear(), n;
|
|
2923
3046
|
}), o = t.cache;
|
|
2924
3047
|
return t;
|
|
2925
3048
|
}
|
|
2926
|
-
var
|
|
3049
|
+
var hs = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, vs = /\\(\\)?/g, ys = ms(function(e) {
|
|
2927
3050
|
var t = [];
|
|
2928
|
-
return e.charCodeAt(0) === 46 && t.push(""), e.replace(
|
|
2929
|
-
t.push(r ?
|
|
3051
|
+
return e.charCodeAt(0) === 46 && t.push(""), e.replace(hs, function(o, n, r, l) {
|
|
3052
|
+
t.push(r ? l.replace(vs, "$1") : n || o);
|
|
2930
3053
|
}), t;
|
|
2931
3054
|
});
|
|
2932
|
-
function
|
|
2933
|
-
return e == null ? "" :
|
|
3055
|
+
function gs(e) {
|
|
3056
|
+
return e == null ? "" : Bt(e);
|
|
2934
3057
|
}
|
|
2935
|
-
function
|
|
2936
|
-
return be(e) ? e :
|
|
3058
|
+
function bs(e, t) {
|
|
3059
|
+
return be(e) ? e : Lr(e, t) ? [e] : ys(gs(e));
|
|
2937
3060
|
}
|
|
2938
|
-
function
|
|
2939
|
-
if (typeof e == "string" ||
|
|
3061
|
+
function ws(e) {
|
|
3062
|
+
if (typeof e == "string" || qe(e))
|
|
2940
3063
|
return e;
|
|
2941
3064
|
var t = e + "";
|
|
2942
3065
|
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
2943
3066
|
}
|
|
2944
|
-
function
|
|
3067
|
+
function Ss(e, t) {
|
|
2945
3068
|
return e != null && t in Object(e);
|
|
2946
3069
|
}
|
|
2947
|
-
function
|
|
2948
|
-
t =
|
|
2949
|
-
for (var n = -1, r = t.length,
|
|
2950
|
-
var
|
|
2951
|
-
if (!(
|
|
3070
|
+
function ks(e, t, o) {
|
|
3071
|
+
t = bs(t, e);
|
|
3072
|
+
for (var n = -1, r = t.length, l = !1; ++n < r; ) {
|
|
3073
|
+
var s = ws(t[n]);
|
|
3074
|
+
if (!(l = e != null && o(e, s)))
|
|
2952
3075
|
break;
|
|
2953
|
-
e = e[
|
|
3076
|
+
e = e[s];
|
|
2954
3077
|
}
|
|
2955
|
-
return
|
|
3078
|
+
return l || ++n != r ? l : (r = e == null ? 0 : e.length, !!r && Ar(r) && Vr(s, r) && (be(e) || Rr(e)));
|
|
2956
3079
|
}
|
|
2957
|
-
function
|
|
2958
|
-
return e != null &&
|
|
3080
|
+
function Cs(e, t) {
|
|
3081
|
+
return e != null && ks(e, t, Ss);
|
|
2959
3082
|
}
|
|
2960
|
-
const
|
|
3083
|
+
const xs = { class: "my-filter-complex" }, $s = {
|
|
2961
3084
|
key: 0,
|
|
2962
3085
|
class: "my-filter-input"
|
|
2963
|
-
},
|
|
3086
|
+
}, _s = { class: "my-fc-footer" }, Fs = /* @__PURE__ */ O({
|
|
2964
3087
|
__name: "FilterComplex",
|
|
2965
3088
|
props: {
|
|
2966
3089
|
renderOpts: Object,
|
|
2967
3090
|
renderParams: Object
|
|
2968
3091
|
},
|
|
2969
3092
|
setup(e) {
|
|
2970
|
-
const t = e, o =
|
|
3093
|
+
const t = e, o = T(), n = y(() => {
|
|
2971
3094
|
const { column: i } = t.renderParams || {};
|
|
2972
3095
|
return i ? i.field : "";
|
|
2973
3096
|
}), r = () => {
|
|
@@ -2980,7 +3103,7 @@ const ys = { class: "my-filter-complex" }, gs = {
|
|
|
2980
3103
|
U(n, () => {
|
|
2981
3104
|
r();
|
|
2982
3105
|
}), r();
|
|
2983
|
-
const
|
|
3106
|
+
const l = y(() => t.renderParams.column), s = y(() => Cs(l.value.params, "optionlist") ? "select" : "input"), a = () => {
|
|
2984
3107
|
const { renderParams: i } = t, u = o.value;
|
|
2985
3108
|
if (i && u) {
|
|
2986
3109
|
const { $table: c } = i, h = !!u.data;
|
|
@@ -2990,62 +3113,62 @@ const ys = { class: "my-filter-complex" }, gs = {
|
|
|
2990
3113
|
const { renderParams: i } = t, u = {};
|
|
2991
3114
|
if (i) {
|
|
2992
3115
|
const { $table: c } = i;
|
|
2993
|
-
c.getColumns().forEach((
|
|
2994
|
-
const { field: S, filters: F } =
|
|
3116
|
+
c.getColumns().forEach((b) => {
|
|
3117
|
+
const { field: S, filters: F } = b;
|
|
2995
3118
|
if (S && F && F.length) {
|
|
2996
|
-
const
|
|
2997
|
-
|
|
3119
|
+
const x = F[0];
|
|
3120
|
+
x.data && (u[S] = x.data);
|
|
2998
3121
|
}
|
|
2999
3122
|
});
|
|
3000
3123
|
}
|
|
3001
3124
|
return u;
|
|
3002
|
-
},
|
|
3125
|
+
}, g = () => {
|
|
3003
3126
|
const { renderParams: i } = t;
|
|
3004
3127
|
if (i) {
|
|
3005
3128
|
const { $table: u, $grid: c } = i, h = o.value;
|
|
3006
3129
|
h && u.updateFilterOptionStatus(h, !!h.data);
|
|
3007
|
-
const
|
|
3008
|
-
c.commitProxy("query",
|
|
3130
|
+
const b = m();
|
|
3131
|
+
c.commitProxy("query", b), c.closeFilter();
|
|
3009
3132
|
}
|
|
3010
3133
|
}, v = () => {
|
|
3011
3134
|
const { renderParams: i } = t, u = o.value;
|
|
3012
3135
|
if (i && u) {
|
|
3013
3136
|
const { $table: c, $grid: h } = i;
|
|
3014
3137
|
u.data = "", c.updateFilterOptionStatus(u, !1);
|
|
3015
|
-
const
|
|
3016
|
-
h.commitProxy("query",
|
|
3138
|
+
const b = m();
|
|
3139
|
+
h.commitProxy("query", b), h.closeFilter();
|
|
3017
3140
|
}
|
|
3018
3141
|
};
|
|
3019
|
-
return (i, u) => (w(),
|
|
3020
|
-
o.value ? (w(),
|
|
3021
|
-
|
|
3142
|
+
return (i, u) => (w(), A("div", xs, [
|
|
3143
|
+
o.value ? (w(), A("div", $s, [
|
|
3144
|
+
s.value === "select" ? (w(), V(p(wo), {
|
|
3022
3145
|
key: 0,
|
|
3023
3146
|
modelValue: o.value.data,
|
|
3024
3147
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value.data = c),
|
|
3025
|
-
options:
|
|
3148
|
+
options: l.value.params.optionlist,
|
|
3026
3149
|
clearable: "",
|
|
3027
|
-
onChange:
|
|
3028
|
-
}, null, 8, ["modelValue", "options"])) : (w(), V(p(
|
|
3150
|
+
onChange: a
|
|
3151
|
+
}, null, 8, ["modelValue", "options"])) : (w(), V(p(So), {
|
|
3029
3152
|
key: 1,
|
|
3030
3153
|
modelValue: o.value.data,
|
|
3031
3154
|
"onUpdate:modelValue": u[1] || (u[1] = (c) => o.value.data = c),
|
|
3032
3155
|
clearable: "",
|
|
3033
|
-
onKeyup:
|
|
3034
|
-
onInput:
|
|
3156
|
+
onKeyup: yt(g, ["enter"]),
|
|
3157
|
+
onInput: a
|
|
3035
3158
|
}, null, 8, ["modelValue"]))
|
|
3036
|
-
])) :
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
default:
|
|
3159
|
+
])) : M("", !0),
|
|
3160
|
+
$("div", _s, [
|
|
3161
|
+
B(p(Te), { onClick: v }, {
|
|
3162
|
+
default: _(() => [...u[2] || (u[2] = [
|
|
3040
3163
|
D("重置", -1)
|
|
3041
3164
|
])]),
|
|
3042
3165
|
_: 1
|
|
3043
3166
|
}),
|
|
3044
|
-
|
|
3167
|
+
B(p(Te), {
|
|
3045
3168
|
status: "primary",
|
|
3046
|
-
onClick:
|
|
3169
|
+
onClick: g
|
|
3047
3170
|
}, {
|
|
3048
|
-
default:
|
|
3171
|
+
default: _(() => [...u[3] || (u[3] = [
|
|
3049
3172
|
D("确认", -1)
|
|
3050
3173
|
])]),
|
|
3051
3174
|
_: 1
|
|
@@ -3053,81 +3176,81 @@ const ys = { class: "my-filter-complex" }, gs = {
|
|
|
3053
3176
|
])
|
|
3054
3177
|
]));
|
|
3055
3178
|
}
|
|
3056
|
-
}),
|
|
3057
|
-
|
|
3179
|
+
}), Ps = /* @__PURE__ */ xt(Fs, [["__scopeId", "data-v-98a6f5eb"]]);
|
|
3180
|
+
bo.renderer.add("MyFilterComplex", {
|
|
3058
3181
|
// 不显示底部按钮,使用自定义的按钮
|
|
3059
3182
|
showTableFilterFooter: !1,
|
|
3060
3183
|
// 自定义筛选模板
|
|
3061
3184
|
renderTableFilter(e, t) {
|
|
3062
|
-
return /* @__PURE__ */ React.createElement(
|
|
3185
|
+
return /* @__PURE__ */ React.createElement(Ps, { renderOpts: e, renderParams: t });
|
|
3063
3186
|
}
|
|
3064
3187
|
});
|
|
3065
|
-
const
|
|
3188
|
+
const Vs = /* @__PURE__ */ O({
|
|
3066
3189
|
components: {
|
|
3067
|
-
VxePager:
|
|
3190
|
+
VxePager: ko,
|
|
3068
3191
|
VxeButton: Te
|
|
3069
3192
|
},
|
|
3070
3193
|
__name: "use-query-grid",
|
|
3071
3194
|
setup(e, { expose: t }) {
|
|
3072
|
-
const o =
|
|
3073
|
-
return
|
|
3195
|
+
const o = T(), n = pt();
|
|
3196
|
+
return Xn(o, n), t({
|
|
3074
3197
|
getGrid: () => o.value
|
|
3075
|
-
}), (r,
|
|
3198
|
+
}), (r, l) => (w(), V(p(wt), N({
|
|
3076
3199
|
ref_key: "gridRef",
|
|
3077
3200
|
ref: o
|
|
3078
3201
|
}, r.$attrs), de({ _: 2 }, [
|
|
3079
|
-
|
|
3080
|
-
name:
|
|
3081
|
-
fn:
|
|
3082
|
-
|
|
3202
|
+
ee(r.$slots, (s, a) => ({
|
|
3203
|
+
name: a,
|
|
3204
|
+
fn: _((m) => [
|
|
3205
|
+
R(r.$slots, a, Q(fe(m || {})))
|
|
3083
3206
|
])
|
|
3084
3207
|
}))
|
|
3085
3208
|
]), 1040));
|
|
3086
3209
|
}
|
|
3087
3210
|
});
|
|
3088
|
-
function
|
|
3089
|
-
const t =
|
|
3211
|
+
function tl(e) {
|
|
3212
|
+
const t = T(), o = new Kn(t, e);
|
|
3090
3213
|
return [O(
|
|
3091
|
-
(r, { attrs:
|
|
3092
|
-
const { gridEvents:
|
|
3214
|
+
(r, { attrs: l, slots: s }) => {
|
|
3215
|
+
const { gridEvents: a, gridOptions: m } = e, g = Object.entries(a || {}).reduce((v, [i, u]) => {
|
|
3093
3216
|
const c = `on${i.charAt(0).toUpperCase() + i.slice(1)}`;
|
|
3094
3217
|
return v[c] = u, v;
|
|
3095
3218
|
}, {});
|
|
3096
|
-
return () => ye(
|
|
3219
|
+
return () => ye(Vs, { ref: t, ...r, ...l, ...m, ...g }, s);
|
|
3097
3220
|
}
|
|
3098
3221
|
), o];
|
|
3099
3222
|
}
|
|
3100
|
-
let
|
|
3101
|
-
async function
|
|
3102
|
-
return
|
|
3223
|
+
let le = null;
|
|
3224
|
+
async function zt() {
|
|
3225
|
+
return le || (le = await import("nprogress"), le.configure({
|
|
3103
3226
|
showSpinner: !0,
|
|
3104
3227
|
speed: 300
|
|
3105
|
-
}),
|
|
3228
|
+
}), le);
|
|
3106
3229
|
}
|
|
3107
|
-
async function
|
|
3108
|
-
(await
|
|
3230
|
+
async function ol() {
|
|
3231
|
+
(await zt())?.start();
|
|
3109
3232
|
}
|
|
3110
|
-
async function
|
|
3111
|
-
(await
|
|
3233
|
+
async function nl() {
|
|
3234
|
+
(await zt())?.done();
|
|
3112
3235
|
}
|
|
3113
3236
|
export {
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3237
|
+
zn as FormApi,
|
|
3238
|
+
an as Modal,
|
|
3239
|
+
Ws as ModalTypes,
|
|
3240
|
+
Ys as SunnyBatchSelect,
|
|
3241
|
+
Qs as SunnyForm,
|
|
3242
|
+
dn as SunnyIcon,
|
|
3243
|
+
Gs as SunnyScrollbar,
|
|
3244
|
+
Ks as SunnySearchInputTag,
|
|
3245
|
+
Fn as SunnySelect,
|
|
3246
|
+
qs as SunnyUpload,
|
|
3247
|
+
ll as patterns,
|
|
3248
|
+
Xs as setupSunnyForm,
|
|
3249
|
+
ol as startProgress,
|
|
3250
|
+
nl as stopProgress,
|
|
3251
|
+
el as useSunnyEditGrid,
|
|
3252
|
+
Zs as useSunnyForm,
|
|
3253
|
+
Hs as useSunnyModal,
|
|
3254
|
+
tl as useSunnyQueryGrid,
|
|
3255
|
+
Is as z
|
|
3133
3256
|
};
|