@aplus-frontend/ui 0.2.0-beta.3 → 0.2.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/es/src/ap-field/hooks/use-default-placeholder.mjs +14 -14
  2. package/es/src/ap-form/item-text/style/css.d.ts +0 -1
  3. package/es/src/ap-form/item-text/style/css.js +1 -1
  4. package/es/src/ap-form/item-text/style/index.d.ts +0 -1
  5. package/es/src/ap-form/item-text/style/index.js +1 -1
  6. package/es/src/ap-form/item-text-group/style/css.d.ts +0 -0
  7. package/es/src/ap-form/item-text-group/style/css.js +1 -0
  8. package/es/src/ap-form/item-text-group/style/index.d.ts +0 -0
  9. package/es/src/ap-form/item-text-group/style/index.js +1 -0
  10. package/es/src/ap-form/items/checkbox/index.vue.d.ts +1 -1
  11. package/es/src/ap-form/items/date/index.vue.d.ts +1 -1
  12. package/es/src/ap-form/items/date-range/index.vue.d.ts +1 -1
  13. package/es/src/ap-form/items/interface.d.ts +11 -0
  14. package/es/src/ap-form/items/number/index.vue.d.ts +1 -1
  15. package/es/src/ap-form/items/radio/index.vue.d.ts +1 -1
  16. package/es/src/ap-form/items/select/index.vue.d.ts +1 -1
  17. package/es/src/ap-form/items/switch/index.vue.d.ts +1 -1
  18. package/es/src/ap-form/items/text/group.vue.d.ts +42 -0
  19. package/es/src/ap-form/items/text/group.vue.mjs +4 -0
  20. package/es/src/ap-form/items/text/group.vue2.mjs +26 -0
  21. package/es/src/ap-form/items/text/index.d.ts +3 -1
  22. package/es/src/ap-form/items/text/index.mjs +10 -6
  23. package/es/src/ap-form/items/text/index.vue.d.ts +1 -1
  24. package/es/src/ap-form/items/text/password.vue.d.ts +1 -1
  25. package/es/src/ap-form/items/text-area/index.vue.d.ts +1 -1
  26. package/es/src/ap-table/ap-table.vue.mjs +103 -108
  27. package/es/src/ap-table/constants.d.ts +192 -190
  28. package/es/src/ap-table/utils.d.ts +197 -233
  29. package/es/src/ap-table/utils.mjs +69 -80
  30. package/es/src/ap-upload/apUpload.vue.d.ts +18 -2
  31. package/es/src/ap-upload/apUpload.vue.mjs +54 -42
  32. package/es/src/ap-upload/apUploadTypes.d.ts +24 -1
  33. package/es/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
  34. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +97 -91
  35. package/es/src/ap-upload/components/Picture.vue.d.ts +44 -1
  36. package/es/src/ap-upload/components/Picture.vue2.mjs +182 -153
  37. package/es/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
  38. package/es/src/ap-upload/components/SingleFile.vue2.mjs +84 -86
  39. package/es/src/business/ap-label/constans.d.ts +1 -1
  40. package/es/src/business/ap-label/interface.d.ts +2 -2
  41. package/es/src/editable-table/hooks/use-get-columns.mjs +29 -34
  42. package/es/src/locale/lang/en.mjs +4 -0
  43. package/es/src/locale/lang/zh-cn.mjs +4 -0
  44. package/es/src/path-map.mjs +3 -1
  45. package/lib/src/ap-field/hooks/use-default-placeholder.js +1 -1
  46. package/lib/src/ap-form/item-text/style/css.d.ts +0 -1
  47. package/lib/src/ap-form/item-text/style/css.js +1 -1
  48. package/lib/src/ap-form/item-text/style/index.d.ts +0 -1
  49. package/lib/src/ap-form/item-text/style/index.js +1 -1
  50. package/lib/src/ap-form/item-text-group/style/css.d.ts +0 -0
  51. package/lib/src/ap-form/item-text-group/style/css.js +1 -0
  52. package/lib/src/ap-form/item-text-group/style/index.d.ts +0 -0
  53. package/lib/src/ap-form/item-text-group/style/index.js +1 -0
  54. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +1 -1
  55. package/lib/src/ap-form/items/date/index.vue.d.ts +1 -1
  56. package/lib/src/ap-form/items/date-range/index.vue.d.ts +1 -1
  57. package/lib/src/ap-form/items/interface.d.ts +11 -0
  58. package/lib/src/ap-form/items/number/index.vue.d.ts +1 -1
  59. package/lib/src/ap-form/items/radio/index.vue.d.ts +1 -1
  60. package/lib/src/ap-form/items/select/index.vue.d.ts +1 -1
  61. package/lib/src/ap-form/items/switch/index.vue.d.ts +1 -1
  62. package/lib/src/ap-form/items/text/group.vue.d.ts +42 -0
  63. package/lib/src/ap-form/items/text/group.vue.js +1 -0
  64. package/lib/src/ap-form/items/text/group.vue2.js +1 -0
  65. package/lib/src/ap-form/items/text/index.d.ts +3 -1
  66. package/lib/src/ap-form/items/text/index.js +1 -1
  67. package/lib/src/ap-form/items/text/index.vue.d.ts +1 -1
  68. package/lib/src/ap-form/items/text/password.vue.d.ts +1 -1
  69. package/lib/src/ap-form/items/text-area/index.vue.d.ts +1 -1
  70. package/lib/src/ap-table/ap-table.vue.js +1 -1
  71. package/lib/src/ap-table/constants.d.ts +192 -190
  72. package/lib/src/ap-table/utils.d.ts +197 -233
  73. package/lib/src/ap-table/utils.js +1 -1
  74. package/lib/src/ap-upload/apUpload.vue.d.ts +18 -2
  75. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  76. package/lib/src/ap-upload/apUploadTypes.d.ts +24 -1
  77. package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
  78. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  79. package/lib/src/ap-upload/components/Picture.vue.d.ts +44 -1
  80. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  81. package/lib/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
  82. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  83. package/lib/src/business/ap-label/constans.d.ts +1 -1
  84. package/lib/src/business/ap-label/interface.d.ts +2 -2
  85. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  86. package/lib/src/locale/lang/en.js +1 -1
  87. package/lib/src/locale/lang/zh-cn.js +1 -1
  88. package/lib/src/path-map.js +1 -1
  89. package/package.json +4 -4
@@ -1,19 +1,19 @@
1
- import { isVNode as b, createVNode as s, mergeProps as a, cloneVNode as y, Fragment as g } from "vue";
2
- import { isObject as f, isArray as p, isUndefined as h, isFunction as d, omit as j, isBoolean as F, isString as O } from "lodash-unified";
3
- import { apTableRenderItemMap as E, apTableFormItemMap as x } from "./constants.mjs";
4
- import { isType as N } from "@fruits-chain/utils";
1
+ import { isVNode as b, createVNode as s, mergeProps as a, cloneVNode as T, Fragment as g } from "vue";
2
+ import { isObject as f, isArray as p, isUndefined as h, isFunction as d, omit as j, isBoolean as O, isString as E } from "lodash-unified";
3
+ import { apTableRenderItemMap as F, apTableFormItemMap as N } from "./constants.mjs";
4
+ import { isType as S } from "@fruits-chain/utils";
5
5
  import "../ap-form/index.mjs";
6
- import { Tooltip as S } from "ant-design-vue";
6
+ import { Tooltip as v } from "ant-design-vue";
7
7
  import { QuestionCircleOutlined as I } from "@ant-design/icons-vue";
8
- import v from "../ap-form/item/index.vue.mjs";
9
- function P(t) {
8
+ import V from "../ap-form/item/index.vue.mjs";
9
+ function w(t) {
10
10
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !b(t);
11
11
  }
12
- const V = (t, e, n) => {
13
- let r = {};
12
+ const C = (t, e, n) => {
13
+ let i = {};
14
14
  return f(t) ? Object.keys(t).forEach((o) => {
15
- f(t[o]) ? r[o] = V(t[o], e[o], n) : r[o] = n(t[o], e);
16
- }) : r = n(t, e), r;
15
+ f(t[o]) ? i[o] = C(t[o], e[o], n) : i[o] = n(t[o], e);
16
+ }) : i = n(t, e), i;
17
17
  }, Q = (t, e) => {
18
18
  switch (t) {
19
19
  case "dayjs":
@@ -21,8 +21,8 @@ const V = (t, e, n) => {
21
21
  case "dayjsRange":
22
22
  return e.map((n) => n.valueOf());
23
23
  case "dayjsDayRange": {
24
- const [n, r] = e;
25
- return [n.startOf("day").valueOf(), r.endOf("day").valueOf()];
24
+ const [n, i] = e;
25
+ return [n.startOf("day").valueOf(), i.endOf("day").valueOf()];
26
26
  }
27
27
  case "multiple":
28
28
  case "multipleNumber":
@@ -38,110 +38,100 @@ const V = (t, e, n) => {
38
38
  function U(t) {
39
39
  return p(t) ? t.join(".") : t;
40
40
  }
41
- function w(t) {
41
+ function P(t) {
42
42
  const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
43
43
  return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
44
44
  }
45
- const A = (t) => w(t) === "map" ? t : new Map(Object.entries(t || {})), m = (t) => {
46
- const e = [], n = A(t);
47
- return n.forEach((r, o) => {
48
- const i = n.get(o) || n.get(`${o}`);
49
- if (i) {
50
- if (typeof i == "object" && (i != null && i.text)) {
45
+ const x = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), m = (t) => {
46
+ const e = [], n = x(t);
47
+ return n.forEach((i, o) => {
48
+ const r = n.get(o) || n.get(`${o}`);
49
+ if (r) {
50
+ if (typeof r == "object" && (r != null && r.text)) {
51
51
  e.push({
52
- text: i == null ? void 0 : i.text,
52
+ text: r == null ? void 0 : r.text,
53
53
  value: o,
54
- label: i == null ? void 0 : i.text,
55
- disabled: i.disabled
54
+ label: r == null ? void 0 : r.text,
55
+ disabled: r.disabled
56
56
  });
57
57
  return;
58
58
  }
59
59
  e.push({
60
- text: i,
61
- label: i,
60
+ text: r,
61
+ label: r,
62
62
  value: o
63
63
  });
64
64
  }
65
65
  }), e;
66
- }, z = (t) => h(t) || t < 0 ? 0 : t, G = (t, e, n) => {
67
- if (n)
68
- return n;
69
- const r = ["select", "date"], o = ["text", "textArea", "number"];
70
- if (e === "dateRange")
71
- return [t("ap.common.chooseText"), t("ap.common.chooseText")];
72
- if (r.includes(e))
73
- return t("ap.common.chooseText");
74
- if (o.includes(e))
75
- return t("ap.common.inputText");
76
- };
77
- function C(t, e) {
66
+ }, z = (t) => h(t) || t < 0 ? 0 : t;
67
+ function A(t, e) {
78
68
  return !t || !d(t) ? t : t(e);
79
69
  }
80
- function K(t) {
70
+ function G(t) {
81
71
  let e = t.valueType || "text";
82
72
  return t.valueEnum && (e = "status"), e;
83
73
  }
84
- function X(t, e, n, r) {
74
+ function K(t, e, n, i) {
85
75
  var u;
86
- const o = E[t];
76
+ const o = F[t];
87
77
  if (o)
88
78
  return s(o, a(e, {
89
79
  mode: "read"
90
80
  }), null);
91
- const i = r == null ? void 0 : r[t];
92
- return ((u = i == null ? void 0 : i.render) == null ? void 0 : u.call(i, e.value, n, e)) || e.value;
81
+ const r = i == null ? void 0 : i[t];
82
+ return ((u = r == null ? void 0 : r.render) == null ? void 0 : u.call(r, e.value, n, e)) || e.value;
93
83
  }
94
- function Y(t, e) {
84
+ function X(t, e) {
95
85
  if (t.customRenderFormItem)
96
86
  return () => {
97
87
  const o = t.customRenderFormItem(t);
98
- return y(o, {
88
+ return T(o, {
99
89
  ...t.fieldProps,
100
90
  span: t.span,
101
91
  ...o.props || {}
102
92
  });
103
93
  };
104
- const n = x[t.valueType];
94
+ const n = N[t.valueType];
105
95
  if (n)
106
96
  return n;
107
- const r = e == null ? void 0 : e[t.valueType];
97
+ const i = e == null ? void 0 : e[t.valueType];
108
98
  return () => {
109
- var i;
110
- const o = (i = r == null ? void 0 : r.renderFormItem) == null ? void 0 : i.call(r, t.fieldProps.field);
111
- return o ? s(v, a(t.fieldProps, {
99
+ var r;
100
+ const o = (r = i == null ? void 0 : i.renderFormItem) == null ? void 0 : r.call(i, t.fieldProps.field);
101
+ return o ? s(V, a(t.fieldProps, {
112
102
  span: t.span
113
- }), P(o) ? o : {
103
+ }), w(o) ? o : {
114
104
  default: () => [o]
115
105
  }) : null;
116
106
  };
117
107
  }
118
- function Z(t, e) {
119
- const n = C(t.fieldProps, e), r = (n == null ? void 0 : n.field) || n || {}, o = t.valueType === "switch", i = t.valueType === "index", u = o ? {
108
+ function Y(t, e) {
109
+ const n = A(t.fieldProps, e), i = (n == null ? void 0 : n.field) || n || {}, o = t.valueType === "switch", r = t.valueType === "index", u = o ? {
120
110
  checked: e.value
121
111
  } : {
122
- value: i ? e.index + 1 : e.value
112
+ value: r ? e.index + 1 : e.value
123
113
  };
124
- return t.valueEnum && (r.valueEnum = t.valueEnum), {
125
- ...j(r, ["request"]),
114
+ return t.valueEnum && (i.valueEnum = t.valueEnum), {
115
+ ...j(i, ["request"]),
126
116
  ...u
127
117
  };
128
118
  }
129
- function k(t) {
119
+ function Z(t) {
130
120
  const e = {
131
121
  ...t
132
122
  };
133
- return F(t.filters) && t.filters && t.valueEnum && (e.filters = m(t.valueEnum)), e;
123
+ return O(t.filters) && t.filters && t.valueEnum && (e.filters = m(t.valueEnum)), e;
134
124
  }
135
- function H(t, e) {
136
- var r;
125
+ function k(t, e) {
126
+ var i;
137
127
  const n = e || {};
138
- return t.valueEnum && !((r = n.field) != null && r.options) && (n.field = {
128
+ return t.valueEnum && !((i = n.field) != null && i.options) && (n.field = {
139
129
  ...n.field,
140
130
  options: m(t.valueEnum)
141
131
  }), n;
142
132
  }
143
- function M(t) {
144
- if (!N("Object")(t))
133
+ function H(t) {
134
+ if (!S("Object")(t))
145
135
  return t;
146
136
  try {
147
137
  return JSON.stringify(t);
@@ -149,14 +139,14 @@ function M(t) {
149
139
  return t;
150
140
  }
151
141
  }
152
- function tt(t, e, n, r) {
142
+ function M(t, e, n, i) {
153
143
  const o = n == null ? void 0 : n({
154
144
  title: t.title,
155
145
  column: t
156
- }), i = (o == null ? void 0 : o.filter((T) => T.type !== Symbol.for("v-cmt"))) || [];
157
- if (o && i.length > 0)
146
+ }), r = (o == null ? void 0 : o.filter((y) => y.type !== Symbol.for("v-cmt"))) || [];
147
+ if (o && r.length > 0)
158
148
  return o;
159
- const l = O(t.title) ? s("span", {
149
+ const l = E(t.title) ? s("span", {
160
150
  class: e,
161
151
  title: t.title
162
152
  }, [t.title]) : t.title, c = t.tooltip ? d(t.tooltip) ? t.tooltip(t) : s(g, null, [t.tooltip]) : null;
@@ -166,34 +156,33 @@ function tt(t, e, n, r) {
166
156
  alignItems: "center",
167
157
  maxWidth: "100%"
168
158
  }
169
- }, [l, s(S, {
159
+ }, [l, s(v, {
170
160
  title: c,
171
161
  placement: "bottom"
172
162
  }, {
173
163
  default: () => [s(I, {
174
164
  style: {
175
165
  padding: "4px",
176
- color: r,
166
+ color: i,
177
167
  verticalAlign: "middle"
178
168
  }
179
169
  }, null)]
180
170
  })]) : l;
181
171
  }
182
172
  export {
183
- k as apColumnToColumn,
173
+ Z as apColumnToColumn,
184
174
  U as dataIndexToStr,
185
- V as formatParamsValueType,
175
+ C as formatParamsValueType,
186
176
  z as getColumnOrder,
187
- C as getFieldProps,
188
- G as getPlaceholder,
189
- Y as getSearchFormItemRenderNode,
190
- X as getTableCellRenderNode,
191
- Z as getTableRenderProps,
192
- K as getTableRenderType,
193
- tt as getTableTitle,
194
- A as objectToMap,
195
- M as objectToString,
177
+ A as getFieldProps,
178
+ X as getSearchFormItemRenderNode,
179
+ K as getTableCellRenderNode,
180
+ Y as getTableRenderProps,
181
+ G as getTableRenderType,
182
+ M as getTableTitle,
183
+ x as objectToMap,
184
+ H as objectToString,
196
185
  Q as parseFieldValue,
197
- H as updateFormProps,
186
+ k as updateFormProps,
198
187
  m as valueEnumToArray
199
188
  };
@@ -1,8 +1,17 @@
1
1
  import { PropType, VNode, DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ExtractPropTypes, RendererNode, RendererElement } from 'vue';
2
- import { FileUploadType, BeforeUpload, CustomRequest } from './apUploadTypes';
2
+ import { FileUploadType, BeforeUpload, CustomRequest, ApUploadSlots } from './apUploadTypes';
3
3
  import { GetOssAccess } from './hooks/useOss';
4
4
  declare function clear(): void;
5
- declare const _default: DefineComponent<{
5
+ declare function setValue(val: any): void;
6
+ declare function __VLS_template(): {
7
+ slots: Readonly<ApUploadSlots> & ApUploadSlots;
8
+ refs: {
9
+ uploadRef: unknown;
10
+ };
11
+ attrs: Partial<{}>;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: DefineComponent<{
6
15
  dirName: {
7
16
  type: StringConstructor;
8
17
  };
@@ -47,6 +56,7 @@ declare const _default: DefineComponent<{
47
56
  }, {
48
57
  done: ComputedRef<boolean>;
49
58
  clear: typeof clear;
59
+ setValue: typeof setValue;
50
60
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
51
61
  "update:value": (...args: any[]) => void;
52
62
  }, string, PublicProps, Readonly< ExtractPropTypes<{
@@ -101,4 +111,10 @@ declare const _default: DefineComponent<{
101
111
  [key: string]: any;
102
112
  }>;
103
113
  }, {}>;
114
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
104
115
  export default _default;
116
+ type __VLS_WithTemplateSlots<T, S> = T & {
117
+ new (): {
118
+ $slots: S;
119
+ };
120
+ };
@@ -1,18 +1,18 @@
1
- import { defineComponent as U, computed as d, provide as t, ref as f, openBlock as g, createElementBlock as j, normalizeClass as T, unref as z, createBlock as k, resolveDynamicComponent as B, normalizeProps as $, mergeProps as q, createCommentVNode as L } from "vue";
1
+ import { defineComponent as k, ref as g, computed as v, provide as t, openBlock as y, createElementBlock as z, normalizeClass as T, unref as B, createBlock as L, resolveDynamicComponent as R, mergeProps as q, createSlots as P, renderList as M, withCtx as V, renderSlot as w, normalizeProps as D, guardReactiveProps as E } 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
- import { injectLocaleToAccept as R } from "./utils/accept.mjs";
7
- import { injectLocaleToOss as M } from "./hooks/useOss.mjs";
8
- import { Form as P } from "ant-design-vue";
9
- import { useLocale as w } from "../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as D } from "../config-provider/hooks/use-namespace.mjs";
11
- import E from "./components/SingleFile.vue2.mjs";
12
- import G from "./components/MultipleFile.vue2.mjs";
13
- import I from "./components/Picture.vue2.mjs";
14
- import { useGlobalConfig as v } from "../config-provider/hooks/use-global-config.mjs";
15
- const se = /* @__PURE__ */ U({
6
+ import { injectLocaleToAccept as G } from "./utils/accept.mjs";
7
+ import { injectLocaleToOss as I } from "./hooks/useOss.mjs";
8
+ import { Form as H } from "ant-design-vue";
9
+ import { useLocale as J } from "../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as K } from "../config-provider/hooks/use-namespace.mjs";
11
+ import Q from "./components/SingleFile.vue2.mjs";
12
+ import W from "./components/MultipleFile.vue2.mjs";
13
+ import X from "./components/Picture.vue2.mjs";
14
+ import { useGlobalConfig as b } from "../config-provider/hooks/use-global-config.mjs";
15
+ const ue = /* @__PURE__ */ k({
16
16
  name: "AplusFileUpload",
17
17
  __name: "apUpload",
18
18
  props: {
@@ -59,48 +59,60 @@ const se = /* @__PURE__ */ U({
59
59
  onChange: Function
60
60
  },
61
61
  emits: ["update:value"],
62
- setup(y, { expose: C, emit: b }) {
63
- var c, l, u, p;
64
- const { t: m, lang: N } = w();
65
- R(m), M(m, N);
66
- const { b: _ } = D("ap-upload"), e = y, F = b, S = {
67
- singleFile: E,
68
- multipleFile: G,
69
- picture: I
70
- }, n = P.useInjectFormItemContext(), x = d({
62
+ setup(C, { expose: N, emit: _ }) {
63
+ var p, u, d, f;
64
+ const { t: c, lang: F } = J();
65
+ G(c), I(c, F);
66
+ const { b: S } = K("ap-upload"), s = g(null), e = C, O = _, h = {
67
+ singleFile: Q,
68
+ multipleFile: W,
69
+ picture: X
70
+ }, i = H.useInjectFormItemContext(), j = v({
71
71
  get() {
72
72
  return e.value;
73
73
  },
74
- set(a) {
75
- var i;
76
- F("update:value", a), n == null || n.onFieldChange(), (i = e.onChange) == null || i.call(e, a);
74
+ set(o) {
75
+ var a;
76
+ O("update:value", o), i == null || i.onFieldChange(), (a = e.onChange) == null || a.call(e, o);
77
77
  }
78
- }), O = v("uiMode"), o = v("apUpload");
79
- t("theme", O.value), t("value", x), t("dirName", e.dirName ?? ((c = o.value) == null ? void 0 : c.dirName)), t(
78
+ }), x = b("uiMode"), r = b("apUpload");
79
+ t("theme", x.value), t("value", j), t("dirName", e.dirName ?? ((p = r.value) == null ? void 0 : p.dirName)), t(
80
80
  "needName",
81
- e.needName ?? ((l = o.value) == null ? void 0 : l.needName) ?? !1
82
- ), t("accept", e.accept ?? ((u = o.value) == null ? void 0 : u.accept) ?? ""), t("maxSize", e.maxSize), t("title", e.title), t("subTitle", e.subTitle), t("maxCount", e.maxCount), t("beforeUpload", e.beforeUpload), t("customRequest", e.customRequest), t(
81
+ e.needName ?? ((u = r.value) == null ? void 0 : u.needName) ?? !1
82
+ ), t("accept", e.accept ?? ((d = r.value) == null ? void 0 : d.accept) ?? ""), t("maxSize", e.maxSize), t("title", e.title), t("subTitle", e.subTitle), t("maxCount", e.maxCount), t("beforeUpload", e.beforeUpload), t("customRequest", e.customRequest), t(
83
83
  "getOssAccess",
84
- e.getOssAccess ?? ((p = o.value) == null ? void 0 : p.getOssAccess)
84
+ e.getOssAccess ?? ((f = r.value) == null ? void 0 : f.getOssAccess)
85
85
  );
86
- const h = d(() => r.value === 0), r = f(0);
87
- t("uploadingCount", r);
88
- const s = f(!0);
89
- function A() {
90
- s.value = !1, setTimeout(() => {
91
- s.value = !0;
92
- });
86
+ const A = v(() => l.value === 0), l = g(0);
87
+ t("uploadingCount", l);
88
+ function U() {
89
+ m(void 0);
93
90
  }
94
- return C({
95
- done: h,
96
- clear: A
97
- }), (a, i) => (g(), j("div", {
98
- class: T(z(_)())
91
+ function m(o) {
92
+ var a, n;
93
+ (n = (a = s == null ? void 0 : s.value) == null ? void 0 : a.setValue) == null || n.call(a, o);
94
+ }
95
+ return N({
96
+ done: A,
97
+ clear: U,
98
+ setValue: m
99
+ }), (o, a) => (y(), z("div", {
100
+ class: T(B(S)())
99
101
  }, [
100
- s.value ? (g(), k(B(S[e.type]), $(q({ key: 0 }, a.$attrs)), null, 16)) : L("", !0)
102
+ (y(), L(R(h[e.type]), q(o.$attrs, {
103
+ ref_key: "uploadRef",
104
+ ref: s
105
+ }), P({ _: 2 }, [
106
+ M(Object.keys(o.$slots), (n) => ({
107
+ name: n,
108
+ fn: V(($) => [
109
+ w(o.$slots, n, D(E($ || {})))
110
+ ])
111
+ }))
112
+ ]), 1040))
101
113
  ], 2));
102
114
  }
103
115
  });
104
116
  export {
105
- se as default
117
+ ue as default
106
118
  };
@@ -1,4 +1,4 @@
1
- import { VNode } from 'vue';
1
+ import { ComputedRef, VNode } from 'vue';
2
2
  export type FileUploadType = 'picture' | 'singleFile' | 'multipleFile';
3
3
  /**
4
4
  * 是否需要返回图片名称
@@ -87,3 +87,26 @@ export type CustomRequest = (cb: {
87
87
  onSuccess: (saveUrl: string) => void;
88
88
  file: File;
89
89
  }) => void;
90
+ export interface ApUploadExpose<SetValueType = any> {
91
+ done?: ComputedRef<boolean>;
92
+ clear?: () => void;
93
+ setValue?: (value: SetValueType) => void;
94
+ }
95
+ interface ApPictureUploadFile extends File {
96
+ uid: string;
97
+ thumbUrl?: string;
98
+ status: 'error' | 'success' | 'done' | 'uploading' | 'removed';
99
+ percent: number;
100
+ path?: string;
101
+ oss?: {
102
+ pauseUpload?: () => Promise<any>;
103
+ };
104
+ [key: string | number | symbol]: any;
105
+ }
106
+ export interface ApUploadSlots {
107
+ pictureContext: ({ fileList, remove }: {
108
+ fileList: ApPictureUploadFile[];
109
+ remove: (file: ApPictureUploadFile) => void;
110
+ }) => VNode;
111
+ }
112
+ export {};
@@ -1,3 +1,6 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
2
+ declare function setValue(val: (string | Record<string, any>)[]): void;
3
+ declare const _default: DefineComponent<{}, {
4
+ setValue: typeof setValue;
5
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
3
6
  export default _default;