@maxtan/ez-ui 0.15.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1026 -822
- package/dist/types/index.d.ts +1933 -0
- package/package.json +4 -3
- package/dist/types/components/checkbox/index.d.ts +0 -45
- package/dist/types/components/checkbox/src/checkbox.d.ts +0 -12
- package/dist/types/components/checkbox/src/checkbox.vue.d.ts +0 -17
- package/dist/types/components/dialog/index.d.ts +0 -58
- package/dist/types/components/dialog/src/dialog.d.ts +0 -17
- package/dist/types/components/dialog/src/dialog.vue.d.ts +0 -33
- package/dist/types/components/dynamic-form/index.d.ts +0 -245
- package/dist/types/components/dynamic-form/src/dynamic-form.d.ts +0 -128
- package/dist/types/components/dynamic-form/src/dynamic-form.vue.d.ts +0 -398
- package/dist/types/components/fast-table/index.d.ts +0 -71
- package/dist/types/components/fast-table/src/column-config.vue.d.ts +0 -21
- package/dist/types/components/fast-table/src/fast-table.d.ts +0 -51
- package/dist/types/components/fast-table/src/fast-table.vue.d.ts +0 -48
- package/dist/types/components/fast-table/src/use-fast-table.d.ts +0 -13
- package/dist/types/components/icon/index.d.ts +0 -30
- package/dist/types/components/icon/src/icon.d.ts +0 -4
- package/dist/types/components/icon/src/icon.vue.d.ts +0 -23
- package/dist/types/components/image-upload/index.d.ts +0 -479
- package/dist/types/components/image-upload/src/image-upload.d.ts +0 -36
- package/dist/types/components/image-upload/src/image-upload.vue.d.ts +0 -432
- package/dist/types/components/index.d.ts +0 -11
- package/dist/types/components/pagination/index.d.ts +0 -49
- package/dist/types/components/pagination/src/pagination.d.ts +0 -2
- package/dist/types/components/pagination/src/pagination.vue.d.ts +0 -16
- package/dist/types/components/radio/index.d.ts +0 -45
- package/dist/types/components/radio/src/radio.d.ts +0 -10
- package/dist/types/components/radio/src/radio.vue.d.ts +0 -16
- package/dist/types/components/search-form/index.d.ts +0 -50
- package/dist/types/components/search-form/src/search-form.d.ts +0 -4
- package/dist/types/components/search-form/src/search-form.vue.d.ts +0 -35
- package/dist/types/components/select/index.d.ts +0 -37
- package/dist/types/components/select/src/select.d.ts +0 -20
- package/dist/types/components/select/src/select.vue.d.ts +0 -13
- package/dist/types/components/table/index.d.ts +0 -49
- package/dist/types/components/table/src/table.d.ts +0 -27
- package/dist/types/components/table/src/table.vue.d.ts +0 -30
- package/dist/types/ez-ui/component.d.ts +0 -1600
- package/dist/types/ez-ui/defaults.d.ts +0 -4
- package/dist/types/ez-ui/index.d.ts +0 -4
- package/dist/types/ez-ui/make-installer.d.ts +0 -4
- package/dist/types/ez-ui/plugin.d.ts +0 -3
- package/dist/types/ez-ui/vite.config.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useLocale as
|
|
3
|
-
const
|
|
4
|
-
for (const
|
|
5
|
-
|
|
6
|
-
},
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
for (const
|
|
11
|
-
|
|
12
|
-
return
|
|
1
|
+
import { useAttrs as Me, computed as T, defineComponent as w, mergeModels as F, useModel as L, createBlock as v, openBlock as o, unref as t, mergeProps as g, withCtx as y, createElementBlock as V, Fragment as P, renderList as W, resolveDynamicComponent as ge, createTextVNode as _, toDisplayString as Y, resolveDirective as Ue, renderSlot as C, createCommentVNode as D, withDirectives as Pe, createElementVNode as N, ref as O, createVNode as M, withModifiers as Ve, normalizeStyle as ie, createSlots as ae, useSlots as je, shallowRef as We, watch as fe, onMounted as ye, normalizeClass as ce, nextTick as Le, onUnmounted as Ke, normalizeProps as Ee, guardReactiveProps as Ye } from "vue";
|
|
2
|
+
import { useLocale as Xe, ElCheckbox as Ne, ElCheckboxButton as Ze, ElCheckboxGroup as Je, ElLoading as be, ElDialog as Qe, ElButton as te, ElSelect as _e, ElOptionGroup as el, ElOption as $e, ElRadio as ll, ElRadioButton as tl, ElRadioGroup as al, ElUpload as ke, ElImage as we, ElImageViewer as ol, ElMessage as se, ElFormItem as nl, ElInput as me, ElInputNumber as sl, ElDatePicker as de, ElTimePicker as Se, ElSwitch as rl, ElTreeSelect as il, ElCascader as ul, ElTree as dl, ElSlider as cl, ElRate as fl, ElForm as ml, ElRow as ze, ElCol as Ce, ElTable as pl, ElTableColumn as Ae, ElPagination as vl, ElDrawer as gl, ElInfiniteScroll as yl, ElMessageBox as bl, ElNotification as hl, ElPopoverDirective as Vl } from "element-plus";
|
|
3
|
+
const G = (e, c) => (e.install = (l) => {
|
|
4
|
+
for (const i of [e, ...Object.values({})])
|
|
5
|
+
i.name ? l.component(i.name, i) : process.env.NODE_ENV !== "production" && console.warn("[withInstall] Component is missing name property:", i);
|
|
6
|
+
}, e);
|
|
7
|
+
function oe(e = []) {
|
|
8
|
+
const c = Me(), l = T(() => {
|
|
9
|
+
const f = {};
|
|
10
|
+
for (const n in c)
|
|
11
|
+
e.includes(n) || (f[n] = c[n]);
|
|
12
|
+
return f;
|
|
13
|
+
}), i = T(() => {
|
|
14
|
+
const f = {};
|
|
15
|
+
for (const n in l.value)
|
|
16
|
+
n.startsWith("on") || (f[n] = l.value[n]);
|
|
17
|
+
return f;
|
|
18
|
+
}), a = T(() => {
|
|
19
|
+
const f = {};
|
|
20
|
+
for (const n in l.value)
|
|
21
|
+
n.startsWith("on") && (f[n] = l.value[n]);
|
|
22
|
+
return f;
|
|
13
23
|
});
|
|
24
|
+
return {
|
|
25
|
+
/** 所有过滤后的属性(包括事件) */
|
|
26
|
+
attrs: l,
|
|
27
|
+
/** 只包含普通属性 */
|
|
28
|
+
props: i,
|
|
29
|
+
/** 只包含事件监听器 */
|
|
30
|
+
listeners: a
|
|
31
|
+
};
|
|
14
32
|
}
|
|
15
|
-
var
|
|
33
|
+
var El = {
|
|
16
34
|
s: {
|
|
17
35
|
label: {
|
|
18
36
|
name: "姓名",
|
|
@@ -92,57 +110,63 @@ var bl = {
|
|
|
92
110
|
}
|
|
93
111
|
}
|
|
94
112
|
};
|
|
95
|
-
const { s:
|
|
96
|
-
function
|
|
97
|
-
return
|
|
113
|
+
const { s: $l } = El;
|
|
114
|
+
function kl(e, c) {
|
|
115
|
+
return c.split(".").reduce((l, i) => l && typeof l == "object" ? l[i] : void 0, e);
|
|
98
116
|
}
|
|
99
|
-
function
|
|
100
|
-
return
|
|
101
|
-
const
|
|
102
|
-
return
|
|
117
|
+
function wl(e, c = {}) {
|
|
118
|
+
return e.replace(/\{\s*(\w+)\s*\}/g, (l, i) => {
|
|
119
|
+
const a = c[i];
|
|
120
|
+
return a !== void 0 ? String(a) : `{${i}}`;
|
|
103
121
|
});
|
|
104
122
|
}
|
|
105
|
-
function
|
|
106
|
-
const { t, lang:
|
|
123
|
+
function ue() {
|
|
124
|
+
const { t: e, lang: c } = Xe();
|
|
107
125
|
return {
|
|
108
|
-
t: (
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
return typeof
|
|
126
|
+
t: (i, a = {}) => {
|
|
127
|
+
const f = e(i, a);
|
|
128
|
+
if (f !== i) return f;
|
|
129
|
+
const n = kl({ s: $l }, i);
|
|
130
|
+
return typeof n == "string" ? wl(n, a) : i;
|
|
113
131
|
},
|
|
114
|
-
lang:
|
|
132
|
+
lang: c
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function Sl(e, c = 200) {
|
|
136
|
+
let l = null;
|
|
137
|
+
return function(...i) {
|
|
138
|
+
l || (l = setTimeout(() => {
|
|
139
|
+
e.apply(this, i), l = null;
|
|
140
|
+
}, c));
|
|
115
141
|
};
|
|
116
142
|
}
|
|
117
|
-
const
|
|
118
|
-
...
|
|
119
|
-
props: /* @__PURE__ */
|
|
143
|
+
const zl = w({ name: "EzCheckbox", inheritAttrs: !1 }), Cl = /* @__PURE__ */ w({
|
|
144
|
+
...zl,
|
|
145
|
+
props: /* @__PURE__ */ F({
|
|
120
146
|
type: { default: "default" },
|
|
121
147
|
options: { default: () => [] }
|
|
122
148
|
}, {
|
|
123
149
|
modelValue: {},
|
|
124
150
|
modelModifiers: {}
|
|
125
151
|
}),
|
|
126
|
-
emits:
|
|
127
|
-
setup(
|
|
128
|
-
const
|
|
129
|
-
() => ["default", "border"].includes(
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
(r(!0), w(O, null, W(t.options, (E) => (r(), p(ce(V.value), h({
|
|
139
|
-
key: String(E.value),
|
|
152
|
+
emits: ["update:modelValue"],
|
|
153
|
+
setup(e) {
|
|
154
|
+
const c = e, l = L(e, "modelValue"), { attrs: i } = oe(["options", "type", "modelValue"]), a = T(
|
|
155
|
+
() => ["default", "border"].includes(c.type) ? Ne : Ze
|
|
156
|
+
);
|
|
157
|
+
return (f, n) => (o(), v(t(Je), g({
|
|
158
|
+
modelValue: l.value,
|
|
159
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => l.value = m)
|
|
160
|
+
}, t(i)), {
|
|
161
|
+
default: y(() => [
|
|
162
|
+
(o(!0), V(P, null, W(e.options, (m) => (o(), v(ge(a.value), g({
|
|
163
|
+
key: String(m.value),
|
|
140
164
|
ref_for: !0
|
|
141
|
-
},
|
|
142
|
-
border:
|
|
165
|
+
}, m, {
|
|
166
|
+
border: e.type === "border"
|
|
143
167
|
}), {
|
|
144
|
-
default:
|
|
145
|
-
|
|
168
|
+
default: y(() => [
|
|
169
|
+
_(Y(m.label), 1)
|
|
146
170
|
]),
|
|
147
171
|
_: 2
|
|
148
172
|
}, 1040, ["border"]))), 128))
|
|
@@ -150,14 +174,14 @@ const wl = $({ name: "EzCheckbox", inheritAttrs: !1 }), $l = /* @__PURE__ */ $({
|
|
|
150
174
|
_: 1
|
|
151
175
|
}, 16, ["modelValue"]));
|
|
152
176
|
}
|
|
153
|
-
}),
|
|
154
|
-
var re = /* @__PURE__ */ ((
|
|
155
|
-
const
|
|
177
|
+
}), Be = G(Cl);
|
|
178
|
+
var re = /* @__PURE__ */ ((e) => (e.CANCEL = "取消", e.CONFIRM = "确定", e))(re || {});
|
|
179
|
+
const Al = { key: 1 }, Dl = {
|
|
156
180
|
key: 0,
|
|
157
181
|
class: "ez-dialog__body"
|
|
158
|
-
},
|
|
159
|
-
...
|
|
160
|
-
props: /* @__PURE__ */
|
|
182
|
+
}, Tl = { key: 1 }, Rl = w({ name: "EzDialog", inheritAttrs: !1, directives: { loading: be.directive } }), xl = /* @__PURE__ */ w({
|
|
183
|
+
...Rl,
|
|
184
|
+
props: /* @__PURE__ */ F({
|
|
161
185
|
title: { default: "" },
|
|
162
186
|
loading: { type: Boolean, default: !1 },
|
|
163
187
|
cancelText: { default: re.CANCEL },
|
|
@@ -166,135 +190,128 @@ const Cl = { key: 1 }, kl = {
|
|
|
166
190
|
modelValue: { type: Boolean },
|
|
167
191
|
modelModifiers: {}
|
|
168
192
|
}),
|
|
169
|
-
emits: /* @__PURE__ */
|
|
170
|
-
setup(
|
|
171
|
-
const { t:
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
|
|
193
|
+
emits: /* @__PURE__ */ F(["cancel", "confirm"], ["update:modelValue"]),
|
|
194
|
+
setup(e, { emit: c }) {
|
|
195
|
+
const { t: l } = ue(), i = e, a = c, f = L(e, "modelValue"), { attrs: n } = oe(["title", "loading", "cancelText", "confirmText", "modelValue"]), m = () => {
|
|
196
|
+
f.value = !1, a("cancel");
|
|
197
|
+
}, d = () => {
|
|
198
|
+
a("confirm");
|
|
175
199
|
};
|
|
176
|
-
return (
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
modelValue:
|
|
180
|
-
"onUpdate:modelValue":
|
|
200
|
+
return (s, r) => {
|
|
201
|
+
const R = Ue("loading");
|
|
202
|
+
return o(), v(t(Qe), g({
|
|
203
|
+
modelValue: f.value,
|
|
204
|
+
"onUpdate:modelValue": r[0] || (r[0] = (K) => f.value = K),
|
|
181
205
|
class: "ez-dialog",
|
|
182
206
|
width: 800,
|
|
183
207
|
"append-to-body": !1,
|
|
184
208
|
"close-on-click-modal": !1,
|
|
185
209
|
"destroy-on-close": !0,
|
|
186
210
|
"close-on-press-escape": !1
|
|
187
|
-
},
|
|
188
|
-
header:
|
|
189
|
-
|
|
211
|
+
}, t(n)), {
|
|
212
|
+
header: y(() => [
|
|
213
|
+
s.$slots.header ? C(s.$slots, "header", { key: 0 }) : (o(), V("p", Al, Y(i.title), 1))
|
|
190
214
|
]),
|
|
191
|
-
default:
|
|
192
|
-
|
|
193
|
-
default
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
]),
|
|
198
|
-
_: 3
|
|
199
|
-
})), [
|
|
200
|
-
[L, s.loading]
|
|
201
|
-
])
|
|
215
|
+
default: y(() => [
|
|
216
|
+
s.$slots.default ? Pe((o(), V("div", Dl, [
|
|
217
|
+
C(s.$slots, "default")
|
|
218
|
+
])), [
|
|
219
|
+
[R, i.loading]
|
|
220
|
+
]) : D("", !0)
|
|
202
221
|
]),
|
|
203
|
-
footer:
|
|
204
|
-
|
|
205
|
-
|
|
222
|
+
footer: y(() => [
|
|
223
|
+
s.$slots.footer ? C(s.$slots, "footer", { key: 0 }) : (o(), V("div", Tl, [
|
|
224
|
+
i.cancelText ? (o(), v(t(te), {
|
|
206
225
|
key: 0,
|
|
207
226
|
type: "default",
|
|
208
|
-
onClick:
|
|
227
|
+
onClick: m
|
|
209
228
|
}, {
|
|
210
|
-
default:
|
|
211
|
-
|
|
229
|
+
default: y(() => [
|
|
230
|
+
_(Y(i.cancelText === t(re).CANCEL ? t(l)("s.button.cancel") : i.cancelText), 1)
|
|
212
231
|
]),
|
|
213
232
|
_: 1
|
|
214
|
-
})) :
|
|
215
|
-
|
|
233
|
+
})) : D("", !0),
|
|
234
|
+
i.confirmText ? (o(), v(t(te), {
|
|
216
235
|
key: 1,
|
|
217
236
|
type: "primary",
|
|
218
|
-
loading:
|
|
219
|
-
onClick:
|
|
237
|
+
loading: i.loading,
|
|
238
|
+
onClick: d
|
|
220
239
|
}, {
|
|
221
|
-
default:
|
|
222
|
-
|
|
240
|
+
default: y(() => [
|
|
241
|
+
_(Y(i.confirmText === t(re).CONFIRM ? t(l)("s.button.confirm") : i.confirmText), 1)
|
|
223
242
|
]),
|
|
224
243
|
_: 1
|
|
225
|
-
}, 8, ["loading"])) :
|
|
244
|
+
}, 8, ["loading"])) : D("", !0)
|
|
226
245
|
]))
|
|
227
246
|
]),
|
|
228
247
|
_: 3
|
|
229
248
|
}, 16, ["modelValue"]);
|
|
230
249
|
};
|
|
231
250
|
}
|
|
232
|
-
}),
|
|
251
|
+
}), Ml = G(xl), Ul = w({ name: "EzSelect", inheritAttrs: !1 }), Pl = /* @__PURE__ */ w({
|
|
233
252
|
...Ul,
|
|
234
|
-
props: /* @__PURE__ */
|
|
253
|
+
props: /* @__PURE__ */ F({
|
|
235
254
|
options: { default: () => [] }
|
|
236
255
|
}, {
|
|
237
256
|
modelValue: {},
|
|
238
257
|
modelModifiers: {}
|
|
239
258
|
}),
|
|
240
259
|
emits: ["update:modelValue"],
|
|
241
|
-
setup(
|
|
242
|
-
const
|
|
243
|
-
return (
|
|
244
|
-
modelValue:
|
|
245
|
-
"onUpdate:modelValue":
|
|
260
|
+
setup(e) {
|
|
261
|
+
const c = L(e, "modelValue"), { attrs: l } = oe(["options", "modelValue"]), i = (n) => typeof n > "u", a = (n) => !i(n.options), f = (n, m) => n.value != null && typeof n.value != "object" ? String(n.value) : m;
|
|
262
|
+
return (n, m) => (o(), v(t(_e), g({
|
|
263
|
+
modelValue: c.value,
|
|
264
|
+
"onUpdate:modelValue": m[0] || (m[0] = (d) => c.value = d),
|
|
246
265
|
clearable: ""
|
|
247
|
-
},
|
|
248
|
-
default:
|
|
249
|
-
(
|
|
250
|
-
key:
|
|
266
|
+
}, t(l)), {
|
|
267
|
+
default: y(() => [
|
|
268
|
+
(o(!0), V(P, null, W(e.options, (d, s) => (o(), V(P, {
|
|
269
|
+
key: f(d, s)
|
|
251
270
|
}, [
|
|
252
|
-
|
|
271
|
+
a(d) ? (o(), v(t(el), g({
|
|
253
272
|
key: 0,
|
|
254
273
|
ref_for: !0
|
|
255
|
-
},
|
|
256
|
-
default:
|
|
257
|
-
(
|
|
258
|
-
key:
|
|
259
|
-
}, { ref_for: !0 },
|
|
274
|
+
}, d), {
|
|
275
|
+
default: y(() => [
|
|
276
|
+
(o(!0), V(P, null, W(d.options, (r) => (o(), v(t($e), g({
|
|
277
|
+
key: f(r, r.value)
|
|
278
|
+
}, { ref_for: !0 }, r), null, 16))), 128))
|
|
260
279
|
]),
|
|
261
280
|
_: 2
|
|
262
|
-
}, 1040)) : (
|
|
281
|
+
}, 1040)) : (o(), v(t($e), g({
|
|
263
282
|
key: 1,
|
|
264
283
|
ref_for: !0
|
|
265
|
-
},
|
|
284
|
+
}, d), null, 16))
|
|
266
285
|
], 64))), 128))
|
|
267
286
|
]),
|
|
268
287
|
_: 1
|
|
269
288
|
}, 16, ["modelValue"]));
|
|
270
289
|
}
|
|
271
|
-
}),
|
|
272
|
-
...
|
|
273
|
-
props: /* @__PURE__ */
|
|
290
|
+
}), Ie = G(Pl), Ll = w({ name: "EzRadio", inheritAttrs: !1 }), Nl = /* @__PURE__ */ w({
|
|
291
|
+
...Ll,
|
|
292
|
+
props: /* @__PURE__ */ F({
|
|
274
293
|
type: { default: "default" },
|
|
275
294
|
options: { default: () => [] }
|
|
276
295
|
}, {
|
|
277
296
|
modelValue: { type: [String, Number, Boolean] },
|
|
278
297
|
modelModifiers: {}
|
|
279
298
|
}),
|
|
280
|
-
emits:
|
|
281
|
-
setup(
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
(r(!0), w(O, null, W(t.options, (E) => (r(), p(ce(V.value), h({
|
|
291
|
-
key: String(E.value),
|
|
299
|
+
emits: ["update:modelValue"],
|
|
300
|
+
setup(e) {
|
|
301
|
+
const c = e, l = L(e, "modelValue"), { attrs: i } = oe(["options", "type", "modelValue"]), a = T(() => ["default", "border"].includes(c.type) ? ll : tl);
|
|
302
|
+
return (f, n) => (o(), v(t(al), g({
|
|
303
|
+
modelValue: l.value,
|
|
304
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => l.value = m)
|
|
305
|
+
}, t(i)), {
|
|
306
|
+
default: y(() => [
|
|
307
|
+
(o(!0), V(P, null, W(e.options, (m) => (o(), v(ge(a.value), g({
|
|
308
|
+
key: String(m.value),
|
|
292
309
|
ref_for: !0
|
|
293
|
-
},
|
|
294
|
-
border:
|
|
310
|
+
}, m, {
|
|
311
|
+
border: e.type === "border"
|
|
295
312
|
}), {
|
|
296
|
-
default:
|
|
297
|
-
|
|
313
|
+
default: y(() => [
|
|
314
|
+
_(Y(m.label), 1)
|
|
298
315
|
]),
|
|
299
316
|
_: 2
|
|
300
317
|
}, 1040, ["border"]))), 128))
|
|
@@ -302,136 +319,136 @@ const Cl = { key: 1 }, kl = {
|
|
|
302
319
|
_: 1
|
|
303
320
|
}, 16, ["modelValue"]));
|
|
304
321
|
}
|
|
305
|
-
}),
|
|
306
|
-
...
|
|
322
|
+
}), Oe = G(Nl), Bl = w({ name: "EzIcon", inheritAttrs: !1 }), Il = /* @__PURE__ */ w({
|
|
323
|
+
...Bl,
|
|
307
324
|
props: {
|
|
308
325
|
size: { default: 20 },
|
|
309
326
|
color: { default: "inherit" }
|
|
310
327
|
},
|
|
311
|
-
setup(
|
|
312
|
-
const
|
|
313
|
-
const { size:
|
|
314
|
-
return !
|
|
315
|
-
fontSize:
|
|
316
|
-
color:
|
|
328
|
+
setup(e) {
|
|
329
|
+
const c = e, l = T(() => {
|
|
330
|
+
const { size: i, color: a } = c;
|
|
331
|
+
return !i && !a ? {} : {
|
|
332
|
+
fontSize: i ? `${i}px` : void 0,
|
|
333
|
+
color: a
|
|
317
334
|
};
|
|
318
335
|
});
|
|
319
|
-
return (
|
|
336
|
+
return (i, a) => (o(), V("i", g({
|
|
320
337
|
class: "ez-icon",
|
|
321
|
-
style:
|
|
322
|
-
},
|
|
323
|
-
|
|
338
|
+
style: l.value
|
|
339
|
+
}, i.$attrs), [
|
|
340
|
+
C(i.$slots, "default", { class: "w-[1em] h-[1em]" })
|
|
324
341
|
], 16));
|
|
325
342
|
}
|
|
326
|
-
}),
|
|
343
|
+
}), Q = G(Il), Ol = {
|
|
327
344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
328
345
|
width: "200",
|
|
329
346
|
height: "200",
|
|
330
347
|
viewBox: "0 0 1024 1024"
|
|
331
|
-
},
|
|
348
|
+
}, ql = /* @__PURE__ */ w({
|
|
332
349
|
name: "ArrowDown",
|
|
333
350
|
__name: "ArrowDown",
|
|
334
|
-
setup(
|
|
335
|
-
return (
|
|
336
|
-
|
|
351
|
+
setup(e) {
|
|
352
|
+
return (c, l) => (o(), V("svg", Ol, [...l[0] || (l[0] = [
|
|
353
|
+
N("path", {
|
|
337
354
|
fill: "currentColor",
|
|
338
355
|
d: "m832 340.992-320 312-320-312a28.8 28.8 0 0 0-20.992-8.96 28.8 28.8 0 0 0-20.992 8.96 28.8 28.8 0 0 0-8.96 20.992c0 8 2.624 14.72 8 19.968l340.992 332.032c5.952 6.016 13.312 8.96 22.016 8.96 8.64 0 16-2.944 22.016-8.96l340.992-331.008a31.23 31.23 0 0 0 8-21.504c0-8.32-3.008-15.36-8.96-20.992a29.76 29.76 0 0 0-42.048.448v.064z"
|
|
339
356
|
}, null, -1)
|
|
340
357
|
])]));
|
|
341
358
|
}
|
|
342
|
-
}),
|
|
359
|
+
}), Fl = {
|
|
343
360
|
xmlns: "http://www.w3.org/2000/svg",
|
|
344
361
|
width: "200",
|
|
345
362
|
height: "200",
|
|
346
363
|
viewBox: "0 0 1024 1024"
|
|
347
|
-
},
|
|
364
|
+
}, Gl = /* @__PURE__ */ w({
|
|
348
365
|
name: "ArrowUp",
|
|
349
366
|
__name: "ArrowUp",
|
|
350
|
-
setup(
|
|
351
|
-
return (
|
|
352
|
-
|
|
367
|
+
setup(e) {
|
|
368
|
+
return (c, l) => (o(), V("svg", Fl, [...l[0] || (l[0] = [
|
|
369
|
+
N("path", {
|
|
353
370
|
fill: "currentColor",
|
|
354
371
|
d: "M488.96 344 148.992 700.992a32.26 32.26 0 0 0-8.96 22.016c0 8 2.944 15.36 8.96 22.016v1.024c6.016 5.952 13.184 8.96 21.504 8.96S185.984 752 192 746.048l320-336 320 336c6.016 5.952 13.184 8.96 21.504 8.96s15.488-3.008 21.504-8.96v-1.024a32.26 32.26 0 0 0 8.96-22.016 32.26 32.26 0 0 0-8.96-22.016L534.976 344A31.17 31.17 0 0 0 512 335.04a31.17 31.17 0 0 0-23.04 8.96"
|
|
355
372
|
}, null, -1)
|
|
356
373
|
])]));
|
|
357
374
|
}
|
|
358
|
-
}),
|
|
375
|
+
}), Hl = {
|
|
359
376
|
xmlns: "http://www.w3.org/2000/svg",
|
|
360
377
|
width: "200",
|
|
361
378
|
height: "200",
|
|
362
379
|
viewBox: "0 0 1024 1024"
|
|
363
|
-
},
|
|
380
|
+
}, De = /* @__PURE__ */ w({
|
|
364
381
|
name: "Delete",
|
|
365
382
|
__name: "delete",
|
|
366
|
-
setup(
|
|
367
|
-
return (
|
|
368
|
-
|
|
383
|
+
setup(e) {
|
|
384
|
+
return (c, l) => (o(), V("svg", Hl, [...l[0] || (l[0] = [
|
|
385
|
+
N("path", {
|
|
369
386
|
fill: "currentColor",
|
|
370
387
|
d: "M218.88 118.592C208 139.968 208 168 208 245.376V272H96a32 32 0 1 0 0 64h832a32 32 0 0 0 0-64H816v-26.624c0-77.44 0-105.408-10.88-126.72a100.03 100.03 0 0 0-43.712-43.776C740.032 64 712 64 634.624 64H389.376c-77.44 0-105.408 0-126.72 10.88-18.88 9.6-34.176 24.96-43.776 43.712M752 272H272v-64c0-28.032 0-42.304 5.568-52.992a50.24 50.24 0 0 1 21.44-21.44C309.76 128.064 323.968 128 352 128h320c28.032 0 42.304 0 52.992 5.568 9.152 4.736 16.64 12.288 21.44 21.44C751.936 165.696 752 179.968 752 208zM192 416a32 32 0 0 0-32 32v358.4c0 53.76.128 81.28 10.688 101.76a96.54 96.54 0 0 0 41.216 41.152C232.384 959.872 259.84 960 313.6 960h396.8c53.76 0 81.28-.128 101.76-10.688a96.54 96.54 0 0 0 41.152-41.216C863.872 887.616 864 860.16 864 806.4V448a32 32 0 0 0-64 0v371.2c0 26.88 0 40.64-5.376 50.88a48.2 48.2 0 0 1-20.544 20.544c-10.24 5.312-24 5.376-50.88 5.376H300.8c-26.88 0-40.64 0-50.88-5.376a48.2 48.2 0 0 1-20.544-20.544c-5.312-10.24-5.376-24-5.376-50.88V448a32 32 0 0 0-32-32m216 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32m208 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32"
|
|
371
388
|
}, null, -1)
|
|
372
389
|
])]));
|
|
373
390
|
}
|
|
374
|
-
}),
|
|
391
|
+
}), jl = {
|
|
375
392
|
xmlns: "http://www.w3.org/2000/svg",
|
|
376
393
|
width: "200",
|
|
377
394
|
height: "200",
|
|
378
395
|
viewBox: "0 0 1024 1024"
|
|
379
|
-
},
|
|
396
|
+
}, Te = /* @__PURE__ */ w({
|
|
380
397
|
name: "Plus",
|
|
381
398
|
__name: "plus",
|
|
382
|
-
setup(
|
|
383
|
-
return (
|
|
384
|
-
|
|
399
|
+
setup(e) {
|
|
400
|
+
return (c, l) => (o(), V("svg", jl, [...l[0] || (l[0] = [
|
|
401
|
+
N("path", {
|
|
385
402
|
fill: "currentColor",
|
|
386
403
|
d: "M512 96a32 32 0 0 0-32 32v352H128a32 32 0 1 0 0 64h352v352a32 32 0 0 0 64 0V544h352a32 32 0 0 0 0-64H544V128a32 32 0 0 0-32-32"
|
|
387
404
|
}, null, -1)
|
|
388
405
|
])]));
|
|
389
406
|
}
|
|
390
|
-
}),
|
|
407
|
+
}), Wl = {
|
|
391
408
|
xmlns: "http://www.w3.org/2000/svg",
|
|
392
409
|
width: "200",
|
|
393
410
|
height: "200",
|
|
394
411
|
viewBox: "0 0 1024 1024"
|
|
395
|
-
},
|
|
412
|
+
}, Kl = /* @__PURE__ */ w({
|
|
396
413
|
name: "Setting",
|
|
397
414
|
__name: "setting",
|
|
398
|
-
setup(
|
|
399
|
-
return (
|
|
400
|
-
|
|
415
|
+
setup(e) {
|
|
416
|
+
return (c, l) => (o(), V("svg", Wl, [...l[0] || (l[0] = [
|
|
417
|
+
N("path", {
|
|
401
418
|
fill: "currentColor",
|
|
402
419
|
d: "M218.688 848q27.712 48 83.2 48h374.08q55.424 0 83.136-48l187.008-323.968q27.776-48 0-96L759.104 104.064q-27.712-48-83.2-48H301.952q-55.488 0-83.2 48L31.68 428.032q-27.712 48 0 96zm55.424-32L87.104 492.032q-9.216-16 0-32l187.008-323.968q9.28-16 27.776-16h374.08q18.432 0 27.712 16l187.008 323.968q9.28 16 0 32L703.68 816q-9.28 16-27.712 16h-374.08q-18.56 0-27.776-16m54.784-339.968a160 160 0 1 0 320 0 160 160 0 0 0-320 0m64 0a96 96 0 1 1 192 0 96 96 0 0 1-192 0"
|
|
403
420
|
}, null, -1)
|
|
404
421
|
])]));
|
|
405
422
|
}
|
|
406
|
-
}),
|
|
423
|
+
}), Yl = {
|
|
407
424
|
xmlns: "http://www.w3.org/2000/svg",
|
|
408
425
|
width: "200",
|
|
409
426
|
height: "200",
|
|
410
427
|
viewBox: "0 0 1024 1024"
|
|
411
|
-
},
|
|
428
|
+
}, Re = /* @__PURE__ */ w({
|
|
412
429
|
name: "ZoomIn",
|
|
413
430
|
__name: "ZoomIn",
|
|
414
|
-
setup(
|
|
415
|
-
return (
|
|
416
|
-
|
|
431
|
+
setup(e) {
|
|
432
|
+
return (c, l) => (o(), V("svg", Yl, [...l[0] || (l[0] = [
|
|
433
|
+
N("path", {
|
|
417
434
|
fill: "currentColor",
|
|
418
435
|
d: "M764.352 809.6a424 424 0 1 1 45.184-45.184l139.456 139.392a31.936 31.936 0 1 1-45.184 45.184L764.352 809.536zM848 488a360 360 0 1 0-720 0 360 360 0 0 0 720 0"
|
|
419
436
|
}, null, -1),
|
|
420
|
-
|
|
437
|
+
N("path", {
|
|
421
438
|
fill: "currentColor",
|
|
422
439
|
d: "M294.4 486.4a32 32 0 0 0 32 32h128v128a32 32 0 0 0 64 0v-128h128a32 32 0 0 0 0-64h-128v-128a32 32 0 0 0-64 0v128h-128a32 32 0 0 0-32 32"
|
|
423
440
|
}, null, -1)
|
|
424
441
|
])]));
|
|
425
442
|
}
|
|
426
|
-
}),
|
|
443
|
+
}), Xl = { class: "ez-image-upload" }, Zl = {
|
|
427
444
|
key: 0,
|
|
428
445
|
class: "ez-image-upload__image"
|
|
429
|
-
},
|
|
446
|
+
}, Jl = {
|
|
430
447
|
key: 1,
|
|
431
448
|
class: "ez-image-upload__list"
|
|
432
|
-
},
|
|
433
|
-
...
|
|
434
|
-
props: /* @__PURE__ */
|
|
449
|
+
}, Ql = { class: "flex items-center justify-center h-full" }, _l = w({ name: "EzImageUpload", inheritAttrs: !1 }), et = /* @__PURE__ */ w({
|
|
450
|
+
..._l,
|
|
451
|
+
props: /* @__PURE__ */ F({
|
|
435
452
|
api: { type: Function, default: () => Promise.resolve({ url: "" }) },
|
|
436
453
|
imageTypes: { default: () => ["image/webp", "image/png", "image/jpg", "image/gif", "image/bmp", "image/jpeg"] },
|
|
437
454
|
limitSize: { default: 10 },
|
|
@@ -445,566 +462,739 @@ const Cl = { key: 1 }, kl = {
|
|
|
445
462
|
modelModifiers: {}
|
|
446
463
|
}),
|
|
447
464
|
emits: ["update:modelValue"],
|
|
448
|
-
setup(
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
465
|
+
setup(e, { expose: c }) {
|
|
466
|
+
const l = e, { attrs: i } = oe([
|
|
467
|
+
"api",
|
|
468
|
+
"imageTypes",
|
|
469
|
+
"limitSize",
|
|
470
|
+
"style",
|
|
471
|
+
"fit",
|
|
472
|
+
"multiple",
|
|
473
|
+
"limit",
|
|
474
|
+
"disabled",
|
|
475
|
+
"modelValue"
|
|
476
|
+
]), { t: a } = ue(), f = O(!1), n = O(0), m = L(e, "modelValue"), d = T(() => l.multiple), s = /^(https?:\/\/|data:|blob:)/i, r = T(() => m.value ? R(m.value) : []);
|
|
477
|
+
function R($) {
|
|
478
|
+
if (!$) return [];
|
|
479
|
+
const E = /^(https?:\/\/|data:|blob:)/i;
|
|
480
|
+
let z = [], U = "", B = !1;
|
|
481
|
+
$ = $.trim().replace(/,$/, "");
|
|
482
|
+
const ee = $.split(",");
|
|
483
|
+
for (let u = 0; u < ee.length; u++) {
|
|
484
|
+
const k = ee[u].trim();
|
|
485
|
+
k && (E.test(k) ? (B && U && z.push(U.trim()), U = k, B = !0) : B ? U += "," + k : E.test(k.trim()) && z.push(k.trim()));
|
|
459
486
|
}
|
|
460
|
-
return
|
|
487
|
+
return B && U && z.push(U.trim()), z.filter((u) => u && E.test(u));
|
|
461
488
|
}
|
|
462
|
-
function
|
|
463
|
-
return
|
|
489
|
+
function K($) {
|
|
490
|
+
return !$ || $.length === 0 ? "" : $.filter((E) => E.trim()).map((E) => E.trim()).join(",");
|
|
464
491
|
}
|
|
465
|
-
const
|
|
466
|
-
if (!
|
|
492
|
+
const H = ($) => l.disabled ? (se.warning(a("s.message.disabled")), !1) : l.imageTypes.includes($.type.toLocaleLowerCase()) ? $.size > l.limitSize * 1024 * 1024 ? (se.error(a("s.validate.upload.limit", { max: l.limitSize })), !1) : !0 : (se.error(a("s.validate.upload.image")), !1), j = async ({ file: $ }) => {
|
|
493
|
+
if (!l.disabled)
|
|
467
494
|
try {
|
|
468
|
-
const { url:
|
|
469
|
-
if (!
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
|
|
495
|
+
const { url: E } = await l.api($);
|
|
496
|
+
if (!E) throw new Error(a("s.message.uploadFail"));
|
|
497
|
+
if (d.value) {
|
|
498
|
+
const z = m.value ? R(m.value) : [];
|
|
499
|
+
E && s.test(E) && (z.push(E), m.value = K(z));
|
|
473
500
|
} else
|
|
474
|
-
|
|
475
|
-
} catch (
|
|
476
|
-
|
|
501
|
+
m.value = E;
|
|
502
|
+
} catch (E) {
|
|
503
|
+
se.error(E.message);
|
|
477
504
|
}
|
|
478
|
-
},
|
|
479
|
-
|
|
480
|
-
},
|
|
481
|
-
if (!
|
|
482
|
-
if (
|
|
483
|
-
const
|
|
484
|
-
|
|
505
|
+
}, X = ($, E = 0) => {
|
|
506
|
+
$ && (n.value = E, f.value = !0);
|
|
507
|
+
}, Z = ($) => {
|
|
508
|
+
if (!l.disabled && !(!$ || !m.value))
|
|
509
|
+
if (d.value) {
|
|
510
|
+
const E = R(m.value), z = E.findIndex((U) => U === $);
|
|
511
|
+
z !== -1 && (E.splice(z, 1), m.value = E.join(","));
|
|
485
512
|
} else
|
|
486
|
-
|
|
487
|
-
},
|
|
488
|
-
return
|
|
489
|
-
getUploadRef: () =>
|
|
490
|
-
getUrlList: () =>
|
|
491
|
-
}), (
|
|
492
|
-
|
|
493
|
-
(
|
|
494
|
-
key:
|
|
513
|
+
m.value = null;
|
|
514
|
+
}, J = O();
|
|
515
|
+
return c({
|
|
516
|
+
getUploadRef: () => J.value,
|
|
517
|
+
getUrlList: () => r.value
|
|
518
|
+
}), ($, E) => (o(), V("div", Xl, [
|
|
519
|
+
d.value ? (o(), V("div", Jl, [
|
|
520
|
+
(o(!0), V(P, null, W(r.value, (z, U) => (o(), V("div", {
|
|
521
|
+
key: U,
|
|
495
522
|
class: "ez-image-upload__item",
|
|
496
|
-
style:
|
|
523
|
+
style: ie(l.style)
|
|
497
524
|
}, [
|
|
498
|
-
|
|
499
|
-
src:
|
|
500
|
-
fit:
|
|
525
|
+
M(t(we), {
|
|
526
|
+
src: z,
|
|
527
|
+
fit: l.fit
|
|
501
528
|
}, null, 8, ["src", "fit"]),
|
|
502
|
-
|
|
529
|
+
N("div", {
|
|
503
530
|
class: "ez-image-upload__handler",
|
|
504
|
-
onClick:
|
|
531
|
+
onClick: E[3] || (E[3] = Ve(() => {
|
|
505
532
|
}, ["stop"]))
|
|
506
533
|
}, [
|
|
507
|
-
|
|
534
|
+
M(t(Q), {
|
|
508
535
|
size: 18,
|
|
509
|
-
onClick: (
|
|
536
|
+
onClick: (B) => X(z, U)
|
|
510
537
|
}, {
|
|
511
|
-
default:
|
|
512
|
-
|
|
538
|
+
default: y(() => [
|
|
539
|
+
M(t(Re))
|
|
513
540
|
]),
|
|
514
541
|
_: 1
|
|
515
542
|
}, 8, ["onClick"]),
|
|
516
|
-
|
|
543
|
+
l.disabled ? D("", !0) : (o(), v(t(Q), {
|
|
517
544
|
key: 0,
|
|
518
545
|
size: 18,
|
|
519
|
-
onClick: (
|
|
546
|
+
onClick: (B) => Z(z)
|
|
520
547
|
}, {
|
|
521
|
-
default:
|
|
522
|
-
|
|
548
|
+
default: y(() => [
|
|
549
|
+
M(t(De))
|
|
523
550
|
]),
|
|
524
551
|
_: 1
|
|
525
552
|
}, 8, ["onClick"]))
|
|
526
553
|
])
|
|
527
554
|
], 4))), 128)),
|
|
528
|
-
|
|
555
|
+
r.value.length < l.limit && !l.disabled || r.value.length === 0 ? (o(), v(t(ke), g({ key: 0 }, t(i), {
|
|
529
556
|
ref_key: "uploadRef",
|
|
530
|
-
ref:
|
|
557
|
+
ref: J,
|
|
531
558
|
action: "",
|
|
532
559
|
accept: "image/*",
|
|
533
560
|
"show-file-list": !1,
|
|
534
|
-
"before-upload":
|
|
561
|
+
"before-upload": H,
|
|
535
562
|
"http-request": j,
|
|
536
|
-
style:
|
|
537
|
-
disabled:
|
|
538
|
-
class: [{ "is-disabled":
|
|
563
|
+
style: l.style,
|
|
564
|
+
disabled: l.disabled,
|
|
565
|
+
class: [{ "is-disabled": l.disabled }, "ez-image-upload__item ez-image-upload__button"]
|
|
539
566
|
}), {
|
|
540
|
-
default:
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
default:
|
|
544
|
-
|
|
567
|
+
default: y(() => [
|
|
568
|
+
N("div", Ql, [
|
|
569
|
+
M(t(Q), null, {
|
|
570
|
+
default: y(() => [
|
|
571
|
+
M(t(Te))
|
|
545
572
|
]),
|
|
546
573
|
_: 1
|
|
547
574
|
})
|
|
548
575
|
])
|
|
549
576
|
]),
|
|
550
577
|
_: 1
|
|
551
|
-
}, 16, ["style", "disabled", "class"])) :
|
|
552
|
-
])) : (
|
|
578
|
+
}, 16, ["style", "disabled", "class"])) : D("", !0)
|
|
579
|
+
])) : (o(), v(t(ke), g({ key: 0 }, t(i), {
|
|
553
580
|
ref_key: "uploadRef",
|
|
554
|
-
ref:
|
|
581
|
+
ref: J,
|
|
555
582
|
action: "",
|
|
556
583
|
accept: "image/*",
|
|
557
584
|
"show-file-list": !1,
|
|
558
|
-
"before-upload":
|
|
585
|
+
"before-upload": H,
|
|
559
586
|
"http-request": j,
|
|
560
|
-
style:
|
|
561
|
-
disabled:
|
|
562
|
-
class: ["ez-image-upload__wrapper", { "is-disabled":
|
|
587
|
+
style: l.style,
|
|
588
|
+
disabled: l.disabled,
|
|
589
|
+
class: ["ez-image-upload__wrapper", { "is-disabled": l.disabled }]
|
|
563
590
|
}), {
|
|
564
|
-
default:
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
src:
|
|
568
|
-
fit:
|
|
591
|
+
default: y(() => [
|
|
592
|
+
m.value ? (o(), V("div", Zl, [
|
|
593
|
+
M(t(we), {
|
|
594
|
+
src: m.value,
|
|
595
|
+
fit: l.fit
|
|
569
596
|
}, null, 8, ["src", "fit"]),
|
|
570
|
-
|
|
597
|
+
N("div", {
|
|
571
598
|
class: "ez-image-upload__handler",
|
|
572
|
-
onClick:
|
|
599
|
+
onClick: E[2] || (E[2] = Ve(() => {
|
|
573
600
|
}, ["stop"]))
|
|
574
601
|
}, [
|
|
575
|
-
|
|
602
|
+
M(t(Q), {
|
|
576
603
|
size: 18,
|
|
577
|
-
onClick:
|
|
604
|
+
onClick: E[0] || (E[0] = (z) => X(m.value, 0))
|
|
578
605
|
}, {
|
|
579
|
-
default:
|
|
580
|
-
|
|
606
|
+
default: y(() => [
|
|
607
|
+
M(t(Re))
|
|
581
608
|
]),
|
|
582
609
|
_: 1
|
|
583
610
|
}),
|
|
584
|
-
|
|
611
|
+
l.disabled ? D("", !0) : (o(), v(t(Q), {
|
|
585
612
|
key: 0,
|
|
586
613
|
size: 18,
|
|
587
|
-
onClick:
|
|
614
|
+
onClick: E[1] || (E[1] = (z) => Z(m.value))
|
|
588
615
|
}, {
|
|
589
|
-
default:
|
|
590
|
-
|
|
616
|
+
default: y(() => [
|
|
617
|
+
M(t(De))
|
|
591
618
|
]),
|
|
592
619
|
_: 1
|
|
593
620
|
}))
|
|
594
621
|
])
|
|
595
|
-
])) : (
|
|
596
|
-
default:
|
|
597
|
-
|
|
622
|
+
])) : (o(), v(t(Q), { key: 1 }, {
|
|
623
|
+
default: y(() => [
|
|
624
|
+
M(t(Te))
|
|
598
625
|
]),
|
|
599
626
|
_: 1
|
|
600
627
|
}))
|
|
601
628
|
]),
|
|
602
629
|
_: 1
|
|
603
630
|
}, 16, ["style", "disabled", "class"])),
|
|
604
|
-
|
|
631
|
+
f.value ? (o(), v(t(ol), {
|
|
605
632
|
key: 2,
|
|
606
|
-
"url-list":
|
|
607
|
-
"initial-index":
|
|
608
|
-
onClose:
|
|
609
|
-
}, null, 8, ["url-list", "initial-index"])) :
|
|
633
|
+
"url-list": d.value ? r.value : [m.value],
|
|
634
|
+
"initial-index": n.value,
|
|
635
|
+
onClose: E[4] || (E[4] = (z) => f.value = !1)
|
|
636
|
+
}, null, 8, ["url-list", "initial-index"])) : D("", !0)
|
|
610
637
|
]));
|
|
611
638
|
}
|
|
612
|
-
}),
|
|
613
|
-
var
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
639
|
+
}), qe = G(et);
|
|
640
|
+
var A = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.TEXTAREA = "textarea", e.NUMBER = "number", e.PASSWORD = "password", e.SELECT = "select", e.RADIO = "radio", e.CHECKBOX = "checkbox", e.DATE = "date", e.DATETIME = "datetime", e.DATERANGE = "daterange", e.DATETIMERANGE = "datetimerange", e.TIME = "time", e.TIMERANGE = "timerange", e.UPLOAD_IMAGES = "upload-images", e.SWITCH = "switch", e.TREE_SELECT = "tree-select", e.CASCADER = "cascader", e.TREE = "tree", e.SLIDER = "slider", e.RATE = "rate", e))(A || {});
|
|
641
|
+
const lt = /* @__PURE__ */ new Set([
|
|
642
|
+
"select",
|
|
643
|
+
"radio",
|
|
644
|
+
"checkbox",
|
|
645
|
+
"date",
|
|
646
|
+
"datetime",
|
|
647
|
+
"daterange",
|
|
648
|
+
"datetimerange",
|
|
649
|
+
"time",
|
|
650
|
+
"timerange",
|
|
651
|
+
"switch",
|
|
652
|
+
"cascader",
|
|
653
|
+
"tree",
|
|
654
|
+
"tree-select"
|
|
655
|
+
/* TREE_SELECT */
|
|
656
|
+
]), tt = /* @__PURE__ */ new Set([
|
|
657
|
+
"select",
|
|
658
|
+
"radio",
|
|
659
|
+
"checkbox",
|
|
660
|
+
"date",
|
|
661
|
+
"datetime",
|
|
662
|
+
"daterange",
|
|
663
|
+
"datetimerange",
|
|
664
|
+
"time",
|
|
665
|
+
"timerange",
|
|
666
|
+
"switch",
|
|
667
|
+
"cascader",
|
|
668
|
+
"tree",
|
|
669
|
+
"tree-select",
|
|
670
|
+
"slider",
|
|
671
|
+
"rate"
|
|
672
|
+
/* RATE */
|
|
673
|
+
]);
|
|
674
|
+
function at(e) {
|
|
675
|
+
return e && lt.has(e) ? "选择" : "输入";
|
|
676
|
+
}
|
|
677
|
+
function ot(e) {
|
|
678
|
+
return e && tt.has(e) ? "change" : "blur";
|
|
679
|
+
}
|
|
680
|
+
const nt = w({ name: "EzFormItem" }), pe = /* @__PURE__ */ w({
|
|
681
|
+
...nt,
|
|
682
|
+
props: /* @__PURE__ */ F({
|
|
683
|
+
config: {},
|
|
684
|
+
formData: { default: () => ({}) }
|
|
685
|
+
}, {
|
|
686
|
+
modelValue: {},
|
|
687
|
+
modelModifiers: {}
|
|
688
|
+
}),
|
|
689
|
+
emits: ["update:modelValue"],
|
|
690
|
+
setup(e) {
|
|
691
|
+
const c = e, l = L(e, "modelValue"), i = T(() => c.config?.itemAttrs && typeof c.config.itemAttrs == "object" ? c.config.itemAttrs : {}), a = T(() => c.config?.attrs && typeof c.config.attrs == "object" ? c.config.attrs : {}), f = T(() => c.config?.options && Array.isArray(c.config.options) ? c.config.options : []), n = /* @__PURE__ */ new WeakMap(), m = () => {
|
|
692
|
+
const { config: d } = c;
|
|
693
|
+
if (!d || typeof d != "object") return;
|
|
694
|
+
if (n.has(d))
|
|
695
|
+
return n.get(d);
|
|
696
|
+
let s;
|
|
697
|
+
return d.rules ? s = d.rules : d.required && (s = [{ required: !0, message: d.requiredMessage || `请${at(d.type)}${d.label || ""}`, trigger: ot(d.type) }]), s !== void 0 && n.set(d, s), s;
|
|
698
|
+
};
|
|
699
|
+
return (d, s) => e.config && e.config.prop ? (o(), v(t(nl), g({
|
|
700
|
+
key: 0,
|
|
701
|
+
prop: e.config.prop,
|
|
702
|
+
label: e.config.label,
|
|
703
|
+
rules: m()
|
|
704
|
+
}, i.value), ae({
|
|
705
|
+
default: y(() => [
|
|
706
|
+
d.$slots.default ? C(d.$slots, "default", {
|
|
707
|
+
key: 0,
|
|
708
|
+
config: e.config,
|
|
709
|
+
value: l.value,
|
|
710
|
+
formData: e.formData
|
|
711
|
+
}) : e.config.component ? (o(), v(ge(e.config.component), g({
|
|
712
|
+
key: 1,
|
|
713
|
+
modelValue: l.value,
|
|
714
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => l.value = r),
|
|
715
|
+
disabled: e.config.disabled
|
|
716
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : (o(), V(P, { key: 2 }, [
|
|
717
|
+
e.config.type === t(A).INPUT || !e.config.type ? (o(), v(t(me), g({
|
|
718
|
+
key: 0,
|
|
719
|
+
modelValue: l.value,
|
|
720
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => l.value = r),
|
|
721
|
+
placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
|
|
722
|
+
disabled: e.config.disabled,
|
|
723
|
+
clearable: ""
|
|
724
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).TEXTAREA ? (o(), v(t(me), g({
|
|
725
|
+
key: 1,
|
|
726
|
+
modelValue: l.value,
|
|
727
|
+
"onUpdate:modelValue": s[2] || (s[2] = (r) => l.value = r),
|
|
728
|
+
type: "textarea",
|
|
729
|
+
placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
|
|
730
|
+
disabled: e.config.disabled
|
|
731
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).NUMBER ? (o(), v(t(sl), g({
|
|
732
|
+
key: 2,
|
|
733
|
+
modelValue: l.value,
|
|
734
|
+
"onUpdate:modelValue": s[3] || (s[3] = (r) => l.value = r),
|
|
735
|
+
placeholder: e.config.placeholder,
|
|
736
|
+
disabled: e.config.disabled
|
|
737
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).PASSWORD ? (o(), v(t(me), g({
|
|
738
|
+
key: 3,
|
|
739
|
+
modelValue: l.value,
|
|
740
|
+
"onUpdate:modelValue": s[4] || (s[4] = (r) => l.value = r),
|
|
741
|
+
type: "password",
|
|
742
|
+
placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
|
|
743
|
+
disabled: e.config.disabled,
|
|
744
|
+
"show-password": "",
|
|
745
|
+
clearable: ""
|
|
746
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).SELECT ? (o(), v(t(Ie), g({
|
|
747
|
+
key: 4,
|
|
748
|
+
modelValue: l.value,
|
|
749
|
+
"onUpdate:modelValue": s[5] || (s[5] = (r) => l.value = r),
|
|
750
|
+
options: f.value,
|
|
751
|
+
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
752
|
+
disabled: e.config.disabled
|
|
753
|
+
}, a.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(A).RADIO ? (o(), v(t(Oe), g({
|
|
754
|
+
key: 5,
|
|
755
|
+
modelValue: l.value,
|
|
756
|
+
"onUpdate:modelValue": s[6] || (s[6] = (r) => l.value = r),
|
|
757
|
+
options: f.value,
|
|
758
|
+
disabled: e.config.disabled
|
|
759
|
+
}, a.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(A).CHECKBOX ? (o(), v(t(Be), g({
|
|
760
|
+
key: 6,
|
|
761
|
+
modelValue: l.value,
|
|
762
|
+
"onUpdate:modelValue": s[7] || (s[7] = (r) => l.value = r),
|
|
763
|
+
options: f.value,
|
|
764
|
+
disabled: e.config.disabled
|
|
765
|
+
}, a.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(A).DATE ? (o(), v(t(de), g({
|
|
766
|
+
key: 7,
|
|
767
|
+
modelValue: l.value,
|
|
768
|
+
"onUpdate:modelValue": s[8] || (s[8] = (r) => l.value = r),
|
|
769
|
+
type: "date",
|
|
770
|
+
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
771
|
+
disabled: e.config.disabled
|
|
772
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).DATETIME ? (o(), v(t(de), g({
|
|
773
|
+
key: 8,
|
|
774
|
+
modelValue: l.value,
|
|
775
|
+
"onUpdate:modelValue": s[9] || (s[9] = (r) => l.value = r),
|
|
776
|
+
type: "datetime",
|
|
777
|
+
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
778
|
+
disabled: e.config.disabled
|
|
779
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).DATERANGE ? (o(), v(t(de), g({
|
|
780
|
+
key: 9,
|
|
781
|
+
modelValue: l.value,
|
|
782
|
+
"onUpdate:modelValue": s[10] || (s[10] = (r) => l.value = r),
|
|
783
|
+
type: "daterange",
|
|
784
|
+
"range-separator": "至",
|
|
785
|
+
"start-placeholder": "开始日期",
|
|
786
|
+
"end-placeholder": "结束日期",
|
|
787
|
+
disabled: e.config.disabled
|
|
788
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).DATETIMERANGE ? (o(), v(t(de), g({
|
|
789
|
+
key: 10,
|
|
790
|
+
modelValue: l.value,
|
|
791
|
+
"onUpdate:modelValue": s[11] || (s[11] = (r) => l.value = r),
|
|
792
|
+
type: "datetimerange",
|
|
793
|
+
"range-separator": "至",
|
|
794
|
+
"start-placeholder": "开始时间",
|
|
795
|
+
"end-placeholder": "结束时间",
|
|
796
|
+
disabled: e.config.disabled
|
|
797
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).TIME ? (o(), v(t(Se), g({
|
|
798
|
+
key: 11,
|
|
799
|
+
modelValue: l.value,
|
|
800
|
+
"onUpdate:modelValue": s[12] || (s[12] = (r) => l.value = r),
|
|
801
|
+
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
802
|
+
disabled: e.config.disabled
|
|
803
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).TIMERANGE ? (o(), v(t(Se), g({
|
|
804
|
+
key: 12,
|
|
805
|
+
modelValue: l.value,
|
|
806
|
+
"onUpdate:modelValue": s[13] || (s[13] = (r) => l.value = r),
|
|
807
|
+
"is-range": "",
|
|
808
|
+
"range-separator": "至",
|
|
809
|
+
"start-placeholder": "开始时间",
|
|
810
|
+
"end-placeholder": "结束时间",
|
|
811
|
+
disabled: e.config.disabled
|
|
812
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).SWITCH ? (o(), v(t(rl), g({
|
|
813
|
+
key: 13,
|
|
814
|
+
modelValue: l.value,
|
|
815
|
+
"onUpdate:modelValue": s[14] || (s[14] = (r) => l.value = r),
|
|
816
|
+
disabled: e.config.disabled
|
|
817
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).TREE_SELECT ? (o(), v(t(il), g({
|
|
818
|
+
key: 14,
|
|
819
|
+
modelValue: l.value,
|
|
820
|
+
"onUpdate:modelValue": s[15] || (s[15] = (r) => l.value = r),
|
|
821
|
+
data: f.value,
|
|
822
|
+
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
823
|
+
disabled: e.config.disabled
|
|
824
|
+
}, a.value), null, 16, ["modelValue", "data", "placeholder", "disabled"])) : e.config.type === t(A).CASCADER ? (o(), v(t(ul), g({
|
|
825
|
+
key: 15,
|
|
826
|
+
modelValue: l.value,
|
|
827
|
+
"onUpdate:modelValue": s[16] || (s[16] = (r) => l.value = r),
|
|
828
|
+
options: f.value,
|
|
829
|
+
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
830
|
+
disabled: e.config.disabled,
|
|
831
|
+
clearable: ""
|
|
832
|
+
}, a.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(A).TREE ? (o(), v(t(dl), g({
|
|
833
|
+
key: 16,
|
|
834
|
+
modelValue: l.value,
|
|
835
|
+
"onUpdate:modelValue": s[17] || (s[17] = (r) => l.value = r),
|
|
836
|
+
data: f.value,
|
|
837
|
+
"show-checkbox": "",
|
|
838
|
+
"node-key": "id"
|
|
839
|
+
}, a.value), null, 16, ["modelValue", "data"])) : e.config.type === t(A).SLIDER ? (o(), v(t(cl), g({
|
|
840
|
+
key: 17,
|
|
841
|
+
modelValue: l.value,
|
|
842
|
+
"onUpdate:modelValue": s[18] || (s[18] = (r) => l.value = r),
|
|
843
|
+
disabled: e.config.disabled
|
|
844
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).RATE ? (o(), v(t(fl), g({
|
|
845
|
+
key: 18,
|
|
846
|
+
modelValue: l.value,
|
|
847
|
+
"onUpdate:modelValue": s[19] || (s[19] = (r) => l.value = r),
|
|
848
|
+
disabled: e.config.disabled
|
|
849
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).UPLOAD_IMAGES && a.value.api ? (o(), v(t(qe), g({
|
|
850
|
+
key: 19,
|
|
851
|
+
modelValue: l.value,
|
|
852
|
+
"onUpdate:modelValue": s[20] || (s[20] = (r) => l.value = r),
|
|
853
|
+
api: a.value.api,
|
|
854
|
+
disabled: e.config.disabled
|
|
855
|
+
}, a.value), null, 16, ["modelValue", "api", "disabled"])) : D("", !0)
|
|
856
|
+
], 64))
|
|
857
|
+
]),
|
|
858
|
+
_: 2
|
|
859
|
+
}, [
|
|
860
|
+
d.$slots.label ? {
|
|
861
|
+
name: "label",
|
|
862
|
+
fn: y(() => [
|
|
863
|
+
C(d.$slots, "label", { config: e.config })
|
|
864
|
+
]),
|
|
865
|
+
key: "0"
|
|
866
|
+
} : void 0
|
|
867
|
+
]), 1040, ["prop", "label", "rules"])) : D("", !0);
|
|
868
|
+
}
|
|
869
|
+
}), st = {
|
|
870
|
+
key: 0,
|
|
871
|
+
class: "ez-dynamic-form-group__title"
|
|
872
|
+
}, rt = {
|
|
873
|
+
key: 1,
|
|
874
|
+
class: "ez-dynamic-form-group__description"
|
|
875
|
+
}, it = w({ name: "EzDynamicForm", inheritAttrs: !1 }), ut = /* @__PURE__ */ w({
|
|
876
|
+
...it,
|
|
877
|
+
props: /* @__PURE__ */ F({
|
|
617
878
|
items: { default: () => [] },
|
|
879
|
+
groups: { default: () => [] },
|
|
618
880
|
modelValue: {},
|
|
619
881
|
cols: { default: 1 },
|
|
620
882
|
gutter: { default: 20 },
|
|
621
|
-
|
|
622
|
-
|
|
883
|
+
disabled: { type: Boolean },
|
|
884
|
+
labelPosition: {},
|
|
885
|
+
requireAsteriskPosition: {},
|
|
886
|
+
labelWidth: {},
|
|
887
|
+
labelSuffix: {},
|
|
888
|
+
inline: { type: Boolean },
|
|
889
|
+
inlineMessage: { type: Boolean },
|
|
890
|
+
statusIcon: { type: Boolean },
|
|
891
|
+
validateOnRuleChange: { type: Boolean },
|
|
892
|
+
hideRequiredAsterisk: { type: Boolean },
|
|
893
|
+
scrollToError: { type: Boolean },
|
|
894
|
+
scrollIntoViewOptions: {},
|
|
895
|
+
size: {}
|
|
896
|
+
}, {
|
|
897
|
+
modelValue: { default: () => ({}) },
|
|
898
|
+
modelModifiers: {}
|
|
899
|
+
}),
|
|
623
900
|
emits: ["update:modelValue"],
|
|
624
|
-
setup(
|
|
625
|
-
const
|
|
626
|
-
let
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
if (n.required) {
|
|
648
|
-
if (B.has(n))
|
|
649
|
-
return B.get(n);
|
|
650
|
-
const e = [{ required: !0, message: n.requiredMessage || `请${X(n.type)}${n.label || ""}`, trigger: C(n.type) }];
|
|
651
|
-
return B.set(n, e), e;
|
|
901
|
+
setup(e, { expose: c }) {
|
|
902
|
+
const l = e, i = je(), a = L(e, "modelValue"), f = We(), n = "__legacy__";
|
|
903
|
+
let m = !1;
|
|
904
|
+
const d = (u) => Object.prototype.toString.call(u) === "[object Object]", s = (u) => u instanceof Date ? new Date(u.getTime()) : Array.isArray(u) ? u.map((k) => s(k)) : d(u) ? Object.fromEntries(Object.entries(u).map(([k, p]) => [k, s(p)])) : u, r = () => {
|
|
905
|
+
d(a.value) || (a.value = {});
|
|
906
|
+
}, R = () => {
|
|
907
|
+
r(), a.value && H.value.forEach((u) => {
|
|
908
|
+
u.prop in a.value || (a.value[u.prop] = u.defaultValue !== void 0 ? u.defaultValue : void 0);
|
|
909
|
+
});
|
|
910
|
+
}, K = T(() => Math.floor(24 / l.cols)), H = T(() => l.groups?.length ? l.groups.flatMap((u) => u.items || []) : l.items || []);
|
|
911
|
+
fe(
|
|
912
|
+
() => [l.items?.length || 0, l.groups?.length || 0],
|
|
913
|
+
([u, k]) => {
|
|
914
|
+
m || u === 0 || k === 0 || (m = !0, console.warn('[EzDynamicForm] Both "items" and "groups" were provided. "groups" takes precedence and "items" will be ignored.'));
|
|
915
|
+
},
|
|
916
|
+
{ immediate: !0 }
|
|
917
|
+
), fe(() => [l.items, l.groups], R, { deep: !0, immediate: !0 }), fe(a, R, { immediate: !0 }), ye(R);
|
|
918
|
+
const j = (u, k, p) => {
|
|
919
|
+
if (!u) return !0;
|
|
920
|
+
try {
|
|
921
|
+
return u(a.value);
|
|
922
|
+
} catch (b) {
|
|
923
|
+
return console.error(`[EzDynamicForm] ${k} visibility error for "${p}":`, b), !1;
|
|
652
924
|
}
|
|
653
|
-
},
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
c.TREE_SELECT,
|
|
681
|
-
c.SLIDER,
|
|
682
|
-
c.RATE
|
|
683
|
-
]), C = (n) => n && T.has(n) ? "change" : "blur", i = (n) => {
|
|
684
|
-
if (n.disabled) return !0;
|
|
685
|
-
if (n.disabledWhen)
|
|
925
|
+
}, X = T(() => {
|
|
926
|
+
const u = Array.isArray(l.groups) && l.groups.length > 0, k = u ? l.groups : [{ name: n, items: l.items || [], cols: l.cols, gutter: l.gutter }], p = [];
|
|
927
|
+
return k.forEach((b, I) => {
|
|
928
|
+
if (!b || b.hidden) return;
|
|
929
|
+
const h = b.name || `group-${I}`;
|
|
930
|
+
if (!j(b.show, "group", h)) return;
|
|
931
|
+
const S = (b.items || []).filter((ne) => ne.hidden ? !1 : j(ne.show, "item", ne.prop)), q = Math.max(1, b.cols || l.cols), x = b.gutter ?? l.gutter, le = b.headerSlot || (b.name ? `group-header-${b.name}` : void 0), he = b.slot || (b.name ? `group-${b.name}` : void 0);
|
|
932
|
+
p.push({
|
|
933
|
+
key: `${h}-${I}`,
|
|
934
|
+
index: I,
|
|
935
|
+
group: b,
|
|
936
|
+
items: S,
|
|
937
|
+
cols: q,
|
|
938
|
+
gutter: x,
|
|
939
|
+
isLegacy: !u,
|
|
940
|
+
headerSlotName: le,
|
|
941
|
+
bodySlotName: he
|
|
942
|
+
});
|
|
943
|
+
}), p;
|
|
944
|
+
}), Z = (u, k) => {
|
|
945
|
+
if (u.span !== void 0)
|
|
946
|
+
return Math.max(1, Math.min(24, u.span));
|
|
947
|
+
const p = Math.max(1, k);
|
|
948
|
+
return Math.max(1, Math.floor(24 / p)) || K.value;
|
|
949
|
+
}, J = (u) => u.isLegacy ? !1 : u.group.title || u.group.description || u.headerSlotName && i[u.headerSlotName] ? !0 : !!i["group-header"], $ = (u) => {
|
|
950
|
+
let k = u.disabled || l.disabled;
|
|
951
|
+
if (!k && u.disabledWhen)
|
|
686
952
|
try {
|
|
687
|
-
|
|
688
|
-
} catch (
|
|
689
|
-
|
|
953
|
+
k = u.disabledWhen(a.value);
|
|
954
|
+
} catch (p) {
|
|
955
|
+
console.error(`[EzDynamicForm] Disabled check error for "${u.prop}":`, p);
|
|
690
956
|
}
|
|
691
|
-
return
|
|
692
|
-
}, k = async () => {
|
|
693
|
-
if (!g.value)
|
|
694
|
-
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
695
|
-
try {
|
|
696
|
-
return await g.value.validate(), !0;
|
|
697
|
-
} catch {
|
|
698
|
-
return !1;
|
|
699
|
-
}
|
|
700
|
-
}, z = async (n) => {
|
|
701
|
-
if (!g.value)
|
|
702
|
-
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
703
|
-
try {
|
|
704
|
-
return await g.value.validateField(n), !0;
|
|
705
|
-
} catch {
|
|
706
|
-
return !1;
|
|
707
|
-
}
|
|
708
|
-
}, H = (n) => {
|
|
709
|
-
if (!g.value) {
|
|
710
|
-
console.warn("[EzDynamicForm] Form ref is not available");
|
|
711
|
-
return;
|
|
712
|
-
}
|
|
713
|
-
g.value.clearValidate(n);
|
|
714
|
-
}, ae = (n) => {
|
|
715
|
-
if (!g.value) {
|
|
716
|
-
console.warn("[EzDynamicForm] Form ref is not available");
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
g.value.resetFields(n), ue(() => {
|
|
720
|
-
d();
|
|
721
|
-
});
|
|
722
|
-
}, q = () => ({ ...a.value }), G = (n, y = !0) => {
|
|
723
|
-
if (!n || typeof n != "object") {
|
|
724
|
-
console.warn("[EzDynamicForm] Invalid data provided to setFormData");
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
V = !0, a.value = y ? { ...a.value, ...n } : { ...n }, ue(() => {
|
|
728
|
-
V = !1;
|
|
729
|
-
});
|
|
957
|
+
return { ...u, disabled: k };
|
|
730
958
|
};
|
|
731
|
-
|
|
732
|
-
() =>
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
959
|
+
return c({
|
|
960
|
+
validate: async () => {
|
|
961
|
+
if (!f.value)
|
|
962
|
+
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
963
|
+
try {
|
|
964
|
+
return await f.value.validate(), !0;
|
|
965
|
+
} catch {
|
|
966
|
+
return !1;
|
|
967
|
+
}
|
|
737
968
|
},
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
969
|
+
validateField: async (u) => {
|
|
970
|
+
if (!f.value)
|
|
971
|
+
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
972
|
+
try {
|
|
973
|
+
return await f.value.validateField(u), !0;
|
|
974
|
+
} catch {
|
|
975
|
+
return !1;
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
clearValidate: (u) => {
|
|
979
|
+
if (!f.value) {
|
|
980
|
+
console.warn("[EzDynamicForm] Form ref is not available");
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
f.value.clearValidate(u);
|
|
984
|
+
},
|
|
985
|
+
getFormData: () => s(a.value),
|
|
986
|
+
setFormData: (u, k = !0) => {
|
|
987
|
+
if (!u) return;
|
|
988
|
+
r();
|
|
989
|
+
const p = s(u);
|
|
990
|
+
k ? Object.assign(a.value, p) : a.value = p, R(), Le(() => {
|
|
991
|
+
f.value?.clearValidate();
|
|
992
|
+
});
|
|
747
993
|
},
|
|
748
|
-
|
|
749
|
-
),
|
|
750
|
-
d();
|
|
751
|
-
}), m({
|
|
752
|
-
validate: k,
|
|
753
|
-
validateField: z,
|
|
754
|
-
clearValidate: H,
|
|
755
|
-
resetFields: ae,
|
|
756
|
-
getFormData: q,
|
|
757
|
-
setFormData: G,
|
|
758
|
-
formRef: g
|
|
759
|
-
}), (n, y) => (r(), p(l(ll), h({
|
|
994
|
+
formRef: f
|
|
995
|
+
}), (u, k) => (o(), v(t(ml), g({
|
|
760
996
|
ref_key: "formRef",
|
|
761
|
-
ref:
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
997
|
+
ref: f,
|
|
998
|
+
class: "ez-dynamic-form",
|
|
999
|
+
"label-width": "auto"
|
|
1000
|
+
}, u.$attrs, { model: a.value }), {
|
|
1001
|
+
default: y(() => [
|
|
1002
|
+
(o(!0), V(P, null, W(X.value, (p) => (o(), V(P, {
|
|
1003
|
+
key: p.key
|
|
1004
|
+
}, [
|
|
1005
|
+
p.isLegacy ? (o(), v(t(ze), {
|
|
1006
|
+
key: 0,
|
|
1007
|
+
gutter: p.gutter
|
|
1008
|
+
}, {
|
|
1009
|
+
default: y(() => [
|
|
1010
|
+
(o(!0), V(P, null, W(p.items, (b) => (o(), v(t(Ce), {
|
|
1011
|
+
key: b.prop,
|
|
1012
|
+
span: Z(b, p.cols)
|
|
1013
|
+
}, {
|
|
1014
|
+
default: y(() => [
|
|
1015
|
+
M(pe, {
|
|
1016
|
+
modelValue: a.value[b.prop],
|
|
1017
|
+
"onUpdate:modelValue": (I) => a.value[b.prop] = I,
|
|
1018
|
+
config: $(b),
|
|
1019
|
+
formData: a.value
|
|
1020
|
+
}, ae({ _: 2 }, [
|
|
1021
|
+
u.$slots[`label-${b.prop}`] ? {
|
|
1022
|
+
name: "label",
|
|
1023
|
+
fn: y(() => [
|
|
1024
|
+
C(u.$slots, `label-${b.prop}`, { item: b })
|
|
1025
|
+
]),
|
|
1026
|
+
key: "0"
|
|
1027
|
+
} : void 0,
|
|
1028
|
+
u.$slots[b.prop] ? {
|
|
1029
|
+
name: "default",
|
|
1030
|
+
fn: y(({ config: I, value: h }) => [
|
|
1031
|
+
C(u.$slots, b.prop, {
|
|
1032
|
+
item: I,
|
|
1033
|
+
value: h,
|
|
1034
|
+
formData: a.value
|
|
1035
|
+
})
|
|
1036
|
+
]),
|
|
1037
|
+
key: "1"
|
|
1038
|
+
} : void 0
|
|
1039
|
+
]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
|
|
1040
|
+
]),
|
|
1041
|
+
_: 2
|
|
1042
|
+
}, 1032, ["span"]))), 128))
|
|
1043
|
+
]),
|
|
1044
|
+
_: 2
|
|
1045
|
+
}, 1032, ["gutter"])) : (o(), V("section", {
|
|
1046
|
+
key: 1,
|
|
1047
|
+
class: ce(["ez-dynamic-form-group", p.group.className]),
|
|
1048
|
+
style: ie(p.group.style)
|
|
1049
|
+
}, [
|
|
1050
|
+
J(p) ? (o(), V("div", {
|
|
1051
|
+
key: 0,
|
|
1052
|
+
class: ce(["ez-dynamic-form-group__header", p.group.headerClassName]),
|
|
1053
|
+
style: ie(p.group.headerStyle)
|
|
1054
|
+
}, [
|
|
1055
|
+
p.headerSlotName && u.$slots[p.headerSlotName] ? C(u.$slots, p.headerSlotName, {
|
|
1056
|
+
key: 0,
|
|
1057
|
+
group: p.group,
|
|
1058
|
+
index: p.index,
|
|
1059
|
+
items: p.items,
|
|
1060
|
+
formData: a.value
|
|
1061
|
+
}) : u.$slots["group-header"] ? C(u.$slots, "group-header", {
|
|
1062
|
+
key: 1,
|
|
1063
|
+
group: p.group,
|
|
1064
|
+
index: p.index,
|
|
1065
|
+
items: p.items,
|
|
1066
|
+
formData: a.value
|
|
1067
|
+
}) : (o(), V(P, { key: 2 }, [
|
|
1068
|
+
p.group.title ? (o(), V("div", st, Y(p.group.title), 1)) : D("", !0),
|
|
1069
|
+
p.group.description ? (o(), V("div", rt, Y(p.group.description), 1)) : D("", !0)
|
|
1070
|
+
], 64))
|
|
1071
|
+
], 6)) : D("", !0),
|
|
1072
|
+
p.bodySlotName && u.$slots[p.bodySlotName] ? C(u.$slots, p.bodySlotName, {
|
|
1073
|
+
key: 1,
|
|
1074
|
+
group: p.group,
|
|
1075
|
+
index: p.index,
|
|
1076
|
+
items: p.items,
|
|
1077
|
+
formData: a.value
|
|
1078
|
+
}) : u.$slots.group ? C(u.$slots, "group", {
|
|
1079
|
+
key: 2,
|
|
1080
|
+
group: p.group,
|
|
1081
|
+
index: p.index,
|
|
1082
|
+
items: p.items,
|
|
1083
|
+
formData: a.value
|
|
1084
|
+
}) : (o(), v(t(ze), {
|
|
1085
|
+
key: 3,
|
|
1086
|
+
gutter: p.gutter,
|
|
1087
|
+
class: ce(["ez-dynamic-form-group__body", p.group.bodyClassName]),
|
|
1088
|
+
style: ie(p.group.bodyStyle)
|
|
772
1089
|
}, {
|
|
773
|
-
default:
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
value: a.value[e.prop],
|
|
1090
|
+
default: y(() => [
|
|
1091
|
+
(o(!0), V(P, null, W(p.items, (b) => (o(), v(t(Ce), {
|
|
1092
|
+
key: `${p.key}-${b.prop}`,
|
|
1093
|
+
span: Z(b, p.cols)
|
|
1094
|
+
}, {
|
|
1095
|
+
default: y(() => [
|
|
1096
|
+
M(pe, {
|
|
1097
|
+
modelValue: a.value[b.prop],
|
|
1098
|
+
"onUpdate:modelValue": (I) => a.value[b.prop] = I,
|
|
1099
|
+
config: $(b),
|
|
784
1100
|
formData: a.value
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).NUMBER ? (r(), p(l(rl), h({
|
|
806
|
-
key: 2,
|
|
807
|
-
modelValue: a.value[e.prop],
|
|
808
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
809
|
-
placeholder: e.placeholder,
|
|
810
|
-
disabled: i(e)
|
|
811
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).PASSWORD ? (r(), p(l(ie), h({
|
|
812
|
-
key: 3,
|
|
813
|
-
modelValue: a.value[e.prop],
|
|
814
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
815
|
-
type: "password",
|
|
816
|
-
placeholder: e.placeholder || `请输入${e.label || ""}`,
|
|
817
|
-
disabled: i(e),
|
|
818
|
-
"show-password": "",
|
|
819
|
-
clearable: ""
|
|
820
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).SELECT ? (r(), p(l(De), h({
|
|
821
|
-
key: 4,
|
|
822
|
-
modelValue: a.value[e.prop],
|
|
823
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
824
|
-
options: e.options || [],
|
|
825
|
-
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
826
|
-
disabled: i(e)
|
|
827
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "disabled"])) : e.type === l(c).RADIO ? (r(), p(l(xe), h({
|
|
828
|
-
key: 5,
|
|
829
|
-
modelValue: a.value[e.prop],
|
|
830
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
831
|
-
options: e.options || [],
|
|
832
|
-
disabled: i(e)
|
|
833
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "disabled"])) : e.type === l(c).CHECKBOX ? (r(), p(l(Re), h({
|
|
834
|
-
key: 6,
|
|
835
|
-
modelValue: a.value[e.prop],
|
|
836
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
837
|
-
options: e.options || [],
|
|
838
|
-
disabled: i(e)
|
|
839
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "disabled"])) : e.type === l(c).DATE ? (r(), p(l(ne), h({
|
|
840
|
-
key: 7,
|
|
841
|
-
modelValue: a.value[e.prop],
|
|
842
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
843
|
-
type: "date",
|
|
844
|
-
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
845
|
-
disabled: i(e)
|
|
846
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).DATETIME ? (r(), p(l(ne), h({
|
|
847
|
-
key: 8,
|
|
848
|
-
modelValue: a.value[e.prop],
|
|
849
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
850
|
-
type: "datetime",
|
|
851
|
-
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
852
|
-
disabled: i(e)
|
|
853
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).DATERANGE ? (r(), p(l(ne), h({
|
|
854
|
-
key: 9,
|
|
855
|
-
modelValue: a.value[e.prop],
|
|
856
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
857
|
-
type: "daterange",
|
|
858
|
-
"range-separator": "至",
|
|
859
|
-
"start-placeholder": "开始日期",
|
|
860
|
-
"end-placeholder": "结束日期",
|
|
861
|
-
disabled: i(e)
|
|
862
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).DATETIMERANGE ? (r(), p(l(ne), h({
|
|
863
|
-
key: 10,
|
|
864
|
-
modelValue: a.value[e.prop],
|
|
865
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
866
|
-
type: "datetimerange",
|
|
867
|
-
"range-separator": "至",
|
|
868
|
-
"start-placeholder": "开始时间",
|
|
869
|
-
"end-placeholder": "结束时间",
|
|
870
|
-
disabled: i(e)
|
|
871
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).TIME ? (r(), p(l(Ve), h({
|
|
872
|
-
key: 11,
|
|
873
|
-
modelValue: a.value[e.prop],
|
|
874
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
875
|
-
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
876
|
-
disabled: i(e)
|
|
877
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).TIMERANGE ? (r(), p(l(Ve), h({
|
|
878
|
-
key: 12,
|
|
879
|
-
modelValue: a.value[e.prop],
|
|
880
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
881
|
-
"is-range": "",
|
|
882
|
-
"range-separator": "至",
|
|
883
|
-
"start-placeholder": "开始时间",
|
|
884
|
-
"end-placeholder": "结束时间",
|
|
885
|
-
disabled: i(e)
|
|
886
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).SWITCH ? (r(), p(l(sl), h({
|
|
887
|
-
key: 13,
|
|
888
|
-
modelValue: a.value[e.prop],
|
|
889
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
890
|
-
disabled: i(e)
|
|
891
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).TREE_SELECT ? (r(), p(l(nl), h({
|
|
892
|
-
key: 14,
|
|
893
|
-
modelValue: a.value[e.prop],
|
|
894
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
895
|
-
data: e.options,
|
|
896
|
-
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
897
|
-
disabled: i(e)
|
|
898
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "data", "placeholder", "disabled"])) : e.type === l(c).CASCADER ? (r(), p(l(ul), h({
|
|
899
|
-
key: 15,
|
|
900
|
-
modelValue: a.value[e.prop],
|
|
901
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
902
|
-
options: e.options,
|
|
903
|
-
placeholder: e.placeholder || `请选择${e.label || ""}`,
|
|
904
|
-
disabled: i(e),
|
|
905
|
-
clearable: ""
|
|
906
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "disabled"])) : e.type === l(c).TREE ? (r(), p(l(dl), h({
|
|
907
|
-
key: 16,
|
|
908
|
-
modelValue: a.value[e.prop],
|
|
909
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
910
|
-
data: e.options,
|
|
911
|
-
"show-checkbox": "",
|
|
912
|
-
"node-key": "id"
|
|
913
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "data"])) : e.type === l(c).SLIDER ? (r(), p(l(il), h({
|
|
914
|
-
key: 17,
|
|
915
|
-
modelValue: a.value[e.prop],
|
|
916
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
917
|
-
disabled: i(e)
|
|
918
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).RATE ? (r(), p(l(pl), h({
|
|
919
|
-
key: 18,
|
|
920
|
-
modelValue: a.value[e.prop],
|
|
921
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
922
|
-
disabled: i(e)
|
|
923
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "upload-images" && e.attrs?.api ? (r(), p(l(Me), h({
|
|
924
|
-
key: 19,
|
|
925
|
-
modelValue: a.value[e.prop],
|
|
926
|
-
"onUpdate:modelValue": (v) => a.value[e.prop] = v,
|
|
927
|
-
api: e.attrs?.api,
|
|
928
|
-
disabled: i(e)
|
|
929
|
-
}, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "api", "disabled"])) : A("", !0)
|
|
930
|
-
], 64))
|
|
1101
|
+
}, ae({ _: 2 }, [
|
|
1102
|
+
u.$slots[`label-${b.prop}`] ? {
|
|
1103
|
+
name: "label",
|
|
1104
|
+
fn: y(() => [
|
|
1105
|
+
C(u.$slots, `label-${b.prop}`, { item: b })
|
|
1106
|
+
]),
|
|
1107
|
+
key: "0"
|
|
1108
|
+
} : void 0,
|
|
1109
|
+
u.$slots[b.prop] ? {
|
|
1110
|
+
name: "default",
|
|
1111
|
+
fn: y(({ config: I, value: h }) => [
|
|
1112
|
+
C(u.$slots, b.prop, {
|
|
1113
|
+
item: I,
|
|
1114
|
+
value: h,
|
|
1115
|
+
formData: a.value
|
|
1116
|
+
})
|
|
1117
|
+
]),
|
|
1118
|
+
key: "1"
|
|
1119
|
+
} : void 0
|
|
1120
|
+
]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
|
|
931
1121
|
]),
|
|
932
1122
|
_: 2
|
|
933
|
-
}, [
|
|
934
|
-
n.$slots[`label-${e.prop}`] ? {
|
|
935
|
-
name: "label",
|
|
936
|
-
fn: b(() => [
|
|
937
|
-
R(n.$slots, `label-${e.prop}`, { item: e })
|
|
938
|
-
]),
|
|
939
|
-
key: "0"
|
|
940
|
-
} : void 0
|
|
941
|
-
]), 1040, ["prop", "label", "rules"])
|
|
1123
|
+
}, 1032, ["span"]))), 128))
|
|
942
1124
|
]),
|
|
943
1125
|
_: 2
|
|
944
|
-
}, 1032, ["
|
|
945
|
-
])
|
|
946
|
-
|
|
947
|
-
}, 8, ["gutter"])
|
|
1126
|
+
}, 1032, ["gutter", "class", "style"]))
|
|
1127
|
+
], 6))
|
|
1128
|
+
], 64))), 128))
|
|
948
1129
|
]),
|
|
949
1130
|
_: 3
|
|
950
1131
|
}, 16, ["model"]));
|
|
951
1132
|
}
|
|
952
|
-
}),
|
|
953
|
-
...
|
|
1133
|
+
}), dt = G(ut), ct = G(pe), ft = w({ name: "EzTable" }), mt = /* @__PURE__ */ w({
|
|
1134
|
+
...ft,
|
|
954
1135
|
props: {
|
|
955
1136
|
data: { default: () => [] },
|
|
956
1137
|
columns: { default: () => [] },
|
|
957
1138
|
rowKey: {}
|
|
958
1139
|
},
|
|
959
|
-
setup(
|
|
960
|
-
const
|
|
961
|
-
const
|
|
1140
|
+
setup(e, { expose: c }) {
|
|
1141
|
+
const l = e, i = O(), a = (n) => {
|
|
1142
|
+
const m = l.columns[l.columns.length - 1], d = () => n.type ? !1 : n.prop !== m.prop;
|
|
962
1143
|
return { ...{
|
|
963
1144
|
align: "center",
|
|
964
1145
|
hidden: 1,
|
|
965
1146
|
resizable: !0,
|
|
966
|
-
reserveSelection:
|
|
1147
|
+
reserveSelection: n.type === "selection",
|
|
967
1148
|
/** 默认最后一个 */
|
|
968
1149
|
showOverflowTooltip: d()
|
|
969
|
-
}, ...
|
|
1150
|
+
}, ...n };
|
|
970
1151
|
};
|
|
971
|
-
return
|
|
972
|
-
getTableRef: () =>
|
|
973
|
-
|
|
1152
|
+
return c({
|
|
1153
|
+
getTableRef: () => i.value,
|
|
1154
|
+
clearSelection: () => i.value?.clearSelection(),
|
|
1155
|
+
toggleRowSelection: (n, m) => i.value?.toggleRowSelection(n, m),
|
|
1156
|
+
toggleAllSelection: () => i.value?.toggleAllSelection(),
|
|
1157
|
+
toggleRowExpansion: (n, m) => i.value?.toggleRowExpansion(n, m),
|
|
1158
|
+
setCurrentRow: (n) => i.value?.setCurrentRow(n),
|
|
1159
|
+
clearSort: () => i.value?.clearSort(),
|
|
1160
|
+
clearFilter: (n) => i.value?.clearFilter(n),
|
|
1161
|
+
doLayout: () => i.value?.doLayout(),
|
|
1162
|
+
sort: (n, m) => i.value?.sort(n, m)
|
|
1163
|
+
}), (n, m) => (o(), v(t(pl), g({
|
|
974
1164
|
ref_key: "tableRef",
|
|
975
|
-
ref:
|
|
976
|
-
data:
|
|
1165
|
+
ref: i,
|
|
1166
|
+
data: l.data,
|
|
977
1167
|
border: "",
|
|
978
1168
|
"row-key": "id"
|
|
979
|
-
},
|
|
980
|
-
default:
|
|
981
|
-
(
|
|
1169
|
+
}, n.$attrs), ae({
|
|
1170
|
+
default: y(() => [
|
|
1171
|
+
(o(!0), V(P, null, W(l.columns, (d) => (o(), V(P, {
|
|
982
1172
|
key: d.prop
|
|
983
1173
|
}, [
|
|
984
|
-
["selection", "index"].includes(d.type) ? (
|
|
1174
|
+
["selection", "index"].includes(d.type) ? (o(), v(t(Ae), g({
|
|
985
1175
|
key: 0,
|
|
986
1176
|
ref_for: !0
|
|
987
|
-
}, a(d)), null, 16)) : d.hidden ?
|
|
1177
|
+
}, a(d)), null, 16)) : d.hidden ? D("", !0) : (o(), v(t(Ae), g({
|
|
988
1178
|
key: 1,
|
|
989
1179
|
ref_for: !0
|
|
990
|
-
}, a(d)),
|
|
991
|
-
|
|
1180
|
+
}, a(d)), ae({ _: 2 }, [
|
|
1181
|
+
n.$slots[d.prop] ? {
|
|
992
1182
|
name: "default",
|
|
993
|
-
fn:
|
|
994
|
-
|
|
1183
|
+
fn: y((s) => [
|
|
1184
|
+
C(n.$slots, d.prop, g({ ref_for: !0 }, s))
|
|
995
1185
|
]),
|
|
996
1186
|
key: "0"
|
|
997
1187
|
} : d.transform ? {
|
|
998
1188
|
name: "default",
|
|
999
|
-
fn:
|
|
1000
|
-
|
|
1189
|
+
fn: y((s) => [
|
|
1190
|
+
_(Y(d.transform(s.row)), 1)
|
|
1001
1191
|
]),
|
|
1002
1192
|
key: "1"
|
|
1003
1193
|
} : void 0,
|
|
1004
|
-
|
|
1194
|
+
n.$slots[`header-${d.prop}`] ? {
|
|
1005
1195
|
name: "header",
|
|
1006
|
-
fn:
|
|
1007
|
-
|
|
1196
|
+
fn: y((s) => [
|
|
1197
|
+
C(n.$slots, `header-${d.prop}`, g({ ref_for: !0 }, s))
|
|
1008
1198
|
]),
|
|
1009
1199
|
key: "2"
|
|
1010
1200
|
} : void 0
|
|
@@ -1013,25 +1203,25 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
1013
1203
|
]),
|
|
1014
1204
|
_: 2
|
|
1015
1205
|
}, [
|
|
1016
|
-
|
|
1206
|
+
n.$slots?.append ? {
|
|
1017
1207
|
name: "append",
|
|
1018
|
-
fn:
|
|
1019
|
-
|
|
1208
|
+
fn: y(() => [
|
|
1209
|
+
C(n.$slots, "append")
|
|
1020
1210
|
]),
|
|
1021
1211
|
key: "0"
|
|
1022
1212
|
} : void 0,
|
|
1023
|
-
|
|
1213
|
+
n.$slots?.empty ? {
|
|
1024
1214
|
name: "empty",
|
|
1025
|
-
fn:
|
|
1026
|
-
|
|
1215
|
+
fn: y(() => [
|
|
1216
|
+
C(n.$slots, "empty")
|
|
1027
1217
|
]),
|
|
1028
1218
|
key: "1"
|
|
1029
1219
|
} : void 0
|
|
1030
1220
|
]), 1040, ["data"]));
|
|
1031
1221
|
}
|
|
1032
|
-
}),
|
|
1033
|
-
...
|
|
1034
|
-
props: /* @__PURE__ */
|
|
1222
|
+
}), Fe = G(mt), pt = { class: "ez-search-form" }, vt = { class: "ez-search-form__operate" }, gt = w({ name: "EzSearchForm", inheritAttrs: !1 }), yt = /* @__PURE__ */ w({
|
|
1223
|
+
...gt,
|
|
1224
|
+
props: /* @__PURE__ */ F({
|
|
1035
1225
|
collapsedHeight: { default: 50 },
|
|
1036
1226
|
reset: { type: Boolean }
|
|
1037
1227
|
}, {
|
|
@@ -1039,92 +1229,85 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
|
|
|
1039
1229
|
expandedModifiers: {}
|
|
1040
1230
|
}),
|
|
1041
1231
|
emits: ["update:expanded"],
|
|
1042
|
-
setup(
|
|
1043
|
-
const
|
|
1044
|
-
let
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1047
|
-
},
|
|
1048
|
-
|
|
1232
|
+
setup(e, { expose: c }) {
|
|
1233
|
+
const l = e, { t: i } = ue(), a = O(), f = O(0), n = L(e, "expanded"), m = T(() => f.value > l.collapsedHeight), d = T(() => n.value ? Gl : ql), s = T(() => n.value ? i("s.button.collapse") : i("s.button.expand"));
|
|
1234
|
+
let r = null;
|
|
1235
|
+
const R = Sl(() => {
|
|
1236
|
+
a.value && (f.value = a.value.scrollHeight);
|
|
1237
|
+
}, 100), K = () => {
|
|
1238
|
+
n.value = !n.value;
|
|
1049
1239
|
};
|
|
1050
|
-
return
|
|
1240
|
+
return ye(() => {
|
|
1051
1241
|
setTimeout(() => {
|
|
1052
|
-
|
|
1242
|
+
a.value && (R(), r = new ResizeObserver(R), r.observe(a.value));
|
|
1053
1243
|
}, 50);
|
|
1054
|
-
}),
|
|
1055
|
-
|
|
1056
|
-
}),
|
|
1057
|
-
countViewHeight:
|
|
1058
|
-
}), (
|
|
1059
|
-
|
|
1244
|
+
}), Ke(() => {
|
|
1245
|
+
r && (r.disconnect(), r = null);
|
|
1246
|
+
}), c({
|
|
1247
|
+
countViewHeight: R
|
|
1248
|
+
}), (H, j) => (o(), V("div", pt, [
|
|
1249
|
+
N("div", {
|
|
1060
1250
|
class: "ez-search-form__wrapper",
|
|
1061
|
-
style:
|
|
1062
|
-
height:
|
|
1251
|
+
style: ie({
|
|
1252
|
+
height: f.value ? n.value ? `${f.value}px` : `${l.collapsedHeight}px` : "auto"
|
|
1063
1253
|
})
|
|
1064
1254
|
}, [
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1255
|
+
N("div", vt, [
|
|
1256
|
+
C(H.$slots, "operate"),
|
|
1257
|
+
m.value ? (o(), v(t(te), {
|
|
1068
1258
|
key: 0,
|
|
1069
|
-
icon:
|
|
1259
|
+
icon: d.value,
|
|
1070
1260
|
size: "small",
|
|
1071
|
-
title:
|
|
1261
|
+
title: s.value,
|
|
1072
1262
|
circle: "",
|
|
1073
|
-
onClick:
|
|
1074
|
-
}, null, 8, ["icon", "title"])) :
|
|
1263
|
+
onClick: j[0] || (j[0] = (X) => K())
|
|
1264
|
+
}, null, 8, ["icon", "title"])) : D("", !0)
|
|
1075
1265
|
]),
|
|
1076
|
-
|
|
1266
|
+
N("div", {
|
|
1077
1267
|
ref_key: "wrapRef",
|
|
1078
|
-
ref:
|
|
1268
|
+
ref: a
|
|
1079
1269
|
}, [
|
|
1080
|
-
|
|
1270
|
+
C(H.$slots, "default")
|
|
1081
1271
|
], 512)
|
|
1082
1272
|
], 4)
|
|
1083
1273
|
]));
|
|
1084
1274
|
}
|
|
1085
|
-
}),
|
|
1086
|
-
...
|
|
1275
|
+
}), Ge = G(yt), bt = w({ name: "EzPagination", inheritAttrs: !1 }), ht = /* @__PURE__ */ w({
|
|
1276
|
+
...bt,
|
|
1087
1277
|
props: {
|
|
1088
1278
|
currentPage: {},
|
|
1089
1279
|
currentPageModifiers: {},
|
|
1090
1280
|
pageSize: {},
|
|
1091
1281
|
pageSizeModifiers: {}
|
|
1092
1282
|
},
|
|
1093
|
-
emits:
|
|
1094
|
-
setup(
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
"current-page": s.value,
|
|
1102
|
-
"onUpdate:currentPage": d[0] || (d[0] = (E) => s.value = E),
|
|
1103
|
-
"page-size": f.value,
|
|
1104
|
-
"onUpdate:pageSize": d[1] || (d[1] = (E) => f.value = E),
|
|
1283
|
+
emits: ["update:currentPage", "update:pageSize"],
|
|
1284
|
+
setup(e) {
|
|
1285
|
+
const c = L(e, "currentPage"), l = L(e, "pageSize"), { attrs: i } = oe(["currentPage", "pageSize"]);
|
|
1286
|
+
return (a, f) => (o(), v(t(vl), g({
|
|
1287
|
+
"current-page": c.value,
|
|
1288
|
+
"onUpdate:currentPage": f[0] || (f[0] = (n) => c.value = n),
|
|
1289
|
+
"page-size": l.value,
|
|
1290
|
+
"onUpdate:pageSize": f[1] || (f[1] = (n) => l.value = n),
|
|
1105
1291
|
"page-sizes": [10, 20, 50, 100],
|
|
1106
1292
|
layout: "total, sizes, prev, pager, next, jumper"
|
|
1107
|
-
},
|
|
1108
|
-
onCurrentChange: V,
|
|
1109
|
-
onSizeChange: u
|
|
1110
|
-
}), null, 16, ["current-page", "page-size"]));
|
|
1293
|
+
}, t(i)), null, 16, ["current-page", "page-size"]));
|
|
1111
1294
|
}
|
|
1112
|
-
}),
|
|
1113
|
-
var
|
|
1114
|
-
const
|
|
1115
|
-
const
|
|
1295
|
+
}), He = G(ht);
|
|
1296
|
+
var ve = /* @__PURE__ */ ((e) => (e.ASC = "ascending", e.DESC = "descending", e[e.EMPTY = null] = "EMPTY", e))(ve || {});
|
|
1297
|
+
const Vt = (e) => {
|
|
1298
|
+
const c = O([]), l = T(() => c.value), i = T(() => c.value.map((n) => n[e]));
|
|
1116
1299
|
return {
|
|
1117
|
-
selectionChange: (
|
|
1118
|
-
|
|
1300
|
+
selectionChange: (n) => {
|
|
1301
|
+
c.value = n;
|
|
1119
1302
|
},
|
|
1120
|
-
getSelectedList:
|
|
1121
|
-
getSelectedIds:
|
|
1122
|
-
getSortParams: ({ prop:
|
|
1123
|
-
const
|
|
1124
|
-
return
|
|
1303
|
+
getSelectedList: l,
|
|
1304
|
+
getSelectedIds: i,
|
|
1305
|
+
getSortParams: ({ prop: n, order: m }) => {
|
|
1306
|
+
const d = { asc: null, desc: null };
|
|
1307
|
+
return m === ve.ASC ? (d.asc = n, d.desc = null) : m === ve.DESC && (d.asc = null, d.desc = n), d;
|
|
1125
1308
|
}
|
|
1126
1309
|
};
|
|
1127
|
-
},
|
|
1310
|
+
}, Et = /* @__PURE__ */ w({
|
|
1128
1311
|
__name: "column-config",
|
|
1129
1312
|
props: {
|
|
1130
1313
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1132,47 +1315,47 @@ const ua = (t) => {
|
|
|
1132
1315
|
columns: { default: () => [] },
|
|
1133
1316
|
columnsModifiers: {}
|
|
1134
1317
|
},
|
|
1135
|
-
emits: /* @__PURE__ */
|
|
1136
|
-
setup(
|
|
1137
|
-
const { t:
|
|
1138
|
-
return (
|
|
1139
|
-
modelValue:
|
|
1140
|
-
"onUpdate:modelValue":
|
|
1318
|
+
emits: /* @__PURE__ */ F(["change"], ["update:modelValue", "update:columns"]),
|
|
1319
|
+
setup(e, { emit: c }) {
|
|
1320
|
+
const { t: l } = ue(), i = ["selection", "index", "expand"], a = c, f = L(e, "modelValue"), n = L(e, "columns"), m = (d) => n.value.filter((r) => r.hidden === 0).length < 2 && d.hidden === 0;
|
|
1321
|
+
return (d, s) => (o(), v(t(gl), {
|
|
1322
|
+
modelValue: f.value,
|
|
1323
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => f.value = r),
|
|
1141
1324
|
class: "ez-column-wrapper",
|
|
1142
|
-
title: l
|
|
1325
|
+
title: t(l)("s.label.column"),
|
|
1143
1326
|
size: "15%"
|
|
1144
1327
|
}, {
|
|
1145
|
-
default:
|
|
1146
|
-
(
|
|
1147
|
-
key:
|
|
1328
|
+
default: y(() => [
|
|
1329
|
+
(o(!0), V(P, null, W(n.value, (r) => (o(), V(P, {
|
|
1330
|
+
key: r.prop
|
|
1148
1331
|
}, [
|
|
1149
|
-
|
|
1332
|
+
i.includes(r.type) ? D("", !0) : (o(), v(t(Ne), {
|
|
1150
1333
|
key: 0,
|
|
1151
|
-
modelValue:
|
|
1152
|
-
"onUpdate:modelValue": (
|
|
1334
|
+
modelValue: r.hidden,
|
|
1335
|
+
"onUpdate:modelValue": (R) => r.hidden = R,
|
|
1153
1336
|
class: "flex",
|
|
1154
1337
|
"true-value": 0,
|
|
1155
1338
|
"false-value": 1,
|
|
1156
|
-
label:
|
|
1339
|
+
label: r.label,
|
|
1157
1340
|
checked: "",
|
|
1158
|
-
disabled:
|
|
1159
|
-
onChange:
|
|
1341
|
+
disabled: m(r),
|
|
1342
|
+
onChange: s[0] || (s[0] = (R) => a("change"))
|
|
1160
1343
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))
|
|
1161
1344
|
], 64))), 128))
|
|
1162
1345
|
]),
|
|
1163
1346
|
_: 1
|
|
1164
1347
|
}, 8, ["modelValue", "title"]));
|
|
1165
1348
|
}
|
|
1166
|
-
}),
|
|
1349
|
+
}), $t = { class: "ez-fast-table" }, kt = { class: "ez-fast-table_wrapper" }, wt = {
|
|
1167
1350
|
key: 0,
|
|
1168
1351
|
class: "ez-fast-table_wrapper_header_operation"
|
|
1169
|
-
},
|
|
1352
|
+
}, St = { class: "ez-fast-table_pagination" }, zt = w({
|
|
1170
1353
|
name: "EzFastTable",
|
|
1171
|
-
directives: { loading:
|
|
1354
|
+
directives: { loading: be.directive },
|
|
1172
1355
|
inheritAttrs: !1
|
|
1173
|
-
}),
|
|
1174
|
-
...
|
|
1175
|
-
props: /* @__PURE__ */
|
|
1356
|
+
}), Ct = /* @__PURE__ */ w({
|
|
1357
|
+
...zt,
|
|
1358
|
+
props: /* @__PURE__ */ F({
|
|
1176
1359
|
api: { type: Function, default: () => Promise.resolve() },
|
|
1177
1360
|
beforeSearch: { type: Function, default: () => Promise.resolve() },
|
|
1178
1361
|
columnTool: { type: Boolean, default: !0 },
|
|
@@ -1188,165 +1371,186 @@ const ua = (t) => {
|
|
|
1188
1371
|
loading: { type: Boolean },
|
|
1189
1372
|
loadingModifiers: {}
|
|
1190
1373
|
}),
|
|
1191
|
-
emits: /* @__PURE__ */
|
|
1192
|
-
setup(
|
|
1193
|
-
const { t:
|
|
1374
|
+
emits: /* @__PURE__ */ F(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
|
|
1375
|
+
setup(e, { expose: c, emit: l }) {
|
|
1376
|
+
const { t: i } = ue(), a = e, f = Me(), n = T(() => {
|
|
1377
|
+
const { api: h, beforeSearch: S, columnTool: q, expanded: x, ...le } = a;
|
|
1378
|
+
return {
|
|
1379
|
+
...f,
|
|
1380
|
+
...le
|
|
1381
|
+
};
|
|
1382
|
+
}), m = O(a.expanded), { selectionChange: d, getSelectedList: s, getSortParams: r, getSelectedIds: R } = Vt(a.rowKey), K = O(null), H = O(!1), j = O(null), X = O([]), Z = O(0), J = l, $ = L(e, "params"), E = L(e, "columns"), z = L(e, "loading"), U = async () => {
|
|
1194
1383
|
try {
|
|
1195
|
-
|
|
1196
|
-
const { code:
|
|
1197
|
-
|
|
1384
|
+
z.value = !0, await a.beforeSearch($.value);
|
|
1385
|
+
const { code: h, data: S } = await a.api($.value);
|
|
1386
|
+
h === 200 && S.records ? (X.value = S.records || [], Z.value = S.total) : (X.value = [], Z.value = 0), J("query");
|
|
1198
1387
|
} finally {
|
|
1199
|
-
|
|
1388
|
+
z.value = !1;
|
|
1200
1389
|
}
|
|
1201
|
-
},
|
|
1202
|
-
|
|
1203
|
-
},
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
const { column:
|
|
1207
|
-
|
|
1208
|
-
},
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1390
|
+
}, B = () => {
|
|
1391
|
+
$.value.current = 1, U();
|
|
1392
|
+
}, ee = () => K.value?.getTableRef(), u = (h) => {
|
|
1393
|
+
const S = r(h);
|
|
1394
|
+
$.value = { ...$.value, ...S };
|
|
1395
|
+
const { column: q } = h;
|
|
1396
|
+
q.sortable === "custom" && B();
|
|
1397
|
+
}, k = (h) => {
|
|
1398
|
+
if (h === null || typeof h != "object") return h;
|
|
1399
|
+
if (h instanceof Date) return new Date(h.getTime());
|
|
1400
|
+
if (h instanceof Array) return h.map((q) => k(q));
|
|
1401
|
+
const S = Object.create(Object.getPrototypeOf(h));
|
|
1402
|
+
for (const q in h)
|
|
1403
|
+
h.hasOwnProperty(q) && (S[q] = k(h[q]));
|
|
1404
|
+
return S;
|
|
1405
|
+
}, p = () => {
|
|
1406
|
+
$.value = k(j.value), J("reset"), Le(() => B());
|
|
1407
|
+
}, b = (h) => {
|
|
1408
|
+
J("changePage", h), h.size ? B() : U();
|
|
1409
|
+
}, I = () => {
|
|
1410
|
+
ee().doLayout();
|
|
1214
1411
|
};
|
|
1215
|
-
return
|
|
1216
|
-
|
|
1217
|
-
}),
|
|
1218
|
-
const
|
|
1219
|
-
return
|
|
1220
|
-
|
|
1412
|
+
return ye(() => {
|
|
1413
|
+
j.value = k($.value);
|
|
1414
|
+
}), c({ search: B, query: U, getTableRef: ee }), (h, S) => {
|
|
1415
|
+
const q = Ue("loading");
|
|
1416
|
+
return o(), V("div", $t, [
|
|
1417
|
+
h.$slots.form ? (o(), v(t(Ge), {
|
|
1221
1418
|
key: 0,
|
|
1222
|
-
loading:
|
|
1223
|
-
expanded:
|
|
1419
|
+
loading: z.value,
|
|
1420
|
+
expanded: m.value
|
|
1224
1421
|
}, {
|
|
1225
|
-
default:
|
|
1226
|
-
|
|
1422
|
+
default: y((x) => [
|
|
1423
|
+
C(h.$slots, "form", Ee(Ye(x)))
|
|
1227
1424
|
]),
|
|
1228
|
-
operate:
|
|
1229
|
-
|
|
1425
|
+
operate: y(() => [
|
|
1426
|
+
M(t(te), {
|
|
1230
1427
|
type: "primary",
|
|
1231
|
-
loading:
|
|
1232
|
-
onClick:
|
|
1428
|
+
loading: z.value,
|
|
1429
|
+
onClick: B
|
|
1233
1430
|
}, {
|
|
1234
|
-
default:
|
|
1235
|
-
|
|
1431
|
+
default: y(() => [
|
|
1432
|
+
_(Y(t(i)("s.button.query")), 1)
|
|
1236
1433
|
]),
|
|
1237
1434
|
_: 1
|
|
1238
1435
|
}, 8, ["loading"]),
|
|
1239
|
-
|
|
1240
|
-
default:
|
|
1241
|
-
|
|
1436
|
+
M(t(te), { onClick: p }, {
|
|
1437
|
+
default: y(() => [
|
|
1438
|
+
_(Y(t(i)("s.button.reset")), 1)
|
|
1242
1439
|
]),
|
|
1243
1440
|
_: 1
|
|
1244
1441
|
})
|
|
1245
1442
|
]),
|
|
1246
1443
|
_: 3
|
|
1247
|
-
}, 8, ["loading", "expanded"])) :
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1444
|
+
}, 8, ["loading", "expanded"])) : D("", !0),
|
|
1445
|
+
h.$slots.freeArea ? C(h.$slots, "freeArea", { key: 1 }) : D("", !0),
|
|
1446
|
+
N("div", kt, [
|
|
1447
|
+
h.$slots.header || a.columnTool ? (o(), V("div", {
|
|
1251
1448
|
key: 0,
|
|
1252
|
-
class:
|
|
1449
|
+
class: ce(["ez-fast-table_wrapper_header", h.$slots.header ? "justify-between" : "justify-end"])
|
|
1253
1450
|
}, [
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
selectList:
|
|
1257
|
-
selectIds:
|
|
1451
|
+
h.$slots.header ? (o(), V("div", wt, [
|
|
1452
|
+
C(h.$slots, "header", {
|
|
1453
|
+
selectList: t(s),
|
|
1454
|
+
selectIds: t(R)
|
|
1258
1455
|
})
|
|
1259
|
-
])) :
|
|
1260
|
-
|
|
1456
|
+
])) : D("", !0),
|
|
1457
|
+
a.columnTool ? (o(), v(t(te), {
|
|
1261
1458
|
key: 1,
|
|
1262
|
-
icon:
|
|
1459
|
+
icon: t(Kl),
|
|
1263
1460
|
circle: "",
|
|
1264
|
-
onClick:
|
|
1265
|
-
}, null, 8, ["icon"])) :
|
|
1266
|
-
], 2)) :
|
|
1267
|
-
|
|
1461
|
+
onClick: S[0] || (S[0] = (x) => H.value = !0)
|
|
1462
|
+
}, null, 8, ["icon"])) : D("", !0)
|
|
1463
|
+
], 2)) : D("", !0),
|
|
1464
|
+
Pe((o(), v(t(Fe), g(n.value, {
|
|
1268
1465
|
ref_key: "fastTableRef",
|
|
1269
|
-
ref:
|
|
1270
|
-
columns:
|
|
1271
|
-
data:
|
|
1272
|
-
onSelectionChange:
|
|
1273
|
-
onSortChange:
|
|
1274
|
-
}),
|
|
1275
|
-
W(
|
|
1276
|
-
name:
|
|
1277
|
-
fn:
|
|
1278
|
-
["form"].includes(
|
|
1466
|
+
ref: K,
|
|
1467
|
+
columns: E.value,
|
|
1468
|
+
data: X.value,
|
|
1469
|
+
onSelectionChange: t(d),
|
|
1470
|
+
onSortChange: u
|
|
1471
|
+
}), ae({ _: 2 }, [
|
|
1472
|
+
W(h.$slots, (x, le, he) => ({
|
|
1473
|
+
name: le,
|
|
1474
|
+
fn: y((ne) => [
|
|
1475
|
+
["form"].includes(x.name) ? D("", !0) : C(h.$slots, le, Ee(g({ key: 0 }, ne)))
|
|
1279
1476
|
])
|
|
1280
1477
|
}))
|
|
1281
1478
|
]), 1040, ["columns", "data", "onSelectionChange"])), [
|
|
1282
|
-
[
|
|
1479
|
+
[q, z.value]
|
|
1283
1480
|
]),
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
"current-page":
|
|
1481
|
+
N("div", St, [
|
|
1482
|
+
M(t(He), {
|
|
1483
|
+
"current-page": $.value.current,
|
|
1287
1484
|
"onUpdate:currentPage": [
|
|
1288
|
-
|
|
1289
|
-
|
|
1485
|
+
S[1] || (S[1] = (x) => $.value.current = x),
|
|
1486
|
+
S[3] || (S[3] = (x) => b({ current: x }))
|
|
1290
1487
|
],
|
|
1291
|
-
"page-size":
|
|
1488
|
+
"page-size": $.value.size,
|
|
1292
1489
|
"onUpdate:pageSize": [
|
|
1293
|
-
|
|
1294
|
-
|
|
1490
|
+
S[2] || (S[2] = (x) => $.value.size = x),
|
|
1491
|
+
S[4] || (S[4] = (x) => b({ size: x }))
|
|
1295
1492
|
],
|
|
1296
|
-
total:
|
|
1493
|
+
total: Z.value
|
|
1297
1494
|
}, null, 8, ["current-page", "page-size", "total"])
|
|
1298
1495
|
])
|
|
1299
1496
|
]),
|
|
1300
|
-
|
|
1301
|
-
modelValue:
|
|
1302
|
-
"onUpdate:modelValue":
|
|
1303
|
-
columns:
|
|
1304
|
-
"onUpdate:columns":
|
|
1305
|
-
onChange:
|
|
1497
|
+
M(Et, {
|
|
1498
|
+
modelValue: H.value,
|
|
1499
|
+
"onUpdate:modelValue": S[5] || (S[5] = (x) => H.value = x),
|
|
1500
|
+
columns: E.value,
|
|
1501
|
+
"onUpdate:columns": S[6] || (S[6] = (x) => E.value = x),
|
|
1502
|
+
onChange: I
|
|
1306
1503
|
}, null, 8, ["modelValue", "columns"])
|
|
1307
1504
|
]);
|
|
1308
1505
|
};
|
|
1309
1506
|
}
|
|
1310
|
-
}),
|
|
1311
|
-
function
|
|
1507
|
+
}), At = G(Ct), xe = /* @__PURE__ */ Symbol("INSTALLED_KEY");
|
|
1508
|
+
function Dt(e = []) {
|
|
1312
1509
|
return {
|
|
1313
|
-
install: (
|
|
1314
|
-
|
|
1510
|
+
install: (l) => {
|
|
1511
|
+
l[xe] || (l[xe] = !0, e.forEach((i) => l.use(i)));
|
|
1315
1512
|
}
|
|
1316
1513
|
};
|
|
1317
1514
|
}
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1515
|
+
const Tt = [
|
|
1516
|
+
Be,
|
|
1517
|
+
Ml,
|
|
1518
|
+
dt,
|
|
1519
|
+
ct,
|
|
1520
|
+
At,
|
|
1521
|
+
Q,
|
|
1522
|
+
qe,
|
|
1523
|
+
He,
|
|
1524
|
+
Oe,
|
|
1525
|
+
Ge,
|
|
1326
1526
|
Ie,
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
gl,
|
|
1527
|
+
Fe
|
|
1528
|
+
], Rt = [
|
|
1529
|
+
yl,
|
|
1530
|
+
be,
|
|
1531
|
+
se,
|
|
1532
|
+
bl,
|
|
1334
1533
|
hl,
|
|
1335
|
-
|
|
1336
|
-
],
|
|
1534
|
+
Vl
|
|
1535
|
+
], xt = Dt([...Tt, ...Rt]), Pt = xt.install;
|
|
1337
1536
|
export {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1537
|
+
tt as CHANGE_TRIGGER_TYPES,
|
|
1538
|
+
Be as EzCheckbox,
|
|
1539
|
+
Ml as EzDialog,
|
|
1540
|
+
dt as EzDynamicForm,
|
|
1541
|
+
At as EzFastTable,
|
|
1542
|
+
ct as EzFormItem,
|
|
1543
|
+
Q as EzIcon,
|
|
1544
|
+
qe as EzImageUpload,
|
|
1545
|
+
He as EzPagination,
|
|
1546
|
+
Oe as EzRadio,
|
|
1547
|
+
Ge as EzSearchForm,
|
|
1548
|
+
Ie as EzSelect,
|
|
1549
|
+
Fe as EzTable,
|
|
1550
|
+
A as FormItemType,
|
|
1551
|
+
lt as SELECT_FORM_TYPES,
|
|
1552
|
+
xt as default,
|
|
1553
|
+
at as getInputVerb,
|
|
1554
|
+
ot as getTrigger,
|
|
1555
|
+
Pt as install
|
|
1352
1556
|
};
|