@aplus-frontend/ui 6.26.4 → 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 (102) 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/hooks/use-virtual-config.d.ts +5 -0
  8. package/es/src/ag-grid/hooks/use-virtual-config.mjs +25 -0
  9. package/es/src/ag-grid/index.vue.mjs +274 -232
  10. package/es/src/ag-grid/interface.d.ts +25 -2
  11. package/es/src/ap-field/select/index.vue.d.ts +51 -21
  12. package/es/src/ap-field/select/index.vue.mjs +51 -49
  13. package/es/src/ap-field/select/read.vue2.mjs +4 -1
  14. package/es/src/ap-field/tree-select/index.vue.d.ts +29 -21
  15. package/es/src/ap-field/tree-select/index.vue.mjs +11 -9
  16. package/es/src/ap-field/tree-select/read.vue2.mjs +7 -5
  17. package/es/src/ap-form/ap-form.vue.d.ts +20 -0
  18. package/es/src/ap-form/ap-form.vue2.mjs +11 -10
  19. package/es/src/ap-form/drawer-form/index.vue.d.ts +22 -0
  20. package/es/src/ap-form/drawer-form/index.vue.mjs +1 -0
  21. package/es/src/ap-form/hooks/use-watch.mjs +25 -28
  22. package/es/src/ap-form/interface.d.ts +1 -1
  23. package/es/src/ap-form/items/select/index.vue.d.ts +64 -28
  24. package/es/src/ap-form/items/tree-select/index.vue.d.ts +40 -28
  25. package/es/src/ap-form/modal-form/index.vue.d.ts +22 -0
  26. package/es/src/ap-form/modal-form/index.vue.mjs +31 -30
  27. package/es/src/ap-form/search-form/index.vue.d.ts +24 -2
  28. package/es/src/ap-form/search-form/index.vue.mjs +72 -68
  29. package/es/src/ap-table/constants.d.ts +52 -28
  30. package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
  31. package/es/src/ap-upload/apUpload.vue.mjs +38 -34
  32. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +59 -59
  33. package/es/src/ap-upload/components/Picture.vue2.mjs +74 -74
  34. package/es/src/ap-upload/components/SingleFile.vue2.mjs +95 -95
  35. package/es/src/business/ap-value-select-card/index.vue2.mjs +120 -123
  36. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +11 -0
  37. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +11 -0
  38. package/es/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  39. package/es/src/business/hooks/usePageListAgGrid.mjs +4 -4
  40. package/es/src/business/hooks/usePageListApGrid.mjs +14 -14
  41. package/es/src/config-provider/config-provider-props.d.ts +14 -1
  42. package/es/src/config-provider/config-provider.d.ts +31 -1
  43. package/es/src/config-provider/hooks/use-global-config.d.ts +14 -1
  44. package/es/src/config-provider/index.d.ts +52 -1
  45. package/es/src/utils/config-provider-preset.d.ts +11 -1
  46. package/es/src/version.d.ts +1 -1
  47. package/es/src/version.mjs +1 -1
  48. package/es/src/work-order-modal/work-order-modal.vue.d.ts +11 -0
  49. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  50. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  51. package/lib/src/ag-grid/hooks/use-columns.d.ts +1 -1
  52. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  53. package/lib/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
  54. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -0
  55. package/lib/src/ag-grid/hooks/use-virtual-config.d.ts +5 -0
  56. package/lib/src/ag-grid/hooks/use-virtual-config.js +1 -0
  57. package/lib/src/ag-grid/index.vue.js +1 -1
  58. package/lib/src/ag-grid/interface.d.ts +25 -2
  59. package/lib/src/ap-field/select/index.vue.d.ts +51 -21
  60. package/lib/src/ap-field/select/index.vue.js +1 -1
  61. package/lib/src/ap-field/select/read.vue2.js +1 -1
  62. package/lib/src/ap-field/tree-select/index.vue.d.ts +29 -21
  63. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  64. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  65. package/lib/src/ap-form/ap-form.vue.d.ts +20 -0
  66. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  67. package/lib/src/ap-form/drawer-form/index.vue.d.ts +22 -0
  68. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  69. package/lib/src/ap-form/hooks/use-watch.js +1 -1
  70. package/lib/src/ap-form/interface.d.ts +1 -1
  71. package/lib/src/ap-form/items/select/index.vue.d.ts +64 -28
  72. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +40 -28
  73. package/lib/src/ap-form/modal-form/index.vue.d.ts +22 -0
  74. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  75. package/lib/src/ap-form/search-form/index.vue.d.ts +24 -2
  76. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  77. package/lib/src/ap-table/constants.d.ts +52 -28
  78. package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
  79. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  80. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  81. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  82. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  83. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  84. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +11 -0
  85. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +11 -0
  86. package/lib/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  87. package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
  88. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  89. package/lib/src/config-provider/config-provider-props.d.ts +14 -1
  90. package/lib/src/config-provider/config-provider.d.ts +31 -1
  91. package/lib/src/config-provider/hooks/use-global-config.d.ts +14 -1
  92. package/lib/src/config-provider/index.d.ts +52 -1
  93. package/lib/src/utils/config-provider-preset.d.ts +11 -1
  94. package/lib/src/version.d.ts +1 -1
  95. package/lib/src/version.js +1 -1
  96. package/lib/src/work-order-modal/work-order-modal.vue.d.ts +11 -0
  97. package/package.json +3 -3
  98. package/theme/ap-pro-card/index.css +5 -5
  99. package/theme/ap-pro-card/index.less +5 -5
  100. package/theme/ap-value-select-card/index.css +3 -4
  101. package/theme/ap-value-select-card/index.less +3 -4
  102. package/theme/index.css +8 -9
@@ -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
+ };
@@ -0,0 +1,5 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { AgGridProps } from '../interface';
3
+ import { GridOptions } from 'ag-grid-community';
4
+ declare const useVirtualConfig: (config: Ref<AgGridProps["virtual"]>) => ComputedRef<GridOptions<any>>;
5
+ export default useVirtualConfig;
@@ -0,0 +1,25 @@
1
+ import { computed as e, unref as i } from "vue";
2
+ import { merge as n } from "lodash-unified";
3
+ const a = {
4
+ row: !0,
5
+ col: !0
6
+ }, f = (o) => e(() => {
7
+ const r = i(o);
8
+ if (r === !1)
9
+ return {
10
+ suppressRowVirtualisation: !0,
11
+ suppressColumnVirtualisation: !0
12
+ };
13
+ const { row: t, col: s, rowBuffer: u } = n(
14
+ a,
15
+ r || {}
16
+ );
17
+ return {
18
+ suppressRowVirtualisation: !t,
19
+ suppressColumnVirtualisation: !s,
20
+ rowBuffer: u
21
+ };
22
+ });
23
+ export {
24
+ f as default
25
+ };