react-science 6.0.1 → 7.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/explorer/MeasurementExplorer.d.ts +2 -3
- package/lib/app/explorer/MeasurementExplorer.d.ts.map +1 -1
- package/lib/app/explorer/MeasurementExplorer.js +2 -2
- package/lib/app/explorer/MeasurementExplorer.js.map +1 -1
- package/lib/app/panels/measurements/MeasurementsPanel.d.ts.map +1 -1
- package/lib/app/panels/measurements/MeasurementsPanel.js +1 -0
- package/lib/app/panels/measurements/MeasurementsPanel.js.map +1 -1
- package/lib/app/panels/measurements/MeasurementsTable.js +2 -2
- package/lib/app/panels/measurements/MeasurementsTable.js.map +1 -1
- package/lib/app-data/kinds/iv/IvMeasurement.d.ts +1 -2
- package/lib/app-data/kinds/iv/IvMeasurement.d.ts.map +1 -1
- package/lib/app-data/state/data/data.helpers.d.ts +1 -1
- package/lib/components/button/Button.d.ts.map +1 -1
- package/lib/components/button/Button.js +19 -13
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/color-picker/gradient-select/GradientSelect.js +2 -2
- package/lib/components/color-picker/gradient-select/GradientSelect.js.map +1 -1
- package/lib/components/header/PanelHeader.d.ts.map +1 -1
- package/lib/components/header/PanelHeader.js +2 -19
- package/lib/components/header/PanelHeader.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib/components/info-panel/InfoPanel.js +18 -12
- package/lib/components/info-panel/InfoPanel.js.map +1 -1
- package/lib/components/selected-total/SelectedTotal.d.ts +7 -0
- package/lib/components/selected-total/SelectedTotal.d.ts.map +1 -0
- package/lib/components/selected-total/SelectedTotal.js +25 -0
- package/lib/components/selected-total/SelectedTotal.js.map +1 -0
- package/lib/components/selected-total/index.d.ts +2 -0
- package/lib/components/selected-total/index.d.ts.map +1 -0
- package/lib/components/selected-total/index.js +18 -0
- package/lib/components/selected-total/index.js.map +1 -0
- package/lib/components/toolbar/Toolbar.d.ts +5 -14
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +28 -13
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib-esm/app/explorer/MeasurementExplorer.d.ts +2 -3
- package/lib-esm/app/explorer/MeasurementExplorer.d.ts.map +1 -1
- package/lib-esm/app/explorer/MeasurementExplorer.js +2 -2
- package/lib-esm/app/explorer/MeasurementExplorer.js.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementsPanel.d.ts.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementsPanel.js +2 -1
- package/lib-esm/app/panels/measurements/MeasurementsPanel.js.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementsTable.js +2 -2
- package/lib-esm/app/panels/measurements/MeasurementsTable.js.map +1 -1
- package/lib-esm/app-data/kinds/iv/IvMeasurement.d.ts +1 -2
- package/lib-esm/app-data/kinds/iv/IvMeasurement.d.ts.map +1 -1
- package/lib-esm/app-data/state/data/data.helpers.d.ts +3 -3
- package/lib-esm/components/button/Button.d.ts.map +1 -1
- package/lib-esm/components/button/Button.js +20 -14
- package/lib-esm/components/button/Button.js.map +1 -1
- package/lib-esm/components/color-picker/gradient-select/GradientSelect.js +2 -2
- package/lib-esm/components/color-picker/gradient-select/GradientSelect.js.map +1 -1
- package/lib-esm/components/header/PanelHeader.d.ts.map +1 -1
- package/lib-esm/components/header/PanelHeader.js +2 -19
- package/lib-esm/components/header/PanelHeader.js.map +1 -1
- package/lib-esm/components/index.d.ts +1 -0
- package/lib-esm/components/index.d.ts.map +1 -1
- package/lib-esm/components/index.js +1 -0
- package/lib-esm/components/index.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 -13
- package/lib-esm/components/info-panel/InfoPanel.js.map +1 -1
- package/lib-esm/components/selected-total/SelectedTotal.d.ts +7 -0
- package/lib-esm/components/selected-total/SelectedTotal.d.ts.map +1 -0
- package/lib-esm/components/selected-total/SelectedTotal.js +22 -0
- package/lib-esm/components/selected-total/SelectedTotal.js.map +1 -0
- package/lib-esm/components/selected-total/index.d.ts +2 -0
- package/lib-esm/components/selected-total/index.d.ts.map +1 -0
- package/lib-esm/components/selected-total/index.js +2 -0
- package/lib-esm/components/selected-total/index.js.map +1 -0
- package/lib-esm/components/table/table_utils.d.ts +1 -1
- package/lib-esm/components/table/table_utils.d.ts.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.d.ts +5 -14
- package/lib-esm/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.js +28 -13
- package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
- package/package.json +33 -31
- package/src/app/explorer/MeasurementExplorer.tsx +6 -4
- package/src/app/panels/measurements/MeasurementsPanel.tsx +2 -1
- package/src/app/panels/measurements/MeasurementsTable.tsx +4 -4
- package/src/app-data/kinds/iv/IvMeasurement.ts +1 -1
- package/src/components/button/Button.tsx +41 -28
- package/src/components/color-picker/gradient-select/GradientSelect.tsx +2 -2
- package/src/components/header/PanelHeader.tsx +2 -20
- package/src/components/index.ts +1 -0
- package/src/components/info-panel/InfoPanel.tsx +69 -45
- package/src/components/selected-total/SelectedTotal.tsx +32 -0
- package/src/components/selected-total/index.ts +1 -0
- package/src/components/toolbar/Toolbar.tsx +42 -32
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function SelectedTotal(props) {
|
|
3
|
+
const { total, count } = props;
|
|
4
|
+
return (_jsx("div", { style: {
|
|
5
|
+
whiteSpace: 'nowrap',
|
|
6
|
+
margin: 0,
|
|
7
|
+
}, children: formatCounterLabel(count, total) }));
|
|
8
|
+
}
|
|
9
|
+
function formatCounterLabel(count, total) {
|
|
10
|
+
const thinSpace = '\u2009';
|
|
11
|
+
if (count !== undefined && total !== undefined) {
|
|
12
|
+
return `[${thinSpace}${count}${thinSpace}/${thinSpace}${total}${thinSpace}]`;
|
|
13
|
+
}
|
|
14
|
+
if (count !== undefined) {
|
|
15
|
+
return `[${thinSpace}${count}${thinSpace}]`;
|
|
16
|
+
}
|
|
17
|
+
if (total !== undefined) {
|
|
18
|
+
return `[${thinSpace}${total}${thinSpace}]`;
|
|
19
|
+
}
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=SelectedTotal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectedTotal.js","sourceRoot":"","sources":["../../../src/components/selected-total/SelectedTotal.tsx"],"names":[],"mappings":";AAKA,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC/B,OAAO,CACL,cACE,KAAK,EAAE;YACL,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,CAAC;SACV,YAEA,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,GAC7B,CACP,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc,EAAE,KAAc;IACxD,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC3B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/C,OAAO,IAAI,SAAS,GAAG,KAAK,GAAG,SAAS,IAAI,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,CAAC;IAC/E,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,IAAI,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,CAAC;IAC9C,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,IAAI,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/selected-total/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/selected-total/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ColumnDef, type Row, type RowData } from '@tanstack/react-table';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export type TableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<TData, TValue>;
|
|
4
|
-
export declare function createTableColumnHelper<TData extends RowData>(): import("@tanstack/
|
|
4
|
+
export declare function createTableColumnHelper<TData extends RowData>(): import("@tanstack/table-core").ColumnHelper<TData>;
|
|
5
5
|
export interface TableRowTrRendererProps<TData extends RowData> {
|
|
6
6
|
row: Row<TData>;
|
|
7
7
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table_utils.d.ts","sourceRoot":"","sources":["../../../src/components/table/table_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,GAAG,EACR,KAAK,OAAO,EACb,MAAM,uBAAuB,CAAC;AAC/B,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,
|
|
1
|
+
{"version":3,"file":"table_utils.d.ts","sourceRoot":"","sources":["../../../src/components/table/table_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,GAAG,EACR,KAAK,OAAO,EACb,MAAM,uBAAuB,CAAC;AAC/B,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,wDAE5D;AAED,MAAM,WAAW,uBAAuB,CAAC,KAAK,SAAS,OAAO;IAC5D,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB;AACD,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,OAAO,IAAI,CACtD,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,KAClC,SAAS,CAAC"}
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { Intent, PopoverProps,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ButtonGroupProps, Intent, PopoverProps, TooltipProps } from '@blueprintjs/core';
|
|
3
|
+
import { MouseEvent } from 'react';
|
|
4
|
+
import { ButtonProps } from '../button';
|
|
5
5
|
export type PopoverInteractionType = 'click' | 'hover' | 'click-target' | 'hover-target';
|
|
6
6
|
interface ToolbarBaseProps {
|
|
7
7
|
intent?: Intent;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export interface ToolbarProps extends ToolbarBaseProps {
|
|
11
|
-
vertical?: boolean;
|
|
12
|
-
large?: boolean;
|
|
13
|
-
children?: Array<ReactElement<ToolbarItemProps>> | ReactElement<ToolbarItemProps> | Iterable<ReactNode> | boolean | null;
|
|
10
|
+
export interface ToolbarProps extends ToolbarBaseProps, Pick<ButtonGroupProps, 'children' | 'minimal' | 'large' | 'vertical' | 'fill'> {
|
|
14
11
|
popoverInteractionKind?: PopoverInteractionType;
|
|
15
12
|
}
|
|
16
|
-
export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
17
|
-
id?: string;
|
|
13
|
+
export interface ToolbarItemProps extends ToolbarBaseProps, Pick<ButtonProps, 'id' | 'icon' | 'active' | 'tag' | 'tagProps'> {
|
|
18
14
|
tooltip?: TooltipProps['content'];
|
|
19
15
|
tooltipProps?: Omit<TooltipProps, 'content'>;
|
|
20
|
-
icon: IconName | ReactElement;
|
|
21
|
-
active?: boolean;
|
|
22
16
|
onClick?: (item: ToolbarItemProps & {
|
|
23
17
|
event: MouseEvent;
|
|
24
18
|
}) => void;
|
|
25
|
-
className?: string;
|
|
26
19
|
isPopover?: boolean;
|
|
27
|
-
tag?: ReactNode;
|
|
28
|
-
tagProps?: Omit<TagProps, 'children'>;
|
|
29
20
|
}
|
|
30
21
|
export interface ToolbarPopoverItemProps extends PopoverProps {
|
|
31
22
|
itemProps: ToolbarItemProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAEL,gBAAgB,EAIhB,MAAM,EAEN,YAAY,EACZ,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEL,UAAU,EAKX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAQhD,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,OAAO,GACP,cAAc,GACd,cAAc,CAAC;AAEnB,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,YACf,SAAQ,gBAAgB,EACtB,IAAI,CACF,gBAAgB,EAChB,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CACvD;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAED,MAAM,WAAW,gBACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC;IAClE,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,gBAAgB,GAAG;QACvB,KAAK,EAAE,UAAU,CAAC;KACnB,KACE,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAID,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,oDAyE1C;yBAzEe,OAAO;sBA2EoB,gBAAgB;6BA2GlD,uBAAuB"}
|
|
@@ -7,8 +7,14 @@ import { Button } from '../button';
|
|
|
7
7
|
import { toolbarContext, useToolbarContext, } from './toolbarContext';
|
|
8
8
|
const border = '1px solid rgb(247, 247, 247)';
|
|
9
9
|
export function Toolbar(props) {
|
|
10
|
-
const { children, disabled, intent, large, vertical, popoverInteractionKind, } = props;
|
|
11
|
-
const contextValue = useMemo(() => ({
|
|
10
|
+
const { children, disabled, intent, large, vertical, popoverInteractionKind, minimal, fill, } = props;
|
|
11
|
+
const contextValue = useMemo(() => ({
|
|
12
|
+
intent,
|
|
13
|
+
large,
|
|
14
|
+
vertical,
|
|
15
|
+
disabled,
|
|
16
|
+
popoverInteractionKind,
|
|
17
|
+
}), [intent, large, vertical, disabled, popoverInteractionKind]);
|
|
12
18
|
const ref = useRef(null);
|
|
13
19
|
// Work around wrong width on vertical flex when wrapping
|
|
14
20
|
// In Chrome: recently fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=507397)
|
|
@@ -38,46 +44,56 @@ export function Toolbar(props) {
|
|
|
38
44
|
return () => observer.unobserve(element);
|
|
39
45
|
}
|
|
40
46
|
}, [vertical]);
|
|
41
|
-
return (_jsx(ToolbarProvider, { value: contextValue, children: _jsx(ButtonGroup
|
|
42
|
-
// Reset because of layout effect above
|
|
43
|
-
// TODO: remove once the workaround is no longer needed
|
|
44
|
-
, { vertical: vertical, large: large, style: {
|
|
47
|
+
return (_jsx(ToolbarProvider, { value: contextValue, children: _jsx(ButtonGroup, { fill: fill, vertical: vertical, large: large, minimal: minimal, style: {
|
|
45
48
|
flexWrap: 'wrap',
|
|
46
49
|
borderRight: vertical ? border : undefined,
|
|
47
50
|
}, children: children }, String(vertical)) }));
|
|
48
51
|
}
|
|
49
52
|
Toolbar.Item = function ToolbarItem(props) {
|
|
50
|
-
const { active = false, icon, onClick, tooltip, tooltipProps,
|
|
53
|
+
const { active = false, icon, onClick, tooltip, tooltipProps, intent: itemIntent, disabled: itemDisabled, isPopover, ...other } = props;
|
|
51
54
|
const { intent: toolbarIntent, disabled: toolbarDisabled, large, vertical, } = useToolbarContext();
|
|
52
55
|
const intent = itemIntent ?? toolbarIntent;
|
|
53
56
|
const disabled = itemDisabled ?? toolbarDisabled;
|
|
54
|
-
const resizedIcon = typeof icon === 'string'
|
|
57
|
+
const resizedIcon = !icon || typeof icon === 'string'
|
|
55
58
|
? icon
|
|
56
59
|
: cloneElement(icon, {
|
|
57
60
|
className: icon.props.className
|
|
58
61
|
? `${icon.props.className} bp5-icon`
|
|
59
62
|
: 'bp5-icon',
|
|
60
63
|
});
|
|
61
|
-
return (_jsx(Button, { alignText: isPopover ? 'left' : undefined,
|
|
64
|
+
return (_jsx(Button, { alignText: isPopover ? 'left' : undefined, disabled: disabled, css: css `
|
|
62
65
|
.${Classes.ICON} {
|
|
63
66
|
color: ${Colors.DARK_GRAY3};
|
|
64
67
|
}
|
|
68
|
+
.bp5-icon {
|
|
69
|
+
width: ${large ? '20px' : '16px'};
|
|
70
|
+
height: ${large ? '20px' : '16px'};
|
|
71
|
+
font-size: ${large ? '14px' : '12px'};
|
|
72
|
+
}
|
|
73
|
+
.bp5-tag {
|
|
74
|
+
font-size: ${large ? '12px' : '10px'};
|
|
75
|
+
line-height: ${large ? '14px' : '12px'};
|
|
76
|
+
min-width: ${large ? '18px' : '15px'};
|
|
77
|
+
min-height: ${large ? '18px' : '15px'};
|
|
78
|
+
}
|
|
65
79
|
`, intent: intent, style: {
|
|
66
80
|
position: 'relative',
|
|
67
81
|
fontSize: '1.125em',
|
|
68
82
|
width: 'fit-content',
|
|
69
|
-
flex: 'none',
|
|
70
83
|
}, type: "button", active: active, icon: _jsxs("div", { style: {
|
|
71
84
|
display: 'flex',
|
|
72
85
|
justifyContent: 'center',
|
|
73
86
|
alignItems: 'center',
|
|
74
87
|
width: 0,
|
|
75
88
|
height: 0,
|
|
76
|
-
|
|
89
|
+
marginRight: 0,
|
|
90
|
+
}, children: [_jsx(Icon, { icon: resizedIcon, size: large ? 20 : 16 }), isPopover && (_jsx(Icon, { icon: "caret-right", size: large ? 14 : 9, style: {
|
|
77
91
|
transform: 'rotate(45deg)',
|
|
78
92
|
position: 'absolute',
|
|
79
93
|
bottom: 0,
|
|
80
94
|
right: 0,
|
|
95
|
+
width: large ? 14 : 9,
|
|
96
|
+
height: large ? 14 : 9,
|
|
81
97
|
} }))] }), onClick: (event) => {
|
|
82
98
|
onClick?.({ event, ...props });
|
|
83
99
|
}, tooltipProps: !tooltip
|
|
@@ -104,9 +120,8 @@ Toolbar.PopoverItem = function ToolbarPopoverItem(props) {
|
|
|
104
120
|
fontSize: '1.125em',
|
|
105
121
|
width: 'fit-content',
|
|
106
122
|
height: 'fit-content',
|
|
107
|
-
flex: 'none',
|
|
108
123
|
},
|
|
109
|
-
},
|
|
124
|
+
}, renderTarget: () => _jsx(Toolbar.Item, { isPopover: true, ...itemProps }), ...other }));
|
|
110
125
|
};
|
|
111
126
|
function ToolbarProvider(props) {
|
|
112
127
|
return (_jsx(toolbarContext.Provider, { value: props.value, children: props.children }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EACL,WAAW,
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EACL,WAAW,EAEX,OAAO,EACP,MAAM,EACN,IAAI,EAEJ,OAAO,GAGR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EACL,YAAY,EAGZ,eAAe,EACf,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAEhD,OAAO,EAEL,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAsC1B,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAE9C,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,sBAAsB,EACtB,OAAO,EACP,IAAI,GACL,GAAG,KAAK,CAAC;IAEV,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,MAAM;QACN,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,sBAAsB;KACvB,CAAC,EACF,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,CAAC,CAC5D,CAAC;IACF,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,yDAAyD;IACzD,2FAA2F;IAC3F,uFAAuF;I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AC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YACxC,KAAK,CAAC,QAAQ,GACS,CAC3B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-science",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "React components to build scientific applications UI",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./app": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"test-only": "vitest run --coverage "
|
|
52
52
|
},
|
|
53
53
|
"volta": {
|
|
54
|
-
"node": "20.
|
|
54
|
+
"node": "20.17.0"
|
|
55
55
|
},
|
|
56
56
|
"overrides": {
|
|
57
57
|
"react": "^18.3.1",
|
|
@@ -65,32 +65,32 @@
|
|
|
65
65
|
"react-dom": ">=18.0.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@blueprintjs/select": "^5.2.
|
|
69
|
-
"@emotion/react": "^11.13.
|
|
68
|
+
"@blueprintjs/select": "^5.2.4",
|
|
69
|
+
"@emotion/react": "^11.13.3",
|
|
70
70
|
"@emotion/styled": "^11.13.0",
|
|
71
71
|
"@lukeed/uuid": "^2.0.1",
|
|
72
72
|
"@popperjs/core": "^2.11.8",
|
|
73
73
|
"@radix-ui/react-collapsible": "^1.1.0",
|
|
74
74
|
"@radix-ui/react-radio-group": "^1.2.0",
|
|
75
75
|
"@radix-ui/react-select": "^2.1.1",
|
|
76
|
-
"@tanstack/react-query": "^5.
|
|
77
|
-
"@tanstack/react-table": "^8.
|
|
76
|
+
"@tanstack/react-query": "^5.56.2",
|
|
77
|
+
"@tanstack/react-table": "^8.20.5",
|
|
78
78
|
"biologic-converter": "^0.6.0",
|
|
79
|
-
"cheminfo-types": "^1.
|
|
79
|
+
"cheminfo-types": "^1.8.0",
|
|
80
80
|
"d3-scale-chromatic": "^3.1.0",
|
|
81
81
|
"filelist-utils": "^1.11.1",
|
|
82
82
|
"immer": "^10.1.1",
|
|
83
83
|
"jcampconverter": "^9.6.4",
|
|
84
84
|
"lodash": "^4.17.21",
|
|
85
|
-
"ml-gsd": "^12.1.
|
|
86
|
-
"ml-peak-shape-generator": "^4.1.
|
|
85
|
+
"ml-gsd": "^12.1.8",
|
|
86
|
+
"ml-peak-shape-generator": "^4.1.4",
|
|
87
87
|
"ml-signal-processing": "^1.0.4",
|
|
88
|
-
"ml-spectra-processing": "^14.5.
|
|
89
|
-
"ms-spectrum": "^3.6.
|
|
88
|
+
"ml-spectra-processing": "^14.5.3",
|
|
89
|
+
"ms-spectrum": "^3.6.6",
|
|
90
90
|
"netcdfjs": "^3.0.0",
|
|
91
91
|
"react-d3-utils": "^1.0.0",
|
|
92
92
|
"react-dropzone": "^14.2.3",
|
|
93
|
-
"react-icons": "^5.
|
|
93
|
+
"react-icons": "^5.3.0",
|
|
94
94
|
"react-inspector": "^6.0.2",
|
|
95
95
|
"react-plot": "^2.0.0",
|
|
96
96
|
"react-popper": "^2.3.0",
|
|
@@ -100,31 +100,33 @@
|
|
|
100
100
|
"wdf-parser": "^0.3.0"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"@babel/core": "^7.
|
|
103
|
+
"@babel/core": "^7.25.2",
|
|
104
|
+
"@babel/preset-env": "^7.25.4",
|
|
104
105
|
"@babel/preset-react": "^7.24.7",
|
|
105
|
-
"@
|
|
106
|
-
"@blueprintjs/
|
|
107
|
-
"@
|
|
108
|
-
"@playwright/
|
|
109
|
-
"@
|
|
110
|
-
"@storybook/addon-
|
|
111
|
-
"@storybook/
|
|
112
|
-
"@storybook/
|
|
113
|
-
"@storybook/react
|
|
106
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
107
|
+
"@blueprintjs/core": "^5.13.0",
|
|
108
|
+
"@blueprintjs/icons": "^5.13.0",
|
|
109
|
+
"@playwright/experimental-ct-react": "^1.47.2",
|
|
110
|
+
"@playwright/test": "^1.47.2",
|
|
111
|
+
"@storybook/addon-essentials": "^8.3.3",
|
|
112
|
+
"@storybook/addon-storysource": "^8.3.3",
|
|
113
|
+
"@storybook/blocks": "^8.3.3",
|
|
114
|
+
"@storybook/react": "^8.3.3",
|
|
115
|
+
"@storybook/react-vite": "^8.3.3",
|
|
114
116
|
"@types/babel__core": "^7.20.5",
|
|
115
117
|
"@types/d3-scale-chromatic": "^3.0.3",
|
|
116
|
-
"@types/lodash": "^4.17.
|
|
117
|
-
"@types/react": "^18.3.
|
|
118
|
+
"@types/lodash": "^4.17.9",
|
|
119
|
+
"@types/react": "^18.3.10",
|
|
118
120
|
"@types/react-dom": "^18.3.0",
|
|
119
121
|
"@types/react-inspector": "^4.0.6",
|
|
120
122
|
"@types/tinycolor2": "^1.4.6",
|
|
121
123
|
"@vitejs/plugin-react": "^4.3.1",
|
|
122
|
-
"@vitest/coverage-v8": "^2.
|
|
124
|
+
"@vitest/coverage-v8": "^2.1.1",
|
|
123
125
|
"cheminfo-font": "^1.13.0",
|
|
124
126
|
"cross-env": "^7.0.3",
|
|
125
127
|
"eslint": "^8.57.0",
|
|
126
|
-
"eslint-config-zakodium": "^
|
|
127
|
-
"eslint-plugin-storybook": "^0.
|
|
128
|
+
"eslint-config-zakodium": "^12.0.0",
|
|
129
|
+
"eslint-plugin-storybook": "^0.9.0",
|
|
128
130
|
"fifo-logger": "^1.0.0",
|
|
129
131
|
"prettier": "^3.3.3",
|
|
130
132
|
"react": "^18.3.1",
|
|
@@ -133,10 +135,10 @@
|
|
|
133
135
|
"react-kbs": "^2.1.1",
|
|
134
136
|
"react-ocl": "^6.1.0",
|
|
135
137
|
"rimraf": "^6.0.1",
|
|
136
|
-
"storybook": "^8.
|
|
137
|
-
"typescript": "^5.
|
|
138
|
-
"vite": "^5.
|
|
139
|
-
"vitest": "^2.
|
|
138
|
+
"storybook": "^8.3.3",
|
|
139
|
+
"typescript": "^5.6.2",
|
|
140
|
+
"vite": "^5.4.8",
|
|
141
|
+
"vitest": "^2.1.1"
|
|
140
142
|
},
|
|
141
143
|
"repository": {
|
|
142
144
|
"type": "git",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { FaArrowsAltH, FaExchangeAlt } from 'react-icons/fa';
|
|
4
4
|
|
|
5
|
-
import { MeasurementPlot, MeasurementPlotProps } from '../helpers
|
|
5
|
+
import { MeasurementPlot, MeasurementPlotProps } from '../helpers';
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
|
|
7
|
+
export type MeasurementExplorerProps = Omit<
|
|
8
|
+
MeasurementPlotProps,
|
|
9
|
+
keyof ExplorerInfo
|
|
10
|
+
>;
|
|
9
11
|
interface ExplorerInfo {
|
|
10
12
|
dataIndex: number;
|
|
11
13
|
xVariableName: string;
|
|
@@ -11,8 +11,9 @@ import {
|
|
|
11
11
|
useAppState,
|
|
12
12
|
} from '../../../app-data';
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { MeasurementPanelProvider, MeasurementsTable } from '.';
|
|
15
15
|
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
16
17
|
export function MeasurementsPanel({ openPanel }: PanelProps<object>) {
|
|
17
18
|
const appState = useAppState();
|
|
18
19
|
const { data, view } = appState;
|
|
@@ -279,11 +279,11 @@ function MeasurementsTableRow(props: MeasurementsTableRowProps) {
|
|
|
279
279
|
onClick={() =>
|
|
280
280
|
openPanel?.({
|
|
281
281
|
title: item.info.file?.name ?? item.info.title,
|
|
282
|
-
renderPanel: (
|
|
282
|
+
renderPanel: (props) => (
|
|
283
283
|
<div>
|
|
284
284
|
<PanelPreferencesToolbar
|
|
285
285
|
title={item.info.file?.name ?? item.info.title}
|
|
286
|
-
onClose={closePanel}
|
|
286
|
+
onClose={() => props.closePanel()}
|
|
287
287
|
/>
|
|
288
288
|
<InfoPanel data={infoPanelData} title="" />
|
|
289
289
|
</div>
|
|
@@ -297,11 +297,11 @@ function MeasurementsTableRow(props: MeasurementsTableRowProps) {
|
|
|
297
297
|
onClick={() =>
|
|
298
298
|
openPanel?.({
|
|
299
299
|
title: item.info.file?.name ?? item.info.title,
|
|
300
|
-
renderPanel: (
|
|
300
|
+
renderPanel: (props) => (
|
|
301
301
|
<div>
|
|
302
302
|
<PanelPreferencesToolbar
|
|
303
303
|
title={item.info.file?.name ?? item.info.title}
|
|
304
|
-
onClose={closePanel}
|
|
304
|
+
onClose={() => props.closePanel()}
|
|
305
305
|
/>
|
|
306
306
|
<MeasurementConfigPanel />
|
|
307
307
|
</div>
|
|
@@ -4,13 +4,14 @@ import {
|
|
|
4
4
|
AnchorButtonProps as BlueprintAnchorButtonProps,
|
|
5
5
|
Button as BlueprintButton,
|
|
6
6
|
ButtonProps as BlueprintButtonProps,
|
|
7
|
+
Icon,
|
|
7
8
|
Tag,
|
|
8
9
|
TagProps,
|
|
9
10
|
Tooltip,
|
|
10
11
|
TooltipProps,
|
|
11
12
|
} from '@blueprintjs/core';
|
|
12
13
|
import { css } from '@emotion/react';
|
|
13
|
-
import { ReactNode } from 'react';
|
|
14
|
+
import { Fragment, ReactNode } from 'react';
|
|
14
15
|
|
|
15
16
|
type BlueprintProps = {
|
|
16
17
|
[key in keyof BlueprintButtonProps &
|
|
@@ -41,33 +42,45 @@ export function Button(props: ButtonProps) {
|
|
|
41
42
|
content={content}
|
|
42
43
|
{...otherToolTipProps}
|
|
43
44
|
renderTarget={({ isOpen, ...targetProps }) => (
|
|
44
|
-
<
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
45
|
+
<InnerButton
|
|
46
|
+
css={css({
|
|
47
|
+
position: 'relative',
|
|
48
|
+
'.bp5-icon': !children && {
|
|
49
|
+
marginRight: '0',
|
|
50
|
+
},
|
|
51
|
+
})}
|
|
52
|
+
{...targetProps}
|
|
53
|
+
{...buttonProps}
|
|
54
|
+
icon={
|
|
55
|
+
<Fragment>
|
|
56
|
+
<Icon icon={buttonProps.icon} />
|
|
57
|
+
{tag && (
|
|
58
|
+
<Tag
|
|
59
|
+
css={css`
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 0;
|
|
62
|
+
left: 0;
|
|
63
|
+
cursor: default;
|
|
64
|
+
font-size: 0.875em;
|
|
65
|
+
padding: 2px !important;
|
|
66
|
+
min-height: 15px;
|
|
67
|
+
min-width: 15px;
|
|
68
|
+
line-height: 1em;
|
|
69
|
+
text-align: center;
|
|
70
|
+
z-index: 20;
|
|
71
|
+
`}
|
|
72
|
+
round
|
|
73
|
+
intent="success"
|
|
74
|
+
{...tagProps}
|
|
75
|
+
>
|
|
76
|
+
{tag}
|
|
77
|
+
</Tag>
|
|
78
|
+
)}
|
|
79
|
+
</Fragment>
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</InnerButton>
|
|
71
84
|
)}
|
|
72
85
|
/>
|
|
73
86
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
import styled from '@emotion/styled';
|
|
4
2
|
import { Button, MenuItem } from '@blueprintjs/core';
|
|
5
3
|
import { ItemRenderer, Select } from '@blueprintjs/select';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
6
|
import * as scaleChromatic from 'd3-scale-chromatic';
|
|
7
7
|
import { FaChevronDown } from 'react-icons/fa';
|
|
8
8
|
|
|
@@ -3,6 +3,7 @@ import { css } from '@emotion/react';
|
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
|
|
5
5
|
import { Button } from '../button/Button';
|
|
6
|
+
import { SelectedTotal } from '../selected-total/SelectedTotal';
|
|
6
7
|
|
|
7
8
|
const styles = {
|
|
8
9
|
container: css({
|
|
@@ -21,12 +22,6 @@ const styles = {
|
|
|
21
22
|
minWidth: 'auto',
|
|
22
23
|
},
|
|
23
24
|
}),
|
|
24
|
-
counterLabel: css({
|
|
25
|
-
margin: 0,
|
|
26
|
-
textAlign: 'right',
|
|
27
|
-
lineHeight: '22px',
|
|
28
|
-
whiteSpace: 'nowrap',
|
|
29
|
-
}),
|
|
30
25
|
};
|
|
31
26
|
|
|
32
27
|
interface PanelHeaderProps {
|
|
@@ -45,23 +40,10 @@ export function PanelHeader({
|
|
|
45
40
|
return (
|
|
46
41
|
<div css={styles.container}>
|
|
47
42
|
<div css={styles.leftContainer}>{children}</div>
|
|
48
|
-
<
|
|
43
|
+
<SelectedTotal count={current} total={total} />
|
|
49
44
|
{onClickSettings && (
|
|
50
45
|
<Button color="black" minimal onClick={onClickSettings} icon="cog" />
|
|
51
46
|
)}
|
|
52
47
|
</div>
|
|
53
48
|
);
|
|
54
49
|
}
|
|
55
|
-
|
|
56
|
-
function formatCounterLabel(current?: number, total?: number) {
|
|
57
|
-
if (current !== undefined && total !== undefined) {
|
|
58
|
-
return `${current} / ${total}`;
|
|
59
|
-
}
|
|
60
|
-
if (current !== undefined) {
|
|
61
|
-
return `[ ${current} ]`;
|
|
62
|
-
}
|
|
63
|
-
if (total !== undefined) {
|
|
64
|
-
return `[ ${total} ]`;
|
|
65
|
-
}
|
|
66
|
-
return '';
|
|
67
|
-
}
|
package/src/components/index.ts
CHANGED