@aplus-frontend/ui 7.0.1 → 7.1.0

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