@aplus-frontend/ui 7.14.0 → 7.14.2

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,32 +1,32 @@
1
- import { defineComponent as ce, ref as v, computed as pe, toRef as me, useSlots as de, createVNode as n, cloneVNode as fe, unref as e, watch as x, createElementBlock as P, openBlock as T, Fragment as ge, createBlock as A, createCommentVNode as j, resolveDynamicComponent as w, withCtx as o, withDirectives as ve, createElementVNode as m, normalizeClass as u, toDisplayString as y, createTextVNode as h, isRef as ye, vShow as Se } from "vue";
2
- import { SettingOutlined as Te, SaveOutlined as Ce } from "@ant-design/icons-vue";
3
- import { Button as F, Modal as be, Divider as B, RadioGroup as he, RadioButton as M, Flex as ke, Space as q, Popover as _e } from "@aplus-frontend/antdv";
1
+ import { defineComponent as me, ref as g, computed as U, toRef as fe, useSlots as de, createVNode as n, cloneVNode as ve, unref as e, watch as w, createElementBlock as E, openBlock as T, Fragment as ge, createBlock as K, createCommentVNode as j, resolveDynamicComponent as B, withCtx as o, withDirectives as ye, createElementVNode as m, normalizeClass as u, toDisplayString as y, createTextVNode as h, isRef as Se, vShow as Te } from "vue";
2
+ import { SettingOutlined as Ce, SaveOutlined as be } from "@ant-design/icons-vue";
3
+ import { Button as F, Modal as he, Divider as N, RadioGroup as ke, RadioButton as M, Flex as _e, Space as q, Popover as ze } from "@aplus-frontend/antdv";
4
4
  import "../../../../ap-button/index.mjs";
5
- import { randomStr as ze } from "../../../../utils/index.mjs";
5
+ import { randomStr as xe } from "../../../../utils/index.mjs";
6
6
  import "../../../../config-provider/index.mjs";
7
- import { getSingleVNode as xe } from "../../../../utils/slot.mjs";
8
- import { useInjectApTable as Ae } from "../../../context.mjs";
9
- import { useTableColumnState as we } from "../../../hooks/use-table-column-state.mjs";
7
+ import { getSingleVNode as Ae } from "../../../../utils/slot.mjs";
8
+ import { useInjectApTable as we } from "../../../context.mjs";
9
+ import { useTableColumnState as Ke } from "../../../hooks/use-table-column-state.mjs";
10
10
  import { useTableTemplateStorage as Be } from "../../../hooks/use-table-template-storage.mjs";
11
- import Ke from "../../../style/setting.mjs";
12
- import { useProvideApColumnSetting as Ne } from "../context.mjs";
11
+ import Ne from "../../../style/setting.mjs";
12
+ import { useProvideApColumnSetting as $e } from "../context.mjs";
13
13
  import "../sorter/index.vue.mjs";
14
14
  import "../template/edit-form.vue.mjs";
15
15
  import "../template/index.vue.mjs";
16
16
  import "../tree-select/index.vue.mjs";
17
- import $e, { customCloneColumnStates as K, isEqualColumnStateIgnoreLabel as Ie } from "../utils.mjs";
18
- import { useLocale as Le } from "../../../../config-provider/hooks/use-locale.mjs";
17
+ import Ie, { customCloneColumnStates as $, isEqualColumnStateIgnoreLabel as Re } from "../utils.mjs";
18
+ import { useLocale as Ve } from "../../../../config-provider/hooks/use-locale.mjs";
19
19
  import { useNamespace as G } from "../../../../config-provider/hooks/use-namespace.mjs";
20
- import Re from "../template/index.vue2.mjs";
21
- import Ve from "../tree-select/index.vue2.mjs";
22
- import De from "../sorter/index.vue2.mjs";
23
- import Oe from "../../../../ap-button/ap-button.vue.mjs";
20
+ import De from "../template/index.vue2.mjs";
21
+ import Le from "../tree-select/index.vue2.mjs";
22
+ import Oe from "../sorter/index.vue2.mjs";
23
+ import Pe from "../../../../ap-button/ap-button.vue.mjs";
24
24
  import Ue from "../template/edit-form.vue2.mjs";
25
25
  const Ee = {
26
26
  style: {
27
27
  "padding-inline": "8px"
28
28
  }
29
- }, pt = /* @__PURE__ */ ce({
29
+ }, mt = /* @__PURE__ */ me({
30
30
  name: "ApTableSetting",
31
31
  __name: "index",
32
32
  props: {
@@ -41,112 +41,118 @@ const Ee = {
41
41
  columnsBackup: J,
42
42
  updateSize: Q,
43
43
  updateColumns: W
44
- } = Ae(), d = v(), k = pe(() => c.config.persistenceKey), C = v(!1), {
44
+ } = we(), f = g(), k = U(() => c.config.persistenceKey), C = g(!1), {
45
45
  basicTemplate: X,
46
- customizeTemplateList: f,
46
+ customizeTemplateList: d,
47
47
  addTemplate: Y,
48
- deleteTemplate: N,
48
+ deleteTemplate: I,
49
49
  updateTemplate: Z
50
- } = Be(c.config, k), {
50
+ } = Be(c.config, k, pe), {
51
51
  columnState: p,
52
- setColumnState: $,
52
+ setColumnState: R,
53
53
  isAllSelected: ee,
54
54
  toggleSelectAll: te
55
- } = we([]), I = `${k.value}__active_key`;
56
- function L(a) {
57
- localStorage.setItem(I, a);
55
+ } = Ke([]), V = U(() => `${k.value}__active_key`);
56
+ function D(a) {
57
+ localStorage.setItem(V.value, a);
58
58
  }
59
- function R() {
60
- return localStorage.getItem(I);
59
+ function _() {
60
+ return localStorage.getItem(V.value);
61
61
  }
62
- const i = v(c.config.defaultActiveKey ?? R() ?? f.value?.[0].key);
63
- Ne({
62
+ const i = g(c.config.defaultActiveKey ?? _() ?? d.value?.[0].key);
63
+ $e({
64
64
  activeKey: i,
65
- cacheConfig: me(c, "config"),
66
- deleteTemplate: re
65
+ cacheConfig: fe(c, "config"),
66
+ deleteTemplate: ue
67
67
  });
68
68
  const {
69
69
  t: r
70
- } = Le(), {
71
- b: g,
70
+ } = Ve(), {
71
+ b: v,
72
72
  be: b
73
73
  } = G("ap-column-setting"), {
74
74
  b: ae
75
- } = G("ap-table"), le = Ke("ap-column-setting"), S = v(!1), V = v(!1), ne = de(), D = xe(ne.trigger) || n(F, {
76
- icon: n(Te, null, null),
75
+ } = G("ap-table"), le = Ne("ap-column-setting"), S = g(!1), L = g(!1), ne = de(), O = Ae(ne.trigger) || n(F, {
76
+ icon: n(Ce, null, null),
77
77
  class: ae("setting-trigger-button")
78
- }, null), O = D ? fe(D, {
78
+ }, null), P = O ? ve(O, {
79
79
  onClick: () => {
80
80
  S.value = !0;
81
81
  }
82
82
  }) : null;
83
83
  function oe() {
84
- $(K(e(X).columnState));
84
+ R($(e(X).columnState));
85
85
  }
86
- function U(a, t) {
87
- W?.($e(e(J), a)), Q?.(t);
86
+ function z(a, t) {
87
+ W?.(Ie(e(J), a)), Q?.(t);
88
88
  }
89
89
  function ie() {
90
- U(e(p), e(d)), S.value = !1;
91
- const a = K(p.value), t = Z(i.value, {
90
+ z(e(p), e(f)), S.value = !1;
91
+ const a = $(p.value), t = Z(i.value, {
92
92
  columnState: a,
93
- size: d.value
93
+ size: f.value
94
94
  });
95
- L(i.value), c.config?.onChange?.(a, t);
95
+ D(i.value), c.config?.onChange?.(a, t);
96
96
  }
97
97
  function se(a) {
98
- const t = c.config.getActiveKey?.(a) ?? ze(), l = {
98
+ const t = c.config.getActiveKey?.(a) ?? xe(), l = {
99
99
  key: t,
100
100
  label: a,
101
101
  columnState: p.value,
102
- size: d.value
102
+ size: f.value
103
103
  };
104
104
  Y(l), C.value = !1, i.value = t, c.config.onChange?.(l.columnState, l);
105
105
  }
106
- function E(a) {
107
- const t = [...f.value].find((l) => l?.key === a);
108
- t && ($(K(t.columnState)), d.value = t.size);
109
- }
110
106
  function re(a) {
107
+ const t = [...d.value].find((l) => l?.key === a);
108
+ t && (R($(t.columnState)), f.value = t.size);
109
+ }
110
+ function ue(a) {
111
111
  if (a !== i.value) {
112
- N(a);
112
+ I(a);
113
113
  return;
114
114
  }
115
- const t = f.value, l = t.findIndex((z) => z.key === a), s = t[l + 1]?.key ?? t[l - 1]?.key;
116
- N(a), i.value = s, L(s);
115
+ const t = d.value, l = t.findIndex((A) => A.key === a), s = t[l + 1]?.key ?? t[l - 1]?.key;
116
+ I(a), i.value = s, D(s);
117
117
  }
118
- function ue(a) {
119
- if (V.value = a, !a) {
120
- const t = R();
118
+ function ce(a) {
119
+ if (L.value = a, !a) {
120
+ const t = _();
121
121
  t && t !== i.value && (i.value = t);
122
122
  }
123
123
  }
124
- x(() => i.value, (a, t) => {
124
+ function pe(a) {
125
+ const t = _() ?? a[0].key;
126
+ i.value = t;
127
+ const l = [...a].find((s) => s?.key === t);
128
+ l && z(l.columnState, l.size);
129
+ }
130
+ w(() => i.value, (a, t) => {
125
131
  if (!t && a) {
126
- const l = [...f.value].find((s) => s?.key === a);
132
+ const l = [...d.value].find((s) => s?.key === a);
127
133
  if (!l)
128
134
  return;
129
- U(l.columnState, l.size);
135
+ z(l.columnState, l.size);
130
136
  }
131
- E(a);
137
+ re(a);
132
138
  }, {
133
139
  immediate: !0
134
140
  });
135
- const _ = v(!1);
136
- return x([d, p, S], ([a, t, l]) => {
141
+ const x = g(!1);
142
+ return w([f, p, S], ([a, t, l]) => {
137
143
  if (!l)
138
144
  return;
139
- const s = f.value.find((z) => z.key === i.value);
140
- s && (s.size !== a || !Ie(t, s.columnState)) ? _.value = !0 : _.value = !1;
145
+ const s = d.value.find((A) => A.key === i.value);
146
+ s && (s.size !== a || !Re(t, s.columnState)) ? x.value = !0 : x.value = !1;
141
147
  }, {
142
148
  deep: !0
143
- }), x(() => i.value, (a) => {
149
+ }), w(() => i.value, (a) => {
144
150
  c.config.onActiveChange?.(a);
145
151
  }, {
146
152
  immediate: !0
147
- }), (a, t) => (T(), P(ge, null, [e(O) ? (T(), A(w(e(O)), {
153
+ }), (a, t) => (T(), E(ge, null, [e(P) ? (T(), K(B(e(P)), {
148
154
  key: 0
149
- })) : j("", !0), n(e(be), {
155
+ })) : j("", !0), n(e(he), {
150
156
  open: S.value,
151
157
  "onUpdate:open": t[4] || (t[4] = (l) => S.value = l),
152
158
  title: e(r)("ap.apTable.setting.title"),
@@ -156,21 +162,21 @@ const Ee = {
156
162
  padding: "0px !important",
157
163
  height: "516px"
158
164
  },
159
- "after-open-change": ue,
160
- "wrap-class-name": `${e(g)()} ${e(le)}`,
165
+ "after-open-change": ce,
166
+ "wrap-class-name": `${e(v)()} ${e(le)}`,
161
167
  "ok-text": e(r)("ap.apTable.setting.saveAndApply"),
162
168
  "mask-closable": !1,
163
169
  onOk: ie
164
170
  }, {
165
171
  footer: o(({
166
172
  extra: l
167
- }) => [n(e(ke), {
173
+ }) => [n(e(_e), {
168
174
  justify: "space-between"
169
175
  }, {
170
176
  default: o(() => [n(e(q), {
171
177
  size: 12
172
178
  }, {
173
- default: o(() => [n(e(_e), {
179
+ default: o(() => [n(e(ze), {
174
180
  open: C.value,
175
181
  "onUpdate:open": t[3] || (t[3] = (s) => C.value = s),
176
182
  trigger: "click",
@@ -182,44 +188,43 @@ const Ee = {
182
188
  onConfirm: se,
183
189
  onCancel: t[2] || (t[2] = () => C.value = !1)
184
190
  })]),
185
- default: o(() => [n(e(Oe), {
191
+ default: o(() => [n(e(Pe), {
186
192
  type: "borderLink",
187
193
  disabled: !a.config.persistenceKey
188
194
  }, {
189
- icon: o(() => [n(e(Ce))]),
195
+ icon: o(() => [n(e(be))]),
190
196
  default: o(() => [h(y(e(r)("ap.apTable.setting.saveAsTemplate")) + " ", 1)]),
191
197
  _: 1
192
198
  }, 8, ["disabled"])]),
193
199
  _: 1
194
- }, 8, ["open"]), _.value ? (T(), P("span", {
200
+ }, 8, ["open"]), x.value ? (T(), E("span", {
195
201
  key: 0,
196
- class: u(e(g)("modify-tip"))
202
+ class: u(e(v)("modify-tip"))
197
203
  }, y(e(r)("ap.apTable.setting.modifyNotification")), 3)) : j("", !0)]),
198
204
  _: 1
199
205
  }), n(e(q), {
200
206
  size: 10
201
207
  }, {
202
- default: o(() => [(T(), A(w(l.cancelBtn))), (T(), A(w(l.okBtn)))]),
208
+ default: o(() => [(T(), K(B(l.cancelBtn))), (T(), K(B(l.okBtn)))]),
203
209
  _: 2
204
210
  }, 1024)]),
205
211
  _: 2
206
212
  }, 1024)]),
207
- default: o(() => [ve(m("div", {
208
- class: u(e(g)("wrapper"))
213
+ default: o(() => [ye(m("div", {
214
+ class: u(e(v)("wrapper"))
209
215
  }, [m("div", {
210
- class: u(e(g)("left"))
211
- }, [n(Re, {
212
- "customize-template-list": e(f),
213
- "persistence-key": k.value,
214
- onActiveChange: E
215
- }, null, 8, ["customize-template-list", "persistence-key"])], 2), n(e(B), {
216
+ class: u(e(v)("left"))
217
+ }, [n(De, {
218
+ "customize-template-list": e(d),
219
+ "persistence-key": k.value
220
+ }, null, 8, ["customize-template-list", "persistence-key"])], 2), n(e(N), {
216
221
  type: "vertical",
217
222
  style: {
218
223
  height: "100%",
219
224
  margin: "0px"
220
225
  }
221
226
  }), m("div", {
222
- class: u(e(g)("center"))
227
+ class: u(e(v)("center"))
223
228
  }, [m("div", {
224
229
  class: u(e(b)("center", "header"))
225
230
  }, [m("div", {
@@ -233,9 +238,9 @@ const Ee = {
233
238
  }, {
234
239
  default: o(() => [h(y(e(ee) ? e(r)("ap.apTable.setting.unSelectAll") : e(r)("ap.apTable.setting.selectAll")), 1)]),
235
240
  _: 1
236
- }, 8, ["onClick"])], 2), n(e(he), {
237
- value: d.value,
238
- "onUpdate:value": t[0] || (t[0] = (l) => d.value = l)
241
+ }, 8, ["onClick"])], 2), n(e(ke), {
242
+ value: f.value,
243
+ "onUpdate:value": t[0] || (t[0] = (l) => f.value = l)
239
244
  }, {
240
245
  default: o(() => [n(e(M), {
241
246
  value: "small"
@@ -249,31 +254,31 @@ const Ee = {
249
254
  _: 1
250
255
  })]),
251
256
  _: 1
252
- }, 8, ["value"])], 2), m("div", Ee, [n(e(B), {
257
+ }, 8, ["value"])], 2), m("div", Ee, [n(e(N), {
253
258
  dashed: "",
254
259
  style: {
255
260
  margin: "0px"
256
261
  }
257
- })]), n(Ve, {
262
+ })]), n(Le, {
258
263
  class: u(e(b)("center", "content")),
259
264
  value: e(p)
260
- }, null, 8, ["class", "value"])], 2), n(e(B), {
265
+ }, null, 8, ["class", "value"])], 2), n(e(N), {
261
266
  type: "vertical",
262
267
  style: {
263
268
  height: "100%",
264
269
  margin: "0px"
265
270
  }
266
271
  }), m("div", {
267
- class: u(e(g)("right"))
268
- }, [n(De, {
272
+ class: u(e(v)("right"))
273
+ }, [n(Oe, {
269
274
  value: e(p),
270
- "onUpdate:value": t[1] || (t[1] = (l) => ye(p) ? p.value = l : null),
275
+ "onUpdate:value": t[1] || (t[1] = (l) => Se(p) ? p.value = l : null),
271
276
  onReset: oe
272
- }, null, 8, ["value"])], 2)], 2), [[Se, V.value]])]),
277
+ }, null, 8, ["value"])], 2)], 2), [[Te, L.value]])]),
273
278
  _: 1
274
279
  }, 8, ["open", "title", "wrap-class-name", "ok-text"])], 64));
275
280
  }
276
281
  });
277
282
  export {
278
- pt as default
283
+ mt as default
279
284
  };
@@ -3,9 +3,6 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
3
3
  type __VLS_Props = {
4
4
  customizeTemplateList: ApColumnTemplate[];
5
5
  persistenceKey: string;
6
- onActiveChange: (nextActiveKey: string) => void;
7
6
  };
8
- declare const _default: DefineComponent<__VLS_Props, {
9
- updateActiveKey: (key: string) => void;
10
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
11
8
  export default _default;
@@ -1,44 +1,40 @@
1
- import { defineComponent as v, createBlock as l, openBlock as a, unref as e, normalizeClass as s, withCtx as d, createElementVNode as r, createVNode as f, toDisplayString as y, createElementBlock as g, Fragment as k, renderList as _ } from "vue";
2
- import { Flex as h, Divider as C } from "@aplus-frontend/antdv";
1
+ import { defineComponent as p, createBlock as l, openBlock as n, unref as e, normalizeClass as r, withCtx as u, createElementVNode as a, createVNode as d, toDisplayString as f, createElementBlock as v, Fragment as k, renderList as _ } from "vue";
2
+ import { Flex as g, Divider as y } from "@aplus-frontend/antdv";
3
3
  import "../../../../config-provider/index.mjs";
4
- import { useInjectApColumnSetting as L } from "../context.mjs";
4
+ import { useInjectApColumnSetting as h } from "../context.mjs";
5
5
  import "./item.vue.mjs";
6
- import { useLocale as x } from "../../../../config-provider/hooks/use-locale.mjs";
7
- import { useNamespace as z } from "../../../../config-provider/hooks/use-namespace.mjs";
8
- import A from "./item.vue2.mjs";
9
- const j = /* @__PURE__ */ v({
6
+ import { useLocale as C } from "../../../../config-provider/hooks/use-locale.mjs";
7
+ import { useNamespace as L } from "../../../../config-provider/hooks/use-namespace.mjs";
8
+ import z from "./item.vue2.mjs";
9
+ const V = /* @__PURE__ */ p({
10
10
  __name: "index",
11
11
  props: {
12
12
  customizeTemplateList: {},
13
- persistenceKey: {},
14
- onActiveChange: { type: Function }
13
+ persistenceKey: {}
15
14
  },
16
- setup(B, { expose: c }) {
17
- const { t: m } = x(), { b: o } = z("ap-column-setting-template-list"), { activeKey: n } = L();
18
- function p(t) {
19
- n.value = t;
15
+ setup(x) {
16
+ const { t: c } = C(), { b: o } = L("ap-column-setting-template-list"), { activeKey: s } = h();
17
+ function m(t) {
18
+ s.value = t;
20
19
  }
21
- function u(t) {
22
- n.value = t;
23
- }
24
- return c({ updateActiveKey: u }), (t, F) => (a(), l(e(h), {
20
+ return (t, B) => (n(), l(e(g), {
25
21
  vertical: "",
26
- class: s(e(o)())
22
+ class: r(e(o)())
27
23
  }, {
28
- default: d(() => [
29
- r("div", {
30
- class: s(e(o)("title"))
31
- }, y(e(m)("ap.apTable.setting.templateSetting")), 3),
32
- f(e(C), { style: { margin: "0" } }),
33
- r("div", {
34
- class: s(e(o)("content"))
24
+ default: u(() => [
25
+ a("div", {
26
+ class: r(e(o)("title"))
27
+ }, f(e(c)("ap.apTable.setting.templateSetting")), 3),
28
+ d(e(y), { style: { margin: "0" } }),
29
+ a("div", {
30
+ class: r(e(o)("content"))
35
31
  }, [
36
- (a(!0), g(k, null, _(t.customizeTemplateList, (i) => (a(), l(A, {
32
+ (n(!0), v(k, null, _(t.customizeTemplateList, (i) => (n(), l(z, {
37
33
  key: i.key,
38
34
  value: i,
39
- "is-active": e(n) === i.key,
35
+ "is-active": e(s) === i.key,
40
36
  "should-remove": t.customizeTemplateList.length > 1,
41
- onClick: () => p(i.key)
37
+ onClick: () => m(i.key)
42
38
  }, null, 8, ["value", "is-active", "should-remove", "onClick"]))), 128))
43
39
  ], 2)
44
40
  ]),
@@ -47,5 +43,5 @@ const j = /* @__PURE__ */ v({
47
43
  }
48
44
  });
49
45
  export {
50
- j as default
46
+ V as default
51
47
  };
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  import { ApColumnTemplate, ApTableSettingType } from '..';
3
- export declare const useTableTemplateStorage: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>) => {
3
+ export declare const useTableTemplateStorage: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>, onPersistenceKeyChange: (templateList: ApColumnTemplate[]) => void) => {
4
4
  basicTemplate: Ref<ApColumnTemplate | undefined, ApColumnTemplate | undefined>;
5
5
  customizeTemplateList: Ref<{
6
6
  columnState: {