react-science 1.0.2 → 3.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.map +1 -1
- package/lib/app/about/AboutDialogToolbarButton.js +1 -1
- package/lib/app/about/AboutDialogToolbarButton.js.map +1 -1
- package/lib/app/kinds/iv/plot-view/IvPlotView.js +1 -1
- package/lib/app/kinds/iv/plot-view/IvPlotView.js.map +1 -1
- package/lib/components/fullscreen/FullscreenToolbarButton.js +1 -1
- package/lib/components/fullscreen/FullscreenToolbarButton.js.map +1 -1
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +0 -1
- 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 +65 -18
- package/lib/components/info-panel/InfoPanel.js.map +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.js +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
- package/lib/components/toolbar/Toolbar.d.ts +3 -3
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +6 -4
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.js +1 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.js.map +1 -1
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js +1 -1
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js.map +1 -1
- package/lib-esm/components/fullscreen/FullscreenToolbarButton.js +1 -1
- package/lib-esm/components/fullscreen/FullscreenToolbarButton.js.map +1 -1
- package/lib-esm/components/index.d.ts +0 -1
- package/lib-esm/components/index.d.ts.map +1 -1
- package/lib-esm/components/index.js +0 -1
- 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 +67 -20
- package/lib-esm/components/info-panel/InfoPanel.js.map +1 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.js +1 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.d.ts +3 -3
- package/lib-esm/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.js +6 -4
- package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
- package/package.json +1 -1
- package/src/app/about/AboutDialogToolbarButton.tsx +6 -1
- package/src/app/kinds/iv/plot-view/IvPlotView.tsx +1 -1
- package/src/components/fullscreen/FullscreenToolbarButton.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/components/info-panel/InfoPanel.tsx +148 -68
- package/src/components/toolbar/PanelPreferencesToolbar.tsx +2 -14
- package/src/components/toolbar/Toolbar.tsx +11 -7
- package/lib/components/layout-manager/LayoutManager.d.ts +0 -18
- package/lib/components/layout-manager/LayoutManager.d.ts.map +0 -1
- package/lib/components/layout-manager/LayoutManager.js +0 -51
- package/lib/components/layout-manager/LayoutManager.js.map +0 -1
- package/lib/components/layout-manager/index.d.ts +0 -2
- package/lib/components/layout-manager/index.d.ts.map +0 -1
- package/lib/components/layout-manager/index.js +0 -18
- package/lib/components/layout-manager/index.js.map +0 -1
- package/lib-esm/components/layout-manager/LayoutManager.d.ts +0 -18
- package/lib-esm/components/layout-manager/LayoutManager.d.ts.map +0 -1
- package/lib-esm/components/layout-manager/LayoutManager.js +0 -47
- package/lib-esm/components/layout-manager/LayoutManager.js.map +0 -1
- package/lib-esm/components/layout-manager/index.d.ts +0 -2
- package/lib-esm/components/layout-manager/index.d.ts.map +0 -1
- package/lib-esm/components/layout-manager/index.js +0 -2
- package/lib-esm/components/layout-manager/index.js.map +0 -1
- package/src/components/layout-manager/LayoutManager.tsx +0 -95
- package/src/components/layout-manager/index.ts +0 -1
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { InputGroup } from '@blueprintjs/core';
|
|
3
|
+
import { Icon, InputGroup } from '@blueprintjs/core';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
6
|
-
// @ts-ignore
|
|
7
5
|
import { Disclosure } from '@headlessui/react';
|
|
8
|
-
import { useState } from 'react';
|
|
9
|
-
import { FaChevronRight } from 'react-icons/fa';
|
|
6
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
10
7
|
import { ValueRenderers } from '../index';
|
|
11
8
|
import { Table } from '../table/Table';
|
|
12
9
|
const style = {
|
|
@@ -18,30 +15,37 @@ const style = {
|
|
|
18
15
|
transition: 'all 0.3s ease-in-out',
|
|
19
16
|
}),
|
|
20
17
|
button: css({
|
|
18
|
+
borderBottom: '1px solid #f5f5f5',
|
|
21
19
|
display: 'flex',
|
|
22
20
|
alignItems: 'center',
|
|
23
21
|
gap: 5,
|
|
24
22
|
padding: '5px 2px',
|
|
23
|
+
width: '100%',
|
|
24
|
+
':hover': {
|
|
25
|
+
backgroundColor: '#f5f5f5',
|
|
26
|
+
},
|
|
25
27
|
}),
|
|
26
28
|
};
|
|
27
29
|
export function InfoPanel(props) {
|
|
28
30
|
const [search, setSearch] = useState('');
|
|
29
31
|
const { title = 'Information', data = [], titleStyle, inputStyle } = props;
|
|
30
|
-
|
|
32
|
+
const viewData = useCallback((data) => {
|
|
31
33
|
const exactMatch = [];
|
|
32
34
|
const startsWith = [];
|
|
33
35
|
const includes = [];
|
|
34
36
|
const valueContains = [];
|
|
35
|
-
for (const [key, value] of Object.entries(data)) {
|
|
36
|
-
|
|
37
|
+
for (const [key, value] of Object.entries(data).sort(([a], [b]) => a.localeCompare(b))) {
|
|
38
|
+
const lowerKey = key.toLowerCase();
|
|
39
|
+
const lowerSearch = search.toLowerCase();
|
|
40
|
+
if (lowerKey === lowerSearch) {
|
|
37
41
|
exactMatch.push([key, value]);
|
|
38
42
|
continue;
|
|
39
43
|
}
|
|
40
|
-
if (
|
|
44
|
+
if (lowerKey.startsWith(lowerSearch)) {
|
|
41
45
|
startsWith.push([key, value]);
|
|
42
46
|
continue;
|
|
43
47
|
}
|
|
44
|
-
if (
|
|
48
|
+
if (lowerKey.includes(lowerSearch)) {
|
|
45
49
|
includes.push([key, value]);
|
|
46
50
|
continue;
|
|
47
51
|
}
|
|
@@ -50,15 +54,54 @@ export function InfoPanel(props) {
|
|
|
50
54
|
continue;
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
|
-
return [...exactMatch, ...startsWith, ...includes, ...valueContains]
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
return [...exactMatch, ...startsWith, ...includes, ...valueContains];
|
|
58
|
+
}, [search]);
|
|
59
|
+
const { filteredData, total, count } = useMemo(() => {
|
|
60
|
+
const filteredData = [];
|
|
61
|
+
let total = 0;
|
|
62
|
+
let count = 0;
|
|
63
|
+
for (const { data: dataContent, ...other } of data) {
|
|
64
|
+
total += Object.entries(dataContent).length;
|
|
65
|
+
const content = viewData(dataContent);
|
|
66
|
+
if (content.length === 0)
|
|
67
|
+
continue;
|
|
68
|
+
filteredData.push({ data: content, ...other });
|
|
69
|
+
count += content.length;
|
|
70
|
+
}
|
|
71
|
+
return { filteredData, total, count };
|
|
72
|
+
}, [data, viewData]);
|
|
73
|
+
return (_jsxs("div", { css: style.container, children: [_jsx("div", { style: titleStyle, children: title }), _jsxs("div", { tabIndex: 0, css: css({
|
|
74
|
+
zIndex: 10,
|
|
75
|
+
marginTop: '5px',
|
|
76
|
+
position: 'sticky',
|
|
77
|
+
backgroundColor: 'white',
|
|
78
|
+
top: '5px',
|
|
79
|
+
display: 'flex',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
gap: 6,
|
|
82
|
+
width: '100%',
|
|
83
|
+
}), children: [_jsx(InputGroup, { css: css({
|
|
84
|
+
flexGrow: 1,
|
|
85
|
+
}), placeholder: "search for a parameter ...", value: search, onChange: ({ target }) => {
|
|
86
|
+
if (target.value !== undefined) {
|
|
87
|
+
setSearch(target.value);
|
|
88
|
+
}
|
|
89
|
+
}, style: inputStyle, leftIcon: "search", type: "search", fill: true }), "[", count, "/", total, "]"] }), _jsx("div", { style: {
|
|
90
|
+
marginTop: '5px',
|
|
91
|
+
display: 'flex',
|
|
92
|
+
flexDirection: 'column',
|
|
93
|
+
gap: '5px',
|
|
94
|
+
}, children: filteredData.map(({ description, data }) => {
|
|
95
|
+
return (_jsx(Disclosure, { defaultOpen: true, children: ({ open }) => (_jsxs(_Fragment, { children: [_jsxs(Disclosure.Button, { css: style.button, children: [_jsx(Icon, { icon: "chevron-right", css: style.chevron(open) }), description] }), _jsx(Disclosure.Panel, { children: _jsxs(Table, { striped: true, css: css({
|
|
96
|
+
width: '100%',
|
|
97
|
+
'td:first-child': {
|
|
98
|
+
width: '30%',
|
|
99
|
+
},
|
|
100
|
+
}), compact: true, children: [_jsxs(Table.Header, { children: [_jsx(ValueRenderers.Header, { style: { width: '50px' }, value: "Parameter" }), _jsx(ValueRenderers.Header, { value: "Value" })] }), data.map(([key, value]) => (_jsxs(Table.Row, { bordered: true, style: {
|
|
101
|
+
height: '10px',
|
|
102
|
+
padding: '0 !imporant',
|
|
103
|
+
}, children: [_jsx(ValueRenderers.Text, { style: { width: '50px' }, value: key }), valueCell(value)] }, key)))] }) })] })) }, description));
|
|
104
|
+
}) })] }));
|
|
62
105
|
}
|
|
63
106
|
/**
|
|
64
107
|
* Get the value cell depending on the type of the value
|
|
@@ -86,7 +129,11 @@ function valueCell(value) {
|
|
|
86
129
|
* @param search - Value to search for.
|
|
87
130
|
* @returns - If search exist in value
|
|
88
131
|
*/
|
|
89
|
-
function valueSearch(value, search) {
|
|
132
|
+
function valueSearch(value, search, lowerCase = true) {
|
|
133
|
+
if (lowerCase) {
|
|
134
|
+
value = String(value).toLowerCase();
|
|
135
|
+
search = search.toLowerCase();
|
|
136
|
+
}
|
|
90
137
|
switch (typeof value) {
|
|
91
138
|
case 'number':
|
|
92
139
|
return String(value).includes(search);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoPanel.js","sourceRoot":"","sources":["../../../src/components/info-panel/InfoPanel.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoPanel.js","sourceRoot":"","sources":["../../../src/components/info-panel/InfoPanel.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAiB,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAavC,MAAM,KAAK,GAAG;IACZ,SAAS,EAAE,GAAG,CAAC;QACb,OAAO,EAAE,KAAK;KACf,CAAC;IACF,OAAO,EAAE,CAAC,IAAa,EAAE,EAAE,CACzB,GAAG,CAAC;QACF,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;QAC/B,UAAU,EAAE,sBAAsB;KAC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KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AA0BD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"PanelPreferencesToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/PanelPreferencesToolbar.tsx"],"names":[],"mappings":";AAKA,UAAU,4BAA4B;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AA0BD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,oDAiB1E"}
|
|
@@ -27,6 +27,6 @@ const styles = {
|
|
|
27
27
|
};
|
|
28
28
|
export function PanelPreferencesToolbar(props) {
|
|
29
29
|
const { title = '', onClose, onSave } = props;
|
|
30
|
-
return (_jsxs("div", { css: styles.container, children: [_jsx("div", { css: styles.title, children: title }), _jsx("div", { css: styles.toolbar, children: _jsxs(Toolbar, { children: [onClose && (_jsx(Toolbar.Item, {
|
|
30
|
+
return (_jsxs("div", { css: styles.container, children: [_jsx("div", { css: styles.title, children: title }), _jsx("div", { css: styles.toolbar, 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
31
|
}
|
|
32
32
|
//# sourceMappingURL=PanelPreferencesToolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelPreferencesToolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/PanelPreferencesToolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,MAAM,MAAM,GAAG;IACb,SAAS,EAAE,GAAG,CAAC;QACb,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,eAAe;QAC/B,YAAY,EAAE,8BAA8B;KAC7C,CAAC;IACF,KAAK,EAAE,GAAG,CAAC;QACT,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,GAAG;KAChB,CAAC;IACF,OAAO,EAAE,GAAG,CAAC;QACX,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,aAAa;QAC5B,YAAY,EAAE;YACZ,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,QAAQ,EAAE,MAAM;SACjB;KACF,CAAC;CACH,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC9C,OAAO,CACL,eAAK,GAAG,EAAE,MAAM,CAAC,SAAS,aACxB,cAAK,GAAG,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAO,EACrC,cAAK,GAAG,EAAE,MAAM,CAAC,OAAO,YACtB,MAAC,OAAO,eACL,OAAO,IAAI,CACV,KAAC,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"PanelPreferencesToolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/PanelPreferencesToolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,MAAM,MAAM,GAAG;IACb,SAAS,EAAE,GAAG,CAAC;QACb,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,eAAe;QAC/B,YAAY,EAAE,8BAA8B;KAC7C,CAAC;IACF,KAAK,EAAE,GAAG,CAAC;QACT,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,GAAG;KAChB,CAAC;IACF,OAAO,EAAE,GAAG,CAAC;QACX,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,aAAa;QAC5B,YAAY,EAAE;YACZ,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,QAAQ,EAAE,MAAM;SACjB;KACF,CAAC;CACH,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC9C,OAAO,CACL,eAAK,GAAG,EAAE,MAAM,CAAC,SAAS,aACxB,cAAK,GAAG,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAO,EACrC,cAAK,GAAG,EAAE,MAAM,CAAC,OAAO,YACtB,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,GACN,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { Intent, PopoverProps, TagProps } from '@blueprintjs/core';
|
|
2
|
+
import { Intent, PopoverProps, TagProps, TooltipProps } from '@blueprintjs/core';
|
|
3
3
|
import { IconName } from '@blueprintjs/icons';
|
|
4
4
|
import { JSX, ReactElement, ReactNode } from 'react';
|
|
5
5
|
export type PopoverInteractionType = 'click' | 'hover' | 'click-target' | 'hover-target';
|
|
@@ -15,12 +15,12 @@ export interface ToolbarProps extends ToolbarBaseProps {
|
|
|
15
15
|
}
|
|
16
16
|
export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
17
17
|
id?: string;
|
|
18
|
-
|
|
18
|
+
tooltip?: TooltipProps['content'];
|
|
19
|
+
tooltipProps?: Omit<TooltipProps, 'content'>;
|
|
19
20
|
icon: IconName | JSX.Element;
|
|
20
21
|
active?: boolean;
|
|
21
22
|
onClick?: (item: ToolbarItemProps) => void;
|
|
22
23
|
className?: string;
|
|
23
|
-
noTooltip?: boolean;
|
|
24
24
|
isPopover?: boolean;
|
|
25
25
|
tag?: ReactNode;
|
|
26
26
|
tagProps?: Omit<TagProps, 'children'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAIL,MAAM,EAEN,YAAY,EACZ,QAAQ,
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAIL,MAAM,EAEN,YAAY,EACZ,QAAQ,EAER,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAEL,GAAG,EACH,YAAY,EACZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAUf,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,YAAa,SAAQ,gBAAgB;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EACL,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,GACrC,YAAY,CAAC,gBAAgB,CAAC,GAC9B,QAAQ,CAAC,SAAS,CAAC,GACnB,OAAO,GACP,IAAI,CAAC;IACT,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC7C,IAAI,EAAE,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAID,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,oDA+D1C;yBA/De,OAAO"}
|
|
@@ -47,7 +47,7 @@ export function Toolbar(props) {
|
|
|
47
47
|
}, children: children }, String(vertical)) }));
|
|
48
48
|
}
|
|
49
49
|
Toolbar.Item = function ToolbarItem(props) {
|
|
50
|
-
const { active = false, icon, onClick,
|
|
50
|
+
const { active = false, icon, onClick, tooltip, tooltipProps, id, intent: itemIntent, disabled: itemDisabled, isPopover, ...other } = props;
|
|
51
51
|
const { intent: toolbarIntent, disabled: toolbarDisabled, large, vertical, } = useToolbarContext();
|
|
52
52
|
const intent = itemIntent ?? toolbarIntent;
|
|
53
53
|
const disabled = itemDisabled ?? toolbarDisabled;
|
|
@@ -80,13 +80,15 @@ Toolbar.Item = function ToolbarItem(props) {
|
|
|
80
80
|
right: 0,
|
|
81
81
|
} }))] }), onClick: () => {
|
|
82
82
|
onClick?.(props);
|
|
83
|
-
}, tooltipProps:
|
|
83
|
+
}, tooltipProps: !tooltip
|
|
84
84
|
? undefined
|
|
85
85
|
: {
|
|
86
|
-
content:
|
|
86
|
+
content: tooltip,
|
|
87
87
|
placement: vertical ? 'right' : 'bottom',
|
|
88
88
|
intent,
|
|
89
89
|
compact: !large,
|
|
90
|
+
interactionKind: 'hover',
|
|
91
|
+
...tooltipProps,
|
|
90
92
|
}, ...other }));
|
|
91
93
|
};
|
|
92
94
|
Toolbar.PopoverItem = function ToolbarPopoverItem(props) {
|
|
@@ -104,7 +106,7 @@ Toolbar.PopoverItem = function ToolbarPopoverItem(props) {
|
|
|
104
106
|
height: 'fit-content',
|
|
105
107
|
flex: 'none',
|
|
106
108
|
},
|
|
107
|
-
}, ...other, children: _jsx(Toolbar.Item, {
|
|
109
|
+
}, ...other, children: _jsx(Toolbar.Item, { isPopover: true, ...itemProps }) }));
|
|
108
110
|
};
|
|
109
111
|
function ToolbarProvider(props) {
|
|
110
112
|
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,EACX,OAAO,EACP,MAAM,EAEN,OAAO,EAGP,IAAI,
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EACL,WAAW,EACX,OAAO,EACP,MAAM,EAEN,OAAO,EAG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AAC;AAEF,SAAS,eAAe,CAAC,KAGxB;IACC,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YACxC,KAAK,CAAC,QAAQ,GACS,CAC3B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -16,8 +16,13 @@ export function AboutDialogToolbarButton(props: AboutDialogToolbarButtonProps) {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
19
|
-
<Toolbar.Item
|
|
19
|
+
<Toolbar.Item
|
|
20
|
+
tooltip={`About ${name}`}
|
|
21
|
+
onClick={openDialog}
|
|
22
|
+
icon={icon}
|
|
23
|
+
/>
|
|
20
24
|
<Dialog
|
|
25
|
+
shouldReturnFocusOnClose={false}
|
|
21
26
|
isOpen={isOpenDialog}
|
|
22
27
|
onClose={closeDialog}
|
|
23
28
|
title={name}
|
|
@@ -5,6 +5,6 @@ import { useFullscreen } from './FullscreenContext';
|
|
|
5
5
|
export function FullscreenToolbarButton() {
|
|
6
6
|
const { toggle } = useFullscreen();
|
|
7
7
|
return (
|
|
8
|
-
<Toolbar.Item icon="fullscreen"
|
|
8
|
+
<Toolbar.Item icon="fullscreen" tooltip="Full screen" onClick={toggle} />
|
|
9
9
|
);
|
|
10
10
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ export * from './fullscreen/index';
|
|
|
7
7
|
export * from './header/index';
|
|
8
8
|
export * from './hooks/index';
|
|
9
9
|
export * from './info-panel/index';
|
|
10
|
-
export * from './layout-manager/index';
|
|
11
10
|
export * from './dialog/index';
|
|
12
11
|
export * from './root-layout/index';
|
|
13
12
|
export * from './split-pane/index';
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { InputGroup } from '@blueprintjs/core';
|
|
2
|
+
import { Icon, InputGroup } from '@blueprintjs/core';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
5
|
-
// @ts-ignore
|
|
6
4
|
import { Disclosure } from '@headlessui/react';
|
|
7
|
-
import { CSSProperties, useState } from 'react';
|
|
8
|
-
import { FaChevronRight } from 'react-icons/fa';
|
|
5
|
+
import { CSSProperties, useCallback, useMemo, useState } from 'react';
|
|
9
6
|
|
|
10
7
|
import { ValueRenderers } from '../index';
|
|
11
8
|
import { Table } from '../table/Table';
|
|
@@ -31,87 +28,165 @@ const style = {
|
|
|
31
28
|
transition: 'all 0.3s ease-in-out',
|
|
32
29
|
}),
|
|
33
30
|
button: css({
|
|
31
|
+
borderBottom: '1px solid #f5f5f5',
|
|
34
32
|
display: 'flex',
|
|
35
33
|
alignItems: 'center',
|
|
36
34
|
gap: 5,
|
|
37
35
|
padding: '5px 2px',
|
|
36
|
+
width: '100%',
|
|
37
|
+
':hover': {
|
|
38
|
+
backgroundColor: '#f5f5f5',
|
|
39
|
+
},
|
|
38
40
|
}),
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
export function InfoPanel(props: InfoPanelProps) {
|
|
42
44
|
const [search, setSearch] = useState('');
|
|
43
45
|
const { title = 'Information', data = [], titleStyle, inputStyle } = props;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const viewData = useCallback(
|
|
47
|
+
(data: Record<string, string | number | object>) => {
|
|
48
|
+
const exactMatch: Array<[string, string | number | object]> = [];
|
|
49
|
+
const startsWith: Array<[string, string | number | object]> = [];
|
|
50
|
+
const includes: Array<[string, string | number | object]> = [];
|
|
51
|
+
const valueContains: Array<[string, string | number | object]> = [];
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
for (const [key, value] of Object.entries(data).sort(([a], [b]) =>
|
|
54
|
+
a.localeCompare(b),
|
|
55
|
+
)) {
|
|
56
|
+
const lowerKey = key.toLowerCase();
|
|
57
|
+
const lowerSearch = search.toLowerCase();
|
|
58
|
+
if (lowerKey === lowerSearch) {
|
|
59
|
+
exactMatch.push([key, value]);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (lowerKey.startsWith(lowerSearch)) {
|
|
63
|
+
startsWith.push([key, value]);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (lowerKey.includes(lowerSearch)) {
|
|
67
|
+
includes.push([key, value]);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (valueSearch(value, search)) {
|
|
71
|
+
valueContains.push([key, value]);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
54
74
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (valueSearch(value, search)) {
|
|
64
|
-
valueContains.push([key, value]);
|
|
65
|
-
continue;
|
|
75
|
+
return [...exactMatch, ...startsWith, ...includes, ...valueContains];
|
|
76
|
+
},
|
|
77
|
+
[search],
|
|
78
|
+
);
|
|
79
|
+
const { filteredData, total, count } = useMemo(() => {
|
|
80
|
+
const filteredData: Array<
|
|
81
|
+
Omit<InfoPanelData, 'data'> & {
|
|
82
|
+
data: Array<[string, string | number | object]>;
|
|
66
83
|
}
|
|
84
|
+
> = [];
|
|
85
|
+
let total = 0;
|
|
86
|
+
let count = 0;
|
|
87
|
+
for (const { data: dataContent, ...other } of data) {
|
|
88
|
+
total += Object.entries(dataContent).length;
|
|
89
|
+
const content = viewData(dataContent);
|
|
90
|
+
if (content.length === 0) continue;
|
|
91
|
+
filteredData.push({ data: content, ...other });
|
|
92
|
+
count += content.length;
|
|
67
93
|
}
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
<Table.Row key={key}>
|
|
71
|
-
<ValueRenderers.Text value={key} />
|
|
72
|
-
{valueCell(value)}
|
|
73
|
-
</Table.Row>
|
|
74
|
-
),
|
|
75
|
-
);
|
|
76
|
-
}
|
|
94
|
+
return { filteredData, total, count };
|
|
95
|
+
}, [data, viewData]);
|
|
77
96
|
return (
|
|
78
97
|
<div css={style.container}>
|
|
79
98
|
<div style={titleStyle}>{title}</div>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
<div
|
|
100
|
+
tabIndex={0}
|
|
101
|
+
css={css({
|
|
102
|
+
zIndex: 10,
|
|
103
|
+
marginTop: '5px',
|
|
104
|
+
position: 'sticky',
|
|
105
|
+
backgroundColor: 'white',
|
|
106
|
+
top: '5px',
|
|
107
|
+
display: 'flex',
|
|
108
|
+
alignItems: 'center',
|
|
109
|
+
gap: 6,
|
|
110
|
+
width: '100%',
|
|
111
|
+
})}
|
|
112
|
+
>
|
|
113
|
+
<InputGroup
|
|
114
|
+
css={css({
|
|
115
|
+
flexGrow: 1,
|
|
116
|
+
})}
|
|
117
|
+
placeholder="search for a parameter ..."
|
|
118
|
+
value={search}
|
|
119
|
+
onChange={({ target }) => {
|
|
120
|
+
if (target.value !== undefined) {
|
|
121
|
+
setSearch(target.value);
|
|
122
|
+
}
|
|
123
|
+
}}
|
|
124
|
+
style={inputStyle}
|
|
125
|
+
leftIcon="search"
|
|
126
|
+
type="search"
|
|
127
|
+
fill
|
|
128
|
+
/>
|
|
129
|
+
[{count}/{total}]
|
|
130
|
+
</div>
|
|
131
|
+
<div
|
|
132
|
+
style={{
|
|
133
|
+
marginTop: '5px',
|
|
134
|
+
display: 'flex',
|
|
135
|
+
flexDirection: 'column',
|
|
136
|
+
gap: '5px',
|
|
85
137
|
}}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
138
|
+
>
|
|
139
|
+
{filteredData.map(({ description, data }) => {
|
|
140
|
+
return (
|
|
141
|
+
<Disclosure defaultOpen key={description}>
|
|
142
|
+
{({ open }) => (
|
|
143
|
+
<>
|
|
144
|
+
<Disclosure.Button css={style.button}>
|
|
145
|
+
<Icon icon="chevron-right" css={style.chevron(open)} />
|
|
146
|
+
{description}
|
|
147
|
+
</Disclosure.Button>
|
|
148
|
+
<Disclosure.Panel>
|
|
149
|
+
<Table
|
|
150
|
+
striped
|
|
151
|
+
css={css({
|
|
152
|
+
width: '100%',
|
|
153
|
+
'td:first-child': {
|
|
154
|
+
width: '30%',
|
|
155
|
+
},
|
|
156
|
+
})}
|
|
157
|
+
compact
|
|
158
|
+
>
|
|
159
|
+
<Table.Header>
|
|
160
|
+
<ValueRenderers.Header
|
|
161
|
+
style={{ width: '50px' }}
|
|
162
|
+
value="Parameter"
|
|
163
|
+
/>
|
|
164
|
+
<ValueRenderers.Header value="Value" />
|
|
165
|
+
</Table.Header>
|
|
166
|
+
{data.map(([key, value]) => (
|
|
167
|
+
<Table.Row
|
|
168
|
+
key={key}
|
|
169
|
+
bordered
|
|
170
|
+
style={{
|
|
171
|
+
height: '10px',
|
|
172
|
+
padding: '0 !imporant',
|
|
173
|
+
}}
|
|
174
|
+
>
|
|
175
|
+
<ValueRenderers.Text
|
|
176
|
+
style={{ width: '50px' }}
|
|
177
|
+
value={key}
|
|
178
|
+
/>
|
|
179
|
+
{valueCell(value)}
|
|
180
|
+
</Table.Row>
|
|
181
|
+
))}
|
|
182
|
+
</Table>
|
|
183
|
+
</Disclosure.Panel>
|
|
184
|
+
</>
|
|
185
|
+
)}
|
|
186
|
+
</Disclosure>
|
|
187
|
+
);
|
|
188
|
+
})}
|
|
189
|
+
</div>
|
|
115
190
|
</div>
|
|
116
191
|
);
|
|
117
192
|
}
|
|
@@ -145,7 +220,12 @@ function valueCell(value: number | string | object | boolean) {
|
|
|
145
220
|
function valueSearch(
|
|
146
221
|
value: number | string | object | boolean,
|
|
147
222
|
search: string,
|
|
223
|
+
lowerCase = true,
|
|
148
224
|
): boolean {
|
|
225
|
+
if (lowerCase) {
|
|
226
|
+
value = String(value).toLowerCase();
|
|
227
|
+
search = search.toLowerCase();
|
|
228
|
+
}
|
|
149
229
|
switch (typeof value) {
|
|
150
230
|
case 'number':
|
|
151
231
|
return String(value).includes(search);
|
|
@@ -41,22 +41,10 @@ export function PanelPreferencesToolbar(props: PanelPreferencesToolbarProps) {
|
|
|
41
41
|
<div css={styles.toolbar}>
|
|
42
42
|
<Toolbar>
|
|
43
43
|
{onClose && (
|
|
44
|
-
<Toolbar.Item
|
|
45
|
-
title="close"
|
|
46
|
-
onClick={onClose}
|
|
47
|
-
intent="danger"
|
|
48
|
-
icon="cross"
|
|
49
|
-
noTooltip
|
|
50
|
-
/>
|
|
44
|
+
<Toolbar.Item onClick={onClose} intent="danger" icon="cross" />
|
|
51
45
|
)}
|
|
52
46
|
{onSave && (
|
|
53
|
-
<Toolbar.Item
|
|
54
|
-
title="save"
|
|
55
|
-
onClick={onSave}
|
|
56
|
-
intent="success"
|
|
57
|
-
icon="tick"
|
|
58
|
-
noTooltip
|
|
59
|
-
/>
|
|
47
|
+
<Toolbar.Item onClick={onSave} intent="success" icon="tick" />
|
|
60
48
|
)}
|
|
61
49
|
</Toolbar>
|
|
62
50
|
</div>
|