ant-design-x-vue 1.2.1 → 1.2.3

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.
@@ -1,22 +1,22 @@
1
- import { defineComponent as $, mergeDefaults as U, toRef as q, useSlots as T, computed as d, useTemplateRef as F, watch as V, createVNode as i, Fragment as X } from "vue";
2
- import B from "../_util/hooks/use-x-component-config.mjs";
3
- import M from "../x-provider/hooks/use-x-provider-context.mjs";
1
+ import { defineComponent as $, mergeDefaults as q, toRef as T, useSlots as V, computed as f, useTemplateRef as F, watch as X, createVNode as i, Fragment as B } from "vue";
2
+ import M from "../_util/hooks/use-x-component-config.mjs";
3
+ import k from "../x-provider/hooks/use-x-provider-context.mjs";
4
4
  import "../x-provider/context.mjs";
5
5
  import "ant-design-vue";
6
- import k from "./PlaceholderUploader.mjs";
6
+ import z from "./PlaceholderUploader.mjs";
7
7
  import L from "./DropArea.mjs";
8
- import z from "./SilentUploader.mjs";
9
- import { _ as G } from "./FileList/FileList2.mjs";
10
- import { AttachmentContextProvider as H } from "./context.mjs";
11
- import J from "./style/index.mjs";
12
- import K from "../_util/hooks/use-state.mjs";
13
- function Q(e, m) {
8
+ import G from "./SilentUploader.mjs";
9
+ import { _ as H } from "./FileList/FileList2.mjs";
10
+ import { AttachmentContextProvider as J } from "./context.mjs";
11
+ import K from "./style/index.mjs";
12
+ import Q from "../_util/hooks/use-state.mjs";
13
+ function W(e, m) {
14
14
  const s = /* @__PURE__ */ Object.create(null);
15
15
  for (const r in e)
16
16
  m.includes(r) || Object.defineProperty(s, r, { enumerable: !0, get: () => e[r] });
17
17
  return s;
18
18
  }
19
- function W(e) {
19
+ function Y(e) {
20
20
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
21
21
  }
22
22
  var x = { exports: {} };
@@ -26,14 +26,14 @@ var x = { exports: {} };
26
26
  http://jedwatson.github.io/classnames
27
27
  */
28
28
  var j;
29
- function Y() {
29
+ function Z() {
30
30
  return j || (j = 1, function(e) {
31
31
  (function() {
32
32
  var m = {}.hasOwnProperty;
33
33
  function s() {
34
34
  for (var l = "", t = 0; t < arguments.length; t++) {
35
35
  var o = arguments[t];
36
- o && (l = v(l, r(o)));
36
+ o && (l = d(l, r(o)));
37
37
  }
38
38
  return l;
39
39
  }
@@ -48,21 +48,21 @@ function Y() {
48
48
  return l.toString();
49
49
  var t = "";
50
50
  for (var o in l)
51
- m.call(l, o) && l[o] && (t = v(t, o));
51
+ m.call(l, o) && l[o] && (t = d(t, o));
52
52
  return t;
53
53
  }
54
- function v(l, t) {
54
+ function d(l, t) {
55
55
  return t ? l ? l + " " + t : l + t : l;
56
56
  }
57
57
  e.exports ? (s.default = s, e.exports = s) : window.classNames = s;
58
58
  })();
59
59
  }(x)), x.exports;
60
60
  }
61
- var Z = Y();
62
- const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
61
+ var _ = Z();
62
+ const c = /* @__PURE__ */ Y(_), fe = /* @__PURE__ */ $({
63
63
  name: "AXAttachments",
64
64
  __name: "Attachments",
65
- props: U({
65
+ props: q({
66
66
  capture: null,
67
67
  type: null,
68
68
  name: null,
@@ -132,38 +132,38 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
132
132
  setup(e, {
133
133
  expose: m
134
134
  }) {
135
- const s = Q(e, ["prefixCls", "rootClassName", "rootStyle", "className", "style", "items", "children", "getDropContainer", "placeholder", "onChange", "onRemove", "overflow", "imageProps", "disabled", "classNames", "styles"]);
136
- q(e, "prefixCls");
137
- const r = T(), {
138
- getPrefixCls: v,
135
+ const s = W(e, ["prefixCls", "rootClassName", "rootStyle", "className", "style", "items", "children", "getDropContainer", "placeholder", "onChange", "onRemove", "overflow", "imageProps", "disabled", "classNames", "styles"]);
136
+ T(e, "prefixCls");
137
+ const r = V(), {
138
+ getPrefixCls: d,
139
139
  direction: l
140
- } = M(), t = v("attachment", e.prefixCls), o = B("attachments"), C = d(() => o.value.classNames), y = d(() => o.value.styles), w = F("attachments-container"), R = F("attachments-upload"), [O, I, A] = J(t), p = d(() => c(I.value, A)), [h, S] = K(e.items);
141
- V(() => e.items, () => {
142
- S(e.items);
140
+ } = k(), t = d("attachment", e.prefixCls), o = M("attachments"), C = f(() => o.value.classNames), y = f(() => o.value.styles), w = F("attachments-container"), O = F("placeholder-uploader"), [I, A, E] = K(t), p = f(() => c(A.value, E)), [v, R] = Q(e.items);
141
+ X(() => e.items, () => {
142
+ R(e.items);
143
143
  });
144
- const P = (a) => {
145
- var n;
146
- S(a.fileList), (n = e.onChange) == null || n.call(e, a);
147
- }, g = d(() => ({
144
+ const S = (n) => {
145
+ var a;
146
+ R(n.fileList), (a = e.onChange) == null || a.call(e, n);
147
+ }, g = f(() => ({
148
148
  ...s,
149
- fileList: h.value,
150
- onChange: P
151
- })), E = (a) => Promise.resolve(typeof e.onRemove == "function" ? e.onRemove(a) : e.onRemove).then((n) => {
152
- if (n === !1)
149
+ fileList: v.value,
150
+ onChange: S
151
+ })), U = (n) => Promise.resolve(typeof e.onRemove == "function" ? e.onRemove(n) : e.onRemove).then((a) => {
152
+ if (a === !1)
153
153
  return;
154
- const f = h.value.filter((u) => u.uid !== a.uid);
155
- P({
154
+ const u = v.value.filter((h) => h.uid !== n.uid);
155
+ S({
156
156
  file: {
157
- ...a,
157
+ ...n,
158
158
  status: "removed"
159
159
  },
160
- fileList: f
160
+ fileList: u
161
161
  });
162
- }), N = (a, n, f) => {
162
+ }), N = (n, a) => {
163
163
  const u = r.placeholder ? r.placeholder({
164
- type: a
165
- }) : typeof e.placeholder == "function" ? e.placeholder(a) : e.placeholder;
166
- return i(k, {
164
+ type: n
165
+ }) : typeof e.placeholder == "function" ? e.placeholder(n) : e.placeholder;
166
+ return i(z, {
167
167
  placeholder: u,
168
168
  upload: g.value,
169
169
  prefixCls: t,
@@ -171,31 +171,29 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
171
171
  style: {
172
172
  ...y.value.placeholder,
173
173
  ...e.styles.placeholder,
174
- ...n == null ? void 0 : n.style
175
- }
174
+ ...a == null ? void 0 : a.style
175
+ },
176
+ ref: n === "inline" ? "placeholder-uploader" : void 0
176
177
  }, null);
177
- }, b = d(() => h.value.length > 0);
178
+ }, P = f(() => v.value.length > 0);
178
179
  return m({
179
180
  nativeElement: w.value,
180
- upload: (a) => {
181
- var f, u;
182
- const n = (
183
- // @ts-expect-error
184
- (u = (f = R.value) == null ? void 0 : f.nativeElement) == null ? void 0 : u.querySelector('input[type="file"]')
185
- );
186
- if (n) {
181
+ upload: (n) => {
182
+ var u, h, b;
183
+ const a = (b = (u = O.value) == null ? void 0 : (h = u.nativeElement).querySelector) == null ? void 0 : b.call(h, 'input[type="file"]');
184
+ if (a) {
187
185
  const D = new DataTransfer();
188
- D.items.add(a), n.files = D.files, n.dispatchEvent(new Event("change", {
186
+ D.items.add(n), a.files = D.files, a.dispatchEvent(new Event("change", {
189
187
  bubbles: !0
190
188
  }));
191
189
  }
192
190
  }
193
- }), () => O(i(H, {
191
+ }), () => I(i(J, {
194
192
  value: {
195
193
  disabled: e.disabled
196
194
  }
197
195
  }, {
198
- default: () => [e.children ? i(X, null, [i(z, {
196
+ default: () => [e.children ? i(B, null, [i(G, {
199
197
  upload: g.value,
200
198
  rootClassName: e.rootClassName,
201
199
  ref: "attachments-upload",
@@ -215,17 +213,17 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
215
213
  },
216
214
  dir: l.value || "ltr",
217
215
  ref: "attachments-container"
218
- }, [i(G, {
216
+ }, [i(H, {
219
217
  prefixCls: t,
220
- items: h.value,
221
- onRemove: E,
218
+ items: v.value,
219
+ onRemove: U,
222
220
  overflow: e.overflow,
223
221
  upload: g.value,
224
222
  listClassName: c(C.value.list, e.classNames.list),
225
223
  listStyle: {
226
224
  ...y.value.list,
227
225
  ...e.styles.list,
228
- ...!b.value && {
226
+ ...!P.value && {
229
227
  display: "none"
230
228
  }
231
229
  },
@@ -235,11 +233,11 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
235
233
  ...e.styles.item
236
234
  },
237
235
  imageProps: e.imageProps
238
- }, null), N("inline", b.value ? {
236
+ }, null), N("inline", P.value ? {
239
237
  style: {
240
238
  display: "none"
241
239
  }
242
- } : {}, R.value), i(L, {
240
+ } : {}), i(L, {
243
241
  getDropContainer: e.getDropContainer || (() => w.value),
244
242
  prefixCls: t,
245
243
  className: p.value,
@@ -249,7 +247,7 @@ const c = /* @__PURE__ */ W(Z), me = /* @__PURE__ */ $({
249
247
  }
250
248
  });
251
249
  export {
252
- me as _,
253
- Q as a,
250
+ fe as _,
251
+ W as a,
254
252
  c
255
253
  };