view-ui-plus-derive 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- import { defineComponent as _, shallowRef as Se, computed as L, onMounted as me, watch as F, resolveComponent as A, createElementBlock as N, openBlock as $, withDirectives as ae, createVNode as O, withCtx as D, createTextVNode as j, toDisplayString as H, unref as y, vShow as ue, Fragment as Q, renderList as ee, createBlock as U, renderSlot as z, ref as E, mergeProps as G, inject as Ke, useSlots as Ue, normalizeClass as P, createCommentVNode as W, createElementVNode as te, nextTick as q, shallowReactive as Te, useTemplateRef as he, normalizeProps as Be, guardReactiveProps as De, createSlots as we, getCurrentInstance as ve, onBeforeUnmount as Ae, mergeModels as xe, useModel as Ye, reactive as Ge } from "vue";
2
- import { getPathValue as pe, setPathValue as _e, deepMerge as Je, makeObjectByPath as qe, omitOwnKeys as We } from "utils-where";
3
- import Xe from "./locale/zh-CN.js";
1
+ import { defineComponent as Y, shallowRef as Ce, computed as N, onMounted as de, watch as I, createElementBlock as j, openBlock as D, withDirectives as te, createVNode as $, unref as o, withCtx as C, createTextVNode as H, toDisplayString as z, vShow as ue, Fragment as X, renderList as _, createBlock as L, renderSlot as M, ref as E, mergeProps as U, useSlots as qe, normalizeClass as F, createCommentVNode as q, createElementVNode as ee, nextTick as G, shallowReactive as ze, useTemplateRef as ce, normalizeProps as Be, guardReactiveProps as Ve, getCurrentInstance as me, createSlots as Fe, onBeforeUnmount as He, mergeModels as Ae, useModel as We, reactive as Xe } from "vue";
2
+ import { Checkbox as oe, CheckboxGroup as Ze, Switch as Qe, InputNumber as Re, Select as _e, Option as et, DatePicker as ke, Table as je, Button as Z, Row as ge, Col as ie, Spin as tt, Dropdown as at, Icon as fe, DropdownMenu as lt, DropdownItem as nt, Tooltip as we, Page as ot } from "view-ui-plus";
3
+ import { getPathValue as Q, omitOwnKeys as Ne, isObject as Me, setPathValue as it, deepMerge as ut, makeObjectByPath as st } from "utils-where";
4
+ import dt from "./locale/zh-CN.js";
4
5
  /* empty css */
5
6
  /* empty css */
6
- import { i as Re } from "./directives/v-iview-select.js";
7
+ import { i as Pe } from "./directives/v-iview-select.js";
7
8
  /* empty css */
8
9
  /* empty css */
9
- import { Checkbox as $e } from "view-ui-plus";
10
10
  /* empty css */
11
11
  /* empty css */
12
- const M = {
12
+ const w = {
13
13
  i18n: null,
14
14
  prefix: "d",
15
- msg: Xe,
16
- t(t, ...k) {
17
- return M.i18n?.global.t(M.prefix + "." + t, ...k) ?? pe(M.msg, M.prefix + "." + t) ?? t;
15
+ msg: dt,
16
+ t(t, ...S) {
17
+ return w.i18n?.global.t(w.prefix + "." + t, ...S) ?? Q(w.msg, w.prefix + "." + t) ?? t;
18
18
  }
19
- }, Ze = {
19
+ }, rt = {
20
20
  name: "AllCheckbox"
21
- }, Qe = /* @__PURE__ */ _({
22
- ...Ze,
21
+ }, ct = /* @__PURE__ */ Y({
22
+ ...rt,
23
23
  props: {
24
24
  modelValue: Array,
25
25
  /**
@@ -69,71 +69,68 @@ const M = {
69
69
  all: Boolean
70
70
  },
71
71
  emits: ["update:modelValue", "update:all", "change"],
72
- setup(t, { emit: k }) {
73
- const a = t, e = k, l = Se(a.modelValue || []), n = L({
72
+ setup(t, { emit: S }) {
73
+ const a = t, e = S, l = Ce(a.modelValue || []), i = N({
74
74
  get() {
75
75
  return l.value.length === a.list.length;
76
76
  },
77
- set(d) {
78
- l.value = d ? a.list.map((p) => p[a.keyMap.value]) : [];
77
+ set(c) {
78
+ l.value = c ? a.list.map((v) => v[a.keyMap.value]) : [];
79
79
  }
80
- }), i = L(
80
+ }), u = N(
81
81
  () => l.value.length > 0 && l.value.length < a.list.length
82
82
  );
83
- function g() {
84
- e("update:modelValue", l.value), e("update:all", n.value), e("change", l.value, n.value);
83
+ function p() {
84
+ e("update:modelValue", l.value), e("update:all", i.value), e("change", l.value, i.value);
85
85
  }
86
- return me(() => {
87
- e("update:all", n.value);
88
- }), F(
86
+ return de(() => {
87
+ e("update:all", i.value);
88
+ }), I(
89
89
  () => a.modelValue,
90
- (d) => {
91
- l.value !== d && (l.value = d || [], e("update:all", n.value));
90
+ (c) => {
91
+ l.value !== c && (l.value = c || [], e("update:all", i.value));
92
92
  }
93
- ), (d, p) => {
94
- const v = A("Checkbox"), u = A("CheckboxGroup");
95
- return $(), N("div", null, [
96
- ae(O(v, {
97
- modelValue: n.value,
98
- "onUpdate:modelValue": p[0] || (p[0] = (x) => n.value = x),
99
- indeterminate: i.value,
100
- onOnChange: g
101
- }, {
102
- default: D(() => [
103
- j(H(t.title ?? y(M).t("allCheckbox.title")), 1)
104
- ]),
105
- _: 1
106
- }, 8, ["modelValue", "indeterminate"]), [
107
- [ue, !t.hideAll]
93
+ ), (c, v) => (D(), j("div", null, [
94
+ te($(o(oe), {
95
+ modelValue: i.value,
96
+ "onUpdate:modelValue": v[0] || (v[0] = (b) => i.value = b),
97
+ indeterminate: u.value,
98
+ onOnChange: p
99
+ }, {
100
+ default: C(() => [
101
+ H(z(t.title ?? o(w).t("allCheckbox.title")), 1)
108
102
  ]),
109
- O(u, {
110
- modelValue: l.value,
111
- "onUpdate:modelValue": p[1] || (p[1] = (x) => l.value = x),
112
- class: "ivu-inline-block",
113
- onOnChange: g
114
- }, {
115
- default: D(() => [
116
- ($(!0), N(Q, null, ee(t.list, (x) => ($(), U(v, {
117
- key: x[t.keyMap.value],
118
- label: x[t.keyMap.value]
119
- }, {
120
- default: D(() => [
121
- z(d.$slots, "default", { item: x }, () => [
122
- j(H(x[t.keyMap.label]), 1)
123
- ])
124
- ]),
125
- _: 2
126
- }, 1032, ["label"]))), 128))
127
- ]),
128
- _: 3
129
- }, 8, ["modelValue"])
130
- ]);
131
- };
103
+ _: 1
104
+ }, 8, ["modelValue", "indeterminate"]), [
105
+ [ue, !t.hideAll]
106
+ ]),
107
+ $(o(Ze), {
108
+ modelValue: l.value,
109
+ "onUpdate:modelValue": v[1] || (v[1] = (b) => l.value = b),
110
+ class: "ivu-inline-block",
111
+ onOnChange: p
112
+ }, {
113
+ default: C(() => [
114
+ (D(!0), j(X, null, _(t.list, (b) => (D(), L(o(oe), {
115
+ key: b[t.keyMap.value],
116
+ label: b[t.keyMap.value]
117
+ }, {
118
+ default: C(() => [
119
+ M(c.$slots, "default", { item: b }, () => [
120
+ H(z(b[t.keyMap.label]), 1)
121
+ ])
122
+ ]),
123
+ _: 2
124
+ }, 1032, ["label"]))), 128))
125
+ ]),
126
+ _: 3
127
+ }, 8, ["modelValue"])
128
+ ]));
132
129
  }
133
- }), et = {
130
+ }), ft = {
134
131
  name: "BaseSwitch"
135
- }, tt = /* @__PURE__ */ _({
136
- ...et,
132
+ }, gt = /* @__PURE__ */ Y({
133
+ ...ft,
137
134
  props: {
138
135
  modelValue: [String, Number, Boolean],
139
136
  /**
@@ -160,52 +157,49 @@ const M = {
160
157
  falseLabel: String
161
158
  },
162
159
  emits: ["update:modelValue", "change"],
163
- setup(t, { emit: k }) {
164
- const a = t, e = k, l = E(a.modelValue), n = (i) => {
165
- e("update:modelValue", i), e("change", i);
160
+ setup(t, { emit: S }) {
161
+ const a = t, e = S, l = E(a.modelValue), i = (u) => {
162
+ e("update:modelValue", u), e("change", u);
166
163
  };
167
- return F(
164
+ return I(
168
165
  () => a.modelValue,
169
- (i) => {
170
- l.value !== i && (l.value = i);
166
+ (u) => {
167
+ l.value !== u && (l.value = u);
171
168
  }
172
- ), (i, g) => {
173
- const d = A("Switch");
174
- return $(), U(d, G({
175
- modelValue: l.value,
176
- "onUpdate:modelValue": g[0] || (g[0] = (p) => l.value = p),
177
- onOnChange: n
178
- }, i.$attrs, {
179
- trueValue: t.trueValue,
180
- falseValue: t.falseValue
181
- }), {
182
- open: D(() => [
183
- z(i.$slots, "open", {}, () => [
184
- j(H(t.trueLabel), 1)
185
- ])
186
- ]),
187
- close: D(() => [
188
- z(i.$slots, "close", {}, () => [
189
- j(H(t.falseLabel), 1)
190
- ])
191
- ]),
192
- _: 3
193
- }, 16, ["modelValue", "trueValue", "falseValue"]);
194
- };
169
+ ), (u, p) => (D(), L(o(Qe), U({
170
+ modelValue: l.value,
171
+ "onUpdate:modelValue": p[0] || (p[0] = (c) => l.value = c),
172
+ onOnChange: i
173
+ }, u.$attrs, {
174
+ trueValue: t.trueValue,
175
+ falseValue: t.falseValue
176
+ }), {
177
+ open: C(() => [
178
+ M(u.$slots, "open", {}, () => [
179
+ H(z(t.trueLabel), 1)
180
+ ])
181
+ ]),
182
+ close: C(() => [
183
+ M(u.$slots, "close", {}, () => [
184
+ H(z(t.falseLabel), 1)
185
+ ])
186
+ ]),
187
+ _: 3
188
+ }, 16, ["modelValue", "trueValue", "falseValue"]));
195
189
  }
196
- }), Ie = Symbol("vupdPrefix"), I = (t) => {
197
- const k = Ke(Ie, "");
198
- return k ? k.replace(/\B([A-Z])/g, "-$1").toLowerCase() + "-" + t : t;
199
- }, at = {
190
+ }), Se = [], R = (t) => (
191
+ // const prefix = inject(classSymbol, '') as string
192
+ Se[0] ? Se[0].replace(/\B([A-Z])/g, "-$1").toLowerCase() + "-" + t : t
193
+ ), mt = {
200
194
  key: 0,
201
195
  class: "ivu-input-group-prepend"
202
- }, lt = {
196
+ }, ht = {
203
197
  key: 1,
204
198
  class: "ivu-input-group-append"
205
- }, nt = {
199
+ }, pt = {
206
200
  name: "Combi"
207
- }, ot = /* @__PURE__ */ _({
208
- ...nt,
201
+ }, bt = /* @__PURE__ */ Y({
202
+ ...pt,
209
203
  props: {
210
204
  /**
211
205
  * 前置文本
@@ -217,31 +211,31 @@ const M = {
217
211
  append: String
218
212
  },
219
213
  setup(t) {
220
- const k = Ue(), a = t, e = L(() => !!a.prepend || !!k.prepend?.().length), l = L(() => !!a.append || !!k.append?.().length);
221
- return (n, i) => ($(), N("div", {
222
- class: P([y(I)("combi"), "ivu-input-group"])
214
+ const S = qe(), a = t, e = N(() => !!a.prepend || !!S.prepend?.().length), l = N(() => !!a.append || !!S.append?.().length);
215
+ return (i, u) => (D(), j("div", {
216
+ class: F([o(R)("combi"), "ivu-input-group"])
223
217
  }, [
224
- e.value ? ($(), N("div", at, [
225
- z(n.$slots, "prepend", {}, () => [
226
- j(H(t.prepend), 1)
218
+ e.value ? (D(), j("div", mt, [
219
+ M(i.$slots, "prepend", {}, () => [
220
+ H(z(t.prepend), 1)
227
221
  ])
228
- ])) : W("", !0),
229
- te("div", {
230
- class: P([y(I)("combi-cell"), { "with-append": l.value, "with-prepend": e.value }])
222
+ ])) : q("", !0),
223
+ ee("div", {
224
+ class: F([o(R)("combi-cell"), { "with-append": l.value, "with-prepend": e.value }])
231
225
  }, [
232
- z(n.$slots, "default")
226
+ M(i.$slots, "default")
233
227
  ], 2),
234
- l.value ? ($(), N("div", lt, [
235
- z(n.$slots, "append", {}, () => [
236
- j(H(t.append), 1)
228
+ l.value ? (D(), j("div", ht, [
229
+ M(i.$slots, "append", {}, () => [
230
+ H(z(t.append), 1)
237
231
  ])
238
- ])) : W("", !0)
232
+ ])) : q("", !0)
239
233
  ], 2));
240
234
  }
241
- }), it = {
235
+ }), vt = {
242
236
  name: "CountRange"
243
- }, ut = /* @__PURE__ */ _({
244
- ...it,
237
+ }, yt = /* @__PURE__ */ Y({
238
+ ...vt,
245
239
  props: {
246
240
  /**
247
241
  * 双向绑定最小值
@@ -331,11 +325,11 @@ const M = {
331
325
  hideJoiner: Boolean
332
326
  },
333
327
  emits: ["update:begin", "update:end", "change-min", "change-max", "change"],
334
- setup(t, { emit: k }) {
335
- const a = t, e = k, l = E(a.begin), n = E(a.end), i = L(() => ({
328
+ setup(t, { emit: S }) {
329
+ const a = t, e = S, l = E(a.begin), i = E(a.end), u = N(() => ({
336
330
  min: a.min,
337
331
  max: a.max,
338
- placeholder: a.minHolder ?? M.t("countRange.minHolder"),
332
+ placeholder: a.minHolder ?? w.t("countRange.minHolder"),
339
333
  disabled: a.disabled || a.minDisabled,
340
334
  class: a.minClass,
341
335
  controlsOutside: a.controlsOutside,
@@ -347,10 +341,10 @@ const M = {
347
341
  parser: a.parser,
348
342
  activeChange: a.activeChange,
349
343
  ...a.minAttr
350
- })), g = L(() => ({
344
+ })), p = N(() => ({
351
345
  min: l.value,
352
346
  max: a.max,
353
- placeholder: a.maxHolder ?? M.t("countRange.maxHolder"),
347
+ placeholder: a.maxHolder ?? w.t("countRange.maxHolder"),
354
348
  disabled: a.disabled || a.maxDisabled,
355
349
  class: a.maxClass,
356
350
  controlsOutside: a.controlsOutside,
@@ -362,43 +356,40 @@ const M = {
362
356
  parser: a.parser,
363
357
  activeChange: l.value ? !1 : a.activeChange,
364
358
  ...a.maxAttr
365
- })), d = () => {
366
- e("update:begin", l.value), e("update:end", n.value);
367
- }, p = (s) => {
368
- n.value != null && s > n.value && (n.value = s + 1 > g.value.max ? g.value.max : s + 1), d(), e("change-min", s), e("change", s, n.value, !1);
369
- }, v = (s) => {
370
- d(), e("change-max", s), e("change", l.value, s, !0);
371
- }, u = (s) => {
372
- l.value !== s && (l.value = s !== void 0 ? s : null);
373
- }, x = (s) => {
374
- n.value !== s && (n.value = s !== void 0 ? s : null);
375
- };
376
- return F(() => a.begin, u), F(() => a.end, x), (s, b) => {
377
- const C = A("InputNumber");
378
- return $(), N("div", {
379
- class: P(y(I)("count-range"))
380
- }, [
381
- O(C, G({
382
- modelValue: l.value,
383
- "onUpdate:modelValue": b[0] || (b[0] = (T) => l.value = T)
384
- }, i.value, { onOnChange: p }), null, 16, ["modelValue"]),
385
- ae(te("span", {
386
- class: P([y(I)("count-range-joiner"), t.joinerClass])
387
- }, null, 2), [
388
- [ue, !t.hideJoiner]
389
- ]),
390
- O(C, G({
391
- modelValue: n.value,
392
- "onUpdate:modelValue": b[1] || (b[1] = (T) => n.value = T)
393
- }, g.value, { onOnChange: v }), null, 16, ["modelValue"])
394
- ], 2);
359
+ })), c = () => {
360
+ e("update:begin", l.value), e("update:end", i.value);
361
+ }, v = (r) => {
362
+ i.value != null && r > i.value && (i.value = r + 1 > p.value.max ? p.value.max : r + 1), c(), e("change-min", r), e("change", r, i.value, !1);
363
+ }, b = (r) => {
364
+ c(), e("change-max", r), e("change", l.value, r, !0);
365
+ }, d = (r) => {
366
+ l.value !== r && (l.value = r !== void 0 ? r : null);
367
+ }, T = (r) => {
368
+ i.value !== r && (i.value = r !== void 0 ? r : null);
395
369
  };
370
+ return I(() => a.begin, d), I(() => a.end, T), (r, y) => (D(), j("div", {
371
+ class: F(o(R)("count-range"))
372
+ }, [
373
+ $(o(Re), U({
374
+ modelValue: l.value,
375
+ "onUpdate:modelValue": y[0] || (y[0] = (B) => l.value = B)
376
+ }, u.value, { onOnChange: v }), null, 16, ["modelValue"]),
377
+ te(ee("span", {
378
+ class: F([o(R)("count-range-joiner"), t.joinerClass])
379
+ }, null, 2), [
380
+ [ue, !t.hideJoiner]
381
+ ]),
382
+ $(o(Re), U({
383
+ modelValue: i.value,
384
+ "onUpdate:modelValue": y[1] || (y[1] = (B) => i.value = B)
385
+ }, p.value, { onOnChange: b }), null, 16, ["modelValue"])
386
+ ], 2));
396
387
  }
397
- }), st = { key: 1 }, dt = {
388
+ }), kt = { key: 1 }, St = {
398
389
  name: "RemoteSelect",
399
390
  inheritAttrs: !1
400
- }, Me = /* @__PURE__ */ _({
401
- ...dt,
391
+ }, Ee = /* @__PURE__ */ Y({
392
+ ...St,
402
393
  props: {
403
394
  modelValue: [String, Array, Number],
404
395
  list: Array,
@@ -466,11 +457,11 @@ const M = {
466
457
  type: Function,
467
458
  default({
468
459
  multiple: t,
469
- keyMap: k,
460
+ keyMap: S,
470
461
  list: a,
471
462
  value: e
472
463
  }) {
473
- return t ? a.filter((l) => e.includes(l[k.value])) : a.find((l) => l[k.value] === e) || {};
464
+ return t ? a.filter((l) => e.includes(l[S.value])) : a.find((l) => l[S.value] === e) || {};
474
465
  }
475
466
  },
476
467
  /**
@@ -488,132 +479,129 @@ const M = {
488
479
  }
489
480
  },
490
481
  emits: ["update:modelValue", "update:chosen", "update:list", "update:refresh", "load"],
491
- setup(t, { expose: k, emit: a }) {
492
- const e = t, l = a, n = E(e.modelValue ?? ""), i = E([]), g = E(!1), d = E({}), p = L(
493
- () => d.value && Object.keys(d.value).length > 0 ? typeof e.textFormat != "function" ? e.multiple ? d.value.map((r) => r[e.keyMap.label]).join(",") : d.value[e.keyMap.label] : e.textFormat(d.value) : ""
494
- ), v = E(!1);
495
- let u, x, s, b;
496
- async function C() {
497
- let r;
482
+ setup(t, { expose: S, emit: a }) {
483
+ const e = t, l = a, i = E(e.modelValue ?? ""), u = E([]), p = E(!1), c = E({}), v = N(
484
+ () => c.value && Object.keys(c.value).length > 0 ? typeof e.textFormat != "function" ? e.multiple ? c.value.map((s) => s[e.keyMap.label]).join(",") : c.value[e.keyMap.label] : e.textFormat(c.value) : ""
485
+ ), b = E(!1);
486
+ let d, T, r, y;
487
+ async function B() {
488
+ let s;
498
489
  if (typeof e.loader != "function") {
499
490
  if (typeof e.method != "function") {
500
491
  console.warn("typeof method isn't function");
501
492
  return;
502
493
  }
503
- if (g.value = !0, r = await e.method(typeof e.param != "function" ? e.param : e.param()), g.value = !1, r && typeof e.process == "function") {
504
- const B = e.process(r);
505
- B != null && (r = B);
494
+ if (p.value = !0, s = await e.method(typeof e.param != "function" ? e.param : e.param()), p.value = !1, s && typeof e.process == "function") {
495
+ const k = e.process(s);
496
+ k != null && (s = k);
506
497
  }
507
498
  } else
508
- g.value = !0, r = await e.loader(), g.value = !1;
509
- r && (v.value = !0, i.value = r, l("update:list", r), S() && T(n.value), u = !0, q(() => {
510
- u = null;
511
- }), l("load", r));
499
+ p.value = !0, s = await e.loader(), p.value = !1;
500
+ s && (b.value = !0, u.value = s, l("update:list", s), V() && P(i.value), d = !0, G(() => {
501
+ d = null;
502
+ }), l("load", s));
512
503
  }
513
- function T(r) {
514
- x = !0, q(() => {
515
- x = null;
516
- }), s && (e.multiple ? !r.toString().length : r === void 0) && (n.value = r = s), d.value = e.getSelected({
504
+ function P(s) {
505
+ T = !0, G(() => {
506
+ T = null;
507
+ }), r && (e.multiple ? !s.toString().length : s === void 0) && (i.value = s = r), c.value = e.getSelected({
517
508
  multiple: e.multiple,
518
509
  keyMap: e.keyMap,
519
- list: i.value,
520
- value: n.value
521
- }), l("update:modelValue", r ?? ""), l("update:chosen", d.value);
510
+ list: u.value,
511
+ value: i.value
512
+ }), l("update:modelValue", s ?? ""), l("update:chosen", c.value);
522
513
  }
523
- function c(r) {
524
- r && !e.autoGet && !g.value && !v.value && (!e.check || e.check()) && (!e.strict || e.parentCode) && C();
514
+ function f(s) {
515
+ s && !e.autoGet && !p.value && !b.value && (!e.check || e.check()) && (!e.strict || e.parentCode) && B();
525
516
  }
526
- function S() {
527
- return n.value != null && n.value.toString().length > 0;
517
+ function V() {
518
+ return i.value != null && i.value.toString().length > 0;
528
519
  }
529
- return l("update:refresh", C), me(() => {
530
- e.autoGet ? C() : S() && !i.value.length && c(!0);
531
- }), k({
532
- code: n,
533
- changeCode: T,
534
- loaded: v,
535
- codes: i,
536
- search: C
537
- }), F(
520
+ return l("update:refresh", B), de(() => {
521
+ e.autoGet ? B() : V() && !u.value.length && f(!0);
522
+ }), S({
523
+ code: i,
524
+ changeCode: P,
525
+ loaded: b,
526
+ codes: u,
527
+ search: B
528
+ }), I(
538
529
  () => e.list,
539
- (r) => {
540
- u || (r && r.length ? (i.value = r, v.value = !!e.cache) : (i.value = [], v.value = !1));
530
+ (s) => {
531
+ d || (s && s.length ? (u.value = s, b.value = !!e.cache) : (u.value = [], b.value = !1));
541
532
  },
542
533
  { immediate: !0 }
543
- ), F(
534
+ ), I(
544
535
  () => e.modelValue,
545
- (r) => {
546
- if (!x && (b = !0, q(() => {
547
- b = null;
548
- }), n.value = r ?? "", T(n.value), e.refresh !== C)) {
549
- for (const B in d.value)
536
+ (s) => {
537
+ if (!T && (y = !0, G(() => {
538
+ y = null;
539
+ }), i.value = s ?? "", P(i.value), e.refresh !== B)) {
540
+ for (const k in c.value)
550
541
  return;
551
- c(S());
542
+ f(V());
552
543
  }
553
544
  }
554
- ), F(
545
+ ), I(
555
546
  () => e.parentCode,
556
- (r) => {
557
- b ? (s = e.modelValue, setTimeout(() => {
558
- s = null;
559
- })) : n.value = e.multiple ? [] : "", i.value = [], v.value = !1, l("update:list", i.value), S() && r && /* !this.opening && */
560
- c(!0);
547
+ (s) => {
548
+ y ? (r = e.modelValue, setTimeout(() => {
549
+ r = null;
550
+ })) : i.value = e.multiple ? [] : "", u.value = [], b.value = !1, l("update:list", u.value), V() && s && /* !this.opening && */
551
+ f(!0);
561
552
  }
562
- ), (r, B) => {
563
- const h = A("Option"), o = A("Select");
564
- return t.textMode ? ($(), N("span", st, [
565
- z(r.$slots, "text", { text: p.value }, () => [
566
- j(H(p.value), 1)
553
+ ), (s, k) => t.textMode ? (D(), j("span", kt, [
554
+ M(s.$slots, "text", { text: v.value }, () => [
555
+ H(z(v.value), 1)
556
+ ])
557
+ ])) : te((D(), L(o(_e), U({
558
+ key: 0,
559
+ modelValue: i.value,
560
+ "onUpdate:modelValue": k[0] || (k[0] = (h) => i.value = h),
561
+ onOnOpenChange: f,
562
+ onOnChange: P
563
+ }, s.$attrs, {
564
+ multiple: t.multiple,
565
+ loading: p.value,
566
+ "not-found-text": p.value ? null : void 0
567
+ }), {
568
+ default: C(() => [
569
+ M(s.$slots, "dropdown", { list: u.value }, () => [
570
+ (D(!0), j(X, null, _(u.value, (h, n) => (D(), L(o(et), {
571
+ key: e.valueAsKey ? h[t.keyMap.value] : n,
572
+ value: h[t.keyMap.value],
573
+ label: t.formatLabel && t.formatLabel(h, n),
574
+ disabled: t.optionDisabled && t.optionDisabled(h, n),
575
+ tag: t.optionTag && t.optionTag(h, n)
576
+ }, {
577
+ default: C(() => [
578
+ M(s.$slots, "default", {
579
+ item: h,
580
+ index: n
581
+ }, () => [
582
+ H(z(h[t.keyMap.label]), 1)
583
+ ])
584
+ ]),
585
+ _: 2
586
+ }, 1032, ["value", "label", "disabled", "tag"]))), 128))
567
587
  ])
568
- ])) : ae(($(), U(o, G({
569
- key: 0,
570
- modelValue: n.value,
571
- "onUpdate:modelValue": B[0] || (B[0] = (V) => n.value = V),
572
- onOnOpenChange: c,
573
- onOnChange: T
574
- }, r.$attrs, {
575
- multiple: t.multiple,
576
- loading: g.value,
577
- "not-found-text": g.value ? null : void 0
578
- }), {
579
- default: D(() => [
580
- z(r.$slots, "dropdown", { list: i.value }, () => [
581
- ($(!0), N(Q, null, ee(i.value, (V, K) => ($(), U(h, {
582
- key: e.valueAsKey ? V[t.keyMap.value] : K,
583
- value: V[t.keyMap.value],
584
- label: t.formatLabel && t.formatLabel(V, K),
585
- disabled: t.optionDisabled && t.optionDisabled(V, K),
586
- tag: t.optionTag && t.optionTag(V, K)
587
- }, {
588
- default: D(() => [
589
- z(r.$slots, "default", {
590
- item: V,
591
- index: K
592
- }, () => [
593
- j(H(V[t.keyMap.label]), 1)
594
- ])
595
- ]),
596
- _: 2
597
- }, 1032, ["value", "label", "disabled", "tag"]))), 128))
598
- ])
599
- ]),
600
- _: 3
601
- }, 16, ["modelValue", "multiple", "loading", "not-found-text"])), [
602
- [y(Re), t.all, "all"]
603
- ]);
604
- };
588
+ ]),
589
+ _: 3
590
+ }, 16, ["modelValue", "multiple", "loading", "not-found-text"])), [
591
+ [o(Pe), t.all, "all"]
592
+ ]);
605
593
  }
606
- }), ke = {
594
+ }), ve = {
607
595
  list: null
608
- }, ne = Te({}), oe = {
596
+ }, ae = ze({}), le = {
609
597
  list: []
610
- }, ie = {
598
+ }, ne = {
611
599
  list: []
612
- }, Ce = {}, ct = {
600
+ }, ye = {}, Ct = {
613
601
  name: "CacheSelect",
614
602
  inheritAttrs: !1
615
- }, rt = /* @__PURE__ */ _({
616
- ...ct,
603
+ }, Bt = /* @__PURE__ */ Y({
604
+ ...Ct,
617
605
  props: {
618
606
  modelValue: [String, Array, Number],
619
607
  /**
@@ -625,298 +613,65 @@ const M = {
625
613
  }
626
614
  },
627
615
  emits: ["update:modelValue", "update:chosen", "update:list", "load", "change"],
628
- setup(t, { emit: k }) {
629
- const a = t, e = k, l = E(""), n = he("sel"), i = (p) => {
630
- e("update:modelValue", p), e("change", p);
631
- }, g = (p) => {
632
- q(() => {
633
- oe[a.cacheId] && (oe[a.cacheId].forEach((v) => {
634
- v.changeCode(v.code);
635
- }), oe[a.cacheId] = []), ie[a.cacheId] && (ie[a.cacheId].forEach((v) => {
636
- v !== n.value && v.$emit("update:list", v.codes);
637
- }), ie[a.cacheId] = []);
638
- }), e("load", p);
639
- }, d = () => l.value != null && l.value.toString().length > 0;
640
- return F(
616
+ setup(t, { emit: S }) {
617
+ const a = t, e = S, l = E(""), i = ce("sel"), u = (v) => {
618
+ e("update:modelValue", v), e("change", v);
619
+ }, p = (v) => {
620
+ G(() => {
621
+ le[a.cacheId] && (le[a.cacheId].forEach((b) => {
622
+ b.changeCode(b.code);
623
+ }), le[a.cacheId] = []), ne[a.cacheId] && (ne[a.cacheId].forEach((b) => {
624
+ b !== i.value && b.$emit("update:list", b.codes);
625
+ }), ne[a.cacheId] = []);
626
+ }), e("load", v);
627
+ }, c = () => l.value != null && l.value.toString().length > 0;
628
+ return I(
641
629
  () => a.modelValue,
642
- (p) => {
643
- l.value !== p && (l.value = p ?? "");
630
+ (v) => {
631
+ l.value !== v && (l.value = v ?? "");
644
632
  }
645
- ), ne[a.cacheId] || (ne[a.cacheId] = [], ke[a.cacheId] = null), me(() => {
646
- ne[a.cacheId].length && (n.value.loaded = !0), a.modelValue && (l.value = a.modelValue), ke[a.cacheId] ? (d() && (oe[a.cacheId] || (oe[a.cacheId] = []), oe[a.cacheId].push(n.value)), n.value.loaded = Ce[a.cacheId]) : ke[a.cacheId] = !0, ie[a.cacheId] || (ie[a.cacheId] = []), ie[a.cacheId].push(n.value), Ce[a.cacheId] || (Ce[a.cacheId] = d()), F(
647
- () => ne[a.cacheId],
648
- (p) => {
649
- p.length && (n.value.loaded = !0);
633
+ ), ae[a.cacheId] || (ae[a.cacheId] = [], ve[a.cacheId] = null), de(() => {
634
+ ae[a.cacheId].length && (i.value.loaded = !0), a.modelValue && (l.value = a.modelValue), ve[a.cacheId] ? (c() && (le[a.cacheId] || (le[a.cacheId] = []), le[a.cacheId].push(i.value)), i.value.loaded = ye[a.cacheId]) : ve[a.cacheId] = !0, ne[a.cacheId] || (ne[a.cacheId] = []), ne[a.cacheId].push(i.value), ye[a.cacheId] || (ye[a.cacheId] = c()), I(
635
+ () => ae[a.cacheId],
636
+ (v) => {
637
+ v.length && (i.value.loaded = !0);
650
638
  },
651
639
  {
652
640
  immediate: !0
653
641
  }
654
642
  );
655
- }), (p, v) => ($(), U(Me, G({
643
+ }), (v, b) => (D(), L(Ee, U({
656
644
  ref: "sel",
657
645
  modelValue: l.value,
658
- "onUpdate:modelValue": v[0] || (v[0] = (u) => l.value = u),
659
- list: y(ne)[t.cacheId],
646
+ "onUpdate:modelValue": b[0] || (b[0] = (d) => l.value = d),
647
+ list: o(ae)[t.cacheId],
660
648
  "onUpdate:list": [
661
- v[1] || (v[1] = (u) => y(ne)[t.cacheId] = u),
662
- v[3] || (v[3] = (u) => p.$emit("update:list", u))
649
+ b[1] || (b[1] = (d) => o(ae)[t.cacheId] = d),
650
+ b[3] || (b[3] = (d) => v.$emit("update:list", d))
663
651
  ],
664
- onLoad: g,
665
- onOnChange: i,
666
- "onUpdate:chosen": v[2] || (v[2] = (u) => p.$emit("update:chosen", u))
667
- }, p.$attrs, { cache: "" }), {
668
- default: D(({ item: u, index: x }) => [
669
- z(p.$slots, "default", {
670
- item: u,
671
- index: x
652
+ onLoad: p,
653
+ onOnChange: u,
654
+ "onUpdate:chosen": b[2] || (b[2] = (d) => v.$emit("update:chosen", d))
655
+ }, v.$attrs, { cache: "" }), {
656
+ default: C(({ item: d, index: T }) => [
657
+ M(v.$slots, "default", {
658
+ item: d,
659
+ index: T
672
660
  })
673
661
  ]),
674
- dropdown: D(({ list: u }) => [
675
- z(p.$slots, "dropdown", { list: u })
662
+ dropdown: C(({ list: d }) => [
663
+ M(v.$slots, "dropdown", { list: d })
676
664
  ]),
677
- text: D((u) => [
678
- z(p.$slots, "text", Be(De(u)))
665
+ text: C((d) => [
666
+ M(v.$slots, "text", Be(Ve(d)))
679
667
  ]),
680
668
  _: 3
681
669
  }, 16, ["modelValue", "list"]));
682
670
  }
683
- }), mt = {
684
- name: "CurdTable"
685
- }, ft = /* @__PURE__ */ _({
686
- ...mt,
687
- props: {
688
- modelValue: {
689
- type: Array,
690
- default: () => []
691
- },
692
- /**
693
- * iview Table columns
694
- */
695
- columns: {
696
- type: Array,
697
- default: () => []
698
- },
699
- /**
700
- * 是否隐藏控制列
701
- */
702
- disabled: Boolean,
703
- /**
704
- * 可否增加数据,默认true
705
- */
706
- addable: {
707
- type: Boolean,
708
- default: !0
709
- },
710
- /**
711
- * 控制列宽度,默认90px
712
- */
713
- actionWidth: {
714
- type: Number,
715
- default: 90
716
- },
717
- /**
718
- * 控制列水平对齐,默认居中
719
- */
720
- actionAlign: {
721
- type: String,
722
- default: "center"
723
- },
724
- /**
725
- * 控制列是否固定
726
- */
727
- actionFixed: String,
728
- /**
729
- * 控制列表头文本
730
- */
731
- actionText: String,
732
- /**
733
- * 右侧控制列
734
- */
735
- actionCol: {
736
- type: Object,
737
- default(t) {
738
- return {
739
- // title: props.actionText,
740
- slot: "action",
741
- width: t.actionWidth,
742
- align: t.actionAlign,
743
- fixed: t.actionFixed
744
- };
745
- }
746
- },
747
- /**
748
- * 新增行时需要添加的数据
749
- */
750
- addRow: {
751
- type: Function,
752
- default: () => []
753
- },
754
- border: Boolean,
755
- size: String,
756
- /**
757
- * 返回Promise以决定何时新增数据
758
- */
759
- beforeAdd: Function,
760
- /**
761
- * 返回Promise以决定何时删除数据
762
- */
763
- beforeRemove: Function,
764
- addBtnType: {
765
- type: String,
766
- default: "dashed"
767
- },
768
- addBtnSize: String,
769
- addBtnGhost: {
770
- type: Boolean,
771
- default: !1
772
- },
773
- addBtnDisabled: {
774
- type: Boolean,
775
- default(t) {
776
- return !t.addable;
777
- }
778
- },
779
- addBtn: {
780
- type: Object,
781
- default: () => ({})
782
- },
783
- delBtnType: {
784
- type: String,
785
- default: "warning"
786
- },
787
- delBtnSize: {
788
- type: String,
789
- default: "small"
790
- },
791
- delBtnGhost: {
792
- type: Boolean,
793
- default: !0
794
- },
795
- delBtn: {
796
- type: Object,
797
- default: () => ({})
798
- },
799
- addText: String,
800
- /**
801
- * 是否隐藏每行的删除按钮,通过函数返回值决定
802
- */
803
- hideDelBtn: Function,
804
- /**
805
- * 是否禁用每行删除按钮,通过函数返回值决定
806
- */
807
- delBtnDisabled: {
808
- type: Function,
809
- default() {
810
- return !1;
811
- }
812
- }
813
- },
814
- emits: ["update:modelValue", "add", "remove", "change"],
815
- setup(t, { emit: k }) {
816
- const a = t, e = k, l = E(a.modelValue), n = L(
817
- () => a.disabled ? a.columns : a.columns.concat(
818
- Object.assign(
819
- {
820
- title: a.actionText ?? M.t("curdTable.actionText")
821
- },
822
- a.actionCol
823
- )
824
- )
825
- ), i = L(() => {
826
- const u = [], x = (s) => {
827
- s.slot && u.push(s), s.children && s.children.forEach((b) => {
828
- x(b);
829
- });
830
- };
831
- return a.columns.forEach((s) => {
832
- x(s);
833
- }), u;
834
- });
835
- function g() {
836
- typeof a.beforeAdd != "function" ? d() : a.beforeAdd().then(d).catch();
837
- }
838
- function d(u) {
839
- l.value.push(...a.addRow(u)), e("update:modelValue", l.value), e("add", l.value[l.value.length - 1]), e("change", !0);
840
- }
841
- function p(u) {
842
- typeof a.beforeRemove != "function" ? v(u) : a.beforeRemove(l.value[u], u).then(() => {
843
- v(u);
844
- });
845
- }
846
- function v(u) {
847
- const [x] = l.value.splice(u, 1);
848
- e("update:modelValue", l.value), e("remove", x), e("change", !1);
849
- }
850
- return F(
851
- () => a.modelValue,
852
- (u) => {
853
- l.value = u;
854
- }
855
- ), (u, x) => {
856
- const s = A("Button"), b = A("Table");
857
- return $(), N("div", null, [
858
- O(b, {
859
- border: t.border,
860
- columns: n.value,
861
- data: l.value,
862
- size: t.size,
863
- style: { "z-index": "0" }
864
- }, we({
865
- action: D(({ row: C, index: T }) => [
866
- z(u.$slots, "moreAction", {
867
- row: C,
868
- index: T
869
- }),
870
- !t.hideDelBtn || !t.hideDelBtn(C, T) ? ($(), U(s, G({
871
- key: 0,
872
- type: t.delBtnType,
873
- size: t.delBtnSize,
874
- ghost: t.delBtnGhost
875
- }, t.delBtn, {
876
- disabled: t.delBtnDisabled(C, T),
877
- onClick: (c) => p(T)
878
- }), {
879
- default: D(() => [
880
- j(H(y(M).t("curdTable.del")), 1)
881
- ]),
882
- _: 1
883
- }, 16, ["type", "size", "ghost", "disabled", "onClick"])) : W("", !0)
884
- ]),
885
- _: 2
886
- }, [
887
- ee(i.value, (C) => ({
888
- name: C.slot,
889
- fn: D((T) => [
890
- z(u.$slots, C.slot, Be(De(T)))
891
- ])
892
- }))
893
- ]), 1032, ["border", "columns", "data", "size"]),
894
- t.disabled ? W("", !0) : ae(($(), U(s, G({
895
- key: 0,
896
- type: t.addBtnType,
897
- size: t.addBtnSize,
898
- ghost: t.addBtnGhost,
899
- disabled: t.addBtnDisabled
900
- }, t.addBtn, {
901
- long: "",
902
- icon: "md-add",
903
- style: { display: "block", position: "relative", "margin-top": "-1px" },
904
- onClick: g
905
- }), {
906
- default: D(() => [
907
- j(H(t.addText ?? y(M).t("curdTable.addText")), 1)
908
- ]),
909
- _: 1
910
- }, 16, ["type", "size", "ghost", "disabled"])), [
911
- [ue, t.addable]
912
- ])
913
- ]);
914
- };
915
- }
916
- }), gt = {
671
+ }), Vt = {
917
672
  name: "DateRange"
918
- }, ht = /* @__PURE__ */ _({
919
- ...gt,
673
+ }, Dt = /* @__PURE__ */ Y({
674
+ ...Vt,
920
675
  props: {
921
676
  /**
922
677
  * 双向绑定开始时间
@@ -1000,73 +755,70 @@ const M = {
1000
755
  format: String
1001
756
  },
1002
757
  emits: ["update:begin", "update:end", "change-begin", "change-end", "change"],
1003
- setup(t, { emit: k }) {
1004
- const a = ve().appContext.config.globalProperties.$Date, e = {
758
+ setup(t, { emit: S }) {
759
+ const a = me().appContext.config.globalProperties.$Date, e = {
1005
760
  date: "day",
1006
761
  month: "month",
1007
762
  year: "year",
1008
763
  datetime: "day"
1009
- }, l = t, n = k, i = E(l.begin), g = E(l.end), d = L(() => ({
764
+ }, l = t, i = S, u = E(l.begin), p = E(l.end), c = N(() => ({
1010
765
  options: l.limitBegin ? {
1011
- disabledDate: (C) => C && a(C).isBefore(Date.now(), e[l.type])
766
+ disabledDate: (B) => B && a(B).isBefore(Date.now(), e[l.type])
1012
767
  // date.valueOf() < Date.now() - (props.disableToday ? 0 : 86400000)
1013
768
  } : void 0,
1014
769
  disabled: l.disabled || l.beginDisabled,
1015
- placeholder: l.beginHolder ?? M.t("dateRange.beginHolder"),
770
+ placeholder: l.beginHolder ?? w.t("dateRange.beginHolder"),
1016
771
  class: l.beginClass,
1017
772
  clearable: l.clearable,
1018
773
  transfer: l.transfer,
1019
774
  format: l.format,
1020
775
  ...l.beginAttr
1021
- })), p = L(() => ({
776
+ })), v = N(() => ({
1022
777
  options: {
1023
- disabledDate: (C) => i.value && C && a(C).isBefore(i.value, e[l.type])
778
+ disabledDate: (B) => u.value && B && a(B).isBefore(u.value, e[l.type])
1024
779
  },
1025
780
  disabled: l.disabled || l.endDisabled,
1026
- placeholder: l.endHolder ?? M.t("dateRange.endHolder"),
781
+ placeholder: l.endHolder ?? w.t("dateRange.endHolder"),
1027
782
  class: l.endClass,
1028
783
  clearable: l.clearable,
1029
784
  transfer: l.transfer,
1030
785
  format: l.format,
1031
786
  ...l.endAttr
1032
- })), v = () => {
1033
- n("update:begin", i.value), n("update:end", g.value);
1034
- }, u = (C) => {
1035
- i.value > g.value && (g.value = l.autoNext ? a(i.value).add(1, e[l.type]).toDate() : ""), v(), n("change-begin", C), n("change", i.value, g.value, !1);
1036
- }, x = (C) => {
1037
- l.type === "datetime" && C && a(C).isBefore(i.value) && (g.value = a(i.value).add(1, "hour").toDate(), C = a(g.value).format("YYYY-MM-DD HH:mm:ss")), v(), n("change-end", C), n("change", i.value, g.value, !0);
1038
- }, s = (C) => {
1039
- i.value !== C && (i.value = C || "");
1040
- }, b = (C) => {
1041
- g.value !== C && (g.value = C || "");
1042
- };
1043
- return F(() => l.begin, s), F(() => l.end, b), (C, T) => {
1044
- const c = A("DatePicker");
1045
- return $(), N("div", {
1046
- class: P(y(I)("date-range"))
1047
- }, [
1048
- O(c, G({
1049
- modelValue: i.value,
1050
- "onUpdate:modelValue": T[0] || (T[0] = (S) => i.value = S),
1051
- onOnChange: u
1052
- }, d.value, { type: t.type }), null, 16, ["modelValue", "type"]),
1053
- ae(te("span", {
1054
- class: P([y(I)("date-range-joiner"), t.joinerClass])
1055
- }, null, 2), [
1056
- [ue, !t.hideJoiner]
1057
- ]),
1058
- O(c, G({
1059
- modelValue: g.value,
1060
- "onUpdate:modelValue": T[1] || (T[1] = (S) => g.value = S),
1061
- onOnChange: x
1062
- }, p.value, { type: t.type }), null, 16, ["modelValue", "type"])
1063
- ], 2);
787
+ })), b = () => {
788
+ i("update:begin", u.value), i("update:end", p.value);
789
+ }, d = (B) => {
790
+ u.value > p.value && (p.value = l.autoNext ? a(u.value).add(1, e[l.type]).toDate() : ""), b(), i("change-begin", B), i("change", u.value, p.value, !1);
791
+ }, T = (B) => {
792
+ l.type === "datetime" && B && a(B).isBefore(u.value) && (p.value = a(u.value).add(1, "hour").toDate(), B = a(p.value).format("YYYY-MM-DD HH:mm:ss")), b(), i("change-end", B), i("change", u.value, p.value, !0);
793
+ }, r = (B) => {
794
+ u.value !== B && (u.value = B || "");
795
+ }, y = (B) => {
796
+ p.value !== B && (p.value = B || "");
1064
797
  };
798
+ return I(() => l.begin, r), I(() => l.end, y), (B, P) => (D(), j("div", {
799
+ class: F(o(R)("date-range"))
800
+ }, [
801
+ $(o(ke), U({
802
+ modelValue: u.value,
803
+ "onUpdate:modelValue": P[0] || (P[0] = (f) => u.value = f),
804
+ onOnChange: d
805
+ }, c.value, { type: t.type }), null, 16, ["modelValue", "type"]),
806
+ te(ee("span", {
807
+ class: F([o(R)("date-range-joiner"), t.joinerClass])
808
+ }, null, 2), [
809
+ [ue, !t.hideJoiner]
810
+ ]),
811
+ $(o(ke), U({
812
+ modelValue: p.value,
813
+ "onUpdate:modelValue": P[1] || (P[1] = (f) => p.value = f),
814
+ onOnChange: T
815
+ }, v.value, { type: t.type }), null, 16, ["modelValue", "type"])
816
+ ], 2));
1065
817
  }
1066
- }), pt = {
818
+ }), Ot = {
1067
819
  name: "DateRangePicker"
1068
- }, vt = /* @__PURE__ */ _({
1069
- ...pt,
820
+ }, xt = /* @__PURE__ */ Y({
821
+ ...Ot,
1070
822
  props: {
1071
823
  /**
1072
824
  * 双向绑定开始时间
@@ -1122,44 +874,272 @@ const M = {
1122
874
  }
1123
875
  },
1124
876
  emits: ["update:begin", "update:end", "change"],
1125
- setup(t, { emit: k }) {
1126
- const a = ve().appContext.config.globalProperties.$Date, e = t, l = k, n = L(
877
+ setup(t, { emit: S }) {
878
+ const a = me().appContext.config.globalProperties.$Date, e = t, l = S, i = N(
1127
879
  () => e.options || (e.limitBegin ? {
1128
- disabledDate: (d) => d && d.valueOf() < Date.now() - (e.disableToday ? 0 : 864e5)
1129
- } : null)
1130
- ), i = L({
880
+ disabledDate: (c) => c && c.valueOf() < Date.now() - (e.disableToday ? 0 : 864e5)
881
+ } : void 0)
882
+ ), u = N({
1131
883
  get() {
1132
- const d = e.begin, p = e.end;
1133
- return d && p ? [a(d).toDate(), a(p).toDate()] : [];
884
+ const c = e.begin, v = e.end;
885
+ return c && v ? [a(c).toDate(), a(v).toDate()] : [];
1134
886
  },
1135
- set(d) {
1136
- let p, v;
1137
- d[0] && d[1] ? (p = a(d[0]).format(e.valueFormat), v = a(d[1]).format(e.valueFormat)) : p = v = "", l("update:begin", p), l("update:end", v);
887
+ set(c) {
888
+ let v, b;
889
+ c[0] && c[1] ? (v = a(c[0]).format(e.valueFormat), b = a(c[1]).format(e.valueFormat)) : v = b = "", l("update:begin", v), l("update:end", b);
1138
890
  }
1139
- }), g = (d, p) => {
1140
- l("change", d, p);
1141
- };
1142
- return (d, p) => {
1143
- const v = A("DatePicker");
1144
- return $(), U(v, {
1145
- modelValue: i.value,
1146
- "onUpdate:modelValue": p[0] || (p[0] = (u) => i.value = u),
1147
- type: t.type,
1148
- clearable: t.clearable,
1149
- "split-panels": t.splitPanels,
1150
- options: n.value,
1151
- transfer: t.transfer,
1152
- placeholder: t.placeholder,
1153
- disabled: t.disabled,
1154
- placement: t.placement,
1155
- onOnChange: g
1156
- }, null, 8, ["modelValue", "type", "clearable", "split-panels", "options", "transfer", "placeholder", "disabled", "placement"]);
891
+ }), p = (c, v) => {
892
+ l("change", c, v);
1157
893
  };
894
+ return (c, v) => (D(), L(o(ke), {
895
+ modelValue: u.value,
896
+ "onUpdate:modelValue": v[0] || (v[0] = (b) => u.value = b),
897
+ type: t.type,
898
+ clearable: t.clearable,
899
+ "split-panels": t.splitPanels,
900
+ options: i.value,
901
+ transfer: t.transfer,
902
+ placeholder: t.placeholder,
903
+ disabled: t.disabled,
904
+ placement: t.placement,
905
+ onOnChange: p
906
+ }, null, 8, ["modelValue", "type", "clearable", "split-panels", "options", "transfer", "placeholder", "disabled", "placement", "onOnChange"]));
907
+ }
908
+ }), $t = {
909
+ name: "CurdTable"
910
+ }, Tt = /* @__PURE__ */ Y({
911
+ ...$t,
912
+ props: {
913
+ modelValue: {
914
+ type: Array,
915
+ default: () => []
916
+ },
917
+ /**
918
+ * iview Table columns
919
+ */
920
+ columns: {
921
+ type: Array,
922
+ default: () => []
923
+ },
924
+ /**
925
+ * 是否隐藏控制列
926
+ */
927
+ disabled: Boolean,
928
+ /**
929
+ * 可否增加数据,默认true
930
+ */
931
+ addable: {
932
+ type: Boolean,
933
+ default: !0
934
+ },
935
+ /**
936
+ * 控制列宽度,默认90px
937
+ */
938
+ actionWidth: {
939
+ type: Number,
940
+ default: 90
941
+ },
942
+ /**
943
+ * 控制列水平对齐,默认居中
944
+ */
945
+ actionAlign: {
946
+ type: String,
947
+ default: "center"
948
+ },
949
+ /**
950
+ * 控制列是否固定
951
+ */
952
+ actionFixed: String,
953
+ /**
954
+ * 控制列表头文本
955
+ */
956
+ actionText: String,
957
+ /**
958
+ * 右侧控制列
959
+ */
960
+ actionCol: {
961
+ type: Object,
962
+ default(t) {
963
+ return {
964
+ // title: props.actionText,
965
+ key: "_action",
966
+ slot: "action",
967
+ width: t.actionWidth,
968
+ align: t.actionAlign,
969
+ fixed: t.actionFixed
970
+ };
971
+ }
972
+ },
973
+ /**
974
+ * 新增行时需要添加的数据
975
+ */
976
+ addRow: {
977
+ type: Function,
978
+ default: () => []
979
+ },
980
+ border: Boolean,
981
+ size: String,
982
+ /**
983
+ * 返回Promise以决定何时新增数据
984
+ */
985
+ beforeAdd: Function,
986
+ /**
987
+ * 返回Promise以决定何时删除数据
988
+ */
989
+ beforeRemove: Function,
990
+ addBtnType: {
991
+ type: String,
992
+ default: "dashed"
993
+ },
994
+ addBtnSize: String,
995
+ addBtnGhost: {
996
+ type: Boolean,
997
+ default: !1
998
+ },
999
+ addBtnDisabled: {
1000
+ type: Boolean,
1001
+ default(t) {
1002
+ return !t.addable;
1003
+ }
1004
+ },
1005
+ addBtn: {
1006
+ type: Object,
1007
+ default: () => ({})
1008
+ },
1009
+ delBtnType: {
1010
+ type: String,
1011
+ default: "warning"
1012
+ },
1013
+ delBtnSize: {
1014
+ type: String,
1015
+ default: "small"
1016
+ },
1017
+ delBtnGhost: {
1018
+ type: Boolean,
1019
+ default: !0
1020
+ },
1021
+ delBtn: {
1022
+ type: Object,
1023
+ default: () => ({})
1024
+ },
1025
+ addText: String,
1026
+ /**
1027
+ * 是否隐藏每行的删除按钮,通过函数返回值决定
1028
+ */
1029
+ hideDelBtn: Function,
1030
+ /**
1031
+ * 是否禁用每行删除按钮,通过函数返回值决定
1032
+ */
1033
+ delBtnDisabled: {
1034
+ type: Function,
1035
+ default() {
1036
+ return !1;
1037
+ }
1038
+ }
1039
+ },
1040
+ emits: ["update:modelValue", "add", "remove", "change"],
1041
+ setup(t, { emit: S }) {
1042
+ const a = t, e = S, l = E(a.modelValue), i = N(
1043
+ () => a.disabled ? a.columns : a.columns.concat(
1044
+ Object.assign(
1045
+ {
1046
+ title: a.actionText ?? w.t("curdTable.actionText")
1047
+ },
1048
+ a.actionCol
1049
+ )
1050
+ )
1051
+ ), u = N(() => {
1052
+ const d = [], T = (r) => {
1053
+ r.slot && d.push(r), r.children && r.children.forEach((y) => {
1054
+ T(y);
1055
+ });
1056
+ };
1057
+ return a.columns.forEach((r) => {
1058
+ T(r);
1059
+ }), d;
1060
+ });
1061
+ function p() {
1062
+ typeof a.beforeAdd != "function" ? c() : a.beforeAdd().then(c).catch();
1063
+ }
1064
+ function c(d) {
1065
+ l.value.push(...a.addRow(d)), e("update:modelValue", l.value), e("add", l.value[l.value.length - 1]), e("change", !0);
1066
+ }
1067
+ function v(d) {
1068
+ typeof a.beforeRemove != "function" ? b(d) : a.beforeRemove(l.value[d], d).then(() => {
1069
+ b(d);
1070
+ });
1071
+ }
1072
+ function b(d) {
1073
+ const [T] = l.value.splice(d, 1);
1074
+ e("update:modelValue", l.value), e("remove", T), e("change", !1);
1075
+ }
1076
+ return I(
1077
+ () => a.modelValue,
1078
+ (d) => {
1079
+ l.value = d;
1080
+ }
1081
+ ), (d, T) => (D(), j("div", null, [
1082
+ $(o(je), U(o(Ne)(d.$attrs, ["id", "class", "style"]), {
1083
+ border: t.border,
1084
+ columns: i.value,
1085
+ data: l.value,
1086
+ size: t.size,
1087
+ style: { "z-index": "0" }
1088
+ }), Fe({
1089
+ action: C(({ row: r, index: y }) => [
1090
+ M(d.$slots, "moreAction", {
1091
+ row: r,
1092
+ index: y
1093
+ }),
1094
+ !t.hideDelBtn || !t.hideDelBtn(r, y) ? (D(), L(o(Z), U({
1095
+ key: 0,
1096
+ type: t.delBtnType,
1097
+ size: t.delBtnSize,
1098
+ ghost: t.delBtnGhost
1099
+ }, t.delBtn, {
1100
+ disabled: t.delBtnDisabled(r, y),
1101
+ onClick: (B) => v(y)
1102
+ }), {
1103
+ default: C(() => [
1104
+ H(z(o(w).t("curdTable.del")), 1)
1105
+ ]),
1106
+ _: 1
1107
+ }, 16, ["type", "size", "ghost", "disabled", "onClick"])) : q("", !0)
1108
+ ]),
1109
+ _: 2
1110
+ }, [
1111
+ _(u.value, (r) => ({
1112
+ name: r.slot,
1113
+ fn: C((y) => [
1114
+ M(d.$slots, r.slot, Be(Ve(y)))
1115
+ ])
1116
+ }))
1117
+ ]), 1040, ["border", "columns", "data", "size"]),
1118
+ t.disabled ? q("", !0) : te((D(), L(o(Z), U({
1119
+ key: 0,
1120
+ type: t.addBtnType,
1121
+ size: t.addBtnSize,
1122
+ ghost: t.addBtnGhost,
1123
+ disabled: t.addBtnDisabled
1124
+ }, t.addBtn, {
1125
+ long: "",
1126
+ icon: "md-add",
1127
+ style: { display: "block", position: "relative", "margin-top": "-1px" },
1128
+ onClick: p
1129
+ }), {
1130
+ default: C(() => [
1131
+ H(z(t.addText ?? o(w).t("curdTable.addText")), 1)
1132
+ ]),
1133
+ _: 1
1134
+ }, 16, ["type", "size", "ghost", "disabled"])), [
1135
+ [ue, t.addable]
1136
+ ])
1137
+ ]));
1158
1138
  }
1159
- }), bt = {
1139
+ }), At = {
1160
1140
  name: "MCalendar"
1161
- }, yt = /* @__PURE__ */ _({
1162
- ...bt,
1141
+ }, Rt = /* @__PURE__ */ Y({
1142
+ ...At,
1163
1143
  props: {
1164
1144
  /**
1165
1145
  * 指定日期,默认显示该日期所在月份
@@ -1265,193 +1245,190 @@ const M = {
1265
1245
  }
1266
1246
  },
1267
1247
  emits: ["update:range", "select-range", "click-day", "dblclick-day"],
1268
- setup(t, { emit: k }) {
1269
- const a = ve().appContext.config.globalProperties.$Date, e = t, l = k, n = E(), i = E(null), g = E(null), d = L(() => {
1270
- let c = Math.floor(e.startDay);
1271
- return (isNaN(c) || c < 0 || c > 6) && (c = 0), c;
1272
- }), p = L(() => {
1273
- let c;
1274
- const S = [], r = d.value + 7;
1275
- for (let B = d.value; B < r; B++)
1276
- c = B % 7, S.push({
1277
- title: e.weekMap?.[c] || M.t(`mCalendar.${e.weekType}.${c}`),
1278
- order: c
1248
+ setup(t, { emit: S }) {
1249
+ const a = me().appContext.config.globalProperties.$Date, e = t, l = S, i = E(), u = E(null), p = E(null), c = N(() => {
1250
+ let f = Math.floor(e.startDay);
1251
+ return (isNaN(f) || f < 0 || f > 6) && (f = 0), f;
1252
+ }), v = N(() => {
1253
+ let f;
1254
+ const V = [], s = c.value + 7;
1255
+ for (let k = c.value; k < s; k++)
1256
+ f = k % 7, V.push({
1257
+ title: e.weekMap?.[f] || w.t(`mCalendar.${e.weekType}.${f}`),
1258
+ order: f
1279
1259
  });
1280
- return S;
1281
- }), v = (c) => {
1282
- let S = a(
1260
+ return V;
1261
+ }), b = (f) => {
1262
+ let V = a(
1283
1263
  e.date || e.dates && e.dates[0] && e.dates[0][e.dateKey]
1284
- ), r, B, h;
1285
- return e.isOnFirstLine ? r = S : (r = S.startOf("month"), B = S.endOf("month")), h = r.day(), d.value !== 0 && h === 0 && (h = 7), S = r.subtract(h - d.value, "day"), e.isOnFirstLine && (B = S.add(41, "day")), {
1286
- beginDate: S.format("YYYY-MM-DD"),
1287
- endDate: B?.format("YYYY-MM-DD"),
1288
- extra: [S, e.isOnFirstLine ? S : r, B]
1264
+ ), s, k, h;
1265
+ return e.isOnFirstLine ? s = V : (s = V.startOf("month"), k = V.endOf("month")), h = s.day(), c.value !== 0 && h === 0 && (h = 7), V = s.subtract(h - c.value, "day"), e.isOnFirstLine && (k = V.add(41, "day")), {
1266
+ beginDate: V.format("YYYY-MM-DD"),
1267
+ endDate: k?.format("YYYY-MM-DD"),
1268
+ extra: [V, e.isOnFirstLine ? V : s, k]
1289
1269
  };
1290
- }, u = () => {
1291
- e.hasRange && (i.value = g.value = null);
1270
+ }, d = () => {
1271
+ e.hasRange && (u.value = p.value = null);
1292
1272
  const {
1293
- extra: [c, S, r]
1294
- } = v(), B = e.dates?.[0] ? e.dates.slice() : [], h = /* @__PURE__ */ new Date();
1295
- let o, V, K;
1296
- for (n.value = [], o = 0; o < 42; o++)
1297
- V = c.add(o, "day"), K = B.find((le) => V.isSame(le[e.dateKey], "day")), n.value.push({
1298
- _date: V.toDate(),
1299
- _text: V.format(e.textFormat),
1300
- _isOuter: V.isBefore(S, "day") || V.isAfter(r, "day"),
1273
+ extra: [f, V, s]
1274
+ } = b(), k = e.dates?.[0] ? e.dates.slice() : [], h = /* @__PURE__ */ new Date();
1275
+ let n, x, K;
1276
+ for (i.value = [], n = 0; n < 42; n++)
1277
+ x = f.add(n, "day"), K = k.find((W) => x.isSame(W[e.dateKey], "day")), i.value.push({
1278
+ _date: x.toDate(),
1279
+ _text: x.format(e.textFormat),
1280
+ _isOuter: x.isBefore(V, "day") || x.isAfter(s, "day"),
1301
1281
  //!eachDay.isBetween(start, end, 'day', '[]'),
1302
- _isToday: V.isSame(h, "day"),
1282
+ _isToday: x.isSame(h, "day"),
1303
1283
  // _rangeStart: undefined,
1304
1284
  // _rangeEnd: undefined,
1305
1285
  _inRange: void 0,
1306
1286
  ...K
1307
1287
  });
1308
1288
  };
1309
- let x;
1310
- const s = (c, S) => {
1311
- const r = e.hasRange && (!c._isOuter || e.outerInRange);
1312
- if (r)
1313
- if (!i.value)
1314
- i.value = c, c._inRange = !0;
1315
- else if (g.value)
1316
- i.value = g.value = null, n.value.forEach((B) => {
1317
- B._inRange = !1;
1318
- }), e.clearable || (i.value = c);
1289
+ let T;
1290
+ const r = (f, V) => {
1291
+ const s = e.hasRange && (!f._isOuter || e.outerInRange);
1292
+ if (s)
1293
+ if (!u.value)
1294
+ u.value = f, f._inRange = !0;
1295
+ else if (p.value)
1296
+ u.value = p.value = null, i.value.forEach((k) => {
1297
+ k._inRange = !1;
1298
+ }), e.clearable || (u.value = f);
1319
1299
  else {
1320
- if (c._date < i.value._date) {
1321
- const B = i.value;
1322
- i.value = c, c = B;
1300
+ if (f._date < u.value._date) {
1301
+ const k = u.value;
1302
+ u.value = f, f = k;
1323
1303
  }
1324
- g.value = c, c._inRange = !0;
1304
+ p.value = f, f._inRange = !0;
1325
1305
  }
1326
- l("click-day", c, S), r && (x = !0, q(() => {
1327
- x = null;
1328
- }), l("update:range", [i.value, g.value]), l(
1306
+ l("click-day", f, V), s && (T = !0, G(() => {
1307
+ T = null;
1308
+ }), l("update:range", [u.value, p.value]), l(
1329
1309
  "select-range",
1330
- [i.value, g.value],
1331
- n.value.slice(
1332
- n.value.indexOf(i.value),
1333
- n.value.indexOf(g.value) + 1
1310
+ [u.value, p.value],
1311
+ i.value.slice(
1312
+ i.value.indexOf(u.value),
1313
+ i.value.indexOf(p.value) + 1
1334
1314
  )
1335
1315
  ));
1336
- }, b = (c, S) => {
1337
- l("dblclick-day", c, S);
1338
- }, C = (c, S) => {
1339
- if (!e.hasRange || !i.value || g.value || c._isOuter && !e.outerInRange)
1316
+ }, y = (f, V) => {
1317
+ l("dblclick-day", f, V);
1318
+ }, B = (f, V) => {
1319
+ if (!e.hasRange || !u.value || p.value || f._isOuter && !e.outerInRange)
1340
1320
  return;
1341
- let r = n.value.indexOf(i.value);
1342
- if (S < r) {
1343
- const B = r;
1344
- r = S, S = B;
1321
+ let s = i.value.indexOf(u.value);
1322
+ if (V < s) {
1323
+ const k = s;
1324
+ s = V, V = k;
1345
1325
  }
1346
- n.value.forEach((B, h) => {
1347
- B._inRange = h >= r && h <= S;
1326
+ i.value.forEach((k, h) => {
1327
+ k._inRange = h >= s && h <= V;
1348
1328
  });
1349
- }, T = (c) => {
1350
- if (!e.hasRange || x) return;
1351
- if (!c || !c.length) {
1352
- i.value = g.value = null, n.value.forEach((o) => {
1353
- o._inRange = !1;
1329
+ }, P = (f) => {
1330
+ if (!e.hasRange || T) return;
1331
+ if (!f || !f.length) {
1332
+ u.value = p.value = null, i.value.forEach((n) => {
1333
+ n._inRange = !1;
1354
1334
  });
1355
1335
  return;
1356
1336
  }
1357
- if (!c[0] || !c[1]) return;
1358
- if (a(c[0]._date).isAfter(c[1]._date)) {
1359
- const o = c[1];
1360
- c[1] = c[0], c[0] = o;
1337
+ if (!f[0] || !f[1]) return;
1338
+ if (a(f[0]._date).isAfter(f[1]._date)) {
1339
+ const n = f[1];
1340
+ f[1] = f[0], f[0] = n;
1361
1341
  }
1362
- const S = n.value.length;
1363
- let r, B = -1, h = S;
1364
- for (let o = 0; o < S; o++)
1365
- if (r = a(n.value[o]._date), B < 0 && r.isSame(c[0]._date, "day") && (i.value = n.value[o], B = o), r.isSame(c[1]._date, "day")) {
1366
- g.value = n.value[o], h = o;
1342
+ const V = i.value.length;
1343
+ let s, k = -1, h = V;
1344
+ for (let n = 0; n < V; n++)
1345
+ if (s = a(i.value[n]._date), k < 0 && s.isSame(f[0]._date, "day") && (u.value = i.value[n], k = n), s.isSame(f[1]._date, "day")) {
1346
+ p.value = i.value[n], h = n;
1367
1347
  break;
1368
1348
  }
1369
- n.value.forEach((o, V) => {
1370
- o._inRange = V >= B && V <= h;
1349
+ i.value.forEach((n, x) => {
1350
+ n._inRange = x >= k && x <= h;
1371
1351
  });
1372
1352
  };
1373
- return u(), e.range && (i.value = e.range[0], g.value = e.range[1], T(e.range)), F(
1353
+ return d(), e.range && (u.value = e.range[0], p.value = e.range[1], P(e.range)), I(
1374
1354
  () => e.date,
1375
- (c) => {
1376
- !e.dates && c instanceof Date && u();
1355
+ (f) => {
1356
+ !e.dates && f instanceof Date && d();
1377
1357
  }
1378
- ), F(
1358
+ ), I(
1379
1359
  () => e.dates,
1380
- (c) => {
1381
- c && u();
1360
+ (f) => {
1361
+ f && d();
1382
1362
  }
1383
- ), F(
1363
+ ), I(
1384
1364
  () => e.startDay,
1385
1365
  () => {
1386
- u();
1366
+ d();
1387
1367
  }
1388
- ), F(() => e.range, T), (c, S) => {
1389
- const r = A("Col"), B = A("Row"), h = A("Spin");
1390
- return $(), N("div", {
1391
- class: P(y(I)("mcalendar"))
1392
- }, [
1393
- O(B, null, {
1394
- default: D(() => [
1395
- ($(!0), N(Q, null, ee(p.value, (o, V) => ($(), U(r, {
1396
- key: V,
1397
- span: "4",
1398
- class: P([
1399
- y(I)("mcalendar-title"),
1400
- { weekend: t.offDay.includes(o.order) },
1401
- t.titleClass && t.titleClass(o, V)
1368
+ ), I(() => e.range, P), (f, V) => (D(), j("div", {
1369
+ class: F(o(R)("mcalendar"))
1370
+ }, [
1371
+ $(o(ge), null, {
1372
+ default: C(() => [
1373
+ (D(!0), j(X, null, _(v.value, (s, k) => (D(), L(o(ie), {
1374
+ key: k,
1375
+ span: "4",
1376
+ class: F([
1377
+ o(R)("mcalendar-title"),
1378
+ { weekend: t.offDay.includes(s.order) },
1379
+ t.titleClass && t.titleClass(s, k)
1380
+ ])
1381
+ }, {
1382
+ default: C(() => [
1383
+ H(z(s.title), 1)
1384
+ ]),
1385
+ _: 2
1386
+ }, 1032, ["class"]))), 128))
1387
+ ]),
1388
+ _: 1
1389
+ }),
1390
+ $(o(ge), null, {
1391
+ default: C(() => [
1392
+ (D(!0), j(X, null, _(i.value, (s, k) => (D(), L(o(ie), {
1393
+ key: k,
1394
+ span: "4",
1395
+ class: F([
1396
+ o(R)("mcalendar-cell"),
1397
+ s._isToday && o(R)("mcalendar-cell_today"),
1398
+ { outer: s._isOuter },
1399
+ { "range-start": s === u.value },
1400
+ { "in-range": s._inRange },
1401
+ { "range-end": s === p.value },
1402
+ t.dateClass && t.dateClass(s, k),
1403
+ s.className
1404
+ ]),
1405
+ onClick: (h) => r(s, k),
1406
+ onDblclick: (h) => y(s, k),
1407
+ onMouseenter: (h) => B(s, k)
1408
+ }, {
1409
+ default: C(() => [
1410
+ M(f.$slots, "cell", {
1411
+ day: s,
1412
+ index: k
1413
+ }, () => [
1414
+ H(z(s._text), 1)
1402
1415
  ])
1403
- }, {
1404
- default: D(() => [
1405
- j(H(o.title), 1)
1406
- ]),
1407
- _: 2
1408
- }, 1032, ["class"]))), 128))
1409
- ]),
1410
- _: 1
1411
- }),
1412
- O(B, null, {
1413
- default: D(() => [
1414
- ($(!0), N(Q, null, ee(n.value, (o, V) => ($(), U(r, {
1415
- key: V,
1416
- span: "4",
1417
- class: P([
1418
- y(I)("mcalendar-cell"),
1419
- o._isToday && y(I)("mcalendar-cell_today"),
1420
- { outer: o._isOuter },
1421
- { "range-start": o === i.value },
1422
- { "in-range": o._inRange },
1423
- { "range-end": o === g.value },
1424
- t.dateClass && t.dateClass(o, V),
1425
- o.className
1426
- ]),
1427
- onClick: (K) => s(o, V),
1428
- onDblclick: (K) => b(o, V),
1429
- onMouseenter: (K) => C(o, V)
1430
- }, {
1431
- default: D(() => [
1432
- z(c.$slots, "cell", {
1433
- day: o,
1434
- index: V
1435
- }, () => [
1436
- j(H(o._text), 1)
1437
- ])
1438
- ]),
1439
- _: 2
1440
- }, 1032, ["class", "onClick", "onDblclick", "onMouseenter"]))), 128))
1441
- ]),
1442
- _: 3
1443
- }),
1444
- ae(O(h, { fix: "" }, null, 512), [
1445
- [ue, t.loading]
1446
- ])
1447
- ], 2);
1448
- };
1416
+ ]),
1417
+ _: 2
1418
+ }, 1032, ["class", "onClick", "onDblclick", "onMouseenter"]))), 128))
1419
+ ]),
1420
+ _: 3
1421
+ }),
1422
+ te($(o(tt), { fix: "" }, null, 512), [
1423
+ [ue, t.loading]
1424
+ ])
1425
+ ], 2));
1449
1426
  }
1450
- }), kt = {
1451
- name: "ModalFooter",
1452
- inheritAttrs: !1
1453
- }, Ct = /* @__PURE__ */ _({
1454
- ...kt,
1427
+ }), wt = {
1428
+ name: "ModalFooter"
1429
+ // inheritAttrs: false
1430
+ }, Mt = /* @__PURE__ */ Y({
1431
+ ...wt,
1455
1432
  props: {
1456
1433
  modelValue: Boolean,
1457
1434
  /**
@@ -1506,90 +1483,87 @@ const M = {
1506
1483
  }
1507
1484
  },
1508
1485
  emits: ["update:modelValue", "ok", "cancel"],
1509
- setup(t, { emit: k }) {
1510
- const a = k, e = ve(), l = () => {
1486
+ setup(t, { emit: S }) {
1487
+ const a = S, e = me(), l = () => {
1511
1488
  e.vnode.props.onCancel ? a("cancel") : a("update:modelValue", !1);
1512
1489
  };
1513
- return (n, i) => {
1514
- const g = A("Col"), d = A("Button"), p = A("Row");
1515
- return $(), U(p, {
1516
- justify: "space-between",
1517
- align: "middle"
1518
- }, {
1519
- default: D(() => [
1520
- O(g, null, {
1521
- default: D(() => [
1522
- z(n.$slots, "other")
1523
- ]),
1524
- _: 3
1525
- }),
1526
- O(g, { class: "flex" }, {
1527
- default: D(() => [
1528
- t.rightCancel ? ($(), N(Q, { key: 1 }, [
1529
- t.hasOk ? ($(), U(d, G({
1530
- key: 0,
1531
- disabled: t.okDisabled,
1532
- loading: t.okLoading
1533
- }, t.ok, {
1534
- type: "primary",
1535
- onClick: i[1] || (i[1] = (v) => n.$emit("ok"))
1536
- }), {
1537
- default: D(() => [
1538
- j(H(t.okText ?? y(M).t("modalFooter.ok")), 1)
1539
- ]),
1540
- _: 1
1541
- }, 16, ["disabled", "loading"])) : W("", !0),
1542
- O(d, G({
1543
- disabled: t.cancelDisabled,
1544
- loading: t.cancelLoading,
1545
- type: t.cancelType
1546
- }, t.cancel, { onClick: l }), {
1547
- default: D(() => [
1548
- j(H(t.cancelText ?? y(M).t("modalFooter.cancel")), 1)
1549
- ]),
1550
- _: 1
1551
- }, 16, ["disabled", "loading", "type"])
1552
- ], 64)) : ($(), N(Q, { key: 0 }, [
1553
- O(d, G({
1554
- disabled: t.cancelDisabled,
1555
- loading: t.cancelLoading,
1556
- type: t.cancelType
1557
- }, t.cancel, { onClick: l }), {
1558
- default: D(() => [
1559
- j(H(t.cancelText ?? y(M).t("modalFooter.cancel")), 1)
1560
- ]),
1561
- _: 1
1562
- }, 16, ["disabled", "loading", "type"]),
1563
- t.hasOk ? ($(), U(d, G({
1564
- key: 0,
1565
- disabled: t.okDisabled,
1566
- loading: t.okLoading
1567
- }, t.ok, {
1568
- type: "primary",
1569
- onClick: i[0] || (i[0] = (v) => n.$emit("ok"))
1570
- }), {
1571
- default: D(() => [
1572
- j(H(t.okText ?? y(M).t("modalFooter.ok")), 1)
1573
- ]),
1574
- _: 1
1575
- }, 16, ["disabled", "loading"])) : W("", !0)
1576
- ], 64)),
1577
- z(n.$slots, "action")
1578
- ]),
1579
- _: 3
1580
- })
1581
- ]),
1582
- _: 3
1583
- });
1584
- };
1490
+ return (i, u) => (D(), L(o(ge), {
1491
+ justify: "space-between",
1492
+ align: "middle"
1493
+ }, {
1494
+ default: C(() => [
1495
+ $(o(ie), null, {
1496
+ default: C(() => [
1497
+ M(i.$slots, "other")
1498
+ ]),
1499
+ _: 3
1500
+ }),
1501
+ $(o(ie), null, {
1502
+ default: C(() => [
1503
+ t.rightCancel ? (D(), j(X, { key: 1 }, [
1504
+ t.hasOk ? (D(), L(o(Z), U({
1505
+ key: 0,
1506
+ disabled: t.okDisabled,
1507
+ loading: t.okLoading
1508
+ }, t.ok, {
1509
+ type: "primary",
1510
+ onClick: u[1] || (u[1] = (p) => i.$emit("ok"))
1511
+ }), {
1512
+ default: C(() => [
1513
+ H(z(t.okText ?? o(w).t("modalFooter.ok")), 1)
1514
+ ]),
1515
+ _: 1
1516
+ }, 16, ["disabled", "loading"])) : q("", !0),
1517
+ $(o(Z), U({
1518
+ disabled: t.cancelDisabled,
1519
+ loading: t.cancelLoading,
1520
+ type: t.cancelType
1521
+ }, t.cancel, { onClick: l }), {
1522
+ default: C(() => [
1523
+ H(z(t.cancelText ?? o(w).t("modalFooter.cancel")), 1)
1524
+ ]),
1525
+ _: 1
1526
+ }, 16, ["disabled", "loading", "type"])
1527
+ ], 64)) : (D(), j(X, { key: 0 }, [
1528
+ $(o(Z), U({
1529
+ disabled: t.cancelDisabled,
1530
+ loading: t.cancelLoading,
1531
+ type: t.cancelType
1532
+ }, t.cancel, { onClick: l }), {
1533
+ default: C(() => [
1534
+ H(z(t.cancelText ?? o(w).t("modalFooter.cancel")), 1)
1535
+ ]),
1536
+ _: 1
1537
+ }, 16, ["disabled", "loading", "type"]),
1538
+ t.hasOk ? (D(), L(o(Z), U({
1539
+ key: 0,
1540
+ disabled: t.okDisabled,
1541
+ loading: t.okLoading
1542
+ }, t.ok, {
1543
+ type: "primary",
1544
+ onClick: u[0] || (u[0] = (p) => i.$emit("ok"))
1545
+ }), {
1546
+ default: C(() => [
1547
+ H(z(t.okText ?? o(w).t("modalFooter.ok")), 1)
1548
+ ]),
1549
+ _: 1
1550
+ }, 16, ["disabled", "loading"])) : q("", !0)
1551
+ ], 64)),
1552
+ M(i.$slots, "action")
1553
+ ]),
1554
+ _: 3
1555
+ })
1556
+ ]),
1557
+ _: 3
1558
+ }));
1585
1559
  }
1586
- }), St = {
1560
+ }), It = {
1587
1561
  key: 0,
1588
1562
  class: "ivu-dropdown-item"
1589
- }, J = {}, Bt = {
1563
+ }, J = {}, zt = {
1590
1564
  name: "ToggleColumn"
1591
- }, ze = /* @__PURE__ */ _({
1592
- ...Bt,
1565
+ }, Le = /* @__PURE__ */ Y({
1566
+ ...zt,
1593
1567
  props: {
1594
1568
  modelValue: {
1595
1569
  type: Array
@@ -1617,175 +1591,212 @@ const M = {
1617
1591
  * @example
1618
1592
  * // 组件会尝试将显示状态读写至 localStorage.app.main.cols
1619
1593
  * storeAt='app.main.cols'
1594
+ *
1595
+ * 特殊情况:如读写至 localStorage.app.page1['part1.list'].cols
1596
+ * storeAt='app.page1.[part1.list].cols'
1620
1597
  */
1621
- storeAt: String
1598
+ storeAt: String,
1599
+ /**
1600
+ * 最小可见列数
1601
+ */
1602
+ minVisible: {
1603
+ type: Number,
1604
+ default: 1
1605
+ },
1606
+ /**
1607
+ * 切换列时是否实时读取本地存储
1608
+ *
1609
+ * 在启用storeAt时,默认只在初始化时从本地读取一次之前保存的状态 \
1610
+ * 若需要每次切换列时都实时从本地获取最新的数据,则可以开启此项 \
1611
+ * 一般在搭配其它逻辑共享同一数据结构时适用,如拖拽列宽后需要将列宽存至同一对象中以节省存储空间 \
1612
+ * 当在循环中使用(即存在cacheId)时,建议开启此项,否则可能会出现列显示异常的情况
1613
+ *
1614
+ * @default
1615
+ * !!props.storeAt && !!props.cacheId
1616
+ */
1617
+ realtime: {
1618
+ type: Boolean,
1619
+ default: (t) => !!t.storeAt && !!t.cacheId
1620
+ }
1622
1621
  },
1623
1622
  emits: ["update:modelValue", "change"],
1624
- setup(t, { emit: k }) {
1625
- const a = t, e = k;
1626
- let l, n, i;
1627
- const g = (h) => {
1623
+ setup(t, { emit: S }) {
1624
+ const a = t, e = S;
1625
+ let l, i, u;
1626
+ const p = (h) => {
1628
1627
  clearTimeout(l);
1629
- let o = localStorage.getItem(n);
1630
- o = o ? JSON.parse(o) : {}, h ? Je(o, qe(i, d)) : _e(o, i, d), l = setTimeout(() => {
1631
- l = null, localStorage.setItem(n, JSON.stringify(o));
1628
+ let n = localStorage.getItem(i);
1629
+ n = n ? JSON.parse(n) : {}, h ? ut(n, st(u, c)) : it(n, u, c), l = setTimeout(() => {
1630
+ l = null, localStorage.setItem(i, JSON.stringify(n));
1632
1631
  });
1633
1632
  };
1634
- let d;
1635
- a.storeAt && (n = a.storeAt.split(".")[0], i = a.storeAt.slice(n.length + 1), d = localStorage.getItem(n) && pe(JSON.parse(localStorage[n]), i), d || (d = {}, g(!0)));
1636
- const p = E(!1), v = Se([]), u = E([]), x = L(() => {
1637
- const h = u.value.filter((o) => o._switchable);
1638
- return h.some((o) => o._visible) && h.some((o) => !o._visible);
1639
- }), s = L({
1633
+ let c;
1634
+ a.storeAt && (i = a.storeAt.split(".")[0], u = a.storeAt.slice(i.length + 1), c = localStorage.getItem(i) && Q(JSON.parse(localStorage[i]), u), c || (c = {}, p(!0)));
1635
+ const v = E(!1), b = Ce([]), d = E([]), T = N(() => {
1636
+ const h = d.value.filter((n) => n._switchable);
1637
+ return h.some((n) => n._visible) && h.some((n) => !n._visible);
1638
+ }), r = N({
1640
1639
  get() {
1641
- const h = u.value.filter((o) => o._switchable);
1642
- return h.length > 0 && h.every((o) => o._visible);
1640
+ const h = d.value.filter((n) => n._switchable);
1641
+ return h.length > 0 && h.every((n) => n._visible);
1643
1642
  },
1644
1643
  set(h) {
1645
- u.value.forEach((o, V) => {
1646
- o._switchable && (v.value[V]._visible = o._visible = h);
1647
- }), a.storeAt && (u.value.forEach((o, V) => {
1648
- d[o.key] = o._visible;
1649
- }), g()), B(), e("change", v.value);
1644
+ if (h)
1645
+ d.value.forEach((n, x) => {
1646
+ if (n._switchable) {
1647
+ b.value[x]._visible = n._visible = h;
1648
+ return;
1649
+ }
1650
+ n._switchable = n.initSwitchable;
1651
+ });
1652
+ else {
1653
+ const n = a.minVisible - d.value.filter((K) => !K._switchable).length;
1654
+ let x = 0;
1655
+ d.value.forEach((K, W) => {
1656
+ K._switchable && (b.value[W]._visible = K._visible = x < n, K._visible && (K._switchable = !1, x++));
1657
+ });
1658
+ }
1659
+ a.storeAt && (a.realtime && (c = Q(JSON.parse(localStorage[i]), u)), d.value.forEach((n, x) => {
1660
+ Me(c[n.key]) ? c[n.key].visible = n._visible : c[n.key] = { visible: n._visible };
1661
+ }), p()), k(), e("change", b.value);
1650
1662
  }
1651
1663
  });
1652
- function b() {
1653
- const h = u.value.filter((o) => o._visible);
1654
- if (!a.all && h.length === 1) {
1655
- h[0]._switchable = !1;
1664
+ function y() {
1665
+ const h = d.value.filter((n) => n._visible);
1666
+ if (h.length <= a.minVisible) {
1667
+ h.forEach((n) => {
1668
+ n._switchable = !1;
1669
+ });
1656
1670
  return;
1657
1671
  }
1658
- h.forEach((o) => {
1659
- o.initSwitchable && !o._switchable && (o._switchable = !0);
1672
+ h.forEach((n) => {
1673
+ n.initSwitchable && !n._switchable && (n._switchable = !0);
1660
1674
  });
1661
1675
  }
1662
- function C(h, o) {
1663
- v.value[o]._visible = h._visible, a.storeAt && (d[h.key] = h._visible, g()), B(), b(), e("change", v.value[o]);
1676
+ function B(h, n) {
1677
+ b.value[n]._visible = h._visible, a.storeAt && (a.realtime && (c = Q(JSON.parse(localStorage[i]), u)), Me(c[h.key]) ? c[h.key].visible = h._visible : c[h.key] = { visible: h._visible }, p()), k(), y(), e("change", b.value[n]);
1664
1678
  }
1665
- let T;
1666
- function c(h) {
1667
- clearTimeout(T), T = setTimeout(() => {
1668
- p.value = h, T = null;
1679
+ let P;
1680
+ function f(h) {
1681
+ clearTimeout(P), P = setTimeout(() => {
1682
+ v.value = h, P = null;
1669
1683
  }, 200);
1670
1684
  }
1671
- function S() {
1672
- (J[a.cacheId]?.cols || a.modelValue).forEach((h) => {
1673
- h.hasOwnProperty("_visible") || (a.storeAt ? h._visible = d[h.key] === void 0 || d[h.key] : h._visible = !0), h.hasOwnProperty("_switchable") || (h._switchable = !0), v.value.push(h), u.value.push({
1674
- title: h.title || "",
1675
- key: h.key,
1676
- initSwitchable: h._switchable,
1677
- _switchable: h._switchable,
1678
- _visible: h._visible
1685
+ function V(h) {
1686
+ !h && a.storeAt && a.realtime && (c = Q(JSON.parse(localStorage[i]), u)), (J[a.cacheId]?.cols || a.modelValue).forEach((n) => {
1687
+ n.hasOwnProperty("_visible") || (n._visible = a.storeAt ? c[n.key] == null || (c[n.key].visible ?? !0) : !0), n.hasOwnProperty("_switchable") || (n._switchable = !0), b.value.push(n), d.value.push({
1688
+ title: n.title || "",
1689
+ key: n.key,
1690
+ initSwitchable: n._switchable,
1691
+ _switchable: n._switchable,
1692
+ _visible: n._visible
1679
1693
  });
1680
- }), b(), B();
1694
+ }), y(), k();
1681
1695
  }
1682
- let r;
1683
- function B() {
1696
+ let s;
1697
+ function k() {
1684
1698
  a.cacheId != null && (J[a.cacheId].flag = !0, setTimeout(() => {
1685
1699
  J[a.cacheId].flag = null;
1686
- })), r = !0, setTimeout(() => {
1687
- r = null;
1700
+ })), s = !0, setTimeout(() => {
1701
+ s = null;
1688
1702
  }), e(
1689
1703
  "update:modelValue",
1690
- v.value.filter((h) => h._visible)
1704
+ b.value.filter((h) => h._visible)
1691
1705
  );
1692
1706
  }
1693
- return me(() => {
1694
- a.cacheId != null && (J[a.cacheId] ? J[a.cacheId].all++ : J[a.cacheId] = { cols: a.modelValue, all: 1 }, Ae(() => {
1707
+ return de(() => {
1708
+ a.cacheId != null && (J[a.cacheId] ? J[a.cacheId].all++ : J[a.cacheId] = { cols: a.modelValue, all: 1 }, He(() => {
1695
1709
  J[a.cacheId] && --J[a.cacheId].all < 1 && delete J[a.cacheId];
1696
- })), S();
1697
- }), F(
1710
+ })), V(!0);
1711
+ }), I(
1698
1712
  () => a.modelValue,
1699
1713
  (h) => {
1700
- r || (J[a.cacheId] && !J[a.cacheId].flag && (J[a.cacheId].cols = h), v.value = [], u.value = [], S());
1714
+ s || (J[a.cacheId] && !J[a.cacheId].flag && (J[a.cacheId].cols = h), b.value = [], d.value = [], V());
1701
1715
  }
1702
- ), (h, o) => {
1703
- const V = A("Icon"), K = A("Button"), le = A("Checkbox"), be = A("DropdownItem"), fe = A("DropdownMenu"), se = A("Dropdown");
1704
- return $(), U(se, {
1705
- trigger: "custom",
1706
- visible: p.value,
1707
- placement: "bottom-end",
1708
- transfer: t.transfer,
1709
- "transfer-class-name": y(I)("toggle-column-pop"),
1710
- class: P(y(I)("toggle-column"))
1711
- }, {
1712
- list: D(() => [
1713
- te("div", {
1714
- onMouseenter: o[3] || (o[3] = (Y) => c(!0)),
1715
- onMouseleave: o[4] || (o[4] = (Y) => c(!1))
1716
- }, [
1717
- t.all ? ($(), N("div", St, [
1718
- O(le, {
1719
- modelValue: s.value,
1720
- "onUpdate:modelValue": o[2] || (o[2] = (Y) => s.value = Y),
1721
- indeterminate: x.value
1722
- }, {
1723
- default: D(() => [
1724
- j(H(y(M).t("toggleColumn.checkAll")), 1)
1725
- ]),
1726
- _: 1
1727
- }, 8, ["modelValue", "indeterminate"])
1728
- ])) : W("", !0),
1729
- O(fe, {
1730
- class: P(y(I)("toggle-column-list"))
1716
+ ), (h, n) => (D(), L(o(at), {
1717
+ trigger: "custom",
1718
+ visible: v.value,
1719
+ placement: "bottom-end",
1720
+ transfer: t.transfer,
1721
+ "transfer-class-name": o(R)("toggle-column-pop"),
1722
+ class: F(o(R)("toggle-column"))
1723
+ }, {
1724
+ list: C(() => [
1725
+ ee("div", {
1726
+ onMouseenter: n[3] || (n[3] = (x) => f(!0)),
1727
+ onMouseleave: n[4] || (n[4] = (x) => f(!1))
1728
+ }, [
1729
+ t.all ? (D(), j("div", It, [
1730
+ $(o(oe), {
1731
+ modelValue: r.value,
1732
+ "onUpdate:modelValue": n[2] || (n[2] = (x) => r.value = x),
1733
+ indeterminate: T.value
1731
1734
  }, {
1732
- default: D(() => [
1733
- ($(!0), N(Q, null, ee(u.value, (Y, de) => ($(), U(be, {
1734
- key: de,
1735
- disabled: !Y._switchable
1736
- }, {
1737
- default: D(() => [
1738
- O(le, {
1739
- modelValue: Y._visible,
1740
- "onUpdate:modelValue": (ce) => Y._visible = ce,
1741
- disabled: !Y._switchable,
1742
- onOnChange: (ce) => C(Y, de)
1743
- }, {
1744
- default: D(() => [
1745
- j(H(Y.title), 1)
1746
- ]),
1747
- _: 2
1748
- }, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onOnChange"])
1749
- ]),
1750
- _: 2
1751
- }, 1032, ["disabled"]))), 128))
1735
+ default: C(() => [
1736
+ H(z(o(w).t("toggleColumn.checkAll")), 1)
1752
1737
  ]),
1753
1738
  _: 1
1754
- }, 8, ["class"])
1755
- ], 32)
1756
- ]),
1757
- default: D(() => [
1758
- te("span", {
1759
- onMouseover: o[0] || (o[0] = (Y) => c(!0)),
1760
- onMouseout: o[1] || (o[1] = (Y) => c(!1)),
1761
- class: P(y(I)("toggle-column-btn"))
1762
- }, [
1763
- z(h.$slots, "default", {}, () => [
1764
- O(K, {
1765
- type: "default",
1766
- icon: t.icon
1739
+ }, 8, ["modelValue", "indeterminate"])
1740
+ ])) : q("", !0),
1741
+ $(o(lt), {
1742
+ class: F(o(R)("toggle-column-list"))
1743
+ }, {
1744
+ default: C(() => [
1745
+ (D(!0), j(X, null, _(d.value, (x, K) => (D(), L(o(nt), {
1746
+ key: K,
1747
+ disabled: !x._switchable
1767
1748
  }, {
1768
- default: D(() => [
1769
- t.icon ? W("", !0) : ($(), N(Q, { key: 0 }, [
1770
- j(H(t.title ?? y(M).t("toggleColumn.title")) + " ", 1),
1771
- O(V, { type: "ios-arrow-down" })
1772
- ], 64))
1749
+ default: C(() => [
1750
+ $(o(oe), {
1751
+ modelValue: x._visible,
1752
+ "onUpdate:modelValue": (W) => x._visible = W,
1753
+ disabled: !x._switchable,
1754
+ onOnChange: (W) => B(x, K)
1755
+ }, {
1756
+ default: C(() => [
1757
+ H(z(x.title), 1)
1758
+ ]),
1759
+ _: 2
1760
+ }, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onOnChange"])
1773
1761
  ]),
1774
- _: 1
1775
- }, 8, ["icon"])
1776
- ])
1777
- ], 34)
1778
- ]),
1779
- _: 3
1780
- }, 8, ["visible", "transfer", "transfer-class-name", "class"]);
1781
- };
1762
+ _: 2
1763
+ }, 1032, ["disabled"]))), 128))
1764
+ ]),
1765
+ _: 1
1766
+ }, 8, ["class"])
1767
+ ], 32)
1768
+ ]),
1769
+ default: C(() => [
1770
+ ee("span", {
1771
+ onMouseover: n[0] || (n[0] = (x) => f(!0)),
1772
+ onMouseout: n[1] || (n[1] = (x) => f(!1)),
1773
+ class: F(o(R)("toggle-column-btn"))
1774
+ }, [
1775
+ M(h.$slots, "default", {}, () => [
1776
+ $(o(Z), {
1777
+ type: "default",
1778
+ icon: t.icon
1779
+ }, {
1780
+ default: C(() => [
1781
+ t.icon ? q("", !0) : (D(), j(X, { key: 0 }, [
1782
+ H(z(t.title ?? o(w).t("toggleColumn.title")) + " ", 1),
1783
+ $(o(fe), { type: "ios-arrow-down" })
1784
+ ], 64))
1785
+ ]),
1786
+ _: 1
1787
+ }, 8, ["icon"])
1788
+ ])
1789
+ ], 34)
1790
+ ]),
1791
+ _: 3
1792
+ }, 8, ["visible", "transfer", "transfer-class-name", "class"]));
1782
1793
  }
1783
- }), Dt = {
1794
+ }), Ft = {
1784
1795
  name: "PageTable"
1785
1796
  // inheritAttrs: false
1786
- }, Vt = /* @__PURE__ */ _({
1787
- ...Dt,
1788
- props: /* @__PURE__ */ xe({
1797
+ }, Ht = /* @__PURE__ */ Y({
1798
+ ...Ft,
1799
+ props: /* @__PURE__ */ Ae({
1789
1800
  columns: {
1790
1801
  type: Array,
1791
1802
  default: () => []
@@ -1957,14 +1968,14 @@ const M = {
1957
1968
  },
1958
1969
  loadingModifiers: {}
1959
1970
  }),
1960
- emits: /* @__PURE__ */ xe(["update:modelValue", "update:selection", "load", "select-all", "selection-change", "select", "reload", "change-col", "maximize-change"], ["update:loading"]),
1971
+ emits: /* @__PURE__ */ Ae(["update:modelValue", "update:selection", "load", "select-all", "selection-change", "select", "reload", "change-col", "maximize-change"], ["update:loading"]),
1961
1972
  setup(t, {
1962
- expose: k,
1973
+ expose: S,
1963
1974
  emit: a
1964
1975
  }) {
1965
1976
  const e = t, l = a;
1966
- let n, i;
1967
- const g = Ye(t, "loading"), d = he("tableRef"), p = he("elRef"), v = he("pageRef"), u = E(!1), x = Se(), s = Ge({
1977
+ let i, u;
1978
+ const p = We(t, "loading"), c = ce("tableRef"), v = ce("elRef"), b = ce("pageRef"), d = E(!1), T = Ce(), r = Xe({
1968
1979
  data: [],
1969
1980
  // rows: [] as Obj[],
1970
1981
  // selections: [],
@@ -1973,352 +1984,350 @@ const M = {
1973
1984
  maxHeight: e.maxHeight,
1974
1985
  selectType: {
1975
1986
  align: "center",
1976
- className: I("page-table-mr0"),
1977
- renderHeader: (m) => {
1978
- const f = s.data.filter((w) => w._checkable && !w._disabled), R = f.length;
1987
+ className: R("page-table-mr0"),
1988
+ renderHeader: (g) => {
1989
+ const m = r.data.filter((A) => A._checkable && !A._disabled), O = m.length;
1979
1990
  return (
1980
1991
  // table.rows.some((e) => e._checkable) && (
1981
- s.data.some((w) => w._checkable) && O($e, {
1982
- "model-value": !!R && f.every((w) => w._checked),
1983
- disabled: !R,
1984
- "onUpdate:model-value": (w) => {
1985
- f.forEach((X) => {
1986
- X._checked = w;
1992
+ r.data.some((A) => A._checkable) && $(oe, {
1993
+ "model-value": !!O && m.every((A) => A._checked),
1994
+ disabled: !O,
1995
+ "onUpdate:model-value": (A) => {
1996
+ m.forEach((se) => {
1997
+ se._checked = A;
1987
1998
  });
1988
1999
  },
1989
- onOnChange: (w) => {
1990
- se(), l("select-all", e.pure ? f.map((X) => ge(X)) : f, w);
2000
+ onOnChange: (A) => {
2001
+ he(), l("select-all", e.pure ? m.map((se) => re(se)) : m, A);
1991
2002
  }
1992
2003
  }, null)
1993
2004
  );
1994
2005
  },
1995
- render: (m, {
1996
- row: f,
1997
- index: R
1998
- }) => f._checkable && O($e, {
1999
- "model-value": f._checked,
2000
- disabled: f._disabled,
2001
- "onUpdate:model-value": (w) => {
2002
- He(s.data[R], w);
2006
+ render: (g, {
2007
+ row: m,
2008
+ index: O
2009
+ }) => m._checkable && $(oe, {
2010
+ "model-value": m._checked,
2011
+ disabled: m._disabled,
2012
+ "onUpdate:model-value": (A) => {
2013
+ Ye(r.data[O], A);
2003
2014
  }
2004
2015
  }, null)
2005
2016
  }
2006
- }), b = Te({
2017
+ }), y = ze({
2007
2018
  curr: 1,
2008
2019
  size: e.initSize || e.pageSizeOpts[0],
2009
2020
  total: 0
2010
- }), C = L(() => u.value ? !1 : e.transfer), T = L(() => {
2011
- const m = [], f = (R) => {
2012
- R.slot && m.push(R), R.children && R.children.forEach((w) => {
2013
- f(w);
2021
+ }), B = N(() => d.value ? !1 : e.transfer), P = N(() => {
2022
+ const g = [], m = (O) => {
2023
+ O.slot && g.push(O), O.children && O.children.forEach((A) => {
2024
+ m(A);
2014
2025
  });
2015
2026
  };
2016
- return e.columns.forEach((R) => {
2017
- f(R);
2018
- }), m;
2027
+ return e.columns.forEach((O) => {
2028
+ m(O);
2029
+ }), g;
2019
2030
  });
2020
- function c() {
2021
- const m = e.columns.find((f) => f.type === "selection");
2022
- if (m) {
2023
- const f = {
2031
+ function f() {
2032
+ const g = e.columns.find((m) => m.type === "selection");
2033
+ if (g) {
2034
+ const m = {
2024
2035
  // fixed: selectType.fixed,
2025
2036
  // key: selectType.key,
2026
- ...m,
2027
- width: m.width || 54,
2037
+ ...g,
2038
+ width: g.width || 54,
2028
2039
  type: void 0,
2029
- ...s.selectType
2040
+ ...r.selectType
2030
2041
  };
2031
- x.value = [f].concat(e.columns.slice(1));
2042
+ T.value = [m].concat(e.columns.slice(1));
2032
2043
  } else
2033
- x.value = e.columns;
2044
+ T.value = e.columns;
2034
2045
  }
2035
- let S, r, B = 0;
2046
+ let V, s, k = 0;
2036
2047
  async function h() {
2037
2048
  if (typeof e.method != "function") return console.warn("typeof method isn't function");
2038
- r && (B = (B + 1) % Number.MAX_SAFE_INTEGER);
2039
- const m = B;
2040
- r = !0, g.value = !0, l("update:selection", []);
2041
- const f = await e.method(Object.assign(Ve(), typeof e.param != "function" ? e.param : e.param()));
2042
- if (B !== m) return;
2043
- if (g.value = !1, r = null, !f) {
2044
- e.autoRemain || (b.total = 0, l("update:modelValue", []));
2049
+ s && (k = (k + 1) % Number.MAX_SAFE_INTEGER);
2050
+ const g = k;
2051
+ s = !0, p.value = !0, l("update:selection", []);
2052
+ const m = await e.method(Object.assign(Te(), typeof e.param != "function" ? e.param : e.param()));
2053
+ if (k !== g) return;
2054
+ if (p.value = !1, s = null, !m) {
2055
+ e.autoRemain || (y.total = 0, l("update:modelValue", []));
2045
2056
  return;
2046
2057
  }
2047
- let R = pe(f, e.dataKey) || [];
2048
- if (o(R), typeof e.process == "function") {
2049
- const w = e.process(R);
2050
- Array.isArray(w) && (R = w);
2058
+ let O = Q(m, e.dataKey) || [];
2059
+ if (n(O), typeof e.process == "function") {
2060
+ const A = e.process(O);
2061
+ Array.isArray(A) && (O = A);
2051
2062
  }
2052
- s.data = R, b.total = pe(f, e.totalKey) || 0, S = !0, l("update:modelValue", s.data), l("load", f), setTimeout(() => {
2053
- S = null;
2063
+ r.data = O, y.total = Q(m, e.totalKey) || 0, V = !0, l("update:modelValue", r.data), l("load", m), setTimeout(() => {
2064
+ V = null;
2054
2065
  });
2055
2066
  }
2056
- function o(m) {
2057
- e.columns.some((f) => f.type === "selection") && m.forEach((f) => {
2058
- f._checkable = !0, f._checked = f._disabled = !1;
2067
+ function n(g) {
2068
+ e.columns.some((m) => m.type === "selection") && g.forEach((m) => {
2069
+ m._checkable = !0, m._checked = m._disabled = !1;
2059
2070
  });
2060
2071
  }
2061
- function V(m) {
2062
- typeof e.check == "function" && !e.check() || (e.isLocal ? K(m) : h());
2072
+ function x(g) {
2073
+ typeof e.check == "function" && !e.check() || (e.isLocal ? K(g) : h());
2063
2074
  }
2064
- function K(m) {
2065
- let f = m ? b.size * (b.curr - 1) : 0;
2066
- const R = [], w = f + b.size, X = w > b.total ? b.total : w, re = e.modelValue;
2067
- for (; f < X; f++)
2068
- re[f]._checked = re[f]._disabled = !1, R.push(re[f]);
2069
- s.data = R, l("update:selection", []);
2075
+ function K(g) {
2076
+ let m = g ? y.size * (y.curr - 1) : 0;
2077
+ const O = [], A = m + y.size, se = A > y.total ? y.total : A, be = e.modelValue;
2078
+ for (; m < se; m++)
2079
+ be[m]._checked = be[m]._disabled = !1, O.push(be[m]);
2080
+ r.data = O, l("update:selection", []);
2070
2081
  }
2071
- function le() {
2072
- V(!0);
2082
+ function W() {
2083
+ x(!0);
2073
2084
  }
2074
- function be(m) {
2075
- b.size = m, b.curr === 1 && V();
2085
+ function Ke(g) {
2086
+ y.size = g, y.curr === 1 && x();
2076
2087
  }
2077
- function fe(m) {
2078
- m !== !0 && (b.curr = 1), q(h);
2088
+ function De(g) {
2089
+ g !== !0 && (y.curr = 1), G(h);
2079
2090
  }
2080
- function se(m, f) {
2081
- m && (m._checked = f);
2082
- let R = s.data.filter((w) => w._checked);
2083
- e.pure && (R = R.map((w) => ge(w))), l("update:selection", R), l("selection-change", R);
2091
+ function he(g, m) {
2092
+ g && (g._checked = m);
2093
+ let O = r.data.filter((A) => A._checked);
2094
+ e.pure && (O = O.map((A) => re(A))), l("update:selection", O), l("selection-change", O);
2084
2095
  }
2085
- function Y() {
2086
- return window.innerHeight - +e.bottomDis - d.value.$el.getBoundingClientRect().top - v.value.$el.offsetHeight;
2096
+ function Oe() {
2097
+ return window.innerHeight - +e.bottomDis - c.value.$el.getBoundingClientRect().top - b.value.$el.offsetHeight;
2087
2098
  }
2088
- function de(m) {
2089
- q(() => {
2090
- const f = Y();
2091
- s[m ? "height" : "maxHeight"] = f > 0 ? f : 0;
2099
+ function xe(g) {
2100
+ G(() => {
2101
+ const m = Oe();
2102
+ r[g ? "height" : "maxHeight"] = m > 0 ? m : 0;
2092
2103
  });
2093
2104
  }
2094
- function ce() {
2095
- (e.maximizeHeightType === "height" || e.maximizeHeightType === "maxHeight") && q(() => {
2096
- const m = Y();
2097
- s[e.maximizeHeightType] = m > 0 ? m : 0;
2105
+ function $e() {
2106
+ (e.maximizeHeightType === "height" || e.maximizeHeightType === "maxHeight") && G(() => {
2107
+ const g = Oe();
2108
+ r[e.maximizeHeightType] = g > 0 ? g : 0;
2098
2109
  });
2099
2110
  }
2100
- function Ve() {
2111
+ function Te() {
2101
2112
  return {
2102
- [e.pageMap.first]: e.usePageNum ? b.curr : b.size * (b.curr - 1),
2103
- [e.pageMap.pageSize]: b.size
2113
+ [e.pageMap.first]: e.usePageNum ? y.curr : y.size * (y.curr - 1),
2114
+ [e.pageMap.pageSize]: y.size
2104
2115
  };
2105
2116
  }
2106
- let ye;
2107
- function Fe(m, f) {
2108
- !e.clickToCheck || !m._checkable || m._disabled || (ye = !0, m = s.data[f], m._checked = !m._checked, se(m, m._checked), l("select", e.pure ? ge(m) : m, m._checked), setTimeout(() => {
2109
- ye = null;
2117
+ let pe;
2118
+ function Ue(g, m) {
2119
+ !e.clickToCheck || !g._checkable || g._disabled || (pe = !0, g = r.data[m], g._checked = !g._checked, he(g, g._checked), l("select", e.pure ? re(g) : g, g._checked), setTimeout(() => {
2120
+ pe = null;
2110
2121
  }));
2111
2122
  }
2112
- function He(m, f) {
2113
- ye || (se(m, f), l("select", e.pure ? ge(m) : m, f));
2123
+ function Ye(g, m) {
2124
+ pe || (he(g, m), l("select", e.pure ? re(g) : g, m));
2114
2125
  }
2115
- function ge(m) {
2116
- const f = {
2117
- ...m
2126
+ function re(g) {
2127
+ const m = {
2128
+ ...g
2118
2129
  };
2119
- return delete f._checkable, delete f._checked, delete f._disabled, f;
2130
+ return delete m._checkable, delete m._checked, delete m._disabled, m;
2120
2131
  }
2121
- function Pe() {
2132
+ function Je() {
2122
2133
  if (e.fullscreen) {
2123
- u.value ? document.exitFullscreen() : p.value.requestFullscreen();
2134
+ d.value ? document.exitFullscreen() : v.value.requestFullscreen();
2124
2135
  return;
2125
2136
  }
2126
- u.value = !u.value, u.value ? (ce(), document.body.classList.add("clip")) : (s.height = e.height ?? n, s.maxHeight = e.maxHeight ?? i, document.body.classList.remove("clip")), q(() => {
2127
- l("maximize-change", u.value);
2137
+ d.value = !d.value, d.value ? ($e(), document.body.classList.add("clip")) : (r.height = e.height ?? i, r.maxHeight = e.maxHeight ?? u, document.body.classList.remove("clip")), G(() => {
2138
+ l("maximize-change", d.value);
2128
2139
  });
2129
2140
  }
2130
- function je() {
2131
- g.value || (e.isLocal ? l("reload") : fe());
2141
+ function Ge() {
2142
+ p.value || (e.isLocal ? l("reload") : De());
2132
2143
  }
2133
- return k({
2134
- search: fe,
2135
- setMaxHeight: de,
2136
- table: s,
2137
- sizer: b,
2144
+ return S({
2145
+ search: De,
2146
+ setMaxHeight: xe,
2147
+ table: r,
2148
+ sizer: y,
2138
2149
  getPage: () => ({
2139
- ...Ve(),
2140
- curr: b.curr,
2141
- total: b.total
2150
+ ...Te(),
2151
+ curr: y.curr,
2152
+ total: y.total
2142
2153
  })
2143
- }), c(), me(() => {
2144
- !e.maxHeight && !e.height && (e.autoMaxHeight || e.autoHeight) && (de(e.autoHeight), q(() => {
2145
- i = s.maxHeight, n = s.height;
2146
- })), e.fullscreen && (p.value.onfullscreenchange = () => {
2147
- u.value = !!document.fullscreenElement, u.value ? setTimeout(ce) : (s.height = e.height ?? n, s.maxHeight = e.maxHeight ?? i), setTimeout(() => {
2148
- l("maximize-change", u.value);
2154
+ }), f(), de(() => {
2155
+ !e.maxHeight && !e.height && (e.autoMaxHeight || e.autoHeight) && (xe(e.autoHeight), G(() => {
2156
+ u = r.maxHeight, i = r.height;
2157
+ })), e.fullscreen && (v.value.onfullscreenchange = () => {
2158
+ d.value = !!document.fullscreenElement, d.value ? setTimeout($e) : (r.height = e.height ?? i, r.maxHeight = e.maxHeight ?? u), setTimeout(() => {
2159
+ l("maximize-change", d.value);
2149
2160
  });
2150
2161
  });
2151
- }), Ae(() => {
2152
- p.value.onfullscreenchange = null;
2153
- }), F(() => e.modelValue, (m) => {
2154
- const f = Array.isArray(m) ? m : [];
2162
+ }), He(() => {
2163
+ v.value.onfullscreenchange = null;
2164
+ }), I(() => e.modelValue, (g) => {
2165
+ const m = Array.isArray(g) ? g : [];
2155
2166
  if (e.isLocal) {
2156
- b.curr = 1, b.total = f.length, o(f), K();
2167
+ y.curr = 1, y.total = m.length, n(m), K();
2157
2168
  return;
2158
2169
  }
2159
- S || (b.curr = 1, b.total = f.length, s.data = f);
2170
+ V || (y.curr = 1, y.total = m.length, r.data = m);
2160
2171
  }, {
2161
2172
  immediate: !0
2162
- }), F(() => e.maxHeight, (m) => {
2163
- s.maxHeight = m;
2164
- }), F(() => e.height, (m) => {
2165
- s.height = m;
2166
- }), F(() => e.columns, () => {
2167
- c();
2168
- }), (m, f) => {
2169
- const R = A("Col"), w = A("Icon"), X = A("Tooltip"), re = A("Row"), Ne = A("Table"), Le = A("Page");
2170
- return $(), N("div", {
2171
- ref: "elRef",
2172
- class: P([
2173
- y(I)("page-table-container"),
2174
- // {
2175
- // 'page-table-bordered': border && showHeader,
2176
- // 'page-table-maximized': maximized,
2177
- // 'page-table-fullscreen': maximized && fullscreen
2178
- // }
2179
- t.border && t.showHeader && y(I)("page-table-bordered"),
2180
- u.value && y(I)("page-table-maximized"),
2181
- u.value && t.fullscreen && y(I)("page-table-fullscreen")
2182
- ])
2183
- }, [t.showHeader ? ($(), U(re, {
2184
- key: 0,
2185
- justify: "space-between",
2186
- align: "middle",
2187
- class: P(y(I)("page-table-header"))
2188
- }, {
2189
- default: D(() => [O(R, null, {
2190
- default: D(() => [z(m.$slots, "title", {}, () => [te("h1", {
2191
- class: P(y(I)("page-table-header-title"))
2192
- }, H(t.title ?? y(M).t("pageTable.title")), 3)])]),
2193
- _: 3
2194
- }), O(R, null, {
2195
- default: D(() => [z(m.$slots, "headerAction"), O(X, {
2196
- placement: "top",
2197
- content: y(M).t("pageTable.reload"),
2198
- transfer: C.value,
2199
- class: P(y(I)("page-table-action"))
2200
- }, {
2201
- default: D(() => [O(w, {
2202
- type: "md-refresh",
2203
- size: "20",
2204
- onClick: je
2205
- })]),
2206
- _: 1
2207
- }, 8, ["content", "transfer", "class"]), O(X, {
2208
- placement: "top",
2209
- content: y(M).t(`pageTable.${u.value ? "restore" : "maxmize"}`),
2210
- transfer: C.value,
2211
- class: P(y(I)("page-table-action"))
2212
- }, {
2213
- default: D(() => [O(w, {
2214
- type: u.value ? "md-contract" : "md-expand",
2215
- size: "20",
2216
- onClick: Pe
2217
- }, null, 8, ["type"])]),
2218
- _: 1
2219
- }, 8, ["content", "transfer", "class"]), O(ze, {
2220
- modelValue: x.value,
2221
- "onUpdate:modelValue": f[0] || (f[0] = (Z) => x.value = Z),
2173
+ }), I(() => e.maxHeight, (g) => {
2174
+ r.maxHeight = g;
2175
+ }), I(() => e.height, (g) => {
2176
+ r.height = g;
2177
+ }), I(() => e.columns, () => {
2178
+ f();
2179
+ }), (g, m) => (D(), j("div", {
2180
+ ref: "elRef",
2181
+ class: F([
2182
+ o(R)("page-table-container"),
2183
+ // {
2184
+ // 'page-table-bordered': border && showHeader,
2185
+ // 'page-table-maximized': maximized,
2186
+ // 'page-table-fullscreen': maximized && fullscreen
2187
+ // }
2188
+ t.border && t.showHeader && o(R)("page-table-bordered"),
2189
+ d.value && o(R)("page-table-maximized"),
2190
+ d.value && t.fullscreen && o(R)("page-table-fullscreen")
2191
+ ])
2192
+ }, [t.showHeader ? (D(), L(o(ge), {
2193
+ key: 0,
2194
+ justify: "space-between",
2195
+ align: "middle",
2196
+ class: F(o(R)("page-table-header"))
2197
+ }, {
2198
+ default: C(() => [$(o(ie), null, {
2199
+ default: C(() => [M(g.$slots, "title", {}, () => [ee("h1", {
2200
+ class: F(o(R)("page-table-header-title"))
2201
+ }, z(t.title ?? o(w).t("pageTable.title")), 3)])]),
2202
+ _: 3
2203
+ }), $(o(ie), null, {
2204
+ default: C(() => [M(g.$slots, "headerAction"), $(o(we), {
2205
+ placement: "top",
2206
+ content: o(w).t("pageTable.reload"),
2207
+ transfer: B.value,
2208
+ class: F(o(R)("page-table-action"))
2209
+ }, {
2210
+ default: C(() => [$(o(fe), {
2211
+ type: "md-refresh",
2222
2212
  size: "20",
2223
- transfer: C.value,
2224
- "store-at": t.storeAt,
2225
- onChange: f[1] || (f[1] = (Z) => m.$emit("change-col", Z))
2226
- }, {
2227
- default: D(() => [O(w, {
2228
- type: "md-settings",
2229
- size: "20"
2230
- })]),
2231
- _: 1
2232
- }, 8, ["modelValue", "transfer", "store-at"])]),
2233
- _: 3
2234
- })]),
2213
+ onClick: Ge
2214
+ })]),
2215
+ _: 1
2216
+ }, 8, ["content", "transfer", "class"]), $(o(we), {
2217
+ placement: "top",
2218
+ content: o(w).t(`pageTable.${d.value ? "restore" : "maxmize"}`),
2219
+ transfer: B.value,
2220
+ class: F(o(R)("page-table-action"))
2221
+ }, {
2222
+ default: C(() => [$(o(fe), {
2223
+ type: d.value ? "md-contract" : "md-expand",
2224
+ size: "20",
2225
+ onClick: Je
2226
+ }, null, 8, ["type"])]),
2227
+ _: 1
2228
+ }, 8, ["content", "transfer", "class"]), $(Le, {
2229
+ modelValue: T.value,
2230
+ "onUpdate:modelValue": m[0] || (m[0] = (O) => T.value = O),
2231
+ size: "20",
2232
+ transfer: B.value,
2233
+ "store-at": t.storeAt,
2234
+ onChange: m[1] || (m[1] = (O) => g.$emit("change-col", O))
2235
+ }, {
2236
+ default: C(() => [$(o(fe), {
2237
+ type: "md-settings",
2238
+ size: "20"
2239
+ })]),
2240
+ _: 1
2241
+ }, 8, ["modelValue", "transfer", "store-at"])]),
2235
2242
  _: 3
2236
- }, 8, ["class"])) : W("", !0), te("div", {
2237
- class: P([y(I)("page-table-list"), !y(b).total && !s.data.length && y(I)("page-table-list-empty")])
2238
- }, [O(Ne, G({
2239
- ref: "tableRef"
2240
- }, y(We)(m.$attrs, ["id", "class", "style"]), {
2241
- border: t.border,
2242
- columns: x.value,
2243
- data: s.data,
2244
- loading: g.value,
2245
- height: s.height,
2246
- "max-height": s.maxHeight,
2247
- onOnRowClick: Fe
2248
- }), we({
2249
- _: 2
2250
- }, [m.$slots.header ? {
2251
- name: "header",
2252
- fn: D(() => [z(m.$slots, "header")]),
2253
- key: "0"
2254
- } : void 0, ee(T.value, (Z) => ({
2255
- name: Z.slot,
2256
- fn: D((Ee) => [z(m.$slots, Z.slot, Be(De(Ee)))])
2257
- })), m.$slots.footer ? {
2258
- name: "footer",
2259
- fn: D(() => [z(m.$slots, "footer")]),
2260
- key: "1"
2261
- } : void 0]), 1040, ["border", "columns", "data", "loading", "height", "max-height"]), ae(O(Le, {
2262
- ref: "pageRef",
2263
- modelValue: y(b).curr,
2264
- "onUpdate:modelValue": f[2] || (f[2] = (Z) => y(b).curr = Z),
2265
- total: y(b).total,
2266
- "page-size": y(b).size,
2267
- "show-total": "",
2268
- "show-sizer": "",
2269
- "show-elevator": "",
2270
- transfer: C.value,
2271
- "page-size-opts": t.pageSizeOpts,
2272
- class: P(y(I)("page-table-paginator")),
2273
- onOnChange: le,
2274
- onOnPageSizeChange: be
2275
- }, null, 8, ["modelValue", "total", "page-size", "transfer", "page-size-opts", "class"]), [[ue, !t.hidePage]])], 2)], 2);
2276
- };
2243
+ })]),
2244
+ _: 3
2245
+ }, 8, ["class"])) : q("", !0), ee("div", {
2246
+ class: F([o(R)("page-table-list"), !o(y).total && !r.data.length && o(R)("page-table-list-empty")])
2247
+ }, [$(o(je), U({
2248
+ ref: "tableRef"
2249
+ }, o(Ne)(g.$attrs, ["id", "class", "style"]), {
2250
+ border: t.border,
2251
+ columns: T.value,
2252
+ data: r.data,
2253
+ loading: p.value,
2254
+ height: r.height,
2255
+ "max-height": r.maxHeight,
2256
+ onOnRowClick: Ue
2257
+ }), Fe({
2258
+ _: 2
2259
+ }, [g.$slots.header ? {
2260
+ name: "header",
2261
+ fn: C(() => [M(g.$slots, "header")]),
2262
+ key: "0"
2263
+ } : void 0, _(P.value, (O) => ({
2264
+ name: O.slot,
2265
+ fn: C((A) => [M(g.$slots, O.slot, Be(Ve(A)))])
2266
+ })), g.$slots.footer ? {
2267
+ name: "footer",
2268
+ fn: C(() => [M(g.$slots, "footer")]),
2269
+ key: "1"
2270
+ } : void 0]), 1040, ["border", "columns", "data", "loading", "height", "max-height", "onOnRowClick"]), te($(o(ot), {
2271
+ ref: "pageRef",
2272
+ modelValue: o(y).curr,
2273
+ "onUpdate:modelValue": m[2] || (m[2] = (O) => o(y).curr = O),
2274
+ total: o(y).total,
2275
+ "page-size": o(y).size,
2276
+ "show-total": "",
2277
+ "show-sizer": "",
2278
+ "show-elevator": "",
2279
+ transfer: B.value,
2280
+ "page-size-opts": t.pageSizeOpts,
2281
+ class: F(o(R)("page-table-paginator")),
2282
+ onOnChange: W,
2283
+ onOnPageSizeChange: Ke
2284
+ }, null, 8, ["modelValue", "total", "page-size", "transfer", "page-size-opts", "class"]), [[ue, !t.hidePage]])], 2)], 2));
2277
2285
  }
2278
- }), Oe = [
2279
- Qe,
2280
- tt,
2281
- ot,
2282
- ut,
2283
- rt,
2284
- Me,
2285
- ft,
2286
- ht,
2287
- vt,
2288
- yt,
2289
- Ct,
2290
- Vt,
2291
- ze
2292
- ], xt = { iviewSelect: Re };
2293
- function $t(t, k = {}) {
2294
- if (k.prefix && (t.provide(Ie, k.prefix), Oe.forEach((a) => a.name = k.prefix + a.name)), Oe.forEach((a) => {
2286
+ }), jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2287
+ __proto__: null,
2288
+ AllCheckbox: ct,
2289
+ BaseSwitch: gt,
2290
+ CacheSelect: Bt,
2291
+ Combi: bt,
2292
+ CountRange: yt,
2293
+ CurdTable: Tt,
2294
+ DateRange: Dt,
2295
+ DateRangePicker: xt,
2296
+ MCalendar: Rt,
2297
+ ModalFooter: Mt,
2298
+ PageTable: Ht,
2299
+ RemoteSelect: Ee,
2300
+ ToggleColumn: Le
2301
+ }, Symbol.toStringTag, { value: "Module" })), Ie = Object.values(jt), Nt = Object.entries({ iviewSelect: Pe });
2302
+ function Pt(t, S = {}) {
2303
+ if (S.prefix && (Se[0] = S.prefix, Ie.forEach((a) => a.name = S.prefix + a.name)), Ie.forEach((a) => {
2295
2304
  t.component(a.name, a);
2296
- }), Object.entries(xt).forEach((a) => {
2305
+ }), Nt.forEach((a) => {
2297
2306
  t.directive(a[0], a[1]);
2298
- }), k.i18n) {
2299
- M.i18n = k.i18n, k.msgPrefix && k.msgPrefix !== "d" && (M.prefix = k.msgPrefix);
2307
+ }), S.i18n) {
2308
+ w.i18n = S.i18n, S.msgPrefix && S.msgPrefix !== "d" && (w.prefix = S.msgPrefix);
2300
2309
  return;
2301
2310
  }
2302
- k.msg && (M.msg = k.msg);
2311
+ S.msg && (w.msg = S.msg);
2303
2312
  }
2304
- const jt = {
2305
- install: $t
2313
+ const Qt = {
2314
+ install: Pt
2306
2315
  };
2307
2316
  export {
2308
- Qe as AllCheckbox,
2309
- tt as BaseSwitch,
2310
- rt as CacheSelect,
2311
- ot as Combi,
2312
- ut as CountRange,
2313
- ft as CurdTable,
2314
- ht as DateRange,
2315
- vt as DateRangePicker,
2316
- yt as MCalendar,
2317
- Ct as ModalFooter,
2318
- Vt as PageTable,
2319
- Me as RemoteSelect,
2320
- ze as ToggleColumn,
2321
- jt as default,
2322
- $t as install,
2323
- Re as iviewSelect
2317
+ ct as AllCheckbox,
2318
+ gt as BaseSwitch,
2319
+ Bt as CacheSelect,
2320
+ bt as Combi,
2321
+ yt as CountRange,
2322
+ Tt as CurdTable,
2323
+ Dt as DateRange,
2324
+ xt as DateRangePicker,
2325
+ Rt as MCalendar,
2326
+ Mt as ModalFooter,
2327
+ Ht as PageTable,
2328
+ Ee as RemoteSelect,
2329
+ Le as ToggleColumn,
2330
+ Qt as default,
2331
+ Pt as install,
2332
+ Pe as iviewSelect
2324
2333
  };