@aplus-frontend/ui 0.1.28 → 0.1.30

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 (79) hide show
  1. package/es/index.mjs +78 -76
  2. package/es/src/ap-field/date-range/index.vue.mjs +154 -109
  3. package/es/src/ap-field/interface.d.ts +4 -0
  4. package/es/src/ap-field/select/index.vue.mjs +4 -2
  5. package/es/src/ap-form/ap-form.vue.d.ts +1 -1
  6. package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
  7. package/es/src/ap-form/search-form/index.vue.d.ts +2 -2
  8. package/es/src/ap-form/style/ap-form-item.css +2 -0
  9. package/es/src/ap-table/ap-table.vue.mjs +1 -1
  10. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -97
  11. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +37 -33
  12. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +5 -6
  13. package/es/src/ap-table/components/setting/utils.d.ts +7 -1
  14. package/es/src/ap-table/components/setting/utils.mjs +37 -22
  15. package/es/src/ap-table/constants.d.ts +12 -0
  16. package/es/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
  17. package/es/src/ap-table/hooks/use-table-column-state.mjs +101 -33
  18. package/es/src/ap-table/interface.d.ts +8 -1
  19. package/es/src/ap-table/utils.mjs +42 -42
  20. package/es/src/business/ap-action-button/ApActionButton.vue.d.ts +43 -0
  21. package/es/src/business/ap-action-button/ApActionButton.vue.mjs +4 -0
  22. package/es/src/business/ap-action-button/ApActionButton.vue2.mjs +97 -0
  23. package/es/src/business/ap-action-button/index.css +6 -0
  24. package/es/src/business/ap-action-button/interface.d.ts +6 -0
  25. package/es/src/business/ap-action-button/interface.mjs +1 -0
  26. package/es/src/business/index.d.ts +265 -0
  27. package/es/src/business/index.mjs +25 -21
  28. package/es/src/editable-table/form-item.vue.d.ts +2 -1
  29. package/es/src/editable-table/form-item.vue.mjs +69 -65
  30. package/es/src/editable-table/index.vue.d.ts +2 -1
  31. package/es/src/editable-table/index.vue.mjs +84 -79
  32. package/es/src/editable-table/interface.d.ts +6 -0
  33. package/es/src/index.mjs +209 -207
  34. package/es/src/theme/ap-action-button/ap-action-button.css +6 -0
  35. package/es/src/theme/ap-form/ap-form-item.css +2 -0
  36. package/es/src/work-order-modal/index.mjs +4 -3
  37. package/es/src/work-order-modal/interfaces.d.ts +3 -0
  38. package/es/src/work-order-modal/interfaces.mjs +6 -1
  39. package/es/src/work-order-modal/work-order-modal.vue.mjs +28 -28
  40. package/lib/index.js +1 -1
  41. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  42. package/lib/src/ap-field/interface.d.ts +4 -0
  43. package/lib/src/ap-field/select/index.vue.js +1 -1
  44. package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
  45. package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
  46. package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
  47. package/lib/src/ap-form/style/ap-form-item.css +2 -0
  48. package/lib/src/ap-table/ap-table.vue.js +1 -1
  49. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  50. package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
  51. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
  52. package/lib/src/ap-table/components/setting/utils.d.ts +7 -1
  53. package/lib/src/ap-table/components/setting/utils.js +1 -1
  54. package/lib/src/ap-table/constants.d.ts +12 -0
  55. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
  56. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  57. package/lib/src/ap-table/interface.d.ts +8 -1
  58. package/lib/src/ap-table/utils.js +1 -1
  59. package/lib/src/business/ap-action-button/ApActionButton.vue.d.ts +43 -0
  60. package/lib/src/business/ap-action-button/ApActionButton.vue.js +1 -0
  61. package/lib/src/business/ap-action-button/ApActionButton.vue2.js +1 -0
  62. package/lib/src/business/ap-action-button/index.css +6 -0
  63. package/lib/src/business/ap-action-button/interface.d.ts +6 -0
  64. package/lib/src/business/ap-action-button/interface.js +1 -0
  65. package/lib/src/business/index.d.ts +265 -0
  66. package/lib/src/business/index.js +1 -1
  67. package/lib/src/editable-table/form-item.vue.d.ts +2 -1
  68. package/lib/src/editable-table/form-item.vue.js +1 -1
  69. package/lib/src/editable-table/index.vue.d.ts +2 -1
  70. package/lib/src/editable-table/index.vue.js +1 -1
  71. package/lib/src/editable-table/interface.d.ts +6 -0
  72. package/lib/src/index.js +1 -1
  73. package/lib/src/theme/ap-action-button/ap-action-button.css +6 -0
  74. package/lib/src/theme/ap-form/ap-form-item.css +2 -0
  75. package/lib/src/work-order-modal/index.js +1 -1
  76. package/lib/src/work-order-modal/interfaces.d.ts +3 -0
  77. package/lib/src/work-order-modal/interfaces.js +1 -1
  78. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  79. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import { defineComponent as Q, useSlots as J, ref as b, watch as R, unref as n, openBlock as p, createBlock as B, withCtx as m, createVNode as x, mergeProps as X, createSlots as Y, createElementBlock as Z, normalizeClass as ee, createCommentVNode as F, createElementVNode as te, toDisplayString as ae, normalizeStyle as oe, renderList as ne, renderSlot as le, normalizeProps as re, guardReactiveProps as se } from "vue";
2
- import { Table as ue, Tooltip as ie } from "ant-design-vue";
1
+ import { defineComponent as J, useSlots as X, ref as b, watch as R, unref as o, openBlock as p, createBlock as F, withCtx as m, createVNode as x, mergeProps as Y, createSlots as Z, createElementBlock as ee, normalizeClass as te, createCommentVNode as B, createElementVNode as ae, toDisplayString as ne, normalizeStyle as oe, renderList as le, renderSlot as re, normalizeProps as ue, guardReactiveProps as se } from "vue";
2
+ import { Table as ie, Tooltip as de } from "ant-design-vue";
3
3
  import { ApForm as y } from "../ap-form/index.mjs";
4
- import { isEqual as de, isArray as k, isNumber as g, cloneDeep as h, omit as me } from "lodash-unified";
4
+ import { isEqual as me, isArray as k, isNumber as g, cloneDeep as h, omit as fe } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
6
  import "../hooks/index.mjs";
7
7
  import { isDef as C } from "../utils/index.mjs";
8
- import { scrollToRowIndex as fe, getColumnIsRequired as ce } from "./utils.mjs";
9
- import pe from "./hooks/use-get-columns.mjs";
8
+ import { scrollToRowIndex as ce, getColumnIsRequired as pe } from "./utils.mjs";
9
+ import xe from "./hooks/use-get-columns.mjs";
10
10
  import "./style/index.css";
11
- import { useToken as xe } from "ant-design-vue/es/theme/internal";
12
- import { QuestionCircleOutlined as ye } from "@ant-design/icons-vue";
13
- import { useNamespace as ge } from "../config-provider/hooks/use-namespace.mjs";
14
- import { useControllableValue as he } from "../hooks/useControllableValue.mjs";
15
- import { useGlobalConfig as Ce } from "../config-provider/hooks/use-global-config.mjs";
16
- const Ae = /* @__PURE__ */ Q({
11
+ import { useToken as ye } from "ant-design-vue/es/theme/internal";
12
+ import { QuestionCircleOutlined as ge } from "@ant-design/icons-vue";
13
+ import { useNamespace as he } from "../config-provider/hooks/use-namespace.mjs";
14
+ import { useControllableValue as Ce } from "../hooks/useControllableValue.mjs";
15
+ import { useGlobalConfig as ve } from "../config-provider/hooks/use-global-config.mjs";
16
+ const ze = /* @__PURE__ */ J({
17
17
  name: "EditableTable",
18
18
  __name: "index",
19
19
  props: {
@@ -113,141 +113,146 @@ const Ae = /* @__PURE__ */ Q({
113
113
  },
114
114
  emits: ["update:value"],
115
115
  setup(V, {
116
- expose: E,
117
- emit: L
116
+ expose: T,
117
+ emit: D
118
118
  }) {
119
119
  const l = V, {
120
- b: N,
121
- em: T
122
- } = ge("editable-table"), _ = J(), D = L, v = b(), {
123
- value: s,
120
+ b: E,
121
+ em: L
122
+ } = he("editable-table"), N = X(), _ = D, v = b(), {
123
+ value: u,
124
124
  updateValue: S
125
- } = he(l, D), u = b(), [, A] = xe(), z = Ce("valueTypeMap"), c = y.useWatch(l.name, u);
125
+ } = Ce(l, _), s = b(), [, A] = ye(), z = ve("valueTypeMap"), c = y.useWatch(l.name, s);
126
126
  R(() => c.value, (e) => {
127
127
  var t;
128
128
  S(e), (t = l.onChange) == null || t.call(l, e);
129
129
  }, {
130
130
  deep: !0
131
- }), R(s, (e) => {
131
+ }), R(u, (e) => {
132
132
  var t;
133
- e !== n(c) && (de(e, n(c)) || (t = u.value) == null || t.setFieldValue(l.name, e));
133
+ e !== o(c) && (me(e, o(c)) || (t = s.value) == null || t.setFieldValue(l.name, e));
134
134
  }, {
135
135
  deep: !0
136
136
  });
137
- const P = pe(l, z);
137
+ const P = xe(l, z);
138
138
  function I() {
139
139
  var e;
140
- (e = u.value) == null || e.resetFields();
140
+ (e = s.value) == null || e.resetFields();
141
141
  }
142
142
  function O(e) {
143
- return e ? (k(e) ? e : [e]).map((a) => k(a) ? [l.name, ...a] : [l.name, a]) : void 0;
143
+ return e ? (k(e) ? e : [e]).map((n) => k(n) ? [l.name, ...n] : [l.name, n]) : void 0;
144
144
  }
145
145
  async function j(e, t) {
146
- var o;
147
- const a = await ((o = u.value) == null ? void 0 : o.validateFields(O(e), t));
148
- return a == null ? void 0 : a[l.name];
146
+ var a;
147
+ const n = await ((a = s.value) == null ? void 0 : a.validateFields(O(e), t));
148
+ return n == null ? void 0 : n[l.name];
149
149
  }
150
150
  function q(e, t) {
151
151
  var r, i, d;
152
- const a = ((r = n(s)) == null ? void 0 : r.length) || 0;
153
- if (C(l.maxLength) && a >= l.maxLength)
152
+ const n = ((r = o(u)) == null ? void 0 : r.length) || 0;
153
+ if (C(l.maxLength) && n >= l.maxLength)
154
154
  return;
155
- const o = [...n(s) || []];
156
- C(t) ? o.splice(t, 0, {
155
+ const a = [...o(u) || []];
156
+ C(t) ? a.splice(t, 0, {
157
157
  ...e || {}
158
- }) : o.push({
158
+ }) : a.push({
159
159
  ...e || {}
160
- }), (d = (i = u.value) == null ? void 0 : i.setFieldValue) == null || d.call(i, l.name, o);
160
+ }), (d = (i = s.value) == null ? void 0 : i.setFieldValue) == null || d.call(i, l.name, a);
161
161
  }
162
162
  function K(e, t = "suffix") {
163
163
  var d, f, w;
164
- const a = ((d = n(s)) == null ? void 0 : d.length) || 0, o = g(e) ? e : e.length;
165
- if (C(l.maxLength) && a + o > l.maxLength)
164
+ const n = ((d = o(u)) == null ? void 0 : d.length) || 0, a = g(e) ? e : e.length;
165
+ if (C(l.maxLength) && n + a > l.maxLength)
166
166
  return;
167
- const r = [...n(s) || []], i = g(e) ? new Array(e).fill({}) : h(e);
168
- t === "suffix" ? r.push(...i) : r.unshift(...i), (w = (f = u.value) == null ? void 0 : f.setFieldValue) == null || w.call(f, l.name, r);
167
+ const r = [...o(u) || []], i = g(e) ? new Array(e).fill({}) : h(e);
168
+ t === "suffix" ? r.push(...i) : r.unshift(...i), (w = (f = s.value) == null ? void 0 : f.setFieldValue) == null || w.call(f, l.name, r);
169
169
  }
170
170
  function M(e) {
171
- var o, r;
172
- let t = h(n(s) || []);
173
- const a = g(e) ? [e] : e;
174
- t = t.filter((i, d) => !a.includes(d)), (r = (o = u.value) == null ? void 0 : o.setFieldValue) == null || r.call(o, l.name, t);
171
+ var a, r;
172
+ let t = h(o(u) || []);
173
+ const n = g(e) ? [e] : e;
174
+ t = t.filter((i, d) => !n.includes(d)), (r = (a = s.value) == null ? void 0 : a.setFieldValue) == null || r.call(a, l.name, t);
175
175
  }
176
176
  function G() {
177
- return n(s);
177
+ return o(u);
178
178
  }
179
179
  function H(e) {
180
180
  var t;
181
- return (t = n(s)) == null ? void 0 : t[e];
181
+ (t = s.value) == null || t.setFieldValue(l.name, e);
182
182
  }
183
- function U(e, t) {
184
- var o, r;
185
- const a = h(n(s));
183
+ function U(e) {
184
+ var t;
185
+ return (t = o(u)) == null ? void 0 : t[e];
186
+ }
187
+ function W(e, t, n = !0) {
188
+ var r, i;
189
+ const a = h(o(u));
186
190
  a[e] && (a[e] = {
187
- ...a[e],
191
+ ...n ? a[e] : {},
188
192
  ...t
189
- }, (r = (o = u.value) == null ? void 0 : o.setFieldValue) == null || r.call(o, l.name, [...a]));
193
+ }, (i = (r = s.value) == null ? void 0 : r.setFieldValue) == null || i.call(r, l.name, [...a]));
190
194
  }
191
- function W(e, t) {
192
- var o;
193
- const a = e === "end" ? s.value.length - 1 : e;
194
- fe(a, (o = v.value) == null ? void 0 : o.$el, t);
195
+ function $(e, t) {
196
+ var a;
197
+ const n = e === "end" ? u.value.length - 1 : e;
198
+ ce(n, (a = v.value) == null ? void 0 : a.$el, t);
195
199
  }
196
- function $() {
200
+ function Q() {
197
201
  var e, t;
198
- (t = (e = u.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, l.name, []);
202
+ (t = (e = s.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, l.name, []);
199
203
  }
200
- return E({
204
+ return T({
201
205
  resetFields: I,
202
206
  validateFields: j,
203
207
  add: q,
204
208
  remove: M,
205
- getRowData: H,
209
+ getRowData: U,
206
210
  getRowsData: G,
207
- setRowData: U,
211
+ setRowData: W,
208
212
  addMultiple: K,
209
- scrollTo: W,
210
- clear: $
211
- }), (e, t) => (p(), B(n(y), {
213
+ scrollTo: $,
214
+ clear: Q,
215
+ setTableData: H
216
+ }), (e, t) => (p(), F(o(y), {
212
217
  "initial-values": {
213
- [l.name]: n(s)
218
+ [l.name]: o(u)
214
219
  },
215
220
  ref_key: "formRef",
216
- ref: u
221
+ ref: s
217
222
  }, {
218
- default: m(() => [x(n(y).FormItem, {
223
+ default: m(() => [x(o(y).FormItem, {
219
224
  name: e.name,
220
225
  "no-style": ""
221
226
  }, {
222
- default: m(() => [x(n(ue), X(n(me)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
223
- class: n(N)(),
224
- columns: n(P),
225
- "data-source": n(s),
227
+ default: m(() => [x(o(ie), Y(o(fe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
228
+ class: o(E)(),
229
+ columns: o(P),
230
+ "data-source": o(u),
226
231
  ref_key: "tableRef",
227
232
  ref: v
228
- }), Y({
233
+ }), Z({
229
234
  headerCell: m(({
230
- column: a
231
- }) => [n(ce)(a) ? (p(), Z("span", {
235
+ column: n
236
+ }) => [o(pe)(n) ? (p(), ee("span", {
232
237
  key: 0,
233
- class: ee(n(T)("header-cell", "required"))
234
- }, "*", 2)) : F("", !0), te("span", null, ae(a.title), 1), a.tooltip ? (p(), B(n(ie), {
238
+ class: te(o(L)("header-cell", "required"))
239
+ }, "*", 2)) : B("", !0), ae("span", null, ne(n.title), 1), n.tooltip ? (p(), F(o(de), {
235
240
  key: 1,
236
- title: a.tooltip,
241
+ title: n.tooltip,
237
242
  placement: "bottom"
238
243
  }, {
239
- default: m(() => [x(n(ye), {
244
+ default: m(() => [x(o(ge), {
240
245
  style: oe({
241
246
  paddingLeft: "4px",
242
- color: n(A).colorPrimary
247
+ color: o(A).colorPrimary
243
248
  })
244
249
  }, null, 8, ["style"])]),
245
250
  _: 2
246
- }, 1032, ["title"])) : F("", !0)]),
251
+ }, 1032, ["title"])) : B("", !0)]),
247
252
  _: 2
248
- }, [ne(_, (a, o) => ({
249
- name: o,
250
- fn: m((r) => [le(e.$slots, o, re(se(r || {})))])
253
+ }, [le(N, (n, a) => ({
254
+ name: a,
255
+ fn: m((r) => [re(e.$slots, a, ue(se(r || {})))])
251
256
  }))]), 1040, ["class", "columns", "data-source"])]),
252
257
  _: 3
253
258
  }, 8, ["name"])]),
@@ -256,5 +261,5 @@ const Ae = /* @__PURE__ */ Q({
256
261
  }
257
262
  });
258
263
  export {
259
- Ae as default
264
+ ze as default
260
265
  };
@@ -163,6 +163,12 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
163
163
  * @returns
164
164
  */
165
165
  scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
166
+ /**
167
+ * 设置表格数据
168
+ * @param nextTableData
169
+ * @returns
170
+ */
171
+ setTableData: (nextTableData: RecordType[]) => void;
166
172
  };
167
173
  /**
168
174
  * 可编辑表格作为表单项暴露的实例