@aplus-frontend/ui 7.15.3 → 7.15.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,101 +1,109 @@
1
- import { Modal as I } from "@aplus-frontend/antdv";
1
+ import { Modal as S } from "@aplus-frontend/antdv";
2
2
  import { isValid as _ } from "@aplus-frontend/utils";
3
- import { ModalMessage as y } from "../enums/modalMessage.mjs";
4
- import { createModal as S } from "./createModal.mjs";
5
- const A = (M, g) => {
6
- const E = g ?? (Array.isArray(M) ? M[0]?.modalId : void 0), n = /* @__PURE__ */ new Map();
7
- let x, u, c = 1e3;
8
- const m = async ({
9
- modalId: r,
10
- params: d,
11
- handleCurrentModal: f,
3
+ import { ModalMessage as m } from "../enums/modalMessage.mjs";
4
+ import { createModal as h } from "./createModal.mjs";
5
+ const A = (u, g) => {
6
+ const E = g ?? (Array.isArray(u) ? u[0]?.modalId : void 0), n = /* @__PURE__ */ new Map();
7
+ let x, M, f = 1e3;
8
+ const y = async ({
9
+ modalId: d,
10
+ params: s,
11
+ handleCurrentModal: p,
12
12
  handleModal: O
13
13
  } = {}) => {
14
- if (!_(r)) {
14
+ if (!_(d)) {
15
15
  l();
16
16
  return;
17
17
  }
18
- x = d;
19
- const s = M.find((t) => t.modalId === r);
20
- let i = !1;
21
- if (u) {
22
- const t = n.get(u), a = {
18
+ x = s;
19
+ const i = u.find((t) => t.modalId === d);
20
+ let c = !1;
21
+ if (M) {
22
+ const t = n.get(M), a = {
23
23
  ...t,
24
24
  destroy: () => {
25
- t?.destroy?.(), n.delete(u);
25
+ t?.destroy?.(), n.delete(M);
26
26
  },
27
27
  open: () => {
28
- i = !0;
28
+ c = !0;
29
29
  }
30
30
  };
31
- await f?.(a), await O?.({
32
- getModal: n.get.bind(n)
31
+ await p?.(a), await O?.({
32
+ getModal: (e) => {
33
+ const r = n.get(e);
34
+ return r ? {
35
+ ...r,
36
+ destroy: () => {
37
+ r?.destroy?.(), n.delete(e);
38
+ }
39
+ } : void 0;
40
+ }
33
41
  });
34
42
  }
35
- return s && setTimeout(() => {
36
- C(s);
37
- }), i;
43
+ return i && setTimeout(() => {
44
+ C(i);
45
+ }), c;
38
46
  }, l = () => {
39
- for (const [r, d] of n)
40
- d?.destroy?.();
41
- }, C = async (r) => {
47
+ for (const [d, s] of n)
48
+ s?.destroy?.();
49
+ }, C = async (d) => {
42
50
  const {
43
- modalId: d,
44
- modalType: f = "createModal",
51
+ modalId: s,
52
+ modalType: p = "createModal",
45
53
  props: O
46
- } = r;
47
- u = d;
48
- const s = n.get(d), i = await O?.(x, async (e) => (a = !0, await m(e)));
49
- c = Math.max(i?.zIndex ?? 0, c), c += 1;
54
+ } = d;
55
+ M = s;
56
+ const i = n.get(s), c = await O?.(x, async (e) => (a = !0, await y(e)));
57
+ f = Math.max(c?.zIndex ?? 0, f), f += 1;
50
58
  let t, a = !1;
51
- if (f === "createModal") {
52
- const e = i, p = async (o) => (a = !0, await m(o));
59
+ if (p === "createModal") {
60
+ const e = c, r = async (o) => (a = !0, await y(o));
53
61
  t = {
54
62
  ...e,
55
63
  destroyOnClose: !1,
56
- zIndex: c,
64
+ zIndex: f,
57
65
  onOk: async (o) => {
58
- const w = await e?.onOk?.(o, p);
66
+ const w = await e?.onOk?.(o, r);
59
67
  if (a || l(), w)
60
- throw new Error(y.NOT_NEED_CLOSE);
68
+ throw new Error(m.NOT_NEED_CLOSE);
61
69
  },
62
70
  onCancel: async (o) => {
63
- const w = await e?.onCancel?.(o, p);
71
+ const w = await e?.onCancel?.(o, r);
64
72
  if (a || l(), w)
65
- throw new Error(y.NOT_NEED_CLOSE);
73
+ throw new Error(m.NOT_NEED_CLOSE);
66
74
  }
67
75
  };
68
76
  } else {
69
- const e = i, p = async (o) => (a = !0, await m(o));
77
+ const e = c, r = async (o) => (a = !0, await y(o));
70
78
  t = {
71
79
  ...e,
72
- zIndex: c,
80
+ zIndex: f,
73
81
  onOk: async () => {
74
- const o = await e?.onOk?.(p);
82
+ const o = await e?.onOk?.(r);
75
83
  if (a || l(), o)
76
- throw new Error(y.NOT_NEED_CLOSE);
84
+ throw new Error(m.NOT_NEED_CLOSE);
77
85
  },
78
86
  onCancel: async () => {
79
- const o = await e?.onCancel?.(p);
87
+ const o = await e?.onCancel?.(r);
80
88
  if (a || l(), o)
81
- throw new Error(y.NOT_NEED_CLOSE);
89
+ throw new Error(m.NOT_NEED_CLOSE);
82
90
  }
83
91
  };
84
92
  }
85
- if (s) {
86
- s?.update(t), s?.open?.();
93
+ if (i) {
94
+ i?.update(t), i?.open?.();
87
95
  return;
88
- } else if (f === "createModal") {
89
- const e = S(t);
90
- e?.open?.(), n.set(d, e);
96
+ } else if (p === "createModal") {
97
+ const e = h(t);
98
+ e?.open?.(), n.set(s, e);
91
99
  } else
92
- I?.[f]?.(t);
93
- }, N = M.find((r) => _(E) && r.modalId === E);
100
+ S?.[p]?.(t);
101
+ }, N = u.find((d) => _(E) && d.modalId === E);
94
102
  if (N !== void 0)
95
103
  return C(N), {
96
104
  getModal: n.get.bind(n),
97
105
  clearAllModal: l,
98
- next: m
106
+ next: y
99
107
  };
100
108
  };
101
109
  export {
@@ -1,46 +1,46 @@
1
- import { useToken as j } from "@aplus-frontend/antdv/es/theme/internal";
2
- import { isBoolean as G, isNumber as h, isObject as b, mergeWith as z, omit as P, isString as R } from "lodash-unified";
3
- import { ref as y, unref as v, watch as T } from "vue";
1
+ import { useToken as G } from "@aplus-frontend/antdv/es/theme/internal";
2
+ import { isBoolean as P, isNumber as b, isObject as h, mergeWith as z, omit as R, isString as U } from "lodash-unified";
3
+ import { ref as y, unref as p, watch as v } from "vue";
4
4
  import "../../config-provider/index.mjs";
5
5
  import { randomStr as E } from "../../utils/index.mjs";
6
- import { getColumnStateString as U } from "../components/setting/utils.mjs";
7
- import { useInjectApTable as W } from "../context.mjs";
8
- import { getTableTitle as X } from "../utils.mjs";
9
- import { useLocale as q } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
11
- function H(t, e, o, a) {
12
- return a ? a.fixed : e ? e.fixed : o && "fixed" in o ? o.fixed : G(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
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(t, e, a, o) {
12
+ return console.log(t, e, a, o), o ? o.fixed : e ? e.fixed : a && "fixed" in a ? a.fixed : P(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
13
13
  }
14
14
  const k = Number.MAX_SAFE_INTEGER, A = E();
15
- function Q(t, e) {
16
- const o = h(t.order) ? t.order : k;
17
- let a = h(e.order) ? e.order : k;
18
- return t.fixed === "right" && e.fixed !== "right" && (a = o - 1), e.fixed === "left" && t.fixed !== "left" && (a = o - 1), o - a;
19
- }
20
15
  function V(t, e) {
16
+ const a = b(t.order) ? t.order : k;
17
+ let o = b(e.order) ? e.order : k;
18
+ return t.fixed === "right" && e.fixed !== "right" && (o = a - 1), e.fixed === "left" && t.fixed !== "left" && (o = a - 1), a - o;
19
+ }
20
+ function Y(t, e) {
21
21
  e && t.removeItem(e);
22
22
  }
23
23
  function I(t, e) {
24
24
  if (!e)
25
25
  return [];
26
- const o = t.getItem(e);
27
- if (!o)
26
+ const a = t.getItem(e);
27
+ if (!a)
28
28
  return [];
29
- const a = JSON.parse(o);
30
- return Array.isArray(a) ? a : (V(t, e), []);
29
+ const o = JSON.parse(a);
30
+ return Array.isArray(o) ? o : (Y(t, e), []);
31
31
  }
32
32
  function N(t, e) {
33
- if (b(t) && b(e))
33
+ if (h(t) && h(e))
34
34
  return z({}, t, e, N);
35
35
  }
36
- const le = (t, e, o) => {
37
- const { columnsBackup: a, size: d } = W(), { t: _ } = q(), { be: L } = D("ap-table"), [Y, O] = j(), s = y(), l = y(
38
- g(
39
- I(localStorage, v(e))
36
+ const le = (t, e, a) => {
37
+ const { columnsBackup: o, size: d } = X(), { t: _ } = D(), { be: L } = H("ap-table"), [Z, O] = G(), s = y(), l = y(
38
+ T(
39
+ I(localStorage, p(e))
40
40
  )
41
41
  );
42
- T(
43
- [a, d],
42
+ v(
43
+ [o, d],
44
44
  ([r, i]) => {
45
45
  r && (s.value = {
46
46
  label: "basic_template",
@@ -50,25 +50,25 @@ const le = (t, e, o) => {
50
50
  });
51
51
  },
52
52
  { immediate: !0, deep: !0 }
53
- ), T(
53
+ ), v(
54
54
  () => e.value,
55
55
  (r) => {
56
- const i = g(
56
+ const i = T(
57
57
  I(localStorage, r)
58
58
  );
59
59
  l.value = i, s.value = {
60
60
  label: "basic_template",
61
- columnState: f(a?.value || []),
61
+ columnState: f(o?.value || []),
62
62
  key: A,
63
63
  size: d?.value
64
- }, o(i ?? []);
64
+ }, a(i ?? []);
65
65
  }
66
66
  );
67
- function g(r) {
67
+ function T(r) {
68
68
  return r.length ? r.map((i) => ({
69
69
  ...i,
70
70
  columnState: f(
71
- a.value,
71
+ o.value,
72
72
  i.columnState,
73
73
  !1
74
74
  )
@@ -77,7 +77,7 @@ const le = (t, e, o) => {
77
77
  label: _("ap.apTable.setting.defaultTemplate"),
78
78
  key: t.getActiveKey?.("DEFAULT_TEMPLATE") ?? E(),
79
79
  size: d?.value,
80
- columnState: f(a?.value || [])
80
+ columnState: f(o?.value || [])
81
81
  }
82
82
  ];
83
83
  }
@@ -88,42 +88,42 @@ const le = (t, e, o) => {
88
88
  i,
89
89
  N
90
90
  );
91
- function S(C, J, M) {
92
- return C.map((u) => {
93
- const m = J?.[u.key] || {}, p = {
91
+ function x(J, M, j) {
92
+ return J.map((u) => {
93
+ const S = M?.[u.key] || {}, m = {
94
94
  key: u.key,
95
- label: R(u.title) ? X(
95
+ label: U(u.title) ? q(
96
96
  u,
97
97
  L("table-header", "title"),
98
98
  void 0,
99
99
  O.value.colorTextTertiary
100
100
  ) : u.title,
101
101
  show: !0,
102
- fixed: H(
102
+ fixed: Q(
103
103
  u,
104
- m,
104
+ i[u.key],
105
105
  n ? t.defaultValue?.[u.key] : void 0,
106
- M
106
+ j
107
107
  ),
108
108
  disabled: !1,
109
- ...P(m, ["children", "fixed"])
109
+ ...R(S, ["children", "fixed"])
110
110
  };
111
- return p.children = u.children?.length ? S(
111
+ return m.children = u.children?.length ? x(
112
112
  u.children,
113
- m.children,
114
- p
115
- ) : void 0, p;
116
- }).sort(Q);
113
+ S.children,
114
+ m
115
+ ) : void 0, m;
116
+ }).sort(V);
117
117
  }
118
- return S(r || [], c);
118
+ return x(r || [], c);
119
119
  }
120
- function x(r) {
121
- if (v(e)) {
120
+ function g(r) {
121
+ if (p(e)) {
122
122
  const i = r.map((n) => ({
123
123
  ...n,
124
- columnState: U(n.columnState)
124
+ columnState: W(n.columnState)
125
125
  }));
126
- localStorage.setItem(v(e), JSON.stringify(i));
126
+ localStorage.setItem(p(e), JSON.stringify(i));
127
127
  }
128
128
  }
129
129
  function B(r) {
@@ -144,16 +144,16 @@ const le = (t, e, o) => {
144
144
  ...i
145
145
  }, l.value[n];
146
146
  }
147
- return T(
147
+ return v(
148
148
  () => l.value,
149
149
  (r) => {
150
- x(r);
150
+ g(r);
151
151
  },
152
152
  { deep: !0, immediate: !0 }
153
153
  ), {
154
154
  basicTemplate: s,
155
155
  customizeTemplateList: l,
156
- syncTemplateListToStorage: x,
156
+ syncTemplateListToStorage: g,
157
157
  addTemplate: B,
158
158
  deleteTemplate: F,
159
159
  updateTemplate: w
@@ -1,2 +1,2 @@
1
- declare const _default: "7.15.3";
1
+ declare const _default: "7.15.4";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.15.3";
1
+ const e = "7.15.4";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("@aplus-frontend/antdv"),N=require("@aplus-frontend/utils"),O=require("../enums/modalMessage.js"),I=require("./createModal.js"),T=(f,S)=>{const m=S??(Array.isArray(f)?f[0]?.modalId:void 0),o=new Map;let x,p,c=1e3;const y=async({modalId:r,params:s,handleCurrentModal:M,handleModal:w}={})=>{if(!N.isValid(r)){d();return}x=s;const l=f.find(t=>t.modalId===r);let i=!1;if(p){const t=o.get(p),n={...t,destroy:()=>{t?.destroy?.(),o.delete(p)},open:()=>{i=!0}};await M?.(n),await w?.({getModal:o.get.bind(o)})}return l&&setTimeout(()=>{g(l)}),i},d=()=>{for(const[r,s]of o)s?.destroy?.()},g=async r=>{const{modalId:s,modalType:M="createModal",props:w}=r;p=s;const l=o.get(s),i=await w?.(x,async e=>(n=!0,await y(e)));c=Math.max(i?.zIndex??0,c),c+=1;let t,n=!1;if(M==="createModal"){const e=i,u=async a=>(n=!0,await y(a));t={...e,destroyOnClose:!1,zIndex:c,onOk:async a=>{const E=await e?.onOk?.(a,u);if(n||d(),E)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)},onCancel:async a=>{const E=await e?.onCancel?.(a,u);if(n||d(),E)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)}}}else{const e=i,u=async a=>(n=!0,await y(a));t={...e,zIndex:c,onOk:async()=>{const a=await e?.onOk?.(u);if(n||d(),a)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)},onCancel:async()=>{const a=await e?.onCancel?.(u);if(n||d(),a)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)}}}if(l){l?.update(t),l?.open?.();return}else if(M==="createModal"){const e=I.createModal(t);e?.open?.(),o.set(s,e)}else _.Modal?.[M]?.(t)},C=f.find(r=>N.isValid(m)&&r.modalId===m);if(C!==void 0)return g(C),{getModal:o.get.bind(o),clearAllModal:d,next:y}};exports.createModalStream=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("@aplus-frontend/antdv"),N=require("@aplus-frontend/utils"),O=require("../enums/modalMessage.js"),T=require("./createModal.js"),h=(f,S)=>{const m=S??(Array.isArray(f)?f[0]?.modalId:void 0),o=new Map;let x,p,M=1e3;const y=async({modalId:s,params:d,handleCurrentModal:u,handleModal:w}={})=>{if(!N.isValid(s)){l();return}x=d;const c=f.find(a=>a.modalId===s);let i=!1;if(p){const a=o.get(p),n={...a,destroy:()=>{a?.destroy?.(),o.delete(p)},open:()=>{i=!0}};await u?.(n),await w?.({getModal:e=>{const r=o.get(e);return r?{...r,destroy:()=>{r?.destroy?.(),o.delete(e)}}:void 0}})}return c&&setTimeout(()=>{g(c)}),i},l=()=>{for(const[s,d]of o)d?.destroy?.()},g=async s=>{const{modalId:d,modalType:u="createModal",props:w}=s;p=d;const c=o.get(d),i=await w?.(x,async e=>(n=!0,await y(e)));M=Math.max(i?.zIndex??0,M),M+=1;let a,n=!1;if(u==="createModal"){const e=i,r=async t=>(n=!0,await y(t));a={...e,destroyOnClose:!1,zIndex:M,onOk:async t=>{const E=await e?.onOk?.(t,r);if(n||l(),E)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)},onCancel:async t=>{const E=await e?.onCancel?.(t,r);if(n||l(),E)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)}}}else{const e=i,r=async t=>(n=!0,await y(t));a={...e,zIndex:M,onOk:async()=>{const t=await e?.onOk?.(r);if(n||l(),t)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)},onCancel:async()=>{const t=await e?.onCancel?.(r);if(n||l(),t)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)}}}if(c){c?.update(a),c?.open?.();return}else if(u==="createModal"){const e=T.createModal(a);e?.open?.(),o.set(d,e)}else _.Modal?.[u]?.(a)},C=f.find(s=>N.isValid(m)&&s.modalId===m);if(C!==void 0)return g(C),{getModal:o.get.bind(o),clearAllModal:l,next:y}};exports.createModalStream=h;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("@aplus-frontend/antdv/es/theme/internal"),s=require("lodash-unified"),c=require("vue");require("../../config-provider/index.js");const q=require("../../utils/index.js"),B=require("../components/setting/utils.js"),F=require("../context.js"),M=require("../utils.js"),C=require("../../config-provider/hooks/use-locale.js"),J=require("../../config-provider/hooks/use-namespace.js");function P(t,e,n,a){return a?a.fixed:e?e.fixed:n&&"fixed"in n?n.fixed:s.isBoolean(t.fixed)?t.fixed?"left":void 0:t.fixed}const b=Number.MAX_SAFE_INTEGER,h=q.randomStr();function U(t,e){const n=s.isNumber(t.order)?t.order:b;let a=s.isNumber(e.order)?e.order:b;return t.fixed==="right"&&e.fixed!=="right"&&(a=n-1),e.fixed==="left"&&t.fixed!=="left"&&(a=n-1),n-a}function W(t,e){e&&t.removeItem(e)}function y(t,e){if(!e)return[];const n=t.getItem(e);if(!n)return[];const a=JSON.parse(n);return Array.isArray(a)?a:(W(t,e),[])}function k(t,e){if(s.isObject(t)&&s.isObject(e))return s.mergeWith({},t,e,k)}const G=(t,e,n)=>{const{columnsBackup:a,size:f}=F.useInjectApTable(),{t:A}=C.useLocale(),{be:N}=J.useNamespace("ap-table"),[R,I]=j.useToken(),m=c.ref(),l=c.ref(p(y(localStorage,c.unref(e))));c.watch([a,f],([r,i])=>{r&&(m.value={label:"basic_template",columnState:d(r),key:h,size:i})},{immediate:!0,deep:!0}),c.watch(()=>e.value,r=>{const i=p(y(localStorage,r));l.value=i,m.value={label:"basic_template",columnState:d(a?.value||[]),key:h,size:f?.value},n(i??[])});function p(r){return r.length?r.map(i=>({...i,columnState:d(a.value,i.columnState,!1)})):[{label:A("ap.apTable.setting.defaultTemplate"),key:t.getActiveKey?.("DEFAULT_TEMPLATE")??q.randomStr(),size:f?.value,columnState:d(a?.value||[])}]}function d(r,i={},u=!0){const T=s.mergeWith({},u?t.defaultValue||{}:{},i,k);function x(O,_,w){return O.map(o=>{const v=_?.[o.key]||{},g={key:o.key,label:s.isString(o.title)?M.getTableTitle(o,N("table-header","title"),void 0,I.value.colorTextTertiary):o.title,show:!0,fixed:P(o,v,u?t.defaultValue?.[o.key]:void 0,w),disabled:!1,...s.omit(v,["children","fixed"])};return g.children=o.children?.length?x(o.children,v.children,g):void 0,g}).sort(U)}return x(r||[],T)}function S(r){if(c.unref(e)){const i=r.map(u=>({...u,columnState:B.getColumnStateString(u.columnState)}));localStorage.setItem(c.unref(e),JSON.stringify(i))}}function z(r){l.value.push(r)}function E(r){const i=l.value.findIndex(u=>u.key===r);l.value.splice(i,1)}function L(r,i){const u=l.value.findIndex(T=>T.key===r);return l.value[u]={...l.value[u],...i},l.value[u]}return c.watch(()=>l.value,r=>{S(r)},{deep:!0,immediate:!0}),{basicTemplate:m,customizeTemplateList:l,syncTemplateListToStorage:S,addTemplate:z,deleteTemplate:E,updateTemplate:L}};exports.useTableTemplateStorage=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("@aplus-frontend/antdv/es/theme/internal"),s=require("lodash-unified"),c=require("vue");require("../../config-provider/index.js");const k=require("../../utils/index.js"),B=require("../components/setting/utils.js"),F=require("../context.js"),M=require("../utils.js"),J=require("../../config-provider/hooks/use-locale.js"),P=require("../../config-provider/hooks/use-namespace.js");function U(t,e,n,a){return console.log(t,e,n,a),a?a.fixed:e?e.fixed:n&&"fixed"in n?n.fixed:s.isBoolean(t.fixed)?t.fixed?"left":void 0:t.fixed}const S=Number.MAX_SAFE_INTEGER,h=k.randomStr();function W(t,e){const n=s.isNumber(t.order)?t.order:S;let a=s.isNumber(e.order)?e.order:S;return t.fixed==="right"&&e.fixed!=="right"&&(a=n-1),e.fixed==="left"&&t.fixed!=="left"&&(a=n-1),n-a}function G(t,e){e&&t.removeItem(e)}function y(t,e){if(!e)return[];const n=t.getItem(e);if(!n)return[];const a=JSON.parse(n);return Array.isArray(a)?a:(G(t,e),[])}function q(t,e){if(s.isObject(t)&&s.isObject(e))return s.mergeWith({},t,e,q)}const R=(t,e,n)=>{const{columnsBackup:a,size:f}=F.useInjectApTable(),{t:A}=J.useLocale(),{be:N}=P.useNamespace("ap-table"),[X,I]=j.useToken(),m=c.ref(),o=c.ref(g(y(localStorage,c.unref(e))));c.watch([a,f],([r,i])=>{r&&(m.value={label:"basic_template",columnState:d(r),key:h,size:i})},{immediate:!0,deep:!0}),c.watch(()=>e.value,r=>{const i=g(y(localStorage,r));o.value=i,m.value={label:"basic_template",columnState:d(a?.value||[]),key:h,size:f?.value},n(i??[])});function g(r){return r.length?r.map(i=>({...i,columnState:d(a.value,i.columnState,!1)})):[{label:A("ap.apTable.setting.defaultTemplate"),key:t.getActiveKey?.("DEFAULT_TEMPLATE")??k.randomStr(),size:f?.value,columnState:d(a?.value||[])}]}function d(r,i={},u=!0){const T=s.mergeWith({},u?t.defaultValue||{}:{},i,q);function x(O,_,w){return O.map(l=>{const b=_?.[l.key]||{},v={key:l.key,label:s.isString(l.title)?M.getTableTitle(l,N("table-header","title"),void 0,I.value.colorTextTertiary):l.title,show:!0,fixed:U(l,i[l.key],u?t.defaultValue?.[l.key]:void 0,w),disabled:!1,...s.omit(b,["children","fixed"])};return v.children=l.children?.length?x(l.children,b.children,v):void 0,v}).sort(W)}return x(r||[],T)}function p(r){if(c.unref(e)){const i=r.map(u=>({...u,columnState:B.getColumnStateString(u.columnState)}));localStorage.setItem(c.unref(e),JSON.stringify(i))}}function z(r){o.value.push(r)}function E(r){const i=o.value.findIndex(u=>u.key===r);o.value.splice(i,1)}function L(r,i){const u=o.value.findIndex(T=>T.key===r);return o.value[u]={...o.value[u],...i},o.value[u]}return c.watch(()=>o.value,r=>{p(r)},{deep:!0,immediate:!0}),{basicTemplate:m,customizeTemplateList:o,syncTemplateListToStorage:p,addTemplate:z,deleteTemplate:E,updateTemplate:L}};exports.useTableTemplateStorage=R;
@@ -1,2 +1,2 @@
1
- declare const _default: "7.15.3";
1
+ declare const _default: "7.15.4";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.15.3";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.15.4";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "7.15.3",
3
+ "version": "7.15.4",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -40,8 +40,8 @@
40
40
  "scroll-into-view-if-needed": "^3.1.0",
41
41
  "vue-virtual-scroller": "2.0.0-beta.8",
42
42
  "vuedraggable": "^4.1.0",
43
- "@aplus-frontend/hooks": "1.0.7",
44
- "@aplus-frontend/utils": "1.0.65"
43
+ "@aplus-frontend/utils": "1.0.65",
44
+ "@aplus-frontend/hooks": "1.0.7"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@aplus-frontend/antdv": "^2.1.4",