@aplus-frontend/ui 0.1.19 → 0.1.20
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.
- package/es/src/business/ap-image/ApImage.vue.d.ts +0 -2
- package/es/src/business/ap-image/ApImage.vue2.mjs +38 -42
- package/es/src/business/index.d.ts +0 -2
- package/lib/src/business/ap-image/ApImage.vue.d.ts +0 -2
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/index.d.ts +0 -2
- package/package.json +3 -3
|
@@ -4,7 +4,6 @@ import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
|
4
4
|
import { ImagePreviewType } from 'ant-design-vue/es/vc-image';
|
|
5
5
|
import { MouseEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
6
6
|
declare const _default: DefineComponent<{
|
|
7
|
-
path: StringConstructor;
|
|
8
7
|
getOssAccess: PropType<() => Promise<accessCreate>>;
|
|
9
8
|
src: StringConstructor;
|
|
10
9
|
wrapperClassName: StringConstructor;
|
|
@@ -32,7 +31,6 @@ declare const _default: DefineComponent<{
|
|
|
32
31
|
type: PropType<OnErrorEventHandlerNonNull>;
|
|
33
32
|
};
|
|
34
33
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
35
|
-
path: StringConstructor;
|
|
36
34
|
getOssAccess: PropType<() => Promise<accessCreate>>;
|
|
37
35
|
src: StringConstructor;
|
|
38
36
|
wrapperClassName: StringConstructor;
|
|
@@ -1,59 +1,55 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Image as
|
|
3
|
-
import { injectLocaleToOss as
|
|
1
|
+
import { defineComponent as k, computed as t, ref as b, watchEffect as A, openBlock as O, createBlock as _, unref as l, normalizeProps as h, guardReactiveProps as F } from "vue";
|
|
2
|
+
import { Image as U } from "ant-design-vue";
|
|
3
|
+
import { injectLocaleToOss as w, getOssInstance as C, getSignatureUrl as I } from "./hooks/useOss.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { imageProps as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
5
|
+
import { imageProps as M } from "ant-design-vue/es/image";
|
|
6
|
+
import P from "./imgs/admin-fallback.jpg.mjs";
|
|
7
|
+
import x from "./imgs/aplus-fallback.jpg.mjs";
|
|
8
|
+
import { omit as y } from "lodash-unified";
|
|
9
|
+
import { useGlobalConfig as n } from "../../config-provider/hooks/use-global-config.mjs";
|
|
10
|
+
import { useLocale as B } from "../../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
const q = /* @__PURE__ */ k({
|
|
11
12
|
__name: "ApImage",
|
|
12
13
|
props: {
|
|
13
|
-
...
|
|
14
|
-
path: String,
|
|
14
|
+
...M(),
|
|
15
15
|
getOssAccess: Function
|
|
16
16
|
},
|
|
17
17
|
setup(i) {
|
|
18
|
-
const
|
|
19
|
-
aplus:
|
|
20
|
-
admin:
|
|
21
|
-
}, m =
|
|
18
|
+
const e = i, c = {
|
|
19
|
+
aplus: x,
|
|
20
|
+
admin: P
|
|
21
|
+
}, m = n("uiMode"), u = n("apUpload"), { t: f, lang: p } = B(), g = t(
|
|
22
22
|
() => {
|
|
23
|
-
var
|
|
24
|
-
return
|
|
23
|
+
var a;
|
|
24
|
+
return e.getOssAccess || ((a = u.value) == null ? void 0 : a.getOssAccess);
|
|
25
25
|
}
|
|
26
|
-
),
|
|
27
|
-
() =>
|
|
28
|
-
),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (r.value) {
|
|
41
|
-
const e = await S(v.value), t = await U({
|
|
42
|
-
oss: e,
|
|
43
|
-
fileName: r.value
|
|
26
|
+
), d = t(
|
|
27
|
+
() => c[m.value] || c.aplus
|
|
28
|
+
), v = t(() => (e == null ? void 0 : e.fallback) || d.value), s = b("");
|
|
29
|
+
return w(f, p), A(async () => {
|
|
30
|
+
var a;
|
|
31
|
+
if (e != null && e.src) {
|
|
32
|
+
if (!((a = e.src) != null && a.startsWith("Frontend-Upload"))) {
|
|
33
|
+
s.value = e.src;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const o = await C(g.value), r = await I({
|
|
38
|
+
oss: o,
|
|
39
|
+
fileName: e.src
|
|
44
40
|
});
|
|
45
|
-
|
|
41
|
+
r && (s.value = r);
|
|
42
|
+
} catch {
|
|
43
|
+
s.value = "";
|
|
46
44
|
}
|
|
47
|
-
} catch {
|
|
48
|
-
s.value = n.value;
|
|
49
45
|
}
|
|
50
|
-
}), (
|
|
51
|
-
...
|
|
52
|
-
fallback:
|
|
46
|
+
}), (a, o) => (O(), _(l(U), h(F({
|
|
47
|
+
...l(y)(e, ["src", "getOssAccess"]),
|
|
48
|
+
fallback: v.value,
|
|
53
49
|
src: s.value
|
|
54
50
|
})), null, 16));
|
|
55
51
|
}
|
|
56
52
|
});
|
|
57
53
|
export {
|
|
58
|
-
|
|
54
|
+
q as default
|
|
59
55
|
};
|
|
@@ -1905,7 +1905,6 @@ export declare const ApBatchActionGroup: DefineComponent<{
|
|
|
1905
1905
|
};
|
|
1906
1906
|
}>>, {}, {}>;
|
|
1907
1907
|
export declare const ApImage: DefineComponent<{
|
|
1908
|
-
path: StringConstructor;
|
|
1909
1908
|
getOssAccess: PropType<() => Promise< accessCreate>>;
|
|
1910
1909
|
src: StringConstructor;
|
|
1911
1910
|
wrapperClassName: StringConstructor;
|
|
@@ -1933,7 +1932,6 @@ export declare const ApImage: DefineComponent<{
|
|
|
1933
1932
|
type: PropType<OnErrorEventHandlerNonNull>;
|
|
1934
1933
|
};
|
|
1935
1934
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
1936
|
-
path: StringConstructor;
|
|
1937
1935
|
getOssAccess: PropType<() => Promise< accessCreate>>;
|
|
1938
1936
|
src: StringConstructor;
|
|
1939
1937
|
wrapperClassName: StringConstructor;
|
|
@@ -4,7 +4,6 @@ import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
|
4
4
|
import { ImagePreviewType } from 'ant-design-vue/es/vc-image';
|
|
5
5
|
import { MouseEventHandler } from 'ant-design-vue/es/_util/EventInterface';
|
|
6
6
|
declare const _default: DefineComponent<{
|
|
7
|
-
path: StringConstructor;
|
|
8
7
|
getOssAccess: PropType<() => Promise<accessCreate>>;
|
|
9
8
|
src: StringConstructor;
|
|
10
9
|
wrapperClassName: StringConstructor;
|
|
@@ -32,7 +31,6 @@ declare const _default: DefineComponent<{
|
|
|
32
31
|
type: PropType<OnErrorEventHandlerNonNull>;
|
|
33
32
|
};
|
|
34
33
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
35
|
-
path: StringConstructor;
|
|
36
34
|
getOssAccess: PropType<() => Promise<accessCreate>>;
|
|
37
35
|
src: StringConstructor;
|
|
38
36
|
wrapperClassName: StringConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("ant-design-vue"),t=require("./hooks/useOss.js");require("../../config-provider/index.js");const q=require("ant-design-vue/es/image"),k=require("./imgs/admin-fallback.jpg.js"),O=require("./imgs/aplus-fallback.jpg.js"),_=require("lodash-unified"),u=require("../../config-provider/hooks/use-global-config.js"),A=require("../../config-provider/hooks/use-locale.js"),h=e.defineComponent({__name:"ApImage",props:{...q.imageProps(),getOssAccess:Function},setup(l){const s=l,n={aplus:O.default,admin:k.default},i=u.useGlobalConfig("uiMode"),f=u.useGlobalConfig("apUpload"),{t:d,lang:g}=A.useLocale(),m=e.computed(()=>{var a;return s.getOssAccess||((a=f.value)==null?void 0:a.getOssAccess)}),p=e.computed(()=>n[i.value]||n.aplus),v=e.computed(()=>(s==null?void 0:s.fallback)||p.value),c=e.ref("");return t.injectLocaleToOss(d,g),e.watchEffect(async()=>{var a;if(s!=null&&s.src){if(!((a=s.src)!=null&&a.startsWith("Frontend-Upload"))){c.value=s.src;return}try{const o=await t.getOssInstance(m.value),r=await t.getSignatureUrl({oss:o,fileName:s.src});r&&(c.value=r)}catch{c.value=""}}}),(a,o)=>(e.openBlock(),e.createBlock(e.unref(b.Image),e.normalizeProps(e.guardReactiveProps({...e.unref(_.omit)(s,["src","getOssAccess"]),fallback:v.value,src:c.value})),null,16))}});exports.default=h;
|
|
@@ -1905,7 +1905,6 @@ export declare const ApBatchActionGroup: DefineComponent<{
|
|
|
1905
1905
|
};
|
|
1906
1906
|
}>>, {}, {}>;
|
|
1907
1907
|
export declare const ApImage: DefineComponent<{
|
|
1908
|
-
path: StringConstructor;
|
|
1909
1908
|
getOssAccess: PropType<() => Promise< accessCreate>>;
|
|
1910
1909
|
src: StringConstructor;
|
|
1911
1910
|
wrapperClassName: StringConstructor;
|
|
@@ -1933,7 +1932,6 @@ export declare const ApImage: DefineComponent<{
|
|
|
1933
1932
|
type: PropType<OnErrorEventHandlerNonNull>;
|
|
1934
1933
|
};
|
|
1935
1934
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
1936
|
-
path: StringConstructor;
|
|
1937
1935
|
getOssAccess: PropType<() => Promise< accessCreate>>;
|
|
1938
1936
|
src: StringConstructor;
|
|
1939
1937
|
wrapperClassName: StringConstructor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"mime": "^4.0.3",
|
|
61
61
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
62
62
|
"sortablejs": "^1.15.2",
|
|
63
|
-
"@aplus-frontend/
|
|
64
|
-
"@aplus-frontend/
|
|
63
|
+
"@aplus-frontend/utils": "1.0.32",
|
|
64
|
+
"@aplus-frontend/hooks": "1.0.7"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@aplus-frontend/icon": "^1.0.21",
|