Updated the models.

This commit is contained in:
2022-06-20 08:24:35 -07:00
parent f5e98bee03
commit 6c6778d58e
14 changed files with 661 additions and 3186 deletions

View File

@@ -1,4 +1,6 @@
<script>
import { createEventDispatcher } from 'svelte';
export let rows;
export let columns;
export let rowKey; //Must only be null/undefined if the row is a new object (not associated with a row in the table). Should not change.
@@ -6,6 +8,8 @@
export let actions;
export let selection; //TODO: allow multiple selections? Make selections optional?
const dispatch = createEventDispatcher();
// Setup a width for each column.
columns.forEach(column => {
let min = column.minWidth ? Math.max(10, column.minWidth) : 10;
@@ -72,6 +76,7 @@
selectedRowElement = element;
element.classList.add('selected');
dispatch('selection', selectedRowElement.dataset.key);
}
// Edit row code.