@aplus-frontend/ui 0.2.11 → 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.
Files changed (85) hide show
  1. package/es/index.mjs +41 -39
  2. package/es/src/ap-list/index.vue.d.ts +1 -0
  3. package/es/src/ap-list/index.vue.mjs +85 -79
  4. package/es/src/ap-list/interface.d.ts +7 -0
  5. package/es/src/ap-table/hooks/use-table-column-state.mjs +84 -75
  6. package/es/src/business/ap-image/ApImage.vue2.mjs +16 -14
  7. package/es/src/business/ap-summary/ap-summary.vue2.mjs +30 -30
  8. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  9. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +227 -0
  10. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.mjs +4 -0
  11. package/es/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  12. package/es/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  13. package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  14. package/es/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  15. package/es/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  16. package/es/src/business/ap-upload-file/hook/useInjectContext.mjs +9 -0
  17. package/es/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  18. package/es/src/business/ap-upload-file/hook/useOss.mjs +30 -0
  19. package/es/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  20. package/es/src/business/ap-upload-file/hook/useProps.mjs +28 -0
  21. package/es/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  22. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +27 -0
  23. package/es/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  24. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +18 -0
  25. package/es/src/business/ap-upload-file/index.d.ts +3 -0
  26. package/es/src/business/ap-upload-file/index.mjs +2 -0
  27. package/es/src/business/ap-upload-file/interface.d.ts +29 -0
  28. package/es/src/business/ap-upload-file/interface.mjs +1 -0
  29. package/es/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  30. package/es/src/business/ap-upload-file/utils/accept.mjs +55 -0
  31. package/es/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  32. package/es/src/business/ap-upload-file/utils/fileList.mjs +16 -0
  33. package/es/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  34. package/es/src/business/ap-upload-file/utils/upload.mjs +62 -0
  35. package/es/src/business/index.d.ts +1 -0
  36. package/es/src/business/index.mjs +43 -42
  37. package/es/src/config-provider/config-provider.d.ts +8 -0
  38. package/es/src/config-provider/css-var.d.ts +8 -0
  39. package/es/src/config-provider/css-var.mjs +25 -9
  40. package/es/src/config-provider/index.d.ts +48 -0
  41. package/es/src/index.mjs +33 -31
  42. package/es/src/path-map.mjs +2 -1
  43. package/lib/index.js +1 -1
  44. package/lib/src/ap-list/index.vue.d.ts +1 -0
  45. package/lib/src/ap-list/index.vue.js +1 -1
  46. package/lib/src/ap-list/interface.d.ts +7 -0
  47. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  48. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  49. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  50. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  51. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -0
  52. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.js +1 -0
  53. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  54. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  55. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  56. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  57. package/lib/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  58. package/lib/src/business/ap-upload-file/hook/useInjectContext.js +1 -0
  59. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  60. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -0
  61. package/lib/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  62. package/lib/src/business/ap-upload-file/hook/useProps.js +1 -0
  63. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  64. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -0
  65. package/lib/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  66. package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -0
  67. package/lib/src/business/ap-upload-file/index.d.ts +3 -0
  68. package/lib/src/business/ap-upload-file/index.js +1 -0
  69. package/lib/src/business/ap-upload-file/interface.d.ts +29 -0
  70. package/lib/src/business/ap-upload-file/interface.js +1 -0
  71. package/lib/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  72. package/lib/src/business/ap-upload-file/utils/accept.js +1 -0
  73. package/lib/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  74. package/lib/src/business/ap-upload-file/utils/fileList.js +1 -0
  75. package/lib/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  76. package/lib/src/business/ap-upload-file/utils/upload.js +1 -0
  77. package/lib/src/business/index.d.ts +1 -0
  78. package/lib/src/business/index.js +1 -1
  79. package/lib/src/config-provider/config-provider.d.ts +8 -0
  80. package/lib/src/config-provider/css-var.d.ts +8 -0
  81. package/lib/src/config-provider/css-var.js +1 -1
  82. package/lib/src/config-provider/index.d.ts +48 -0
  83. package/lib/src/index.js +1 -1
  84. package/lib/src/path-map.js +1 -1
  85. package/package.json +2 -2
@@ -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
- if (!((a = e.src) != null && a.startsWith("Frontend-Upload"))) {
37
- t.value = e.src;
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
- }
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 I, computed as v, openBlock as m, createBlock as l, unref as r, normalizeClass as y, withCtx as f, createElementBlock as L, Fragment as w, renderList as z, normalizeStyle as B, resolveDynamicComponent as N } from "vue";
2
- import { isNil as R, get as c } from "lodash-unified";
3
- import { TableSummaryRow as A, TableSummaryCell as D } from "@aplus-frontend/antdv";
4
- import { flattenColumns as F, formatDataIndex as u } from "./utils.mjs";
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 V } from "@aplus-frontend/utils";
7
- import { useNamespace as $ } from "../../config-provider/hooks/use-namespace.mjs";
8
- const O = /* @__PURE__ */ I({
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(x) {
26
- const n = x, k = (a) => a === 0, h = (a, o) => {
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 (R(e == null ? void 0 : e.thousands) ? !0 : e == null ? void 0 : e.thousands) ? P(a, t) : V(a, t);
32
- }, T = v(() => {
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 = F(n.columns).map((t, d) => {
40
+ const e = V(n.columns).map((t, d) => {
41
41
  let s;
42
- const g = c(n.data, u(t.dataIndex || t.key));
43
- if (k(d))
42
+ const b = c(n.data, u(t.dataIndex || t.key));
43
+ if (h(d))
44
44
  s = n.summaryTitle;
45
- else if (g && (t.customRender || t.renderText)) {
46
- const p = c(n.data, u(t.dataIndex || t.key)), b = u(t.dataIndex || t.key), i = t.customRender || t.renderText;
47
- s = i == null ? void 0 : i({
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
- [b]: p
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 = h(c(n.data, u(t.dataIndex || t.key)), t);
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: C,
69
- e: S,
70
- em: _
71
- } = $("ap-summary");
72
- return (a, o) => (m(), l(r(A), {
73
- class: y(r(C)())
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: f(() => [(m(!0), L(w, null, z(T.value, (e, t) => (m(), l(r(D), {
76
- class: y(`${n.size === "small" ? r(_)("item", "small") : r(S)("item")}`),
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: f(() => [(m(), l(N(e.value)))]),
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
- O as default
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
+ } & {};
@@ -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
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ap-upload-single.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui-theme/dist/ap-upload-single/index.css';
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui-theme/src/ap-upload-single/index.less';
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ import { ApUploadGetOssAccess } from '../interface';
3
+ import { Translator } from '../../../config-provider';
4
+ export declare function useInjectContext(t: Translator, lang: Ref<string>, getOssAccess?: ApUploadGetOssAccess): void;
@@ -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>;
@@ -0,0 +1,30 @@
1
+ import { createOssInstance as i } from "@aplus-frontend/oss";
2
+ let t, o, e;
3
+ function r(n, s, a) {
4
+ t = n, o = s, a && (e = a);
5
+ }
6
+ const c = {
7
+ "zh-cn": "zh_CN",
8
+ en: "en_US"
9
+ };
10
+ function l() {
11
+ return c[o.value] ?? "zh_CN";
12
+ }
13
+ async function g() {
14
+ if (!e)
15
+ throw new Error(`${t("ap.apUpload.pleasePass")}getOssAccess`);
16
+ const n = i();
17
+ return await n.initOssClient({
18
+ getOssAccess: e,
19
+ locale: l(),
20
+ onFailure: (s) => {
21
+ throw new Error(
22
+ typeof (s == null ? void 0 : s.message) == "string" ? s.message : t("ap.apUpload.FailedToObtainOssTemporaryPermissions")
23
+ );
24
+ }
25
+ }), n;
26
+ }
27
+ export {
28
+ g as getOssInstance,
29
+ r as injectHookOss
30
+ };
@@ -0,0 +1,12 @@
1
+ import { ApUploadCustomRequest, ApUploadFile, ApUploadSingleProps } from '../interface';
2
+ import { ComputedRef, VNodeArrayChildren, VNode, RendererNode, RendererElement } from 'vue';
3
+ export declare function useSingleProps(props: ApUploadSingleProps): {
4
+ title: ComputedRef<string | number | true | VNodeArrayChildren | VNode<RendererNode, RendererElement, {
5
+ [key: string]: any;
6
+ }>>;
7
+ subTitle: ComputedRef<string | number | true | VNodeArrayChildren | VNode<RendererNode, RendererElement, {
8
+ [key: string]: any;
9
+ }>>;
10
+ beforeUpload: (file: ApUploadFile, fileList: ApUploadFile[]) => boolean | Promise<boolean>;
11
+ customRequest: ApUploadCustomRequest;
12
+ };
@@ -0,0 +1,28 @@
1
+ import { computed as l } from "vue";
2
+ import { getAcceptText as d } from "../utils/accept.mjs";
3
+ import "../../../config-provider/index.mjs";
4
+ import { uploadBeforeUpload as f, uploadCustomRequest as U } from "../utils/upload.mjs";
5
+ import { useLocale as o } from "../../../config-provider/hooks/use-locale.mjs";
6
+ function z(e) {
7
+ const { t: c } = o(), m = l(
8
+ () => e.title || c("ap.apUpload.clickOrDragUpload")
9
+ ), i = l(
10
+ () => e.subTitle || `${c("ap.apUpload.supportExtension")}:${d(e.accept)},${c(
11
+ "ap.apUpload.maxWarnUploadFileSize",
12
+ {
13
+ maxSize: e.maxSize
14
+ }
15
+ )}`
16
+ );
17
+ function n(t, a) {
18
+ var u;
19
+ return e != null && e.beforeUpload ? (u = e == null ? void 0 : e.beforeUpload) == null ? void 0 : u.call(e, t, a) : f(t, a, e);
20
+ }
21
+ return { title: m, subTitle: i, beforeUpload: n, customRequest: (t) => {
22
+ var a, u;
23
+ e != null && e.customRequest ? (a = e == null ? void 0 : e.customRequest) == null || a.call(e, t) : (u = U) == null || u(t, e);
24
+ } };
25
+ }
26
+ export {
27
+ z as useSingleProps
28
+ };
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
3
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { createElementVNode as e, openBlock as o, createElementBlock as t } from "vue";
2
+ import n from "../../../../_virtual/_plugin-vue_export-helper.mjs";
3
+ const l = {}, r = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
6
+ fill: "none",
7
+ version: "1.1",
8
+ viewBox: "0 0 20 20"
9
+ }, L = /* @__PURE__ */ e("g", null, [
10
+ /* @__PURE__ */ e("g", null, [
11
+ /* @__PURE__ */ e("path", {
12
+ d: "M14.2913,4.375L16.875,4.375C17.2202,4.375,17.5,4.65482,17.5,5C17.5,5.34518,17.2202,5.625,16.875,5.625L15.9375,5.625L15.9375,15.625Q15.9375,16.401699999999998,15.3883,16.9508Q14.8392,17.5,14.0625,17.5L5.9375,17.5Q5.16085,17.5,4.61167,16.9508Q4.0625,16.401699999999998,4.0625,15.625L4.0625,5.625L3.125,5.625C2.7798220000000002,5.625,2.5,5.34518,2.5,5C2.5,4.65482,2.7798220000000002,4.375,3.125,4.375L5.70873,4.375C5.71225,4.3689,5.71588,4.3628599999999995,5.719609999999999,4.35687L6.71624,2.75811Q7.26675,1.875,8.307400000000001,1.875L11.6926,1.875Q12.7332,1.875,13.2838,2.75811L14.2802,4.3565000000000005C14.284,4.36261,14.2877,4.36878,14.2913,4.375ZM12.8187,4.375L12.22299,3.41937Q12.03948,3.125,11.6926,3.125L8.307400000000001,3.125Q7.96052,3.125,7.77702,3.41937L7.1813,4.375L12.8187,4.375ZM5.3125,5.625L14.6875,5.625L14.6875,15.625Q14.6875,15.8839,14.5044,16.0669Q14.3214,16.25,14.0625,16.25L5.9375,16.25Q5.6786200000000004,16.25,5.495559999999999,16.0669Q5.3125,15.8839,5.3125,15.625L5.3125,5.625ZM9.375,8.75C9.375,8.40482,9.65482,8.125,10,8.125C10.34518,8.125,10.625,8.40482,10.625,8.75L10.625,13.125C10.625,13.4702,10.34518,13.75,10,13.75C9.65482,13.75,9.375,13.4702,9.375,13.125L9.375,8.75Z",
13
+ "fill-rule": "evenodd",
14
+ fill: "currentColor",
15
+ "fill-opacity": "1"
16
+ })
17
+ ])
18
+ ], -1), c = [
19
+ L
20
+ ];
21
+ function s(i, _) {
22
+ return o(), t("svg", r, c);
23
+ }
24
+ const f = /* @__PURE__ */ n(l, [["render", s]]);
25
+ export {
26
+ f as default
27
+ };
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
3
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { createStaticVNode as t, openBlock as o, createElementBlock as i } from "vue";
2
+ import e from "../../../../_virtual/_plugin-vue_export-helper.mjs";
3
+ const s = {}, l = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
6
+ fill: "none",
7
+ version: "1.1",
8
+ viewBox: "0 0 56 56"
9
+ }, r = /* @__PURE__ */ t('<defs><clipPath id="master_svg0_693_19001"><rect x="0" y="0" width="56" height="56" rx="7"></rect></clipPath><linearGradient x1="0.5" y1="0" x2="0.5" y2="0.7987817525863647" id="master_svg1_693_19025"><stop offset="0%" stop-color="#AED1FF" stop-opacity="1"></stop><stop offset="100%" stop-color="#74B1FF" stop-opacity="1"></stop></linearGradient><linearGradient x1="0.5" y1="0" x2="0.5" y2="1" id="master_svg2_693_19014"><stop offset="0.7142857182770967%" stop-color="#DBEBFF" stop-opacity="1"></stop><stop offset="100%" stop-color="#98C5FF" stop-opacity="1"></stop></linearGradient></defs><g clip-path="url(#master_svg0_693_19001)"><g><g><path d="M49.4644,10.22729L35.1706,10.22729C34.2282,10.22729,33.316,9.89456,32.595,9.287759999999999L29.1746,6.4093C28.0931,5.499102,26.7249,5,25.3113,5L5.5,5C3.29086,5,1.5,6.79086,1.5,9L1.5,45L54.4995,45L54.5,15.2852C54.5,12.49165,52.2455,10.22729,49.4644,10.22729Z" fill="url(#master_svg1_693_19025)" fill-opacity="1"></path></g><g><path d="M10.5,13L45.5,13C46.6046,13,47.5,13.895431,47.5,15L47.5,35.9999L8.5,36L8.5,15C8.5,13.895431,9.395431,13,10.5,13" fill="#FFFFFF" fill-opacity="0.30000001192092896"></path></g><g><path d="M8.5,17L47.5,17C48.6046,17,49.5,17.895431,49.5,19L49.5,41.9998L6.5,42L6.5,19C6.5,17.895431,7.395431,17,8.5,17" fill="#F9FCFF" fill-opacity="1"></path></g><g><rect x="14.5" y="21" width="15" height="2" rx="1" fill="#8DBFFF" fill-opacity="0.30000001192092896"></rect></g><g><rect x="14.5" y="27" width="28" height="2" rx="1" fill="#8DBFFF" fill-opacity="0.6000000238418579"></rect></g><g><path d="M1.5,37L1.5,48C1.5,50.2091,3.29086,52,5.5,52L50.5,52C52.7091,52,54.5,50.2091,54.5,48L54.5,37C54.5,35.34315,53.1569,34,51.5,34L4.5,34C2.84315,34,1.5,35.34315,1.5,37Z" fill="url(#master_svg2_693_19014)" fill-opacity="1"></path></g></g></g>', 2), p = [
10
+ r
11
+ ];
12
+ function a(c, _) {
13
+ return o(), i("svg", l, p);
14
+ }
15
+ const n = /* @__PURE__ */ e(s, [["render", a]]);
16
+ export {
17
+ n as default
18
+ };
@@ -0,0 +1,3 @@
1
+ import { default as ApUploadSingle } from './ap-upload-single/ap-upload-single.vue';
2
+ export * from './interface';
3
+ export { ApUploadSingle };
@@ -0,0 +1,2 @@
1
+ import "./interface.mjs";
2
+ import "./ap-upload-single/ap-upload-single.vue2.mjs";
@@ -0,0 +1,29 @@
1
+ import { accessCreate } from '@aplus-frontend/oss';
2
+ import { VNodeChild } from 'vue';
3
+ import { UploadFile, UploadChangeParam, UploadProps } from '@aplus-frontend/antdv';
4
+ export type ApUploadGetOssAccess = () => Promise<accessCreate>;
5
+ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
6
+ export type ApUploadFile<T = any> = UploadFile<T> & {
7
+ ossDestroy?: () => any;
8
+ [key: string | number | symbol]: any;
9
+ };
10
+ export type ApUploadCustomRequest = (option: Omit<Parameters<Exclude<UploadProps['customRequest'], undefined>>[0], 'file'> & {
11
+ file?: ApUploadFile;
12
+ }, props?: {
13
+ dirName?: string;
14
+ }) => void;
15
+ export type ApUploadBaseProps<T = any> = {
16
+ dirName: string;
17
+ getOssAccess?: ApUploadGetOssAccess;
18
+ fileList?: ApUploadFile<T>[];
19
+ onChange?: (info?: UploadChangeParam<ApUploadFile<T>>) => void;
20
+ maxSize?: number;
21
+ accept?: string;
22
+ beforeUpload?: (file: ApUploadFile<T>, fileList: ApUploadFile<T>[]) => boolean | Promise<boolean>;
23
+ customRequest?: ApUploadCustomRequest;
24
+ };
25
+ export type ApUploadSingleProps<T = any> = ApUploadBaseProps<T> & {
26
+ title?: VNodeChild;
27
+ subTitle?: VNodeChild;
28
+ };
29
+ export {};