Update multiple settings components to enable more generic usage of column selectors and remove some bespoke copy from generic components. Enable display names for grid columns
This commit is contained in:
parent
e436c1da1c
commit
9fd04cc2c7
|
@ -2,9 +2,4 @@
|
|||
import ColumnEditor from "./ColumnEditor.svelte"
|
||||
</script>
|
||||
|
||||
<ColumnEditor
|
||||
{...$$props}
|
||||
on:change
|
||||
allowCellEditing={false}
|
||||
subject="Dynamic Filter"
|
||||
/>
|
||||
<ColumnEditor {...$$props} on:change allowCellEditing={false} />
|
||||
|
|
|
@ -142,10 +142,10 @@
|
|||
<div class="column">
|
||||
<div class="wide">
|
||||
<Body size="S">
|
||||
By default, all table columns will automatically be shown.
|
||||
By default, all columns will automatically be shown.
|
||||
<br />
|
||||
You can manually control which columns are included in your table,
|
||||
and their appearance, by adding them below.
|
||||
You can manually control which columns are included by adding them
|
||||
below.
|
||||
</Body>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
export let componentInstance
|
||||
export let value = []
|
||||
export let allowCellEditing = true
|
||||
export let subject = "Table"
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
|
@ -78,10 +77,7 @@
|
|||
<div class="column-editor">
|
||||
<ActionButton on:click={open}>Configure columns</ActionButton>
|
||||
</div>
|
||||
<Drawer bind:this={drawer} title="{subject} Columns">
|
||||
<svelte:fragment slot="description">
|
||||
Configure the columns in your {subject.toLowerCase()}.
|
||||
</svelte:fragment>
|
||||
<Drawer bind:this={drawer} title="Columns">
|
||||
<Button cta slot="buttons" on:click={save}>Save</Button>
|
||||
<ColumnDrawer
|
||||
slot="body"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { Button, ActionButton, Drawer } from "@budibase/bbui"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import ColumnDrawer from "./ColumnDrawer.svelte"
|
||||
import ColumnDrawer from "./ColumnEditor/ColumnDrawer.svelte"
|
||||
import { cloneDeep } from "lodash/fp"
|
||||
import {
|
||||
getDatasourceForProvider,
|
||||
|
|
|
@ -5243,11 +5243,10 @@
|
|||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "multifield",
|
||||
"type": "columns/basic",
|
||||
"label": "Columns",
|
||||
"key": "columnWhitelist",
|
||||
"dependsOn": "table",
|
||||
"placeholder": "All columns"
|
||||
"key": "columns",
|
||||
"dependsOn": "table"
|
||||
},
|
||||
{
|
||||
"type": "filter",
|
||||
|
|
|
@ -13,10 +13,23 @@
|
|||
export let initialSortColumn = null
|
||||
export let initialSortOrder = null
|
||||
export let initialRowHeight = null
|
||||
export let columnWhitelist = null
|
||||
export let columns = null
|
||||
|
||||
const component = getContext("component")
|
||||
const { styleable, API, builderStore } = getContext("sdk")
|
||||
|
||||
$: columnWhitelist = columns?.map(col => col.name)
|
||||
$: schemaOverrides = getSchemaOverrides(columns)
|
||||
|
||||
const getSchemaOverrides = columns => {
|
||||
let overrides = {}
|
||||
columns?.forEach(column => {
|
||||
overrides[column.name] = {
|
||||
displayName: column.displayName || column.name,
|
||||
}
|
||||
})
|
||||
return overrides
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
@ -35,6 +48,7 @@
|
|||
{initialSortOrder}
|
||||
{initialRowHeight}
|
||||
{columnWhitelist}
|
||||
{schemaOverrides}
|
||||
showControls={false}
|
||||
allowExpandRows={false}
|
||||
allowSchemaChanges={false}
|
||||
|
|
Loading…
Reference in New Issue