@aplus-frontend/ui 0.0.19 → 0.0.20

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 (53) hide show
  1. package/es/src/ap-form/ap-form-item.vue.d.ts +2 -8
  2. package/es/src/ap-form/constant.d.ts +4 -0
  3. package/es/src/ap-form/constant.mjs +4 -3
  4. package/es/src/ap-form/interface.d.ts +10 -0
  5. package/es/src/ap-form/items/checkbox/index.vue.d.ts +9 -2
  6. package/es/src/ap-form/items/checkbox/index.vue.mjs +20 -13
  7. package/es/src/ap-form/items/date/index.vue.d.ts +26 -14
  8. package/es/src/ap-form/items/date/index.vue.mjs +26 -18
  9. package/es/src/ap-form/items/date-range/index.vue.d.ts +24 -13
  10. package/es/src/ap-form/items/date-range/index.vue.mjs +27 -19
  11. package/es/src/ap-form/items/number/index.vue.d.ts +16 -9
  12. package/es/src/ap-form/items/number/index.vue.mjs +30 -22
  13. package/es/src/ap-form/items/radio/index.vue.d.ts +9 -2
  14. package/es/src/ap-form/items/radio/index.vue.mjs +21 -14
  15. package/es/src/ap-form/items/select/index.vue.d.ts +28 -15
  16. package/es/src/ap-form/items/select/index.vue.mjs +30 -22
  17. package/es/src/ap-form/items/switch/index.vue.d.ts +10 -6
  18. package/es/src/ap-form/items/switch/index.vue.mjs +25 -17
  19. package/es/src/ap-form/items/text/index.vue.d.ts +14 -8
  20. package/es/src/ap-form/items/text/index.vue2.mjs +32 -24
  21. package/es/src/ap-form/items/text/password.vue.d.ts +16 -9
  22. package/es/src/ap-form/items/text/password.vue.mjs +29 -21
  23. package/es/src/ap-form/items/text-area/index.vue.d.ts +9 -2
  24. package/es/src/ap-form/items/text-area/index.vue.mjs +24 -17
  25. package/es/src/ap-table/ap-table.vue.mjs +69 -71
  26. package/es/src/ap-table/constants.d.ts +2692 -1453
  27. package/lib/src/ap-form/ap-form-item.vue.d.ts +2 -8
  28. package/lib/src/ap-form/constant.d.ts +4 -0
  29. package/lib/src/ap-form/constant.js +1 -1
  30. package/lib/src/ap-form/interface.d.ts +10 -0
  31. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +9 -2
  32. package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
  33. package/lib/src/ap-form/items/date/index.vue.d.ts +26 -14
  34. package/lib/src/ap-form/items/date/index.vue.js +1 -1
  35. package/lib/src/ap-form/items/date-range/index.vue.d.ts +24 -13
  36. package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
  37. package/lib/src/ap-form/items/number/index.vue.d.ts +16 -9
  38. package/lib/src/ap-form/items/number/index.vue.js +1 -1
  39. package/lib/src/ap-form/items/radio/index.vue.d.ts +9 -2
  40. package/lib/src/ap-form/items/radio/index.vue.js +1 -1
  41. package/lib/src/ap-form/items/select/index.vue.d.ts +28 -15
  42. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  43. package/lib/src/ap-form/items/switch/index.vue.d.ts +10 -6
  44. package/lib/src/ap-form/items/switch/index.vue.js +1 -1
  45. package/lib/src/ap-form/items/text/index.vue.d.ts +14 -8
  46. package/lib/src/ap-form/items/text/index.vue2.js +1 -1
  47. package/lib/src/ap-form/items/text/password.vue.d.ts +16 -9
  48. package/lib/src/ap-form/items/text/password.vue.js +1 -1
  49. package/lib/src/ap-form/items/text-area/index.vue.d.ts +9 -2
  50. package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
  51. package/lib/src/ap-table/ap-table.vue.js +1 -1
  52. package/lib/src/ap-table/constants.d.ts +2692 -1453
  53. package/package.json +3 -3
@@ -1,14 +1,14 @@
1
- import { defineComponent as Z, useSlots as ee, computed as d, createVNode as s, mergeProps as m, unref as r, watch as ae, openBlock as i, createElementBlock as f, normalizeClass as F, normalizeStyle as x, createSlots as E, withCtx as p, Fragment as te, renderList as O, createBlock as oe, resolveDynamicComponent as re, renderSlot as R, createCommentVNode as L, createElementVNode as z, toDisplayString as ne, normalizeProps as le, guardReactiveProps as de } from "vue";
1
+ import { defineComponent as Z, useSlots as ee, computed as d, createVNode as s, mergeProps as m, unref as n, watch as ae, openBlock as i, createElementBlock as f, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as te, renderList as E, createBlock as oe, resolveDynamicComponent as re, renderSlot as x, createCommentVNode as O, createElementVNode as L, toDisplayString as ne, normalizeProps as le, guardReactiveProps as de } from "vue";
2
2
  import { Typography as se, Table as ue, Tooltip as ie } from "ant-design-vue";
3
3
  import { useToken as pe } from "ant-design-vue/es/theme/internal";
4
4
  import { ApForm as ce } from "../ap-form/index.mjs";
5
- import { apTableRenderItemMap as me, noRenderAsFormItemValueList as N, apTableFormItemMap as fe } from "./constants.mjs";
5
+ import { apTableRenderItemMap as me, noRenderAsFormItemValueList as z, apTableFormItemMap as fe } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
7
  import { useTablePaging as ge } from "./hooks/use-table-paging.mjs";
8
8
  import { isUndefined as T, omit as ye } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
10
  import { QuestionCircleOutlined as he } from "@ant-design/icons-vue";
11
- import { apColumnToColumn as be, getTableRenderType as Ce, getTableRenderProps as Se, getColumnOrder as V, updateFormProps as Fe, getFieldProps as xe, getPlaceholder as Re } from "./utils.mjs";
11
+ import { apColumnToColumn as be, getTableRenderType as Ce, getTableRenderProps as Se, getColumnOrder as N, updateFormProps as Fe, getFieldProps as Re, getPlaceholder as xe } from "./utils.mjs";
12
12
  import Te from "./hooks/use-table-content-height.mjs";
13
13
  import { useLocale as we } from "../config-provider/hooks/use-locale.mjs";
14
14
  import { useNamespace as Be } from "../config-provider/hooks/use-namespace.mjs";
@@ -129,35 +129,35 @@ const ve = {
129
129
  default: !1
130
130
  }
131
131
  },
132
- setup(D, {
133
- expose: W
132
+ setup(V, {
133
+ expose: D
134
134
  }) {
135
- const t = D, w = ee(), [, j] = pe(), {
136
- t: _
135
+ const t = V, w = ee(), [, W] = pe(), {
136
+ t: j
137
137
  } = we(), {
138
138
  e: g,
139
139
  b: u
140
- } = Be("ap-table"), A = Pe("uiMode", "aplus"), {
141
- height: M,
142
- contentRef: q
140
+ } = Be("ap-table"), _ = Pe("uiMode", "aplus"), {
141
+ height: A,
142
+ contentRef: M
143
143
  } = Te(), y = d(() => {
144
144
  var o;
145
145
  let e = ((o = t.columns) == null ? void 0 : o.filter((a) => !a.hideInTable)) || [];
146
146
  return e = e.map((a) => ({
147
147
  ...be(a),
148
148
  customRender({
149
- value: n,
149
+ value: r,
150
150
  ...l
151
151
  }) {
152
- const C = Ce(a), k = me[C], Y = Se(a, {
153
- value: n,
152
+ const C = Ce(a), I = me[C], Y = Se(a, {
153
+ value: r,
154
154
  ...l
155
155
  });
156
- let S = U(a, n, s(k, m(Y, {
156
+ let S = U(a, r, s(I, m(Y, {
157
157
  mode: "read"
158
158
  }), null));
159
159
  return a.customRender && (S = a.customRender({
160
- value: n,
160
+ value: r,
161
161
  ...l,
162
162
  column: a,
163
163
  originalNode: S
@@ -166,58 +166,56 @@ const ve = {
166
166
  })), e;
167
167
  }), B = d(() => {
168
168
  var e, o, a;
169
- return ((a = (o = (e = t.columns) == null ? void 0 : e.filter((n) => !n.hideInSearch && n.dataIndex && (n.valueType || n.customRenderFormItem) && !N.includes(n.valueType))) == null ? void 0 : o.sort((n, l) => {
170
- let C = V(n.order);
171
- return V(l.order) - C;
172
- })) == null ? void 0 : a.map((n) => {
173
- const l = Fe(n, xe(n.fieldProps, {}));
169
+ return ((a = (o = (e = t.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : o.sort((r, l) => {
170
+ let C = N(r.order);
171
+ return N(l.order) - C;
172
+ })) == null ? void 0 : a.map((r) => {
173
+ const l = Fe(r, Re(r.fieldProps, {}));
174
174
  return {
175
- ...n,
175
+ ...r,
176
176
  fieldProps: {
177
- label: n.title,
178
- name: n.dataIndex,
177
+ label: r.title,
178
+ name: r.dataIndex,
179
179
  ...l || {},
180
180
  // 格式化placeholder
181
- placeholder: Re(_, n.valueType, l == null ? void 0 : l.placeholder)
181
+ placeholder: xe(j, r.valueType, l == null ? void 0 : l.placeholder)
182
182
  }
183
183
  };
184
184
  })) || [];
185
- }), H = d(() => r(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), K = d(() => r(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
185
+ }), q = d(() => n(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), H = d(() => n(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
186
186
  formRef: h,
187
187
  submit: P,
188
188
  reset: v,
189
189
  tableProps: c,
190
- handleTableChange: $,
190
+ handleTableChange: K,
191
191
  data: b
192
192
  } = ge({
193
193
  async request(e) {
194
- var a, n;
194
+ var a, r;
195
195
  const o = await ((a = t.request) == null ? void 0 : a.call(t, e));
196
- return (n = t.onLoad) == null || n.call(t, (o == null ? void 0 : o.data) || []), {
196
+ return (r = t.onLoad) == null || r.call(t, (o == null ? void 0 : o.data) || []), {
197
197
  data: (o == null ? void 0 : o.data) || [],
198
198
  total: (o == null ? void 0 : o.total) || 0
199
199
  };
200
200
  },
201
- filterFields: r(K),
202
- sortFields: r(H),
201
+ filterFields: n(H),
202
+ sortFields: n(q),
203
203
  defaultParams: t.params,
204
204
  defaultData: t.defaultData,
205
205
  manual: t.manual,
206
206
  defaultCurrent: t.pagination ? t.pagination.defaultCurrent : void 0,
207
207
  defaultPageSize: t.pagination ? t.pagination.defaultPageSize : void 0,
208
208
  formatParams: t.beforeSearchSubmit
209
- }), I = d(() => {
209
+ }), $ = d(() => {
210
210
  var e;
211
211
  return t.scroll ? t.scroll : t.adaptive && (b.value.total > 0 || (e = t.dataSource) != null && e.length) ? {
212
- y: r(M),
212
+ y: n(A),
213
213
  x: "100%"
214
214
  } : {
215
215
  x: !0
216
216
  };
217
217
  }), G = d(() => {
218
- const e = r(c);
219
- console.log("xxx", r(I));
220
- const o = T(t.dataSource) ? e : {
218
+ const e = n(c), o = T(t.dataSource) ? e : {
221
219
  ...e,
222
220
  dataSource: t.dataSource,
223
221
  onChange: t.onChange
@@ -225,13 +223,13 @@ const ve = {
225
223
  return {
226
224
  ...t,
227
225
  ...o,
228
- loading: T(t.loading) ? r(c).loading : t.loading,
229
- pagination: t.pagination === !1 ? !1 : r(c).pagination,
230
- scroll: r(I)
226
+ loading: T(t.loading) ? n(c).loading : t.loading,
227
+ pagination: t.pagination === !1 ? !1 : n(c).pagination,
228
+ scroll: n($)
231
229
  };
232
230
  }), Q = d(() => [u(), t.card ? null : u("wrapper"), t.adaptive ? u("adaptive") : null].filter(Boolean));
233
231
  function U(e, o, a) {
234
- return N.includes(e.valueType) ? a : e.copyable || e.ellipsis ? s(se.Text, {
232
+ return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? s(se.Text, {
235
233
  copyable: e.copyable ? {
236
234
  text: o,
237
235
  tooltip: !1
@@ -242,39 +240,39 @@ const ve = {
242
240
  content: a
243
241
  }, null) : a;
244
242
  }
245
- ae(() => r(b).loading, (e) => {
243
+ ae(() => n(b).loading, (e) => {
246
244
  var o;
247
245
  (o = t.onLoadingChange) == null || o.call(t, e);
248
246
  });
249
247
  function J(e) {
250
- var o, a, n;
251
- (n = (a = (o = h.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || n.call(a, e);
248
+ var o, a, r;
249
+ (r = (a = (o = h.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
252
250
  }
253
251
  function X() {
254
252
  var e, o, a;
255
253
  return (a = (o = (e = h.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : a.call(o, !0);
256
254
  }
257
- return W({
255
+ return D({
258
256
  submit: () => P(),
259
257
  reset: () => v(),
260
258
  setSearchFormValues: J,
261
259
  getSearchFormValues: X,
262
- dataSource: d(() => r(b).records)
260
+ dataSource: d(() => n(b).records)
263
261
  }), (e, o) => (i(), f("div", {
264
262
  class: F(Q.value)
265
- }, [r(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), f("div", {
263
+ }, [n(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), f("div", {
266
264
  key: 0,
267
- class: F(e.card ? r(g)("search-wrapper") : null),
268
- style: x(e.searchFormWrapperStyle)
269
- }, [s(r(ce).SearchForm, m(e.searchForm || {}, {
265
+ class: F(e.card ? n(g)("search-wrapper") : null),
266
+ style: R(e.searchFormWrapperStyle)
267
+ }, [s(n(ce).SearchForm, m(e.searchForm || {}, {
270
268
  ref_key: "formRef",
271
269
  ref: h,
272
270
  "custom-reset": "",
273
- onSubmit: r(P),
274
- onReset: r(v),
275
- "submit-loading": r(c).loading
276
- }), E({
277
- default: p(() => [(i(!0), f(te, null, O(B.value, (a) => (i(), oe(re(a.customRenderFormItem ? a.customRenderFormItem(a) : r(fe)[a.valueType || "text"]), m({
271
+ onSubmit: n(P),
272
+ onReset: n(v),
273
+ "submit-loading": n(c).loading
274
+ }), k({
275
+ default: p(() => [(i(!0), f(te, null, E(B.value, (a) => (i(), oe(re(a.customRenderFormItem ? a.customRenderFormItem(a) : n(fe)[a.valueType || "text"]), m({
278
276
  key: a.dataIndex,
279
277
  ref_for: !0
280
278
  }, a.fieldProps || {}, {
@@ -283,38 +281,38 @@ const ve = {
283
281
  _: 2
284
282
  }, [w.searchFormExtra ? {
285
283
  name: "extra",
286
- fn: p(() => [R(e.$slots, "searchFormExtra")]),
284
+ fn: p(() => [x(e.$slots, "searchFormExtra")]),
287
285
  key: "0"
288
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : L("", !0), z("div", {
286
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : O("", !0), L("div", {
289
287
  ref_key: "contentRef",
290
- ref: q,
291
- class: F([r(g)("table-wrapper"), e.card ? r(g)("table-wrapper-card") : null]),
292
- style: x(e.tableWrapperStyle)
293
- }, [R(e.$slots, "title"), s(r(ue), m({
294
- class: r(A) === "admin" ? r(u)("table-admin") : r(u)("table")
288
+ ref: M,
289
+ class: F([n(g)("table-wrapper"), e.card ? n(g)("table-wrapper-card") : null]),
290
+ style: R(e.tableWrapperStyle)
291
+ }, [x(e.$slots, "title"), s(n(ue), m({
292
+ class: n(_) === "admin" ? n(u)("table-admin") : n(u)("table")
295
293
  }, G.value, {
296
- onChange: r($),
294
+ onChange: n(K),
297
295
  columns: y.value
298
- }), E({
296
+ }), k({
299
297
  headerCell: p(({
300
298
  column: a,
301
- title: n
302
- }) => [a.tooltip ? (i(), f("span", ve, [z("span", null, ne(n), 1), s(r(ie), {
299
+ title: r
300
+ }) => [a.tooltip ? (i(), f("span", ve, [L("span", null, ne(r), 1), s(n(ie), {
303
301
  title: a.tooltip,
304
302
  placement: "bottom"
305
303
  }, {
306
- default: p(() => [s(r(he), {
307
- style: x({
304
+ default: p(() => [s(n(he), {
305
+ style: R({
308
306
  paddingLeft: "4px",
309
- color: r(j).colorPrimary
307
+ color: n(W).colorPrimary
310
308
  })
311
309
  }, null, 8, ["style"])]),
312
310
  _: 2
313
- }, 1032, ["title"])])) : L("", !0)]),
311
+ }, 1032, ["title"])])) : O("", !0)]),
314
312
  _: 2
315
- }, [O(r(ye)(w, ["title", "searchFormExtra"]), (a, n) => ({
316
- name: n,
317
- fn: p((l) => [R(e.$slots, n, le(de(l || {})))])
313
+ }, [E(n(ye)(w, ["title", "searchFormExtra"]), (a, r) => ({
314
+ name: r,
315
+ fn: p((l) => [x(e.$slots, r, le(de(l || {})))])
318
316
  }))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
319
317
  }
320
318
  });