@aplus-frontend/ui 7.19.2 → 7.19.4

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.
@@ -1,20 +1,20 @@
1
- import { defineComponent as fe, useSlots as me, ref as k, shallowRef as he, computed as s, onMounted as ve, watch as ye, unref as l, createVNode as m, createElementBlock as M, createBlock as C, openBlock as h, toDisplayString as N, mergeProps as ge, h as Ce, createSlots as be, withCtx as v, createElementVNode as x, normalizeClass as y, createCommentVNode as P, resolveDynamicComponent as L, withModifiers as we, renderList as Oe, renderSlot as Se, normalizeProps as Fe, guardReactiveProps as Be } from "vue";
2
- import { Select as ke, Flex as T, Checkbox as q, Spin as Ne } from "@aplus-frontend/antdv";
3
- import { debounce as xe, isFunction as R, isArray as Ve, isNil as Ae, omit as z, isNumber as Ie } from "lodash-unified";
1
+ import { defineComponent as Oe, useSlots as Se, ref as N, shallowRef as Fe, computed as s, onMounted as Ve, watch as ke, unref as o, createVNode as v, createElementBlock as T, createBlock as O, openBlock as y, toDisplayString as A, mergeProps as xe, h as Be, createSlots as Ne, withCtx as g, createElementVNode as I, normalizeClass as b, createCommentVNode as R, resolveDynamicComponent as z, withModifiers as Ae, renderList as Ie, renderSlot as _e, normalizeProps as De, guardReactiveProps as Me } from "vue";
2
+ import { Select as Le, Flex as E, Checkbox as U, Spin as Pe } from "@aplus-frontend/antdv";
3
+ import { debounce as qe, isFunction as K, isNil as $, isArray as j, omit as H, isNumber as Te } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../utils/index.mjs";
6
- import { useDevWarning as _e } from "../../utils/warning.mjs";
6
+ import { useDevWarning as Re } from "../../utils/warning.mjs";
7
7
  import "../../hooks/index.mjs";
8
- import { useDefaultPlaceholder as De } from "../hooks/use-default-placeholder.mjs";
9
- import Me from "../style/index.mjs";
10
- import { useSelectOptions as Pe } from "./use-select-options.mjs";
11
- import { isDef as V } from "../../utils/is.mjs";
12
- import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
13
- import { useLocale as Le } from "../../config-provider/hooks/use-locale.mjs";
14
- import { useControllableValue as Te } from "../../hooks/useControllableValue.mjs";
15
- const qe = {
8
+ import { useDefaultPlaceholder as ze } from "../hooks/use-default-placeholder.mjs";
9
+ import Ee from "../style/index.mjs";
10
+ import { useSelectOptions as Ue } from "./use-select-options.mjs";
11
+ import { isDef as _ } from "../../utils/is.mjs";
12
+ import { useNamespace as W } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import { useLocale as Ke } from "../../config-provider/hooks/use-locale.mjs";
14
+ import { useControllableValue as $e } from "../../hooks/useControllableValue.mjs";
15
+ const je = {
16
16
  key: 0
17
- }, Re = ["onClick"], et = /* @__PURE__ */ fe({
17
+ }, He = ["onClick"], st = /* @__PURE__ */ Oe({
18
18
  name: "ApFieldSelect",
19
19
  __name: "index",
20
20
  props: {
@@ -181,207 +181,237 @@ const qe = {
181
181
  }
182
182
  },
183
183
  emits: ["update:value"],
184
- setup(U, {
185
- expose: K,
186
- emit: $
184
+ setup(G, {
185
+ expose: J,
186
+ emit: Q
187
187
  }) {
188
- let r = 0;
189
- const b = me(), e = U, {
190
- deprecated: j
191
- } = _e("ApFieldSelect");
192
- j(!V(e.refetchOnFocus), "refetchOnFocus", "fetchOnFocus");
188
+ let i = 0;
189
+ const S = Se(), t = G, {
190
+ deprecated: X
191
+ } = Re("ApFieldSelect");
192
+ X(!_(t.refetchOnFocus), "refetchOnFocus", "fetchOnFocus");
193
193
  const {
194
- b: w
195
- } = E("field-select"), {
196
- b: d
197
- } = E("field-select-popup-option"), H = Me("field"), A = k(!1), I = k(!1), {
198
- t: _
199
- } = Le(), W = xe((t) => {
200
- if (!R(e.request))
194
+ b: F
195
+ } = W("field-select"), {
196
+ b: f
197
+ } = W("field-select-popup-option"), Y = Ee("field"), D = N(!1), M = N(!1), {
198
+ t: L
199
+ } = Ke(), Z = qe((e) => {
200
+ if (!K(t.request))
201
201
  return;
202
- r += 1;
203
- const n = r;
204
- g([]), u.value = !0, e.request(t).then((o) => {
205
- r === n && (g(o), u.value = !1);
202
+ i += 1;
203
+ const n = i;
204
+ w([]), r.value = !0, t.request(e).then((l) => {
205
+ i === n && (w(l), r.value = !1);
206
206
  });
207
- }, e.searchDelay), G = (t, n) => {
208
- const o = e.fieldNames?.label || "label";
209
- return typeof n?.[o] == "string" && n[o].toLowerCase().indexOf(t.toLowerCase()) > -1;
207
+ }, t.searchDelay), ee = (e, n) => {
208
+ const l = t.fieldNames?.label || "label";
209
+ return typeof n?.[l] == "string" && n[l].toLowerCase().indexOf(e.toLowerCase()) > -1;
210
210
  }, {
211
- options: p,
212
- updateOptions: g
213
- } = Pe(e), O = he(), u = k(e?.loading || !1), J = $, Q = s(() => e.fetchOnFocus ?? e.refetchOnFocus), X = s(() => {
214
- if (e.multiple)
215
- return e.tokenSeparators ? "tags" : "multiple";
211
+ options: c,
212
+ updateOptions: w
213
+ } = Ue(t), V = Fe(), r = N(t?.loading || !1), te = Q, ne = s(() => t.fetchOnFocus ?? t.refetchOnFocus), le = s(() => {
214
+ if (t.multiple)
215
+ return t.tokenSeparators ? "tags" : "multiple";
216
216
  });
217
- async function i(t = !0) {
218
- if (!R(e.request))
217
+ async function d(e = !0) {
218
+ if (!K(t.request))
219
219
  return;
220
- u.value = !0, r += 1;
221
- const n = r;
220
+ r.value = !0, i += 1;
221
+ const n = i;
222
222
  try {
223
- t && g([]);
224
- const o = await e.request(void 0, e.params);
225
- if (n !== r)
223
+ e && w([]);
224
+ const l = await t.request(void 0, t.params);
225
+ if (n !== i)
226
226
  return;
227
- g(o);
227
+ w(l);
228
228
  } finally {
229
- u.value = !1;
229
+ r.value = !1;
230
230
  }
231
231
  }
232
- function Y(t) {
233
- !A.value && r === 0 && e.lazy === "first-focus" ? i() : Q.value && !u.value && i(!0), e.onFocus?.(t), A.value = !0;
232
+ function oe(e) {
233
+ !D.value && i === 0 && t.lazy === "first-focus" ? d() : ne.value && !r.value && d(!0), t.onFocus?.(e), D.value = !0;
234
234
  }
235
- function Z(t) {
236
- if (!t) {
237
- e.onDropdownVisibleChange?.(t);
235
+ function ae(e) {
236
+ if (!e) {
237
+ t.onDropdownVisibleChange?.(e);
238
238
  return;
239
239
  }
240
- !I.value && r === 0 && e.lazy === "first-open" ? i() : e.fetchOnOpen && !u.value && i(!0), e.onDropdownVisibleChange?.(t), I.value = !0;
240
+ !M.value && i === 0 && t.lazy === "first-open" ? d() : t.fetchOnOpen && !r.value && d(!0), t.onDropdownVisibleChange?.(e), M.value = !0;
241
241
  }
242
- ve(() => {
243
- if (!e.lazy) {
244
- i();
242
+ Ve(() => {
243
+ if (!t.lazy) {
244
+ d();
245
245
  return;
246
246
  }
247
- }), ye(() => e.params, () => {
248
- i();
247
+ }), ke(() => t.params, () => {
248
+ d();
249
249
  }, {
250
250
  deep: !0
251
251
  });
252
252
  const {
253
- value: f,
254
- updateValue: S
255
- } = Te(e, J), ee = De("Select", e), te = s(() => {
256
- const t = l(f);
257
- if (!t)
258
- return e.emptyText;
259
- const n = e.fieldNames?.label || "label", o = e.fieldNames?.value || "value";
260
- return Ve(t) ? t.map((a) => l(p).find((pe) => pe[o] === a)?.[n]).filter(Boolean).join("、") || e.emptyText : l(p).find((a) => a[o] === t)?.[n] || e.emptyText;
261
- }), ne = s(() => {
262
- const t = !!e?.showSearch, n = e.searchMode;
263
- let o = {};
264
- return t && (o = n === "request" ? {
253
+ value: p,
254
+ updateValue: k
255
+ } = $e(t, te), ue = ze("Select", t), se = s(() => {
256
+ const e = o(p);
257
+ if ($(e))
258
+ return t.emptyText;
259
+ const n = t.fieldNames?.label || "label", l = t.fieldNames?.value || "value";
260
+ return j(e) ? e.map((a) => o(c).find((h) => h[l] === a)?.[n]).filter(Boolean).join("、") || t.emptyText : o(c).find((a) => a[l] === e)?.[n] || t.emptyText;
261
+ }), re = s(() => {
262
+ const e = !!t?.showSearch, n = t.searchMode;
263
+ let l = {};
264
+ return e && (l = n === "request" ? {
265
265
  defaultActiveFirstOption: !1,
266
- onSearch: W,
267
- notFoundContent: u.value ? void 0 : null,
266
+ onSearch: Z,
267
+ notFoundContent: r.value ? void 0 : null,
268
268
  filterOption: !1,
269
269
  suffixIcon: null
270
270
  } : {
271
- filterOption: Ae(e?.filterOption) ? G : e?.filterOption
271
+ filterOption: $(t?.filterOption) ? ee : t?.filterOption
272
272
  }), {
273
- ...z(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect", "onDropdownVisibleChange"]),
274
- placeholder: l(ee),
275
- ...o
273
+ ...H(t, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect", "onDropdownVisibleChange"]),
274
+ placeholder: o(ue),
275
+ ...l
276
276
  };
277
- }), oe = s(() => p.value.map((t) => t[e.fieldNames?.value || "value"])), F = s(() => p.value.filter((t) => !t.disabled).map((t) => t[e.fieldNames?.value || "value"])), D = s(() => !e.multiple || V(e.maxCount) ? !1 : Ie(e.addAll) ? oe.value.length >= e.addAll : !!e.addAll), le = s(() => e.multiple && e.allowOnlySelect && (!V(e.maxCount) || e.maxCount >= 1));
278
- function ae() {
279
- O.value?.focus();
277
+ }), ie = s(() => c.value.map((e) => e[t.fieldNames?.value || "value"])), x = s(() => c.value.filter((e) => !e.disabled).map((e) => e[t.fieldNames?.value || "value"])), P = s(() => !t.multiple || _(t.maxCount) ? !1 : Te(t.addAll) ? ie.value.length >= t.addAll : !!t.addAll), ce = s(() => t.multiple && t.allowOnlySelect && (!_(t.maxCount) || t.maxCount >= 1));
278
+ function de() {
279
+ V.value?.focus();
280
280
  }
281
- function se() {
282
- O.value?.blur();
281
+ function fe() {
282
+ V.value?.blur();
283
283
  }
284
- function B(t, n) {
285
- const o = e.fieldNames?.[n] ?? n;
286
- return o === "groupLabel" ? t[o] ?? t.label : t[o];
284
+ function m(e, n) {
285
+ const l = t.fieldNames?.[n] ?? n;
286
+ return l === "groupLabel" ? e[l] ?? e.label : e[l];
287
287
  }
288
- function ue(t) {
289
- const n = B(t, "value");
290
- S(e.multiple ? [n] : n), e.onChange?.([n], [t]);
288
+ function pe(e) {
289
+ const n = q(e);
290
+ k(t.multiple ? [n] : n), t.onChange?.([n], [e]);
291
291
  }
292
- function re(t) {
293
- return b.option ? m("div", {
294
- class: d("custom")
295
- }, [b.option(t)]) : m("span", {
296
- class: d("label")
297
- }, [B(t, t.options?.length ? "groupLabel" : "label")]);
292
+ function me(e) {
293
+ return S.option ? v("div", {
294
+ class: f("custom")
295
+ }, [S.option(e)]) : v("span", {
296
+ class: f("label")
297
+ }, [m(e, e.options?.length ? "groupLabel" : "label")]);
298
298
  }
299
- const ie = s(() => {
300
- const t = l(f) || [], n = F.value;
301
- return n.length > 0 && n.every((o) => t.includes(o));
302
- }), ce = s(() => {
303
- const t = l(f) || [], n = F.value, o = n.filter((c) => t.includes(c)).length;
304
- return o > 0 && o < n.length;
299
+ const he = s(() => {
300
+ const e = o(p) || [], n = x.value;
301
+ return n.length > 0 && n.every((l) => C(e, l));
302
+ }), ve = s(() => {
303
+ const e = o(p) || [], n = x.value, l = n.filter((u) => C(e, u)).length;
304
+ return l > 0 && l < n.length;
305
305
  });
306
- function de() {
307
- const t = new Set(l(f) || []), n = F.value;
308
- n.length > 0 && n.every((a) => t.has(a)) ? n.forEach((a) => t.delete(a)) : n.forEach((a) => t.add(a));
309
- const c = p.value.filter((a) => t.has(a[e.fieldNames?.value || "value"]));
310
- S([...t]), e.onChange?.([...t], c);
306
+ function B(e, n) {
307
+ return (e.value ?? e) === n;
308
+ }
309
+ const ye = (e) => {
310
+ const n = o(p), l = m(e, "value");
311
+ return j(n) ? !!n.find((u) => B(u, l)) : !1;
312
+ };
313
+ function C(e, n) {
314
+ return e.find((l) => B(l, n)) != null;
315
+ }
316
+ function ge(e, n) {
317
+ return e.findIndex((l) => B(l, n));
318
+ }
319
+ function q(e, n) {
320
+ const l = m(e, "label"), u = n ?? m(e, "value");
321
+ return t.labelInValue ? {
322
+ label: typeof l == "function" ? l() : l,
323
+ originLabel: l,
324
+ value: u,
325
+ key: e?.key ?? u
326
+ } : u;
327
+ }
328
+ function be() {
329
+ const e = [...o(p) || []], n = x.value;
330
+ n.length > 0 && n.every((a) => C(e, a)) ? n.forEach((a) => {
331
+ const h = ge(e, a);
332
+ ~h && e.splice(h, 1);
333
+ }) : n.forEach((a) => {
334
+ if (C(e, a))
335
+ return;
336
+ const h = c.value.find((we) => m(we, "value") === a), Ce = q(h, a);
337
+ e.push(Ce);
338
+ });
339
+ const u = c.value.filter((a) => C(e, m(a, "value")));
340
+ k([...e]), t.onChange?.([...e], u);
311
341
  }
312
- return K({
313
- focus: ae,
314
- blur: se,
315
- request: i
316
- }), (t, n) => t.mode === "read" ? (h(), M("span", qe, N(te.value), 1)) : (h(), C(l(ke), ge({
342
+ return J({
343
+ focus: de,
344
+ blur: fe,
345
+ request: d
346
+ }), (e, n) => e.mode === "read" ? (y(), T("span", je, A(se.value), 1)) : (y(), O(o(Le), xe({
317
347
  key: 1,
318
348
  ref_key: "selectRef",
319
- ref: O,
349
+ ref: V,
320
350
  "allow-clear": ""
321
- }, ne.value, {
322
- mode: X.value,
323
- value: l(f),
324
- options: l(p),
325
- loading: u.value,
326
- "menu-item-selected-icon": Ce("span"),
327
- "popup-class-name": `${l(w)("popup")} ${l(H)}`,
328
- "onUpdate:value": l(S),
329
- onFocus: Y,
330
- onDropdownVisibleChange: Z
331
- }), be({
332
- option: v((o) => [x("div", {
333
- class: y(l(d)("outter"))
334
- }, [m(l(T), {
351
+ }, re.value, {
352
+ mode: le.value,
353
+ value: o(p),
354
+ options: o(c),
355
+ loading: r.value,
356
+ "menu-item-selected-icon": Be("span"),
357
+ "popup-class-name": `${o(F)("popup")} ${o(Y)}`,
358
+ "onUpdate:value": o(k),
359
+ onFocus: oe,
360
+ onDropdownVisibleChange: ae
361
+ }), Ne({
362
+ option: g((l) => [I("div", {
363
+ class: b(o(f)("outter"))
364
+ }, [v(o(E), {
335
365
  justify: "space-between",
336
366
  align: "center",
337
- class: y(l(d)("wrapper")),
367
+ class: b(o(f)("wrapper")),
338
368
  gap: 8
339
369
  }, {
340
- default: v(() => [m(l(T), {
370
+ default: g(() => [v(o(E), {
341
371
  gap: 8,
342
372
  align: "center",
343
- class: y(l(d)("content-wrapper"))
373
+ class: b(o(f)("content-wrapper"))
344
374
  }, {
345
- default: v(() => [D.value ? (h(), C(l(q), {
375
+ default: g(() => [P.value ? (y(), O(o(U), {
346
376
  key: 0,
347
- checked: l(f)?.includes(B(o, "value"))
348
- }, null, 8, ["checked"])) : P("", !0), (h(), C(L(re(o))))]),
377
+ checked: ye(l)
378
+ }, null, 8, ["checked"])) : R("", !0), (y(), O(z(me(l))))]),
349
379
  _: 2
350
- }, 1032, ["class"]), le.value && !o?.disabled ? (h(), M("span", {
380
+ }, 1032, ["class"]), ce.value && !l?.disabled ? (y(), T("span", {
351
381
  key: 0,
352
- class: y(l(d)("action")),
353
- onClick: we(() => ue(o), ["stop"])
354
- }, N(l(_)("ap.field.chooseOnly")), 11, Re)) : P("", !0)]),
382
+ class: b(o(f)("action")),
383
+ onClick: Ae(() => pe(l), ["stop"])
384
+ }, A(o(L)("ap.field.chooseOnly")), 11, He)) : R("", !0)]),
355
385
  _: 2
356
386
  }, 1032, ["class"])], 2)]),
357
387
  _: 2
358
- }, [Oe(l(z)(b, ["option"]), (o, c) => ({
359
- name: c,
360
- fn: v((a) => [Se(t.$slots, c, Fe(Be(a || {})))])
361
- })), u.value ? {
388
+ }, [Ie(o(H)(S, ["option"]), (l, u) => ({
389
+ name: u,
390
+ fn: g((a) => [_e(e.$slots, u, De(Me(a || {})))])
391
+ })), r.value ? {
362
392
  name: "notFoundContent",
363
- fn: v(() => [m(l(Ne), {
393
+ fn: g(() => [v(o(Pe), {
364
394
  size: "small"
365
395
  })]),
366
396
  key: "0"
367
- } : void 0, D.value ? {
397
+ } : void 0, P.value ? {
368
398
  name: "dropdownRender",
369
- fn: v(({
370
- menuNode: o
371
- }) => [x("div", {
399
+ fn: g(({
400
+ menuNode: l
401
+ }) => [I("div", {
372
402
  tabindex: -1,
373
- class: y(l(w)("popup-all-option")),
374
- onClick: de
375
- }, [m(l(q), {
376
- checked: ie.value,
377
- indeterminate: ce.value
378
- }, null, 8, ["checked", "indeterminate"]), x("span", {
379
- class: y(l(w)("popup-all-option-label"))
380
- }, N(l(_)("ap.field.selectAll")), 3)], 2), (h(), C(L(o)))]),
403
+ class: b(o(F)("popup-all-option")),
404
+ onClick: be
405
+ }, [v(o(U), {
406
+ checked: he.value,
407
+ indeterminate: ve.value
408
+ }, null, 8, ["checked", "indeterminate"]), I("span", {
409
+ class: b(o(F)("popup-all-option-label"))
410
+ }, A(o(L)("ap.field.selectAll")), 3)], 2), (y(), O(z(l)))]),
381
411
  key: "1"
382
412
  } : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "onUpdate:value"]));
383
413
  }
384
414
  });
385
415
  export {
386
- et as default
416
+ st as default
387
417
  };
@@ -1,23 +1,23 @@
1
- import { useToken as G } from "@aplus-frontend/antdv/es/theme/internal";
2
- import { isBoolean as P, isNumber as b, isObject as y, mergeWith as E, omit as R, isString as U } from "lodash-unified";
3
- import { ref as k, watch as d, unref as v } from "vue";
1
+ import { useToken as P } from "@aplus-frontend/antdv/es/theme/internal";
2
+ import { isBoolean as R, isNumber as b, isObject as y, mergeWith as E, omit as U, isString as W } from "lodash-unified";
3
+ import { ref as k, watch as s, unref as v } from "vue";
4
4
  import "../../config-provider/index.mjs";
5
5
  import { randomStr as N } from "../../utils/index.mjs";
6
- import { getColumnStateString as W } from "../components/setting/utils.mjs";
7
- import { useInjectApTable as X } from "../context.mjs";
8
- import { getTableTitle as q } from "../utils.mjs";
9
- import { useLocale as D } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs";
11
- function Q(r, e, o, a) {
12
- return a ? a.fixed : e ? e.fixed : o && "fixed" in o ? o.fixed : P(r.fixed) ? r.fixed ? "left" : void 0 : r.fixed;
6
+ import { getColumnStateString as X } from "../components/setting/utils.mjs";
7
+ import { useInjectApTable as q } from "../context.mjs";
8
+ import { getTableTitle as D } from "../utils.mjs";
9
+ import { useLocale as H } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as Q } from "../../config-provider/hooks/use-namespace.mjs";
11
+ function V(r, e, o, a) {
12
+ return a ? a.fixed : e ? e.fixed : o && "fixed" in o ? o.fixed : R(r.fixed) ? r.fixed ? "left" : void 0 : r.fixed;
13
13
  }
14
14
  const A = Number.MAX_SAFE_INTEGER, I = N();
15
- function V(r, e) {
15
+ function Y(r, e) {
16
16
  const o = b(r.order) ? r.order : A;
17
17
  let a = b(e.order) ? e.order : A;
18
18
  return r.fixed === "right" && e.fixed !== "right" && (a = o - 1), e.fixed === "left" && r.fixed !== "left" && (a = o - 1), o - a;
19
19
  }
20
- function Y(r, e) {
20
+ function Z(r, e) {
21
21
  e && r.removeItem(e);
22
22
  }
23
23
  function z(r, e) {
@@ -27,16 +27,16 @@ function z(r, e) {
27
27
  if (!o)
28
28
  return [];
29
29
  const a = JSON.parse(o);
30
- return Array.isArray(a) ? a : (Y(r, e), []);
30
+ return Array.isArray(a) ? a : (Z(r, e), []);
31
31
  }
32
32
  function _(r, e) {
33
33
  if (y(r) && y(e))
34
34
  return E({}, r, e, _);
35
35
  }
36
- const ue = (r, e, o) => {
37
- const { columnsBackup: a, size: s } = X(), { t: L } = D(), { be: O } = H("ap-table"), [Z, B] = G(), m = k(), n = k([]);
36
+ const fe = (r, e, o) => {
37
+ const { columnsBackup: a, size: m } = q(), { t: L } = H(), { be: O } = Q("ap-table"), [$, B] = P(), c = k(), n = k([]);
38
38
  let g;
39
- g = d(
39
+ g = s(
40
40
  () => a?.value,
41
41
  (t, i) => {
42
42
  t?.length && !i?.length && (n.value = T(
@@ -46,35 +46,35 @@ const ue = (r, e, o) => {
46
46
  {
47
47
  immediate: !0
48
48
  }
49
- ), d(
50
- [a, s],
49
+ ), s(
50
+ [a, m],
51
51
  ([t, i]) => {
52
- t && (m.value = {
52
+ t && (c.value = {
53
53
  label: "basic_template",
54
- columnState: f(t),
54
+ columnState: d(t),
55
55
  key: I,
56
56
  size: i
57
57
  });
58
58
  },
59
59
  { immediate: !0, deep: !0 }
60
- ), d(
60
+ ), s(
61
61
  () => e.value,
62
62
  (t) => {
63
63
  const i = T(
64
64
  z(localStorage, t)
65
65
  );
66
- n.value = i, m.value = {
66
+ n.value = i, c.value = {
67
67
  label: "basic_template",
68
- columnState: f(a?.value || []),
68
+ columnState: d(a?.value || []),
69
69
  key: I,
70
- size: s?.value
70
+ size: m?.value
71
71
  }, o(i ?? []);
72
72
  }
73
73
  );
74
74
  function T(t) {
75
75
  return t.length ? t.map((i) => ({
76
76
  ...i,
77
- columnState: f(
77
+ columnState: d(
78
78
  a.value,
79
79
  i.columnState,
80
80
  !1
@@ -83,52 +83,52 @@ const ue = (r, e, o) => {
83
83
  {
84
84
  label: L("ap.apTable.setting.defaultTemplate"),
85
85
  key: r.getActiveKey?.("DEFAULT_TEMPLATE") ?? N(),
86
- size: s?.value,
87
- columnState: f(a?.value || [])
86
+ size: m?.value,
87
+ columnState: d(a?.value || [])
88
88
  }
89
89
  ];
90
90
  }
91
- function f(t, i = {}, l = !0) {
92
- const c = E(
91
+ function d(t, i = {}, l = !0) {
92
+ const p = E(
93
93
  {},
94
94
  l ? r.defaultValue || {} : {},
95
95
  i,
96
96
  _
97
97
  );
98
98
  function h(M, j, C) {
99
- return M.map((u) => {
100
- const S = j?.[u.key] || {}, p = {
99
+ return M.map((u, G) => {
100
+ const S = j?.[u.key] || {}, f = {
101
101
  key: u.key,
102
- label: U(u.title) ? q(
102
+ label: W(u.title) ? D(
103
103
  u,
104
104
  O("table-header", "title"),
105
105
  void 0,
106
106
  B.value.colorTextTertiary
107
107
  ) : u.title,
108
108
  show: !0,
109
- fixed: Q(
109
+ fixed: V(
110
110
  u,
111
111
  i[u.key],
112
112
  l ? r.defaultValue?.[u.key] : void 0,
113
113
  C
114
114
  ),
115
115
  disabled: !1,
116
- ...R(S, ["children", "fixed"])
116
+ ...U(S, ["children", "fixed"])
117
117
  };
118
- return p.children = u.children?.length ? h(
118
+ return f.children = u.children?.length ? h(
119
119
  u.children,
120
120
  S.children,
121
- p
122
- ) : void 0, p;
123
- }).sort(V);
121
+ f
122
+ ) : void 0, f.order = f.order ?? G, f;
123
+ }).sort(Y);
124
124
  }
125
- return h(t || [], c);
125
+ return h(t || [], p);
126
126
  }
127
127
  function x(t) {
128
128
  if (v(e)) {
129
129
  const i = t.map((l) => ({
130
130
  ...l,
131
- columnState: W(l.columnState)
131
+ columnState: X(l.columnState)
132
132
  }));
133
133
  localStorage.setItem(v(e), JSON.stringify(i));
134
134
  }
@@ -144,21 +144,21 @@ const ue = (r, e, o) => {
144
144
  }
145
145
  function J(t, i) {
146
146
  const l = n.value.findIndex(
147
- (c) => c.key === t
147
+ (p) => p.key === t
148
148
  );
149
149
  return n.value[l] = {
150
150
  ...n.value[l],
151
151
  ...i
152
152
  }, n.value[l];
153
153
  }
154
- return d(
154
+ return s(
155
155
  () => n.value,
156
156
  (t) => {
157
157
  t.length && x(t);
158
158
  },
159
159
  { deep: !0, immediate: !0 }
160
160
  ), {
161
- basicTemplate: m,
161
+ basicTemplate: c,
162
162
  customizeTemplateList: n,
163
163
  syncTemplateListToStorage: x,
164
164
  addTemplate: F,
@@ -167,5 +167,5 @@ const ue = (r, e, o) => {
167
167
  };
168
168
  };
169
169
  export {
170
- ue as useTableTemplateStorage
170
+ fe as useTableTemplateStorage
171
171
  };