@aplus-frontend/ui 0.2.10 → 0.2.12
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-form/ap-form.vue.d.ts +4 -0
- package/es/src/ap-form/ap-form.vue2.mjs +131 -108
- package/es/src/ap-form/drawer-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/drawer-form/index.vue.mjs +43 -37
- package/es/src/ap-form/interface.d.ts +8 -0
- package/es/src/ap-form/modal-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/modal-form/index.vue.mjs +26 -20
- package/es/src/ap-form/search-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/search-form/index.vue.mjs +37 -31
- package/es/src/ap-form/utils/params.d.ts +17 -0
- package/es/src/ap-form/utils/params.mjs +19 -0
- 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/hooks/use-table-column-state.mjs +84 -75
- package/es/src/ap-table/interface.d.ts +1 -0
- package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
- package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +80 -70
- package/es/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
- package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +44 -34
- package/es/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
- package/es/src/business/ap-group-search/extension-select/style/css.js +1 -0
- package/es/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
- package/es/src/business/ap-group-search/extension-select/style/index.js +1 -0
- package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +9 -9
- package/es/src/business/ap-group-search/index.d.ts +28 -0
- package/es/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
- package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +50 -50
- package/es/src/business/ap-group-search/popover-select/style/css.js +1 -1
- package/es/src/business/ap-group-search/popover-select/style/index.js +1 -1
- package/es/src/business/ap-image/ApImage.vue2.mjs +16 -14
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
- 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 +1 -1
- package/es/src/locale/lang/zh-cn.mjs +1 -1
- package/es/src/path-map.mjs +3 -1
- package/es/src/utils/index.d.ts +12 -0
- package/es/src/utils/index.mjs +27 -18
- package/lib/index.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +4 -0
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +8 -0
- package/lib/src/ap-form/modal-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/utils/params.d.ts +17 -0
- package/lib/src/ap-form/utils/params.js +1 -0
- 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/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/interface.d.ts +1 -0
- package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
- package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
- package/lib/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
- package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
- package/lib/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
- package/lib/src/business/ap-group-search/extension-select/style/css.js +1 -0
- package/lib/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
- package/lib/src/business/ap-group-search/extension-select/style/index.js +1 -0
- package/lib/src/business/ap-group-search/images/icon-line-select.vue.js +1 -1
- package/lib/src/business/ap-group-search/index.d.ts +28 -0
- package/lib/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
- package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
- package/lib/src/business/ap-group-search/popover-select/style/css.js +1 -1
- package/lib/src/business/ap-group-search/popover-select/style/index.js +1 -1
- package/lib/src/business/ap-image/ApImage.vue2.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/lib/src/utils/index.d.ts +12 -0
- package/lib/src/utils/index.js +1 -1
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
1
|
+
import { defineComponent as P, ref as u, watchEffect as R, openBlock as L, createElementBlock as M, normalizeClass as p, unref as e, createVNode as a, withCtx as n, createElementVNode as s, mergeProps as O, createTextVNode as d, toDisplayString as m } from "vue";
|
|
2
|
+
import { Popover as T, Select as z, Button as f, Space as G } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../../config-provider/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { wait as
|
|
6
|
-
import { useLocale as
|
|
7
|
-
import { useGlobalConfig as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
const
|
|
4
|
+
import A from "../images/icon-line-select.vue.mjs";
|
|
5
|
+
import { wait as D } from "@aplus-frontend/utils";
|
|
6
|
+
import { useLocale as F } from "../../../config-provider/hooks/use-locale.mjs";
|
|
7
|
+
import { useGlobalConfig as E } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
8
|
+
import { useNamespace as K } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const Y = /* @__PURE__ */ P({
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
value: {},
|
|
@@ -81,54 +81,52 @@ const Z = /* @__PURE__ */ O({
|
|
|
81
81
|
optionFilterProp: {},
|
|
82
82
|
optionLabelProp: {},
|
|
83
83
|
defaultActiveFirstOption: { type: Boolean },
|
|
84
|
-
labelInValue: { type: Boolean }
|
|
84
|
+
labelInValue: { type: Boolean },
|
|
85
|
+
__parentRef: {}
|
|
85
86
|
},
|
|
86
87
|
emits: ["submit", "open-change"],
|
|
87
|
-
setup(
|
|
88
|
-
const { t:
|
|
89
|
-
|
|
90
|
-
t.value =
|
|
88
|
+
setup(S, { emit: w }) {
|
|
89
|
+
const { t: r } = F(), h = E("uiMode", "aplus"), i = S, v = w, t = u([]), c = u(!1), g = u();
|
|
90
|
+
R(() => {
|
|
91
|
+
t.value = i.value;
|
|
91
92
|
});
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return document.querySelector(u) || ((w = (S = o == null ? void 0 : o.parentNode) == null ? void 0 : S.parentNode) == null ? void 0 : w.parentNode) || o;
|
|
96
|
-
}, _ = (o) => {
|
|
97
|
-
c.value = o, C("open-change", o);
|
|
98
|
-
}, y = () => {
|
|
93
|
+
const B = (o) => i.__parentRef || o, b = (o) => {
|
|
94
|
+
c.value = o, v("open-change", o);
|
|
95
|
+
}, C = () => {
|
|
99
96
|
c.value = !1;
|
|
100
|
-
},
|
|
97
|
+
}, _ = () => {
|
|
101
98
|
t.value = [];
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
},
|
|
99
|
+
}, x = (o) => {
|
|
100
|
+
t.value = o;
|
|
101
|
+
}, k = async () => {
|
|
105
102
|
var o;
|
|
106
|
-
(o = g.value) == null || o.blur(),
|
|
107
|
-
}, { b:
|
|
108
|
-
return (o,
|
|
109
|
-
class: p(e(
|
|
103
|
+
(o = g.value) == null || o.blur(), C(), await D(150), v("submit", t.value);
|
|
104
|
+
}, { b: N, e: V, em: l } = K("ap-popover-select");
|
|
105
|
+
return (o, y) => (L(), M("div", {
|
|
106
|
+
class: p(e(N)())
|
|
110
107
|
}, [
|
|
111
|
-
a(e(
|
|
112
|
-
overlayClassName: e(
|
|
113
|
-
"get-popup-container":
|
|
108
|
+
a(e(T), {
|
|
109
|
+
overlayClassName: e(V)("popover"),
|
|
110
|
+
"get-popup-container": B,
|
|
114
111
|
trigger: "click",
|
|
115
112
|
open: c.value,
|
|
116
113
|
placement: "bottomLeft",
|
|
117
|
-
onOpenChange:
|
|
114
|
+
onOpenChange: b
|
|
118
115
|
}, {
|
|
119
116
|
content: n(() => [
|
|
120
117
|
s("div", null, [
|
|
121
118
|
s("div", {
|
|
122
|
-
class: p(e(
|
|
119
|
+
class: p(e(l)("popover", "content"))
|
|
123
120
|
}, [
|
|
124
|
-
a(e(
|
|
121
|
+
a(e(z), O({ ...i }, {
|
|
125
122
|
mode: "tags",
|
|
126
123
|
bordered: !1,
|
|
127
124
|
value: t.value,
|
|
128
|
-
onChange:
|
|
129
|
-
placeholder: e(
|
|
125
|
+
onChange: y[0] || (y[0] = (I) => x(I)),
|
|
126
|
+
placeholder: e(r)("ap.apGroupSearch.tokenSeparatorsPlaceholder"),
|
|
130
127
|
tokenSeparators: [",", `
|
|
131
128
|
`, "\r"],
|
|
129
|
+
"max-tag-count": 200,
|
|
132
130
|
open: !1,
|
|
133
131
|
ref_key: "selectRef",
|
|
134
132
|
ref: g
|
|
@@ -136,36 +134,36 @@ const Z = /* @__PURE__ */ O({
|
|
|
136
134
|
], 2),
|
|
137
135
|
s("div", {
|
|
138
136
|
class: p(
|
|
139
|
-
e(
|
|
137
|
+
e(h) === "aplus" ? e(l)("popover", "footer") : e(l)("popover", "footer--admin")
|
|
140
138
|
)
|
|
141
139
|
}, [
|
|
142
|
-
a(e(
|
|
140
|
+
a(e(f), {
|
|
143
141
|
size: "small",
|
|
144
|
-
onClick:
|
|
142
|
+
onClick: C
|
|
145
143
|
}, {
|
|
146
144
|
default: n(() => [
|
|
147
|
-
m(
|
|
145
|
+
d(m(e(r)("ap.apGroupSearch.close")), 1)
|
|
148
146
|
]),
|
|
149
147
|
_: 1
|
|
150
148
|
}),
|
|
151
|
-
a(e(
|
|
149
|
+
a(e(G), null, {
|
|
152
150
|
default: n(() => [
|
|
153
|
-
a(e(
|
|
151
|
+
a(e(f), {
|
|
154
152
|
size: "small",
|
|
155
|
-
onClick:
|
|
153
|
+
onClick: _
|
|
156
154
|
}, {
|
|
157
155
|
default: n(() => [
|
|
158
|
-
m(
|
|
156
|
+
d(m(e(r)("ap.apGroupSearch.clear")), 1)
|
|
159
157
|
]),
|
|
160
158
|
_: 1
|
|
161
159
|
}),
|
|
162
|
-
a(e(
|
|
160
|
+
a(e(f), {
|
|
163
161
|
size: "small",
|
|
164
162
|
type: "primary",
|
|
165
|
-
onClick:
|
|
163
|
+
onClick: k
|
|
166
164
|
}, {
|
|
167
165
|
default: n(() => [
|
|
168
|
-
m(
|
|
166
|
+
d(m(e(r)("ap.apGroupSearch.confirm")), 1)
|
|
169
167
|
]),
|
|
170
168
|
_: 1
|
|
171
169
|
})
|
|
@@ -177,9 +175,11 @@ const Z = /* @__PURE__ */ O({
|
|
|
177
175
|
]),
|
|
178
176
|
default: n(() => [
|
|
179
177
|
s("span", {
|
|
180
|
-
class: p(
|
|
178
|
+
class: p(
|
|
179
|
+
e(h) === "aplus" ? e(l)("popover", "trigger") : e(l)("popover", "trigger--admin")
|
|
180
|
+
)
|
|
181
181
|
}, [
|
|
182
|
-
a(
|
|
182
|
+
a(A)
|
|
183
183
|
], 2)
|
|
184
184
|
]),
|
|
185
185
|
_: 1
|
|
@@ -188,5 +188,5 @@ const Z = /* @__PURE__ */ O({
|
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
export {
|
|
191
|
-
|
|
191
|
+
Y as default
|
|
192
192
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-popover-select.css';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-popover-select.less';
|
|
@@ -32,20 +32,22 @@ const T = /* @__PURE__ */ b({
|
|
|
32
32
|
), v = s(() => (e == null ? void 0 : e.fallback) || d.value), t = k("");
|
|
33
33
|
return y(m, p), A(async () => {
|
|
34
34
|
var a;
|
|
35
|
-
if (e != null && e.src) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
if (!(e != null && e.src)) {
|
|
36
|
+
t.value = "";
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (!((a = e.src) != null && a.startsWith("Frontend-Upload"))) {
|
|
40
|
+
t.value = e.src;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const o = await B(g.value), r = await C({
|
|
45
|
+
oss: o,
|
|
46
|
+
fileName: e.src
|
|
47
|
+
});
|
|
48
|
+
r && (t.value = r);
|
|
49
|
+
} catch {
|
|
50
|
+
t.value = "";
|
|
49
51
|
}
|
|
50
52
|
}), (a, o) => (O(), h(l(U), _(w({
|
|
51
53
|
...l(M)(e, ["src", "getOssAccess"]),
|
|
@@ -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
|
|
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,45 +22,65 @@ const J = /* @__PURE__ */ S({
|
|
|
22
22
|
default: "middle"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
var
|
|
28
|
-
if (!
|
|
29
|
-
return
|
|
30
|
-
const
|
|
31
|
-
return (
|
|
32
|
-
},
|
|
33
|
-
let
|
|
34
|
-
|
|
25
|
+
setup(k) {
|
|
26
|
+
const n = k, h = (a) => a === 0, T = (a, o) => {
|
|
27
|
+
var s;
|
|
28
|
+
if (!a || !E(a) || o.valueType !== "number")
|
|
29
|
+
return a;
|
|
30
|
+
const e = (s = o.fieldProps) == null ? void 0 : s.field, t = (e == null ? void 0 : e.precision) || 0;
|
|
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
|
+
let a = [];
|
|
34
|
+
n.hasSelect && a.push({
|
|
35
35
|
key: "select",
|
|
36
36
|
rowSpan: 1,
|
|
37
37
|
align: "left",
|
|
38
38
|
value: ""
|
|
39
39
|
});
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const e = V(n.columns).map((t, d) => {
|
|
41
|
+
let s;
|
|
42
|
+
const b = c(n.data, u(t.dataIndex || t.key));
|
|
43
|
+
if (h(d))
|
|
44
|
+
s = n.summaryTitle;
|
|
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
|
+
value: p,
|
|
49
|
+
record: {
|
|
50
|
+
[I]: p
|
|
51
|
+
},
|
|
52
|
+
text: void 0,
|
|
53
|
+
index: 0,
|
|
54
|
+
renderIndex: 0,
|
|
55
|
+
column: {}
|
|
56
|
+
});
|
|
57
|
+
} else
|
|
58
|
+
s = T(c(n.data, u(t.dataIndex || t.key)), t);
|
|
59
|
+
return {
|
|
60
|
+
key: t.key,
|
|
61
|
+
rowSpan: 1,
|
|
62
|
+
align: t.align,
|
|
63
|
+
value: N(y, null, [s])
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
return a.concat(e);
|
|
47
67
|
}), {
|
|
48
|
-
b:
|
|
49
|
-
e:
|
|
50
|
-
em:
|
|
51
|
-
} =
|
|
52
|
-
return (
|
|
53
|
-
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)())
|
|
54
74
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
class:
|
|
57
|
-
key:
|
|
58
|
-
index:
|
|
59
|
-
style:
|
|
60
|
-
textAlign:
|
|
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
|
+
key: e.key,
|
|
78
|
+
index: t,
|
|
79
|
+
style: B({
|
|
80
|
+
textAlign: e.align
|
|
61
81
|
})
|
|
62
82
|
}, {
|
|
63
|
-
default:
|
|
83
|
+
default: x(() => [(m(), i(R(e.value)))]),
|
|
64
84
|
_: 2
|
|
65
85
|
}, 1032, ["class", "index", "style"]))), 128))]),
|
|
66
86
|
_: 1
|
|
@@ -68,5 +88,5 @@ const J = /* @__PURE__ */ S({
|
|
|
68
88
|
}
|
|
69
89
|
});
|
|
70
90
|
export {
|
|
71
|
-
|
|
91
|
+
Q as default
|
|
72
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
|
+
} & {};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { defineComponent as Q, computed as y, openBlock as c, createBlock as k, unref as e, mergeProps as W, withCtx as u, renderSlot as X, createElementVNode as s, normalizeClass as l, createElementBlock as g, createVNode as n, createTextVNode as p, toDisplayString as f, resolveDynamicComponent as S, h as $, Fragment as q } from "vue";
|
|
2
|
+
import { clearAllFile as I } from "../utils/fileList.mjs";
|
|
3
|
+
import C from "../icon/file-icon.vue.mjs";
|
|
4
|
+
import L from "../icon/delete-icon.vue.mjs";
|
|
5
|
+
import { Form as Y, UploadDragger as Z, TypographyParagraph as N, Progress as ee, Tooltip as B } from "@aplus-frontend/antdv";
|
|
6
|
+
import { FormItemInputContext as te } from "@aplus-frontend/antdv/es/form/FormItemContext";
|
|
7
|
+
import { useSingleProps as oe } from "../hook/useProps.mjs";
|
|
8
|
+
import { useInjectContext as le } from "../hook/useInjectContext.mjs";
|
|
9
|
+
import { omit as se } from "lodash-unified";
|
|
10
|
+
import "../../../config-provider/index.mjs";
|
|
11
|
+
import { useGlobalConfig as O } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useLocale as ne } from "../../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
import { useNamespace as ie } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
const ke = /* @__PURE__ */ Q({
|
|
15
|
+
__name: "ap-upload-single",
|
|
16
|
+
props: {
|
|
17
|
+
dirName: {},
|
|
18
|
+
getOssAccess: {},
|
|
19
|
+
fileList: {},
|
|
20
|
+
onChange: {},
|
|
21
|
+
maxSize: { default: 500 },
|
|
22
|
+
accept: { default: "*" },
|
|
23
|
+
beforeUpload: {},
|
|
24
|
+
customRequest: {},
|
|
25
|
+
title: { type: [Object, String, Number, Boolean, null, Array] },
|
|
26
|
+
subTitle: { type: [Object, String, Number, Boolean, null, Array] }
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:fileList"],
|
|
29
|
+
setup(R, { emit: T }) {
|
|
30
|
+
var D;
|
|
31
|
+
const j = te.useInject(), E = y(() => j.status), d = R, P = T, b = Y.useInjectFormItemContext(), m = y({
|
|
32
|
+
get() {
|
|
33
|
+
return d.fileList || [];
|
|
34
|
+
},
|
|
35
|
+
set(i) {
|
|
36
|
+
P("update:fileList", i), b == null || b.onFieldChange();
|
|
37
|
+
}
|
|
38
|
+
}), o = y(() => {
|
|
39
|
+
var i;
|
|
40
|
+
return (i = m.value) == null ? void 0 : i[0];
|
|
41
|
+
}), z = O("apUpload"), { t: V, lang: _ } = ne(), {
|
|
42
|
+
title: M,
|
|
43
|
+
subTitle: h,
|
|
44
|
+
beforeUpload: G,
|
|
45
|
+
customRequest: H
|
|
46
|
+
} = oe(d), J = H;
|
|
47
|
+
le(
|
|
48
|
+
V,
|
|
49
|
+
_,
|
|
50
|
+
(d == null ? void 0 : d.getOssAccess) ?? ((D = z.value) == null ? void 0 : D.getOssAccess)
|
|
51
|
+
);
|
|
52
|
+
const { b: U, e: t } = ie("ap-upload-single"), x = O("uiMode");
|
|
53
|
+
function K(i) {
|
|
54
|
+
return se(i, [
|
|
55
|
+
"dirName",
|
|
56
|
+
"needName",
|
|
57
|
+
"getOssAccess",
|
|
58
|
+
"fileList",
|
|
59
|
+
"title",
|
|
60
|
+
"subTitle"
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
return (i, a) => (c(), k(e(Z), W({
|
|
64
|
+
maxCount: 1,
|
|
65
|
+
showUploadList: !1,
|
|
66
|
+
disabled: !!o.value && [void 0, "uploading", "error", "success", "done"].includes(o.value.status)
|
|
67
|
+
}, {
|
|
68
|
+
...i.$attrs,
|
|
69
|
+
...K(d)
|
|
70
|
+
}, {
|
|
71
|
+
"file-list": m.value,
|
|
72
|
+
"onUpdate:fileList": a[3] || (a[3] = (v) => m.value = v),
|
|
73
|
+
class: [e(U)(), `${e(U)()}-affix-wrapper-status-${E.value}`],
|
|
74
|
+
beforeUpload: e(G),
|
|
75
|
+
customRequest: e(J)
|
|
76
|
+
}), {
|
|
77
|
+
default: u(() => [
|
|
78
|
+
X(i.$slots, "default", {}, () => {
|
|
79
|
+
var v, F, w, A;
|
|
80
|
+
return [
|
|
81
|
+
s("div", {
|
|
82
|
+
class: l([e(t)("content")])
|
|
83
|
+
}, [
|
|
84
|
+
(v = o.value) != null && v.status && ["uploading"].includes(o.value.status) ? (c(), g("div", {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: l([e(t)("content-file"), e(t)("content-ing")])
|
|
87
|
+
}, [
|
|
88
|
+
s("div", {
|
|
89
|
+
class: l([e(t)("content-file-icon")])
|
|
90
|
+
}, [
|
|
91
|
+
n(C)
|
|
92
|
+
], 2),
|
|
93
|
+
s("div", {
|
|
94
|
+
class: l([e(t)("content-file-name"), e(t)("content-ing-name")])
|
|
95
|
+
}, [
|
|
96
|
+
n(e(N), {
|
|
97
|
+
ellipsis: { rows: 2 },
|
|
98
|
+
tooltip: o.value.error
|
|
99
|
+
}, {
|
|
100
|
+
default: u(() => [
|
|
101
|
+
p(f(o.value.name), 1)
|
|
102
|
+
]),
|
|
103
|
+
_: 1
|
|
104
|
+
}, 8, ["tooltip"]),
|
|
105
|
+
n(e(ee), {
|
|
106
|
+
percent: o.value.percent || 0,
|
|
107
|
+
size: 4,
|
|
108
|
+
showInfo: !1,
|
|
109
|
+
trailColor: e(x) === "admin" ? "#D9D9D9" : "#DEE4ED",
|
|
110
|
+
strokeColor: e(x) === "admin" ? "#34B77C" : "#0070FF"
|
|
111
|
+
}, null, 8, ["percent", "trailColor", "strokeColor"])
|
|
112
|
+
], 2),
|
|
113
|
+
s("div", {
|
|
114
|
+
class: l([e(t)("content-file-delete")]),
|
|
115
|
+
onClick: a[0] || (a[0] = (r) => e(I)(m.value))
|
|
116
|
+
}, [
|
|
117
|
+
n(L)
|
|
118
|
+
], 2)
|
|
119
|
+
], 2)) : (F = o.value) != null && F.status && ["error"].includes(o.value.status) ? (c(), g("div", {
|
|
120
|
+
key: 1,
|
|
121
|
+
class: l([e(t)("content-file"), e(t)("content-error")])
|
|
122
|
+
}, [
|
|
123
|
+
s("div", {
|
|
124
|
+
class: l([e(t)("content-file-icon")])
|
|
125
|
+
}, [
|
|
126
|
+
n(C)
|
|
127
|
+
], 2),
|
|
128
|
+
s("div", {
|
|
129
|
+
class: l([e(t)("content-file-name"), e(t)("content-error-name")])
|
|
130
|
+
}, [
|
|
131
|
+
n(e(B), null, {
|
|
132
|
+
title: u(() => {
|
|
133
|
+
var r;
|
|
134
|
+
return [
|
|
135
|
+
p(f(((r = o.value) == null ? void 0 : r.error) || "--"), 1)
|
|
136
|
+
];
|
|
137
|
+
}),
|
|
138
|
+
default: u(() => [
|
|
139
|
+
n(e(N), {
|
|
140
|
+
ellipsis: { rows: 2 },
|
|
141
|
+
tooltip: o.value.error
|
|
142
|
+
}, {
|
|
143
|
+
default: u(() => [
|
|
144
|
+
p(f(o.value.name), 1)
|
|
145
|
+
]),
|
|
146
|
+
_: 1
|
|
147
|
+
}, 8, ["tooltip"])
|
|
148
|
+
]),
|
|
149
|
+
_: 1
|
|
150
|
+
})
|
|
151
|
+
], 2),
|
|
152
|
+
s("div", {
|
|
153
|
+
class: l([e(t)("content-file-delete")]),
|
|
154
|
+
onClick: a[1] || (a[1] = (r) => e(I)(m.value))
|
|
155
|
+
}, [
|
|
156
|
+
n(L)
|
|
157
|
+
], 2)
|
|
158
|
+
], 2)) : o.value && ((w = o.value) == null ? void 0 : w.status) === void 0 || (A = o.value) != null && A.status && ["success", "done"].includes(o.value.status) ? (c(), g("div", {
|
|
159
|
+
key: 2,
|
|
160
|
+
class: l([e(t)("content-file"), e(t)("content-done")])
|
|
161
|
+
}, [
|
|
162
|
+
s("div", {
|
|
163
|
+
class: l([e(t)("content-file-icon")])
|
|
164
|
+
}, [
|
|
165
|
+
n(C)
|
|
166
|
+
], 2),
|
|
167
|
+
s("div", {
|
|
168
|
+
class: l([e(t)("content-file-name"), e(t)("content-done-name")])
|
|
169
|
+
}, [
|
|
170
|
+
n(e(B), null, {
|
|
171
|
+
title: u(() => {
|
|
172
|
+
var r;
|
|
173
|
+
return [
|
|
174
|
+
p(f(((r = o.value) == null ? void 0 : r.name) || "--"), 1)
|
|
175
|
+
];
|
|
176
|
+
}),
|
|
177
|
+
default: u(() => [
|
|
178
|
+
n(e(N), {
|
|
179
|
+
ellipsis: { rows: 2 },
|
|
180
|
+
tooltip: o.value.error
|
|
181
|
+
}, {
|
|
182
|
+
default: u(() => [
|
|
183
|
+
p(f(o.value.name), 1)
|
|
184
|
+
]),
|
|
185
|
+
_: 1
|
|
186
|
+
}, 8, ["tooltip"])
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
})
|
|
190
|
+
], 2),
|
|
191
|
+
s("div", {
|
|
192
|
+
class: l([e(t)("content-file-delete")]),
|
|
193
|
+
onClick: a[2] || (a[2] = (r) => e(I)(m.value))
|
|
194
|
+
}, [
|
|
195
|
+
n(L)
|
|
196
|
+
], 2)
|
|
197
|
+
], 2)) : (c(), g("div", {
|
|
198
|
+
key: 3,
|
|
199
|
+
class: l([e(t)("content-empty")])
|
|
200
|
+
}, [
|
|
201
|
+
s("div", {
|
|
202
|
+
class: l([e(t)("content-empty-icon")])
|
|
203
|
+
}, [
|
|
204
|
+
n(C)
|
|
205
|
+
], 2),
|
|
206
|
+
s("div", {
|
|
207
|
+
class: l([e(t)("content-empty-title")])
|
|
208
|
+
}, [
|
|
209
|
+
(c(), k(S($(q, [e(M)]))))
|
|
210
|
+
], 2),
|
|
211
|
+
s("div", {
|
|
212
|
+
class: l([e(t)("content-empty-sub-title")])
|
|
213
|
+
}, [
|
|
214
|
+
(c(), k(S($(q, [e(h)]))))
|
|
215
|
+
], 2)
|
|
216
|
+
], 2))
|
|
217
|
+
], 2)
|
|
218
|
+
];
|
|
219
|
+
})
|
|
220
|
+
]),
|
|
221
|
+
_: 3
|
|
222
|
+
}, 16, ["disabled", "file-list", "class", "beforeUpload", "customRequest"]));
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
export {
|
|
226
|
+
ke as default
|
|
227
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/dist/ap-upload-single/index.css';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-upload-single/index.less';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { injectUtilUpload as e } from "../utils/upload.mjs";
|
|
2
|
+
import { injectUtilAccept as c } from "../utils/accept.mjs";
|
|
3
|
+
import { injectHookOss as n } from "./useOss.mjs";
|
|
4
|
+
function f(o, t, i) {
|
|
5
|
+
e(o), c(o), n(o, t, i);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
f as useInjectContext
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { accessCreate, Oss } from '@aplus-frontend/oss';
|
|
2
|
+
import { Translator } from '../../../config-provider';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
import { ApUploadGetOssAccess } from '../interface';
|
|
5
|
+
export type { Oss } from '@aplus-frontend/oss';
|
|
6
|
+
export type GetOssAccess = () => Promise<accessCreate>;
|
|
7
|
+
export declare function injectHookOss(tValue: Translator, langValue: Ref<string>, getOssAccessValue?: ApUploadGetOssAccess): void;
|
|
8
|
+
export declare function getOssInstance(): Promise< Oss>;
|