Skip to content

Commit 9f97cc9

Browse files
committed
[ui-react] Split components into files
1 parent 10ea5e8 commit 9f97cc9

32 files changed

+857
-743
lines changed

src/ui-react-dom/RelationshipInHtmlTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import {objToArray} from '../common/obj.ts';
99
import {isUndefined} from '../common/other.ts';
1010
import {getProps, getRelationshipsStoreTableIds} from '../common/react.ts';
1111
import {DOT, strSplit} from '../common/strings.ts';
12-
import {CellView} from '../ui-react/components.tsx';
1312
import {
1413
useRelationshipsOrRelationshipsById,
1514
useRemoteRowId,
1615
useRowIds,
1716
useTableCellIds,
1817
} from '../ui-react/hooks.ts';
18+
import {CellView} from '../ui-react/index.ts';
1919
import {EditableCellView} from './EditableCellView.tsx';
2020
import {
2121
extraHeaders,

src/ui-react-dom/ResultSortedTableInHtmlTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import type {
33
ResultSortedTableInHtmlTable as ResultSortedTableInHtmlTableDecl,
44
ResultSortedTableInHtmlTableProps,
55
} from '../@types/ui-react-dom/index.js';
6-
import {ResultCellView} from '../ui-react/components.tsx';
76
import {
87
useResultRowCount,
98
useResultSortedRowIds,
109
useResultTableCellIds,
1110
} from '../ui-react/hooks.ts';
11+
import {ResultCellView} from '../ui-react/index.ts';
1212
import {
1313
HtmlTable,
1414
useCells,

src/ui-react-dom/ResultTableInHtmlTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type {
33
ResultTableInHtmlTable as ResultTableInHtmlTableDecl,
44
ResultTableInHtmlTableProps,
55
} from '../@types/ui-react-dom/index.js';
6-
import {ResultCellView} from '../ui-react/components.tsx';
76
import {useResultRowIds, useResultTableCellIds} from '../ui-react/hooks.ts';
7+
import {ResultCellView} from '../ui-react/index.ts';
88
import {
99
HtmlTable,
1010
useCells,

src/ui-react-dom/SliceInHtmlTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import type {
55
SliceInHtmlTableProps,
66
} from '../@types/ui-react-dom/index.js';
77
import {getIndexStoreTableId} from '../common/react.ts';
8-
import {CellView} from '../ui-react/components.tsx';
98
import {
109
useIndexesOrIndexesById,
1110
useSliceRowIds,
1211
useTableCellIds,
1312
} from '../ui-react/hooks.ts';
13+
import {CellView} from '../ui-react/index.ts';
1414
import {EditableCellView} from './EditableCellView.tsx';
1515
import {
1616
HtmlTable,

src/ui-react-dom/SortedTableInHtmlTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import type {
33
SortedTableInHtmlTable as SortedTableInHtmlTableDecl,
44
SortedTableInHtmlTableProps,
55
} from '../@types/ui-react-dom/index.js';
6-
import {CellView} from '../ui-react/components.tsx';
76
import {
87
useRowCount,
98
useSortedRowIds,
109
useTableCellIds,
1110
} from '../ui-react/hooks.ts';
11+
import {CellView} from '../ui-react/index.ts';
1212
import {EditableCellView} from './EditableCellView.tsx';
1313
import {
1414
HtmlTable,

src/ui-react-dom/TableInHtmlTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type {
33
TableInHtmlTable as TableInHtmlTableDecl,
44
TableInHtmlTableProps,
55
} from '../@types/ui-react-dom/index.js';
6-
import {CellView} from '../ui-react/components.tsx';
76
import {useRowIds, useTableCellIds} from '../ui-react/hooks.ts';
7+
import {CellView} from '../ui-react/index.ts';
88
import {EditableCellView} from './EditableCellView.tsx';
99
import {
1010
HtmlTable,

src/ui-react-dom/ValuesInHtmlTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import type {ValueProps} from '../@types/ui-react/index.d.ts';
88
import {arrayMap} from '../common/array.ts';
99
import {getProps} from '../common/react.ts';
1010
import {EXTRA, VALUE} from '../common/strings.ts';
11-
import {ValueView} from '../ui-react/components.tsx';
1211
import {useValueIds} from '../ui-react/hooks.ts';
12+
import {ValueView} from '../ui-react/index.ts';
1313
import {EditableValueView} from './EditableValueView.tsx';
1414
import {extraHeaders, extraKey} from './common.tsx';
1515

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type {BackwardCheckpointsView as BackwardCheckpointsViewDecl} from '../@types/ui-react/index.js';
2+
import {getUseCheckpointView} from './common.tsx';
3+
4+
export const BackwardCheckpointsView: typeof BackwardCheckpointsViewDecl =
5+
getUseCheckpointView((checkpointIds) => checkpointIds[0]);

src/ui-react/CellView.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type {
2+
CellProps,
3+
CellView as CellViewDecl,
4+
} from '../@types/ui-react/index.js';
5+
import {EMPTY_STRING} from '../common/strings.ts';
6+
import {wrap} from './common.tsx';
7+
import {useCell} from './hooks.ts';
8+
9+
export const CellView: typeof CellViewDecl = ({
10+
tableId,
11+
rowId,
12+
cellId,
13+
store,
14+
debugIds,
15+
}: CellProps): any =>
16+
wrap(
17+
EMPTY_STRING + (useCell(tableId, rowId, cellId, store) ?? EMPTY_STRING),
18+
undefined,
19+
debugIds,
20+
cellId,
21+
);

src/ui-react/CheckpointView.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type {
2+
CheckpointProps,
3+
CheckpointView as CheckpointViewDecl,
4+
} from '../@types/ui-react/index.js';
5+
import {EMPTY_STRING} from '../common/strings.ts';
6+
import {wrap} from './common.tsx';
7+
import {useCheckpoint} from './hooks.ts';
8+
9+
export const CheckpointView: typeof CheckpointViewDecl = ({
10+
checkpoints,
11+
checkpointId,
12+
debugIds,
13+
}: CheckpointProps): any =>
14+
wrap(
15+
useCheckpoint(checkpointId, checkpoints) ?? EMPTY_STRING,
16+
undefined,
17+
debugIds,
18+
checkpointId,
19+
);

0 commit comments

Comments
 (0)