Formatting.

This commit is contained in:
mike12345567 2020-10-15 18:11:36 +01:00
parent 335043440d
commit 7d0231cb75
3 changed files with 38 additions and 23 deletions

View File

@ -3,4 +3,4 @@
export let files
</script>
<AttachmentList {files} on:delete />
<AttachmentList {files} on:delete />

View File

@ -12,7 +12,12 @@
import AgGrid from "@budibase/svelte-ag-grid"
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 datasource = {}
@ -25,7 +30,7 @@
let canEdit = editable && datasource && datasource.type !== "view"
let canAddDelete = editable && datasource && datasource.type === "table"
let modal;
let modal
let store = _bb.store
let dataLoaded = false
@ -153,7 +158,10 @@
on:select={({ detail }) => (selectedRows = detail)} />
{/if}
<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>
</ModalContent>
</Modal>

View File

@ -1,6 +1,6 @@
<script>
import { Modal, ModalContent, Icon } from '@budibase/bbui'
import { createEventDispatcher } from "svelte";
import { Modal, ModalContent, Icon } from "@budibase/bbui"
import { createEventDispatcher } from "svelte"
const dispatch = createEventDispatcher()
import { FILE_TYPES } from "./fileTypes"
@ -9,16 +9,16 @@
export let height = "70"
export let width = "70"
let modal;
let currentFile;
let modal
let currentFile
const openModal = (file) => {
const openModal = file => {
currentFile = file
modal.show()
}
const handleConfirm = () => {
dispatch('delete', currentFile)
dispatch("delete", currentFile)
}
</script>
@ -31,12 +31,19 @@
{:else}<i class="far fa-file" />{/if}
</a>
<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>
{/each}
</div>
<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>
</ModalContent>
</Modal>
@ -67,7 +74,7 @@
position: relative;
}
button {
button {
display: block;
box-sizing: border-box;
position: absolute;
@ -85,18 +92,18 @@
border-radius: var(--border-radius-xl);
background: black;
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;
outline: none;
}
button:hover {
background-color: var(--grey-8);
cursor: pointer;
}
button:active {
background-color: var(--grey-9);
cursor: pointer;
}
}
button:hover {
background-color: var(--grey-8);
cursor: pointer;
}
button:active {
background-color: var(--grey-9);
cursor: pointer;
}
.file {
position: relative;