@pungfe/element 0.0.1-alpha.9 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +151 -1
  3. package/dist/advance-C3UkhTla.js +1894 -0
  4. package/dist/advance-DIZmFb3t.cjs +1 -0
  5. package/dist/advance.cjs +1 -0
  6. package/dist/advance.d.ts +23 -0
  7. package/dist/advance.js +2 -0
  8. package/dist/basic-BfqwJFE_.cjs +1 -0
  9. package/dist/basic-CZ74BN1R.js +1006 -0
  10. package/dist/basic.cjs +1 -0
  11. package/dist/basic.d.ts +33 -0
  12. package/dist/basic.js +2 -0
  13. package/dist/components/advance/XButtonAsync.vue.d.ts +21 -0
  14. package/dist/{basic/XReconfirm.vue.d.ts → components/advance/XButtonConfirm.vue.d.ts} +6 -5
  15. package/dist/components/advance/XCascaderRequest.vue.d.ts +55 -0
  16. package/dist/components/advance/XFormFlex.vue.d.ts +19 -0
  17. package/dist/components/advance/XFormRequestNext.vue.d.ts +53 -0
  18. package/dist/components/advance/XRequest.vue.d.ts +74 -0
  19. package/dist/components/advance/XSelectRequest.vue.d.ts +53 -0
  20. package/dist/components/advance/XTableFlex.vue.d.ts +53 -0
  21. package/dist/components/advance/XTableRequestConfigNext.vue.d.ts +68 -0
  22. package/dist/components/advance/XTableRequestNext.vue.d.ts +89 -0
  23. package/dist/components/advance/XUploadOssNext.vue.d.ts +29 -0
  24. package/dist/{basic/XButton.vue.d.ts → components/basic/Button.vue.d.ts} +15 -4
  25. package/dist/{basic/XSelect.vue.d.ts → components/basic/Cascader.vue.d.ts} +16 -12
  26. package/dist/components/basic/Checkbox.vue.d.ts +22 -0
  27. package/dist/components/basic/ConfigProvider.vue.d.ts +21 -0
  28. package/dist/components/basic/DatePicker.vue.d.ts +34 -0
  29. package/dist/{basic/XDialog.vue.d.ts → components/basic/Dialog.vue.d.ts} +17 -9
  30. package/dist/{basic/XForm.vue.d.ts → components/basic/Form.vue.d.ts} +3 -27
  31. package/dist/components/basic/FormItem.vue.d.ts +34 -0
  32. package/dist/components/basic/Input.vue.d.ts +44 -0
  33. package/dist/components/basic/InputNumber.vue.d.ts +48 -0
  34. package/dist/components/basic/Pagination.vue.d.ts +41 -0
  35. package/dist/components/basic/Select.vue.d.ts +51 -0
  36. package/dist/components/basic/TabPane.vue.d.ts +32 -0
  37. package/dist/components/basic/Table.vue.d.ts +105 -0
  38. package/dist/{basic/XTabs.vue.d.ts → components/basic/Tabs.vue.d.ts} +9 -11
  39. package/dist/components/basic/Upload.vue.d.ts +47 -0
  40. package/dist/constants/index.d.ts +15 -9
  41. package/dist/index.cjs +1 -0
  42. package/dist/index.d.ts +4 -42
  43. package/dist/index.js +25 -1192
  44. package/dist/install.d.ts +12 -0
  45. package/dist/locales/en.d.ts +2 -0
  46. package/dist/locales/zh-cn.d.ts +2 -0
  47. package/dist/locales-CPrLlnob.js +389 -0
  48. package/dist/locales-fS7f5AIx.cjs +1 -0
  49. package/dist/locales.cjs +1 -0
  50. package/dist/locales.d.ts +2 -0
  51. package/dist/locales.js +2 -0
  52. package/dist/resolver.cjs +1 -0
  53. package/dist/resolver.d.ts +3 -1
  54. package/dist/resolver.js +56 -34
  55. package/dist/style.css +3 -0
  56. package/dist/types.d.ts +30 -0
  57. package/package.json +119 -80
  58. package/dist/basic/XCascader.vue.d.ts +0 -26
  59. package/dist/basic/XCheckbox.vue.d.ts +0 -28
  60. package/dist/basic/XColorPicker.vue.d.ts +0 -21
  61. package/dist/basic/XDivider.vue.d.ts +0 -20
  62. package/dist/basic/XImage.vue.d.ts +0 -5
  63. package/dist/basic/XInput.vue.d.ts +0 -29
  64. package/dist/basic/XInputNumber.vue.d.ts +0 -31
  65. package/dist/basic/XPagination.vue.d.ts +0 -21
  66. package/dist/basic/XRate.vue.d.ts +0 -20
  67. package/dist/basic/XScrollbar.vue.d.ts +0 -415
  68. package/dist/basic/XSpace.vue.d.ts +0 -20
  69. package/dist/basic/XTable.vue.d.ts +0 -55
  70. package/dist/basic/XTag.vue.d.ts +0 -28
  71. package/dist/basic/XText.vue.d.ts +0 -23
  72. package/dist/basic/XUpload.vue.d.ts +0 -41
package/dist/index.js CHANGED
@@ -1,1192 +1,25 @@
1
- import { defineComponent as b, openBlock as m, createBlock as y, unref as h, mergeProps as V, withCtx as v, renderSlot as E, useModel as T, inject as p, mergeModels as B, computed as C, toValue as L, onMounted as K, nextTick as de, getCurrentScope as re, onScopeDispose as ue, getCurrentInstance as G, shallowRef as N, watch as W, createElementBlock as j, Fragment as Y, renderList as J, useSlots as se, createSlots as ce, normalizeProps as O, guardReactiveProps as M, ref as F, provide as $, createVNode as z, resolveComponent as U, createTextVNode as q, useTemplateRef as Z, toDisplayString as fe, normalizeClass as me } from "vue";
2
- import { ElButton as pe, ElCascader as be, ElCheckboxGroup as ye, ElCheckbox as ve, ElColorPicker as ge, ElDialog as he, ElDivider as Be, ElForm as we, ElFormItem as Ve, ElMessage as ee, ElImage as Ce, ElInput as Ee, ElPagination as Te, ElRate as xe, ElPopconfirm as Xe, ElScrollbar as Se, ElSpace as ze, ElTable as ke, ElTableColumn as Ie, ElTabs as Ae, ElTabPane as $e, ElTag as Oe, ElText as Me, ElUpload as Pe } from "element-plus";
3
- const Ke = /* @__PURE__ */ b({
4
- __name: "XButton",
5
- props: {
6
- size: {},
7
- disabled: { type: Boolean, default: void 0 },
8
- type: {},
9
- icon: {},
10
- nativeType: {},
11
- loading: { type: Boolean },
12
- loadingIcon: {},
13
- plain: { type: Boolean },
14
- text: { type: Boolean },
15
- link: { type: Boolean },
16
- bg: { type: Boolean },
17
- autofocus: { type: Boolean },
18
- round: { type: Boolean },
19
- circle: { type: Boolean },
20
- color: {},
21
- dark: { type: Boolean },
22
- autoInsertSpace: { type: Boolean },
23
- tag: {}
24
- },
25
- emits: ["click"],
26
- setup(e, { emit: t }) {
27
- const l = e, n = t;
28
- return (o, i) => (m(), y(h(pe), V(l, {
29
- onClick: i[0] || (i[0] = (d) => n("click", d))
30
- }), {
31
- default: v(() => [
32
- E(o.$slots, "default")
33
- ]),
34
- _: 3
35
- }, 16));
36
- }
37
- }), P = /* @__PURE__ */ Symbol("X_FORM_ITEM_LABEL"), te = /* @__PURE__ */ Symbol("X_FORM_VALIDATIONS"), k = /* @__PURE__ */ Symbol(
38
- "X_FORM_ITEM_VALIDATION"
39
- ), Re = /* @__PURE__ */ Symbol(
40
- "X_FORM_TAB_UPDATE_HOOK"
41
- ), ae = /* @__PURE__ */ Symbol("X_TAB_PANES"), le = /* @__PURE__ */ Symbol("X_TAB_PANE"), D = /* @__PURE__ */ Symbol(
42
- "X_TABLE_QUERY_UPDATE_HOOK"
43
- ), H = /* @__PURE__ */ Symbol(
44
- "X_TABLE_QUERY_EXECUTE_HOOK"
45
- ), Ge = /* @__PURE__ */ b({
46
- __name: "XCascader",
47
- props: /* @__PURE__ */ B({
48
- clearable: {
49
- type: Boolean
50
- },
51
- placeholder: {
52
- default: "请选择"
53
- },
54
- disabled: {
55
- type: Boolean,
56
- default: void 0
57
- },
58
- props: {}
59
- }, {
60
- modelValue: {},
61
- modelModifiers: {}
62
- }),
63
- emits: /* @__PURE__ */ B(["blur", "change"], ["update:modelValue"]),
64
- setup(e, {
65
- emit: t
66
- }) {
67
- const l = e, n = t, o = T(e, "modelValue"), i = p(k, void 0);
68
- if (i?.required) {
69
- const {
70
- validator: c,
71
- label: r
72
- } = i;
73
- i.validator = () => o.value ? c?.() : `请输入${r}`;
74
- }
75
- const d = p(P, void 0), a = p(D, void 0), u = p(H, void 0);
76
- a?.on(([c, r]) => d === c && r === void 0 && (o.value = void 0)), u?.on(() => d && a?.trigger([d, o.value]));
77
- const s = () => {
78
- i?.validate(), n("blur");
79
- };
80
- return (c, r) => (m(), y(h(be), V(l, {
81
- modelValue: o.value,
82
- "onUpdate:modelValue": r[0] || (r[0] = (w) => o.value = w),
83
- onBlur: s
84
- }), null, 16, ["modelValue"]));
85
- }
86
- });
87
- function Le(e, t) {
88
- return re() ? (ue(e, t), !0) : !1;
89
- }
90
- const Ue = typeof window < "u" && typeof document < "u";
91
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
92
- function Fe(e) {
93
- return Array.isArray(e) ? e : [e];
94
- }
95
- function De(e) {
96
- return G();
97
- }
98
- function He(e, t = !0, l) {
99
- De() ? K(e, l) : t ? e() : de(e);
100
- }
101
- // @__NO_SIDE_EFFECTS__
102
- function Q(e, t) {
103
- return C(() => L(e).map((l) => L(l)).map(t));
104
- }
105
- const oe = Ue ? window : void 0;
106
- function I(e) {
107
- var t;
108
- const l = L(e);
109
- return (t = l?.$el) !== null && t !== void 0 ? t : l;
110
- }
111
- // @__NO_SIDE_EFFECTS__
112
- function _e() {
113
- const e = N(!1), t = G();
114
- return t && K(() => {
115
- e.value = !0;
116
- }, t), e;
117
- }
118
- // @__NO_SIDE_EFFECTS__
119
- function Ne(e) {
120
- const t = /* @__PURE__ */ _e();
121
- return C(() => (t.value, !!e()));
122
- }
123
- function qe(e, t, l = {}) {
124
- const { window: n = oe, ...o } = l;
125
- let i;
126
- const d = /* @__PURE__ */ Ne(() => n && "ResizeObserver" in n), a = () => {
127
- i && (i.disconnect(), i = void 0);
128
- }, u = W(C(() => {
129
- const c = L(e);
130
- return Array.isArray(c) ? c.map((r) => I(r)) : [I(c)];
131
- }), (c) => {
132
- if (a(), d.value && n) {
133
- i = new ResizeObserver(t);
134
- for (const r of c) r && i.observe(r, o);
135
- }
136
- }, {
137
- immediate: !0,
138
- flush: "post"
139
- }), s = () => {
140
- a(), u();
141
- };
142
- return Le(s), {
143
- isSupported: d,
144
- stop: s
145
- };
146
- }
147
- function Qe(e, t = {
148
- width: 0,
149
- height: 0
150
- }, l = {}) {
151
- const { window: n = oe, box: o = "content-box" } = l, i = C(() => {
152
- var r;
153
- return (r = I(e)) === null || r === void 0 || (r = r.namespaceURI) === null || r === void 0 ? void 0 : r.includes("svg");
154
- }), d = N(t.width), a = N(t.height), { stop: u } = qe(e, ([r]) => {
155
- const w = o === "border-box" ? r.borderBoxSize : o === "content-box" ? r.contentBoxSize : r.devicePixelContentBoxSize;
156
- if (n && i.value) {
157
- const x = I(e);
158
- if (x) {
159
- const X = x.getBoundingClientRect();
160
- d.value = X.width, a.value = X.height;
161
- }
162
- } else if (w) {
163
- const x = Fe(w);
164
- d.value = x.reduce((X, { inlineSize: A }) => X + A, 0), a.value = x.reduce((X, { blockSize: A }) => X + A, 0);
165
- } else
166
- d.value = r.contentRect.width, a.value = r.contentRect.height;
167
- }, l);
168
- He(() => {
169
- const r = I(e);
170
- r && (d.value = "offsetWidth" in r ? r.offsetWidth : t.width, a.value = "offsetHeight" in r ? r.offsetHeight : t.height);
171
- });
172
- const s = W(() => I(e), (r) => {
173
- d.value = r ? t.width : 0, a.value = r ? t.height : 0;
174
- });
175
- function c() {
176
- u(), s();
177
- }
178
- return {
179
- width: d,
180
- height: a,
181
- stop: c
182
- };
183
- }
184
- const Ye = /* @__PURE__ */ b({
185
- __name: "XCheckbox",
186
- props: /* @__PURE__ */ B({
187
- data: {},
188
- factory: {
189
- type: Function
190
- },
191
- identify: {
192
- type: Function
193
- },
194
- ariaControls: {},
195
- label: {},
196
- value: {},
197
- indeterminate: {
198
- type: Boolean
199
- },
200
- disabled: {
201
- type: Boolean
202
- },
203
- checked: {
204
- type: Boolean
205
- },
206
- name: {},
207
- trueValue: {},
208
- falseValue: {},
209
- trueLabel: {},
210
- falseLabel: {},
211
- id: {},
212
- border: {
213
- type: Boolean
214
- },
215
- size: {},
216
- tabindex: {},
217
- validateEvent: {
218
- type: Boolean
219
- },
220
- ariaLabel: {}
221
- }, {
222
- modelValue: {},
223
- modelModifiers: {}
224
- }),
225
- emits: ["update:modelValue"],
226
- setup(e) {
227
- const t = T(e, "modelValue"), l = /* @__PURE__ */ Q(() => e.data, e.factory), n = C(() => [...l.value]), o = (s) => {
228
- if (typeof s == "object") {
229
- if (e.identify)
230
- return e.identify(s);
231
- throw new Error("`identify` is required when value's type extends `object` or `object[]`");
232
- } else
233
- return s;
234
- }, i = (s) => n.value.map((c) => c.value).find((c) => o(c) === s), d = C(() => n.value.map((s) => {
235
- const c = o(s.value);
236
- return {
237
- ...s,
238
- key: c,
239
- value: c
240
- };
241
- })), a = C({
242
- get: () => t.value && t.value.map(o),
243
- set: (s) => t.value = Array.isArray(s) ? s.map((c) => i(c)) : []
244
- }), u = p(k, void 0);
245
- if (u?.required) {
246
- const {
247
- validator: s,
248
- label: c
249
- } = u;
250
- u.validator = () => !t.value || Array.isArray(t.value) && t.value.length === 0 ? `请选择${c}` : s?.();
251
- }
252
- return (s, c) => (m(), y(h(ye), V({
253
- modelValue: a.value,
254
- "onUpdate:modelValue": c[0] || (c[0] = (r) => a.value = r)
255
- }, {
256
- disabled: e.disabled,
257
- size: e.size
258
- }), {
259
- default: v(() => [(m(!0), j(Y, null, J(d.value, (r) => (m(), y(h(ve), {
260
- key: r.key,
261
- disabled: r.disabled,
262
- label: r.label,
263
- value: r.value
264
- }, null, 8, ["disabled", "label", "value"]))), 128))]),
265
- _: 1
266
- }, 16, ["modelValue"]));
267
- }
268
- }), Je = /* @__PURE__ */ b({
269
- __name: "XColorPicker",
270
- props: /* @__PURE__ */ B({
271
- clearable: {
272
- type: Boolean
273
- },
274
- disabled: {
275
- type: Boolean,
276
- default: void 0
277
- }
278
- }, {
279
- modelValue: {},
280
- modelModifiers: {}
281
- }),
282
- emits: ["update:modelValue"],
283
- setup(e) {
284
- const t = e, l = T(e, "modelValue"), n = p(k, void 0);
285
- if (n?.required) {
286
- const {
287
- validator: a,
288
- label: u
289
- } = n;
290
- n.validator = () => l.value ? a?.() : `请输入${u}`;
291
- }
292
- const o = p(P, void 0), i = p(D, void 0), d = p(H, void 0);
293
- return i?.on(([a, u]) => o === a && u === void 0 && (l.value = void 0)), d?.on(() => o && i?.trigger([o, l.value])), (a, u) => (m(), y(h(ge), V(t, {
294
- modelValue: l.value,
295
- "onUpdate:modelValue": u[0] || (u[0] = (s) => l.value = s)
296
- }), null, 16, ["modelValue"]));
297
- }
298
- }), Ze = /* @__PURE__ */ b({
299
- __name: "XDialog",
300
- props: /* @__PURE__ */ B({
301
- title: {},
302
- bodyClass: {}
303
- }, {
304
- modelValue: {
305
- type: Boolean
306
- },
307
- modelModifiers: {}
308
- }),
309
- emits: ["update:modelValue"],
310
- setup(e) {
311
- const {
312
- header: t,
313
- footer: l
314
- } = se(), n = T(e, "modelValue");
315
- return (o, i) => (m(), y(h(he), {
316
- modelValue: n.value,
317
- "onUpdate:modelValue": i[0] || (i[0] = (d) => n.value = d),
318
- title: e.title,
319
- "body-class": `flex flex-col ${e.bodyClass}`
320
- }, ce({
321
- default: v(() => [E(o.$slots, "default")]),
322
- _: 2
323
- }, [t ? {
324
- name: "header",
325
- fn: v(() => [E(o.$slots, "header")]),
326
- key: "0"
327
- } : void 0, l ? {
328
- name: "footer",
329
- fn: v(() => [E(o.$slots, "footer")]),
330
- key: "1"
331
- } : void 0]), 1032, ["modelValue", "title", "body-class"]));
332
- }
333
- }), et = /* @__PURE__ */ b({
334
- __name: "XDivider",
335
- props: {
336
- direction: {},
337
- contentPosition: {},
338
- borderStyle: {}
339
- },
340
- setup(e) {
341
- const t = e;
342
- return (l, n) => (m(), y(h(Be), O(M(t)), {
343
- default: v(() => [
344
- E(l.$slots, "default")
345
- ]),
346
- _: 3
347
- }, 16));
348
- }
349
- }), tt = /* @__PURE__ */ b((e, {
350
- expose: t
351
- }) => {
352
- const l = p(le, void 0), n = p(Re, void 0), o = F(), i = {
353
- label: e.label,
354
- required: e.required,
355
- clearValidate() {
356
- o.value = void 0;
357
- },
358
- validate() {
359
- return o.value = i.validator?.() ?? void 0, o.value && l?.name && (ee({
360
- plain: !0,
361
- type: "warning",
362
- message: o.value
363
- }), n?.trigger(l.name)), !o.value;
364
- }
365
- };
366
- return p(te, void 0)?.push(i), $(k, i), t({
367
- ...i
368
- }), $(P, e.label), () => z(Ve, V({
369
- label: e.label,
370
- labelPosition: e.labelPosition,
371
- labelWidth: e.labelWidth,
372
- required: e.required
373
- }, {
374
- error: o.value
375
- }), {
376
- label: () => e.label,
377
- default: () => e.content?.()
378
- });
379
- }, {
380
- props: ["label", "required", "content", "tooltip"]
381
- }), at = /* @__PURE__ */ b({
382
- __name: "XForm",
383
- props: {
384
- content: {
385
- type: Function
386
- },
387
- data: {
388
- default: () => () => {
389
- }
390
- },
391
- disabled: {
392
- type: Boolean
393
- },
394
- inline: {
395
- type: Boolean
396
- },
397
- labelWidth: {},
398
- labelPosition: {},
399
- statusIcon: {
400
- type: Boolean,
401
- default: !0
402
- }
403
- },
404
- setup(e, {
405
- expose: t
406
- }) {
407
- const l = F(), n = [];
408
- $(te, n);
409
- const o = () => n.every((a) => a.validate()), i = () => {
410
- l.value?.resetFields(), n.forEach((a) => a.clearValidate());
411
- };
412
- t({
413
- data: e.data,
414
- validate: o,
415
- resetFields: i
416
- });
417
- const d = () => e.content?.({
418
- data: e.data
419
- });
420
- return (a, u) => (m(), y(h(we), V({
421
- ref_key: "form",
422
- ref: l
423
- }, {
424
- inline: e.inline,
425
- disabled: e.disabled,
426
- labelWidth: e.labelWidth,
427
- model: e.data,
428
- labelPosition: e.labelPosition,
429
- statusIcon: e.statusIcon
430
- }), {
431
- default: v(() => [z(d)]),
432
- _: 1
433
- }, 16));
434
- }
435
- }), lt = /* @__PURE__ */ b({
436
- __name: "XImage",
437
- props: {
438
- hideOnClickModal: { type: Boolean },
439
- src: {},
440
- fit: {},
441
- loading: {},
442
- lazy: { type: Boolean },
443
- scrollContainer: {},
444
- previewSrcList: {},
445
- previewTeleported: { type: Boolean },
446
- zIndex: {},
447
- initialIndex: {},
448
- infinite: { type: Boolean },
449
- closeOnPressEscape: { type: Boolean },
450
- zoomRate: {},
451
- scale: {},
452
- minScale: {},
453
- maxScale: {},
454
- showProgress: { type: Boolean },
455
- crossorigin: {}
456
- },
457
- setup(e) {
458
- const t = e;
459
- return (l, n) => (m(), y(h(Ce), O(M(t)), null, 16));
460
- }
461
- }), ot = /* @__PURE__ */ b({
462
- __name: "XInput",
463
- props: /* @__PURE__ */ B({
464
- clearable: {
465
- type: Boolean
466
- },
467
- placeholder: {
468
- default: "请输入"
469
- },
470
- disabled: {
471
- type: Boolean,
472
- default: void 0
473
- },
474
- size: {},
475
- type: {},
476
- showPassword: {
477
- type: Boolean
478
- },
479
- autosize: {}
480
- }, {
481
- modelValue: {},
482
- modelModifiers: {}
483
- }),
484
- emits: /* @__PURE__ */ B(["blur", "change"], ["update:modelValue"]),
485
- setup(e, {
486
- emit: t
487
- }) {
488
- const l = e, n = t, o = T(e, "modelValue"), i = p(k, void 0);
489
- if (i?.required) {
490
- const {
491
- validator: r,
492
- label: w
493
- } = i;
494
- i.validator = () => o.value ? r?.() : `请输入${w}`;
495
- }
496
- const d = p(P, void 0), a = p(D, void 0), u = p(H, void 0);
497
- a?.on(([r, w]) => d === r && w === void 0 && (o.value = void 0)), u?.on(() => d && a?.trigger([d, o.value]));
498
- const s = (r) => n("change", r), c = () => {
499
- i?.validate(), n("blur");
500
- };
501
- return (r, w) => (m(), y(h(Ee), V(l, {
502
- modelValue: o.value,
503
- "onUpdate:modelValue": w[0] || (w[0] = (x) => o.value = x),
504
- onBlur: c,
505
- onChange: s
506
- }), null, 16, ["modelValue"]));
507
- }
508
- }), nt = /* @__PURE__ */ b({
509
- __name: "XInputNumber",
510
- props: /* @__PURE__ */ B({
511
- placeholder: {
512
- default: "请输入"
513
- },
514
- disabled: {
515
- type: Boolean,
516
- default: void 0
517
- },
518
- align: {
519
- default: "left"
520
- },
521
- size: {},
522
- step: {},
523
- max: {},
524
- min: {},
525
- controls: {
526
- type: Boolean
527
- },
528
- precision: {},
529
- stepStrictly: {
530
- type: Boolean
531
- }
532
- }, {
533
- modelValue: {},
534
- modelModifiers: {}
535
- }),
536
- emits: /* @__PURE__ */ B(["blur"], ["update:modelValue"]),
537
- setup(e, {
538
- emit: t
539
- }) {
540
- const l = e, n = t, o = T(e, "modelValue"), i = p(k, void 0);
541
- if (i?.required) {
542
- const {
543
- validator: a,
544
- label: u
545
- } = i;
546
- i.validator = () => o.value === void 0 ? `请输入${u}` : a?.();
547
- }
548
- const d = () => {
549
- i?.validate(), n("blur");
550
- };
551
- return (a, u) => {
552
- const s = U("ElInputNumber");
553
- return m(), y(s, V(l, {
554
- modelValue: o.value,
555
- "onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
556
- onBlur: d
557
- }), null, 16, ["modelValue"]);
558
- };
559
- }
560
- }), it = /* @__PURE__ */ b({
561
- __name: "XPagination",
562
- props: /* @__PURE__ */ B({
563
- sizes: { default: () => [20, 50, 100] },
564
- pageSize: {},
565
- defaultPageSize: {},
566
- total: {},
567
- pageCount: {},
568
- pagerCount: {},
569
- currentPage: {},
570
- defaultCurrentPage: {},
571
- layout: { default: "prev, pager, next, jumper, ->, total" },
572
- popperClass: {},
573
- popperStyle: {},
574
- prevText: {},
575
- prevIcon: {},
576
- nextText: {},
577
- nextIcon: {},
578
- teleported: { type: Boolean },
579
- small: { type: Boolean },
580
- size: {},
581
- background: { type: Boolean, default: !0 },
582
- disabled: { type: Boolean },
583
- hideOnSinglePage: { type: Boolean },
584
- appendSizeTo: {}
585
- }, {
586
- size: {},
587
- sizeModifiers: {},
588
- current: {},
589
- currentModifiers: {}
590
- }),
591
- emits: /* @__PURE__ */ B(["sizeChange", "currentChange"], ["update:size", "update:current"]),
592
- setup(e, { emit: t }) {
593
- const l = t, n = T(e, "size"), o = T(e, "current");
594
- return (i, d) => (m(), y(h(Te), V({ background: e.background, pageSizes: e.sizes, layout: e.layout, total: e.total }, {
595
- "current-page": o.value,
596
- "onUpdate:currentPage": d[0] || (d[0] = (a) => o.value = a),
597
- "page-size": n.value,
598
- "onUpdate:pageSize": d[1] || (d[1] = (a) => n.value = a),
599
- onSizeChange: d[2] || (d[2] = (a) => l("sizeChange", a)),
600
- onCurrentChange: d[3] || (d[3] = (a) => l("currentChange", a))
601
- }), null, 16, ["current-page", "page-size"]));
602
- }
603
- }), dt = /* @__PURE__ */ b({
604
- __name: "XRate",
605
- props: /* @__PURE__ */ B({
606
- ariaLabel: {},
607
- id: {},
608
- lowThreshold: {},
609
- highThreshold: {},
610
- max: {},
611
- colors: {},
612
- voidColor: {},
613
- disabledVoidColor: {},
614
- icons: {},
615
- voidIcon: {},
616
- disabledVoidIcon: {},
617
- disabled: {
618
- type: Boolean,
619
- default: void 0
620
- },
621
- allowHalf: {
622
- type: Boolean
623
- },
624
- showText: {
625
- type: Boolean
626
- },
627
- showScore: {
628
- type: Boolean
629
- },
630
- textColor: {},
631
- texts: {},
632
- scoreTemplate: {},
633
- size: {},
634
- clearable: {
635
- type: Boolean
636
- }
637
- }, {
638
- modelValue: {},
639
- modelModifiers: {}
640
- }),
641
- emits: ["update:modelValue"],
642
- setup(e) {
643
- const t = e, l = T(e, "modelValue");
644
- return (n, o) => (m(), y(h(xe), V(t, {
645
- modelValue: l.value,
646
- "onUpdate:modelValue": o[0] || (o[0] = (i) => l.value = i)
647
- }), null, 16, ["modelValue"]));
648
- }
649
- }), rt = /* @__PURE__ */ b({
650
- __name: "XReconfirm",
651
- props: {
652
- title: { default: "是否执行?" }
653
- },
654
- emits: ["cancel", "confirm"],
655
- setup(e, { emit: t }) {
656
- const l = t;
657
- return (n, o) => {
658
- const i = U("XButton");
659
- return m(), y(h(Xe), {
660
- title: e.title,
661
- onCancel: o[0] || (o[0] = () => l("cancel")),
662
- onConfirm: o[1] || (o[1] = () => l("confirm"))
663
- }, {
664
- reference: v(() => [
665
- E(n.$slots, "default")
666
- ]),
667
- actions: v(({ confirm: d, cancel: a }) => [
668
- z(i, {
669
- size: "small",
670
- onClick: a
671
- }, {
672
- default: v(() => [...o[2] || (o[2] = [
673
- q(" 取消 ", -1)
674
- ])]),
675
- _: 1
676
- }, 8, ["onClick"]),
677
- z(i, {
678
- type: "danger",
679
- size: "small",
680
- onClick: d
681
- }, {
682
- default: v(() => [...o[3] || (o[3] = [
683
- q(" 确定 ", -1)
684
- ])]),
685
- _: 1
686
- }, 8, ["onClick"])
687
- ]),
688
- _: 3
689
- }, 8, ["title"]);
690
- };
691
- }
692
- }), ut = /* @__PURE__ */ b({
693
- __name: "XScrollbar",
694
- props: {
695
- ariaLabel: {},
696
- ariaOrientation: {},
697
- distance: {},
698
- height: {},
699
- maxHeight: {},
700
- native: {
701
- type: Boolean
702
- },
703
- wrapStyle: {},
704
- wrapClass: {},
705
- viewClass: {},
706
- viewStyle: {},
707
- noresize: {
708
- type: Boolean
709
- },
710
- tag: {},
711
- always: {
712
- type: Boolean
713
- },
714
- minSize: {},
715
- tabindex: {},
716
- id: {},
717
- role: {}
718
- },
719
- setup(e, {
720
- expose: t
721
- }) {
722
- const l = e, n = Z("scrollbar"), o = C(() => n.value?.wrapRef), i = C(() => o.value?.firstElementChild);
723
- return t({
724
- wrapRef: o,
725
- viewRef: i
726
- }), (d, a) => (m(), y(h(Se), V({
727
- ref: "scrollbar"
728
- }, l), {
729
- default: v(() => [E(d.$slots, "default")]),
730
- _: 3
731
- }, 16));
732
- }
733
- }), st = /* @__PURE__ */ b({
734
- __name: "XSelect",
735
- props: /* @__PURE__ */ B({
736
- data: {},
737
- factory: {
738
- type: Function
739
- },
740
- identify: {
741
- type: Function
742
- },
743
- supplement: {
744
- type: Function
745
- },
746
- ariaLabel: {},
747
- emptyValues: {},
748
- valueOnClear: {},
749
- name: {},
750
- id: {},
751
- autocomplete: {},
752
- automaticDropdown: {
753
- type: Boolean
754
- },
755
- size: {},
756
- effect: {},
757
- disabled: {
758
- type: Boolean,
759
- default: () => {
760
- }
761
- },
762
- clearable: {
763
- type: Boolean
764
- },
765
- filterable: {
766
- type: Boolean
767
- },
768
- allowCreate: {
769
- type: Boolean
770
- },
771
- loading: {
772
- type: Boolean
773
- },
774
- popperClass: {},
775
- popperStyle: {},
776
- popperOptions: {},
777
- remote: {
778
- type: Boolean
779
- },
780
- debounce: {},
781
- loadingText: {},
782
- noMatchText: {},
783
- noDataText: {},
784
- remoteMethod: {},
785
- filterMethod: {},
786
- multiple: {
787
- type: Boolean
788
- },
789
- multipleLimit: {},
790
- placeholder: {
791
- default: "请选择"
792
- },
793
- defaultFirstOption: {
794
- type: Boolean
795
- },
796
- reserveKeyword: {
797
- type: Boolean
798
- },
799
- valueKey: {},
800
- collapseTags: {
801
- type: Boolean
802
- },
803
- collapseTagsTooltip: {
804
- type: Boolean
805
- },
806
- maxCollapseTags: {},
807
- teleported: {
808
- type: Boolean
809
- },
810
- persistent: {
811
- type: Boolean
812
- },
813
- clearIcon: {},
814
- fitInputWidth: {
815
- type: Boolean
816
- },
817
- suffixIcon: {},
818
- tagType: {},
819
- tagEffect: {},
820
- validateEvent: {
821
- type: Boolean
822
- },
823
- remoteShowSuffix: {
824
- type: Boolean
825
- },
826
- showArrow: {
827
- type: Boolean
828
- },
829
- offset: {},
830
- placement: {},
831
- fallbackPlacements: {},
832
- tabindex: {},
833
- appendTo: {},
834
- options: {},
835
- props: {}
836
- }, {
837
- modelValue: {},
838
- modelModifiers: {}
839
- }),
840
- emits: /* @__PURE__ */ B(["blur", "change"], ["update:modelValue"]),
841
- setup(e, {
842
- emit: t
843
- }) {
844
- const l = t, n = T(e, "modelValue"), o = F([]), i = /* @__PURE__ */ Q(() => e.data, e.factory), d = C(() => [...(/* @__PURE__ */ Q(o, e.factory)).value, ...i.value]), a = (f) => {
845
- if (typeof f == "object") {
846
- if (e.identify)
847
- return e.identify(f);
848
- throw new Error("`identify` is required when value's type extends `object` or `object[]`");
849
- } else
850
- return f;
851
- }, u = (f) => d.value.map((g) => g.value).find((g) => a(g) === f);
852
- let s = 0;
853
- W([n, i], async () => {
854
- if (s++, n.value) {
855
- const f = [].concat(n.value).filter((_) => !i.value.map((S) => a(S.value)).includes(a(_))), g = s, R = await e.supplement?.(f);
856
- g === s && R && (o.value = R);
857
- } else
858
- o.value = [];
859
- }, {
860
- immediate: !0
861
- });
862
- const c = C(() => d.value.map((f) => {
863
- const g = a(f.value);
864
- return {
865
- ...f,
866
- key: g,
867
- value: g
868
- };
869
- })), r = C({
870
- get: () => n.value && (Array.isArray(n.value) ? n.value.map(a) : a(n.value)),
871
- set: (f) => {
872
- Array.isArray(f) ? n.value = f.map((g) => u(g)) : n.value = f === void 0 ? void 0 : u(f) || (e.allowCreate ? f : void 0);
873
- }
874
- }), w = p(k, void 0);
875
- if (w?.required) {
876
- const {
877
- validator: f,
878
- label: g
879
- } = w;
880
- w.validator = () => !n.value || Array.isArray(n.value) && n.value.length === 0 ? `请选择${g}` : f?.();
881
- }
882
- const x = p(P, void 0), X = p(D, void 0), A = p(H, void 0);
883
- X?.on(([f, g]) => x === f && g === void 0 && (r.value = void 0)), A?.on(() => x && X?.trigger([x, r.value === void 0 ? void 0 : [].concat(r.value).map((f) => c.value.find((g) => g.value === f).label).join(",")]));
884
- const ne = (f) => l("change", f), ie = () => {
885
- w?.validate(), l("blur");
886
- };
887
- return (f, g) => {
888
- const R = U("ElOption"), _ = U("ElSelect");
889
- return m(), y(_, V({
890
- allowCreate: e.allowCreate,
891
- clearable: e.clearable,
892
- filterable: e.filterable,
893
- remote: e.remote,
894
- remoteMethod: e.remoteMethod,
895
- placeholder: e.placeholder,
896
- disabled: e.disabled,
897
- size: e.size,
898
- loading: e.loading,
899
- multiple: e.multiple,
900
- collapseTags: e.collapseTags,
901
- collapseTagsTooltip: e.collapseTags
902
- }, {
903
- modelValue: r.value,
904
- "onUpdate:modelValue": g[0] || (g[0] = (S) => r.value = S),
905
- onBlur: ie,
906
- onChange: ne
907
- }), {
908
- default: v(() => [(m(!0), j(Y, null, J(c.value, (S) => (m(), y(R, {
909
- key: S.key,
910
- label: S.label,
911
- value: S.value
912
- }, {
913
- default: v(() => [q(fe(S.label), 1)]),
914
- _: 2
915
- }, 1032, ["label", "value"]))), 128))]),
916
- _: 1
917
- }, 16, ["modelValue"]);
918
- };
919
- }
920
- }), ct = /* @__PURE__ */ b({
921
- __name: "XSpace",
922
- props: {
923
- direction: {},
924
- class: {},
925
- style: {},
926
- alignment: {},
927
- prefixCls: {},
928
- spacer: {},
929
- wrap: {
930
- type: Boolean
931
- },
932
- fill: {
933
- type: Boolean
934
- },
935
- fillRatio: {},
936
- size: {}
937
- },
938
- setup(e) {
939
- const t = e;
940
- return (l, n) => (m(), y(h(ze), O(M(t)), {
941
- default: v(() => [E(l.$slots, "default")]),
942
- _: 3
943
- }, 16));
944
- }
945
- }), ft = /* @__PURE__ */ b({
946
- __name: "XTable",
947
- props: {
948
- data: {},
949
- height: {},
950
- columns: {},
951
- showOverflowTooltip: {
952
- type: Boolean
953
- },
954
- border: {
955
- type: Boolean
956
- },
957
- highlightCurrentRow: {
958
- type: Boolean
959
- },
960
- spanMethod: {
961
- type: Function
962
- }
963
- },
964
- emits: ["rowClick", "selectionChange", "headerDragend"],
965
- setup(e, {
966
- emit: t
967
- }) {
968
- const l = t, n = Z("container"), o = F(), i = Qe(n), d = C(() => e.height ?? i.height.value), a = () => z(ke, V({
969
- ref: o
970
- }, {
971
- data: e.data,
972
- height: d.value,
973
- showOverflowTooltip: e.showOverflowTooltip,
974
- border: e.border,
975
- highlightCurrentRow: e.highlightCurrentRow,
976
- spanMethod: e.spanMethod
977
- }, {
978
- "onRow-click": (u) => l("rowClick", u),
979
- "onSelection-change": (u) => l("selectionChange", u),
980
- "onHeader-dragend": (u, s, c) => l("headerDragend", u, s, c)
981
- }), {
982
- default: () => e.columns.map((u) => z(Ie, u, {
983
- default: ({
984
- $index: s,
985
- row: c
986
- }) => u.content?.({
987
- index: s,
988
- row: c
989
- }),
990
- header: () => u.header?.({
991
- column: u
992
- }) ?? u.label
993
- }))
994
- });
995
- return (u, s) => (m(), j("div", {
996
- ref_key: "container",
997
- ref: n,
998
- class: me([e.height === void 0 && "h-full"])
999
- }, [z(a)], 2));
1000
- }
1001
- }), mt = /* @__PURE__ */ b((e, {
1002
- slots: t
1003
- }) => {
1004
- const l = {
1005
- ...e
1006
- };
1007
- return p(ae, void 0)?.push(l), $(le, l), () => z($e, e, {
1008
- ...t
1009
- });
1010
- }, {
1011
- props: ["label", "name", "closable", "lazy", "disabled"]
1012
- }), pt = /* @__PURE__ */ b({
1013
- __name: "XTabs",
1014
- props: /* @__PURE__ */ B({
1015
- type: {},
1016
- defaultValue: {},
1017
- addable: {
1018
- type: Boolean,
1019
- default: () => {
1020
- }
1021
- },
1022
- editable: {
1023
- type: Boolean,
1024
- default: () => {
1025
- }
1026
- },
1027
- tabPosition: {}
1028
- }, {
1029
- modelValue: {},
1030
- modelModifiers: {}
1031
- }),
1032
- emits: /* @__PURE__ */ B(["tabChange", "tabRemove"], ["update:modelValue"]),
1033
- setup(e, {
1034
- emit: t
1035
- }) {
1036
- const l = t, n = T(e, "modelValue");
1037
- return $(ae, []), (i, d) => (m(), y(h(Ae), V({
1038
- addable: e.addable,
1039
- editable: e.editable,
1040
- type: e.type,
1041
- defaultValue: e.defaultValue,
1042
- tabPosition: e.tabPosition
1043
- }, {
1044
- modelValue: n.value,
1045
- "onUpdate:modelValue": d[0] || (d[0] = (a) => n.value = a),
1046
- onTabChange: d[1] || (d[1] = (a) => l("tabChange", a)),
1047
- onTabRemove: d[2] || (d[2] = (a) => l("tabRemove", a))
1048
- }), {
1049
- default: v(() => [E(i.$slots, "default")]),
1050
- _: 3
1051
- }, 16, ["modelValue"]));
1052
- }
1053
- }), bt = /* @__PURE__ */ b({
1054
- __name: "XTag",
1055
- props: {
1056
- type: {},
1057
- color: {},
1058
- closable: { type: Boolean, default: () => {
1059
- } },
1060
- round: { type: Boolean, default: () => {
1061
- } }
1062
- },
1063
- emits: ["close"],
1064
- setup(e) {
1065
- return (t, l) => (m(), y(h(Oe), V({ type: e.type, color: e.color, closable: e.closable, round: e.round }, {
1066
- onClose: l[0] || (l[0] = (n) => t.$emit("close"))
1067
- }), {
1068
- default: v(() => [
1069
- E(t.$slots, "default")
1070
- ]),
1071
- _: 3
1072
- }, 16));
1073
- }
1074
- }), yt = /* @__PURE__ */ b({
1075
- __name: "XText",
1076
- props: {
1077
- type: {},
1078
- size: {},
1079
- truncated: { type: Boolean, default: () => {
1080
- } }
1081
- },
1082
- setup(e) {
1083
- return (t, l) => (m(), y(h(Me), O(M({ type: e.type, size: e.size, truncated: e.truncated })), {
1084
- default: v(() => [
1085
- E(t.$slots, "default")
1086
- ]),
1087
- _: 3
1088
- }, 16));
1089
- }
1090
- }), vt = /* @__PURE__ */ b({
1091
- __name: "XUpload",
1092
- props: /* @__PURE__ */ B({
1093
- action: {},
1094
- data: {
1095
- type: Function
1096
- },
1097
- disabled: {
1098
- type: Boolean,
1099
- default: () => {
1100
- }
1101
- },
1102
- limit: {},
1103
- multiple: {
1104
- type: Boolean
1105
- },
1106
- showFileList: {
1107
- type: Boolean,
1108
- default: !0
1109
- },
1110
- drag: {
1111
- type: Boolean
1112
- },
1113
- accept: {},
1114
- listType: {},
1115
- maxSize: {
1116
- default: () => 1 / 0
1117
- }
1118
- }, {
1119
- modelValue: {},
1120
- modelModifiers: {}
1121
- }),
1122
- emits: ["update:modelValue"],
1123
- setup(e) {
1124
- const t = T(e, "modelValue"), l = C(() => [].concat(t.value ?? []).reverse().map((a) => ({
1125
- name: a.split("/").findLast(() => !0),
1126
- url: a,
1127
- uid: Number(a.slice(0, a.lastIndexOf("/")).split("/").findLast(() => !0))
1128
- }))), n = p(k, void 0);
1129
- if (n?.required) {
1130
- const {
1131
- validator: a,
1132
- label: u
1133
- } = n;
1134
- n.validator = () => !t.value || Array.isArray(t.value) && t.value.length === 0 ? `请上传${u}` : a?.();
1135
- }
1136
- const o = (a) => (a.size > e.maxSize && ee.warning("文件过大,请重新选择"), a.size < e.maxSize), i = (a) => window.open(a.url), d = (a, u) => {
1137
- t.value = Array.isArray(t.value) ? u.map((s) => s.url) : void 0;
1138
- };
1139
- return (a, u) => (m(), y(h(Pe), O(M({
1140
- limit: e.limit,
1141
- disabled: e.disabled,
1142
- data: e.data,
1143
- maxSize: e.maxSize,
1144
- showFileList: e.showFileList,
1145
- fileList: l.value,
1146
- beforeUpload: o,
1147
- onPreview: i,
1148
- onRemove: d
1149
- })), {
1150
- file: v(({
1151
- file: s
1152
- }) => [E(a.$slots, "file", {
1153
- file: s
1154
- })]),
1155
- default: v(() => [E(a.$slots, "default")]),
1156
- _: 3
1157
- }, 16));
1158
- }
1159
- });
1160
- export {
1161
- Ke as XButton,
1162
- Ge as XCascader,
1163
- Ye as XCheckbox,
1164
- Je as XColorPicker,
1165
- Ze as XDialog,
1166
- et as XDivider,
1167
- at as XForm,
1168
- tt as XFormItem,
1169
- lt as XImage,
1170
- ot as XInput,
1171
- nt as XInputNumber,
1172
- it as XPagination,
1173
- dt as XRate,
1174
- rt as XReconfirm,
1175
- ut as XScrollbar,
1176
- st as XSelect,
1177
- ct as XSpace,
1178
- mt as XTabPane,
1179
- ft as XTable,
1180
- pt as XTabs,
1181
- bt as XTag,
1182
- yt as XText,
1183
- vt as XUpload,
1184
- P as X_FORM_ITEM_LABEL,
1185
- k as X_FORM_ITEM_VALIDATION,
1186
- Re as X_FORM_TAB_UPDATE_HOOK,
1187
- te as X_FORM_VALIDATIONS,
1188
- H as X_TABLE_QUERY_EXECUTE_HOOK,
1189
- D as X_TABLE_QUERY_UPDATE_HOOK,
1190
- le as X_TAB_PANE,
1191
- ae as X_TAB_PANES
1192
- };
1
+ import { _ as e, t, v as n } from "./basic-CZ74BN1R.js";
2
+ import { t as r } from "./advance-C3UkhTla.js";
3
+ import { vLoading as i } from "element-plus";
4
+ //#region src/install.ts
5
+ var a = {
6
+ button: { autoInsertSpace: !1 },
7
+ table: { showOverflowTooltip: !1 }
8
+ }, o = (e = {}) => ({
9
+ button: {
10
+ ...a.button,
11
+ ...e.button
12
+ },
13
+ table: {
14
+ ...a.table,
15
+ ...e.table
16
+ },
17
+ oss: e.oss
18
+ }), s = (a, s = {}) => {
19
+ a[n] || (a[n] = !0, a.provide(e, o(s.config)), a.directive("loading", i), Object.entries({
20
+ ...t,
21
+ ...s.advance ? r : {}
22
+ }).forEach(([e, t]) => a.component(e, t)));
23
+ }, c = s;
24
+ //#endregion
25
+ export { c as default, s as install };