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