@aplus-frontend/ui 7.10.4 → 7.10.6

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 (59) hide show
  1. package/es/src/ap-field/interface.d.ts +1 -1
  2. package/es/src/ap-field/slider/index.vue.d.ts +196 -412
  3. package/es/src/ap-field/slider/index.vue.mjs +50 -39
  4. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +68 -67
  5. package/es/src/business/ap-attachment/ApAttachment.d.ts +2 -8
  6. package/es/src/business/ap-attachment/ApAttachment.mjs +46 -40
  7. package/es/src/business/ap-attachment/constans.d.ts +1 -4
  8. package/es/src/business/ap-attachment/constans.mjs +3 -6
  9. package/es/src/business/ap-attachment/index.d.ts +3 -12
  10. package/es/src/business/ap-ladder/components/RenderValue.mjs +25 -22
  11. package/es/src/business/ap-ladder/utils.d.ts +1 -0
  12. package/es/src/business/ap-ladder/utils.mjs +10 -9
  13. package/es/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  14. package/es/src/business/ap-title/index.d.ts +3 -3
  15. package/es/src/business/ap-title/interface.d.ts +1 -1
  16. package/es/src/business/ap-upload/apUpload.vue.d.ts +9 -0
  17. package/es/src/business/ap-upload/apUpload.vue.mjs +22 -18
  18. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -123
  19. package/es/src/business/ap-upload/components/Picture.vue2.mjs +150 -147
  20. package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +130 -127
  21. package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  22. package/es/src/business/ap-upload/hooks/useOss.mjs +52 -51
  23. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +11 -10
  24. package/es/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  25. package/es/src/business/ap-upload-file/hook/useOss.mjs +19 -16
  26. package/es/src/business/ap-upload-file/interface.d.ts +3 -1
  27. package/es/src/business/ap-upload-file/utils/upload.mjs +22 -20
  28. package/es/src/version.d.ts +1 -1
  29. package/es/src/version.mjs +1 -1
  30. package/lib/src/ap-field/interface.d.ts +1 -1
  31. package/lib/src/ap-field/slider/index.vue.d.ts +196 -412
  32. package/lib/src/ap-field/slider/index.vue.js +1 -1
  33. package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
  34. package/lib/src/business/ap-attachment/ApAttachment.d.ts +2 -8
  35. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  36. package/lib/src/business/ap-attachment/constans.d.ts +1 -4
  37. package/lib/src/business/ap-attachment/constans.js +1 -1
  38. package/lib/src/business/ap-attachment/index.d.ts +3 -12
  39. package/lib/src/business/ap-ladder/components/RenderValue.js +1 -1
  40. package/lib/src/business/ap-ladder/utils.d.ts +1 -0
  41. package/lib/src/business/ap-ladder/utils.js +1 -1
  42. package/lib/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  43. package/lib/src/business/ap-title/index.d.ts +3 -3
  44. package/lib/src/business/ap-title/interface.d.ts +1 -1
  45. package/lib/src/business/ap-upload/apUpload.vue.d.ts +9 -0
  46. package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
  47. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  48. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  49. package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
  50. package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  51. package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
  52. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  53. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  54. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -1
  55. package/lib/src/business/ap-upload-file/interface.d.ts +3 -1
  56. package/lib/src/business/ap-upload-file/utils/upload.js +1 -1
  57. package/lib/src/version.d.ts +1 -1
  58. package/lib/src/version.js +1 -1
  59. package/package.json +3 -3
@@ -1,30 +1,33 @@
1
1
  import { createOssInstance as r } from "@aplus-frontend/oss";
2
- let n, o, t;
3
- function p(s, e, a) {
4
- n = s, o = e, a && (t = a);
2
+ let a, c, n;
3
+ function g(e, t, s) {
4
+ a = e, c = t, s && (n = s);
5
5
  }
6
6
  const i = {
7
7
  "zh-cn": "zh_CN",
8
8
  en: "en_US"
9
9
  };
10
- function c() {
11
- return i[o.value] ?? "zh_CN";
10
+ function l() {
11
+ return i[c.value] ?? "zh_CN";
12
12
  }
13
- async function g() {
14
- if (!t)
15
- throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);
16
- const s = r();
13
+ async function O({ bucket: e } = {}) {
14
+ if (!n)
15
+ throw new Error(`${a("ap.apUpload.pleasePass")}getOssAccess`);
16
+ const t = await (e ? n(e) : n()), s = r();
17
17
  return await s.initOssClient({
18
- getOssAccess: t,
19
- locale: c(),
20
- onFailure: (e) => {
18
+ getOssAccess: async () => t,
19
+ locale: l(),
20
+ onFailure: (o) => {
21
21
  throw new Error(
22
- typeof e?.message == "string" ? e.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
22
+ typeof o?.message == "string" ? o.message : a("ap.apUpload.FailedToObtainOssTemporaryPermissions")
23
23
  );
24
24
  }
25
- }), s;
25
+ }), {
26
+ oss: s,
27
+ bucket: t?.bucket
28
+ };
26
29
  }
27
30
  export {
28
- g as getOssInstance,
29
- p as injectHookOss
31
+ O as getOssInstance,
32
+ g as injectHookOss
30
33
  };
@@ -1,7 +1,7 @@
1
1
  import { UploadFile, UploadChangeParam, UploadProps } from '@aplus-frontend/antdv';
2
2
  import { accessCreate } from '@aplus-frontend/oss';
3
3
  import { VNodeChild } from 'vue';
4
- export type ApUploadGetOssAccess = () => Promise<accessCreate>;
4
+ export type ApUploadGetOssAccess = (bucket?: string) => Promise<accessCreate>;
5
5
  type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
6
6
  export type ApUploadFile<T = any> = UploadFile<T> & {
7
7
  ossDestroy?: () => any;
@@ -11,6 +11,7 @@ export type ApUploadCustomRequest = (option: Omit<Parameters<Exclude<UploadProps
11
11
  file?: ApUploadFile;
12
12
  }, props?: {
13
13
  dirName?: string;
14
+ bucket?: string;
14
15
  }) => void;
15
16
  export type ApUploadBaseProps<T = any> = {
16
17
  dirName: string;
@@ -23,6 +24,7 @@ export type ApUploadBaseProps<T = any> = {
23
24
  customRequest?: ApUploadCustomRequest;
24
25
  maxSizeErrorMsg?: string;
25
26
  acceptErrorMsg?: string;
27
+ bucket?: string;
26
28
  };
27
29
  export type ApUploadSingleProps<T = any> = ApUploadBaseProps<T> & {
28
30
  title?: VNodeChild;
@@ -1,14 +1,14 @@
1
1
  import { message as i } from "@aplus-frontend/antdv";
2
- import { getOssInstance as g } from "../hook/useOss.mjs";
3
- import { fileMatchesAccept as f } from "./accept.mjs";
2
+ import { getOssInstance as d } from "../hook/useOss.mjs";
3
+ import { fileMatchesAccept as x } from "./accept.mjs";
4
4
  let o;
5
- function U(e) {
5
+ function C(e) {
6
6
  o = e;
7
7
  }
8
8
  function m(e, r, a) {
9
9
  e.status = r, e.error = a;
10
10
  }
11
- function S(e, r, a) {
11
+ function z(e, r, a) {
12
12
  if (a?.maxCount && a.maxCount > 1 && r.length >= a.maxCount) {
13
13
  const t = a?.maxCountErrorMsg || o("ap.apUpload.maxUploadFiles", {
14
14
  maxCount: a.maxCount
@@ -21,42 +21,44 @@ function S(e, r, a) {
21
21
  });
22
22
  return i.warning(t), m(e, "error", t), !1;
23
23
  }
24
- if (!f(e, a.accept)) {
24
+ if (!x(e, a.accept)) {
25
25
  const t = a?.acceptErrorMsg || o("ap.apUpload.fileFormatNotSupported");
26
26
  return i.warning(t), m(e, "error", t), !1;
27
27
  }
28
28
  return !0;
29
29
  }
30
- const C = async (e, r) => {
31
- const { file: a, onError: t, onProgress: u, onSuccess: l } = e;
30
+ const M = async (e, r) => {
31
+ const { file: a, onError: t, onProgress: l, onSuccess: g } = e;
32
32
  try {
33
- const n = await (await g())?.put({
33
+ const { oss: c, bucket: u } = await d({
34
+ bucket: r?.bucket
35
+ }), s = await c?.put({
34
36
  dirName: r?.dirName,
35
37
  fileName: a?.name,
36
38
  data: a,
37
- progressCallBack: (s) => {
38
- u?.({
39
- percent: s
39
+ progressCallBack: (n) => {
40
+ l?.({
41
+ percent: n
40
42
  });
41
43
  }
42
44
  });
43
- if (n.status === 204)
45
+ if (s.status === 204)
44
46
  return;
45
- if (n.status === 200) {
46
- const { saveUrl: s } = n;
47
- l?.({
47
+ if (s.status === 200) {
48
+ const { saveUrl: n } = s, f = u && n ? `${u}:${n}` : n;
49
+ g?.({
48
50
  fileName: a?.name,
49
- path: s
51
+ path: f
50
52
  });
51
53
  } else
52
- t?.(n?.message || o("ap.apUpload.networkAnomaly"));
54
+ t?.(s?.message || o("ap.apUpload.networkAnomaly"));
53
55
  } catch (c) {
54
56
  t?.(c);
55
57
  }
56
58
  };
57
59
  export {
58
60
  m as changeFileStatus,
59
- U as injectUtilUpload,
60
- S as uploadBeforeUpload,
61
- C as uploadCustomRequest
61
+ C as injectUtilUpload,
62
+ z as uploadBeforeUpload,
63
+ M as uploadCustomRequest
62
64
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "7.10.4";
1
+ declare const _default: "7.10.6";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.10.4";
1
+ const e = "7.10.6";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -211,7 +211,7 @@ export type ApFieldTreeSelectExpose = Omit<ApFieldSelectExpose, 'request'> & {
211
211
  */
212
212
  request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
213
213
  };
214
- export type ApFieldSliderProps = BasicApFieldProps<SliderProps> & {
214
+ export type ApFieldSliderProps = BasicApFieldProps<Partial<SliderProps>> & {
215
215
  emptyText?: string;
216
216
  defaultValue?: number | [number, number];
217
217
  };