@aplus-frontend/ui 0.0.1-beta.24 → 0.0.1-beta.25

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 (39) hide show
  1. package/es/src/ap-download/ap-download.vue.mjs +33 -27
  2. package/es/src/ap-download/hooks/index.d.ts +1 -0
  3. package/es/src/ap-download/hooks/index.mjs +20 -0
  4. package/es/src/ap-download/interface.d.ts +14 -1
  5. package/es/src/ap-download/style/ap-download.css +2 -2
  6. package/es/src/theme/ap-download/ap-download.css +2 -2
  7. package/lib/src/ap-download/ap-download.vue.js +1 -1
  8. package/lib/src/ap-download/hooks/index.d.ts +1 -0
  9. package/lib/src/ap-download/hooks/index.js +1 -0
  10. package/lib/src/ap-download/interface.d.ts +14 -1
  11. package/lib/src/ap-download/style/ap-download.css +2 -2
  12. package/lib/src/theme/ap-download/ap-download.css +2 -2
  13. package/package.json +3 -3
  14. package/es/src/base-button/index.d.ts +0 -137
  15. package/es/src/basic/index.d.ts +0 -278
  16. package/es/src/button/index.d.ts +0 -51
  17. package/es/src/config-provider/index.d.ts +0 -691
  18. package/es/src/container/index.d.ts +0 -178
  19. package/es/src/count-down/index.d.ts +0 -150
  20. package/es/src/description/index.d.ts +0 -214
  21. package/es/src/dropdown/index.d.ts +0 -113
  22. package/es/src/icon/index.d.ts +0 -208
  23. package/es/src/icon-picker/index.d.ts +0 -190
  24. package/es/src/scroll-bar/index.d.ts +0 -177
  25. package/es/src/strength-meter/index.d.ts +0 -89
  26. package/es/src/transition/index.d.ts +0 -369
  27. package/lib/src/base-button/index.d.ts +0 -137
  28. package/lib/src/basic/index.d.ts +0 -278
  29. package/lib/src/button/index.d.ts +0 -51
  30. package/lib/src/config-provider/index.d.ts +0 -691
  31. package/lib/src/container/index.d.ts +0 -178
  32. package/lib/src/count-down/index.d.ts +0 -150
  33. package/lib/src/description/index.d.ts +0 -214
  34. package/lib/src/dropdown/index.d.ts +0 -113
  35. package/lib/src/icon/index.d.ts +0 -208
  36. package/lib/src/icon-picker/index.d.ts +0 -190
  37. package/lib/src/scroll-bar/index.d.ts +0 -177
  38. package/lib/src/strength-meter/index.d.ts +0 -89
  39. package/lib/src/transition/index.d.ts +0 -369
@@ -1,9 +1,10 @@
1
- import { defineComponent as b, computed as n, openBlock as _, createElementBlock as k, normalizeStyle as y, normalizeClass as o, createElementVNode as r, renderSlot as z, toDisplayString as v } from "vue";
1
+ import { defineComponent as _, computed as n, onMounted as y, openBlock as z, createElementBlock as I, normalizeStyle as O, normalizeClass as i, createElementVNode as a, renderSlot as v, toDisplayString as B } from "vue";
2
2
  import "../config-provider/index.mjs";
3
+ import { useOssInit as M, useOss as N } from "./hooks/index.mjs";
3
4
  import "./style/ap-download.css";
4
- import { useGlobalConfig as B } from "../config-provider/hooks/use-global-config.mjs";
5
- import { useNamespace as I } from "../config-provider/hooks/use-namespace.mjs";
6
- const F = { class: "icon" }, M = { class: "text" }, G = /* @__PURE__ */ b({
5
+ import { useGlobalConfig as k } from "../config-provider/hooks/use-global-config.mjs";
6
+ import { useNamespace as A } from "../config-provider/hooks/use-namespace.mjs";
7
+ const F = { class: "icon" }, W = { class: "text" }, q = /* @__PURE__ */ _({
7
8
  name: "ApDownload",
8
9
  __name: "ap-download",
9
10
  props: {
@@ -11,40 +12,45 @@ const F = { class: "icon" }, M = { class: "text" }, G = /* @__PURE__ */ b({
11
12
  color: { default: "#0070FF" },
12
13
  size: { default: "middle" },
13
14
  disabled: { type: Boolean, default: !1 },
14
- triggerClick: {}
15
+ fileName: {},
16
+ getOssAccess: {}
15
17
  },
16
- setup(p) {
17
- const e = p, l = B("uiMode"), { b: s, bm: a } = I("download");
18
- function c(t, i) {
19
- t.length === 4 && (t = `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`);
20
- const f = parseInt(t.slice(1, 3), 16), S = parseInt(t.slice(3, 5), 16), $ = parseInt(t.slice(5, 7), 16), w = Math.round(i * 255).toString(16).padStart(2, "0");
21
- return `#${f.toString(16).padStart(2, "0")}${S.toString(16).padStart(2, "0")}${$.toString(16).padStart(2, "0")}${w}`;
18
+ setup(l) {
19
+ const t = l, p = k("uiMode"), { b: o, bm: s } = A("download");
20
+ function c(e, r) {
21
+ e.length === 4 && (e = `#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);
22
+ const w = parseInt(e.slice(1, 3), 16), S = parseInt(e.slice(3, 5), 16), $ = parseInt(e.slice(5, 7), 16), b = Math.round(r * 255).toString(16).padStart(2, "0");
23
+ return `#${w.toString(16).padStart(2, "0")}${S.toString(16).padStart(2, "0")}${$.toString(16).padStart(2, "0")}${b}`;
22
24
  }
23
25
  const d = n(() => ({
24
- "--tag-main-color": e.color,
25
- "--tag-main-color-opacity": c(e.color, 0.6)
26
- })), u = n(() => [s("wrapper"), a("wrapper", e.size)].filter(Boolean)), m = n(() => {
27
- const t = [s("inner-wrapper"), a("inner-wrapper", e.size)];
28
- return e.disabled && (l.value === "aplus" ? t.push(a("inner-wrapper", "disabled")) : t.push(a("inner-wrapper", "disabled-admin"))), t;
29
- }), g = () => {
30
- e.triggerClick && e.triggerClick();
26
+ "--download-main-color": t.color,
27
+ "--download-main-color-opacity": c(t.color, 0.6)
28
+ })), u = n(() => [o("wrapper"), s("wrapper", t.size)].filter(Boolean)), m = n(() => {
29
+ const e = [o("inner-wrapper"), s("inner-wrapper", t.size)];
30
+ return t.disabled && (p.value === "aplus" ? e.push(s("inner-wrapper", "disabled")) : e.push(s("inner-wrapper", "disabled-admin"))), e;
31
+ });
32
+ y(() => {
33
+ t.disabled || M(t.getOssAccess);
34
+ });
35
+ const { client: f } = N(), g = () => {
36
+ t.disabled || f.downloadFile(t.fileName);
31
37
  };
32
- return (t, i) => (_(), k("span", {
33
- style: y(d.value),
34
- class: o(u.value),
38
+ return (e, r) => (z(), I("span", {
39
+ style: O(d.value),
40
+ class: i(u.value),
35
41
  onClick: g
36
42
  }, [
37
- r("span", {
38
- class: o(m.value)
43
+ a("span", {
44
+ class: i(m.value)
39
45
  }, [
40
- r("span", F, [
41
- z(t.$slots, "icon")
46
+ a("span", F, [
47
+ v(e.$slots, "icon")
42
48
  ]),
43
- r("span", M, v(t.text), 1)
49
+ a("span", W, B(e.text), 1)
44
50
  ], 2)
45
51
  ], 6));
46
52
  }
47
53
  });
48
54
  export {
49
- G as default
55
+ q as default
50
56
  };
@@ -1,4 +1,5 @@
1
1
  import { Oss } from '@aplus-frontend/oss';
2
+
2
3
  export type { Oss } from '@aplus-frontend/oss';
3
4
  export declare function useOss(): {
4
5
  client: Oss;
@@ -0,0 +1,20 @@
1
+ import { client as t } from "@aplus-frontend/oss";
2
+ function i() {
3
+ return { client: t };
4
+ }
5
+ async function e(n) {
6
+ if (!n)
7
+ throw new Error("请传入getOssAccess");
8
+ return await t.initOssClient({
9
+ getOssAccess: n,
10
+ onFailure: (s) => {
11
+ throw new Error(
12
+ typeof (s == null ? void 0 : s.message) == "string" ? s.message : "获取oss临时权限失败"
13
+ );
14
+ }
15
+ }), i();
16
+ }
17
+ export {
18
+ i as useOss,
19
+ e as useOssInit
20
+ };
@@ -1,3 +1,14 @@
1
+ interface accessCreate {
2
+ bucket: string;
3
+ regionId: string;
4
+ endpoint: string;
5
+ accessKeyId: string;
6
+ accessKeySecret: string;
7
+ expiration: number;
8
+ extInformation: string;
9
+ fileProvideType: string;
10
+ callbackUrl: string;
11
+ }
1
12
  export interface ApDownLoadProps {
2
13
  /**
3
14
  * 标签内容
@@ -16,5 +27,7 @@ export interface ApDownLoadProps {
16
27
  * @default false
17
28
  */
18
29
  disabled?: boolean;
19
- triggerClick?: () => void;
30
+ fileName: string;
31
+ getOssAccess: () => Promise<accessCreate>;
20
32
  }
33
+ export {};
@@ -5,7 +5,7 @@
5
5
  }
6
6
  .aplus-download-inner-wrapper {
7
7
  display: inline-block;
8
- color: var(--tag-main-color);
8
+ color: var(--download-main-color);
9
9
  cursor: pointer;
10
10
  display: flex;
11
11
  align-items: center;
@@ -18,7 +18,7 @@
18
18
  margin-left: 5px;
19
19
  }
20
20
  .aplus-download-inner-wrapper:hover {
21
- color: var(--tag-main-color-opacity);
21
+ color: var(--download-main-color-opacity);
22
22
  }
23
23
  .aplus-download-inner-wrapper--large {
24
24
  line-height: 26px;
@@ -5,7 +5,7 @@
5
5
  }
6
6
  .aplus-download-inner-wrapper {
7
7
  display: inline-block;
8
- color: var(--tag-main-color);
8
+ color: var(--download-main-color);
9
9
  cursor: pointer;
10
10
  display: flex;
11
11
  align-items: center;
@@ -18,7 +18,7 @@
18
18
  margin-left: 5px;
19
19
  }
20
20
  .aplus-download-inner-wrapper:hover {
21
- color: var(--tag-main-color-opacity);
21
+ color: var(--download-main-color-opacity);
22
22
  }
23
23
  .aplus-download-inner-wrapper--large {
24
24
  line-height: 26px;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../config-provider/index.js");require("./style/ap-download.css");const b=require("../config-provider/hooks/use-global-config.js"),$=require("../config-provider/hooks/use-namespace.js"),w={class:"icon"},_={class:"text"},y=t.defineComponent({name:"ApDownload",__name:"ap-download",props:{text:{},color:{default:"#0070FF"},size:{default:"middle"},disabled:{type:Boolean,default:!1},triggerClick:{}},setup(i){const a=i,o=b.useGlobalConfig("uiMode"),{b:r,bm:n}=$.useNamespace("download");function l(e,s){e.length===4&&(e=`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);const g=parseInt(e.slice(1,3),16),m=parseInt(e.slice(3,5),16),f=parseInt(e.slice(5,7),16),S=Math.round(s*255).toString(16).padStart(2,"0");return`#${g.toString(16).padStart(2,"0")}${m.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${S}`}const c=t.computed(()=>({"--tag-main-color":a.color,"--tag-main-color-opacity":l(a.color,.6)})),p=t.computed(()=>[r("wrapper"),n("wrapper",a.size)].filter(Boolean)),u=t.computed(()=>{const e=[r("inner-wrapper"),n("inner-wrapper",a.size)];return a.disabled&&(o.value==="aplus"?e.push(n("inner-wrapper","disabled")):e.push(n("inner-wrapper","disabled-admin"))),e}),d=()=>{a.triggerClick&&a.triggerClick()};return(e,s)=>(t.openBlock(),t.createElementBlock("span",{style:t.normalizeStyle(c.value),class:t.normalizeClass(p.value),onClick:d},[t.createElementVNode("span",{class:t.normalizeClass(u.value)},[t.createElementVNode("span",w,[t.renderSlot(e.$slots,"icon")]),t.createElementVNode("span",_,t.toDisplayString(e.text),1)],2)],6))}});exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../config-provider/index.js");const o=require("./hooks/index.js");require("./style/ap-download.css");const $=require("../config-provider/hooks/use-global-config.js"),_=require("../config-provider/hooks/use-namespace.js"),y={class:"icon"},v={class:"text"},N=t.defineComponent({name:"ApDownload",__name:"ap-download",props:{text:{},color:{default:"#0070FF"},size:{default:"middle"},disabled:{type:Boolean,default:!1},fileName:{},getOssAccess:{}},setup(i){const s=i,l=$.useGlobalConfig("uiMode"),{b:a,bm:n}=_.useNamespace("download");function c(e,r){e.length===4&&(e=`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);const g=parseInt(e.slice(1,3),16),w=parseInt(e.slice(3,5),16),S=parseInt(e.slice(5,7),16),b=Math.round(r*255).toString(16).padStart(2,"0");return`#${g.toString(16).padStart(2,"0")}${w.toString(16).padStart(2,"0")}${S.toString(16).padStart(2,"0")}${b}`}const d=t.computed(()=>({"--download-main-color":s.color,"--download-main-color-opacity":c(s.color,.6)})),p=t.computed(()=>[a("wrapper"),n("wrapper",s.size)].filter(Boolean)),u=t.computed(()=>{const e=[a("inner-wrapper"),n("inner-wrapper",s.size)];return s.disabled&&(l.value==="aplus"?e.push(n("inner-wrapper","disabled")):e.push(n("inner-wrapper","disabled-admin"))),e});t.onMounted(()=>{s.disabled||o.useOssInit(s.getOssAccess)});const{client:m}=o.useOss(),f=()=>{s.disabled||m.downloadFile(s.fileName)};return(e,r)=>(t.openBlock(),t.createElementBlock("span",{style:t.normalizeStyle(d.value),class:t.normalizeClass(p.value),onClick:f},[t.createElementVNode("span",{class:t.normalizeClass(u.value)},[t.createElementVNode("span",y,[t.renderSlot(e.$slots,"icon")]),t.createElementVNode("span",v,t.toDisplayString(e.text),1)],2)],6))}});exports.default=N;
@@ -1,4 +1,5 @@
1
1
  import { Oss } from '@aplus-frontend/oss';
2
+
2
3
  export type { Oss } from '@aplus-frontend/oss';
3
4
  export declare function useOss(): {
4
5
  client: Oss;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@aplus-frontend/oss");function n(){return{client:e.client}}async function i(t){if(!t)throw new Error("请传入getOssAccess");return await e.client.initOssClient({getOssAccess:t,onFailure:s=>{throw new Error(typeof(s==null?void 0:s.message)=="string"?s.message:"获取oss临时权限失败")}}),n()}exports.useOss=n;exports.useOssInit=i;
@@ -1,3 +1,14 @@
1
+ interface accessCreate {
2
+ bucket: string;
3
+ regionId: string;
4
+ endpoint: string;
5
+ accessKeyId: string;
6
+ accessKeySecret: string;
7
+ expiration: number;
8
+ extInformation: string;
9
+ fileProvideType: string;
10
+ callbackUrl: string;
11
+ }
1
12
  export interface ApDownLoadProps {
2
13
  /**
3
14
  * 标签内容
@@ -16,5 +27,7 @@ export interface ApDownLoadProps {
16
27
  * @default false
17
28
  */
18
29
  disabled?: boolean;
19
- triggerClick?: () => void;
30
+ fileName: string;
31
+ getOssAccess: () => Promise<accessCreate>;
20
32
  }
33
+ export {};
@@ -5,7 +5,7 @@
5
5
  }
6
6
  .aplus-download-inner-wrapper {
7
7
  display: inline-block;
8
- color: var(--tag-main-color);
8
+ color: var(--download-main-color);
9
9
  cursor: pointer;
10
10
  display: flex;
11
11
  align-items: center;
@@ -18,7 +18,7 @@
18
18
  margin-left: 5px;
19
19
  }
20
20
  .aplus-download-inner-wrapper:hover {
21
- color: var(--tag-main-color-opacity);
21
+ color: var(--download-main-color-opacity);
22
22
  }
23
23
  .aplus-download-inner-wrapper--large {
24
24
  line-height: 26px;
@@ -5,7 +5,7 @@
5
5
  }
6
6
  .aplus-download-inner-wrapper {
7
7
  display: inline-block;
8
- color: var(--tag-main-color);
8
+ color: var(--download-main-color);
9
9
  cursor: pointer;
10
10
  display: flex;
11
11
  align-items: center;
@@ -18,7 +18,7 @@
18
18
  margin-left: 5px;
19
19
  }
20
20
  .aplus-download-inner-wrapper:hover {
21
- color: var(--tag-main-color-opacity);
21
+ color: var(--download-main-color-opacity);
22
22
  }
23
23
  .aplus-download-inner-wrapper--large {
24
24
  line-height: 26px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.0.1-beta.24",
3
+ "version": "0.0.1-beta.25",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [
@@ -60,8 +60,8 @@
60
60
  "sortablejs": "^1.15.2",
61
61
  "@aplus-frontend/oss": "^1.0.11",
62
62
  "mime": "^4.0.3",
63
- "@aplus-frontend/utils": "1.0.19",
64
- "@aplus-frontend/hooks": "1.0.4"
63
+ "@aplus-frontend/hooks": "1.0.4",
64
+ "@aplus-frontend/utils": "1.0.19"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "ant-design-vue": "^4.2.1",
@@ -1,137 +0,0 @@
1
- import { default as ModalButton } from './modal-button.vue';
2
- import { default as PopConfirmButton } from './pop-confirm-button.vue';
3
- import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Plugin } from '@vue/runtime-core';
4
- export * from './interface';
5
- export { ModalButton, PopConfirmButton };
6
- export declare const BaseButton: {
7
- new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
8
- text: {
9
- type: PropType<string>;
10
- };
11
- color: {
12
- type: PropType<"primary" | "success" | "error" | "warning">;
13
- };
14
- disabled: {
15
- type: PropType<boolean>;
16
- };
17
- onClick: {
18
- type: PropType<() => void>;
19
- };
20
- loading: {
21
- type: PropType<boolean>;
22
- };
23
- preIcon: {
24
- type: PropType<string>;
25
- };
26
- postIcon: {
27
- type: PropType<string>;
28
- };
29
- iconSize: {
30
- type: PropType<number>;
31
- default: number;
32
- };
33
- }>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
34
- text: {
35
- type: PropType<string>;
36
- };
37
- color: {
38
- type: PropType<"primary" | "success" | "error" | "warning">;
39
- };
40
- disabled: {
41
- type: PropType<boolean>;
42
- };
43
- onClick: {
44
- type: PropType<() => void>;
45
- };
46
- loading: {
47
- type: PropType<boolean>;
48
- };
49
- preIcon: {
50
- type: PropType<string>;
51
- };
52
- postIcon: {
53
- type: PropType<string>;
54
- };
55
- iconSize: {
56
- type: PropType<number>;
57
- default: number;
58
- };
59
- }>>, {
60
- iconSize: number;
61
- }, true, {}, {}, {
62
- P: {};
63
- B: {};
64
- D: {};
65
- C: {};
66
- M: {};
67
- Defaults: {};
68
- }, Readonly< ExtractPropTypes<{
69
- text: {
70
- type: PropType<string>;
71
- };
72
- color: {
73
- type: PropType<"primary" | "success" | "error" | "warning">;
74
- };
75
- disabled: {
76
- type: PropType<boolean>;
77
- };
78
- onClick: {
79
- type: PropType<() => void>;
80
- };
81
- loading: {
82
- type: PropType<boolean>;
83
- };
84
- preIcon: {
85
- type: PropType<string>;
86
- };
87
- postIcon: {
88
- type: PropType<string>;
89
- };
90
- iconSize: {
91
- type: PropType<number>;
92
- default: number;
93
- };
94
- }>>, {}, {}, {}, {}, {
95
- iconSize: number;
96
- }>;
97
- __isFragment?: undefined;
98
- __isTeleport?: undefined;
99
- __isSuspense?: undefined;
100
- } & ComponentOptionsBase<Readonly< ExtractPropTypes<{
101
- text: {
102
- type: PropType<string>;
103
- };
104
- color: {
105
- type: PropType<"primary" | "success" | "error" | "warning">;
106
- };
107
- disabled: {
108
- type: PropType<boolean>;
109
- };
110
- onClick: {
111
- type: PropType<() => void>;
112
- };
113
- loading: {
114
- type: PropType<boolean>;
115
- };
116
- preIcon: {
117
- type: PropType<string>;
118
- };
119
- postIcon: {
120
- type: PropType<string>;
121
- };
122
- iconSize: {
123
- type: PropType<number>;
124
- default: number;
125
- };
126
- }>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
127
- iconSize: number;
128
- }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
129
- $slots: {
130
- icon?(_: {}): any;
131
- default?(_: any): any;
132
- };
133
- }) & Plugin<any[]> & (new (...args: any[]) => {
134
- $props: {
135
- onClick?: (() => void) | undefined;
136
- };
137
- });