2020-04-02 06:58:38 +00:00
|
|
|
<template>
|
2021-11-18 09:48:51 +00:00
|
|
|
<div class="file flex flex-row items-center p-3 cursor-pointer">
|
2020-04-02 06:58:38 +00:00
|
|
|
<div class="icon-wrap">
|
2021-11-18 09:48:51 +00:00
|
|
|
<fluent-icon icon="document" size="28" />
|
2020-04-02 06:58:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="meta">
|
|
|
|
<div class="title">
|
|
|
|
{{ title }}
|
|
|
|
</div>
|
2021-11-18 09:48:51 +00:00
|
|
|
<div class="link-wrap mb-1">
|
2020-04-02 06:58:38 +00:00
|
|
|
<a
|
|
|
|
class="download"
|
|
|
|
rel="noreferrer noopener nofollow"
|
|
|
|
target="_blank"
|
|
|
|
:href="url"
|
|
|
|
>
|
|
|
|
{{ $t('COMPONENTS.FILE_BUBBLE.DOWNLOAD') }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-11-18 09:48:51 +00:00
|
|
|
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
|
|
|
|
|
2020-04-02 06:58:38 +00:00
|
|
|
export default {
|
2021-11-18 09:48:51 +00:00
|
|
|
components: {
|
|
|
|
FluentIcon,
|
|
|
|
},
|
2020-04-02 06:58:38 +00:00
|
|
|
props: {
|
|
|
|
url: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
isInProgress: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2020-06-15 08:05:52 +00:00
|
|
|
widgetColor: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
2020-04-02 06:58:38 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
title() {
|
|
|
|
return this.isInProgress
|
|
|
|
? this.$t('COMPONENTS.FILE_BUBBLE.UPLOADING')
|
|
|
|
: decodeURI(this.fileName);
|
|
|
|
},
|
|
|
|
fileName() {
|
|
|
|
const filename = this.url.substring(this.url.lastIndexOf('/') + 1);
|
|
|
|
return filename;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
openLink() {
|
|
|
|
const win = window.open(this.url, '_blank');
|
|
|
|
win.focus();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '~widget/assets/scss/variables.scss';
|
|
|
|
|
|
|
|
.file {
|
|
|
|
.icon-wrap {
|
2020-05-02 04:17:36 +00:00
|
|
|
font-size: $font-size-mega;
|
2020-04-02 06:58:38 +00:00
|
|
|
color: $color-woot;
|
|
|
|
line-height: 1;
|
|
|
|
margin-left: $space-smaller;
|
|
|
|
margin-right: $space-small;
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-weight: $font-weight-medium;
|
2020-05-02 04:17:36 +00:00
|
|
|
font-size: $font-size-default;
|
2020-04-02 06:58:38 +00:00
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.download {
|
2020-05-02 04:17:36 +00:00
|
|
|
color: $color-woot;
|
|
|
|
font-weight: $font-weight-medium;
|
2020-04-02 06:58:38 +00:00
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
font-size: $font-size-small;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.link-wrap {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
.meta {
|
|
|
|
padding-right: $space-smaller;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|