-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add upload file list with progress (#1825)
- Loading branch information
1 parent
6f226fa
commit cf85404
Showing
12 changed files
with
325 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div | ||
v-if="filesInUploadCount > 0" | ||
class="upload-files" | ||
v-bind:class="{ closed: !open }" | ||
> | ||
<div class="card floating"> | ||
<div class="card-title"> | ||
<h2>{{ $t("prompts.uploadFiles", { files: filesInUploadCount }) }}</h2> | ||
|
||
<button | ||
class="action" | ||
@click="toggle" | ||
aria-label="Toggle file upload list" | ||
title="Toggle file upload list" | ||
> | ||
<i class="material-icons">{{ | ||
open ? "keyboard_arrow_down" : "keyboard_arrow_up" | ||
}}</i> | ||
</button> | ||
</div> | ||
|
||
<div class="card-content file-icons"> | ||
<div | ||
class="file" | ||
v-for="file in filesInUpload" | ||
:key="file.id" | ||
:data-type="file.type" | ||
:aria-label="file.name" | ||
> | ||
<div class="file-name"> | ||
<i class="material-icons"></i> {{ file.name }} | ||
</div> | ||
<div class="file-progress"> | ||
<div v-bind:style="{ width: file.progress + '%' }"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters } from "vuex"; | ||
export default { | ||
name: "uploadFiles", | ||
data: function () { | ||
return { | ||
open: false, | ||
}; | ||
}, | ||
computed: { | ||
...mapGetters(["filesInUpload", "filesInUploadCount"]), | ||
}, | ||
methods: { | ||
toggle: function () { | ||
this.open = !this.open; | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.