Skip to content

Commit

Permalink
improve delete component of tables
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Feb 25, 2025
1 parent 874dbd9 commit b175730
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@
$: resolvedConfig.afterIcon && afterIconComponent && handleAfterIcon()
function getIconSize() {
switch (resolvedConfig.size as 'xs' | 'sm' | 'md' | 'lg' | 'xl') {
switch (resolvedConfig.size as 'xs' | 'xs2' | 'xs3' | 'sm' | 'md' | 'lg' | 'xl') {
case 'xs':
return 14
case 'xs2':
return 12
case 'xs3':
return 10
case 'sm':
return 16
case 'md':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const buttonColorOptions = [...BUTTON_COLORS]
export const selectOptions = {
buttonColorOptions,
tabsKindOptions: ['tabs', 'sidebar', 'accordion', 'invisibleOnView'],
buttonSizeOptions: ['xs', 'sm', 'md', 'lg', 'xl'],
buttonSizeOptions: ['xs2', 'xs', 'sm', 'md', 'lg', 'xl'],
tableSearchOptions: ['By Component', 'By Runnable', 'Disabled'],
chartThemeOptions: ['theme1', 'theme2', 'theme3'],
textStyleOptions: ['Title', 'Subtitle', 'Body', 'Label', 'Caption'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@
return
}
components = components.filter((x) => x.id !== cid)
delete $errorByComponent[cid]
$selectedComponent = [id]
$app = $app
console.log('items', items)
// Remove the corresponding item from the items array
items = items.filter((item) => item.originalIndex !== index)
}
Expand Down Expand Up @@ -159,7 +158,10 @@
</div>
</div>
<div class="flex flex-row items-center gap-1">
<CloseButton small on:close={() => deleteComponent(component.id, index)} />
<CloseButton
small
on:close={() => deleteComponent(component.id, item.originalIndex)}
/>
</div>
</div>
{#if actionsOrder === undefined}
Expand Down

0 comments on commit b175730

Please sign in to comment.