@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.
@@ -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 b, computed as c, ref as h, watchEffect as O, openBlock as _, createBlock as P, unref as w, normalizeProps as C, guardReactiveProps as F } from "vue";
2
- import { Image as I } from "ant-design-vue";
3
- import { injectLocaleToOss as M, getOssInstance as S, getSignatureUrl as U } from "./hooks/useOss.mjs";
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 x } from "ant-design-vue/es/image";
6
- import y from "./imgs/admin-fallback.jpg.mjs";
7
- import B from "./imgs/aplus-fallback.jpg.mjs";
8
- import { useGlobalConfig as u } from "../../config-provider/hooks/use-global-config.mjs";
9
- import { useLocale as L } from "../../config-provider/hooks/use-locale.mjs";
10
- const H = /* @__PURE__ */ b({
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
- ...x(),
14
- path: String,
14
+ ...M(),
15
15
  getOssAccess: Function
16
16
  },
17
17
  setup(i) {
18
- const a = i, o = {
19
- aplus: B,
20
- admin: y
21
- }, m = u("uiMode"), p = u("apUpload"), { t: f, lang: g } = L(), r = c(() => a.path), v = c(
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 e;
24
- return a.getOssAccess || ((e = p.value) == null ? void 0 : e.getOssAccess);
23
+ var a;
24
+ return e.getOssAccess || ((a = u.value) == null ? void 0 : a.getOssAccess);
25
25
  }
26
- ), l = c(
27
- () => o[m.value] || o.aplus
28
- ), n = c(() => (a == null ? void 0 : a.fallback) || l.value), s = h(l.value);
29
- M(f, g);
30
- function d(e) {
31
- const { path: t, getOssAccess: k, ...A } = e;
32
- return A;
33
- }
34
- return O(async () => {
35
- if (a != null && a.src) {
36
- s.value = a.src;
37
- return;
38
- }
39
- try {
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
- t && (s.value = t);
41
+ r && (s.value = r);
42
+ } catch {
43
+ s.value = "";
46
44
  }
47
- } catch {
48
- s.value = n.value;
49
45
  }
50
- }), (e, t) => (_(), P(w(I), C(F({
51
- ...d(a),
52
- fallback: n.value,
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
- H as default
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"),q=require("ant-design-vue"),u=require("./hooks/useOss.js");require("../../config-provider/index.js");const h=require("ant-design-vue/es/image"),_=require("./imgs/admin-fallback.jpg.js"),A=require("./imgs/aplus-fallback.jpg.js"),i=require("../../config-provider/hooks/use-global-config.js"),C=require("../../config-provider/hooks/use-locale.js"),M=e.defineComponent({__name:"ApImage",props:{...h.imageProps(),path:String,getOssAccess:Function},setup(f){const s=f,n={aplus:A.default,admin:_.default},g=i.useGlobalConfig("uiMode"),p=i.useGlobalConfig("apUpload"),{t:d,lang:v}=C.useLocale(),l=e.computed(()=>s.path),m=e.computed(()=>{var a;return s.getOssAccess||((a=p.value)==null?void 0:a.getOssAccess)}),o=e.computed(()=>n[g.value]||n.aplus),r=e.computed(()=>(s==null?void 0:s.fallback)||o.value),c=e.ref(o.value);u.injectLocaleToOss(d,v);function b(a){const{path:t,getOssAccess:O,...k}=a;return k}return e.watchEffect(async()=>{if(s!=null&&s.src){c.value=s.src;return}try{if(l.value){const a=await u.getOssInstance(m.value),t=await u.getSignatureUrl({oss:a,fileName:l.value});t&&(c.value=t)}}catch{c.value=r.value}}),(a,t)=>(e.openBlock(),e.createBlock(e.unref(q.Image),e.normalizeProps(e.guardReactiveProps({...b(s),fallback:r.value,src:c.value})),null,16))}});exports.default=M;
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.19",
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/hooks": "1.0.7",
64
- "@aplus-frontend/utils": "1.0.32"
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",