@aplus-frontend/ui 0.0.39 → 0.1.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 (97) hide show
  1. package/es/index.mjs +149 -148
  2. package/es/src/ap-action/item/index.vue2.mjs +19 -20
  3. package/es/src/ap-action/item-modal/index.vue.mjs +7 -6
  4. package/es/src/ap-action/style/item.css +10 -25
  5. package/es/src/ap-field/checkbox/index.vue.mjs +32 -27
  6. package/es/src/ap-field/checkbox/style.css +7 -0
  7. package/es/src/ap-field/interface.d.ts +3 -1
  8. package/es/src/ap-field/radio/index.vue.d.ts +3 -0
  9. package/es/src/ap-field/radio/index.vue.mjs +44 -29
  10. package/es/src/ap-field/radio/style.css +4 -0
  11. package/es/src/ap-field/text-area/index.vue.mjs +9 -10
  12. package/es/src/ap-form/style/ap-form-item.css +6 -6
  13. package/es/src/ap-table/ap-table.vue.d.ts +6 -0
  14. package/es/src/ap-table/ap-table.vue.mjs +124 -124
  15. package/es/src/ap-table/constants.d.ts +15 -6
  16. package/es/src/ap-table/style/ap-table.css +1 -21
  17. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +14 -0
  18. package/es/src/business/ap-export-group/ApExportGroup.vue.mjs +4 -0
  19. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +117 -0
  20. package/es/src/business/ap-export-group/interface.d.ts +37 -0
  21. package/es/src/business/ap-export-group/interface.mjs +4 -0
  22. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +10 -9
  23. package/es/src/business/index.d.ts +105 -0
  24. package/es/src/business/index.mjs +12 -9
  25. package/es/src/check-card/index.vue2.mjs +44 -48
  26. package/es/src/check-card/style/index.css +10 -42
  27. package/es/src/config-provider/config-provider.mjs +22 -17
  28. package/es/src/design-token/index.mjs +4 -2
  29. package/es/src/editable-table/form-item.vue.d.ts +4 -0
  30. package/es/src/editable-table/form-item.vue.mjs +75 -68
  31. package/es/src/editable-table/index.vue.d.ts +4 -0
  32. package/es/src/editable-table/index.vue.mjs +79 -72
  33. package/es/src/editable-table/interface.d.ts +8 -0
  34. package/es/src/editable-table/style/index.css +1 -21
  35. package/es/src/editable-table/utils.d.ts +8 -0
  36. package/es/src/editable-table/utils.mjs +29 -18
  37. package/es/src/index.mjs +175 -174
  38. package/es/src/locale/lang/en.mjs +7 -1
  39. package/es/src/locale/lang/zh-cn.mjs +28 -22
  40. package/es/src/theme/ap-action/item.css +10 -25
  41. package/es/src/theme/ap-field/checkbox.css +7 -0
  42. package/es/src/theme/ap-field/radio.css +4 -0
  43. package/es/src/theme/ap-form/ap-form-item.css +6 -6
  44. package/es/src/theme/ap-table/ap-table.css +1 -21
  45. package/es/src/theme/check-card/index.css +10 -42
  46. package/es/src/theme/css-var/index.d.ts +7 -0
  47. package/es/src/theme/css-var/index.mjs +109 -0
  48. package/es/src/theme/editable-table/index.css +1 -21
  49. package/lib/index.js +1 -1
  50. package/lib/src/ap-action/item/index.vue2.js +1 -1
  51. package/lib/src/ap-action/item-modal/index.vue.js +1 -1
  52. package/lib/src/ap-action/style/item.css +10 -25
  53. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  54. package/lib/src/ap-field/checkbox/style.css +7 -0
  55. package/lib/src/ap-field/interface.d.ts +3 -1
  56. package/lib/src/ap-field/radio/index.vue.d.ts +3 -0
  57. package/lib/src/ap-field/radio/index.vue.js +1 -1
  58. package/lib/src/ap-field/radio/style.css +4 -0
  59. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  60. package/lib/src/ap-form/style/ap-form-item.css +6 -6
  61. package/lib/src/ap-table/ap-table.vue.d.ts +6 -0
  62. package/lib/src/ap-table/ap-table.vue.js +1 -1
  63. package/lib/src/ap-table/constants.d.ts +15 -6
  64. package/lib/src/ap-table/style/ap-table.css +1 -21
  65. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +14 -0
  66. package/lib/src/business/ap-export-group/ApExportGroup.vue.js +1 -0
  67. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -0
  68. package/lib/src/business/ap-export-group/interface.d.ts +37 -0
  69. package/lib/src/business/ap-export-group/interface.js +1 -0
  70. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  71. package/lib/src/business/index.d.ts +105 -0
  72. package/lib/src/business/index.js +1 -1
  73. package/lib/src/check-card/index.vue2.js +1 -1
  74. package/lib/src/check-card/style/index.css +10 -42
  75. package/lib/src/config-provider/config-provider.js +1 -1
  76. package/lib/src/design-token/index.js +1 -1
  77. package/lib/src/editable-table/form-item.vue.d.ts +4 -0
  78. package/lib/src/editable-table/form-item.vue.js +1 -1
  79. package/lib/src/editable-table/index.vue.d.ts +4 -0
  80. package/lib/src/editable-table/index.vue.js +1 -1
  81. package/lib/src/editable-table/interface.d.ts +8 -0
  82. package/lib/src/editable-table/style/index.css +1 -21
  83. package/lib/src/editable-table/utils.d.ts +8 -0
  84. package/lib/src/editable-table/utils.js +1 -1
  85. package/lib/src/index.js +1 -1
  86. package/lib/src/locale/lang/en.js +1 -1
  87. package/lib/src/locale/lang/zh-cn.js +1 -1
  88. package/lib/src/theme/ap-action/item.css +10 -25
  89. package/lib/src/theme/ap-field/checkbox.css +7 -0
  90. package/lib/src/theme/ap-field/radio.css +4 -0
  91. package/lib/src/theme/ap-form/ap-form-item.css +6 -6
  92. package/lib/src/theme/ap-table/ap-table.css +1 -21
  93. package/lib/src/theme/check-card/index.css +10 -42
  94. package/lib/src/theme/css-var/index.d.ts +7 -0
  95. package/lib/src/theme/css-var/index.js +1 -0
  96. package/lib/src/theme/editable-table/index.css +1 -21
  97. package/package.json +6 -5
@@ -1,16 +1,15 @@
1
- import { defineComponent as P, ref as V, unref as o, useSlots as A, watch as O, openBlock as x, createBlock as T, mergeProps as C, withCtx as m, createVNode as K, createSlots as M, createElementBlock as q, Fragment as G, createElementVNode as w, normalizeClass as H, toDisplayString as W, createCommentVNode as I, renderList as U, renderSlot as $, normalizeProps as J, guardReactiveProps as Q } from "vue";
2
- import { Table as X } from "ant-design-vue";
3
- import { ApForm as b } from "../ap-form/index.mjs";
4
- import { isNumber as u, cloneDeep as i, omit as Y } from "lodash-unified";
1
+ import { defineComponent as V, ref as x, unref as t, useSlots as A, watch as O, openBlock as C, createBlock as K, mergeProps as w, withCtx as m, createVNode as q, createSlots as H, createElementBlock as I, Fragment as W, createElementVNode as b, normalizeClass as $, toDisplayString as G, createCommentVNode as M, renderList as U, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
2
+ import { Table as Y } from "ant-design-vue";
3
+ import { ApForm as y } from "../ap-form/index.mjs";
4
+ import { isNumber as u, cloneDeep as f, omit as Z } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as Z } from "../ap-form/context.mjs";
6
+ import { useInjectForm as ee } from "../ap-form/context.mjs";
7
7
  import "./style/index.css";
8
- import { isDef as f } from "../utils/index.mjs";
9
- import ee from "./hooks/use-get-columns.mjs";
10
- import { getColumnIsRequired as oe } from "./utils.mjs";
11
- import { useNamespace as te } from "../config-provider/hooks/use-namespace.mjs";
12
- import { useGlobalConfig as ae } from "../config-provider/hooks/use-global-config.mjs";
13
- const ge = /* @__PURE__ */ P({
8
+ import { isDef as c } from "../utils/index.mjs";
9
+ import oe from "./hooks/use-get-columns.mjs";
10
+ import { scrollToRowIndex as te, getColumnIsRequired as ae } from "./utils.mjs";
11
+ import { useNamespace as ne } from "../config-provider/hooks/use-namespace.mjs";
12
+ const ge = /* @__PURE__ */ V({
14
13
  name: "EditableTableInner",
15
14
  __name: "form-item",
16
15
  props: {
@@ -110,88 +109,96 @@ const ge = /* @__PURE__ */ P({
110
109
  default: () => ({})
111
110
  }
112
111
  },
113
- setup(y, {
114
- expose: R
112
+ setup(R, {
113
+ expose: B
115
114
  }) {
116
- var c;
117
- const a = y, {
115
+ var p;
116
+ const n = R, {
118
117
  internalInstance: l,
119
- model: B
120
- } = Z(), r = V(((c = o(B)) == null ? void 0 : c[a.name]) || []), D = A(), F = b.useWatch(a.name);
118
+ model: D
119
+ } = ee(), r = x(((p = t(D)) == null ? void 0 : p[n.name]) || []), v = A(), F = y.useWatch(n.name);
121
120
  O(() => F.value, (e) => {
122
- var t;
123
- r.value = e, (t = a.onChange) == null || t.call(a, e);
121
+ var o;
122
+ r.value = e, (o = n.onChange) == null || o.call(n, e);
124
123
  });
125
124
  const {
126
- b: p,
127
- em: E
128
- } = te("editable-table"), L = ae("uiMode", "aplus"), v = ee(a);
129
- function N(e, t) {
130
- var s;
131
- const n = ((s = o(r)) == null ? void 0 : s.length) || 0;
132
- if (f(a.maxLength) && n >= a.maxLength)
125
+ b: E,
126
+ em: L
127
+ } = ne("editable-table"), i = x(), N = oe(n);
128
+ function k(e, o) {
129
+ var d;
130
+ const a = ((d = t(r)) == null ? void 0 : d.length) || 0;
131
+ if (c(n.maxLength) && a >= n.maxLength)
133
132
  return;
134
- const d = [...o(r) || []];
135
- f(t) ? d.splice(t, 0, {
133
+ const s = [...t(r) || []];
134
+ c(o) ? s.splice(o, 0, {
136
135
  ...e || {}
137
- }) : d.push({
136
+ }) : s.push({
138
137
  ...e || {}
139
- }), l == null || l.setFieldValue(a.name, [...o(r) || [], e || {}]);
138
+ }), l == null || l.setFieldValue(n.name, [...t(r) || [], e || {}]);
140
139
  }
141
- function S(e, t = "suffix") {
140
+ function S(e, o = "suffix") {
142
141
  var g;
143
- const n = ((g = o(r)) == null ? void 0 : g.length) || 0, d = u(e) ? e : e.length;
144
- if (f(a.maxLength) && n + d > a.maxLength)
142
+ const a = ((g = t(r)) == null ? void 0 : g.length) || 0, s = u(e) ? e : e.length;
143
+ if (c(n.maxLength) && a + s > n.maxLength)
145
144
  return;
146
- const s = [...o(r) || []], h = u(e) ? new Array(e).fill({}) : i(e);
147
- t === "suffix" ? s.push(...h) : s.unshift(...h), l == null || l.setFieldValue(a.name, s);
145
+ const d = [...t(r) || []], h = u(e) ? new Array(e).fill({}) : f(e);
146
+ o === "suffix" ? d.push(...h) : d.unshift(...h), l == null || l.setFieldValue(n.name, d);
148
147
  }
149
- function k(e) {
150
- let t = i(o(r) || []);
151
- const n = u(e) ? [e] : e;
152
- t = t.filter((d, s) => !n.includes(s)), l == null || l.setFieldValue(a.name, t);
148
+ function _(e) {
149
+ let o = f(t(r) || []);
150
+ const a = u(e) ? [e] : e;
151
+ o = o.filter((s, d) => !a.includes(d)), l == null || l.setFieldValue(n.name, o);
153
152
  }
154
- function _() {
155
- return o(r);
153
+ function T() {
154
+ return t(r);
156
155
  }
157
156
  function j(e) {
158
- var t;
159
- return (t = o(r)) == null ? void 0 : t[e];
157
+ var o;
158
+ return (o = t(r)) == null ? void 0 : o[e];
159
+ }
160
+ function z(e, o) {
161
+ const a = f(t(r));
162
+ a[e] && (a[e] = {
163
+ ...a[e],
164
+ ...o
165
+ }, l == null || l.setFieldValue(n.name, [...a]));
160
166
  }
161
- function z(e, t) {
162
- const n = i(o(r));
163
- n[e] && (n[e] = {
164
- ...n[e],
165
- ...t
166
- }, l == null || l.setFieldValue(a.name, [...n]));
167
+ function P(e, o) {
168
+ var s;
169
+ const a = e === "end" ? r.value.length - 1 : e;
170
+ te(a, (s = i.value) == null ? void 0 : s.$el, o);
167
171
  }
168
- return R({
169
- add: N,
170
- remove: k,
172
+ return B({
173
+ add: k,
174
+ remove: _,
171
175
  getRowData: j,
172
- getRowsData: _,
176
+ getRowsData: T,
173
177
  setRowData: z,
174
- addMultiple: S
175
- }), (e, t) => (x(), T(o(b).FormItem, C(e.formItem, {
178
+ addMultiple: S,
179
+ scrollTo: P
180
+ }), (e, o) => (C(), K(t(y).FormItem, w(e.formItem, {
176
181
  name: e.name,
177
182
  label: e.label
178
183
  }), {
179
- default: m(() => [K(o(X), C(o(Y)(a, ["name", "maxLength", "onChange"]), {
180
- class: [o(p)(), o(L) === "admin" ? o(p)("admin") : null],
181
- columns: o(v),
182
- "data-source": r.value
183
- }), M({
184
+ default: m(() => [q(t(Y), w(t(Z)(n, ["name", "maxLength", "onChange"]), {
185
+ class: t(E)(),
186
+ columns: t(N),
187
+ "data-source": r.value,
188
+ ref_key: "tableRef",
189
+ ref: i
190
+ }), H({
184
191
  headerCell: m(({
185
- column: n
186
- }) => [o(oe)(n) ? (x(), q(G, {
192
+ column: a
193
+ }) => [t(ae)(a) ? (C(), I(W, {
187
194
  key: 0
188
- }, [w("span", {
189
- class: H(o(E)("header-cell", "required"))
190
- }, "*", 2), w("span", null, W(n.title), 1)], 64)) : I("", !0)]),
195
+ }, [b("span", {
196
+ class: $(t(L)("header-cell", "required"))
197
+ }, "*", 2), b("span", null, G(a.title), 1)], 64)) : M("", !0)]),
191
198
  _: 2
192
- }, [U(D, (n, d) => ({
193
- name: d,
194
- fn: m((s) => [$(e.$slots, d, J(Q(s || {})))])
199
+ }, [U(v, (a, s) => ({
200
+ name: s,
201
+ fn: m((d) => [J(e.$slots, s, Q(X(d || {})))])
195
202
  }))]), 1040, ["class", "columns", "data-source"])]),
196
203
  _: 3
197
204
  }, 16, ["name", "label"]));
@@ -1,6 +1,7 @@
1
1
  import { EditableColumnType } from './interface';
2
2
  import { NamePath, ValidateOptions } from 'ant-design-vue/es/form/interface';
3
3
  import { Recordable } from '../type';
4
+ import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
4
5
  import { ExtractPropTypes, PropType, VNode, RendererNode, RendererElement, CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowUnwrapRef } from 'vue';
5
6
  import { SpinSize } from 'ant-design-vue/es/spin/Spin';
6
7
  import { VueTypeValidableDef } from '../../node_modules/vue-types';
@@ -210,6 +211,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: {
210
211
  getRowsData: () => UnwrapRefSimple<RecordType>[];
211
212
  setRowData: (index: number, payload: any) => void;
212
213
  addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
214
+ scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
213
215
  }>) => void) | undefined, __VLS_setup?: Promise<{
214
216
  props: {
215
217
  loading?: boolean | Partial< ExtractPropTypes<{
@@ -371,6 +373,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: {
371
373
  getRowsData: () => UnwrapRefSimple<RecordType>[];
372
374
  setRowData: (index: number, payload: any) => void;
373
375
  addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
376
+ scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
374
377
  }>): void;
375
378
  attrs: any;
376
379
  slots: Readonly<{
@@ -569,6 +572,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: {
569
572
  getRowsData: () => UnwrapRefSimple<RecordType>[];
570
573
  setRowData: (index: number, payload: any) => void;
571
574
  addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
575
+ scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
572
576
  }>): void;
573
577
  attrs: any;
574
578
  slots: Readonly<{
@@ -1,17 +1,16 @@
1
- import { defineComponent as T, useSlots as K, ref as M, watch as q, unref as a, openBlock as w, createBlock as G, withCtx as c, createVNode as y, mergeProps as H, createSlots as U, createElementBlock as W, Fragment as $, createElementVNode as v, normalizeClass as J, toDisplayString as Q, createCommentVNode as X, renderList as Y, renderSlot as Z, normalizeProps as ee, guardReactiveProps as te } from "vue";
2
- import { Table as ae } from "ant-design-vue";
1
+ import { defineComponent as q, useSlots as H, ref as w, watch as U, unref as o, openBlock as y, createBlock as W, withCtx as c, createVNode as v, mergeProps as $, createSlots as G, createElementBlock as M, Fragment as J, createElementVNode as b, normalizeClass as Q, toDisplayString as X, createCommentVNode as Y, renderList as Z, renderSlot as ee, normalizeProps as te, guardReactiveProps as ae } from "vue";
2
+ import { Table as ne } from "ant-design-vue";
3
3
  import { ApForm as f } from "../ap-form/index.mjs";
4
- import { isNumber as p, cloneDeep as h, omit as ne } from "lodash-unified";
4
+ import { isNumber as p, cloneDeep as h, omit as oe } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
6
  import "../hooks/index.mjs";
7
7
  import { isDef as x } from "../utils/index.mjs";
8
- import { getColumnIsRequired as oe } from "./utils.mjs";
9
- import le from "./hooks/use-get-columns.mjs";
8
+ import { scrollToRowIndex as le, getColumnIsRequired as re } from "./utils.mjs";
9
+ import se from "./hooks/use-get-columns.mjs";
10
10
  import "./style/index.css";
11
- import { useNamespace as re } from "../config-provider/hooks/use-namespace.mjs";
12
- import { useGlobalConfig as se } from "../config-provider/hooks/use-global-config.mjs";
13
- import { useControllableValue as ue } from "../hooks/useControllableValue.mjs";
14
- const be = /* @__PURE__ */ T({
11
+ import { useNamespace as ue } from "../config-provider/hooks/use-namespace.mjs";
12
+ import { useControllableValue as de } from "../hooks/useControllableValue.mjs";
13
+ const be = /* @__PURE__ */ q({
15
14
  name: "EditableTable",
16
15
  __name: "index",
17
16
  props: {
@@ -110,108 +109,116 @@ const be = /* @__PURE__ */ T({
110
109
  onFieldChange: {}
111
110
  },
112
111
  emits: ["update:value"],
113
- setup(b, {
114
- expose: R,
115
- emit: B
112
+ setup(R, {
113
+ expose: B,
114
+ emit: F
116
115
  }) {
117
- const l = b, {
118
- b: g,
119
- em: F
120
- } = re("editable-table"), D = se("uiMode", "aplus"), _ = K(), E = B, {
116
+ const l = R, {
117
+ b: D,
118
+ em: _
119
+ } = ue("editable-table"), k = H(), E = F, g = w(), {
121
120
  value: s,
122
121
  updateValue: L
123
- } = ue(l, E), u = M(), k = f.useWatch(l.name, u);
124
- q(() => k.value, (e) => {
125
- var n;
126
- L(e), (n = l.onChange) == null || n.call(l, e);
122
+ } = de(l, E), u = w(), N = f.useWatch(l.name, u);
123
+ U(() => N.value, (e) => {
124
+ var a;
125
+ L(e), (a = l.onChange) == null || a.call(l, e);
127
126
  });
128
- const N = le(l);
129
- function S() {
127
+ const S = se(l);
128
+ function V() {
130
129
  var e;
131
130
  (e = u.value) == null || e.resetFields();
132
131
  }
133
- async function V(e, n) {
132
+ async function T(e, a) {
134
133
  var t;
135
- const o = await ((t = u.value) == null ? void 0 : t.validateFields(e, n));
136
- return o == null ? void 0 : o[l.name];
134
+ const n = await ((t = u.value) == null ? void 0 : t.validateFields(e, a));
135
+ return n == null ? void 0 : n[l.name];
137
136
  }
138
- function z(e, n) {
137
+ function z(e, a) {
139
138
  var r, d, i;
140
- const o = ((r = a(s)) == null ? void 0 : r.length) || 0;
141
- if (x(l.maxLength) && o >= l.maxLength)
139
+ const n = ((r = o(s)) == null ? void 0 : r.length) || 0;
140
+ if (x(l.maxLength) && n >= l.maxLength)
142
141
  return;
143
- const t = [...a(s) || []];
144
- x(n) ? t.splice(n, 0, {
142
+ const t = [...o(s) || []];
143
+ x(a) ? t.splice(a, 0, {
145
144
  ...e || {}
146
145
  }) : t.push({
147
146
  ...e || {}
148
147
  }), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, l.name, t);
149
148
  }
150
- function P(e, n = "suffix") {
149
+ function I(e, a = "suffix") {
151
150
  var i, m, C;
152
- const o = ((i = a(s)) == null ? void 0 : i.length) || 0, t = p(e) ? e : e.length;
153
- if (x(l.maxLength) && o + t > l.maxLength)
151
+ const n = ((i = o(s)) == null ? void 0 : i.length) || 0, t = p(e) ? e : e.length;
152
+ if (x(l.maxLength) && n + t > l.maxLength)
154
153
  return;
155
- const r = [...a(s) || []], d = p(e) ? new Array(e).fill({}) : h(e);
156
- n === "suffix" ? r.push(...d) : r.unshift(...d), (C = (m = u.value) == null ? void 0 : m.setFieldValue) == null || C.call(m, l.name, r);
154
+ const r = [...o(s) || []], d = p(e) ? new Array(e).fill({}) : h(e);
155
+ a === "suffix" ? r.push(...d) : r.unshift(...d), (C = (m = u.value) == null ? void 0 : m.setFieldValue) == null || C.call(m, l.name, r);
157
156
  }
158
- function j(e) {
157
+ function P(e) {
159
158
  var t, r;
160
- let n = h(a(s) || []);
161
- const o = p(e) ? [e] : e;
162
- n = n.filter((d, i) => !o.includes(i)), (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, n);
159
+ let a = h(o(s) || []);
160
+ const n = p(e) ? [e] : e;
161
+ a = a.filter((d, i) => !n.includes(i)), (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, a);
163
162
  }
164
- function A() {
165
- return a(s);
163
+ function j() {
164
+ return o(s);
166
165
  }
167
- function I(e) {
168
- var n;
169
- return (n = a(s)) == null ? void 0 : n[e];
166
+ function A(e) {
167
+ var a;
168
+ return (a = o(s)) == null ? void 0 : a[e];
170
169
  }
171
- function O(e, n) {
170
+ function O(e, a) {
172
171
  var t, r;
173
- const o = h(a(s));
174
- o[e] && (o[e] = {
175
- ...o[e],
176
- ...n
177
- }, (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, [...o]));
172
+ const n = h(o(s));
173
+ n[e] && (n[e] = {
174
+ ...n[e],
175
+ ...a
176
+ }, (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, [...n]));
178
177
  }
179
- return R({
180
- resetFields: S,
181
- validateFields: V,
178
+ function K(e, a) {
179
+ var t;
180
+ const n = e === "end" ? s.value.length - 1 : e;
181
+ le(n, (t = g.value) == null ? void 0 : t.$el, a);
182
+ }
183
+ return B({
184
+ resetFields: V,
185
+ validateFields: T,
182
186
  add: z,
183
- remove: j,
184
- getRowData: I,
185
- getRowsData: A,
187
+ remove: P,
188
+ getRowData: A,
189
+ getRowsData: j,
186
190
  setRowData: O,
187
- addMultiple: P
188
- }), (e, n) => (w(), G(a(f), {
191
+ addMultiple: I,
192
+ scrollTo: K
193
+ }), (e, a) => (y(), W(o(f), {
189
194
  "initial-values": {
190
- [l.name]: a(s)
195
+ [l.name]: o(s)
191
196
  },
192
197
  ref_key: "formRef",
193
198
  ref: u
194
199
  }, {
195
- default: c(() => [y(a(f).FormItem, {
200
+ default: c(() => [v(o(f).FormItem, {
196
201
  name: e.name,
197
202
  "no-style": ""
198
203
  }, {
199
- default: c(() => [y(a(ae), H(a(ne)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
200
- class: [a(g)(), a(D) === "admin" ? a(g)("admin") : null],
201
- columns: a(N),
202
- "data-source": a(s)
203
- }), U({
204
+ default: c(() => [v(o(ne), $(o(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
205
+ class: o(D)(),
206
+ columns: o(S),
207
+ "data-source": o(s),
208
+ ref_key: "tableRef",
209
+ ref: g
210
+ }), G({
204
211
  headerCell: c(({
205
- column: o
206
- }) => [a(oe)(o) ? (w(), W($, {
212
+ column: n
213
+ }) => [o(re)(n) ? (y(), M(J, {
207
214
  key: 0
208
- }, [v("span", {
209
- class: J(a(F)("header-cell", "required"))
210
- }, "*", 2), v("span", null, Q(o.title), 1)], 64)) : X("", !0)]),
215
+ }, [b("span", {
216
+ class: Q(o(_)("header-cell", "required"))
217
+ }, "*", 2), b("span", null, X(n.title), 1)], 64)) : Y("", !0)]),
211
218
  _: 2
212
- }, [Y(_, (o, t) => ({
219
+ }, [Z(k, (n, t) => ({
213
220
  name: t,
214
- fn: c((r) => [Z(e.$slots, t, ee(te(r || {})))])
221
+ fn: c((r) => [ee(e.$slots, t, te(ae(r || {})))])
215
222
  }))]), 1040, ["class", "columns", "data-source"])]),
216
223
  _: 3
217
224
  }, 8, ["name"])]),
@@ -5,6 +5,7 @@ import { DataIndex } from 'ant-design-vue/es/vc-table/interface';
5
5
  import { FormItemProps } from 'ant-design-vue';
6
6
  import { VNode } from 'vue';
7
7
  import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
8
+ import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
8
9
 
9
10
  export type EditableColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? Omit<ColumnType<RecordType>, 'children' | 'customRender' | 'ellipsis'> & {
10
11
  children?: EditableColumnType<RecordType, ValueType>;
@@ -158,6 +159,13 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
158
159
  * @returns
159
160
  */
160
161
  setRowData: (index: number, data: Partial<RecordType>) => void;
162
+ /**
163
+ * 滚动到表格的某行
164
+ * @param index
165
+ * @param options
166
+ * @returns
167
+ */
168
+ scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
161
169
  };
162
170
  /**
163
171
  * 可编辑表格作为表单项暴露的实例
@@ -12,31 +12,11 @@
12
12
  flex: 1;
13
13
  }
14
14
  .aplus-editable-table tr > th.ant-table-cell {
15
- background-color: #F2F6F9;
16
- border-bottom-color: #E9EDF3;
15
+ background-color: var(--ap-table-header-bg);
17
16
  }
18
17
  .aplus-editable-table tr > th.ant-table-cell::before {
19
18
  display: none;
20
19
  }
21
- .aplus-editable-table tr > td.ant-table-cell {
22
- border-top-color: #E9EDF3;
23
- }
24
- .aplus-editable-table-admin .ant-pagination {
25
- margin-bottom: 0 !important;
26
- }
27
- .aplus-editable-table-admin .ant-pagination .ant-pagination-total-text {
28
- flex: 1;
29
- }
30
- .aplus-editable-table-admin tr > th.ant-table-cell {
31
- background-color: #FAFAFA;
32
- border-bottom-color: #E9E9E9;
33
- }
34
- .aplus-editable-table-admin tr > th.ant-table-cell::before {
35
- display: none;
36
- }
37
- .aplus-editable-table-admin tr > td.ant-table-cell {
38
- border-top-color: #E9E9E9;
39
- }
40
20
  .aplus-editable-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:has(.is-editable) {
41
21
  padding: 20px 16px 0px;
42
22
  }
@@ -1,4 +1,5 @@
1
1
  import { EditableColumnType } from './interface';
2
+ import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
2
3
 
3
4
  /**
4
5
  * 获取编辑模式下默认映射的组件
@@ -20,3 +21,10 @@ export declare function getColumnIsRequired(column: EditableColumnType<any, 'tex
20
21
  */
21
22
  export declare function getRawDisplayValue(column: EditableColumnType, value: any): any;
22
23
  export declare function mergeClass(current: string, classNames?: string | string[]): string;
24
+ /**
25
+ * 滚动到表格的某行
26
+ * @param index
27
+ * @param container
28
+ * @param options
29
+ */
30
+ export declare function scrollToRowIndex(index: number, container?: HTMLElement, options?: StandardBehaviorOptions): void;
@@ -1,39 +1,50 @@
1
- import { isFunction as o, isArray as n } from "lodash-unified";
1
+ import { isFunction as i, isArray as n } from "lodash-unified";
2
2
  import { apTableFormItemMap as s } from "../ap-table/constants.mjs";
3
3
  import { isDef as f } from "../utils/index.mjs";
4
- import { getValueStr as u } from "../ap-field/number/helper.mjs";
5
- function P(r) {
4
+ import { getValueStr as l } from "../ap-field/number/helper.mjs";
5
+ import d from "scroll-into-view-if-needed";
6
+ function m(r) {
6
7
  const e = s[r];
7
8
  return e || console.warn(
8
9
  `${r} can not render because of no default renderer, use customRender instead.`
9
10
  ), e;
10
11
  }
11
- function g(r) {
12
+ function b(r) {
12
13
  if (!r.fieldProps)
13
14
  return !1;
14
- const e = o(r.fieldProps) ? r.fieldProps({}) : r.fieldProps;
15
- return f(e.required) ? e.required : (n(e.rules) ? e.rules : e.rules ? [e.rules] : []).some((i) => i.required);
15
+ const e = i(r.fieldProps) ? r.fieldProps({}) : r.fieldProps;
16
+ return f(e.required) ? e.required : (n(e.rules) ? e.rules : e.rules ? [e.rules] : []).some((t) => t.required);
16
17
  }
17
- function m(r, e) {
18
+ function g(r, e) {
18
19
  if (r.valueType === "text" || r.valueType === "textArea")
19
20
  return e || "--";
20
21
  if (r.valueType === "number") {
21
- const t = r.fieldProps ? o(r.fieldProps) ? r.fieldProps({}) : r.fieldProps : {};
22
- return u(e, t) || "--";
22
+ const o = r.fieldProps ? i(r.fieldProps) ? r.fieldProps({}) : r.fieldProps : {};
23
+ return l(e, o) || "--";
23
24
  }
24
25
  return e;
25
26
  }
26
- function C(r, e) {
27
- const t = [r];
27
+ function w(r, e) {
28
+ const o = [r];
28
29
  if (e) {
29
- const i = n(e) ? e : [e];
30
- t.unshift(...i);
30
+ const t = n(e) ? e : [e];
31
+ o.unshift(...t);
31
32
  }
32
- return t.join(" ");
33
+ return o.join(" ");
34
+ }
35
+ function y(r, e = document.body, o = {}) {
36
+ const t = e.querySelectorAll("tr.ant-table-row")[r];
37
+ console.log(t), t && d(t, {
38
+ scrollMode: "if-needed",
39
+ block: "nearest",
40
+ behavior: "smooth",
41
+ ...o
42
+ });
33
43
  }
34
44
  export {
35
- g as getColumnIsRequired,
36
- P as getEditableComponent,
37
- m as getRawDisplayValue,
38
- C as mergeClass
45
+ b as getColumnIsRequired,
46
+ m as getEditableComponent,
47
+ g as getRawDisplayValue,
48
+ w as mergeClass,
49
+ y as scrollToRowIndex
39
50
  };