@aplus-frontend/ui 7.0.0-beta.1 → 7.0.0-beta.3

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 (143) hide show
  1. package/es/index.mjs +216 -218
  2. package/es/src/ag-grid/editable/form-item.vue.mjs +68 -63
  3. package/es/src/ag-grid/editable/index.vue.mjs +66 -61
  4. package/es/src/ag-grid/editable/interface.d.ts +3 -1
  5. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +65 -63
  6. package/es/src/ag-grid/style/index.d.ts +28 -1
  7. package/es/src/ag-grid/style/index.mjs +56 -43
  8. package/es/src/ag-grid/theme.mjs +12 -11
  9. package/es/src/ap-action/item/index.vue2.mjs +14 -12
  10. package/es/src/ap-action/style/dropdown-item.mjs +4 -4
  11. package/es/src/ap-action/style/index.d.ts +5 -2
  12. package/es/src/ap-action/style/index.mjs +29 -23
  13. package/es/src/ap-button/ap-button.vue.mjs +45 -49
  14. package/es/src/ap-button/style/index.mjs +5 -4
  15. package/es/src/ap-download/hooks/useStyle.mjs +9 -9
  16. package/es/src/ap-form/style/item.d.ts +1 -2
  17. package/es/src/ap-form/style/item.mjs +12 -16
  18. package/es/src/ap-form/style/modal-form.d.ts +2 -1
  19. package/es/src/ap-form/style/modal-form.mjs +26 -13
  20. package/es/src/ap-form/style/search-form-sorter.d.ts +2 -1
  21. package/es/src/ap-form/style/search-form-sorter.mjs +20 -13
  22. package/es/src/ap-form/style/token.d.ts +25 -1
  23. package/es/src/ap-grid/hooks/use-table-style.mjs +1 -1
  24. package/es/src/ap-grid/index.vue.mjs +2 -2
  25. package/es/src/ap-grid/style/index.d.ts +4 -1
  26. package/es/src/ap-grid/style/index.mjs +10 -7
  27. package/es/src/ap-table/ap-table.vue2.mjs +2 -2
  28. package/es/src/ap-table/utils.mjs +14 -11
  29. package/es/src/ap-tag/ap-tag.vue.mjs +7 -6
  30. package/es/src/business/ap-appendix/style/index.d.ts +3 -2
  31. package/es/src/business/ap-appendix/style/index.mjs +19 -16
  32. package/es/src/business/ap-appendix/style/token.d.ts +4 -0
  33. package/es/src/business/ap-appendix/style/token.mjs +6 -0
  34. package/es/src/business/ap-attachment/ApAttachment.mjs +73 -73
  35. package/es/src/business/ap-attachment/style/index.mjs +1 -0
  36. package/es/src/business/ap-batch-action/style/index.mjs +3 -3
  37. package/es/src/business/ap-radio-group/style/index.mjs +3 -3
  38. package/es/src/business/ap-view/style/index.mjs +18 -21
  39. package/es/src/business/batch-input-group/style/index.d.ts +3 -0
  40. package/es/src/business/batch-input-group/style/index.mjs +9 -5
  41. package/es/src/check-card/style/index.mjs +37 -31
  42. package/es/src/config-provider/config-provider.d.ts +1 -2
  43. package/es/src/config-provider/hooks/use-global-config.d.ts +1 -2
  44. package/es/src/config-provider/hooks/use-global-config.mjs +42 -33
  45. package/es/src/config-provider/hooks/use-token.d.ts +7 -2
  46. package/es/src/config-provider/hooks/use-token.mjs +6 -3
  47. package/es/src/config-provider/index.d.ts +1 -2
  48. package/es/src/design-token/constants.d.ts +1 -6
  49. package/es/src/design-token/constants.mjs +2 -100
  50. package/es/src/design-token/index.d.ts +1 -1
  51. package/es/src/design-token/index.mjs +5 -6
  52. package/es/src/design-token/interface.d.ts +9 -1
  53. package/es/src/design-token/interface.mjs +1 -0
  54. package/es/src/full-screen/index.vue.mjs +31 -30
  55. package/es/src/index.mjs +196 -198
  56. package/es/src/mask/style/index.mjs +2 -2
  57. package/es/src/scroll-bar/style/index.mjs +17 -17
  58. package/es/src/splitter/style/index.d.ts +9 -1
  59. package/es/src/splitter/style/index.mjs +1 -2
  60. package/es/src/text/style/index.d.ts +4 -1
  61. package/es/src/text/style/index.mjs +22 -18
  62. package/es/src/utils/cssinjs/index.d.ts +1 -5
  63. package/es/src/utils/cssinjs/index.mjs +49 -39
  64. package/es/src/utils/cssinjs/instance.mjs +7 -7
  65. package/es/src/utils/cssinjs/plugin-append-cssvar.d.ts +6 -0
  66. package/es/src/utils/cssinjs/plugin-append-cssvar.mjs +6 -0
  67. package/es/src/utils/cssinjs/utils.d.ts +6 -0
  68. package/es/src/utils/cssinjs/utils.mjs +15 -0
  69. package/es/src/version.d.ts +1 -1
  70. package/es/src/version.mjs +1 -1
  71. package/lib/index.js +1 -1
  72. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  73. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  74. package/lib/src/ag-grid/editable/interface.d.ts +3 -1
  75. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
  76. package/lib/src/ag-grid/style/index.d.ts +28 -1
  77. package/lib/src/ag-grid/style/index.js +1 -1
  78. package/lib/src/ag-grid/theme.js +1 -1
  79. package/lib/src/ap-action/item/index.vue2.js +1 -1
  80. package/lib/src/ap-action/style/dropdown-item.js +1 -1
  81. package/lib/src/ap-action/style/index.d.ts +5 -2
  82. package/lib/src/ap-action/style/index.js +1 -1
  83. package/lib/src/ap-button/ap-button.vue.js +1 -1
  84. package/lib/src/ap-button/style/index.js +1 -1
  85. package/lib/src/ap-download/hooks/useStyle.js +1 -1
  86. package/lib/src/ap-form/style/item.d.ts +1 -2
  87. package/lib/src/ap-form/style/item.js +1 -1
  88. package/lib/src/ap-form/style/modal-form.d.ts +2 -1
  89. package/lib/src/ap-form/style/modal-form.js +1 -1
  90. package/lib/src/ap-form/style/search-form-sorter.d.ts +2 -1
  91. package/lib/src/ap-form/style/search-form-sorter.js +1 -1
  92. package/lib/src/ap-form/style/token.d.ts +25 -1
  93. package/lib/src/ap-grid/hooks/use-table-style.js +1 -1
  94. package/lib/src/ap-grid/index.vue.js +1 -1
  95. package/lib/src/ap-grid/style/index.d.ts +4 -1
  96. package/lib/src/ap-grid/style/index.js +1 -1
  97. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  98. package/lib/src/ap-table/utils.js +1 -1
  99. package/lib/src/ap-tag/ap-tag.vue.js +1 -1
  100. package/lib/src/business/ap-appendix/style/index.d.ts +3 -2
  101. package/lib/src/business/ap-appendix/style/index.js +1 -1
  102. package/lib/src/business/ap-appendix/style/token.d.ts +4 -0
  103. package/lib/src/business/ap-appendix/style/token.js +1 -0
  104. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  105. package/lib/src/business/ap-attachment/style/index.js +1 -1
  106. package/lib/src/business/ap-batch-action/style/index.js +1 -1
  107. package/lib/src/business/ap-radio-group/style/index.js +1 -1
  108. package/lib/src/business/ap-view/style/index.js +1 -1
  109. package/lib/src/business/batch-input-group/style/index.d.ts +3 -0
  110. package/lib/src/business/batch-input-group/style/index.js +1 -1
  111. package/lib/src/check-card/style/index.js +1 -1
  112. package/lib/src/config-provider/config-provider.d.ts +1 -2
  113. package/lib/src/config-provider/hooks/use-global-config.d.ts +1 -2
  114. package/lib/src/config-provider/hooks/use-global-config.js +1 -1
  115. package/lib/src/config-provider/hooks/use-token.d.ts +7 -2
  116. package/lib/src/config-provider/hooks/use-token.js +1 -1
  117. package/lib/src/config-provider/index.d.ts +1 -2
  118. package/lib/src/design-token/constants.d.ts +1 -6
  119. package/lib/src/design-token/constants.js +1 -1
  120. package/lib/src/design-token/index.d.ts +1 -1
  121. package/lib/src/design-token/index.js +1 -1
  122. package/lib/src/design-token/interface.d.ts +9 -1
  123. package/lib/src/design-token/interface.js +1 -0
  124. package/lib/src/full-screen/index.vue.js +1 -1
  125. package/lib/src/index.js +1 -1
  126. package/lib/src/mask/style/index.js +2 -2
  127. package/lib/src/scroll-bar/style/index.js +1 -1
  128. package/lib/src/splitter/style/index.d.ts +9 -1
  129. package/lib/src/splitter/style/index.js +1 -1
  130. package/lib/src/text/style/index.d.ts +4 -1
  131. package/lib/src/text/style/index.js +1 -1
  132. package/lib/src/utils/cssinjs/index.d.ts +1 -5
  133. package/lib/src/utils/cssinjs/index.js +1 -1
  134. package/lib/src/utils/cssinjs/instance.js +1 -1
  135. package/lib/src/utils/cssinjs/plugin-append-cssvar.d.ts +6 -0
  136. package/lib/src/utils/cssinjs/plugin-append-cssvar.js +1 -0
  137. package/lib/src/utils/cssinjs/utils.d.ts +6 -0
  138. package/lib/src/utils/cssinjs/utils.js +1 -0
  139. package/lib/src/version.d.ts +1 -1
  140. package/lib/src/version.js +1 -1
  141. package/package.json +1 -1
  142. package/es/src/utils/cssinjs/plugin-specificity.mjs +0 -13
  143. package/lib/src/utils/cssinjs/plugin-specificity.js +0 -1
@@ -1,20 +1,20 @@
1
- import { defineComponent as H, useSlots as K, ref as w, onMounted as P, unref as a, watch as G, createElementBlock as M, openBlock as O, Fragment as W, createVNode as d, mergeProps as y, withCtx as g, createSlots as U, renderList as $, renderSlot as q, normalizeProps as J, guardReactiveProps as Q } from "vue";
2
- import { ApForm as h } from "../../ap-form/index.mjs";
3
- import { cloneDeep as X, isEqual as Y, omit as b } from "lodash-unified";
1
+ import { defineComponent as K, useSlots as P, ref as y, onMounted as G, unref as t, watch as M, createElementBlock as O, openBlock as W, Fragment as U, createVNode as d, mergeProps as g, withCtx as h, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
2
+ import { ApForm as C } from "../../ap-form/index.mjs";
3
+ import { cloneDeep as Y, isEqual as Z, omit as R } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
- import { useGetEditableColumns as Z } from "../hooks/use-editable-columns.mjs";
5
+ import { useGetEditableColumns as ee } from "../hooks/use-editable-columns.mjs";
6
6
  import "../index.vue2.mjs";
7
- import { useEditableFormItemApi as ee } from "../hooks/use-editable-form-item-api.mjs";
8
- import { useInjectForm as oe } from "../../ap-form/context.mjs";
9
- import { getModelValue as ae } from "../../ap-form/utils/get.mjs";
10
- import { getShadowName as te } from "../utils.mjs";
11
- import { useWatch as ne } from "../../ap-form/hooks/use-watch.mjs";
12
- import { arrayToObject as le } from "./utils.mjs";
13
- import re from "../style/editable.mjs";
14
- import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
15
- import { useGlobalConfig as ie } from "../../config-provider/hooks/use-global-config.mjs";
16
- import me from "../index.vue.mjs";
17
- const Ie = /* @__PURE__ */ H({
7
+ import { useEditableFormItemApi as oe } from "../hooks/use-editable-form-item-api.mjs";
8
+ import { useInjectForm as ae } from "../../ap-form/context.mjs";
9
+ import { getModelValue as te } from "../../ap-form/utils/get.mjs";
10
+ import { getShadowName as ne } from "../utils.mjs";
11
+ import { useWatch as le } from "../../ap-form/hooks/use-watch.mjs";
12
+ import { arrayToObject as re } from "./utils.mjs";
13
+ import se from "../style/editable.mjs";
14
+ import { useNamespace as ie } from "../../config-provider/hooks/use-namespace.mjs";
15
+ import { useGlobalConfig as me } from "../../config-provider/hooks/use-global-config.mjs";
16
+ import de from "../index.vue.mjs";
17
+ const Ee = /* @__PURE__ */ K({
18
18
  name: "EditableGrid",
19
19
  __name: "form-item",
20
20
  props: {
@@ -127,92 +127,97 @@ const Ie = /* @__PURE__ */ H({
127
127
  name: {},
128
128
  formItem: {}
129
129
  },
130
- setup(C, {
131
- expose: R
130
+ setup(b, {
131
+ expose: B
132
132
  }) {
133
- const B = K(), o = C, {
134
- b: x
135
- } = se("editable-aggrid"), v = re("editable-aggrid"), r = w(), {
133
+ const x = P(), o = b, {
134
+ b: v
135
+ } = ie("editable-aggrid"), S = se("editable-aggrid"), r = y(), {
136
136
  internalInstance: s,
137
- model: S
138
- } = oe(), i = te(o.name);
137
+ model: I
138
+ } = ae(), i = ne(o.name);
139
139
  let p;
140
- P(() => {
141
- const e = o.formItem?.initialValue ?? ae(a(S), o.name);
142
- p = X(e), u(e, "suffix");
140
+ G(() => {
141
+ const e = o.formItem?.initialValue ?? te(t(I), o.name);
142
+ p = Y(e), u(e, "suffix");
143
143
  });
144
- const n = w([]), I = ne(o.name);
145
- G(() => I.value, (e) => {
146
- Y(e, n.value) || c(e ?? p);
144
+ const l = y([]), E = le(o.name);
145
+ M(() => E.value, (e) => {
146
+ Z(e, l.value) || c(e ?? p);
147
147
  }, {
148
148
  deep: !0
149
149
  });
150
- const E = ie("valueTypeMap"), F = Z(o, E, i), {
150
+ const F = me("valueTypeMap"), T = ee(o, F, i), {
151
151
  add: N,
152
152
  addMultiple: u,
153
153
  remove: _,
154
- removeByKey: T,
155
- getRowData: V,
156
- getRowsData: D,
157
- setRowData: j,
158
- clear: k,
154
+ removeByKey: V,
155
+ getRowData: D,
156
+ getRowsData: j,
157
+ setRowData: k,
158
+ clear: L,
159
159
  refreshRowIds: m
160
- } = ee(o, s, n, i);
161
- function L() {
160
+ } = oe(o, s, l, i);
161
+ function z() {
162
162
  const e = r.value?._internalGridApi;
163
163
  if (!m.value?.length || !e)
164
164
  return;
165
- const t = m.value.map((l) => e.getRowNode(l)).filter((l) => !!l);
165
+ const a = m.value.map((n) => e.getRowNode(n)).filter((n) => !!n);
166
166
  e.refreshCells({
167
- rowNodes: t,
167
+ rowNodes: a,
168
168
  force: !0
169
169
  }), m.value = [];
170
170
  }
171
171
  function c(e) {
172
- n.value = e;
173
- const t = le(e, o.rowKey);
174
- s?.setFieldValue(o.name, e), s?.setFieldValue(i, t);
172
+ l.value = e;
173
+ const a = re(e, o.rowKey);
174
+ s?.setFieldValue(o.name, e), s?.setFieldValue(i, a);
175
175
  }
176
- function z(e) {
177
- const t = e === "end" ? n.value.length - 1 : e;
178
- r.value?.scrollToRow(t);
176
+ function f(e, a) {
177
+ const n = e === "end" ? l.value.length - 1 : e;
178
+ r.value?.scrollToRow(n, a);
179
179
  }
180
- return R({
180
+ function A(e, a) {
181
+ r.value?.scrollToColumn(e, a);
182
+ }
183
+ return B({
181
184
  add: N,
182
185
  addMultiple: u,
183
186
  remove: _,
184
- removeByKey: T,
185
- getRowData: V,
186
- getRowsData: D,
187
- setRowData: j,
188
- clear: k,
187
+ removeByKey: V,
188
+ getRowData: D,
189
+ getRowsData: j,
190
+ setRowData: k,
191
+ clear: L,
189
192
  setTableData: c,
190
- scrollTo: z
191
- }), (e, t) => (O(), M(W, null, [d(a(h).FormItem, {
193
+ scrollTo: f,
194
+ scrollToRow: f,
195
+ scrollToColumn: A
196
+ }), (e, a) => (W(), O(U, null, [d(t(C).FormItem, {
192
197
  hidden: "",
193
198
  name: e.name
194
- }, null, 8, ["name"]), d(a(h).FormItem, y(a(b)(e.formItem, "initialValue"), {
199
+ }, null, 8, ["name"]), d(t(C).FormItem, g(t(R)(e.formItem, "initialValue"), {
195
200
  label: e.label
196
201
  }), {
197
- default: g(() => [d(me, y(a(b)(o, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
202
+ default: h(() => [d(de, g(t(R)(o, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
198
203
  ref_key: "tableRef",
199
204
  ref: r,
200
- class: [a(x)(), a(v)],
205
+ class: [t(v)(), t(S)],
201
206
  size: "mini",
202
- columns: a(F),
203
- "data-source": n.value,
207
+ columns: t(T),
208
+ "data-source": l.value,
204
209
  "search-form": !1,
205
- onUpdate: L
206
- }), U({
210
+ onUpdate: z
211
+ }), $({
207
212
  _: 2
208
- }, [$(B, (l, f) => ({
209
- name: f,
210
- fn: g((A) => [q(e.$slots, f, J(Q(A || {})))])
213
+ }, [q(x, (n, w) => ({
214
+ name: w,
215
+ fn: h((H) => [J(e.$slots, w, Q(X(H || {})))])
211
216
  }))]), 1040, ["class", "columns", "data-source"])]),
212
217
  _: 3
213
218
  }, 16, ["label"])], 64));
214
219
  }
215
220
  });
216
221
  export {
217
- Ie as default
222
+ Ee as default
218
223
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as G, useSlots as O, ref as f, watch as U, unref as t, createBlock as W, openBlock as M, withCtx as d, createVNode as y, mergeProps as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
1
+ import { defineComponent as O, useSlots as U, ref as y, watch as W, unref as n, createBlock as M, openBlock as $, withCtx as d, createVNode as w, mergeProps as q, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
2
  import { ApForm as u } from "../../ap-form/index.mjs";
3
- import { isEqual as Z, isArray as w, omit as ee } from "lodash-unified";
3
+ import { isEqual as ee, isArray as g, omit as oe } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { useGetEditableColumns as oe } from "../hooks/use-editable-columns.mjs";
6
+ import { useGetEditableColumns as ae } from "../hooks/use-editable-columns.mjs";
7
7
  import "../index.vue2.mjs";
8
- import { useEditableApi as ae } from "../hooks/use-editable-api.mjs";
8
+ import { useEditableApi as te } from "../hooks/use-editable-api.mjs";
9
9
  import { arrayToObject as p } from "./utils.mjs";
10
- import te from "../style/editable.mjs";
11
- import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
12
- import { useControllableValue as le } from "../../hooks/useControllableValue.mjs";
13
- import { useGlobalConfig as re } from "../../config-provider/hooks/use-global-config.mjs";
14
- import se from "../index.vue.mjs";
15
- const Ce = /* @__PURE__ */ G({
10
+ import ne from "../style/editable.mjs";
11
+ import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
12
+ import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
13
+ import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
14
+ import ie from "../index.vue.mjs";
15
+ const xe = /* @__PURE__ */ O({
16
16
  name: "EditableGrid",
17
17
  __name: "index",
18
18
  props: {
@@ -128,102 +128,107 @@ const Ce = /* @__PURE__ */ G({
128
128
  onFieldChange: {}
129
129
  },
130
130
  emits: ["update:value"],
131
- setup(g, {
132
- expose: h,
133
- emit: b
131
+ setup(h, {
132
+ expose: C,
133
+ emit: R
134
134
  }) {
135
- const R = O(), o = g, {
135
+ const b = U(), o = h, {
136
136
  b: v
137
- } = ne("editable-aggrid"), C = te("editable-aggrid"), x = b, s = f(), {
137
+ } = le("editable-aggrid"), x = ne("editable-aggrid"), B = R, s = y(), {
138
138
  value: r,
139
139
  updateValue: m
140
- } = le(o, x), l = f(), B = u.useWatch(o.name, l);
141
- U(r, (e) => {
140
+ } = re(o, B), l = y(), S = u.useWatch(o.name, l);
141
+ W(r, (e) => {
142
142
  const a = p(e, o.rowKey);
143
- Z(a, t(B)) || l.value?.setFieldValue(o.name, a);
143
+ ee(a, n(S)) || l.value?.setFieldValue(o.name, a);
144
144
  }, {
145
145
  deep: !0
146
146
  });
147
- const S = re("valueTypeMap"), _ = oe(o, S), {
147
+ const T = se("valueTypeMap"), _ = ae(o, T), {
148
148
  add: F,
149
149
  addMultiple: E,
150
- remove: T,
151
- removeByKey: N,
152
- getRowData: A,
153
- getRowsData: V,
154
- setRowData: k,
155
- clear: D,
150
+ remove: N,
151
+ removeByKey: A,
152
+ getRowData: V,
153
+ getRowsData: k,
154
+ setRowData: D,
155
+ clear: K,
156
156
  refreshRowIds: i
157
- } = ae(o, l, r, m);
158
- function K() {
157
+ } = te(o, l, r, m);
158
+ function j() {
159
159
  const e = s.value?._internalGridApi;
160
160
  if (!i.value?.length || !e)
161
161
  return;
162
- const a = i.value.map((n) => e.getRowNode(n)).filter((n) => !!n);
162
+ const a = i.value.map((t) => e.getRowNode(t)).filter((t) => !!t);
163
163
  e.refreshCells({
164
164
  rowNodes: a,
165
165
  force: !0
166
166
  }), i.value = [];
167
167
  }
168
- function j() {
168
+ function I() {
169
169
  l.value?.resetFields();
170
170
  }
171
- function I(e) {
172
- return e ? (w(e) ? e : [e]).map((n) => w(n) ? [o.name, ...n] : [o.name, n]) : void 0;
171
+ function z(e) {
172
+ return e ? (g(e) ? e : [e]).map((t) => g(t) ? [o.name, ...t] : [o.name, t]) : void 0;
173
173
  }
174
- async function z(e, a) {
175
- return (await l.value?.validateFields(I(e), a))?.[o.name];
174
+ async function H(e, a) {
175
+ return (await l.value?.validateFields(z(e), a))?.[o.name];
176
176
  }
177
- function H(e) {
177
+ function L(e) {
178
178
  m(e);
179
179
  const a = p(e, o.rowKey);
180
180
  l.value?.setFieldValue(o.name, a);
181
181
  }
182
- function L(e) {
183
- const a = e === "end" ? r.value.length - 1 : e;
184
- s.value?.scrollToRow(a);
182
+ function c(e, a) {
183
+ const t = e === "end" ? r.value.length - 1 : e;
184
+ s.value?.scrollToRow(t, a);
185
+ }
186
+ function P(e, a) {
187
+ s.value?.scrollToColumn(e, a);
185
188
  }
186
- return h({
187
- resetFields: j,
188
- validateFields: z,
189
+ return C({
190
+ resetFields: I,
191
+ validateFields: H,
189
192
  add: F,
190
193
  addMultiple: E,
191
- remove: T,
192
- removeByKey: N,
193
- getRowData: A,
194
- getRowsData: V,
195
- setRowData: k,
196
- clear: D,
197
- setTableData: H,
198
- scrollTo: L
199
- }), (e, a) => (M(), W(t(u), {
194
+ remove: N,
195
+ removeByKey: A,
196
+ getRowData: V,
197
+ getRowsData: k,
198
+ setRowData: D,
199
+ clear: K,
200
+ setTableData: L,
201
+ scrollTo: c,
202
+ scrollToRow: c,
203
+ scrollToColumn: P
204
+ }), (e, a) => ($(), M(n(u), {
200
205
  ref_key: "formRef",
201
206
  ref: l,
202
207
  "initial-values": {
203
- [o.name]: t(p)(t(r), o.rowKey)
208
+ [o.name]: n(p)(n(r), o.rowKey)
204
209
  },
205
210
  style: {
206
211
  height: "100%"
207
212
  }
208
213
  }, {
209
- default: d(() => [y(t(u).FormItem, {
214
+ default: d(() => [w(n(u).FormItem, {
210
215
  name: e.name,
211
216
  "no-style": ""
212
217
  }, {
213
- default: d(() => [y(se, $(t(ee)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
218
+ default: d(() => [w(ie, q(n(oe)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
214
219
  ref_key: "tableRef",
215
220
  ref: s,
216
- class: [t(v)(), t(C)],
221
+ class: [n(v)(), n(x)],
217
222
  size: "mini",
218
- columns: t(_),
219
- "data-source": t(r),
223
+ columns: n(_),
224
+ "data-source": n(r),
220
225
  "search-form": !1,
221
- onUpdate: K
222
- }), q({
226
+ onUpdate: j
227
+ }), J({
223
228
  _: 2
224
- }, [J(R, (n, c) => ({
225
- name: c,
226
- fn: d((P) => [Q(e.$slots, c, X(Y(P || {})))])
229
+ }, [Q(b, (t, f) => ({
230
+ name: f,
231
+ fn: d((G) => [X(e.$slots, f, Y(Z(G || {})))])
227
232
  }))]), 1040, ["class", "columns", "data-source"])]),
228
233
  _: 3
229
234
  }, 8, ["name"])]),
@@ -232,5 +237,5 @@ const Ce = /* @__PURE__ */ G({
232
237
  }
233
238
  });
234
239
  export {
235
- Ce as default
240
+ xe as default
236
241
  };
@@ -80,7 +80,9 @@ export type EditableAgGridProps<RecordType = any> = Omit<AgGridProps<RecordType>
80
80
  onFieldChange?: (rowIndex: number, fieldName: DataIndex, newValue: any) => void;
81
81
  };
82
82
  export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableTableExpose<ModelType, RecordType>, 'scrollTo' | 'remove'> & {
83
- scrollTo: (index: number | 'end') => void;
83
+ scrollTo: (index: number | 'end', position?: 'top' | 'bottom' | 'middle') => void;
84
+ scrollToRow: (index: number | 'end', position?: 'top' | 'bottom' | 'middle') => void;
85
+ scrollToColumn: (key: string, position?: 'auto' | 'start' | 'middle' | 'end') => void;
84
86
  remove: (data: RecordType | RecordType[]) => void;
85
87
  };
86
88
  export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields'>;
@@ -6,51 +6,53 @@ let $ = 0;
6
6
  function I() {
7
7
  return `_ag_grid${$++}`;
8
8
  }
9
- const J = (l, v, n, w) => {
9
+ const J = (l, c, n, w) => {
10
10
  const K = E([]);
11
- function j(s, t) {
12
- const r = d(n)?.length || 0;
13
- if (F(l.maxLength) && r >= l.maxLength || !s && x(l.rowKey))
11
+ function j(f, s) {
12
+ const v = d(n)?.length || 0;
13
+ if (F(l.maxLength) && v >= l.maxLength || !f && x(l.rowKey))
14
14
  return;
15
- const f = {
16
- ...s || { [l.rowKey]: I() }
15
+ const t = {
16
+ ...f || { [l.rowKey]: I() }
17
17
  };
18
- v?.setFieldValue(
18
+ c?.setFieldValue(
19
19
  w,
20
- f,
20
+ t,
21
21
  !1,
22
- (i, c) => {
23
- const e = y(f, void 0, l.rowKey);
24
- i[c] ? i[c][e] = f : i[c] = { [e]: f }, n.value ? V(t) ? n.value.push(f) : (K.value = n.value.map(
25
- (u, o) => o < t ? null : y(u, o, l.rowKey)
26
- ).filter(Boolean), n.value.splice(t, 0, f)) : n.value = [f], v?.setFieldValue(
22
+ (i, r) => {
23
+ const e = y(t, void 0, l.rowKey);
24
+ i[r] ? i[r][e] = t : i[r] = { [e]: t }, n.value ? V(s) ? n.value.push(t) : (K.value = n.value.map(
25
+ (u, o) => o < s ? null : y(u, o, l.rowKey)
26
+ ).filter(Boolean), n.value.splice(s, 0, t)) : n.value = [t], c?.setFieldValue(
27
27
  l.name,
28
- f,
28
+ t,
29
29
  !0,
30
30
  (u, o) => {
31
31
  if (!u[o]) {
32
- u[o] = [f];
32
+ u[o] = [t];
33
33
  return;
34
34
  }
35
- V(t) ? u[o].push(f) : u[o].splice(t, 0, f);
35
+ V(s) ? u[o].push(t) : u[o].splice(s, 0, t);
36
36
  }
37
37
  );
38
38
  }
39
39
  );
40
40
  }
41
- function k(s, t = "suffix") {
42
- const r = d(n)?.length || 0, f = h(s) ? s : s.length;
43
- if (F(l.maxLength) && r + f > l.maxLength || h(s) && x(l.rowKey))
41
+ function k(f, s = "suffix") {
42
+ if (!f)
44
43
  return;
45
- const i = h(s) ? new Array(s).fill(0).map(() => ({ [l.rowKey]: I() })) : S(s), c = U(i, l.rowKey);
46
- v?.setFieldValue(
44
+ const v = d(n)?.length || 0, t = h(f) ? f : f.length;
45
+ if (F(l.maxLength) && v + t > l.maxLength || h(f) && x(l.rowKey))
46
+ return;
47
+ const i = h(f) ? new Array(f).fill(0).map(() => ({ [l.rowKey]: I() })) : S(f), r = U(i, l.rowKey);
48
+ c?.setFieldValue(
47
49
  w,
48
- c,
50
+ r,
49
51
  !1,
50
52
  (e, u) => {
51
- e[u] ? Object.assign(e[u], c) : e[u] = c, n.value ? t === "suffix" ? n.value.push(...i) : (K.value = n.value.map(
53
+ e[u] ? Object.assign(e[u], r) : e[u] = r, n.value ? s === "suffix" ? n.value.push(...i) : (K.value = n.value.map(
52
54
  (o, g) => y(o, g, l.rowKey)
53
- ), n.value.unshift(...i)) : n.value = [...i], v?.setFieldValue(
55
+ ), n.value.unshift(...i)) : n.value = [...i], c?.setFieldValue(
54
56
  l.name,
55
57
  i,
56
58
  !0,
@@ -59,31 +61,31 @@ const J = (l, v, n, w) => {
59
61
  o[g] = [...i];
60
62
  return;
61
63
  }
62
- t === "suffix" ? o[g].push(...i) : o[g].unshift(...i);
64
+ s === "suffix" ? o[g].push(...i) : o[g].unshift(...i);
63
65
  }
64
66
  );
65
67
  }
66
68
  );
67
69
  }
68
- function L(s) {
69
- const t = R(s) ? s : [s];
70
- v?.setFieldValue(
70
+ function L(f) {
71
+ const s = R(f) ? f : [f];
72
+ c?.setFieldValue(
71
73
  w,
72
74
  void 0,
73
75
  !1,
74
- (r, f) => {
75
- for (const e of t) {
76
+ (v, t) => {
77
+ for (const e of s) {
76
78
  const u = y(e, void 0, l.rowKey);
77
- delete r[f][u];
79
+ delete v[t][u];
78
80
  }
79
81
  const i = n.value.filter(
80
- (e) => !t.includes(e)
81
- ), c = n.value.findIndex(
82
- (e) => t.includes(e)
82
+ (e) => !s.includes(e)
83
+ ), r = n.value.findIndex(
84
+ (e) => s.includes(e)
83
85
  );
84
86
  K.value = n.value.map(
85
- (e, u) => u <= c ? null : y(e, u, l.rowKey)
86
- ).filter(Boolean), i.length ? n.value = i : n.value.splice(0, n.value.length), v.setFieldValue(
87
+ (e, u) => u <= r ? null : y(e, u, l.rowKey)
88
+ ).filter(Boolean), i.length ? n.value = i : n.value.splice(0, n.value.length), c.setFieldValue(
87
89
  l.name,
88
90
  void 0,
89
91
  !0,
@@ -94,23 +96,23 @@ const J = (l, v, n, w) => {
94
96
  }
95
97
  );
96
98
  }
97
- function O(s) {
98
- const t = new Set(R(s) ? s : [s]);
99
- t.size !== 0 && v?.setFieldValue(
99
+ function O(f) {
100
+ const s = new Set(R(f) ? f : [f]);
101
+ s.size !== 0 && c?.setFieldValue(
100
102
  w,
101
103
  void 0,
102
104
  !1,
103
- (r, f) => {
104
- for (const e of t)
105
- delete r[f][e];
105
+ (v, t) => {
106
+ for (const e of s)
107
+ delete v[t][e];
106
108
  const i = n.value.filter(
107
- (e, u) => !t.has(y(e, u, l.rowKey))
108
- ), c = n.value.findIndex(
109
- (e, u) => t.has(y(e, u, l.rowKey))
109
+ (e, u) => !s.has(y(e, u, l.rowKey))
110
+ ), r = n.value.findIndex(
111
+ (e, u) => s.has(y(e, u, l.rowKey))
110
112
  );
111
113
  K.value = n.value.map(
112
- (e, u) => u <= c ? null : y(e, u, l.rowKey)
113
- ).filter(Boolean), i.length ? n.value = i : n.value.splice(0, n.value.length), v.setFieldValue(
114
+ (e, u) => u <= r ? null : y(e, u, l.rowKey)
115
+ ).filter(Boolean), i.length ? n.value = i : n.value.splice(0, n.value.length), c.setFieldValue(
114
116
  l.name,
115
117
  void 0,
116
118
  !0,
@@ -121,41 +123,41 @@ const J = (l, v, n, w) => {
121
123
  }
122
124
  );
123
125
  }
124
- function T(s) {
125
- return d(n)?.[s];
126
+ function T(f) {
127
+ return d(n)?.[f];
126
128
  }
127
129
  function B() {
128
130
  return d(n);
129
131
  }
130
- function _(s, t, r = !0) {
131
- v?.setFieldValue?.(
132
+ function _(f, s, v = !0) {
133
+ c?.setFieldValue?.(
132
134
  w,
133
135
  void 0,
134
136
  !1,
135
- (f, i) => {
136
- const c = n.value.findIndex(
137
- (u, o) => s === o
137
+ (t, i) => {
138
+ const r = n.value.findIndex(
139
+ (u, o) => f === o
138
140
  );
139
- if (!~c)
141
+ if (!~r)
140
142
  return;
141
143
  const e = y(
142
- n.value[c],
143
- c,
144
+ n.value[r],
145
+ r,
144
146
  l.rowKey
145
147
  );
146
- if (e && !(!f[i] || !f[i][e])) {
147
- if (!r) {
148
- const u = Object.keys(f[i][e]);
148
+ if (e && !(!t[i] || !t[i][e])) {
149
+ if (!v) {
150
+ const u = Object.keys(t[i][e]);
149
151
  for (const o of u)
150
- o !== l.rowKey && delete f[i][e][o];
152
+ o !== l.rowKey && delete t[i][e][o];
151
153
  }
152
- Object.assign(f[i][e], { ...t });
154
+ Object.assign(t[i][e], { ...s });
153
155
  }
154
156
  }
155
157
  );
156
158
  }
157
159
  function z() {
158
- v?.setFieldValue(w, {}), v?.setFieldValue(l.name, []);
160
+ c?.setFieldValue(w, {}), c?.setFieldValue(l.name, []);
159
161
  }
160
162
  return {
161
163
  add: j,
@@ -1,5 +1,32 @@
1
1
  import { GenStyleFunc } from '../../design-token/interface';
2
2
  import { Ref } from 'vue';
3
- export declare const genAgGridStyle: GenStyleFunc;
3
+ export type AgGridToken = {
4
+ /**
5
+ * 卡片模式下表单容器的下边距尺寸
6
+ */
7
+ agGridSearchFormWrapperMarginBlockEnd: number;
8
+ /**
9
+ * 小尺寸表格单元格垂直边距
10
+ */
11
+ agGridCellPaddingBlockMini: number;
12
+ /**
13
+ * 中等尺寸单元格垂直边距
14
+ */
15
+ agGridCellPaddingBlockMedium: number;
16
+ /**
17
+ * 多行文本时最多显示的行
18
+ */
19
+ agGridLineClamp: number;
20
+ /**
21
+ * 单元格省略时提示框最大宽度
22
+ */
23
+ agGridEllipsisTooltipMaxWidth: number;
24
+ /**
25
+ * 表格省略时提示框内边距
26
+ */
27
+ agGridEllipsisTooltipPadding: number | string;
28
+ };
29
+ export declare const defaultToken: AgGridToken;
30
+ export declare const genAgGridStyle: GenStyleFunc<AgGridToken>;
4
31
  declare const _default: (prefixCls: string) => Ref<string | undefined, string | undefined>;
5
32
  export default _default;