Formatting.
This commit is contained in:
parent
ca5f5f44ac
commit
99b5efc40f
|
@ -3,4 +3,4 @@
|
||||||
export let files
|
export let files
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AttachmentList {files} on:delete />
|
<AttachmentList {files} on:delete />
|
||||||
|
|
|
@ -12,7 +12,12 @@
|
||||||
|
|
||||||
import AgGrid from "@budibase/svelte-ag-grid"
|
import AgGrid from "@budibase/svelte-ag-grid"
|
||||||
import CreateRowButton from "./CreateRow/Button.svelte"
|
import CreateRowButton from "./CreateRow/Button.svelte"
|
||||||
import { TextButton as DeleteButton, Icon, Modal, ModalContent } from "@budibase/bbui"
|
import {
|
||||||
|
TextButton as DeleteButton,
|
||||||
|
Icon,
|
||||||
|
Modal,
|
||||||
|
ModalContent,
|
||||||
|
} from "@budibase/bbui"
|
||||||
|
|
||||||
export let _bb
|
export let _bb
|
||||||
export let datasource = {}
|
export let datasource = {}
|
||||||
|
@ -25,7 +30,7 @@
|
||||||
let canEdit = editable && datasource && datasource.type !== "view"
|
let canEdit = editable && datasource && datasource.type !== "view"
|
||||||
let canAddDelete = editable && datasource && datasource.type === "table"
|
let canAddDelete = editable && datasource && datasource.type === "table"
|
||||||
|
|
||||||
let modal;
|
let modal
|
||||||
|
|
||||||
let store = _bb.store
|
let store = _bb.store
|
||||||
let dataLoaded = false
|
let dataLoaded = false
|
||||||
|
@ -153,7 +158,10 @@
|
||||||
on:select={({ detail }) => (selectedRows = detail)} />
|
on:select={({ detail }) => (selectedRows = detail)} />
|
||||||
{/if}
|
{/if}
|
||||||
<Modal bind:this={modal}>
|
<Modal bind:this={modal}>
|
||||||
<ModalContent title="Confirm Row Deletion" confirmText="Delete" onConfirm={deleteRows} >
|
<ModalContent
|
||||||
|
title="Confirm Row Deletion"
|
||||||
|
confirmText="Delete"
|
||||||
|
onConfirm={deleteRows}>
|
||||||
<span>Are you sure you want to delete {selectedRows.length} row(s)?</span>
|
<span>Are you sure you want to delete {selectedRows.length} row(s)?</span>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal, ModalContent, Icon } from '@budibase/bbui'
|
import { Modal, ModalContent, Icon } from "@budibase/bbui"
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte"
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
import { FILE_TYPES } from "./fileTypes"
|
import { FILE_TYPES } from "./fileTypes"
|
||||||
|
@ -9,16 +9,16 @@
|
||||||
export let height = "70"
|
export let height = "70"
|
||||||
export let width = "70"
|
export let width = "70"
|
||||||
|
|
||||||
let modal;
|
let modal
|
||||||
let currentFile;
|
let currentFile
|
||||||
|
|
||||||
const openModal = (file) => {
|
const openModal = file => {
|
||||||
currentFile = file
|
currentFile = file
|
||||||
modal.show()
|
modal.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
dispatch('delete', currentFile)
|
dispatch("delete", currentFile)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -31,12 +31,19 @@
|
||||||
{:else}<i class="far fa-file" />{/if}
|
{:else}<i class="far fa-file" />{/if}
|
||||||
</a>
|
</a>
|
||||||
<span>{file.name}</span>
|
<span>{file.name}</span>
|
||||||
<div class="button-placement"><button primary on:click|stopPropagation={() => openModal(file)}>×</button></div>
|
<div class="button-placement">
|
||||||
|
<button
|
||||||
|
primary
|
||||||
|
on:click|stopPropagation={() => openModal(file)}>×</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
<Modal bind:this={modal}>
|
<Modal bind:this={modal}>
|
||||||
<ModalContent title="Confirm File Deletion" confirmText="Delete" onConfirm={handleConfirm} >
|
<ModalContent
|
||||||
|
title="Confirm File Deletion"
|
||||||
|
confirmText="Delete"
|
||||||
|
onConfirm={handleConfirm}>
|
||||||
<span>Are you sure you want to delete this attachment?</span>
|
<span>Are you sure you want to delete this attachment?</span>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -67,7 +74,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
display: block;
|
display: block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -85,18 +92,18 @@
|
||||||
border-radius: var(--border-radius-xl);
|
border-radius: var(--border-radius-xl);
|
||||||
background: black;
|
background: black;
|
||||||
transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
|
transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
|
||||||
background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
|
background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
button:hover {
|
button:hover {
|
||||||
background-color: var(--grey-8);
|
background-color: var(--grey-8);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
button:active {
|
button:active {
|
||||||
background-color: var(--grey-9);
|
background-color: var(--grey-9);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file {
|
.file {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
Loading…
Reference in New Issue