@aplus-frontend/ui 0.4.14 → 0.4.16

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 (55) hide show
  1. package/es/src/ap-table/ap-table.vue2.mjs +203 -179
  2. package/es/src/ap-table/hooks/use-sticky-scroll.d.ts +6 -0
  3. package/es/src/ap-table/hooks/use-sticky-scroll.mjs +16 -0
  4. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +1 -1
  5. package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
  6. package/es/src/ap-upload/apUpload.vue.mjs +22 -18
  7. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +66 -66
  8. package/es/src/ap-upload/components/Picture.vue2.mjs +82 -82
  9. package/es/src/ap-upload/components/SingleFile.vue2.mjs +114 -114
  10. package/es/src/config-provider/config-provider.d.ts +3 -0
  11. package/es/src/config-provider/css-var.d.ts +4 -0
  12. package/es/src/config-provider/css-var.mjs +22 -14
  13. package/es/src/config-provider/index.d.ts +15 -0
  14. package/es/src/scroll-bar/index.vue.d.ts +2 -0
  15. package/es/src/scroll-bar/index.vue.mjs +40 -35
  16. package/es/src/scroll-bar/interface.d.ts +4 -1
  17. package/es/src/theme/antd-global-overwrite/admin/index.css +24 -2
  18. package/es/src/theme/antd-global-overwrite/admin/table.css +24 -2
  19. package/es/src/theme/antd-global-overwrite/aplus/index.css +24 -2
  20. package/es/src/theme/antd-global-overwrite/aplus/table.css +24 -2
  21. package/es/src/utils/index.d.ts +1 -0
  22. package/es/src/utils/index.mjs +40 -30
  23. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  24. package/lib/src/ap-table/hooks/use-sticky-scroll.d.ts +6 -0
  25. package/lib/src/ap-table/hooks/use-sticky-scroll.js +1 -0
  26. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  27. package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
  28. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  29. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  30. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  31. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  32. package/lib/src/config-provider/config-provider.d.ts +3 -0
  33. package/lib/src/config-provider/css-var.d.ts +4 -0
  34. package/lib/src/config-provider/css-var.js +1 -1
  35. package/lib/src/config-provider/index.d.ts +15 -0
  36. package/lib/src/scroll-bar/index.vue.d.ts +2 -0
  37. package/lib/src/scroll-bar/index.vue.js +1 -1
  38. package/lib/src/scroll-bar/interface.d.ts +4 -1
  39. package/lib/src/theme/antd-global-overwrite/admin/index.css +24 -2
  40. package/lib/src/theme/antd-global-overwrite/admin/table.css +24 -2
  41. package/lib/src/theme/antd-global-overwrite/aplus/index.css +24 -2
  42. package/lib/src/theme/antd-global-overwrite/aplus/table.css +24 -2
  43. package/lib/src/utils/index.d.ts +1 -0
  44. package/lib/src/utils/index.js +1 -1
  45. package/package.json +3 -3
  46. package/theme/antd-global-overwrite/admin/index.css +24 -2
  47. package/theme/antd-global-overwrite/admin/table.css +24 -2
  48. package/theme/antd-global-overwrite/admin/table.less +8 -2
  49. package/theme/antd-global-overwrite/aplus/index.css +24 -2
  50. package/theme/antd-global-overwrite/aplus/table.css +24 -2
  51. package/theme/antd-global-overwrite/aplus/table.less +7 -2
  52. package/theme/ap-table/ap-table.css +9 -0
  53. package/theme/ap-table/ap-table.less +20 -8
  54. package/theme/ap-table-modal/index.css +9 -0
  55. package/theme/index.css +9 -0
@@ -1,4 +1,4 @@
1
- import { defineComponent as A, ref as g, computed as v, provide as t, openBlock as y, createElementBlock as U, normalizeClass as $, unref as k, createBlock as T, resolveDynamicComponent as B, mergeProps as L, createSlots as R, renderList as q, withCtx as P, renderSlot as V, normalizeProps as w, guardReactiveProps as D } from "vue";
1
+ import { defineComponent as A, ref as g, computed as v, provide as t, openBlock as y, createElementBlock as R, normalizeClass as U, unref as $, createBlock as k, resolveDynamicComponent as T, mergeProps as B, createSlots as L, renderList as q, withCtx as P, renderSlot as V, normalizeProps as w, guardReactiveProps as D } from "vue";
2
2
  import "../config-provider/index.mjs";
3
3
  import "./components/SingleFile.vue.mjs";
4
4
  import "./components/MultipleFile.vue.mjs";
@@ -12,7 +12,7 @@ import Q from "./components/SingleFile.vue2.mjs";
12
12
  import W from "./components/MultipleFile.vue2.mjs";
13
13
  import X from "./components/Picture.vue2.mjs";
14
14
  import { useGlobalConfig as C } from "../config-provider/hooks/use-global-config.mjs";
15
- const me = /* @__PURE__ */ A({
15
+ const pe = /* @__PURE__ */ A({
16
16
  name: "AplusFileUpload",
17
17
  __name: "apUpload",
18
18
  props: {
@@ -79,35 +79,39 @@ const me = /* @__PURE__ */ A({
79
79
  acceptErrorMsg: {
80
80
  type: String,
81
81
  default: void 0
82
+ },
83
+ onRemove: {
84
+ type: Function,
85
+ default: void 0
82
86
  }
83
87
  },
84
88
  emits: ["update:value"],
85
89
  setup(S, { expose: b, emit: x }) {
86
- var p, m, d, f;
87
- const { t: l, lang: M } = J();
88
- G(l), I(l, M);
89
- const { b: N } = K("ap-upload"), n = g(null), e = S, _ = x, E = {
90
+ var m, p, d, f;
91
+ const { t: u, lang: F } = J();
92
+ G(u), I(u, F);
93
+ const { b: M } = K("ap-upload"), n = g(null), e = S, N = x, _ = {
90
94
  singleFile: Q,
91
95
  multipleFile: W,
92
96
  picture: X
93
- }, s = H.useInjectFormItemContext(), F = v({
97
+ }, s = H.useInjectFormItemContext(), E = v({
94
98
  get() {
95
99
  return e.value;
96
100
  },
97
101
  set(o) {
98
102
  var a;
99
- _("update:value", o), s == null || s.onFieldChange(), (a = e.onChange) == null || a.call(e, o);
103
+ N("update:value", o), s == null || s.onFieldChange(), (a = e.onChange) == null || a.call(e, o);
100
104
  }
101
105
  }), O = C("uiMode"), i = C("apUpload");
102
- t("theme", O.value), t("value", F), t("dirName", e.dirName ?? ((p = i.value) == null ? void 0 : p.dirName)), t(
106
+ t("theme", O.value), t("value", E), t("dirName", e.dirName ?? ((m = i.value) == null ? void 0 : m.dirName)), t(
103
107
  "needName",
104
- e.needName ?? ((m = i.value) == null ? void 0 : m.needName) ?? !1
108
+ e.needName ?? ((p = i.value) == null ? void 0 : p.needName) ?? !1
105
109
  ), t("accept", e.accept ?? ((d = i.value) == null ? void 0 : d.accept) ?? ""), t("maxSize", e.maxSize), t("title", e.title), t("subTitle", e.subTitle), t("maxCount", e.maxCount), t("beforeUpload", e.beforeUpload), t("customRequest", e.customRequest), t(
106
110
  "getOssAccess",
107
111
  e.getOssAccess ?? ((f = i.value) == null ? void 0 : f.getOssAccess)
108
- ), t("maxSizeErrorMsg", e.maxSizeErrorMsg), t("maxCountErrorMsg", e.maxCountErrorMsg), t("acceptErrorMsg", e.acceptErrorMsg);
109
- const z = v(() => u.value === 0), u = g(0);
110
- t("uploadingCount", u);
112
+ ), t("maxSizeErrorMsg", e.maxSizeErrorMsg), t("maxCountErrorMsg", e.maxCountErrorMsg), t("acceptErrorMsg", e.acceptErrorMsg), t("onRemove", e.onRemove);
113
+ const z = v(() => l.value === 0), l = g(0);
114
+ t("uploadingCount", l);
111
115
  function h() {
112
116
  c(void 0);
113
117
  }
@@ -119,13 +123,13 @@ const me = /* @__PURE__ */ A({
119
123
  done: z,
120
124
  clear: h,
121
125
  setValue: c
122
- }), (o, a) => (y(), U("div", {
123
- class: $(k(N)())
126
+ }), (o, a) => (y(), R("div", {
127
+ class: U($(M)())
124
128
  }, [
125
- (y(), T(B(E[e.type]), L(o.$attrs, {
129
+ (y(), k(T(_[e.type]), B(o.$attrs, {
126
130
  ref_key: "uploadRef",
127
131
  ref: n
128
- }), R({ _: 2 }, [
132
+ }), L({ _: 2 }, [
129
133
  q(Object.keys(o.$slots), (r) => ({
130
134
  name: r,
131
135
  fn: P((j) => [
@@ -137,5 +141,5 @@ const me = /* @__PURE__ */ A({
137
141
  }
138
142
  });
139
143
  export {
140
- me as default
144
+ pe as default
141
145
  };
@@ -1,37 +1,37 @@
1
- import { defineComponent as W, inject as s, ref as G, watch as H, nextTick as J, openBlock as x, createElementBlock as k, normalizeClass as K, unref as n, createVNode as C, withCtx as T, createElementVNode as b, createTextVNode as Q, toDisplayString as S, withModifiers as X, createBlock as Y, resolveDynamicComponent as Z, createCommentVNode as ee } from "vue";
1
+ import { defineComponent as G, inject as s, ref as H, watch as J, nextTick as K, openBlock as h, createElementBlock as C, normalizeClass as Q, unref as n, createVNode as U, withCtx as b, createElementVNode as S, createTextVNode as X, toDisplayString as L, withModifiers as Y, createBlock as Z, resolveDynamicComponent as ee, createCommentVNode as te } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as te, getName as oe, getReturnData as L } from "../utils/returnData.mjs";
4
- import { useOss as ae, getOssInstance as se } from "../hooks/useOss.mjs";
5
- import { message as m, Upload as ne, Button as re } from "@aplus-frontend/antdv";
6
- import { UploadOutlined as ie } from "@ant-design/icons-vue";
7
- import { fileMatchesAccept as le, getAcceptText as ue } from "../utils/accept.mjs";
8
- import { useLocale as ce } from "../../config-provider/hooks/use-locale.mjs";
9
- import { useNamespace as pe } from "../../config-provider/hooks/use-namespace.mjs";
10
- const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 }, _e = /* @__PURE__ */ W({
3
+ import { getPath as oe, getName as se, getReturnData as M } from "../utils/returnData.mjs";
4
+ import { useOss as ae, getOssInstance as ne } from "../hooks/useOss.mjs";
5
+ import { message as m, Upload as re, Button as ie } from "@aplus-frontend/antdv";
6
+ import { UploadOutlined as le } from "@ant-design/icons-vue";
7
+ import { fileMatchesAccept as ue, getAcceptText as ce } from "../utils/accept.mjs";
8
+ import { useLocale as pe } from "../../config-provider/hooks/use-locale.mjs";
9
+ import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
10
+ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 }, Ae = /* @__PURE__ */ G({
11
11
  __name: "MultipleFile",
12
- setup(ge, { expose: M }) {
13
- const { t: r } = ce(), { b: U } = pe("ap-upload-multiple-file"), { put: z } = ae(), R = s("theme"), B = s("dirName"), h = s("accept") || "*", E = s("maxSize") ?? 500, I = s("title") || r("ap.apUpload.uploadFile"), f = s("subTitle"), i = s("maxCount") ?? 10, d = s("uploadingCount"), _ = s("beforeUpload"), A = s("customRequest"), P = s("getOssAccess"), O = s("maxSizeErrorMsg"), q = s("maxCountErrorMsg"), D = s("acceptErrorMsg"), a = s("value"), c = [], g = s("needName"), l = G(null);
14
- H(
12
+ setup(ve, { expose: z }) {
13
+ const { t: r } = pe(), { b: E } = me("ap-upload-multiple-file"), { put: R } = ae(), B = s("theme"), I = s("dirName"), y = s("accept") || "*", _ = s("maxSize") ?? 500, P = s("title") || r("ap.apUpload.uploadFile"), f = s("subTitle"), i = s("maxCount") ?? 10, d = s("uploadingCount"), A = s("beforeUpload"), F = s("customRequest"), O = s("getOssAccess"), q = s("maxSizeErrorMsg"), D = s("maxCountErrorMsg"), $ = s("acceptErrorMsg"), g = s("onRemove"), a = s("value"), c = [], v = s("needName"), l = H(null);
14
+ J(
15
15
  () => a == null ? void 0 : a.value,
16
16
  function(e) {
17
17
  var t, o;
18
- !((o = (t = l == null ? void 0 : l.value) == null ? void 0 : t.fileList) != null && o.length) && e && F(e);
18
+ !((o = (t = l == null ? void 0 : l.value) == null ? void 0 : t.fileList) != null && o.length) && e && N(e);
19
19
  },
20
20
  { immediate: !0 }
21
21
  );
22
- function F(e) {
22
+ function N(e) {
23
23
  if (!e) {
24
24
  p = [], l.value.fileList = [], a.value = void 0, c.splice(0, c.length);
25
25
  return;
26
26
  }
27
- J(() => {
27
+ K(() => {
28
28
  const t = e.map((o) => {
29
- const u = te(g, o), y = oe(g, o), w = new File(
29
+ const u = oe(v, o), w = se(v, o), k = new File(
30
30
  [o],
31
- y,
31
+ w,
32
32
  {}
33
33
  );
34
- return w.response = u, w.uid = u, w;
34
+ return k.response = u, k.uid = u, k;
35
35
  });
36
36
  if (i && t.length > i) {
37
37
  m.warning(
@@ -49,9 +49,9 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
49
49
  }), l.value.fileList = t, a.value = e;
50
50
  });
51
51
  }
52
- M({ setValue: F });
53
- let p = [], N;
54
- function v(e) {
52
+ z({ setValue: N });
53
+ let p = [], T;
54
+ function x(e) {
55
55
  setTimeout(() => {
56
56
  const t = l.value.fileList.findIndex(
57
57
  (o) => o.uid === e.uid
@@ -59,32 +59,32 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
59
59
  t >= 0 && l.value.fileList.splice(t, 1);
60
60
  });
61
61
  }
62
- async function $(e) {
62
+ async function j(e) {
63
63
  if (i && i > 1 && p.length >= i)
64
- return clearTimeout(N), N = setTimeout(() => {
64
+ return clearTimeout(T), T = setTimeout(() => {
65
65
  m.warning(
66
- q || r("ap.apUpload.maxUploadFiles", {
66
+ D || r("ap.apUpload.maxUploadFiles", {
67
67
  maxCount: i
68
68
  })
69
69
  );
70
- }), v(e), !1;
71
- if (e.size > E * 1024 * 1024)
70
+ }), x(e), !1;
71
+ if (e.size > _ * 1024 * 1024)
72
72
  return m.warning(
73
- O || r("ap.apUpload.maxUploadFileSize", {
74
- maxSize: E
73
+ q || r("ap.apUpload.maxUploadFileSize", {
74
+ maxSize: _
75
75
  })
76
- ), v(e), !1;
77
- if (!le(e, h))
76
+ ), x(e), !1;
77
+ if (!ue(e, y))
78
78
  return m.warning(
79
- D || r("ap.apUpload.fileFormatNotSupported")
80
- ), v(e), !1;
81
- if (typeof _ == "function" && await _(e) === !1)
82
- return v(e), !1;
79
+ $ || r("ap.apUpload.fileFormatNotSupported")
80
+ ), x(e), !1;
81
+ if (typeof A == "function" && await A(e) === !1)
82
+ return x(e), !1;
83
83
  i && i === 1 && (p = [], a.value = void 0), p.push(e);
84
84
  }
85
- async function j(e) {
86
- if (d.value++, typeof A == "function") {
87
- A({
85
+ async function V(e) {
86
+ if (d.value++, typeof F == "function") {
87
+ F({
88
88
  onProgress: (t) => {
89
89
  setTimeout(() => {
90
90
  e.onProgress({
@@ -105,7 +105,7 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
105
105
  e.onSuccess(t);
106
106
  }), a.value = [
107
107
  ...a.value || [],
108
- L(g, t, e.file.name)
108
+ M(v, t, e.file.name)
109
109
  ], c.push({
110
110
  uid: e.file.uid,
111
111
  path: t
@@ -116,15 +116,15 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
116
116
  return;
117
117
  }
118
118
  try {
119
- const t = await se(P);
120
- e.file.oss = t, z({
119
+ const t = await ne(O);
120
+ e.file.oss = t, R({
121
121
  file: e.file,
122
- dirName: B,
122
+ dirName: I,
123
123
  oss: t,
124
124
  successCallBack(o) {
125
125
  e.onSuccess(o), a.value = [
126
126
  ...a.value || [],
127
- L(g, o, e.file.name)
127
+ M(v, o, e.file.name)
128
128
  ], c.push({
129
129
  uid: e.file.uid,
130
130
  path: o
@@ -151,11 +151,11 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
151
151
  }), d.value--;
152
152
  }
153
153
  }
154
- function V(e) {
154
+ function W(e) {
155
155
  var o;
156
- if (e.response) {
156
+ if (g && (g == null || g(e)), e.response) {
157
157
  if (Array.isArray(a.value)) {
158
- const u = c.findIndex((y) => y.uid === e.uid);
158
+ const u = c.findIndex((w) => w.uid === e.uid);
159
159
  u >= 0 && (a == null || a.value.splice(u, 1), c.splice(u, 1)), a.value.length === 0 && (a.value = void 0);
160
160
  }
161
161
  } else
@@ -165,16 +165,16 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
165
165
  );
166
166
  return p.splice(t, 1), Promise.resolve(!0);
167
167
  }
168
- return (e, t) => (x(), k("div", {
169
- class: K({
170
- [n(U)()]: !0,
171
- [n(U)("admin")]: n(R) === "admin"
168
+ return (e, t) => (h(), C("div", {
169
+ class: Q({
170
+ [n(E)()]: !0,
171
+ [n(E)("admin")]: n(B) === "admin"
172
172
  })
173
173
  }, [
174
- C(n(ne), {
174
+ U(n(re), {
175
175
  ref_key: "uploadRef",
176
176
  ref: l,
177
- accept: n(h),
177
+ accept: n(y),
178
178
  multiple: "",
179
179
  "max-count": n(i),
180
180
  progress: {
@@ -182,27 +182,27 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
182
182
  showInfo: !1,
183
183
  strokeColor: "#0070FF"
184
184
  },
185
- "before-upload": $,
186
- "custom-request": j,
187
- onRemove: V
185
+ "before-upload": j,
186
+ "custom-request": V,
187
+ onRemove: W
188
188
  }, {
189
- default: T(() => [
190
- b("div", me, [
191
- C(n(re), { class: "file-btn" }, {
192
- default: T(() => [
193
- C(n(ie)),
194
- Q(" " + S(n(I)), 1)
189
+ default: b(() => [
190
+ S("div", de, [
191
+ U(n(ie), { class: "file-btn" }, {
192
+ default: b(() => [
193
+ U(n(le)),
194
+ X(" " + L(n(P)), 1)
195
195
  ]),
196
196
  _: 1
197
197
  }),
198
- b("div", {
198
+ S("div", {
199
199
  class: "sub-title",
200
- onClick: t[0] || (t[0] = X(() => {
200
+ onClick: t[0] || (t[0] = Y(() => {
201
201
  }, ["stop"]))
202
202
  }, [
203
- typeof n(f) == "string" ? (x(), k("div", de, S(n(f) || `${n(r)("ap.apUpload.supportExtension")}:${n(ue)(n(h))}`), 1)) : n(f) ? (x(), k("div", fe, [
204
- (x(), Y(Z(n(f))))
205
- ])) : ee("", !0)
203
+ typeof n(f) == "string" ? (h(), C("div", fe, L(n(f) || `${n(r)("ap.apUpload.supportExtension")}:${n(ce)(n(y))}`), 1)) : n(f) ? (h(), C("div", ge, [
204
+ (h(), Z(ee(n(f))))
205
+ ])) : te("", !0)
206
206
  ])
207
207
  ])
208
208
  ]),
@@ -212,5 +212,5 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
212
212
  }
213
213
  });
214
214
  export {
215
- _e as default
215
+ Ae as default
216
216
  };
@@ -1,48 +1,48 @@
1
- import { defineComponent as X, inject as u, ref as R, watch as Y, nextTick as Z, openBlock as g, createElementBlock as h, normalizeClass as F, unref as i, createElementVNode as d, renderSlot as ee, Fragment as te, renderList as ne, withDirectives as ae, createVNode as U, createCommentVNode as $, vShow as se, toDisplayString as k } from "vue";
1
+ import { defineComponent as Y, inject as c, ref as $, watch as Z, nextTick as F, openBlock as g, createElementBlock as h, normalizeClass as ee, unref as i, createElementVNode as d, renderSlot as te, Fragment as ne, renderList as ae, withDirectives as se, createVNode as k, createCommentVNode as I, vShow as oe, toDisplayString as C } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as oe, getName as ie, getReturnData as I } from "../utils/returnData.mjs";
4
- import { CloseOutlined as re, PlusOutlined as ce } from "@ant-design/icons-vue";
5
- import { useOss as ue, getOssInstance as M } from "../hooks/useOss.mjs";
6
- import { fileMatchesAccept as le, getAcceptText as pe } from "../utils/accept.mjs";
7
- import { message as m, Progress as de } from "@aplus-frontend/antdv";
8
- import { omit as me } from "lodash-unified";
9
- import { useLocale as fe } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as ge } from "../../config-provider/hooks/use-namespace.mjs";
11
- const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture-item-box" }, ye = ["src"], _e = { class: "picture-item-shadow" }, we = ["onClick"], Ue = {
3
+ import { getPath as ie, getName as re, getReturnData as M } from "../utils/returnData.mjs";
4
+ import { CloseOutlined as ce, PlusOutlined as ue } from "@ant-design/icons-vue";
5
+ import { useOss as le, getOssInstance as T } from "../hooks/useOss.mjs";
6
+ import { fileMatchesAccept as pe, getAcceptText as de } from "../utils/accept.mjs";
7
+ import { message as m, Progress as me } from "@aplus-frontend/antdv";
8
+ import { omit as fe } from "lodash-unified";
9
+ import { useLocale as ge } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const ve = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture-item-box" }, _e = ["src"], we = { class: "picture-item-shadow" }, Ue = ["onClick"], ke = {
12
12
  key: 0,
13
13
  class: "picture-item-uploading"
14
- }, ke = { class: "picture-title" }, Ce = { key: 0 }, Se = { key: 1 }, De = /* @__PURE__ */ X({
14
+ }, Ce = { class: "picture-title" }, Se = { key: 0 }, Ee = { key: 1 }, Oe = /* @__PURE__ */ Y({
15
15
  __name: "Picture",
16
- setup(Ee, { expose: T }) {
17
- const { t: l } = fe(), { b: C } = ge("ap-upload-picture"), { put: D } = ue(), O = u("theme"), B = u("dirName"), _ = u("accept") || "image/*", w = u("maxSize") ?? 5, S = u("title"), p = u("maxCount") ?? 10, v = u("uploadingCount"), E = u("beforeUpload"), b = u("customRequest"), z = u("getOssAccess"), L = u("maxSizeErrorMsg"), q = u("maxCountErrorMsg"), V = u("acceptErrorMsg"), x = R(null), r = u("value"), y = u("needName");
18
- let o = R([]);
16
+ setup(be, { expose: D }) {
17
+ const { t: l } = ge(), { b: S } = he("ap-upload-picture"), { put: O } = le(), B = c("theme"), L = c("dirName"), w = c("accept") || "image/*", U = c("maxSize") ?? 5, E = c("title"), p = c("maxCount") ?? 10, v = c("uploadingCount"), b = c("beforeUpload"), z = c("customRequest"), A = c("getOssAccess"), q = c("maxSizeErrorMsg"), V = c("maxCountErrorMsg"), j = c("acceptErrorMsg"), x = $(null), r = c("value"), y = c("needName"), _ = c("onRemove");
18
+ let o = $([]);
19
19
  const f = [];
20
- Y(
20
+ Z(
21
21
  () => r == null ? void 0 : r.value,
22
22
  async function(e) {
23
23
  var a;
24
- !((a = o == null ? void 0 : o.value) != null && a.length) && e && A(e);
24
+ !((a = o == null ? void 0 : o.value) != null && a.length) && e && N(e);
25
25
  },
26
26
  { immediate: !0 }
27
27
  );
28
- function A(e) {
28
+ function N(e) {
29
29
  if (!e) {
30
30
  r.value = void 0, f.splice(0, f.length), o.value = [];
31
31
  return;
32
32
  }
33
- Z(async () => {
33
+ F(async () => {
34
34
  const a = [];
35
35
  for (let t of e) {
36
- const n = oe(y, t), s = ie(y, t), c = await M(z), Q = await c.getSignatureUrl(n), W = {
36
+ const n = ie(y, t), s = re(y, t), u = await T(A), W = await u.getSignatureUrl(n), X = {
37
37
  ...typeof t == "string" ? {} : t,
38
38
  ...new File([t], s, {}),
39
39
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
40
- thumbUrl: Q,
40
+ thumbUrl: W,
41
41
  status: "success",
42
42
  percent: 100,
43
43
  path: n
44
44
  };
45
- a.push(W), c.destroy();
45
+ a.push(X), u.destroy();
46
46
  }
47
47
  if (p && a.length > p) {
48
48
  m.warning(
@@ -60,38 +60,38 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
60
60
  }), r.value = e;
61
61
  });
62
62
  }
63
- T({ setValue: A });
64
- function j() {
63
+ D({ setValue: N });
64
+ function G() {
65
65
  var e;
66
66
  (e = x.value) == null || e.click();
67
67
  }
68
- function G(e) {
68
+ function H(e) {
69
69
  const a = e.target;
70
- H(a == null ? void 0 : a.files);
70
+ J(a == null ? void 0 : a.files);
71
71
  }
72
- function H(e) {
72
+ function J(e) {
73
73
  if (e != null && e.length)
74
74
  for (let a = 0; a < e.length; a++)
75
- J(e[a]);
75
+ K(e[a]);
76
76
  x.value && (x.value.value = "");
77
77
  }
78
- let N;
79
- async function J(e) {
78
+ let P;
79
+ async function K(e) {
80
80
  if (p && p > 1 && o.value.length >= p)
81
- return clearTimeout(N), N = setTimeout(() => {
81
+ return clearTimeout(P), P = setTimeout(() => {
82
82
  m.warning(
83
- q || l("ap.apUpload.maxUploadPicture", { maxCount: p })
83
+ V || l("ap.apUpload.maxUploadPicture", { maxCount: p })
84
84
  );
85
85
  }), !1;
86
- if (e.size > w * 1024 * 1024)
86
+ if (e.size > U * 1024 * 1024)
87
87
  return m.warning(
88
- L || l("ap.apUpload.maxUploadFileSize", { maxSize: w })
88
+ q || l("ap.apUpload.maxUploadFileSize", { maxSize: U })
89
89
  ), !1;
90
- if (!/image\/\w+/.test(e.type) || !le(e, _))
90
+ if (!/image\/\w+/.test(e.type) || !pe(e, w))
91
91
  return m.warning(
92
- V || l("ap.apUpload.pictureFormatNotSupported")
92
+ j || l("ap.apUpload.pictureFormatNotSupported")
93
93
  ), !1;
94
- if (typeof E == "function" && await E(e) === !1)
94
+ if (typeof b == "function" && await b(e) === !1)
95
95
  return !1;
96
96
  const a = new FileReader();
97
97
  a.readAsDataURL(e), a.onload = function() {
@@ -102,14 +102,14 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
102
102
  status: "uploading",
103
103
  percent: 0
104
104
  };
105
- K(t, e);
105
+ Q(t, e);
106
106
  }, a.onerror = function() {
107
107
  m.warning(l("ap.apUpload.imageParsingFailed"));
108
108
  };
109
109
  }
110
- async function K(e, a) {
111
- if (v.value++, typeof b == "function") {
112
- b({
110
+ async function Q(e, a) {
111
+ if (v.value++, typeof z == "function") {
112
+ z({
113
113
  onProgress: (t) => {
114
114
  const n = o.value.find((s) => s.uid === e.uid);
115
115
  n && (n.percent = t);
@@ -125,7 +125,7 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
125
125
  const n = o.value.find((s) => s.uid === e.uid);
126
126
  n && (n.status = "success", n.path = t), r.value = [
127
127
  ...r.value || [],
128
- I(y, t, a.name)
128
+ M(y, t, a.name)
129
129
  ], f.push({
130
130
  uid: e.uid,
131
131
  path: t
@@ -136,16 +136,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
136
136
  return;
137
137
  }
138
138
  try {
139
- const t = await M(z);
140
- e.oss = t, o.value.push(e), D({
139
+ const t = await T(A);
140
+ e.oss = t, o.value.push(e), O({
141
141
  file: a,
142
- dirName: B,
142
+ dirName: L,
143
143
  oss: t,
144
144
  successCallBack(n) {
145
- const s = o.value.find((c) => c.uid === e.uid);
145
+ const s = o.value.find((u) => u.uid === e.uid);
146
146
  s && (s.status = "success", s.path = n), r.value = [
147
147
  ...r.value || [],
148
- I(y, n, a.name)
148
+ M(y, n, a.name)
149
149
  ], f.push({
150
150
  uid: e.uid,
151
151
  path: n
@@ -154,12 +154,12 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
154
154
  errorCallBack(n) {
155
155
  m.warning(n || l("ap.apUpload.networkAnomaly"));
156
156
  const s = o.value.findIndex(
157
- (c) => c.uid === e.uid
157
+ (u) => u.uid === e.uid
158
158
  );
159
159
  s > -1 && o.value.splice(s, 1), v.value--;
160
160
  },
161
161
  progressCallBack(n) {
162
- const s = o.value.find((c) => c.uid === e.uid);
162
+ const s = o.value.find((u) => u.uid === e.uid);
163
163
  s && (s.percent = n);
164
164
  }
165
165
  });
@@ -171,16 +171,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
171
171
  n > -1 && o.value.splice(n, 1), v.value--;
172
172
  }
173
173
  }
174
- function P(e) {
174
+ function R(e) {
175
175
  var t, n;
176
- if (e.path && r) {
176
+ if (_ && (_ == null || _(e)), e.path && r) {
177
177
  if (Array.isArray(r.value)) {
178
178
  const s = f.findIndex(
179
- (c) => c.uid === e.uid
179
+ (u) => u.uid === e.uid
180
180
  );
181
181
  if (s >= 0) {
182
- const c = ((t = r == null ? void 0 : r.value) == null ? void 0 : t.slice()) ?? [];
183
- c == null || c.splice(s, 1), r.value = c, f.splice(s, 1);
182
+ const u = ((t = r == null ? void 0 : r.value) == null ? void 0 : t.slice()) ?? [];
183
+ u == null || u.splice(s, 1), r.value = u, f.splice(s, 1);
184
184
  }
185
185
  r.value.length === 0 && (r.value = void 0);
186
186
  }
@@ -192,9 +192,9 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
192
192
  return o.value.splice(a, 1), Promise.resolve(!0);
193
193
  }
194
194
  return (e, a) => (g(), h("div", {
195
- class: F({
196
- [i(C)()]: !0,
197
- [i(C)("admin")]: i(O) === "admin"
195
+ class: ee({
196
+ [i(S)()]: !0,
197
+ [i(S)("admin")]: i(B) === "admin"
198
198
  })
199
199
  }, [
200
200
  d("input", {
@@ -202,49 +202,49 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
202
202
  ref: x,
203
203
  style: { display: "none" },
204
204
  type: "file",
205
- accept: i(_),
206
- onChange: G
207
- }, null, 40, he),
208
- d("div", ve, [
209
- ee(e.$slots, "pictureContext", {
205
+ accept: i(w),
206
+ onChange: H
207
+ }, null, 40, ve),
208
+ d("div", xe, [
209
+ te(e.$slots, "pictureContext", {
210
210
  fileList: i(o).map((t) => {
211
211
  var n;
212
212
  return {
213
- ...i(me)(t, "oss"),
213
+ ...i(fe)(t, "oss"),
214
214
  oss: {
215
215
  pauseUpload: (n = t == null ? void 0 : t.oss) == null ? void 0 : n.pauseUpload
216
216
  }
217
217
  };
218
218
  }),
219
- remove: P
219
+ remove: R
220
220
  }, () => [
221
- (g(!0), h(te, null, ne(i(o), (t) => (g(), h("div", {
221
+ (g(!0), h(ne, null, ae(i(o), (t) => (g(), h("div", {
222
222
  key: t.uid,
223
223
  class: "picture-item"
224
224
  }, [
225
- d("div", xe, [
225
+ d("div", ye, [
226
226
  d("img", {
227
227
  src: t.thumbUrl,
228
228
  alt: ""
229
- }, null, 8, ye),
230
- ae(d("div", _e, [
229
+ }, null, 8, _e),
230
+ se(d("div", we, [
231
231
  d("div", {
232
232
  class: "picture-item-close",
233
- onClick: (n) => P(t)
233
+ onClick: (n) => R(t)
234
234
  }, [
235
- U(i(re))
236
- ], 8, we),
237
- t.status === "uploading" ? (g(), h("div", Ue, [
238
- U(i(de), {
235
+ k(i(ce))
236
+ ], 8, Ue),
237
+ t.status === "uploading" ? (g(), h("div", ke, [
238
+ k(i(me), {
239
239
  percent: t.percent,
240
240
  "stroke-color": "#ffffff",
241
241
  "trail-color": "rgba(255, 255, 255, 0.3)",
242
242
  size: 4,
243
243
  "show-info": !1
244
244
  }, null, 8, ["percent"])
245
- ])) : $("", !0)
245
+ ])) : I("", !0)
246
246
  ], 512), [
247
- [se, t.status === "uploading"]
247
+ [oe, t.status === "uploading"]
248
248
  ])
249
249
  ])
250
250
  ]))), 128))
@@ -252,21 +252,21 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
252
252
  i(p) === void 0 || i(o).length < i(p) ? (g(), h("div", {
253
253
  key: 0,
254
254
  class: "picture-upload",
255
- onClick: j
255
+ onClick: G
256
256
  }, [
257
- U(i(ce)),
258
- d("div", null, k(i(l)("ap.apUpload.update")), 1)
259
- ])) : $("", !0)
257
+ k(i(ue)),
258
+ d("div", null, C(i(l)("ap.apUpload.update")), 1)
259
+ ])) : I("", !0)
260
260
  ]),
261
- d("div", ke, [
262
- i(S) ? (g(), h("div", Ce, k(i(S)), 1)) : (g(), h("div", Se, k(`${i(l)("ap.apUpload.supportExtension")}:${i(pe)(i(_))},${i(l)(
261
+ d("div", Ce, [
262
+ i(E) ? (g(), h("div", Se, C(i(E)), 1)) : (g(), h("div", Ee, C(`${i(l)("ap.apUpload.supportExtension")}:${i(de)(i(w))},${i(l)(
263
263
  "ap.apUpload.maxUploadPictureSize",
264
- { maxSize: i(w) }
264
+ { maxSize: i(U) }
265
265
  )}`), 1))
266
266
  ])
267
267
  ], 2));
268
268
  }
269
269
  });
270
270
  export {
271
- De as default
271
+ Oe as default
272
272
  };