UNPKG

ant-design-x-vue-next

Version:

Ant Design X for Vue — community continuation aligned with @ant-design/x

59 lines (58 loc) 1.52 kB
import { defineComponent as c, mergeDefaults as d, useSlots as f, useTemplateRef as m, computed as p, createVNode as o, mergeProps as h, Fragment as y, isVNode as v } from "vue"; import { Upload as N } from "ant-design-vue"; function b(e) { return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !v(e); } const A = /* @__PURE__ */ c({ name: "AXAttachmentsSilentUploader", __name: "SilentUploader", props: d({ children: null, upload: null, visible: { type: Boolean }, rootClassName: null, className: null, style: null }, { visible: !0 }), setup(e, { expose: r }) { const n = f(), s = m("upload"), u = p(() => { var l; return (l = s.value) == null ? void 0 : l.$el; }), i = () => { var a; if (e.children) return e.children; const l = (a = n.default) == null ? void 0 : a.call(n); if (!l) return null; const t = Array.isArray(l) ? l : [l]; return t.length ? t.length === 1 ? t[0] : o(y, null, [t]) : null; }; return r({ nativeElement: u }), () => { const l = i(); return o("div", { class: e.className ?? e.rootClassName, style: { ...e.style, ...e.visible === !1 ? { display: "none" } : null } }, [o(N, h(e.upload, { showUploadList: !1, ref: "upload" }), b(l) ? l : { default: () => [l] })]); }; } }); export { A as default };