@aplus-frontend/ui 0.0.21 → 0.0.23

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 (55) hide show
  1. package/es/index.mjs +34 -32
  2. package/es/src/ap-form/hooks/use-watch.d.ts +1 -1
  3. package/es/src/ap-form/modal-form/index.vue.mjs +41 -39
  4. package/es/src/ap-list/hooks/use-offline-list.d.ts +21 -0
  5. package/es/src/ap-list/hooks/use-offline-list.mjs +32 -0
  6. package/es/src/ap-list/index.d.ts +4 -0
  7. package/es/src/ap-list/index.mjs +2 -0
  8. package/es/src/ap-list/index.vue.d.ts +153 -0
  9. package/es/src/ap-list/index.vue.mjs +137 -0
  10. package/es/src/ap-list/index.vue2.mjs +4 -0
  11. package/es/src/ap-list/interface.d.ts +35 -2
  12. package/es/src/ap-list/interface.mjs +1 -0
  13. package/es/src/ap-list/style/index.css +5 -0
  14. package/es/src/ap-table/interface.d.ts +2 -2
  15. package/es/src/check-card/group.vue.d.ts +1 -1
  16. package/es/src/check-card/group.vue.mjs +1 -1
  17. package/es/src/check-card/index.vue.d.ts +1 -1
  18. package/es/src/check-card/index.vue2.mjs +40 -36
  19. package/es/src/check-card/interface.d.ts +1 -1
  20. package/es/src/editable-table/form-item.vue.d.ts +755 -105
  21. package/es/src/editable-table/form-item.vue.mjs +81 -64
  22. package/es/src/editable-table/index.vue.d.ts +527 -112
  23. package/es/src/editable-table/index.vue.mjs +93 -76
  24. package/es/src/editable-table/interface.d.ts +11 -5
  25. package/es/src/index.d.ts +1 -0
  26. package/es/src/index.mjs +230 -227
  27. package/es/src/theme/ap-list/index.css +5 -0
  28. package/lib/index.js +1 -1
  29. package/lib/src/ap-form/hooks/use-watch.d.ts +1 -1
  30. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  31. package/lib/src/ap-list/hooks/use-offline-list.d.ts +21 -0
  32. package/lib/src/ap-list/hooks/use-offline-list.js +1 -0
  33. package/lib/src/ap-list/index.d.ts +4 -0
  34. package/lib/src/ap-list/index.js +1 -0
  35. package/lib/src/ap-list/index.vue.d.ts +153 -0
  36. package/lib/src/ap-list/index.vue.js +1 -0
  37. package/lib/src/ap-list/index.vue2.js +1 -0
  38. package/lib/src/ap-list/interface.d.ts +35 -2
  39. package/lib/src/ap-list/interface.js +1 -0
  40. package/lib/src/ap-list/style/index.css +5 -0
  41. package/lib/src/ap-table/interface.d.ts +2 -2
  42. package/lib/src/check-card/group.vue.d.ts +1 -1
  43. package/lib/src/check-card/group.vue.js +1 -1
  44. package/lib/src/check-card/index.vue.d.ts +1 -1
  45. package/lib/src/check-card/index.vue2.js +1 -1
  46. package/lib/src/check-card/interface.d.ts +1 -1
  47. package/lib/src/editable-table/form-item.vue.d.ts +755 -105
  48. package/lib/src/editable-table/form-item.vue.js +1 -1
  49. package/lib/src/editable-table/index.vue.d.ts +527 -112
  50. package/lib/src/editable-table/index.vue.js +1 -1
  51. package/lib/src/editable-table/interface.d.ts +11 -5
  52. package/lib/src/index.d.ts +1 -0
  53. package/lib/src/index.js +1 -1
  54. package/lib/src/theme/ap-list/index.css +5 -0
  55. package/package.json +3 -3
@@ -1,15 +1,15 @@
1
- import { defineComponent as P, ref as L, unref as o, useSlots as V, watch as j, openBlock as f, createBlock as z, mergeProps as c, withCtx as i, createVNode as _, createSlots as O, createElementBlock as T, Fragment as K, createElementVNode as x, normalizeClass as q, toDisplayString as A, createCommentVNode as G, renderList as H, renderSlot as M, normalizeProps as W, guardReactiveProps as U } from "vue";
2
- import { Table as $ } from "ant-design-vue";
3
- import { ApForm as C } from "../ap-form/index.mjs";
4
- import { cloneDeep as g, omit as J } from "lodash-unified";
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";
2
+ import { Table as Z } from "ant-design-vue";
3
+ import { ApForm as y } from "../ap-form/index.mjs";
4
+ import { isNumber as p, cloneDeep as m, omit as I } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as Q } 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 X } from "../utils/index.mjs";
9
- import Y from "./hooks/use-get-columns.mjs";
10
- import { useNamespace as Z } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as I } from "../config-provider/hooks/use-global-config.mjs";
12
- const pe = /* @__PURE__ */ P({
8
+ import { isDef as f } from "../utils/index.mjs";
9
+ import te from "./hooks/use-get-columns.mjs";
10
+ 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({
13
13
  name: "EditableTableInner",
14
14
  __name: "form-item",
15
15
  props: {
@@ -109,81 +109,98 @@ const pe = /* @__PURE__ */ P({
109
109
  default: () => ({})
110
110
  }
111
111
  },
112
- setup(h, {
113
- expose: w
112
+ setup(R, {
113
+ expose: B
114
114
  }) {
115
- var p;
116
- const n = h, {
115
+ var h;
116
+ const r = R, {
117
117
  formInstance: t,
118
- model: b
119
- } = Q(), d = L(((p = o(b)) == null ? void 0 : p[n.name]) || []), y = V(), R = C.useWatch(n.name);
120
- j(() => R.value, (a) => {
118
+ model: D
119
+ } = ee(), s = A(((h = o(D)) == null ? void 0 : h[r.name]) || []), F = O(), E = y.useWatch(r.name);
120
+ T(() => E.value, (e) => {
121
121
  var l;
122
- d.value = a, (l = n.onChange) == null || l.call(n, a);
122
+ s.value = e, (l = r.onChange) == null || l.call(r, e);
123
123
  });
124
124
  const {
125
- b: u,
126
- em: B
127
- } = Z("editable-table"), D = I("uiMode", "aplus"), E = Y(n);
128
- function F(a) {
129
- var e, r;
130
- const l = ((e = o(d)) == null ? void 0 : e.length) || 0;
131
- X(n.maxLength) && l >= n.maxLength || (r = t == null ? void 0 : t.setFieldValue) == null || r.call(t, n.name, [...o(d) || [], a || {}]);
125
+ b: c,
126
+ 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)
132
+ return;
133
+ const n = [...o(s) || []];
134
+ f(l) ? n.splice(l, 0, {
135
+ ...e || {}
136
+ }) : n.push({
137
+ ...e || {}
138
+ }), (i = t == null ? void 0 : t.setFieldValue) == null || i.call(t, r.name, [...o(s) || [], e || {}]);
132
139
  }
133
- function v(a) {
134
- var e;
135
- const l = g(o(d) || []);
136
- l.splice(a, 1), (e = t == null ? void 0 : t.setFieldValue) == null || e.call(t, n.name, [...l]);
140
+ function k(e, l = "suffix") {
141
+ 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)
144
+ 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);
137
147
  }
138
- function S() {
139
- return o(d);
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);
140
153
  }
141
- function k(a) {
154
+ function _() {
155
+ return o(s);
156
+ }
157
+ function j(e) {
142
158
  var l;
143
- return (l = o(d)) == null ? void 0 : l[a];
159
+ return (l = o(s)) == null ? void 0 : l[e];
144
160
  }
145
- function N(a, l) {
146
- var r;
147
- const e = g(o(d));
148
- e[a] && (e[a] = {
149
- ...e[a],
161
+ function z(e, l) {
162
+ var n;
163
+ const a = m(o(s));
164
+ a[e] && (a[e] = {
165
+ ...a[e],
150
166
  ...l
151
- }, (r = t == null ? void 0 : t.setFieldValue) == null || r.call(t, n.name, [...e]));
167
+ }, (n = t == null ? void 0 : t.setFieldValue) == null || n.call(t, r.name, [...a]));
152
168
  }
153
- return w({
154
- add: F,
155
- remove: v,
156
- getRowData: k,
157
- getRowsData: S,
158
- setRowData: N
159
- }), (a, l) => (f(), z(o(C).FormItem, c(a.formItem, {
160
- name: a.name,
161
- label: a.label
169
+ return B({
170
+ add: S,
171
+ remove: P,
172
+ getRowData: j,
173
+ getRowsData: _,
174
+ setRowData: z,
175
+ addMultiple: k
176
+ }), (e, l) => (C(), K(o(y).FormItem, w(e.formItem, {
177
+ name: e.name,
178
+ label: e.label
162
179
  }), {
163
- default: i(() => [_(o($), c(o(J)(n, ["name", "maxLength"]), {
164
- class: [o(u)(), o(D) === "admin" ? o(u)("admin") : null],
165
- columns: o(E),
166
- "data-source": d.value
167
- }), O({
168
- headerCell: i(({
169
- column: e
180
+ default: u(() => [M(o(Z), w(o(I)(r, ["name", "maxLength"]), {
181
+ class: [o(c)(), o(v) === "admin" ? o(c)("admin") : null],
182
+ columns: o(N),
183
+ "data-source": s.value
184
+ }), q({
185
+ headerCell: u(({
186
+ column: a
170
187
  }) => {
171
- var r, s, m;
172
- return [(r = e == null ? void 0 : e.fieldProps) != null && r.required || (m = (s = e == null ? void 0 : e.fieldProps) == null ? void 0 : s.rules) != null && m.length ? (f(), T(K, {
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, {
173
190
  key: 0
174
- }, [x("span", {
175
- class: q(o(B)("header-cell", "required"))
176
- }, "*", 2), x("span", null, A(e.title), 1)], 64)) : G("", !0)];
191
+ }, [b("span", {
192
+ class: W(o(L)("header-cell", "required"))
193
+ }, "*", 2), b("span", null, U(a.title), 1)], 64)) : $("", !0)];
177
194
  }),
178
195
  _: 2
179
- }, [H(y, (e, r) => ({
180
- name: r,
181
- fn: i((s) => [M(a.$slots, r, W(U(s || {})))])
196
+ }, [J(F, (a, n) => ({
197
+ name: n,
198
+ fn: u((d) => [Q(e.$slots, n, X(Y(d || {})))])
182
199
  }))]), 1040, ["class", "columns", "data-source"])]),
183
200
  _: 3
184
201
  }, 16, ["name", "label"]));
185
202
  }
186
203
  });
187
204
  export {
188
- pe as default
205
+ he as default
189
206
  };