Files
nextcloud-server-mirror/dist/FilesViewFileDropEmptyContent-CTBQ_08j.chunk.mjs.map
2026-10-07 08:58:40 +00:00

1 line
7.6 KiB
Plaintext

{"version":3,"file":"FilesViewFileDropEmptyContent-CTBQ_08j.chunk.mjs","sources":["../node_modules/@mdi/svg/svg/cloud-upload-outline.svg?raw","../apps/files_sharing/src/public/views/FilesViewFileDropEmptyContent.vue"],"sourcesContent":["export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" id=\\\"mdi-cloud-upload-outline\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M6.5 20Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13Q12.18 20 11.59 19.41 11 18.83 11 18V12.85L9.4 14.4L8 13L12 9L16 13L14.6 14.4L13 12.85V18H18.5Q19.55 18 20.27 17.27 21 16.55 21 15.5 21 14.45 20.27 13.73 19.55 13 18.5 13H17V11Q17 8.93 15.54 7.46 14.08 6 12 6 9.93 6 8.46 7.46 7 8.93 7 11H6.5Q5.05 11 4.03 12.03 3 13.05 3 14.5 3 15.95 4.03 17 5.05 18 6.5 18H9V20M12 13Z\\\" /></svg>\"","<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<NcEmptyContent\n\t\tclass=\"file-drop-empty-content\"\n\t\tdata-cy-files-sharing-file-drop\n\t\t:name=\"name\">\n\t\t<template #icon>\n\t\t\t<NcIconSvgWrapper :svg=\"svgCloudUpload\" />\n\t\t</template>\n\t\t<template #description>\n\t\t\t<p>\n\t\t\t\t{{ shareNote || t('files_sharing', 'Upload files to {foldername}.', { foldername }) }}\n\t\t\t</p>\n\t\t\t<p v-if=\"disclaimer\">\n\t\t\t\t{{ t('files_sharing', 'By uploading files, you agree to the terms of service.') }}\n\t\t\t</p>\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"getSortedUploads().length\"\n\t\t\t\tclass=\"file-drop-empty-content__note-card\"\n\t\t\t\ttype=\"success\">\n\t\t\t\t<h2 id=\"file-drop-empty-content__heading\">\n\t\t\t\t\t{{ t('files_sharing', 'Successfully uploaded files') }}\n\t\t\t\t</h2>\n\t\t\t\t<ul aria-labelledby=\"file-drop-empty-content__heading\" class=\"file-drop-empty-content__list\">\n\t\t\t\t\t<li v-for=\"file in getSortedUploads()\" :key=\"file\">\n\t\t\t\t\t\t{{ file }}\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</NcNoteCard>\n\t\t</template>\n\t\t<template #action>\n\t\t\t<template v-if=\"disclaimer\">\n\t\t\t\t<!-- Terms of service if enabled -->\n\t\t\t\t<NcButton variant=\"primary\" @click=\"showDialog = true\">\n\t\t\t\t\t{{ t('files_sharing', 'View terms of service') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcDialog\n\t\t\t\t\tv-model:open=\"showDialog\"\n\t\t\t\t\tcloseOnClickOutside\n\t\t\t\t\tcontentClasses=\"terms-of-service-dialog\"\n\t\t\t\t\t:name=\"t('files_sharing', 'Terms of service')\"\n\t\t\t\t\t:message=\"disclaimer\" />\n\t\t\t</template>\n\t\t\t<NcUploadPicker\n\t\t\t\t:content=\"getContent\"\n\t\t\t\t:destination=\"uploadDestination\"\n\t\t\t\tdirectory\n\t\t\t\t:label=\"t('files_sharing', 'Upload')\"\n\t\t\t\tmultiple />\n\t\t</template>\n\t</NcEmptyContent>\n</template>\n\n<script lang=\"ts\">\n// We need this on module level rather than on the instance as view will be refreshed by the files app after uploading\nconst uploads = new Set<string>()\n</script>\n\n<script setup lang=\"ts\">\nimport svgCloudUpload from '@mdi/svg/svg/cloud-upload-outline.svg?raw'\nimport { getUploader, UploadStatus } from '@nextcloud/files/upload'\nimport { loadState } from '@nextcloud/initial-state'\nimport { translate as t } from '@nextcloud/l10n'\nimport { basename } from '@nextcloud/paths'\nimport { ref } from 'vue'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcDialog from '@nextcloud/vue/components/NcDialog'\nimport NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'\nimport NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'\nimport NcNoteCard from '@nextcloud/vue/components/NcNoteCard'\nimport NcUploadPicker from '@nextcloud/vue/components/NcUploadPicker'\n\ndefineProps<{\n\tfoldername: string\n}>()\n\nconst disclaimer = loadState<string>('files_sharing', 'disclaimer', '')\nconst shareLabel = loadState<string>('files_sharing', 'label', '')\nconst shareNote = loadState<string>('files_sharing', 'note', '')\n\nconst name = shareLabel || t('files_sharing', 'File drop')\n\nconst showDialog = ref(false)\nconst uploadDestination = getUploader().destination\n\ngetUploader()\n\t.addEventListener('uploadFinished', ({ detail: upload }) => {\n\t\t// only leaf uploads are files, a folder upload is reported with its children\n\t\tif (upload.status === UploadStatus.FINISHED && upload.children.length === 0) {\n\t\t\tuploads.add(decodeURIComponent(basename(upload.source)))\n\t\t}\n\t})\n\n/**\n * The destination folder has no listing, so nothing can conflict with an upload\n */\nasync function getContent() {\n\treturn []\n}\n\n/**\n * Get the previous uploads as sorted list\n */\nfunction getSortedUploads() {\n\treturn [...uploads].sort((a, b) => a.localeCompare(b))\n}\n</script>\n\n<style scoped lang=\"scss\">\n.file-drop-empty-content {\n\tmargin: auto;\n\tmax-width: max(50vw, 300px);\n\n\t.file-drop-empty-content__note-card {\n\t\twidth: fit-content;\n\t\tmargin-inline: auto;\n\t}\n\n\t#file-drop-empty-content__heading {\n\t\tmargin-block: 0 10px;\n\t\tfont-weight: bold;\n\t\tfont-size: 20px;\n\t}\n\n\t.file-drop-empty-content__list {\n\t\tlist-style: inside;\n\t\tmax-height: min(350px, 33vh);\n\t\toverflow-y: scroll;\n\t\tpadding-inline-end: calc(2 * var(--default-grid-baseline));\n\t}\n\n\t:deep(.terms-of-service-dialog) {\n\t\tmin-height: min(100px, 20vh);\n\t}\n\n\t/* TODO fix in library */\n\t:deep(.empty-content__action) {\n\t\tdisplay: flex;\n\t\tgap: var(--default-grid-baseline);\n\t}\n}\n</style>\n"],"names":["svgCloudUpload","uploads","disclaimer","loadState","shareLabel","shareNote","name","t","showDialog","ref","uploadDestination","getUploader","upload","UploadStatus","basename","getContent","getSortedUploads","a","b","_createBlock","_unref","NcEmptyContent","_createVNode","NcIconSvgWrapper","_createElementVNode","_toDisplayString","__props","_openBlock","_createElementBlock","NcNoteCard","_hoisted_2","_hoisted_3","_Fragment","_renderList","file","NcButton","NcDialog","$event","NcUploadPicker"],"mappings":"2yCAAA,MAAAA,EAAe,kyBC0DTC,MAAc,+EAqBpB,MAAMC,EAAaC,EAAkB,gBAAiB,aAAc,EAAE,EAChEC,EAAaD,EAAkB,gBAAiB,QAAS,EAAE,EAC3DE,EAAYF,EAAkB,gBAAiB,OAAQ,EAAE,EAEzDG,EAAOF,GAAcG,EAAE,gBAAiB,WAAW,EAEnDC,EAAaC,EAAI,EAAK,EACtBC,EAAoBC,IAAc,YAExCA,EAAA,EACE,iBAAiB,iBAAkB,CAAC,CAAE,OAAQC,KAAa,CAEvDA,EAAO,SAAWC,EAAa,UAAYD,EAAO,SAAS,SAAW,GACzEX,EAAQ,IAAI,mBAAmBa,EAASF,EAAO,MAAM,CAAC,CAAC,CAEzD,CAAC,EAKF,eAAeG,GAAa,CAC3B,MAAO,CAAA,CACR,CAKA,SAASC,GAAmB,CAC3B,MAAO,CAAC,GAAGf,CAAO,EAAE,KAAK,CAACgB,EAAGC,IAAMD,EAAE,cAAcC,CAAC,CAAC,CACtD,mBAvGCC,EAgDiBC,EAAAC,CAAA,EAAA,CA/ChB,MAAM,0BACN,kCAAA,GACC,KAAMD,EAAAd,CAAA,CAAA,GACI,OACV,IAA0C,CAA1CgB,EAA0CF,EAAAG,CAAA,EAAA,CAAvB,IAAKH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