@aplus-frontend/ui 0.1.35 → 0.1.37

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 (75) hide show
  1. package/es/index.mjs +136 -133
  2. package/es/src/ap-button/ap-action-button.vue.d.ts +5 -0
  3. package/es/src/ap-button/ap-action-button.vue.mjs +8 -8
  4. package/es/src/ap-form/ap-form.vue2.mjs +93 -93
  5. package/es/src/ap-form/index.d.ts +3 -1
  6. package/es/src/ap-form/index.mjs +5 -1
  7. package/es/src/ap-form/interface.d.ts +4 -0
  8. package/es/src/ap-form/set/index.vue.d.ts +43 -0
  9. package/es/src/ap-form/set/index.vue.mjs +35 -0
  10. package/es/src/ap-form/set/index.vue2.mjs +4 -0
  11. package/es/src/ap-table/ap-table.vue.d.ts +1 -0
  12. package/es/src/ap-table/ap-table.vue.mjs +109 -107
  13. package/es/src/ap-table/components/setting/utils.d.ts +1 -1
  14. package/es/src/ap-table/components/setting/utils.mjs +12 -21
  15. package/es/src/ap-table/components/style/setting/modal.css +15 -3
  16. package/es/src/ap-table/interface.d.ts +5 -0
  17. package/es/src/ap-table/utils.mjs +14 -13
  18. package/es/src/ap-upload/apUpload.vue.mjs +40 -39
  19. package/es/src/business/ap-button-group/ApButtonGroup.vue.d.ts +21 -0
  20. package/es/src/business/ap-button-group/ApButtonGroup.vue.mjs +4 -0
  21. package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +71 -0
  22. package/es/src/business/ap-button-group/interface.d.ts +29 -0
  23. package/es/src/business/ap-button-group/interface.mjs +1 -0
  24. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -1
  25. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.mjs +11 -11
  26. package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
  27. package/es/src/business/index.d.ts +607 -4
  28. package/es/src/business/index.mjs +27 -23
  29. package/es/src/editable-table/form-item.vue.mjs +76 -97
  30. package/es/src/editable-table/hooks/use-get-columns.mjs +41 -35
  31. package/es/src/editable-table/index.vue.mjs +79 -100
  32. package/es/src/editable-table/style/index.css +12 -0
  33. package/es/src/editable-table/utils.d.ts +8 -1
  34. package/es/src/editable-table/utils.mjs +103 -69
  35. package/es/src/index.mjs +220 -217
  36. package/es/src/theme/ap-table/setting/modal.css +15 -3
  37. package/es/src/theme/editable-table/index.css +12 -0
  38. package/lib/index.js +1 -1
  39. package/lib/src/ap-button/ap-action-button.vue.d.ts +5 -0
  40. package/lib/src/ap-button/ap-action-button.vue.js +1 -1
  41. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  42. package/lib/src/ap-form/index.d.ts +3 -1
  43. package/lib/src/ap-form/index.js +1 -1
  44. package/lib/src/ap-form/interface.d.ts +4 -0
  45. package/lib/src/ap-form/set/index.vue.d.ts +43 -0
  46. package/lib/src/ap-form/set/index.vue.js +1 -0
  47. package/lib/src/ap-form/set/index.vue2.js +1 -0
  48. package/lib/src/ap-table/ap-table.vue.d.ts +1 -0
  49. package/lib/src/ap-table/ap-table.vue.js +1 -1
  50. package/lib/src/ap-table/components/setting/utils.d.ts +1 -1
  51. package/lib/src/ap-table/components/setting/utils.js +1 -1
  52. package/lib/src/ap-table/components/style/setting/modal.css +15 -3
  53. package/lib/src/ap-table/interface.d.ts +5 -0
  54. package/lib/src/ap-table/utils.js +1 -1
  55. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  56. package/lib/src/business/ap-button-group/ApButtonGroup.vue.d.ts +21 -0
  57. package/lib/src/business/ap-button-group/ApButtonGroup.vue.js +1 -0
  58. package/lib/src/business/ap-button-group/ApButtonGroup.vue2.js +1 -0
  59. package/lib/src/business/ap-button-group/interface.d.ts +29 -0
  60. package/lib/src/business/ap-button-group/interface.js +1 -0
  61. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -1
  62. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.js +1 -1
  63. package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
  64. package/lib/src/business/index.d.ts +607 -4
  65. package/lib/src/business/index.js +1 -1
  66. package/lib/src/editable-table/form-item.vue.js +1 -1
  67. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  68. package/lib/src/editable-table/index.vue.js +1 -1
  69. package/lib/src/editable-table/style/index.css +12 -0
  70. package/lib/src/editable-table/utils.d.ts +8 -1
  71. package/lib/src/editable-table/utils.js +1 -1
  72. package/lib/src/index.js +1 -1
  73. package/lib/src/theme/ap-table/setting/modal.css +15 -3
  74. package/lib/src/theme/editable-table/index.css +12 -0
  75. package/package.json +5 -5
@@ -15,10 +15,12 @@ import "./ap-image/ApImage.vue.mjs";
15
15
  import "./ap-ladder/ApLadder.vue.mjs";
16
16
  import m from "./ap-attachment/ApAttachment.mjs";
17
17
  import "./ap-card/ApCard.vue.mjs";
18
- import { ApTransformDataHelper as fo } from "../utils/ap-trans-data/index.mjs";
18
+ import { ApTransformDataHelper as lo } from "../utils/ap-trans-data/index.mjs";
19
+ import "./ap-button-group/ApButtonGroup.vue.mjs";
19
20
  import "./ap-batch-action-group/interface.mjs";
20
- import { handleExportDownload as _o } from "./ap-export-group/handleExportDownload.mjs";
21
- import { default as eo } from "./ap-table-modal/index.mjs";
21
+ import { handleExportDownload as $o } from "./ap-export-group/handleExportDownload.mjs";
22
+ import "./ap-button-group/interface.mjs";
23
+ import { default as bo } from "./ap-table-modal/index.mjs";
22
24
  import p from "./ap-title/ApTitle.vue2.mjs";
23
25
  import i from "./ap-expand-alert/ApExpandAlert.vue2.mjs";
24
26
  import a from "./ap-status/ApStatus.vue2.mjs";
@@ -30,25 +32,27 @@ import _ from "./ap-batch-action/ApBatchAction.vue2.mjs";
30
32
  import A from "./ap-batch-action-group/ApBatchActionGroup.vue2.mjs";
31
33
  import e from "./ap-image/ApImage.vue2.mjs";
32
34
  import l from "./ap-ladder/ApLadder.vue2.mjs";
33
- import $ from "./ap-card/ApCard.vue2.mjs";
34
- const P = o(p), Q = i, U = o(t), V = o(a), W = o(n), X = o(c), Y = o(f), Z = s, oo = _, to = r, ro = A, mo = e, po = o(l), io = m, ao = o($);
35
+ import u from "./ap-card/ApCard.vue2.mjs";
36
+ import $ from "./ap-button-group/ApButtonGroup.vue2.mjs";
37
+ const W = o(p), X = i, Y = o(t), Z = o(a), oo = o(n), to = o(c), ro = o(f), mo = s, po = _, io = r, ao = A, no = e, co = o(l), fo = m, so = o(u), _o = o($);
35
38
  export {
36
- io as ApAttachment,
37
- oo as ApBatchAction,
38
- ro as ApBatchActionGroup,
39
- ao as ApCard,
40
- Q as ApExpandAlert,
41
- Y as ApExportGroup,
42
- mo as ApImage,
43
- Z as ApInputRadio,
44
- U as ApLabel,
45
- to as ApLabelGroup,
46
- po as ApLadder,
47
- X as ApSelectLayout,
48
- V as ApStatus,
49
- W as ApStatusGroup,
50
- eo as ApTableModal,
51
- P as ApTitle,
52
- fo as ApTransformDataHelper,
53
- _o as handleExportDownload
39
+ fo as ApAttachment,
40
+ po as ApBatchAction,
41
+ ao as ApBatchActionGroup,
42
+ _o as ApButtonGroup,
43
+ so as ApCard,
44
+ X as ApExpandAlert,
45
+ ro as ApExportGroup,
46
+ no as ApImage,
47
+ mo as ApInputRadio,
48
+ Y as ApLabel,
49
+ io as ApLabelGroup,
50
+ co as ApLadder,
51
+ to as ApSelectLayout,
52
+ Z as ApStatus,
53
+ oo as ApStatusGroup,
54
+ bo as ApTableModal,
55
+ W as ApTitle,
56
+ lo as ApTransformDataHelper,
57
+ $o as handleExportDownload
54
58
  };
@@ -1,18 +1,16 @@
1
- import { defineComponent as q, ref as x, unref as l, useSlots as G, watch as H, openBlock as m, createBlock as y, mergeProps as C, withCtx as d, createVNode as b, createSlots as W, createElementBlock as $, normalizeClass as Q, createCommentVNode as w, createElementVNode as U, toDisplayString as I, normalizeStyle as J, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as ee } from "vue";
2
- import { Table as te, Tooltip as oe } from "ant-design-vue";
3
- import { ApForm as R } from "../ap-form/index.mjs";
4
- import { isArray as ae, isNumber as i, cloneDeep as f, omit as le } from "lodash-unified";
1
+ import { defineComponent as P, ref as h, unref as l, useSlots as z, watch as O, openBlock as K, createBlock as M, mergeProps as x, withCtx as g, createVNode as G, createSlots as H, renderList as W, renderSlot as $, normalizeProps as U, guardReactiveProps as q } from "vue";
2
+ import { Table as J } from "ant-design-vue";
3
+ import { ApForm as b } from "../ap-form/index.mjs";
4
+ import { isArray as Q, isNumber as d, cloneDeep as f, omit as w } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as ne } from "../ap-form/context.mjs";
6
+ import { useInjectForm as X } from "../ap-form/context.mjs";
7
7
  import "./style/index.css";
8
- import { isDef as p } from "../utils/index.mjs";
9
- import re from "./hooks/use-get-columns.mjs";
10
- import { scrollToRowIndex as ue, getColumnIsRequired as se } from "./utils.mjs";
11
- import { QuestionCircleOutlined as de } from "@ant-design/icons-vue";
12
- import { useToken as me } from "ant-design-vue/es/theme/internal";
13
- import { useNamespace as ie } from "../config-provider/hooks/use-namespace.mjs";
14
- import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
15
- const Fe = /* @__PURE__ */ q({
8
+ import { isDef as m } from "../utils/index.mjs";
9
+ import Y from "./hooks/use-get-columns.mjs";
10
+ import { scrollToRowIndex as Z } from "./utils.mjs";
11
+ import { useNamespace as I } from "../config-provider/hooks/use-namespace.mjs";
12
+ import { useGlobalConfig as ee } from "../config-provider/hooks/use-global-config.mjs";
13
+ const ce = /* @__PURE__ */ P({
16
14
  name: "EditableTableInner",
17
15
  __name: "form-item",
18
16
  props: {
@@ -112,121 +110,102 @@ const Fe = /* @__PURE__ */ q({
112
110
  default: () => ({})
113
111
  }
114
112
  },
115
- setup(B, {
116
- expose: D
113
+ setup(C, {
114
+ expose: y
117
115
  }) {
118
- const n = B;
119
- function k(e, t) {
120
- return ae(t) ? t.reduce((o, a) => o == null ? void 0 : o[a], e) : e == null ? void 0 : e[t];
116
+ const a = C;
117
+ function R(e, o) {
118
+ return Q(o) ? o.reduce((r, t) => r == null ? void 0 : r[t], e) : e == null ? void 0 : e[o];
121
119
  }
122
120
  const {
123
- internalInstance: r,
124
- model: T
125
- } = ne(), u = x(k(l(T), n.name) || []), F = G(), L = R.useWatch(n.name);
126
- H(() => L.value, (e) => {
127
- var t;
128
- u.value = e, (t = n.onChange) == null || t.call(n, e);
121
+ internalInstance: n,
122
+ model: B
123
+ } = X(), u = h(R(l(B), a.name) || []), D = z(), F = b.useWatch(a.name);
124
+ O(() => F.value, (e) => {
125
+ var o;
126
+ u.value = e, (o = a.onChange) == null || o.call(a, e);
129
127
  }, {
130
128
  deep: !0
131
129
  });
132
130
  const {
133
- b: E,
134
- em: N
135
- } = ie("editable-table"), c = x(), S = fe("valueTypeMap"), [, V] = me(), _ = re(n, S);
136
- function v(e, t) {
131
+ b: L
132
+ } = I("editable-table"), i = h(), T = ee("valueTypeMap"), v = Y(a, T);
133
+ function E(e, o) {
137
134
  var s;
138
- const o = ((s = l(u)) == null ? void 0 : s.length) || 0;
139
- if (p(n.maxLength) && o >= n.maxLength)
135
+ const r = ((s = l(u)) == null ? void 0 : s.length) || 0;
136
+ if (m(a.maxLength) && r >= a.maxLength)
140
137
  return;
141
- const a = [...l(u) || []];
142
- p(t) ? a.splice(t, 0, {
138
+ const t = [...l(u) || []];
139
+ m(o) ? t.splice(o, 0, {
143
140
  ...e || {}
144
- }) : a.push({
141
+ }) : t.push({
145
142
  ...e || {}
146
- }), r == null || r.setFieldValue(n.name, a);
143
+ }), n == null || n.setFieldValue(a.name, t);
147
144
  }
148
- function z(e, t = "suffix") {
149
- var g;
150
- const o = ((g = l(u)) == null ? void 0 : g.length) || 0, a = i(e) ? e : e.length;
151
- if (p(n.maxLength) && o + a > n.maxLength)
145
+ function N(e, o = "suffix") {
146
+ var p;
147
+ const r = ((p = l(u)) == null ? void 0 : p.length) || 0, t = d(e) ? e : e.length;
148
+ if (m(a.maxLength) && r + t > a.maxLength)
152
149
  return;
153
- const s = [...l(u) || []], h = i(e) ? new Array(e).fill({}) : f(e);
154
- t === "suffix" ? s.push(...h) : s.unshift(...h), r == null || r.setFieldValue(n.name, s);
150
+ const s = [...l(u) || []], c = d(e) ? new Array(e).fill({}) : f(e);
151
+ o === "suffix" ? s.push(...c) : s.unshift(...c), n == null || n.setFieldValue(a.name, s);
155
152
  }
156
- function P(e) {
157
- let t = f(l(u) || []);
158
- const o = i(e) ? [e] : e;
159
- t = t.filter((a, s) => !o.includes(s)), r == null || r.setFieldValue(n.name, t);
153
+ function S(e) {
154
+ let o = f(l(u) || []);
155
+ const r = d(e) ? [e] : e;
156
+ o = o.filter((t, s) => !r.includes(s)), n == null || n.setFieldValue(a.name, o);
160
157
  }
161
- function j() {
158
+ function V() {
162
159
  return l(u);
163
160
  }
164
- function A(e) {
165
- var t;
166
- return (t = l(u)) == null ? void 0 : t[e];
161
+ function _(e) {
162
+ var o;
163
+ return (o = l(u)) == null ? void 0 : o[e];
167
164
  }
168
- function O(e, t, o = !0) {
169
- const a = f(l(u));
170
- a[e] && (a[e] = {
171
- ...o ? a[e] : {},
172
- ...t
173
- }, r == null || r.setFieldValue(n.name, [...a]));
165
+ function k(e, o, r = !0) {
166
+ const t = f(l(u));
167
+ t[e] && (t[e] = {
168
+ ...r ? t[e] : {},
169
+ ...o
170
+ }, n == null || n.setFieldValue(a.name, [...t]));
174
171
  }
175
- function K(e) {
176
- r == null || r.setFieldValue(n.name, e);
172
+ function j(e) {
173
+ n == null || n.setFieldValue(a.name, e);
177
174
  }
178
- function M(e, t) {
179
- var a;
180
- const o = e === "end" ? u.value.length - 1 : e;
181
- ue(o, (a = c.value) == null ? void 0 : a.$el, t);
175
+ function A(e, o) {
176
+ var t;
177
+ const r = e === "end" ? u.value.length - 1 : e;
178
+ Z(r, (t = i.value) == null ? void 0 : t.$el, o);
182
179
  }
183
- return D({
184
- add: v,
185
- remove: P,
186
- getRowData: A,
187
- getRowsData: j,
188
- setRowData: O,
189
- addMultiple: z,
190
- scrollTo: M,
191
- setTableData: K
192
- }), (e, t) => (m(), y(l(R).FormItem, C(e.formItem, {
180
+ return y({
181
+ add: E,
182
+ remove: S,
183
+ getRowData: _,
184
+ getRowsData: V,
185
+ setRowData: k,
186
+ addMultiple: N,
187
+ scrollTo: A,
188
+ setTableData: j
189
+ }), (e, o) => (K(), M(l(b).FormItem, x(e.formItem, {
193
190
  name: e.name,
194
191
  label: e.label
195
192
  }), {
196
- default: d(() => [b(l(te), C(l(le)(n, ["name", "maxLength", "onChange"]), {
197
- class: l(E)(),
198
- columns: l(_),
193
+ default: g(() => [G(l(J), x(l(w)(a, ["name", "maxLength", "onChange"]), {
194
+ class: l(L)(),
195
+ columns: l(v),
199
196
  "data-source": u.value,
200
197
  ref_key: "tableRef",
201
- ref: c
202
- }), W({
203
- headerCell: d(({
204
- column: o
205
- }) => [l(se)(o) ? (m(), $("span", {
206
- key: 0,
207
- class: Q(l(N)("header-cell", "required"))
208
- }, "*", 2)) : w("", !0), U("span", null, I(o.title), 1), o.tooltip ? (m(), y(l(oe), {
209
- key: 1,
210
- title: o.tooltip,
211
- placement: "bottom"
212
- }, {
213
- default: d(() => [b(l(de), {
214
- style: J({
215
- paddingLeft: "4px",
216
- color: l(V).colorPrimary
217
- })
218
- }, null, 8, ["style"])]),
219
- _: 2
220
- }, 1032, ["title"])) : w("", !0)]),
198
+ ref: i
199
+ }), H({
221
200
  _: 2
222
- }, [X(F, (o, a) => ({
223
- name: a,
224
- fn: d((s) => [Y(e.$slots, a, Z(ee(s || {})))])
201
+ }, [W(l(w)(D, ["headerCell"]), (r, t) => ({
202
+ name: t,
203
+ fn: g((s) => [$(e.$slots, t, U(q(s || {})))])
225
204
  }))]), 1040, ["class", "columns", "data-source"])]),
226
205
  _: 3
227
206
  }, 16, ["name", "label"]));
228
207
  }
229
208
  });
230
209
  export {
231
- Fe as default
210
+ ce as default
232
211
  };
@@ -1,71 +1,77 @@
1
- import { computed as h, unref as I } from "vue";
2
- import { omit as R, isFunction as C, isArray as s } from "lodash-unified";
3
- import { mergeClass as y, getFinalNode as N } from "../utils.mjs";
4
- import { updateFormProps as T, getFieldProps as v, getPlaceholder as w, getTableRenderProps as A } from "../../ap-table/utils.mjs";
1
+ import { useSlots as y, computed as N, unref as m } from "vue";
2
+ import { omit as k, isFunction as v, isArray as f } from "lodash-unified";
3
+ import { getEditableTableTitle as w, mergeClass as A, getFinalNode as q } from "../utils.mjs";
4
+ import { updateFormProps as E, getFieldProps as G, getPlaceholder as L, getTableRenderProps as S } from "../../ap-table/utils.mjs";
5
5
  import "../../config-provider/index.mjs";
6
- import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
7
- const D = (d, f) => {
6
+ import { useToken as U } from "ant-design-vue/es/theme/internal";
7
+ import { useLocale as $ } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
9
+ const W = (a, b) => {
8
10
  const {
9
- t: x
10
- } = G();
11
- return h(() => {
12
- const t = d.columns;
13
- if (!t)
11
+ t: g
12
+ } = $(), {
13
+ em: h,
14
+ be: x
15
+ } = j("editable-table"), F = y(), [, I] = U();
16
+ return N(() => {
17
+ const d = a.columns;
18
+ if (!d)
14
19
  return [];
15
- function c(g) {
16
- return g.map((e) => ({
17
- ...R(e, ["ellipsis"]),
20
+ function c(R) {
21
+ return R.map((e) => ({
22
+ ...k(e, ["ellipsis"]),
18
23
  children: c(e.children || []),
24
+ title: w(e, x("table-header", "title"), h("header-cell", "required"), F.headerCell, m(I).colorPrimary),
19
25
  customRender({
20
- value: l,
26
+ value: o,
21
27
  ...n
22
28
  }) {
23
- const o = C(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
29
+ const t = v(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
24
30
  if (!e.valueType && !e.customRender && !e.customRenderFormItem)
25
31
  return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
26
32
  let r;
27
- if (o) {
28
- const a = T(e, v(e.fieldProps, {
29
- value: l,
33
+ if (t) {
34
+ const l = E(e, G(e.fieldProps, {
35
+ value: o,
30
36
  ...n
31
37
  })), i = {};
32
- d.onFieldChange && (i[`onUpdate:${a.valuePropName || "value"}`] = (b) => {
33
- var m;
34
- return (m = d.onFieldChange) == null ? void 0 : m.call(d, n.index, e.dataIndex, b);
38
+ a.onFieldChange && (i[`onUpdate:${l.valuePropName || "value"}`] = (T) => {
39
+ var s;
40
+ return (s = a.onFieldChange) == null ? void 0 : s.call(a, n.index, e.dataIndex, T);
35
41
  });
36
- const F = s(e.dataIndex) ? e.dataIndex : [e.dataIndex];
42
+ const C = f(e.dataIndex) ? e.dataIndex : [e.dataIndex];
37
43
  r = {
38
- name: [...s(d.name) ? d.name : [d.name], n.index, ...F],
39
- ...a || {},
44
+ name: [...f(a.name) ? a.name : [a.name], n.index, ...C],
45
+ ...l || {},
40
46
  // 格式化placeholder
41
- placeholder: w(x, e.valueType, a == null ? void 0 : a.placeholder),
47
+ placeholder: L(g, e.valueType, l == null ? void 0 : l.placeholder),
42
48
  field: {
43
49
  style: "width: 100%",
44
- ...(a == null ? void 0 : a.field) || {},
50
+ ...(l == null ? void 0 : l.field) || {},
45
51
  ...i,
46
- class: y("is-editable", a.class)
52
+ class: A("is-editable", l.class)
47
53
  }
48
54
  };
49
55
  } else
50
56
  r = {
51
- field: A(e, {
52
- value: l,
57
+ field: S(e, {
58
+ value: o,
53
59
  ...n
54
60
  })
55
61
  };
56
- const u = N(e, o, r, l, n.record, I(f));
62
+ const u = q(e, t, r, o, n.record, m(b));
57
63
  return e.customRender ? e.customRender({
58
- value: l,
64
+ value: o,
59
65
  ...n,
60
- editable: o,
66
+ editable: t,
61
67
  originalNode: u
62
68
  }) : u;
63
69
  }
64
70
  }));
65
71
  }
66
- return c(t);
72
+ return c(d);
67
73
  });
68
74
  };
69
75
  export {
70
- D as default
76
+ W as default
71
77
  };