From e7eb3dd331e0059ccf366f1411a1be208fec2a2a Mon Sep 17 00:00:00 2001 From: kunish Date: Sun, 10 Sep 2023 17:43:23 +0800 Subject: [PATCH] feat(connections): keyed connection rows and cells --- src/pages/Connections.tsx | 130 +++++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 59 deletions(-) diff --git a/src/pages/Connections.tsx b/src/pages/Connections.tsx index 2ef9809..f34ca04 100644 --- a/src/pages/Connections.tsx +++ b/src/pages/Connections.tsx @@ -1,5 +1,6 @@ import { writeClipboard } from '@solid-primitives/clipboard' import { useI18n } from '@solid-primitives/i18n' +import { Key } from '@solid-primitives/keyed' import { makePersisted } from '@solid-primitives/storage' import { IconCircleX, @@ -321,20 +322,20 @@ export default () => {
- + type}> {(tab) => ( )} - +
@@ -438,64 +439,75 @@ export default () => { - - {(row) => ( - - - {(cell) => ( - { - e.preventDefault() + id}> + {(keyedRow) => { + const row = keyedRow() - const value = cell.renderValue() as null | string - value && writeClipboard(value).catch(() => {}) - }} - > - {cell.getIsGrouped() ? ( - + ) : cell.getIsAggregated() ? ( + flexRender( + cell.column.columnDef.aggregatedCell ?? + cell.column.columnDef.cell, + cell.getContext(), + ) + ) : cell.getIsPlaceholder() ? null : ( + flexRender( cell.column.columnDef.cell, cell.getContext(), - )} -
- -
({row.subRows.length})
- - ) : cell.getIsAggregated() ? ( - flexRender( - cell.column.columnDef.aggregatedCell ?? - cell.column.columnDef.cell, - cell.getContext(), - ) - ) : cell.getIsPlaceholder() ? null : ( - flexRender( - cell.column.columnDef.cell, - cell.getContext(), - ) - )} - - )} - - - )} - + ) + )} + + ) + }} + + + ) + }} +