@aplus-frontend/ui 7.13.9 → 7.13.11

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 (47) hide show
  1. package/es/src/ag-grid/hooks/use-columns.d.ts +2 -0
  2. package/es/src/ag-grid/hooks/use-columns.mjs +35 -17
  3. package/es/src/ag-grid/index.vue.mjs +323 -292
  4. package/es/src/ap-field/date-range/index.vue.mjs +18 -18
  5. package/es/src/ap-field/date-range/read.vue2.mjs +3 -3
  6. package/es/src/ap-field/hooks/use-default-presets.mjs +59 -16
  7. package/es/src/ap-field/interface.d.ts +46 -1
  8. package/es/src/ap-field/select/use-select-options.mjs +13 -12
  9. package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
  10. package/es/src/ap-table/hooks/use-sorted-filtered.mjs +13 -11
  11. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
  12. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +148 -142
  13. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +119 -112
  14. package/es/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
  15. package/es/src/business/ap-export-group/handleExportDownload.mjs +2 -2
  16. package/es/src/business/ap-export-group/interface.d.ts +9 -0
  17. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +56 -54
  18. package/es/src/config-provider/config-provider-props.d.ts +1 -1
  19. package/es/src/config-provider/config-provider.d.ts +3 -0
  20. package/es/src/config-provider/hooks/use-global-config.d.ts +1 -0
  21. package/es/src/config-provider/index.d.ts +6 -0
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ag-grid/hooks/use-columns.d.ts +2 -0
  25. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  26. package/lib/src/ag-grid/index.vue.js +1 -1
  27. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  28. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  29. package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
  30. package/lib/src/ap-field/interface.d.ts +46 -1
  31. package/lib/src/ap-field/select/use-select-options.js +1 -1
  32. package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
  33. package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
  34. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
  35. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  36. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  37. package/lib/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
  38. package/lib/src/business/ap-export-group/handleExportDownload.js +1 -1
  39. package/lib/src/business/ap-export-group/interface.d.ts +9 -0
  40. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  41. package/lib/src/config-provider/config-provider-props.d.ts +1 -1
  42. package/lib/src/config-provider/config-provider.d.ts +3 -0
  43. package/lib/src/config-provider/hooks/use-global-config.d.ts +1 -0
  44. package/lib/src/config-provider/index.d.ts +6 -0
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +3 -3
@@ -1,167 +1,168 @@
1
- import { ref as pe, reactive as k, unref as g, nextTick as he, onMounted as me, watch as Se, computed as L, createVNode as C } from "vue";
2
- import { cloneDeep as ze, isArray as B, isEqualWith as Pe, isUndefined as Te } from "lodash-unified";
1
+ import { ref as me, reactive as B, unref as g, nextTick as Se, onMounted as ze, watch as Pe, computed as y, createVNode as x } from "vue";
2
+ import { cloneDeep as Te, isArray as J, isEqualWith as be, isUndefined as Ce } from "lodash-unified";
3
3
  import "../../config-provider/index.mjs";
4
4
  import "../../utils/index.mjs";
5
- import { parseFieldValue as be, dataIndexToStr as Ce, isEqualCustom as xe } from "../utils.mjs";
6
- import { useTableSortedAndFiltered as Fe } from "./use-sorted-filtered.mjs";
7
- import { useLocale as we } from "../../config-provider/hooks/use-locale.mjs";
8
- import { useNamespace as De } from "../../config-provider/hooks/use-namespace.mjs";
9
- import { isDef as J } from "../../utils/is.mjs";
10
- const d = 1, O = 20, K = {
5
+ import { parseFieldValue as xe, dataIndexToStr as Fe, isEqualCustom as we } from "../utils.mjs";
6
+ import { useTableSortedAndFiltered as De } from "./use-sorted-filtered.mjs";
7
+ import { useLocale as Ee } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { useNamespace as ve } from "../../config-provider/hooks/use-namespace.mjs";
9
+ import { isDef as K } from "../../utils/is.mjs";
10
+ const d = 1, R = 20, Q = {
11
11
  defaultCurrent: d,
12
- defaultPageSize: O,
12
+ defaultPageSize: R,
13
13
  showLessItems: !1,
14
14
  showTotal: !0
15
15
  };
16
- function Ee(i) {
17
- return i === !1 ? {} : i == null || i === !0 ? K : {
18
- ...K,
16
+ function Ae(i) {
17
+ return i === !1 ? {} : i == null || i === !0 ? Q : {
18
+ ...Q,
19
19
  ...i
20
20
  };
21
21
  }
22
- function ve(i) {
22
+ function Le(i) {
23
23
  const f = {};
24
- return i === !1 || (i === !0 || i == null ? (f.current = d, f.pageSize = O) : (f.current = i.defaultCurrent || d, f.pageSize = i.defaultPageSize || O)), f;
24
+ return i === !1 || (i === !0 || i == null ? (f.current = d, f.pageSize = R) : (f.current = i.defaultCurrent || d, f.pageSize = i.defaultPageSize || R)), f;
25
25
  }
26
- const je = ({
26
+ const qe = ({
27
27
  manual: i = !1,
28
28
  request: f,
29
- params: y = {},
30
- defaultData: R = [],
31
- formatParams: I,
32
- paramsValueTypeMap: M,
33
- resetFieldsIgnores: N,
34
- filterFields: Q,
35
- sortFields: W,
36
- namespace: $ = "ap-table",
29
+ params: I = {},
30
+ defaultData: M = [],
31
+ formatParams: N,
32
+ paramsValueTypeMap: O,
33
+ resetFieldsIgnores: V,
34
+ filterFields: W,
35
+ sortFields: $,
36
+ namespace: G = "ap-table",
37
37
  pagination: p,
38
- onClickReset: G,
39
- onAfterRequest: Z
38
+ onClickReset: Z,
39
+ onAfterRequest: H,
40
+ defaultSortOrder: h
40
41
  }) => {
41
- let x = 0, s = {};
42
- const H = Ee(p), X = (e) => I ? I(e) : e, h = pe(), c = k(ve(p)), {
43
- getColumnSFConfig: Y,
44
- setSF: ee,
45
- clearAll: te,
46
- sortedInfo: V,
47
- filteredInfo: j
48
- } = Fe(), {
49
- t: m
50
- } = we(), {
51
- b: S
52
- } = De($), a = k({
53
- total: R.length,
54
- records: R,
42
+ let F = 0, s = {};
43
+ const X = Ae(p), Y = (e) => N ? N(e) : e, m = me(), c = B(Le(p)), {
44
+ getColumnSFConfig: ee,
45
+ setSF: te,
46
+ clearAll: ne,
47
+ sortedInfo: j,
48
+ filteredInfo: U
49
+ } = De(h), {
50
+ t: S
51
+ } = Ee(), {
52
+ b: z
53
+ } = ve(G), a = B({
54
+ total: M.length,
55
+ records: M,
55
56
  loading: !1
56
- }), z = () => h.value?.apForm?.getFieldsValueTransformed(!0) || {}, F = async (e, t) => {
57
- const n = X(e), r = Date.now(), o = t?.cache;
58
- x = r, a.loading = !0;
57
+ }), P = () => m.value?.apForm?.getFieldsValueTransformed(!0) || {}, w = async (e, t) => {
58
+ const n = Y(e), r = Date.now(), o = t?.cache;
59
+ F = r, a.loading = !0;
59
60
  try {
60
61
  const u = await f({
61
- ...g(y),
62
+ ...g(I),
62
63
  ...n
63
64
  });
64
- if (x === r) {
65
+ if (F === r) {
65
66
  a.total = u.total || u.data?.length || 0, o ? a.records.push(...u.data || []) : a.records = [...u.data || []];
66
- const b = a.records.length < a.total;
67
- t?.onSuccess?.(e, b), a.loading = !1;
67
+ const C = a.records.length < a.total;
68
+ t?.onSuccess?.(e, C), a.loading = !1;
68
69
  }
69
70
  } catch {
70
- x === r && !o && (a.records = [], a.total = 0), a.loading = !1;
71
+ F === r && !o && (a.records = [], a.total = 0), a.loading = !1;
71
72
  } finally {
72
- Z?.(a.records);
73
+ H?.(a.records);
73
74
  }
74
- }, w = (e) => {
75
+ }, D = (e) => {
75
76
  const t = {};
76
77
  return Object.entries(e).forEach(([n, r]) => {
77
- if (t[n] = r, M && r) {
78
- const o = M[n];
79
- o && (t[n] = be(o, r));
78
+ if (t[n] = r, O && r) {
79
+ const o = O[n];
80
+ o && (t[n] = xe(o, r));
80
81
  }
81
82
  }), t;
82
- }, ne = async (e) => {
83
- const t = z(), n = {};
83
+ }, re = async (e) => {
84
+ const t = P(), n = {};
84
85
  Object.entries(t).forEach(([r, o]) => {
85
- N && N.indexOf(r) > -1 && (n[r] = o);
86
- }), await h.value?.apForm?.resetFields(), h.value?.apForm?.setFieldsValue?.(n), he(() => {
86
+ V && V.indexOf(r) > -1 && (n[r] = o);
87
+ }), await m.value?.apForm?.resetFields(), m.value?.apForm?.setFieldsValue?.(n), Se(() => {
87
88
  e?.();
88
89
  });
89
- }, P = (e) => {
90
+ }, T = (e) => {
90
91
  s = e;
91
- const t = w(e);
92
- F(t);
93
- }, re = (e) => {
94
- P({
92
+ const t = D(e);
93
+ w(t);
94
+ }, ae = (e) => {
95
+ T({
95
96
  ...s,
96
97
  ...e
97
98
  });
98
99
  };
99
- let T, D = !0;
100
- function U() {
101
- T = void 0, D = !0;
100
+ let b, E = !0;
101
+ function q() {
102
+ b = void 0, E = !0;
102
103
  }
103
- const ae = () => {
104
- if (!D)
104
+ const oe = () => {
105
+ if (!E)
105
106
  return;
106
- const e = T ? T + 1 : 2, t = {
107
+ const e = b ? b + 1 : 2, t = {
107
108
  ...s,
108
109
  current: e
109
110
  };
110
111
  s = t;
111
- const n = w(t);
112
- F(n, {
112
+ const n = D(t);
113
+ w(n, {
113
114
  cache: !0,
114
115
  onSuccess(r, o) {
115
- T = r.current, D = o;
116
+ b = r.current, E = o;
116
117
  }
117
118
  });
118
- }, oe = () => ze(s), E = () => {
119
- q(!0), U();
120
- }, q = (e = !1) => {
121
- const t = z(), n = p !== !1;
122
- n && e && (c.current = d), P({
119
+ }, se = () => Te(s), v = () => {
120
+ _(!0), q();
121
+ }, _ = (e = !1) => {
122
+ const t = P(), n = p !== !1;
123
+ n && e && (c.current = d), T({
123
124
  ...t,
124
125
  filter: s.filter,
125
126
  sort: s.sort,
126
127
  current: n ? e ? d : s.current || c.current : void 0,
127
128
  pageSize: n ? s.pageSize || c.pageSize : void 0
128
129
  });
129
- }, se = () => {
130
- te(), s.sort = {}, s.filter = {}, G?.(), ne(E), U();
131
- }, v = () => {
132
- P(s);
133
- }, ce = (e) => {
130
+ }, ce = () => {
131
+ ne(), s.sort = {}, s.filter = {}, Z?.(), re(v), q();
132
+ }, A = () => {
133
+ T(s);
134
+ }, ie = (e) => {
134
135
  if (p === !1)
135
- v();
136
+ A();
136
137
  else {
137
138
  const {
138
139
  current: t,
139
140
  pageSize: n
140
141
  } = c, r = a.total - e, o = Math.ceil(r / n), u = t > o ? o : t;
141
- re({
142
+ ae({
142
143
  current: u > 0 ? u : 1
143
144
  });
144
145
  }
145
- }, A = (e, t, n) => {
146
- const r = z();
147
- c.current = e.current, c.pageSize = e.pageSize, ee(t, n);
148
- const o = B(n) ? [...n] : [n], u = {};
146
+ }, L = (e, t, n) => {
147
+ const r = P();
148
+ c.current = e.current, c.pageSize = e.pageSize, te(t, n);
149
+ const o = J(n) ? [...n] : [n], u = {};
149
150
  for (const l of o)
150
- g(W)?.includes(l.columnKey || l.field) && l.order && (u[Ce(l.columnKey || l.field)] = l.order);
151
- const b = {};
151
+ g($)?.includes(l.columnKey || l.field) && l.order && (u[Fe(l.columnKey || l.field)] = l.order);
152
+ const C = {};
152
153
  for (const l of Object.keys(t))
153
- g(Q)?.includes(l) && t[l] && (b[l] = t[l]);
154
- const _ = {
154
+ g(W)?.includes(l) && t[l] && (C[l] = t[l]);
155
+ const k = {
155
156
  ...r,
156
- filter: b,
157
+ filter: C,
157
158
  sort: u,
158
159
  current: e.current,
159
160
  pageSize: e.pageSize
160
161
  };
161
- Pe(s, _, xe) || P(_);
162
- }, ie = (e, t = j.value || {}, n = V.value || {}) => {
162
+ be(s, k, we) || T(k);
163
+ }, ue = (e, t = U.value || {}, n = j.value || {}) => {
163
164
  const r = e?.current ?? c.current, o = e?.pageSize ?? c.pageSize;
164
- A(
165
+ L(
165
166
  {
166
167
  current: r,
167
168
  pageSize: o
@@ -175,8 +176,13 @@ const je = ({
175
176
  }
176
177
  );
177
178
  };
178
- me(() => {
179
- const e = z(), {
179
+ function le() {
180
+ return h ? {
181
+ [h.field]: h.order
182
+ } : {};
183
+ }
184
+ ze(() => {
185
+ const e = P(), {
180
186
  current: t,
181
187
  pageSize: n
182
188
  } = c;
@@ -184,18 +190,18 @@ const je = ({
184
190
  current: t,
185
191
  pageSize: n,
186
192
  filter: {},
187
- sort: {},
193
+ sort: le(),
188
194
  ...e
189
195
  }, !i) {
190
- const r = w(s);
191
- F(r);
196
+ const r = D(s);
197
+ w(r);
192
198
  }
193
- }), Se(() => g(y), () => {
194
- E();
199
+ }), Pe(() => g(I), () => {
200
+ v();
195
201
  }, {
196
202
  deep: !0
197
203
  });
198
- const ue = L(() => {
204
+ const fe = y(() => {
199
205
  if (a.total === 0)
200
206
  return "-";
201
207
  const {
@@ -204,74 +210,74 @@ const je = ({
204
210
  } = c;
205
211
  return `${e}/${Math.ceil(a.total / t)}`;
206
212
  });
207
- function le(e) {
208
- B(e) && (a.records = e, a.total = e.length);
213
+ function ge(e) {
214
+ J(e) && (a.records = e, a.total = e.length);
209
215
  }
210
- const fe = L(() => {
216
+ const de = y(() => {
211
217
  const {
212
218
  showLessItems: e,
213
219
  showTotal: t,
214
220
  showQuickJumper: n,
215
221
  showSizeChanger: r,
216
222
  pageSizeOptions: o
217
- } = H;
223
+ } = X;
218
224
  return {
219
225
  loading: a.loading,
220
226
  pagination: {
221
227
  current: c.current,
222
228
  pageSize: c.pageSize,
223
229
  total: a.total,
224
- showSizeChanger: J(r) ? r : !e,
225
- showQuickJumper: J(n) ? n : !e,
230
+ showSizeChanger: K(r) ? r : !e,
231
+ showQuickJumper: K(n) ? n : !e,
226
232
  showLessItems: e,
227
233
  size: "default",
228
- pageSizeOptions: Te(o) ? ["10", "20", "50", "100"] : o,
229
- showTotal: t ? (u) => C("span", {
230
- class: S("pagination-total-wrapper")
231
- }, [m("ap.apTable.pagination.totalLeftPrefix"), " ", C("span", {
232
- class: S("pagination-count-text")
233
- }, [u]), " ", m("ap.apTable.pagination.totalLeftSuffix"), C("span", {
234
- class: S("pagination--total-right")
235
- }, [m("ap.apTable.pagination.totalRightPrefix"), " ", C("span", {
236
- class: S("pagination-count-text")
237
- }, [g(ue)]), " ", m("ap.apTable.pagination.totalRightSuffix")])]) : void 0
234
+ pageSizeOptions: Ce(o) ? ["10", "20", "50", "100"] : o,
235
+ showTotal: t ? (u) => x("span", {
236
+ class: z("pagination-total-wrapper")
237
+ }, [S("ap.apTable.pagination.totalLeftPrefix"), " ", x("span", {
238
+ class: z("pagination-count-text")
239
+ }, [u]), " ", S("ap.apTable.pagination.totalLeftSuffix"), x("span", {
240
+ class: z("pagination--total-right")
241
+ }, [S("ap.apTable.pagination.totalRightPrefix"), " ", x("span", {
242
+ class: z("pagination-count-text")
243
+ }, [g(fe)]), " ", S("ap.apTable.pagination.totalRightSuffix")])]) : void 0
238
244
  },
239
- onChange: A,
245
+ onChange: L,
240
246
  dataSource: a.records
241
247
  };
242
248
  });
243
- function ge(e, t = !0) {
244
- Object.assign(c, e), s.current = e.current, s.pageSize = e.pageSize, t && v();
249
+ function pe(e, t = !0) {
250
+ Object.assign(c, e), s.current = e.current, s.pageSize = e.pageSize, t && A();
245
251
  }
246
- function de() {
252
+ function he() {
247
253
  return {
248
254
  ...c
249
255
  };
250
256
  }
251
257
  return {
252
- formRef: h,
253
- submit: E,
254
- reset: se,
255
- refresh: v,
256
- refreshByDelete: ce,
258
+ formRef: m,
259
+ submit: v,
260
+ reset: ce,
261
+ refresh: A,
262
+ refreshByDelete: ie,
257
263
  data: a,
258
- handleTableChange: A,
259
- handleTableChangeOptional: ie,
260
- tableProps: fe,
261
- dataSource: L(() => a.records),
262
- setDataSource: le,
263
- getColumnSFConfig: Y,
264
- sortedInfo: V,
265
- filteredInfo: j,
266
- getPaging: de,
267
- setPaging: ge,
268
- submitWith: q,
269
- fetchNextPageAndCache: ae,
270
- getLastParams: oe
264
+ handleTableChange: L,
265
+ handleTableChangeOptional: ue,
266
+ tableProps: de,
267
+ dataSource: y(() => a.records),
268
+ setDataSource: ge,
269
+ getColumnSFConfig: ee,
270
+ sortedInfo: j,
271
+ filteredInfo: U,
272
+ getPaging: he,
273
+ setPaging: pe,
274
+ submitWith: _,
275
+ fetchNextPageAndCache: oe,
276
+ getLastParams: se
271
277
  };
272
278
  };
273
279
  export {
274
280
  d as DEFAULT_CURRENT,
275
- O as DEFAULT_PAGE_SIZE,
276
- je as useTablePaging
281
+ R as DEFAULT_PAGE_SIZE,
282
+ qe as useTablePaging
277
283
  };