Ensure side panel ejection works properly and tidy up table block structure

This commit is contained in:
Andrew Kingston 2022-11-17 14:18:55 +00:00
parent 64828e3b06
commit 4e519d75b4
3 changed files with 45 additions and 43 deletions

View File

@ -3667,7 +3667,7 @@
"Ascending",
"Descending"
],
"defaultValue": "Descending"
"defaultValue": "Ascending"
},
{
"type": "number",
@ -4578,7 +4578,7 @@
"type": "boolean",
"key": "showTitleButton",
"label": "Show button above table",
"defaultValue": true
"defaultValue": false
},
{
"type": "text",

View File

@ -39,9 +39,7 @@
hidden
class="side-panel"
>
{#if open}
<slot />
{/if}
<slot />
</div>
<style>

View File

@ -184,7 +184,7 @@
props={{
dataSource,
filter: enrichedFilter,
sortColumn: sortColumn || normalFields?.[0],
sortColumn,
sortOrder,
paginate,
limit: rowCount,
@ -206,45 +206,49 @@
}}
/>
</BlockComponent>
<BlockComponent
type="sidepanel"
bind:id={detailsSidePanelId}
context="details-side-panel"
order={2}
>
{#if clickBehaviour === "details"}
<BlockComponent
type="formblock"
props={{
dataSource,
showSaveButton: true,
showDeleteButton: true,
actionType: "Update",
rowId: `{{ ${safe("state")}.${safe(stateKey)} }}`,
fields: normalFields,
title: "Row Details",
labelPosition: "left",
}}
/>
</BlockComponent>
<BlockComponent
type="sidepanel"
bind:id={newRowSidePanelId}
context="new-side-panel"
order={3}
>
type="sidepanel"
bind:id={detailsSidePanelId}
context="details-side-panel"
order={2}
>
<BlockComponent
type="formblock"
props={{
dataSource,
showSaveButton: true,
showDeleteButton: true,
actionType: "Update",
rowId: `{{ ${safe("state")}.${safe(stateKey)} }}`,
fields: normalFields,
title: "Row Details",
labelPosition: "left",
}}
/>
</BlockComponent>
{/if}
{#if showTitleButton && titleButtonClickBehaviour === "new"}
<BlockComponent
type="formblock"
props={{
dataSource,
showSaveButton: true,
showDeleteButton: false,
actionType: "Create",
fields: normalFields,
title: "Create Row",
labelPosition: "left",
}}
/>
</BlockComponent>
type="sidepanel"
bind:id={newRowSidePanelId}
context="new-side-panel"
order={3}
>
<BlockComponent
type="formblock"
props={{
dataSource,
showSaveButton: true,
showDeleteButton: false,
actionType: "Create",
fields: normalFields,
title: "Create Row",
labelPosition: "left",
}}
/>
</BlockComponent>
{/if}
</BlockComponent>
</Block>
{/if}