@aplus-frontend/ui 0.0.28 → 0.0.29

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 (69) hide show
  1. package/es/src/ap-download/hooks/index.mjs +4 -3
  2. package/es/src/ap-download/interface.d.ts +2 -2
  3. package/es/src/ap-field/date/helper.mjs +5 -5
  4. package/es/src/ap-field/date-range/index.vue.mjs +15 -15
  5. package/es/src/ap-form/ap-form-list.vue.mjs +29 -21
  6. package/es/src/ap-form/ap-form.vue2.mjs +77 -77
  7. package/es/src/ap-form/interface.d.ts +4 -0
  8. package/es/src/ap-form/search-form/index.vue.mjs +123 -99
  9. package/es/src/ap-table/hooks/use-table-paging.mjs +23 -21
  10. package/es/src/ap-upload/apUpload.vue.d.ts +3 -11
  11. package/es/src/ap-upload/apUpload.vue.mjs +42 -36
  12. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +115 -102
  13. package/es/src/ap-upload/components/Picture.vue2.mjs +121 -111
  14. package/es/src/ap-upload/components/SingleFile.vue2.mjs +120 -109
  15. package/es/src/ap-upload/hooks/useOss.d.ts +9 -4
  16. package/es/src/ap-upload/hooks/useOss.mjs +52 -34
  17. package/es/src/ap-upload/utils/accept.d.ts +3 -0
  18. package/es/src/ap-upload/utils/accept.mjs +35 -30
  19. package/es/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  20. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +7 -6
  21. package/es/src/business/ap-status/interface.d.ts +4 -1
  22. package/es/src/business/index.d.ts +41 -8
  23. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  24. package/es/src/config-provider/config-provider-props.mjs +4 -0
  25. package/es/src/config-provider/config-provider.d.ts +10 -1
  26. package/es/src/config-provider/config-provider.mjs +9 -8
  27. package/es/src/config-provider/constants.d.ts +10 -0
  28. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  29. package/es/src/config-provider/index.d.ts +20 -1
  30. package/es/src/locale/lang/en.mjs +24 -0
  31. package/es/src/locale/lang/zh-cn.mjs +24 -0
  32. package/es/src/work-order-modal/createWorkOrder.d.ts +3 -1
  33. package/es/src/work-order-modal/interfaces.d.ts +3 -1
  34. package/es/src/work-order-modal/work-order-modal.vue.mjs +7 -7
  35. package/lib/src/ap-download/hooks/index.js +1 -1
  36. package/lib/src/ap-download/interface.d.ts +2 -2
  37. package/lib/src/ap-field/date/helper.js +1 -1
  38. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  39. package/lib/src/ap-form/ap-form-list.vue.js +1 -1
  40. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  41. package/lib/src/ap-form/interface.d.ts +4 -0
  42. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  43. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  44. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -11
  45. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  46. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  47. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  48. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  49. package/lib/src/ap-upload/hooks/useOss.d.ts +9 -4
  50. package/lib/src/ap-upload/hooks/useOss.js +1 -1
  51. package/lib/src/ap-upload/utils/accept.d.ts +3 -0
  52. package/lib/src/ap-upload/utils/accept.js +1 -1
  53. package/lib/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  54. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  55. package/lib/src/business/ap-status/interface.d.ts +4 -1
  56. package/lib/src/business/index.d.ts +41 -8
  57. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  58. package/lib/src/config-provider/config-provider-props.js +1 -1
  59. package/lib/src/config-provider/config-provider.d.ts +10 -1
  60. package/lib/src/config-provider/config-provider.js +1 -1
  61. package/lib/src/config-provider/constants.d.ts +10 -0
  62. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  63. package/lib/src/config-provider/index.d.ts +20 -1
  64. package/lib/src/locale/lang/en.js +1 -1
  65. package/lib/src/locale/lang/zh-cn.js +1 -1
  66. package/lib/src/work-order-modal/createWorkOrder.d.ts +3 -1
  67. package/lib/src/work-order-modal/interfaces.d.ts +3 -1
  68. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  69. package/package.json +1 -1
@@ -1,24 +1,23 @@
1
- import { isVNode as J, defineComponent as K, useSlots as Q, ref as X, unref as o, shallowRef as P, computed as C, watch as k, cloneVNode as Y, createVNode as a, Fragment as Z, openBlock as A, createBlock as E, mergeProps as ee, withCtx as N, resolveDynamicComponent as te } from "vue";
2
- import { Flex as T, Space as oe, Button as y } from "ant-design-vue";
1
+ import { isVNode as ee, defineComponent as te, useSlots as ae, ref as oe, unref as t, shallowRef as j, computed as C, watch as I, cloneVNode as le, createVNode as l, Fragment as S, openBlock as c, createBlock as h, mergeProps as ne, withCtx as R, resolveDynamicComponent as F, createElementBlock as re, renderList as se } from "vue";
2
+ import { Col as B, Flex as D, Space as ue, Button as b, Row as pe } from "ant-design-vue";
3
3
  import "../ap-form.vue.mjs";
4
- import "../ap-form-item-group/index.vue2.mjs";
5
4
  import "../ap-form-item.vue2.mjs";
6
5
  import "../../hooks/index.mjs";
7
- import { genRealChildren as V } from "../ap-form-item-group/helper.mjs";
8
- import { DoubleRightOutlined as ae } from "@ant-design/icons-vue";
6
+ import { genRealChildren as O } from "../ap-form-item-group/helper.mjs";
7
+ import { DoubleRightOutlined as ie } from "@ant-design/icons-vue";
9
8
  import "../../config-provider/index.mjs";
10
9
  import "../style/search-form.css";
11
- import { omit as le } from "lodash-unified";
12
- import { useControllableValue as ne } from "../../hooks/useControllableValue.mjs";
13
- import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useLocale as se } from "../../config-provider/hooks/use-locale.mjs";
15
- import I from "../ap-form-item.vue.mjs";
16
- import pe from "../ap-form.vue2.mjs";
17
- import ce from "../ap-form-item-group/index.vue.mjs";
18
- function ie(i) {
19
- return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !J(i);
10
+ import { isArray as ce, omit as de } from "lodash-unified";
11
+ import { isDef as fe } from "../../utils/index.mjs";
12
+ import { useControllableValue as me } from "../../hooks/useControllableValue.mjs";
13
+ import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
14
+ import { useLocale as xe } from "../../config-provider/hooks/use-locale.mjs";
15
+ import L from "../ap-form-item.vue.mjs";
16
+ import Ce from "../ap-form.vue2.mjs";
17
+ function ge(d) {
18
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !ee(d);
20
19
  }
21
- const s = 24, Pe = /* @__PURE__ */ K({
20
+ const p = 24, Ie = /* @__PURE__ */ te({
22
21
  name: "ApFormSearchForm",
23
22
  __name: "index",
24
23
  props: {
@@ -97,113 +96,138 @@ const s = 24, Pe = /* @__PURE__ */ K({
97
96
  }
98
97
  },
99
98
  emits: ["update:collapse"],
100
- setup(i, {
101
- expose: j,
102
- emit: M
99
+ setup(d, {
100
+ expose: M,
101
+ emit: $
103
102
  }) {
104
- var S;
105
- const l = Q(), t = i, O = M, {
106
- value: u,
107
- updateValue: $
108
- } = ne(t, O, {
103
+ var N;
104
+ const r = ae(), a = d, q = $, {
105
+ value: f,
106
+ updateValue: z
107
+ } = me(a, q, {
109
108
  valuePropName: "collapse",
110
109
  defaultValuePropName: "defaultCollapse"
111
110
  }), {
112
- b: D
113
- } = re("ap-form-search-form"), {
114
- t: g
115
- } = se(), m = X();
116
- function L() {
117
- $(!o(u));
111
+ b: U
112
+ } = he("ap-form-search-form"), {
113
+ t: v
114
+ } = xe(), x = oe();
115
+ function W() {
116
+ z(!t(f));
118
117
  }
119
- function q() {
120
- var e, n;
121
- (n = (e = m.value) == null ? void 0 : e.validateFields()) == null || n.then(t.onSubmit);
118
+ function G() {
119
+ var e, o;
120
+ (o = (e = x.value) == null ? void 0 : e.validateFields()) == null || o.then(a.onSubmit);
122
121
  }
123
- function z() {
124
- var e, n, f;
125
- t.customReset || (n = (e = m.value) == null ? void 0 : e.resetFields) == null || n.call(e), (f = t.onReset) == null || f.call(t);
122
+ function H() {
123
+ var e, o, n;
124
+ a.customReset || (o = (e = x.value) == null ? void 0 : e.resetFields) == null || o.call(e), (n = a.onReset) == null || n.call(a);
126
125
  }
127
- const R = P(V(l.default())), d = P((S = l.extra) == null ? void 0 : S.call(l)), F = C(() => Math.floor(s / t.countPerRow));
128
- k(() => l.default(), (e) => {
129
- R.value = V(e);
130
- }), k(() => {
126
+ const w = j(O(r.default())), m = j((N = r.extra) == null ? void 0 : N.call(r)), E = C(() => Math.floor(p / a.countPerRow));
127
+ I(() => r.default(), (e) => {
128
+ w.value = O(e);
129
+ }), I(() => {
131
130
  var e;
132
- return (e = l.extra) == null ? void 0 : e.call(l);
131
+ return (e = r.extra) == null ? void 0 : e.call(r);
133
132
  }, (e) => {
134
- d.value = e;
133
+ m.value = e;
135
134
  });
136
- const U = C(() => {
137
- let e;
138
- const n = [...o(R)], f = [], b = [], r = o(F);
139
- let h = 0;
140
- n.forEach((p) => {
141
- const c = p.props;
142
- c != null && c.hidden ? f.push(p) : (h += c.span || r, b.push(p));
135
+ const J = (e) => fe(e) ? (ce(e) ? e : [e]).join("") : Date.now(), g = C(() => {
136
+ const e = [...t(w)], o = [], n = [], s = t(E);
137
+ let y = 0;
138
+ e.forEach((u) => {
139
+ const i = u.props;
140
+ i != null && i.hidden ? o.push(u) : (y += i.span || s, n.push(u));
143
141
  });
144
- const B = s - (h + r) % s, w = B < r ? s : B, x = s - r * (o(d) && !t.extraInAction ? 2 : 1), W = !t.forceExpand && h > x;
145
- let _ = 0;
146
- const G = b.map((p, c) => {
147
- const v = p.props;
148
- return _ += v.span || r, Y(p, {
149
- span: v.span || r,
150
- key: `ApFormSearchFormItem-${c}-${Date.now()}`,
151
- hidden: !t.forceExpand && o(u) && _ > x
152
- });
153
- }), H = s - Math.min(x, _) - r;
154
- return a(Z, null, [G, f, a(I, {
155
- span: o(F)
142
+ const k = p - (y + s) % p, Q = k < s ? p : k, A = p - s * (t(m) && !a.extraInAction ? 2 : 1), X = !a.forceExpand && y > A;
143
+ let P = 0, T = 0;
144
+ const Y = n.map((u, i) => {
145
+ const _ = u.props, V = _.span || s;
146
+ if (P += V, !a.forceExpand && t(f) && P > A) {
147
+ o.push(le(u, {
148
+ hidden: !0
149
+ }));
150
+ return;
151
+ }
152
+ return T += V, {
153
+ node: u,
154
+ span: _.span || s,
155
+ key: `ApFormSearchFormItem-${i}-${J(_.name)}`
156
+ };
157
+ }).filter(Boolean), Z = p - T - s;
158
+ return {
159
+ hideNode: l(S, null, [o]),
160
+ nodes: Y,
161
+ defaultExtraSpan: Q,
162
+ actualExtraSpan: Z,
163
+ showCollapse: X
164
+ };
165
+ }), K = C(() => {
166
+ let e;
167
+ const o = t(g);
168
+ return l(S, null, [l(B, {
169
+ span: t(t(E))
156
170
  }, {
157
- default: () => [a(T, {
158
- justify: "space-between"
159
- }, {
160
- default: () => [a(oe, null, {
161
- default: () => [a(y, {
162
- type: "primary",
163
- onClick: q,
164
- loading: t.submitLoading
165
- }, {
166
- default: () => [t.searchText || g("ap.apForm.search.search")]
167
- }), a(y, {
168
- onClick: z
169
- }, {
170
- default: () => [t.resetText || g("ap.apForm.search.reset")]
171
- }), W ? a(y, {
172
- onClick: L,
173
- icon: a(ae, {
174
- style: "color:#B8C3D1",
175
- rotate: o(u) ? 90 : -90
176
- }, null)
177
- }, null) : null]
178
- }), t.extraInAction ? o(d) : null]
171
+ default: () => [l(L, null, {
172
+ default: () => [l(D, {
173
+ justify: "space-between"
174
+ }, {
175
+ default: () => [l(ue, null, {
176
+ default: () => [l(b, {
177
+ type: "primary",
178
+ onClick: G,
179
+ loading: a.submitLoading
180
+ }, {
181
+ default: () => [a.searchText || v("ap.apForm.search.search")]
182
+ }), l(b, {
183
+ onClick: H
184
+ }, {
185
+ default: () => [a.resetText || v("ap.apForm.search.reset")]
186
+ }), o.showCollapse ? l(b, {
187
+ onClick: W,
188
+ icon: l(ie, {
189
+ style: "color:#B8C3D1",
190
+ rotate: t(f) ? 90 : -90
191
+ }, null)
192
+ }, null) : null]
193
+ }), a.extraInAction ? t(m) : null]
194
+ })]
179
195
  })]
180
- }), !t.extraInAction && o(d) ? a(I, {
181
- span: o(u) ? H : w
196
+ }), !a.extraInAction && t(m) ? l(B, {
197
+ span: t(f) ? o.actualExtraSpan : o.defaultExtraSpan
182
198
  }, {
183
- default: () => [a(T, {
184
- justify: !o(u) && w === s ? "start" : "end"
185
- }, ie(e = o(d)) ? e : {
186
- default: () => [e]
199
+ default: () => [l(L, null, {
200
+ default: () => [l(D, {
201
+ justify: !t(f) && o.defaultExtraSpan === p ? "start" : "end"
202
+ }, ge(e = t(m)) ? e : {
203
+ default: () => [e]
204
+ })]
187
205
  })]
188
206
  }) : null]);
189
207
  });
190
- return j({
191
- apForm: C(() => o(m))
192
- }), (e, n) => (A(), E(pe, ee({
193
- class: o(D)(),
208
+ return M({
209
+ apForm: C(() => t(x))
210
+ }), (e, o) => (c(), h(Ce, ne({
211
+ class: t(U)(),
194
212
  ref_key: "apForm",
195
- ref: m
196
- }, o(le)(t, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
197
- default: N(() => [a(ce, {
198
- "count-per-row": t.countPerRow
213
+ ref: x
214
+ }, t(de)(a, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
215
+ default: R(() => [(c(), h(F(g.value.hideNode))), l(t(pe), {
216
+ gutter: 16
199
217
  }, {
200
- default: N(() => [(A(), E(te(U.value)))]),
218
+ default: R(() => [(c(!0), re(S, null, se(g.value.nodes, (n) => (c(), h(t(B), {
219
+ key: n.key,
220
+ span: n.span
221
+ }, {
222
+ default: R(() => [(c(), h(F(n.node)))]),
223
+ _: 2
224
+ }, 1032, ["span"]))), 128)), (c(), h(F(K.value)))]),
201
225
  _: 1
202
- }, 8, ["count-per-row"])]),
226
+ })]),
203
227
  _: 1
204
228
  }, 16, ["class"]));
205
229
  }
206
230
  });
207
231
  export {
208
- Pe as default
232
+ Ie as default
209
233
  };
@@ -1,10 +1,10 @@
1
- import { ref as v, unref as r, onMounted as N, computed as j } from "vue";
2
- import { parseFieldValue as U, dataIndexToStr as W } from "../utils.mjs";
3
- import { isArray as X } from "lodash-unified";
1
+ import { ref as v, nextTick as N, unref as r, onMounted as U, computed as $ } from "vue";
2
+ import { parseFieldValue as W, dataIndexToStr as X } from "../utils.mjs";
3
+ import { isArray as Y } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
- import { useLocale as Y } from "../../config-provider/hooks/use-locale.mjs";
6
- const ae = ({
7
- manual: x = !1,
5
+ import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
6
+ const oe = ({
7
+ manual: j = !1,
8
8
  defaultCurrent: y = 1,
9
9
  defaultPageSize: S = 10,
10
10
  request: D,
@@ -17,7 +17,7 @@ const ae = ({
17
17
  sortFields: E = []
18
18
  }) => {
19
19
  let F = 0, f = {};
20
- const L = (e) => T ? T(e) : e, l = v(), i = v(y), g = v(S), { t: V } = Y(), n = v({
20
+ const L = (e) => T ? T(e) : e, l = v(), i = v(y), g = v(S), { t: V } = Z(), n = v({
21
21
  total: 0,
22
22
  records: A,
23
23
  loading: !1
@@ -41,15 +41,17 @@ const ae = ({
41
41
  return Object.entries(e).forEach(([t, o]) => {
42
42
  if (a[t] = o, z && o) {
43
43
  const s = z[t];
44
- s && (a[t] = U(s, o));
44
+ s && (a[t] = W(s, o));
45
45
  }
46
46
  }), a;
47
47
  }, M = (e) => {
48
48
  var o, s, d, p, m, u, c;
49
49
  const a = ((s = (o = l.value) == null ? void 0 : o.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
50
- Object.entries(a).forEach(([$, K]) => {
51
- P && P.indexOf($) > -1 && (t[$] = K);
52
- }), (p = (d = l.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (c = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || c.call(u, t), e == null || e();
50
+ Object.entries(a).forEach(([O, K]) => {
51
+ P && P.indexOf(O) > -1 && (t[O] = K);
52
+ }), (p = (d = l.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (c = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || c.call(u, t), N(() => {
53
+ e == null || e();
54
+ });
53
55
  }, h = (e) => {
54
56
  f = e;
55
57
  const a = w(e);
@@ -76,13 +78,13 @@ const ae = ({
76
78
  q({
77
79
  current: o > 0 ? o : 1
78
80
  });
79
- }, O = (e, a, t) => {
81
+ }, x = (e, a, t) => {
80
82
  var m, u;
81
83
  const o = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
82
84
  i.value = e.current, g.value = e.pageSize;
83
- const s = X(t) ? [...t] : [t], d = {};
85
+ const s = Y(t) ? [...t] : [t], d = {};
84
86
  for (const c of s)
85
- E.includes(c.field) && (d[W(c.field)] = c.order);
87
+ E.includes(c.field) && (d[X(c.field)] = c.order);
86
88
  const p = {};
87
89
  for (const c of Object.keys(a))
88
90
  B.includes(c) && (p[c] = a[c]);
@@ -94,21 +96,21 @@ const ae = ({
94
96
  pageSize: e.pageSize
95
97
  });
96
98
  };
97
- N(() => {
99
+ U(() => {
98
100
  var a, t;
99
101
  const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
100
102
  if (f = {
101
103
  current: r(i),
102
104
  pageSize: r(g),
103
105
  ...e
104
- }, !x) {
106
+ }, !j) {
105
107
  const o = w(f);
106
108
  b(o);
107
109
  }
108
110
  });
109
- const H = j(() => r(n).total === 0 ? "-" : `${r(i.value)}/${Math.ceil(
111
+ const H = $(() => r(n).total === 0 ? "-" : `${r(i.value)}/${Math.ceil(
110
112
  r(n).total / r(g)
111
- )}`), I = j(() => ({
113
+ )}`), I = $(() => ({
112
114
  loading: r(n).loading,
113
115
  pagination: {
114
116
  current: r(i),
@@ -121,7 +123,7 @@ const ae = ({
121
123
  { page: r(H) }
122
124
  )}`
123
125
  },
124
- onChange: O,
126
+ onChange: x,
125
127
  dataSource: r(n).records
126
128
  }));
127
129
  return {
@@ -133,10 +135,10 @@ const ae = ({
133
135
  data: n,
134
136
  current: i,
135
137
  pageSize: g,
136
- handleTableChange: O,
138
+ handleTableChange: x,
137
139
  tableProps: I
138
140
  };
139
141
  };
140
142
  export {
141
- ae as useTablePaging
143
+ oe as useTablePaging
142
144
  };
@@ -1,11 +1,11 @@
1
1
  import { PropType, VNode, DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ExtractPropTypes, RendererNode, RendererElement } from 'vue';
2
2
  import { FileUploadType, BeforeUpload, CustomRequest } from './apUploadTypes';
3
+ import { accessCreate } from '@aplus-frontend/oss';
3
4
 
4
5
  declare function clear(): void;
5
6
  declare const _default: DefineComponent<{
6
7
  dirName: {
7
8
  type: StringConstructor;
8
- default: string;
9
9
  };
10
10
  type: {
11
11
  type: PropType<FileUploadType>;
@@ -17,11 +17,9 @@ declare const _default: DefineComponent<{
17
17
  };
18
18
  needName: {
19
19
  type: (BooleanConstructor | ObjectConstructor)[];
20
- default: boolean;
21
20
  };
22
21
  accept: {
23
22
  type: StringConstructor;
24
- default: string;
25
23
  };
26
24
  maxSize: {
27
25
  type: NumberConstructor;
@@ -44,7 +42,7 @@ declare const _default: DefineComponent<{
44
42
  type: PropType<CustomRequest>;
45
43
  };
46
44
  getOssAccess: {
47
- type: FunctionConstructor;
45
+ type: PropType<() => Promise< accessCreate>>;
48
46
  };
49
47
  }, {
50
48
  done: ComputedRef<boolean>;
@@ -54,7 +52,6 @@ declare const _default: DefineComponent<{
54
52
  }, string, PublicProps, Readonly< ExtractPropTypes<{
55
53
  dirName: {
56
54
  type: StringConstructor;
57
- default: string;
58
55
  };
59
56
  type: {
60
57
  type: PropType<FileUploadType>;
@@ -66,11 +63,9 @@ declare const _default: DefineComponent<{
66
63
  };
67
64
  needName: {
68
65
  type: (BooleanConstructor | ObjectConstructor)[];
69
- default: boolean;
70
66
  };
71
67
  accept: {
72
68
  type: StringConstructor;
73
- default: string;
74
69
  };
75
70
  maxSize: {
76
71
  type: NumberConstructor;
@@ -93,7 +88,7 @@ declare const _default: DefineComponent<{
93
88
  type: PropType<CustomRequest>;
94
89
  };
95
90
  getOssAccess: {
96
- type: FunctionConstructor;
91
+ type: PropType<() => Promise< accessCreate>>;
97
92
  };
98
93
  }>> & {
99
94
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
@@ -101,11 +96,8 @@ declare const _default: DefineComponent<{
101
96
  type: FileUploadType;
102
97
  title: string;
103
98
  value: string | unknown[] | Record<string, any>;
104
- accept: string;
105
- dirName: string;
106
99
  subTitle: string | VNode< RendererNode, RendererElement, {
107
100
  [key: string]: any;
108
101
  }>;
109
- needName: boolean | Record<string, any>;
110
102
  }, {}>;
111
103
  export default _default;
@@ -1,21 +1,23 @@
1
- import { defineComponent as b, computed as r, provide as e, ref as u, openBlock as i, createElementBlock as _, normalizeClass as C, unref as N, createBlock as S, resolveDynamicComponent as x, normalizeProps as F, mergeProps as O, createCommentVNode as z } from "vue";
1
+ import { defineComponent as F, computed as c, provide as e, ref as u, openBlock as d, createElementBlock as U, normalizeClass as T, unref as j, createBlock as z, resolveDynamicComponent as h, normalizeProps as k, mergeProps as B, createCommentVNode as $ } from "vue";
2
2
  import "../config-provider/index.mjs";
3
3
  import "./components/SingleFile.vue.mjs";
4
4
  import "./components/MultipleFile.vue.mjs";
5
5
  import "./components/Picture.vue.mjs";
6
6
  import "./styles/upload.css";
7
- import { useNamespace as A } from "../config-provider/hooks/use-namespace.mjs";
8
- import U from "./components/SingleFile.vue2.mjs";
9
- import h from "./components/MultipleFile.vue2.mjs";
10
- import k from "./components/Picture.vue2.mjs";
11
- import { useGlobalConfig as B } from "../config-provider/hooks/use-global-config.mjs";
12
- const H = /* @__PURE__ */ b({
7
+ import { injectLocaleToAccept as q } from "./utils/accept.mjs";
8
+ import { injectLocaleToOss as L } from "./hooks/useOss.mjs";
9
+ import { useLocale as R } from "../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as M } from "../config-provider/hooks/use-namespace.mjs";
11
+ import P from "./components/SingleFile.vue2.mjs";
12
+ import w from "./components/MultipleFile.vue2.mjs";
13
+ import D from "./components/Picture.vue2.mjs";
14
+ import { useGlobalConfig as f } from "../config-provider/hooks/use-global-config.mjs";
15
+ const ae = /* @__PURE__ */ F({
13
16
  name: "AplusFileUpload",
14
17
  __name: "apUpload",
15
18
  props: {
16
19
  dirName: {
17
- type: String,
18
- default: "FileDemo"
20
+ type: String
19
21
  },
20
22
  type: {
21
23
  type: String,
@@ -26,12 +28,10 @@ const H = /* @__PURE__ */ b({
26
28
  default: void 0
27
29
  },
28
30
  needName: {
29
- type: [Boolean, Object],
30
- default: !1
31
+ type: [Boolean, Object]
31
32
  },
32
33
  accept: {
33
- type: String,
34
- default: ""
34
+ type: String
35
35
  },
36
36
  maxSize: {
37
37
  type: Number
@@ -58,38 +58,44 @@ const H = /* @__PURE__ */ b({
58
58
  }
59
59
  },
60
60
  emits: ["update:value"],
61
- setup(s, { expose: l, emit: m }) {
62
- const { b: p } = A("ap-upload"), t = s, c = m, d = {
63
- singleFile: U,
64
- multipleFile: h,
65
- picture: k
66
- }, f = r({
61
+ setup(g, { expose: v, emit: y }) {
62
+ var r, i, m, l;
63
+ const { t: s, lang: b } = R();
64
+ q(s), L(s, b);
65
+ const { b: N } = M("ap-upload"), t = g, C = y, _ = {
66
+ singleFile: P,
67
+ multipleFile: w,
68
+ picture: D
69
+ }, S = c({
67
70
  get() {
68
71
  return t.value;
69
72
  },
70
- set(a) {
71
- c("update:value", a);
73
+ set(n) {
74
+ C("update:value", n);
72
75
  }
73
- }), y = B("uiMode");
74
- e("theme", y.value), e("value", f), e("dirName", t.dirName), e("needName", t.needName), e("accept", t.accept), e("maxSize", t.maxSize), e("title", t.title), e("subTitle", t.subTitle), e("maxCount", t.maxCount), e("beforeUpload", t.beforeUpload), e("customRequest", t.customRequest), e("getOssAccess", t.getOssAccess);
75
- const g = r(() => n.value === 0), n = u(0);
76
- e("uploadingCount", n);
77
- const o = u(!0);
78
- function v() {
79
- o.value = !1, setTimeout(() => {
80
- o.value = !0;
76
+ }), x = f("uiMode"), o = f("apUpload");
77
+ e("theme", x.value), e("value", S), e("dirName", t.dirName ?? ((r = o.value) == null ? void 0 : r.dirName)), e("needName", t.needName ?? ((i = o.value) == null ? void 0 : i.needName) ?? !1), e("accept", t.accept ?? ((m = o.value) == null ? void 0 : m.accept) ?? ""), e("maxSize", t.maxSize), e("title", t.title), e("subTitle", t.subTitle), e("maxCount", t.maxCount), e("beforeUpload", t.beforeUpload), e("customRequest", t.customRequest), e(
78
+ "getOssAccess",
79
+ t.getOssAccess ?? ((l = o.value) == null ? void 0 : l.getOssAccess)
80
+ );
81
+ const O = c(() => p.value === 0), p = u(0);
82
+ e("uploadingCount", p);
83
+ const a = u(!0);
84
+ function A() {
85
+ a.value = !1, setTimeout(() => {
86
+ a.value = !0;
81
87
  });
82
88
  }
83
- return l({
84
- done: g,
85
- clear: v
86
- }), (a, T) => (i(), _("div", {
87
- class: C(N(p)())
89
+ return v({
90
+ done: O,
91
+ clear: A
92
+ }), (n, E) => (d(), U("div", {
93
+ class: T(j(N)())
88
94
  }, [
89
- o.value ? (i(), S(x(d[t.type]), F(O({ key: 0 }, a.$attrs)), null, 16)) : z("", !0)
95
+ a.value ? (d(), z(h(_[t.type]), k(B({ key: 0 }, n.$attrs)), null, 16)) : $("", !0)
90
96
  ], 2));
91
97
  }
92
98
  });
93
99
  export {
94
- H as default
100
+ ae as default
95
101
  };