@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,4 +1,4 @@
1
- import { defineComponent as A, useSlots as K, ref as w, onMounted as P, unref as a, watch as G, createElementBlock as H, openBlock as M, Fragment as O, createVNode as d, mergeProps as y, withCtx as g, createSlots as W, renderList as U, renderSlot as $, normalizeProps as q, guardReactiveProps as J } from "vue";
1
+ import { defineComponent as A, useSlots as H, ref as w, onMounted as K, unref as a, watch as P, createElementBlock as G, openBlock as M, Fragment as O, createVNode as d, mergeProps as y, withCtx as g, createSlots as W, renderList as U, renderSlot as $, normalizeProps as q, guardReactiveProps as J } from "vue";
2
2
  import { ApForm as h } from "../../ap-form/index.mjs";
3
3
  import { cloneDeep as Q, isEqual as X, omit as C } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
@@ -41,7 +41,6 @@ const xe = /* @__PURE__ */ A({
41
41
  type: Boolean
42
42
  },
43
43
  components: {},
44
- customRow: {},
45
44
  customHeaderRow: {},
46
45
  direction: {},
47
46
  expandFixed: {
@@ -97,6 +96,7 @@ const xe = /* @__PURE__ */ A({
97
96
  rowHeight: {
98
97
  default: 66
99
98
  },
99
+ getRowHeight: {},
100
100
  advanceRenderer: {
101
101
  type: Boolean
102
102
  },
@@ -115,6 +115,7 @@ const xe = /* @__PURE__ */ A({
115
115
  type: Boolean
116
116
  },
117
117
  onUpdate: {},
118
+ customRow: {},
118
119
  columns: {},
119
120
  defaultValue: {},
120
121
  onChange: {},
@@ -124,22 +125,22 @@ const xe = /* @__PURE__ */ A({
124
125
  name: {},
125
126
  formItem: {}
126
127
  },
127
- setup(b, {
128
- expose: R
128
+ setup(R, {
129
+ expose: b
129
130
  }) {
130
- const B = K(), o = b, {
131
+ const B = H(), o = R, {
131
132
  b: x
132
133
  } = le("editable-aggrid"), r = w(), {
133
134
  internalInstance: s,
134
135
  model: v
135
136
  } = ee(), i = ae(o.name);
136
137
  let p;
137
- P(() => {
138
+ K(() => {
138
139
  const e = o.formItem?.initialValue ?? oe(a(v), o.name);
139
140
  p = Q(e), u(e, "suffix");
140
141
  });
141
142
  const n = w([]), S = te(o.name);
142
- G(() => S.value, (e) => {
143
+ P(() => S.value, (e) => {
143
144
  X(e, n.value) || c(e ?? p);
144
145
  }, {
145
146
  deep: !0
@@ -174,7 +175,7 @@ const xe = /* @__PURE__ */ A({
174
175
  const t = e === "end" ? n.value.length - 1 : e;
175
176
  r.value?.scrollToRow(t);
176
177
  }
177
- return R({
178
+ return b({
178
179
  add: F,
179
180
  addMultiple: u,
180
181
  remove: N,
@@ -185,7 +186,7 @@ const xe = /* @__PURE__ */ A({
185
186
  clear: j,
186
187
  setTableData: c,
187
188
  scrollTo: L
188
- }), (e, t) => (M(), H(O, null, [d(a(h).FormItem, {
189
+ }), (e, t) => (M(), G(O, null, [d(a(h).FormItem, {
189
190
  hidden: "",
190
191
  name: e.name
191
192
  }, null, 8, ["name"]), d(a(h).FormItem, y(a(C)(e.formItem, "initialValue"), {
@@ -1,4 +1,4 @@
1
- import { defineComponent as G, useSlots as H, ref as f, watch as O, unref as n, createBlock as U, openBlock as W, withCtx as d, createVNode as y, mergeProps as M, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
1
+ import { defineComponent as P, useSlots as G, ref as f, watch as O, unref as n, createBlock as U, openBlock as W, withCtx as d, createVNode as y, mergeProps as M, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
2
2
  import { ApForm as u } from "../../ap-form/index.mjs";
3
3
  import { isEqual as Y, isArray as w, omit as Z } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
@@ -11,7 +11,7 @@ import { useNamespace as ae } from "../../config-provider/hooks/use-namespace.mj
11
11
  import { useControllableValue as te } from "../../hooks/useControllableValue.mjs";
12
12
  import { useGlobalConfig as ne } from "../../config-provider/hooks/use-global-config.mjs";
13
13
  import le from "../index.vue.mjs";
14
- const be = /* @__PURE__ */ G({
14
+ const Re = /* @__PURE__ */ P({
15
15
  name: "EditableGrid",
16
16
  __name: "index",
17
17
  props: {
@@ -39,7 +39,6 @@ const be = /* @__PURE__ */ G({
39
39
  type: Boolean
40
40
  },
41
41
  components: {},
42
- customRow: {},
43
42
  customHeaderRow: {},
44
43
  direction: {},
45
44
  expandFixed: {
@@ -95,6 +94,7 @@ const be = /* @__PURE__ */ G({
95
94
  rowHeight: {
96
95
  default: 66
97
96
  },
97
+ getRowHeight: {},
98
98
  advanceRenderer: {
99
99
  type: Boolean
100
100
  },
@@ -113,6 +113,7 @@ const be = /* @__PURE__ */ G({
113
113
  type: Boolean
114
114
  },
115
115
  onUpdate: {},
116
+ customRow: {},
116
117
  columns: {},
117
118
  value: {},
118
119
  defaultValue: {},
@@ -127,14 +128,14 @@ const be = /* @__PURE__ */ G({
127
128
  emits: ["update:value"],
128
129
  setup(g, {
129
130
  expose: h,
130
- emit: b
131
+ emit: R
131
132
  }) {
132
- const v = H(), o = g, {
133
- b: C
134
- } = ae("editable-aggrid"), R = b, s = f(), {
133
+ const b = G(), o = g, {
134
+ b: v
135
+ } = ae("editable-aggrid"), C = R, s = f(), {
135
136
  value: r,
136
137
  updateValue: m
137
- } = te(o, R), l = f(), x = u.useWatch(o.name, l);
138
+ } = te(o, C), l = f(), x = u.useWatch(o.name, l);
138
139
  O(r, (e) => {
139
140
  const a = p(e, o.rowKey);
140
141
  Y(a, n(x)) || l.value?.setFieldValue(o.name, a);
@@ -171,12 +172,12 @@ const be = /* @__PURE__ */ G({
171
172
  async function z(e, a) {
172
173
  return (await l.value?.validateFields(j(e), a))?.[o.name];
173
174
  }
174
- function I(e) {
175
+ function H(e) {
175
176
  m(e);
176
177
  const a = p(e, o.rowKey);
177
178
  l.value?.setFieldValue(o.name, a);
178
179
  }
179
- function L(e) {
180
+ function I(e) {
180
181
  const a = e === "end" ? r.value.length - 1 : e;
181
182
  s.value?.scrollToRow(a);
182
183
  }
@@ -191,8 +192,8 @@ const be = /* @__PURE__ */ G({
191
192
  getRowsData: A,
192
193
  setRowData: V,
193
194
  clear: k,
194
- setTableData: I,
195
- scrollTo: L
195
+ setTableData: H,
196
+ scrollTo: I
196
197
  }), (e, a) => (W(), U(n(u), {
197
198
  ref_key: "formRef",
198
199
  ref: l,
@@ -210,7 +211,7 @@ const be = /* @__PURE__ */ G({
210
211
  default: d(() => [y(le, M(n(Z)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
211
212
  ref_key: "tableRef",
212
213
  ref: s,
213
- class: n(C)(),
214
+ class: n(v)(),
214
215
  size: "mini",
215
216
  columns: n(S),
216
217
  "data-source": n(r),
@@ -218,9 +219,9 @@ const be = /* @__PURE__ */ G({
218
219
  onUpdate: D
219
220
  }), $({
220
221
  _: 2
221
- }, [q(v, (t, c) => ({
222
+ }, [q(b, (t, c) => ({
222
223
  name: c,
223
- fn: d((P) => [J(e.$slots, c, Q(X(P || {})))])
224
+ fn: d((L) => [J(e.$slots, c, Q(X(L || {})))])
224
225
  }))]), 1040, ["class", "columns", "data-source"])]),
225
226
  _: 3
226
227
  }, 8, ["name"])]),
@@ -229,5 +230,5 @@ const be = /* @__PURE__ */ G({
229
230
  }
230
231
  });
231
232
  export {
232
- be as default
233
+ Re as default
233
234
  };
@@ -1,100 +1,100 @@
1
- import { getTableRenderProps as m, objectToString as P } from "../../ap-table/utils.mjs";
2
- import { rendererMap as c } from "../renderer/index.mjs";
3
- import { isNumber as f, isFunction as y } from "lodash-unified";
4
- import { ref as R, unref as C, computed as T } from "vue";
1
+ import { getTableRenderProps as h, objectToString as P } from "../../ap-table/utils.mjs";
2
+ import { rendererMap as y } from "../renderer/index.mjs";
3
+ import { isNumber as f, isFunction as m } from "lodash-unified";
4
+ import { ref as R, unref as x, computed 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 "../components/tooltip/index.vue.mjs";
8
8
  import "../../config-provider/index.mjs";
9
- import { dataIndexToField as I } from "../../ap-grid/utils/col.mjs";
10
- import { isDef as S } from "../../utils/index.mjs";
9
+ import { dataIndexToField as S } from "../../ap-grid/utils/col.mjs";
10
+ import { isDef as I } from "../../utils/index.mjs";
11
11
  import { useGlobalConfig as _ } from "../../config-provider/hooks/use-global-config.mjs";
12
12
  import { useNamespace as G } from "../../config-provider/hooks/use-namespace.mjs";
13
13
  import W from "../components/body-cell/index.vue2.mjs";
14
14
  import z from "../components/tooltip/index.vue2.mjs";
15
15
  import v from "../components/header-cell/index.vue2.mjs";
16
- function F(r) {
17
- return f(r) && r > 1;
16
+ function F(t) {
17
+ return f(t) && t > 1;
18
18
  }
19
- function M(r, l) {
20
- if (l.bodyCellTooltip)
21
- return y(l.bodyCellTooltip) ? l.bodyCellTooltip(r.value, r.data) : l.bodyCellTooltip;
22
- if (l.renderText)
23
- return l.renderText({
24
- value: r.value,
25
- record: r.data,
26
- column: l,
27
- text: r.value
19
+ function M(t, a) {
20
+ if (a.bodyCellTooltip)
21
+ return m(a.bodyCellTooltip) ? a.bodyCellTooltip(t.value, t.data) : a.bodyCellTooltip;
22
+ if (a.renderText)
23
+ return a.renderText({
24
+ value: t.value,
25
+ record: t.data,
26
+ column: a,
27
+ text: t.value
28
28
  });
29
- const n = l.valueType || "text", d = c[n];
29
+ const n = a.valueType || "text", d = y[n];
30
30
  if (d) {
31
- const p = m(
32
- { ...l, valueType: n },
31
+ const p = h(
32
+ { ...a, valueType: n },
33
33
  {
34
- value: r.value,
35
- text: r.value,
36
- record: r.data,
37
- column: r.column,
38
- rowIndex: r.node?.rowIndex,
39
- pinned: r.node?.rowPinned
34
+ value: t.value,
35
+ text: t.value,
36
+ record: t.data,
37
+ column: t.column,
38
+ rowIndex: t.node?.rowIndex,
39
+ pinned: t.node?.rowPinned
40
40
  }
41
41
  );
42
42
  return d(p);
43
43
  }
44
- return P(r.value);
44
+ return P(t.value);
45
45
  }
46
- const X = (r, l, n) => {
47
- const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), h = (t) => {
48
- const i = {
46
+ const X = (t, a, n) => {
47
+ const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), c = (r) => {
48
+ const o = {
49
49
  cellRenderer: W,
50
50
  cellRendererParams: {
51
- column: t,
52
- extraValueType: C(d)
51
+ column: r,
52
+ extraValueType: x(d)
53
53
  }
54
54
  };
55
- if (t.customRender)
56
- return i;
57
- if (t.renderText)
55
+ if (r.customRender)
56
+ return o;
57
+ if (r.renderText)
58
58
  return {
59
- valueFormatter: (o) => t.renderText({
60
- value: o.value,
61
- record: o.data,
62
- column: t,
63
- text: o.value
59
+ valueFormatter: (i) => r.renderText({
60
+ value: i.value,
61
+ record: i.data,
62
+ column: r,
63
+ text: i.value
64
64
  })
65
65
  };
66
- const a = t.valueType || "text", e = c[a];
66
+ const l = r.valueType || "text", e = y[l];
67
67
  return e ? {
68
- valueFormatter: (o) => {
69
- const s = m(
70
- { ...t, valueType: a },
68
+ valueFormatter: (i) => {
69
+ const s = h(
70
+ { ...r, valueType: l },
71
71
  {
72
- value: o.value,
73
- text: o.value,
74
- record: o.data,
75
- column: o.column,
76
- rowIndex: o.node?.rowIndex,
77
- pinned: o.node?.rowPinned
72
+ value: i.value,
73
+ text: i.value,
74
+ record: i.data,
75
+ column: i.column,
76
+ rowIndex: i.node?.rowIndex,
77
+ pinned: i.node?.rowPinned
78
78
  }
79
79
  );
80
80
  return e(s);
81
81
  }
82
- } : i;
83
- }, b = (t) => {
84
- const i = {}, a = t.bodyCellTooltip || !t.customRender && (t.ellipsis === !0 || t.ellipsis === "tooltip" || f(t.ellipsis)), e = f(t.ellipsis) && t.ellipsis > 1, o = f(t.ellipsis) ? t.ellipsis : 1;
85
- return i.tooltipValueGetter = a ? (s) => M(s, t) : void 0, i.wrapText = !t.ellipsis || e, i.cellStyle = {
86
- "--ag-grid-line-clamp": o
87
- }, i.tooltipComponent = z, i.tooltipComponentParams = {
88
- lineClamp: o,
82
+ } : o;
83
+ }, b = (r) => {
84
+ const o = {}, l = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, i = f(r.ellipsis) ? r.ellipsis : 1;
85
+ return o.tooltipValueGetter = l ? (s) => M(s, r) : void 0, o.wrapText = !r.ellipsis || e, o.cellStyle = {
86
+ "--ag-grid-line-clamp": i
87
+ }, o.tooltipComponent = z, o.tooltipComponentParams = {
88
+ lineClamp: i,
89
89
  gridWrapperRef: u
90
- }, i;
90
+ }, o;
91
91
  }, g = T(() => {
92
- const t = C(r);
93
- function i(a) {
94
- return a.map((e) => {
95
- const o = {
96
- field: I(e.dataIndex),
97
- colId: S(e.key) ? String(e.key) : void 0,
92
+ const r = x(t);
93
+ function o(l) {
94
+ return l.map((e) => {
95
+ const i = {
96
+ field: S(e.dataIndex),
97
+ colId: I(e.key) ? String(e.key) : void 0,
98
98
  sortable: !!e.sorter,
99
99
  comparator: e.sorter === !0 ? () => 0 : e.sorter,
100
100
  headerComponentParams: {
@@ -110,33 +110,35 @@ const X = (r, l, n) => {
110
110
  // undefined to null
111
111
  colSpan: e.colSpan,
112
112
  cellClass: n((s) => {
113
- const x = e.cellClass || "", D = y(x) ? x(s.data, s.node) : x;
113
+ const C = e.cellClass || "", D = m(C) ? C(s.data, s.node) : C;
114
114
  return [
115
115
  `${p("cell", e.align || "left")}`,
116
116
  F(e.ellipsis) ? p("cell", "multiline") : null,
117
117
  D
118
118
  ].flat().filter(Boolean);
119
119
  }),
120
+ headerStyle: e.headerStyle,
121
+ headerClass: e.headerClass,
120
122
  autoHeight: !0,
121
123
  // 设置自动计算高度以自适应多行换行的场景
122
124
  ...b(e),
123
- ...h(e)
125
+ ...c(e)
124
126
  };
125
127
  return e.children?.length ? {
126
- ...o,
128
+ ...i,
127
129
  headerGroupComponent: v,
128
130
  headerGroupComponentParams: {
129
131
  column: e
130
132
  },
131
- children: i(e.children)
132
- } : o;
133
+ children: o(e.children)
134
+ } : i;
133
135
  });
134
136
  }
135
- return i(t);
137
+ return o(r);
136
138
  }), w = T(
137
139
  () => ({
138
140
  headerComponent: v,
139
- resizable: l.columnResizable,
141
+ resizable: a.columnResizable,
140
142
  suppressMovable: !0,
141
143
  cellDataType: !1
142
144
  })
@@ -74,5 +74,5 @@ type RowSelectionParams<T> = AgGridRowSelection<T> & {
74
74
  */
75
75
  rowKey: ApTableProps['rowKey'];
76
76
  };
77
- declare const useGridRowSelection: <RecordType = Recordable>(props: RowSelectionParams<RecordType>) => RowSelectionReturnType<RecordType>;
77
+ declare const useGridRowSelection: <RecordType extends Recordable = Recordable>(props: RowSelectionParams<RecordType>) => RowSelectionReturnType<RecordType>;
78
78
  export default useGridRowSelection;
@@ -1,98 +1,111 @@
1
- import { ref as A, computed as i, unref as o } from "vue";
2
- import { isFunction as r } from "lodash-unified";
3
- function D(c, n) {
4
- return !n?.length || r(c) ? [] : n.map((u) => ({ [c]: u }));
1
+ import { ref as E, computed as M, unref as o } from "vue";
2
+ import { isFunction as d } from "lodash-unified";
3
+ function I(n) {
4
+ const { rowKey: a, defaultSelectedRowKeys: c, defaultSelectedRows: u } = n;
5
+ return a ? c?.length ? d(a) ? [] : i(c, n.type).map(
6
+ (l) => ({ [a]: l })
7
+ ) : u?.length ? i(u, n.type).filter(
8
+ (l) => {
9
+ const s = d(a) ? a(l) : a;
10
+ return s && (l[s] === 0 || l[s]);
11
+ }
12
+ ) : [] : [];
13
+ }
14
+ function i(n, a) {
15
+ return n.length && a === "radio" ? [n[0]] : n;
5
16
  }
6
- const m = (c) => {
7
- const n = A(
8
- D(c.rowKey, c.defaultSelectedRowKeys)
9
- ), u = (e) => r(c.rowKey) ? c.rowKey(e) : e[c.rowKey], a = i(() => {
17
+ const F = (n) => {
18
+ const a = n.type === "radio", c = E(I(n)), u = (e) => d(n.rowKey) ? n.rowKey(e) : e[n.rowKey], l = M(() => {
10
19
  const e = /* @__PURE__ */ new Map();
11
- return o(n).forEach((t) => {
20
+ return o(c).forEach((t) => {
12
21
  e.set(u(t), t);
13
22
  }), e;
14
23
  });
15
- function S(e) {
16
- return o(a).has(u(e));
24
+ function s(e) {
25
+ return o(l).has(u(e));
17
26
  }
18
- function v(e) {
19
- if (!s(e))
27
+ function S(e) {
28
+ if (!f(e))
20
29
  return;
21
- const t = o(a);
22
- t.set(u(e), e), n.value = [...t.values()];
30
+ const t = o(l);
31
+ a && t.clear(), t.set(u(e), e), c.value = [...t.values()];
23
32
  }
24
- function w(e) {
25
- const t = o(a);
26
- for (const l of e)
27
- s(l) && t.set(u(l), l);
28
- n.value = [...t.values()];
33
+ function g(e) {
34
+ const t = o(l);
35
+ a && t.clear();
36
+ for (const r of i(e, n.type))
37
+ f(r) && t.set(u(r), r);
38
+ c.value = [...t.values()];
29
39
  }
30
- function M(e) {
31
- if (r(c.rowKey))
40
+ function K(e) {
41
+ if (d(n.rowKey))
32
42
  return;
33
- const t = o(a);
34
- for (const l of e) {
35
- const f = o(c.dataSource).find(
36
- (b) => u(b) === l
37
- ), d = { [c.rowKey]: l };
38
- s(f || d) && t.set(l, f || d);
43
+ const t = o(l);
44
+ a && t.clear();
45
+ for (const r of i(e, n.type)) {
46
+ const v = o(n.dataSource).find(
47
+ (D) => u(D) === r
48
+ ), w = { [n.rowKey]: r };
49
+ f(v || w) && t.set(r, v || w);
39
50
  }
40
- n.value = [...t.values()];
51
+ c.value = [...t.values()];
41
52
  }
42
53
  function y(e) {
43
- if (!s(e))
54
+ if (!f(e))
44
55
  return;
45
- const t = o(a);
46
- t.delete(u(e)), n.value = [...t.values()];
56
+ const t = o(l);
57
+ t.delete(u(e)), c.value = [...t.values()];
47
58
  }
48
- function x(e) {
49
- const t = o(a);
50
- for (const l of e)
51
- s(l) && t.delete(u(l));
52
- n.value = [...t.values()];
59
+ function R(e) {
60
+ const t = o(l);
61
+ for (const r of i(e, n.type))
62
+ f(r) && t.delete(u(r));
63
+ c.value = [...t.values()];
53
64
  }
54
- function s(e) {
55
- const t = c.disabled;
65
+ function f(e) {
66
+ const t = n.disabled;
56
67
  return !(t ? t(e) : !1);
57
68
  }
58
- function K() {
59
- const e = o(a);
60
- o(c.dataSource).forEach((t) => {
61
- s(t) && e.set(u(t), t);
62
- }), n.value = [...e.values()];
69
+ function x() {
70
+ if (a)
71
+ return;
72
+ const e = o(l);
73
+ o(n.dataSource).forEach((t) => {
74
+ f(t) && e.set(u(t), t);
75
+ }), c.value = [...e.values()];
63
76
  }
64
- function g(e) {
65
- if (!s(e))
77
+ function h(e) {
78
+ if (!f(e))
66
79
  return;
67
- const t = o(a), l = u(e);
68
- t.has(l) ? t.delete(l) : t.set(l, e), n.value = [...t.values()];
80
+ const t = o(l), r = u(e);
81
+ t.has(r) ? y(e) : S(e);
69
82
  }
70
- function R() {
71
- const e = o(a);
72
- o(c.dataSource).forEach((t) => {
73
- s(t) && e.delete(u(t));
74
- }), n.value = [...e.values()];
83
+ function b() {
84
+ const e = o(l);
85
+ o(n.dataSource).forEach((t) => {
86
+ f(t) && e.delete(u(t));
87
+ }), c.value = [...e.values()];
75
88
  }
76
- function h() {
77
- n.value = [];
89
+ function A() {
90
+ c.value = [];
78
91
  }
79
92
  return {
80
- select: v,
93
+ select: S,
81
94
  unSelect: y,
82
- isSelected: S,
83
- selectAll: K,
84
- unSelectAll: R,
85
- clearAll: h,
86
- toggleSelect: g,
87
- selectedRows: n,
88
- selectedRowKeys: i(
89
- () => o(n).map((e) => u(e))
95
+ isSelected: s,
96
+ selectAll: x,
97
+ unSelectAll: b,
98
+ clearAll: A,
99
+ toggleSelect: h,
100
+ selectedRows: c,
101
+ selectedRowKeys: M(
102
+ () => o(c).map((e) => u(e))
90
103
  ),
91
- selectMulti: w,
92
- unSelectMulti: x,
93
- selectMultiByKeys: M
104
+ selectMulti: g,
105
+ unSelectMulti: R,
106
+ selectMultiByKeys: K
94
107
  };
95
108
  };
96
109
  export {
97
- m as default
110
+ F as default
98
111
  };
@@ -1,6 +1,7 @@
1
1
  import { AgGridExpose, AgGridProps, AgGridSlots } from './interface';
2
+ import { Recordable } from '../type';
2
3
  import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
3
- declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ declare const _default: <RecordType extends Recordable>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & AgGridProps<RecordType> & Partial<{}>> & PublicProps;
5
6
  expose(exposed: ShallowUnwrapRef<AgGridExpose>): void;
6
7
  attrs: any;