@aplus-frontend/ui 6.37.0 → 6.39.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 (153) hide show
  1. package/es/index.mjs +215 -218
  2. package/es/src/ag-grid/components/row/index.vue.d.ts +6 -0
  3. package/es/src/ag-grid/components/row/index.vue.mjs +4 -0
  4. package/es/src/ag-grid/components/row/index.vue2.mjs +14 -0
  5. package/es/src/ag-grid/editable/form-item.vue.mjs +10 -9
  6. package/es/src/ag-grid/editable/index.vue.mjs +17 -16
  7. package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
  8. package/es/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
  9. package/es/src/ag-grid/hooks/use-row-selection.mjs +81 -68
  10. package/es/src/ag-grid/index.vue.d.ts +2 -1
  11. package/es/src/ag-grid/index.vue.mjs +282 -257
  12. package/es/src/ag-grid/interface.d.ts +54 -3
  13. package/es/src/ap-action/group/index.vue.mjs +24 -21
  14. package/es/src/ap-action/item/index.vue2.mjs +28 -20
  15. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
  16. package/es/src/ap-table/interface.d.ts +6 -0
  17. package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
  18. package/es/src/business/ag-grid-modal/constants.mjs +6 -0
  19. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  20. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
  21. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  22. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
  23. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  24. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
  25. package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  26. package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
  27. package/es/src/business/ag-grid-modal/index.d.ts +2 -0
  28. package/es/src/business/ag-grid-modal/index.mjs +6 -0
  29. package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
  30. package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
  31. package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
  32. package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
  33. package/es/src/business/ag-grid-modal/style/css.js +1 -0
  34. package/es/src/business/ag-grid-modal/style/index.js +1 -0
  35. package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
  36. package/es/src/business/ag-grid-modal/utils.mjs +72 -0
  37. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  38. package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
  39. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
  40. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  41. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  42. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  43. package/es/src/business/ap-table-modal/index.d.ts +3 -0
  44. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  45. package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
  46. package/es/src/business/index.d.ts +1 -0
  47. package/es/src/business/index.mjs +55 -54
  48. package/es/src/index.d.ts +0 -1
  49. package/es/src/index.mjs +280 -284
  50. package/es/src/path-map.mjs +3 -2
  51. package/es/src/version.d.ts +1 -1
  52. package/es/src/version.mjs +1 -1
  53. package/lib/index.js +1 -1
  54. package/lib/src/ag-grid/components/row/index.vue.d.ts +6 -0
  55. package/lib/src/ag-grid/components/row/index.vue.js +1 -0
  56. package/lib/src/ag-grid/components/row/index.vue2.js +1 -0
  57. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  58. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  59. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  60. package/lib/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
  61. package/lib/src/ag-grid/hooks/use-row-selection.js +1 -1
  62. package/lib/src/ag-grid/index.vue.d.ts +2 -1
  63. package/lib/src/ag-grid/index.vue.js +1 -1
  64. package/lib/src/ag-grid/interface.d.ts +54 -3
  65. package/lib/src/ap-action/group/index.vue.js +1 -1
  66. package/lib/src/ap-action/item/index.vue2.js +1 -1
  67. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  68. package/lib/src/ap-table/interface.d.ts +6 -0
  69. package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
  70. package/lib/src/business/ag-grid-modal/constants.js +1 -0
  71. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  72. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
  73. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  74. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
  75. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  76. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
  77. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  78. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
  79. package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
  80. package/lib/src/business/ag-grid-modal/index.js +1 -0
  81. package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
  82. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
  83. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
  84. package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
  85. package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
  86. package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
  87. package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
  88. package/lib/src/business/ag-grid-modal/utils.js +1 -0
  89. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  90. package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
  91. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
  92. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  93. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  94. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  95. package/lib/src/business/ap-table-modal/index.d.ts +3 -0
  96. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  97. package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
  98. package/lib/src/business/index.d.ts +1 -0
  99. package/lib/src/business/index.js +1 -1
  100. package/lib/src/index.d.ts +0 -1
  101. package/lib/src/index.js +1 -1
  102. package/lib/src/path-map.js +1 -1
  103. package/lib/src/version.d.ts +1 -1
  104. package/lib/src/version.js +1 -1
  105. package/package.json +1 -1
  106. package/theme/ag-grid/index.css +3 -0
  107. package/theme/ag-grid-modal/index.css +773 -0
  108. package/theme/ag-grid-modal/index.less +58 -0
  109. package/theme/ap-form/ap-form-item.css +3 -0
  110. package/theme/ap-form/ap-form-item.less +3 -0
  111. package/theme/ap-form/index.css +3 -0
  112. package/theme/ap-form/search-form.css +3 -0
  113. package/theme/ap-grid/index.css +3 -0
  114. package/theme/ap-table/ap-table.css +3 -0
  115. package/theme/ap-table-modal/index.css +3 -0
  116. package/theme/ap-upload/index.css +5 -0
  117. package/theme/ap-upload/multiple-file.css +5 -0
  118. package/theme/ap-upload/multiple-file.less +6 -0
  119. package/theme/editable-table/index.css +3 -0
  120. package/theme/index.css +54 -3
  121. package/theme/index.less +1 -1
  122. package/es/src/work-order-modal/createWorkOrder.d.ts +0 -3
  123. package/es/src/work-order-modal/createWorkOrder.mjs +0 -32
  124. package/es/src/work-order-modal/help-message.vue.d.ts +0 -3
  125. package/es/src/work-order-modal/help-message.vue.mjs +0 -4
  126. package/es/src/work-order-modal/help-message.vue2.mjs +0 -36
  127. package/es/src/work-order-modal/index.d.ts +0 -4
  128. package/es/src/work-order-modal/index.mjs +0 -8
  129. package/es/src/work-order-modal/interfaces.d.ts +0 -31
  130. package/es/src/work-order-modal/interfaces.mjs +0 -9
  131. package/es/src/work-order-modal/style/css.js +0 -4
  132. package/es/src/work-order-modal/style/index.js +0 -4
  133. package/es/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
  134. package/es/src/work-order-modal/work-order-modal.vue.mjs +0 -192
  135. package/es/src/work-order-modal/work-order-modal.vue2.mjs +0 -4
  136. package/lib/src/work-order-modal/createWorkOrder.d.ts +0 -3
  137. package/lib/src/work-order-modal/createWorkOrder.js +0 -1
  138. package/lib/src/work-order-modal/help-message.vue.d.ts +0 -3
  139. package/lib/src/work-order-modal/help-message.vue.js +0 -1
  140. package/lib/src/work-order-modal/help-message.vue2.js +0 -1
  141. package/lib/src/work-order-modal/index.d.ts +0 -4
  142. package/lib/src/work-order-modal/index.js +0 -1
  143. package/lib/src/work-order-modal/interfaces.d.ts +0 -31
  144. package/lib/src/work-order-modal/interfaces.js +0 -1
  145. package/lib/src/work-order-modal/style/css.cjs +0 -4
  146. package/lib/src/work-order-modal/style/index.cjs +0 -4
  147. package/lib/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
  148. package/lib/src/work-order-modal/work-order-modal.vue.js +0 -1
  149. package/lib/src/work-order-modal/work-order-modal.vue2.js +0 -1
  150. /package/es/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
  151. /package/es/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
  152. /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
  153. /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
@@ -4,7 +4,7 @@ import { TableProps } from '@aplus-frontend/antdv';
4
4
  import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
5
5
  import { Recordable } from '../type';
6
6
  import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
7
- import { ColDef, GridApi, ICellRendererParams, IRowNode, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowPinnedType, ScrollDirection } from 'ag-grid-community';
7
+ import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection } from 'ag-grid-community';
8
8
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
9
9
  export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
10
10
  children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
@@ -103,6 +103,14 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
103
103
  * @description 仅限内部使用
104
104
  */
105
105
  _requireMark?: boolean;
106
+ /**
107
+ * 自定义列表头样式
108
+ */
109
+ headerStyle?: ColDef<RecordType>['headerStyle'];
110
+ /**
111
+ * 自定表头列类名
112
+ */
113
+ headerClass?: ColDef<RecordType>['headerClass'];
106
114
  } : null;
107
115
  export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
108
116
  /**
@@ -123,6 +131,10 @@ export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
123
131
  * 是否隐藏不可选中的元素
124
132
  */
125
133
  hideDisabled?: boolean;
134
+ /**
135
+ * 默认选中的行数据(如果没有rowKey将会被过滤掉,如果和defaultSelectedRowKeys同时使用,优先级更低)
136
+ */
137
+ defaultSelectedRows?: RecordType[];
126
138
  };
127
139
  export type AgGridVirtualConfig = {
128
140
  row?: boolean;
@@ -135,7 +147,20 @@ export type AgGridSummaryType<RecordType = any> = {
135
147
  cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType, rowIndex: number) => string | string[]);
136
148
  rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
137
149
  };
138
- export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky'> & {
150
+ export type AgGridCustomRowConfig<RecordType = any> = {
151
+ /**
152
+ * 判断哪些行是自定义渲染行
153
+ * @param params
154
+ * @returns
155
+ */
156
+ isCustomRow: (params: IsFullWidthRowParams<RecordType>) => boolean;
157
+ /**
158
+ * 行自定义渲染函数
159
+ * @returns
160
+ */
161
+ render: (params: any) => any;
162
+ };
163
+ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky' | 'customRow'> & {
139
164
  /**
140
165
  * 列配置
141
166
  */
@@ -239,6 +264,13 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
239
264
  * 指定每一行占据的高度(大量数据展示时的性能优化)
240
265
  */
241
266
  rowHeight?: number;
267
+ /**
268
+ * 指定一行占据的高度
269
+ * @since 6.38.0
270
+ * @param params
271
+ * @returns
272
+ */
273
+ getRowHeight?: (params: RowHeightParams<RecordType>) => number | null | undefined;
242
274
  /**
243
275
  * 是否使用另外一种渲染器来渲染单元格
244
276
  */
@@ -282,6 +314,11 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
282
314
  * @returns
283
315
  */
284
316
  onUpdate?: () => void;
317
+ /**
318
+ * 自定义行渲染配置
319
+ * @since 6.37.0
320
+ */
321
+ customRow?: AgGridCustomRowConfig;
285
322
  };
286
323
  export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
287
324
  /**
@@ -328,11 +365,25 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
328
365
  rowSelection: {
329
366
  selectedRows: ComputedRef<RecordType[]>;
330
367
  /**
331
- * 通过API调用设置行选中
368
+ * 通过rowKey来选中行
369
+ * 如果是单选模式,只会选择数组中的第一个元素做选中操作
332
370
  * @param keys
333
371
  * @returns
334
372
  */
335
373
  setSelectedRowKeys: (keys: (string | number)[]) => void;
374
+ /**
375
+ * 通过整行数据来选中行
376
+ * 如果是单选模式,只会选择数组中的第一个元素做选中操作
377
+ * @param rows
378
+ * @returns
379
+ */
380
+ setSelectedRows: (rows: RecordType[]) => void;
381
+ /**
382
+ * 反选中行
383
+ * @param rows
384
+ * @returns
385
+ */
386
+ unSelectRows: (rows: RecordType[]) => void;
336
387
  clearAll: () => void;
337
388
  };
338
389
  /**
@@ -5,10 +5,10 @@ import "../item-modal/index.vue2.mjs";
5
5
  import "../item-popconfirm/index.vue2.mjs";
6
6
  import "../item-dropdown/index.vue2.mjs";
7
7
  import "../../config-provider/index.mjs";
8
- import { isUndefined as x } from "lodash-unified";
9
- import { useLocale as B } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { isUndefined as F } from "lodash-unified";
9
+ import { useLocale as x } from "../../config-provider/hooks/use-locale.mjs";
10
10
  import f from "../item-dropdown/index.vue.mjs";
11
- import F from "../item-modal/index.vue.mjs";
11
+ import B from "../item-modal/index.vue.mjs";
12
12
  import $ from "../item-popconfirm/index.vue.mjs";
13
13
  import b from "../item/index.vue2.mjs";
14
14
  const q = /* @__PURE__ */ k({
@@ -22,51 +22,54 @@ const q = /* @__PURE__ */ k({
22
22
  iconFirst: { type: Boolean }
23
23
  },
24
24
  setup(_) {
25
- const r = _, { t: g } = B(), l = m(
25
+ const r = _, { t: g } = x(), l = m(
26
26
  () => r.actions.filter(
27
- (e) => e.visible || x(e.visible)
27
+ (t) => t.visible || F(t.visible)
28
28
  )
29
29
  ), d = m(() => c(l).length > r.count), u = m(() => {
30
- const e = c(l);
31
- if (e.length <= r.count)
30
+ const t = c(l);
31
+ if (t.length <= r.count)
32
32
  return {
33
- showActions: e,
33
+ showActions: t.map((e) => ({
34
+ ...e,
35
+ iconFirst: !0
36
+ })),
34
37
  menuActions: []
35
38
  };
36
- let i = e.slice(0, r.count - 1);
37
- return r.iconFirst && (i = i.map((t) => ({
38
- ...t,
39
+ let i = t.slice(0, r.count - 1);
40
+ return r.iconFirst && (i = i.map((e) => ({
41
+ ...e,
39
42
  iconFirst: !0
40
43
  }))), {
41
44
  showActions: i,
42
- menuActions: e.slice(r.count - 1)
45
+ menuActions: t.slice(r.count - 1)
43
46
  };
44
47
  });
45
- return (e, i) => (o(), n(c(w), {
48
+ return (t, i) => (o(), n(c(w), {
46
49
  size: 16,
47
50
  align: "center"
48
51
  }, {
49
52
  default: A(() => [
50
- (o(!0), a(p, null, v(u.value.showActions, (t, h) => (o(), a(p, { key: h }, [
51
- t.actions ? (o(), n(f, s({
53
+ (o(!0), a(p, null, v(u.value.showActions, (e, h) => (o(), a(p, { key: h }, [
54
+ e.actions ? (o(), n(f, s({
52
55
  key: 0,
53
56
  ref_for: !0
54
- }, t), null, 16)) : t.modalProps ? (o(), n(F, s({
57
+ }, e), null, 16)) : e.modalProps ? (o(), n(B, s({
55
58
  key: 1,
56
59
  ref_for: !0
57
- }, t), null, 16)) : t.popconfirmProps ? (o(), n($, s({
60
+ }, e), null, 16)) : e.popconfirmProps ? (o(), n($, s({
58
61
  key: 2,
59
62
  ref_for: !0
60
- }, t), null, 16)) : (o(), n(b, s({
63
+ }, e), null, 16)) : (o(), n(b, s({
61
64
  key: 3,
62
65
  ref_for: !0
63
- }, t), null, 16))
66
+ }, e), null, 16))
64
67
  ], 64))), 128)),
65
68
  d.value ? (o(), n(f, {
66
69
  key: 0,
67
70
  actions: u.value.menuActions,
68
- placement: e.placement,
69
- trigger: e.trigger,
71
+ placement: t.placement,
72
+ trigger: t.trigger,
70
73
  text: c(g)("ap.common.more")
71
74
  }, null, 8, ["actions", "placement", "trigger", "text"])) : y("", !0)
72
75
  ]),
@@ -1,8 +1,9 @@
1
- import { defineComponent as C, useSlots as B, createPropsRestProxy as A, ref as F, computed as d, unref as l, renderSlot as y, createElementBlock as u, createCommentVNode as a, openBlock as n, mergeProps as h, createBlock as f, normalizeClass as L, resolveDynamicComponent as g, isVNode as N, toDisplayString as P } from "vue";
1
+ import { defineComponent as C, useSlots as B, createPropsRestProxy as h, ref as A, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as F, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as g, isVNode as S, toDisplayString as V } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import S from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
- import { useNamespace as $ } from "../../config-provider/hooks/use-namespace.mjs";
5
- const D = { key: 1 }, E = /* @__PURE__ */ C({
3
+ import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
+ import { Tooltip as w } from "@aplus-frontend/antdv";
5
+ import { useNamespace as x } from "../../config-provider/hooks/use-namespace.mjs";
6
+ const D = { key: 1 }, q = /* @__PURE__ */ C({
6
7
  name: "ApActionItem",
7
8
  __name: "index",
8
9
  props: {
@@ -17,45 +18,52 @@ const D = { key: 1 }, E = /* @__PURE__ */ C({
17
18
  iconFirst: { type: Boolean, default: !1 }
18
19
  },
19
20
  setup(o) {
20
- const s = B(), r = A(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon"]), { b: k, m: t, e: b } = $("action-item"), c = F(!1), m = d(() => o.iconFirst && (o.icon || s.icon));
21
+ const s = B(), r = h(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon"]), { b: k, m: l, e: v } = x("action-item"), c = A(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
21
22
  function p(e) {
22
- l(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
23
+ n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
23
24
  }
24
- const i = d(() => o.loading || l(c)), v = d(() => [
25
+ const i = u(() => o.loading || n(c)), b = u(() => [
25
26
  k(),
26
- t(o.color),
27
- m.value ? t("icon-first") : null,
28
- o.disabled ? t("disabled") : null,
29
- i.value ? t("loading") : null
27
+ l(o.color),
28
+ d.value ? l("icon-first") : null,
29
+ o.disabled ? l("disabled") : null,
30
+ i.value ? l("loading") : null
30
31
  ].filter(Boolean));
31
32
  return (e, I) => y(e.$slots, "trigger", {
32
33
  loading: i.value,
33
34
  disabled: e.disabled,
34
35
  onClick: p
35
36
  }, () => [
36
- e.visible ? (n(), u("span", h({ key: 0 }, e.$attrs, {
37
- class: v.value,
37
+ e.visible ? (t(), f("span", F({ key: 0 }, e.$attrs, {
38
+ class: b.value,
38
39
  onClick: p
39
40
  }), [
40
- i.value ? (n(), f(l(S), {
41
+ i.value ? (t(), m(n($), {
41
42
  key: 0,
42
43
  "prefix-cls": "btn",
43
44
  "exist-icon": !1,
44
45
  loading: ""
45
46
  })) : a("", !0),
46
- e.icon || s.icon ? (n(), u("span", {
47
+ e.icon || s.icon ? (t(), f("span", {
47
48
  key: 1,
48
- class: L(l(b)("icon-wrapper"))
49
+ class: N(n(v)("icon-wrapper"))
49
50
  }, [
50
- (n(), f(g(e.icon || s.icon)))
51
+ L(n(w), {
52
+ title: d.value ? e.text : null
53
+ }, {
54
+ default: P(() => [
55
+ (t(), m(g(e.icon || s.icon)))
56
+ ]),
57
+ _: 1
58
+ }, 8, ["title"])
51
59
  ], 2)) : a("", !0),
52
- m.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
53
- N(e.text) ? (n(), f(g(e.text), { key: 0 })) : (n(), u("span", D, P(e.text || ""), 1))
60
+ d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
61
+ S(e.text) ? (t(), m(g(e.text), { key: 0 })) : (t(), f("span", D, V(e.text || ""), 1))
54
62
  ])
55
63
  ], 16)) : a("", !0)
56
64
  ]);
57
65
  }
58
66
  });
59
67
  export {
60
- E as default
68
+ q as default
61
69
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as G, ref as b, unref as e, computed as L, useSlots as M, createVNode as t, cloneVNode as P, createElementBlock as q, openBlock as k, Fragment as H, createBlock as J, createCommentVNode as Q, resolveDynamicComponent as W, withCtx as u, createElementVNode as a, normalizeClass as s, toDisplayString as m, createTextVNode as v, isRef as X } from "vue";
2
- import { Button as y, Modal as Y, RadioGroup as Z, RadioButton as T, Divider as x } from "@aplus-frontend/antdv";
3
- import { getSingleVNode as ee } from "../../../../utils/slot.mjs";
4
- import { useInjectApTable as te } from "../../../context.mjs";
1
+ import { defineComponent as L, ref as v, unref as e, computed as M, useSlots as P, createVNode as t, cloneVNode as q, createElementBlock as H, openBlock as h, Fragment as J, createBlock as Q, createCommentVNode as W, resolveDynamicComponent as X, withCtx as u, withDirectives as Y, createElementVNode as s, normalizeClass as i, toDisplayString as c, createTextVNode as S, isRef as Z, vShow as ee } from "vue";
2
+ import { Button as y, Modal as te, RadioGroup as le, RadioButton as T, Divider as x } from "@aplus-frontend/antdv";
3
+ import { getSingleVNode as ne } from "../../../../utils/slot.mjs";
4
+ import { useInjectApTable as ae } from "../../../context.mjs";
5
5
  import "../tree-select/index.vue.mjs";
6
- import { useTableColumnState as le } from "../../../hooks/use-table-column-state.mjs";
6
+ import { useTableColumnState as oe } from "../../../hooks/use-table-column-state.mjs";
7
7
  import "../../../../config-provider/index.mjs";
8
8
  import "../sorter/index.vue.mjs";
9
- import ne, { customCloneColumnStates as B } from "../utils.mjs";
10
- import { SettingOutlined as oe } from "@ant-design/icons-vue";
11
- import { useLocale as ae } from "../../../../config-provider/hooks/use-locale.mjs";
9
+ import se, { customCloneColumnStates as B } from "../utils.mjs";
10
+ import { SettingOutlined as ie } from "@ant-design/icons-vue";
11
+ import { useLocale as ue } from "../../../../config-provider/hooks/use-locale.mjs";
12
12
  import { useNamespace as N } from "../../../../config-provider/hooks/use-namespace.mjs";
13
- import se from "../tree-select/index.vue2.mjs";
14
- import ie from "../sorter/index.vue2.mjs";
15
- const Te = /* @__PURE__ */ G({
13
+ import re from "../tree-select/index.vue2.mjs";
14
+ import pe from "../sorter/index.vue2.mjs";
15
+ const Be = /* @__PURE__ */ L({
16
16
  name: "ApTableSetting",
17
17
  __name: "index",
18
18
  props: {
@@ -20,85 +20,86 @@ const Te = /* @__PURE__ */ G({
20
20
  default: () => ({})
21
21
  }
22
22
  },
23
- setup(h) {
24
- const c = h, {
25
- columnsBackup: _,
26
- size: z,
27
- updateSize: A,
28
- updateColumns: V
29
- } = te(), d = b(e(z)), R = L(() => c.config.persistenceKey), {
30
- columnState: l,
31
- setColumnState: w,
32
- isAllSelected: D,
33
- toggleSelectAll: O,
34
- columnStateBackup: U,
35
- setColumnStateBackup: E,
36
- cacheColumnStateIfNeeded: I
37
- } = le(c.config, R, []), {
38
- t: n
39
- } = ae(), {
23
+ setup(_) {
24
+ const m = _, {
25
+ columnsBackup: z,
26
+ size: A,
27
+ updateSize: V,
28
+ updateColumns: w
29
+ } = ae(), d = v(e(A)), R = M(() => m.config.persistenceKey), {
30
+ columnState: n,
31
+ setColumnState: D,
32
+ isAllSelected: O,
33
+ toggleSelectAll: U,
34
+ columnStateBackup: E,
35
+ setColumnStateBackup: I,
36
+ cacheColumnStateIfNeeded: K
37
+ } = oe(m.config, R, []), {
38
+ t: a
39
+ } = ue(), {
40
40
  b: f,
41
41
  be: g
42
42
  } = N("ap-column-setting"), {
43
- b: K
44
- } = N("ap-table"), r = b(!1), $ = M(), C = ee($.trigger) || t(y, {
45
- icon: t(oe, null, null),
46
- class: K("setting-trigger-button")
47
- }, null), S = C ? P(C, {
43
+ b: $
44
+ } = N("ap-table"), r = v(!1), C = v(!1), j = P(), b = ne(j.trigger) || t(y, {
45
+ icon: t(ie, null, null),
46
+ class: $("setting-trigger-button")
47
+ }, null), k = b ? q(b, {
48
48
  onClick: () => {
49
49
  r.value = !0;
50
50
  }
51
51
  }) : null;
52
- function j() {
53
- w(B(e(U)));
54
- }
55
52
  function F() {
56
- V?.(ne(e(_), e(l))), A?.(e(d)), r.value = !1;
57
- const p = B(l.value);
58
- E(p), I(p), c.config?.onChange?.(p);
53
+ D(B(e(E)));
54
+ }
55
+ function G() {
56
+ w?.(se(e(z), e(n))), V?.(e(d)), r.value = !1;
57
+ const p = B(n.value);
58
+ I(p), K(p), m.config?.onChange?.(p);
59
59
  }
60
- return (p, o) => (k(), q(H, null, [e(S) ? (k(), J(W(e(S)), {
60
+ return (p, o) => (h(), H(J, null, [e(k) ? (h(), Q(X(e(k)), {
61
61
  key: 0
62
- })) : Q("", !0), t(e(Y), {
62
+ })) : W("", !0), t(e(te), {
63
63
  open: r.value,
64
- "onUpdate:open": o[2] || (o[2] = (i) => r.value = i),
65
- title: e(n)("ap.apTable.setting.title"),
64
+ "onUpdate:open": o[2] || (o[2] = (l) => r.value = l),
65
+ title: e(a)("ap.apTable.setting.title"),
66
66
  width: 900,
67
67
  centered: !0,
68
68
  "body-style": {
69
69
  padding: "0px !important",
70
70
  height: "450px"
71
71
  },
72
- onOk: F
72
+ "after-open-change": (l) => C.value = l,
73
+ onOk: G
73
74
  }, {
74
- default: u(() => [a("div", {
75
- class: s(e(f)("wrapper"))
76
- }, [a("div", {
77
- class: s(e(f)("left"))
78
- }, [a("div", {
79
- class: s(e(g)("left", "header"))
80
- }, [a("div", null, [a("span", {
81
- class: s(e(g)("left", "header-tips"))
82
- }, m(e(n)("ap.apTable.setting.selectAllTip")), 3), t(e(y), {
75
+ default: u(() => [Y(s("div", {
76
+ class: i(e(f)("wrapper"))
77
+ }, [s("div", {
78
+ class: i(e(f)("left"))
79
+ }, [s("div", {
80
+ class: i(e(g)("left", "header"))
81
+ }, [s("div", null, [s("span", {
82
+ class: i(e(g)("left", "header-tips"))
83
+ }, c(e(a)("ap.apTable.setting.selectAllTip")), 3), t(e(y), {
83
84
  type: "link",
84
85
  size: "small",
85
- onClick: e(O)
86
+ onClick: e(U)
86
87
  }, {
87
- default: u(() => [v(m(e(D) ? e(n)("ap.apTable.setting.unSelectAll") : e(n)("ap.apTable.setting.selectAll")), 1)]),
88
+ default: u(() => [S(c(e(O) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
88
89
  _: 1
89
- }, 8, ["onClick"])]), t(e(Z), {
90
+ }, 8, ["onClick"])]), t(e(le), {
90
91
  value: d.value,
91
- "onUpdate:value": o[0] || (o[0] = (i) => d.value = i)
92
+ "onUpdate:value": o[0] || (o[0] = (l) => d.value = l)
92
93
  }, {
93
94
  default: u(() => [t(e(T), {
94
95
  value: "small"
95
96
  }, {
96
- default: u(() => [v(m(e(n)("ap.apTable.setting.sizeSmall")), 1)]),
97
+ default: u(() => [S(c(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
97
98
  _: 1
98
99
  }), t(e(T), {
99
100
  value: "middle"
100
101
  }, {
101
- default: u(() => [v(m(e(n)("ap.apTable.setting.sizeNormal")), 1)]),
102
+ default: u(() => [S(c(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
102
103
  _: 1
103
104
  })]),
104
105
  _: 1
@@ -107,26 +108,26 @@ const Te = /* @__PURE__ */ G({
107
108
  style: {
108
109
  margin: "0px"
109
110
  }
110
- }), t(se, {
111
- class: s(e(g)("left", "content")),
112
- value: e(l)
111
+ }), t(re, {
112
+ class: i(e(g)("left", "content")),
113
+ value: e(n)
113
114
  }, null, 8, ["class", "value"])], 2), t(e(x), {
114
115
  type: "vertical",
115
116
  style: {
116
117
  height: "100%",
117
118
  margin: "0px"
118
119
  }
119
- }), a("div", {
120
- class: s(e(f)("right"))
121
- }, [t(ie, {
122
- value: e(l),
123
- "onUpdate:value": o[1] || (o[1] = (i) => X(l) ? l.value = i : null),
124
- onReset: j
125
- }, null, 8, ["value"])], 2)], 2)]),
120
+ }), s("div", {
121
+ class: i(e(f)("right"))
122
+ }, [t(pe, {
123
+ value: e(n),
124
+ "onUpdate:value": o[1] || (o[1] = (l) => Z(n) ? n.value = l : null),
125
+ onReset: F
126
+ }, null, 8, ["value"])], 2)], 2), [[ee, C.value]])]),
126
127
  _: 1
127
- }, 8, ["open", "title"])], 64));
128
+ }, 8, ["open", "title", "after-open-change"])], 64));
128
129
  }
129
130
  });
130
131
  export {
131
- Te as default
132
+ Be as default
132
133
  };
@@ -352,6 +352,12 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
352
352
  * 查询表单提交
353
353
  */
354
354
  submit: () => void;
355
+ /**
356
+ * 表格查询提交(重制页码但查询参数不会重置)
357
+ * @param resetCurrent 是否重置当前页码,默认为`false`
358
+ * @returns
359
+ */
360
+ submitWith: (resetCurrent?: boolean) => void;
355
361
  /**
356
362
  * 查询表单重置
357
363
  */
@@ -0,0 +1,4 @@
1
+ /** 非字符串增加key值字段 */
2
+ export declare const ROW_KEY = "__ag-grid-modal-row-key";
3
+ export declare const SMALL_HEIGHT = "480px";
4
+ export declare const LARGER_HEIGHT = "calc(100vh - 200px)";
@@ -0,0 +1,6 @@
1
+ const o = "__ag-grid-modal-row-key", c = "480px", _ = "calc(100vh - 200px)";
2
+ export {
3
+ _ as LARGER_HEIGHT,
4
+ o as ROW_KEY,
5
+ c as SMALL_HEIGHT
6
+ };
@@ -0,0 +1,33 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { AgGridExpose } from '../../../ag-grid';
3
+ import { RefreshType } from '../interface';
4
+ interface Options {
5
+ onMounted?: () => void;
6
+ onSelectedRows?: (rows?: any[]) => void;
7
+ }
8
+ export interface GridApi {
9
+ /** 设置 AgGrid 实例 */
10
+ setInstance: (node: any) => void;
11
+ /** 刷新表格 */
12
+ refresh: (type?: RefreshType) => void;
13
+ /** 获取 AgGrid 实例 */
14
+ getInstance: () => AgGridExpose | undefined;
15
+ /** 设置 AgGrid 选中行 */
16
+ setSelectedRowKeys: (keys: (string | number)[]) => void;
17
+ /** 获取 AgGrid 选中行 */
18
+ getSelectedRows: () => any[] | undefined;
19
+ /** 清空所有选中行 */
20
+ clearAllSelected: () => void;
21
+ /** 清除某一行数据 */
22
+ removeSelected: (record: any) => void;
23
+ /** 设置表格数据length */
24
+ setDataSourceLength: (len: number) => void;
25
+ }
26
+ interface GridApiProvider extends GridApi {
27
+ selectedRows?: ComputedRef<any[]>;
28
+ dataSourceLength?: ComputedRef<number>;
29
+ }
30
+ export declare function useAgGridInstance(options?: Options): [GridApi, any];
31
+ /** 获取上下文中grid的api */
32
+ export declare function useAgGridModalInject(): GridApiProvider | undefined;
33
+ export {};
@@ -0,0 +1,50 @@
1
+ import { ref as o, watch as r, defineComponent as A, provide as h, toRef as a, inject as I } from "vue";
2
+ import { cloneDeep as y } from "lodash-unified";
3
+ const u = Symbol("ag-grid-provider-key");
4
+ function L(n) {
5
+ const t = o(), c = o(), l = o(0), d = (e) => {
6
+ t.value = e;
7
+ }, i = (e) => {
8
+ l.value = e;
9
+ }, v = () => t.value, S = (e = "reset") => {
10
+ t.value && e in t.value && t.value[e]();
11
+ }, w = (e) => {
12
+ t.value?.rowSelection.setSelectedRowKeys(e);
13
+ }, g = () => y(t.value?.rowSelection.selectedRows.value), f = () => t.value?.rowSelection.clearAll(), R = (e) => t.value?.rowSelection.unSelectRows([e]);
14
+ r(t, (e) => {
15
+ e && n?.onMounted?.();
16
+ }), r(
17
+ () => t.value?.rowSelection.selectedRows.value,
18
+ (e) => {
19
+ c.value = e, n?.onSelectedRows?.(e);
20
+ }
21
+ );
22
+ const s = {
23
+ setInstance: d,
24
+ refresh: S,
25
+ getInstance: v,
26
+ setSelectedRowKeys: w,
27
+ getSelectedRows: g,
28
+ clearAllSelected: f,
29
+ removeSelected: R,
30
+ setDataSourceLength: i
31
+ }, p = A({
32
+ setup(e, { slots: m }) {
33
+ return h(u, {
34
+ ...s,
35
+ selectedRows: a(() => c.value),
36
+ dataSourceLength: a(
37
+ () => l.value
38
+ )
39
+ }), m.default;
40
+ }
41
+ });
42
+ return [s, p];
43
+ }
44
+ function _() {
45
+ return I(u);
46
+ }
47
+ export {
48
+ L as useAgGridInstance,
49
+ _ as useAgGridModalInject
50
+ };
@@ -0,0 +1,3 @@
1
+ import { AgGridPreviewModalProps, PreviewModalReturnType } from '../interface';
2
+ /** ag-grid弹框 */
3
+ export declare function useAgGridModal<T = any>(props: AgGridPreviewModalProps<T>): PreviewModalReturnType;