view-ui-plus-derive 0.1.0 → 0.1.3

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 U, shallowRef as ye, computed as N, onMounted as ce, watch as F, resolveComponent as x, createElementBlock as P, openBlock as V, withDirectives as ue, createVNode as $, withCtx as C, createTextVNode as j, toDisplayString as z, unref as M, vShow as re, Fragment as X, renderList as ee, createBlock as E, renderSlot as I, ref as H, mergeProps as _, useSlots as Fe, createCommentVNode as G, createElementVNode as te, normalizeClass as ie, nextTick as Q, shallowReactive as De, useTemplateRef as be, normalizeProps as ke, guardReactiveProps as Ce, createSlots as Ve, getCurrentInstance as pe, onBeforeUnmount as $e, mergeModels as Se, useAttrs as ze, useModel as je, reactive as Pe } from "vue";
2
- import { getPathValue as ge, setPathValue as Ne, deepMerge as He, makeObjectByPath as Le, omitOwnKeys as Ee } from "utils-where";
3
- import Ke from "./locale/zh-CN.js";
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";
4
4
  /* empty css */
5
5
  /* empty css */
6
- import { i as Oe } from "./directives/v-iview-select.js";
6
+ import { i as Re } from "./directives/v-iview-select.js";
7
7
  /* empty css */
8
8
  /* empty css */
9
- import { Checkbox as Be } from "view-ui-plus";
9
+ import { Checkbox as $e } from "view-ui-plus";
10
10
  /* empty css */
11
11
  /* empty css */
12
- const A = {
12
+ const M = {
13
13
  i18n: null,
14
14
  prefix: "d",
15
- msg: Ke,
16
- t(e, ...S) {
17
- return A.i18n?.global.t(A.prefix + "." + e, ...S) ?? ge(A.msg, A.prefix + "." + e) ?? e;
15
+ msg: Xe,
16
+ t(t, ...k) {
17
+ return M.i18n?.global.t(M.prefix + "." + t, ...k) ?? pe(M.msg, M.prefix + "." + t) ?? t;
18
18
  }
19
- }, _e = {
19
+ }, Ze = {
20
20
  name: "AllCheckbox"
21
- }, Ue = /* @__PURE__ */ U({
22
- ..._e,
21
+ }, Qe = /* @__PURE__ */ _({
22
+ ...Ze,
23
23
  props: {
24
24
  modelValue: Array,
25
25
  /**
@@ -52,10 +52,10 @@ const A = {
52
52
  */
53
53
  keyMap: {
54
54
  type: Object,
55
- default(e) {
55
+ default(t) {
56
56
  return {
57
- value: e.valueKey,
58
- label: e.labelKey
57
+ value: t.valueKey,
58
+ label: t.labelKey
59
59
  };
60
60
  }
61
61
  },
@@ -69,57 +69,57 @@ const A = {
69
69
  all: Boolean
70
70
  },
71
71
  emits: ["update:modelValue", "update:all", "change"],
72
- setup(e, { emit: S }) {
73
- const t = e, l = S, a = ye(t.modelValue || []), n = N({
72
+ setup(t, { emit: k }) {
73
+ const a = t, e = k, l = Se(a.modelValue || []), n = L({
74
74
  get() {
75
- return a.value.length === t.list.length;
75
+ return l.value.length === a.list.length;
76
76
  },
77
77
  set(d) {
78
- a.value = d ? t.list.map((v) => v[t.keyMap.value]) : [];
78
+ l.value = d ? a.list.map((p) => p[a.keyMap.value]) : [];
79
79
  }
80
- }), i = N(
81
- () => a.value.length > 0 && a.value.length < t.list.length
80
+ }), i = L(
81
+ () => l.value.length > 0 && l.value.length < a.list.length
82
82
  );
83
- function m() {
84
- l("update:modelValue", a.value), l("update:all", n.value), l("change", a.value, n.value);
83
+ function g() {
84
+ e("update:modelValue", l.value), e("update:all", n.value), e("change", l.value, n.value);
85
85
  }
86
- return ce(() => {
87
- l("update:all", n.value);
86
+ return me(() => {
87
+ e("update:all", n.value);
88
88
  }), F(
89
- () => t.modelValue,
89
+ () => a.modelValue,
90
90
  (d) => {
91
- a.value !== d && (a.value = d || [], l("update:all", n.value));
91
+ l.value !== d && (l.value = d || [], e("update:all", n.value));
92
92
  }
93
- ), (d, v) => {
94
- const c = x("Checkbox"), f = x("CheckboxGroup");
95
- return V(), P("div", null, [
96
- ue($(c, {
93
+ ), (d, p) => {
94
+ const v = A("Checkbox"), u = A("CheckboxGroup");
95
+ return $(), N("div", null, [
96
+ ae(O(v, {
97
97
  modelValue: n.value,
98
- "onUpdate:modelValue": v[0] || (v[0] = (b) => n.value = b),
98
+ "onUpdate:modelValue": p[0] || (p[0] = (x) => n.value = x),
99
99
  indeterminate: i.value,
100
- onOnChange: m
100
+ onOnChange: g
101
101
  }, {
102
- default: C(() => [
103
- j(z(e.title ?? M(A).t("allCheckbox.title")), 1)
102
+ default: D(() => [
103
+ j(H(t.title ?? y(M).t("allCheckbox.title")), 1)
104
104
  ]),
105
105
  _: 1
106
106
  }, 8, ["modelValue", "indeterminate"]), [
107
- [re, !e.hideAll]
107
+ [ue, !t.hideAll]
108
108
  ]),
109
- $(f, {
110
- modelValue: a.value,
111
- "onUpdate:modelValue": v[1] || (v[1] = (b) => a.value = b),
109
+ O(u, {
110
+ modelValue: l.value,
111
+ "onUpdate:modelValue": p[1] || (p[1] = (x) => l.value = x),
112
112
  class: "ivu-inline-block",
113
- onOnChange: m
113
+ onOnChange: g
114
114
  }, {
115
- default: C(() => [
116
- (V(!0), P(X, null, ee(e.list, (b) => (V(), E(c, {
117
- key: b[e.keyMap.value],
118
- label: b[e.keyMap.value]
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
119
  }, {
120
- default: C(() => [
121
- I(d.$slots, "default", { item: b }, () => [
122
- j(z(b[e.keyMap.label]), 1)
120
+ default: D(() => [
121
+ z(d.$slots, "default", { item: x }, () => [
122
+ j(H(x[t.keyMap.label]), 1)
123
123
  ])
124
124
  ]),
125
125
  _: 2
@@ -130,10 +130,10 @@ const A = {
130
130
  ]);
131
131
  };
132
132
  }
133
- }), Ye = {
133
+ }), et = {
134
134
  name: "BaseSwitch"
135
- }, Ge = /* @__PURE__ */ U({
136
- ...Ye,
135
+ }, tt = /* @__PURE__ */ _({
136
+ ...et,
137
137
  props: {
138
138
  modelValue: [String, Number, Boolean],
139
139
  /**
@@ -160,49 +160,52 @@ const A = {
160
160
  falseLabel: String
161
161
  },
162
162
  emits: ["update:modelValue", "change"],
163
- setup(e, { emit: S }) {
164
- const t = e, l = S, a = H(t.modelValue), n = (i) => {
165
- l("update:modelValue", i), l("change", i);
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);
166
166
  };
167
167
  return F(
168
- () => t.modelValue,
168
+ () => a.modelValue,
169
169
  (i) => {
170
- a.value !== i && (a.value = i);
170
+ l.value !== i && (l.value = i);
171
171
  }
172
- ), (i, m) => {
173
- const d = x("Switch");
174
- return V(), E(d, _({
175
- modelValue: a.value,
176
- "onUpdate:modelValue": m[0] || (m[0] = (v) => a.value = v),
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
177
  onOnChange: n
178
178
  }, i.$attrs, {
179
- trueValue: e.trueValue,
180
- falseValue: e.falseValue
179
+ trueValue: t.trueValue,
180
+ falseValue: t.falseValue
181
181
  }), {
182
- open: C(() => [
183
- I(i.$slots, "open", {}, () => [
184
- j(z(e.trueLabel), 1)
182
+ open: D(() => [
183
+ z(i.$slots, "open", {}, () => [
184
+ j(H(t.trueLabel), 1)
185
185
  ])
186
186
  ]),
187
- close: C(() => [
188
- I(i.$slots, "close", {}, () => [
189
- j(z(e.falseLabel), 1)
187
+ close: D(() => [
188
+ z(i.$slots, "close", {}, () => [
189
+ j(H(t.falseLabel), 1)
190
190
  ])
191
191
  ]),
192
192
  _: 3
193
193
  }, 16, ["modelValue", "trueValue", "falseValue"]);
194
194
  };
195
195
  }
196
- }), Je = { class: "combi ivu-input-group" }, We = {
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 = {
197
200
  key: 0,
198
201
  class: "ivu-input-group-prepend"
199
- }, qe = {
202
+ }, lt = {
200
203
  key: 1,
201
204
  class: "ivu-input-group-append"
202
- }, Qe = {
205
+ }, nt = {
203
206
  name: "Combi"
204
- }, Xe = /* @__PURE__ */ U({
205
- ...Qe,
207
+ }, ot = /* @__PURE__ */ _({
208
+ ...nt,
206
209
  props: {
207
210
  /**
208
211
  * 前置文本
@@ -213,30 +216,32 @@ const A = {
213
216
  */
214
217
  append: String
215
218
  },
216
- setup(e) {
217
- const S = Fe(), t = e, l = N(() => !!t.prepend || !!S.prepend?.().length), a = N(() => !!t.append || !!S.append?.().length);
218
- return (n, i) => (V(), P("div", Je, [
219
- l.value ? (V(), P("div", We, [
220
- I(n.$slots, "prepend", {}, () => [
221
- j(z(e.prepend), 1)
219
+ 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"])
223
+ }, [
224
+ e.value ? ($(), N("div", at, [
225
+ z(n.$slots, "prepend", {}, () => [
226
+ j(H(t.prepend), 1)
222
227
  ])
223
- ])) : G("", !0),
228
+ ])) : W("", !0),
224
229
  te("div", {
225
- class: ie(["combi-cell", { "with-append": a.value, "with-prepend": l.value }])
230
+ class: P([y(I)("combi-cell"), { "with-append": l.value, "with-prepend": e.value }])
226
231
  }, [
227
- I(n.$slots, "default")
232
+ z(n.$slots, "default")
228
233
  ], 2),
229
- a.value ? (V(), P("div", qe, [
230
- I(n.$slots, "append", {}, () => [
231
- j(z(e.append), 1)
234
+ l.value ? ($(), N("div", lt, [
235
+ z(n.$slots, "append", {}, () => [
236
+ j(H(t.append), 1)
232
237
  ])
233
- ])) : G("", !0)
234
- ]));
238
+ ])) : W("", !0)
239
+ ], 2));
235
240
  }
236
- }), Ze = { class: "count-range" }, et = {
241
+ }), it = {
237
242
  name: "CountRange"
238
- }, tt = /* @__PURE__ */ U({
239
- ...et,
243
+ }, ut = /* @__PURE__ */ _({
244
+ ...it,
240
245
  props: {
241
246
  /**
242
247
  * 双向绑定最小值
@@ -326,72 +331,74 @@ const A = {
326
331
  hideJoiner: Boolean
327
332
  },
328
333
  emits: ["update:begin", "update:end", "change-min", "change-max", "change"],
329
- setup(e, { emit: S }) {
330
- const t = e, l = S, a = H(t.begin), n = H(t.end), i = N(() => ({
331
- min: t.min,
332
- max: t.max,
333
- placeholder: t.minHolder ?? A.t("countRange.minHolder"),
334
- disabled: t.disabled || t.minDisabled,
335
- class: t.minClass,
336
- controlsOutside: t.controlsOutside,
337
- step: t.step,
338
- readonly: t.readonly,
339
- editable: t.editable,
340
- precision: t.precision,
341
- formatter: t.formatter,
342
- parser: t.parser,
343
- activeChange: t.activeChange,
344
- ...t.minAttr
345
- })), m = N(() => ({
346
- min: a.value,
347
- max: t.max,
348
- placeholder: t.maxHolder ?? A.t("countRange.maxHolder"),
349
- disabled: t.disabled || t.maxDisabled,
350
- class: t.maxClass,
351
- controlsOutside: t.controlsOutside,
352
- step: t.step,
353
- readonly: t.readonly,
354
- editable: t.editable,
355
- precision: t.precision,
356
- formatter: t.formatter,
357
- parser: t.parser,
358
- activeChange: a.value ? !1 : t.activeChange,
359
- ...t.maxAttr
334
+ setup(t, { emit: k }) {
335
+ const a = t, e = k, l = E(a.begin), n = E(a.end), i = L(() => ({
336
+ min: a.min,
337
+ max: a.max,
338
+ placeholder: a.minHolder ?? M.t("countRange.minHolder"),
339
+ disabled: a.disabled || a.minDisabled,
340
+ class: a.minClass,
341
+ controlsOutside: a.controlsOutside,
342
+ step: a.step,
343
+ readonly: a.readonly,
344
+ editable: a.editable,
345
+ precision: a.precision,
346
+ formatter: a.formatter,
347
+ parser: a.parser,
348
+ activeChange: a.activeChange,
349
+ ...a.minAttr
350
+ })), g = L(() => ({
351
+ min: l.value,
352
+ max: a.max,
353
+ placeholder: a.maxHolder ?? M.t("countRange.maxHolder"),
354
+ disabled: a.disabled || a.maxDisabled,
355
+ class: a.maxClass,
356
+ controlsOutside: a.controlsOutside,
357
+ step: a.step,
358
+ readonly: a.readonly,
359
+ editable: a.editable,
360
+ precision: a.precision,
361
+ formatter: a.formatter,
362
+ parser: a.parser,
363
+ activeChange: l.value ? !1 : a.activeChange,
364
+ ...a.maxAttr
360
365
  })), d = () => {
361
- l("update:begin", a.value), l("update:end", n.value);
362
- }, v = (u) => {
363
- n.value != null && u > n.value && (n.value = u + 1 > m.value.max ? m.value.max : u + 1), d(), l("change-min", u), l("change", u, n.value, !1);
364
- }, c = (u) => {
365
- d(), l("change-max", u), l("change", a.value, u, !0);
366
- }, f = (u) => {
367
- a.value !== u && (a.value = u !== void 0 ? u : null);
368
- }, b = (u) => {
369
- n.value !== u && (n.value = u !== void 0 ? u : null);
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);
370
375
  };
371
- return F(() => t.begin, f), F(() => t.end, b), (u, R) => {
372
- const y = x("InputNumber");
373
- return V(), P("div", Ze, [
374
- $(y, _({
375
- modelValue: a.value,
376
- "onUpdate:modelValue": R[0] || (R[0] = (O) => a.value = O)
377
- }, i.value, { onOnChange: v }), null, 16, ["modelValue"]),
378
- ue(te("span", {
379
- class: ie(["count-range-joiner", e.joinerClass])
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])
380
387
  }, null, 2), [
381
- [re, !e.hideJoiner]
388
+ [ue, !t.hideJoiner]
382
389
  ]),
383
- $(y, _({
390
+ O(C, G({
384
391
  modelValue: n.value,
385
- "onUpdate:modelValue": R[1] || (R[1] = (O) => n.value = O)
386
- }, m.value, { onOnChange: c }), null, 16, ["modelValue"])
387
- ]);
392
+ "onUpdate:modelValue": b[1] || (b[1] = (T) => n.value = T)
393
+ }, g.value, { onOnChange: v }), null, 16, ["modelValue"])
394
+ ], 2);
388
395
  };
389
396
  }
390
- }), at = { key: 1 }, lt = {
397
+ }), st = { key: 1 }, dt = {
391
398
  name: "RemoteSelect",
392
399
  inheritAttrs: !1
393
- }, xe = /* @__PURE__ */ U({
394
- ...lt,
400
+ }, Me = /* @__PURE__ */ _({
401
+ ...dt,
395
402
  props: {
396
403
  modelValue: [String, Array, Number],
397
404
  list: Array,
@@ -416,10 +423,10 @@ const A = {
416
423
  },
417
424
  keyMap: {
418
425
  type: Object,
419
- default(e) {
426
+ default(t) {
420
427
  return {
421
- value: e.valueKey,
422
- label: e.labelKey
428
+ value: t.valueKey,
429
+ label: t.labelKey
423
430
  };
424
431
  }
425
432
  },
@@ -458,12 +465,12 @@ const A = {
458
465
  getSelected: {
459
466
  type: Function,
460
467
  default({
461
- multiple: e,
462
- keyMap: S,
463
- list: t,
464
- value: l
468
+ multiple: t,
469
+ keyMap: k,
470
+ list: a,
471
+ value: e
465
472
  }) {
466
- return e ? t.filter((a) => l.includes(a[S.value])) : t.find((a) => a[S.value] === l) || {};
473
+ return t ? a.filter((l) => e.includes(l[k.value])) : a.find((l) => l[k.value] === e) || {};
467
474
  }
468
475
  },
469
476
  /**
@@ -481,109 +488,109 @@ const A = {
481
488
  }
482
489
  },
483
490
  emits: ["update:modelValue", "update:chosen", "update:list", "update:refresh", "load"],
484
- setup(e, { expose: S, emit: t }) {
485
- const l = e, a = t, n = H(l.modelValue ?? ""), i = H([]), m = H(!1), d = H({}), v = N(
486
- () => d.value && Object.keys(d.value).length > 0 ? typeof l.textFormat != "function" ? l.multiple ? d.value.map((r) => r[l.keyMap.label]).join(",") : d.value[l.keyMap.label] : l.textFormat(d.value) : ""
487
- ), c = H(!1);
488
- let f, b, u, R;
489
- async function y() {
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() {
490
497
  let r;
491
- if (typeof l.loader != "function") {
492
- if (typeof l.method != "function") {
498
+ if (typeof e.loader != "function") {
499
+ if (typeof e.method != "function") {
493
500
  console.warn("typeof method isn't function");
494
501
  return;
495
502
  }
496
- if (m.value = !0, r = await l.method(typeof l.param != "function" ? l.param : l.param()), m.value = !1, r && typeof l.process == "function") {
497
- const B = l.process(r);
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);
498
505
  B != null && (r = B);
499
506
  }
500
507
  } else
501
- m.value = !0, r = await l.loader(), m.value = !1;
502
- r && (c.value = !0, i.value = r, a("update:list", r), k() && O(n.value), f = !0, Q(() => {
503
- f = null;
504
- }), a("load", r));
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));
505
512
  }
506
- function O(r) {
507
- b = !0, Q(() => {
508
- b = null;
509
- }), u && (l.multiple ? !r.toString().length : r === void 0) && (n.value = r = u), d.value = l.getSelected({
510
- multiple: l.multiple,
511
- keyMap: l.keyMap,
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({
517
+ multiple: e.multiple,
518
+ keyMap: e.keyMap,
512
519
  list: i.value,
513
520
  value: n.value
514
- }), a("update:modelValue", r ?? ""), a("update:chosen", d.value);
521
+ }), l("update:modelValue", r ?? ""), l("update:chosen", d.value);
515
522
  }
516
- function s(r) {
517
- r && !l.autoGet && !m.value && !c.value && (!l.check || l.check()) && (!l.strict || l.parentCode) && y();
523
+ function c(r) {
524
+ r && !e.autoGet && !g.value && !v.value && (!e.check || e.check()) && (!e.strict || e.parentCode) && C();
518
525
  }
519
- function k() {
526
+ function S() {
520
527
  return n.value != null && n.value.toString().length > 0;
521
528
  }
522
- return a("update:refresh", y), ce(() => {
523
- l.autoGet ? y() : k() && !i.value.length && s(!0);
524
- }), S({
529
+ return l("update:refresh", C), me(() => {
530
+ e.autoGet ? C() : S() && !i.value.length && c(!0);
531
+ }), k({
525
532
  code: n,
526
- changeCode: O,
527
- loaded: c,
533
+ changeCode: T,
534
+ loaded: v,
528
535
  codes: i,
529
- search: y
536
+ search: C
530
537
  }), F(
531
- () => l.list,
538
+ () => e.list,
532
539
  (r) => {
533
- f || (r && r.length ? (i.value = r, c.value = !!l.cache) : (i.value = [], c.value = !1));
540
+ u || (r && r.length ? (i.value = r, v.value = !!e.cache) : (i.value = [], v.value = !1));
534
541
  },
535
542
  { immediate: !0 }
536
543
  ), F(
537
- () => l.modelValue,
544
+ () => e.modelValue,
538
545
  (r) => {
539
- if (!b && (R = !0, Q(() => {
540
- R = null;
541
- }), n.value = r ?? "", O(n.value), l.refresh !== y)) {
546
+ if (!x && (b = !0, q(() => {
547
+ b = null;
548
+ }), n.value = r ?? "", T(n.value), e.refresh !== C)) {
542
549
  for (const B in d.value)
543
550
  return;
544
- s(k());
551
+ c(S());
545
552
  }
546
553
  }
547
554
  ), F(
548
- () => l.parentCode,
555
+ () => e.parentCode,
549
556
  (r) => {
550
- R ? (u = l.modelValue, setTimeout(() => {
551
- u = null;
552
- })) : n.value = l.multiple ? [] : "", i.value = [], c.value = !1, a("update:list", i.value), k() && r && /* !this.opening && */
553
- s(!0);
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);
554
561
  }
555
562
  ), (r, B) => {
556
- const p = x("Option"), o = x("Select");
557
- return e.textMode ? (V(), P("span", at, [
558
- I(r.$slots, "text", { text: v.value }, () => [
559
- j(z(v.value), 1)
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)
560
567
  ])
561
- ])) : ue((V(), E(o, _({
568
+ ])) : ae(($(), U(o, G({
562
569
  key: 0,
563
570
  modelValue: n.value,
564
- "onUpdate:modelValue": B[0] || (B[0] = (D) => n.value = D),
565
- onOnOpenChange: s,
566
- onOnChange: O
571
+ "onUpdate:modelValue": B[0] || (B[0] = (V) => n.value = V),
572
+ onOnOpenChange: c,
573
+ onOnChange: T
567
574
  }, r.$attrs, {
568
- multiple: e.multiple,
569
- loading: m.value,
570
- "not-found-text": m.value ? null : void 0
575
+ multiple: t.multiple,
576
+ loading: g.value,
577
+ "not-found-text": g.value ? null : void 0
571
578
  }), {
572
- default: C(() => [
573
- I(r.$slots, "dropdown", { list: i.value }, () => [
574
- (V(!0), P(X, null, ee(i.value, (D, L) => (V(), E(p, {
575
- key: l.valueAsKey ? D[e.keyMap.value] : L,
576
- value: D[e.keyMap.value],
577
- label: e.formatLabel && e.formatLabel(D, L),
578
- disabled: e.optionDisabled && e.optionDisabled(D, L),
579
- tag: e.optionTag && e.optionTag(D, L)
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)
580
587
  }, {
581
- default: C(() => [
582
- I(r.$slots, "default", {
583
- item: D,
584
- index: L
588
+ default: D(() => [
589
+ z(r.$slots, "default", {
590
+ item: V,
591
+ index: K
585
592
  }, () => [
586
- j(z(D[e.keyMap.label]), 1)
593
+ j(H(V[t.keyMap.label]), 1)
587
594
  ])
588
595
  ]),
589
596
  _: 2
@@ -592,21 +599,21 @@ const A = {
592
599
  ]),
593
600
  _: 3
594
601
  }, 16, ["modelValue", "multiple", "loading", "not-found-text"])), [
595
- [M(Oe), e.all, "all"]
602
+ [y(Re), t.all, "all"]
596
603
  ]);
597
604
  };
598
605
  }
599
- }), he = {
606
+ }), ke = {
600
607
  list: null
601
- }, le = De({}), ne = {
608
+ }, ne = Te({}), oe = {
602
609
  list: []
603
- }, oe = {
610
+ }, ie = {
604
611
  list: []
605
- }, ve = {}, nt = {
612
+ }, Ce = {}, ct = {
606
613
  name: "CacheSelect",
607
614
  inheritAttrs: !1
608
- }, ot = /* @__PURE__ */ U({
609
- ...nt,
615
+ }, rt = /* @__PURE__ */ _({
616
+ ...ct,
610
617
  props: {
611
618
  modelValue: [String, Array, Number],
612
619
  /**
@@ -618,65 +625,65 @@ const A = {
618
625
  }
619
626
  },
620
627
  emits: ["update:modelValue", "update:chosen", "update:list", "load", "change"],
621
- setup(e, { emit: S }) {
622
- const t = e, l = S, a = H(""), n = be("sel"), i = (v) => {
623
- l("update:modelValue", v), l("change", v);
624
- }, m = (v) => {
625
- Q(() => {
626
- ne[t.cacheId] && (ne[t.cacheId].forEach((c) => {
627
- c.changeCode(c.code);
628
- }), ne[t.cacheId] = []), oe[t.cacheId] && (oe[t.cacheId].forEach((c) => {
629
- c !== n.value && c.$emit("update:list", c.codes);
630
- }), oe[t.cacheId] = []);
631
- }), l("load", v);
632
- }, d = () => a.value != null && a.value.toString().length > 0;
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;
633
640
  return F(
634
- () => t.modelValue,
635
- (v) => {
636
- a.value !== v && (a.value = v ?? "");
641
+ () => a.modelValue,
642
+ (p) => {
643
+ l.value !== p && (l.value = p ?? "");
637
644
  }
638
- ), le[t.cacheId] || (le[t.cacheId] = [], he[t.cacheId] = null), ce(() => {
639
- le[t.cacheId].length && (n.value.loaded = !0), t.modelValue && (a.value = t.modelValue), he[t.cacheId] ? (d() && (ne[t.cacheId] || (ne[t.cacheId] = []), ne[t.cacheId].push(n.value)), n.value.loaded = ve[t.cacheId]) : he[t.cacheId] = !0, oe[t.cacheId] || (oe[t.cacheId] = []), oe[t.cacheId].push(n.value), ve[t.cacheId] || (ve[t.cacheId] = d()), F(
640
- () => le[t.cacheId],
641
- (v) => {
642
- v.length && (n.value.loaded = !0);
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);
643
650
  },
644
651
  {
645
652
  immediate: !0
646
653
  }
647
654
  );
648
- }), (v, c) => (V(), E(xe, _({
655
+ }), (p, v) => ($(), U(Me, G({
649
656
  ref: "sel",
650
- modelValue: a.value,
651
- "onUpdate:modelValue": c[0] || (c[0] = (f) => a.value = f),
652
- list: M(le)[e.cacheId],
657
+ modelValue: l.value,
658
+ "onUpdate:modelValue": v[0] || (v[0] = (u) => l.value = u),
659
+ list: y(ne)[t.cacheId],
653
660
  "onUpdate:list": [
654
- c[1] || (c[1] = (f) => M(le)[e.cacheId] = f),
655
- c[3] || (c[3] = (f) => v.$emit("update:list", f))
661
+ v[1] || (v[1] = (u) => y(ne)[t.cacheId] = u),
662
+ v[3] || (v[3] = (u) => p.$emit("update:list", u))
656
663
  ],
657
- onLoad: m,
664
+ onLoad: g,
658
665
  onOnChange: i,
659
- "onUpdate:chosen": c[2] || (c[2] = (f) => v.$emit("update:chosen", f))
660
- }, v.$attrs, { cache: "" }), {
661
- default: C(({ item: f, index: b }) => [
662
- I(v.$slots, "default", {
663
- item: f,
664
- index: b
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
665
672
  })
666
673
  ]),
667
- dropdown: C(({ list: f }) => [
668
- I(v.$slots, "dropdown", { list: f })
674
+ dropdown: D(({ list: u }) => [
675
+ z(p.$slots, "dropdown", { list: u })
669
676
  ]),
670
- text: C((f) => [
671
- I(v.$slots, "text", ke(Ce(f)))
677
+ text: D((u) => [
678
+ z(p.$slots, "text", Be(De(u)))
672
679
  ]),
673
680
  _: 3
674
681
  }, 16, ["modelValue", "list"]));
675
682
  }
676
- }), it = {
683
+ }), mt = {
677
684
  name: "CurdTable"
678
- }, ut = /* @__PURE__ */ U({
679
- ...it,
685
+ }, ft = /* @__PURE__ */ _({
686
+ ...mt,
680
687
  props: {
681
688
  modelValue: {
682
689
  type: Array,
@@ -727,13 +734,13 @@ const A = {
727
734
  */
728
735
  actionCol: {
729
736
  type: Object,
730
- default(e) {
737
+ default(t) {
731
738
  return {
732
739
  // title: props.actionText,
733
740
  slot: "action",
734
- width: e.actionWidth,
735
- align: e.actionAlign,
736
- fixed: e.actionFixed
741
+ width: t.actionWidth,
742
+ align: t.actionAlign,
743
+ fixed: t.actionFixed
737
744
  };
738
745
  }
739
746
  },
@@ -765,8 +772,8 @@ const A = {
765
772
  },
766
773
  addBtnDisabled: {
767
774
  type: Boolean,
768
- default(e) {
769
- return !e.addable;
775
+ default(t) {
776
+ return !t.addable;
770
777
  }
771
778
  },
772
779
  addBtn: {
@@ -805,111 +812,111 @@ const A = {
805
812
  }
806
813
  },
807
814
  emits: ["update:modelValue", "add", "remove", "change"],
808
- setup(e, { emit: S }) {
809
- const t = e, l = S, a = H(t.modelValue), n = N(
810
- () => t.disabled ? t.columns : t.columns.concat(
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(
811
818
  Object.assign(
812
819
  {
813
- title: t.actionText ?? A.t("curdTable.actionText")
820
+ title: a.actionText ?? M.t("curdTable.actionText")
814
821
  },
815
- t.actionCol
822
+ a.actionCol
816
823
  )
817
824
  )
818
- ), i = N(() => {
819
- const f = [], b = (u) => {
820
- u.slot && f.push(u), u.children && u.children.forEach((R) => {
821
- b(R);
825
+ ), i = L(() => {
826
+ const u = [], x = (s) => {
827
+ s.slot && u.push(s), s.children && s.children.forEach((b) => {
828
+ x(b);
822
829
  });
823
830
  };
824
- return t.columns.forEach((u) => {
825
- b(u);
826
- }), f;
831
+ return a.columns.forEach((s) => {
832
+ x(s);
833
+ }), u;
827
834
  });
828
- function m() {
829
- typeof t.beforeAdd != "function" ? d() : t.beforeAdd().then(d).catch();
835
+ function g() {
836
+ typeof a.beforeAdd != "function" ? d() : a.beforeAdd().then(d).catch();
830
837
  }
831
- function d(f) {
832
- a.value.push(...t.addRow(f)), l("update:modelValue", a.value), l("add", a.value[a.value.length - 1]), l("change", !0);
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);
833
840
  }
834
- function v(f) {
835
- typeof t.beforeRemove != "function" ? c(f) : t.beforeRemove(a.value[f], f).then(() => {
836
- c(f);
841
+ function p(u) {
842
+ typeof a.beforeRemove != "function" ? v(u) : a.beforeRemove(l.value[u], u).then(() => {
843
+ v(u);
837
844
  });
838
845
  }
839
- function c(f) {
840
- const [b] = a.value.splice(f, 1);
841
- l("update:modelValue", a.value), l("remove", b), l("change", !1);
846
+ function v(u) {
847
+ const [x] = l.value.splice(u, 1);
848
+ e("update:modelValue", l.value), e("remove", x), e("change", !1);
842
849
  }
843
850
  return F(
844
- () => t.modelValue,
845
- (f) => {
846
- a.value = f;
851
+ () => a.modelValue,
852
+ (u) => {
853
+ l.value = u;
847
854
  }
848
- ), (f, b) => {
849
- const u = x("Button"), R = x("Table");
850
- return V(), P("div", null, [
851
- $(R, {
852
- border: e.border,
855
+ ), (u, x) => {
856
+ const s = A("Button"), b = A("Table");
857
+ return $(), N("div", null, [
858
+ O(b, {
859
+ border: t.border,
853
860
  columns: n.value,
854
- data: a.value,
855
- size: e.size,
861
+ data: l.value,
862
+ size: t.size,
856
863
  style: { "z-index": "0" }
857
- }, Ve({
858
- action: C(({ row: y, index: O }) => [
859
- I(f.$slots, "moreAction", {
860
- row: y,
861
- index: O
864
+ }, we({
865
+ action: D(({ row: C, index: T }) => [
866
+ z(u.$slots, "moreAction", {
867
+ row: C,
868
+ index: T
862
869
  }),
863
- !e.hideDelBtn || !e.hideDelBtn(y, O) ? (V(), E(u, _({
870
+ !t.hideDelBtn || !t.hideDelBtn(C, T) ? ($(), U(s, G({
864
871
  key: 0,
865
- type: e.delBtnType,
866
- size: e.delBtnSize,
867
- ghost: e.delBtnGhost
868
- }, e.delBtn, {
869
- disabled: e.delBtnDisabled(y, O),
870
- onClick: (s) => v(O)
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)
871
878
  }), {
872
- default: C(() => [
873
- j(z(M(A).t("curdTable.del")), 1)
879
+ default: D(() => [
880
+ j(H(y(M).t("curdTable.del")), 1)
874
881
  ]),
875
882
  _: 1
876
- }, 16, ["type", "size", "ghost", "disabled", "onClick"])) : G("", !0)
883
+ }, 16, ["type", "size", "ghost", "disabled", "onClick"])) : W("", !0)
877
884
  ]),
878
885
  _: 2
879
886
  }, [
880
- ee(i.value, (y) => ({
881
- name: y.slot,
882
- fn: C((O) => [
883
- I(f.$slots, y.slot, ke(Ce(O)))
887
+ ee(i.value, (C) => ({
888
+ name: C.slot,
889
+ fn: D((T) => [
890
+ z(u.$slots, C.slot, Be(De(T)))
884
891
  ])
885
892
  }))
886
893
  ]), 1032, ["border", "columns", "data", "size"]),
887
- e.disabled ? G("", !0) : ue((V(), E(u, _({
894
+ t.disabled ? W("", !0) : ae(($(), U(s, G({
888
895
  key: 0,
889
- type: e.addBtnType,
890
- size: e.addBtnSize,
891
- ghost: e.addBtnGhost,
892
- disabled: e.addBtnDisabled
893
- }, e.addBtn, {
896
+ type: t.addBtnType,
897
+ size: t.addBtnSize,
898
+ ghost: t.addBtnGhost,
899
+ disabled: t.addBtnDisabled
900
+ }, t.addBtn, {
894
901
  long: "",
895
902
  icon: "md-add",
896
903
  style: { display: "block", position: "relative", "margin-top": "-1px" },
897
- onClick: m
904
+ onClick: g
898
905
  }), {
899
- default: C(() => [
900
- j(z(e.addText ?? M(A).t("curdTable.addText")), 1)
906
+ default: D(() => [
907
+ j(H(t.addText ?? y(M).t("curdTable.addText")), 1)
901
908
  ]),
902
909
  _: 1
903
910
  }, 16, ["type", "size", "ghost", "disabled"])), [
904
- [re, e.addable]
911
+ [ue, t.addable]
905
912
  ])
906
913
  ]);
907
914
  };
908
915
  }
909
- }), st = { class: "date-range" }, dt = {
916
+ }), gt = {
910
917
  name: "DateRange"
911
- }, ct = /* @__PURE__ */ U({
912
- ...dt,
918
+ }, ht = /* @__PURE__ */ _({
919
+ ...gt,
913
920
  props: {
914
921
  /**
915
922
  * 双向绑定开始时间
@@ -993,71 +1000,73 @@ const A = {
993
1000
  format: String
994
1001
  },
995
1002
  emits: ["update:begin", "update:end", "change-begin", "change-end", "change"],
996
- setup(e, { emit: S }) {
997
- const t = pe().appContext.config.globalProperties.$Date, l = {
1003
+ setup(t, { emit: k }) {
1004
+ const a = ve().appContext.config.globalProperties.$Date, e = {
998
1005
  date: "day",
999
1006
  month: "month",
1000
1007
  year: "year",
1001
1008
  datetime: "day"
1002
- }, a = e, n = S, i = H(a.begin), m = H(a.end), d = N(() => ({
1003
- options: a.limitBegin ? {
1004
- disabledDate: (y) => y && t(y).isBefore(Date.now(), l[a.type])
1009
+ }, l = t, n = k, i = E(l.begin), g = E(l.end), d = L(() => ({
1010
+ options: l.limitBegin ? {
1011
+ disabledDate: (C) => C && a(C).isBefore(Date.now(), e[l.type])
1005
1012
  // date.valueOf() < Date.now() - (props.disableToday ? 0 : 86400000)
1006
1013
  } : void 0,
1007
- disabled: a.disabled || a.beginDisabled,
1008
- placeholder: a.beginHolder ?? A.t("dateRange.beginHolder"),
1009
- class: a.beginClass,
1010
- clearable: a.clearable,
1011
- transfer: a.transfer,
1012
- format: a.format,
1013
- ...a.beginAttr
1014
- })), v = N(() => ({
1014
+ disabled: l.disabled || l.beginDisabled,
1015
+ placeholder: l.beginHolder ?? M.t("dateRange.beginHolder"),
1016
+ class: l.beginClass,
1017
+ clearable: l.clearable,
1018
+ transfer: l.transfer,
1019
+ format: l.format,
1020
+ ...l.beginAttr
1021
+ })), p = L(() => ({
1015
1022
  options: {
1016
- disabledDate: (y) => i.value && y && t(y).isBefore(i.value, l[a.type])
1023
+ disabledDate: (C) => i.value && C && a(C).isBefore(i.value, e[l.type])
1017
1024
  },
1018
- disabled: a.disabled || a.endDisabled,
1019
- placeholder: a.endHolder ?? A.t("dateRange.endHolder"),
1020
- class: a.endClass,
1021
- clearable: a.clearable,
1022
- transfer: a.transfer,
1023
- format: a.format,
1024
- ...a.endAttr
1025
- })), c = () => {
1026
- n("update:begin", i.value), n("update:end", m.value);
1027
- }, f = (y) => {
1028
- i.value > m.value && (m.value = a.autoNext ? t(i.value).add(1, l[a.type]).toDate() : ""), c(), n("change-begin", y), n("change", i.value, m.value, !1);
1029
- }, b = (y) => {
1030
- a.type === "datetime" && y && t(y).isBefore(i.value) && (m.value = t(i.value).add(1, "hour").toDate(), y = t(m.value).format("YYYY-MM-DD HH:mm:ss")), c(), n("change-end", y), n("change", i.value, m.value, !0);
1031
- }, u = (y) => {
1032
- i.value !== y && (i.value = y || "");
1033
- }, R = (y) => {
1034
- m.value !== y && (m.value = y || "");
1025
+ disabled: l.disabled || l.endDisabled,
1026
+ placeholder: l.endHolder ?? M.t("dateRange.endHolder"),
1027
+ class: l.endClass,
1028
+ clearable: l.clearable,
1029
+ transfer: l.transfer,
1030
+ format: l.format,
1031
+ ...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 || "");
1035
1042
  };
1036
- return F(() => a.begin, u), F(() => a.end, R), (y, O) => {
1037
- const s = x("DatePicker");
1038
- return V(), P("div", st, [
1039
- $(s, _({
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({
1040
1049
  modelValue: i.value,
1041
- "onUpdate:modelValue": O[0] || (O[0] = (k) => i.value = k),
1042
- onOnChange: f
1043
- }, d.value, { type: e.type }), null, 16, ["modelValue", "type"]),
1044
- ue(te("span", {
1045
- class: ie(["date-range-joiner", e.joinerClass])
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])
1046
1055
  }, null, 2), [
1047
- [re, !e.hideJoiner]
1056
+ [ue, !t.hideJoiner]
1048
1057
  ]),
1049
- $(s, _({
1050
- modelValue: m.value,
1051
- "onUpdate:modelValue": O[1] || (O[1] = (k) => m.value = k),
1052
- onOnChange: b
1053
- }, v.value, { type: e.type }), null, 16, ["modelValue", "type"])
1054
- ]);
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);
1055
1064
  };
1056
1065
  }
1057
- }), rt = {
1066
+ }), pt = {
1058
1067
  name: "DateRangePicker"
1059
- }, ft = /* @__PURE__ */ U({
1060
- ...rt,
1068
+ }, vt = /* @__PURE__ */ _({
1069
+ ...pt,
1061
1070
  props: {
1062
1071
  /**
1063
1072
  * 双向绑定开始时间
@@ -1079,8 +1088,8 @@ const A = {
1079
1088
  type: {
1080
1089
  type: String,
1081
1090
  default: "daterange",
1082
- validator(e) {
1083
- return ["daterange", "datetimerange"].includes(e);
1091
+ validator(t) {
1092
+ return ["daterange", "datetimerange"].includes(t);
1084
1093
  }
1085
1094
  },
1086
1095
  options: Object,
@@ -1113,44 +1122,44 @@ const A = {
1113
1122
  }
1114
1123
  },
1115
1124
  emits: ["update:begin", "update:end", "change"],
1116
- setup(e, { emit: S }) {
1117
- const t = pe().appContext.config.globalProperties.$Date, l = e, a = S, n = N(
1118
- () => l.options || (l.limitBegin ? {
1119
- disabledDate: (d) => d && d.valueOf() < Date.now() - (l.disableToday ? 0 : 864e5)
1125
+ setup(t, { emit: k }) {
1126
+ const a = ve().appContext.config.globalProperties.$Date, e = t, l = k, n = L(
1127
+ () => e.options || (e.limitBegin ? {
1128
+ disabledDate: (d) => d && d.valueOf() < Date.now() - (e.disableToday ? 0 : 864e5)
1120
1129
  } : null)
1121
- ), i = N({
1130
+ ), i = L({
1122
1131
  get() {
1123
- const d = l.begin, v = l.end;
1124
- return d && v ? [t(d).toDate(), t(v).toDate()] : [];
1132
+ const d = e.begin, p = e.end;
1133
+ return d && p ? [a(d).toDate(), a(p).toDate()] : [];
1125
1134
  },
1126
1135
  set(d) {
1127
- let v, c;
1128
- d[0] && d[1] ? (v = t(d[0]).format(l.valueFormat), c = t(d[1]).format(l.valueFormat)) : v = c = "", a("update:begin", v), a("update:end", c);
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);
1129
1138
  }
1130
- }), m = (d, v) => {
1131
- a("change", d, v);
1139
+ }), g = (d, p) => {
1140
+ l("change", d, p);
1132
1141
  };
1133
- return (d, v) => {
1134
- const c = x("DatePicker");
1135
- return V(), E(c, {
1142
+ return (d, p) => {
1143
+ const v = A("DatePicker");
1144
+ return $(), U(v, {
1136
1145
  modelValue: i.value,
1137
- "onUpdate:modelValue": v[0] || (v[0] = (f) => i.value = f),
1138
- type: e.type,
1139
- clearable: e.clearable,
1140
- "split-panels": e.splitPanels,
1146
+ "onUpdate:modelValue": p[0] || (p[0] = (u) => i.value = u),
1147
+ type: t.type,
1148
+ clearable: t.clearable,
1149
+ "split-panels": t.splitPanels,
1141
1150
  options: n.value,
1142
- transfer: e.transfer,
1143
- placeholder: e.placeholder,
1144
- disabled: e.disabled,
1145
- placement: e.placement,
1146
- onOnChange: m
1151
+ transfer: t.transfer,
1152
+ placeholder: t.placeholder,
1153
+ disabled: t.disabled,
1154
+ placement: t.placement,
1155
+ onOnChange: g
1147
1156
  }, null, 8, ["modelValue", "type", "clearable", "split-panels", "options", "transfer", "placeholder", "disabled", "placement"]);
1148
1157
  };
1149
1158
  }
1150
- }), mt = { class: "mcalendar" }, gt = {
1159
+ }), bt = {
1151
1160
  name: "MCalendar"
1152
- }, pt = /* @__PURE__ */ U({
1153
- ...gt,
1161
+ }, yt = /* @__PURE__ */ _({
1162
+ ...bt,
1154
1163
  props: {
1155
1164
  /**
1156
1165
  * 指定日期,默认显示该日期所在月份
@@ -1167,7 +1176,7 @@ const A = {
1167
1176
  startDay: {
1168
1177
  type: Number,
1169
1178
  default: 1,
1170
- validator: (e) => e > -1 && e < 7
1179
+ validator: (t) => t > -1 && t < 7
1171
1180
  },
1172
1181
  /**
1173
1182
  * 休息日,默认周六周日
@@ -1256,173 +1265,175 @@ const A = {
1256
1265
  }
1257
1266
  },
1258
1267
  emits: ["update:range", "select-range", "click-day", "dblclick-day"],
1259
- setup(e, { emit: S }) {
1260
- const t = pe().appContext.config.globalProperties.$Date, l = e, a = S, n = H(), i = H(null), m = H(null), d = N(() => {
1261
- let s = Math.floor(l.startDay);
1262
- return (isNaN(s) || s < 0 || s > 6) && (s = 0), s;
1263
- }), v = N(() => {
1264
- let s;
1265
- const k = [], r = d.value + 7;
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;
1266
1275
  for (let B = d.value; B < r; B++)
1267
- s = B % 7, k.push({
1268
- title: l.weekMap?.[s] || A.t(`mCalendar.${l.weekType}.${s}`),
1269
- order: s
1276
+ c = B % 7, S.push({
1277
+ title: e.weekMap?.[c] || M.t(`mCalendar.${e.weekType}.${c}`),
1278
+ order: c
1270
1279
  });
1271
- return k;
1272
- }), c = (s) => {
1273
- let k = t(
1274
- l.date || l.dates && l.dates[0] && l.dates[0][l.dateKey]
1275
- ), r, B, p;
1276
- return l.isOnFirstLine ? r = k : (r = k.startOf("month"), B = k.endOf("month")), p = r.day(), d.value !== 0 && p === 0 && (p = 7), k = r.subtract(p - d.value, "day"), l.isOnFirstLine && (B = k.add(41, "day")), {
1277
- beginDate: k.format("YYYY-MM-DD"),
1280
+ return S;
1281
+ }), v = (c) => {
1282
+ let S = a(
1283
+ 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"),
1278
1287
  endDate: B?.format("YYYY-MM-DD"),
1279
- extra: [k, l.isOnFirstLine ? k : r, B]
1288
+ extra: [S, e.isOnFirstLine ? S : r, B]
1280
1289
  };
1281
- }, f = () => {
1282
- l.hasRange && (i.value = m.value = null);
1290
+ }, u = () => {
1291
+ e.hasRange && (i.value = g.value = null);
1283
1292
  const {
1284
- extra: [s, k, r]
1285
- } = c(), B = l.dates?.[0] ? l.dates.slice() : [], p = /* @__PURE__ */ new Date();
1286
- let o, D, L;
1293
+ extra: [c, S, r]
1294
+ } = v(), B = e.dates?.[0] ? e.dates.slice() : [], h = /* @__PURE__ */ new Date();
1295
+ let o, V, K;
1287
1296
  for (n.value = [], o = 0; o < 42; o++)
1288
- D = s.add(o, "day"), L = B.find((J) => D.isSame(J[l.dateKey], "day")), n.value.push({
1289
- _date: D.toDate(),
1290
- _text: D.format(l.textFormat),
1291
- _isOuter: D.isBefore(k, "day") || D.isAfter(r, "day"),
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"),
1292
1301
  //!eachDay.isBetween(start, end, 'day', '[]'),
1293
- _isToday: D.isSame(p, "day"),
1302
+ _isToday: V.isSame(h, "day"),
1294
1303
  // _rangeStart: undefined,
1295
1304
  // _rangeEnd: undefined,
1296
1305
  _inRange: void 0,
1297
- ...L
1306
+ ...K
1298
1307
  });
1299
1308
  };
1300
- let b;
1301
- const u = (s, k) => {
1302
- const r = l.hasRange && (!s._isOuter || l.outerInRange);
1309
+ let x;
1310
+ const s = (c, S) => {
1311
+ const r = e.hasRange && (!c._isOuter || e.outerInRange);
1303
1312
  if (r)
1304
1313
  if (!i.value)
1305
- i.value = s, s._inRange = !0;
1306
- else if (m.value)
1307
- i.value = m.value = null, n.value.forEach((B) => {
1314
+ i.value = c, c._inRange = !0;
1315
+ else if (g.value)
1316
+ i.value = g.value = null, n.value.forEach((B) => {
1308
1317
  B._inRange = !1;
1309
- }), l.clearable || (i.value = s);
1318
+ }), e.clearable || (i.value = c);
1310
1319
  else {
1311
- if (s._date < i.value._date) {
1320
+ if (c._date < i.value._date) {
1312
1321
  const B = i.value;
1313
- i.value = s, s = B;
1322
+ i.value = c, c = B;
1314
1323
  }
1315
- m.value = s, s._inRange = !0;
1324
+ g.value = c, c._inRange = !0;
1316
1325
  }
1317
- a("click-day", s, k), r && (b = !0, Q(() => {
1318
- b = null;
1319
- }), a("update:range", [i.value, m.value]), a(
1326
+ l("click-day", c, S), r && (x = !0, q(() => {
1327
+ x = null;
1328
+ }), l("update:range", [i.value, g.value]), l(
1320
1329
  "select-range",
1321
- [i.value, m.value],
1330
+ [i.value, g.value],
1322
1331
  n.value.slice(
1323
1332
  n.value.indexOf(i.value),
1324
- n.value.indexOf(m.value) + 1
1333
+ n.value.indexOf(g.value) + 1
1325
1334
  )
1326
1335
  ));
1327
- }, R = (s, k) => {
1328
- a("dblclick-day", s, k);
1329
- }, y = (s, k) => {
1330
- if (!l.hasRange || !i.value || m.value || s._isOuter && !l.outerInRange)
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)
1331
1340
  return;
1332
1341
  let r = n.value.indexOf(i.value);
1333
- if (k < r) {
1342
+ if (S < r) {
1334
1343
  const B = r;
1335
- r = k, k = B;
1344
+ r = S, S = B;
1336
1345
  }
1337
- n.value.forEach((B, p) => {
1338
- B._inRange = p >= r && p <= k;
1346
+ n.value.forEach((B, h) => {
1347
+ B._inRange = h >= r && h <= S;
1339
1348
  });
1340
- }, O = (s) => {
1341
- if (!l.hasRange || b) return;
1342
- if (!s || !s.length) {
1343
- i.value = m.value = null, n.value.forEach((o) => {
1349
+ }, T = (c) => {
1350
+ if (!e.hasRange || x) return;
1351
+ if (!c || !c.length) {
1352
+ i.value = g.value = null, n.value.forEach((o) => {
1344
1353
  o._inRange = !1;
1345
1354
  });
1346
1355
  return;
1347
1356
  }
1348
- if (!s[0] || !s[1]) return;
1349
- if (t(s[0]._date).isAfter(s[1]._date)) {
1350
- const o = s[1];
1351
- s[1] = s[0], s[0] = o;
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;
1352
1361
  }
1353
- const k = n.value.length;
1354
- let r, B = -1, p = k;
1355
- for (let o = 0; o < k; o++)
1356
- if (r = t(n.value[o]._date), B < 0 && r.isSame(s[0]._date, "day") && (i.value = n.value[o], B = o), r.isSame(s[1]._date, "day")) {
1357
- m.value = n.value[o], p = o;
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;
1358
1367
  break;
1359
1368
  }
1360
- n.value.forEach((o, D) => {
1361
- o._inRange = D >= B && D <= p;
1369
+ n.value.forEach((o, V) => {
1370
+ o._inRange = V >= B && V <= h;
1362
1371
  });
1363
1372
  };
1364
- return f(), l.range && (i.value = l.range[0], m.value = l.range[1], O(l.range)), F(
1365
- () => l.date,
1366
- (s) => {
1367
- !l.dates && s instanceof Date && f();
1373
+ return u(), e.range && (i.value = e.range[0], g.value = e.range[1], T(e.range)), F(
1374
+ () => e.date,
1375
+ (c) => {
1376
+ !e.dates && c instanceof Date && u();
1368
1377
  }
1369
1378
  ), F(
1370
- () => l.dates,
1371
- (s) => {
1372
- s && f();
1379
+ () => e.dates,
1380
+ (c) => {
1381
+ c && u();
1373
1382
  }
1374
1383
  ), F(
1375
- () => l.startDay,
1384
+ () => e.startDay,
1376
1385
  () => {
1377
- f();
1386
+ u();
1378
1387
  }
1379
- ), F(() => l.range, O), (s, k) => {
1380
- const r = x("Col"), B = x("Row"), p = x("Spin");
1381
- return V(), P("div", mt, [
1382
- $(B, null, {
1383
- default: C(() => [
1384
- (V(!0), P(X, null, ee(v.value, (o, D) => (V(), E(r, {
1385
- key: D,
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,
1386
1397
  span: "4",
1387
- class: ie([
1388
- "mcalendar-title",
1389
- { weekend: e.offDay.includes(o.order) },
1390
- e.titleClass && e.titleClass(o, D)
1398
+ class: P([
1399
+ y(I)("mcalendar-title"),
1400
+ { weekend: t.offDay.includes(o.order) },
1401
+ t.titleClass && t.titleClass(o, V)
1391
1402
  ])
1392
1403
  }, {
1393
- default: C(() => [
1394
- j(z(o.title), 1)
1404
+ default: D(() => [
1405
+ j(H(o.title), 1)
1395
1406
  ]),
1396
1407
  _: 2
1397
1408
  }, 1032, ["class"]))), 128))
1398
1409
  ]),
1399
1410
  _: 1
1400
1411
  }),
1401
- $(B, null, {
1402
- default: C(() => [
1403
- (V(!0), P(X, null, ee(n.value, (o, D) => (V(), E(r, {
1404
- key: D,
1412
+ O(B, null, {
1413
+ default: D(() => [
1414
+ ($(!0), N(Q, null, ee(n.value, (o, V) => ($(), U(r, {
1415
+ key: V,
1405
1416
  span: "4",
1406
- class: ie([
1407
- "mcalendar-cell",
1408
- { "mcalendar-cell_today": o._isToday },
1417
+ class: P([
1418
+ y(I)("mcalendar-cell"),
1419
+ o._isToday && y(I)("mcalendar-cell_today"),
1409
1420
  { outer: o._isOuter },
1410
1421
  { "range-start": o === i.value },
1411
1422
  { "in-range": o._inRange },
1412
- { "range-end": o === m.value },
1413
- e.dateClass && e.dateClass(o, D),
1423
+ { "range-end": o === g.value },
1424
+ t.dateClass && t.dateClass(o, V),
1414
1425
  o.className
1415
1426
  ]),
1416
- onClick: (L) => u(o, D),
1417
- onDblclick: (L) => R(o, D),
1418
- onMouseenter: (L) => y(o, D)
1427
+ onClick: (K) => s(o, V),
1428
+ onDblclick: (K) => b(o, V),
1429
+ onMouseenter: (K) => C(o, V)
1419
1430
  }, {
1420
- default: C(() => [
1421
- I(s.$slots, "cell", {
1431
+ default: D(() => [
1432
+ z(c.$slots, "cell", {
1422
1433
  day: o,
1423
- index: D
1434
+ index: V
1424
1435
  }, () => [
1425
- j(z(o._text), 1)
1436
+ j(H(o._text), 1)
1426
1437
  ])
1427
1438
  ]),
1428
1439
  _: 2
@@ -1430,17 +1441,17 @@ const A = {
1430
1441
  ]),
1431
1442
  _: 3
1432
1443
  }),
1433
- ue($(p, { fix: "" }, null, 512), [
1434
- [re, e.loading]
1444
+ ae(O(h, { fix: "" }, null, 512), [
1445
+ [ue, t.loading]
1435
1446
  ])
1436
- ]);
1447
+ ], 2);
1437
1448
  };
1438
1449
  }
1439
- }), ht = {
1450
+ }), kt = {
1440
1451
  name: "ModalFooter",
1441
1452
  inheritAttrs: !1
1442
- }, vt = /* @__PURE__ */ U({
1443
- ...ht,
1453
+ }, Ct = /* @__PURE__ */ _({
1454
+ ...kt,
1444
1455
  props: {
1445
1456
  modelValue: Boolean,
1446
1457
  /**
@@ -1495,75 +1506,75 @@ const A = {
1495
1506
  }
1496
1507
  },
1497
1508
  emits: ["update:modelValue", "ok", "cancel"],
1498
- setup(e, { emit: S }) {
1499
- const t = S, l = pe(), a = () => {
1500
- l.vnode.props.onCancel ? t("cancel") : t("update:modelValue", !1);
1509
+ setup(t, { emit: k }) {
1510
+ const a = k, e = ve(), l = () => {
1511
+ e.vnode.props.onCancel ? a("cancel") : a("update:modelValue", !1);
1501
1512
  };
1502
1513
  return (n, i) => {
1503
- const m = x("Col"), d = x("Button"), v = x("Row");
1504
- return V(), E(v, {
1514
+ const g = A("Col"), d = A("Button"), p = A("Row");
1515
+ return $(), U(p, {
1505
1516
  justify: "space-between",
1506
1517
  align: "middle"
1507
1518
  }, {
1508
- default: C(() => [
1509
- $(m, null, {
1510
- default: C(() => [
1511
- I(n.$slots, "other")
1519
+ default: D(() => [
1520
+ O(g, null, {
1521
+ default: D(() => [
1522
+ z(n.$slots, "other")
1512
1523
  ]),
1513
1524
  _: 3
1514
1525
  }),
1515
- $(m, { class: "flex" }, {
1516
- default: C(() => [
1517
- e.rightCancel ? (V(), P(X, { key: 1 }, [
1518
- e.hasOk ? (V(), E(d, _({
1526
+ O(g, { class: "flex" }, {
1527
+ default: D(() => [
1528
+ t.rightCancel ? ($(), N(Q, { key: 1 }, [
1529
+ t.hasOk ? ($(), U(d, G({
1519
1530
  key: 0,
1520
- disabled: e.okDisabled,
1521
- loading: e.okLoading
1522
- }, e.ok, {
1531
+ disabled: t.okDisabled,
1532
+ loading: t.okLoading
1533
+ }, t.ok, {
1523
1534
  type: "primary",
1524
- onClick: i[1] || (i[1] = (c) => n.$emit("ok"))
1535
+ onClick: i[1] || (i[1] = (v) => n.$emit("ok"))
1525
1536
  }), {
1526
- default: C(() => [
1527
- j(z(e.okText ?? M(A).t("modalFooter.ok")), 1)
1537
+ default: D(() => [
1538
+ j(H(t.okText ?? y(M).t("modalFooter.ok")), 1)
1528
1539
  ]),
1529
1540
  _: 1
1530
- }, 16, ["disabled", "loading"])) : G("", !0),
1531
- $(d, _({
1532
- disabled: e.cancelDisabled,
1533
- loading: e.cancelLoading,
1534
- type: e.cancelType
1535
- }, e.cancel, { onClick: a }), {
1536
- default: C(() => [
1537
- j(z(e.cancelText ?? M(A).t("modalFooter.cancel")), 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)
1538
1549
  ]),
1539
1550
  _: 1
1540
1551
  }, 16, ["disabled", "loading", "type"])
1541
- ], 64)) : (V(), P(X, { key: 0 }, [
1542
- $(d, _({
1543
- disabled: e.cancelDisabled,
1544
- loading: e.cancelLoading,
1545
- type: e.cancelType
1546
- }, e.cancel, { onClick: a }), {
1547
- default: C(() => [
1548
- j(z(e.cancelText ?? M(A).t("modalFooter.cancel")), 1)
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)
1549
1560
  ]),
1550
1561
  _: 1
1551
1562
  }, 16, ["disabled", "loading", "type"]),
1552
- e.hasOk ? (V(), E(d, _({
1563
+ t.hasOk ? ($(), U(d, G({
1553
1564
  key: 0,
1554
- disabled: e.okDisabled,
1555
- loading: e.okLoading
1556
- }, e.ok, {
1565
+ disabled: t.okDisabled,
1566
+ loading: t.okLoading
1567
+ }, t.ok, {
1557
1568
  type: "primary",
1558
- onClick: i[0] || (i[0] = (c) => n.$emit("ok"))
1569
+ onClick: i[0] || (i[0] = (v) => n.$emit("ok"))
1559
1570
  }), {
1560
- default: C(() => [
1561
- j(z(e.okText ?? M(A).t("modalFooter.ok")), 1)
1571
+ default: D(() => [
1572
+ j(H(t.okText ?? y(M).t("modalFooter.ok")), 1)
1562
1573
  ]),
1563
1574
  _: 1
1564
- }, 16, ["disabled", "loading"])) : G("", !0)
1575
+ }, 16, ["disabled", "loading"])) : W("", !0)
1565
1576
  ], 64)),
1566
- I(n.$slots, "action")
1577
+ z(n.$slots, "action")
1567
1578
  ]),
1568
1579
  _: 3
1569
1580
  })
@@ -1572,13 +1583,13 @@ const A = {
1572
1583
  });
1573
1584
  };
1574
1585
  }
1575
- }), bt = {
1586
+ }), St = {
1576
1587
  key: 0,
1577
1588
  class: "ivu-dropdown-item"
1578
- }, Y = {}, yt = {
1589
+ }, J = {}, Bt = {
1579
1590
  name: "ToggleColumn"
1580
- }, Te = /* @__PURE__ */ U({
1581
- ...yt,
1591
+ }, ze = /* @__PURE__ */ _({
1592
+ ...Bt,
1582
1593
  props: {
1583
1594
  modelValue: {
1584
1595
  type: Array
@@ -1610,126 +1621,128 @@ const A = {
1610
1621
  storeAt: String
1611
1622
  },
1612
1623
  emits: ["update:modelValue", "change"],
1613
- setup(e, { emit: S }) {
1614
- const t = e, l = S;
1615
- let a, n, i;
1616
- const m = (p) => {
1617
- clearTimeout(a);
1624
+ setup(t, { emit: k }) {
1625
+ const a = t, e = k;
1626
+ let l, n, i;
1627
+ const g = (h) => {
1628
+ clearTimeout(l);
1618
1629
  let o = localStorage.getItem(n);
1619
- o = o ? JSON.parse(o) : {}, p ? He(o, Le(i, d)) : Ne(o, i, d), a = setTimeout(() => {
1620
- a = null, localStorage.setItem(n, JSON.stringify(o));
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));
1621
1632
  });
1622
1633
  };
1623
1634
  let d;
1624
- t.storeAt && (n = t.storeAt.split(".")[0], i = t.storeAt.slice(n.length + 1), d = localStorage.getItem(n) && ge(JSON.parse(localStorage[n]), i), d || (d = {}, m(!0)));
1625
- const v = H(!1), c = ye([]), f = H([]), b = N(() => {
1626
- const p = f.value.filter((o) => o._switchable);
1627
- return p.some((o) => o._visible) && p.some((o) => !o._visible);
1628
- }), u = N({
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({
1629
1640
  get() {
1630
- const p = f.value.filter((o) => o._switchable);
1631
- return p.length > 0 && p.every((o) => o._visible);
1641
+ const h = u.value.filter((o) => o._switchable);
1642
+ return h.length > 0 && h.every((o) => o._visible);
1632
1643
  },
1633
- set(p) {
1634
- f.value.forEach((o, D) => {
1635
- o._switchable && (c.value[D]._visible = o._visible = p);
1636
- }), t.storeAt && (f.value.forEach((o, D) => {
1644
+ 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) => {
1637
1648
  d[o.key] = o._visible;
1638
- }), m()), B(), l("change", c.value);
1649
+ }), g()), B(), e("change", v.value);
1639
1650
  }
1640
1651
  });
1641
- function R() {
1642
- const p = f.value.filter((o) => o._visible);
1643
- if (!t.all && p.length === 1) {
1644
- p[0]._switchable = !1;
1652
+ function b() {
1653
+ const h = u.value.filter((o) => o._visible);
1654
+ if (!a.all && h.length === 1) {
1655
+ h[0]._switchable = !1;
1645
1656
  return;
1646
1657
  }
1647
- p.forEach((o) => {
1658
+ h.forEach((o) => {
1648
1659
  o.initSwitchable && !o._switchable && (o._switchable = !0);
1649
1660
  });
1650
1661
  }
1651
- function y(p, o) {
1652
- c.value[o]._visible = p._visible, t.storeAt && (d[p.key] = p._visible, m()), B(), R(), l("change", c.value[o]);
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]);
1653
1664
  }
1654
- let O;
1655
- function s(p) {
1656
- clearTimeout(O), O = setTimeout(() => {
1657
- v.value = p, O = null;
1665
+ let T;
1666
+ function c(h) {
1667
+ clearTimeout(T), T = setTimeout(() => {
1668
+ p.value = h, T = null;
1658
1669
  }, 200);
1659
1670
  }
1660
- function k() {
1661
- (Y[t.cacheId]?.cols || t.modelValue).forEach((p) => {
1662
- p.hasOwnProperty("_visible") || (t.storeAt ? p._visible = d[p.key] === void 0 || d[p.key] : p._visible = !0), p.hasOwnProperty("_switchable") || (p._switchable = !0), c.value.push(p), f.value.push({
1663
- title: p.title || "",
1664
- key: p.key,
1665
- initSwitchable: p._switchable,
1666
- _switchable: p._switchable,
1667
- _visible: p._visible
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
1668
1679
  });
1669
- }), R(), B();
1680
+ }), b(), B();
1670
1681
  }
1671
1682
  let r;
1672
1683
  function B() {
1673
- t.cacheId != null && (Y[t.cacheId].flag = !0, setTimeout(() => {
1674
- Y[t.cacheId].flag = null;
1684
+ a.cacheId != null && (J[a.cacheId].flag = !0, setTimeout(() => {
1685
+ J[a.cacheId].flag = null;
1675
1686
  })), r = !0, setTimeout(() => {
1676
1687
  r = null;
1677
- }), l(
1688
+ }), e(
1678
1689
  "update:modelValue",
1679
- c.value.filter((p) => p._visible)
1690
+ v.value.filter((h) => h._visible)
1680
1691
  );
1681
1692
  }
1682
- return ce(() => {
1683
- t.cacheId != null && (Y[t.cacheId] ? Y[t.cacheId].all++ : Y[t.cacheId] = { cols: t.modelValue, all: 1 }, $e(() => {
1684
- Y[t.cacheId] && --Y[t.cacheId].all < 1 && delete Y[t.cacheId];
1685
- })), k();
1693
+ return me(() => {
1694
+ a.cacheId != null && (J[a.cacheId] ? J[a.cacheId].all++ : J[a.cacheId] = { cols: a.modelValue, all: 1 }, Ae(() => {
1695
+ J[a.cacheId] && --J[a.cacheId].all < 1 && delete J[a.cacheId];
1696
+ })), S();
1686
1697
  }), F(
1687
- () => t.modelValue,
1688
- (p) => {
1689
- r || (Y[t.cacheId] && !Y[t.cacheId].flag && (Y[t.cacheId].cols = p), c.value = [], f.value = [], k());
1698
+ () => a.modelValue,
1699
+ (h) => {
1700
+ r || (J[a.cacheId] && !J[a.cacheId].flag && (J[a.cacheId].cols = h), v.value = [], u.value = [], S());
1690
1701
  }
1691
- ), (p, o) => {
1692
- const D = x("Icon"), L = x("Button"), J = x("Checkbox"), ae = x("DropdownItem"), fe = x("DropdownMenu"), se = x("Dropdown");
1693
- return V(), E(se, {
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, {
1694
1705
  trigger: "custom",
1695
- visible: v.value,
1706
+ visible: p.value,
1696
1707
  placement: "bottom-end",
1697
- transfer: e.transfer,
1698
- "transfer-class-name": "toggle-column-pop",
1699
- class: "toggle-column"
1708
+ transfer: t.transfer,
1709
+ "transfer-class-name": y(I)("toggle-column-pop"),
1710
+ class: P(y(I)("toggle-column"))
1700
1711
  }, {
1701
- list: C(() => [
1712
+ list: D(() => [
1702
1713
  te("div", {
1703
- onMouseenter: o[3] || (o[3] = (K) => s(!0)),
1704
- onMouseleave: o[4] || (o[4] = (K) => s(!1))
1714
+ onMouseenter: o[3] || (o[3] = (Y) => c(!0)),
1715
+ onMouseleave: o[4] || (o[4] = (Y) => c(!1))
1705
1716
  }, [
1706
- e.all ? (V(), P("div", bt, [
1707
- $(J, {
1708
- modelValue: u.value,
1709
- "onUpdate:modelValue": o[2] || (o[2] = (K) => u.value = K),
1710
- indeterminate: b.value
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
1711
1722
  }, {
1712
- default: C(() => [
1713
- j(z(M(A).t("toggleColumn.checkAll")), 1)
1723
+ default: D(() => [
1724
+ j(H(y(M).t("toggleColumn.checkAll")), 1)
1714
1725
  ]),
1715
1726
  _: 1
1716
1727
  }, 8, ["modelValue", "indeterminate"])
1717
- ])) : G("", !0),
1718
- $(fe, { class: "toggle-column-list" }, {
1719
- default: C(() => [
1720
- (V(!0), P(X, null, ee(f.value, (K, me) => (V(), E(ae, {
1721
- key: me,
1722
- disabled: !K._switchable
1728
+ ])) : W("", !0),
1729
+ O(fe, {
1730
+ class: P(y(I)("toggle-column-list"))
1731
+ }, {
1732
+ default: D(() => [
1733
+ ($(!0), N(Q, null, ee(u.value, (Y, de) => ($(), U(be, {
1734
+ key: de,
1735
+ disabled: !Y._switchable
1723
1736
  }, {
1724
- default: C(() => [
1725
- $(J, {
1726
- modelValue: K._visible,
1727
- "onUpdate:modelValue": (Z) => K._visible = Z,
1728
- disabled: !K._switchable,
1729
- onOnChange: (Z) => y(K, me)
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)
1730
1743
  }, {
1731
- default: C(() => [
1732
- j(z(K.title), 1)
1744
+ default: D(() => [
1745
+ j(H(Y.title), 1)
1733
1746
  ]),
1734
1747
  _: 2
1735
1748
  }, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onOnChange"])
@@ -1738,45 +1751,41 @@ const A = {
1738
1751
  }, 1032, ["disabled"]))), 128))
1739
1752
  ]),
1740
1753
  _: 1
1741
- })
1754
+ }, 8, ["class"])
1742
1755
  ], 32)
1743
1756
  ]),
1744
- default: C(() => [
1757
+ default: D(() => [
1745
1758
  te("span", {
1746
- onMouseover: o[0] || (o[0] = (K) => s(!0)),
1747
- onMouseout: o[1] || (o[1] = (K) => s(!1)),
1748
- class: "toggle-column-btn"
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"))
1749
1762
  }, [
1750
- I(p.$slots, "default", {}, () => [
1751
- $(L, {
1763
+ z(h.$slots, "default", {}, () => [
1764
+ O(K, {
1752
1765
  type: "default",
1753
- icon: e.icon
1766
+ icon: t.icon
1754
1767
  }, {
1755
- default: C(() => [
1756
- e.icon ? G("", !0) : (V(), P(X, { key: 0 }, [
1757
- j(z(e.title ?? M(A).t("toggleColumn.title")) + " ", 1),
1758
- $(D, { type: "ios-arrow-down" })
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" })
1759
1772
  ], 64))
1760
1773
  ]),
1761
1774
  _: 1
1762
1775
  }, 8, ["icon"])
1763
1776
  ])
1764
- ], 32)
1777
+ ], 34)
1765
1778
  ]),
1766
1779
  _: 3
1767
- }, 8, ["visible", "transfer"]);
1780
+ }, 8, ["visible", "transfer", "transfer-class-name", "class"]);
1768
1781
  };
1769
1782
  }
1770
- }), kt = {
1771
- class: "page-table-header-title"
1772
- }, Ct = {
1773
- class: "page-table-list"
1774
- }, St = {
1783
+ }), Dt = {
1775
1784
  name: "PageTable"
1776
1785
  // inheritAttrs: false
1777
- }, Bt = /* @__PURE__ */ U({
1778
- ...St,
1779
- props: /* @__PURE__ */ Se({
1786
+ }, Vt = /* @__PURE__ */ _({
1787
+ ...Dt,
1788
+ props: /* @__PURE__ */ xe({
1780
1789
  columns: {
1781
1790
  type: Array,
1782
1791
  default: () => []
@@ -1832,10 +1841,10 @@ const A = {
1832
1841
  */
1833
1842
  pageMap: {
1834
1843
  type: Object,
1835
- default(e) {
1844
+ default(t) {
1836
1845
  return {
1837
- first: e.pageKey,
1838
- pageSize: e.sizeKey
1846
+ first: t.pageKey,
1847
+ pageSize: t.sizeKey
1839
1848
  };
1840
1849
  }
1841
1850
  },
@@ -1845,13 +1854,6 @@ const A = {
1845
1854
  */
1846
1855
  process: Function,
1847
1856
  // loading: Boolean,
1848
- /**
1849
- * 自动设置Table的maxHeight
1850
- */
1851
- autoMaxHeight: {
1852
- type: Boolean,
1853
- default: !0
1854
- },
1855
1857
  /**
1856
1858
  * 是否本地分页
1857
1859
  */
@@ -1869,16 +1871,12 @@ const A = {
1869
1871
  autoRemain: Boolean,
1870
1872
  /**
1871
1873
  * 计算Table的maxHeight时,Table距离视口底部的距离
1872
- * @default 80
1874
+ * @default 45
1873
1875
  */
1874
1876
  bottomDis: {
1875
1877
  type: [Number, String],
1876
- default: 80
1878
+ default: 45
1877
1879
  },
1878
- /**
1879
- * Table的maxHeight
1880
- */
1881
- maxHeight: [Number, String],
1882
1880
  /**
1883
1881
  * 勾选项
1884
1882
  */
@@ -1922,253 +1920,311 @@ const A = {
1922
1920
  /**
1923
1921
  * 传至ToggleColumn组件的storeAt
1924
1922
  */
1925
- storeAt: String
1923
+ storeAt: String,
1924
+ /**
1925
+ * 隐藏分页
1926
+ */
1927
+ hidePage: Boolean,
1928
+ /**
1929
+ * 自动设置Table的maxHeight
1930
+ */
1931
+ autoMaxHeight: {
1932
+ type: Boolean,
1933
+ default: !0
1934
+ },
1935
+ /**
1936
+ * Table的maxHeight
1937
+ */
1938
+ maxHeight: [Number, String],
1939
+ /**
1940
+ * Table的height
1941
+ */
1942
+ height: [Number, String],
1943
+ /**
1944
+ * 自动设置Table的height
1945
+ */
1946
+ autoHeight: Boolean,
1947
+ /**
1948
+ * 最大化时自动计算哪种高度
1949
+ */
1950
+ maximizeHeightType: {
1951
+ type: String,
1952
+ default: "maxHeight"
1953
+ }
1926
1954
  }, {
1927
1955
  loading: {
1928
1956
  type: Boolean
1929
1957
  },
1930
1958
  loadingModifiers: {}
1931
1959
  }),
1932
- emits: /* @__PURE__ */ Se(["update:modelValue", "update:selection", "load", "select-all", "selection-change", "select", "reload", "change-col"], ["update:loading"]),
1933
- setup(e, {
1934
- expose: S,
1935
- emit: t
1960
+ emits: /* @__PURE__ */ xe(["update:modelValue", "update:selection", "load", "select-all", "selection-change", "select", "reload", "change-col", "maximize-change"], ["update:loading"]),
1961
+ setup(t, {
1962
+ expose: k,
1963
+ emit: a
1936
1964
  }) {
1937
- const l = Ee(ze(), ["id", "class", "style"]), a = e, n = t;
1938
- let i;
1939
- const m = je(e, "loading"), d = be("tableRef"), v = be("elRef"), c = H(!1), f = ye(), b = Pe({
1965
+ 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({
1940
1968
  data: [],
1941
1969
  // rows: [] as Obj[],
1942
1970
  // selections: [],
1943
1971
  // loading: false,
1944
- maxHeight: a.maxHeight,
1972
+ height: e.height,
1973
+ maxHeight: e.maxHeight,
1945
1974
  selectType: {
1946
1975
  align: "center",
1947
- className: "page-table-mr0",
1948
- renderHeader: (g) => {
1949
- const h = b.data.filter((w) => w._checkable && !w._disabled), T = h.length;
1976
+ className: I("page-table-mr0"),
1977
+ renderHeader: (m) => {
1978
+ const f = s.data.filter((w) => w._checkable && !w._disabled), R = f.length;
1950
1979
  return (
1951
1980
  // table.rows.some((e) => e._checkable) && (
1952
- b.data.some((w) => w._checkable) && $(Be, {
1953
- "model-value": !!T && h.every((w) => w._checked),
1954
- disabled: !T,
1981
+ s.data.some((w) => w._checkable) && O($e, {
1982
+ "model-value": !!R && f.every((w) => w._checked),
1983
+ disabled: !R,
1955
1984
  "onUpdate:model-value": (w) => {
1956
- h.forEach((W) => {
1957
- W._checked = w;
1985
+ f.forEach((X) => {
1986
+ X._checked = w;
1958
1987
  });
1959
1988
  },
1960
1989
  onOnChange: (w) => {
1961
- J(), n("select-all", a.pure ? h.map((W) => Z(W)) : h, w);
1990
+ se(), l("select-all", e.pure ? f.map((X) => ge(X)) : f, w);
1962
1991
  }
1963
1992
  }, null)
1964
1993
  );
1965
1994
  },
1966
- render: (g, {
1967
- row: h,
1968
- index: T
1969
- }) => h._checkable && $(Be, {
1970
- "model-value": h._checked,
1971
- disabled: h._disabled,
1995
+ render: (m, {
1996
+ row: f,
1997
+ index: R
1998
+ }) => f._checkable && O($e, {
1999
+ "model-value": f._checked,
2000
+ disabled: f._disabled,
1972
2001
  "onUpdate:model-value": (w) => {
1973
- me(b.data[T], w);
2002
+ He(s.data[R], w);
1974
2003
  }
1975
2004
  }, null)
1976
2005
  }
1977
- }), u = De({
2006
+ }), b = Te({
1978
2007
  curr: 1,
1979
- size: 30,
2008
+ size: e.initSize || e.pageSizeOpts[0],
1980
2009
  total: 0
1981
- }), R = N(() => c.value ? !1 : a.transfer), y = N(() => {
1982
- const g = [], h = (T) => {
1983
- T.slot && g.push(T), T.children && T.children.forEach((w) => {
1984
- h(w);
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);
1985
2014
  });
1986
2015
  };
1987
- return a.columns.forEach((T) => {
1988
- h(T);
1989
- }), g;
2016
+ return e.columns.forEach((R) => {
2017
+ f(R);
2018
+ }), m;
1990
2019
  });
1991
- function O() {
1992
- const g = a.columns.find((h) => h.type === "selection");
1993
- if (g) {
1994
- const h = {
2020
+ function c() {
2021
+ const m = e.columns.find((f) => f.type === "selection");
2022
+ if (m) {
2023
+ const f = {
1995
2024
  // fixed: selectType.fixed,
1996
2025
  // key: selectType.key,
1997
- ...g,
1998
- width: g.width || 54,
2026
+ ...m,
2027
+ width: m.width || 54,
1999
2028
  type: void 0,
2000
- ...b.selectType
2029
+ ...s.selectType
2001
2030
  };
2002
- f.value = [h].concat(a.columns.slice(1));
2031
+ x.value = [f].concat(e.columns.slice(1));
2003
2032
  } else
2004
- f.value = a.columns;
2033
+ x.value = e.columns;
2005
2034
  }
2006
- let s;
2007
- async function k() {
2008
- if (typeof a.method != "function") return console.warn("typeof method isn't function");
2009
- m.value = !0, n("update:selection", []);
2010
- const g = await a.method(Object.assign(fe(), typeof a.param != "function" ? a.param : a.param()));
2011
- if (m.value = !1, !g) {
2012
- a.autoRemain || (u.total = 0, n("update:modelValue", []));
2035
+ let S, r, B = 0;
2036
+ async function h() {
2037
+ 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", []));
2013
2045
  return;
2014
2046
  }
2015
- let h = ge(g, a.dataKey) || [];
2016
- if (r(h), typeof a.process == "function") {
2017
- const T = a.process(h);
2018
- Array.isArray(T) && (h = T);
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);
2019
2051
  }
2020
- b.data = h, u.total = ge(g, a.totalKey), s = !0, n("update:modelValue", b.data), n("load", g), setTimeout(() => {
2021
- s = null;
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;
2022
2054
  });
2023
2055
  }
2024
- function r(g) {
2025
- a.columns.some((h) => h.type === "selection") && g.forEach((h) => {
2026
- h._checkable = !0, h._checked = h._disabled = !1;
2056
+ function o(m) {
2057
+ e.columns.some((f) => f.type === "selection") && m.forEach((f) => {
2058
+ f._checkable = !0, f._checked = f._disabled = !1;
2027
2059
  });
2028
2060
  }
2029
- function B(g) {
2030
- typeof a.check == "function" && !a.check() || (a.isLocal ? p(g) : k());
2061
+ function V(m) {
2062
+ typeof e.check == "function" && !e.check() || (e.isLocal ? K(m) : h());
2063
+ }
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", []);
2070
+ }
2071
+ function le() {
2072
+ V(!0);
2031
2073
  }
2032
- function p(g) {
2033
- let h = g ? u.size * (u.curr - 1) : 0;
2034
- const T = [], w = h + u.size, W = w > u.total ? u.total : w, de = a.modelValue;
2035
- for (; h < W; h++)
2036
- de[h]._checked = de[h]._disabled = !1, T.push(de[h]);
2037
- b.data = T, n("update:selection", []);
2074
+ function be(m) {
2075
+ b.size = m, b.curr === 1 && V();
2038
2076
  }
2039
- function o() {
2040
- B(!0);
2077
+ function fe(m) {
2078
+ m !== !0 && (b.curr = 1), q(h);
2041
2079
  }
2042
- function D(g) {
2043
- u.size = g, u.curr === 1 && B();
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);
2044
2084
  }
2045
- function L(g) {
2046
- g !== !0 && (u.curr = 1), Q(k);
2085
+ function Y() {
2086
+ return window.innerHeight - +e.bottomDis - d.value.$el.getBoundingClientRect().top - v.value.$el.offsetHeight;
2047
2087
  }
2048
- function J(g, h) {
2049
- g && (g._checked = h);
2050
- let T = b.data.filter((w) => w._checked);
2051
- a.pure && (T = T.map((w) => Z(w))), n("update:selection", T), n("selection-change", T);
2088
+ function de(m) {
2089
+ q(() => {
2090
+ const f = Y();
2091
+ s[m ? "height" : "maxHeight"] = f > 0 ? f : 0;
2092
+ });
2052
2093
  }
2053
- function ae() {
2054
- Q(() => {
2055
- const g = window.innerHeight - +a.bottomDis - d.value.$el.getBoundingClientRect().top;
2056
- b.maxHeight = g > 0 ? g : 0;
2094
+ function ce() {
2095
+ (e.maximizeHeightType === "height" || e.maximizeHeightType === "maxHeight") && q(() => {
2096
+ const m = Y();
2097
+ s[e.maximizeHeightType] = m > 0 ? m : 0;
2057
2098
  });
2058
2099
  }
2059
- function fe() {
2100
+ function Ve() {
2060
2101
  return {
2061
- [a.pageMap.first]: a.usePageNum ? u.curr : u.size * (u.curr - 1),
2062
- [a.pageMap.pageSize]: u.size
2102
+ [e.pageMap.first]: e.usePageNum ? b.curr : b.size * (b.curr - 1),
2103
+ [e.pageMap.pageSize]: b.size
2063
2104
  };
2064
2105
  }
2065
- let se;
2066
- function K(g, h) {
2067
- !a.clickToCheck || !g._checkable || g._disabled || (se = !0, g = b.data[h], g._checked = !g._checked, J(g, g._checked), n("select", a.pure ? Z(g) : g, g._checked), setTimeout(() => {
2068
- se = null;
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;
2069
2110
  }));
2070
2111
  }
2071
- function me(g, h) {
2072
- se || (J(g, h), n("select", a.pure ? Z(g) : g, h));
2112
+ function He(m, f) {
2113
+ ye || (se(m, f), l("select", e.pure ? ge(m) : m, f));
2073
2114
  }
2074
- function Z(g) {
2075
- const h = {
2076
- ...g
2115
+ function ge(m) {
2116
+ const f = {
2117
+ ...m
2077
2118
  };
2078
- return delete h._checkable, delete h._checked, delete h._disabled, h;
2119
+ return delete f._checkable, delete f._checked, delete f._disabled, f;
2079
2120
  }
2080
- function we() {
2081
- if (a.fullscreen) {
2082
- c.value ? document.exitFullscreen() : v.value.requestFullscreen();
2121
+ function Pe() {
2122
+ if (e.fullscreen) {
2123
+ u.value ? document.exitFullscreen() : p.value.requestFullscreen();
2083
2124
  return;
2084
2125
  }
2085
- c.value = !c.value, c.value ? (setTimeout(ae), document.body.classList.add("clip")) : (b.maxHeight = a.maxHeight ?? i, document.body.classList.remove("clip"));
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);
2128
+ });
2086
2129
  }
2087
- function Ae() {
2088
- m.value || (a.isLocal ? n("reload") : L());
2130
+ function je() {
2131
+ g.value || (e.isLocal ? l("reload") : fe());
2089
2132
  }
2090
- return S({
2091
- search: L,
2092
- setMaxHeight: ae,
2093
- table: b,
2133
+ return k({
2134
+ search: fe,
2135
+ setMaxHeight: de,
2136
+ table: s,
2137
+ sizer: b,
2094
2138
  getPage: () => ({
2095
- ...fe(),
2096
- curr: u.curr,
2097
- total: u.total
2139
+ ...Ve(),
2140
+ curr: b.curr,
2141
+ total: b.total
2098
2142
  })
2099
- }), O(), u.size = a.initSize || a.pageSizeOpts[0], ce(() => {
2100
- !a.maxHeight && a.autoMaxHeight && (ae(), Q(() => {
2101
- i = b.maxHeight;
2102
- })), a.fullscreen && (v.value.onfullscreenchange = () => {
2103
- c.value = !!document.fullscreenElement, c.value ? setTimeout(ae) : b.maxHeight = a.maxHeight ?? i;
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);
2149
+ });
2104
2150
  });
2105
- }), $e(() => {
2106
- v.value.onfullscreenchange = null;
2107
- }), F(() => a.modelValue, (g) => {
2108
- const h = Array.isArray(g) ? g : [];
2109
- if (a.isLocal) {
2110
- u.curr = 1, u.total = h.length, r(h), p();
2151
+ }), Ae(() => {
2152
+ p.value.onfullscreenchange = null;
2153
+ }), F(() => e.modelValue, (m) => {
2154
+ const f = Array.isArray(m) ? m : [];
2155
+ if (e.isLocal) {
2156
+ b.curr = 1, b.total = f.length, o(f), K();
2111
2157
  return;
2112
2158
  }
2113
- s || (u.curr = 1, u.total = h.length, b.data = h);
2159
+ S || (b.curr = 1, b.total = f.length, s.data = f);
2114
2160
  }, {
2115
2161
  immediate: !0
2116
- }), F(() => a.maxHeight, (g) => {
2117
- b.maxHeight = g;
2118
- }), F(() => a.columns, () => {
2119
- O();
2120
- }), (g, h) => {
2121
- const T = x("Col"), w = x("Icon"), W = x("Tooltip"), de = x("Row"), Re = x("Table"), Ie = x("Page");
2122
- return V(), P("div", {
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", {
2123
2171
  ref: "elRef",
2124
- class: ie(["page-table-container", {
2125
- "page-table-bordered": e.border && e.showHeader,
2126
- "page-table-maximized": c.value,
2127
- "page-table-fullscreen": c.value && e.fullscreen
2128
- }])
2129
- }, [e.showHeader ? (V(), E(de, {
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, {
2130
2184
  key: 0,
2131
2185
  justify: "space-between",
2132
2186
  align: "middle",
2133
- class: "page-table-header"
2187
+ class: P(y(I)("page-table-header"))
2134
2188
  }, {
2135
- default: C(() => [$(T, null, {
2136
- default: C(() => [I(g.$slots, "title", {}, () => [te("h1", kt, z(e.title ?? M(A).t("pageTable.title")), 1)])]),
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)])]),
2137
2193
  _: 3
2138
- }), $(T, null, {
2139
- default: C(() => [I(g.$slots, "headerAction"), $(W, {
2194
+ }), O(R, null, {
2195
+ default: D(() => [z(m.$slots, "headerAction"), O(X, {
2140
2196
  placement: "top",
2141
- content: M(A).t("pageTable.reload"),
2142
- transfer: R.value,
2143
- class: "page-table-action"
2197
+ content: y(M).t("pageTable.reload"),
2198
+ transfer: C.value,
2199
+ class: P(y(I)("page-table-action"))
2144
2200
  }, {
2145
- default: C(() => [$(w, {
2201
+ default: D(() => [O(w, {
2146
2202
  type: "md-refresh",
2147
2203
  size: "20",
2148
- onClick: Ae
2204
+ onClick: je
2149
2205
  })]),
2150
2206
  _: 1
2151
- }, 8, ["content", "transfer"]), $(W, {
2207
+ }, 8, ["content", "transfer", "class"]), O(X, {
2152
2208
  placement: "top",
2153
- content: M(A).t(`pageTable.${c.value ? "restore" : "maxmize"}`),
2154
- transfer: R.value,
2155
- class: "page-table-action"
2209
+ content: y(M).t(`pageTable.${u.value ? "restore" : "maxmize"}`),
2210
+ transfer: C.value,
2211
+ class: P(y(I)("page-table-action"))
2156
2212
  }, {
2157
- default: C(() => [$(w, {
2158
- type: c.value ? "md-contract" : "md-expand",
2213
+ default: D(() => [O(w, {
2214
+ type: u.value ? "md-contract" : "md-expand",
2159
2215
  size: "20",
2160
- onClick: we
2216
+ onClick: Pe
2161
2217
  }, null, 8, ["type"])]),
2162
2218
  _: 1
2163
- }, 8, ["content", "transfer"]), $(Te, {
2164
- modelValue: f.value,
2165
- "onUpdate:modelValue": h[0] || (h[0] = (q) => f.value = q),
2219
+ }, 8, ["content", "transfer", "class"]), O(ze, {
2220
+ modelValue: x.value,
2221
+ "onUpdate:modelValue": f[0] || (f[0] = (Z) => x.value = Z),
2166
2222
  size: "20",
2167
- transfer: R.value,
2168
- "store-at": e.storeAt,
2169
- onChange: h[1] || (h[1] = (q) => g.$emit("change-col", q))
2223
+ transfer: C.value,
2224
+ "store-at": t.storeAt,
2225
+ onChange: f[1] || (f[1] = (Z) => m.$emit("change-col", Z))
2170
2226
  }, {
2171
- default: C(() => [$(w, {
2227
+ default: D(() => [O(w, {
2172
2228
  type: "md-settings",
2173
2229
  size: "20"
2174
2230
  })]),
@@ -2177,88 +2233,92 @@ const A = {
2177
2233
  _: 3
2178
2234
  })]),
2179
2235
  _: 3
2180
- })) : G("", !0), te("div", Ct, [$(Re, _({
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({
2181
2239
  ref: "tableRef"
2182
- }, M(l), {
2183
- border: e.border,
2184
- columns: f.value,
2185
- data: b.data,
2186
- loading: m.value,
2187
- "max-height": b.maxHeight,
2188
- onOnRowClick: K
2189
- }), Ve({
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({
2190
2249
  _: 2
2191
- }, [g.$slots.header ? {
2250
+ }, [m.$slots.header ? {
2192
2251
  name: "header",
2193
- fn: C(() => [I(g.$slots, "header")]),
2252
+ fn: D(() => [z(m.$slots, "header")]),
2194
2253
  key: "0"
2195
- } : void 0, ee(y.value, (q) => ({
2196
- name: q.slot,
2197
- fn: C((Me) => [I(g.$slots, q.slot, ke(Ce(Me)))])
2198
- })), g.$slots.footer ? {
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 ? {
2199
2258
  name: "footer",
2200
- fn: C(() => [I(g.$slots, "footer")]),
2259
+ fn: D(() => [z(m.$slots, "footer")]),
2201
2260
  key: "1"
2202
- } : void 0]), 1040, ["border", "columns", "data", "loading", "max-height"]), $(Ie, {
2203
- modelValue: M(u).curr,
2204
- "onUpdate:modelValue": h[2] || (h[2] = (q) => M(u).curr = q),
2205
- total: M(u).total,
2206
- "page-size": M(u).size,
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,
2207
2267
  "show-total": "",
2208
2268
  "show-sizer": "",
2209
2269
  "show-elevator": "",
2210
- transfer: R.value,
2211
- "page-size-opts": e.pageSizeOpts,
2212
- class: "page-table-page-right",
2213
- onOnChange: o,
2214
- onOnPageSizeChange: D
2215
- }, null, 8, ["modelValue", "total", "page-size", "transfer", "page-size-opts"])])], 2);
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);
2216
2276
  };
2217
2277
  }
2218
- }), Dt = [
2219
- Ue,
2220
- Ge,
2221
- Xe,
2278
+ }), Oe = [
2279
+ Qe,
2222
2280
  tt,
2223
2281
  ot,
2224
- xe,
2225
2282
  ut,
2226
- ct,
2283
+ rt,
2284
+ Me,
2227
2285
  ft,
2228
- pt,
2286
+ ht,
2229
2287
  vt,
2230
- Bt,
2231
- Te
2232
- ], Vt = { iviewSelect: Oe };
2233
- function $t(e, S = {}) {
2234
- if (Dt.forEach((t) => {
2235
- e.component(t.name, t);
2236
- }), Object.entries(Vt).forEach((t) => {
2237
- e.directive(t[0], t[1]);
2238
- }), S.i18n) {
2239
- A.i18n = S.i18n, S.msgPrefix && S.msgPrefix !== "d" && (A.prefix = S.msgPrefix);
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) => {
2295
+ t.component(a.name, a);
2296
+ }), Object.entries(xt).forEach((a) => {
2297
+ t.directive(a[0], a[1]);
2298
+ }), k.i18n) {
2299
+ M.i18n = k.i18n, k.msgPrefix && k.msgPrefix !== "d" && (M.prefix = k.msgPrefix);
2240
2300
  return;
2241
2301
  }
2242
- S.msg && (A.msg = S.msg);
2302
+ k.msg && (M.msg = k.msg);
2243
2303
  }
2244
- const Pt = {
2304
+ const jt = {
2245
2305
  install: $t
2246
2306
  };
2247
2307
  export {
2248
- Ue as AllCheckbox,
2249
- Ge as BaseSwitch,
2250
- ot as CacheSelect,
2251
- Xe as Combi,
2252
- tt as CountRange,
2253
- ut as CurdTable,
2254
- ct as DateRange,
2255
- ft as DateRangePicker,
2256
- pt as MCalendar,
2257
- vt as ModalFooter,
2258
- Bt as PageTable,
2259
- xe as RemoteSelect,
2260
- Te as ToggleColumn,
2261
- Pt as default,
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,
2262
2322
  $t as install,
2263
- Oe as iviewSelect
2323
+ Re as iviewSelect
2264
2324
  };