react-science 4.1.3 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/about/AboutDialogToolbarButton.d.ts +2 -2
- package/lib/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
- package/lib/app/kinds/ir/IrPeaksPanel.d.ts.map +1 -1
- package/lib/app/kinds/ir/IrPeaksPanel.js +7 -18
- package/lib/app/kinds/ir/IrPeaksPanel.js.map +1 -1
- package/lib/app/panels/SignalProcessingPanel.d.ts.map +1 -1
- package/lib/app/panels/SignalProcessingPanel.js +52 -27
- package/lib/app/panels/SignalProcessingPanel.js.map +1 -1
- package/lib/app/panels/measurements/MeasurementsTable.d.ts.map +1 -1
- package/lib/app/panels/measurements/MeasurementsTable.js +6 -6
- package/lib/app/panels/measurements/MeasurementsTable.js.map +1 -1
- package/lib/app/panels/measurements/measurementPanelContext.d.ts +2 -1
- package/lib/app/panels/measurements/measurementPanelContext.d.ts.map +1 -1
- package/lib/app/panels/measurements/measurementPanelContext.js.map +1 -1
- package/lib/components/color-picker/gradient-select/GradientSelect.d.ts.map +1 -1
- package/lib/components/color-picker/gradient-select/GradientSelect.js +11 -38
- package/lib/components/color-picker/gradient-select/GradientSelect.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Swatch.d.ts +2 -2
- package/lib/components/color-picker/react-color/common/interaction.d.ts +2 -2
- package/lib/components/dialog/ConfirmDialog.js +3 -3
- package/lib/components/dialog/ConfirmDialog.js.map +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib/components/info-panel/InfoPanel.js +24 -19
- package/lib/components/info-panel/InfoPanel.js.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.js +32 -9
- package/lib/components/logger/FifoLoggerDialog.js.map +1 -1
- package/lib/components/root-layout/css-reset/customPreflight.d.ts.map +1 -1
- package/lib/components/table/default_table_cell.d.ts +3 -0
- package/lib/components/table/default_table_cell.d.ts.map +1 -0
- package/lib/components/table/default_table_cell.js +46 -0
- package/lib/components/table/default_table_cell.js.map +1 -0
- package/lib/components/table/index.d.ts +2 -1
- package/lib/components/table/index.d.ts.map +1 -1
- package/lib/components/table/index.js +2 -1
- package/lib/components/table/index.js.map +1 -1
- package/lib/components/table/table_body.d.ts +9 -0
- package/lib/components/table/table_body.d.ts.map +1 -0
- package/lib/components/table/table_body.js +19 -0
- package/lib/components/table/table_body.js.map +1 -0
- package/lib/components/table/table_header.d.ts +8 -0
- package/lib/components/table/table_header.d.ts.map +1 -0
- package/lib/components/table/table_header.js +16 -0
- package/lib/components/table/table_header.js.map +1 -0
- package/lib/components/table/table_header_cell.d.ts +7 -0
- package/lib/components/table/table_header_cell.d.ts.map +1 -0
- package/lib/components/table/table_header_cell.js +22 -0
- package/lib/components/table/table_header_cell.js.map +1 -0
- package/lib/components/table/table_root.d.ts +18 -0
- package/lib/components/table/table_root.d.ts.map +1 -0
- package/lib/components/table/table_root.js +23 -0
- package/lib/components/table/table_root.js.map +1 -0
- package/lib/components/table/table_row_cell.d.ts +7 -0
- package/lib/components/table/table_row_cell.d.ts.map +1 -0
- package/lib/components/table/table_row_cell.js +10 -0
- package/lib/components/table/table_row_cell.js.map +1 -0
- package/lib/components/table/table_utils.d.ts +10 -0
- package/lib/components/table/table_utils.d.ts.map +1 -0
- package/lib/components/table/table_utils.js +8 -0
- package/lib/components/table/table_utils.js.map +1 -0
- package/lib/components/table/use_table_columns.d.ts +4 -0
- package/lib/components/table/use_table_columns.d.ts.map +1 -0
- package/lib/components/table/use_table_columns.js +17 -0
- package/lib/components/table/use_table_columns.js.map +1 -0
- package/lib/components/toolbar/PanelPreferencesToolbar.d.ts +2 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
- package/lib/components/toolbar/Toolbar.d.ts +2 -2
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +2 -2
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib/components/value-renderers/index.d.ts +0 -1
- package/lib/components/value-renderers/index.d.ts.map +1 -1
- package/lib/components/value-renderers/index.js +1 -3
- package/lib/components/value-renderers/index.js.map +1 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.d.ts +2 -2
- package/lib-esm/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
- package/lib-esm/app/kinds/ir/IrPeaksPanel.d.ts.map +1 -1
- package/lib-esm/app/kinds/ir/IrPeaksPanel.js +9 -20
- package/lib-esm/app/kinds/ir/IrPeaksPanel.js.map +1 -1
- package/lib-esm/app/panels/SignalProcessingPanel.d.ts.map +1 -1
- package/lib-esm/app/panels/SignalProcessingPanel.js +54 -29
- package/lib-esm/app/panels/SignalProcessingPanel.js.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementsTable.js +7 -7
- package/lib-esm/app/panels/measurements/MeasurementsTable.js.map +1 -1
- package/lib-esm/app/panels/measurements/measurementPanelContext.d.ts +2 -1
- package/lib-esm/app/panels/measurements/measurementPanelContext.d.ts.map +1 -1
- package/lib-esm/app/panels/measurements/measurementPanelContext.js.map +1 -1
- package/lib-esm/components/color-picker/gradient-select/GradientSelect.d.ts.map +1 -1
- package/lib-esm/components/color-picker/gradient-select/GradientSelect.js +11 -38
- package/lib-esm/components/color-picker/gradient-select/GradientSelect.js.map +1 -1
- package/lib-esm/components/color-picker/react-color/common/Swatch.d.ts +2 -2
- package/lib-esm/components/color-picker/react-color/common/interaction.d.ts +2 -2
- package/lib-esm/components/dialog/ConfirmDialog.js +1 -1
- package/lib-esm/components/dialog/ConfirmDialog.js.map +1 -1
- package/lib-esm/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib-esm/components/info-panel/InfoPanel.js +19 -14
- package/lib-esm/components/info-panel/InfoPanel.js.map +1 -1
- package/lib-esm/components/logger/FifoLoggerDialog.d.ts.map +1 -1
- package/lib-esm/components/logger/FifoLoggerDialog.js +31 -8
- package/lib-esm/components/logger/FifoLoggerDialog.js.map +1 -1
- package/lib-esm/components/root-layout/css-reset/customPreflight.d.ts.map +1 -1
- package/lib-esm/components/table/default_table_cell.d.ts +3 -0
- package/lib-esm/components/table/default_table_cell.d.ts.map +1 -0
- package/lib-esm/components/table/default_table_cell.js +20 -0
- package/lib-esm/components/table/default_table_cell.js.map +1 -0
- package/lib-esm/components/table/index.d.ts +2 -1
- package/lib-esm/components/table/index.d.ts.map +1 -1
- package/lib-esm/components/table/index.js +2 -1
- package/lib-esm/components/table/index.js.map +1 -1
- package/lib-esm/components/table/table_body.d.ts +9 -0
- package/lib-esm/components/table/table_body.d.ts.map +1 -0
- package/lib-esm/components/table/table_body.js +16 -0
- package/lib-esm/components/table/table_body.js.map +1 -0
- package/lib-esm/components/table/table_header.d.ts +8 -0
- package/lib-esm/components/table/table_header.d.ts.map +1 -0
- package/lib-esm/components/table/table_header.js +13 -0
- package/lib-esm/components/table/table_header.js.map +1 -0
- package/lib-esm/components/table/table_header_cell.d.ts +7 -0
- package/lib-esm/components/table/table_header_cell.d.ts.map +1 -0
- package/lib-esm/components/table/table_header_cell.js +19 -0
- package/lib-esm/components/table/table_header_cell.js.map +1 -0
- package/lib-esm/components/table/table_root.d.ts +18 -0
- package/lib-esm/components/table/table_root.d.ts.map +1 -0
- package/lib-esm/components/table/table_root.js +20 -0
- package/lib-esm/components/table/table_root.js.map +1 -0
- package/lib-esm/components/table/table_row_cell.d.ts +7 -0
- package/lib-esm/components/table/table_row_cell.d.ts.map +1 -0
- package/lib-esm/components/table/table_row_cell.js +7 -0
- package/lib-esm/components/table/table_row_cell.js.map +1 -0
- package/lib-esm/components/table/table_utils.d.ts +10 -0
- package/lib-esm/components/table/table_utils.d.ts.map +1 -0
- package/lib-esm/components/table/table_utils.js +5 -0
- package/lib-esm/components/table/table_utils.js.map +1 -0
- package/lib-esm/components/table/use_table_columns.d.ts +4 -0
- package/lib-esm/components/table/use_table_columns.d.ts.map +1 -0
- package/lib-esm/components/table/use_table_columns.js +14 -0
- package/lib-esm/components/table/use_table_columns.js.map +1 -0
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.d.ts +2 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.d.ts +2 -2
- package/lib-esm/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.js +2 -2
- package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
- package/lib-esm/components/value-renderers/index.d.ts +0 -1
- package/lib-esm/components/value-renderers/index.d.ts.map +1 -1
- package/lib-esm/components/value-renderers/index.js +0 -1
- package/lib-esm/components/value-renderers/index.js.map +1 -1
- package/package.json +31 -31
- package/src/app/about/AboutDialogToolbarButton.tsx +2 -2
- package/src/app/kinds/ir/IrPeaksPanel.tsx +15 -51
- package/src/app/panels/SignalProcessingPanel.tsx +99 -82
- package/src/app/panels/measurements/MeasurementsTable.tsx +19 -21
- package/src/app/panels/measurements/measurementPanelContext.tsx +2 -2
- package/src/components/color-picker/gradient-select/GradientSelect.tsx +44 -71
- package/src/components/dialog/ConfirmDialog.tsx +1 -1
- package/src/components/info-panel/InfoPanel.tsx +33 -34
- package/src/components/logger/FifoLoggerDialog.tsx +53 -35
- package/src/components/table/default_table_cell.tsx +20 -0
- package/src/components/table/index.ts +2 -1
- package/src/components/table/table_body.tsx +37 -0
- package/src/components/table/table_header.tsx +31 -0
- package/src/components/table/table_header_cell.tsx +38 -0
- package/src/components/table/table_root.tsx +74 -0
- package/src/components/table/table_row_cell.tsx +17 -0
- package/src/components/table/table_utils.ts +24 -0
- package/src/components/table/use_table_columns.ts +19 -0
- package/src/components/toolbar/PanelPreferencesToolbar.tsx +2 -1
- package/src/components/toolbar/Toolbar.tsx +6 -7
- package/src/components/value-renderers/index.ts +0 -2
- package/lib/components/table/Table.d.ts +0 -17
- package/lib/components/table/Table.d.ts.map +0 -1
- package/lib/components/table/Table.js +0 -38
- package/lib/components/table/Table.js.map +0 -1
- package/lib/components/table/TableHeader.d.ts +0 -5
- package/lib/components/table/TableHeader.d.ts.map +0 -1
- package/lib/components/table/TableHeader.js +0 -16
- package/lib/components/table/TableHeader.js.map +0 -1
- package/lib/components/table/TableRow.d.ts +0 -5
- package/lib/components/table/TableRow.d.ts.map +0 -1
- package/lib/components/table/TableRow.js +0 -44
- package/lib/components/table/TableRow.js.map +0 -1
- package/lib/components/table/tableContext.d.ts +0 -7
- package/lib/components/table/tableContext.d.ts.map +0 -1
- package/lib/components/table/tableContext.js +0 -11
- package/lib/components/table/tableContext.js.map +0 -1
- package/lib/components/value-renderers/Header.d.ts +0 -7
- package/lib/components/value-renderers/Header.d.ts.map +0 -1
- package/lib/components/value-renderers/Header.js +0 -14
- package/lib/components/value-renderers/Header.js.map +0 -1
- package/lib-esm/components/table/Table.d.ts +0 -17
- package/lib-esm/components/table/Table.d.ts.map +0 -1
- package/lib-esm/components/table/Table.js +0 -35
- package/lib-esm/components/table/Table.js.map +0 -1
- package/lib-esm/components/table/TableHeader.d.ts +0 -5
- package/lib-esm/components/table/TableHeader.d.ts.map +0 -1
- package/lib-esm/components/table/TableHeader.js +0 -12
- package/lib-esm/components/table/TableHeader.js.map +0 -1
- package/lib-esm/components/table/TableRow.d.ts +0 -5
- package/lib-esm/components/table/TableRow.d.ts.map +0 -1
- package/lib-esm/components/table/TableRow.js +0 -40
- package/lib-esm/components/table/TableRow.js.map +0 -1
- package/lib-esm/components/table/tableContext.d.ts +0 -7
- package/lib-esm/components/table/tableContext.d.ts.map +0 -1
- package/lib-esm/components/table/tableContext.js +0 -7
- package/lib-esm/components/table/tableContext.js.map +0 -1
- package/lib-esm/components/value-renderers/Header.d.ts +0 -7
- package/lib-esm/components/value-renderers/Header.d.ts.map +0 -1
- package/lib-esm/components/value-renderers/Header.js +0 -11
- package/lib-esm/components/value-renderers/Header.js.map +0 -1
- package/src/components/table/Table.tsx +0 -70
- package/src/components/table/TableHeader.tsx +0 -24
- package/src/components/table/TableRow.tsx +0 -82
- package/src/components/table/tableContext.ts +0 -7
- package/src/components/value-renderers/Header.tsx +0 -18
|
@@ -4,8 +4,8 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
5
5
|
import { CSSProperties, useCallback, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import { createTableColumnHelper, Table } from '../table';
|
|
8
|
+
import * as ValueRenderers from '../value-renderers';
|
|
9
9
|
|
|
10
10
|
export interface InfoPanelData {
|
|
11
11
|
description: string;
|
|
@@ -71,35 +71,51 @@ const style = {
|
|
|
71
71
|
}),
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
+
interface InfoPanelDatum {
|
|
75
|
+
parameter: string;
|
|
76
|
+
value: string | number | object;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const columnHelper = createTableColumnHelper<InfoPanelDatum>();
|
|
80
|
+
const columns = [
|
|
81
|
+
columnHelper.accessor('parameter', {
|
|
82
|
+
header: 'Parameter',
|
|
83
|
+
}),
|
|
84
|
+
columnHelper.accessor('value', {
|
|
85
|
+
header: 'Value',
|
|
86
|
+
cell: ({ getValue }) => valueCell(getValue()),
|
|
87
|
+
}),
|
|
88
|
+
];
|
|
89
|
+
|
|
74
90
|
export function InfoPanel(props: InfoPanelProps) {
|
|
75
91
|
const [search, setSearch] = useState('');
|
|
76
92
|
const { title = 'Information', data = [], titleStyle, inputStyle } = props;
|
|
77
93
|
const viewData = useCallback(
|
|
78
94
|
(data: Record<string, string | number | object>) => {
|
|
79
|
-
const exactMatch:
|
|
80
|
-
const startsWith:
|
|
81
|
-
const includes:
|
|
82
|
-
const valueContains:
|
|
95
|
+
const exactMatch: InfoPanelDatum[] = [];
|
|
96
|
+
const startsWith: InfoPanelDatum[] = [];
|
|
97
|
+
const includes: InfoPanelDatum[] = [];
|
|
98
|
+
const valueContains: InfoPanelDatum[] = [];
|
|
83
99
|
|
|
84
|
-
for (const [
|
|
100
|
+
for (const [parameter, value] of Object.entries(data).sort(([a], [b]) =>
|
|
85
101
|
a.localeCompare(b),
|
|
86
102
|
)) {
|
|
87
|
-
const lowerKey =
|
|
103
|
+
const lowerKey = parameter.toLowerCase();
|
|
88
104
|
const lowerSearch = search.toLowerCase();
|
|
89
105
|
if (lowerKey === lowerSearch) {
|
|
90
|
-
exactMatch.push(
|
|
106
|
+
exactMatch.push({ parameter, value });
|
|
91
107
|
continue;
|
|
92
108
|
}
|
|
93
109
|
if (lowerKey.startsWith(lowerSearch)) {
|
|
94
|
-
startsWith.push(
|
|
110
|
+
startsWith.push({ parameter, value });
|
|
95
111
|
continue;
|
|
96
112
|
}
|
|
97
113
|
if (lowerKey.includes(lowerSearch)) {
|
|
98
|
-
includes.push(
|
|
114
|
+
includes.push({ parameter, value });
|
|
99
115
|
continue;
|
|
100
116
|
}
|
|
101
117
|
if (valueSearch(value, search)) {
|
|
102
|
-
valueContains.push(
|
|
118
|
+
valueContains.push({ parameter, value });
|
|
103
119
|
continue;
|
|
104
120
|
}
|
|
105
121
|
}
|
|
@@ -110,7 +126,7 @@ export function InfoPanel(props: InfoPanelProps) {
|
|
|
110
126
|
const { filteredData, total, count } = useMemo(() => {
|
|
111
127
|
const filteredData: Array<
|
|
112
128
|
Omit<InfoPanelData, 'data'> & {
|
|
113
|
-
data:
|
|
129
|
+
data: InfoPanelDatum[];
|
|
114
130
|
}
|
|
115
131
|
> = [];
|
|
116
132
|
let total = 0;
|
|
@@ -190,29 +206,12 @@ export function InfoPanel(props: InfoPanelProps) {
|
|
|
190
206
|
</Collapsible.Trigger>
|
|
191
207
|
<Collapsible.Content css={style.content}>
|
|
192
208
|
<Table
|
|
209
|
+
data={data}
|
|
210
|
+
columns={columns}
|
|
193
211
|
striped
|
|
194
|
-
|
|
195
|
-
width: '100%',
|
|
196
|
-
})}
|
|
212
|
+
tableProps={{ style: { width: '100%' } }}
|
|
197
213
|
compact
|
|
198
|
-
|
|
199
|
-
<Table.Header>
|
|
200
|
-
<ValueRenderers.Header value="Parameter" />
|
|
201
|
-
<ValueRenderers.Header value="Value" />
|
|
202
|
-
</Table.Header>
|
|
203
|
-
{data.map(([key, value]) => (
|
|
204
|
-
<Table.Row
|
|
205
|
-
key={key}
|
|
206
|
-
style={{
|
|
207
|
-
height: '10px',
|
|
208
|
-
padding: '0 !imporant',
|
|
209
|
-
}}
|
|
210
|
-
>
|
|
211
|
-
<ValueRenderers.Text value={key} />
|
|
212
|
-
{valueCell(value)}
|
|
213
|
-
</Table.Row>
|
|
214
|
-
))}
|
|
215
|
-
</Table>
|
|
214
|
+
/>
|
|
216
215
|
</Collapsible.Content>
|
|
217
216
|
</Collapsible.Root>
|
|
218
217
|
);
|
|
@@ -4,9 +4,12 @@ import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
5
|
import styled from '@emotion/styled';
|
|
6
6
|
import type { LogEntry } from 'fifo-logger';
|
|
7
|
-
import { CSSProperties } from 'react';
|
|
7
|
+
import { CSSProperties, useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import { Button
|
|
9
|
+
import { Button } from '../button';
|
|
10
|
+
import { createTableColumnHelper, Table } from '../table';
|
|
11
|
+
|
|
12
|
+
import { useFifoLogger } from './useFifoLogger';
|
|
10
13
|
|
|
11
14
|
const ActionsFooter = styled.div`
|
|
12
15
|
display: flex;
|
|
@@ -37,8 +40,46 @@ export interface FifoLoggerDialogProps {
|
|
|
37
40
|
unseen: number;
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
const columnHelper = createTableColumnHelper<LogEntry>();
|
|
44
|
+
function useColumns(unseen: number) {
|
|
45
|
+
return useMemo(
|
|
46
|
+
() => [
|
|
47
|
+
columnHelper.display({
|
|
48
|
+
header: '#',
|
|
49
|
+
cell: ({ row }) => {
|
|
50
|
+
return (
|
|
51
|
+
<RowIndexCell
|
|
52
|
+
pillColor={
|
|
53
|
+
row.index >= unseen
|
|
54
|
+
? 'transparent'
|
|
55
|
+
: rowBackgroundColor[row.original.levelLabel]
|
|
56
|
+
}
|
|
57
|
+
>
|
|
58
|
+
{String(row.index + 1)}
|
|
59
|
+
</RowIndexCell>
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
columnHelper.accessor('time', {
|
|
64
|
+
header: 'Time',
|
|
65
|
+
cell: ({ getValue }) => new Date(getValue()).toLocaleTimeString(),
|
|
66
|
+
}),
|
|
67
|
+
columnHelper.accessor('levelLabel', {
|
|
68
|
+
header: 'Level',
|
|
69
|
+
}),
|
|
70
|
+
columnHelper.accessor('message', {
|
|
71
|
+
header: 'Message',
|
|
72
|
+
}),
|
|
73
|
+
],
|
|
74
|
+
[unseen],
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
40
78
|
export function FifoLoggerDialog(props: FifoLoggerDialogProps) {
|
|
41
79
|
const logger = useFifoLogger();
|
|
80
|
+
|
|
81
|
+
const columns = useColumns(props.unseen);
|
|
82
|
+
|
|
42
83
|
return (
|
|
43
84
|
<Dialog
|
|
44
85
|
shouldReturnFocusOnClose={false}
|
|
@@ -55,44 +96,21 @@ export function FifoLoggerDialog(props: FifoLoggerDialogProps) {
|
|
|
55
96
|
>
|
|
56
97
|
<DialogBody>
|
|
57
98
|
<Table
|
|
99
|
+
data={props.logs}
|
|
100
|
+
columns={columns}
|
|
58
101
|
compact
|
|
59
102
|
bordered
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
>
|
|
64
|
-
<Table.Header>
|
|
65
|
-
<ValueRenderers.Header value="#" />
|
|
66
|
-
<ValueRenderers.Header value="Time" />
|
|
67
|
-
<ValueRenderers.Header value="Level" />
|
|
68
|
-
<ValueRenderers.Header value="Message" />
|
|
69
|
-
</Table.Header>
|
|
70
|
-
{props.logs.map((logEntry, idx) => (
|
|
71
|
-
<Table.Row
|
|
72
|
-
key={logEntry.id}
|
|
103
|
+
tableProps={{ style: { width: '100%' } }}
|
|
104
|
+
renderRowTr={({ row, children }) => (
|
|
105
|
+
<tr
|
|
73
106
|
style={{
|
|
74
|
-
backgroundColor: rowBackgroundColor[
|
|
107
|
+
backgroundColor: rowBackgroundColor[row.original.levelLabel],
|
|
75
108
|
}}
|
|
76
109
|
>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
? 'transparent'
|
|
82
|
-
: rowBackgroundColor[logEntry.levelLabel]
|
|
83
|
-
}
|
|
84
|
-
>
|
|
85
|
-
{String(idx + 1)}
|
|
86
|
-
</RowIndexCell>
|
|
87
|
-
</ValueRenderers.Component>
|
|
88
|
-
<ValueRenderers.Text
|
|
89
|
-
value={new Date(logEntry.time).toLocaleTimeString()}
|
|
90
|
-
/>
|
|
91
|
-
<ValueRenderers.Text value={logEntry.levelLabel} />
|
|
92
|
-
<ValueRenderers.Text value={logEntry.message} />
|
|
93
|
-
</Table.Row>
|
|
94
|
-
))}
|
|
95
|
-
</Table>
|
|
110
|
+
{children}
|
|
111
|
+
</tr>
|
|
112
|
+
)}
|
|
113
|
+
/>
|
|
96
114
|
</DialogBody>
|
|
97
115
|
<DialogFooter
|
|
98
116
|
actions={
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CellContext, RowData } from '@tanstack/react-table';
|
|
2
|
+
|
|
3
|
+
import * as ValueRenderers from '../value-renderers';
|
|
4
|
+
|
|
5
|
+
// TODO: support Date
|
|
6
|
+
export function defaultTableCell<TData extends RowData, TValue = unknown>(
|
|
7
|
+
context: CellContext<TData, TValue>,
|
|
8
|
+
) {
|
|
9
|
+
const value = context.getValue();
|
|
10
|
+
if (typeof value === 'string') {
|
|
11
|
+
return <ValueRenderers.Text value={value} />;
|
|
12
|
+
} else if (typeof value === 'number') {
|
|
13
|
+
return <ValueRenderers.Number value={value} />;
|
|
14
|
+
} else if (typeof value === 'boolean') {
|
|
15
|
+
return <ValueRenderers.Boolean value={value} />;
|
|
16
|
+
} else {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
18
|
+
return <ValueRenderers.Text value={`${value}`} />;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './table_root';
|
|
2
|
+
export * from './table_utils';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Row, RowData } from '@tanstack/react-table';
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
|
|
4
|
+
import { TableRowCell } from './table_row_cell';
|
|
5
|
+
import type {
|
|
6
|
+
TableRowTrRenderer,
|
|
7
|
+
TableRowTrRendererProps,
|
|
8
|
+
} from './table_utils';
|
|
9
|
+
|
|
10
|
+
interface TableBodyProps<TData extends RowData> {
|
|
11
|
+
rows: Array<Row<TData>>;
|
|
12
|
+
renderRowTr: TableRowTrRenderer<TData> | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function TableBody<TData extends RowData>(props: TableBodyProps<TData>) {
|
|
16
|
+
const { rows, renderRowTr = defaultRenderRowTr } = props;
|
|
17
|
+
return (
|
|
18
|
+
<tbody>
|
|
19
|
+
{rows.map((row) => (
|
|
20
|
+
<Fragment key={row.id}>
|
|
21
|
+
{renderRowTr({
|
|
22
|
+
row,
|
|
23
|
+
children: row
|
|
24
|
+
.getVisibleCells()
|
|
25
|
+
.map((cell) => <TableRowCell key={cell.id} cell={cell} />),
|
|
26
|
+
})}
|
|
27
|
+
</Fragment>
|
|
28
|
+
))}
|
|
29
|
+
</tbody>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function defaultRenderRowTr<TData extends RowData>(
|
|
34
|
+
props: TableRowTrRendererProps<TData>,
|
|
35
|
+
) {
|
|
36
|
+
return <tr>{props.children}</tr>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Header, RowData } from '@tanstack/react-table';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
import { TableHeaderCell } from './table_header_cell';
|
|
5
|
+
|
|
6
|
+
const headerStyle: CSSProperties = {
|
|
7
|
+
position: 'sticky',
|
|
8
|
+
top: 0,
|
|
9
|
+
zIndex: 10,
|
|
10
|
+
backgroundColor: 'white',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface TableHeaderProps<TData extends RowData> {
|
|
14
|
+
headers: Array<Header<TData, unknown>>;
|
|
15
|
+
sticky: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function TableHeader<TData extends RowData>(
|
|
19
|
+
props: TableHeaderProps<TData>,
|
|
20
|
+
) {
|
|
21
|
+
const { headers, sticky } = props;
|
|
22
|
+
return (
|
|
23
|
+
<thead style={sticky ? headerStyle : undefined}>
|
|
24
|
+
<tr>
|
|
25
|
+
{headers.map((header) => (
|
|
26
|
+
<TableHeaderCell key={header.id} header={header} />
|
|
27
|
+
))}
|
|
28
|
+
</tr>
|
|
29
|
+
</thead>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { flexRender, type Header, type RowData } from '@tanstack/react-table';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
interface TableHeaderCellProps<TData extends RowData> {
|
|
5
|
+
header: Header<TData, unknown>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function TableHeaderCell<TData extends RowData>(
|
|
9
|
+
props: TableHeaderCellProps<TData>,
|
|
10
|
+
) {
|
|
11
|
+
const { header } = props;
|
|
12
|
+
const column = header.column;
|
|
13
|
+
|
|
14
|
+
const canSort = column.getCanSort();
|
|
15
|
+
const sorted = column.getIsSorted();
|
|
16
|
+
|
|
17
|
+
const style: CSSProperties = {
|
|
18
|
+
position: 'relative',
|
|
19
|
+
cursor: canSort ? 'pointer' : undefined,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<th
|
|
24
|
+
style={style}
|
|
25
|
+
onClick={canSort ? column.getToggleSortingHandler() : undefined}
|
|
26
|
+
>
|
|
27
|
+
<div style={{ display: 'flex', flexDirection: 'row', gap: '5px' }}>
|
|
28
|
+
{flexRender(header.column.columnDef.header, header.getContext())}
|
|
29
|
+
{sorted
|
|
30
|
+
? {
|
|
31
|
+
asc: '🔼',
|
|
32
|
+
desc: '🔽',
|
|
33
|
+
}[sorted]
|
|
34
|
+
: null}
|
|
35
|
+
</div>
|
|
36
|
+
</th>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
|
|
3
|
+
import { HTMLTable } from '@blueprintjs/core';
|
|
4
|
+
import {
|
|
5
|
+
getCoreRowModel,
|
|
6
|
+
getSortedRowModel,
|
|
7
|
+
type RowData,
|
|
8
|
+
type TableOptions,
|
|
9
|
+
useReactTable,
|
|
10
|
+
} from '@tanstack/react-table';
|
|
11
|
+
import { TableHTMLAttributes } from 'react';
|
|
12
|
+
|
|
13
|
+
import { TableBody } from './table_body';
|
|
14
|
+
import { TableHeader } from './table_header';
|
|
15
|
+
import type { TableColumnDef, TableRowTrRenderer } from './table_utils';
|
|
16
|
+
import { useTableColumns } from './use_table_columns';
|
|
17
|
+
|
|
18
|
+
export interface TableProps<TData extends RowData> {
|
|
19
|
+
data: TData[];
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
columns: Array<TableColumnDef<TData, any>>;
|
|
22
|
+
|
|
23
|
+
bordered?: boolean;
|
|
24
|
+
compact?: boolean;
|
|
25
|
+
interactive?: boolean;
|
|
26
|
+
striped?: boolean;
|
|
27
|
+
stickyHeader?: boolean;
|
|
28
|
+
|
|
29
|
+
reactTable?: Omit<
|
|
30
|
+
TableOptions<TData>,
|
|
31
|
+
'data' | 'columns' | 'getCoreRowModel' | 'getSortedRowModel'
|
|
32
|
+
>;
|
|
33
|
+
tableProps?: Omit<TableHTMLAttributes<HTMLTableElement>, 'children'>;
|
|
34
|
+
renderRowTr?: TableRowTrRenderer<TData>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function Table<TData extends RowData>(props: TableProps<TData>) {
|
|
38
|
+
const {
|
|
39
|
+
data,
|
|
40
|
+
columns,
|
|
41
|
+
|
|
42
|
+
bordered = false,
|
|
43
|
+
compact = false,
|
|
44
|
+
interactive = false,
|
|
45
|
+
striped = false,
|
|
46
|
+
stickyHeader = false,
|
|
47
|
+
|
|
48
|
+
reactTable,
|
|
49
|
+
tableProps,
|
|
50
|
+
renderRowTr,
|
|
51
|
+
} = props;
|
|
52
|
+
|
|
53
|
+
const columnDefs = useTableColumns(columns);
|
|
54
|
+
const table = useReactTable<TData>({
|
|
55
|
+
...reactTable,
|
|
56
|
+
data,
|
|
57
|
+
columns: columnDefs,
|
|
58
|
+
getCoreRowModel: getCoreRowModel(),
|
|
59
|
+
getSortedRowModel: getSortedRowModel(),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<HTMLTable
|
|
64
|
+
bordered={bordered}
|
|
65
|
+
compact={compact}
|
|
66
|
+
interactive={interactive}
|
|
67
|
+
striped={striped}
|
|
68
|
+
{...tableProps}
|
|
69
|
+
>
|
|
70
|
+
<TableHeader sticky={stickyHeader} headers={table.getFlatHeaders()} />
|
|
71
|
+
<TableBody rows={table.getRowModel().rows} renderRowTr={renderRowTr} />
|
|
72
|
+
</HTMLTable>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Cell, flexRender, type RowData } from '@tanstack/react-table';
|
|
2
|
+
|
|
3
|
+
interface TableRowCellProps<TData extends RowData> {
|
|
4
|
+
cell: Cell<TData, unknown>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function TableRowCell<TData extends RowData>(
|
|
8
|
+
props: TableRowCellProps<TData>,
|
|
9
|
+
) {
|
|
10
|
+
const { cell } = props;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<td style={{ position: 'relative' }}>
|
|
14
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
15
|
+
</td>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ColumnDef,
|
|
3
|
+
createColumnHelper,
|
|
4
|
+
type Row,
|
|
5
|
+
type RowData,
|
|
6
|
+
} from '@tanstack/react-table';
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
|
|
9
|
+
export type TableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<
|
|
10
|
+
TData,
|
|
11
|
+
TValue
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
export function createTableColumnHelper<TData extends RowData>() {
|
|
15
|
+
return createColumnHelper<TData>();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface TableRowTrRendererProps<TData extends RowData> {
|
|
19
|
+
row: Row<TData>;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export type TableRowTrRenderer<TData extends RowData> = (
|
|
23
|
+
props: TableRowTrRendererProps<TData>,
|
|
24
|
+
) => ReactNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ColumnDef, RowData } from '@tanstack/react-table';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
import { defaultTableCell } from './default_table_cell';
|
|
5
|
+
import type { TableColumnDef } from './table_utils';
|
|
6
|
+
|
|
7
|
+
export function useTableColumns<TData extends RowData>(
|
|
8
|
+
columnDefs: Array<TableColumnDef<TData>>,
|
|
9
|
+
) {
|
|
10
|
+
return useMemo<Array<ColumnDef<TData>>>(() => {
|
|
11
|
+
return columnDefs.map((columnDef) => {
|
|
12
|
+
return {
|
|
13
|
+
...columnDef,
|
|
14
|
+
cell: columnDef.cell ?? defaultTableCell,
|
|
15
|
+
enableSorting: columnDef.enableSorting ?? false,
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
}, [columnDefs]);
|
|
19
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
3
4
|
|
|
4
5
|
import { Toolbar } from './Toolbar';
|
|
5
6
|
|
|
6
7
|
interface PanelPreferencesToolbarProps {
|
|
7
|
-
title?:
|
|
8
|
+
title?: ReactNode;
|
|
8
9
|
onClose?: () => void;
|
|
9
10
|
onSave?: () => void;
|
|
10
11
|
}
|
|
@@ -3,27 +3,26 @@ import {
|
|
|
3
3
|
ButtonGroup,
|
|
4
4
|
Classes,
|
|
5
5
|
Colors,
|
|
6
|
+
Icon,
|
|
6
7
|
Intent,
|
|
7
8
|
Popover,
|
|
8
9
|
PopoverProps,
|
|
9
10
|
TagProps,
|
|
10
|
-
Icon,
|
|
11
11
|
TooltipProps,
|
|
12
12
|
} from '@blueprintjs/core';
|
|
13
13
|
import { IconName } from '@blueprintjs/icons';
|
|
14
14
|
import { css } from '@emotion/react';
|
|
15
15
|
import {
|
|
16
16
|
cloneElement,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
ReactNode,
|
|
17
|
+
type MouseEvent,
|
|
18
|
+
type ReactElement,
|
|
19
|
+
type ReactNode,
|
|
21
20
|
useLayoutEffect,
|
|
22
21
|
useMemo,
|
|
23
22
|
useRef,
|
|
24
23
|
} from 'react';
|
|
25
24
|
|
|
26
|
-
import { Button } from '../
|
|
25
|
+
import { Button } from '../button';
|
|
27
26
|
|
|
28
27
|
import {
|
|
29
28
|
ToolbarContext,
|
|
@@ -57,7 +56,7 @@ export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
|
57
56
|
id?: string;
|
|
58
57
|
tooltip?: TooltipProps['content'];
|
|
59
58
|
tooltipProps?: Omit<TooltipProps, 'content'>;
|
|
60
|
-
icon: IconName |
|
|
59
|
+
icon: IconName | ReactElement;
|
|
61
60
|
active?: boolean;
|
|
62
61
|
onClick?: (
|
|
63
62
|
item: ToolbarItemProps & {
|
|
@@ -7,8 +7,6 @@ export { Text } from './Text';
|
|
|
7
7
|
export { Title } from './Title';
|
|
8
8
|
export { Component } from './Component';
|
|
9
9
|
|
|
10
|
-
export { Header } from './Header';
|
|
11
|
-
|
|
12
10
|
export { ObjectRenderer as Object } from './ObjectRenderer';
|
|
13
11
|
export interface ValueRenderersProps {
|
|
14
12
|
onClick?: (event: MouseEvent) => void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
bordered?: boolean;
|
|
5
|
-
compact?: boolean;
|
|
6
|
-
interactive?: boolean;
|
|
7
|
-
striped?: boolean;
|
|
8
|
-
color?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function Table(props: TableProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare namespace Table {
|
|
12
|
-
var Row: ({ children, style, bordered, ...other }: import("./TableRow").TableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
var Header: ({ children, bordered, style, sticky, }: TableProps & {
|
|
14
|
-
sticky?: boolean;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/table/Table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,SAAS,EAEV,MAAM,OAAO,CAAC;AAsBf,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,oDA2BtC;yBA3Be,KAAK;;;cA3Bc,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Table = Table;
|
|
4
|
-
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
-
/** @jsxImportSource @emotion/react */
|
|
6
|
-
const core_1 = require("@blueprintjs/core");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const TableHeader_1 = require("./TableHeader");
|
|
9
|
-
const TableRow_1 = require("./TableRow");
|
|
10
|
-
const tableContext_1 = require("./tableContext");
|
|
11
|
-
function splitChildren(children) {
|
|
12
|
-
const Rows = [];
|
|
13
|
-
let Header = null;
|
|
14
|
-
for (const child of react_1.Children.toArray(children)) {
|
|
15
|
-
if (typeof child !== 'object' || !(0, react_1.isValidElement)(child)) {
|
|
16
|
-
throw new Error('invalid Table child');
|
|
17
|
-
}
|
|
18
|
-
else if (child.type === TableRow_1.TableRow) {
|
|
19
|
-
Rows.push(child);
|
|
20
|
-
}
|
|
21
|
-
else if (child.type === TableHeader_1.TableHeader) {
|
|
22
|
-
Header = child;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
throw new Error('invalid Table child');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return { Rows, Header };
|
|
29
|
-
}
|
|
30
|
-
function Table(props) {
|
|
31
|
-
const { bordered = false, compact = false, interactive = false, striped = false, color = '', children, ...tableProps } = props;
|
|
32
|
-
const { Header, Rows } = splitChildren(children);
|
|
33
|
-
const tableContextValue = (0, react_1.useMemo)(() => ({ color }), [color]);
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(tableContext_1.TableContext.Provider, { value: tableContextValue, children: (0, jsx_runtime_1.jsxs)(core_1.HTMLTable, { bordered: bordered, compact: compact, interactive: interactive, striped: striped, ...tableProps, children: [Header, (0, jsx_runtime_1.jsx)("tbody", { children: Rows })] }) }));
|
|
35
|
-
}
|
|
36
|
-
Table.Row = TableRow_1.TableRow;
|
|
37
|
-
Table.Header = TableHeader_1.TableHeader;
|
|
38
|
-
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/components/table/Table.tsx"],"names":[],"mappings":";;AAuCA,sBA2BC;;AAlED,sCAAsC;AACtC,4CAA8C;AAC9C,iCAMe;AAEf,+CAA4C;AAC5C,yCAAsC;AACtC,iDAA8C;AAE9C,SAAS,aAAa,CAAC,QAAmB;IACxC,MAAM,IAAI,GAAmB,EAAE,CAAC;IAChC,IAAI,MAAM,GAAwB,IAAI,CAAC;IACvC,KAAK,MAAM,KAAK,IAAI,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,yBAAW,EAAE,CAAC;YACtC,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAUD,SAAgB,KAAK,CAAC,KAAiB;IACrC,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,KAAK,EACnB,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEjD,MAAM,iBAAiB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,OAAO,CACL,uBAAC,2BAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,iBAAiB,YAC7C,wBAAC,gBAAS,IACR,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,KACZ,UAAU,aAEb,MAAM,EACP,4CAAQ,IAAI,GAAS,IACX,GACU,CACzB,CAAC;AACJ,CAAC;AAED,KAAK,CAAC,GAAG,GAAG,mBAAQ,CAAC;AACrB,KAAK,CAAC,MAAM,GAAG,yBAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAU1C,eAAO,MAAM,WAAW,2CAKrB,UAAU,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,4CAQnC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableHeader = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const TableRow_1 = require("./TableRow");
|
|
6
|
-
const headerStyle = {
|
|
7
|
-
position: 'sticky',
|
|
8
|
-
top: 0,
|
|
9
|
-
zIndex: 10,
|
|
10
|
-
backgroundColor: 'white',
|
|
11
|
-
};
|
|
12
|
-
const TableHeader = ({ children, bordered, style, sticky, }) => {
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)("thead", { style: sticky ? headerStyle : undefined, children: (0, jsx_runtime_1.jsx)(TableRow_1.TableRow, { bordered: bordered, style: style, children: children }) }));
|
|
14
|
-
};
|
|
15
|
-
exports.TableHeader = TableHeader;
|
|
16
|
-
//# sourceMappingURL=TableHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader.js","sourceRoot":"","sources":["../../../src/components/table/TableHeader.tsx"],"names":[],"mappings":";;;;AACA,yCAAsC;AAEtC,MAAM,WAAW,GAAwB;IACvC,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,EAAE;IACV,eAAe,EAAE,OAAO;CACzB,CAAC;AAEK,MAAM,WAAW,GAAG,CAAC,EAC1B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,GAC4B,EAAE,EAAE;IACtC,OAAO,CACL,kCAAO,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,YAC5C,uBAAC,mBAAQ,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,YACvC,QAAQ,GACA,GACL,CACT,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,WAAW,eAatB"}
|