Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnexcodev committed Oct 23, 2024
1 parent 5193694 commit 4535b5f
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,6 @@ export const ToniqListTable = defineToniqElement<ListTableInputs>()({
}

function listItem(columnItem: ListTableColumn) {
const rowItems = rows.map(
(
row,
): {
contents: HtmlInterpolation;
rowActions: typeof row.rowActions;
} => ({
contents: row.cells[columnItem.key as keyof typeof row],
rowActions: row.rowActions,
}),
);

function calculateLeft(columnKey: string) {
const wrapperEl = host.shadowRoot.querySelector(
`.column-wrapper[data-column="${columnKey}"]`,
Expand Down Expand Up @@ -378,11 +366,19 @@ export const ToniqListTable = defineToniqElement<ListTableInputs>()({
isSticky ? calculateLeft(columnItem.key as string) : undefined,
)}
>
${guard([rowItems], () =>
${guard([rows], () =>
repeat(
rowItems,
(rowItem) => rowItem,
(rowItem, rowIndex) => {
rows,
(row) => row.cells[columnItem.key as keyof typeof row],
(row, rowIndex) => {
const rowItem = {
contents: row.cells[columnItem.key as keyof typeof row],
rowActions: row.rowActions,
} as {
contents: HtmlInterpolation;
rowActions: typeof row.rowActions;
};
return html`
<div
class="column-content"
Expand Down

0 comments on commit 4535b5f

Please sign in to comment.