Add filebase improvements

This commit is contained in:
Kelani Tolulope
2023-03-23 09:00:18 +01:00
committed by Jože Fortun
parent 9f172ee6ba
commit dead68f078
7 changed files with 44 additions and 12 deletions
+6 -2
View File
@@ -15,6 +15,8 @@ interface Options {
margin?: number;
backgroundColor?: string;
magnifyOption: string;
enablePreview?: boolean;
enableDownload?: boolean;
}
const PageBlockFileDefaultMode = 'list'
@@ -40,7 +42,9 @@ const defaults: Readonly<Options> = Object.freeze({
borderRadius: undefined,
margin: undefined,
backgroundColor: undefined,
magnifyOption: ''
magnifyOption: '',
enablePreview: true,
enableDownload: true
})
export class PageBlockFile extends PageBlock {
@@ -60,7 +64,7 @@ export class PageBlockFile extends PageBlock {
this.options.attachments = o.attachments
}
Apply(this.options, o, Boolean, 'hideFileName')
Apply(this.options, o, Boolean, 'hideFileName', 'enablePreview', 'enableDownload')
Apply(this.options, o, String, 'backgroundColor', 'magnifyOption')
Apply(this.options, o, Number, 'height', 'width', 'maxHeight', 'maxWidth', 'borderRadius', 'margin')
@@ -1,6 +1,6 @@
<template>
<div class="inline">
<main>
<div class="inline h-100">
<main class="h-100">
<component
:is="previewType"
v-bind="$attrs"
@@ -1,5 +1,5 @@
<template>
<div class="inline">
<div class="inline h-100">
<img
ref="image"
:key="src"
@@ -90,7 +90,7 @@ div {
}
&.inline {
img {
img:not(.disable-zoom-cursor) {
cursor: zoom-in;
}
}