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", "Ascending",
"Descending" "Descending"
], ],
"defaultValue": "Descending" "defaultValue": "Ascending"
}, },
{ {
"type": "number", "type": "number",
@ -4578,7 +4578,7 @@
"type": "boolean", "type": "boolean",
"key": "showTitleButton", "key": "showTitleButton",
"label": "Show button above table", "label": "Show button above table",
"defaultValue": true "defaultValue": false
}, },
{ {
"type": "text", "type": "text",

View File

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

View File

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