@aplus-frontend/ui 0.1.39 → 0.1.41

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 (89) hide show
  1. package/es/index.mjs +136 -134
  2. package/es/src/ap-action/group/index.vue.d.ts +1 -1
  3. package/es/src/ap-download/interface.d.ts +1 -1
  4. package/es/src/ap-field/date/index.vue.d.ts +1 -1
  5. package/es/src/ap-field/date-range/index.vue.d.ts +1 -1
  6. package/es/src/ap-field/number/index.vue.d.ts +1 -1
  7. package/es/src/ap-field/rate/index.vue.d.ts +1 -1
  8. package/es/src/ap-field/select/index.vue.d.ts +1 -1
  9. package/es/src/ap-form/ap-form-item.vue.d.ts +1 -1
  10. package/es/src/ap-form/index.d.ts +3 -1
  11. package/es/src/ap-form/index.mjs +8 -4
  12. package/es/src/ap-form/interface.d.ts +1 -0
  13. package/es/src/ap-form/items/number/index.vue.d.ts +16 -16
  14. package/es/src/ap-form/items/text/index.vue.d.ts +12 -12
  15. package/es/src/ap-form/items/text/password.vue.d.ts +12 -12
  16. package/es/src/ap-form/items/text-area/index.vue.d.ts +12 -12
  17. package/es/src/ap-form/modal-form/drawer.vue.d.ts +830 -0
  18. package/es/src/ap-form/modal-form/drawer.vue.mjs +288 -0
  19. package/es/src/ap-form/modal-form/drawer.vue2.mjs +4 -0
  20. package/es/src/ap-table/ap-table.vue.mjs +40 -40
  21. package/es/src/ap-table/constants.d.ts +209 -209
  22. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -1
  23. package/es/src/ap-table/hooks/use-table-paging.mjs +74 -74
  24. package/es/src/ap-table/utils.d.ts +72 -72
  25. package/es/src/base-button/index.d.ts +4 -4
  26. package/es/src/business/ap-label/ApLabel.d.ts +1 -1
  27. package/es/src/business/index.d.ts +11 -11
  28. package/es/src/check-card/group.vue.d.ts +1 -1
  29. package/es/src/config-provider/config-provider-props.d.ts +5 -0
  30. package/es/src/config-provider/config-provider-props.mjs +4 -0
  31. package/es/src/config-provider/config-provider.d.ts +90 -3
  32. package/es/src/config-provider/config-provider.mjs +27 -23
  33. package/es/src/config-provider/css-var.d.ts +88 -0
  34. package/es/src/{theme/css-var/index.mjs → config-provider/css-var.mjs} +1 -0
  35. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -0
  36. package/es/src/config-provider/index.d.ts +486 -9
  37. package/es/src/index.mjs +107 -105
  38. package/es/src/theme/antd-global-overwrite/admin/button.css +0 -3
  39. package/es/src/theme/antd-global-overwrite/admin/index.css +0 -3
  40. package/es/src/theme/antd-global-overwrite/aplus/button.css +0 -3
  41. package/es/src/theme/antd-global-overwrite/aplus/index.css +0 -3
  42. package/es/src/type.d.ts +3 -0
  43. package/es/src/utils/config-provider-preset.d.ts +3 -3
  44. package/lib/index.js +1 -1
  45. package/lib/src/ap-action/group/index.vue.d.ts +1 -1
  46. package/lib/src/ap-download/interface.d.ts +1 -1
  47. package/lib/src/ap-field/date/index.vue.d.ts +1 -1
  48. package/lib/src/ap-field/date-range/index.vue.d.ts +1 -1
  49. package/lib/src/ap-field/number/index.vue.d.ts +1 -1
  50. package/lib/src/ap-field/rate/index.vue.d.ts +1 -1
  51. package/lib/src/ap-field/select/index.vue.d.ts +1 -1
  52. package/lib/src/ap-form/ap-form-item.vue.d.ts +1 -1
  53. package/lib/src/ap-form/index.d.ts +3 -1
  54. package/lib/src/ap-form/index.js +1 -1
  55. package/lib/src/ap-form/interface.d.ts +1 -0
  56. package/lib/src/ap-form/items/number/index.vue.d.ts +16 -16
  57. package/lib/src/ap-form/items/text/index.vue.d.ts +12 -12
  58. package/lib/src/ap-form/items/text/password.vue.d.ts +12 -12
  59. package/lib/src/ap-form/items/text-area/index.vue.d.ts +12 -12
  60. package/lib/src/ap-form/modal-form/drawer.vue.d.ts +830 -0
  61. package/lib/src/ap-form/modal-form/drawer.vue.js +1 -0
  62. package/lib/src/ap-form/modal-form/drawer.vue2.js +1 -0
  63. package/lib/src/ap-table/ap-table.vue.js +1 -1
  64. package/lib/src/ap-table/constants.d.ts +209 -209
  65. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -1
  66. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  67. package/lib/src/ap-table/utils.d.ts +72 -72
  68. package/lib/src/base-button/index.d.ts +4 -4
  69. package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
  70. package/lib/src/business/index.d.ts +11 -11
  71. package/lib/src/check-card/group.vue.d.ts +1 -1
  72. package/lib/src/config-provider/config-provider-props.d.ts +5 -0
  73. package/lib/src/config-provider/config-provider-props.js +1 -1
  74. package/lib/src/config-provider/config-provider.d.ts +90 -3
  75. package/lib/src/config-provider/config-provider.js +1 -1
  76. package/lib/src/config-provider/css-var.d.ts +88 -0
  77. package/lib/src/{theme/css-var/index.js → config-provider/css-var.js} +1 -1
  78. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -0
  79. package/lib/src/config-provider/index.d.ts +486 -9
  80. package/lib/src/index.js +1 -1
  81. package/lib/src/theme/antd-global-overwrite/admin/button.css +0 -3
  82. package/lib/src/theme/antd-global-overwrite/admin/index.css +0 -3
  83. package/lib/src/theme/antd-global-overwrite/aplus/button.css +0 -3
  84. package/lib/src/theme/antd-global-overwrite/aplus/index.css +0 -3
  85. package/lib/src/type.d.ts +3 -0
  86. package/lib/src/utils/config-provider-preset.d.ts +3 -3
  87. package/package.json +2 -2
  88. package/es/src/theme/css-var/index.d.ts +0 -7
  89. package/lib/src/theme/css-var/index.d.ts +0 -7
@@ -91,5 +91,5 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
91
91
  dataSource: DataType[];
92
92
  }>;
93
93
  dataSource: ComputedRef<DataType[]>;
94
- setDataSource: (dataSource: DataType[]) => void;
94
+ setDataSource: (dataSource?: DataType[]) => void;
95
95
  };
@@ -1,101 +1,101 @@
1
- import { ref as P, nextTick as _, unref as n, onMounted as I, computed as V, createVNode as b } from "vue";
2
- import { parseFieldValue as k, dataIndexToStr as ee } from "../utils.mjs";
3
- import { isArray as te } from "lodash-unified";
1
+ import { ref as x, nextTick as I, unref as o, onMounted as k, computed as V, createVNode as P } from "vue";
2
+ import { parseFieldValue as ee, dataIndexToStr as te } from "../utils.mjs";
3
+ import { isArray as B } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import { useLocale as ae } from "../../config-provider/hooks/use-locale.mjs";
6
- import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
6
+ import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
7
7
  const ue = ({
8
- manual: B = !1,
9
- defaultCurrent: E = 1,
8
+ manual: E = !1,
9
+ defaultCurrent: M = 1,
10
10
  defaultPageSize: w = 10,
11
- request: M,
12
- defaultParams: N = {},
13
- defaultData: $ = [],
11
+ request: N,
12
+ defaultParams: $ = {},
13
+ defaultData: q = [],
14
14
  formatParams: C,
15
15
  paramsValueTypeMap: y,
16
16
  resetFieldsIgnores: D,
17
- filterFields: q,
18
- sortFields: J,
19
- showLessItems: z = !1,
20
- showTotal: L = !0
17
+ filterFields: J,
18
+ sortFields: L,
19
+ showLessItems: b = !1,
20
+ showTotal: Q = !0
21
21
  }) => {
22
- let S = 0, f = {};
23
- const Q = (e) => C ? C(e) : e, c = P(), l = P(E), p = P(w), {
22
+ let z = 0, f = {};
23
+ const G = (e) => C ? C(e) : e, c = x(), l = x(M), p = x(w), {
24
24
  t: F
25
25
  } = ae(), {
26
- b: T
27
- } = ne("ap-table"), o = P({
26
+ b: S
27
+ } = oe("ap-table"), n = x({
28
28
  total: 0,
29
- records: $,
29
+ records: q,
30
30
  loading: !1
31
31
  }), O = async (e) => {
32
32
  var r;
33
- const a = Q(e), t = Date.now();
34
- S = t, o.value.loading = !0;
33
+ const a = G(e), t = Date.now();
34
+ z = t, n.value.loading = !0;
35
35
  try {
36
- const s = await M({
37
- ...N,
36
+ const s = await N({
37
+ ...$,
38
38
  ...a
39
39
  });
40
- S === t && (o.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, o.value.records = [...s.data || []]);
40
+ z === t && (n.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, n.value.records = [...s.data || []]);
41
41
  } catch {
42
- S === t && (o.value.records = [], o.value.total = 0);
42
+ z === t && (n.value.records = [], n.value.total = 0);
43
43
  } finally {
44
- o.value.loading = !1;
44
+ n.value.loading = !1;
45
45
  }
46
46
  }, R = (e) => {
47
47
  const a = {};
48
48
  return Object.entries(e).forEach(([t, r]) => {
49
49
  if (a[t] = r, y && r) {
50
50
  const s = y[t];
51
- s && (a[t] = k(s, r));
51
+ s && (a[t] = ee(s, r));
52
52
  }
53
53
  }), a;
54
- }, G = async (e) => {
54
+ }, H = async (e) => {
55
55
  var r, s, g, d, m, u, h;
56
56
  const a = ((s = (r = c.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
57
57
  Object.entries(a).forEach(([v, i]) => {
58
58
  D && D.indexOf(v) > -1 && (t[v] = i);
59
- }), await ((d = (g = c.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t), _(() => {
59
+ }), await ((d = (g = c.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t), I(() => {
60
60
  e == null || e();
61
61
  });
62
- }, x = (e) => {
62
+ }, T = (e) => {
63
63
  f = e;
64
64
  const a = R(e);
65
65
  O(a);
66
- }, H = (e) => {
67
- x({
66
+ }, K = (e) => {
67
+ T({
68
68
  ...f,
69
69
  ...e
70
70
  });
71
71
  }, j = () => {
72
72
  var a, t;
73
73
  const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
74
- l.value = 1, x({
74
+ l.value = 1, T({
75
75
  ...e,
76
76
  current: 1,
77
77
  pageSize: f.pageSize || w
78
78
  });
79
- }, K = () => {
80
- G(j);
81
79
  }, U = () => {
82
- x(f);
83
- }, W = (e) => {
84
- const a = n(o).total - e, t = Math.ceil(a / n(p)), r = n(l) > t ? t : n(l);
85
- H({
80
+ H(j);
81
+ }, W = () => {
82
+ T(f);
83
+ }, X = (e) => {
84
+ const a = o(n).total - e, t = Math.ceil(a / o(p)), r = o(l) > t ? t : o(l);
85
+ K({
86
86
  current: r > 0 ? r : 1
87
87
  });
88
88
  }, A = (e, a, t) => {
89
89
  var m, u, h, v;
90
90
  const r = ((u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
91
91
  l.value = e.current, p.value = e.pageSize;
92
- const s = te(t) ? [...t] : [t], g = {};
92
+ const s = B(t) ? [...t] : [t], g = {};
93
93
  for (const i of s)
94
- (h = n(J)) != null && h.includes(i.field) && (g[ee(i.field)] = i.order);
94
+ (h = o(L)) != null && h.includes(i.field) && (g[te(i.field)] = i.order);
95
95
  const d = {};
96
96
  for (const i of Object.keys(a))
97
- (v = n(q)) != null && v.includes(i) && (d[i] = a[i]);
98
- x({
97
+ (v = o(J)) != null && v.includes(i) && (d[i] = a[i]);
98
+ T({
99
99
  ...r,
100
100
  filter: d,
101
101
  sort: g,
@@ -103,58 +103,58 @@ const ue = ({
103
103
  pageSize: e.pageSize
104
104
  });
105
105
  };
106
- I(() => {
106
+ k(() => {
107
107
  var a, t;
108
108
  const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
109
109
  if (f = {
110
- current: n(l),
111
- pageSize: n(p),
110
+ current: o(l),
111
+ pageSize: o(p),
112
112
  ...e
113
- }, !B) {
113
+ }, !E) {
114
114
  const r = R(f);
115
115
  O(r);
116
116
  }
117
117
  });
118
- const X = V(() => n(o).total === 0 ? "-" : `${n(l.value)}/${Math.ceil(n(o).total / n(p))}`);
119
- function Y(e) {
120
- e != null && e.length && (o.value.records = e, o.value.total = e.length);
118
+ const Y = V(() => o(n).total === 0 ? "-" : `${o(l.value)}/${Math.ceil(o(n).total / o(p))}`);
119
+ function Z(e) {
120
+ B(e) && (n.value.records = e, n.value.total = e.length);
121
121
  }
122
- const Z = V(() => ({
123
- loading: n(o).loading,
122
+ const _ = V(() => ({
123
+ loading: o(n).loading,
124
124
  pagination: {
125
- current: n(l),
126
- pageSize: n(p),
127
- total: n(o).total,
128
- showSizeChanger: !z,
129
- showQuickJumper: !z,
130
- showLessItems: z,
125
+ current: o(l),
126
+ pageSize: o(p),
127
+ total: o(n).total,
128
+ showSizeChanger: !b,
129
+ showQuickJumper: !b,
130
+ showLessItems: b,
131
131
  size: "default",
132
- showTotal: L ? (e) => b("span", {
133
- class: T("pagination-total-wrapper")
134
- }, [F("ap.apTable.pagination.totalLeftPrefix"), " ", b("span", {
135
- class: T("pagination-count-text")
136
- }, [e]), " ", F("ap.apTable.pagination.totalLeftSuffix"), b("span", {
137
- class: T("pagination--total-right")
138
- }, [F("ap.apTable.pagination.totalRightPrefix"), " ", b("span", {
139
- class: T("pagination-count-text")
140
- }, [n(X)]), " ", F("ap.apTable.pagination.totalRightSuffix")])]) : void 0
132
+ showTotal: Q ? (e) => P("span", {
133
+ class: S("pagination-total-wrapper")
134
+ }, [F("ap.apTable.pagination.totalLeftPrefix"), " ", P("span", {
135
+ class: S("pagination-count-text")
136
+ }, [e]), " ", F("ap.apTable.pagination.totalLeftSuffix"), P("span", {
137
+ class: S("pagination--total-right")
138
+ }, [F("ap.apTable.pagination.totalRightPrefix"), " ", P("span", {
139
+ class: S("pagination-count-text")
140
+ }, [o(Y)]), " ", F("ap.apTable.pagination.totalRightSuffix")])]) : void 0
141
141
  },
142
142
  onChange: A,
143
- dataSource: n(o).records
143
+ dataSource: o(n).records
144
144
  }));
145
145
  return {
146
146
  formRef: c,
147
147
  submit: j,
148
- reset: K,
149
- refresh: U,
150
- refreshByDelete: W,
151
- data: o,
148
+ reset: U,
149
+ refresh: W,
150
+ refreshByDelete: X,
151
+ data: n,
152
152
  current: l,
153
153
  pageSize: p,
154
154
  handleTableChange: A,
155
- tableProps: Z,
156
- dataSource: V(() => n(o).records),
157
- setDataSource: Y
155
+ tableProps: _,
156
+ dataSource: V(() => o(n).records),
157
+ setDataSource: Z
158
158
  };
159
159
  };
160
160
  export {