@aplus-frontend/ui 6.26.5 → 6.27.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 (50) hide show
  1. package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  2. package/es/src/ag-grid/hooks/use-columns-def.mjs +29 -29
  3. package/es/src/ag-grid/hooks/use-columns.d.ts +1 -1
  4. package/es/src/ag-grid/hooks/use-columns.mjs +8 -8
  5. package/es/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
  6. package/es/src/ag-grid/hooks/use-pinned-row.mjs +32 -0
  7. package/es/src/ag-grid/index.vue.mjs +251 -228
  8. package/es/src/ag-grid/interface.d.ts +4 -2
  9. package/es/src/ap-form/ap-form.vue.d.ts +2 -8
  10. package/es/src/ap-form/ap-form.vue2.mjs +3 -3
  11. package/es/src/ap-form/hooks/use-watch.mjs +25 -28
  12. package/es/src/ap-form/interface.d.ts +1 -1
  13. package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
  14. package/es/src/ap-upload/apUpload.vue.mjs +38 -34
  15. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +59 -59
  16. package/es/src/ap-upload/components/Picture.vue2.mjs +74 -74
  17. package/es/src/ap-upload/components/SingleFile.vue2.mjs +95 -95
  18. package/es/src/business/ap-value-select-card/index.vue2.mjs +120 -123
  19. package/es/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  20. package/es/src/business/hooks/usePageListAgGrid.mjs +4 -4
  21. package/es/src/business/hooks/usePageListApGrid.mjs +14 -14
  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-def.d.ts +2 -2
  25. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  26. package/lib/src/ag-grid/hooks/use-columns.d.ts +1 -1
  27. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  28. package/lib/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
  29. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -0
  30. package/lib/src/ag-grid/index.vue.js +1 -1
  31. package/lib/src/ag-grid/interface.d.ts +4 -2
  32. package/lib/src/ap-form/ap-form.vue.d.ts +2 -8
  33. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  34. package/lib/src/ap-form/hooks/use-watch.js +1 -1
  35. package/lib/src/ap-form/interface.d.ts +1 -1
  36. package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
  37. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  38. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  39. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  40. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  41. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  42. package/lib/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  43. package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
  44. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +1 -1
  48. package/theme/ap-value-select-card/index.css +3 -4
  49. package/theme/ap-value-select-card/index.less +3 -4
  50. package/theme/index.css +3 -4
@@ -1,4 +1,4 @@
1
- import { ColDef, ColGroupDef } from 'ag-grid-community';
1
+ import { CellClassFunc, ColDef, ColGroupDef } from 'ag-grid-community';
2
2
  import { AgGridColumnType, AgGridProps } from '../interface';
3
3
  import { Ref, ComputedRef } from 'vue';
4
4
  /**
@@ -7,7 +7,7 @@ import { Ref, ComputedRef } from 'vue';
7
7
  * @param props
8
8
  * @returns
9
9
  */
10
- export declare const useColumnsDef: <RecordType>(shownColumns: Ref<AgGridColumnType<RecordType>[]>, props: AgGridProps<RecordType>) => {
10
+ export declare const useColumnsDef: <RecordType>(columns: Ref<AgGridColumnType<RecordType>[]>, props: AgGridProps<RecordType>, customCellClass: (callback: CellClassFunc) => CellClassFunc) => {
11
11
  columnDefs: ComputedRef<(ColDef<any, any> | ColGroupDef<any>)[]>;
12
12
  defaultColDef: ComputedRef<ColDef<any, any>>;
13
13
  };
@@ -1,17 +1,17 @@
1
- import { getTableRenderProps as C, objectToString as w } from "../../ap-table/utils.mjs";
1
+ import { getTableRenderProps as C, objectToString as m } from "../../ap-table/utils.mjs";
2
2
  import { rendererMap as y } from "../renderer/index.mjs";
3
3
  import { isFunction as b, isNumber as f } from "lodash-unified";
4
4
  import { computed as v, unref as T } from "vue";
5
5
  import "../components/body-cell/index.vue.mjs";
6
6
  import "../components/header-cell/index.vue.mjs";
7
7
  import "../../config-provider/index.mjs";
8
- import { dataIndexToField as m } from "../../ap-grid/utils/col.mjs";
9
- import { isDef as R } from "../../utils/index.mjs";
10
- import { useGlobalConfig as D } from "../../config-provider/hooks/use-global-config.mjs";
11
- import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
12
- import P from "../components/body-cell/index.vue2.mjs";
13
- import S from "../components/header-cell/index.vue2.mjs";
14
- function _(t, a) {
8
+ import { dataIndexToField as R } from "../../ap-grid/utils/col.mjs";
9
+ import { isDef as D } from "../../utils/index.mjs";
10
+ import { useGlobalConfig as I } from "../../config-provider/hooks/use-global-config.mjs";
11
+ import { useNamespace as P } from "../../config-provider/hooks/use-namespace.mjs";
12
+ import S from "../components/body-cell/index.vue2.mjs";
13
+ import _ from "../components/header-cell/index.vue2.mjs";
14
+ function z(t, a) {
15
15
  if (a.bodyCellTooltip)
16
16
  return b(a.bodyCellTooltip) ? a.bodyCellTooltip(t.value, t.data) : a.bodyCellTooltip;
17
17
  if (a.renderText)
@@ -36,16 +36,16 @@ function _(t, a) {
36
36
  );
37
37
  return d(p);
38
38
  }
39
- return w(t.value);
39
+ return m(t.value);
40
40
  }
41
- const E = (t, a) => {
42
- const s = D("valueTypeMap"), { em: d } = I("ag-grid"), u = v(() => {
43
- const c = T(t), h = (i) => {
41
+ const J = (t, a, s) => {
42
+ const d = I("valueTypeMap"), { em: u } = P("ag-grid"), p = v(() => {
43
+ const h = T(t), g = (i) => {
44
44
  const e = {
45
- cellRenderer: P,
45
+ cellRenderer: S,
46
46
  cellRendererParams: {
47
47
  column: i,
48
- extraValueType: T(s)
48
+ extraValueType: T(d)
49
49
  }
50
50
  };
51
51
  if (i.customRender)
@@ -80,8 +80,8 @@ const E = (t, a) => {
80
80
  function x(i) {
81
81
  return i.map((e) => {
82
82
  const n = e.bodyCellTooltip || !e.customRender && (e.ellipsis === !0 || e.ellipsis === "tooltip" || f(e.ellipsis)), l = {
83
- field: m(e.dataIndex),
84
- colId: R(e.key) ? String(e.key) : void 0,
83
+ field: R(e.dataIndex),
84
+ colId: D(e.key) ? String(e.key) : void 0,
85
85
  sortable: !!e.sorter,
86
86
  comparator: e.sorter === !0 ? () => 0 : e.sorter,
87
87
  headerComponentParams: {
@@ -96,21 +96,21 @@ const E = (t, a) => {
96
96
  pinned: e.fixed || null,
97
97
  // undefined to null
98
98
  colSpan: e.colSpan,
99
- cellClass: (r) => {
100
- const o = e.cellClass || "", g = b(o) ? o(r.data, r.node) : o;
99
+ cellClass: s((r) => {
100
+ const o = e.cellClass || "", w = b(o) ? o(r.data, r.node) : o;
101
101
  return [
102
- `${d("cell", e.align || "left")}`,
103
- g
102
+ `${u("cell", e.align || "left")}`,
103
+ w
104
104
  ].flat().filter(Boolean);
105
- },
105
+ }),
106
106
  cellStyle: {
107
107
  "--ag-grid-line-clamp": f(e.ellipsis) ? e.ellipsis : 1
108
108
  },
109
109
  wrapText: !e.ellipsis || f(e.ellipsis) && e.ellipsis >= 2,
110
110
  autoHeight: !0,
111
111
  // 设置自动计算高度以自适应多行换行的场景
112
- tooltipValueGetter: n ? (r) => _(r, e) : void 0,
113
- ...h(e)
112
+ tooltipValueGetter: n ? (r) => z(r, e) : void 0,
113
+ ...g(e)
114
114
  };
115
115
  return e.children?.length ? {
116
116
  ...l,
@@ -118,20 +118,20 @@ const E = (t, a) => {
118
118
  } : l;
119
119
  });
120
120
  }
121
- return x(c);
122
- }), p = v(
121
+ return x(h);
122
+ }), c = v(
123
123
  () => ({
124
- headerComponent: S,
124
+ headerComponent: _,
125
125
  resizable: a.columnResizable,
126
126
  suppressMovable: !0,
127
127
  cellDataType: !1
128
128
  })
129
129
  );
130
130
  return {
131
- columnDefs: u,
132
- defaultColDef: p
131
+ columnDefs: p,
132
+ defaultColDef: c
133
133
  };
134
134
  };
135
135
  export {
136
- E as useColumnsDef
136
+ J as useColumnsDef
137
137
  };
@@ -4,6 +4,6 @@ import { AgGridColumnType, AgGridProps } from '../interface';
4
4
  * 维护/更新表格将要显示的类
5
5
  */
6
6
  export declare const useColumns: <RecordType>(props: AgGridProps<RecordType>) => {
7
+ columns: Ref<AgGridColumnType<RecordType>[], AgGridColumnType<RecordType>[]>;
7
8
  shownColumns: Ref<AgGridColumnType<RecordType>[], AgGridColumnType<RecordType>[]>;
8
- shownColumnsBackup: Ref<AgGridColumnType<RecordType>[], AgGridColumnType<RecordType>[]>;
9
9
  };
@@ -1,22 +1,22 @@
1
- import { ref as t, watch as l } from "vue";
1
+ import { ref as u, watch as m } from "vue";
2
2
  const c = (e) => {
3
- const o = t([]), u = t([]);
4
- function s() {
3
+ const o = u([]), t = u([]);
4
+ function l() {
5
5
  return e.columns?.filter((n) => !n.hideInTable) || [];
6
6
  }
7
- return l(
7
+ return m(
8
8
  () => e.columns,
9
9
  () => {
10
- const n = s();
11
- o.value = n, u.value = n, e.onShownColumnsChange?.(n);
10
+ const n = l();
11
+ o.value = n, t.value = n, e.onShownColumnsChange?.(n);
12
12
  },
13
13
  {
14
14
  deep: !0,
15
15
  immediate: !0
16
16
  }
17
17
  ), {
18
- shownColumns: o,
19
- shownColumnsBackup: u
18
+ columns: o,
19
+ shownColumns: t
20
20
  };
21
21
  };
22
22
  export {
@@ -0,0 +1,7 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { AgGridProps } from '../interface';
3
+ import { CellClassFunc, GridOptions } from 'ag-grid-community';
4
+ export declare const usePinnedRow: (summary: Ref<AgGridProps["summary"]>) => {
5
+ getRowPinnedCellClass: (prevCellClass: CellClassFunc) => CellClassFunc;
6
+ rowPinnedGridConfig: ComputedRef<GridOptions<any>>;
7
+ };
@@ -0,0 +1,32 @@
1
+ import { computed as w } from "vue";
2
+ import { isFunction as l } from "lodash-unified";
3
+ const C = (r) => {
4
+ const d = w(() => {
5
+ const o = r.value;
6
+ if (!o)
7
+ return {};
8
+ const { rowClassName: n, top: t, bottom: e } = o;
9
+ return {
10
+ pinnedTopRowData: t,
11
+ pinnedBottomRowData: e,
12
+ getRowClass({ node: i, data: s, rowIndex: u }) {
13
+ if (!(!i.rowPinned || !n))
14
+ return l(n) ? n(s, u, i.rowPinned) : n;
15
+ }
16
+ };
17
+ });
18
+ return {
19
+ getRowPinnedCellClass: (o) => (n) => {
20
+ let t;
21
+ const { cellClassName: e } = r.value || {};
22
+ return !n.node.rowPinned || !e ? t = [o(n)] : t = [
23
+ o(n),
24
+ l(e) ? e(n.data, n.colDef, n.node.rowPinned) : e
25
+ ], t.flat().filter(Boolean);
26
+ },
27
+ rowPinnedGridConfig: d
28
+ };
29
+ };
30
+ export {
31
+ C as usePinnedRow
32
+ };