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

View File

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