@aplus-frontend/ui 0.0.28 → 0.0.30

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 (81) hide show
  1. package/es/src/ap-download/hooks/index.mjs +4 -3
  2. package/es/src/ap-download/interface.d.ts +2 -2
  3. package/es/src/ap-field/date/helper.mjs +5 -5
  4. package/es/src/ap-field/date-range/index.vue.mjs +15 -15
  5. package/es/src/ap-form/ap-form-list.vue.mjs +29 -21
  6. package/es/src/ap-form/ap-form.vue2.mjs +77 -77
  7. package/es/src/ap-form/interface.d.ts +4 -0
  8. package/es/src/ap-form/search-form/index.vue.mjs +123 -99
  9. package/es/src/ap-form/style/search-form.css +6 -0
  10. package/es/src/ap-table/hooks/use-table-paging.mjs +23 -21
  11. package/es/src/ap-upload/apUpload.vue.d.ts +3 -11
  12. package/es/src/ap-upload/apUpload.vue.mjs +42 -36
  13. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +115 -102
  14. package/es/src/ap-upload/components/Picture.vue2.mjs +121 -111
  15. package/es/src/ap-upload/components/SingleFile.vue2.mjs +120 -109
  16. package/es/src/ap-upload/hooks/useOss.d.ts +9 -4
  17. package/es/src/ap-upload/hooks/useOss.mjs +52 -34
  18. package/es/src/ap-upload/styles/multiple-file.css +1 -1
  19. package/es/src/ap-upload/utils/accept.d.ts +3 -0
  20. package/es/src/ap-upload/utils/accept.mjs +35 -30
  21. package/es/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  22. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +7 -6
  23. package/es/src/business/ap-status/interface.d.ts +4 -1
  24. package/es/src/business/index.d.ts +41 -8
  25. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  26. package/es/src/config-provider/config-provider-props.mjs +4 -0
  27. package/es/src/config-provider/config-provider.d.ts +10 -1
  28. package/es/src/config-provider/config-provider.mjs +9 -8
  29. package/es/src/config-provider/constants.d.ts +10 -0
  30. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  31. package/es/src/config-provider/index.d.ts +20 -1
  32. package/es/src/editable-table/style/index.css +3 -0
  33. package/es/src/locale/lang/en.mjs +24 -0
  34. package/es/src/locale/lang/zh-cn.mjs +24 -0
  35. package/es/src/theme/ap-form/search-form.css +6 -0
  36. package/es/src/theme/ap-upload/multiple-file.css +1 -1
  37. package/es/src/theme/editable-table/index.css +3 -0
  38. package/es/src/work-order-modal/createWorkOrder.d.ts +3 -1
  39. package/es/src/work-order-modal/interfaces.d.ts +3 -1
  40. package/es/src/work-order-modal/work-order-modal.vue.mjs +7 -7
  41. package/lib/src/ap-download/hooks/index.js +1 -1
  42. package/lib/src/ap-download/interface.d.ts +2 -2
  43. package/lib/src/ap-field/date/helper.js +1 -1
  44. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  45. package/lib/src/ap-form/ap-form-list.vue.js +1 -1
  46. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  47. package/lib/src/ap-form/interface.d.ts +4 -0
  48. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  49. package/lib/src/ap-form/style/search-form.css +6 -0
  50. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  51. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -11
  52. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  53. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  54. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  55. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  56. package/lib/src/ap-upload/hooks/useOss.d.ts +9 -4
  57. package/lib/src/ap-upload/hooks/useOss.js +1 -1
  58. package/lib/src/ap-upload/styles/multiple-file.css +1 -1
  59. package/lib/src/ap-upload/utils/accept.d.ts +3 -0
  60. package/lib/src/ap-upload/utils/accept.js +1 -1
  61. package/lib/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  62. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  63. package/lib/src/business/ap-status/interface.d.ts +4 -1
  64. package/lib/src/business/index.d.ts +41 -8
  65. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  66. package/lib/src/config-provider/config-provider-props.js +1 -1
  67. package/lib/src/config-provider/config-provider.d.ts +10 -1
  68. package/lib/src/config-provider/config-provider.js +1 -1
  69. package/lib/src/config-provider/constants.d.ts +10 -0
  70. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  71. package/lib/src/config-provider/index.d.ts +20 -1
  72. package/lib/src/editable-table/style/index.css +3 -0
  73. package/lib/src/locale/lang/en.js +1 -1
  74. package/lib/src/locale/lang/zh-cn.js +1 -1
  75. package/lib/src/theme/ap-form/search-form.css +6 -0
  76. package/lib/src/theme/ap-upload/multiple-file.css +1 -1
  77. package/lib/src/theme/editable-table/index.css +3 -0
  78. package/lib/src/work-order-modal/createWorkOrder.d.ts +3 -1
  79. package/lib/src/work-order-modal/interfaces.d.ts +3 -1
  80. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  81. package/package.json +1 -1
@@ -1,213 +1,224 @@
1
- import { defineComponent as Z, inject as l, ref as g, watch as V, computed as ee, openBlock as h, createElementBlock as b, normalizeClass as te, unref as n, createElementVNode as r, toDisplayString as A, createCommentVNode as S, normalizeStyle as ne, createBlock as ae, withModifiers as se, createVNode as oe } from "vue";
1
+ import { defineComponent as V, inject as s, ref as h, watch as ee, computed as te, openBlock as _, createElementBlock as A, normalizeClass as ae, unref as a, createElementVNode as i, toDisplayString as x, createCommentVNode as z, normalizeStyle as ne, createBlock as oe, withModifiers as le, createVNode as se } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getName as le, getReturnData as U } from "../utils/returnData.mjs";
4
- import { useOss as re, useOssInit as ie } from "../hooks/useOss.mjs";
5
- import { fileMatchesAccept as ce, getAcceptText as ue } from "../utils/accept.mjs";
6
- import { message as c, Progress as ve } from "ant-design-vue";
7
- import { DeleteOutlined as fe } from "@ant-design/icons-vue";
8
- import I from "../assets/single-file-icon.png.mjs";
3
+ import { getName as re, getReturnData as $ } from "../utils/returnData.mjs";
4
+ import { useOss as ie, useOssInit as ce } from "../hooks/useOss.mjs";
5
+ import { fileMatchesAccept as ue, getAcceptText as pe } from "../utils/accept.mjs";
6
+ import { message as u, Progress as ve } from "ant-design-vue";
7
+ import { DeleteOutlined as de } from "@ant-design/icons-vue";
8
+ import q from "../assets/single-file-icon.png.mjs";
9
9
  import "../styles/single-file.css";
10
- import { useNamespace as pe } from "../../config-provider/hooks/use-namespace.mjs";
11
- const de = ["accept"], me = {
10
+ import { useLocale as fe } from "../../config-provider/hooks/use-locale.mjs";
11
+ import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
12
+ const ge = ["accept"], he = {
12
13
  key: 0,
13
14
  class: "state-un"
14
- }, ge = ["src"], he = { class: "state-un-title" }, _e = { class: "state-un-subtitle" }, Ce = {
15
+ }, _e = ["src"], ke = { class: "state-un-title" }, ye = { class: "state-un-subtitle" }, De = {
15
16
  key: 1,
16
17
  class: "state-ing"
17
- }, De = { class: "left" }, ke = ["src"], ye = { class: "center" }, we = { class: "center-progress" }, Re = /* @__PURE__ */ Z({
18
+ }, Ce = { class: "left" }, we = ["src"], Fe = { class: "center" }, Ue = { class: "center-progress" }, Te = /* @__PURE__ */ V({
18
19
  __name: "SingleFile",
19
- setup(Fe) {
20
- const { b: _ } = pe("ap-upload-single-file"), { put: $, client: z } = re(), C = l("theme"), q = l("dirName"), D = l("accept") || "*", k = l("maxSize") || 500, j = l("title") || "点击或将文件拖拽到这里上传", y = l("subTitle"), a = l("value"), w = l("needName"), u = l("uploadingCount"), P = l("beforeUpload"), x = l("customRequest"), G = l("getOssAccess"), s = g(null);
21
- V(
22
- () => a == null ? void 0 : a.value,
20
+ setup(Ne) {
21
+ const { t: r } = fe(), { b: k } = me("ap-upload-single-file"), { put: M, client: B } = ie(), y = s("theme"), j = s("dirName"), D = s("accept") || "*", C = s("maxSize") ?? 500, G = s("title") || r("ap.apUpload.clickOrDragUpload"), w = s("subTitle"), n = s("value"), F = s("needName"), p = s("uploadingCount"), b = s("beforeUpload"), O = s("customRequest"), W = s("getOssAccess"), o = h(null);
22
+ ee(
23
+ () => n == null ? void 0 : n.value,
23
24
  function(e) {
24
- const t = le(w, e);
25
- s.value === null && e && (o.value = 3, s.value = new File([e], t, {}));
25
+ const t = re(F, e);
26
+ o.value === null && e && (l.value = 3, o.value = new File([e], t, {}));
26
27
  }
27
28
  );
28
- const o = g(1), p = g(0), d = g(null), O = ee(() => s.value && (a == null ? void 0 : a.value));
29
+ const l = h(1), f = h(0), m = h(null), P = te(() => o.value && (n == null ? void 0 : n.value));
29
30
  function H() {
30
31
  var e;
31
- o.value === 1 && ((e = d.value) == null || e.click());
32
+ l.value === 1 && ((e = m.value) == null || e.click());
32
33
  }
33
- function R(e) {
34
+ function L(e) {
34
35
  e.preventDefault(), e.stopPropagation();
35
36
  }
36
37
  function J(e) {
37
38
  e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
38
39
  }
39
40
  function K(e) {
40
- T(e);
41
+ R(e);
41
42
  }
42
43
  function Q(e) {
43
- if (e.preventDefault(), e.stopPropagation(), o.value !== 1)
44
+ if (e.preventDefault(), e.stopPropagation(), l.value !== 1)
44
45
  return;
45
- var t = e.dataTransfer, i = [], L = 0, M = t.files.length;
46
+ var t = e.dataTransfer, c = [], T = 0, I = t.files.length;
46
47
  function v() {
47
- L === M - 1 && K(i), L++;
48
+ T === I - 1 && K(c), T++;
48
49
  }
49
50
  if (t.items !== void 0)
50
- for (var F = 0; F < t.items.length; F++) {
51
- var B = t.items[F];
52
- if (B.kind === "file" && B.webkitGetAsEntry().isFile) {
53
- var Y = B.getAsFile();
54
- i.push(Y), v();
51
+ for (var U = 0; U < t.items.length; U++) {
52
+ var N = t.items[U];
53
+ if (N.kind === "file" && N.webkitGetAsEntry().isFile) {
54
+ var Z = N.getAsFile();
55
+ c.push(Z), v();
55
56
  }
56
57
  }
57
58
  else
58
- for (let N = 0; N < M; N++) {
59
- var m = t.files[N];
60
- if (m.type)
61
- i.push(m), v();
59
+ for (let E = 0; E < I; E++) {
60
+ var g = t.files[E];
61
+ if (g.type)
62
+ c.push(g), v();
62
63
  else
63
64
  try {
64
- var E = new FileReader();
65
- E.readAsDataURL(m.slice(0, 3)), E.addEventListener(
65
+ var S = new FileReader();
66
+ S.readAsDataURL(g.slice(0, 3)), S.addEventListener(
66
67
  "load",
67
- function(f) {
68
- console.warn(f, "load"), i.push(m), v();
68
+ function(d) {
69
+ console.warn(d, "load"), c.push(g), v();
69
70
  },
70
71
  !1
71
- ), E.addEventListener(
72
+ ), S.addEventListener(
72
73
  "error",
73
- function(f) {
74
- console.warn(f, "error"), c.warning("不支持上传文件夹"), v();
74
+ function(d) {
75
+ console.warn(d, "error"), u.warning(r("ap.apUpload.foldersNotSupported")), v();
75
76
  },
76
77
  !1
77
78
  );
78
- } catch (f) {
79
- console.warn(f), c.warning("不支持上传文件夹"), v();
79
+ } catch (d) {
80
+ console.warn(d), u.warning(r("ap.apUpload.foldersNotSupported")), v();
80
81
  }
81
82
  }
82
83
  }
83
- function W(e) {
84
+ function X(e) {
84
85
  const t = e.target;
85
- T(t == null ? void 0 : t.files), d.value && (d.value.value = "");
86
+ R(t == null ? void 0 : t.files), m.value && (m.value.value = "");
86
87
  }
87
- async function T(e) {
88
+ async function R(e) {
88
89
  if (e != null && e.length) {
89
- if (typeof P == "function") {
90
- if (P(e[0]) === !1)
90
+ if (typeof b == "function") {
91
+ if (b(e[0]) === !1)
91
92
  return;
92
93
  } else {
93
- if (e[0].size > k * 1024 * 1024) {
94
- c.warning(`文件大小不超过${k}MB`);
94
+ if (e[0].size > C * 1024 * 1024) {
95
+ u.warning(
96
+ r("ap.apUpload.maxUploadFileSize", {
97
+ maxSize: C
98
+ })
99
+ );
95
100
  return;
96
101
  }
97
- if (!ce(e[0], D)) {
98
- c.warning("不支持该格式的文件");
102
+ if (!ue(e[0], D)) {
103
+ u.warning(r("ap.apUpload.fileFormatNotSupported"));
99
104
  return;
100
105
  }
101
106
  }
102
- if (s.value = e[0], o.value = 2, p.value = 0, a.value = "", u.value++, typeof x == "function") {
103
- x({
107
+ if (o.value = e[0], l.value = 2, f.value = 0, n.value = "", p.value++, typeof O == "function") {
108
+ O({
104
109
  onProgress: (t) => {
105
- p.value = t;
110
+ f.value = t;
106
111
  },
107
112
  onError: (t) => {
108
- c.warning(t || "网络异常"), o.value = 1, s.value = null, u.value--;
113
+ u.warning(t || r("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, p.value--;
109
114
  },
110
115
  onSuccess: (t) => {
111
- a.value = U(
112
- w,
116
+ n.value = $(
117
+ F,
113
118
  t,
114
- s.value.name
115
- ), o.value = 3, u.value--;
119
+ o.value.name
120
+ ), l.value = 3, p.value--;
116
121
  },
117
122
  file: e[0]
118
123
  });
119
124
  return;
120
125
  }
121
126
  try {
122
- await ie(G), $({
123
- file: s.value,
124
- dirName: q,
125
- oss: z,
127
+ await ce(W), M({
128
+ file: o.value,
129
+ dirName: j,
130
+ oss: B,
126
131
  successCallBack(t) {
127
- a.value = U(
128
- w,
132
+ n.value = $(
133
+ F,
129
134
  t,
130
- s.value.name
131
- ), o.value = 3, u.value--;
135
+ o.value.name
136
+ ), l.value = 3, p.value--;
132
137
  },
133
138
  errorCallBack(t) {
134
- c.warning(t || "网络异常"), o.value = 1, s.value = null, u.value--;
139
+ u.warning(t || r("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, p.value--;
135
140
  },
136
141
  progressCallBack(t) {
137
- p.value = t;
142
+ f.value = t;
138
143
  }
139
144
  });
140
145
  } catch (t) {
141
- c.warning(typeof (t == null ? void 0 : t.message) == "string" ? t.message : "网络异常"), o.value = 1, s.value = null, u.value--;
146
+ u.warning(
147
+ typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
148
+ ), l.value = 1, o.value = null, p.value--;
142
149
  }
143
150
  }
144
151
  }
145
- function X() {
146
- s.value && !(a != null && a.value) && z.pauseUpload(), o.value = 1, s.value = null, a.value = void 0;
152
+ function Y() {
153
+ o.value && !(n != null && n.value) && B.pauseUpload(), l.value = 1, o.value = null, n.value = void 0;
147
154
  }
148
155
  return (e, t) => {
149
- var i;
150
- return h(), b("div", {
151
- class: te({
152
- [n(_)()]: !0,
153
- [n(_)("admin")]: n(C) === "admin",
154
- [n(_)("un")]: o.value === 1
156
+ var c;
157
+ return _(), A("div", {
158
+ class: ae({
159
+ [a(k)()]: !0,
160
+ [a(k)("admin")]: a(y) === "admin",
161
+ [a(k)("un")]: l.value === 1
155
162
  }),
156
163
  onClick: H,
157
- onDragenter: R,
164
+ onDragenter: L,
158
165
  onDragover: J,
159
- onDragleave: R,
166
+ onDragleave: L,
160
167
  onDrop: Q
161
168
  }, [
162
- r("input", {
169
+ i("input", {
163
170
  style: { display: "none" },
164
171
  type: "file",
165
172
  ref_key: "fileRef",
166
- ref: d,
167
- accept: n(D),
168
- onChange: W
169
- }, null, 40, de),
170
- o.value === 1 ? (h(), b("div", me, [
171
- r("img", {
173
+ ref: m,
174
+ accept: a(D),
175
+ onChange: X
176
+ }, null, 40, ge),
177
+ l.value === 1 ? (_(), A("div", he, [
178
+ i("img", {
172
179
  class: "state-un-icon",
173
- src: n(I)
174
- }, null, 8, ge),
175
- r("div", he, A(n(j)), 1),
176
- r("div", _e, A(typeof n(y) == "string" && n(y).length > 0 ? n(y) : `支持扩展名:${n(ue)(n(D))},文件大小小于${n(k)}MB`), 1)
177
- ])) : S("", !0),
178
- [2, 3].includes(o.value) ? (h(), b("div", Ce, [
179
- r("div", De, [
180
- r("img", { src: n(I) }, null, 8, ke)
180
+ src: a(q)
181
+ }, null, 8, _e),
182
+ i("div", ke, x(a(G)), 1),
183
+ i("div", ye, x(typeof a(w) == "string" && a(w).length > 0 ? a(w) : `${a(r)("ap.apUpload.supportExtension")}:${a(pe)(
184
+ a(D)
185
+ )},${a(r)("ap.apUpload.maxWarnUploadFileSize", {
186
+ maxSize: a(C)
187
+ })}`), 1)
188
+ ])) : z("", !0),
189
+ [2, 3].includes(l.value) ? (_(), A("div", De, [
190
+ i("div", Ce, [
191
+ i("img", { src: a(q) }, null, 8, we)
181
192
  ]),
182
- r("div", ye, [
183
- r("div", {
193
+ i("div", Fe, [
194
+ i("div", {
184
195
  class: "center-title",
185
196
  style: ne({
186
- color: O.value ? "#0070FF" : "#182948"
197
+ color: P.value ? "#0070FF" : "#182948"
187
198
  })
188
- }, A((i = s.value) == null ? void 0 : i.name), 5),
189
- r("div", we, [
190
- O.value ? S("", !0) : (h(), ae(n(ve), {
199
+ }, x((c = o.value) == null ? void 0 : c.name), 5),
200
+ i("div", Ue, [
201
+ P.value ? z("", !0) : (_(), oe(a(ve), {
191
202
  key: 0,
192
- percent: p.value,
203
+ percent: f.value,
193
204
  size: 4,
194
205
  showInfo: !1,
195
- trailColor: n(C) === "admin" ? "#D9D9D9" : "#DEE4ED",
196
- strokeColor: n(C) === "admin" ? "#34B77C" : "#0070FF"
206
+ trailColor: a(y) === "admin" ? "#D9D9D9" : "#DEE4ED",
207
+ strokeColor: a(y) === "admin" ? "#34B77C" : "#0070FF"
197
208
  }, null, 8, ["percent", "trailColor", "strokeColor"]))
198
209
  ])
199
210
  ]),
200
- r("div", {
211
+ i("div", {
201
212
  class: "right",
202
- onClick: se(X, ["stop"])
213
+ onClick: le(Y, ["stop"])
203
214
  }, [
204
- oe(n(fe))
215
+ se(a(de))
205
216
  ])
206
- ])) : S("", !0)
217
+ ])) : z("", !0)
207
218
  ], 34);
208
219
  };
209
220
  }
210
221
  });
211
222
  export {
212
- Re as default
223
+ Te as default
213
224
  };
@@ -1,9 +1,14 @@
1
- import { Oss } from '@aplus-frontend/oss';
1
+ import { client, Oss } from '@aplus-frontend/oss';
2
+ import { Translator } from '../../config-provider';
3
+ import { Ref } from 'vue';
4
+
2
5
  export type { Oss } from '@aplus-frontend/oss';
6
+ export type GetOssAccess = Parameters<typeof client.initOssClient>[0]['getOssAccess'];
7
+ export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
3
8
  declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack }: {
4
9
  file: File;
5
10
  dirName: string;
6
- oss: any;
11
+ oss: Oss;
7
12
  successCallBack: (saveUrl: string, previewUrl: string) => void;
8
13
  errorCallBack: (msg: string) => void;
9
14
  progressCallBack: (p: number) => void;
@@ -12,8 +17,8 @@ export declare function useOss(): {
12
17
  client: Oss;
13
18
  put: typeof put;
14
19
  };
15
- export declare function useOssInit(getOssAccess: any): Promise<{
20
+ export declare function useOssInit(getOssAccess: GetOssAccess): Promise<{
16
21
  client: Oss;
17
22
  put: typeof put;
18
23
  }>;
19
- export declare function getOssInstance(getOssAccess: any): Promise< Oss>;
24
+ export declare function getOssInstance(getOssAccess: Parameters<typeof client.initOssClient>[0]['getOssAccess']): Promise<Oss>;
@@ -1,62 +1,80 @@
1
- import { client as o, createOssInstance as w } from "@aplus-frontend/oss";
2
- async function f({
3
- file: t,
1
+ import { client as p, createOssInstance as m } from "@aplus-frontend/oss";
2
+ let e, l;
3
+ function y(a, s) {
4
+ e = a, l = s;
5
+ }
6
+ const w = {
7
+ "zh-cn": "zh_CN",
8
+ en: "en_US"
9
+ };
10
+ function c() {
11
+ return w[l.value] ?? "zh_CN";
12
+ }
13
+ async function g({
14
+ file: a,
4
15
  dirName: s,
5
- oss: e,
6
- successCallBack: c,
7
- errorCallBack: i,
16
+ oss: t,
17
+ successCallBack: r,
18
+ errorCallBack: o,
8
19
  progressCallBack: u
9
20
  }) {
21
+ if (!s) {
22
+ o("required dirName");
23
+ return;
24
+ }
10
25
  try {
11
- const n = await e.put({
12
- fileName: t.name,
26
+ const n = await t.put({
27
+ fileName: a.name,
13
28
  dirName: s,
14
- data: t,
15
- progressCallBack: (a) => {
16
- u(a);
29
+ data: a,
30
+ progressCallBack: (i) => {
31
+ u(i);
17
32
  }
18
33
  });
19
34
  if (n.status === 204)
20
35
  return;
21
36
  if (n.status === 200) {
22
- const { saveUrl: a, previewUrl: r } = n;
23
- c(a, r);
37
+ const { saveUrl: i, previewUrl: f } = n;
38
+ r(i, f);
24
39
  } else
25
- i((n == null ? void 0 : n.message) || "网络异常");
40
+ o((n == null ? void 0 : n.message) || e("ap.apUpload.networkAnomaly"));
26
41
  } catch (n) {
27
- i(n);
42
+ o(n);
28
43
  }
29
44
  }
30
- function g() {
31
- return { client: o, put: f };
45
+ function O() {
46
+ return { client: p, put: g };
32
47
  }
33
- async function p(t) {
34
- if (!t)
35
- throw new Error("请传入getOssAccess");
36
- return await o.initOssClient({
37
- getOssAccess: t,
48
+ async function h(a) {
49
+ if (!a)
50
+ throw new Error(`${e("ap.apUpload.pleasePass")}getOssAccess`);
51
+ return await p.initOssClient({
52
+ getOssAccess: a,
53
+ locale: c(),
38
54
  onFailure: (s) => {
39
55
  throw new Error(
40
- typeof (s == null ? void 0 : s.message) == "string" ? s.message : "获取oss临时权限失败"
56
+ typeof (s == null ? void 0 : s.message) == "string" ? s.message : e("ap.apUpload.FailedToObtainOssTemporaryPermissions")
41
57
  );
42
58
  }
43
- }), g();
59
+ }), O();
44
60
  }
45
- async function l(t) {
46
- if (!t)
47
- throw new Error("请传入getOssAccess");
48
- const s = w();
61
+ async function U(a) {
62
+ if (!a)
63
+ throw new Error(`${e("ap.apUpload.pleasePass")}getOssAccess`);
64
+ const s = m();
49
65
  return await s.initOssClient({
50
- getOssAccess: t,
51
- onFailure: (e) => {
66
+ getOssAccess: a,
67
+ locale: c(),
68
+ onFailure: (t) => {
52
69
  throw new Error(
53
- typeof (e == null ? void 0 : e.message) == "string" ? e.message : "获取oss临时权限失败"
70
+ typeof (t == null ? void 0 : t.message) == "string" ? t.message : e("ap.apUpload.FailedToObtainOssTemporaryPermissions")
54
71
  );
55
72
  }
56
73
  }), s;
57
74
  }
58
75
  export {
59
- l as getOssInstance,
60
- g as useOss,
61
- p as useOssInit
76
+ U as getOssInstance,
77
+ y as injectLocaleToOss,
78
+ O as useOss,
79
+ h as useOssInit
62
80
  };
@@ -16,7 +16,7 @@
16
16
  color: #0070ff;
17
17
  }
18
18
  .aplus-ap-upload-multiple-file .multiple-file-context .sub-title {
19
- margin-left: 16px;
19
+ padding-left: 16px;
20
20
  color: #8896b0;
21
21
  font-size: 14px;
22
22
  }
@@ -1,3 +1,6 @@
1
+ import { Translator } from '../../config-provider';
2
+
3
+ export declare function injectLocaleToAccept(value: Translator): void;
1
4
  /**
2
5
  * 校验文件是否满足指定的格式
3
6
  * @param file
@@ -1,51 +1,56 @@
1
- import p from "mime";
2
- function f(n, i) {
3
- var s, o, u, a;
4
- const e = i.split(",").map((t) => t.trim());
5
- for (const t of e) {
6
- if (t === "*")
1
+ import r from "mime";
2
+ let a;
3
+ function f(t) {
4
+ a = t;
5
+ }
6
+ function y(t, i) {
7
+ var p, o, l, c;
8
+ const e = i.split(",").map((n) => n.trim());
9
+ for (const n of e) {
10
+ if (n === "*")
7
11
  return !0;
8
- if (t.endsWith("/*")) {
9
- const [r] = t.split("/"), [c] = n.type.split("/");
10
- if (r === c)
12
+ if (n.endsWith("/*")) {
13
+ const [s] = n.split("/"), [u] = t.type.split("/");
14
+ if (s === u)
11
15
  return !0;
12
- } else if (/^\./.test(t)) {
13
- if (n.type === p.getType(t))
16
+ } else if (/^\./.test(n)) {
17
+ if (t.type === r.getType(n))
14
18
  return !0;
15
- const r = (s = n.name) == null ? void 0 : s.lastIndexOf(".");
16
- if (r > -1 && ((o = n.name) == null ? void 0 : o.slice(r)) === t)
19
+ const s = (p = t.name) == null ? void 0 : p.lastIndexOf(".");
20
+ if (s > -1 && ((o = t.name) == null ? void 0 : o.slice(s)) === n)
17
21
  return !0;
18
22
  } else {
19
- if (n.type === t)
23
+ if (t.type === n)
20
24
  return !0;
21
- const r = (u = n.name) == null ? void 0 : u.lastIndexOf(".");
22
- if (r > -1 && [...p.getAllExtensions(t) || []].map(
23
- (l) => `.${l}`
24
- ).includes((a = n.name) == null ? void 0 : a.slice(r)))
25
+ const s = (l = t.name) == null ? void 0 : l.lastIndexOf(".");
26
+ if (s > -1 && [...r.getAllExtensions(n) || []].map(
27
+ (m) => `.${m}`
28
+ ).includes((c = t.name) == null ? void 0 : c.slice(s)))
25
29
  return !0;
26
30
  }
27
31
  }
28
32
  return !1;
29
33
  }
30
- function y(n) {
34
+ function T(t) {
31
35
  const i = {
32
- image: "图片类型",
33
- video: "视频类型",
34
- audio: "音频类型",
35
- application: "文档类型",
36
- "*": "全部类型"
36
+ image: a("ap.apUpload.pictureType"),
37
+ video: a("ap.apUpload.videoType"),
38
+ audio: a("ap.apUpload.audioType"),
39
+ application: a("ap.apUpload.documentType"),
40
+ "*": a("ap.apUpload.allTypes")
37
41
  };
38
- return n.split(",").map((e) => e.trim()).map((e) => {
42
+ return t.split(",").map((e) => e.trim()).map((e) => {
39
43
  if (e === "*")
40
44
  return i[e];
41
45
  if (e.endsWith("/*")) {
42
- const [s] = e.split("/");
43
- return i[s] || s;
46
+ const [p] = e.split("/");
47
+ return i[p] || p;
44
48
  } else
45
- return /^\./.test(e) ? e : [...p.getAllExtensions(e) || []].map((s) => `.${s}`).join(",") || e;
49
+ return /^\./.test(e) ? e : [...r.getAllExtensions(e) || []].map((p) => `.${p}`).join(",") || e;
46
50
  }).join(",");
47
51
  }
48
52
  export {
49
- f as fileMatchesAccept,
50
- y as getAcceptText
53
+ y as fileMatchesAccept,
54
+ T as getAcceptText,
55
+ f as injectLocaleToAccept
51
56
  };
@@ -1,18 +1,23 @@
1
- import { ApStatusGroupProps, ApStatusGroupItemProps } from './interface';
1
+ import { ApStatusGroupProps, ApStatusProps } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
3
 
4
4
  declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApStatusGroupProps>, {
5
5
  currentValue: number;
6
6
  padding: number;
7
7
  statusList: null;
8
+ show: boolean;
8
9
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApStatusGroupProps>, {
9
10
  currentValue: number;
10
11
  padding: number;
11
12
  statusList: null;
13
+ show: boolean;
12
14
  }>>>, {
13
15
  padding: number;
16
+ show: boolean;
14
17
  currentValue: string | number;
15
- statusList: ApStatusGroupItemProps[] | null;
18
+ statusList: Required<Pick< ApStatusProps, "text" | "color"> & {
19
+ value: string | number;
20
+ }>[] | null;
16
21
  }, {}>;
17
22
  export default _default;
18
23
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;