@aplus-frontend/ui 7.14.0 → 7.14.1
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.vue2.mjs +32 -32
- package/es/src/business/ap-image/style/index.mjs +9 -8
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-image/style/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as S, computed as
|
|
1
|
+
import { defineComponent as S, computed as n, ref as _, watchEffect as W, createBlock as h, openBlock as i, unref as r, mergeProps as j, withCtx as B, renderSlot as E, normalizeProps as F, guardReactiveProps as L, createElementVNode as b, normalizeClass as U, createElementBlock as x, Fragment as D, renderList as P, resolveDynamicComponent as R, createVNode as T } from "vue";
|
|
2
2
|
import { DownloadOutlined as z } from "@ant-design/icons-vue";
|
|
3
3
|
import { Image as V } from "@aplus-frontend/antdv";
|
|
4
4
|
import { omit as $ } from "lodash-unified";
|
|
@@ -23,20 +23,20 @@ const ue = /* @__PURE__ */ S({
|
|
|
23
23
|
uiMode: {},
|
|
24
24
|
preview: { type: [Boolean, Object], default: !0 }
|
|
25
25
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const { b: u } = X("ap-image"), p = Q("ap-image"), e =
|
|
26
|
+
setup(v) {
|
|
27
|
+
const { b: u } = X("ap-image"), p = Q("ap-image"), e = v, d = {
|
|
28
28
|
aplus: K,
|
|
29
29
|
admin: J
|
|
30
|
-
},
|
|
30
|
+
}, k = m("apImage", { uiMode: "aplus" }), w = m("apUpload"), f = m(
|
|
31
31
|
"downloadCenterTriggerConfig"
|
|
32
|
-
),
|
|
33
|
-
() => e.uiMode ||
|
|
34
|
-
), { t:
|
|
35
|
-
() => e.getOssAccess ||
|
|
36
|
-
),
|
|
37
|
-
() => d[
|
|
38
|
-
),
|
|
39
|
-
G(
|
|
32
|
+
), C = n(
|
|
33
|
+
() => e.uiMode || k.value?.uiMode
|
|
34
|
+
), { t: O, lang: y } = Y(), g = n(
|
|
35
|
+
() => e.getOssAccess || w.value?.getOssAccess
|
|
36
|
+
), A = n(
|
|
37
|
+
() => d[C.value] || d.aplus
|
|
38
|
+
), N = n(() => e?.fallback || A.value), s = _("");
|
|
39
|
+
G(O, y), W(async () => {
|
|
40
40
|
if (!e?.src) {
|
|
41
41
|
s.value = "";
|
|
42
42
|
return;
|
|
@@ -46,11 +46,11 @@ const ue = /* @__PURE__ */ S({
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const a = e.src?.match(/^([^:]+):(.*)$/),
|
|
50
|
-
() =>
|
|
51
|
-
|
|
49
|
+
const a = e.src?.match(/^([^:]+):(.*)$/), o = a?.[1], t = a?.[2] ?? e.src, l = await q(
|
|
50
|
+
() => o ? g.value?.(o) : g.value?.(),
|
|
51
|
+
o
|
|
52
52
|
), c = await H({
|
|
53
|
-
oss:
|
|
53
|
+
oss: l,
|
|
54
54
|
fileName: t
|
|
55
55
|
});
|
|
56
56
|
c && (s.value = c);
|
|
@@ -58,46 +58,46 @@ const ue = /* @__PURE__ */ S({
|
|
|
58
58
|
s.value = "";
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
async function
|
|
61
|
+
async function I() {
|
|
62
62
|
if (!e?.src)
|
|
63
63
|
return;
|
|
64
|
-
const a = e.src,
|
|
64
|
+
const a = e.src, o = e.fileName ?? e.src;
|
|
65
65
|
if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
|
|
66
|
-
M(a,
|
|
66
|
+
M(a, o);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
if (f.value?.trigger) {
|
|
70
70
|
let t = [
|
|
71
71
|
{
|
|
72
72
|
objectName: a,
|
|
73
|
-
fileName:
|
|
73
|
+
fileName: o
|
|
74
74
|
}
|
|
75
75
|
];
|
|
76
76
|
await f.value?.trigger(t);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
const M = (a,
|
|
79
|
+
const M = (a, o) => {
|
|
80
80
|
const t = document.createElement("a");
|
|
81
|
-
t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download",
|
|
81
|
+
t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", o), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
82
82
|
};
|
|
83
|
-
return (a,
|
|
84
|
-
class: [
|
|
83
|
+
return (a, o) => (i(), h(r(V), j({
|
|
84
|
+
class: [r(u)(), r(p)]
|
|
85
85
|
}, {
|
|
86
|
-
...
|
|
87
|
-
fallback:
|
|
86
|
+
...r($)(e, ["src", "getOssAccess"]),
|
|
87
|
+
fallback: N.value,
|
|
88
88
|
src: s.value
|
|
89
89
|
}), {
|
|
90
90
|
toolbarRender: B((t) => [
|
|
91
91
|
E(a.$slots, "toolbarRender", F(L({ ...t })), () => [
|
|
92
|
-
|
|
93
|
-
class: U([
|
|
92
|
+
b("div", {
|
|
93
|
+
class: U([r(u)("toolbar"), r(p)])
|
|
94
94
|
}, [
|
|
95
|
-
(i(!0), x(D, null, P(t.originalNodes, (
|
|
96
|
-
|
|
95
|
+
(i(!0), x(D, null, P(t.originalNodes, (l, c) => (i(), h(R(l), { key: c }))), 128)),
|
|
96
|
+
b("div", {
|
|
97
97
|
class: "ant-image-preview-operations-operation",
|
|
98
|
-
onClick:
|
|
98
|
+
onClick: I
|
|
99
99
|
}, [
|
|
100
|
-
T(
|
|
100
|
+
T(r(z))
|
|
101
101
|
])
|
|
102
102
|
], 2)
|
|
103
103
|
])
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { genComponentStyleHook as
|
|
2
|
-
const
|
|
1
|
+
import { genComponentStyleHook as a } from "../../../utils/cssinjs/index.mjs";
|
|
2
|
+
const n = (e) => {
|
|
3
3
|
const { componentCls: o } = e;
|
|
4
4
|
return {
|
|
5
5
|
[`${o}-toolbar`]: {
|
|
6
6
|
display: "flex",
|
|
7
7
|
alignItems: "center",
|
|
8
|
-
paddingInline: e.
|
|
8
|
+
paddingInline: e.spaceXL,
|
|
9
9
|
paddingBlock: 0,
|
|
10
10
|
backgroundColor: "rgba(0, 0, 0, 0.1)",
|
|
11
|
-
borderRadius: "100px"
|
|
11
|
+
borderRadius: "100px",
|
|
12
|
+
gap: e.space
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
|
-
},
|
|
15
|
-
|
|
15
|
+
}, t = a("ApImage", (e) => [
|
|
16
|
+
n(e)
|
|
16
17
|
]);
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
t as default,
|
|
20
|
+
n as genApImageStyle
|
|
20
21
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.14.
|
|
1
|
+
declare const _default: "7.14.1";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@ant-design/icons-vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@ant-design/icons-vue"),I=require("@aplus-frontend/antdv"),M=require("lodash-unified");require("../../config-provider/index.js");const l=require("./hooks/useOss.js"),_=require("./imgs/admin-fallback.jpg.js"),A=require("./imgs/user-fallback.jpg.js"),B=require("./style/index.js"),S=require("../../config-provider/hooks/use-namespace.js"),i=require("../../config-provider/hooks/use-global-config.js"),j=require("../../config-provider/hooks/use-locale.js"),E=e.defineComponent({__name:"ApImage",props:{getOssAccess:{},width:{},height:{},alt:{},fallback:{},src:{},fileName:{},uiMode:{},preview:{type:[Boolean,Object],default:!0}},setup(g){const{b:u}=S.useNamespace("ap-image"),d=B.default("ap-image"),t=g,f={aplus:A.default,admin:_.default},b=i.useGlobalConfig("apImage",{uiMode:"aplus"}),v=i.useGlobalConfig("apUpload"),m=i.useGlobalConfig("downloadCenterTriggerConfig"),h=e.computed(()=>t.uiMode||b.value?.uiMode),{t:k,lang:C}=j.useLocale(),p=e.computed(()=>t.getOssAccess||v.value?.getOssAccess),w=e.computed(()=>f[h.value]||f.aplus),q=e.computed(()=>t?.fallback||w.value),o=e.ref("");l.injectLocaleToOss(k,C),e.watchEffect(async()=>{if(!t?.src){o.value="";return}if(t.src?.startsWith("http")||t.src?.startsWith("data:")||t.src?.startsWith("blob:")){o.value=t.src;return}try{const r=t.src?.match(/^([^:]+):(.*)$/),s=r?.[1],a=r?.[2]??t.src,n=await l.getOssInstance(()=>s?p.value?.(s):p.value?.(),s),c=await l.getSignatureUrl({oss:n,fileName:a});c&&(o.value=c)}catch{o.value=""}});async function O(){if(!t?.src)return;const r=t.src,s=t.fileName??t.src;if(t.src?.startsWith("http")||t.src?.startsWith("data:")){N(r,s);return}if(m.value?.trigger){let a=[{objectName:r,fileName:s}];await m.value?.trigger(a)}}const N=(r,s)=>{const a=document.createElement("a");a.href=r,a.rel="noopener noreferrer",a.setAttribute("download",s),document.body.appendChild(a),a.click(),document.body.removeChild(a)};return(r,s)=>(e.openBlock(),e.createBlock(e.unref(I.Image),e.mergeProps({class:[e.unref(u)(),e.unref(d)]},{...e.unref(M.omit)(t,["src","getOssAccess"]),fallback:q.value,src:o.value}),{toolbarRender:e.withCtx(a=>[e.renderSlot(r.$slots,"toolbarRender",e.normalizeProps(e.guardReactiveProps({...a})),()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(u)("toolbar"),e.unref(d)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.originalNodes,(n,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{key:c}))),128)),e.createElementVNode("div",{class:"ant-image-preview-operations-operation",onClick:O},[e.createVNode(e.unref(y.DownloadOutlined))])],2)])]),_:3},16,["class"]))}});exports.default=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../utils/cssinjs/index.js"),n=e=>{const{componentCls:o}=e;return{[`${o}-toolbar`]:{display:"flex",alignItems:"center",paddingInline:e.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../utils/cssinjs/index.js"),n=e=>{const{componentCls:o}=e;return{[`${o}-toolbar`]:{display:"flex",alignItems:"center",paddingInline:e.spaceXL,paddingBlock:0,backgroundColor:"rgba(0, 0, 0, 0.1)",borderRadius:"100px",gap:e.space}}},a=t.genComponentStyleHook("ApImage",e=>[n(e)]);exports.default=a;exports.genApImageStyle=n;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.14.
|
|
1
|
+
declare const _default: "7.14.1";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.14.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.14.1";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "7.14.
|
|
3
|
+
"version": "7.14.1",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
41
41
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
|
42
42
|
"vuedraggable": "^4.1.0",
|
|
43
|
-
"@aplus-frontend/
|
|
44
|
-
"@aplus-frontend/
|
|
43
|
+
"@aplus-frontend/hooks": "1.0.7",
|
|
44
|
+
"@aplus-frontend/utils": "1.0.65"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@aplus-frontend/antdv": "^2.1.
|
|
47
|
+
"@aplus-frontend/antdv": "^2.1.2",
|
|
48
48
|
"@aplus-frontend/icon": "^2.0.6",
|
|
49
49
|
"@aplus-frontend/oss": "^2.0.1",
|
|
50
50
|
"vue": "^3.5.21",
|
|
51
51
|
"vxe-table": "^4.13.37"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@aplus-frontend/antdv": "^2.1.
|
|
54
|
+
"@aplus-frontend/antdv": "^2.1.2",
|
|
55
55
|
"@aplus-frontend/icon": "^2.0.6",
|
|
56
56
|
"@aplus-frontend/oss": "^2.0.1",
|
|
57
57
|
"@emotion/serialize": "^1.3.3",
|