@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,75 +1,83 @@
1
- import { defineComponent as J, inject as u, ref as R, watch as K, openBlock as f, createElementBlock as h, normalizeClass as Q, unref as i, createElementVNode as p, Fragment as W, renderList as X, withDirectives as Y, createVNode as C, createCommentVNode as $, vShow as Z, toDisplayString as U } from "vue";
1
+ import { defineComponent as K, inject as u, ref as R, watch as Q, nextTick as W, openBlock as h, createElementBlock as g, normalizeClass as X, unref as i, createElementVNode as d, Fragment as Y, renderList as Z, withDirectives as F, createVNode as C, createCommentVNode as $, vShow as ee, toDisplayString as U } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as F, getName as ee, getReturnData as w } from "../utils/returnData.mjs";
4
- import { CloseOutlined as te, PlusOutlined as ne } from "@ant-design/icons-vue";
5
- import { useOss as ae, getOssInstance as D } from "../hooks/useOss.mjs";
6
- import { fileMatchesAccept as se, getAcceptText as oe } from "../utils/accept.mjs";
7
- import { message as d, Progress as ie } from "ant-design-vue";
8
- import { useLocale as ce } from "../../config-provider/hooks/use-locale.mjs";
9
- import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
10
- const re = ["accept"], le = { class: "picture-context" }, pe = { class: "picture-item-box" }, de = ["src"], me = { class: "picture-item-shadow" }, fe = ["onClick"], he = {
3
+ import { getPath as te, getName as ne, getReturnData as y } from "../utils/returnData.mjs";
4
+ import { CloseOutlined as ae, PlusOutlined as se } from "@ant-design/icons-vue";
5
+ import { useOss as oe, getOssInstance as T } from "../hooks/useOss.mjs";
6
+ import { fileMatchesAccept as ie, getAcceptText as ce } from "../utils/accept.mjs";
7
+ import { message as m, Progress as ue } from "ant-design-vue";
8
+ import { useLocale as re } from "../../config-provider/hooks/use-locale.mjs";
9
+ import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
10
+ const pe = ["accept"], de = { class: "picture-context" }, me = { class: "picture-item-box" }, fe = ["src"], he = { class: "picture-item-shadow" }, ge = ["onClick"], ve = {
11
11
  key: 0,
12
12
  class: "picture-item-uploading"
13
- }, ge = { class: "picture-title" }, ve = { key: 0 }, _e = { key: 1 }, be = /* @__PURE__ */ J({
13
+ }, xe = { class: "picture-title" }, _e = { key: 0 }, ye = { key: 1 }, Ie = /* @__PURE__ */ K({
14
14
  __name: "Picture",
15
- setup(xe) {
16
- const { t: r } = ce(), { b: A } = ue("ap-upload-picture"), { put: E } = ae(), O = u("theme"), T = u("dirName"), y = u("accept") || "image/*", k = u("maxSize") ?? 5, N = u("title"), l = u("maxCount") ?? 10, g = u("uploadingCount"), P = u("beforeUpload"), S = u("customRequest"), b = u("getOssAccess"), x = R(null), c = u("value"), v = u("needName");
17
- let o = R([]);
18
- const _ = [];
19
- K(
15
+ setup(we, { expose: D }) {
16
+ const { t: r } = re(), { b: A } = le("ap-upload-picture"), { put: E } = oe(), O = u("theme"), B = u("dirName"), w = u("accept") || "image/*", k = u("maxSize") ?? 5, N = u("title"), l = u("maxCount") ?? 10, v = u("uploadingCount"), P = u("beforeUpload"), S = u("customRequest"), b = u("getOssAccess"), _ = R(null), c = u("value"), x = u("needName");
17
+ let s = R([]);
18
+ const f = [];
19
+ Q(
20
20
  () => c == null ? void 0 : c.value,
21
21
  async function(e) {
22
22
  var a;
23
- if (!((a = o == null ? void 0 : o.value) != null && a.length) && e) {
24
- const n = [];
25
- for (let t of e) {
26
- const s = F(v, t), m = ee(v, t), I = await D(b), G = await I.getSignatureUrl(s), H = {
27
- ...new File([t], m, {}),
28
- uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
29
- thumbUrl: G,
30
- status: "success",
31
- percent: 100,
32
- path: s
33
- };
34
- n.push(H), I.destroy();
35
- }
36
- if (l && n.length > l) {
37
- d.warning(
38
- r("ap.apUpload.fileInitializationException", {
39
- maxCount: l
40
- })
41
- );
42
- return;
43
- }
44
- n.forEach((t) => {
45
- o.value.push(t), _.push({
46
- uid: t.uid,
47
- path: t.path
48
- });
49
- });
50
- }
23
+ !((a = s == null ? void 0 : s.value) != null && a.length) && e && z(e);
51
24
  },
52
25
  { immediate: !0 }
53
26
  );
54
- function B() {
27
+ function z(e) {
28
+ if (!e) {
29
+ c.value = void 0, f.splice(0, f.length), s.value = [];
30
+ return;
31
+ }
32
+ W(async () => {
33
+ const a = [];
34
+ for (let t of e) {
35
+ const n = te(x, t), o = ne(x, t), p = await T(b), H = await p.getSignatureUrl(n), J = {
36
+ ...new File([t], o, {}),
37
+ uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
38
+ thumbUrl: H,
39
+ status: "success",
40
+ percent: 100,
41
+ path: n
42
+ };
43
+ a.push(J), p.destroy();
44
+ }
45
+ if (l && a.length > l) {
46
+ m.warning(
47
+ r("ap.apUpload.fileInitializationException", {
48
+ maxCount: l
49
+ })
50
+ );
51
+ return;
52
+ }
53
+ a.forEach((t) => {
54
+ s.value.push(t), f.push({
55
+ uid: t.uid,
56
+ path: t.path
57
+ });
58
+ }), c.value = e;
59
+ });
60
+ }
61
+ D({ setValue: z });
62
+ function q() {
55
63
  var e;
56
- (e = x.value) == null || e.click();
64
+ (e = _.value) == null || e.click();
57
65
  }
58
- function q(e) {
66
+ function L(e) {
59
67
  const a = e.target;
60
- L(a == null ? void 0 : a.files);
68
+ M(a == null ? void 0 : a.files);
61
69
  }
62
- function L(e) {
70
+ function M(e) {
63
71
  if (e != null && e.length)
64
72
  for (let a = 0; a < e.length; a++)
65
- M(e[a]);
66
- x.value && (x.value.value = "");
73
+ V(e[a]);
74
+ _.value && (_.value.value = "");
67
75
  }
68
- let z;
69
- function M(e) {
70
- if (l && l > 1 && o.value.length >= l)
71
- return clearTimeout(z), z = setTimeout(() => {
72
- d.warning(
76
+ let I;
77
+ function V(e) {
78
+ if (l && l > 1 && s.value.length >= l)
79
+ return clearTimeout(I), I = setTimeout(() => {
80
+ m.warning(
73
81
  r("ap.apUpload.maxUploadPicture", { maxCount: l })
74
82
  );
75
83
  }), !1;
@@ -78,134 +86,134 @@ const re = ["accept"], le = { class: "picture-context" }, pe = { class: "picture
78
86
  return !1;
79
87
  } else {
80
88
  if (e.size > k * 1024 * 1024)
81
- return d.warning(
89
+ return m.warning(
82
90
  r("ap.apUpload.maxUploadFileSize", { maxSize: k })
83
91
  ), !1;
84
- if (!/image\/\w+/.test(e.type) || !se(e, y))
85
- return d.warning(r("ap.apUpload.pictureFormatNotSupported")), !1;
92
+ if (!/image\/\w+/.test(e.type) || !ie(e, w))
93
+ return m.warning(r("ap.apUpload.pictureFormatNotSupported")), !1;
86
94
  }
87
95
  const a = new FileReader();
88
96
  a.readAsDataURL(e), a.onload = function() {
89
- const n = {
97
+ const t = {
90
98
  ...e,
91
99
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
92
100
  thumbUrl: this.result,
93
101
  status: "uploading",
94
102
  percent: 0
95
103
  };
96
- V(n, e);
104
+ j(t, e);
97
105
  }, a.onerror = function() {
98
- d.warning(r("ap.apUpload.imageParsingFailed"));
106
+ m.warning(r("ap.apUpload.imageParsingFailed"));
99
107
  };
100
108
  }
101
- async function V(e, a) {
102
- if (g.value++, typeof S == "function") {
109
+ async function j(e, a) {
110
+ if (v.value++, typeof S == "function") {
103
111
  S({
104
- onProgress: (n) => {
105
- const t = o.value.find((s) => s.uid === e.uid);
106
- t && (t.percent = n);
112
+ onProgress: (t) => {
113
+ const n = s.value.find((o) => o.uid === e.uid);
114
+ n && (n.percent = t);
107
115
  },
108
- onError: (n) => {
109
- d.warning(n || r("ap.apUpload.networkAnomaly"));
110
- const t = o.value.findIndex(
111
- (s) => s.uid === e.uid
116
+ onError: (t) => {
117
+ m.warning(t || r("ap.apUpload.networkAnomaly"));
118
+ const n = s.value.findIndex(
119
+ (o) => o.uid === e.uid
112
120
  );
113
- t > -1 && o.value.splice(t, 1), g.value--;
121
+ n > -1 && s.value.splice(n, 1), v.value--;
114
122
  },
115
- onSuccess: (n) => {
116
- const t = o.value.find((s) => s.uid === e.uid);
117
- t && (t.status = "success", t.path = n), c.value ? c.value.push(w(v, n, a.name)) : c.value = [w(v, n, a.name)], _.push({
123
+ onSuccess: (t) => {
124
+ const n = s.value.find((o) => o.uid === e.uid);
125
+ n && (n.status = "success", n.path = t), c.value ? c.value.push(y(x, t, a.name)) : c.value = [y(x, t, a.name)], f.push({
118
126
  uid: e.uid,
119
- path: n
120
- }), g.value--;
127
+ path: t
128
+ }), v.value--;
121
129
  },
122
130
  file: a
123
131
  });
124
132
  return;
125
133
  }
126
134
  try {
127
- const n = await D(b);
128
- e.oss = n, o.value.push(e), E({
135
+ const t = await T(b);
136
+ e.oss = t, s.value.push(e), E({
129
137
  file: a,
130
- dirName: T,
131
- oss: n,
132
- successCallBack(t) {
133
- const s = o.value.find((m) => m.uid === e.uid);
134
- s && (s.status = "success", s.path = t), c.value ? c.value.push(w(v, t, a.name)) : c.value = [w(v, t, a.name)], _.push({
138
+ dirName: B,
139
+ oss: t,
140
+ successCallBack(n) {
141
+ const o = s.value.find((p) => p.uid === e.uid);
142
+ o && (o.status = "success", o.path = n), c.value ? c.value.push(y(x, n, a.name)) : c.value = [y(x, n, a.name)], f.push({
135
143
  uid: e.uid,
136
- path: t
137
- }), g.value--;
144
+ path: n
145
+ }), v.value--;
138
146
  },
139
- errorCallBack(t) {
140
- d.warning(t || r("ap.apUpload.networkAnomaly"));
141
- const s = o.value.findIndex(
142
- (m) => m.uid === e.uid
147
+ errorCallBack(n) {
148
+ m.warning(n || r("ap.apUpload.networkAnomaly"));
149
+ const o = s.value.findIndex(
150
+ (p) => p.uid === e.uid
143
151
  );
144
- s > -1 && o.value.splice(s, 1), g.value--;
152
+ o > -1 && s.value.splice(o, 1), v.value--;
145
153
  },
146
- progressCallBack(t) {
147
- const s = o.value.find((m) => m.uid === e.uid);
148
- s && (s.percent = t);
154
+ progressCallBack(n) {
155
+ const o = s.value.find((p) => p.uid === e.uid);
156
+ o && (o.percent = n);
149
157
  }
150
158
  });
151
- } catch (n) {
152
- d.warning(
153
- typeof (n == null ? void 0 : n.message) == "string" ? n.message : r("ap.apUpload.networkAnomaly")
159
+ } catch (t) {
160
+ m.warning(
161
+ typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
154
162
  );
155
- const t = o.value.findIndex((s) => s.uid === e.uid);
156
- t > -1 && o.value.splice(t, 1), g.value--;
163
+ const n = s.value.findIndex((o) => o.uid === e.uid);
164
+ n > -1 && s.value.splice(n, 1), v.value--;
157
165
  }
158
166
  }
159
- function j(e) {
160
- var n;
167
+ function G(e) {
168
+ var t;
161
169
  if (e.path) {
162
170
  if (Array.isArray(c.value)) {
163
- const t = _.findIndex(
164
- (s) => s.uid === e.uid
171
+ const n = f.findIndex(
172
+ (o) => o.uid === e.uid
165
173
  );
166
- t >= 0 && (c == null || c.value.splice(t, 1), _.splice(t, 1)), c.value.length === 0 && (c.value = void 0);
174
+ n >= 0 && (c == null || c.value.splice(n, 1), f.splice(n, 1)), c.value.length === 0 && (c.value = void 0);
167
175
  }
168
176
  } else
169
- (n = e == null ? void 0 : e.oss) == null || n.pauseUpload();
170
- const a = o.value.findIndex(
171
- (t) => t.uid === e.uid
177
+ (t = e == null ? void 0 : e.oss) == null || t.pauseUpload();
178
+ const a = s.value.findIndex(
179
+ (n) => n.uid === e.uid
172
180
  );
173
- return o.value.splice(a, 1), Promise.resolve(!0);
181
+ return s.value.splice(a, 1), Promise.resolve(!0);
174
182
  }
175
- return (e, a) => (f(), h("div", {
176
- class: Q({
183
+ return (e, a) => (h(), g("div", {
184
+ class: X({
177
185
  [i(A)()]: !0,
178
186
  [i(A)("admin")]: i(O) === "admin"
179
187
  })
180
188
  }, [
181
- p("input", {
189
+ d("input", {
182
190
  style: { display: "none" },
183
191
  type: "file",
184
192
  ref_key: "fileRef",
185
- ref: x,
186
- accept: i(y),
187
- onChange: q
188
- }, null, 40, re),
189
- p("div", le, [
190
- (f(!0), h(W, null, X(i(o), (n) => (f(), h("div", {
191
- class: "picture-item",
192
- key: n.uid
193
+ ref: _,
194
+ accept: i(w),
195
+ onChange: L
196
+ }, null, 40, pe),
197
+ d("div", de, [
198
+ (h(!0), g(Y, null, Z(i(s), (t) => (h(), g("div", {
199
+ key: t.uid,
200
+ class: "picture-item"
193
201
  }, [
194
- p("div", pe, [
195
- p("img", {
196
- src: n.thumbUrl,
202
+ d("div", me, [
203
+ d("img", {
204
+ src: t.thumbUrl,
197
205
  alt: ""
198
- }, null, 8, de),
199
- Y(p("div", me, [
200
- p("div", {
206
+ }, null, 8, fe),
207
+ F(d("div", he, [
208
+ d("div", {
201
209
  class: "picture-item-close",
202
- onClick: (t) => j(n)
210
+ onClick: (n) => G(t)
203
211
  }, [
204
- C(i(te))
205
- ], 8, fe),
206
- n.status === "uploading" ? (f(), h("div", he, [
207
- C(i(ie), {
208
- percent: n.percent,
212
+ C(i(ae))
213
+ ], 8, ge),
214
+ t.status === "uploading" ? (h(), g("div", ve, [
215
+ C(i(ue), {
216
+ percent: t.percent,
209
217
  strokeColor: "#ffffff",
210
218
  trailColor: "rgba(255, 255, 255, 0.3)",
211
219
  size: 4,
@@ -213,21 +221,21 @@ const re = ["accept"], le = { class: "picture-context" }, pe = { class: "picture
213
221
  }, null, 8, ["percent"])
214
222
  ])) : $("", !0)
215
223
  ], 512), [
216
- [Z, n.status === "uploading"]
224
+ [ee, t.status === "uploading"]
217
225
  ])
218
226
  ])
219
227
  ]))), 128)),
220
- i(l) === void 0 || i(o).length < i(l) ? (f(), h("div", {
228
+ i(l) === void 0 || i(s).length < i(l) ? (h(), g("div", {
221
229
  key: 0,
222
230
  class: "picture-upload",
223
- onClick: B
231
+ onClick: q
224
232
  }, [
225
- C(i(ne)),
226
- p("div", null, U(i(r)("ap.apUpload.update")), 1)
233
+ C(i(se)),
234
+ d("div", null, U(i(r)("ap.apUpload.update")), 1)
227
235
  ])) : $("", !0)
228
236
  ]),
229
- p("div", ge, [
230
- i(N) ? (f(), h("div", ve, U(i(N)), 1)) : (f(), h("div", _e, U(`${i(r)("ap.apUpload.supportExtension")}:${i(oe)(i(y))},${i(r)(
237
+ d("div", xe, [
238
+ i(N) ? (h(), g("div", _e, U(i(N)), 1)) : (h(), g("div", ye, U(`${i(r)("ap.apUpload.supportExtension")}:${i(ce)(i(w))},${i(r)(
231
239
  "ap.apUpload.maxUploadPictureSize",
232
240
  { maxSize: i(k) }
233
241
  )}`), 1))
@@ -236,5 +244,5 @@ const re = ["accept"], le = { class: "picture-context" }, pe = { class: "picture
236
244
  }
237
245
  });
238
246
  export {
239
- be as default
247
+ Ie as default
240
248
  };
@@ -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;