@aplus-frontend/ui 7.10.3 → 7.10.5

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 (71) 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-attachment/ApAttachment.d.ts +2 -8
  5. package/es/src/business/ap-attachment/ApAttachment.mjs +46 -40
  6. package/es/src/business/ap-attachment/constans.d.ts +1 -4
  7. package/es/src/business/ap-attachment/constans.mjs +3 -6
  8. package/es/src/business/ap-attachment/index.d.ts +3 -12
  9. package/es/src/business/ap-download/ap-download.vue.d.ts +2 -1
  10. package/es/src/business/ap-download/ap-download.vue.mjs +10 -10
  11. package/es/src/business/ap-image/ApImage.vue2.mjs +49 -46
  12. package/es/src/business/ap-image/hooks/useOss.d.ts +1 -1
  13. package/es/src/business/ap-image/hooks/useOss.mjs +30 -28
  14. package/es/src/business/ap-image/interface.d.ts +1 -1
  15. package/es/src/business/ap-ladder/components/RenderValue.mjs +25 -22
  16. package/es/src/business/ap-ladder/utils.d.ts +1 -0
  17. package/es/src/business/ap-ladder/utils.mjs +10 -9
  18. package/es/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  19. package/es/src/business/ap-title/index.d.ts +3 -3
  20. package/es/src/business/ap-title/interface.d.ts +1 -1
  21. package/es/src/business/ap-upload/apUpload.vue.d.ts +10 -1
  22. package/es/src/business/ap-upload/apUpload.vue.mjs +22 -18
  23. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -123
  24. package/es/src/business/ap-upload/components/Picture.vue2.mjs +150 -147
  25. package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +130 -127
  26. package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  27. package/es/src/business/ap-upload/hooks/useOss.mjs +52 -51
  28. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +11 -10
  29. package/es/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  30. package/es/src/business/ap-upload-file/hook/useOss.mjs +19 -16
  31. package/es/src/business/ap-upload-file/interface.d.ts +3 -1
  32. package/es/src/business/ap-upload-file/utils/upload.mjs +22 -20
  33. package/es/src/config-provider/constants.d.ts +2 -2
  34. package/es/src/version.d.ts +1 -1
  35. package/es/src/version.mjs +1 -1
  36. package/lib/src/ap-field/interface.d.ts +1 -1
  37. package/lib/src/ap-field/slider/index.vue.d.ts +196 -412
  38. package/lib/src/ap-field/slider/index.vue.js +1 -1
  39. package/lib/src/business/ap-attachment/ApAttachment.d.ts +2 -8
  40. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  41. package/lib/src/business/ap-attachment/constans.d.ts +1 -4
  42. package/lib/src/business/ap-attachment/constans.js +1 -1
  43. package/lib/src/business/ap-attachment/index.d.ts +3 -12
  44. package/lib/src/business/ap-download/ap-download.vue.d.ts +2 -1
  45. package/lib/src/business/ap-download/ap-download.vue.js +1 -1
  46. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  47. package/lib/src/business/ap-image/hooks/useOss.d.ts +1 -1
  48. package/lib/src/business/ap-image/hooks/useOss.js +1 -1
  49. package/lib/src/business/ap-image/interface.d.ts +1 -1
  50. package/lib/src/business/ap-ladder/components/RenderValue.js +1 -1
  51. package/lib/src/business/ap-ladder/utils.d.ts +1 -0
  52. package/lib/src/business/ap-ladder/utils.js +1 -1
  53. package/lib/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  54. package/lib/src/business/ap-title/index.d.ts +3 -3
  55. package/lib/src/business/ap-title/interface.d.ts +1 -1
  56. package/lib/src/business/ap-upload/apUpload.vue.d.ts +10 -1
  57. package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
  58. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  59. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  60. package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
  61. package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  62. package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
  63. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  64. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  65. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -1
  66. package/lib/src/business/ap-upload-file/interface.d.ts +3 -1
  67. package/lib/src/business/ap-upload-file/utils/upload.js +1 -1
  68. package/lib/src/config-provider/constants.d.ts +2 -2
  69. package/lib/src/version.d.ts +1 -1
  70. package/lib/src/version.js +1 -1
  71. package/package.json +3 -3
@@ -1,65 +1,76 @@
1
- import { defineComponent as B, useSlots as x, shallowRef as g, computed as k, unref as t, createElementBlock as C, createBlock as S, openBlock as n, Fragment as _, createTextVNode as h, toDisplayString as P, mergeProps as T, createSlots as V, renderList as b, withCtx as R, renderSlot as F, normalizeProps as U, guardReactiveProps as A } from "vue";
2
- import { Slider as $ } from "@aplus-frontend/antdv";
3
- import { isNil as w, isArray as N, omit as z } from "lodash-unified";
1
+ import { defineComponent as B, useSlots as x, shallowRef as C, computed as b, unref as t, createElementBlock as g, createBlock as k, openBlock as n, Fragment as F, createTextVNode as S, toDisplayString as h, mergeProps as T, createSlots as V, renderList as _, withCtx as P, renderSlot as R, normalizeProps as N, guardReactiveProps as U } from "vue";
2
+ import { Slider as A } from "@aplus-frontend/antdv";
3
+ import { isNil as H, isArray as L, omit as $ } from "lodash-unified";
4
4
  import "../../hooks/index.mjs";
5
- import { useControllableValue as D } from "../../hooks/useControllableValue.mjs";
6
- const I = /* @__PURE__ */ B({
5
+ import { useControllableValue as w } from "../../hooks/useControllableValue.mjs";
6
+ const G = /* @__PURE__ */ B({
7
7
  name: "ApFieldSlider",
8
8
  __name: "index",
9
9
  props: {
10
10
  mode: {},
11
11
  class: {},
12
12
  style: {},
13
- id: {},
13
+ range: { type: [Boolean, Object] },
14
+ value: {},
15
+ defaultValue: {},
16
+ onChange: {},
17
+ "onUpdate:value": {},
18
+ onAfterChange: {},
19
+ onChangeComplete: {},
20
+ handleStyle: {},
21
+ trackStyle: {},
14
22
  prefixCls: {},
15
- tooltipPrefixCls: {},
16
- range: {},
17
23
  reverse: { type: Boolean },
18
24
  min: { default: 0 },
19
25
  max: { default: 100 },
20
26
  step: { default: 1 },
21
27
  marks: {},
22
28
  dots: { type: Boolean },
23
- value: {},
24
- defaultValue: {},
25
29
  included: { type: Boolean, default: !0 },
26
30
  disabled: { type: Boolean, default: void 0 },
31
+ keyboard: { type: Boolean },
27
32
  vertical: { type: Boolean },
33
+ className: {},
34
+ rootClassName: {},
35
+ id: {},
36
+ tooltip: {},
37
+ autoFocus: { type: Boolean },
38
+ styles: {},
39
+ classNames: {},
40
+ onFocus: {},
41
+ onBlur: {},
42
+ tooltipPrefixCls: {},
28
43
  tipFormatter: {},
29
- tooltipOpen: { type: Boolean, default: void 0 },
30
44
  tooltipVisible: { type: Boolean, default: void 0 },
31
- tooltipPlacement: {},
32
45
  getTooltipPopupContainer: {},
33
- autofocus: { type: Boolean },
34
- handleStyle: {},
35
- trackStyle: {},
36
- onChange: {},
37
- onAfterChange: {},
38
- onFocus: {},
39
- onBlur: {},
40
- "onUpdate:value": {},
46
+ tooltipPlacement: {},
47
+ tabIndex: {},
48
+ ariaLabelForHandle: {},
49
+ ariaLabelledByForHandle: {},
50
+ ariaRequired: { type: Boolean },
51
+ ariaValueTextFormatterForHandle: {},
41
52
  emptyText: { default: "--" }
42
53
  },
43
54
  emits: ["update:value"],
44
- setup(u, { expose: s, emit: i }) {
45
- const p = x(), o = g(), l = u, d = i, { value: a, updateValue: f } = D(l, d), m = k(() => {
46
- const e = t(a);
47
- return w(e) ? l.emptyText : N(e) ? `${e[0]}-${e[1]}` : e;
55
+ setup(s, { expose: u, emit: i }) {
56
+ const p = x(), o = C(), a = s, d = i, { value: l, updateValue: m } = w(a, d), c = b(() => {
57
+ const e = t(l);
58
+ return H(e) ? a.emptyText : L(e) ? `${e[0]}-${e[1]}` : e;
48
59
  });
49
- function c() {
60
+ function f() {
50
61
  o.value?.focus?.();
51
62
  }
52
- function v() {
63
+ function y() {
53
64
  o.value?.blur?.();
54
65
  }
55
- return s({
56
- focus: c,
57
- blur: v
58
- }), (e, E) => e.mode === "read" ? (n(), C(_, { key: 0 }, [
59
- h(P(m.value), 1)
60
- ], 64)) : (n(), S(t($), T(
66
+ return u({
67
+ focus: f,
68
+ blur: y
69
+ }), (e, j) => e.mode === "read" ? (n(), g(F, { key: 0 }, [
70
+ S(h(c.value), 1)
71
+ ], 64)) : (n(), k(t(A), T(
61
72
  { key: 1 },
62
- t(z)(l, [
73
+ t($)(a, [
63
74
  "value",
64
75
  "onUpdate:value",
65
76
  "mode",
@@ -69,19 +80,19 @@ const I = /* @__PURE__ */ B({
69
80
  {
70
81
  ref_key: "sliderRef",
71
82
  ref: o,
72
- value: t(a),
73
- "onUpdate:value": t(f)
83
+ value: t(l),
84
+ "onUpdate:value": t(m)
74
85
  }
75
86
  ), V({ _: 2 }, [
76
- b(p, (L, r) => ({
87
+ _(p, (q, r) => ({
77
88
  name: r,
78
- fn: R((y) => [
79
- F(e.$slots, r, U(A(y || {})))
89
+ fn: P((v) => [
90
+ R(e.$slots, r, N(U(v || {})))
80
91
  ])
81
92
  }))
82
93
  ]), 1040, ["value", "onUpdate:value"]));
83
94
  }
84
95
  });
85
96
  export {
86
- I as default
97
+ G as default
87
98
  };
@@ -31,10 +31,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
31
31
  nameKey?: string;
32
32
  pathKey?: string;
33
33
  }>;
34
- default: () => {
35
- nameKey: string;
36
- pathKey: string;
37
- };
34
+ default: undefined;
38
35
  };
39
36
  getOssAccess: {
40
37
  type: PropType< ApAttachmentProps["getOssAccess"]>;
@@ -76,10 +73,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
76
73
  nameKey?: string;
77
74
  pathKey?: string;
78
75
  }>;
79
- default: () => {
80
- nameKey: string;
81
- pathKey: string;
82
- };
76
+ default: undefined;
83
77
  };
84
78
  getOssAccess: {
85
79
  type: PropType< ApAttachmentProps["getOssAccess"]>;
@@ -1,5 +1,5 @@
1
- import { defineComponent as W, ref as k, useSlots as _, computed as o, cloneVNode as j, toRaw as h, unref as K, createVNode as t, createTextVNode as R } from "vue";
2
- import { LoadingOutlined as g } from "@ant-design/icons-vue";
1
+ import { defineComponent as U, ref as k, useSlots as W, computed as o, cloneVNode as _, toRaw as g, unref as j, createVNode as t, createTextVNode as R } from "vue";
2
+ import { LoadingOutlined as p } from "@ant-design/icons-vue";
3
3
  import { Tooltip as B, Popover as G } from "@aplus-frontend/antdv";
4
4
  import { debounce as H, isArray as M } from "lodash-unified";
5
5
  import { useToken as q } from "../../config-provider/hooks/use-token.mjs";
@@ -12,44 +12,50 @@ import X from "./style/index.mjs";
12
12
  import { useNamespace as Y } from "../../config-provider/hooks/use-namespace.mjs";
13
13
  import { useGlobalConfig as T } from "../../config-provider/hooks/use-global-config.mjs";
14
14
  import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
15
- const fe = /* @__PURE__ */ W({
15
+ const fe = /* @__PURE__ */ U({
16
16
  name: "ApAttachment",
17
17
  props: Q(),
18
18
  setup(e, {
19
- emit: p
19
+ emit: N
20
20
  }) {
21
21
  const {
22
22
  b: x,
23
23
  e: a
24
- } = Y("ap-attachment"), L = X("ap-attachment"), C = T("apUpload"), N = T("downloadCenterTriggerConfig"), {
25
- token: w
24
+ } = Y("ap-attachment"), y = X("ap-attachment"), r = T("apUpload"), L = T("downloadCenterTriggerConfig"), {
25
+ token: C
26
26
  } = q(), {
27
27
  lang: O,
28
- t: m
29
- } = Z(), i = k(!1), c = k(""), d = _(), P = o(() => O.value === "zh-cn" ? "zh_CN" : "en_US"), s = o(() => e.needName ?? C?.value?.needName), f = o(() => e.attachmentList.length === 1), y = o(() => s.value ? e.attachmentList.length > 0 && s.value && s.value?.nameKey ? e.attachmentList[0][s.value.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), I = o(() => f.value ? y.value : m("ap.apAttachment.downloadall")), A = o(() => ({
30
- "--download-main-color": w.value?.colorLink,
31
- "--download-main-color-opacity": J(w.value?.colorLink, 0.6)
32
- })), S = o(() => e.getOssAccess || C.value?.getOssAccess), V = o(() => {
33
- const l = d.default ? d.default()[0] : null;
34
- return l ? j(l, {
28
+ t: d
29
+ } = Z(), i = k(!1), c = k(""), f = W(), K = o(() => O.value === "zh-cn" ? "zh_CN" : "en_US"), s = o(() => e.needName ?? (r?.value?.needName === !0 ? {
30
+ nameKey: "fileName",
31
+ pathKey: "path"
32
+ } : r?.value?.needName ?? {
33
+ nameKey: "fileName",
34
+ pathKey: "filePath"
35
+ })), v = o(() => e.attachmentList.length === 1), w = o(() => s.value ? e.attachmentList.length > 0 && s.value && s.value?.nameKey ? e.attachmentList[0][s.value.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), P = o(() => v.value ? w.value : d("ap.apAttachment.downloadall")), A = o(() => ({
36
+ "--download-main-color": C.value?.colorLink,
37
+ "--download-main-color-opacity": J(C.value?.colorLink, 0.6)
38
+ })), I = o(() => e.getOssAccess || r.value?.getOssAccess), S = o(() => {
39
+ const l = f.default ? f.default()[0] : null;
40
+ return l ? _(l, {
35
41
  style: {
36
42
  "font-size": "16px"
37
43
  }
38
44
  }) : null;
39
- }), v = H(async (l, r) => {
45
+ }), h = H(async (l, u) => {
40
46
  if (!e.disabled) {
41
- i.value = !0, r && (c.value = r);
47
+ i.value = !0, u && (c.value = u);
42
48
  try {
43
- const n = M(h(l)) ? h(l) : [h(l)];
44
- if (N.value?.trigger) {
45
- const u = F(s.value, n).map((b) => ({
49
+ const n = M(g(l)) ? g(l) : [g(l)];
50
+ if (L.value?.trigger) {
51
+ const m = F(s.value, n).map((b) => ({
46
52
  objectName: b.path,
47
53
  fileName: b.fileName
48
54
  }));
49
- N.value?.trigger(u), p("downloadCallback", u);
55
+ L.value?.trigger(m), N("downloadCallback", m);
50
56
  } else {
51
- const u = await (await E(S.value, K(P))).downloadFile(F(e.needName, n));
52
- p("downloadCallback", u);
57
+ const m = await (await E(I.value, j(K))).downloadFile(F(e.needName, n));
58
+ N("downloadCallback", m);
53
59
  }
54
60
  } catch (n) {
55
61
  D(!1, n);
@@ -57,56 +63,56 @@ const fe = /* @__PURE__ */ W({
57
63
  i.value = !1, c.value = "";
58
64
  }
59
65
  }
60
- }, 500), z = (l) => l && l.length > 0 ? t("ul", {
61
- class: [a("file-list"), L.value],
66
+ }, 500), V = (l) => l && l.length > 0 ? t("ul", {
67
+ class: [a("file-list"), y.value],
62
68
  style: A.value
63
- }, [l.map((r, n) => t("li", {
69
+ }, [l.map((u, n) => t("li", {
64
70
  key: n,
65
71
  class: [a("file-item")],
66
- onClick: () => v(r, n + 1)
72
+ onClick: () => h(u, n + 1)
67
73
  }, [i.value && c.value === n + 1 ? t("span", {
68
74
  class: [a("spin")]
69
- }, [t(g, {
75
+ }, [t(p, {
70
76
  spin: !0
71
- }, null)]) : null, r.fileName])), t("li", {
77
+ }, null)]) : null, u.fileName])), t("li", {
72
78
  class: [a("download-all")],
73
- onClick: () => v(e.attachmentList, "all")
79
+ onClick: () => h(e.attachmentList, "all")
74
80
  }, [i.value && c.value === "all" ? t("span", {
75
81
  class: [a("spin")]
76
- }, [t(g, {
82
+ }, [t(p, {
77
83
  spin: !0
78
- }, null)]) : null, m("ap.apAttachment.downloadall")])]) : null;
84
+ }, null)]) : null, d("ap.apAttachment.downloadall")])]) : null;
79
85
  return () => e.attachmentList?.length > 0 && t("div", {
80
- class: [x(), L.value],
86
+ class: [x(), y.value],
81
87
  style: [A.value]
82
88
  }, [t(B, {
83
- title: I.value,
89
+ title: P.value,
84
90
  placement: e.textToolTipPlacement,
85
91
  color: e.toolTipBgColor
86
92
  }, {
87
93
  default: () => [t("div", {
88
94
  class: [a("content")],
89
- onClick: () => v(f.value ? e.attachmentList[0] : e.attachmentList, "global")
95
+ onClick: () => h(v.value ? e.attachmentList[0] : e.attachmentList, "global")
90
96
  }, [i.value && c.value === "global" ? t("div", {
91
97
  class: [a("spin")]
92
- }, [t(g, {
98
+ }, [t(p, {
93
99
  spin: !0
94
- }, null)]) : null, d.default ? t("div", {
100
+ }, null)]) : null, f.default ? t("div", {
95
101
  class: [a("text-render")]
96
- }, [V.value, R(" ")]) : null, t("div", {
102
+ }, [S.value, R(" ")]) : null, t("div", {
97
103
  class: [a("text-inner")],
98
104
  style: {
99
105
  "max-width": e.maxWidth ? e.maxWidth + "px" : "auto"
100
106
  }
101
- }, [y.value])])]
107
+ }, [w.value])])]
102
108
  }), t(G, {
103
- content: z(e.attachmentList),
109
+ content: V(e.attachmentList),
104
110
  placement: e.fileMorePopoverPlacement,
105
111
  color: "#fff"
106
112
  }, {
107
- default: () => [!f.value && t("div", {
113
+ default: () => [!v.value && t("div", {
108
114
  class: [a("more")]
109
- }, [m("ap.apAttachment.more")])]
115
+ }, [d("ap.apAttachment.more")])]
110
116
  })]);
111
117
  }
112
118
  });
@@ -30,10 +30,7 @@ export declare const ApAttachmentProps: () => {
30
30
  nameKey?: string;
31
31
  pathKey?: string;
32
32
  }>;
33
- default: () => {
34
- nameKey: string;
35
- pathKey: string;
36
- };
33
+ default: undefined;
37
34
  };
38
35
  getOssAccess: {
39
36
  type: PropType<_ApAttachmentProps["getOssAccess"]>;
@@ -1,4 +1,4 @@
1
- const e = () => ({
1
+ const t = () => ({
2
2
  attachmentList: {
3
3
  type: Array,
4
4
  default: [],
@@ -25,10 +25,7 @@ const e = () => ({
25
25
  },
26
26
  needName: {
27
27
  type: Object,
28
- default: () => ({
29
- nameKey: "fileName",
30
- pathKey: "filePath"
31
- })
28
+ default: void 0
32
29
  },
33
30
  getOssAccess: {
34
31
  type: Function
@@ -42,5 +39,5 @@ const e = () => ({
42
39
  }
43
40
  });
44
41
  export {
45
- e as ApAttachmentProps
42
+ t as ApAttachmentProps
46
43
  };
@@ -33,10 +33,7 @@ declare const ApAttachment: {
33
33
  nameKey?: string;
34
34
  pathKey?: string;
35
35
  }>;
36
- default: () => {
37
- nameKey: string;
38
- pathKey: string;
39
- };
36
+ default: undefined;
40
37
  };
41
38
  getOssAccess: {
42
39
  type: PropType< ApAttachmentProps["getOssAccess"]>;
@@ -96,10 +93,7 @@ declare const ApAttachment: {
96
93
  nameKey?: string;
97
94
  pathKey?: string;
98
95
  }>;
99
- default: () => {
100
- nameKey: string;
101
- pathKey: string;
102
- };
96
+ default: undefined;
103
97
  };
104
98
  getOssAccess: {
105
99
  type: PropType< ApAttachmentProps["getOssAccess"]>;
@@ -156,10 +150,7 @@ declare const ApAttachment: {
156
150
  nameKey?: string;
157
151
  pathKey?: string;
158
152
  }>;
159
- default: () => {
160
- nameKey: string;
161
- pathKey: string;
162
- };
153
+ default: undefined;
163
154
  };
164
155
  getOssAccess: {
165
156
  type: PropType< ApAttachmentProps["getOssAccess"]>;
@@ -1,4 +1,4 @@
1
- import { ApDownLoadProps, downloadCallbackResponse } from './interface';
1
+ import { ApDownLoadProps, downloadCallbackResponse, ApDownLoadNeedNameModel } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  import { ButtonType } from '@aplus-frontend/antdv/es/button';
4
4
  type __VLS_Props = ApDownLoadProps;
@@ -19,6 +19,7 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
19
19
  size: "small" | "large" | "middle";
20
20
  type: ButtonType;
21
21
  disabled: boolean;
22
+ needName: ApDownLoadNeedNameModel;
22
23
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
23
24
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
24
25
  export default _default;
@@ -40,20 +40,20 @@ const M = {
40
40
  variant: {},
41
41
  text: {},
42
42
  fileName: {},
43
- needName: { type: [Boolean, Object] },
43
+ needName: { type: [Boolean, Object], default: void 0 },
44
44
  getOssAccess: {}
45
45
  },
46
46
  emits: ["downloadCallback"],
47
47
  setup(C, { emit: N }) {
48
- const r = N, n = z(!1), { lang: b } = G(), w = A(), h = s(() => b.value === "zh-cn" ? "zh_CN" : "en_US"), e = C, l = y("apUpload"), c = y(
48
+ const r = N, l = z(!1), { lang: b } = G(), v = A(), w = s(() => b.value === "zh-cn" ? "zh_CN" : "en_US"), e = C, n = y("apUpload"), c = y(
49
49
  "downloadCenterTriggerConfig"
50
- ), d = s(() => e.disabled), v = s(() => e.size), { getInnerWrapperClass: _ } = P(v, d), k = s(() => e.getOssAccess || l.value?.getOssAccess), B = async () => {
50
+ ), d = s(() => e.disabled), h = s(() => e.size), { getInnerWrapperClass: _ } = P(h, d), k = s(() => e.getOssAccess || n.value?.getOssAccess), B = async () => {
51
51
  if (!e.disabled) {
52
- n.value = !0;
52
+ l.value = !0;
53
53
  try {
54
54
  if (c.value?.trigger) {
55
55
  let a = g(
56
- e.needName ?? l?.value?.needName,
56
+ e.needName ?? n?.value?.needName,
57
57
  e.fileName
58
58
  ).map((p) => ({
59
59
  objectName: p.path,
@@ -63,10 +63,10 @@ const M = {
63
63
  } else {
64
64
  const a = await (await E(
65
65
  k.value,
66
- t(h)
66
+ t(w)
67
67
  )).downloadFile(
68
68
  g(
69
- e.needName ?? l?.value?.needName,
69
+ e.needName ?? n?.value?.needName,
70
70
  e.fileName
71
71
  )
72
72
  );
@@ -75,7 +75,7 @@ const M = {
75
75
  } catch (o) {
76
76
  console.error(o);
77
77
  } finally {
78
- n.value = !1;
78
+ l.value = !1;
79
79
  }
80
80
  }
81
81
  };
@@ -89,10 +89,10 @@ const M = {
89
89
  m("div", {
90
90
  class: j(t(_))
91
91
  }, [
92
- n.value ? (i(), f("span", M, [
92
+ l.value ? (i(), f("span", M, [
93
93
  I(t(U), { spin: !0 })
94
94
  ])) : u("", !0),
95
- t(w).icon ? (i(), f("span", R, [
95
+ t(v).icon ? (i(), f("span", R, [
96
96
  F(o.$slots, "icon")
97
97
  ])) : u("", !0),
98
98
  m("span", W, T(o.text), 1)
@@ -1,16 +1,16 @@
1
- import { defineComponent as M, computed as n, ref as S, watchEffect as U, createBlock as p, openBlock as l, unref as a, mergeProps as f, withCtx as j, renderSlot as B, normalizeProps as E, guardReactiveProps as L, createElementVNode as g, normalizeClass as x, createElementBlock as D, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as z } from "vue";
2
- import { DownloadOutlined as V } from "@ant-design/icons-vue";
3
- import { Image as W } from "@aplus-frontend/antdv";
4
- import { omit as G } from "lodash-unified";
1
+ import { defineComponent as S, computed as n, ref as j, watchEffect as B, createBlock as h, openBlock as i, unref as o, mergeProps as v, withCtx as E, renderSlot as F, normalizeProps as L, guardReactiveProps as U, createElementVNode as b, normalizeClass as W, createElementBlock as x, Fragment as D, renderList as P, resolveDynamicComponent as R, createVNode as T } from "vue";
2
+ import { DownloadOutlined as z } from "@ant-design/icons-vue";
3
+ import { Image as V } from "@aplus-frontend/antdv";
4
+ import { omit as $ } from "lodash-unified";
5
5
  import "../../config-provider/index.mjs";
6
- import { injectLocaleToOss as $, getOssInstance as q, getSignatureUrl as H } from "./hooks/useOss.mjs";
6
+ import { injectLocaleToOss as G, getOssInstance as q, getSignatureUrl as H } from "./hooks/useOss.mjs";
7
7
  import J from "./imgs/admin-fallback.jpg.mjs";
8
8
  import K from "./imgs/user-fallback.jpg.mjs";
9
9
  import Q from "./style/index.mjs";
10
10
  import { useNamespace as X } from "../../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
11
+ import { useGlobalConfig as m } from "../../config-provider/hooks/use-global-config.mjs";
12
12
  import { useLocale as Y } from "../../config-provider/hooks/use-locale.mjs";
13
- const ue = /* @__PURE__ */ M({
13
+ const ue = /* @__PURE__ */ S({
14
14
  __name: "ApImage",
15
15
  props: {
16
16
  getOssAccess: {},
@@ -23,78 +23,81 @@ const ue = /* @__PURE__ */ M({
23
23
  uiMode: {},
24
24
  preview: { type: [Boolean, Object], default: !0 }
25
25
  },
26
- setup(v) {
27
- const { b: i } = X("ap-image"), m = Q("ap-image"), e = v, u = {
26
+ setup(k) {
27
+ const { b: u } = X("ap-image"), p = Q("ap-image"), e = k, d = {
28
28
  aplus: K,
29
29
  admin: J
30
- }, b = c("apImage", { uiMode: "aplus" }), h = c("apUpload"), d = c(
30
+ }, w = m("apImage", { uiMode: "aplus" }), C = m("apUpload"), f = m(
31
31
  "downloadCenterTriggerConfig"
32
- ), k = n(
33
- () => e.uiMode || b.value?.uiMode
34
- ), { t: w, lang: C } = Y(), O = n(
35
- () => e.getOssAccess || h.value?.getOssAccess
36
- ), y = n(
37
- () => u[k.value] || u.aplus
38
- ), A = n(() => e?.fallback || y.value), s = S("");
39
- $(w, C), U(async () => {
32
+ ), O = n(
33
+ () => e.uiMode || w.value?.uiMode
34
+ ), { t: y, lang: A } = Y(), g = n(
35
+ () => e.getOssAccess || C.value?.getOssAccess
36
+ ), N = n(
37
+ () => d[O.value] || d.aplus
38
+ ), I = n(() => e?.fallback || N.value), s = j("");
39
+ G(y, A), B(async () => {
40
40
  if (!e?.src) {
41
41
  s.value = "";
42
42
  return;
43
43
  }
44
- if (!e.src?.startsWith("Frontend-Upload")) {
44
+ if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
45
45
  s.value = e.src;
46
46
  return;
47
47
  }
48
48
  try {
49
- const t = await q(O.value), r = await H({
50
- oss: t,
51
- fileName: e.src
49
+ const a = e.src?.match(/^([^:]+):(.*)$/), r = a?.[1], t = a?.[2] ?? e.src, l = await q(
50
+ () => r ? g.value?.(r) : g.value?.(),
51
+ r
52
+ ), c = await H({
53
+ oss: l,
54
+ fileName: t
52
55
  });
53
- r && (s.value = r);
56
+ c && (s.value = c);
54
57
  } catch {
55
58
  s.value = "";
56
59
  }
57
60
  });
58
- async function N() {
61
+ async function _() {
59
62
  if (!e?.src)
60
63
  return;
61
- const t = e.src, r = e.fileName ?? e.src;
62
- if (!e.src?.startsWith("Frontend-Upload")) {
63
- I(t, r);
64
+ const a = e.src, r = e.fileName ?? e.src;
65
+ if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
66
+ M(a, r);
64
67
  return;
65
68
  }
66
- if (d.value?.trigger) {
67
- let o = [
69
+ if (f.value?.trigger) {
70
+ let t = [
68
71
  {
69
- objectName: t,
72
+ objectName: a,
70
73
  fileName: r
71
74
  }
72
75
  ];
73
- await d.value?.trigger(o);
76
+ await f.value?.trigger(t);
74
77
  }
75
78
  }
76
- const I = (t, r) => {
77
- const o = document.createElement("a");
78
- o.href = t, o.rel = "noopener noreferrer", o.setAttribute("download", r), document.body.appendChild(o), o.click(), document.body.removeChild(o);
79
+ const M = (a, r) => {
80
+ const t = document.createElement("a");
81
+ t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", r), document.body.appendChild(t), t.click(), document.body.removeChild(t);
79
82
  };
80
- return (t, r) => (l(), p(a(W), f({
81
- class: [a(i)(), a(m)]
83
+ return (a, r) => (i(), h(o(V), v({
84
+ class: [o(u)(), o(p)]
82
85
  }, {
83
- ...a(G)(e, ["src", "getOssAccess"]),
84
- fallback: A.value,
86
+ ...o($)(e, ["src", "getOssAccess"]),
87
+ fallback: I.value,
85
88
  src: s.value
86
89
  }), {
87
- toolbarRender: j((o) => [
88
- B(t.$slots, "toolbarRender", E(L({ ...o })), () => [
89
- g("div", {
90
- class: x([a(i)("toolbar"), a(m)])
90
+ toolbarRender: E((t) => [
91
+ F(a.$slots, "toolbarRender", L(U({ ...t })), () => [
92
+ b("div", {
93
+ class: W([o(u)("toolbar"), o(p)])
91
94
  }, [
92
- (l(!0), D(P, null, R(o.originalNodes, (_, F) => (l(), p(T(_), f({ ref_for: !0 }, e, { key: F }), null, 16))), 128)),
93
- g("div", {
95
+ (i(!0), x(D, null, P(t.originalNodes, (l, c) => (i(), h(R(l), v({ ref_for: !0 }, e, { key: c }), null, 16))), 128)),
96
+ b("div", {
94
97
  class: "ant-image-preview-operations-operation",
95
- onClick: N
98
+ onClick: _
96
99
  }, [
97
- z(a(V))
100
+ T(o(z))
98
101
  ])
99
102
  ], 2)
100
103
  ])
@@ -3,7 +3,7 @@ import { Ref } from 'vue';
3
3
  import { Translator } from '../../../config-provider';
4
4
  type GetOssAccess = () => Promise<accessCreate>;
5
5
  export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
6
- export declare function getOssInstance(getOssAccess?: GetOssAccess): Promise<Oss>;
6
+ export declare function getOssInstance(getOssAccess?: GetOssAccess, bucket?: string): Promise<Oss>;
7
7
  export declare function getSignatureUrl({ oss, fileName }: {
8
8
  oss: Oss;
9
9
  fileName: string;