@aplus-frontend/ui 0.0.23 → 0.0.25

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 (31) hide show
  1. package/es/src/ap-field/date/index.vue.mjs +26 -26
  2. package/es/src/ap-field/number/helper.d.ts +9 -0
  3. package/es/src/ap-field/number/helper.mjs +20 -11
  4. package/es/src/ap-table/ap-table.vue.d.ts +2137 -112
  5. package/es/src/ap-table/ap-table.vue.mjs +31 -30
  6. package/es/src/check-card/style/index.css +1 -0
  7. package/es/src/editable-table/form-item.vue.mjs +61 -63
  8. package/es/src/editable-table/hooks/use-get-columns.mjs +27 -27
  9. package/es/src/editable-table/index.vue.mjs +63 -65
  10. package/es/src/editable-table/utils.d.ts +13 -0
  11. package/es/src/editable-table/utils.mjs +26 -6
  12. package/es/src/theme/check-card/index.css +1 -0
  13. package/es/src/work-order-modal/createWorkOrder.mjs +2 -1
  14. package/es/src/work-order-modal/work-order-modal.vue.d.ts +2 -0
  15. package/es/src/work-order-modal/work-order-modal.vue.mjs +51 -46
  16. package/lib/src/ap-field/date/index.vue.js +1 -1
  17. package/lib/src/ap-field/number/helper.d.ts +9 -0
  18. package/lib/src/ap-field/number/helper.js +1 -1
  19. package/lib/src/ap-table/ap-table.vue.d.ts +2137 -112
  20. package/lib/src/ap-table/ap-table.vue.js +1 -1
  21. package/lib/src/check-card/style/index.css +1 -0
  22. package/lib/src/editable-table/form-item.vue.js +1 -1
  23. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  24. package/lib/src/editable-table/index.vue.js +1 -1
  25. package/lib/src/editable-table/utils.d.ts +13 -0
  26. package/lib/src/editable-table/utils.js +1 -1
  27. package/lib/src/theme/check-card/index.css +1 -0
  28. package/lib/src/work-order-modal/createWorkOrder.js +1 -1
  29. package/lib/src/work-order-modal/work-order-modal.vue.d.ts +2 -0
  30. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  31. package/package.json +3 -3
@@ -1,21 +1,22 @@
1
- import { defineComponent as ae, useSlots as te, computed as s, createVNode as d, mergeProps as f, unref as l, watch as oe, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as re, renderList as L, createBlock as le, resolveDynamicComponent as ne, renderSlot as x, createCommentVNode as E, createElementVNode as O, toDisplayString as se, normalizeProps as de, guardReactiveProps as ue } from "vue";
1
+ import { defineComponent as ae, useSlots as te, computed as s, createVNode as d, mergeProps as f, unref as l, watch as oe, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as re, renderList as L, createBlock as le, resolveDynamicComponent as ne, renderSlot as w, createCommentVNode as E, createElementVNode as O, toDisplayString as se, normalizeProps as de, guardReactiveProps as ue } from "vue";
2
2
  import { Typography as ie, Table as pe, Tooltip as ce } from "ant-design-vue";
3
3
  import { useToken as fe } from "ant-design-vue/es/theme/internal";
4
4
  import { ApForm as me } from "../ap-form/index.mjs";
5
- import { apTableRenderItemMap as ge, noRenderAsFormItemValueList as z, apTableFormItemMap as ye } from "./constants.mjs";
5
+ import { apTableRenderItemMap as ge, noRenderAsFormItemValueList as V, apTableFormItemMap as ye } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
7
  import { useTablePaging as be } from "./hooks/use-table-paging.mjs";
8
- import { omit as N, isUndefined as T, isBoolean as he } from "lodash-unified";
8
+ import { omit as z, isUndefined as x, isBoolean as he } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
10
  import { QuestionCircleOutlined as Ce } from "@ant-design/icons-vue";
11
- import { apColumnToColumn as Se, getTableRenderType as Fe, getTableRenderProps as Re, getColumnOrder as V, updateFormProps as xe, getFieldProps as Te, getPlaceholder as we } from "./utils.mjs";
11
+ import { apColumnToColumn as Se, getTableRenderType as Fe, getTableRenderProps as Re, getColumnOrder as N, updateFormProps as we, getFieldProps as xe, getPlaceholder as Te } from "./utils.mjs";
12
12
  import Be from "./hooks/use-table-content-height.mjs";
13
- import { useLocale as Pe } from "../config-provider/hooks/use-locale.mjs";
14
- import { useNamespace as ve } from "../config-provider/hooks/use-namespace.mjs";
15
- import { useGlobalConfig as Ie } from "../config-provider/hooks/use-global-config.mjs";
16
- const ke = {
13
+ import { getRawDisplayValue as Pe } from "../editable-table/utils.mjs";
14
+ import { useLocale as ve } from "../config-provider/hooks/use-locale.mjs";
15
+ import { useNamespace as Ie } from "../config-provider/hooks/use-namespace.mjs";
16
+ import { useGlobalConfig as ke } from "../config-provider/hooks/use-global-config.mjs";
17
+ const Le = {
17
18
  key: 0
18
- }, $e = /* @__PURE__ */ ae({
19
+ }, Qe = /* @__PURE__ */ ae({
19
20
  name: "ApTable",
20
21
  __name: "ap-table",
21
22
  props: {
@@ -132,19 +133,19 @@ const ke = {
132
133
  setup(D, {
133
134
  expose: W
134
135
  }) {
135
- const o = D, w = te(), [, j] = fe(), {
136
+ const o = D, T = te(), [, j] = fe(), {
136
137
  t: _
137
- } = Pe(), {
138
+ } = ve(), {
138
139
  e: g,
139
140
  b: u
140
- } = ve("ap-table"), A = Ie("uiMode", "aplus"), {
141
+ } = Ie("ap-table"), A = ke("uiMode", "aplus"), {
141
142
  height: M,
142
143
  contentRef: q
143
144
  } = Be(), y = s(() => {
144
145
  var t;
145
146
  let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
146
147
  return e = e.map((a) => ({
147
- ...N(Se(a), ["ellipsis"]),
148
+ ...z(Se(a), ["ellipsis"]),
148
149
  customRender({
149
150
  value: r,
150
151
  ...n
@@ -166,11 +167,11 @@ const ke = {
166
167
  })), e;
167
168
  }), B = s(() => {
168
169
  var e, t, a;
169
- return ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
170
- let C = V(r.order);
171
- return V(n.order) - C;
170
+ return ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !V.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
171
+ let C = N(r.order);
172
+ return N(n.order) - C;
172
173
  })) == null ? void 0 : a.map((r) => {
173
- const n = xe(r, Te(r.fieldProps, {}));
174
+ const n = we(r, xe(r.fieldProps, {}));
174
175
  return {
175
176
  ...r,
176
177
  fieldProps: {
@@ -178,7 +179,7 @@ const ke = {
178
179
  name: r.dataIndex,
179
180
  ...n || {},
180
181
  // 格式化placeholder
181
- placeholder: we(_, r.valueType, n == null ? void 0 : n.placeholder)
182
+ placeholder: Te(_, r.valueType, n == null ? void 0 : n.placeholder)
182
183
  }
183
184
  };
184
185
  })) || [];
@@ -221,7 +222,7 @@ const ke = {
221
222
  if ((e = o.columns) != null && e.some((t) => t.ellipsis))
222
223
  return "fixed";
223
224
  }), U = s(() => {
224
- const e = l(c), t = T(o.dataSource) ? e : {
225
+ const e = l(c), t = x(o.dataSource) ? e : {
225
226
  ...e,
226
227
  dataSource: o.dataSource,
227
228
  onChange: o.onChange
@@ -229,13 +230,13 @@ const ke = {
229
230
  return {
230
231
  ...o,
231
232
  ...t,
232
- loading: T(o.loading) ? l(c).loading : o.loading,
233
+ loading: x(o.loading) ? l(c).loading : o.loading,
233
234
  pagination: o.pagination === !1 ? !1 : l(c).pagination,
234
235
  scroll: l(G)
235
236
  };
236
237
  }), J = s(() => [u(), o.card ? null : u("wrapper"), o.adaptive ? u("adaptive") : null].filter(Boolean));
237
238
  function X(e, t, a) {
238
- return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ie.Paragraph, {
239
+ return V.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ie.Paragraph, {
239
240
  copyable: e.copyable ? {
240
241
  text: t,
241
242
  tooltip: !1
@@ -246,7 +247,7 @@ const ke = {
246
247
  ...e.ellipsis,
247
248
  tooltip: t
248
249
  } : !1,
249
- content: e.ellipsis ? t : a
250
+ content: e.ellipsis ? Pe(e, t) : a
250
251
  }, null) : a;
251
252
  }
252
253
  oe(() => l(h).loading, (e) => {
@@ -269,7 +270,7 @@ const ke = {
269
270
  dataSource: s(() => l(h).records)
270
271
  }), (e, t) => (i(), m("div", {
271
272
  class: F(J.value)
272
- }, [l(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), m("div", {
273
+ }, [l(x)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), m("div", {
273
274
  key: 0,
274
275
  class: F(e.card ? l(g)("search-wrapper") : null),
275
276
  style: R(e.searchFormWrapperStyle)
@@ -288,16 +289,16 @@ const ke = {
288
289
  span: a.span
289
290
  }), null, 16, ["span"]))), 128))]),
290
291
  _: 2
291
- }, [w.searchFormExtra ? {
292
+ }, [T.searchFormExtra ? {
292
293
  name: "extra",
293
- fn: p(() => [x(e.$slots, "searchFormExtra")]),
294
+ fn: p(() => [w(e.$slots, "searchFormExtra")]),
294
295
  key: "0"
295
296
  } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : E("", !0), O("div", {
296
297
  ref_key: "contentRef",
297
298
  ref: q,
298
299
  class: F([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
299
300
  style: R(e.tableWrapperStyle)
300
- }, [x(e.$slots, "title"), d(l(pe), f({
301
+ }, [w(e.$slots, "title"), d(l(pe), f({
301
302
  class: l(A) === "admin" ? l(u)("table-admin") : l(u)("table")
302
303
  }, U.value, {
303
304
  "table-layout": Q.value,
@@ -307,7 +308,7 @@ const ke = {
307
308
  headerCell: p(({
308
309
  column: a,
309
310
  title: r
310
- }) => [a.tooltip ? (i(), m("span", ke, [O("span", null, se(r), 1), d(l(ce), {
311
+ }) => [a.tooltip ? (i(), m("span", Le, [O("span", null, se(r), 1), d(l(ce), {
311
312
  title: a.tooltip,
312
313
  placement: "bottom"
313
314
  }, {
@@ -320,12 +321,12 @@ const ke = {
320
321
  _: 2
321
322
  }, 1032, ["title"])])) : E("", !0)]),
322
323
  _: 2
323
- }, [L(l(N)(w, ["title", "searchFormExtra"]), (a, r) => ({
324
+ }, [L(l(z)(T, ["title", "searchFormExtra"]), (a, r) => ({
324
325
  name: r,
325
- fn: p((n) => [x(e.$slots, r, de(ue(n || {})))])
326
+ fn: p((n) => [w(e.$slots, r, de(ue(n || {})))])
326
327
  }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
327
328
  }
328
329
  });
329
330
  export {
330
- $e as default
331
+ Qe as default
331
332
  };
@@ -102,6 +102,7 @@
102
102
  top: 0;
103
103
  right: 0;
104
104
  z-index: 1;
105
+ line-height: 1;
105
106
  -webkit-user-select: none;
106
107
  -moz-user-select: none;
107
108
  user-select: none;
@@ -1,15 +1,16 @@
1
- import { defineComponent as V, ref as A, unref as o, useSlots as O, watch as T, openBlock as C, createBlock as K, mergeProps as w, withCtx as u, createVNode as M, createSlots as q, createElementBlock as G, Fragment as H, createElementVNode as b, normalizeClass as W, toDisplayString as U, createCommentVNode as $, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
1
+ import { defineComponent as V, ref as A, unref as o, useSlots as O, watch as T, openBlock as C, createBlock as K, mergeProps as w, withCtx as i, createVNode as M, createSlots as q, createElementBlock as G, Fragment as H, createElementVNode as b, normalizeClass as W, toDisplayString as U, createCommentVNode as $, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
2
  import { Table as Z } from "ant-design-vue";
3
3
  import { ApForm as y } from "../ap-form/index.mjs";
4
- import { isNumber as p, cloneDeep as m, omit as I } from "lodash-unified";
4
+ import { isNumber as m, cloneDeep as p, omit as I } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
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";
8
+ import { isDef as c } from "../utils/index.mjs";
9
9
  import te from "./hooks/use-get-columns.mjs";
10
+ import { getColumnIsRequired as oe } from "./utils.mjs";
10
11
  import { useNamespace as ae } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as oe } from "../config-provider/hooks/use-global-config.mjs";
12
- const he = /* @__PURE__ */ V({
12
+ import { useGlobalConfig as le } from "../config-provider/hooks/use-global-config.mjs";
13
+ const xe = /* @__PURE__ */ V({
13
14
  name: "EditableTableInner",
14
15
  __name: "form-item",
15
16
  props: {
@@ -113,94 +114,91 @@ const he = /* @__PURE__ */ V({
113
114
  expose: B
114
115
  }) {
115
116
  var h;
116
- const r = R, {
117
+ const l = R, {
117
118
  formInstance: t,
118
119
  model: D
119
- } = ee(), s = A(((h = o(D)) == null ? void 0 : h[r.name]) || []), F = O(), E = y.useWatch(r.name);
120
+ } = ee(), d = A(((h = o(D)) == null ? void 0 : h[l.name]) || []), F = O(), E = y.useWatch(l.name);
120
121
  T(() => E.value, (e) => {
121
- var l;
122
- s.value = e, (l = r.onChange) == null || l.call(r, e);
122
+ var a;
123
+ d.value = e, (a = l.onChange) == null || a.call(l, e);
123
124
  });
124
125
  const {
125
- b: c,
126
+ b: f,
126
127
  em: L
127
- } = ae("editable-table"), v = oe("uiMode", "aplus"), N = te(r);
128
- function S(e, l) {
129
- var d, i;
130
- const a = ((d = o(s)) == null ? void 0 : d.length) || 0;
131
- if (f(r.maxLength) && a >= r.maxLength)
128
+ } = ae("editable-table"), v = le("uiMode", "aplus"), N = te(l);
129
+ function S(e, a) {
130
+ var u, s;
131
+ const n = ((u = o(d)) == null ? void 0 : u.length) || 0;
132
+ if (c(l.maxLength) && n >= l.maxLength)
132
133
  return;
133
- const n = [...o(s) || []];
134
- f(l) ? n.splice(l, 0, {
134
+ const r = [...o(d) || []];
135
+ c(a) ? r.splice(a, 0, {
135
136
  ...e || {}
136
- }) : n.push({
137
+ }) : r.push({
137
138
  ...e || {}
138
- }), (i = t == null ? void 0 : t.setFieldValue) == null || i.call(t, r.name, [...o(s) || [], e || {}]);
139
+ }), (s = t == null ? void 0 : t.setFieldValue) == null || s.call(t, l.name, [...o(d) || [], e || {}]);
139
140
  }
140
- function k(e, l = "suffix") {
141
+ function k(e, a = "suffix") {
141
142
  var g, x;
142
- const a = ((g = o(s)) == null ? void 0 : g.length) || 0, n = p(e) ? e : e.length;
143
- if (f(r.maxLength) && a + n > r.maxLength)
143
+ const n = ((g = o(d)) == null ? void 0 : g.length) || 0, r = m(e) ? e : e.length;
144
+ if (c(l.maxLength) && n + r > l.maxLength)
144
145
  return;
145
- const d = [...o(s) || []], i = p(e) ? new Array(e).fill({}) : m(e);
146
- l === "suffix" ? d.push(...i) : d.unshift(...i), (x = t == null ? void 0 : t.setFieldValue) == null || x.call(t, r.name, d);
146
+ const u = [...o(d) || []], s = m(e) ? new Array(e).fill({}) : p(e);
147
+ a === "suffix" ? u.push(...s) : u.unshift(...s), (x = t == null ? void 0 : t.setFieldValue) == null || x.call(t, l.name, u);
147
148
  }
148
- function P(e) {
149
- var n;
150
- let l = m(o(s) || []);
151
- const a = p(e) ? [e] : e;
152
- l = l.filter((d, i) => !a.includes(i)), (n = t == null ? void 0 : t.setFieldValue) == null || n.call(t, r.name, l);
149
+ function _(e) {
150
+ var r;
151
+ let a = p(o(d) || []);
152
+ const n = m(e) ? [e] : e;
153
+ a = a.filter((u, s) => !n.includes(s)), (r = t == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, a);
153
154
  }
154
- function _() {
155
- return o(s);
155
+ function j() {
156
+ return o(d);
156
157
  }
157
- function j(e) {
158
- var l;
159
- return (l = o(s)) == null ? void 0 : l[e];
158
+ function z(e) {
159
+ var a;
160
+ return (a = o(d)) == null ? void 0 : a[e];
160
161
  }
161
- function z(e, l) {
162
- var n;
163
- const a = m(o(s));
164
- a[e] && (a[e] = {
165
- ...a[e],
166
- ...l
167
- }, (n = t == null ? void 0 : t.setFieldValue) == null || n.call(t, r.name, [...a]));
162
+ function P(e, a) {
163
+ var r;
164
+ const n = p(o(d));
165
+ n[e] && (n[e] = {
166
+ ...n[e],
167
+ ...a
168
+ }, (r = t == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, [...n]));
168
169
  }
169
170
  return B({
170
171
  add: S,
171
- remove: P,
172
- getRowData: j,
173
- getRowsData: _,
174
- setRowData: z,
172
+ remove: _,
173
+ getRowData: z,
174
+ getRowsData: j,
175
+ setRowData: P,
175
176
  addMultiple: k
176
- }), (e, l) => (C(), K(o(y).FormItem, w(e.formItem, {
177
+ }), (e, a) => (C(), K(o(y).FormItem, w(e.formItem, {
177
178
  name: e.name,
178
179
  label: e.label
179
180
  }), {
180
- default: u(() => [M(o(Z), w(o(I)(r, ["name", "maxLength"]), {
181
- class: [o(c)(), o(v) === "admin" ? o(c)("admin") : null],
181
+ default: i(() => [M(o(Z), w(o(I)(l, ["name", "maxLength"]), {
182
+ class: [o(f)(), o(v) === "admin" ? o(f)("admin") : null],
182
183
  columns: o(N),
183
- "data-source": s.value
184
+ "data-source": d.value
184
185
  }), q({
185
- headerCell: u(({
186
- column: a
187
- }) => {
188
- var n, d, i;
189
- return [(n = a == null ? void 0 : a.fieldProps) != null && n.required || (i = (d = a == null ? void 0 : a.fieldProps) == null ? void 0 : d.rules) != null && i.length ? (C(), G(H, {
190
- key: 0
191
- }, [b("span", {
192
- class: W(o(L)("header-cell", "required"))
193
- }, "*", 2), b("span", null, U(a.title), 1)], 64)) : $("", !0)];
194
- }),
186
+ headerCell: i(({
187
+ column: n
188
+ }) => [o(oe)(n) ? (C(), G(H, {
189
+ key: 0
190
+ }, [b("span", {
191
+ class: W(o(L)("header-cell", "required"))
192
+ }, "*", 2), b("span", null, U(n.title), 1)], 64)) : $("", !0)]),
195
193
  _: 2
196
- }, [J(F, (a, n) => ({
197
- name: n,
198
- fn: u((d) => [Q(e.$slots, n, X(Y(d || {})))])
194
+ }, [J(F, (n, r) => ({
195
+ name: r,
196
+ fn: i((u) => [Q(e.$slots, r, X(Y(u || {})))])
199
197
  }))]), 1040, ["class", "columns", "data-source"])]),
200
198
  _: 3
201
199
  }, 16, ["name", "label"]));
202
200
  }
203
201
  });
204
202
  export {
205
- he as default
203
+ xe as default
206
204
  };
@@ -1,17 +1,17 @@
1
- import { computed as y, createVNode as i, mergeProps as x } from "vue";
2
- import { omit as h, isFunction as C, isBoolean as F } from "lodash-unified";
3
- import { getEditableComponent as R } from "../utils.mjs";
4
- import { updateFormProps as T, getFieldProps as I, getPlaceholder as N, getTableRenderProps as L } from "../../ap-table/utils.mjs";
1
+ import { computed as b, createVNode as i, mergeProps as x } from "vue";
2
+ import { omit as h, isFunction as C, isBoolean as R } from "lodash-unified";
3
+ import { getEditableComponent as F, getRawDisplayValue as T } from "../utils.mjs";
4
+ import { updateFormProps as I, getFieldProps as N, getPlaceholder as V, getTableRenderProps as w } from "../../ap-table/utils.mjs";
5
5
  import "../../config-provider/index.mjs";
6
- import { apTableRenderItemMap as M, noRenderAsFormItemValueList as V } from "../../ap-table/constants.mjs";
7
- import { Typography as w } from "ant-design-vue";
8
- import { useLocale as A } from "../../config-provider/hooks/use-locale.mjs";
6
+ import { apTableRenderItemMap as L, noRenderAsFormItemValueList as M } from "../../ap-table/constants.mjs";
7
+ import { Typography as A } from "ant-design-vue";
8
+ import { useLocale as B } from "../../config-provider/hooks/use-locale.mjs";
9
9
  const q = (t) => {
10
10
  const {
11
11
  t: u
12
- } = A(), f = y(() => {
13
- let o = t.columns;
14
- return o ? (o = o.map((e) => ({
12
+ } = B(), f = b(() => {
13
+ let l = t.columns;
14
+ return l ? (l = l.map((e) => ({
15
15
  ...h(e, ["ellipsis"]),
16
16
  customRender({
17
17
  value: n,
@@ -20,32 +20,32 @@ const q = (t) => {
20
20
  const c = C(e.editable) ? e.editable(a.text, a.record, a.index) : !!e.editable;
21
21
  let r;
22
22
  if (c) {
23
- const d = R(e.valueType), l = T(e, I(e.fieldProps, {
23
+ const d = F(e.valueType), o = I(e, N(e.fieldProps, {
24
24
  value: n,
25
25
  ...a
26
26
  })), s = {};
27
- t.onFieldChange && (s[`onUpdate:${l.valuePropName || "value"}`] = (g) => {
27
+ t.onFieldChange && (s[`onUpdate:${o.valuePropName || "value"}`] = (y) => {
28
28
  var p;
29
- return (p = t.onFieldChange) == null ? void 0 : p.call(t, a.index, e.dataIndex, g);
29
+ return (p = t.onFieldChange) == null ? void 0 : p.call(t, a.index, e.dataIndex, y);
30
30
  });
31
- const b = {
31
+ const g = {
32
32
  name: [t.name, a.index, e.dataIndex],
33
- ...l || {},
33
+ ...o || {},
34
34
  // 格式化placeholder
35
- placeholder: N(u, e.valueType, l == null ? void 0 : l.placeholder),
35
+ placeholder: V(u, e.valueType, o == null ? void 0 : o.placeholder),
36
36
  field: {
37
37
  style: "width: 100%",
38
- ...(l == null ? void 0 : l.field) || {},
38
+ ...(o == null ? void 0 : o.field) || {},
39
39
  ...s
40
40
  }
41
41
  };
42
- r = i(d, b, null);
42
+ r = i(d, g, null);
43
43
  } else {
44
- const d = M[e.valueType], l = L(e, {
44
+ const d = L[e.valueType], o = w(e, {
45
45
  value: n,
46
46
  ...a
47
47
  });
48
- r = m(e, n, i(d, x(l, {
48
+ r = m(e, n, i(d, x(o, {
49
49
  mode: "read"
50
50
  }), null));
51
51
  }
@@ -56,21 +56,21 @@ const q = (t) => {
56
56
  originalNode: r
57
57
  }) : r;
58
58
  }
59
- })), o) : [];
59
+ })), l) : [];
60
60
  });
61
- function m(o, e, n) {
62
- return V.includes(o.valueType) ? n : o.copyable || o.ellipsis ? i(w.Paragraph, {
63
- copyable: o.copyable ? {
61
+ function m(l, e, n) {
62
+ return M.includes(l.valueType) ? n : l.copyable || l.ellipsis ? i(A.Paragraph, {
63
+ copyable: l.copyable ? {
64
64
  text: e,
65
65
  tooltip: !1
66
66
  } : !1,
67
- ellipsis: o.ellipsis ? F(o.ellipsis) ? {
67
+ ellipsis: l.ellipsis ? R(l.ellipsis) ? {
68
68
  tooltip: e
69
69
  } : {
70
- ...o.ellipsis,
70
+ ...l.ellipsis,
71
71
  tooltip: e
72
72
  } : !1,
73
- content: o.ellipsis ? e : n
73
+ content: l.ellipsis ? T(l, e) : n
74
74
  }, null) : n;
75
75
  }
76
76
  return f;
@@ -1,16 +1,17 @@
1
- import { defineComponent as I, useSlots as K, ref as M, watch as q, unref as o, openBlock as w, createBlock as G, withCtx as f, 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";
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
2
  import { Table as ae } from "ant-design-vue";
3
- import { ApForm as p } from "../ap-form/index.mjs";
4
- import { isNumber as c, cloneDeep as h, omit as ne } from "lodash-unified";
3
+ import { ApForm as f } from "../ap-form/index.mjs";
4
+ import { isNumber as p, cloneDeep as x, omit as ne } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
6
  import "../hooks/index.mjs";
7
- import { isDef as x } from "../utils/index.mjs";
8
- import oe from "./hooks/use-get-columns.mjs";
7
+ import { isDef as h } from "../utils/index.mjs";
8
+ import { getColumnIsRequired as oe } from "./utils.mjs";
9
+ import le from "./hooks/use-get-columns.mjs";
9
10
  import "./style/index.css";
10
- import { useNamespace as le } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as re } from "../config-provider/hooks/use-global-config.mjs";
12
- import { useControllableValue as se } from "../hooks/useControllableValue.mjs";
13
- const ye = /* @__PURE__ */ I({
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({
14
15
  name: "EditableTable",
15
16
  __name: "index",
16
17
  props: {
@@ -116,104 +117,101 @@ const ye = /* @__PURE__ */ I({
116
117
  const l = b, {
117
118
  b: g,
118
119
  em: F
119
- } = le("editable-table"), D = re("uiMode", "aplus"), _ = K(), E = B, {
120
- value: d,
120
+ } = re("editable-table"), D = se("uiMode", "aplus"), _ = K(), E = B, {
121
+ value: s,
121
122
  updateValue: L
122
- } = se(l, E), i = M(), k = p.useWatch(l.name, i);
123
+ } = ue(l, E), u = M(), k = f.useWatch(l.name, u);
123
124
  q(() => k.value, (e) => {
124
125
  var n;
125
126
  L(e), (n = l.onChange) == null || n.call(l, e);
126
127
  });
127
- const N = oe(l);
128
+ const N = le(l);
128
129
  function S() {
129
130
  var e;
130
- (e = i.value) == null || e.resetFields();
131
+ (e = u.value) == null || e.resetFields();
131
132
  }
132
133
  async function V(e, n) {
133
134
  var t;
134
- const a = await ((t = i.value) == null ? void 0 : t.validateFields(e, n));
135
- return a == null ? void 0 : a[l.name];
135
+ const o = await ((t = u.value) == null ? void 0 : t.validateFields(e, n));
136
+ return o == null ? void 0 : o[l.name];
136
137
  }
137
- function P(e, n) {
138
- var r, s, u;
139
- const a = ((r = o(d)) == null ? void 0 : r.length) || 0;
140
- if (x(l.maxLength) && a >= l.maxLength)
138
+ function z(e, n) {
139
+ var r, d, i;
140
+ const o = ((r = a(s)) == null ? void 0 : r.length) || 0;
141
+ if (h(l.maxLength) && o >= l.maxLength)
141
142
  return;
142
- const t = [...o(d) || []];
143
- x(n) ? t.splice(n, 0, {
143
+ const t = [...a(s) || []];
144
+ h(n) ? t.splice(n, 0, {
144
145
  ...e || {}
145
146
  }) : t.push({
146
147
  ...e || {}
147
- }), (u = (s = i.value) == null ? void 0 : s.setFieldValue) == null || u.call(s, l.name, t);
148
+ }), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, l.name, t);
148
149
  }
149
- function z(e, n = "suffix") {
150
- var u, m, C;
151
- const a = ((u = o(d)) == null ? void 0 : u.length) || 0, t = c(e) ? e : e.length;
152
- if (x(l.maxLength) && a + t > l.maxLength)
150
+ function P(e, n = "suffix") {
151
+ var i, m, C;
152
+ const o = ((i = a(s)) == null ? void 0 : i.length) || 0, t = p(e) ? e : e.length;
153
+ if (h(l.maxLength) && o + t > l.maxLength)
153
154
  return;
154
- const r = [...o(d) || []], s = c(e) ? new Array(e).fill({}) : h(e);
155
- n === "suffix" ? r.push(...s) : r.unshift(...s), (C = (m = i.value) == null ? void 0 : m.setFieldValue) == null || C.call(m, l.name, r);
155
+ const r = [...a(s) || []], d = p(e) ? new Array(e).fill({}) : x(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);
156
157
  }
157
158
  function j(e) {
158
159
  var t, r;
159
- let n = h(o(d) || []);
160
- const a = c(e) ? [e] : e;
161
- n = n.filter((s, u) => !a.includes(u)), (r = (t = i.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, n);
160
+ let n = x(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);
162
163
  }
163
164
  function A() {
164
- return o(d);
165
+ return a(s);
165
166
  }
166
- function O(e) {
167
+ function I(e) {
167
168
  var n;
168
- return (n = o(d)) == null ? void 0 : n[e];
169
+ return (n = a(s)) == null ? void 0 : n[e];
169
170
  }
170
- function T(e, n) {
171
+ function O(e, n) {
171
172
  var t, r;
172
- const a = h(o(d));
173
- a[e] && (a[e] = {
174
- ...a[e],
173
+ const o = x(a(s));
174
+ o[e] && (o[e] = {
175
+ ...o[e],
175
176
  ...n
176
- }, (r = (t = i.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, [...a]));
177
+ }, (r = (t = u.value) == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, [...o]));
177
178
  }
178
179
  return R({
179
180
  resetFields: S,
180
181
  validateFields: V,
181
- add: P,
182
+ add: z,
182
183
  remove: j,
183
- getRowData: O,
184
+ getRowData: I,
184
185
  getRowsData: A,
185
- setRowData: T,
186
- addMultiple: z
187
- }), (e, n) => (w(), G(o(p), {
186
+ setRowData: O,
187
+ addMultiple: P
188
+ }), (e, n) => (w(), G(a(f), {
188
189
  "initial-values": {
189
- [l.name]: o(d)
190
+ [l.name]: a(s)
190
191
  },
191
192
  ref_key: "formRef",
192
- ref: i
193
+ ref: u
193
194
  }, {
194
- default: f(() => [y(o(p).FormItem, {
195
+ default: c(() => [y(a(f).FormItem, {
195
196
  name: e.name,
196
197
  "no-style": ""
197
198
  }, {
198
- default: f(() => [y(o(ae), H(o(ne)(l, ["name", "value", "onUpdate:value", "maxLength"]), {
199
- class: [o(g)(), o(D) === "admin" ? o(g)("admin") : null],
200
- columns: o(N),
201
- "data-source": o(d)
199
+ default: c(() => [y(a(ae), H(a(ne)(l, ["name", "value", "onUpdate:value", "maxLength"]), {
200
+ class: [a(g)(), a(D) === "admin" ? a(g)("admin") : null],
201
+ columns: a(N),
202
+ "data-source": a(s)
202
203
  }), U({
203
- headerCell: f(({
204
- column: a
205
- }) => {
206
- var t, r, s;
207
- return [(t = a == null ? void 0 : a.fieldProps) != null && t.required || (s = (r = a == null ? void 0 : a.fieldProps) == null ? void 0 : r.rules) != null && s.length ? (w(), W($, {
208
- key: 0
209
- }, [v("span", {
210
- class: J(o(F)("header-cell", "required"))
211
- }, "*", 2), v("span", null, Q(a.title), 1)], 64)) : X("", !0)];
212
- }),
204
+ headerCell: c(({
205
+ column: o
206
+ }) => [a(oe)(o) ? (w(), W($, {
207
+ 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)]),
213
211
  _: 2
214
- }, [Y(_, (a, t) => ({
212
+ }, [Y(_, (o, t) => ({
215
213
  name: t,
216
- fn: f((r) => [Z(e.$slots, t, ee(te(r || {})))])
214
+ fn: c((r) => [Z(e.$slots, t, ee(te(r || {})))])
217
215
  }))]), 1040, ["class", "columns", "data-source"])]),
218
216
  _: 3
219
217
  }, 8, ["name"])]),
@@ -222,5 +220,5 @@ const ye = /* @__PURE__ */ I({
222
220
  }
223
221
  });
224
222
  export {
225
- ye as default
223
+ be as default
226
224
  };