@maxtan/ez-ui 0.12.1 → 0.13.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 +279 -255
- package/package.json +1 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useLocale as Se, ElCheckbox as ge, ElCheckboxButton as Te, ElCheckboxGroup as Be, ElLoading as ae, ElDialog as Ve, ElButton as Y, ElScrollbar as Me, ElTable as Le, ElTableColumn as re, ElPagination as Pe, ElDrawer as Re, ElRadio as Ue, ElRadioButton as Ie, ElRadioGroup as
|
|
2
|
-
import { defineComponent as v, computed as P, createBlock as p, openBlock as
|
|
1
|
+
import { useLocale as Se, ElCheckbox as ge, ElCheckboxButton as Te, ElCheckboxGroup as Be, ElLoading as ae, ElDialog as Ve, ElButton as Y, ElScrollbar as Me, ElTable as Le, ElTableColumn as re, ElPagination as Pe, ElDrawer as Re, ElRadio as Ue, ElRadioButton as Ie, ElRadioGroup as qe, ElSelect as De, ElOptionGroup as Ae, ElOption as ie, ElUpload as ue, ElImage as de, ElImageViewer as Fe, ElMessage as J, ElInfiniteScroll as Oe, ElMessageBox as Ne, ElNotification as je, ElPopoverDirective as He } from "element-plus";
|
|
2
|
+
import { defineComponent as v, computed as P, createBlock as p, openBlock as o, unref as s, normalizeProps as X, guardReactiveProps as oe, withCtx as d, createElementBlock as m, Fragment as R, renderList as O, resolveDynamicComponent as ye, mergeProps as k, createTextVNode as H, toDisplayString as A, mergeModels as K, useModel as F, resolveDirective as he, renderSlot as B, createCommentVNode as E, withDirectives as _e, ref as V, createSlots as te, createElementVNode as T, onMounted as be, nextTick as we, onUnmounted as Ke, normalizeStyle as $e, createVNode as S, normalizeClass as Ge, withModifiers as ce } from "vue";
|
|
3
3
|
const U = (l, n) => (l.install = (e) => {
|
|
4
4
|
for (const t of [l, ...Object.values({})])
|
|
5
5
|
e.component(t.name, t);
|
|
@@ -84,22 +84,30 @@ var Ye = {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
const { s:
|
|
88
|
-
function
|
|
87
|
+
const { s: Je } = Ye;
|
|
88
|
+
function Ze(l, n) {
|
|
89
89
|
return n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, l);
|
|
90
90
|
}
|
|
91
|
+
function Qe(l, n = {}) {
|
|
92
|
+
return l.replace(/\{\s*(\w+)\s*\}/g, (e, t) => {
|
|
93
|
+
const r = n[t];
|
|
94
|
+
return r !== void 0 ? String(r) : `{${t}}`;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
91
97
|
function Q() {
|
|
92
98
|
const { t: l, lang: n } = Se();
|
|
93
99
|
return {
|
|
94
|
-
t: (t,
|
|
95
|
-
const c =
|
|
96
|
-
|
|
100
|
+
t: (t, r = {}) => {
|
|
101
|
+
const c = l(t, r);
|
|
102
|
+
if (c !== t) return c;
|
|
103
|
+
const a = Ze({ s: Je }, t);
|
|
104
|
+
return typeof a == "string" ? Qe(a, r) : t;
|
|
97
105
|
},
|
|
98
106
|
lang: n
|
|
99
107
|
};
|
|
100
108
|
}
|
|
101
|
-
const
|
|
102
|
-
...
|
|
109
|
+
const We = v({ name: "EzCheckbox" }), Xe = /* @__PURE__ */ v({
|
|
110
|
+
...We,
|
|
103
111
|
props: {
|
|
104
112
|
type: { default: "default" },
|
|
105
113
|
options: { default: () => [] }
|
|
@@ -108,9 +116,9 @@ const Qe = v({ name: "EzCheckbox" }), We = /* @__PURE__ */ v({
|
|
|
108
116
|
const n = l, e = P(
|
|
109
117
|
() => ["default", "border"].includes(n.type) ? ge : Te
|
|
110
118
|
);
|
|
111
|
-
return (t, r) => (
|
|
119
|
+
return (t, r) => (o(), p(s(Be), X(oe(t.$attrs)), {
|
|
112
120
|
default: d(() => [
|
|
113
|
-
(
|
|
121
|
+
(o(!0), m(R, null, O(t.options, (c) => (o(), p(ye(e.value), k({
|
|
114
122
|
key: String(c.value),
|
|
115
123
|
ref_for: !0
|
|
116
124
|
}, c, {
|
|
@@ -118,7 +126,7 @@ const Qe = v({ name: "EzCheckbox" }), We = /* @__PURE__ */ v({
|
|
|
118
126
|
border: t.type === "border"
|
|
119
127
|
}), {
|
|
120
128
|
default: d(() => [
|
|
121
|
-
|
|
129
|
+
H(A(c.label), 1)
|
|
122
130
|
]),
|
|
123
131
|
_: 2
|
|
124
132
|
}, 1040, ["value", "border"]))), 128))
|
|
@@ -126,18 +134,18 @@ const Qe = v({ name: "EzCheckbox" }), We = /* @__PURE__ */ v({
|
|
|
126
134
|
_: 1
|
|
127
135
|
}, 16));
|
|
128
136
|
}
|
|
129
|
-
}),
|
|
130
|
-
var
|
|
131
|
-
const
|
|
137
|
+
}), et = U(Xe);
|
|
138
|
+
var Z = /* @__PURE__ */ ((l) => (l.CANCEL = "取消", l.CONFIRM = "确定", l))(Z || {});
|
|
139
|
+
const tt = { key: 1 }, lt = {
|
|
132
140
|
key: 0,
|
|
133
141
|
class: "ez-dialog__body"
|
|
134
|
-
},
|
|
135
|
-
...
|
|
142
|
+
}, at = { key: 1 }, ot = v({ name: "EzDialog", directives: { loading: ae.directive } }), st = /* @__PURE__ */ v({
|
|
143
|
+
...ot,
|
|
136
144
|
props: /* @__PURE__ */ K({
|
|
137
145
|
title: { default: "" },
|
|
138
146
|
loading: { type: Boolean, default: !1 },
|
|
139
|
-
cancelText: { default:
|
|
140
|
-
confirmText: { default:
|
|
147
|
+
cancelText: { default: Z.CANCEL },
|
|
148
|
+
confirmText: { default: Z.CONFIRM },
|
|
141
149
|
width: { default: 800 },
|
|
142
150
|
appendToBody: { type: Boolean, default: !1 },
|
|
143
151
|
destroyOnClose: { type: Boolean, default: !0 },
|
|
@@ -149,16 +157,16 @@ const et = { key: 1 }, tt = {
|
|
|
149
157
|
}),
|
|
150
158
|
emits: /* @__PURE__ */ K(["cancel", "confirm"], ["update:modelValue"]),
|
|
151
159
|
setup(l, { emit: n }) {
|
|
152
|
-
const { t: e } = Q(), t = l, r = n, c =
|
|
160
|
+
const { t: e } = Q(), t = l, r = n, c = F(l, "modelValue"), a = () => {
|
|
153
161
|
c.value = !1, r("cancel");
|
|
154
162
|
}, b = () => {
|
|
155
163
|
r("confirm");
|
|
156
164
|
};
|
|
157
|
-
return (f,
|
|
158
|
-
const u =
|
|
159
|
-
return
|
|
165
|
+
return (f, h) => {
|
|
166
|
+
const u = he("loading");
|
|
167
|
+
return o(), p(s(Ve), k({
|
|
160
168
|
modelValue: c.value,
|
|
161
|
-
"onUpdate:modelValue":
|
|
169
|
+
"onUpdate:modelValue": h[0] || (h[0] = ($) => c.value = $)
|
|
162
170
|
}, f.$attrs, {
|
|
163
171
|
width: t.width,
|
|
164
172
|
"append-to-body": t.appendToBody,
|
|
@@ -168,13 +176,13 @@ const et = { key: 1 }, tt = {
|
|
|
168
176
|
class: "ez-dialog"
|
|
169
177
|
}), {
|
|
170
178
|
header: d(() => [
|
|
171
|
-
f.$slots.header ?
|
|
179
|
+
f.$slots.header ? B(f.$slots, "header", { key: 0 }) : (o(), m("p", tt, A(t.title), 1))
|
|
172
180
|
]),
|
|
173
181
|
default: d(() => [
|
|
174
|
-
|
|
182
|
+
_e((o(), p(s(Me), null, {
|
|
175
183
|
default: d(() => [
|
|
176
|
-
f.$slots.default ? (
|
|
177
|
-
|
|
184
|
+
f.$slots.default ? (o(), m("div", lt, [
|
|
185
|
+
B(f.$slots, "default")
|
|
178
186
|
])) : E("", !0)
|
|
179
187
|
]),
|
|
180
188
|
_: 3
|
|
@@ -183,25 +191,25 @@ const et = { key: 1 }, tt = {
|
|
|
183
191
|
])
|
|
184
192
|
]),
|
|
185
193
|
footer: d(() => [
|
|
186
|
-
f.$slots.footer ?
|
|
187
|
-
t.cancelText ? (
|
|
194
|
+
f.$slots.footer ? B(f.$slots, "footer", { key: 0 }) : (o(), m("div", at, [
|
|
195
|
+
t.cancelText ? (o(), p(s(Y), {
|
|
188
196
|
key: 0,
|
|
189
197
|
type: "default",
|
|
190
|
-
onClick:
|
|
198
|
+
onClick: a
|
|
191
199
|
}, {
|
|
192
200
|
default: d(() => [
|
|
193
|
-
|
|
201
|
+
H(A(t.cancelText === s(Z).CANCEL ? s(e)("s.button.cancel") : t.cancelText), 1)
|
|
194
202
|
]),
|
|
195
203
|
_: 1
|
|
196
204
|
})) : E("", !0),
|
|
197
|
-
t.confirmText ? (
|
|
205
|
+
t.confirmText ? (o(), p(s(Y), {
|
|
198
206
|
key: 1,
|
|
199
207
|
type: "primary",
|
|
200
208
|
loading: t.loading,
|
|
201
209
|
onClick: b
|
|
202
210
|
}, {
|
|
203
211
|
default: d(() => [
|
|
204
|
-
|
|
212
|
+
H(A(t.confirmText === s(Z).CONFIRM ? s(e)("s.button.confirm") : t.confirmText), 1)
|
|
205
213
|
]),
|
|
206
214
|
_: 1
|
|
207
215
|
}, 8, ["loading"])) : E("", !0)
|
|
@@ -211,8 +219,8 @@ const et = { key: 1 }, tt = {
|
|
|
211
219
|
}, 16, ["modelValue", "width", "append-to-body", "close-on-click-modal", "destroy-on-close", "close-on-press-escape"]);
|
|
212
220
|
};
|
|
213
221
|
}
|
|
214
|
-
}),
|
|
215
|
-
...
|
|
222
|
+
}), nt = U(st), rt = v({ name: "EzTable" }), it = /* @__PURE__ */ v({
|
|
223
|
+
...rt,
|
|
216
224
|
props: {
|
|
217
225
|
data: { default: () => [] },
|
|
218
226
|
columns: { default: () => [] },
|
|
@@ -220,22 +228,22 @@ const et = { key: 1 }, tt = {
|
|
|
220
228
|
rowKey: { default: "id" }
|
|
221
229
|
},
|
|
222
230
|
setup(l, { expose: n }) {
|
|
223
|
-
const e = l, t = V(), r = (
|
|
224
|
-
const b = e.columns[e.columns.length - 1], f = () =>
|
|
231
|
+
const e = l, t = V(), r = (a) => {
|
|
232
|
+
const b = e.columns[e.columns.length - 1], f = () => a.type ? !1 : a.prop !== b.prop;
|
|
225
233
|
return { ...{
|
|
226
234
|
align: "center",
|
|
227
235
|
hidden: 1,
|
|
228
236
|
resizable: !0,
|
|
229
|
-
reserveSelection:
|
|
237
|
+
reserveSelection: a.type === "selection",
|
|
230
238
|
/** 默认最后一个 */
|
|
231
239
|
showOverflowTooltip: f()
|
|
232
|
-
}, ...
|
|
240
|
+
}, ...a };
|
|
233
241
|
};
|
|
234
242
|
return n({
|
|
235
243
|
getTableRef: () => t.value
|
|
236
|
-
}), (
|
|
237
|
-
var f,
|
|
238
|
-
return
|
|
244
|
+
}), (a, b) => {
|
|
245
|
+
var f, h;
|
|
246
|
+
return o(), p(s(Le), k(a.$attrs, {
|
|
239
247
|
ref_key: "tableRef",
|
|
240
248
|
ref: t,
|
|
241
249
|
data: e.data,
|
|
@@ -243,33 +251,33 @@ const et = { key: 1 }, tt = {
|
|
|
243
251
|
"row-key": e.rowKey
|
|
244
252
|
}), te({
|
|
245
253
|
default: d(() => [
|
|
246
|
-
(
|
|
254
|
+
(o(!0), m(R, null, O(e.columns, (u) => (o(), m(R, {
|
|
247
255
|
key: u.prop
|
|
248
256
|
}, [
|
|
249
|
-
["selection", "index"].includes(u.type) ? (
|
|
257
|
+
["selection", "index"].includes(u.type) ? (o(), p(s(re), k({
|
|
250
258
|
key: 0,
|
|
251
259
|
ref_for: !0
|
|
252
|
-
}, r(u)), null, 16)) : u.hidden ? E("", !0) : (
|
|
260
|
+
}, r(u)), null, 16)) : u.hidden ? E("", !0) : (o(), p(s(re), k({
|
|
253
261
|
key: 1,
|
|
254
262
|
ref_for: !0
|
|
255
263
|
}, r(u)), te({ _: 2 }, [
|
|
256
|
-
|
|
264
|
+
a.$slots[u.prop] ? {
|
|
257
265
|
name: "default",
|
|
258
|
-
fn: d((
|
|
259
|
-
|
|
266
|
+
fn: d(($) => [
|
|
267
|
+
B(a.$slots, u.prop, k({ ref_for: !0 }, $))
|
|
260
268
|
]),
|
|
261
269
|
key: "0"
|
|
262
270
|
} : u.transform ? {
|
|
263
271
|
name: "default",
|
|
264
|
-
fn: d((
|
|
265
|
-
|
|
272
|
+
fn: d(($) => [
|
|
273
|
+
H(A(u.transform($.row)), 1)
|
|
266
274
|
]),
|
|
267
275
|
key: "1"
|
|
268
276
|
} : void 0,
|
|
269
|
-
|
|
277
|
+
a.$slots[`header-${u.prop}`] ? {
|
|
270
278
|
name: "header",
|
|
271
|
-
fn: d((
|
|
272
|
-
|
|
279
|
+
fn: d(($) => [
|
|
280
|
+
B(a.$slots, `header-${u.prop}`, k({ ref_for: !0 }, $))
|
|
273
281
|
]),
|
|
274
282
|
key: "2"
|
|
275
283
|
} : void 0
|
|
@@ -278,109 +286,125 @@ const et = { key: 1 }, tt = {
|
|
|
278
286
|
]),
|
|
279
287
|
_: 2
|
|
280
288
|
}, [
|
|
281
|
-
(f =
|
|
289
|
+
(f = a.$slots) != null && f.append ? {
|
|
282
290
|
name: "append",
|
|
283
291
|
fn: d(() => [
|
|
284
|
-
|
|
292
|
+
B(a.$slots, "append")
|
|
285
293
|
]),
|
|
286
294
|
key: "0"
|
|
287
295
|
} : void 0,
|
|
288
|
-
(
|
|
296
|
+
(h = a.$slots) != null && h.empty ? {
|
|
289
297
|
name: "empty",
|
|
290
298
|
fn: d(() => [
|
|
291
|
-
|
|
299
|
+
B(a.$slots, "empty")
|
|
292
300
|
]),
|
|
293
301
|
key: "1"
|
|
294
302
|
} : void 0
|
|
295
303
|
]), 1040, ["data", "border", "row-key"]);
|
|
296
304
|
};
|
|
297
305
|
}
|
|
298
|
-
}), ke = U(
|
|
306
|
+
}), ke = U(it), ut = {
|
|
299
307
|
xmlns: "http://www.w3.org/2000/svg",
|
|
308
|
+
width: "200",
|
|
309
|
+
height: "200",
|
|
300
310
|
viewBox: "0 0 1024 1024"
|
|
301
|
-
},
|
|
302
|
-
name: "
|
|
303
|
-
__name: "
|
|
311
|
+
}, dt = /* @__PURE__ */ v({
|
|
312
|
+
name: "ArrowDown",
|
|
313
|
+
__name: "ArrowDown",
|
|
304
314
|
setup(l) {
|
|
305
|
-
return (n, e) => (
|
|
306
|
-
|
|
315
|
+
return (n, e) => (o(), m("svg", ut, e[0] || (e[0] = [
|
|
316
|
+
T("path", {
|
|
307
317
|
fill: "currentColor",
|
|
308
|
-
d: "
|
|
318
|
+
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"
|
|
309
319
|
}, null, -1)
|
|
310
320
|
])));
|
|
311
321
|
}
|
|
312
|
-
}),
|
|
322
|
+
}), ct = {
|
|
313
323
|
xmlns: "http://www.w3.org/2000/svg",
|
|
324
|
+
width: "200",
|
|
325
|
+
height: "200",
|
|
314
326
|
viewBox: "0 0 1024 1024"
|
|
315
|
-
},
|
|
316
|
-
name: "
|
|
317
|
-
__name: "
|
|
327
|
+
}, ft = /* @__PURE__ */ v({
|
|
328
|
+
name: "ArrowUp",
|
|
329
|
+
__name: "ArrowUp",
|
|
318
330
|
setup(l) {
|
|
319
|
-
return (n, e) => (
|
|
320
|
-
|
|
331
|
+
return (n, e) => (o(), m("svg", ct, e[0] || (e[0] = [
|
|
332
|
+
T("path", {
|
|
321
333
|
fill: "currentColor",
|
|
322
|
-
d: "
|
|
334
|
+
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"
|
|
323
335
|
}, null, -1)
|
|
324
336
|
])));
|
|
325
337
|
}
|
|
326
|
-
}),
|
|
338
|
+
}), pt = {
|
|
327
339
|
xmlns: "http://www.w3.org/2000/svg",
|
|
340
|
+
width: "200",
|
|
341
|
+
height: "200",
|
|
328
342
|
viewBox: "0 0 1024 1024"
|
|
329
343
|
}, fe = /* @__PURE__ */ v({
|
|
330
344
|
name: "Delete",
|
|
331
345
|
__name: "delete",
|
|
332
346
|
setup(l) {
|
|
333
|
-
return (n, e) => (
|
|
334
|
-
|
|
347
|
+
return (n, e) => (o(), m("svg", pt, e[0] || (e[0] = [
|
|
348
|
+
T("path", {
|
|
335
349
|
fill: "currentColor",
|
|
336
|
-
d: "
|
|
350
|
+
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"
|
|
337
351
|
}, null, -1)
|
|
338
352
|
])));
|
|
339
353
|
}
|
|
340
|
-
}),
|
|
354
|
+
}), mt = {
|
|
341
355
|
xmlns: "http://www.w3.org/2000/svg",
|
|
356
|
+
width: "200",
|
|
357
|
+
height: "200",
|
|
342
358
|
viewBox: "0 0 1024 1024"
|
|
343
359
|
}, pe = /* @__PURE__ */ v({
|
|
344
360
|
name: "Plus",
|
|
345
361
|
__name: "plus",
|
|
346
362
|
setup(l) {
|
|
347
|
-
return (n, e) => (
|
|
348
|
-
|
|
363
|
+
return (n, e) => (o(), m("svg", mt, e[0] || (e[0] = [
|
|
364
|
+
T("path", {
|
|
349
365
|
fill: "currentColor",
|
|
350
|
-
d: "
|
|
366
|
+
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"
|
|
351
367
|
}, null, -1)
|
|
352
368
|
])));
|
|
353
369
|
}
|
|
354
|
-
}),
|
|
370
|
+
}), vt = {
|
|
355
371
|
xmlns: "http://www.w3.org/2000/svg",
|
|
372
|
+
width: "200",
|
|
373
|
+
height: "200",
|
|
356
374
|
viewBox: "0 0 1024 1024"
|
|
357
|
-
},
|
|
375
|
+
}, gt = /* @__PURE__ */ v({
|
|
358
376
|
name: "Setting",
|
|
359
377
|
__name: "setting",
|
|
360
378
|
setup(l) {
|
|
361
|
-
return (n, e) => (
|
|
362
|
-
|
|
379
|
+
return (n, e) => (o(), m("svg", vt, e[0] || (e[0] = [
|
|
380
|
+
T("path", {
|
|
363
381
|
fill: "currentColor",
|
|
364
|
-
d: "
|
|
382
|
+
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"
|
|
365
383
|
}, null, -1)
|
|
366
384
|
])));
|
|
367
385
|
}
|
|
368
|
-
}),
|
|
386
|
+
}), yt = {
|
|
369
387
|
xmlns: "http://www.w3.org/2000/svg",
|
|
388
|
+
width: "200",
|
|
389
|
+
height: "200",
|
|
370
390
|
viewBox: "0 0 1024 1024"
|
|
371
391
|
}, me = /* @__PURE__ */ v({
|
|
372
392
|
name: "ZoomIn",
|
|
373
|
-
__name: "
|
|
393
|
+
__name: "ZoomIn",
|
|
374
394
|
setup(l) {
|
|
375
|
-
return (n, e) => (
|
|
376
|
-
|
|
395
|
+
return (n, e) => (o(), m("svg", yt, e[0] || (e[0] = [
|
|
396
|
+
T("path", {
|
|
397
|
+
fill: "currentColor",
|
|
398
|
+
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"
|
|
399
|
+
}, null, -1),
|
|
400
|
+
T("path", {
|
|
377
401
|
fill: "currentColor",
|
|
378
|
-
d: "
|
|
402
|
+
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"
|
|
379
403
|
}, null, -1)
|
|
380
404
|
])));
|
|
381
405
|
}
|
|
382
|
-
}),
|
|
383
|
-
...
|
|
406
|
+
}), ht = { class: "ez-search-from" }, _t = { class: "ez-search-from_operate" }, bt = v({ name: "EzSearchForm", inheritAttrs: !1 }), wt = /* @__PURE__ */ v({
|
|
407
|
+
...bt,
|
|
384
408
|
props: /* @__PURE__ */ K({
|
|
385
409
|
arrowHeight: { default: 50 },
|
|
386
410
|
reset: { type: Boolean }
|
|
@@ -390,50 +414,50 @@ const et = { key: 1 }, tt = {
|
|
|
390
414
|
}),
|
|
391
415
|
emits: ["update:expanded"],
|
|
392
416
|
setup(l, { expose: n }) {
|
|
393
|
-
const e = l, { t } = Q(), r = V(), c = V(0),
|
|
417
|
+
const e = l, { t } = Q(), r = V(), c = V(0), a = F(l, "expanded"), b = P(() => c.value > e.arrowHeight), f = P(() => a.value ? ft : dt), h = P(() => a.value ? t("s.button.collapse") : t("s.button.expand")), u = () => {
|
|
394
418
|
const L = setTimeout(() => {
|
|
395
419
|
if (clearTimeout(L), r.value) {
|
|
396
420
|
const { height: M } = r.value.getBoundingClientRect();
|
|
397
421
|
c.value = M;
|
|
398
422
|
}
|
|
399
423
|
}, 50);
|
|
400
|
-
},
|
|
401
|
-
|
|
424
|
+
}, $ = () => {
|
|
425
|
+
a.value = !a.value;
|
|
402
426
|
};
|
|
403
427
|
return be(() => {
|
|
404
|
-
|
|
428
|
+
we(u), window.addEventListener("resize", u);
|
|
405
429
|
}), Ke(() => {
|
|
406
430
|
window.removeEventListener("resize", u);
|
|
407
431
|
}), n({
|
|
408
432
|
countViewHeight: u
|
|
409
|
-
}), (L, M) => (
|
|
410
|
-
|
|
433
|
+
}), (L, M) => (o(), m("div", ht, [
|
|
434
|
+
T("div", {
|
|
411
435
|
class: "overflow-hidden transition-[height] duration-300 ease-linear",
|
|
412
|
-
style:
|
|
413
|
-
height:
|
|
436
|
+
style: $e({
|
|
437
|
+
height: a.value ? `${c.value}px` : `${e.arrowHeight}px`
|
|
414
438
|
})
|
|
415
439
|
}, [
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
b.value ? (
|
|
440
|
+
T("div", _t, [
|
|
441
|
+
B(L.$slots, "operate"),
|
|
442
|
+
b.value ? (o(), p(s(Y), {
|
|
419
443
|
key: 0,
|
|
420
444
|
icon: f.value,
|
|
421
445
|
size: "small",
|
|
422
|
-
title:
|
|
446
|
+
title: h.value,
|
|
423
447
|
circle: "",
|
|
424
|
-
onClick: M[0] || (M[0] = (
|
|
448
|
+
onClick: M[0] || (M[0] = (N) => $())
|
|
425
449
|
}, null, 8, ["icon", "title"])) : E("", !0)
|
|
426
450
|
]),
|
|
427
|
-
|
|
451
|
+
T("div", {
|
|
428
452
|
ref_key: "wrapRef",
|
|
429
453
|
ref: r
|
|
430
454
|
}, [
|
|
431
|
-
|
|
455
|
+
B(L.$slots, "default")
|
|
432
456
|
], 512)
|
|
433
457
|
], 4)
|
|
434
458
|
]));
|
|
435
459
|
}
|
|
436
|
-
}), ze = U(
|
|
460
|
+
}), ze = U(wt), $t = v({ name: "EzPagination" }), kt = /* @__PURE__ */ v({
|
|
437
461
|
...$t,
|
|
438
462
|
props: {
|
|
439
463
|
background: { type: Boolean, default: !1 },
|
|
@@ -444,7 +468,7 @@ const et = { key: 1 }, tt = {
|
|
|
444
468
|
},
|
|
445
469
|
setup(l) {
|
|
446
470
|
const n = l;
|
|
447
|
-
return (e, t) => (
|
|
471
|
+
return (e, t) => (o(), p(s(Pe), k({
|
|
448
472
|
"page-sizes": n.pageSizes,
|
|
449
473
|
background: n.background,
|
|
450
474
|
size: n.size,
|
|
@@ -452,22 +476,22 @@ const et = { key: 1 }, tt = {
|
|
|
452
476
|
total: n.total
|
|
453
477
|
}, e.$attrs), null, 16, ["page-sizes", "background", "size", "layout", "total"]));
|
|
454
478
|
}
|
|
455
|
-
}), Ce = U(
|
|
479
|
+
}), Ce = U(kt);
|
|
456
480
|
var le = /* @__PURE__ */ ((l) => (l.ASC = "ascending", l.DESC = "descending", l[l.EMPTY = null] = "EMPTY", l))(le || {});
|
|
457
|
-
const
|
|
458
|
-
const n = V([]), e = P(() => n.value), t = P(() => n.value.map((
|
|
481
|
+
const zt = (l) => {
|
|
482
|
+
const n = V([]), e = P(() => n.value), t = P(() => n.value.map((a) => a[l]));
|
|
459
483
|
return {
|
|
460
|
-
selectionChange: (
|
|
461
|
-
n.value =
|
|
484
|
+
selectionChange: (a) => {
|
|
485
|
+
n.value = a;
|
|
462
486
|
},
|
|
463
487
|
getSelectedList: e,
|
|
464
488
|
getSelectedIds: t,
|
|
465
|
-
getSortParams: ({ prop:
|
|
489
|
+
getSortParams: ({ prop: a, order: b }) => {
|
|
466
490
|
const f = { asc: null, desc: null };
|
|
467
|
-
return b === le.ASC ? (f.asc =
|
|
491
|
+
return b === le.ASC ? (f.asc = a, f.desc = null) : b === le.DESC && (f.asc = null, f.desc = a), f;
|
|
468
492
|
}
|
|
469
493
|
};
|
|
470
|
-
},
|
|
494
|
+
}, Ct = /* @__PURE__ */ v({
|
|
471
495
|
__name: "column-config",
|
|
472
496
|
props: {
|
|
473
497
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -477,44 +501,44 @@ const kt = (l) => {
|
|
|
477
501
|
},
|
|
478
502
|
emits: /* @__PURE__ */ K(["change"], ["update:modelValue", "update:columns"]),
|
|
479
503
|
setup(l, { emit: n }) {
|
|
480
|
-
const { t: e } = Q(), t = ["selection", "index", "expand"], r = n, c =
|
|
481
|
-
return (f,
|
|
504
|
+
const { t: e } = Q(), t = ["selection", "index", "expand"], r = n, c = F(l, "modelValue"), a = F(l, "columns"), b = (f) => a.value.filter((u) => u.hidden === 0).length < 2 && f.hidden === 0;
|
|
505
|
+
return (f, h) => (o(), p(s(Re), {
|
|
482
506
|
modelValue: c.value,
|
|
483
|
-
"onUpdate:modelValue":
|
|
507
|
+
"onUpdate:modelValue": h[1] || (h[1] = (u) => c.value = u),
|
|
484
508
|
class: "ez-column-wrapper",
|
|
485
509
|
title: s(e)("s.label.column"),
|
|
486
510
|
size: "15%"
|
|
487
511
|
}, {
|
|
488
512
|
default: d(() => [
|
|
489
|
-
(
|
|
513
|
+
(o(!0), m(R, null, O(a.value, (u) => (o(), m(R, {
|
|
490
514
|
key: u.prop
|
|
491
515
|
}, [
|
|
492
|
-
t.includes(u.type) ? E("", !0) : (
|
|
516
|
+
t.includes(u.type) ? E("", !0) : (o(), p(s(ge), {
|
|
493
517
|
key: 0,
|
|
494
518
|
modelValue: u.hidden,
|
|
495
|
-
"onUpdate:modelValue": (
|
|
519
|
+
"onUpdate:modelValue": ($) => u.hidden = $,
|
|
496
520
|
class: "flex",
|
|
497
521
|
"true-value": 0,
|
|
498
522
|
"false-value": 1,
|
|
499
523
|
label: u.label,
|
|
500
524
|
checked: "",
|
|
501
525
|
disabled: b(u),
|
|
502
|
-
onChange:
|
|
526
|
+
onChange: h[0] || (h[0] = ($) => r("change"))
|
|
503
527
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))
|
|
504
528
|
], 64))), 128))
|
|
505
529
|
]),
|
|
506
530
|
_: 1
|
|
507
531
|
}, 8, ["modelValue", "title"]));
|
|
508
532
|
}
|
|
509
|
-
}),
|
|
533
|
+
}), Et = { class: "ez-fast-table" }, xt = { class: "ez-fast-table-wrapper" }, St = {
|
|
510
534
|
key: 0,
|
|
511
535
|
class: "ez-fast-table-wrapper_header_operation"
|
|
512
|
-
},
|
|
536
|
+
}, Tt = { class: "mt-[10px] flex justify-end" }, Bt = v({
|
|
513
537
|
name: "EzFastTable",
|
|
514
538
|
directives: { loading: ae.directive },
|
|
515
539
|
inheritAttrs: !1
|
|
516
|
-
}),
|
|
517
|
-
...
|
|
540
|
+
}), Vt = /* @__PURE__ */ v({
|
|
541
|
+
...Bt,
|
|
518
542
|
props: /* @__PURE__ */ K({
|
|
519
543
|
api: { type: Function, default: () => Promise.resolve() },
|
|
520
544
|
beforeSearch: { type: Function, default: () => Promise.resolve() },
|
|
@@ -534,43 +558,43 @@ const kt = (l) => {
|
|
|
534
558
|
}),
|
|
535
559
|
emits: /* @__PURE__ */ K(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
|
|
536
560
|
setup(l, { expose: n, emit: e }) {
|
|
537
|
-
const { t } = Q(), r = l, c = V(r.expanded), { selectionChange:
|
|
561
|
+
const { t } = Q(), r = l, c = V(r.expanded), { selectionChange: a, getSelectedList: b, getSortParams: f, getSelectedIds: h } = zt(r.rowKey), u = V(null), $ = V(!1), L = V(null), M = V([]), N = V(0), G = e, x = F(l, "params"), g = F(l, "columns"), i = F(l, "loading"), _ = async () => {
|
|
538
562
|
try {
|
|
539
563
|
i.value = !0, await r.beforeSearch(x.value);
|
|
540
|
-
const { code: y, data:
|
|
541
|
-
y === 200 &&
|
|
564
|
+
const { code: y, data: w } = await r.api(x.value);
|
|
565
|
+
y === 200 && w.records ? (M.value = w.records || [], N.value = w.total) : (M.value = [], N.value = 0), G("query");
|
|
542
566
|
} finally {
|
|
543
567
|
i.value = !1;
|
|
544
568
|
}
|
|
545
569
|
}, z = () => {
|
|
546
|
-
x.value.current = 1,
|
|
570
|
+
x.value.current = 1, _();
|
|
547
571
|
}, I = () => {
|
|
548
572
|
var y;
|
|
549
573
|
return (y = u.value) == null ? void 0 : y.getTableRef();
|
|
550
574
|
}, W = (y) => {
|
|
551
|
-
const
|
|
552
|
-
x.value = { ...x.value,
|
|
575
|
+
const w = f(y);
|
|
576
|
+
x.value = { ...x.value, ...w };
|
|
553
577
|
const { column: ee } = y;
|
|
554
578
|
ee.sortable === "custom" && z();
|
|
555
|
-
},
|
|
556
|
-
x.value =
|
|
579
|
+
}, q = (y) => JSON.parse(JSON.stringify(y)), D = () => {
|
|
580
|
+
x.value = q(L.value), G("reset"), we(() => z());
|
|
557
581
|
}, se = (y) => {
|
|
558
|
-
G("changePage", y), y.size ? z() :
|
|
582
|
+
G("changePage", y), y.size ? z() : _();
|
|
559
583
|
}, Ee = () => {
|
|
560
584
|
I().doLayout();
|
|
561
585
|
};
|
|
562
586
|
return be(() => {
|
|
563
|
-
L.value =
|
|
564
|
-
}), n({ search: z, query:
|
|
565
|
-
const ee =
|
|
566
|
-
return
|
|
567
|
-
y.$slots.form ? (
|
|
587
|
+
L.value = q(x.value);
|
|
588
|
+
}), n({ search: z, query: _, getTableRef: I }), (y, w) => {
|
|
589
|
+
const ee = he("loading");
|
|
590
|
+
return o(), m("div", Et, [
|
|
591
|
+
y.$slots.form ? (o(), p(s(ze), {
|
|
568
592
|
key: 0,
|
|
569
593
|
loading: i.value,
|
|
570
594
|
expanded: c.value
|
|
571
595
|
}, {
|
|
572
596
|
default: d((C) => [
|
|
573
|
-
|
|
597
|
+
B(y.$slots, "form", X(oe(C)))
|
|
574
598
|
]),
|
|
575
599
|
operate: d(() => [
|
|
576
600
|
S(s(Y), {
|
|
@@ -579,84 +603,84 @@ const kt = (l) => {
|
|
|
579
603
|
onClick: z
|
|
580
604
|
}, {
|
|
581
605
|
default: d(() => [
|
|
582
|
-
|
|
606
|
+
H(A(s(t)("s.button.query")), 1)
|
|
583
607
|
]),
|
|
584
608
|
_: 1
|
|
585
609
|
}, 8, ["loading"]),
|
|
586
610
|
S(s(Y), { onClick: D }, {
|
|
587
611
|
default: d(() => [
|
|
588
|
-
|
|
612
|
+
H(A(s(t)("s.button.reset")), 1)
|
|
589
613
|
]),
|
|
590
614
|
_: 1
|
|
591
615
|
})
|
|
592
616
|
]),
|
|
593
617
|
_: 3
|
|
594
618
|
}, 8, ["loading", "expanded"])) : E("", !0),
|
|
595
|
-
y.$slots.freeArea ?
|
|
596
|
-
|
|
597
|
-
y.$slots.header || r.columnTool ? (
|
|
619
|
+
y.$slots.freeArea ? B(y.$slots, "freeArea", { key: 1 }) : E("", !0),
|
|
620
|
+
T("div", xt, [
|
|
621
|
+
y.$slots.header || r.columnTool ? (o(), m("div", {
|
|
598
622
|
key: 0,
|
|
599
623
|
class: Ge(["ez-fast-table-wrapper_header flex", y.$slots.header ? "justify-between" : "justify-end"])
|
|
600
624
|
}, [
|
|
601
|
-
y.$slots.header ? (
|
|
602
|
-
|
|
625
|
+
y.$slots.header ? (o(), m("div", St, [
|
|
626
|
+
B(y.$slots, "header", {
|
|
603
627
|
selectList: s(b),
|
|
604
|
-
selectIds: s(
|
|
628
|
+
selectIds: s(h)
|
|
605
629
|
})
|
|
606
630
|
])) : E("", !0),
|
|
607
|
-
r.columnTool ? (
|
|
631
|
+
r.columnTool ? (o(), p(s(Y), {
|
|
608
632
|
key: 1,
|
|
609
|
-
icon: s(
|
|
633
|
+
icon: s(gt),
|
|
610
634
|
circle: "",
|
|
611
|
-
onClick:
|
|
635
|
+
onClick: w[0] || (w[0] = (C) => $.value = !0)
|
|
612
636
|
}, null, 8, ["icon"])) : E("", !0)
|
|
613
637
|
], 2)) : E("", !0),
|
|
614
|
-
|
|
638
|
+
_e((o(), p(s(ke), k(y.$attrs, {
|
|
615
639
|
ref_key: "fastTableRef",
|
|
616
640
|
ref: u,
|
|
617
641
|
columns: g.value,
|
|
618
642
|
data: M.value,
|
|
619
643
|
"row-key": r.rowKey,
|
|
620
|
-
onSelectionChange: s(
|
|
644
|
+
onSelectionChange: s(a),
|
|
621
645
|
onSortChange: W
|
|
622
646
|
}), te({ _: 2 }, [
|
|
623
|
-
|
|
647
|
+
O(y.$slots, (C, ne, Wt) => ({
|
|
624
648
|
name: ne,
|
|
625
649
|
fn: d((xe) => [
|
|
626
|
-
["form"].includes(C.name) ? E("", !0) :
|
|
650
|
+
["form"].includes(C.name) ? E("", !0) : B(y.$slots, ne, X(k({ key: 0 }, xe)))
|
|
627
651
|
])
|
|
628
652
|
}))
|
|
629
653
|
]), 1040, ["columns", "data", "row-key", "onSelectionChange"])), [
|
|
630
654
|
[ee, i.value]
|
|
631
655
|
]),
|
|
632
|
-
|
|
656
|
+
T("div", Tt, [
|
|
633
657
|
S(s(Ce), {
|
|
634
658
|
"current-page": x.value.current,
|
|
635
659
|
"onUpdate:currentPage": [
|
|
636
|
-
|
|
637
|
-
|
|
660
|
+
w[1] || (w[1] = (C) => x.value.current = C),
|
|
661
|
+
w[3] || (w[3] = (C) => se({ current: C }))
|
|
638
662
|
],
|
|
639
663
|
"page-size": x.value.size,
|
|
640
664
|
"onUpdate:pageSize": [
|
|
641
|
-
|
|
642
|
-
|
|
665
|
+
w[2] || (w[2] = (C) => x.value.size = C),
|
|
666
|
+
w[4] || (w[4] = (C) => se({ size: C }))
|
|
643
667
|
],
|
|
644
|
-
total:
|
|
668
|
+
total: N.value
|
|
645
669
|
}, null, 8, ["current-page", "page-size", "total"])
|
|
646
670
|
])
|
|
647
671
|
]),
|
|
648
|
-
S(
|
|
649
|
-
modelValue:
|
|
650
|
-
"onUpdate:modelValue":
|
|
672
|
+
S(Ct, {
|
|
673
|
+
modelValue: $.value,
|
|
674
|
+
"onUpdate:modelValue": w[5] || (w[5] = (C) => $.value = C),
|
|
651
675
|
columns: g.value,
|
|
652
|
-
"onUpdate:columns":
|
|
676
|
+
"onUpdate:columns": w[6] || (w[6] = (C) => g.value = C),
|
|
653
677
|
onChange: Ee
|
|
654
678
|
}, null, 8, ["modelValue", "columns"])
|
|
655
679
|
]);
|
|
656
680
|
};
|
|
657
681
|
}
|
|
658
|
-
}),
|
|
659
|
-
...
|
|
682
|
+
}), Mt = U(Vt), Lt = v({ name: "EzIcon", inheritAttrs: !1 }), Pt = /* @__PURE__ */ v({
|
|
683
|
+
...Lt,
|
|
660
684
|
props: {
|
|
661
685
|
size: { default: 20 },
|
|
662
686
|
color: { default: "inherit" },
|
|
@@ -670,24 +694,24 @@ const kt = (l) => {
|
|
|
670
694
|
color: r
|
|
671
695
|
};
|
|
672
696
|
});
|
|
673
|
-
return (t, r) => (
|
|
697
|
+
return (t, r) => (o(), m("i", k(t.$attrs, {
|
|
674
698
|
class: ["ez-icon", n.class],
|
|
675
699
|
style: e.value
|
|
676
700
|
}), [
|
|
677
|
-
|
|
701
|
+
B(t.$slots, "default", { class: "w-[1em] h-[1em]" })
|
|
678
702
|
], 16));
|
|
679
703
|
}
|
|
680
|
-
}),
|
|
681
|
-
...
|
|
704
|
+
}), j = U(Pt), Rt = v({ name: "EzRadio" }), Ut = /* @__PURE__ */ v({
|
|
705
|
+
...Rt,
|
|
682
706
|
props: {
|
|
683
707
|
type: { default: "default" },
|
|
684
708
|
options: { default: () => [] }
|
|
685
709
|
},
|
|
686
710
|
setup(l) {
|
|
687
711
|
const n = l, e = P(() => ["default", "border"].includes(n.type) ? Ue : Ie);
|
|
688
|
-
return (t, r) => (
|
|
712
|
+
return (t, r) => (o(), p(s(qe), X(oe(t.$attrs)), {
|
|
689
713
|
default: d(() => [
|
|
690
|
-
(
|
|
714
|
+
(o(!0), m(R, null, O(t.options, (c) => (o(), p(ye(e.value), k({
|
|
691
715
|
key: String(c.value),
|
|
692
716
|
ref_for: !0
|
|
693
717
|
}, c, {
|
|
@@ -695,7 +719,7 @@ const kt = (l) => {
|
|
|
695
719
|
border: t.type === "border"
|
|
696
720
|
}), {
|
|
697
721
|
default: d(() => [
|
|
698
|
-
|
|
722
|
+
H(A(c.label), 1)
|
|
699
723
|
]),
|
|
700
724
|
_: 2
|
|
701
725
|
}, 1040, ["value", "border"]))), 128))
|
|
@@ -703,45 +727,45 @@ const kt = (l) => {
|
|
|
703
727
|
_: 1
|
|
704
728
|
}, 16));
|
|
705
729
|
}
|
|
706
|
-
}),
|
|
707
|
-
...
|
|
730
|
+
}), It = U(Ut), qt = v({ name: "EzSelect" }), Dt = /* @__PURE__ */ v({
|
|
731
|
+
...qt,
|
|
708
732
|
props: {
|
|
709
733
|
options: { default: () => [] },
|
|
710
734
|
clearable: { type: Boolean, default: !1 }
|
|
711
735
|
},
|
|
712
736
|
setup(l) {
|
|
713
737
|
const n = l, e = (r) => typeof r > "u", t = (r) => !e(r.options);
|
|
714
|
-
return (r, c) => (
|
|
738
|
+
return (r, c) => (o(), p(s(De), k(r.$attrs, {
|
|
715
739
|
clearable: n.clearable
|
|
716
740
|
}), {
|
|
717
741
|
default: d(() => [
|
|
718
|
-
(
|
|
719
|
-
t(
|
|
742
|
+
(o(!0), m(R, null, O(n.options, (a, b) => (o(), m(R, { key: b }, [
|
|
743
|
+
t(a) ? (o(), p(s(Ae), k({
|
|
720
744
|
key: 0,
|
|
721
745
|
ref_for: !0
|
|
722
|
-
},
|
|
746
|
+
}, a), {
|
|
723
747
|
default: d(() => [
|
|
724
|
-
(
|
|
748
|
+
(o(!0), m(R, null, O(a.options, (f) => (o(), p(s(ie), k({
|
|
725
749
|
key: f.label
|
|
726
750
|
}, { ref_for: !0 }, f), null, 16))), 128))
|
|
727
751
|
]),
|
|
728
752
|
_: 2
|
|
729
|
-
}, 1040)) : (
|
|
753
|
+
}, 1040)) : (o(), p(s(ie), k({
|
|
730
754
|
key: 1,
|
|
731
755
|
ref_for: !0
|
|
732
|
-
},
|
|
756
|
+
}, a), null, 16))
|
|
733
757
|
], 64))), 128))
|
|
734
758
|
]),
|
|
735
759
|
_: 1
|
|
736
760
|
}, 16, ["clearable"]));
|
|
737
761
|
}
|
|
738
|
-
}),
|
|
762
|
+
}), At = U(Dt), Ft = { class: "ez-upload-image" }, Ot = {
|
|
739
763
|
key: 0,
|
|
740
764
|
class: "flex items-center justify-center"
|
|
741
765
|
}, Nt = {
|
|
742
766
|
key: 1,
|
|
743
767
|
class: "ez-upload-image-list"
|
|
744
|
-
}, jt = { class: "flex items-center justify-center h-full" }, Ht = v({ name: "EzImageUpload" }),
|
|
768
|
+
}, jt = { class: "flex items-center justify-center h-full" }, Ht = v({ name: "EzImageUpload" }), Kt = /* @__PURE__ */ v({
|
|
745
769
|
...Ht,
|
|
746
770
|
props: /* @__PURE__ */ K({
|
|
747
771
|
api: { type: Function, default: () => Promise.resolve({ url: "" }) },
|
|
@@ -765,77 +789,77 @@ const kt = (l) => {
|
|
|
765
789
|
}),
|
|
766
790
|
emits: ["update:modelValue"],
|
|
767
791
|
setup(l, { expose: n }) {
|
|
768
|
-
const e = l, { t } = Q(), r = V(!1), c = V(0),
|
|
792
|
+
const e = l, { t } = Q(), r = V(!1), c = V(0), a = F(l, "modelValue"), b = P(() => e.multiple), f = /^(https?:\/\/|data:|blob:)/i, h = P(() => a.value ? u(a.value) : []);
|
|
769
793
|
function u(g) {
|
|
770
794
|
if (!g) return [];
|
|
771
795
|
const i = /^(https?:\/\/|data:|blob:)/i;
|
|
772
|
-
let
|
|
796
|
+
let _ = [], z = "", I = !1;
|
|
773
797
|
g = g.trim().replace(/,$/, "");
|
|
774
798
|
const W = g.split(",");
|
|
775
|
-
for (let
|
|
776
|
-
const D = W[
|
|
777
|
-
D && (i.test(D) ? (I && z &&
|
|
799
|
+
for (let q = 0; q < W.length; q++) {
|
|
800
|
+
const D = W[q].trim();
|
|
801
|
+
D && (i.test(D) ? (I && z && _.push(z.trim()), z = D, I = !0) : I ? z += "," + D : i.test(D.trim()) && _.push(D.trim()));
|
|
778
802
|
}
|
|
779
|
-
return I && z &&
|
|
803
|
+
return I && z && _.push(z.trim()), _.filter((q) => q && i.test(q));
|
|
780
804
|
}
|
|
781
|
-
function
|
|
805
|
+
function $(g) {
|
|
782
806
|
return !g || g.length === 0 ? "" : g.filter((i) => i.trim()).map((i) => i.trim()).join(",");
|
|
783
807
|
}
|
|
784
|
-
const L = (g) => e.disabled ? (
|
|
808
|
+
const L = (g) => e.disabled ? (J.warning(t("s.message.disabled")), !1) : e.imageTypes.includes(g.type.toLocaleLowerCase()) ? g.size > e.limitSize * 1024 * 1024 ? (J.error(t("s.validate.upload.limit", { max: e.limitSize })), !1) : !0 : (J.error(t("s.validate.upload.image")), !1), M = async ({ file: g }) => {
|
|
785
809
|
if (!e.disabled)
|
|
786
810
|
try {
|
|
787
811
|
const { url: i } = await e.api(g);
|
|
788
812
|
if (!i) throw new Error(t("s.message.uploadFail"));
|
|
789
813
|
if (b.value) {
|
|
790
|
-
const
|
|
791
|
-
i && f.test(i) && (
|
|
814
|
+
const _ = a.value ? u(a.value) : [];
|
|
815
|
+
i && f.test(i) && (_.push(i), a.value = $(_));
|
|
792
816
|
} else
|
|
793
|
-
|
|
817
|
+
a.value = i;
|
|
794
818
|
} catch (i) {
|
|
795
|
-
|
|
819
|
+
J.error(i.message);
|
|
796
820
|
}
|
|
797
|
-
},
|
|
821
|
+
}, N = (g, i = 0) => {
|
|
798
822
|
g && (c.value = i, r.value = !0);
|
|
799
823
|
}, G = (g) => {
|
|
800
|
-
if (!e.disabled && !(!g || !
|
|
824
|
+
if (!e.disabled && !(!g || !a.value))
|
|
801
825
|
if (b.value) {
|
|
802
|
-
const i = u(
|
|
803
|
-
|
|
826
|
+
const i = u(a.value), _ = i.findIndex((z) => z === g);
|
|
827
|
+
_ !== -1 && (i.splice(_, 1), a.value = i.join(","));
|
|
804
828
|
} else
|
|
805
|
-
|
|
829
|
+
a.value = null;
|
|
806
830
|
}, x = V();
|
|
807
831
|
return n({
|
|
808
832
|
getUploadRef: () => x.value,
|
|
809
|
-
getUrlList: () =>
|
|
810
|
-
}), (g, i) => (
|
|
811
|
-
b.value ? (
|
|
812
|
-
(
|
|
833
|
+
getUrlList: () => h.value
|
|
834
|
+
}), (g, i) => (o(), m("div", Ft, [
|
|
835
|
+
b.value ? (o(), m("div", Nt, [
|
|
836
|
+
(o(!0), m(R, null, O(h.value, (_, z) => (o(), m("div", {
|
|
813
837
|
key: z,
|
|
814
838
|
class: "ez-upload-image-item",
|
|
815
|
-
style:
|
|
839
|
+
style: $e(e.style)
|
|
816
840
|
}, [
|
|
817
841
|
S(s(de), {
|
|
818
|
-
src:
|
|
842
|
+
src: _,
|
|
819
843
|
fit: e.fit
|
|
820
844
|
}, null, 8, ["src", "fit"]),
|
|
821
|
-
|
|
845
|
+
T("div", {
|
|
822
846
|
class: "ez-upload-image_handle",
|
|
823
847
|
onClick: i[3] || (i[3] = ce(() => {
|
|
824
848
|
}, ["stop"]))
|
|
825
849
|
}, [
|
|
826
|
-
S(s(
|
|
850
|
+
S(s(j), {
|
|
827
851
|
size: 18,
|
|
828
|
-
onClick: (I) =>
|
|
852
|
+
onClick: (I) => N(_, z)
|
|
829
853
|
}, {
|
|
830
854
|
default: d(() => [
|
|
831
855
|
S(s(me))
|
|
832
856
|
]),
|
|
833
857
|
_: 2
|
|
834
858
|
}, 1032, ["onClick"]),
|
|
835
|
-
e.disabled ? E("", !0) : (
|
|
859
|
+
e.disabled ? E("", !0) : (o(), p(s(j), {
|
|
836
860
|
key: 0,
|
|
837
861
|
size: 18,
|
|
838
|
-
onClick: (I) => G(
|
|
862
|
+
onClick: (I) => G(_)
|
|
839
863
|
}, {
|
|
840
864
|
default: d(() => [
|
|
841
865
|
S(s(fe))
|
|
@@ -844,7 +868,7 @@ const kt = (l) => {
|
|
|
844
868
|
}, 1032, ["onClick"]))
|
|
845
869
|
])
|
|
846
870
|
], 4))), 128)),
|
|
847
|
-
|
|
871
|
+
h.value.length < e.limit && !e.disabled || h.value.length === 0 ? (o(), p(s(ue), k({ key: 0 }, g.$attrs, {
|
|
848
872
|
ref_key: "uploadRef",
|
|
849
873
|
ref: x,
|
|
850
874
|
action: "",
|
|
@@ -857,8 +881,8 @@ const kt = (l) => {
|
|
|
857
881
|
class: [{ "is-disabled": e.disabled }, "ez-upload-image-item ez-upload-button"]
|
|
858
882
|
}), {
|
|
859
883
|
default: d(() => [
|
|
860
|
-
|
|
861
|
-
S(s(
|
|
884
|
+
T("div", jt, [
|
|
885
|
+
S(s(j), null, {
|
|
862
886
|
default: d(() => [
|
|
863
887
|
S(s(pe))
|
|
864
888
|
]),
|
|
@@ -868,7 +892,7 @@ const kt = (l) => {
|
|
|
868
892
|
]),
|
|
869
893
|
_: 1
|
|
870
894
|
}, 16, ["style", "disabled", "class"])) : E("", !0)
|
|
871
|
-
])) : (
|
|
895
|
+
])) : (o(), p(s(ue), k({ key: 0 }, g.$attrs, {
|
|
872
896
|
ref_key: "uploadRef",
|
|
873
897
|
ref: x,
|
|
874
898
|
action: "",
|
|
@@ -881,29 +905,29 @@ const kt = (l) => {
|
|
|
881
905
|
class: ["ez-upload-image-wrapper", { "is-disabled": e.disabled }]
|
|
882
906
|
}), {
|
|
883
907
|
default: d(() => [
|
|
884
|
-
|
|
908
|
+
a.value ? (o(), m("div", Ot, [
|
|
885
909
|
S(s(de), {
|
|
886
|
-
src:
|
|
910
|
+
src: a.value,
|
|
887
911
|
fit: e.fit
|
|
888
912
|
}, null, 8, ["src", "fit"]),
|
|
889
|
-
|
|
913
|
+
T("div", {
|
|
890
914
|
class: "ez-upload-image_handle",
|
|
891
915
|
onClick: i[2] || (i[2] = ce(() => {
|
|
892
916
|
}, ["stop"]))
|
|
893
917
|
}, [
|
|
894
|
-
S(s(
|
|
918
|
+
S(s(j), {
|
|
895
919
|
size: 18,
|
|
896
|
-
onClick: i[0] || (i[0] = (
|
|
920
|
+
onClick: i[0] || (i[0] = (_) => N(a.value, 0))
|
|
897
921
|
}, {
|
|
898
922
|
default: d(() => [
|
|
899
923
|
S(s(me))
|
|
900
924
|
]),
|
|
901
925
|
_: 1
|
|
902
926
|
}),
|
|
903
|
-
e.disabled ? E("", !0) : (
|
|
927
|
+
e.disabled ? E("", !0) : (o(), p(s(j), {
|
|
904
928
|
key: 0,
|
|
905
929
|
size: 18,
|
|
906
|
-
onClick: i[1] || (i[1] = (
|
|
930
|
+
onClick: i[1] || (i[1] = (_) => G(a.value))
|
|
907
931
|
}, {
|
|
908
932
|
default: d(() => [
|
|
909
933
|
S(s(fe))
|
|
@@ -911,7 +935,7 @@ const kt = (l) => {
|
|
|
911
935
|
_: 1
|
|
912
936
|
}))
|
|
913
937
|
])
|
|
914
|
-
])) : (
|
|
938
|
+
])) : (o(), p(s(j), { key: 1 }, {
|
|
915
939
|
default: d(() => [
|
|
916
940
|
S(s(pe))
|
|
917
941
|
]),
|
|
@@ -920,52 +944,52 @@ const kt = (l) => {
|
|
|
920
944
|
]),
|
|
921
945
|
_: 1
|
|
922
946
|
}, 16, ["style", "disabled", "class"])),
|
|
923
|
-
r.value ? (
|
|
947
|
+
r.value ? (o(), p(s(Fe), {
|
|
924
948
|
key: 2,
|
|
925
|
-
"url-list": b.value ?
|
|
949
|
+
"url-list": b.value ? h.value : [a.value],
|
|
926
950
|
"initial-index": c.value,
|
|
927
|
-
onClose: i[4] || (i[4] = (
|
|
951
|
+
onClose: i[4] || (i[4] = (_) => r.value = !1)
|
|
928
952
|
}, null, 8, ["url-list", "initial-index"])) : E("", !0)
|
|
929
953
|
]));
|
|
930
954
|
}
|
|
931
|
-
}),
|
|
932
|
-
function
|
|
955
|
+
}), Gt = U(Kt), ve = Symbol("INSTALLED_KEY");
|
|
956
|
+
function Yt(l = []) {
|
|
933
957
|
return {
|
|
934
958
|
install: (e) => {
|
|
935
959
|
e[ve] || (e[ve] = !0, l.forEach((t) => e.use(t)));
|
|
936
960
|
}
|
|
937
961
|
};
|
|
938
962
|
}
|
|
939
|
-
const
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
963
|
+
const Jt = [
|
|
964
|
+
et,
|
|
965
|
+
nt,
|
|
966
|
+
Mt,
|
|
967
|
+
j,
|
|
968
|
+
Gt,
|
|
945
969
|
Ce,
|
|
946
|
-
|
|
970
|
+
It,
|
|
947
971
|
ze,
|
|
948
|
-
|
|
972
|
+
At,
|
|
949
973
|
ke
|
|
950
974
|
], Zt = [
|
|
951
|
-
|
|
975
|
+
Oe,
|
|
952
976
|
ae,
|
|
953
|
-
|
|
977
|
+
J,
|
|
978
|
+
Ne,
|
|
954
979
|
je,
|
|
955
|
-
He
|
|
956
|
-
|
|
957
|
-
], Jt = Gt([...Yt, ...Zt]), el = Jt.install;
|
|
980
|
+
He
|
|
981
|
+
], Qt = Yt([...Jt, ...Zt]), tl = Qt.install;
|
|
958
982
|
export {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
983
|
+
et as EzCheckbox,
|
|
984
|
+
nt as EzDialog,
|
|
985
|
+
Mt as EzFastTable,
|
|
986
|
+
j as EzIcon,
|
|
987
|
+
Gt as EzImageUpload,
|
|
964
988
|
Ce as EzPagination,
|
|
965
|
-
|
|
989
|
+
It as EzRadio,
|
|
966
990
|
ze as EzSearchForm,
|
|
967
|
-
|
|
991
|
+
At as EzSelect,
|
|
968
992
|
ke as EzTable,
|
|
969
|
-
|
|
970
|
-
|
|
993
|
+
Qt as default,
|
|
994
|
+
tl as install
|
|
971
995
|
};
|