@aplus-frontend/ui 0.2.0-beta.3 → 0.2.0-beta.4

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 (57) hide show
  1. package/es/src/ap-form/item-text/style/css.d.ts +0 -1
  2. package/es/src/ap-form/item-text/style/css.js +1 -1
  3. package/es/src/ap-form/item-text/style/index.d.ts +0 -1
  4. package/es/src/ap-form/item-text/style/index.js +1 -1
  5. package/es/src/ap-form/item-text-group/style/css.d.ts +0 -0
  6. package/es/src/ap-form/item-text-group/style/css.js +1 -0
  7. package/es/src/ap-form/item-text-group/style/index.d.ts +0 -0
  8. package/es/src/ap-form/item-text-group/style/index.js +1 -0
  9. package/es/src/ap-form/items/interface.d.ts +11 -0
  10. package/es/src/ap-form/items/text/group.vue.d.ts +42 -0
  11. package/es/src/ap-form/items/text/group.vue.mjs +4 -0
  12. package/es/src/ap-form/items/text/group.vue2.mjs +26 -0
  13. package/es/src/ap-form/items/text/index.d.ts +3 -1
  14. package/es/src/ap-form/items/text/index.mjs +10 -6
  15. package/es/src/ap-table/constants.d.ts +2 -0
  16. package/es/src/ap-table/utils.d.ts +2 -0
  17. package/es/src/ap-upload/apUpload.vue.d.ts +17 -1
  18. package/es/src/ap-upload/apUpload.vue.mjs +54 -42
  19. package/es/src/ap-upload/apUploadTypes.d.ts +6 -1
  20. package/es/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
  21. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +98 -90
  22. package/es/src/ap-upload/components/Picture.vue.d.ts +4 -1
  23. package/es/src/ap-upload/components/Picture.vue2.mjs +146 -138
  24. package/es/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
  25. package/es/src/ap-upload/components/SingleFile.vue2.mjs +84 -86
  26. package/es/src/business/ap-label/constans.d.ts +1 -1
  27. package/es/src/business/ap-label/interface.d.ts +2 -2
  28. package/es/src/path-map.mjs +3 -1
  29. package/lib/src/ap-form/item-text/style/css.d.ts +0 -1
  30. package/lib/src/ap-form/item-text/style/css.js +1 -1
  31. package/lib/src/ap-form/item-text/style/index.d.ts +0 -1
  32. package/lib/src/ap-form/item-text/style/index.js +1 -1
  33. package/lib/src/ap-form/item-text-group/style/css.d.ts +0 -0
  34. package/lib/src/ap-form/item-text-group/style/css.js +1 -0
  35. package/lib/src/ap-form/item-text-group/style/index.d.ts +0 -0
  36. package/lib/src/ap-form/item-text-group/style/index.js +1 -0
  37. package/lib/src/ap-form/items/interface.d.ts +11 -0
  38. package/lib/src/ap-form/items/text/group.vue.d.ts +42 -0
  39. package/lib/src/ap-form/items/text/group.vue.js +1 -0
  40. package/lib/src/ap-form/items/text/group.vue2.js +1 -0
  41. package/lib/src/ap-form/items/text/index.d.ts +3 -1
  42. package/lib/src/ap-form/items/text/index.js +1 -1
  43. package/lib/src/ap-table/constants.d.ts +2 -0
  44. package/lib/src/ap-table/utils.d.ts +2 -0
  45. package/lib/src/ap-upload/apUpload.vue.d.ts +17 -1
  46. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  47. package/lib/src/ap-upload/apUploadTypes.d.ts +6 -1
  48. package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
  49. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  50. package/lib/src/ap-upload/components/Picture.vue.d.ts +4 -1
  51. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  52. package/lib/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
  53. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  54. package/lib/src/business/ap-label/constans.d.ts +1 -1
  55. package/lib/src/business/ap-label/interface.d.ts +2 -2
  56. package/lib/src/path-map.js +1 -1
  57. package/package.json +2 -2
@@ -1,82 +1,90 @@
1
- import { defineComponent as $, inject as n, ref as j, watch as W, nextTick as G, openBlock as x, createElementBlock as C, normalizeClass as H, unref as s, createVNode as _, withCtx as b, createElementVNode as L, createTextVNode as J, toDisplayString as S, withModifiers as K, createBlock as Q, resolveDynamicComponent as V, createCommentVNode as X } from "vue";
1
+ import { defineComponent as $, inject as n, ref as j, watch as V, nextTick as W, openBlock as v, createElementBlock as C, normalizeClass as G, unref as s, createVNode as _, withCtx as L, createElementVNode as b, createTextVNode as H, toDisplayString as S, withModifiers as J, createBlock as K, resolveDynamicComponent as Q, createCommentVNode as X } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as Y, getName as Z, getReturnData as y } from "../utils/returnData.mjs";
3
+ import { getPath as Y, getName as Z, getReturnData as x } from "../utils/returnData.mjs";
4
4
  import { useOss as ee, getOssInstance as te } from "../hooks/useOss.mjs";
5
- import { message as c, Upload as oe, Button as ae } from "ant-design-vue";
5
+ import { message as m, Upload as oe, Button as ae } from "ant-design-vue";
6
6
  import { UploadOutlined as se } from "@ant-design/icons-vue";
7
7
  import { fileMatchesAccept as ne, getAcceptText as ie } from "../utils/accept.mjs";
8
- import { useLocale as re } from "../../config-provider/hooks/use-locale.mjs";
9
- import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
8
+ import { useLocale as le } from "../../config-provider/hooks/use-locale.mjs";
9
+ import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
10
10
  const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 }, Ce = /* @__PURE__ */ $({
11
11
  __name: "MultipleFile",
12
- setup(me) {
13
- const { t: i } = re(), { b: U } = le("ap-upload-multiple-file"), { put: B } = ee(), I = n("theme"), P = n("dirName"), w = n("accept") || "*", A = n("maxSize") ?? 500, z = n("title") || i("ap.apUpload.uploadFile"), h = n("subTitle"), r = n("maxCount") ?? 10, m = n("uploadingCount"), F = n("beforeUpload"), N = n("customRequest"), R = n("getOssAccess"), a = n("value"), g = [], d = n("needName"), p = j(null);
14
- W(
12
+ setup(me, { expose: B }) {
13
+ const { t: i } = le(), { b: U } = re("ap-upload-multiple-file"), { put: I } = ee(), P = n("theme"), z = n("dirName"), y = n("accept") || "*", A = n("maxSize") ?? 500, R = n("title") || i("ap.apUpload.uploadFile"), g = n("subTitle"), l = n("maxCount") ?? 10, d = n("uploadingCount"), F = n("beforeUpload"), N = n("customRequest"), O = n("getOssAccess"), a = n("value"), p = [], f = n("needName"), r = j(null);
14
+ V(
15
15
  () => a == null ? void 0 : a.value,
16
16
  function(e) {
17
17
  var t, o;
18
- !((o = (t = p == null ? void 0 : p.value) == null ? void 0 : t.fileList) != null && o.length) && e && G(() => {
19
- const l = e.map((u) => {
20
- const E = Y(d, u), M = Z(d, u), k = new File(
21
- [u],
22
- M,
23
- {}
24
- );
25
- return k.response = E, k.uid = E, k;
26
- });
27
- if (r && l.length > r) {
28
- c.warning(
29
- i("ap.apUpload.fileInitializationException", {
30
- maxCount: r
31
- })
32
- );
33
- return;
34
- }
35
- l.forEach((u) => {
36
- f.push(u), g.push({
37
- uid: u.uid,
38
- path: u.response
39
- });
40
- }), p.value.fileList = l;
41
- });
18
+ !((o = (t = r == null ? void 0 : r.value) == null ? void 0 : t.fileList) != null && o.length) && e && T(e);
42
19
  },
43
20
  { immediate: !0 }
44
21
  );
45
- let f = [], T;
46
- function v(e) {
22
+ function T(e) {
23
+ if (!e) {
24
+ c = [], r.value.fileList = [], a.value = void 0, p.splice(0, p.length);
25
+ return;
26
+ }
27
+ W(() => {
28
+ const t = e.map((o) => {
29
+ const u = Y(f, o), w = Z(f, o), k = new File(
30
+ [o],
31
+ w,
32
+ {}
33
+ );
34
+ return k.response = u, k.uid = u, k;
35
+ });
36
+ if (l && t.length > l) {
37
+ m.warning(
38
+ i("ap.apUpload.fileInitializationException", {
39
+ maxCount: l
40
+ })
41
+ );
42
+ return;
43
+ }
44
+ t.forEach((o) => {
45
+ c.push(o), p.push({
46
+ uid: o.uid,
47
+ path: o.response
48
+ });
49
+ }), r.value.fileList = t, a.value = e;
50
+ });
51
+ }
52
+ B({ setValue: T });
53
+ let c = [], E;
54
+ function h(e) {
47
55
  setTimeout(() => {
48
- const t = p.value.fileList.findIndex(
56
+ const t = r.value.fileList.findIndex(
49
57
  (o) => o.uid === e.uid
50
58
  );
51
- t >= 0 && p.value.fileList.splice(t, 1);
59
+ t >= 0 && r.value.fileList.splice(t, 1);
52
60
  });
53
61
  }
54
- function O(e) {
55
- if (r && r > 1 && f.length >= r)
56
- return clearTimeout(T), T = setTimeout(() => {
57
- c.warning(
62
+ function q(e) {
63
+ if (l && l > 1 && c.length >= l)
64
+ return clearTimeout(E), E = setTimeout(() => {
65
+ m.warning(
58
66
  i("ap.apUpload.maxUploadFiles", {
59
- maxCount: r
67
+ maxCount: l
60
68
  })
61
69
  );
62
- }), v(e), !1;
70
+ }), h(e), !1;
63
71
  if (typeof F == "function") {
64
72
  if (F(e) === !1)
65
- return v(e), !1;
73
+ return h(e), !1;
66
74
  } else {
67
75
  if (e.size > A * 1024 * 1024)
68
- return c.warning(
76
+ return m.warning(
69
77
  i("ap.apUpload.maxUploadFileSize", {
70
78
  maxSize: A
71
79
  })
72
- ), v(e), !1;
73
- if (!ne(e, w))
74
- return c.warning(i("ap.apUpload.fileFormatNotSupported")), v(e), !1;
80
+ ), h(e), !1;
81
+ if (!ne(e, y))
82
+ return m.warning(i("ap.apUpload.fileFormatNotSupported")), h(e), !1;
75
83
  }
76
- r && r === 1 && (f = [], a.value = void 0), f.push(e);
84
+ l && l === 1 && (c = [], a.value = void 0), c.push(e);
77
85
  }
78
- async function q(e) {
79
- if (m.value++, typeof N == "function") {
86
+ async function D(e) {
87
+ if (d.value++, typeof N == "function") {
80
88
  N({
81
89
  onProgress: (t) => {
82
90
  setTimeout(() => {
@@ -86,50 +94,50 @@ const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 },
86
94
  });
87
95
  },
88
96
  onError: (t) => {
89
- c.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
97
+ m.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
90
98
  e.onError({
91
99
  name: t,
92
100
  message: t
93
101
  });
94
- }), m.value--;
102
+ }), d.value--;
95
103
  },
96
104
  onSuccess: (t) => {
97
105
  setTimeout(() => {
98
106
  e.onSuccess(t);
99
107
  }), a.value ? a.value.push(
100
- y(d, t, e.file.name)
108
+ x(f, t, e.file.name)
101
109
  ) : a.value = [
102
- y(d, t, e.file.name)
103
- ], g.push({
110
+ x(f, t, e.file.name)
111
+ ], p.push({
104
112
  uid: e.file.uid,
105
113
  path: t
106
- }), m.value--;
114
+ }), d.value--;
107
115
  },
108
116
  file: e.file
109
117
  });
110
118
  return;
111
119
  }
112
120
  try {
113
- const t = await te(R);
114
- e.file.oss = t, B({
121
+ const t = await te(O);
122
+ e.file.oss = t, I({
115
123
  file: e.file,
116
- dirName: P,
124
+ dirName: z,
117
125
  oss: t,
118
126
  successCallBack(o) {
119
127
  e.onSuccess(o), a.value ? a.value.push(
120
- y(d, o, e.file.name)
128
+ x(f, o, e.file.name)
121
129
  ) : a.value = [
122
- y(d, o, e.file.name)
123
- ], g.push({
130
+ x(f, o, e.file.name)
131
+ ], p.push({
124
132
  uid: e.file.uid,
125
133
  path: o
126
- }), m.value--;
134
+ }), d.value--;
127
135
  },
128
136
  errorCallBack(o) {
129
- c.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
137
+ m.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
130
138
  name: o,
131
139
  message: o
132
- }), m.value--;
140
+ }), d.value--;
133
141
  },
134
142
  progressCallBack(o) {
135
143
  e.onProgress({
@@ -138,65 +146,65 @@ const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 },
138
146
  }
139
147
  });
140
148
  } catch (t) {
141
- c.warning(
149
+ m.warning(
142
150
  typeof (t == null ? void 0 : t.message) == "string" ? t.message : i("ap.apUpload.networkAnomaly")
143
151
  ), e.onError({
144
152
  name: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly"),
145
153
  message: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly")
146
- }), m.value--;
154
+ }), d.value--;
147
155
  }
148
156
  }
149
- function D(e) {
157
+ function M(e) {
150
158
  var o;
151
159
  if (e.response) {
152
160
  if (Array.isArray(a.value)) {
153
- const l = g.findIndex((u) => u.uid === e.uid);
154
- l >= 0 && (a == null || a.value.splice(l, 1), g.splice(l, 1)), a.value.length === 0 && (a.value = void 0);
161
+ const u = p.findIndex((w) => w.uid === e.uid);
162
+ u >= 0 && (a == null || a.value.splice(u, 1), p.splice(u, 1)), a.value.length === 0 && (a.value = void 0);
155
163
  }
156
164
  } else
157
165
  (o = e == null ? void 0 : e.oss) == null || o.pauseUpload();
158
- const t = f.findIndex(
159
- (l) => l.uid === e.uid
166
+ const t = c.findIndex(
167
+ (u) => u.uid === e.uid
160
168
  );
161
- return f.splice(t, 1), Promise.resolve(!0);
169
+ return c.splice(t, 1), Promise.resolve(!0);
162
170
  }
163
- return (e, t) => (x(), C("div", {
164
- class: H({
171
+ return (e, t) => (v(), C("div", {
172
+ class: G({
165
173
  [s(U)()]: !0,
166
- [s(U)("admin")]: s(I) === "admin"
174
+ [s(U)("admin")]: s(P) === "admin"
167
175
  })
168
176
  }, [
169
177
  _(s(oe), {
170
178
  ref_key: "uploadRef",
171
- ref: p,
172
- accept: s(w),
179
+ ref: r,
180
+ accept: s(y),
173
181
  multiple: "",
174
- maxCount: s(r),
182
+ maxCount: s(l),
175
183
  progress: {
176
184
  strokeWidth: 3,
177
185
  showInfo: !1,
178
186
  strokeColor: "#0070FF"
179
187
  },
180
- beforeUpload: O,
181
- customRequest: q,
182
- onRemove: D
188
+ beforeUpload: q,
189
+ customRequest: D,
190
+ onRemove: M
183
191
  }, {
184
- default: b(() => [
185
- L("div", ue, [
192
+ default: L(() => [
193
+ b("div", ue, [
186
194
  _(s(ae), { class: "file-btn" }, {
187
- default: b(() => [
195
+ default: L(() => [
188
196
  _(s(se)),
189
- J(" " + S(s(z)), 1)
197
+ H(" " + S(s(R)), 1)
190
198
  ]),
191
199
  _: 1
192
200
  }),
193
- L("div", {
201
+ b("div", {
194
202
  class: "sub-title",
195
- onClick: t[0] || (t[0] = K(() => {
203
+ onClick: t[0] || (t[0] = J(() => {
196
204
  }, ["stop"]))
197
205
  }, [
198
- typeof s(h) == "string" ? (x(), C("div", pe, S(s(h) || `${s(i)("ap.apUpload.supportExtension")}:${s(ie)(s(w))}`), 1)) : s(h) ? (x(), C("div", ce, [
199
- (x(), Q(V(s(h))))
206
+ typeof s(g) == "string" ? (v(), C("div", pe, S(s(g) || `${s(i)("ap.apUpload.supportExtension")}:${s(ie)(s(y))}`), 1)) : s(g) ? (v(), C("div", ce, [
207
+ (v(), K(Q(s(g))))
200
208
  ])) : X("", !0)
201
209
  ])
202
210
  ])
@@ -1,3 +1,6 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
2
+ declare function setValue(val?: (string | Record<string, any>)[]): void;
3
+ declare const _default: DefineComponent<{}, {
4
+ setValue: typeof setValue;
5
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
3
6
  export default _default;