@aplus-frontend/ui 0.2.11 → 0.2.13
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/index.mjs +41 -39
- package/es/src/ap-list/index.vue.d.ts +1 -0
- package/es/src/ap-list/index.vue.mjs +85 -79
- package/es/src/ap-list/interface.d.ts +7 -0
- package/es/src/ap-table/ap-table.vue2.mjs +64 -65
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +20 -0
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue.mjs +4 -0
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +82 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +84 -75
- package/es/src/business/ap-image/ApImage.vue.d.ts +39 -1
- package/es/src/business/ap-image/ApImage.vue2.mjs +89 -39
- package/es/src/business/ap-image/hooks/useOss.mjs +35 -26
- package/es/src/business/ap-image/index.d.ts +41 -1
- package/es/src/business/ap-image/interface.d.ts +1 -0
- package/es/src/business/ap-image/style/css.d.ts +0 -1
- package/es/src/business/ap-image/style/css.js +1 -1
- package/es/src/business/ap-image/style/index.d.ts +0 -1
- package/es/src/business/ap-image/style/index.js +1 -1
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +30 -30
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +227 -0
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.mjs +4 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
- package/es/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
- package/es/src/business/ap-upload-file/hook/useInjectContext.mjs +9 -0
- package/es/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
- package/es/src/business/ap-upload-file/hook/useOss.mjs +30 -0
- package/es/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
- package/es/src/business/ap-upload-file/hook/useProps.mjs +28 -0
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +27 -0
- package/es/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +18 -0
- package/es/src/business/ap-upload-file/index.d.ts +3 -0
- package/es/src/business/ap-upload-file/index.mjs +2 -0
- package/es/src/business/ap-upload-file/interface.d.ts +29 -0
- package/es/src/business/ap-upload-file/interface.mjs +1 -0
- package/es/src/business/ap-upload-file/utils/accept.d.ts +16 -0
- package/es/src/business/ap-upload-file/utils/accept.mjs +55 -0
- package/es/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
- package/es/src/business/ap-upload-file/utils/fileList.mjs +16 -0
- package/es/src/business/ap-upload-file/utils/upload.d.ts +10 -0
- package/es/src/business/ap-upload-file/utils/upload.mjs +62 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +43 -42
- package/es/src/config-provider/config-provider.d.ts +8 -0
- package/es/src/config-provider/css-var.d.ts +8 -0
- package/es/src/config-provider/css-var.mjs +25 -9
- package/es/src/config-provider/index.d.ts +48 -0
- package/es/src/index.mjs +33 -31
- package/es/src/locale/lang/en.mjs +4 -0
- package/es/src/locale/lang/zh-cn.mjs +4 -0
- package/es/src/path-map.mjs +2 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +1 -0
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-list/interface.d.ts +7 -0
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +20 -0
- package/lib/src/ap-table/components/paragraph-ellipsis/index.vue.js +1 -0
- package/lib/src/ap-table/components/paragraph-ellipsis/index.vue2.js +1 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/business/ap-image/ApImage.vue.d.ts +39 -1
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-image/hooks/useOss.js +1 -1
- package/lib/src/business/ap-image/index.d.ts +41 -1
- package/lib/src/business/ap-image/interface.d.ts +1 -0
- package/lib/src/business/ap-image/style/css.d.ts +0 -1
- package/lib/src/business/ap-image/style/css.js +1 -1
- package/lib/src/business/ap-image/style/index.d.ts +0 -1
- package/lib/src/business/ap-image/style/index.js +1 -1
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
- package/lib/src/business/ap-upload-file/hook/useInjectContext.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
- package/lib/src/business/ap-upload-file/hook/useOss.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
- package/lib/src/business/ap-upload-file/hook/useProps.js +1 -0
- package/lib/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -0
- package/lib/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -0
- package/lib/src/business/ap-upload-file/index.d.ts +3 -0
- package/lib/src/business/ap-upload-file/index.js +1 -0
- package/lib/src/business/ap-upload-file/interface.d.ts +29 -0
- package/lib/src/business/ap-upload-file/interface.js +1 -0
- package/lib/src/business/ap-upload-file/utils/accept.d.ts +16 -0
- package/lib/src/business/ap-upload-file/utils/accept.js +1 -0
- package/lib/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
- package/lib/src/business/ap-upload-file/utils/fileList.js +1 -0
- package/lib/src/business/ap-upload-file/utils/upload.d.ts +10 -0
- package/lib/src/business/ap-upload-file/utils/upload.js +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +8 -0
- package/lib/src/config-provider/css-var.d.ts +8 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +48 -0
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Image as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as S, computed as s, ref as U, watchEffect as j, openBlock as i, createBlock as g, unref as n, mergeProps as p, withCtx as B, renderSlot as E, normalizeProps as I, guardReactiveProps as L, createElementVNode as b, normalizeClass as D, createElementBlock as M, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as x } from "vue";
|
|
2
|
+
import { Image as z } from "@aplus-frontend/antdv";
|
|
3
|
+
import { DownloadOutlined as V } from "@ant-design/icons-vue";
|
|
4
|
+
import { injectLocaleToOss as W, getOssInstance as G, getSignatureUrl as $ } from "./hooks/useOss.mjs";
|
|
4
5
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { omit as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
6
|
+
import q from "./imgs/admin-fallback.jpg.mjs";
|
|
7
|
+
import H from "./imgs/aplus-fallback.jpg.mjs";
|
|
8
|
+
import { omit as J } from "lodash-unified";
|
|
9
|
+
import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useGlobalConfig as m } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
import { useLocale as Q } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
const se = /* @__PURE__ */ S({
|
|
11
13
|
__name: "ApImage",
|
|
12
14
|
props: {
|
|
13
15
|
getOssAccess: {},
|
|
@@ -16,44 +18,92 @@ const T = /* @__PURE__ */ b({
|
|
|
16
18
|
alt: {},
|
|
17
19
|
fallback: {},
|
|
18
20
|
src: {},
|
|
21
|
+
fileName: {},
|
|
19
22
|
preview: { type: [Boolean, Object], default: !0 }
|
|
20
23
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const e =
|
|
23
|
-
aplus:
|
|
24
|
-
admin:
|
|
25
|
-
},
|
|
24
|
+
setup(v) {
|
|
25
|
+
const { b: u } = K("ap-image"), e = v, d = {
|
|
26
|
+
aplus: H,
|
|
27
|
+
admin: q
|
|
28
|
+
}, k = m("uiMode"), w = m("apUpload"), f = m(
|
|
29
|
+
"downloadCenterTriggerConfig"
|
|
30
|
+
), { t: h, lang: C } = Q(), O = s(
|
|
26
31
|
() => {
|
|
27
32
|
var a;
|
|
28
|
-
return e.getOssAccess || ((a =
|
|
33
|
+
return e.getOssAccess || ((a = w.value) == null ? void 0 : a.getOssAccess);
|
|
29
34
|
}
|
|
30
|
-
),
|
|
31
|
-
() =>
|
|
32
|
-
),
|
|
33
|
-
|
|
35
|
+
), A = s(
|
|
36
|
+
() => d[k.value] || d.aplus
|
|
37
|
+
), N = s(() => (e == null ? void 0 : e.fallback) || A.value), r = U("");
|
|
38
|
+
W(h, C), j(async () => {
|
|
34
39
|
var a;
|
|
35
|
-
if (e != null && e.src) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const o = await B(g.value), r = await C({
|
|
42
|
-
oss: o,
|
|
43
|
-
fileName: e.src
|
|
44
|
-
});
|
|
45
|
-
r && (t.value = r);
|
|
46
|
-
} catch {
|
|
47
|
-
t.value = "";
|
|
48
|
-
}
|
|
40
|
+
if (!(e != null && e.src)) {
|
|
41
|
+
r.value = "";
|
|
42
|
+
return;
|
|
49
43
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
if (!((a = e.src) != null && a.startsWith("Frontend-Upload"))) {
|
|
45
|
+
r.value = e.src;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const o = await G(O.value), t = await $({
|
|
50
|
+
oss: o,
|
|
51
|
+
fileName: e.src
|
|
52
|
+
});
|
|
53
|
+
t && (r.value = t);
|
|
54
|
+
} catch {
|
|
55
|
+
r.value = "";
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
async function y() {
|
|
59
|
+
var t, l, c;
|
|
60
|
+
if (!(e != null && e.src))
|
|
61
|
+
return;
|
|
62
|
+
const a = e.src, o = e.fileName ?? e.src;
|
|
63
|
+
if (!((t = e.src) != null && t.startsWith("Frontend-Upload"))) {
|
|
64
|
+
_(a, o);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if ((l = f.value) != null && l.trigger) {
|
|
68
|
+
let F = [
|
|
69
|
+
{
|
|
70
|
+
objectName: a,
|
|
71
|
+
fileName: o
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
await ((c = f.value) == null ? void 0 : c.trigger(F));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const _ = (a, o) => {
|
|
78
|
+
const t = document.createElement("a");
|
|
79
|
+
t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", o), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
80
|
+
};
|
|
81
|
+
return (a, o) => (i(), g(n(z), p({
|
|
82
|
+
class: [n(u)()]
|
|
83
|
+
}, {
|
|
84
|
+
...n(J)(e, ["src", "getOssAccess"]),
|
|
85
|
+
fallback: N.value,
|
|
86
|
+
src: r.value
|
|
87
|
+
}), {
|
|
88
|
+
toolbarRender: B((t) => [
|
|
89
|
+
E(a.$slots, "toolbarRender", I(L({ ...t })), () => [
|
|
90
|
+
b("div", {
|
|
91
|
+
class: D([n(u)("toolbar")])
|
|
92
|
+
}, [
|
|
93
|
+
(i(!0), M(P, null, R(t.originalNodes, (l, c) => (i(), g(T(l), p({ ref_for: !0 }, t, { key: c }), null, 16))), 128)),
|
|
94
|
+
b("div", {
|
|
95
|
+
class: "ant-image-preview-operations-operation",
|
|
96
|
+
onClick: y
|
|
97
|
+
}, [
|
|
98
|
+
x(n(V))
|
|
99
|
+
])
|
|
100
|
+
], 2)
|
|
101
|
+
])
|
|
102
|
+
]),
|
|
103
|
+
_: 3
|
|
104
|
+
}, 16, ["class"]));
|
|
55
105
|
}
|
|
56
106
|
});
|
|
57
107
|
export {
|
|
58
|
-
|
|
108
|
+
se as default
|
|
59
109
|
};
|
|
@@ -1,37 +1,46 @@
|
|
|
1
|
-
import { createOssInstance as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createOssInstance as l } from "@aplus-frontend/oss";
|
|
2
|
+
const r = 1e4;
|
|
3
|
+
let a, i;
|
|
4
|
+
function f(t, n) {
|
|
5
|
+
a = t, i = n;
|
|
5
6
|
}
|
|
6
|
-
const
|
|
7
|
+
const u = {
|
|
7
8
|
"zh-cn": "zh_CN",
|
|
8
9
|
en: "en_US"
|
|
9
10
|
};
|
|
10
|
-
function
|
|
11
|
-
return i
|
|
11
|
+
function g() {
|
|
12
|
+
return u[i.value] ?? "zh_CN";
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
let e;
|
|
15
|
+
async function m(t) {
|
|
16
|
+
if (!t)
|
|
15
17
|
throw new Error(`${a("ap.apUpload.pleasePass")}getOssAccess`);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
return e != null && e.createDate && e.createDate < Date.now() + r && (e != null && e.oss) || (e = {
|
|
19
|
+
oss: new Promise((n, c) => {
|
|
20
|
+
const o = l();
|
|
21
|
+
o.initOssClient({
|
|
22
|
+
getOssAccess: t,
|
|
23
|
+
locale: g(),
|
|
24
|
+
onFailure: (s) => {
|
|
25
|
+
c(
|
|
26
|
+
typeof (s == null ? void 0 : s.message) == "string" ? s.message : a("ap.apUpload.FailedToObtainOssTemporaryPermissions")
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}).then(() => {
|
|
30
|
+
n(o);
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
createDate: Date.now()
|
|
34
|
+
}), e.oss;
|
|
26
35
|
}
|
|
27
|
-
function
|
|
28
|
-
oss:
|
|
29
|
-
fileName:
|
|
36
|
+
function O({
|
|
37
|
+
oss: t,
|
|
38
|
+
fileName: n
|
|
30
39
|
}) {
|
|
31
|
-
return
|
|
40
|
+
return t.getSignatureUrl(n);
|
|
32
41
|
}
|
|
33
42
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
m as getOssInstance,
|
|
44
|
+
O as getSignatureUrl,
|
|
45
|
+
f as injectLocaleToOss
|
|
37
46
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Plugin } from 'vue';
|
|
2
2
|
import { accessCreate } from '@aplus-frontend/oss';
|
|
3
|
+
import { ImgInfo } from '@aplus-frontend/antdv/es/vc-image/src/Preview';
|
|
3
4
|
export * from './interface';
|
|
4
5
|
declare const ApImage: {
|
|
5
6
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
@@ -12,6 +13,9 @@ declare const ApImage: {
|
|
|
12
13
|
getOssAccess: {
|
|
13
14
|
type: PropType<() => Promise< accessCreate>>;
|
|
14
15
|
};
|
|
16
|
+
fileName: {
|
|
17
|
+
type: PropType<string>;
|
|
18
|
+
};
|
|
15
19
|
src: {
|
|
16
20
|
type: PropType<string>;
|
|
17
21
|
};
|
|
@@ -42,6 +46,9 @@ declare const ApImage: {
|
|
|
42
46
|
getOssAccess: {
|
|
43
47
|
type: PropType<() => Promise< accessCreate>>;
|
|
44
48
|
};
|
|
49
|
+
fileName: {
|
|
50
|
+
type: PropType<string>;
|
|
51
|
+
};
|
|
45
52
|
src: {
|
|
46
53
|
type: PropType<string>;
|
|
47
54
|
};
|
|
@@ -88,6 +95,9 @@ declare const ApImage: {
|
|
|
88
95
|
getOssAccess: {
|
|
89
96
|
type: PropType<() => Promise< accessCreate>>;
|
|
90
97
|
};
|
|
98
|
+
fileName: {
|
|
99
|
+
type: PropType<string>;
|
|
100
|
+
};
|
|
91
101
|
src: {
|
|
92
102
|
type: PropType<string>;
|
|
93
103
|
};
|
|
@@ -131,6 +141,9 @@ declare const ApImage: {
|
|
|
131
141
|
getOssAccess: {
|
|
132
142
|
type: PropType<() => Promise< accessCreate>>;
|
|
133
143
|
};
|
|
144
|
+
fileName: {
|
|
145
|
+
type: PropType<string>;
|
|
146
|
+
};
|
|
134
147
|
src: {
|
|
135
148
|
type: PropType<string>;
|
|
136
149
|
};
|
|
@@ -160,7 +173,34 @@ declare const ApImage: {
|
|
|
160
173
|
maskClassName?: string;
|
|
161
174
|
current?: number;
|
|
162
175
|
};
|
|
163
|
-
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (
|
|
176
|
+
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
177
|
+
$slots: {
|
|
178
|
+
toolbarRender?(_: {
|
|
179
|
+
originalNodes: import("vue/jsx-runtime").JSX.Element[];
|
|
180
|
+
actions: {
|
|
181
|
+
onFlipX: () => void;
|
|
182
|
+
onFlipY: () => void;
|
|
183
|
+
onRotateLeft: () => void;
|
|
184
|
+
onRotateRight: () => void;
|
|
185
|
+
onZoomIn: () => void;
|
|
186
|
+
onZoomOut: () => void;
|
|
187
|
+
};
|
|
188
|
+
transform: {
|
|
189
|
+
x: number;
|
|
190
|
+
y: number;
|
|
191
|
+
scale: number;
|
|
192
|
+
rotate: number;
|
|
193
|
+
flip: {
|
|
194
|
+
x: number;
|
|
195
|
+
y: number;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
image: ImgInfo;
|
|
199
|
+
current?: number;
|
|
200
|
+
total?: number;
|
|
201
|
+
}): any;
|
|
202
|
+
};
|
|
203
|
+
}) & ( Plugin & (new (...args: any[]) => {
|
|
164
204
|
$props: {
|
|
165
205
|
onClick?: () => void;
|
|
166
206
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@aplus-frontend/ui-theme/dist/ap-image/ap-image.css';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-image/ap-image.less';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isNil as
|
|
3
|
-
import { TableSummaryRow as
|
|
4
|
-
import { flattenColumns as
|
|
1
|
+
import { defineComponent as v, computed as L, createVNode as N, Fragment as y, openBlock as m, createBlock as i, unref as r, normalizeClass as f, withCtx as x, createElementBlock as w, renderList as z, normalizeStyle as B, resolveDynamicComponent as R } from "vue";
|
|
2
|
+
import { isNil as A, get as c } from "lodash-unified";
|
|
3
|
+
import { TableSummaryRow as D, TableSummaryCell as F } from "@aplus-frontend/antdv";
|
|
4
|
+
import { flattenColumns as V, formatDataIndex as u } from "./utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { isNumeric as E, toThousand as P, toFixed as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
const
|
|
6
|
+
import { isNumeric as E, toThousand as P, toFixed as $ } from "@aplus-frontend/utils";
|
|
7
|
+
import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
const Q = /* @__PURE__ */ v({
|
|
9
9
|
name: "ApSummary",
|
|
10
10
|
__name: "ap-summary",
|
|
11
11
|
props: {
|
|
@@ -22,14 +22,14 @@ const O = /* @__PURE__ */ I({
|
|
|
22
22
|
default: "middle"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const n =
|
|
25
|
+
setup(k) {
|
|
26
|
+
const n = k, h = (a) => a === 0, T = (a, o) => {
|
|
27
27
|
var s;
|
|
28
28
|
if (!a || !E(a) || o.valueType !== "number")
|
|
29
29
|
return a;
|
|
30
30
|
const e = (s = o.fieldProps) == null ? void 0 : s.field, t = (e == null ? void 0 : e.precision) || 0;
|
|
31
|
-
return (
|
|
32
|
-
},
|
|
31
|
+
return (A(e == null ? void 0 : e.thousands) ? !0 : e == null ? void 0 : e.thousands) ? P(a, t) : $(a, t);
|
|
32
|
+
}, C = L(() => {
|
|
33
33
|
let a = [];
|
|
34
34
|
n.hasSelect && a.push({
|
|
35
35
|
key: "select",
|
|
@@ -37,17 +37,17 @@ const O = /* @__PURE__ */ I({
|
|
|
37
37
|
align: "left",
|
|
38
38
|
value: ""
|
|
39
39
|
});
|
|
40
|
-
const e =
|
|
40
|
+
const e = V(n.columns).map((t, d) => {
|
|
41
41
|
let s;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
42
|
+
const b = c(n.data, u(t.dataIndex || t.key));
|
|
43
|
+
if (h(d))
|
|
44
44
|
s = n.summaryTitle;
|
|
45
|
-
else if (
|
|
46
|
-
const p = c(n.data, u(t.dataIndex || t.key)),
|
|
47
|
-
s =
|
|
45
|
+
else if (b && (t.customRender || t.renderText)) {
|
|
46
|
+
const p = c(n.data, u(t.dataIndex || t.key)), I = u(t.dataIndex || t.key), l = t.customRender || t.renderText;
|
|
47
|
+
s = l == null ? void 0 : l({
|
|
48
48
|
value: p,
|
|
49
49
|
record: {
|
|
50
|
-
[
|
|
50
|
+
[I]: p
|
|
51
51
|
},
|
|
52
52
|
text: void 0,
|
|
53
53
|
index: 0,
|
|
@@ -55,32 +55,32 @@ const O = /* @__PURE__ */ I({
|
|
|
55
55
|
column: {}
|
|
56
56
|
});
|
|
57
57
|
} else
|
|
58
|
-
s =
|
|
58
|
+
s = T(c(n.data, u(t.dataIndex || t.key)), t);
|
|
59
59
|
return {
|
|
60
60
|
key: t.key,
|
|
61
61
|
rowSpan: 1,
|
|
62
62
|
align: t.align,
|
|
63
|
-
value: s
|
|
63
|
+
value: N(y, null, [s])
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
66
|
return a.concat(e);
|
|
67
67
|
}), {
|
|
68
|
-
b:
|
|
69
|
-
e:
|
|
70
|
-
em:
|
|
71
|
-
} =
|
|
72
|
-
return (a, o) => (m(),
|
|
73
|
-
class:
|
|
68
|
+
b: S,
|
|
69
|
+
e: _,
|
|
70
|
+
em: g
|
|
71
|
+
} = j("ap-summary");
|
|
72
|
+
return (a, o) => (m(), i(r(D), {
|
|
73
|
+
class: f(r(S)())
|
|
74
74
|
}, {
|
|
75
|
-
default:
|
|
76
|
-
class:
|
|
75
|
+
default: x(() => [(m(!0), w(y, null, z(C.value, (e, t) => (m(), i(r(F), {
|
|
76
|
+
class: f(`${n.size === "small" ? r(g)("item", "small") : r(_)("item")}`),
|
|
77
77
|
key: e.key,
|
|
78
78
|
index: t,
|
|
79
79
|
style: B({
|
|
80
80
|
textAlign: e.align
|
|
81
81
|
})
|
|
82
82
|
}, {
|
|
83
|
-
default:
|
|
83
|
+
default: x(() => [(m(), i(R(e.value)))]),
|
|
84
84
|
_: 2
|
|
85
85
|
}, 1032, ["class", "index", "style"]))), 128))]),
|
|
86
86
|
_: 1
|
|
@@ -88,5 +88,5 @@ const O = /* @__PURE__ */ I({
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
export {
|
|
91
|
-
|
|
91
|
+
Q as default
|
|
92
92
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ApUploadSingleProps } from '../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApUploadSingleProps>, {
|
|
12
|
+
needName: boolean;
|
|
13
|
+
maxSize: number;
|
|
14
|
+
accept: string;
|
|
15
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
|
+
"update:fileList": (...args: any[]) => void;
|
|
17
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApUploadSingleProps>, {
|
|
18
|
+
needName: boolean;
|
|
19
|
+
maxSize: number;
|
|
20
|
+
accept: string;
|
|
21
|
+
}>>> & {
|
|
22
|
+
"onUpdate:fileList"?: ((...args: any[]) => any) | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
accept: string;
|
|
25
|
+
maxSize: number;
|
|
26
|
+
}, {}>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithDefaults<P, D> = {
|
|
30
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
31
|
+
default: D[K];
|
|
32
|
+
}> : P[K];
|
|
33
|
+
};
|
|
34
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
|
+
type __VLS_TypePropsToOption<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
38
|
+
} : {
|
|
39
|
+
type: PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type __VLS_PrettifyLocal<T> = {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} & {};
|