@aplus-frontend/ui 7.12.6 → 7.13.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.
Files changed (168) hide show
  1. package/es/src/ag-grid/components/loading/index.vue.d.ts +3 -0
  2. package/es/src/ag-grid/components/loading/index.vue.mjs +4 -0
  3. package/es/src/ag-grid/components/loading/index.vue2.mjs +18 -0
  4. package/es/src/ag-grid/context.mjs +1 -1
  5. package/es/src/ag-grid/editable/form-item.vue.mjs +33 -31
  6. package/es/src/ag-grid/editable/index.vue.mjs +1 -0
  7. package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
  8. package/es/src/ag-grid/index.vue.mjs +209 -202
  9. package/es/src/ag-grid/interface.d.ts +4 -0
  10. package/es/src/ag-grid/style/index.mjs +8 -5
  11. package/es/src/ap-drawer/interface.d.ts +13 -2
  12. package/es/src/ap-drawer/utils/createDrawer.mjs +37 -32
  13. package/es/src/ap-field/select/index.vue.d.ts +1 -2
  14. package/es/src/ap-field/select/index.vue.mjs +126 -88
  15. package/es/src/ap-field/style/index.mjs +8 -6
  16. package/es/src/ap-field/style/select.d.ts +2 -0
  17. package/es/src/ap-field/style/select.mjs +43 -0
  18. package/es/src/ap-form/context.mjs +1 -1
  19. package/es/src/ap-form/item-group/helper.mjs +2 -2
  20. package/es/src/ap-form/items/select/index.vue.d.ts +4 -8
  21. package/es/src/ap-form/provider/context.mjs +1 -1
  22. package/es/src/ap-grid/utils/table.mjs +2 -2
  23. package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
  24. package/es/src/ap-table/ap-table.vue2.mjs +15 -16
  25. package/es/src/ap-table/components/setting/context.d.ts +17 -0
  26. package/es/src/ap-table/components/setting/context.mjs +18 -0
  27. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  28. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +217 -88
  29. package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
  30. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +49 -51
  31. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  32. package/es/src/ap-table/components/setting/template/edit-form.vue.mjs +4 -0
  33. package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +74 -0
  34. package/es/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  35. package/es/src/ap-table/components/setting/template/index.vue.mjs +4 -0
  36. package/es/src/ap-table/components/setting/template/index.vue2.mjs +51 -0
  37. package/es/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  38. package/es/src/ap-table/components/setting/template/item.vue.mjs +4 -0
  39. package/es/src/ap-table/components/setting/template/item.vue2.mjs +77 -0
  40. package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  41. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +26 -29
  42. package/es/src/ap-table/components/setting/utils.d.ts +1 -0
  43. package/es/src/ap-table/components/setting/utils.mjs +22 -15
  44. package/es/src/ap-table/constants.d.ts +2 -4
  45. package/es/src/ap-table/context.mjs +1 -1
  46. package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  47. package/es/src/ap-table/hooks/use-table-column-state.mjs +32 -120
  48. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  49. package/es/src/ap-table/hooks/use-table-template-storage.mjs +150 -0
  50. package/es/src/ap-table/interface.d.ts +26 -3
  51. package/es/src/ap-table/style/index.d.ts +1 -0
  52. package/es/src/ap-table/style/index.mjs +2 -1
  53. package/es/src/ap-table/style/setting.d.ts +2 -0
  54. package/es/src/ap-table/style/setting.mjs +114 -19
  55. package/es/src/ap-table/utils.mjs +1 -1
  56. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  57. package/es/src/business/ag-grid-modal/style/index.mjs +7 -7
  58. package/es/src/business/ap-attachment/ApAttachment.mjs +96 -89
  59. package/es/src/business/ap-attachment/style/index.mjs +33 -16
  60. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +24 -22
  61. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  62. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +35 -31
  63. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  64. package/es/src/business/ap-batch-action-group/interface.d.ts +1 -1
  65. package/es/src/business/ap-download/hooks/index.mjs +1 -1
  66. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
  67. package/es/src/business/ap-keep-alive/hook.mjs +1 -1
  68. package/es/src/business/ap-keep-alive/utils.mjs +1 -1
  69. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +19 -19
  70. package/es/src/business/ap-upload/components/Picture.vue2.mjs +34 -34
  71. package/es/src/business/ap-value-select-card/style/index.mjs +3 -2
  72. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +21 -21
  73. package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
  74. package/es/src/business/ap-view/style/index.mjs +2 -2
  75. package/es/src/check-card/context.mjs +1 -1
  76. package/es/src/config-provider/constants.mjs +1 -1
  77. package/es/src/config-provider/hooks/use-locale.mjs +1 -1
  78. package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
  79. package/es/src/config-provider/hooks/use-token.mjs +1 -1
  80. package/es/src/design-token/index.mjs +5 -5
  81. package/es/src/editable-table/utils.mjs +1 -1
  82. package/es/src/locale/lang/en.mjs +15 -4
  83. package/es/src/locale/lang/zh-cn.mjs +18 -7
  84. package/es/src/text/context.mjs +1 -1
  85. package/es/src/time-ago/useTimeAgo.mjs +26 -27
  86. package/es/src/utils/data-range-persets.d.ts +13 -1
  87. package/es/src/utils/data-range-persets.mjs +80 -60
  88. package/es/src/utils/index.d.ts +1 -0
  89. package/es/src/utils/index.mjs +56 -48
  90. package/es/src/utils/retry.d.ts +12 -0
  91. package/es/src/utils/retry.mjs +27 -0
  92. package/es/src/utils/slot.mjs +1 -1
  93. package/es/src/version.d.ts +1 -1
  94. package/es/src/version.mjs +1 -1
  95. package/lib/src/ag-grid/components/loading/index.vue.d.ts +3 -0
  96. package/lib/src/ag-grid/components/loading/index.vue.js +1 -0
  97. package/lib/src/ag-grid/components/loading/index.vue2.js +1 -0
  98. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  99. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  100. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
  101. package/lib/src/ag-grid/index.vue.js +1 -1
  102. package/lib/src/ag-grid/interface.d.ts +4 -0
  103. package/lib/src/ag-grid/style/index.js +1 -1
  104. package/lib/src/ap-drawer/interface.d.ts +13 -2
  105. package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
  106. package/lib/src/ap-field/select/index.vue.d.ts +1 -2
  107. package/lib/src/ap-field/select/index.vue.js +1 -1
  108. package/lib/src/ap-field/style/index.js +1 -1
  109. package/lib/src/ap-field/style/select.d.ts +2 -0
  110. package/lib/src/ap-field/style/select.js +1 -0
  111. package/lib/src/ap-form/items/select/index.vue.d.ts +4 -8
  112. package/lib/src/ap-grid/utils/table.js +1 -1
  113. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  114. package/lib/src/ap-table/components/setting/context.d.ts +17 -0
  115. package/lib/src/ap-table/components/setting/context.js +1 -0
  116. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  117. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  118. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
  119. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  120. package/lib/src/ap-table/components/setting/template/edit-form.vue.js +1 -0
  121. package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -0
  122. package/lib/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  123. package/lib/src/ap-table/components/setting/template/index.vue.js +1 -0
  124. package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -0
  125. package/lib/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  126. package/lib/src/ap-table/components/setting/template/item.vue.js +1 -0
  127. package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -0
  128. package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  129. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  130. package/lib/src/ap-table/components/setting/utils.d.ts +1 -0
  131. package/lib/src/ap-table/components/setting/utils.js +1 -1
  132. package/lib/src/ap-table/constants.d.ts +2 -4
  133. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  134. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  135. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  136. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -0
  137. package/lib/src/ap-table/interface.d.ts +26 -3
  138. package/lib/src/ap-table/style/index.d.ts +1 -0
  139. package/lib/src/ap-table/style/index.js +1 -1
  140. package/lib/src/ap-table/style/setting.d.ts +2 -0
  141. package/lib/src/ap-table/style/setting.js +1 -1
  142. package/lib/src/business/ag-grid-modal/style/index.js +1 -1
  143. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  144. package/lib/src/business/ap-attachment/style/index.js +1 -1
  145. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  146. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  147. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
  148. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  149. package/lib/src/business/ap-batch-action-group/interface.d.ts +1 -1
  150. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  151. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  152. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  153. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  154. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  155. package/lib/src/business/ap-view/style/index.js +1 -1
  156. package/lib/src/design-token/index.js +1 -1
  157. package/lib/src/locale/lang/en.js +1 -1
  158. package/lib/src/locale/lang/zh-cn.js +1 -1
  159. package/lib/src/time-ago/useTimeAgo.js +1 -1
  160. package/lib/src/utils/data-range-persets.d.ts +13 -1
  161. package/lib/src/utils/data-range-persets.js +1 -1
  162. package/lib/src/utils/index.d.ts +1 -0
  163. package/lib/src/utils/index.js +1 -1
  164. package/lib/src/utils/retry.d.ts +12 -0
  165. package/lib/src/utils/retry.js +1 -0
  166. package/lib/src/version.d.ts +1 -1
  167. package/lib/src/version.js +1 -1
  168. package/package.json +2 -2
@@ -1,134 +1,46 @@
1
- import { useToken as D } from "@aplus-frontend/antdv/es/theme/internal";
2
- import { isObject as v, mergeWith as A, isBoolean as G, omit as W, isString as X, isNumber as T } from "lodash-unified";
3
- import { ref as q, shallowRef as H, unref as i, computed as L, watchEffect as P } from "vue";
4
- import "../../config-provider/index.mjs";
1
+ import { ref as d, computed as h, unref as n } from "vue";
5
2
  import "../../utils/index.mjs";
6
- import Q, { customCloneColumnStates as b, getColumnStateString as U } from "../components/setting/utils.mjs";
7
- import { useInjectApTable as V } from "../context.mjs";
8
- import { getTableTitle as Y } from "../utils.mjs";
9
- import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { isDef as $ } from "../../utils/is.mjs";
11
- function c(r, o) {
12
- r.forEach((n) => {
13
- o(n), n.children?.length && c(n.children, o);
3
+ import { isDef as w } from "../../utils/is.mjs";
4
+ function r(s, e) {
5
+ s.forEach((l) => {
6
+ e(l), l.children?.length && r(l.children, e);
14
7
  });
15
8
  }
16
- function K(r, o) {
17
- if (!o)
18
- return {};
19
- const n = r.getItem(o);
20
- return n ? JSON.parse(n) : {};
21
- }
22
- function N(r, o) {
23
- if (v(r) && v(o))
24
- return A({}, r, o, N);
25
- }
26
- const y = Number.MAX_SAFE_INTEGER;
27
- function ee(r, o, n, a) {
28
- return a ? a.fixed : o ? o.fixed : n && "fixed" in n ? n.fixed : G(r.fixed) ? r.fixed ? "left" : void 0 : r.fixed;
29
- }
30
- const de = (r, o, n) => {
31
- const { be: a } = Z("ap-table"), [te, B] = D(), l = q(n), d = H(
32
- b(n)
33
- ), { columnsBackup: m, updateColumns: E } = V(), F = r.persistenceType || "localStorage", h = window[F];
34
- function I() {
35
- const e = K(
36
- h,
37
- i(o)
38
- ), t = A(
39
- {},
40
- r.defaultValue || {},
41
- e,
42
- N
43
- ), s = i(m);
44
- function u(R, j, z) {
45
- return R.map((f) => {
46
- const k = j?.[f.key] || {}, g = {
47
- key: f.key,
48
- label: X(f.title) ? Y(
49
- f,
50
- a("table-header", "title"),
51
- void 0,
52
- B.value.colorTextTertiary
53
- ) : f.title,
54
- show: !0,
55
- fixed: ee(
56
- f,
57
- e[f.key],
58
- r.defaultValue?.[f.key],
59
- z
60
- ),
61
- disabled: !1,
62
- ...W(k, ["children", "fixed"])
63
- };
64
- return g.children = f.children?.length ? u(
65
- f.children,
66
- k.children,
67
- g
68
- ) : void 0, g;
69
- }).sort(O);
70
- }
71
- return u(s || [], t);
72
- }
73
- function O(e, t) {
74
- const s = T(e.order) ? e.order : y;
75
- let u = T(t.order) ? t.order : y;
76
- return e.fixed === "right" && t.fixed !== "right" && (u = s - 1), t.fixed === "left" && e.fixed !== "left" && (u = s - 1), s - u;
77
- }
78
- const p = L(() => i(l).every((e) => e.show));
79
- function S() {
80
- const e = i(l);
81
- c(e, (t) => {
82
- !t.disabled && (t.show = !0);
9
+ const A = (s) => {
10
+ const e = d(s), l = h(() => n(e).every((t) => t.show));
11
+ function f() {
12
+ const t = n(e);
13
+ r(t, (o) => {
14
+ !o.disabled && (o.show = !0);
83
15
  });
84
16
  }
85
- function x() {
86
- const e = i(l);
87
- c(e, (t) => {
88
- !t.disabled && (t.show = !1);
17
+ function i() {
18
+ const t = n(e);
19
+ r(t, (o) => {
20
+ !o.disabled && (o.show = !1);
89
21
  });
90
22
  }
91
- function _() {
92
- i(p) ? x() : S();
23
+ function u() {
24
+ n(l) ? i() : f();
93
25
  }
94
- function J(e, t) {
95
- c(i(l), (s) => {
96
- s.key === e && (s.show = $(t) ? t : !s.show);
26
+ function a(t, o) {
27
+ r(n(e), (c) => {
28
+ c.key === t && (c.show = w(o) ? o : !c.show);
97
29
  });
98
30
  }
99
- function C(e) {
100
- l.value = e;
101
- }
102
- function M(e) {
103
- d.value = e;
104
- }
105
- function w(e) {
106
- if (i(o)) {
107
- const t = U(e);
108
- h.setItem(i(o), JSON.stringify(t));
109
- }
110
- }
111
- return P(() => {
112
- const e = I();
113
- C(e), r.onChange?.(e), E?.(
114
- Q(
115
- i(m),
116
- i(e)
117
- )
118
- ), d.value = b(e), w(e);
119
- }), {
120
- columnState: l,
121
- selectAll: S,
122
- unSelectAll: x,
123
- toggleSelect: J,
124
- setColumnState: C,
125
- isAllSelected: p,
126
- toggleSelectAll: _,
127
- columnStateBackup: d,
128
- setColumnStateBackup: M,
129
- cacheColumnStateIfNeeded: w
31
+ function S(t) {
32
+ e.value = t;
33
+ }
34
+ return {
35
+ columnState: e,
36
+ selectAll: f,
37
+ unSelectAll: i,
38
+ toggleSelect: a,
39
+ setColumnState: S,
40
+ isAllSelected: l,
41
+ toggleSelectAll: u
130
42
  };
131
43
  };
132
44
  export {
133
- de as useTableColumnState
45
+ A as useTableColumnState
134
46
  };
@@ -0,0 +1,49 @@
1
+ import { Ref } from 'vue';
2
+ import { ApColumnTemplate, ApTableSettingType } from '..';
3
+ export declare const useTableTemplateStorage: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>) => {
4
+ basicTemplate: Ref<ApColumnTemplate | undefined, ApColumnTemplate | undefined>;
5
+ customizeTemplateList: Ref<{
6
+ columnState: {
7
+ key: string | number;
8
+ show?: boolean | undefined;
9
+ fixed?: "left" | "right" | undefined;
10
+ disabled?: boolean | undefined;
11
+ label?: any;
12
+ children?: /*elided*/ any[] | undefined;
13
+ order?: number | undefined;
14
+ }[];
15
+ label: string;
16
+ key: string;
17
+ size?: "middle" | "small" | undefined;
18
+ }[], ApColumnTemplate[] | {
19
+ columnState: {
20
+ key: string | number;
21
+ show?: boolean | undefined;
22
+ fixed?: "left" | "right" | undefined;
23
+ disabled?: boolean | undefined;
24
+ label?: any;
25
+ children?: /*elided*/ any[] | undefined;
26
+ order?: number | undefined;
27
+ }[];
28
+ label: string;
29
+ key: string;
30
+ size?: "middle" | "small" | undefined;
31
+ }[]>;
32
+ syncTemplateListToStorage: (nextTemplateList: ApColumnTemplate[]) => void;
33
+ addTemplate: (template: ApColumnTemplate) => void;
34
+ deleteTemplate: (key: string) => void;
35
+ updateTemplate: (key: string, newTemplate: Partial<ApColumnTemplate>) => {
36
+ columnState: {
37
+ key: string | number;
38
+ show?: boolean | undefined;
39
+ fixed?: "left" | "right" | undefined;
40
+ disabled?: boolean | undefined;
41
+ label?: any;
42
+ children?: /*elided*/ any[] | undefined;
43
+ order?: number | undefined;
44
+ }[];
45
+ label: string;
46
+ key: string;
47
+ size?: "middle" | "small" | undefined;
48
+ };
49
+ };
@@ -0,0 +1,150 @@
1
+ import { useToken as F } from "@aplus-frontend/antdv/es/theme/internal";
2
+ import { isBoolean as J, isNumber as T, isObject as x, mergeWith as y, omit as L, isString as j } from "lodash-unified";
3
+ import { ref as S, unref as c, watch as h } from "vue";
4
+ import "../../config-provider/index.mjs";
5
+ import { randomStr as k } from "../../utils/index.mjs";
6
+ import { getColumnStateString as G } from "../components/setting/utils.mjs";
7
+ import { useInjectApTable as M } from "../context.mjs";
8
+ import { getTableTitle as R } from "../utils.mjs";
9
+ import { useNamespace as W } from "../../config-provider/hooks/use-namespace.mjs";
10
+ function X(t, e, i, o) {
11
+ return o ? o.fixed : e ? e.fixed : i && "fixed" in i ? i.fixed : J(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
12
+ }
13
+ const b = Number.MAX_SAFE_INTEGER, q = k();
14
+ function H(t, e) {
15
+ const i = T(t.order) ? t.order : b;
16
+ let o = T(e.order) ? e.order : b;
17
+ return t.fixed === "right" && e.fixed !== "right" && (o = i - 1), e.fixed === "left" && t.fixed !== "left" && (o = i - 1), i - o;
18
+ }
19
+ function P(t, e) {
20
+ e && t.removeItem(e);
21
+ }
22
+ function Q(t, e) {
23
+ if (!e)
24
+ return [];
25
+ const i = t.getItem(e);
26
+ if (!i)
27
+ return [];
28
+ const o = JSON.parse(i);
29
+ return Array.isArray(o) ? o : (P(t, e), []);
30
+ }
31
+ function I(t, e) {
32
+ if (x(t) && x(e))
33
+ return y({}, t, e, I);
34
+ }
35
+ const ie = (t, e) => {
36
+ const { columnsBackup: i, size: o } = M(), { be: A } = W("ap-table"), [U, N] = F(), m = S(), u = S(
37
+ z(
38
+ Q(localStorage, c(e))
39
+ )
40
+ );
41
+ h(
42
+ [i, o],
43
+ ([r, n]) => {
44
+ r && (m.value = {
45
+ label: "basic_template",
46
+ columnState: l(r),
47
+ key: q,
48
+ size: n
49
+ });
50
+ },
51
+ { immediate: !0, deep: !0 }
52
+ );
53
+ function z(r) {
54
+ return r.length ? r.map((n) => ({
55
+ ...n,
56
+ columnState: l(
57
+ i.value,
58
+ n.columnState,
59
+ !1
60
+ )
61
+ })) : [
62
+ {
63
+ label: "默认模版",
64
+ key: k(),
65
+ size: o?.value,
66
+ columnState: l(i?.value || [])
67
+ }
68
+ ];
69
+ }
70
+ function l(r, n = {}, a = !0) {
71
+ const d = y(
72
+ {},
73
+ a ? t.defaultValue || {} : {},
74
+ n,
75
+ I
76
+ );
77
+ function g(E, w, C) {
78
+ return E.map((f) => {
79
+ const v = w?.[f.key] || {}, s = {
80
+ key: f.key,
81
+ label: j(f.title) ? R(
82
+ f,
83
+ A("table-header", "title"),
84
+ void 0,
85
+ N.value.colorTextTertiary
86
+ ) : f.title,
87
+ show: !0,
88
+ fixed: X(
89
+ f,
90
+ void 0,
91
+ a ? t.defaultValue?.[f.key] : void 0,
92
+ C
93
+ ),
94
+ disabled: !1,
95
+ ...L(v, ["children", "fixed"])
96
+ };
97
+ return s.children = f.children?.length ? g(
98
+ f.children,
99
+ v.children,
100
+ s
101
+ ) : void 0, s;
102
+ }).sort(H);
103
+ }
104
+ return g(r || [], d);
105
+ }
106
+ function p(r) {
107
+ if (c(e)) {
108
+ const n = r.map((a) => ({
109
+ ...a,
110
+ columnState: G(a.columnState)
111
+ }));
112
+ localStorage.setItem(c(e), JSON.stringify(n));
113
+ }
114
+ }
115
+ function O(r) {
116
+ u.value.push(r);
117
+ }
118
+ function _(r) {
119
+ const n = u.value.findIndex(
120
+ (a) => a.key === r
121
+ );
122
+ u.value.splice(n, 1);
123
+ }
124
+ function B(r, n) {
125
+ const a = u.value.findIndex(
126
+ (d) => d.key === r
127
+ );
128
+ return u.value[a] = {
129
+ ...u.value[a],
130
+ ...n
131
+ }, u.value[a];
132
+ }
133
+ return h(
134
+ () => u.value,
135
+ (r) => {
136
+ p(r);
137
+ },
138
+ { deep: !0, immediate: !0 }
139
+ ), {
140
+ basicTemplate: m,
141
+ customizeTemplateList: u,
142
+ syncTemplateListToStorage: p,
143
+ addTemplate: O,
144
+ deleteTemplate: _,
145
+ updateTemplate: B
146
+ };
147
+ };
148
+ export {
149
+ ie as useTableTemplateStorage
150
+ };
@@ -81,10 +81,12 @@ export type CommonFieldReturnType = ApFormItemProps & {
81
81
  export type ApTableSettingType = {
82
82
  /**
83
83
  * 用于持久化缓存的key
84
+ * @since 7.13.0 在此版本后必填
84
85
  */
85
- persistenceKey?: string;
86
+ persistenceKey: string;
86
87
  /**
87
88
  * 持久化类型
89
+ * @deprecated 已废弃,将只使用localStorage
88
90
  */
89
91
  persistenceType?: 'localStorage' | 'sessionStorage';
90
92
  /**
@@ -96,7 +98,7 @@ export type ApTableSettingType = {
96
98
  * @param val
97
99
  * @returns
98
100
  */
99
- onChange?: (val: ApColumnState[]) => void;
101
+ onChange?: (val: ApColumnState[], template: ApColumnTemplate) => void;
100
102
  };
101
103
  export type ApTableSettingDefaultValueType = Recordable<Omit<ApColumnState, 'label' | 'key' | 'children'> & {
102
104
  children?: ApTableSettingDefaultValueType;
@@ -131,6 +133,27 @@ export type ApColumnState = {
131
133
  */
132
134
  order?: number;
133
135
  };
136
+ export type ApColumnCachedTemplate = Omit<ApColumnTemplate, 'columnState'> & {
137
+ columnState: ApTableSettingDefaultValueType;
138
+ };
139
+ export type ApColumnTemplate = {
140
+ /**
141
+ * 列状态
142
+ */
143
+ columnState: ApColumnState[];
144
+ /**
145
+ * 模板名称
146
+ */
147
+ label: string;
148
+ /**
149
+ * 模版唯一标识
150
+ */
151
+ key: string;
152
+ /**
153
+ * 表格尺寸
154
+ */
155
+ size?: 'middle' | 'small';
156
+ };
134
157
  export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType extends ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType> = ReturnType | ((opt: Partial<{
135
158
  value: any;
136
159
  text: any;
@@ -345,7 +368,7 @@ export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<R
345
368
  /**
346
369
  * 是否开启表格设置
347
370
  */
348
- settings?: true | ApTableSettingType;
371
+ settings?: ApTableSettingType;
349
372
  };
350
373
  export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
351
374
  /**
@@ -4,6 +4,7 @@ export type ApTableToken = {
4
4
  apTableHeaderBg: string;
5
5
  apTableIndexSize: number;
6
6
  apTableSettingRightWidth: number;
7
+ apTableSettingLeftWidth: number;
7
8
  };
8
9
  export declare const defaultValue: (token: BaseToken) => ApTableToken;
9
10
  export declare const genSettingTriggerBtnStyle: StyleMixin;
@@ -3,7 +3,8 @@ import { genComponentStyleHook as o } from "../../utils/cssinjs/index.mjs";
3
3
  const r = (t) => ({
4
4
  apTableHeaderBg: t.tableHeaderBg,
5
5
  apTableIndexSize: 14,
6
- apTableSettingRightWidth: 240
6
+ apTableSettingRightWidth: 240,
7
+ apTableSettingLeftWidth: 240
7
8
  }), p = (t) => ({
8
9
  [`.${t.namespace}-ap-table-setting-trigger-button`]: {
9
10
  color: t.textColor2,
@@ -6,5 +6,7 @@ export declare const genTableSettingSelectGroupStyle: GenStyleFunc;
6
6
  export declare const genTableSettingSortableItemMetaStyle: GenStyleFunc;
7
7
  export declare const genTableSettingSortableItemStyle: GenStyleFunc;
8
8
  export declare const genTableSettingSorterStyle: GenStyleFunc;
9
+ export declare const genTableSettingTemplateListStyle: GenStyleFunc;
10
+ export declare const genTableSettingTemplateItemStyle: GenStyleFunc;
9
11
  declare const _default: (prefixCls: string) => ComputedRef<string>;
10
12
  export default _default;
@@ -1,16 +1,28 @@
1
- import { singleRow as a, resetComponent as t } from "../../style/index.mjs";
2
- import { genComponentStyleHook as n } from "../../utils/cssinjs/index.mjs";
3
- import { defaultValue as r } from "./index.mjs";
1
+ import { singleRow as a, resetComponent as r } from "../../style/index.mjs";
2
+ import { genComponentStyleHook as t } from "../../utils/cssinjs/index.mjs";
3
+ import { defaultValue as n } from "./index.mjs";
4
4
  const o = (e) => {
5
5
  const { componentCls: l, namespace: i } = e;
6
6
  return {
7
7
  [l]: {
8
+ ".ant-modal-content": {
9
+ padding: 0
10
+ },
11
+ "div.ant-modal-header": {
12
+ marginBottom: 0,
13
+ padding: "12px 20px",
14
+ borderBottom: `1px solid ${e.antdv.colorSplit}`
15
+ },
16
+ ".ant-modal-footer": {
17
+ padding: "12px 20px",
18
+ marginTop: 0,
19
+ borderTop: "1px solid #E9EDF3"
20
+ },
8
21
  [`${l}-wrapper`]: {
9
22
  display: "flex",
10
23
  flexDirection: "row",
11
24
  flexWrap: "nowrap",
12
25
  height: "100%",
13
- paddingBlockEnd: e.spaceLG,
14
26
  [`.${i}-ap-table-table-header__title`]: {
15
27
  ...a(e)
16
28
  },
@@ -24,10 +36,13 @@ const o = (e) => {
24
36
  }
25
37
  },
26
38
  [`${l}-left`]: {
39
+ width: e.apTableSettingLeftWidth
40
+ },
41
+ [`${l}-center`]: {
27
42
  flex: 1,
28
43
  flexShrink: 1,
29
44
  minWidth: 0,
30
- paddingInline: "20px",
45
+ paddingInline: e.spaceLG,
31
46
  display: "flex",
32
47
  flexDirection: "column",
33
48
  "&__header": {
@@ -36,11 +51,17 @@ const o = (e) => {
36
51
  flexWrap: "nowrap",
37
52
  justifyContent: "space-between",
38
53
  alignItems: "center",
39
- padding: e.space,
54
+ paddingInline: e.space,
55
+ paddingBlock: e.spaceMD,
40
56
  "&-tips": {
41
57
  color: e.textColor3
42
58
  }
43
59
  },
60
+ "&__tip-wrapper": {
61
+ flex: 1,
62
+ display: "flex",
63
+ alignItems: "center"
64
+ },
44
65
  "&__content": {
45
66
  flex: 1,
46
67
  padding: e.spaceLG,
@@ -53,6 +74,7 @@ const o = (e) => {
53
74
  maxWidth: "100%",
54
75
  display: "inline-flex",
55
76
  alignItems: "center",
77
+ lineHeight: 0,
56
78
  "> span:last-child": {
57
79
  flex: 1,
58
80
  minWidth: 0
@@ -62,10 +84,13 @@ const o = (e) => {
62
84
  },
63
85
  [`${l}-right`]: {
64
86
  width: e.apTableSettingRightWidth
87
+ },
88
+ [`${l}-modify-tip`]: {
89
+ color: e.colorWarn
65
90
  }
66
91
  }
67
92
  };
68
- }, c = (e) => {
93
+ }, p = (e) => {
69
94
  const { componentCls: l } = e;
70
95
  return {
71
96
  [l]: {
@@ -82,7 +107,7 @@ const o = (e) => {
82
107
  }
83
108
  }
84
109
  };
85
- }, p = (e) => {
110
+ }, c = (e) => {
86
111
  const { componentCls: l } = e, i = `${l}-sortable-item-meta`;
87
112
  return {
88
113
  [l]: {
@@ -170,9 +195,9 @@ const o = (e) => {
170
195
  },
171
196
  "&-header": {
172
197
  paddingInline: "20px",
173
- paddingBlock: e.spaceLG,
198
+ paddingBlock: e.spaceXL,
174
199
  "&-title": {
175
- ...t(e),
200
+ ...r(e),
176
201
  fontWeight: "bold",
177
202
  color: e.textColor1
178
203
  }
@@ -188,22 +213,92 @@ const o = (e) => {
188
213
  }
189
214
  }
190
215
  };
191
- }, h = n(
216
+ }, g = (e) => {
217
+ const { componentCls: l } = e;
218
+ return {
219
+ [l]: {
220
+ [`${e.componentCls}-template-list`]: {
221
+ height: "100%",
222
+ "&-title": {
223
+ paddingInline: 20,
224
+ paddingBlock: e.spaceXL,
225
+ fontWeight: "bold"
226
+ },
227
+ "&-content": {
228
+ flex: 1,
229
+ overflow: "auto",
230
+ paddingInline: e.spaceLG,
231
+ paddingBlock: e.space
232
+ }
233
+ }
234
+ }
235
+ };
236
+ }, m = (e) => {
237
+ const { componentCls: l } = e, i = `${e.componentCls}-template-item`;
238
+ return {
239
+ [l]: {
240
+ [i]: {
241
+ display: "flex",
242
+ flexDirection: "row",
243
+ flexWrap: "nowrap",
244
+ justifyContent: "space-between",
245
+ paddingInline: e.space,
246
+ paddingBlock: e.spaceSM,
247
+ borderRadius: e.borderRadius,
248
+ marginBlockEnd: e.spaceXS,
249
+ "&:last-child": {
250
+ marginBottom: 0
251
+ },
252
+ "&:hover": {
253
+ backgroundColor: e.calc(e.colorPrimary).colorMix(5),
254
+ cursor: "pointer",
255
+ [`${e.componentCls}-template-item-action-wrapper`]: {
256
+ display: "flex"
257
+ }
258
+ },
259
+ "&-label": {
260
+ ...a(e),
261
+ lineHeight: "20px"
262
+ },
263
+ "&-action-wrapper": {
264
+ display: "none"
265
+ },
266
+ "&-icon-wrapper": {
267
+ paddingInline: e.spaceXS,
268
+ borderRadius: e.borderRadius,
269
+ "&:hover": {
270
+ backgroundColor: e.colorBg1
271
+ }
272
+ }
273
+ },
274
+ [`${i}-active`]: {
275
+ backgroundColor: e.calc(e.colorPrimary).colorMix(5),
276
+ "&-label": {
277
+ color: e.colorPrimary
278
+ }
279
+ }
280
+ }
281
+ };
282
+ }, S = t(
192
283
  "ApTable.Setting",
193
284
  (e) => [
194
285
  o(e),
195
- c(e),
196
- d(e),
197
286
  p(e),
198
- s(e)
287
+ d(e),
288
+ c(e),
289
+ s(e),
290
+ m(e),
291
+ g(e)
199
292
  ],
200
- r
293
+ n
201
294
  );
202
295
  export {
203
- h as default,
204
- c as genTableSettingSelectGroupStyle,
205
- p as genTableSettingSortableItemMetaStyle,
296
+ S as default,
297
+ p as genTableSettingSelectGroupStyle,
298
+ c as genTableSettingSortableItemMetaStyle,
206
299
  d as genTableSettingSortableItemStyle,
207
300
  s as genTableSettingSorterStyle,
208
- o as genTableSettingStyle
301
+ o as genTableSettingStyle,
302
+ m as genTableSettingTemplateItemStyle,
303
+ g as genTableSettingTemplateListStyle
209
304
  };
@@ -147,7 +147,7 @@ function re(e, t, n, o) {
147
147
  const r = n?.({
148
148
  title: e.title,
149
149
  column: e
150
- }), i = r?.filter((l) => l.type !== Symbol.for("v-cmt")) || [];
150
+ }), i = r?.filter((l) => l.type !== /* @__PURE__ */ Symbol.for("v-cmt")) || [];
151
151
  if (r && i.length > 0)
152
152
  return r;
153
153
  const p = N(e.title) ? s("span", {
@@ -1,6 +1,6 @@
1
1
  import { cloneDeep as A } from "lodash-unified";
2
2
  import { ref as o, watch as r, defineComponent as h, provide as I, toRef as a, inject as y } from "vue";
3
- const u = Symbol("ag-grid-provider-key");
3
+ const u = /* @__PURE__ */ Symbol("ag-grid-provider-key");
4
4
  function L(n) {
5
5
  const t = o(), c = o(), l = o(0), d = (e) => {
6
6
  t.value = e;