Add button setting to grid and allow removing all buttons

This commit is contained in:
Andrew Kingston 2023-11-01 11:40:27 +00:00
parent 234cdbbf24
commit 0921bcf333
2 changed files with 18 additions and 5 deletions

View File

@ -19,7 +19,7 @@
componentBindings: componentBindings || [], componentBindings: componentBindings || [],
bindings, bindings,
removeButton, removeButton,
canRemove: buttonCount > 1, canRemove: true,
} }
const sanitizeValue = val => { const sanitizeValue = val => {
@ -86,11 +86,11 @@
focus={focusItem} focus={focusItem}
draggable={buttonCount > 1} draggable={buttonCount > 1}
/> />
<div class="list-footer" on:click={addButton}>
<div class="add-button">Add button</div>
</div>
{/if} {/if}
<div class="list-footer" on:click={addButton} class:empty={!buttonCount}>
<div class="add-button">Add button</div>
</div>
</div> </div>
<style> <style>
@ -120,6 +120,9 @@
var(--spectrum-table-border-color, var(--spectrum-alias-border-color-mid)); var(--spectrum-table-border-color, var(--spectrum-alias-border-color-mid));
cursor: pointer; cursor: pointer;
} }
.list-footer.empty {
border-radius: 4px;
}
.add-button { .add-button {
margin: var(--spacing-s); margin: var(--spacing-s);

View File

@ -5858,6 +5858,16 @@
"label": "High contrast", "label": "High contrast",
"key": "stripeRows", "key": "stripeRows",
"defaultValue": false "defaultValue": false
},
{
"section": true,
"name": "Buttons",
"settings": [
{
"type": "buttonConfiguration",
"key": "buttons"
}
]
} }
] ]
}, },