@vue-start/element-pro 0.2.12 → 0.2.14

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.es.js CHANGED
@@ -1,28 +1,28 @@
1
- import { createExpose as Z, createFormItemCompFn as re, createExposeObj as T, ProForm as C, ProSearchForm as R, ProFormList as B, ProTable as M, ProDesc as k, ProCurdDesc as V, ProCurdForm as A, ProCurdModal as z, ProLayout as L } from "@vue-start/pro";
2
- import { ElFormItem as s, ElForm as h, ElLoading as oe, ElDialog as j, ElButton as w, ElPagination as N, ElPopover as O, ElCheckboxGroup as U, ElCheckboxButton as le, ElCheckbox as ue, ElRadioGroup as D, ElRadioButton as de, ElRadio as ce, ElSelect as q, ElOption as ie, ElTabs as K, ElTabPane as pe, ElInput as fe, ElInputNumber as me, ElDatePicker as ye, ElTimePicker as be, ElTreeSelect as ge, ElSwitch as ve, ElCascader as Pe, ElTableColumn as $, ElTable as G, ElDescriptions as Se } from "element-plus";
3
- import { defineComponent as m, createVNode as c, mergeProps as i, reactive as Ce, ref as g, toRaw as ke } from "vue";
4
- import { keys as S, omit as p, isBoolean as _, isString as se, debounce as he, map as P, size as W, pick as Fe, get as Te } from "lodash";
5
- import { useEffect as ee, generateId as xe, useWatch as F } from "@vue-start/hooks";
6
- const H = () => ({
1
+ import { createExpose as be, createFormItemCompFn as Me, createExposeObj as V, ProForm as s, ProSearchForm as A, ProFormList as $, ProTable as D, ProDesc as L, ProCurdDesc as G, ProCurdForm as _, ProCurdModal as W, ProUploaderText as Z, ElementKeys as m, ProCurd as Be, ProList as Ve, ProShowText as H, ProShowDigit as ze, ProShowDate as Ue, ProShowOptions as z, ProShowTree as J } from "@vue-start/pro";
2
+ import { ElFormItem as w, ElForm as N, ElLoading as Ae, ElDialog as Q, ElButton as I, ElPagination as X, ElPopover as Y, ElCheckboxGroup as ee, ElCheckboxButton as De, ElCheckbox as Pe, ElRadioGroup as te, ElRadioButton as Le, ElRadio as we, ElSelect as ae, ElOption as Ne, ElTabs as ne, ElTabPane as Oe, ElMenu as M, ElUpload as re, useFormItem as je, ElInput as qe, ElInputNumber as $e, ElDatePicker as Ge, ElTimePicker as _e, ElTreeSelect as We, ElSwitch as Ze, ElCascader as He, ElTableColumn as oe, ElTable as le, ElDescriptions as ge, ElRow as Je, ElCol as Qe, ElDescriptionsItem as Xe } from "element-plus";
3
+ import { defineComponent as g, createVNode as i, mergeProps as d, reactive as Ye, ref as S, toRaw as et, computed as pe, isVNode as tt } from "vue";
4
+ import { keys as T, omit as f, isBoolean as Se, isString as at, debounce as nt, map as h, size as B, pick as j, get as O, isNumber as U, filter as ue, isArray as rt } from "lodash";
5
+ import { useEffect as he, generateId as ot, useWatch as K, convertTreeData as lt, isValidFileType as ut, convertFileSize as ct } from "@vue-start/hooks";
6
+ const ce = () => ({
7
7
  name: {
8
8
  type: [String, Array]
9
9
  }
10
- }), Ee = m({
10
+ }), Ce = g({
11
11
  props: {
12
- ...s.props,
13
- ...H()
12
+ ...w.props,
13
+ ...ce()
14
14
  },
15
15
  setup: (e, {
16
16
  slots: t
17
17
  }) => {
18
- const u = S(H());
19
- return () => c(s, i(p(e, ...u, "name", "prop"), {
18
+ const c = T(ce());
19
+ return () => i(w, d(f(e, ...c, "name", "prop"), {
20
20
  prop: e.prop || e.name
21
21
  }), t);
22
22
  }
23
- }), te = ["clearValidate", "resetFields", "scrollToField", "validate", "validateField", "submit"], De = m({
23
+ }), ke = ["clearValidate", "resetFields", "scrollToField", "validate", "validateField", "submit"], it = g({
24
24
  props: {
25
- ...h.props,
25
+ ...N.props,
26
26
  hideRequiredMark: {
27
27
  type: [Boolean, Object],
28
28
  default: void 0
@@ -30,30 +30,30 @@ const H = () => ({
30
30
  },
31
31
  setup: (e, {
32
32
  slots: t,
33
- emit: u,
34
- expose: o
33
+ emit: c,
34
+ expose: a
35
35
  }) => {
36
- const l = e.model || Ce({}), n = g();
37
- return ee(() => {
38
- !n.value || (n.value.submit = () => {
39
- var r;
40
- (r = n.value) == null || r.validate((d, a) => {
41
- d ? u("finish", ke(l)) : u("finishFailed", a);
36
+ const l = e.model || Ye({}), r = S();
37
+ return he(() => {
38
+ !r.value || (r.value.submit = () => {
39
+ var n;
40
+ (n = r.value) == null || n.validate((u, o) => {
41
+ u ? c("finish", et(l)) : c("finishFailed", o);
42
42
  });
43
43
  });
44
- }, []), o(Z(te, n)), () => c(h, i({
45
- ref: n
46
- }, p(e, "model"), {
47
- hideRequiredAsterisk: _(e.hideRequiredMark) ? e.hideRequiredMark : e.hideRequiredAsterisk,
44
+ }, []), a(be(ke, r)), () => i(N, d({
45
+ ref: r
46
+ }, f(e, "model"), {
47
+ hideRequiredAsterisk: Se(e.hideRequiredMark) ? e.hideRequiredMark : e.hideRequiredAsterisk,
48
48
  model: l
49
49
  }), t);
50
50
  }
51
- }), b = re(Ee, (e, t, u) => ({
51
+ }), C = Me(Ce, (e, t, c) => ({
52
52
  modelValue: e,
53
53
  "onUpdate:modelValue": t,
54
54
  clearable: !0,
55
- disabled: u
56
- })), ae = (e = "comp") => e + "-" + xe(), Ie = () => ({
55
+ disabled: c
56
+ })), Fe = (e = "comp") => e + "-" + ot(), dt = () => ({
57
57
  loading: {
58
58
  type: Boolean
59
59
  },
@@ -81,22 +81,22 @@ const H = () => ({
81
81
  customClass: {
82
82
  type: String
83
83
  }
84
- }), Re = m({
84
+ }), Te = g({
85
85
  props: {
86
- ...Ie()
86
+ ...dt()
87
87
  },
88
88
  setup: (e, {
89
89
  slots: t
90
90
  }) => {
91
- const u = ae();
92
- return ee(() => {
91
+ const c = Fe();
92
+ return he(() => {
93
93
  if (!e.loading)
94
94
  return;
95
- let o = e.target;
96
- if (t.default ? o = document.getElementById(u) : e.target && se(e.target) && (o = document.querySelector("#" + e.target)), !o)
95
+ let a = e.target;
96
+ if (t.default ? a = document.getElementById(c) : e.target && at(e.target) && (a = document.querySelector("#" + e.target)), !a)
97
97
  return;
98
- const l = oe.service({
99
- target: o,
98
+ const l = Ae.service({
99
+ target: a,
100
100
  body: e.body,
101
101
  fullscreen: e.fullscreen,
102
102
  lock: e.lock,
@@ -108,11 +108,11 @@ const H = () => ({
108
108
  return () => {
109
109
  l && l.close();
110
110
  };
111
- }, () => e.loading), () => t.default ? c("div", {
112
- id: u
111
+ }, () => e.loading), () => t.default ? i("div", {
112
+ id: c
113
113
  }, [t.default()]) : null;
114
114
  }
115
- }), J = () => ({
115
+ }), ie = () => ({
116
116
  clsName: {
117
117
  type: String,
118
118
  default: "pro-modal"
@@ -144,70 +144,70 @@ const H = () => ({
144
144
  type: [Object, Boolean],
145
145
  default: void 0
146
146
  }
147
- }), Be = m({
147
+ }), xe = g({
148
148
  props: {
149
- ...j.props,
149
+ ...Q.props,
150
150
  appendToBody: {
151
151
  type: Boolean,
152
152
  default: !0
153
153
  },
154
- ...J()
154
+ ...ie()
155
155
  },
156
156
  setup: (e, {
157
157
  slots: t,
158
- emit: u
158
+ emit: c
159
159
  }) => {
160
- const o = g(e.visible);
161
- F(() => {
162
- o.value !== e.visible && (o.value = e.visible);
160
+ const a = S(e.visible);
161
+ K(() => {
162
+ a.value !== e.visible && (a.value = e.visible);
163
163
  }, () => e.visible);
164
164
  const l = () => {
165
- var d;
166
- if ((d = e.cancelButtonProps) != null && d.onClick) {
165
+ var u;
166
+ if ((u = e.cancelButtonProps) != null && u.onClick) {
167
167
  e.cancelButtonProps.onClick();
168
168
  return;
169
169
  }
170
- o.value = !1, u("update:visible", !1);
171
- }, n = () => {
172
- var d;
173
- if ((d = e.okButtonProps) != null && d.onClick) {
170
+ a.value = !1, c("update:visible", !1);
171
+ }, r = () => {
172
+ var u;
173
+ if ((u = e.okButtonProps) != null && u.onClick) {
174
174
  e.okButtonProps.onClick();
175
175
  return;
176
176
  }
177
- u("ok");
178
- }, r = S(J());
179
- return () => c(j, i({
177
+ c("ok");
178
+ }, n = T(ie());
179
+ return () => i(Q, d({
180
180
  class: e.clsName
181
- }, p(e, ...r, "modelValue"), {
182
- closeOnClickModal: _(e.maskClosable) ? e.maskClosable : e.closeOnClickModal,
183
- modelValue: o.value,
184
- "onUpdate:modelValue": [(d) => o.value = d, (d) => {
185
- u("update:visible", d);
181
+ }, f(e, ...n, "modelValue"), {
182
+ closeOnClickModal: Se(e.maskClosable) ? e.maskClosable : e.closeOnClickModal,
183
+ modelValue: a.value,
184
+ "onUpdate:modelValue": [(u) => a.value = u, (u) => {
185
+ c("update:visible", u);
186
186
  }],
187
187
  onClose: () => {
188
- u("cancel");
188
+ c("cancel");
189
189
  }
190
190
  }), {
191
- footer: e.footer === !1 ? void 0 : () => c("div", {
191
+ footer: e.footer === !1 ? void 0 : () => i("div", {
192
192
  class: `${e.clsName}-operate`
193
- }, [c(w, i(p(e.cancelButtonProps, "onClick"), {
193
+ }, [i(I, d(f(e.cancelButtonProps, "onClick"), {
194
194
  onClick: l
195
195
  }), {
196
196
  default: () => [e.cancelText]
197
- }), c(w, i({
197
+ }), i(I, d({
198
198
  type: "primary",
199
199
  loading: e.confirmLoading
200
- }, p(e.okButtonProps, "onClick"), {
201
- onClick: n
200
+ }, f(e.okButtonProps, "onClick"), {
201
+ onClick: r
202
202
  }), {
203
203
  default: () => [e.okText]
204
204
  })]),
205
205
  ...t
206
206
  });
207
207
  }
208
- }), qe = m({
208
+ }), ft = g({
209
209
  props: {
210
- ...N.props,
210
+ ...X.props,
211
211
  page: {
212
212
  type: Number,
213
213
  default: 1
@@ -215,41 +215,41 @@ const H = () => ({
215
215
  },
216
216
  setup: (e, {
217
217
  slots: t,
218
- emit: u
218
+ emit: c
219
219
  }) => {
220
- const o = g(e.page), l = g(e.pageSize);
221
- F(() => {
222
- o.value !== e.page && (o.value = e.page);
223
- }, () => e.page), F(() => {
220
+ const a = S(e.page), l = S(e.pageSize);
221
+ K(() => {
222
+ a.value !== e.page && (a.value = e.page);
223
+ }, () => e.page), K(() => {
224
224
  l.value !== e.pageSize && (l.value = e.pageSize);
225
225
  }, () => e.pageSize);
226
- const n = he(() => {
227
- u("composeChange", o.value, l.value);
228
- }, 300), r = () => {
229
- n(), u("update:page", o.value);
230
- }, d = () => {
231
- n(), u("update:pageSize", l.value);
226
+ const r = nt(() => {
227
+ c("composeChange", a.value, l.value);
228
+ }, 300), n = () => {
229
+ r(), c("update:page", a.value);
230
+ }, u = () => {
231
+ r(), c("update:pageSize", l.value);
232
232
  };
233
- return () => c(N, i({
234
- currentPage: o.value,
235
- "onUpdate:currentPage": (a) => o.value = a,
233
+ return () => i(X, d({
234
+ currentPage: a.value,
235
+ "onUpdate:currentPage": (o) => a.value = o,
236
236
  pageSize: l.value,
237
- "onUpdate:pageSize": (a) => l.value = a,
238
- onCurrentChange: r,
239
- onSizeChange: d
240
- }, p(e, "currentPage", "pageSize")), t);
237
+ "onUpdate:pageSize": (o) => l.value = o,
238
+ onCurrentChange: n,
239
+ onSizeChange: u
240
+ }, f(e, "currentPage", "pageSize")), t);
241
241
  }
242
- }), Ke = m({
242
+ }), mt = g({
243
243
  props: {
244
- ...O.props
244
+ ...Y.props
245
245
  },
246
246
  setup: (e, {
247
247
  slots: t
248
- }) => () => c(O, e, {
248
+ }) => () => i(Y, e, {
249
249
  reference: t.default,
250
250
  default: t.content
251
251
  })
252
- }), Q = () => ({
252
+ }), de = () => ({
253
253
  options: Array,
254
254
  buttonStyle: {
255
255
  type: String,
@@ -259,49 +259,49 @@ const H = () => ({
259
259
  type: String,
260
260
  default: "default"
261
261
  }
262
- }), Me = m({
262
+ }), yt = g({
263
263
  props: {
264
- ...U.props,
265
- ...Q()
264
+ ...ee.props,
265
+ ...de()
266
266
  },
267
267
  setup: (e, {
268
268
  slots: t,
269
- emit: u,
270
- expose: o
269
+ emit: c,
270
+ expose: a
271
271
  }) => {
272
- const l = g();
273
- o(T(l));
274
- const n = S(Q());
275
- return () => c(U, i({
272
+ const l = S();
273
+ a(V(l));
274
+ const r = T(de());
275
+ return () => i(ee, d({
276
276
  ref: l
277
- }, p(e, n), {
278
- "onUpdate:modelValue": (r) => {
279
- u("update:modelValue", r || void 0);
277
+ }, f(e, r), {
278
+ "onUpdate:modelValue": (n) => {
279
+ c("update:modelValue", n || void 0);
280
280
  }
281
281
  }), {
282
282
  default: () => {
283
- var r, d;
284
- return [(r = t.start) == null ? void 0 : r.call(t), P(e.options, (a) => {
285
- var f;
286
- const y = (f = t.label) == null ? void 0 : f.call(t, a);
287
- return e.optionType === "button" || e.buttonStyle === "button" ? c(le, i({
288
- key: a.value
289
- }, p(a, "value"), {
290
- label: a.value
283
+ var n, u;
284
+ return [(n = t.start) == null ? void 0 : n.call(t), h(e.options, (o) => {
285
+ var b;
286
+ const v = (b = t.label) == null ? void 0 : b.call(t, o);
287
+ return e.optionType === "button" || e.buttonStyle === "button" ? i(De, d({
288
+ key: o.value
289
+ }, f(o, "value"), {
290
+ label: o.value
291
291
  }), {
292
- default: () => [y || a.label]
293
- }) : c(ue, i({
294
- key: a.value
295
- }, a, {
296
- label: a.value
292
+ default: () => [v || o.label]
293
+ }) : i(Pe, d({
294
+ key: o.value
295
+ }, o, {
296
+ label: o.value
297
297
  }), {
298
- default: () => [y || a.label]
298
+ default: () => [v || o.label]
299
299
  });
300
- }), (d = t.default) == null ? void 0 : d.call(t)];
300
+ }), (u = t.default) == null ? void 0 : u.call(t)];
301
301
  }
302
302
  });
303
303
  }
304
- }), X = () => ({
304
+ }), fe = () => ({
305
305
  options: {
306
306
  type: Array
307
307
  },
@@ -313,157 +313,360 @@ const H = () => ({
313
313
  type: String,
314
314
  default: "default"
315
315
  }
316
- }), Ve = m({
316
+ }), vt = g({
317
317
  props: {
318
- ...D.props,
319
- ...X()
318
+ ...te.props,
319
+ ...fe()
320
320
  },
321
321
  setup: (e, {
322
322
  slots: t,
323
- emit: u,
324
- expose: o
323
+ emit: c,
324
+ expose: a
325
325
  }) => {
326
- const l = g();
327
- o(T(l));
328
- const n = S(X());
329
- return () => c(D, i({
326
+ const l = S();
327
+ a(V(l));
328
+ const r = T(fe());
329
+ return () => i(te, d({
330
330
  ref: l
331
- }, p(e, n), {
332
- "onUpdate:modelValue": (r) => {
333
- u("update:modelValue", r);
331
+ }, f(e, r), {
332
+ "onUpdate:modelValue": (n) => {
333
+ c("update:modelValue", n);
334
334
  }
335
335
  }), {
336
336
  default: () => {
337
- var r, d;
338
- return [(r = t.start) == null ? void 0 : r.call(t), P(e.options, (a) => {
339
- var f;
340
- const y = (f = t.label) == null ? void 0 : f.call(t, a);
341
- return e.optionType === "button" || e.buttonStyle === "button" ? c(de, i({
342
- key: a.value
343
- }, p(a, "value"), {
344
- label: a.value
337
+ var n, u;
338
+ return [(n = t.start) == null ? void 0 : n.call(t), h(e.options, (o) => {
339
+ var b;
340
+ const v = (b = t.label) == null ? void 0 : b.call(t, o);
341
+ return e.optionType === "button" || e.buttonStyle === "button" ? i(Le, d({
342
+ key: o.value
343
+ }, f(o, "value"), {
344
+ label: o.value
345
345
  }), {
346
- default: () => [y || a.label]
347
- }) : c(ce, i({
348
- key: a.value
349
- }, p(a, "value"), {
350
- label: a.value
346
+ default: () => [v || o.label]
347
+ }) : i(we, d({
348
+ key: o.value
349
+ }, f(o, "value"), {
350
+ label: o.value
351
351
  }), {
352
- default: () => [y || a.label]
352
+ default: () => [v || o.label]
353
353
  });
354
- }), (d = t.default) == null ? void 0 : d.call(t)];
354
+ }), (u = t.default) == null ? void 0 : u.call(t)];
355
355
  }
356
356
  });
357
357
  }
358
- }), Y = () => ({
358
+ }), me = () => ({
359
359
  options: Array
360
- }), Ae = m({
360
+ }), bt = g({
361
361
  props: {
362
- ...q.props,
363
- ...Y()
362
+ ...ae.props,
363
+ ...me()
364
364
  },
365
365
  setup: (e, {
366
366
  slots: t,
367
- emit: u,
368
- expose: o
367
+ emit: c,
368
+ expose: a
369
369
  }) => {
370
- const l = g();
371
- o(T(l));
372
- const n = S(Y());
373
- return () => c(q, i({
370
+ const l = S();
371
+ a(V(l));
372
+ const r = T(me());
373
+ return () => i(ae, d({
374
374
  ref: l
375
- }, p(e, n), {
376
- "onUpdate:modelValue": (r) => {
377
- u("update:modelValue", r || void 0);
375
+ }, f(e, r), {
376
+ "onUpdate:modelValue": (n) => {
377
+ c("update:modelValue", n || void 0);
378
378
  }
379
379
  }), {
380
380
  default: () => {
381
- var r, d;
382
- return [(r = t.start) == null ? void 0 : r.call(t), P(e.options, (a) => {
383
- var f;
384
- const y = (f = t.label) == null ? void 0 : f.call(t, a);
385
- return c(ie, i({
386
- key: a.value
387
- }, a), {
388
- default: () => [y || a.label]
381
+ var n, u;
382
+ return [(n = t.start) == null ? void 0 : n.call(t), h(e.options, (o) => {
383
+ var b;
384
+ const v = (b = t.label) == null ? void 0 : b.call(t, o);
385
+ return i(Ne, d({
386
+ key: o.value
387
+ }, o), {
388
+ default: () => [v || o.label]
389
389
  });
390
- }), (d = t.default) == null ? void 0 : d.call(t)];
390
+ }), (u = t.default) == null ? void 0 : u.call(t)];
391
391
  },
392
- ...p(t, "default")
392
+ ...f(t, "default")
393
393
  });
394
394
  }
395
- }), $e = m({
395
+ }), At = g({
396
396
  props: {
397
- ...K.props,
397
+ ...ne.props,
398
398
  options: {
399
399
  type: Array
400
400
  }
401
401
  },
402
402
  setup: (e, {
403
403
  slots: t,
404
- emit: u
405
- }) => () => c(K, i(p(e, "options"), {
406
- "onUpdate:modelValue": (o) => {
407
- u("update:modelValue", o);
404
+ emit: c
405
+ }) => () => i(ne, d(f(e, "options"), {
406
+ "onUpdate:modelValue": (a) => {
407
+ c("update:modelValue", a);
408
408
  }
409
409
  }), {
410
410
  default: () => {
411
- var o, l;
412
- return [(o = t.start) == null ? void 0 : o.call(t), P(e.options, (n) => c(pe, i({
413
- key: n.value
414
- }, p(n, "value"), {
415
- name: n.value
411
+ var a, l;
412
+ return [(a = t.start) == null ? void 0 : a.call(t), h(e.options, (r) => i(Oe, d({
413
+ key: r.value
414
+ }, f(r, "value"), {
415
+ name: r.value
416
416
  }), {
417
417
  label: () => {
418
- var r;
419
- return ((r = t.label) == null ? void 0 : r.call(t, n)) || n.label;
418
+ var n;
419
+ return ((n = t.label) == null ? void 0 : n.call(t, r)) || r.label;
420
420
  }
421
421
  })), (l = t.default) == null ? void 0 : l.call(t)];
422
422
  }
423
423
  })
424
- }), Ge = b({
425
- InputComp: fe,
424
+ });
425
+ function Pt(e) {
426
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !tt(e);
427
+ }
428
+ const q = {
429
+ convertSubMenuProps: {
430
+ type: Function
431
+ },
432
+ convertMenuItemProps: {
433
+ type: Function
434
+ },
435
+ onMenuItemClick: {
436
+ type: Function
437
+ }
438
+ }, Ee = T(q), se = g({
439
+ inheritAttrs: !1,
440
+ props: {
441
+ menu: {
442
+ type: Object
443
+ },
444
+ ...q
445
+ },
446
+ setup: (e, {
447
+ slots: t
448
+ }) => {
449
+ const c = () => {
450
+ var a;
451
+ (a = e.onMenuItemClick) == null || a.call(e, e.menu);
452
+ };
453
+ return () => {
454
+ var l, r;
455
+ const a = e.menu;
456
+ return (a == null ? void 0 : a.children) && B(a.children) > 0 ? i(M.SubMenu, d({
457
+ index: a == null ? void 0 : a.value
458
+ }, (l = e.convertSubMenuProps) == null ? void 0 : l.call(e, a)), {
459
+ default: () => [h(a.children, (n) => i(se, d({
460
+ menu: n
461
+ }, j(e, Ee)), t))],
462
+ title: () => {
463
+ var n;
464
+ return ((n = t.title) == null ? void 0 : n.call(t, a)) || (a == null ? void 0 : a.label);
465
+ }
466
+ }) : i(M.MenuItem, d({
467
+ index: a == null ? void 0 : a.value
468
+ }, (r = e.convertMenuItemProps) == null ? void 0 : r.call(e, a), {
469
+ onClick: c
470
+ }), {
471
+ title: () => {
472
+ var n;
473
+ return ((n = t.title) == null ? void 0 : n.call(t, a)) || (a == null ? void 0 : a.label);
474
+ }
475
+ });
476
+ };
477
+ }
478
+ }), ye = () => ({
479
+ activeKey: {
480
+ type: String
481
+ },
482
+ options: {
483
+ type: Array
484
+ },
485
+ fieldNames: {
486
+ type: Object,
487
+ default: {
488
+ children: "children",
489
+ value: "value",
490
+ label: "label"
491
+ }
492
+ },
493
+ ...q
494
+ }), gt = g({
495
+ props: {
496
+ ...f(M.props, "defaultActive"),
497
+ ...ye()
498
+ },
499
+ setup: (e, {
500
+ slots: t
501
+ }) => {
502
+ const c = S(e.activeKey);
503
+ K(() => {
504
+ e.activeKey !== c.value && (c.value = e.activeKey);
505
+ }, () => e.activeKey);
506
+ const a = pe(() => {
507
+ var r;
508
+ return lt(e.options, (n) => {
509
+ var v, b;
510
+ const u = ((v = e.fieldNames) == null ? void 0 : v.value) || "value", o = ((b = e.fieldNames) == null ? void 0 : b.label) || "label";
511
+ return {
512
+ ...f(n, u, o),
513
+ value: O(n, u),
514
+ label: O(n, o)
515
+ };
516
+ }, {
517
+ children: ((r = e.fieldNames) == null ? void 0 : r.children) || "children",
518
+ childrenName: "children"
519
+ });
520
+ }), l = T(ye());
521
+ return () => {
522
+ let r;
523
+ return i(M, d({
524
+ defaultActive: c.value
525
+ }, f(e, l)), Pt(r = h(a.value, (n) => i(se, d({
526
+ menu: n
527
+ }, j(e, Ee)), t))) ? r : {
528
+ default: () => [r]
529
+ });
530
+ };
531
+ }
532
+ }), ve = () => ({
533
+ modelValue: {
534
+ type: Array,
535
+ default: void 0
536
+ },
537
+ maxSize: {
538
+ type: Number
539
+ },
540
+ convertResponseData: {
541
+ type: Function
542
+ },
543
+ convertItemData: {
544
+ type: Function,
545
+ default: (e) => ({
546
+ ...e,
547
+ status: e.status || "success"
548
+ })
549
+ },
550
+ onErrorMsg: Function,
551
+ onStart: Function,
552
+ beforeUpload: {
553
+ type: Function
554
+ }
555
+ }), pt = ["abort", "submit", "clearFiles", "handleStart", "handleRemove"], Ie = g({
556
+ props: {
557
+ ...f(re.props, "fileList"),
558
+ ...ve()
559
+ },
560
+ setup: (e, {
561
+ slots: t,
562
+ expose: c,
563
+ emit: a
564
+ }) => {
565
+ const l = S();
566
+ c(V(l, pt));
567
+ const {
568
+ formItem: r
569
+ } = je(), n = () => rt(e.modelValue) ? h(e.modelValue, (P) => {
570
+ var p;
571
+ return ((p = e.convertItemData) == null ? void 0 : p.call(e, P)) || P;
572
+ }) : [], u = S(n());
573
+ let o = !1;
574
+ const v = () => {
575
+ var p;
576
+ o = !0;
577
+ const P = ue(u.value, (y) => y.status === "success");
578
+ a("update:modelValue", h(P, (y) => {
579
+ var F;
580
+ return ((F = e.convertResponseData) == null ? void 0 : F.call(e, y)) || y;
581
+ })), (p = r == null ? void 0 : r.validate) == null || p.call(r, "change");
582
+ };
583
+ K(() => {
584
+ o || (u.value = n(), o = !1);
585
+ }, () => e.modelValue);
586
+ const b = (P) => {
587
+ var p, y, F, x;
588
+ if (e.beforeUpload)
589
+ return e.beforeUpload(P);
590
+ if (e.accept && !ut(e.accept, P.name))
591
+ return (p = e.onErrorMsg) == null || p.call(e, "FileTypeError", `\u8BF7\u4E0A\u4F20\u6B63\u786E\u683C\u5F0F\uFF08${e.accept.replace(/,/g, "\uFF0C")}\uFF09\u7684\u6587\u4EF6`), !1;
592
+ if (U(P.size)) {
593
+ if (P.size <= 0)
594
+ return (y = e.onErrorMsg) == null || y.call(e, "FileSizeError-Zero", "\u4E0A\u4F20\u6587\u4EF6\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"), !1;
595
+ if (U(e.maxSize) && P.size > e.maxSize)
596
+ return (F = e.onErrorMsg) == null || F.call(e, "FileSizeError-MaxSize", `\u8BF7\u4E0A\u4F20\u5C0F\u4E8E${ct(e.maxSize)}\u7684\u6587\u4EF6`), !1;
597
+ }
598
+ return (x = e.onStart) == null || x.call(e, P), !0;
599
+ }, k = pe(() => U(e.limit) ? e.limit > B(u.value) : !0), R = T(ve());
600
+ return () => {
601
+ var P, p;
602
+ return i("div", {
603
+ class: `pro-uploader ${k.value ? "" : "pro-uploader-limit"}`
604
+ }, [(P = t.start) == null ? void 0 : P.call(t), i(re, d({
605
+ ref: l,
606
+ fileList: u.value,
607
+ "onUpdate:fileList": (y) => u.value = y
608
+ }, f(e, "fileList", "onSuccess", "onRemove", "beforeUpload", ...R), {
609
+ beforeUpload: b,
610
+ onSuccess: (y, F, x) => {
611
+ var E;
612
+ (E = e.onSuccess) == null || E.call(e, y, F, x), v();
613
+ },
614
+ onRemove: (y, F) => {
615
+ var x;
616
+ u.value = ue(u.value, (E) => !(y.uid === E.uid && y.name === E.name)), (x = e.onRemove) == null || x.call(e, y, F), v();
617
+ }
618
+ }), {
619
+ default: () => {
620
+ var y;
621
+ return [k.value && ((y = t.default) == null ? void 0 : y.call(t))];
622
+ },
623
+ ...f(t, "default")
624
+ }), (p = t.end) == null ? void 0 : p.call(t)]);
625
+ };
626
+ }
627
+ }), St = C({
628
+ InputComp: qe,
426
629
  valueType: "text",
427
630
  name: "PFromText"
428
- }), We = b({
429
- InputComp: me,
631
+ }), ht = C({
632
+ InputComp: $e,
430
633
  valueType: "digit",
431
634
  name: "PFormNumber"
432
- }), He = b({
433
- InputComp: ye,
635
+ }), Ct = C({
636
+ InputComp: Ge,
434
637
  valueType: "date",
435
638
  name: "PFormDate"
436
- }), Je = b({
437
- InputComp: be,
639
+ }), kt = C({
640
+ InputComp: _e,
438
641
  valueType: "time",
439
642
  name: "PFormTime"
440
- }), Qe = b({
441
- InputComp: Ae,
643
+ }), Ft = C({
644
+ InputComp: bt,
442
645
  valueType: "select",
443
646
  name: "PFormSelect"
444
- }), Xe = b({
445
- InputComp: ge,
647
+ }), Tt = C({
648
+ InputComp: We,
446
649
  valueType: "treeSelect",
447
650
  name: "PFormTreeSelect"
448
- }), Ye = b({
449
- InputComp: Me,
651
+ }), xt = C({
652
+ InputComp: yt,
450
653
  valueType: "checkbox",
451
654
  name: "PFromCheckbox"
452
- }), Ze = b({
453
- InputComp: Ve,
655
+ }), Et = C({
656
+ InputComp: vt,
454
657
  valueType: "radio",
455
658
  name: "PFromRadio"
456
- }), _e = b({
457
- InputComp: ve,
659
+ }), st = C({
660
+ InputComp: Ze,
458
661
  valueType: "switch",
459
662
  name: "PFromSwitch"
460
- }), et = b({
461
- InputComp: Pe,
663
+ }), It = C({
664
+ InputComp: He,
462
665
  valueType: "cascader",
463
666
  name: "PFormCascader"
464
- }), ne = m({
667
+ }), Ke = g({
465
668
  props: {
466
- ...p($.props, "label", "prop"),
669
+ ...f(oe.props, "label", "prop"),
467
670
  title: {
468
671
  type: String
469
672
  },
@@ -480,55 +683,55 @@ const H = () => ({
480
683
  setup: (e, {
481
684
  slots: t
482
685
  }) => {
483
- const u = ({
484
- row: n,
485
- column: r,
486
- $index: d
686
+ const c = ({
687
+ row: r,
688
+ column: n,
689
+ $index: u
487
690
  }) => {
488
- var I;
489
- const a = n, y = d, f = {
490
- ...r,
491
- title: r.label,
492
- dataIndex: r.property
493
- }, v = Te(n, f.dataIndex), x = {
494
- value: v,
495
- text: v,
496
- record: a,
497
- column: f,
498
- index: y
499
- }, E = (I = t.bodyCell) == null ? void 0 : I.call(t, x);
500
- return E || (e.customRender ? e.customRender(x) : v);
691
+ var p;
692
+ const o = r, v = u, b = {
693
+ ...n,
694
+ title: n.label,
695
+ dataIndex: n.property
696
+ }, k = O(r, b.dataIndex), R = {
697
+ value: k,
698
+ text: k,
699
+ record: o,
700
+ column: b,
701
+ index: v
702
+ }, P = (p = t.bodyCell) == null ? void 0 : p.call(t, R);
703
+ return P || (e.customRender ? e.customRender(R) : k);
501
704
  }, l = {
502
705
  header: ({
503
- column: n,
504
- $index: r
706
+ column: r,
707
+ $index: n
505
708
  }) => {
506
- var v;
507
- const d = r, a = n.label, y = {
508
- ...n,
509
- title: a,
510
- dataIndex: n.property
709
+ var k;
710
+ const u = n, o = r.label, v = {
711
+ ...r,
712
+ title: o,
713
+ dataIndex: r.property
511
714
  };
512
- return ((v = t.headerCell) == null ? void 0 : v.call(t, {
513
- title: a,
514
- column: y,
515
- index: d
516
- })) || a;
715
+ return ((k = t.headerCell) == null ? void 0 : k.call(t, {
716
+ title: o,
717
+ column: v,
718
+ index: u
719
+ })) || o;
517
720
  }
518
721
  };
519
- return (!e.children || W(e.children) <= 0) && (l.default = u), () => c($, i(p(e, "title", "dataIndex", "prop", "customRender", "children"), {
722
+ return (!e.children || B(e.children) <= 0) && (l.default = c), () => i(oe, d(f(e, "title", "dataIndex", "prop", "customRender", "children"), {
520
723
  prop: e.dataIndex,
521
724
  label: e.title
522
725
  }), {
523
- default: () => [W(e.children) > 0 && P(e.children, (n) => c(ne, i({
524
- key: n.dataIndex
525
- }, n), t))],
726
+ default: () => [B(e.children) > 0 && h(e.children, (r) => i(Ke, d({
727
+ key: r.dataIndex
728
+ }, r), t))],
526
729
  ...l
527
730
  });
528
731
  }
529
- }), ze = ["clearSelection", "getSelectionRows", "toggleRowSelection", "toggleAllSelection", "toggleRowExpansion", "setCurrentRow", "clearSort", "clearFilter", "doLayout", "sort", "scrollTo", "setScrollTop", "setScrollLeft"], Le = m({
732
+ }), Kt = ["clearSelection", "getSelectionRows", "toggleRowSelection", "toggleAllSelection", "toggleRowExpansion", "setCurrentRow", "clearSort", "clearFilter", "doLayout", "sort", "scrollTo", "setScrollTop", "setScrollLeft"], Re = g({
530
733
  props: {
531
- ...G.props,
734
+ ...le.props,
532
735
  columns: {
533
736
  type: Array
534
737
  },
@@ -541,114 +744,156 @@ const H = () => ({
541
744
  },
542
745
  setup: (e, {
543
746
  slots: t,
544
- expose: u
747
+ expose: c
545
748
  }) => {
546
- const o = g(), l = ae("table");
547
- return u(Z(ze, o)), () => c(G, i({
548
- ref: o,
749
+ const a = S(), l = Fe("table");
750
+ return c(be(Kt, a)), () => i(le, d({
751
+ ref: a,
549
752
  id: l
550
- }, p(e, "columns", "dataSource", "loading"), {
753
+ }, f(e, "columns", "dataSource", "loading"), {
551
754
  data: e.dataSource || e.data
552
755
  }), {
553
756
  default: () => {
554
- var n, r;
555
- return [(n = t.start) == null ? void 0 : n.call(t), P(e.columns, (d) => c(ne, i({
556
- key: d.dataIndex
557
- }, d), t)), (r = t.default) == null ? void 0 : r.call(t), e.loading && c(Re, {
757
+ var r, n;
758
+ return [(r = t.start) == null ? void 0 : r.call(t), h(e.columns, (u) => i(Ke, d({
759
+ key: u.dataIndex
760
+ }, u), t)), (n = t.default) == null ? void 0 : n.call(t), e.loading && i(Te, {
558
761
  target: l,
559
762
  loading: !0
560
763
  }, null)];
561
764
  },
562
- ...Fe(t, "append", "empty")
765
+ ...j(t, "append", "empty")
563
766
  });
564
767
  }
768
+ }), Rt = g({
769
+ props: {
770
+ ...I.props,
771
+ type: {
772
+ type: String,
773
+ default: "primary"
774
+ },
775
+ link: {
776
+ type: Boolean,
777
+ default: !0
778
+ }
779
+ },
780
+ setup: (e, {
781
+ slots: t
782
+ }) => () => i(I, e, t)
565
783
  });
566
- C.props = {
567
- ...h.props,
568
- ...C.props,
569
- formMethods: { type: Array, default: te }
784
+ s.props = {
785
+ ...N.props,
786
+ ...s.props,
787
+ formMethods: { type: Array, default: ke }
570
788
  };
571
- R.props = {
572
- ...C.props,
573
- ...R.props,
789
+ A.props = {
790
+ ...s.props,
791
+ ...A.props,
574
792
  inline: { type: Boolean, default: !0 }
575
793
  };
576
- B.props = {
577
- ...s.props,
578
- ...B.props
794
+ $.props = {
795
+ ...w.props,
796
+ ...$.props
579
797
  };
580
- M.props = {
581
- ...Le.props,
582
- ...M.props
798
+ D.props = {
799
+ ...Re.props,
800
+ ...D.props
583
801
  };
584
- k.props = {
585
- ...Se.props,
586
- ...k.props
802
+ L.props = {
803
+ ...ge.props,
804
+ ...L.props
587
805
  };
588
- V.props = {
589
- ...k.props,
590
- ...V.props
806
+ G.props = {
807
+ ...L.props,
808
+ ...G.props
591
809
  };
592
- A.props = {
593
- ...C.props,
594
- ...A.props
810
+ _.props = {
811
+ ...s.props,
812
+ ..._.props
595
813
  };
596
- z.props = {
597
- ...Be.props,
598
- ...z.props
814
+ W.props = {
815
+ ...xe.props,
816
+ ...W.props
599
817
  };
600
- L.props = {
601
- ...L.props,
602
- convertMenuParams: {
603
- type: Function,
604
- default: ({ mode: e, activeKey: t, openKeys: u }) => ({ mode: e, defaultActive: t })
605
- },
606
- convertSubMenuParams: {
607
- type: Function,
608
- default: (e) => ({ index: e.value })
609
- },
610
- convertMenuItemParams: {
611
- type: Function,
612
- default: (e) => ({ index: e.value })
613
- },
614
- subMenuSlots: {
615
- type: Object,
616
- default: {
617
- title: (e) => e.label
618
- }
619
- },
620
- menuItemSlots: {
621
- type: Object,
622
- default: {
623
- title: (e) => e.label
624
- }
625
- }
818
+ Z.props = {
819
+ ...Ie.props,
820
+ ...Z.props,
821
+ modelValue: String
822
+ };
823
+ const Dt = {
824
+ [m.LoadingKey]: Te,
825
+ [m.RowKey]: Je,
826
+ [m.ColKey]: Qe,
827
+ [m.ButtonKey]: I,
828
+ [m.DescriptionsKey]: ge,
829
+ [m.DescriptionsItemKey]: Xe,
830
+ [m.MenusKey]: gt,
831
+ [m.ModalKey]: xe,
832
+ [m.PaginationKey]: ft,
833
+ [m.PopoverKey]: mt,
834
+ [m.CheckboxKey]: Pe,
835
+ [m.FormKey]: it,
836
+ [m.FormItemKey]: Ce,
837
+ [m.TableKey]: Re,
838
+ [m.TableOperateKey]: Rt,
839
+ [m.UploaderKey]: Ie,
840
+ [m.ProFormKey]: s,
841
+ [m.ProSearchFormKey]: A,
842
+ [m.ProTableKey]: D,
843
+ [m.ProCurdKey]: Be,
844
+ [m.ProListKey]: Ve,
845
+ text: H,
846
+ digit: ze,
847
+ date: Ue,
848
+ time: H,
849
+ select: z,
850
+ radio: z,
851
+ checkbox: z,
852
+ treeSelect: J,
853
+ cascader: J
854
+ }, Lt = {
855
+ text: St,
856
+ digit: ht,
857
+ date: Ct,
858
+ time: kt,
859
+ select: Ft,
860
+ treeSelect: Tt,
861
+ checkbox: xt,
862
+ radio: Et,
863
+ switch: st,
864
+ cascader: It
626
865
  };
627
866
  export {
628
- te as FormMethods,
629
- Me as ProCheckbox,
630
- De as ProForm,
631
- et as ProFormCascader,
632
- Ye as ProFormCheckbox,
633
- He as ProFormDatePicker,
634
- Ee as ProFormItem,
635
- Ze as ProFormRadio,
636
- Qe as ProFormSelect,
637
- _e as ProFormSwitch,
638
- Ge as ProFormText,
639
- We as ProFormTextNumber,
640
- Je as ProFormTimePicker,
641
- Xe as ProFormTreeSelect,
642
- Re as ProLoading,
643
- Be as ProModal,
644
- qe as ProPagination,
645
- Ke as ProPopover,
646
- Ve as ProRadio,
647
- Ae as ProSelect,
648
- Le as ProTable,
649
- ne as ProTableColumn,
650
- $e as ProTabs,
651
- ze as TableMethods,
652
- b as createFormItemComponent,
653
- ae as createLoadingId
867
+ ke as FormMethods,
868
+ yt as ProCheckbox,
869
+ it as ProForm,
870
+ It as ProFormCascader,
871
+ xt as ProFormCheckbox,
872
+ Ct as ProFormDatePicker,
873
+ Ce as ProFormItem,
874
+ Et as ProFormRadio,
875
+ Ft as ProFormSelect,
876
+ st as ProFormSwitch,
877
+ St as ProFormText,
878
+ ht as ProFormTextNumber,
879
+ kt as ProFormTimePicker,
880
+ Tt as ProFormTreeSelect,
881
+ Te as ProLoading,
882
+ gt as ProMenus,
883
+ xe as ProModal,
884
+ ft as ProPagination,
885
+ mt as ProPopover,
886
+ vt as ProRadio,
887
+ bt as ProSelect,
888
+ Re as ProTable,
889
+ Ke as ProTableColumn,
890
+ Rt as ProTableOperateItem,
891
+ At as ProTabs,
892
+ Ie as ProUploader,
893
+ Kt as TableMethods,
894
+ pt as UploadMethods,
895
+ C as createFormItemComponent,
896
+ Fe as createLoadingId,
897
+ Dt as elementMap,
898
+ Lt as formElementMap
654
899
  };