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