Skip to content

Commit

Permalink
fix: table rows can not be added
Browse files Browse the repository at this point in the history
  • Loading branch information
m-risto committed Sep 16, 2024
1 parent 5d40bc3 commit dc1aa87
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
@if(tableHandles()?.show){ @if(showRowHandle() && rowOptions()){
<div #rowHandle class="absolute">
<!-- This is already checked, that its not undefined-->
<bna-table-handle [options]="$any(rowOptions())" />
</div>
} @if(showColumnHandle() && columnOptions()){
<div #colHandle class="absolute">
<!-- This is already checked, that its not undefined-->
<bna-table-handle [options]="$any(columnOptions())" />
</div>
} }
@if (tableHandles()?.show) {
@if (showRowHandle() && rowOptions()) {
<div #rowHandle class="fixed">
<!-- This is already checked, that its not undefined-->
<bna-table-handle [options]="$any(rowOptions())" />
</div>
}
@if (showColumnHandle() && columnOptions()) {
<div #colHandle class="fixed">
<!-- This is already checked, that its not undefined-->
<bna-table-handle [options]="$any(columnOptions())" />
</div>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ export class BnaTableHandlesController implements AfterViewInit {
if (!options) {
return;
}
const columnHandleOptions: TableHandleOptions = {
const rowHandleOptions: TableHandleOptions = {
...options,
orientation: 'column',
orientation: 'row',
showOtherHandle: () => {
this.showColumnHandle.set(true);
},
hideOtherHandle: () => {
this.showColumnHandle.set(false);
},
};
return columnHandleOptions;
return rowHandleOptions;
});
columnOptions = computed(() => {
const options = this.options();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
<hlm-icon size="sm" [name]="icon()" />
</button>
<div
class="absolute inset-y-0 left-[40px]"
class="absolute inset-y-0 left-[40px] border border-border"
#menu
[ngClass]="{ hidden: !isMenuOpened }"
>
<bna-table-handle-menu class="w-full" [options]="optionsWithCloseMenu()" />

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ async function useTableHandlePosition(
},
floatings[orientation],
{
strategy:'fixed',
placement: orientation === 'row' ? 'left' : 'top',
middleware: [offset(orientation === 'row' ? -5 : -12)],
}
Expand Down

0 comments on commit dc1aa87

Please sign in to comment.