react-science 12.0.0 → 13.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/README.md +11 -3
- package/lib/components/accordion/accordion.d.ts +2 -2
- package/lib/components/accordion/accordion.d.ts.map +1 -1
- package/lib/components/accordion/accordion.js +26 -42
- package/lib/components/accordion/accordion.js.map +1 -1
- package/lib/components/accordion/accordion_context.d.ts +1 -1
- package/lib/components/accordion/accordion_context.js +1 -1
- package/lib/components/accordion/accordion_context.provider.d.ts +9 -2
- package/lib/components/accordion/accordion_context.provider.d.ts.map +1 -1
- package/lib/components/accordion/accordion_context.provider.js +49 -32
- package/lib/components/accordion/accordion_context.provider.js.map +1 -1
- package/lib/components/accordion/accordion_context.utils.d.ts +23 -0
- package/lib/components/accordion/accordion_context.utils.d.ts.map +1 -0
- package/lib/components/accordion/accordion_context.utils.js +40 -0
- package/lib/components/accordion/accordion_context.utils.js.map +1 -0
- package/lib/components/accordion/index.d.ts +1 -1
- package/lib/components/accordion/index.js +1 -1
- package/lib/components/activity_bar/activity_bar.d.ts.map +1 -1
- package/lib/components/activity_bar/activity_bar.js +6 -4
- package/lib/components/activity_bar/activity_bar.js.map +1 -1
- package/lib/components/button/Button.d.ts +2 -3
- package/lib/components/button/Button.d.ts.map +1 -1
- package/lib/components/button/Button.js +31 -27
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/color-picker/gradient_select/gradient_select.d.ts +1 -1
- package/lib/components/color-picker/gradient_select/gradient_select.d.ts.map +1 -1
- package/lib/components/color-picker/gradient_select/gradient_select.js +8 -9
- package/lib/components/color-picker/gradient_select/gradient_select.js.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.js +5 -5
- package/lib/components/color-picker/react-color/ColorPicker.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Saturation.js +5 -5
- package/lib/components/color-picker/react-color/common/Saturation.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/color.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/color.js +2 -3
- package/lib/components/color-picker/react-color/helpers/color.js.map +1 -1
- package/lib/components/dialog/ConfirmDialog.d.ts +1 -2
- package/lib/components/dialog/ConfirmDialog.d.ts.map +1 -1
- package/lib/components/dialog/ConfirmDialog.js +12 -9
- package/lib/components/dialog/ConfirmDialog.js.map +1 -1
- package/lib/components/drop-zone/DropZone.d.ts.map +1 -1
- package/lib/components/drop-zone/DropZone.js +3 -7
- package/lib/components/drop-zone/DropZone.js.map +1 -1
- package/lib/components/forms/radio-button-group/RadioButton.d.ts +1 -2
- package/lib/components/forms/radio-button-group/RadioButton.d.ts.map +1 -1
- package/lib/components/forms/radio-button-group/RadioButton.js +5 -4
- package/lib/components/forms/radio-button-group/RadioButton.js.map +1 -1
- package/lib/components/forms/radio-button-group/RadioButtonGroup.d.ts +1 -2
- package/lib/components/forms/radio-button-group/RadioButtonGroup.d.ts.map +1 -1
- package/lib/components/forms/radio-button-group/RadioButtonGroup.js +3 -1
- package/lib/components/forms/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/components/header/Header.d.ts +1 -1
- package/lib/components/header/Header.d.ts.map +1 -1
- package/lib/components/header/Header.js +11 -14
- package/lib/components/header/Header.js.map +1 -1
- package/lib/components/header/PanelHeader.d.ts +1 -1
- package/lib/components/header/PanelHeader.d.ts.map +1 -1
- package/lib/components/header/PanelHeader.js +22 -23
- package/lib/components/header/PanelHeader.js.map +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib/components/info-panel/InfoPanel.js +35 -30
- package/lib/components/info-panel/InfoPanel.js.map +1 -1
- package/lib/components/inline_editable_renderer/index.d.ts +2 -0
- package/lib/components/inline_editable_renderer/index.d.ts.map +1 -0
- package/lib/components/inline_editable_renderer/index.js +2 -0
- package/lib/components/inline_editable_renderer/index.js.map +1 -0
- package/lib/components/inline_editable_renderer/inline_editable_renderer.d.ts +24 -0
- package/lib/components/inline_editable_renderer/inline_editable_renderer.d.ts.map +1 -0
- package/lib/components/inline_editable_renderer/inline_editable_renderer.js +52 -0
- package/lib/components/inline_editable_renderer/inline_editable_renderer.js.map +1 -0
- package/lib/components/logger/FifoLoggerDialog.d.ts +1 -2
- package/lib/components/logger/FifoLoggerDialog.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.js +8 -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/root-layout/css-reset/customPreflight.js +1 -2
- package/lib/components/root-layout/css-reset/customPreflight.js.map +1 -1
- package/lib/components/split-pane/SplitPane.d.ts +36 -19
- package/lib/components/split-pane/SplitPane.d.ts.map +1 -1
- package/lib/components/split-pane/SplitPane.js +69 -79
- package/lib/components/split-pane/SplitPane.js.map +1 -1
- package/lib/components/table/table_body.js +1 -0
- package/lib/components/table/table_body.js.map +1 -1
- package/lib/components/table/table_root.d.ts +20 -4
- package/lib/components/table/table_root.d.ts.map +1 -1
- package/lib/components/table/table_root.js +41 -7
- package/lib/components/table/table_root.js.map +1 -1
- package/lib/components/table/table_utils.d.ts +8 -0
- package/lib/components/table/table_utils.d.ts.map +1 -1
- package/lib/components/table/table_utils.js.map +1 -1
- package/lib/components/table/use_table_scroll.d.ts +5 -0
- package/lib/components/table/use_table_scroll.d.ts.map +1 -0
- package/lib/components/table/use_table_scroll.js +36 -0
- package/lib/components/table/use_table_scroll.js.map +1 -0
- package/lib/components/toolbar/PanelPreferencesToolbar.d.ts +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.js +24 -27
- package/lib/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
- package/lib/components/toolbar/Toolbar.d.ts +4 -5
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +27 -32
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib/components/utils/debounce.d.ts +2 -0
- package/lib/components/utils/debounce.d.ts.map +1 -0
- package/lib/components/utils/debounce.js +12 -0
- package/lib/components/utils/debounce.js.map +1 -0
- package/lib/components/utils/index.d.ts +2 -0
- package/lib/components/utils/index.d.ts.map +1 -1
- package/lib/components/utils/index.js +2 -0
- package/lib/components/utils/index.js.map +1 -1
- package/lib/components/utils/throttle.d.ts +2 -0
- package/lib/components/utils/throttle.d.ts.map +1 -0
- package/lib/components/utils/throttle.js +14 -0
- package/lib/components/utils/throttle.js.map +1 -0
- package/lib/components/value-renderers/Color.d.ts +1 -1
- package/lib/components/value-renderers/Color.d.ts.map +1 -1
- package/lib/components/value-renderers/Color.js +7 -13
- package/lib/components/value-renderers/Color.js.map +1 -1
- package/lib/components/value-renderers/Text.d.ts +1 -1
- package/lib/components/value-renderers/Text.d.ts.map +1 -1
- package/lib/components/value-renderers/Text.js +6 -9
- package/lib/components/value-renderers/Text.js.map +1 -1
- package/lib/components/value-renderers/Title.d.ts +1 -1
- package/lib/components/value-renderers/Title.d.ts.map +1 -1
- package/lib/components/value-renderers/Title.js +6 -9
- package/lib/components/value-renderers/Title.js.map +1 -1
- package/package.json +42 -37
- package/src/components/accordion/accordion.tsx +28 -48
- package/src/components/accordion/accordion_context.provider.tsx +74 -36
- package/src/components/accordion/accordion_context.ts +2 -2
- package/src/components/accordion/accordion_context.utils.ts +66 -0
- package/src/components/accordion/index.ts +1 -1
- package/src/components/activity_bar/activity_bar.tsx +6 -4
- package/src/components/button/Button.tsx +47 -35
- package/src/components/color-picker/gradient_select/gradient_select.tsx +9 -11
- package/src/components/color-picker/react-color/ColorPicker.tsx +6 -6
- package/src/components/color-picker/react-color/common/Saturation.tsx +6 -6
- package/src/components/color-picker/react-color/helpers/color.ts +4 -3
- package/src/components/dialog/ConfirmDialog.tsx +14 -11
- package/src/components/drop-zone/DropZone.tsx +3 -7
- package/src/components/forms/radio-button-group/RadioButton.tsx +4 -4
- package/src/components/forms/radio-button-group/RadioButtonGroup.tsx +2 -1
- package/src/components/header/Header.tsx +11 -16
- package/src/components/header/PanelHeader.tsx +26 -30
- package/src/components/info-panel/InfoPanel.tsx +43 -39
- package/src/components/inline_editable_renderer/index.ts +1 -0
- package/src/components/inline_editable_renderer/inline_editable_renderer.tsx +86 -0
- package/src/components/logger/FifoLoggerDialog.tsx +9 -11
- package/src/components/root-layout/css-reset/customPreflight.ts +1 -2
- package/src/components/split-pane/SplitPane.tsx +144 -117
- package/src/components/table/table_body.tsx +1 -0
- package/src/components/table/table_root.tsx +71 -7
- package/src/components/table/table_utils.ts +11 -0
- package/src/components/table/use_table_scroll.ts +55 -0
- package/src/components/toolbar/PanelPreferencesToolbar.tsx +30 -30
- package/src/components/toolbar/Toolbar.tsx +33 -37
- package/src/components/utils/debounce.ts +16 -0
- package/src/components/utils/index.ts +2 -0
- package/src/components/utils/throttle.ts +19 -0
- package/src/components/value-renderers/Color.tsx +8 -13
- package/src/components/value-renderers/Text.tsx +6 -12
- package/src/components/value-renderers/Title.tsx +6 -12
- package/lib/components/accordion/accordion_context.state.d.ts +0 -26
- package/lib/components/accordion/accordion_context.state.d.ts.map +0 -1
- package/lib/components/accordion/accordion_context.state.js +0 -47
- package/lib/components/accordion/accordion_context.state.js.map +0 -1
- package/src/components/accordion/accordion_context.state.ts +0 -84
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { Colors } from '@blueprintjs/core';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import styled from '@emotion/styled';
|
|
4
|
+
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
5
|
+
import { useEffect, useReducer, useRef } from 'react';
|
|
6
|
+
import { match } from 'ts-pattern';
|
|
6
7
|
import useResizeObserver from 'use-resize-observer';
|
|
7
|
-
import { useOnOff } from '../hooks/useOnOff.js';
|
|
8
8
|
import { useSplitPaneSize } from './useSplitPaneSize.js';
|
|
9
9
|
export function SplitPane(props) {
|
|
10
|
-
const { direction = 'horizontal', controlledSide = 'start',
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const { direction = 'horizontal', controlledSide = 'start', defaultSize = '50%', defaultOpen = true, open: openProp, size: sizeProp, onSizeChange, closeThreshold = null, onResize, onOpenChange, children, } = props;
|
|
11
|
+
const [isOpen, setIsOpen] = useControllableState({
|
|
12
|
+
prop: openProp,
|
|
13
|
+
defaultProp: defaultOpen,
|
|
14
|
+
onChange: onOpenChange,
|
|
15
|
+
});
|
|
16
|
+
const [size, setSize] = useControllableState({
|
|
17
|
+
prop: sizeProp,
|
|
18
|
+
defaultProp: defaultSize,
|
|
19
|
+
onChange: onSizeChange,
|
|
20
|
+
});
|
|
21
|
+
const [splitSize, sizeType] = parseSize(size ?? defaultSize);
|
|
15
22
|
// Whether the user has already interacted with the pane.
|
|
16
23
|
const [hasTouched, touch] = useReducer(() => true, false);
|
|
17
|
-
const [[splitSize, sizeType], setSize] = useState(() => parseSize(size));
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
setSize(parseSize(size));
|
|
20
|
-
}, [size]);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (typeof closed === 'boolean') {
|
|
23
|
-
if (closed) {
|
|
24
|
-
closePane();
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
openPane();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}, [closePane, closed, openPane]);
|
|
31
24
|
const splitterRef = useRef(null);
|
|
32
25
|
const { onPointerDown } = useSplitPaneSize({
|
|
33
26
|
controlledSide,
|
|
@@ -36,43 +29,30 @@ export function SplitPane(props) {
|
|
|
36
29
|
sizeType,
|
|
37
30
|
onSizeChange(value) {
|
|
38
31
|
touch();
|
|
39
|
-
|
|
32
|
+
const serialized = serializeSize(value);
|
|
33
|
+
setSize(serialized);
|
|
40
34
|
},
|
|
41
35
|
onResize,
|
|
42
36
|
});
|
|
43
37
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
44
38
|
// @ts-ignore Module exists.
|
|
45
39
|
const rootSize = useResizeObserver();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (direction === 'horizontal') {
|
|
53
|
-
isFinalClosed = rootSize.width < minimumSize;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
isFinalClosed = rootSize.height < minimumSize;
|
|
40
|
+
const mainDirectionSize = direction === 'horizontal' ? rootSize.width : rootSize.height;
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (closeThreshold === null ||
|
|
43
|
+
hasTouched ||
|
|
44
|
+
mainDirectionSize === undefined) {
|
|
45
|
+
return;
|
|
57
46
|
}
|
|
58
|
-
|
|
47
|
+
const shouldBeOpen = mainDirectionSize >= closeThreshold;
|
|
48
|
+
setIsOpen(shouldBeOpen);
|
|
49
|
+
}, [mainDirectionSize, closeThreshold, hasTouched, setIsOpen, isOpen]);
|
|
59
50
|
function handleToggle() {
|
|
60
51
|
touch();
|
|
61
|
-
|
|
62
|
-
openPane();
|
|
63
|
-
if (isPaneClosed && onToggle) {
|
|
64
|
-
onToggle(false);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
closePane();
|
|
69
|
-
if (!isPaneClosed && onToggle) {
|
|
70
|
-
onToggle(true);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
52
|
+
setIsOpen(!isOpen);
|
|
73
53
|
}
|
|
74
54
|
function getSplitSideStyle(side) {
|
|
75
|
-
return getItemStyle(
|
|
55
|
+
return getItemStyle(isOpen ?? defaultOpen, controlledSide === side, direction, splitSize, sizeType);
|
|
76
56
|
}
|
|
77
57
|
return (_jsxs("div", { ref: rootSize.ref, style: {
|
|
78
58
|
display: 'flex',
|
|
@@ -80,11 +60,11 @@ export function SplitPane(props) {
|
|
|
80
60
|
width: '100%',
|
|
81
61
|
[direction === 'horizontal' ? 'minWidth' : 'minHeight']: 0,
|
|
82
62
|
flexDirection: direction === 'horizontal' ? 'row' : 'column',
|
|
83
|
-
}, children: [_jsx(SplitSide, { style: getSplitSideStyle('start'), children: children[0] }), _jsx(Splitter, { onDoubleClick: handleToggle, onPointerDown:
|
|
63
|
+
}, children: [_jsx(SplitSide, { style: getSplitSideStyle('start'), children: children[0] }), _jsx(Splitter, { onDoubleClick: handleToggle, onPointerDown: isOpen ? onPointerDown : undefined, isOpen: isOpen ?? defaultOpen, direction: direction, splitterRef: splitterRef }), _jsx(SplitSide, { style: getSplitSideStyle('end'), children: children[1] })] }));
|
|
84
64
|
}
|
|
85
65
|
function Splitter(props) {
|
|
86
|
-
const { onDoubleClick, onPointerDown, direction,
|
|
87
|
-
return (_jsx(
|
|
66
|
+
const { onDoubleClick, onPointerDown, direction, isOpen, splitterRef } = props;
|
|
67
|
+
return (_jsx(Split, { onDoubleClick: onDoubleClick, onPointerDown: onPointerDown, enabled: isOpen, direction: direction, ref: splitterRef, children: _jsx(SplitContent, { children: direction === 'horizontal' ? '⋮' : '⋯' }) }));
|
|
88
68
|
}
|
|
89
69
|
function SplitSide(props) {
|
|
90
70
|
const { style, children } = props;
|
|
@@ -96,14 +76,17 @@ function parseSize(size) {
|
|
|
96
76
|
const type = size.replaceAll(/[\d .]/g, '');
|
|
97
77
|
return [value, type];
|
|
98
78
|
}
|
|
79
|
+
function serializeSize(size) {
|
|
80
|
+
return `${size[0]}${size[1]}`;
|
|
81
|
+
}
|
|
99
82
|
const flexBase = 100;
|
|
100
83
|
function percentToFlex(percent) {
|
|
101
84
|
percent /= 100;
|
|
102
85
|
return (flexBase - percent * flexBase) / percent;
|
|
103
86
|
}
|
|
104
|
-
function getItemStyle(
|
|
87
|
+
function getItemStyle(isOpen, isControlledSide, direction, size, type) {
|
|
105
88
|
const isHorizontal = direction === 'horizontal';
|
|
106
|
-
if (
|
|
89
|
+
if (!isOpen) {
|
|
107
90
|
return isControlledSide
|
|
108
91
|
? { display: 'none' }
|
|
109
92
|
: { flex: '1 1 0%', display: 'flex' };
|
|
@@ -133,28 +116,35 @@ function getItemStyle(isClosed, isControlledSide, direction, size, type) {
|
|
|
133
116
|
};
|
|
134
117
|
}
|
|
135
118
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
119
|
+
const Split = styled.div `
|
|
120
|
+
background-color: ${Colors.LIGHT_GRAY5};
|
|
121
|
+
display: flex;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
align-items: center;
|
|
124
|
+
user-select: none;
|
|
125
|
+
min-width: 11px;
|
|
126
|
+
touch-action: none;
|
|
127
|
+
|
|
128
|
+
:hover {
|
|
129
|
+
background-color: ${Colors.LIGHT_GRAY3};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
${(props) => match(props.direction)
|
|
133
|
+
.with('horizontal', () => `
|
|
134
|
+
cursor: ${props.enabled ? 'ew-resize' : 'pointer'};
|
|
135
|
+
width: 10px;
|
|
136
|
+
`)
|
|
137
|
+
.with('vertical', () => `
|
|
138
|
+
height: 10px;
|
|
139
|
+
cursor: ${props.enabled ? 'ns-resize' : 'pointer'};
|
|
140
|
+
`)
|
|
141
|
+
.exhaustive()}
|
|
142
|
+
`;
|
|
143
|
+
const SplitContent = styled.div `
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
place-content: center;
|
|
147
|
+
font-size: 0.875em;
|
|
148
|
+
max-height: 100%;
|
|
149
|
+
`;
|
|
160
150
|
//# sourceMappingURL=SplitPane.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitPane.js","sourceRoot":"","sources":["../../../src/components/split-pane/SplitPane.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"SplitPane.js","sourceRoot":"","sources":["../../../src/components/split-pane/SplitPane.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAO9E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA+EzD,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EACJ,SAAS,GAAG,YAAY,EACxB,cAAc,GAAG,OAAO,EACxB,WAAW,GAAG,KAAK,EACnB,WAAW,GAAG,IAAI,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,cAAc,GAAG,IAAI,EACrB,QAAQ,EACR,YAAY,EACZ,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,oBAAoB,CAAC;QAC/C,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,WAAW;QACxB,QAAQ,EAAE,YAAY;KACvB,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAgB;QAC1D,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,WAA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BAChB,OAAO,EAAE,MAAM;aAChB;YACH,CAAC,CAAC;gBACE,IAAI,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO;gBACnC,OAAO,EAAE,MAAM;gBACf,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;aAC7C,CAAC;IACR,CAAC;SAAM,CAAC;QACN,OAAO,gBAAgB;YACrB,CAAC,CAAC;gBACE,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI;gBACzC,OAAO,EAAE,MAAM;aAChB;YACH,CAAC,CAAC;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;gBACf,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;aAC7C,CAAC;IACR,CAAC;AACH,CAAC;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAGtB;sBACoB,MAAM,CAAC,WAAW;;;;;;;;;wBAShB,MAAM,CAAC,WAAW;;;IAGtC,CAAC,KAAK,EAAE,EAAE,CACV,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;KACnB,IAAI,CACH,YAAY,EACZ,GAAG,EAAE,CAAC;kBACI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;;OAElD,CACA;KACA,IAAI,CACH,UAAU,EACV,GAAG,EAAE,CAAC;;kBAEI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;OAClD,CACA;KACA,UAAU,EAAE;CAClB,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table_body.js","sourceRoot":"","sources":["../../../src/components/table/table_body.tsx"],"names":[],"mappings":";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} from '@tanstack/react-table';
|
|
3
|
-
import type { TableHTMLAttributes } from 'react';
|
|
2
|
+
import type { RefObject, TableHTMLAttributes } from 'react';
|
|
4
3
|
import type { HeaderCellRenderer } from './table_header_cell.js';
|
|
5
|
-
import type { TableColumnDef, TableRowTrRenderer } from './table_utils.js';
|
|
4
|
+
import type { Scroller, TableColumnDef, TableRowTrRenderer, VirtualScroller } from './table_utils.js';
|
|
6
5
|
interface TableBaseProps<TData extends RowData> {
|
|
7
6
|
data: TData[];
|
|
8
7
|
/**
|
|
@@ -37,7 +36,16 @@ interface TableBaseProps<TData extends RowData> {
|
|
|
37
36
|
*/
|
|
38
37
|
virtualizeRows?: boolean;
|
|
39
38
|
reactTable?: Omit<TableOptions<TData>, 'data' | 'columns' | 'getCoreRowModel' | 'getSortedRowModel'>;
|
|
39
|
+
/**
|
|
40
|
+
* Props which are forwarded to the underlying HTML table element.
|
|
41
|
+
*/
|
|
40
42
|
tableProps?: Omit<TableHTMLAttributes<HTMLTableElement>, 'children'>;
|
|
43
|
+
/**
|
|
44
|
+
* An alias for `tableProps.className`. Exists to ensure the Table component
|
|
45
|
+
* can be styled with styled components library (e.g. emotion).
|
|
46
|
+
* If you use both the alias and `tableProps.className`, they will be merged together.
|
|
47
|
+
*/
|
|
48
|
+
className?: string;
|
|
41
49
|
/**
|
|
42
50
|
* Override the default row rendering.
|
|
43
51
|
* Make sure to spread the passed `trProps` onto the rendered `<tr>` element.
|
|
@@ -47,12 +55,20 @@ interface TableBaseProps<TData extends RowData> {
|
|
|
47
55
|
* Override the columns' header cell rendering.
|
|
48
56
|
*/
|
|
49
57
|
renderHeaderCell?: HeaderCellRenderer<TData>;
|
|
58
|
+
/**
|
|
59
|
+
* A ref which will be set with a callback to scroll to a row in the
|
|
60
|
+
* table, specified by the row's ID.
|
|
61
|
+
*/
|
|
62
|
+
scrollToRowRef?: RefObject<VirtualScroller | ScrollToOptions | undefined>;
|
|
63
|
+
getRowId?: TableOptions<TData>['getRowId'];
|
|
50
64
|
}
|
|
51
65
|
interface RegularTableProps<TData extends RowData> extends TableBaseProps<TData> {
|
|
52
66
|
virtualizeRows?: false | undefined;
|
|
67
|
+
scrollToRowRef?: RefObject<Scroller | undefined>;
|
|
53
68
|
}
|
|
54
69
|
interface VirtualizedTableProps<TData extends RowData> extends TableBaseProps<TData> {
|
|
55
70
|
virtualizeRows: true;
|
|
71
|
+
scrollToRowRef?: RefObject<VirtualScroller | undefined>;
|
|
56
72
|
/**
|
|
57
73
|
* For virtualization of the table rows, provide an estimate of the height of each row.
|
|
58
74
|
* @param index The index of the row in the data array.
|
|
@@ -61,6 +77,6 @@ interface VirtualizedTableProps<TData extends RowData> extends TableBaseProps<TD
|
|
|
61
77
|
estimatedRowHeight: (index: number) => number;
|
|
62
78
|
}
|
|
63
79
|
export type TableProps<TData extends RowData> = RegularTableProps<TData> | VirtualizedTableProps<TData>;
|
|
64
|
-
export declare function Table<TData extends RowData>(props: TableProps<TData>): import("
|
|
80
|
+
export declare function Table<TData extends RowData>(props: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
65
81
|
export {};
|
|
66
82
|
//# sourceMappingURL=table_root.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table_root.d.ts","sourceRoot":"","sources":["../../../src/components/table/table_root.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table_root.d.ts","sourceRoot":"","sources":["../../../src/components/table/table_root.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAOnE,OAAO,KAAK,EAAa,SAAS,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAKvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAsC1B,UAAU,cAAc,CAAC,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AClD;AAED,UAAU,qBAAqB,CAAC,KAAK,SAAS,OAAO,CACnD,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC7B,cAAc,EAAE,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACxD;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED,MAAM,MAAM,UAAU,CAAC,KAAK,SAAS,OAAO,IACxC,iBAAiB,CAAC,KAAK,CAAC,GACxB,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEjC,wBAAgB,KAAK,CAAC,KAAK,SAAS,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,2CA+EpE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
2
|
import { HTMLTable } from '@blueprintjs/core';
|
|
4
3
|
import styled from '@emotion/styled';
|
|
5
4
|
import { getCoreRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
|
|
@@ -8,17 +7,39 @@ import { useRef } from 'react';
|
|
|
8
7
|
import { TableBody } from './table_body.js';
|
|
9
8
|
import { TableHeader } from './table_header.js';
|
|
10
9
|
import { useTableColumns } from './use_table_columns.js';
|
|
11
|
-
|
|
12
|
-
// We cannot use that with virtualization, so we override its implementation here.
|
|
10
|
+
import { useTableScroll } from './use_table_scroll.js';
|
|
13
11
|
const CustomHTMLTable = styled(HTMLTable, {
|
|
14
|
-
shouldForwardProp: (prop) => prop !== 'striped',
|
|
12
|
+
shouldForwardProp: (prop) => prop !== 'striped' && prop !== 'stickyHeader',
|
|
15
13
|
}) `
|
|
14
|
+
/* When using a sticky header, ensure that the borders are located below the last header instead of above the first row. */
|
|
15
|
+
${(props) => {
|
|
16
|
+
if (!props.stickyHeader)
|
|
17
|
+
return '';
|
|
18
|
+
return `
|
|
19
|
+
thead tr:last-child {
|
|
20
|
+
box-shadow: inset 0 -1px #11141826;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
tbody tr:first-child td {
|
|
24
|
+
box-shadow: ${props.bordered
|
|
25
|
+
? 'inset 1px 0 0 0 #11141826 !important'
|
|
26
|
+
: 'none !important'};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
tbody tr:first-child td:first-child {
|
|
30
|
+
box-shadow: none !important;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
}}
|
|
34
|
+
|
|
35
|
+
/* Blueprint's HTMLTable \`striped\` prop's implementation is based on nth-child odd / even */
|
|
36
|
+
/* We cannot use that with virtualization, so we override its implementation here. */
|
|
16
37
|
tbody tr.odd td {
|
|
17
38
|
background: ${(props) => props.striped ? 'rgba(143, 153, 168, 0.15)' : 'inherit'};
|
|
18
39
|
}
|
|
19
40
|
`;
|
|
20
41
|
export function Table(props) {
|
|
21
|
-
const { data, columns, bordered = false, compact = false, interactive = false, striped = false, stickyHeader = false, reactTable, tableProps, renderRowTr, renderHeaderCell, virtualizeRows, } = props;
|
|
42
|
+
const { data, columns, bordered = false, compact = false, interactive = false, striped = false, stickyHeader = false, reactTable, tableProps, className, renderRowTr, renderHeaderCell, virtualizeRows, getRowId, } = props;
|
|
22
43
|
const scrollElementRef = useRef(null);
|
|
23
44
|
const columnDefs = useTableColumns(columns);
|
|
24
45
|
const table = useReactTable({
|
|
@@ -27,6 +48,7 @@ export function Table(props) {
|
|
|
27
48
|
columns: columnDefs,
|
|
28
49
|
getCoreRowModel: getCoreRowModel(),
|
|
29
50
|
getSortedRowModel: getSortedRowModel(),
|
|
51
|
+
getRowId,
|
|
30
52
|
});
|
|
31
53
|
const tanstackVirtualizer = useVirtualizer({
|
|
32
54
|
enabled: virtualizeRows,
|
|
@@ -35,7 +57,19 @@ export function Table(props) {
|
|
|
35
57
|
estimateSize: (props.virtualizeRows && props.estimatedRowHeight) || (() => 0),
|
|
36
58
|
overscan: 5,
|
|
37
59
|
});
|
|
38
|
-
|
|
60
|
+
const tableRef = useTableScroll(props, table, tanstackVirtualizer);
|
|
61
|
+
// Make the table component compatible with styled components libraries.
|
|
62
|
+
let finalClassName;
|
|
63
|
+
if (tableProps?.className && className) {
|
|
64
|
+
finalClassName = `${tableProps.className} ${className}`;
|
|
65
|
+
}
|
|
66
|
+
else if (className) {
|
|
67
|
+
finalClassName = className;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
finalClassName = tableProps?.className;
|
|
71
|
+
}
|
|
72
|
+
return (_jsx(Container, { virtualizeRows: virtualizeRows, scrollRef: scrollElementRef, children: _jsxs(CustomHTMLTable, { ref: tableRef, bordered: bordered, compact: compact, interactive: interactive, striped: striped, stickyHeader: stickyHeader, ...tableProps, className: finalClassName, children: [_jsx(TableHeader, { sticky: stickyHeader, headers: table.getFlatHeaders(), renderHeaderCell: renderHeaderCell }), _jsx(TableBody, { rows: table.getRowModel().rows, renderRowTr: renderRowTr, virtualizer: tanstackVirtualizer, virtualizeRows: virtualizeRows })] }) }));
|
|
39
73
|
}
|
|
40
74
|
const ScrollRefDiv = styled.div `
|
|
41
75
|
height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table_root.js","sourceRoot":"","sources":["../../../src/components/table/table_root.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"table_root.js","sourceRoot":"","sources":["../../../src/components/table/table_root.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEz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EACF,KAAC,SAAS,IACR,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAC9B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,mBAAmB,EAChC,cAAc,EAAE,cAAc,GAC9B,IACc,GACR,CACb,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG9B,CAAC;AAEF,SAAS,SAAS,CAAC,EACjB,cAAc,EACd,SAAS,EACT,QAAQ,GAKT;IACC,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,KAAC,YAAY,IAAC,GAAG,EAAE,SAAS,YAAG,QAAQ,GAAgB,CAAC;IACjE,CAAC;IACD,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { ColumnDef, Row, RowData } from '@tanstack/react-table';
|
|
2
|
+
import type { ScrollToOptions } from '@tanstack/react-virtual';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
export type TableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<TData, TValue>;
|
|
4
5
|
export declare function createTableColumnHelper<TData extends RowData>(): import("@tanstack/react-table").ColumnHelper<TData>;
|
|
5
6
|
export interface TableRowTrProps {
|
|
6
7
|
className: string;
|
|
7
8
|
children: ReactNode;
|
|
9
|
+
'data-row-id': string;
|
|
8
10
|
}
|
|
9
11
|
export type TableRowTrRenderer<TData extends RowData> = (trProps: TableRowTrProps, row: Row<TData>) => ReactNode;
|
|
12
|
+
export interface VirtualScroller {
|
|
13
|
+
scrollIntoView: (id: string, options?: ScrollToOptions) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface Scroller {
|
|
16
|
+
scrollIntoView: (id: string, options?: ScrollIntoViewOptions) => void;
|
|
17
|
+
}
|
|
10
18
|
//# sourceMappingURL=table_utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table_utils.d.ts","sourceRoot":"","sources":["../../../src/components/table/table_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,SAAS,CAC7E,KAAK,EACL,MAAM,CACP,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,SAAS,OAAO,yDAE5D;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"table_utils.d.ts","sourceRoot":"","sources":["../../../src/components/table/table_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,SAAS,CAC7E,KAAK,EACL,MAAM,CACP,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,SAAS,OAAO,yDAE5D;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IAEpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,OAAO,IAAI,CACtD,OAAO,EAAE,eAAe,EACxB,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KACZ,SAAS,CAAC;AAEf,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;CACjE;AAED,MAAM,WAAW,QAAQ;IACvB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table_utils.js","sourceRoot":"","sources":["../../../src/components/table/table_utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"table_utils.js","sourceRoot":"","sources":["../../../src/components/table/table_utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAS3D,MAAM,UAAU,uBAAuB;IACrC,OAAO,kBAAkB,EAAS,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RowData, Table } from '@tanstack/react-table';
|
|
2
|
+
import type { Virtualizer } from '@tanstack/react-virtual';
|
|
3
|
+
import type { TableProps } from './table_root.js';
|
|
4
|
+
export declare function useTableScroll<TData extends RowData>(tableProps: TableProps<TData>, table: Table<TData>, virtualizer: Virtualizer<HTMLDivElement, Element>): import("react").RefObject<HTMLTableElement>;
|
|
5
|
+
//# sourceMappingURL=use_table_scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_table_scroll.d.ts","sourceRoot":"","sources":["../../../src/components/table/use_table_scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAGV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,wBAAgB,cAAc,CAAC,KAAK,SAAS,OAAO,EAClD,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,EAC7B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,EACnB,WAAW,EAAE,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,+CAyClD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useImperativeHandle, useRef } from 'react';
|
|
2
|
+
export function useTableScroll(tableProps, table, virtualizer) {
|
|
3
|
+
const tableRef = useRef(null);
|
|
4
|
+
const { scrollToRowRef, virtualizeRows } = tableProps;
|
|
5
|
+
// @ts-expect-error We cannot call the hook conditionally to satisfy the type checker
|
|
6
|
+
useImperativeHandle(scrollToRowRef, () => {
|
|
7
|
+
if (virtualizeRows) {
|
|
8
|
+
return {
|
|
9
|
+
scrollIntoView(id, options) {
|
|
10
|
+
const sortedRows = table.getRowModel().rows; // Get sorted rows
|
|
11
|
+
const rowIndex = sortedRows.findIndex((row) => row.id === id); // Find the index of the row by ID
|
|
12
|
+
if (rowIndex === -1) {
|
|
13
|
+
// We don't expect this situation, but it's not critical enough to throw an error.
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
console.warn(`Could not scroll to row with ID ${id}, the row does not exist`);
|
|
16
|
+
}
|
|
17
|
+
virtualizer.scrollToIndex(rowIndex, options);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return {
|
|
23
|
+
scrollIntoView(id, options) {
|
|
24
|
+
const element = tableRef.current?.querySelector(`tr[data-row-id="${id}"]`);
|
|
25
|
+
if (!element) {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.warn(`Could not scroll to row with ID ${id}, the row does not exist`);
|
|
28
|
+
}
|
|
29
|
+
element?.scrollIntoView(options);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}, [virtualizeRows, table, virtualizer]);
|
|
34
|
+
return tableRef;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=use_table_scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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C;oBACD,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;gBACnC,CAAC;aACF,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAEzC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -4,6 +4,6 @@ interface PanelPreferencesToolbarProps {
|
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
onSave?: () => void;
|
|
6
6
|
}
|
|
7
|
-
export declare function PanelPreferencesToolbar(props: PanelPreferencesToolbarProps): import("
|
|
7
|
+
export declare function PanelPreferencesToolbar(props: PanelPreferencesToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=PanelPreferencesToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelPreferencesToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/PanelPreferencesToolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PanelPreferencesToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/PanelPreferencesToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,4BAA4B;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AA0BD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,2CAkB1E"}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
2
|
-
|
|
3
|
-
import { css } from '@emotion/react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/styled';
|
|
4
3
|
import { Toolbar } from './Toolbar.js';
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
4
|
+
const PanelPreferencesToolbarContainer = styled.div `
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
border-bottom: 1px solid rgb(240 240 240);
|
|
8
|
+
`;
|
|
9
|
+
const PanelPreferencesToolbarTitle = styled.div `
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
padding-left: 12px;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
`;
|
|
16
|
+
const PanelPreferencesToolbarContent = styled.div `
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: row-reverse;
|
|
19
|
+
|
|
20
|
+
& > button {
|
|
21
|
+
padding: 0 0 0 9px;
|
|
22
|
+
min-width: auto;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
28
25
|
export function PanelPreferencesToolbar(props) {
|
|
29
26
|
const { title = '', onClose, onSave } = props;
|
|
30
|
-
return (_jsxs(
|
|
27
|
+
return (_jsxs(PanelPreferencesToolbarContainer, { children: [_jsx(PanelPreferencesToolbarTitle, { children: title }), _jsx(PanelPreferencesToolbarContent, { children: _jsxs(Toolbar, { children: [onClose && (_jsx(Toolbar.Item, { onClick: onClose, intent: "danger", icon: "cross" })), onSave && (_jsx(Toolbar.Item, { onClick: onSave, intent: "success", icon: "tick" }))] }) })] }));
|
|
31
28
|
}
|
|
32
29
|
//# sourceMappingURL=PanelPreferencesToolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelPreferencesToolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/PanelPreferencesToolbar.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"PanelPreferencesToolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/PanelPreferencesToolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,MAAM,gCAAgC,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIlD,CAAC;AAEF,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM9C,CAAC;AAEF,MAAM,8BAA8B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQhD,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE9C,OAAO,CACL,MAAC,gCAAgC,eAC/B,KAAC,4BAA4B,cAAE,KAAK,GAAgC,EACpE,KAAC,8BAA8B,cAC7B,MAAC,OAAO,eACL,OAAO,IAAI,CACV,KAAC,OAAO,CAAC,IAAI,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,GAAG,CAChE,EACA,MAAM,IAAI,CACT,KAAC,OAAO,CAAC,IAAI,IAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAC,SAAS,EAAC,IAAI,EAAC,MAAM,GAAG,CAC/D,IACO,GACqB,IACA,CACpC,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** @jsxImportSource @emotion/react */
|
|
2
1
|
import type { ButtonGroupProps, Intent, PopoverProps, TooltipProps } from '@blueprintjs/core';
|
|
3
2
|
import type { MouseEvent } from 'react';
|
|
4
3
|
import type { ButtonProps } from '../button/index.js';
|
|
@@ -21,14 +20,14 @@ export interface ToolbarItemProps extends ToolbarBaseProps, Pick<ButtonProps, 'i
|
|
|
21
20
|
tooltipProps?: Omit<TooltipProps, 'content'>;
|
|
22
21
|
onClick?: (event: MouseEvent) => void;
|
|
23
22
|
}
|
|
24
|
-
export interface ToolbarPopoverItemProps extends PopoverProps {
|
|
23
|
+
export interface ToolbarPopoverItemProps extends Omit<PopoverProps, 'targetProps'> {
|
|
25
24
|
itemProps: ToolbarItemProps;
|
|
26
25
|
}
|
|
27
|
-
export declare function Toolbar(props: ToolbarProps): import("
|
|
26
|
+
export declare function Toolbar(props: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
28
27
|
export declare namespace Toolbar {
|
|
29
28
|
var Item: typeof ToolbarItem;
|
|
30
|
-
var PopoverItem: (props: ToolbarPopoverItemProps) => import("
|
|
29
|
+
var PopoverItem: (props: ToolbarPopoverItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
30
|
}
|
|
32
|
-
declare function ToolbarItem(props: ToolbarItemProps): import("
|
|
31
|
+
declare function ToolbarItem(props: ToolbarItemProps): import("react/jsx-runtime").JSX.Element;
|
|
33
32
|
export {};
|
|
34
33
|
//# sourceMappingURL=Toolbar.d.ts.map
|