@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
@@ -1,32 +1,34 @@
1
- import { defineComponent as oo, useSlots as to, ref as I, toRef as T, unref as t, computed as l, nextTick as ro, watch as z, createElementBlock as A, openBlock as b, normalizeStyle as V, normalizeClass as m, createCommentVNode as ae, createElementVNode as B, createVNode as M, mergeProps as O, createSlots as ao, withCtx as ne, Fragment as no, renderList as lo, createBlock as le, resolveDynamicComponent as so, renderSlot as se, withDirectives as io, vShow as uo } from "vue";
2
- import { AgGridVue as co } from "ag-grid-vue3";
3
- import { ModuleRegistry as mo, AllCommunityModule as po } from "ag-grid-community";
4
- import { mergeProps as fo } from "./utils.mjs";
5
- import { Spin as go, Pagination as wo } from "@aplus-frontend/antdv";
6
- import { isUndefined as F, isFunction as G } from "lodash-unified";
1
+ import { defineComponent as so, useSlots as io, ref as D, toRef as N, unref as t, computed as n, nextTick as A, watch as M, createElementBlock as V, openBlock as b, normalizeStyle as W, normalizeClass as f, createCommentVNode as le, createElementVNode as F, createVNode as O, mergeProps as G, createSlots as uo, withCtx as ne, Fragment as co, renderList as mo, createBlock as se, resolveDynamicComponent as po, renderSlot as ie, withDirectives as fo, vShow as go } from "vue";
2
+ import { AgGridVue as wo } from "ag-grid-vue3";
3
+ import { ModuleRegistry as So, AllCommunityModule as yo } from "ag-grid-community";
4
+ import { mergeProps as ho } from "./utils.mjs";
5
+ import { Spin as Co, Pagination as Ro } from "@aplus-frontend/antdv";
6
+ import { isUndefined as B, isFunction as H } from "lodash-unified";
7
7
  import "../config-provider/index.mjs";
8
- import { ApForm as So } from "../ap-form/index.mjs";
9
- import { recursionApColumns as yo } from "../ap-table/utils.mjs";
10
- import { useTablePaging as Co } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
- import ho from "./hooks/use-row-selection.mjs";
12
- import { useProvideSorter as vo } from "./context.mjs";
13
- import { useProvideApTable as Ro } from "../ap-table/context.mjs";
14
- import { DEFAULT_ROW_SELECTION_CONFIG as ie, sizeReverseMap as bo, sizeMap as Bo } from "../ap-grid/constants.mjs";
15
- import { useToken as Fo } from "@aplus-frontend/antdv/es/theme/internal";
16
- import { useTheme as ko } from "./theme.mjs";
17
- import { useColumns as xo } from "./hooks/use-columns.mjs";
18
- import { useColumnsDef as Io } from "./hooks/use-columns-def.mjs";
19
- import { isDef as To } from "../utils/index.mjs";
20
- import { getValidVNodeList as Do } from "../utils/slot.mjs";
21
- import { useSearchForm as No } from "./hooks/use-search-form.mjs";
8
+ import { ApForm as vo } from "../ap-form/index.mjs";
9
+ import { recursionApColumns as bo } from "../ap-table/utils.mjs";
10
+ import { useTablePaging as Fo } from "../ap-table/hooks/use-table-paging-ng.mjs";
11
+ import Bo from "./hooks/use-row-selection.mjs";
12
+ import { useProvideSorter as ko } from "./context.mjs";
13
+ import { useProvideApTable as xo } from "../ap-table/context.mjs";
14
+ import { DEFAULT_ROW_SELECTION_CONFIG as de, sizeReverseMap as Io, sizeMap as Do } from "../ap-grid/constants.mjs";
15
+ import { useToken as No } from "@aplus-frontend/antdv/es/theme/internal";
16
+ import { useTheme as To } from "./theme.mjs";
17
+ import { useColumns as Eo } from "./hooks/use-columns.mjs";
18
+ import { useColumnsDef as Ko } from "./hooks/use-columns-def.mjs";
19
+ import { isDef as Po } from "../utils/index.mjs";
20
+ import { getValidVNodeList as zo } from "../utils/slot.mjs";
21
+ import { useSearchForm as Ao } from "./hooks/use-search-form.mjs";
22
22
  import "./components/empty/index.vue.mjs";
23
- import Eo from "./hooks/use-virtual-config.mjs";
24
- import { usePinnedRow as Ko } from "./hooks/use-pinned-row.mjs";
25
- import Po from "./hooks/use-selection-col-def.mjs";
26
- import { useNamespace as zo } from "../config-provider/hooks/use-namespace.mjs";
27
- import { useGlobalConfig as Ao } from "../config-provider/hooks/use-global-config.mjs";
28
- import Vo from "./components/empty/index.vue2.mjs";
29
- const mt = /* @__PURE__ */ oo({
23
+ import Mo from "./hooks/use-virtual-config.mjs";
24
+ import { usePinnedRow as Vo } from "./hooks/use-pinned-row.mjs";
25
+ import Wo from "./hooks/use-selection-col-def.mjs";
26
+ import "./components/row/index.vue.mjs";
27
+ import { useNamespace as Oo } from "../config-provider/hooks/use-namespace.mjs";
28
+ import { useGlobalConfig as Go } from "../config-provider/hooks/use-global-config.mjs";
29
+ import Ho from "./components/row/index.vue2.mjs";
30
+ import Lo from "./components/empty/index.vue2.mjs";
31
+ const Ct = /* @__PURE__ */ so({
30
32
  name: "AgGrid",
31
33
  __name: "index",
32
34
  props: {
@@ -46,7 +48,6 @@ const mt = /* @__PURE__ */ oo({
46
48
  id: {},
47
49
  showHeader: { type: Boolean },
48
50
  components: {},
49
- customRow: {},
50
51
  customHeaderRow: {},
51
52
  direction: {},
52
53
  expandFixed: { type: [String, Boolean] },
@@ -89,6 +90,7 @@ const mt = /* @__PURE__ */ oo({
89
90
  loading: { type: Boolean, default: void 0 },
90
91
  summary: {},
91
92
  rowHeight: {},
93
+ getRowHeight: {},
92
94
  advanceRenderer: { type: Boolean },
93
95
  browserTooltips: { type: Boolean },
94
96
  virtual: { type: [Boolean, Object], default: void 0 },
@@ -97,67 +99,68 @@ const mt = /* @__PURE__ */ oo({
97
99
  rowClassName: {},
98
100
  rowClassRules: {},
99
101
  autoHeight: { type: Boolean },
100
- onUpdate: {}
102
+ onUpdate: {},
103
+ customRow: {}
101
104
  },
102
- setup(de, { expose: ue }) {
103
- mo.registerModules([po]);
104
- const o = de, W = to(), { e: k, b: u, be: ce } = zo("ag-grid"), C = I(o.size), me = ko(C, T(o, "rowHeight")), pe = Eo(T(o, "virtual")), { rowPinnedGridConfig: H, getRowPinnedCellClass: fe } = Ko(
105
- T(o, "summary")
106
- ), ge = Ao("apGrid"), s = I(), [, we] = Fo();
107
- let p = !!o.dataSource;
108
- const L = No(o), { shownColumns: f, columns: U, columnKeys: Se, getTargetColumnByKey: ye } = xo(o), { defaultColDef: Ce, columnDefs: he, gridWrapperRef: ve } = Io(U, o, fe), x = I({});
109
- vo({
105
+ setup(ue, { expose: ce }) {
106
+ So.registerModules([yo]);
107
+ const o = ue, L = io(), { e: k, b: u, be: me } = Oo("ag-grid"), h = D(o.size), pe = To(h, N(o, "rowHeight")), fe = Mo(N(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Vo(
108
+ N(o, "summary")
109
+ ), we = Go("apGrid"), s = D(), [, Se] = No();
110
+ let C = !!o.dataSource;
111
+ const j = Ao(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Eo(o), { defaultColDef: Ce, columnDefs: Re, gridWrapperRef: ve } = Ko($, o, ge), x = D({});
112
+ ko({
110
113
  sorter: x,
111
114
  setSorter(e) {
112
115
  x.value = e;
113
116
  }
114
117
  });
115
- const Re = {
118
+ const be = {
116
119
  asc: "ascend",
117
120
  desc: "descend"
118
121
  };
119
- function be() {
122
+ function Fe() {
120
123
  const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(x) || {};
121
124
  let a = e?.[0];
122
- const d = Object.keys(r);
123
- if (d.length && d.every((c) => r[c] === null)) {
125
+ const i = Object.keys(r);
126
+ if (i.length && i.every((c) => r[c] === null)) {
124
127
  const c = Object.keys(r)[0];
125
128
  c && (a = s.value?.getColumn(c));
126
129
  }
127
130
  if (!a)
128
131
  return;
129
- const i = a.getColDef(), y = a.getSort(), v = ye(i.colId);
130
- $(void 0, void 0, {
131
- column: i,
132
- field: v?.field ?? i.field ?? i.colId,
133
- order: y ? Re[y] : null
132
+ const d = a.getColDef(), m = a.getSort(), p = he(d.colId);
133
+ _(void 0, void 0, {
134
+ column: d,
135
+ field: p?.field ?? d.field ?? d.colId,
136
+ order: m ? be[m] : null
134
137
  });
135
138
  }
136
- const Be = l(() => yo(t(f), (e) => {
139
+ const Be = n(() => bo(t(g), (e) => {
137
140
  if (e.sorter === !0)
138
141
  return e.field ?? e.dataIndex ?? e.key;
139
- }).filter(Boolean)), Fe = () => {
142
+ }).filter(Boolean)), ke = () => {
140
143
  x.value = {};
141
144
  const e = s.value;
142
145
  if (!e)
143
146
  return;
144
147
  const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
145
148
  e.applyColumnState({ state: r });
146
- }, ke = l(() => To(o.manual) ? o.manual : Do(W.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
147
- formRef: g,
148
- submit: D,
149
- reset: N,
150
- data: w,
151
- tableProps: j,
152
- handleTableChangeOptional: $,
153
- submitWith: q,
154
- refresh: J,
155
- getPaging: xe,
156
- setPaging: Ie,
157
- setDataSource: Te
158
- } = Co({
149
+ }, xe = n(() => Po(o.manual) ? o.manual : zo(L.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
150
+ formRef: w,
151
+ submit: T,
152
+ reset: E,
153
+ data: S,
154
+ tableProps: q,
155
+ handleTableChangeOptional: _,
156
+ submitWith: J,
157
+ refresh: Q,
158
+ getPaging: Ie,
159
+ setPaging: De,
160
+ setDataSource: Ne
161
+ } = Fo({
159
162
  async request(e) {
160
- if (p = !1, S.value && !S.value.preserveSelectedRowKeys && F(o.dataSource) && P(), !F(o.dataSource)) {
163
+ if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) && z(), !B(o.dataSource)) {
161
164
  const a = e.pageSize * (e.current - 1);
162
165
  return {
163
166
  data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
@@ -171,338 +174,360 @@ const mt = /* @__PURE__ */ oo({
171
174
  };
172
175
  },
173
176
  namespace: "ap-grid",
174
- filterFields: I([]),
175
- params: T(o, "params"),
177
+ filterFields: D([]),
178
+ params: N(o, "params"),
176
179
  defaultData: o.defaultData,
177
- manual: t(ke),
180
+ manual: t(xe),
178
181
  formatParams: o.beforeSearchSubmit,
179
182
  pagination: o.pagination,
180
183
  sortFields: Be,
181
- onClickReset: Fe
182
- }), S = l(() => {
183
- const e = o.rowSelection || ge.value?.rowSelection;
184
+ onClickReset: ke
185
+ }), y = n(() => {
186
+ const e = o.rowSelection || we.value?.rowSelection;
184
187
  if (e)
185
- return e === !0 ? ie : {
186
- ...ie,
188
+ return e === !0 ? de : {
189
+ ...de,
187
190
  ...e
188
191
  };
189
- }), De = Po(o, f), Ne = l(
190
- () => F(o.dataSource) ? w.records : o.dataSource
192
+ }), Te = Wo(o, g), Ee = n(
193
+ () => B(o.dataSource) ? S.records : o.dataSource
191
194
  ), {
192
- select: Ee,
193
- unSelect: Ke,
194
- selectedRows: E,
195
- selectedRowKeys: Pe,
196
- clearAll: ze,
197
- selectMultiByKeys: Ae
198
- } = ho({
199
- ...S.value,
200
- dataSource: Ne,
195
+ select: Ke,
196
+ unSelect: Pe,
197
+ selectedRows: K,
198
+ selectedRowKeys: ze,
199
+ clearAll: Ae,
200
+ selectMultiByKeys: Me,
201
+ selectMulti: Ve,
202
+ unSelectMulti: We
203
+ } = Bo({
204
+ ...y.value,
205
+ dataSource: Ee,
201
206
  rowKey: o.rowKey
202
- }), Ve = {
207
+ }), Oe = {
203
208
  checkbox: "multiRow",
204
209
  radio: "singleRow"
205
- }, Me = l(() => {
206
- const e = S.value;
210
+ }, Ge = n(() => {
211
+ const e = y.value;
207
212
  if (!e)
208
213
  return;
209
214
  const { type: r = "checkbox", disabled: a } = e;
210
215
  return {
211
- mode: Ve[r],
212
- isRowSelectable: (d) => a ? !a(d.data) : !0,
216
+ mode: Oe[r],
217
+ isRowSelectable: (i) => a ? !a(i.data) : !0,
213
218
  hideDisabledCheckboxes: e.hideDisabled ?? !1
214
219
  };
215
220
  });
216
- function K(e) {
217
- return G(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
221
+ function P(e) {
222
+ return H(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
218
223
  }
219
- const Q = ({
224
+ const I = ({
220
225
  api: e = s.value
221
226
  }) => {
222
- if (o.onUpdate?.(), !S.value)
227
+ if (o.onUpdate?.(), !y.value)
223
228
  return;
224
- const r = E.value;
225
- if (!r.length) {
226
- setTimeout(() => {
227
- p = !0;
228
- }, 0);
229
- return;
230
- }
231
- p = !1;
229
+ const r = K.value || [];
230
+ C = !1;
232
231
  const a = [];
233
- e.forEachNode((d) => {
234
- const h = d.data, i = K(h);
235
- r.find((y) => K(y) === i) && a.push(d);
232
+ e.forEachNode((i) => {
233
+ const R = i.data, d = P(R), m = i.isSelected();
234
+ r.find((p) => P(p) === d) ? !m && a.push(i) : m && i.setSelected(!1);
236
235
  }), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
237
- p = !0;
236
+ C = !0;
238
237
  }, 0);
239
- }, Oe = (e) => {
240
- p && (e.node.isSelected() ? Ee(e.data) : Ke(e.data), G(S.value?.tooltip) && e.api.refreshCells({
238
+ }, He = (e) => {
239
+ C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data), H(y.value?.tooltip) && e.api.refreshCells({
241
240
  rowNodes: [e.node],
242
241
  // todo: 取消硬编码
243
242
  columns: ["ag-Grid-SelectionColumn"],
244
243
  force: !0
245
244
  }));
246
- }, Ge = () => {
247
- p = !0;
248
- }, P = () => {
249
- ze(), s.value?.deselectAll();
245
+ }, Le = () => {
246
+ C = !0;
247
+ }, z = () => {
248
+ Ae(), s.value?.deselectAll();
250
249
  };
251
- function We(e) {
252
- Ae(e), ro(() => {
253
- Q({});
250
+ function Ue(e) {
251
+ Me(e), A(() => {
252
+ I({});
253
+ });
254
+ }
255
+ const je = n(() => {
256
+ const e = o.customRow;
257
+ return e ? {
258
+ isFullWidthRow: e.isCustomRow,
259
+ fullWidthCellRenderer: Ho,
260
+ fullWidthCellRendererParams: {
261
+ render: e.render
262
+ }
263
+ } : {};
264
+ });
265
+ function $e(e) {
266
+ Ve(e), A(() => {
267
+ I({});
268
+ });
269
+ }
270
+ function qe(e) {
271
+ We(e), A(() => {
272
+ I({});
254
273
  });
255
274
  }
256
275
  function X(e = !1) {
257
276
  const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
258
- return g.value?.apForm?.[r]?.(!0);
277
+ return w.value?.apForm?.[r]?.(!0);
259
278
  }
260
279
  function Y(e) {
261
- g.value?.apForm?.setFieldsValue?.(e);
280
+ w.value?.apForm?.setFieldsValue?.(e);
262
281
  }
263
282
  function Z() {
264
- return g.value?.getSorterItems() || [];
283
+ return w.value?.getSorterItems() || [];
265
284
  }
266
- function _(e) {
267
- g.value?.setSorterItems(e);
285
+ function ee(e) {
286
+ w.value?.setSorterItems(e);
268
287
  }
269
- function ee() {
270
- g.value?.resetSorterItems();
288
+ function oe() {
289
+ w.value?.resetSorterItems();
271
290
  }
272
- function oe(e) {
291
+ function te(e) {
273
292
  return e && String(e);
274
293
  }
275
- function He(e) {
294
+ function _e(e) {
276
295
  const r = s.value;
277
296
  if (!r)
278
297
  return;
279
- const a = r.getColumnState() || [], d = e.map((n) => n.key ? String(n.key) : n.key).filter(Boolean), h = a.map((n) => {
280
- if (!Se.value.includes(n.colId))
281
- return n;
282
- const R = !d.includes(n.colId), te = {
283
- ...n,
284
- hide: R
285
- }, re = e.find(
286
- (eo) => oe(eo.key) === n.colId
298
+ const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), R = a.map((l) => {
299
+ if (!ye.value.includes(l.colId))
300
+ return l;
301
+ const v = !i.includes(l.colId), re = {
302
+ ...l,
303
+ hide: v
304
+ }, ae = e.find(
305
+ (no) => te(no.key) === l.colId
287
306
  );
288
- return re && (te.pinned = re.fixed || null), te;
289
- }), i = new Map(
290
- e.map((n, R) => [oe(n.key), R])
291
- ), y = h.filter((n) => i.has(n.colId)).sort(
292
- (n, R) => i.get(n.colId) - i.get(R.colId)
293
- ), v = [];
307
+ return ae && (re.pinned = ae.fixed || null), re;
308
+ }), d = new Map(
309
+ e.map((l, v) => [te(l.key), v])
310
+ ), m = R.filter((l) => d.has(l.colId)).sort(
311
+ (l, v) => d.get(l.colId) - d.get(v.colId)
312
+ ), p = [];
294
313
  let c = 0;
295
- for (const n of h)
296
- i.has(n.colId) ? v.push(y[c++]) : v.push(n);
314
+ for (const l of R)
315
+ d.has(l.colId) ? p.push(m[c++]) : p.push(l);
297
316
  r.applyColumnState({
298
- state: v,
317
+ state: p,
299
318
  applyOrder: !0
300
319
  });
301
320
  }
302
- Ro({
303
- columns: l(() => f.value),
304
- columnsBackup: l(() => U.value),
305
- size: l(() => Bo[C.value]),
321
+ xo({
322
+ columns: n(() => g.value),
323
+ columnsBackup: n(() => $.value),
324
+ size: n(() => Do[h.value]),
306
325
  updateColumns(e) {
307
- f.value = e, o.onShownColumnsChange?.(e), He(e);
326
+ g.value = e, o.onShownColumnsChange?.(e), _e(e);
308
327
  },
309
328
  updateSize(e) {
310
- C.value = bo[e];
329
+ h.value = Io[e];
311
330
  },
312
- renderConfig: l(() => ({
313
- className: ce("table-header", "title"),
314
- color: we.value.colorTextTertiary
331
+ renderConfig: n(() => ({
332
+ className: me("table-header", "title"),
333
+ color: Se.value.colorTextTertiary
315
334
  })),
316
- dataSource: l(() => t(w).records),
335
+ dataSource: n(() => t(S).records),
317
336
  getSearchFormValues: X,
318
337
  setSearchFormValues: Y,
319
- submit: D,
320
- submitWith: q,
321
- reset: N,
322
- refresh: J,
338
+ submit: T,
339
+ submitWith: J,
340
+ reset: E,
341
+ refresh: Q,
323
342
  getSearchFormSorterItems: Z,
324
- setSearchFormSorterItems: _,
325
- resetSearchFormSorterItems: ee
343
+ setSearchFormSorterItems: ee,
344
+ resetSearchFormSorterItems: oe
326
345
  });
327
- const Le = l(
328
- () => F(o.loading) ? w.loading : o.loading
329
- ), Ue = l(() => [
346
+ const Je = n(
347
+ () => B(o.loading) ? S.loading : o.loading
348
+ ), Qe = n(() => [
330
349
  u(),
331
350
  o.card ? null : u("wrapper"),
332
351
  u("adaptive"),
333
- u(`size-${C.value}`)
334
- ].filter(Boolean)), je = l(() => ({
352
+ u(`size-${h.value}`)
353
+ ].filter(Boolean)), Xe = n(() => ({
335
354
  height: "100%",
336
355
  ...o.tableStyle || {}
337
- })), $e = (e, r) => {
338
- $({ current: e, pageSize: r });
356
+ })), Ye = (e, r) => {
357
+ _({ current: e, pageSize: r });
339
358
  };
340
- function qe(e) {
359
+ function Ze(e) {
341
360
  const r = e.data;
342
- return K(r);
361
+ return P(r);
343
362
  }
344
- function Je(e, r) {
363
+ function eo(e, r) {
345
364
  s.value?.ensureIndexVisible(e, r);
346
365
  }
347
- function Qe(e) {
366
+ function oo(e) {
348
367
  o.onRowClicked?.(e.data, e.event);
349
368
  }
350
- function Xe(e) {
369
+ function to(e) {
351
370
  o.onScrollEnd?.(e.direction);
352
371
  }
353
- function Ye(e) {
372
+ function ro(e) {
354
373
  return s.value?.refreshCells(e);
355
374
  }
356
- function Ze(e) {
375
+ function ao(e) {
357
376
  return s.value?.redrawRows(e);
358
377
  }
359
- const _e = (e) => {
378
+ const lo = (e) => {
360
379
  const r = [
361
- H.value.getRowClass?.(e)
380
+ U.value.getRowClass?.(e)
362
381
  ];
363
382
  if (!e.node.rowPinned) {
364
- const a = G(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
383
+ const a = H(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
365
384
  r.push(a);
366
385
  }
367
386
  return r.flat().filter(Boolean);
368
387
  };
369
- return z(
388
+ return M(
370
389
  () => o.dataSource,
371
390
  (e) => {
372
- Te(e);
391
+ Ne(e);
373
392
  },
374
393
  { immediate: !0, deep: !0 }
375
- ), z(
394
+ ), M(
376
395
  () => o.size,
377
396
  (e) => {
378
- C.value = e;
397
+ h.value = e;
379
398
  }
380
- ), z(
381
- () => t(w).loading,
399
+ ), M(
400
+ () => t(S).loading,
382
401
  (e) => {
383
402
  o.onLoadingChange?.(e);
384
403
  }
385
- ), ue({
386
- submit: D,
387
- reset: N,
388
- refresh: J,
389
- submitWith: q,
404
+ ), ce({
405
+ submit: T,
406
+ reset: E,
407
+ refresh: Q,
408
+ submitWith: J,
390
409
  setSearchFormValues: Y,
391
410
  getSearchFormValues: X,
392
- getShowColumns: () => t(f),
411
+ getShowColumns: () => t(g),
393
412
  rowSelection: {
394
- selectedRows: l(() => E.value),
395
- setSelectedRowKeys: We,
396
- clearAll: P
413
+ selectedRows: n(() => K.value),
414
+ setSelectedRowKeys: Ue,
415
+ setSelectedRows: $e,
416
+ clearAll: z,
417
+ unSelectRows: qe
397
418
  },
398
- scrollToRow: Je,
399
- getDataSource: () => t(w.records),
400
- getPaging: xe,
401
- setPaging: Ie,
419
+ scrollToRow: eo,
420
+ getDataSource: () => t(S.records),
421
+ getPaging: Ie,
422
+ setPaging: De,
402
423
  getSearchFormSorterItems: Z,
403
- setSearchFormSorterItems: _,
404
- resetSearchFormSorterItems: ee,
405
- refreshCells: Ye,
406
- redrawRows: Ze,
407
- _internalGridApi: l(() => s.value)
408
- }), (e, r) => (b(), A("div", {
409
- class: m(Ue.value),
410
- style: V(e.wrapperStyle)
424
+ setSearchFormSorterItems: ee,
425
+ resetSearchFormSorterItems: oe,
426
+ refreshCells: ro,
427
+ redrawRows: ao,
428
+ _internalGridApi: n(() => s.value)
429
+ }), (e, r) => (b(), V("div", {
430
+ class: f(Qe.value),
431
+ style: W(e.wrapperStyle)
411
432
  }, [
412
- t(F)(e.dataSource) && e.searchForm !== !1 && t(L).length > 0 ? (b(), A("div", {
433
+ t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(), V("div", {
413
434
  key: 0,
414
- class: m(e.card ? t(k)("search-wrapper") : null),
415
- style: V(e.searchFormWrapperStyle)
435
+ class: f(e.card ? t(k)("search-wrapper") : null),
436
+ style: W(e.searchFormWrapperStyle)
416
437
  }, [
417
- M(t(So).SearchForm, O(e.searchForm || {}, {
438
+ O(t(vo).SearchForm, G(e.searchForm || {}, {
418
439
  ref_key: "formRef",
419
- ref: g,
440
+ ref: w,
420
441
  "custom-reset": "",
421
- "submit-loading": t(j).loading,
422
- onSubmit: t(D),
423
- onReset: t(N)
424
- }), ao({
442
+ "submit-loading": t(q).loading,
443
+ onSubmit: t(T),
444
+ onReset: t(E)
445
+ }), uo({
425
446
  default: ne(() => [
426
- (b(!0), A(no, null, lo(t(L), (a) => (b(), le(so(a.renderNode), {
447
+ (b(!0), V(co, null, mo(t(j), (a) => (b(), se(po(a.renderNode), {
427
448
  key: a.dataIndex
428
449
  }))), 128))
429
450
  ]),
430
451
  _: 2
431
452
  }, [
432
- W.searchFormExtra ? {
453
+ L.searchFormExtra ? {
433
454
  name: "extra",
434
455
  fn: ne(() => [
435
- se(e.$slots, "searchFormExtra")
456
+ ie(e.$slots, "searchFormExtra")
436
457
  ]),
437
458
  key: "0"
438
459
  } : void 0
439
460
  ]), 1040, ["submit-loading", "onSubmit", "onReset"])
440
- ], 6)) : ae("", !0),
441
- B("div", {
442
- class: m([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
443
- style: V(e.tableWrapperStyle)
461
+ ], 6)) : le("", !0),
462
+ F("div", {
463
+ class: f([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
464
+ style: W(e.tableWrapperStyle)
444
465
  }, [
445
- B("div", {
446
- class: m(t(u)("header-wrapper"))
466
+ F("div", {
467
+ class: f(t(u)("header-wrapper"))
447
468
  }, [
448
- se(e.$slots, "title", {
449
- selectedRows: t(E),
450
- selectedRowKeys: t(Pe),
451
- shownColumns: t(f),
452
- clearAll: P
469
+ ie(e.$slots, "title", {
470
+ selectedRows: t(K),
471
+ selectedRowKeys: t(ze),
472
+ shownColumns: t(g),
473
+ clearAll: z
453
474
  })
454
475
  ], 2),
455
- B("div", {
476
+ F("div", {
456
477
  ref_key: "gridWrapperRef",
457
478
  ref: ve,
458
- class: m(t(u)("grid-wrapper"))
479
+ class: f(t(u)("grid-wrapper"))
459
480
  }, [
460
- M(t(co), O(t(fo)(t(pe), t(H)), {
461
- "get-row-class": _e,
462
- style: je.value,
463
- "row-data": t(w).records,
464
- "column-defs": t(he),
465
- "default-col-def": t(Ce),
466
- "suppress-loading-overlay": "",
467
- "row-selection": Me.value,
468
- "selection-column-def": t(De),
469
- "get-row-id": qe,
470
- theme: t(me),
471
- "tooltip-show-delay": 500,
472
- "enable-browser-tooltips": e.browserTooltips,
473
- "tooltip-interaction": "",
474
- "row-class-rules": e.rowClassRules,
475
- "no-rows-overlay-component": Vo,
476
- "suppress-cell-focus": "",
477
- "dom-layout": e.autoHeight ? "autoHeight" : "normal",
478
- onSortChanged: be,
479
- onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
480
- onRowDataUpdated: Q,
481
- onRowSelected: Oe,
482
- onFirstDataRendered: Ge,
483
- onRowClicked: Qe,
484
- onBodyScrollEnd: Xe
485
- }), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
486
- io(B("div", {
487
- class: m(t(k)("table-loading-wrapper"))
481
+ O(t(wo), G(
482
+ t(ho)(t(fe), t(U), je.value),
483
+ {
484
+ "get-row-class": lo,
485
+ style: Xe.value,
486
+ "row-data": t(S).records,
487
+ "column-defs": t(Re),
488
+ "default-col-def": t(Ce),
489
+ "suppress-loading-overlay": "",
490
+ "row-selection": Ge.value,
491
+ "selection-column-def": t(Te),
492
+ "get-row-id": Ze,
493
+ "get-row-height": o.getRowHeight,
494
+ theme: t(pe),
495
+ "tooltip-show-delay": 500,
496
+ "enable-browser-tooltips": e.browserTooltips,
497
+ "tooltip-interaction": "",
498
+ "row-class-rules": e.rowClassRules,
499
+ "no-rows-overlay-component": Lo,
500
+ "suppress-cell-focus": "",
501
+ "dom-layout": e.autoHeight ? "autoHeight" : "normal",
502
+ onSortChanged: Fe,
503
+ onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
504
+ onRowDataUpdated: I,
505
+ onRowSelected: He,
506
+ onFirstDataRendered: Le,
507
+ onRowClicked: oo,
508
+ onBodyScrollEnd: to
509
+ }
510
+ ), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
511
+ fo(F("div", {
512
+ class: f(t(k)("table-loading-wrapper"))
488
513
  }, [
489
- M(t(go), { delay: 300 })
514
+ O(t(Co), { delay: 300 })
490
515
  ], 2), [
491
- [uo, Le.value]
516
+ [go, Je.value]
492
517
  ])
493
518
  ], 2),
494
- B("div", {
495
- class: m(t(u)("pagination-wrapper"))
519
+ F("div", {
520
+ class: f(t(u)("pagination-wrapper"))
496
521
  }, [
497
- e.pagination !== !1 ? (b(), le(t(wo), O({
522
+ e.pagination !== !1 ? (b(), se(t(Ro), G({
498
523
  key: 0,
499
524
  class: t(u)("pagination")
500
- }, t(j).pagination, { onChange: $e }), null, 16, ["class"])) : ae("", !0)
525
+ }, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
501
526
  ], 2)
502
527
  ], 6)
503
528
  ], 6));
504
529
  }
505
530
  });
506
531
  export {
507
- mt as default
532
+ Ct as default
508
533
  };