@aplus-frontend/ui 6.13.4 → 6.15.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 (48) hide show
  1. package/es/src/ap-grid/hooks/use-row-selection.d.ts +6 -5
  2. package/es/src/ap-grid/hooks/use-row-selection.mjs +71 -56
  3. package/es/src/ap-grid/index.vue.mjs +7 -10
  4. package/es/src/ap-grid/utils/table.mjs +8 -8
  5. package/es/src/ap-list/hooks/use-offline-list.d.ts +3 -0
  6. package/es/src/ap-list/hooks/use-offline-list.mjs +25 -19
  7. package/es/src/ap-list/interface.d.ts +3 -5
  8. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
  9. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +153 -116
  10. package/es/src/business/ap-export-group/convertExportField.d.ts +3 -1
  11. package/es/src/business/ap-export-group/index.d.ts +3 -3
  12. package/es/src/business/ap-export-group/interface.d.ts +14 -2
  13. package/es/src/business/ap-table-modal/interface.d.ts +3 -1
  14. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +32 -30
  15. package/es/src/design-token/index.mjs +1 -1
  16. package/es/src/editable-table/hooks/use-get-columns.mjs +18 -18
  17. package/es/src/version.d.ts +1 -1
  18. package/es/src/version.mjs +1 -1
  19. package/lib/src/ap-grid/hooks/use-row-selection.d.ts +6 -5
  20. package/lib/src/ap-grid/hooks/use-row-selection.js +1 -1
  21. package/lib/src/ap-grid/index.vue.js +1 -1
  22. package/lib/src/ap-grid/utils/table.js +1 -1
  23. package/lib/src/ap-list/hooks/use-offline-list.d.ts +3 -0
  24. package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
  25. package/lib/src/ap-list/interface.d.ts +3 -5
  26. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
  27. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  28. package/lib/src/business/ap-export-group/convertExportField.d.ts +3 -1
  29. package/lib/src/business/ap-export-group/index.d.ts +3 -3
  30. package/lib/src/business/ap-export-group/interface.d.ts +14 -2
  31. package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
  32. package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
  33. package/lib/src/design-token/index.js +1 -1
  34. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  35. package/lib/src/version.d.ts +1 -1
  36. package/lib/src/version.js +1 -1
  37. package/package.json +1 -1
  38. package/theme/antdv-override.css +0 -24
  39. package/theme/antdv-override.less +0 -33
  40. package/theme/ap-grid/index.css +11 -4
  41. package/theme/ap-grid/index.less +11 -2
  42. package/theme/ap-table-modal/index.css +3 -2
  43. package/theme/ap-table-modal/index.less +3 -2
  44. package/theme/css-var.css +2 -0
  45. package/theme/css-var.less +4 -0
  46. package/theme/index.css +16 -30
  47. package/theme/reset.css +18 -0
  48. package/theme/reset.less +26 -2
@@ -1,7 +1,8 @@
1
1
  import { TableRowSelection } from '@aplus-frontend/antdv/lib/table/interface';
2
2
  import { ComputedRef, Ref } from 'vue';
3
- import { ApTableProps, ApTableRowSelection } from '../../ap-table';
3
+ import { ApTableProps } from '../../ap-table';
4
4
  import { Recordable } from '../../type';
5
+ import { ApGridRowSelection } from '../interface';
5
6
  export interface RowSelectionReturnType<RecordType = any> {
6
7
  rowSelection: ComputedRef<TableRowSelection<RecordType>>;
7
8
  selectedRows: Ref<Partial<RecordType>[]>;
@@ -58,12 +59,12 @@ export interface RowSelectionReturnType<RecordType = any> {
58
59
  unSelectMulti: (items: RecordType[]) => void;
59
60
  /**
60
61
  * VxeTable 表格checkbox-change事件
61
- * @param item
62
62
  * @param select
63
- * @param partRowData
63
+ * @param selectedRows
64
+ * @param reserveSelectedRows
64
65
  * @returns
65
66
  */
66
- selectChange: (item: RecordType, select: boolean, partRowData: RecordType[]) => void;
67
+ selectChange: (select: boolean, selectedRows: RecordType[], reserveSelectedRows: RecordType[]) => void;
67
68
  /**
68
69
  * VxeTable 表格checkbox-all事件
69
70
  * @param item
@@ -86,7 +87,7 @@ export interface RowSelectionReturnType<RecordType = any> {
86
87
  */
87
88
  selectMultiByKeys: (keys: (string | number)[]) => void;
88
89
  }
89
- type RowSelectionParams<T> = Omit<ApTableRowSelection<T>, 'mode'> & {
90
+ type RowSelectionParams<T> = ApGridRowSelection<T> & {
90
91
  /**
91
92
  * 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
92
93
  */
@@ -1,117 +1,132 @@
1
- import { ref as I, computed as v, unref as o } from "vue";
2
- import { isFunction as i, cloneDeep as _ } from "lodash-unified";
3
- function b(a, c) {
4
- return !(c != null && c.length) || i(a) ? [] : c.map((f) => ({ [a]: f }));
1
+ import { ref as F, computed as M, unref as o } from "vue";
2
+ import { isFunction as v, cloneDeep as h } from "lodash-unified";
3
+ function T(a, c) {
4
+ return !(c != null && c.length) || v(a) ? [] : c.map((d) => ({ [a]: d }));
5
5
  }
6
- const F = (a) => {
7
- a.defaultSelectedRowKeys;
8
- const c = I(
9
- b(a.rowKey, a.defaultSelectedRowKeys)
6
+ const m = (a) => {
7
+ const c = F(
8
+ T(a.rowKey, a.defaultSelectedRowKeys)
10
9
  );
11
- function f(e, t) {
10
+ function d(e, t) {
12
11
  c.value = t;
13
12
  }
14
- const l = (e) => i(a.rowKey) ? a.rowKey(e) : e[a.rowKey], s = v(() => {
13
+ const u = (e) => v(a.rowKey) ? a.rowKey(e) : e[a.rowKey], s = M(() => {
15
14
  const e = /* @__PURE__ */ new Map();
16
15
  return o(c).forEach((t) => {
17
- e.set(l(t), t);
16
+ e.set(u(t), t);
18
17
  }), e;
19
18
  });
20
- function M(e) {
21
- return o(s).has(l(e));
19
+ function w(e) {
20
+ return o(s).has(u(e));
22
21
  }
23
22
  function g(e) {
23
+ if (!f(e))
24
+ return;
24
25
  const t = o(s);
25
- t.set(l(e), e), c.value = [...t.values()];
26
+ t.set(u(e), e), c.value = [...t.values()];
26
27
  }
27
- function h(e) {
28
+ function x(e) {
28
29
  const t = o(s);
29
30
  for (const n of e)
30
- t.set(l(n), n);
31
+ f(n) && t.set(u(n), n);
31
32
  c.value = [...t.values()];
32
33
  }
33
- function w(e) {
34
- if (i(a.rowKey))
34
+ function y(e) {
35
+ if (v(a.rowKey))
35
36
  return;
36
37
  const t = o(s);
37
38
  for (const n of e) {
38
- const u = o(a.dataSource).find(
39
- (r) => l(r) === n
40
- ), S = { [a.rowKey]: n };
41
- t.set(String(n), u || S);
39
+ const l = o(a.dataSource).find(
40
+ (i) => u(i) === n
41
+ ), r = { [a.rowKey]: n };
42
+ f(l || r) && t.set(n, l || r);
42
43
  }
43
44
  c.value = [...t.values()];
44
45
  }
45
- function x(e) {
46
+ function E(e) {
47
+ if (!f(e))
48
+ return;
46
49
  const t = o(s);
47
- t.delete(l(e)), c.value = [...t.values()];
50
+ t.delete(u(e)), c.value = [...t.values()];
48
51
  }
49
- function y(e) {
52
+ function K(e) {
50
53
  const t = o(s);
51
54
  for (const n of e)
52
- t.delete(l(n));
55
+ f(n) && t.delete(u(n));
53
56
  c.value = [...t.values()];
54
57
  }
55
- function d(e, t) {
58
+ function S(e, t) {
56
59
  const n = e;
57
- for (const u of t)
58
- n.set(l(u), u);
60
+ for (const l of t)
61
+ n.set(u(l), l);
59
62
  return n;
60
63
  }
61
- function K(e, t, n) {
62
- const u = o(s);
63
- t ? u.set(l(e), e) : u.delete(l(e)), d(u, n), c.value = [...u.values()];
64
+ function b(e, t, n) {
65
+ const l = o(s);
66
+ e ? S(l, [...n, ...t]) : o(a.dataSource).forEach((r) => {
67
+ const i = u(r);
68
+ t.some((B) => u(B) === i) ? l.set(i, r) : l.delete(i);
69
+ }), c.value = [...l.values()];
64
70
  }
65
71
  function A(e, t) {
66
- c.value = [...t];
72
+ const n = h(o(s));
73
+ e ? S(n, t) : o(a.dataSource).forEach((l) => {
74
+ f(l) && n.delete(u(l));
75
+ }), c.value = [...n.values()];
76
+ }
77
+ function f(e) {
78
+ const t = a.shown, n = a.disabled, l = t ? t(e) : !0, r = n ? n(e) : !1;
79
+ return l && !r;
67
80
  }
68
81
  function C(e, t) {
69
- const n = _(o(s));
70
- o(a.dataSource).forEach((u) => {
71
- e.find((r) => l(r) === l(u)) ? n.set(l(u), u) : n.delete(l(u));
72
- }), d(n, t), c.value = [...n.values()];
82
+ const n = h(o(s));
83
+ o(a.dataSource).forEach((l) => {
84
+ e.find((i) => u(i) === u(l)) ? n.set(u(l), l) : n.delete(u(l));
85
+ }), S(n, t), c.value = [...n.values()];
73
86
  }
74
- function E() {
87
+ function D() {
75
88
  const e = o(s);
76
89
  o(a.dataSource).forEach((t) => {
77
- e.set(l(t), t);
90
+ f(t) && e.set(u(t), t);
78
91
  }), c.value = [...e.values()];
79
92
  }
80
93
  function R(e) {
81
- const t = o(s), n = l(e);
94
+ if (!f(e))
95
+ return;
96
+ const t = o(s), n = u(e);
82
97
  t.has(n) ? t.delete(n) : t.set(n, e), c.value = [...t.values()];
83
98
  }
84
- function D() {
99
+ function I() {
85
100
  const e = o(s);
86
101
  o(a.dataSource).forEach((t) => {
87
- e.delete(l(t));
102
+ f(t) && e.delete(u(t));
88
103
  }), c.value = [...e.values()];
89
104
  }
90
- function m() {
105
+ function k() {
91
106
  c.value = [];
92
107
  }
93
108
  return {
94
109
  select: g,
95
- unSelect: x,
96
- isSelected: M,
97
- selectAll: E,
98
- unSelectAll: D,
99
- clearAll: m,
110
+ unSelect: E,
111
+ isSelected: w,
112
+ selectAll: D,
113
+ unSelectAll: I,
114
+ clearAll: k,
100
115
  toggleSelect: R,
101
116
  selectedRows: c,
102
- selectMulti: h,
103
- unSelectMulti: y,
104
- rowSelection: v(() => ({
117
+ selectMulti: x,
118
+ unSelectMulti: K,
119
+ rowSelection: M(() => ({
105
120
  ...a,
106
- onChange: f,
107
- selectedRowKeys: o(c).map((e) => l(e))
121
+ onChange: d,
122
+ selectedRowKeys: o(c).map((e) => u(e))
108
123
  })),
109
- selectChange: K,
124
+ selectChange: b,
110
125
  selectAllChange: A,
111
126
  selectRangeChange: C,
112
- selectMultiByKeys: w
127
+ selectMultiByKeys: y
113
128
  };
114
129
  };
115
130
  export {
116
- F as default
131
+ m as default
117
132
  };
@@ -252,17 +252,14 @@ const Gt = /* @__PURE__ */ $e({
252
252
  dataSource: Pe,
253
253
  rowKey: o.rowKey
254
254
  }), Te = ({
255
- checked: e,
256
- row: t
255
+ checked: e
257
256
  }) => {
258
- const l = s.value;
259
- if (l && l) {
260
- const r = [
261
- ...l.getCheckboxReserveRecords(),
262
- ...l.getCheckboxRecords()
263
- ];
264
- y.selectChange(t, e, r);
265
- }
257
+ const t = s.value;
258
+ t && t && y.selectChange(
259
+ e,
260
+ t.getCheckboxRecords(),
261
+ t.getCheckboxReserveRecords()
262
+ );
266
263
  }, Ne = ({
267
264
  checked: e
268
265
  }) => {
@@ -1,10 +1,10 @@
1
- import { omit as d, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
1
+ import { omit as u, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
2
2
  import { isDef as m } from "../../utils/index.mjs";
3
3
  const g = 20, w = 50, b = (e) => e.some((t) => !!t.html);
4
- function R(e) {
4
+ function v(e) {
5
5
  var n;
6
6
  const t = {
7
- ...d(e, [
7
+ ...u(e, [
8
8
  "columns",
9
9
  "request",
10
10
  "searchForm",
@@ -42,7 +42,7 @@ function R(e) {
42
42
  range: o.range || !1
43
43
  };
44
44
  }
45
- return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = d(e.expandable, [
45
+ return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = u(e.expandable, [
46
46
  "renderContent",
47
47
  "width",
48
48
  "title"
@@ -50,10 +50,10 @@ function R(e) {
50
50
  enabled: !1
51
51
  }, t.virtualYConfig = {
52
52
  enabled: !1
53
- }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, e.virtual !== !1 && (t.headerCellConfig = {
53
+ }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, t.headerCellConfig = {
54
54
  height: 36,
55
55
  ...t.headerCellConfig || {}
56
- }), t.treeConfig && (t.treeConfig = {
56
+ }, t.treeConfig && (t.treeConfig = {
57
57
  ...t.treeConfig || {},
58
58
  /**
59
59
  * 使用非树层级列表,配合transform
@@ -62,7 +62,7 @@ function R(e) {
62
62
  }), t;
63
63
  }
64
64
  function f(e, t, i) {
65
- const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1, u = n ? g : w, h = C(l) && l >= 0 ? l : u;
65
+ const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1, d = n ? g : w, h = C(l) && l >= 0 ? l : d;
66
66
  e[r] = {
67
67
  enabled: a,
68
68
  gt: h,
@@ -94,5 +94,5 @@ function k(e) {
94
94
  export {
95
95
  k as getRowExpandProps,
96
96
  K as getRowSelectionProps,
97
- R as toVxeProps
97
+ v as toVxeProps
98
98
  };
@@ -14,6 +14,9 @@ export declare const useOfflineList: <DataType = Recordable>(params: ApListProps
14
14
  total: number;
15
15
  showSizeChanger: boolean;
16
16
  showQuickJumper: boolean;
17
+ showLessItems: boolean | undefined;
18
+ size: "default" | "small";
19
+ pageSizeOptions: (string | number)[];
17
20
  }>;
18
21
  dataSource: ComputedRef<DataType[]>;
19
22
  onChange: (page: number, size: number) => void;
@@ -1,32 +1,38 @@
1
- import { ref as o, computed as r, unref as t } from "vue";
2
- const l = (e) => {
3
- const n = o(
1
+ import { ref as g, computed as f, unref as n } from "vue";
2
+ import { isDef as s } from "../../utils/index.mjs";
3
+ import { isUndefined as S } from "lodash-unified";
4
+ const C = (e) => {
5
+ const i = g(
4
6
  e.pagination && e.pagination.defaultCurrent || 1
5
- ), u = o(
7
+ ), o = g(
6
8
  e.pagination && e.pagination.defaultPageSize || 10
7
9
  );
8
- function a(i, g) {
9
- n.value = i, u.value = g;
10
+ function d(t, a) {
11
+ i.value = t, o.value = a;
10
12
  }
11
- const c = r(() => e.dataSource ? e.pagination === !1 ? [...e.dataSource] : e.dataSource.slice(
12
- (t(n) - 1) * t(u),
13
- t(n) * t(u)
13
+ const p = f(() => e.dataSource ? e.pagination === !1 ? [...e.dataSource] : e.dataSource.slice(
14
+ (n(i) - 1) * n(o),
15
+ n(i) * n(o)
14
16
  ) : []);
15
17
  return {
16
- pagination: r(() => {
17
- var i;
18
+ pagination: f(() => {
19
+ var c;
20
+ const { showLessItems: t, showSizeChanger: a, showQuickJumper: r, pageSizeOptions: u } = e.pagination || {};
18
21
  return {
19
- current: t(n),
20
- pageSize: t(u),
21
- total: ((i = e.dataSource) == null ? void 0 : i.length) || 0,
22
- showSizeChanger: !0,
23
- showQuickJumper: !0
22
+ current: n(i),
23
+ pageSize: n(o),
24
+ total: ((c = e.dataSource) == null ? void 0 : c.length) || 0,
25
+ showSizeChanger: s(a) ? a : !t,
26
+ showQuickJumper: s(r) ? r : !t,
27
+ showLessItems: t,
28
+ size: "default",
29
+ pageSizeOptions: S(u) ? ["10", "20", "50", "100"] : u
24
30
  };
25
31
  }),
26
- dataSource: c,
27
- onChange: a
32
+ dataSource: p,
33
+ onChange: d
28
34
  };
29
35
  };
30
36
  export {
31
- l as useOfflineList
37
+ C as useOfflineList
32
38
  };
@@ -1,5 +1,5 @@
1
1
  import { StyleValue } from 'vue';
2
- import { RequestData } from '../ap-table';
2
+ import { ApTablePaginationConfig, RequestData } from '../ap-table';
3
3
  import { Recordable } from '../type';
4
4
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
5
5
  export type ApListProps<RecordType = any, ParamsType = Recordable> = {
@@ -49,14 +49,12 @@ export type ApListProps<RecordType = any, ParamsType = Recordable> = {
49
49
  /**
50
50
  * 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
51
51
  */
52
- pagination?: false | {
53
- defaultCurrent?: number;
54
- defaultPageSize?: number;
52
+ pagination?: false | (Omit<ApTablePaginationConfig, 'showTotal'> & {
55
53
  /**
56
54
  * 只有一页时隐藏分页
57
55
  */
58
56
  hideOnSinglePage?: boolean;
59
- };
57
+ });
60
58
  /**
61
59
  * 是否手动发起第一次网络请求
62
60
  */
@@ -1,7 +1,7 @@
1
1
  import { ApExportGroupProps } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  declare const _default: DefineComponent<ApExportGroupProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApExportGroupProps> & Readonly<{}>, {
4
- type: "button" | "dropdown";
4
+ type: "button" | "dropdown" | "group";
5
5
  exportField: boolean | {
6
6
  key?: string;
7
7
  convertField?: {