@aplus-frontend/ui 6.35.1 → 6.36.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 (125) hide show
  1. package/es/src/ag-grid/index.vue.mjs +17 -16
  2. package/es/src/ag-grid/interface.d.ts +4 -0
  3. package/es/src/ap-field/date/index.vue.mjs +6 -5
  4. package/es/src/ap-field/date/read.vue2.mjs +8 -7
  5. package/es/src/ap-field/date-range/index.vue.mjs +20 -17
  6. package/es/src/ap-field/date-range/read.vue2.mjs +3 -2
  7. package/es/src/ap-field/index.d.ts +3 -3
  8. package/es/src/ap-field/text/index.vue.d.ts +1 -1
  9. package/es/src/ap-field/text/password.vue.d.ts +1 -1
  10. package/es/src/ap-field/text/read-password.vue.d.ts +1 -1
  11. package/es/src/ap-field/text/read.vue.d.ts +1 -1
  12. package/es/src/ap-field/text-area/index.vue.d.ts +1 -1
  13. package/es/src/ap-field/text-area/read.vue.d.ts +1 -1
  14. package/es/src/ap-form/ap-form.vue.d.ts +1 -1
  15. package/es/src/ap-form/drawer-form/index.vue.d.ts +20 -20
  16. package/es/src/ap-form/interface.d.ts +12 -1
  17. package/es/src/ap-form/item/index.vue.d.ts +34 -34
  18. package/es/src/ap-form/items/checkbox/index.vue.d.ts +2 -2
  19. package/es/src/ap-form/items/date/index.vue.d.ts +2 -2
  20. package/es/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  21. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  22. package/es/src/ap-form/items/radio/index.vue.d.ts +2 -2
  23. package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
  24. package/es/src/ap-form/items/switch/index.vue.d.ts +2 -2
  25. package/es/src/ap-form/items/text/index.vue.d.ts +8 -8
  26. package/es/src/ap-form/items/text/password.vue.d.ts +8 -8
  27. package/es/src/ap-form/items/text-area/index.vue.d.ts +6 -6
  28. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  29. package/es/src/ap-form/modal-form/index.vue.d.ts +30 -21
  30. package/es/src/ap-form/render/item.vue.d.ts +2 -2
  31. package/es/src/ap-form/search-form/hooks/use-count-per-row.d.ts +13 -2
  32. package/es/src/ap-form/search-form/hooks/use-count-per-row.mjs +32 -22
  33. package/es/src/ap-form/search-form/index.vue.d.ts +298 -20
  34. package/es/src/ap-form/search-form/index.vue.mjs +94 -88
  35. package/es/src/ap-modal/utils/createModal.mjs +38 -35
  36. package/es/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
  37. package/es/src/ap-table/constants.d.ts +77 -77
  38. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +132 -109
  39. package/es/src/business/ap-attachment/ApAttachment.d.ts +9 -0
  40. package/es/src/business/ap-attachment/ApAttachment.mjs +48 -47
  41. package/es/src/business/ap-attachment/constans.d.ts +4 -0
  42. package/es/src/business/ap-attachment/constans.mjs +4 -0
  43. package/es/src/business/ap-attachment/index.d.ts +15 -0
  44. package/es/src/business/ap-attachment/interface.d.ts +1 -0
  45. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +15 -13
  46. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +10 -10
  47. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +10 -10
  48. package/es/src/business/batch-input-group/form-item.vue.d.ts +2 -2
  49. package/es/src/business/batch-input-group/index.vue.d.ts +4 -4
  50. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  51. package/es/src/config-provider/config-provider.d.ts +10 -1
  52. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  53. package/es/src/config-provider/index.d.ts +16 -1
  54. package/es/src/utils/config-provider-preset.d.ts +3 -1
  55. package/es/src/version.d.ts +1 -1
  56. package/es/src/version.mjs +1 -1
  57. package/es/src/work-order-modal/work-order-modal.vue.d.ts +10 -10
  58. package/es/src/work-order-modal/work-order-modal.vue.mjs +6 -4
  59. package/lib/src/ag-grid/index.vue.js +1 -1
  60. package/lib/src/ag-grid/interface.d.ts +4 -0
  61. package/lib/src/ap-field/date/index.vue.js +1 -1
  62. package/lib/src/ap-field/date/read.vue2.js +1 -1
  63. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  64. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  65. package/lib/src/ap-field/index.d.ts +3 -3
  66. package/lib/src/ap-field/text/index.vue.d.ts +1 -1
  67. package/lib/src/ap-field/text/password.vue.d.ts +1 -1
  68. package/lib/src/ap-field/text/read-password.vue.d.ts +1 -1
  69. package/lib/src/ap-field/text/read.vue.d.ts +1 -1
  70. package/lib/src/ap-field/text-area/index.vue.d.ts +1 -1
  71. package/lib/src/ap-field/text-area/read.vue.d.ts +1 -1
  72. package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
  73. package/lib/src/ap-form/drawer-form/index.vue.d.ts +20 -20
  74. package/lib/src/ap-form/interface.d.ts +12 -1
  75. package/lib/src/ap-form/item/index.vue.d.ts +34 -34
  76. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +2 -2
  77. package/lib/src/ap-form/items/date/index.vue.d.ts +2 -2
  78. package/lib/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  79. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  80. package/lib/src/ap-form/items/radio/index.vue.d.ts +2 -2
  81. package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
  82. package/lib/src/ap-form/items/switch/index.vue.d.ts +2 -2
  83. package/lib/src/ap-form/items/text/index.vue.d.ts +8 -8
  84. package/lib/src/ap-form/items/text/password.vue.d.ts +8 -8
  85. package/lib/src/ap-form/items/text-area/index.vue.d.ts +6 -6
  86. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  87. package/lib/src/ap-form/modal-form/index.vue.d.ts +30 -21
  88. package/lib/src/ap-form/render/item.vue.d.ts +2 -2
  89. package/lib/src/ap-form/search-form/hooks/use-count-per-row.d.ts +13 -2
  90. package/lib/src/ap-form/search-form/hooks/use-count-per-row.js +1 -1
  91. package/lib/src/ap-form/search-form/index.vue.d.ts +298 -20
  92. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  93. package/lib/src/ap-modal/utils/createModal.js +1 -1
  94. package/lib/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
  95. package/lib/src/ap-table/constants.d.ts +77 -77
  96. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  97. package/lib/src/business/ap-attachment/ApAttachment.d.ts +9 -0
  98. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  99. package/lib/src/business/ap-attachment/constans.d.ts +4 -0
  100. package/lib/src/business/ap-attachment/constans.js +1 -1
  101. package/lib/src/business/ap-attachment/index.d.ts +15 -0
  102. package/lib/src/business/ap-attachment/interface.d.ts +1 -0
  103. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  104. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +10 -10
  105. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +10 -10
  106. package/lib/src/business/batch-input-group/form-item.vue.d.ts +2 -2
  107. package/lib/src/business/batch-input-group/index.vue.d.ts +4 -4
  108. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  109. package/lib/src/config-provider/config-provider.d.ts +10 -1
  110. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  111. package/lib/src/config-provider/index.d.ts +16 -1
  112. package/lib/src/utils/config-provider-preset.d.ts +3 -1
  113. package/lib/src/version.d.ts +1 -1
  114. package/lib/src/version.js +1 -1
  115. package/lib/src/work-order-modal/work-order-modal.vue.d.ts +10 -10
  116. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  117. package/package.json +3 -3
  118. package/theme/ag-grid/index.css +3 -0
  119. package/theme/ag-grid/index.less +3 -0
  120. package/theme/ap-attachment/ap-attachment.css +8 -4
  121. package/theme/ap-attachment/ap-attachment.less +8 -4
  122. package/theme/ap-upload/index.css +6 -0
  123. package/theme/ap-upload/multiple-file.css +6 -0
  124. package/theme/ap-upload/multiple-file.less +7 -0
  125. package/theme/index.css +17 -4
@@ -1,113 +1,116 @@
1
- import { defineComponent as H, inject as a, ref as J, watch as K, nextTick as Q, createElementBlock as U, openBlock as h, normalizeClass as X, unref as s, createVNode as k, withCtx as T, createElementVNode as b, createTextVNode as Y, toDisplayString as M, withModifiers as Z, createCommentVNode as ee, createBlock as te, resolveDynamicComponent as oe } 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 L, 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 ae, getName as se, getReturnData as S } from "../utils/returnData.mjs";
4
- import { useOss as ne, getOssInstance as re } from "../hooks/useOss.mjs";
5
- import { message as c, Upload as ie, Button as le } from "@aplus-frontend/antdv";
6
- import { UploadOutlined as ue } from "@ant-design/icons-vue";
7
- import { fileMatchesAccept as ce, getAcceptText as pe } from "../utils/accept.mjs";
8
- import { useLocale as me } from "../../config-provider/hooks/use-locale.mjs";
9
- import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
10
- const fe = { class: "multiple-file-context" }, ge = { key: 0 }, ve = { key: 1 }, Fe = /* @__PURE__ */ H({
3
+ import { getPath as re, getName as le, getReturnData as S } from "../utils/returnData.mjs";
4
+ import { useOss as ie, getOssInstance as z } 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 { useGlobalConfig as ge } from "../../config-provider/hooks/use-global-config.mjs";
9
+ import { useLocale as he } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as ve } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const we = { class: "multiple-file-context" }, xe = { key: 0 }, ye = { key: 1 }, Me = /* @__PURE__ */ Q({
11
12
  __name: "MultipleFile",
12
- setup(he, { expose: L }) {
13
- const { t: r } = me(), { b: C } = de("ap-upload-multiple-file"), { put: z } = ne(), B = a("theme"), I = a("dirName"), x = a("accept") || "*", E = a("maxSize") ?? 500, P = a("title") || r("ap.apUpload.uploadFile"), d = a("subTitle"), i = a("maxCount") ?? 10, p = a("uploadingCount"), _ = a("beforeUpload"), A = a("customRequest"), O = a("getOssAccess"), V = a("maxSizeErrorMsg"), q = a("maxCountErrorMsg"), D = a("acceptErrorMsg"), F = a("onRemove"), w = a("showUploadErrorMsg"), n = a("value"), l = [], f = a("needName"), m = J(null);
14
- K(
13
+ setup(Ce, { expose: B }) {
14
+ const E = ge(
15
+ "downloadCenterTriggerConfig"
16
+ ), { t: r } = he(), { b: N } = ve("ap-upload-multiple-file"), { put: O } = ie(), P = a("theme"), D = a("dirName"), y = a("accept") || "*", _ = a("maxSize") ?? 500, V = 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"), q = a("maxSizeErrorMsg"), j = a("maxCountErrorMsg"), $ = a("acceptErrorMsg"), A = a("onRemove"), C = a("showUploadErrorMsg"), n = a("value"), i = [], f = a("needName"), d = X(null);
17
+ Y(
15
18
  () => n?.value,
16
19
  function(e) {
17
- !m?.value?.fileList?.length && e && N(e);
20
+ !d?.value?.fileList?.length && e && R(e);
18
21
  },
19
22
  { immediate: !0 }
20
23
  );
21
- function N(e) {
24
+ function R(e) {
22
25
  if (!e) {
23
- u = [], m.value.fileList = [], n.value = void 0, l.splice(0, l.length);
26
+ u = [], d.value.fileList = [], n.value = void 0, i.splice(0, i.length);
24
27
  return;
25
28
  }
26
- Q(() => {
27
- const t = e.map((o) => {
28
- const v = ae(f, o), G = se(f, o), y = new File(
29
- [o],
30
- G,
29
+ Z(() => {
30
+ const o = e.map((t) => {
31
+ const h = re(f, t), K = le(f, t), v = new File(
32
+ [t],
33
+ K,
31
34
  {}
32
35
  );
33
- return y.response = v, y.uid = v, y;
36
+ return v.response = h, v.uid = h, v.status = "done", v;
34
37
  });
35
- if (i && t.length > i) {
38
+ if (l && o.length > l) {
36
39
  c.warning(
37
40
  r("ap.apUpload.fileInitializationException", {
38
- maxCount: i
41
+ maxCount: l
39
42
  })
40
43
  );
41
44
  return;
42
45
  }
43
- t.forEach((o) => {
44
- u.push(o), l.push({
45
- uid: o.uid,
46
- path: o.response
46
+ o.forEach((t) => {
47
+ u.push(t), i.push({
48
+ uid: t.uid,
49
+ path: t.response
47
50
  });
48
- }), m.value.fileList = t, n.value = e;
51
+ }), d.value.fileList = o, n.value = e;
49
52
  });
50
53
  }
51
- L({ setValue: N });
52
- let u = [], R;
54
+ B({ setValue: R });
55
+ let u = [], M;
53
56
  function g(e) {
54
57
  setTimeout(() => {
55
- const t = m.value.fileList.findIndex(
56
- (o) => o.uid === e.uid
58
+ const o = d.value.fileList.findIndex(
59
+ (t) => t.uid === e.uid
57
60
  );
58
- t >= 0 && m.value.fileList.splice(t, 1);
61
+ o >= 0 && d.value.fileList.splice(o, 1);
59
62
  });
60
63
  }
61
- async function $(e) {
62
- if (i && i > 1 && u.length >= i)
63
- return clearTimeout(R), R = setTimeout(() => {
64
+ async function G(e) {
65
+ if (l && l > 1 && u.length >= l)
66
+ return clearTimeout(M), M = setTimeout(() => {
64
67
  c.warning(
65
- q || r("ap.apUpload.maxUploadFiles", {
66
- maxCount: i
68
+ j || r("ap.apUpload.maxUploadFiles", {
69
+ maxCount: l
67
70
  })
68
71
  );
69
72
  }), g(e), !1;
70
- if (e.size > E * 1024 * 1024)
73
+ if (e.size > _ * 1024 * 1024)
71
74
  return c.warning(
72
- V || r("ap.apUpload.maxUploadFileSize", {
73
- maxSize: E
75
+ q || r("ap.apUpload.maxUploadFileSize", {
76
+ maxSize: _
74
77
  })
75
78
  ), g(e), !1;
76
- if (!ce(e, x))
79
+ if (!me(e, y))
77
80
  return c.warning(
78
- D || r("ap.apUpload.fileFormatNotSupported")
81
+ $ || r("ap.apUpload.fileFormatNotSupported")
79
82
  ), g(e), !1;
80
- if (typeof _ == "function" && await _(e) === !1)
83
+ if (typeof b == "function" && await b(e) === !1)
81
84
  return g(e), !1;
82
- i && i === 1 && (u = [], n.value = void 0), u.push(e);
85
+ l && l === 1 && (u = [], n.value = void 0), u.push(e);
83
86
  }
84
- async function j(e) {
85
- if (p.value++, typeof A == "function") {
86
- A({
87
- onProgress: (t) => {
87
+ async function W(e) {
88
+ if (p.value++, typeof F == "function") {
89
+ F({
90
+ onProgress: (o) => {
88
91
  setTimeout(() => {
89
92
  e.onProgress({
90
- percent: t
93
+ percent: o
91
94
  });
92
95
  });
93
96
  },
94
- onError: (t) => {
95
- w && c.warning(t || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
97
+ onError: (o) => {
98
+ C && c.warning(o || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
96
99
  e.onError({
97
- name: t,
98
- message: t
100
+ name: o,
101
+ message: o
99
102
  });
100
103
  }), p.value--;
101
104
  },
102
- onSuccess: (t) => {
105
+ onSuccess: (o) => {
103
106
  setTimeout(() => {
104
- e.onSuccess(t);
107
+ e.onSuccess(o);
105
108
  }), n.value = [
106
109
  ...n.value || [],
107
- S(f, t, e.file.name)
108
- ], l.push({
110
+ S(f, o, e.file.name)
111
+ ], i.push({
109
112
  uid: e.file.uid,
110
- path: t
113
+ path: o
111
114
  }), p.value--;
112
115
  },
113
116
  file: e.file
@@ -115,92 +118,112 @@ const fe = { class: "multiple-file-context" }, ge = { key: 0 }, ve = { key: 1 },
115
118
  return;
116
119
  }
117
120
  try {
118
- const t = await re(O);
119
- e.file.oss = t, z({
121
+ const o = await z(T);
122
+ e.file.oss = o, O({
120
123
  file: e.file,
121
- dirName: I,
122
- oss: t,
123
- successCallBack(o) {
124
- e.onSuccess(o), n.value = [
124
+ dirName: D,
125
+ oss: o,
126
+ successCallBack(t) {
127
+ e.onSuccess(t), n.value = [
125
128
  ...n.value || [],
126
- S(f, o, e.file.name)
127
- ], l.push({
129
+ S(f, t, e.file.name)
130
+ ], i.push({
128
131
  uid: e.file.uid,
129
- path: o
132
+ path: t
130
133
  }), p.value--;
131
134
  },
132
- errorCallBack(o) {
133
- w && c.warning(o || r("ap.apUpload.networkAnomaly")), e.onError({
134
- name: o,
135
- message: o
135
+ errorCallBack(t) {
136
+ C && c.warning(t || r("ap.apUpload.networkAnomaly")), e.onError({
137
+ name: t,
138
+ message: t
136
139
  }), p.value--;
137
140
  },
138
- progressCallBack(o) {
141
+ progressCallBack(t) {
139
142
  e.onProgress({
140
- percent: o
143
+ percent: t
141
144
  });
142
145
  }
143
146
  });
144
- } catch (t) {
145
- w && c.warning(
146
- typeof t?.message == "string" ? t.message : r("ap.apUpload.networkAnomaly")
147
+ } catch (o) {
148
+ C && c.warning(
149
+ typeof o?.message == "string" ? o.message : r("ap.apUpload.networkAnomaly")
147
150
  ), e.onError({
148
- name: t?.message || r("ap.apUpload.networkAnomaly"),
149
- message: t?.message || r("ap.apUpload.networkAnomaly")
151
+ name: o?.message || r("ap.apUpload.networkAnomaly"),
152
+ message: o?.message || r("ap.apUpload.networkAnomaly")
150
153
  }), p.value--;
151
154
  }
152
155
  }
153
- function W(e) {
154
- if (F && F?.(e), e.response) {
156
+ function H(e) {
157
+ if (A && A?.(e), e.response) {
155
158
  if (Array.isArray(n.value)) {
156
- const o = l.findIndex((v) => v.uid === e.uid);
157
- o >= 0 && (n?.value.splice(o, 1), l.splice(o, 1)), n.value.length === 0 && (n.value = void 0);
159
+ const t = i.findIndex((h) => h.uid === e.uid);
160
+ t >= 0 && (n?.value.splice(t, 1), i.splice(t, 1)), n.value.length === 0 && (n.value = void 0);
158
161
  }
159
162
  } else
160
163
  e?.oss?.pauseUpload();
161
- const t = u.findIndex(
162
- (o) => o.uid === e.uid
164
+ const o = u.findIndex(
165
+ (t) => t.uid === e.uid
163
166
  );
164
- return u.splice(t, 1), Promise.resolve(!0);
167
+ return u.splice(o, 1), Promise.resolve(!0);
165
168
  }
166
- return (e, t) => (h(), U("div", {
167
- class: X({
168
- [s(C)()]: !0,
169
- [s(C)("admin")]: s(B) === "admin"
169
+ const J = async (e) => {
170
+ if (E.value?.trigger) {
171
+ let o = [e].map((t) => ({
172
+ objectName: t.response,
173
+ fileName: t.name
174
+ }));
175
+ E.value?.trigger?.(o);
176
+ } else
177
+ (await z(T)).downloadFile([
178
+ {
179
+ path: e.response,
180
+ fileName: e.name
181
+ }
182
+ ]);
183
+ };
184
+ return (e, o) => (w(), U("div", {
185
+ class: ee({
186
+ [s(N)()]: !0,
187
+ [s(N)("admin")]: s(P) === "admin"
170
188
  })
171
189
  }, [
172
- k(s(ie), {
190
+ x(s(ue), {
173
191
  ref_key: "uploadRef",
174
- ref: m,
175
- accept: s(x),
192
+ ref: d,
193
+ accept: s(y),
176
194
  multiple: "",
177
- "max-count": s(i),
195
+ "max-count": s(l),
178
196
  progress: {
179
197
  strokeWidth: 3,
180
198
  showInfo: !1,
181
199
  strokeColor: "#0070FF"
182
200
  },
183
- "before-upload": $,
184
- "custom-request": j,
185
- onRemove: W
201
+ "before-upload": G,
202
+ "custom-request": W,
203
+ "show-upload-list": { showDownloadIcon: !0, showRemoveIcon: !0 },
204
+ onRemove: H,
205
+ onDownload: J
186
206
  }, {
187
- default: T(() => [
188
- b("div", fe, [
189
- k(s(le), { class: "file-btn" }, {
190
- default: T(() => [
191
- k(s(ue)),
192
- Y(" " + M(s(P)), 1)
207
+ downloadIcon: k(() => [
208
+ x(s(de))
209
+ ]),
210
+ default: k(() => [
211
+ I("div", we, [
212
+ x(s(ce), { class: "file-btn" }, {
213
+ default: k(() => [
214
+ x(s(pe)),
215
+ oe(" " + L(s(V)), 1)
193
216
  ]),
194
217
  _: 1
195
218
  }),
196
- b("div", {
219
+ I("div", {
197
220
  class: "sub-title",
198
- onClick: t[0] || (t[0] = Z(() => {
221
+ onClick: o[0] || (o[0] = te(() => {
199
222
  }, ["stop"]))
200
223
  }, [
201
- typeof s(d) == "string" ? (h(), U("div", ge, M(s(d) || `${s(r)("ap.apUpload.supportExtension")}:${s(pe)(s(x))}`), 1)) : s(d) ? (h(), U("div", ve, [
202
- (h(), te(oe(s(d))))
203
- ])) : ee("", !0)
224
+ typeof s(m) == "string" ? (w(), U("div", xe, L(s(m) || `${s(r)("ap.apUpload.supportExtension")}:${s(fe)(s(y))}`), 1)) : s(m) ? (w(), U("div", ye, [
225
+ (w(), se(ne(s(m))))
226
+ ])) : ae("", !0)
204
227
  ])
205
228
  ])
206
229
  ]),
@@ -210,5 +233,5 @@ const fe = { class: "multiple-file-context" }, ge = { key: 0 }, ve = { key: 1 },
210
233
  }
211
234
  });
212
235
  export {
213
- Fe as default
236
+ Me as default
214
237
  };
@@ -22,6 +22,10 @@ declare const _default: DefineComponent<ExtractPropTypes<{
22
22
  type: StringConstructor;
23
23
  default: string;
24
24
  };
25
+ maxWidth: {
26
+ type: (NumberConstructor | StringConstructor)[];
27
+ default: string;
28
+ };
25
29
  needName: {
26
30
  type: PropType<{
27
31
  nameKey?: string;
@@ -63,6 +67,10 @@ declare const _default: DefineComponent<ExtractPropTypes<{
63
67
  type: StringConstructor;
64
68
  default: string;
65
69
  };
70
+ maxWidth: {
71
+ type: (NumberConstructor | StringConstructor)[];
72
+ default: string;
73
+ };
66
74
  needName: {
67
75
  type: PropType<{
68
76
  nameKey?: string;
@@ -86,6 +94,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
86
94
  }>> & Readonly<{}>, {
87
95
  size: string;
88
96
  disabled: boolean;
97
+ maxWidth: string | number;
89
98
  needName: {
90
99
  nameKey?: string;
91
100
  pathKey?: string;
@@ -1,52 +1,50 @@
1
- import { defineComponent as M, ref as C, useSlots as U, computed as n, cloneVNode as _, toRaw as f, unref as j, createVNode as t, createTextVNode as K } from "vue";
2
- import { Tooltip as B, Popover as G } from "@aplus-frontend/antdv";
1
+ import { defineComponent as M, ref as p, useSlots as S, computed as o, cloneVNode as U, toRaw as f, unref as W, createVNode as t, createTextVNode as _ } from "vue";
2
+ import { Tooltip as j, Popover as K } from "@aplus-frontend/antdv";
3
3
  import "../../config-provider/index.mjs";
4
- import { ApAttachmentProps as H } from "./constans.mjs";
5
- import { getHexWithOpacity as R, getFileInfo as w } from "../../ap-download/utils/getFileInfo.mjs";
6
- import { useOssInit as W } from "../../ap-download/hooks/index.mjs";
7
- import { debounce as q, isArray as D } from "lodash-unified";
4
+ import { ApAttachmentProps as B } from "./constans.mjs";
5
+ import { getHexWithOpacity as G, getFileInfo as w } from "../../ap-download/utils/getFileInfo.mjs";
6
+ import { useOssInit as H } from "../../ap-download/hooks/index.mjs";
7
+ import { debounce as R, isArray as q } from "lodash-unified";
8
8
  import { LoadingOutlined as v } from "@ant-design/icons-vue";
9
- import { warning as E } from "../../utils/warning.mjs";
10
- import { useNamespace as J } from "../../config-provider/hooks/use-namespace.mjs";
9
+ import { warning as D } from "../../utils/warning.mjs";
10
+ import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
11
11
  import { useGlobalConfig as g } from "../../config-provider/hooks/use-global-config.mjs";
12
- import { useLocale as Q } from "../../config-provider/hooks/use-locale.mjs";
13
- const se = /* @__PURE__ */ M({
12
+ import { useLocale as J } from "../../config-provider/hooks/use-locale.mjs";
13
+ const ce = /* @__PURE__ */ M({
14
14
  name: "ApAttachment",
15
- props: H(),
15
+ props: B(),
16
16
  setup(e) {
17
17
  const {
18
18
  b: y,
19
19
  e: l
20
- } = J("ap-attachment"), F = g("uiMode"), b = g("apUpload"), h = g("downloadCenterTriggerConfig"), {
21
- lang: O,
22
- t: r
23
- } = Q(), i = C(!1), c = C(""), m = U(), T = n(() => O.value === "zh-cn" ? "zh_CN" : "en_US"), u = n(() => e.attachmentList.length === 1), p = n(() => e.needName ? e.attachmentList.length > 0 && e.needName && e.needName.nameKey ? e.attachmentList[0][e.needName.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), x = n(() => u.value ? p.value : r("ap.apAttachment.downloadall")), N = n(() => e.color ? e.color : F.value === "aplus" ? "#0070FF" : "#1890FF"), P = n(() => ({
24
- width: u.value ? "auto" : "266px"
25
- })), A = n(() => ({
26
- "--download-main-color": N.value,
27
- "--download-main-color-opacity": R(N.value, 0.6)
28
- })), k = n(() => e.getOssAccess || b.value?.getOssAccess), S = n(() => {
29
- const a = m.default ? m.default()[0] : null;
30
- return a ? _(a, {
20
+ } = E("ap-attachment"), F = g("uiMode"), b = g("apUpload"), h = g("downloadCenterTriggerConfig"), {
21
+ lang: x,
22
+ t: m
23
+ } = J(), i = p(!1), c = p(""), u = S(), O = o(() => x.value === "zh-cn" ? "zh_CN" : "en_US"), r = o(() => e.attachmentList.length === 1), N = o(() => e.needName ? e.attachmentList.length > 0 && e.needName && e.needName.nameKey ? e.attachmentList[0][e.needName.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), T = o(() => r.value ? N.value : m("ap.apAttachment.downloadall")), L = o(() => e.color ? e.color : F.value === "aplus" ? "#0070FF" : "#1890FF"), A = o(() => ({
24
+ "--download-main-color": L.value,
25
+ "--download-main-color-opacity": G(L.value, 0.6)
26
+ })), P = o(() => e.getOssAccess || b.value?.getOssAccess), k = o(() => {
27
+ const a = u.default ? u.default()[0] : null;
28
+ return a ? U(a, {
31
29
  style: {
32
30
  "font-size": "16px"
33
31
  }
34
32
  }) : null;
35
- }), d = q(async (a, s) => {
33
+ }), d = R(async (a, s) => {
36
34
  if (!e.disabled) {
37
35
  i.value = !0, s && (c.value = s);
38
36
  try {
39
- const o = D(f(a)) ? f(a) : [f(a)];
37
+ const n = q(f(a)) ? f(a) : [f(a)];
40
38
  if (h.value?.trigger) {
41
- const I = w(e.needName, o).map((L) => ({
42
- objectName: L.path,
43
- fileName: L.fileName
39
+ const I = w(e.needName, n).map((C) => ({
40
+ objectName: C.path,
41
+ fileName: C.fileName
44
42
  }));
45
43
  h.value?.trigger(I);
46
44
  } else
47
- await (await W(k.value, j(T))).downloadFile(w(e.needName, o));
48
- } catch (o) {
49
- E(!1, o);
45
+ await (await H(P.value, W(O))).downloadFile(w(e.needName, n));
46
+ } catch (n) {
47
+ D(!1, n);
50
48
  } finally {
51
49
  i.value = !1, c.value = "";
52
50
  }
@@ -54,11 +52,11 @@ const se = /* @__PURE__ */ M({
54
52
  }, 500), V = (a) => a && a.length > 0 ? t("ul", {
55
53
  class: [l("file-list")],
56
54
  style: A.value
57
- }, [a.map((s, o) => t("li", {
58
- key: o,
55
+ }, [a.map((s, n) => t("li", {
56
+ key: n,
59
57
  class: [l("file-item")],
60
- onClick: () => d(s, o + 1)
61
- }, [i.value && c.value === o + 1 ? t("span", {
58
+ onClick: () => d(s, n + 1)
59
+ }, [i.value && c.value === n + 1 ? t("span", {
62
60
  class: [l("spin")]
63
61
  }, [t(v, {
64
62
  spin: !0
@@ -69,38 +67,41 @@ const se = /* @__PURE__ */ M({
69
67
  class: [l("spin")]
70
68
  }, [t(v, {
71
69
  spin: !0
72
- }, null)]) : null, r("ap.apAttachment.downloadall")])]) : null;
70
+ }, null)]) : null, m("ap.apAttachment.downloadall")])]) : null;
73
71
  return () => e.attachmentList?.length > 0 && t("div", {
74
72
  class: [y()],
75
- style: [P.value, A.value]
76
- }, [t(B, {
77
- title: x.value,
73
+ style: [A.value]
74
+ }, [t(j, {
75
+ title: T.value,
78
76
  placement: e.textToolTipPlacement,
79
77
  color: e.toolTipBgColor
80
78
  }, {
81
79
  default: () => [t("div", {
82
80
  class: [l("content")],
83
- onClick: () => d(u.value ? e.attachmentList[0] : e.attachmentList, "global")
81
+ onClick: () => d(r.value ? e.attachmentList[0] : e.attachmentList, "global")
84
82
  }, [i.value && c.value === "global" ? t("div", {
85
83
  class: [l("spin")]
86
84
  }, [t(v, {
87
85
  spin: !0
88
- }, null)]) : null, m.default ? t("div", {
86
+ }, null)]) : null, u.default ? t("div", {
89
87
  class: [l("text-render")]
90
- }, [S.value, K(" ")]) : null, t("div", {
91
- class: [l("text-inner")]
92
- }, [p.value])])]
93
- }), t(G, {
88
+ }, [k.value, _(" ")]) : null, t("div", {
89
+ class: [l("text-inner")],
90
+ style: {
91
+ "max-width": e.maxWidth ? e.maxWidth + "px" : "auto"
92
+ }
93
+ }, [N.value])])]
94
+ }), t(K, {
94
95
  content: V(e.attachmentList),
95
96
  placement: e.fileMorePopoverPlacement,
96
97
  color: "#fff"
97
98
  }, {
98
- default: () => [!u.value && t("div", {
99
+ default: () => [!r.value && t("div", {
99
100
  class: [l("more")]
100
- }, [r("ap.apAttachment.more")])]
101
+ }, [m("ap.apAttachment.more")])]
101
102
  })]);
102
103
  }
103
104
  });
104
105
  export {
105
- se as default
106
+ ce as default
106
107
  };
@@ -21,6 +21,10 @@ export declare const ApAttachmentProps: () => {
21
21
  type: StringConstructor;
22
22
  default: string;
23
23
  };
24
+ maxWidth: {
25
+ type: (NumberConstructor | StringConstructor)[];
26
+ default: string;
27
+ };
24
28
  needName: {
25
29
  type: PropType<{
26
30
  nameKey?: string;
@@ -19,6 +19,10 @@ const e = () => ({
19
19
  type: String,
20
20
  default: "middle"
21
21
  },
22
+ maxWidth: {
23
+ type: [Number, String],
24
+ default: "auto"
25
+ },
22
26
  needName: {
23
27
  type: Object,
24
28
  default: () => ({
@@ -24,6 +24,10 @@ declare const ApAttachment: {
24
24
  type: StringConstructor;
25
25
  default: string;
26
26
  };
27
+ maxWidth: {
28
+ type: (NumberConstructor | StringConstructor)[];
29
+ default: string;
30
+ };
27
31
  needName: {
28
32
  type: PropType<{
29
33
  nameKey?: string;
@@ -47,6 +51,7 @@ declare const ApAttachment: {
47
51
  }>> & Readonly<{}>, () => false | import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
48
52
  size: string;
49
53
  disabled: boolean;
54
+ maxWidth: string | number;
50
55
  needName: {
51
56
  nameKey?: string;
52
57
  pathKey?: string;
@@ -82,6 +87,10 @@ declare const ApAttachment: {
82
87
  type: StringConstructor;
83
88
  default: string;
84
89
  };
90
+ maxWidth: {
91
+ type: (NumberConstructor | StringConstructor)[];
92
+ default: string;
93
+ };
85
94
  needName: {
86
95
  type: PropType<{
87
96
  nameKey?: string;
@@ -105,6 +114,7 @@ declare const ApAttachment: {
105
114
  }>> & Readonly<{}>, () => false | import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
106
115
  size: string;
107
116
  disabled: boolean;
117
+ maxWidth: string | number;
108
118
  needName: {
109
119
  nameKey?: string;
110
120
  pathKey?: string;
@@ -137,6 +147,10 @@ declare const ApAttachment: {
137
147
  type: StringConstructor;
138
148
  default: string;
139
149
  };
150
+ maxWidth: {
151
+ type: (NumberConstructor | StringConstructor)[];
152
+ default: string;
153
+ };
140
154
  needName: {
141
155
  type: PropType<{
142
156
  nameKey?: string;
@@ -160,6 +174,7 @@ declare const ApAttachment: {
160
174
  }>> & Readonly<{}>, () => false | import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
161
175
  size: string;
162
176
  disabled: boolean;
177
+ maxWidth: string | number;
163
178
  needName: {
164
179
  nameKey?: string;
165
180
  pathKey?: string;
@@ -10,4 +10,5 @@ export type ApAttachmentProps = Required<{
10
10
  textToolTipPlacement?: TooltipPlacement;
11
11
  fileMorePopoverPlacement?: TooltipPlacement;
12
12
  toolTipBgColor?: string;
13
+ maxWidth?: number;
13
14
  } & Pick<ApDownLoadProps, 'color' | 'size' | 'needName' | 'disabled'>> & Pick<ApDownLoadProps, 'getOssAccess'>;