@aplus-frontend/ui 0.3.0 → 0.3.2

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 (139) hide show
  1. package/es/src/ap-action/item/index.vue2.mjs +11 -11
  2. package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
  3. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +24 -24
  4. package/es/src/ap-drawer/utils/createDrawer.mjs +10 -10
  5. package/es/src/ap-field/checkbox/index.vue.mjs +3 -3
  6. package/es/src/ap-field/date/index.vue.mjs +2 -2
  7. package/es/src/ap-field/date-range/index.vue.mjs +2 -2
  8. package/es/src/ap-field/number/index.vue.mjs +3 -3
  9. package/es/src/ap-field/radio/index.vue.mjs +5 -5
  10. package/es/src/ap-field/rate/index.vue.mjs +4 -4
  11. package/es/src/ap-field/segmented/index.vue.mjs +3 -3
  12. package/es/src/ap-field/select/index.vue.mjs +4 -4
  13. package/es/src/ap-field/slider/index.vue.mjs +3 -3
  14. package/es/src/ap-field/switch/index.vue.mjs +4 -4
  15. package/es/src/ap-field/text-area/index.vue.mjs +3 -3
  16. package/es/src/ap-form/ap-form.vue.d.ts +5 -6
  17. package/es/src/ap-form/ap-form.vue2.mjs +5 -5
  18. package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -4
  19. package/es/src/ap-form/drawer-form/index.vue.mjs +2 -2
  20. package/es/src/ap-form/interface.d.ts +12 -3
  21. package/es/src/ap-form/modal-form/index.vue.d.ts +4 -4
  22. package/es/src/ap-form/modal-form/index.vue.mjs +3 -3
  23. package/es/src/ap-form/search-form/index.vue.d.ts +5 -5
  24. package/es/src/ap-form/search-form/index.vue.mjs +2 -2
  25. package/es/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue2.mjs +6 -6
  26. package/es/src/ap-list/index.vue.mjs +27 -27
  27. package/es/src/ap-modal/utils/createModal.mjs +10 -10
  28. package/es/src/ap-scroll-bar/ap-scroll-bar.vue2.mjs +3 -3
  29. package/es/src/ap-table/ap-table.vue2.mjs +3 -3
  30. package/es/src/ap-table/components/index/index.vue2.mjs +3 -3
  31. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +4 -4
  32. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +2 -2
  33. package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +3 -3
  34. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +8 -8
  35. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +6 -6
  36. package/es/src/ap-table/components/status/index.vue2.mjs +4 -4
  37. package/es/src/ap-table/hooks/use-table-content-height.mjs +13 -11
  38. package/es/src/ap-tag/ap-tag-group.vue.mjs +1 -1
  39. package/es/src/ap-upload/apUpload.vue.d.ts +57 -8
  40. package/es/src/ap-upload/apUpload.vue.mjs +56 -37
  41. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +10 -10
  42. package/es/src/ap-upload/components/Picture.vue2.mjs +26 -26
  43. package/es/src/ap-upload/components/SingleFile.vue2.mjs +27 -27
  44. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +49 -49
  45. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +10 -10
  46. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +5 -5
  47. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +11 -11
  48. package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +1 -1
  49. package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +26 -26
  50. package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +15 -15
  51. package/es/src/business/ap-group-search/index.d.ts +1 -1
  52. package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +15 -15
  53. package/es/src/business/ap-image/ApImage.vue2.mjs +28 -28
  54. package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
  55. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +8 -9
  56. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +5 -2
  57. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +74 -70
  58. package/es/src/business/ap-upload-file/hook/useProps.mjs +8 -8
  59. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +1 -1
  60. package/es/src/business/ap-upload-file/interface.d.ts +2 -0
  61. package/es/src/business/ap-upload-file/utils/fileList.d.ts +2 -2
  62. package/es/src/business/ap-upload-file/utils/fileList.mjs +12 -12
  63. package/es/src/business/ap-upload-file/utils/upload.d.ts +3 -0
  64. package/es/src/business/ap-upload-file/utils/upload.mjs +23 -23
  65. package/es/src/business/batch-input-group/index.vue.mjs +5 -5
  66. package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +15 -15
  67. package/es/src/editable-table/form-item.vue.mjs +3 -3
  68. package/es/src/editable-table/index.vue.mjs +6 -6
  69. package/es/src/work-order-modal/work-order-modal.vue.mjs +28 -28
  70. package/lib/src/ap-action/item/index.vue2.js +1 -1
  71. package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
  72. package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
  73. package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
  74. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  75. package/lib/src/ap-field/date/index.vue.js +1 -1
  76. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  77. package/lib/src/ap-field/number/index.vue.js +1 -1
  78. package/lib/src/ap-field/radio/index.vue.js +1 -1
  79. package/lib/src/ap-field/rate/index.vue.js +1 -1
  80. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  81. package/lib/src/ap-field/select/index.vue.js +1 -1
  82. package/lib/src/ap-field/slider/index.vue.js +1 -1
  83. package/lib/src/ap-field/switch/index.vue.js +1 -1
  84. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  85. package/lib/src/ap-form/ap-form.vue.d.ts +5 -6
  86. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  87. package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -4
  88. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  89. package/lib/src/ap-form/interface.d.ts +12 -3
  90. package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -4
  91. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  92. package/lib/src/ap-form/search-form/index.vue.d.ts +5 -5
  93. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  94. package/lib/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue2.js +1 -1
  95. package/lib/src/ap-list/index.vue.js +1 -1
  96. package/lib/src/ap-modal/utils/createModal.js +1 -1
  97. package/lib/src/ap-scroll-bar/ap-scroll-bar.vue2.js +1 -1
  98. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  99. package/lib/src/ap-table/components/index/index.vue2.js +1 -1
  100. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  101. package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
  102. package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -1
  103. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
  104. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
  105. package/lib/src/ap-table/components/status/index.vue2.js +1 -1
  106. package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
  107. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  108. package/lib/src/ap-upload/apUpload.vue.d.ts +57 -8
  109. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  110. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  111. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  112. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  113. package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
  114. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  115. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  116. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  117. package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +1 -1
  118. package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
  119. package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
  120. package/lib/src/business/ap-group-search/index.d.ts +1 -1
  121. package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
  122. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  123. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  124. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  125. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +5 -2
  126. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  127. package/lib/src/business/ap-upload-file/hook/useProps.js +1 -1
  128. package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -1
  129. package/lib/src/business/ap-upload-file/interface.d.ts +2 -0
  130. package/lib/src/business/ap-upload-file/utils/fileList.d.ts +2 -2
  131. package/lib/src/business/ap-upload-file/utils/fileList.js +1 -1
  132. package/lib/src/business/ap-upload-file/utils/upload.d.ts +3 -0
  133. package/lib/src/business/ap-upload-file/utils/upload.js +1 -1
  134. package/lib/src/business/batch-input-group/index.vue.js +1 -1
  135. package/lib/src/business/batch-input-group/popover-input/index.vue2.js +2 -2
  136. package/lib/src/editable-table/form-item.vue.js +1 -1
  137. package/lib/src/editable-table/index.vue.js +1 -1
  138. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  139. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { defineComponent as S, computed as s, ref as U, watchEffect as j, openBlock as i, createBlock as g, unref as n, mergeProps as p, withCtx as B, renderSlot as E, normalizeProps as I, guardReactiveProps as L, createElementVNode as b, normalizeClass as D, createElementBlock as M, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as x } from "vue";
1
+ import { defineComponent as S, computed as c, ref as U, watchEffect as j, openBlock as i, createBlock as p, unref as n, mergeProps as g, withCtx as B, renderSlot as E, normalizeProps as I, guardReactiveProps as L, createElementVNode as b, normalizeClass as D, createElementBlock as M, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as x } from "vue";
2
2
  import { Image as z } from "@aplus-frontend/antdv";
3
3
  import { DownloadOutlined as V } from "@ant-design/icons-vue";
4
4
  import { injectLocaleToOss as W, getOssInstance as G, getSignatureUrl as $ } from "./hooks/useOss.mjs";
@@ -9,7 +9,7 @@ import { omit as J } from "lodash-unified";
9
9
  import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
10
10
  import { useGlobalConfig as m } from "../../config-provider/hooks/use-global-config.mjs";
11
11
  import { useLocale as Q } from "../../config-provider/hooks/use-locale.mjs";
12
- const se = /* @__PURE__ */ S({
12
+ const ce = /* @__PURE__ */ S({
13
13
  __name: "ApImage",
14
14
  props: {
15
15
  getOssAccess: {},
@@ -27,70 +27,70 @@ const se = /* @__PURE__ */ S({
27
27
  admin: q
28
28
  }, k = m("uiMode"), w = m("apUpload"), f = m(
29
29
  "downloadCenterTriggerConfig"
30
- ), { t: h, lang: C } = Q(), O = s(
30
+ ), { t: h, lang: C } = Q(), O = c(
31
31
  () => {
32
- var a;
33
- return e.getOssAccess || ((a = w.value) == null ? void 0 : a.getOssAccess);
32
+ var r;
33
+ return e.getOssAccess || ((r = w.value) == null ? void 0 : r.getOssAccess);
34
34
  }
35
- ), A = s(
35
+ ), A = c(
36
36
  () => d[k.value] || d.aplus
37
- ), N = s(() => (e == null ? void 0 : e.fallback) || A.value), r = U("");
37
+ ), N = c(() => (e == null ? void 0 : e.fallback) || A.value), o = U("");
38
38
  W(h, C), j(async () => {
39
- var a;
39
+ var r;
40
40
  if (!(e != null && e.src)) {
41
- r.value = "";
41
+ o.value = "";
42
42
  return;
43
43
  }
44
- if (!((a = e.src) != null && a.startsWith("Frontend-Upload"))) {
45
- r.value = e.src;
44
+ if (!((r = e.src) != null && r.startsWith("Frontend-Upload"))) {
45
+ o.value = e.src;
46
46
  return;
47
47
  }
48
48
  try {
49
- const o = await G(O.value), t = await $({
50
- oss: o,
49
+ const a = await G(O.value), t = await $({
50
+ oss: a,
51
51
  fileName: e.src
52
52
  });
53
- t && (r.value = t);
53
+ t && (o.value = t);
54
54
  } catch {
55
- r.value = "";
55
+ o.value = "";
56
56
  }
57
57
  });
58
58
  async function y() {
59
- var t, l, c;
59
+ var t, l, s;
60
60
  if (!(e != null && e.src))
61
61
  return;
62
- const a = e.src, o = e.fileName ?? e.src;
62
+ const r = e.src, a = e.fileName ?? e.src;
63
63
  if (!((t = e.src) != null && t.startsWith("Frontend-Upload"))) {
64
- _(a, o);
64
+ _(r, a);
65
65
  return;
66
66
  }
67
67
  if ((l = f.value) != null && l.trigger) {
68
68
  let F = [
69
69
  {
70
- objectName: a,
71
- fileName: o
70
+ objectName: r,
71
+ fileName: a
72
72
  }
73
73
  ];
74
- await ((c = f.value) == null ? void 0 : c.trigger(F));
74
+ await ((s = f.value) == null ? void 0 : s.trigger(F));
75
75
  }
76
76
  }
77
- const _ = (a, o) => {
77
+ const _ = (r, a) => {
78
78
  const t = document.createElement("a");
79
- t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", o), document.body.appendChild(t), t.click(), document.body.removeChild(t);
79
+ t.href = r, t.rel = "noopener noreferrer", t.setAttribute("download", a), document.body.appendChild(t), t.click(), document.body.removeChild(t);
80
80
  };
81
- return (a, o) => (i(), g(n(z), p({
81
+ return (r, a) => (i(), p(n(z), g({
82
82
  class: [n(u)()]
83
83
  }, {
84
84
  ...n(J)(e, ["src", "getOssAccess"]),
85
85
  fallback: N.value,
86
- src: r.value
86
+ src: o.value
87
87
  }), {
88
88
  toolbarRender: B((t) => [
89
- E(a.$slots, "toolbarRender", I(L({ ...t })), () => [
89
+ E(r.$slots, "toolbarRender", I(L({ ...t })), () => [
90
90
  b("div", {
91
91
  class: D([n(u)("toolbar")])
92
92
  }, [
93
- (i(!0), M(P, null, R(t.originalNodes, (l, c) => (i(), g(T(l), p({ ref_for: !0 }, t, { key: c }), null, 16))), 128)),
93
+ (i(!0), M(P, null, R(t.originalNodes, (l, s) => (i(), p(T(l), g({ ref_for: !0 }, e, { key: s }), null, 16))), 128)),
94
94
  b("div", {
95
95
  class: "ant-image-preview-operations-operation",
96
96
  onClick: y
@@ -105,5 +105,5 @@ const se = /* @__PURE__ */ S({
105
105
  }
106
106
  });
107
107
  export {
108
- se as default
108
+ ce as default
109
109
  };
@@ -73,8 +73,8 @@ const Q = /* @__PURE__ */ I({
73
73
  class: f(r(S)())
74
74
  }, {
75
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
76
  key: e.key,
77
+ class: f(`${n.size === "small" ? r(g)("item", "small") : r(_)("item")}`),
78
78
  index: t,
79
79
  style: B({
80
80
  textAlign: e.align
@@ -175,8 +175,6 @@ const fe = /* @__PURE__ */ F({
175
175
  getApTableInstance: N
176
176
  }), (o, t) => ($(), z(s(H), b(
177
177
  {
178
- onOk: L,
179
- onCancel: w,
180
178
  open: i.value,
181
179
  "onUpdate:open": t[0] || (t[0] = (l) => i.value = l)
182
180
  },
@@ -197,27 +195,28 @@ const fe = /* @__PURE__ */ F({
197
195
  {
198
196
  title: D(),
199
197
  "body-style": { maxHeight: "calc(100vh - 205px)", overflowY: "scroll" },
200
- centered: e.centered ?? !0
198
+ centered: e.centered ?? !0,
199
+ onOk: L,
200
+ onCancel: w
201
201
  }
202
202
  ), {
203
203
  default: k(() => [
204
204
  T(X, b(e.tableLayoutConfig || {}, {
205
- onClear: O,
206
205
  "selected-list": a.value,
206
+ onClear: O,
207
207
  onDeleteItem: G
208
208
  }), {
209
209
  default: k(() => [
210
- T(s(Z), b({
210
+ T(s(Z), b(s(S)(e.apTableProps, "dataSource"), {
211
+ ref_key: "apTableRef",
212
+ ref: d,
211
213
  scroll: { y: "100%" },
212
214
  style: { padding: "0px" },
213
215
  columns: o.columns,
214
216
  request: I,
215
217
  "row-key": o.getRowKey,
216
218
  "row-selection": A.value,
217
- bordered: s(K) === "admin"
218
- }, s(S)(e.apTableProps, "dataSource"), {
219
- ref_key: "apTableRef",
220
- ref: d,
219
+ bordered: s(K) === "admin",
221
220
  "data-source": C.value
222
221
  }), null, 16, ["columns", "row-key", "row-selection", "bordered", "data-source"])
223
222
  ]),
@@ -1,10 +1,13 @@
1
- import { ApUploadSingleProps } from '../interface';
1
+ import { ApUploadFile, ApUploadSingleProps } from '../interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  type __VLS_Props = ApUploadSingleProps;
4
4
  declare function __VLS_template(): {
5
5
  attrs: Partial<{}>;
6
6
  slots: {
7
- default?(_: {}): any;
7
+ default?(_: {
8
+ file: ApUploadFile | undefined;
9
+ clear: () => void | undefined;
10
+ }): any;
8
11
  };
9
12
  refs: {};
10
13
  rootEl: any;
@@ -1,17 +1,17 @@
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";
1
+ import { defineComponent as Q, computed as C, openBlock as m, createBlock as k, unref as e, mergeProps as W, withCtx as u, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z, createElementVNode as s, normalizeClass as l, createElementBlock as g, createVNode as n, createTextVNode as p, toDisplayString as f, resolveDynamicComponent as E, h as P, Fragment as $ } from "vue";
2
+ import { clearSingleFile as ee, clearAllFile as x } from "../utils/fileList.mjs";
3
+ import b from "../icon/file-icon.vue.mjs";
4
+ import F from "../icon/delete-icon.vue.mjs";
5
+ import { Form as te, UploadDragger as oe, TypographyParagraph as I, Progress as le, Tooltip as q } from "@aplus-frontend/antdv";
6
+ import { FormItemInputContext as se } from "@aplus-frontend/antdv/es/form/FormItemContext";
7
+ import { useSingleProps as ne } from "../hook/useProps.mjs";
8
+ import { useInjectContext as ae } from "../hook/useInjectContext.mjs";
9
+ import { omit as ie } from "lodash-unified";
10
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({
11
+ import { useGlobalConfig as B } from "../../../config-provider/hooks/use-global-config.mjs";
12
+ import { useLocale as re } from "../../../config-provider/hooks/use-locale.mjs";
13
+ import { useNamespace as ue } from "../../../config-provider/hooks/use-namespace.mjs";
14
+ const Ie = /* @__PURE__ */ Q({
15
15
  __name: "ap-upload-single",
16
16
  props: {
17
17
  dirName: {},
@@ -22,36 +22,38 @@ const ke = /* @__PURE__ */ Q({
22
22
  accept: { default: "*" },
23
23
  beforeUpload: {},
24
24
  customRequest: {},
25
+ maxSizeErrorMsg: {},
26
+ acceptErrorMsg: {},
25
27
  title: { type: [Object, String, Number, Boolean, null, Array] },
26
28
  subTitle: { type: [Object, String, Number, Boolean, null, Array] }
27
29
  },
28
30
  emits: ["update:fileList"],
29
- setup(R, { emit: T }) {
31
+ setup(O, { emit: T }) {
30
32
  var D;
31
- const j = te.useInject(), E = y(() => j.status), d = R, P = T, b = Y.useInjectFormItemContext(), m = y({
33
+ const U = se.useInject(), j = C(() => U.status), d = O, z = T, y = te.useInjectFormItemContext(), c = C({
32
34
  get() {
33
35
  return d.fileList || [];
34
36
  },
35
- set(i) {
36
- P("update:fileList", i), b == null || b.onFieldChange();
37
+ set(a) {
38
+ z("update:fileList", a), y == null || y.onFieldChange();
37
39
  }
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,
40
+ }), o = C(() => {
41
+ var a;
42
+ return (a = c.value) == null ? void 0 : a[0];
43
+ }), R = B("apUpload"), { t: M, lang: V } = re(), {
44
+ title: _,
43
45
  subTitle: h,
44
46
  beforeUpload: G,
45
47
  customRequest: H
46
- } = oe(d), J = H;
47
- le(
48
+ } = ne(d), J = H;
49
+ ae(
50
+ M,
48
51
  V,
49
- _,
50
- (d == null ? void 0 : d.getOssAccess) ?? ((D = z.value) == null ? void 0 : D.getOssAccess)
52
+ (d == null ? void 0 : d.getOssAccess) ?? ((D = R.value) == null ? void 0 : D.getOssAccess)
51
53
  );
52
- const { b: U, e: t } = ie("ap-upload-single"), x = O("uiMode");
53
- function K(i) {
54
- return se(i, [
54
+ const { b: N, e: t } = ue("ap-upload-single"), S = B("uiMode");
55
+ function K(a) {
56
+ return ie(a, [
55
57
  "dirName",
56
58
  "needName",
57
59
  "getOssAccess",
@@ -60,40 +62,42 @@ const ke = /* @__PURE__ */ Q({
60
62
  "subTitle"
61
63
  ]);
62
64
  }
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,
65
+ return (a, i) => (m(), k(e(oe), W({
66
+ ...a.$attrs,
69
67
  ...K(d)
70
68
  }, {
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)
69
+ "file-list": c.value,
70
+ "onUpdate:fileList": i[3] || (i[3] = (v) => c.value = v),
71
+ "max-count": 1,
72
+ "show-upload-list": !1,
73
+ disabled: !!o.value && [void 0, "uploading", "error", "success", "done"].includes(o.value.status),
74
+ class: [e(N)(), `${e(N)()}-affix-wrapper-status-${j.value}`],
75
+ "before-upload": e(G),
76
+ "custom-request": e(J)
76
77
  }), {
77
78
  default: u(() => [
78
- X(i.$slots, "default", {}, () => {
79
- var v, F, w, A;
79
+ X(a.$slots, "default", Y(Z({
80
+ file: o.value,
81
+ clear: () => o.value && e(ee)(o.value, c.value, { maxCount: 1 })
82
+ })), () => {
83
+ var v, L, w, A;
80
84
  return [
81
85
  s("div", {
82
86
  class: l([e(t)("content")])
83
87
  }, [
84
- (v = o.value) != null && v.status && ["uploading"].includes(o.value.status) ? (c(), g("div", {
88
+ (v = o.value) != null && v.status && ["uploading"].includes(o.value.status) ? (m(), g("div", {
85
89
  key: 0,
86
90
  class: l([e(t)("content-file"), e(t)("content-ing")])
87
91
  }, [
88
92
  s("div", {
89
93
  class: l([e(t)("content-file-icon")])
90
94
  }, [
91
- n(C)
95
+ n(b)
92
96
  ], 2),
93
97
  s("div", {
94
98
  class: l([e(t)("content-file-name"), e(t)("content-ing-name")])
95
99
  }, [
96
- n(e(N), {
100
+ n(e(I), {
97
101
  ellipsis: { rows: 2 },
98
102
  tooltip: o.value.error
99
103
  }, {
@@ -102,33 +106,33 @@ const ke = /* @__PURE__ */ Q({
102
106
  ]),
103
107
  _: 1
104
108
  }, 8, ["tooltip"]),
105
- n(e(ee), {
109
+ n(e(le), {
106
110
  percent: o.value.percent || 0,
107
111
  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
+ "show-info": !1,
113
+ "trail-color": e(S) === "admin" ? "#D9D9D9" : "#DEE4ED",
114
+ "stroke-color": e(S) === "admin" ? "#34B77C" : "#0070FF"
115
+ }, null, 8, ["percent", "trail-color", "stroke-color"])
112
116
  ], 2),
113
117
  s("div", {
114
118
  class: l([e(t)("content-file-delete")]),
115
- onClick: a[0] || (a[0] = (r) => e(I)(m.value))
119
+ onClick: i[0] || (i[0] = (r) => e(x)(c.value))
116
120
  }, [
117
- n(L)
121
+ n(F)
118
122
  ], 2)
119
- ], 2)) : (F = o.value) != null && F.status && ["error"].includes(o.value.status) ? (c(), g("div", {
123
+ ], 2)) : (L = o.value) != null && L.status && ["error"].includes(o.value.status) ? (m(), g("div", {
120
124
  key: 1,
121
125
  class: l([e(t)("content-file"), e(t)("content-error")])
122
126
  }, [
123
127
  s("div", {
124
128
  class: l([e(t)("content-file-icon")])
125
129
  }, [
126
- n(C)
130
+ n(b)
127
131
  ], 2),
128
132
  s("div", {
129
133
  class: l([e(t)("content-file-name"), e(t)("content-error-name")])
130
134
  }, [
131
- n(e(B), null, {
135
+ n(e(q), null, {
132
136
  title: u(() => {
133
137
  var r;
134
138
  return [
@@ -136,7 +140,7 @@ const ke = /* @__PURE__ */ Q({
136
140
  ];
137
141
  }),
138
142
  default: u(() => [
139
- n(e(N), {
143
+ n(e(I), {
140
144
  ellipsis: { rows: 2 },
141
145
  tooltip: o.value.error
142
146
  }, {
@@ -151,23 +155,23 @@ const ke = /* @__PURE__ */ Q({
151
155
  ], 2),
152
156
  s("div", {
153
157
  class: l([e(t)("content-file-delete")]),
154
- onClick: a[1] || (a[1] = (r) => e(I)(m.value))
158
+ onClick: i[1] || (i[1] = (r) => e(x)(c.value))
155
159
  }, [
156
- n(L)
160
+ n(F)
157
161
  ], 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", {
162
+ ], 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) ? (m(), g("div", {
159
163
  key: 2,
160
164
  class: l([e(t)("content-file"), e(t)("content-done")])
161
165
  }, [
162
166
  s("div", {
163
167
  class: l([e(t)("content-file-icon")])
164
168
  }, [
165
- n(C)
169
+ n(b)
166
170
  ], 2),
167
171
  s("div", {
168
172
  class: l([e(t)("content-file-name"), e(t)("content-done-name")])
169
173
  }, [
170
- n(e(B), null, {
174
+ n(e(q), null, {
171
175
  title: u(() => {
172
176
  var r;
173
177
  return [
@@ -175,7 +179,7 @@ const ke = /* @__PURE__ */ Q({
175
179
  ];
176
180
  }),
177
181
  default: u(() => [
178
- n(e(N), {
182
+ n(e(I), {
179
183
  ellipsis: { rows: 2 },
180
184
  tooltip: o.value.error
181
185
  }, {
@@ -190,28 +194,28 @@ const ke = /* @__PURE__ */ Q({
190
194
  ], 2),
191
195
  s("div", {
192
196
  class: l([e(t)("content-file-delete")]),
193
- onClick: a[2] || (a[2] = (r) => e(I)(m.value))
197
+ onClick: i[2] || (i[2] = (r) => e(x)(c.value))
194
198
  }, [
195
- n(L)
199
+ n(F)
196
200
  ], 2)
197
- ], 2)) : (c(), g("div", {
201
+ ], 2)) : (m(), g("div", {
198
202
  key: 3,
199
203
  class: l([e(t)("content-empty")])
200
204
  }, [
201
205
  s("div", {
202
206
  class: l([e(t)("content-empty-icon")])
203
207
  }, [
204
- n(C)
208
+ n(b)
205
209
  ], 2),
206
210
  s("div", {
207
211
  class: l([e(t)("content-empty-title")])
208
212
  }, [
209
- (c(), k(S($(q, [e(M)]))))
213
+ (m(), k(E(P($, [e(_)]))))
210
214
  ], 2),
211
215
  s("div", {
212
216
  class: l([e(t)("content-empty-sub-title")])
213
217
  }, [
214
- (c(), k(S($(q, [e(h)]))))
218
+ (m(), k(E(P($, [e(h)]))))
215
219
  ], 2)
216
220
  ], 2))
217
221
  ], 2)
@@ -219,9 +223,9 @@ const ke = /* @__PURE__ */ Q({
219
223
  })
220
224
  ]),
221
225
  _: 3
222
- }, 16, ["disabled", "file-list", "class", "beforeUpload", "customRequest"]));
226
+ }, 16, ["file-list", "disabled", "class", "before-upload", "custom-request"]));
223
227
  }
224
228
  });
225
229
  export {
226
- ke as default
230
+ Ie as default
227
231
  };
@@ -1,12 +1,12 @@
1
- import { computed as l } from "vue";
1
+ import { computed as m } from "vue";
2
2
  import { getAcceptText as d } from "../utils/accept.mjs";
3
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";
4
+ import { uploadBeforeUpload as o, uploadCustomRequest as f } from "../utils/upload.mjs";
5
+ import { useLocale as U } from "../../../config-provider/hooks/use-locale.mjs";
6
6
  function z(e) {
7
- const { t: c } = o(), m = l(
7
+ const { t: c } = U(), l = m(
8
8
  () => e.title || c("ap.apUpload.clickOrDragUpload")
9
- ), i = l(
9
+ ), i = m(
10
10
  () => e.subTitle || `${c("ap.apUpload.supportExtension")}:${d(e.accept)},${c(
11
11
  "ap.apUpload.maxWarnUploadFileSize",
12
12
  {
@@ -16,11 +16,11 @@ function z(e) {
16
16
  );
17
17
  function n(t, a) {
18
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);
19
+ return o(t, a, e) && (((u = e == null ? void 0 : e.beforeUpload) == null ? void 0 : u.call(e, t, a)) ?? !0);
20
20
  }
21
- return { title: m, subTitle: i, beforeUpload: n, customRequest: (t) => {
21
+ return { title: l, subTitle: i, beforeUpload: n, customRequest: (t) => {
22
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);
23
+ e != null && e.customRequest ? (a = e == null ? void 0 : e.customRequest) == null || a.call(e, t) : (u = f) == null || u(t, e);
24
24
  } };
25
25
  }
26
26
  export {
@@ -9,7 +9,7 @@ const r = {}, s = {
9
9
  };
10
10
  function p(a, t) {
11
11
  return o(), i("svg", s, t[0] || (t[0] = [
12
- e('<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)
12
+ e('<defs><clipPath id="master_svg0_693_19001"><rect x="0" y="0" width="56" height="56" rx="7"></rect></clipPath><linearGradient id="master_svg1_693_19025" x1="0.5" y1="0" x2="0.5" y2="0.7987817525863647"><stop offset="0%" stop-color="#AED1FF" stop-opacity="1"></stop><stop offset="100%" stop-color="#74B1FF" stop-opacity="1"></stop></linearGradient><linearGradient id="master_svg2_693_19014" x1="0.5" y1="0" x2="0.5" y2="1"><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)
13
13
  ]));
14
14
  }
15
15
  const g = /* @__PURE__ */ l(r, [["render", p]]);
@@ -21,6 +21,8 @@ export type ApUploadBaseProps<T = any> = {
21
21
  accept?: string;
22
22
  beforeUpload?: (file: ApUploadFile<T>, fileList: ApUploadFile<T>[]) => boolean | Promise<boolean>;
23
23
  customRequest?: ApUploadCustomRequest;
24
+ maxSizeErrorMsg?: string;
25
+ acceptErrorMsg?: string;
24
26
  };
25
27
  export type ApUploadSingleProps<T = any> = ApUploadBaseProps<T> & {
26
28
  title?: VNodeChild;
@@ -1,5 +1,5 @@
1
1
  import { ApUploadFile } from '../interface';
2
- export declare function clearSingleFile(file: ApUploadFile, fileList: ApUploadFile[], props?: {
2
+ export declare function clearSingleFile(file?: ApUploadFile | undefined, fileList?: ApUploadFile[], props?: {
3
3
  maxCount?: number;
4
4
  }): void;
5
- export declare function clearAllFile(fileList: ApUploadFile[]): void;
5
+ export declare function clearAllFile(fileList?: ApUploadFile[]): void;
@@ -1,16 +1,16 @@
1
- function e(t, n, u) {
2
- var c;
3
- t.status === "uploading" && ((c = t.ossDestroy) == null || c.call(t));
4
- const a = n.findIndex((d) => d.uid === t.uid);
5
- a > -1 && (n.splice(a, 1), u != null && u.maxCount && n.length >= u.maxCount && n.splice(u.maxCount));
1
+ function x(n, u, a) {
2
+ var d;
3
+ (n == null ? void 0 : n.status) === "uploading" && ((d = n == null ? void 0 : n.ossDestroy) == null || d.call(n));
4
+ const c = u == null ? void 0 : u.findIndex((o) => o.uid === (n == null ? void 0 : n.uid));
5
+ c !== void 0 && c > -1 && (u == null || u.splice(c, 1), a != null && a.maxCount && u && (u == null ? void 0 : u.length) >= a.maxCount && (u == null || u.splice(a.maxCount)));
6
6
  }
7
- function o(t) {
8
- t.forEach((n) => {
9
- var u;
10
- n.status === "uploading" && ((u = n.ossDestroy) == null || u.call(n));
11
- }), t.splice(0);
7
+ function g(n) {
8
+ n == null || n.forEach((u) => {
9
+ var a;
10
+ u.status === "uploading" && ((a = u.ossDestroy) == null || a.call(u));
11
+ }), n == null || n.splice(0);
12
12
  }
13
13
  export {
14
- o as clearAllFile,
15
- e as clearSingleFile
14
+ g as clearAllFile,
15
+ x as clearSingleFile
16
16
  };
@@ -6,5 +6,8 @@ export declare function uploadBeforeUpload(file: ApUploadFile, fileList: ApUploa
6
6
  maxSize?: number;
7
7
  maxCount?: number;
8
8
  accept?: string;
9
+ maxCountErrorMsg?: string;
10
+ maxSizeErrorMsg?: string;
11
+ acceptErrorMsg?: string;
9
12
  }): boolean;
10
13
  export declare const uploadCustomRequest: ApUploadCustomRequest;