view-ui-plus-derive 0.0.2 → 0.1.0

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