diff --git a/packages/bbui/src/Table/AttachmentRenderer.svelte b/packages/bbui/src/Table/AttachmentRenderer.svelte
index 96e9f7ff99..ab9760a980 100644
--- a/packages/bbui/src/Table/AttachmentRenderer.svelte
+++ b/packages/bbui/src/Table/AttachmentRenderer.svelte
@@ -4,10 +4,15 @@
const displayLimit = 5
$: attachments = value?.slice(0, displayLimit) ?? []
$: leftover = (value?.length ?? 0) - attachments.length
+
+ const imageExtensions = ["png", "tiff", "gif", "raw", "jpg", "jpeg"]
+ const isImage = extension => {
+ return imageExtensions.includes(extension?.toLowerCase())
+ }
{#each attachments as attachment}
- {#if attachment.type?.startsWith('image')}
+ {#if isImage(attachment.extension)}
{:else}
{attachment.extension}
diff --git a/packages/bbui/src/Table/CellRenderer.svelte b/packages/bbui/src/Table/CellRenderer.svelte
index 0c14ec2aa5..e45d9696b8 100644
--- a/packages/bbui/src/Table/CellRenderer.svelte
+++ b/packages/bbui/src/Table/CellRenderer.svelte
@@ -7,13 +7,17 @@
export let schema
export let value
+ export let customRenderers = []
const plainTypes = ["string", "options", "number", "longform"]
$: type = schema?.type ?? "string"
+ $: customRenderer = customRenderers?.find(x => x.column === schema?.name)
{#if value != null && value !== ''}
- {#if plainTypes.includes(type)}
+ {#if customRenderer}
+
+ {:else if plainTypes.includes(type)}
{:else if type === 'boolean'}
diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte
index 548e46b607..d002b4c939 100644
--- a/packages/bbui/src/Table/Table.svelte
+++ b/packages/bbui/src/Table/Table.svelte
@@ -16,6 +16,7 @@
export let selectedRows = []
export let customColumnRenderer = SelectEditRenderer
export let customColumnTitle
+ export let customRenderers = []
const dispatch = createEventDispatcher()
@@ -93,7 +94,11 @@
autoColumns.push(field)
}
})
- return columns.sort().concat(autoColumns)
+ return columns
+ .sort((a, b) => {
+ return a.toLowerCase() < b.toLowerCase() ? a : b
+ })
+ .concat(autoColumns)
}
const onScroll = event => {
@@ -181,7 +186,7 @@
{/if}
- {#if allowEditColumns}
+ {#if allowEditColumns && schema[field]?.editable !== false}