UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

619 lines (597 loc) 27.6 kB
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import { createElementVNode, openBlock, createElementBlock, isVNode, defineComponent, toRefs, computed, ref, createVNode, mergeProps } from 'vue'; import { _ as __unplugin_components_4 } from '../../_chunks/dep-b7fdf66d.mjs'; import { _ as __unplugin_components_3 } from '../../_chunks/dep-84ddb5ec.mjs'; import { _ as __unplugin_components_2 } from '../../_chunks/dep-fd7c9c01.mjs'; import { _ as __unplugin_components_1 } from '../../_chunks/dep-07473300.mjs'; import { _ as __unplugin_components_0 } from '../../_chunks/dep-7b4b2cfc.mjs'; import { _ as _toConsumableArray } from '../../_chunks/dep-5bec687c.mjs'; import { _ as _defineProperty } from '../../_chunks/dep-f9e836af.mjs'; import { ImageViewer } from '../../image-viewer/index.mjs'; import { commonProps } from '../constants.mjs'; import { Button } from '../../button/index.mjs'; import useDrag from '../hooks/useDrag.mjs'; import { abridgeName, FILE_PDF_REGEXP, FILE_EXCEL_REGEXP, FILE_WORD_REGEXP, FILE_PPT_REGEXP, VIDEO_REGEXP, IMAGE_REGEXP, returnFileSize } from '../../_common/js/upload/utils.mjs'; import { Loading } from '../../loading/index.mjs'; import '../../hooks/index.mjs'; import { Link } from '../../link/index.mjs'; import { Image } from '../../image/index.mjs'; import { useTNodeJSX } from '../../hooks/tnode.mjs'; import '../../_chunks/dep-89b966f4.mjs'; import '../../_chunks/dep-82805301.mjs'; import '../../image-viewer/image-viewer.mjs'; import '../../_chunks/dep-7f8588b1.mjs'; import '../../_chunks/dep-6af44080.mjs'; import '../../_chunks/dep-cf7b0304.mjs'; import '../../_chunks/dep-32d4c595.mjs'; import '../../image-viewer/props.mjs'; import '../../image-viewer/base/ImageModalIcon.mjs'; import '../../hooks/useConfig.mjs'; import '../../config-provider/useConfig.mjs'; import '../../_chunks/dep-1cc1c24f.mjs'; import '../../_chunks/dep-10a947a6.mjs'; import '../../_chunks/dep-b75d8d74.mjs'; import '../../_chunks/dep-6ad18815.mjs'; import '../../_chunks/dep-91ac8f71.mjs'; import '../../_chunks/dep-c4737535.mjs'; import '../../_chunks/dep-81c83986.mjs'; import '../../_chunks/dep-6aa0223b.mjs'; import '../../_chunks/dep-db381ece.mjs'; import '../../_chunks/dep-5755c21c.mjs'; import '../../_chunks/dep-7f239c43.mjs'; import '../../_chunks/dep-6f04869e.mjs'; import '../../_chunks/dep-d32fbbb3.mjs'; import '../../_chunks/dep-dafada74.mjs'; import '../../_chunks/dep-addc2a84.mjs'; import '../../_chunks/dep-a95026f2.mjs'; import '../../_chunks/dep-068e912d.mjs'; import '../../_chunks/dep-6e7b37b8.mjs'; import '../../_chunks/dep-e1ab85c5.mjs'; import '../../_chunks/dep-5f0e0453.mjs'; import '../../_chunks/dep-71f84cf2.mjs'; import '../../_chunks/dep-0e832fc7.mjs'; import '../../_chunks/dep-69963a8c.mjs'; import '../../_chunks/dep-8d1c9a23.mjs'; import '../../_chunks/dep-03412fab.mjs'; import '../../_chunks/dep-205ff58d.mjs'; import '../../_chunks/dep-11fa9c2c.mjs'; import '../../_chunks/dep-b09f48fa.mjs'; import '../../_chunks/dep-26bf361a.mjs'; import '../../_chunks/dep-3ec3335a.mjs'; import '../../_chunks/dep-ed4e7c50.mjs'; import '../../_chunks/dep-a666b9ad.mjs'; import '../../_common/js/global-config/default-config.mjs'; import '../../_common/js/global-config/locale/en_US.mjs'; import '../../config-provider/type.mjs'; import '../../_chunks/dep-a628549d.mjs'; import '../../_chunks/dep-4903a8a8.mjs'; import '../../_chunks/dep-7dcfa37a.mjs'; import '../../_chunks/dep-f4eba04c.mjs'; import '../../_chunks/dep-735bcd0d.mjs'; import '../../_chunks/dep-765678ef.mjs'; import '../../_chunks/dep-8db27830.mjs'; import '../../_chunks/dep-ae4bffa5.mjs'; import '../../utils/render-tnode.mjs'; import '../../_chunks/dep-9d7ebc32.mjs'; import '../../image-viewer/base/ImageViewerUtils.mjs'; import '../../_chunks/dep-aa9e0b15.mjs'; import '../../tooltip/index.mjs'; import '../../tooltip/tooltip.mjs'; import '../../_chunks/dep-60f1d7ee.mjs'; import '../../_chunks/dep-fa6608fd.mjs'; import '../../_chunks/dep-e901316d.mjs'; import '../../_chunks/dep-b57a2815.mjs'; import '../../_chunks/dep-983ce253.mjs'; import '../../tooltip/props.mjs'; import '../../popup/props.mjs'; import '../../popup/index.mjs'; import '../../popup/popup.mjs'; import '@popperjs/core'; import '../../_chunks/dep-0c786bea.mjs'; import '../../_chunks/dep-e727a519.mjs'; import '../../hooks/useVModel.mjs'; import '../../utils/dom.mjs'; import '../../utils/easing.mjs'; import '../../_common/js/utils/set-style.mjs'; import '../../popup/container.mjs'; import '../../hooks/useResizeObserver.mjs'; import '../../hooks/icon.mjs'; import '../../hooks/slot.mjs'; import '../../hooks/useCommonClassName.mjs'; import '../../hooks/useDefaultValue.mjs'; import '../../hooks/useDestroyOnClose.mjs'; import '../../hooks/useKeepAnimation.mjs'; import '../../hooks/useRipple.mjs'; import '../../utils/set-style.mjs'; import '../../hooks/useVirtualScroll.mjs'; import '../../hooks/useImagePreviewUrl.mjs'; import '../../_common/js/log/log.mjs'; import '../../utils/withInstall.mjs'; import './style/css.mjs'; import '../../popup/type.mjs'; import '../../tooltip/util.mjs'; import '../../tooltip/type.mjs'; import '../../image-viewer/utils.mjs'; import '../../image-viewer/base/ImageItem.mjs'; import '../../_chunks/dep-5b2c02e7.mjs'; import '../../image-viewer/hooks.mjs'; import '../../image-viewer/base/ImageViewerModal.mjs'; import '../../dialog/index.mjs'; import '../../dialog/dialog.mjs'; import '../../_chunks/dep-bd64cde8.mjs'; import '../../dialog/props.mjs'; import '../../dialog/hooks.mjs'; import '../../button/button.mjs'; import '../../button/props.mjs'; import '../../hooks/useDisabled.mjs'; import '../../_chunks/dep-b9fae426.mjs'; import '../../loading/directive.mjs'; import '../../loading/plugin.mjs'; import '../../loading/loading.mjs'; import '../../loading/icon/gradient.mjs'; import '../../_common/js/loading/circle-adapter.mjs'; import '../../_common/js/utils/helper.mjs'; import '../../_chunks/dep-53e379cd.mjs'; import '../../_chunks/dep-5a2ce53e.mjs'; import '../../_chunks/dep-1bae6a97.mjs'; import '../../_chunks/dep-23f91684.mjs'; import '../../loading/props.mjs'; import '../../hooks/useTeleport.mjs'; import '../../loading/type.mjs'; import '../../button/type.mjs'; import '../../dialog/stack.mjs'; import '../../_common/js/utils/getScrollbarWidth.mjs'; import '../../dialog/type.mjs'; import '../../dialog/plugin.mjs'; import '../../image-viewer/const.mjs'; import '../../image/image.mjs'; import '../../_common/js/utils/observe.mjs'; import '../../image/props.mjs'; import '../../space/index.mjs'; import '../../space/space.mjs'; import '../../space/props.mjs'; import '../../space/type.mjs'; import '../../image/type.mjs'; import '../../image-viewer/type.mjs'; import '../../link/link.mjs'; import '../../link/props.mjs'; import '../../link/type.mjs'; const _hoisted_1$5 = { class: "x-icon", viewBox: "0 0 24 24", width: "1.1em", height: "1.1em" }; const _hoisted_2$5 = /*#__PURE__*/createElementVNode("path", { fill: "currentColor", d: "M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6-5.997ZM5.83 8H9V4.83L5.83 8ZM11 4v5a1 1 0 0 1-1 1H5v10h14V4h-8Z" }, null, -1 /* HOISTED */); const _hoisted_3$5 = [ _hoisted_2$5 ]; function render$5(_ctx, _cache) { return (openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$5)) } var __unplugin_components_10 = { name: 'ri-file-line', render: render$5 }; /* vite-plugin-components disabled */ const _hoisted_1$4 = { class: "x-icon", viewBox: "0 0 24 24", width: "1.1em", height: "1.1em" }; const _hoisted_2$4 = /*#__PURE__*/createElementVNode("path", { fill: "currentColor", d: "M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.993.993 0 0 1 3 20.007V3.993ZM5 5v14h14V5H5Zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332Z" }, null, -1 /* HOISTED */); const _hoisted_3$4 = [ _hoisted_2$4 ]; function render$4(_ctx, _cache) { return (openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$4)) } var __unplugin_components_9 = { name: 'ri-video-line', render: render$4 }; /* vite-plugin-components disabled */ const _hoisted_1$3 = { class: "x-icon", viewBox: "0 0 24 24", width: "1.1em", height: "1.1em" }; const _hoisted_2$3 = /*#__PURE__*/createElementVNode("path", { fill: "currentColor", d: "M3 2.992C3 2.444 3.447 2 3.998 2H16l5 5v13.992A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008V2.992ZM5 4v16h14V8h-3v6h-6v2H8V8h7V4H5Zm5 6v2h4v-2h-4Z" }, null, -1 /* HOISTED */); const _hoisted_3$3 = [ _hoisted_2$3 ]; function render$3(_ctx, _cache) { return (openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$3)) } var __unplugin_components_8 = { name: 'ri-file-ppt-line', render: render$3 }; /* vite-plugin-components disabled */ const _hoisted_1$2 = { class: "x-icon", viewBox: "0 0 24 24", width: "1.1em", height: "1.1em" }; const _hoisted_2$2 = /*#__PURE__*/createElementVNode("path", { fill: "currentColor", d: "M16 8v8h-2l-2-2l-2 2H8V8h2v5l2-2l2 2V8h1V4H5v16h14V8h-3ZM3 2.992C3 2.444 3.447 2 3.998 2H16l5 5v13.992A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008V2.992Z" }, null, -1 /* HOISTED */); const _hoisted_3$2 = [ _hoisted_2$2 ]; function render$2(_ctx, _cache) { return (openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$2)) } var __unplugin_components_7 = { name: 'ri-file-word-line', render: render$2 }; /* vite-plugin-components disabled */ const _hoisted_1$1 = { class: "x-icon", viewBox: "0 0 24 24", width: "1.1em", height: "1.1em" }; const _hoisted_2$1 = /*#__PURE__*/createElementVNode("path", { fill: "currentColor", d: "m13.2 12l2.8 4h-2.4L12 13.714L10.4 16H8l2.8-4L8 8h2.4l1.6 2.286L13.6 8H15V4H5v16h14V8h-3l-2.8 4ZM3 2.992C3 2.444 3.447 2 3.998 2H16l5 5v13.992A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008V2.992Z" }, null, -1 /* HOISTED */); const _hoisted_3$1 = [ _hoisted_2$1 ]; function render$1(_ctx, _cache) { return (openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1)) } var __unplugin_components_6 = { name: 'ri-file-excel-line', render: render$1 }; /* vite-plugin-components disabled */ const _hoisted_1 = { class: "x-icon", viewBox: "0 0 24 24", width: "1.1em", height: "1.1em" }; const _hoisted_2 = /*#__PURE__*/createElementVNode("path", { fill: "currentColor", d: "M5 4h10v4h4v12H5V4ZM3.998 2A.995.995 0 0 0 3 2.992v18.016a1 1 0 0 0 .993.992h16.014A1 1 0 0 0 21 20.992V7l-5-5H3.998ZM10.5 7.5c0 1.577-.456 3.437-1.225 5.153c-.772 1.723-1.814 3.197-2.9 4.066l1.18 1.613c2.927-1.952 6.168-3.29 9.303-2.842l.458-1.939C14.644 12.661 12.5 9.99 12.5 7.5h-2Zm.6 5.972c.267-.597.504-1.216.704-1.843a9.66 9.66 0 0 0 1.706 1.966c-.982.176-1.944.465-2.875.833c.165-.314.32-.633.465-.956Z" }, null, -1 /* HOISTED */); const _hoisted_3 = [ _hoisted_2 ]; function render(_ctx, _cache) { return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3)) } var __unplugin_components_5 = { name: 'ri-file-pdf2-line', render }; /* vite-plugin-components disabled */ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _isSlot(s) { return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s); } var MultipleFlowList = defineComponent({ name: "UploadMultipleFlowList", props: _objectSpread(_objectSpread({}, commonProps), {}, { showThumbnail: Boolean, uploadFiles: Function, cancelUpload: Function, dragEvents: Object, disabled: Boolean, isBatchUpload: Boolean, draggable: Boolean, onPreview: Function }), setup: function setup(props, _ref) { var slots = _ref.slots; var _toRefs = toRefs(props), uploading = _toRefs.uploading, disabled = _toRefs.disabled, displayFiles = _toRefs.displayFiles, classPrefix = _toRefs.classPrefix, accept = _toRefs.accept; var uploadPrefix = computed(function () { return "".concat(classPrefix.value, "-upload"); }); var locale = computed(function () { return props.locale; }); var renderTNodeJSX = useTNodeJSX(); var drag = useDrag(props.dragEvents, accept); var currentPreviewFile = ref([]); var previewIndex = ref(0); var uploadText = computed(function () { if (uploading.value) return "".concat(locale.value.progress.uploadingText); return locale.value.triggerUploadText.normal; }); var innerDragEvents = computed(function () { var draggable = props.draggable === void 0 ? true : props.draggable; return draggable ? { onDrop: drag.handleDrop, onDragenter: drag.handleDragenter, onDragover: drag.handleDragover, onDragleave: drag.handleDragleave } : {}; }); var getStatusMap = function getStatusMap() { var iconMap = { success: createVNode(__unplugin_components_0, null, null), fail: createVNode(__unplugin_components_1, null, null), progress: createVNode(Loading, null, null), waiting: createVNode(__unplugin_components_2, null, null) }; var progress = locale.value.progress; var textMap = { success: progress === null || progress === void 0 ? void 0 : progress.successText, fail: progress === null || progress === void 0 ? void 0 : progress.failText, progress: progress === null || progress === void 0 ? void 0 : progress.uploadingText, waiting: progress === null || progress === void 0 ? void 0 : progress.waitingText }; return { iconMap: iconMap, textMap: textMap }; }; var renderEmpty = function renderEmpty() { return createVNode("div", { "class": "".concat(uploadPrefix.value, "__flow-empty") }, [drag.dragActive.value ? locale.value.dragger.dragDropText : locale.value.dragger.clickAndDragText]); }; var renderImgItem = function renderImgItem(file, index) { var _getStatusMap = getStatusMap(), iconMap = _getStatusMap.iconMap, textMap = _getStatusMap.textMap; var fileName = props.abridgeName && file.name ? abridgeName.apply(void 0, [file.name].concat(_toConsumableArray(props.abridgeName))) : file.name; return createVNode("li", { "class": "".concat(uploadPrefix.value, "__card-item"), "key": file.name + index + file.percent + file.status || "0" }, [createVNode("div", { "class": ["".concat(uploadPrefix.value, "__card-content"), _defineProperty({}, "".concat(classPrefix.value, "-is-bordered"), file.status !== "waiting")] }, [["fail", "progress"].includes(file.status) && createVNode("div", { "class": "".concat(uploadPrefix.value, "__card-status-wrap ").concat(uploadPrefix.value, "__").concat(props.theme, "-").concat(file.status) }, [iconMap[file.status], createVNode("p", null, [textMap[file.status], props.showUploadProgress && file.status === "progress" ? " ".concat(file.percent, "%") : ""])]), (["waiting", "success"].includes(file.status) || !file.status && file.url) && createVNode(Image, { "class": "".concat(uploadPrefix.value, "__card-image"), "src": file.url || file.raw, "error": "", "loading": "" }, null), createVNode("div", { "class": "".concat(uploadPrefix.value, "__card-mask") }, [file.url && createVNode("span", { "class": "".concat(uploadPrefix.value, "__card-mask-item") }, [createVNode(__unplugin_components_3, { "onClick": function onClick(_ref3) { var _props$onPreview; var e = _ref3.e; previewIndex.value = index; currentPreviewFile.value = displayFiles.value; (_props$onPreview = props.onPreview) === null || _props$onPreview === void 0 ? void 0 : _props$onPreview.call(props, { file: file, index: index, e: e }); } }, null), createVNode("span", { "class": "".concat(uploadPrefix.value, "__card-mask-item-divider") }, null)]), !disabled.value && createVNode("span", { "class": "".concat(uploadPrefix.value, "__card-mask-item ").concat(uploadPrefix.value, "__delete"), "onClick": function onClick(e) { return props.onRemove({ e: e, index: index, file: file }); } }, [createVNode(__unplugin_components_4, null, null)])])]), createVNode("p", { "class": "".concat(uploadPrefix.value, "__card-name") }, [fileName])]); }; var renderStatus = function renderStatus(file) { var _getStatusMap2 = getStatusMap(), iconMap = _getStatusMap2.iconMap, textMap = _getStatusMap2.textMap; return createVNode("div", { "class": "".concat(uploadPrefix.value, "__flow-status") }, [iconMap[file.status], createVNode("span", { "class": "".concat(uploadPrefix.value, "__").concat(props.theme, "-").concat(file.status) }, [textMap[file.status], props.showUploadProgress && file.status === "progress" ? " ".concat(file.percent || 0, "%") : ""])]); }; var renderNormalActionCol = function renderNormalActionCol(file, index) { var _locale$value; return createVNode("td", null, [createVNode(Button, { "theme": "primary", "variant": "text", "content": (_locale$value = locale.value) === null || _locale$value === void 0 || (_locale$value = _locale$value.triggerUploadText) === null || _locale$value === void 0 ? void 0 : _locale$value["delete"], "class": "".concat(uploadPrefix.value, "__delete"), "onClick": function onClick(e) { return props.onRemove({ e: e, index: index, file: file }); } }, null)]); }; var renderBatchActionCol = function renderBatchActionCol(index) { var _locale$value2; return index === 0 ? createVNode("td", { "rowSpan": displayFiles.value.length, "class": "".concat(uploadPrefix.value, "__flow-table__batch-row") }, [createVNode(Button, { "theme": "primary", "variant": "text", "content": (_locale$value2 = locale.value) === null || _locale$value2 === void 0 || (_locale$value2 = _locale$value2.triggerUploadText) === null || _locale$value2 === void 0 ? void 0 : _locale$value2["delete"], "class": "".concat(uploadPrefix.value, "__delete"), "onClick": function onClick(e) { return props.onRemove({ e: e, index: -1, file: void 0 }); } }, null)]) : null; }; var getFileThumbnailIcon = function getFileThumbnailIcon(fileType) { if (FILE_PDF_REGEXP.test(fileType)) { return createVNode(__unplugin_components_5, null, null); } if (FILE_EXCEL_REGEXP.test(fileType)) { return createVNode(__unplugin_components_6, null, null); } if (FILE_WORD_REGEXP.test(fileType)) { return createVNode(__unplugin_components_7, null, null); } if (FILE_PPT_REGEXP.test(fileType)) { return createVNode(__unplugin_components_8, null, null); } if (VIDEO_REGEXP.test(fileType)) { return createVNode(__unplugin_components_9, null, null); } return createVNode(__unplugin_components_10, null, null); }; var renderFileThumbnail = function renderFileThumbnail(file) { if (!file || !file.raw && file.url) return null; var fileType = file.raw.type; var className = "".concat(uploadPrefix.value, "__file-thumbnail"); if (IMAGE_REGEXP.test(fileType)) { return createVNode(Image, { "class": className, "src": file.url || file.raw, "fit": "scale-down", "error": "", "loading": "", "onClick": function onClick(e) { var _props$onPreview2; e.preventDefault(); currentPreviewFile.value = [file]; previewIndex.value = 0; (_props$onPreview2 = props.onPreview) === null || _props$onPreview2 === void 0 ? void 0 : _props$onPreview2.call(props, { file: file, index: 0, e: e }); } }, null); } return createVNode("div", { "class": className }, [getFileThumbnailIcon(fileType)]); }; var renderFileList = function renderFileList() { var _locale$value$file, _locale$value$file2, _locale$value$file3, _locale$value$file4; var customList = renderTNodeJSX("fileListDisplay", { params: { files: props.displayFiles, dragEvents: innerDragEvents.value } }); if (customList || props.fileListDisplay) return customList; return createVNode("table", mergeProps({ "class": "".concat(uploadPrefix.value, "__flow-table") }, innerDragEvents.value), [createVNode("thead", null, [createVNode("tr", null, [createVNode("th", null, [(_locale$value$file = locale.value.file) === null || _locale$value$file === void 0 ? void 0 : _locale$value$file.fileNameText]), createVNode("th", { "style": { minWidth: "120px" } }, [(_locale$value$file2 = locale.value.file) === null || _locale$value$file2 === void 0 ? void 0 : _locale$value$file2.fileSizeText]), createVNode("th", { "style": { minWidth: "120px" } }, [(_locale$value$file3 = locale.value.file) === null || _locale$value$file3 === void 0 ? void 0 : _locale$value$file3.fileStatusText]), disabled.value ? null : createVNode("th", null, [(_locale$value$file4 = locale.value.file) === null || _locale$value$file4 === void 0 ? void 0 : _locale$value$file4.fileOperationText])])]), createVNode("tbody", null, [!displayFiles.value.length && createVNode("tr", null, [createVNode("td", { "colSpan": 4 }, [renderEmpty()])]), displayFiles.value.map(function (file, index) { var _props$abridgeName; var showBatchUploadAction = props.isBatchUpload; var deleteNode = showBatchUploadAction && displayFiles.value.every(function (item) { return item.status === "success" || !item.status; }) ? renderBatchActionCol(index) : renderNormalActionCol(file, index); var fileName = (_props$abridgeName = props.abridgeName) !== null && _props$abridgeName !== void 0 && _props$abridgeName.length ? abridgeName.apply(void 0, [file.name].concat(_toConsumableArray(props.abridgeName))) : file.name; var thumbnailNode = props.showThumbnail ? createVNode("div", { "class": "".concat(uploadPrefix.value, "__file-info") }, [renderFileThumbnail(file), fileName]) : fileName; var fileNameNode = file.url ? createVNode(Link, { "href": file.url, "target": "_blank", "hover": "color" }, _isSlot(thumbnailNode) ? thumbnailNode : { "default": function _default() { return [thumbnailNode]; } }) : thumbnailNode; return createVNode("tr", { "key": file.name + index + file.size }, [createVNode("td", { "class": "".concat(uploadPrefix.value, "__file-name"), "key": file.name + file.url }, [fileNameNode]), createVNode("td", null, [returnFileSize(file.size)]), createVNode("td", null, [renderStatus(file)]), disabled.value ? null : deleteNode]); })])]); }; var renderImageList = function renderImageList() { var customList = renderTNodeJSX("fileListDisplay", { params: { files: props.displayFiles, dragEvents: innerDragEvents.value } }); if (customList || props.fileListDisplay) return customList; return createVNode("ul", { "class": "".concat(uploadPrefix.value, "__card clearfix") }, [props.displayFiles.map(function (file, index) { return renderImgItem(file, index); })]); }; return function () { var _slots$default, _locale$value3; var cardClassName = "".concat(uploadPrefix.value, "__flow-card-area"); return createVNode("div", { "class": "".concat(uploadPrefix.value, "__flow ").concat(uploadPrefix.value, "__flow-").concat(props.theme) }, [createVNode("div", { "class": "".concat(uploadPrefix.value, "__flow-op") }, [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots), props.placeholder && createVNode("small", { "class": "".concat(uploadPrefix.value, "__flow-placeholder ").concat(uploadPrefix.value, "__placeholder") }, [props.placeholder])]), props.theme === "image-flow" && createVNode("div", mergeProps({ "class": cardClassName }, innerDragEvents.value), [displayFiles.value.length ? renderImageList() : renderEmpty()]), props.theme === "file-flow" && (displayFiles.value.length ? renderFileList() : createVNode("div", mergeProps({ "class": cardClassName }, innerDragEvents.value), [renderEmpty()])), !props.autoUpload && createVNode("div", { "class": "".concat(uploadPrefix.value, "__flow-bottom") }, [createVNode(Button, { "theme": "default", "disabled": disabled.value || !uploading.value, "content": (_locale$value3 = locale.value) === null || _locale$value3 === void 0 ? void 0 : _locale$value3.cancelUploadText, "class": "".concat(uploadPrefix.value, "__cancel"), "onClick": function onClick(e) { var _props$cancelUpload; return (_props$cancelUpload = props.cancelUpload) === null || _props$cancelUpload === void 0 ? void 0 : _props$cancelUpload.call(props, { e: e }); } }, null), createVNode(Button, { "disabled": disabled.value || uploading.value || !displayFiles.value.length, "theme": "primary", "loading": uploading.value, "class": "".concat(uploadPrefix.value, "__continue"), "content": uploadText.value, "onClick": function onClick() { var _props$uploadFiles; return (_props$uploadFiles = props.uploadFiles) === null || _props$uploadFiles === void 0 ? void 0 : _props$uploadFiles.call(props); } }, null)]), createVNode(ImageViewer, { "images": currentPreviewFile.value.map(function (t) { return t.url || t.raw; }), "visible": !!currentPreviewFile.value.length, "onClose": function onClose() { currentPreviewFile.value = []; }, "index": previewIndex.value, "onIndexChange": function onIndexChange(val) { return previewIndex.value = val; } }, null)]); }; } }); export { MultipleFlowList as default }; //# sourceMappingURL=multiple-flow-list.mjs.map