@aplus-frontend/ui 7.7.3 → 7.7.5

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