react-science 0.19.2 → 0.20.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.js +10 -10
- package/lib/app/explorer/MeasurementExplorer.js +36 -43
- package/lib/app/helpers/react-plot.js +16 -13
- package/lib/app/kinds/iv/plot-view/IvPlotView.js +14 -13
- package/lib/app/panels/measurements/MeasurementCheckbox.js +10 -8
- package/lib/app/panels/measurements/MeasurementColorPreview.js +9 -7
- package/lib/app/panels/measurements/MeasurementsTable.js +81 -94
- package/lib/components/button/ButtonGroup.js +31 -43
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +18 -21
- package/lib/components/drop-zone/DropZone.js +48 -48
- package/lib/components/dropdown-menu/DropdownMenu.js +4 -4
- package/lib/components/forms/Input.js +150 -0
- package/lib/components/forms/context/FieldsContext.js +54 -0
- package/lib/components/forms/context/index.js +17 -0
- package/lib/components/forms/index.js +18 -0
- package/lib/components/index.js +1 -0
- package/lib/components/modal/ConfirmModal.js +40 -29
- package/lib/components/modal/Modal.js +45 -34
- package/lib/components/root-layout/RootLayout.js +1 -1
- package/lib/components/root-layout/css-reset/customPreflight.js +10 -3
- package/lib/components/spinner/FullSpinner.js +10 -7
- package/lib-esm/app/about/AboutDialogToolbarButton.d.ts +1 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
- package/lib-esm/app/about/AboutDialogToolbarButton.js +7 -10
- package/lib-esm/app/about/AboutDialogToolbarButton.js.map +1 -1
- package/lib-esm/app/explorer/MeasurementExplorer.d.ts +2 -1
- package/lib-esm/app/explorer/MeasurementExplorer.d.ts.map +1 -1
- package/lib-esm/app/explorer/MeasurementExplorer.js +31 -41
- package/lib-esm/app/explorer/MeasurementExplorer.js.map +1 -1
- package/lib-esm/app/helpers/MeasurementPlot.js.map +1 -1
- package/lib-esm/app/helpers/react-plot.d.ts +4 -2
- package/lib-esm/app/helpers/react-plot.d.ts.map +1 -1
- package/lib-esm/app/helpers/react-plot.js +11 -11
- package/lib-esm/app/helpers/react-plot.js.map +1 -1
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.d.ts +2 -1
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.d.ts.map +1 -1
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js +14 -13
- package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementCheckbox.d.ts +2 -1
- package/lib-esm/app/panels/measurements/MeasurementCheckbox.d.ts.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementCheckbox.js +4 -5
- package/lib-esm/app/panels/measurements/MeasurementCheckbox.js.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementColorPreview.d.ts +2 -1
- package/lib-esm/app/panels/measurements/MeasurementColorPreview.d.ts.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementColorPreview.js +4 -5
- package/lib-esm/app/panels/measurements/MeasurementColorPreview.js.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts +2 -1
- package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts.map +1 -1
- package/lib-esm/app/panels/measurements/MeasurementsTable.js +81 -94
- package/lib-esm/app/panels/measurements/MeasurementsTable.js.map +1 -1
- package/lib-esm/components/button/ButtonGroup.d.ts +2 -2
- package/lib-esm/components/button/ButtonGroup.d.ts.map +1 -1
- package/lib-esm/components/button/ButtonGroup.js +28 -43
- package/lib-esm/components/button/ButtonGroup.js.map +1 -1
- package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts +2 -1
- package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts.map +1 -1
- package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +16 -19
- package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js.map +1 -1
- package/lib-esm/components/drop-zone/DropZone.d.ts +2 -2
- package/lib-esm/components/drop-zone/DropZone.d.ts.map +1 -1
- package/lib-esm/components/drop-zone/DropZone.js +42 -45
- package/lib-esm/components/drop-zone/DropZone.js.map +1 -1
- package/lib-esm/components/dropdown-menu/DropdownMenu.js +4 -4
- package/lib-esm/components/dropdown-menu/DropdownMenu.js.map +1 -1
- package/lib-esm/components/forms/Input.d.ts +17 -0
- package/lib-esm/components/forms/Input.d.ts.map +1 -0
- package/lib-esm/components/forms/Input.js +144 -0
- package/lib-esm/components/forms/Input.js.map +1 -0
- package/lib-esm/components/forms/context/FieldsContext.d.ts +16 -0
- package/lib-esm/components/forms/context/FieldsContext.d.ts.map +1 -0
- package/lib-esm/components/forms/context/FieldsContext.js +47 -0
- package/lib-esm/components/forms/context/FieldsContext.js.map +1 -0
- package/lib-esm/components/forms/context/index.d.ts +2 -0
- package/lib-esm/components/forms/context/index.d.ts.map +1 -0
- package/lib-esm/components/forms/context/index.js +2 -0
- package/lib-esm/components/forms/context/index.js.map +1 -0
- package/lib-esm/components/forms/index.d.ts +3 -0
- package/lib-esm/components/forms/index.d.ts.map +1 -0
- package/lib-esm/components/forms/index.js +3 -0
- package/lib-esm/components/forms/index.js.map +1 -0
- 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/modal/ConfirmModal.d.ts +1 -1
- package/lib-esm/components/modal/ConfirmModal.d.ts.map +1 -1
- package/lib-esm/components/modal/ConfirmModal.js +37 -29
- package/lib-esm/components/modal/ConfirmModal.js.map +1 -1
- package/lib-esm/components/modal/Modal.d.ts +4 -4
- package/lib-esm/components/modal/Modal.d.ts.map +1 -1
- package/lib-esm/components/modal/Modal.js +45 -34
- package/lib-esm/components/modal/Modal.js.map +1 -1
- package/lib-esm/components/root-layout/RootLayout.d.ts.map +1 -1
- package/lib-esm/components/root-layout/RootLayout.js +2 -2
- package/lib-esm/components/root-layout/RootLayout.js.map +1 -1
- package/lib-esm/components/root-layout/css-reset/customPreflight.d.ts +5 -1
- package/lib-esm/components/root-layout/css-reset/customPreflight.d.ts.map +1 -1
- package/lib-esm/components/root-layout/css-reset/customPreflight.js +6 -2
- package/lib-esm/components/root-layout/css-reset/customPreflight.js.map +1 -1
- package/lib-esm/components/spinner/FullSpinner.d.ts +7 -1
- package/lib-esm/components/spinner/FullSpinner.d.ts.map +1 -1
- package/lib-esm/components/spinner/FullSpinner.js +8 -8
- package/lib-esm/components/spinner/FullSpinner.js.map +1 -1
- package/package.json +1 -1
- package/src/app/about/AboutDialogToolbarButton.tsx +6 -9
- package/src/app/explorer/MeasurementExplorer.tsx +47 -59
- package/src/app/helpers/MeasurementPlot.tsx +1 -0
- package/src/app/helpers/react-plot.tsx +24 -19
- package/src/app/kinds/iv/plot-view/IvPlotView.tsx +18 -19
- package/src/app/panels/measurements/MeasurementCheckbox.tsx +3 -5
- package/src/app/panels/measurements/MeasurementColorPreview.tsx +4 -6
- package/src/app/panels/measurements/MeasurementsTable.tsx +112 -115
- package/src/components/button/ButtonGroup.tsx +30 -44
- package/src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx +19 -26
- package/src/components/drop-zone/DropZone.tsx +54 -56
- package/src/components/dropdown-menu/DropdownMenu.tsx +19 -17
- package/src/components/forms/Input.tsx +255 -0
- package/src/components/forms/context/FieldsContext.tsx +82 -0
- package/src/components/forms/context/index.ts +1 -0
- package/src/components/forms/index.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/components/modal/ConfirmModal.tsx +49 -44
- package/src/components/modal/Modal.tsx +54 -58
- package/src/components/root-layout/RootLayout.tsx +3 -7
- package/src/components/root-layout/css-reset/customPreflight.ts +6 -2
- package/src/components/spinner/FullSpinner.tsx +14 -9
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.AboutDialogToolbarButton = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("
|
|
5
|
-
|
|
6
|
-
const react_1 = require("@emotion/react");
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
7
9
|
const index_1 = require("../../components/index");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`,
|
|
13
|
-
};
|
|
10
|
+
const ModalBody = styled_1.default.div `
|
|
11
|
+
max-width: 600px;
|
|
12
|
+
padding: 10px;
|
|
13
|
+
`;
|
|
14
14
|
function AboutDialogToolbarButton(props) {
|
|
15
15
|
const { name, icon, body } = props;
|
|
16
16
|
const [isOpenDialog, openDialog, closeDialog] = (0, index_1.useOnOff)(false);
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(index_1.Toolbar.Item, { titleOrientation: "horizontal", title: `About ${name}`, onClick: openDialog, children: icon }), (0, jsx_runtime_1.jsxs)(index_1.Modal, { isOpen: isOpenDialog, onRequestClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(index_1.Modal.Header, { children: name }), (0, jsx_runtime_1.jsx)(index_1.Modal.Body, { children: (0, jsx_runtime_1.jsx)(
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(index_1.Toolbar.Item, { titleOrientation: "horizontal", title: `About ${name}`, onClick: openDialog, children: icon }), (0, jsx_runtime_1.jsxs)(index_1.Modal, { isOpen: isOpenDialog, onRequestClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(index_1.Modal.Header, { children: name }), (0, jsx_runtime_1.jsx)(index_1.Modal.Body, { children: (0, jsx_runtime_1.jsx)(ModalBody, { children: body }) })] })] }));
|
|
18
18
|
}
|
|
19
19
|
exports.AboutDialogToolbarButton = AboutDialogToolbarButton;
|
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.MeasurementExplorer = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("
|
|
5
|
-
|
|
6
|
-
const react_1 = require("
|
|
7
|
-
const react_2 = require("react");
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
+
const react_1 = require("react");
|
|
8
10
|
const fa_1 = require("react-icons/fa");
|
|
9
11
|
const index_1 = require("../helpers/index");
|
|
12
|
+
const MeasurementExplorerRoot = styled_1.default.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
`;
|
|
16
|
+
const MeasurementExplorerContent = styled_1.default.div `
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: space-around;
|
|
19
|
+
margin-bottom: 20px;
|
|
20
|
+
`;
|
|
21
|
+
const MeasurementExplorerSelect = styled_1.default.select `
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
border: 1px solid black;
|
|
24
|
+
padding: 1px;
|
|
25
|
+
margin-left: 2px;
|
|
26
|
+
`;
|
|
27
|
+
const MeasurementExplorerAction = styled_1.default.div `
|
|
28
|
+
padding: 1px;
|
|
29
|
+
display: flex;
|
|
30
|
+
`;
|
|
10
31
|
function MeasurementExplorer(props) {
|
|
11
32
|
const { measurement: { data }, width = '100%', height = '100%', } = props;
|
|
12
33
|
function defaultInfo(dataIndex) {
|
|
@@ -17,7 +38,7 @@ function MeasurementExplorer(props) {
|
|
|
17
38
|
yVariableName: varNames.includes('y') ? 'y' : varNames[1],
|
|
18
39
|
};
|
|
19
40
|
}
|
|
20
|
-
const [info, setInfo] = (0,
|
|
41
|
+
const [info, setInfo] = (0, react_1.useState)({
|
|
21
42
|
flipHorizontalAxis: false,
|
|
22
43
|
...defaultInfo(0),
|
|
23
44
|
});
|
|
@@ -40,19 +61,7 @@ function MeasurementExplorer(props) {
|
|
|
40
61
|
return null;
|
|
41
62
|
});
|
|
42
63
|
}
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
`, children: [(0, jsx_runtime_1.jsxs)("div", { css: (0, react_1.css) `
|
|
47
|
-
display: flex;
|
|
48
|
-
justify-content: space-around;
|
|
49
|
-
margin-bottom: 20px;
|
|
50
|
-
`, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "dataIndex: " }), (0, jsx_runtime_1.jsx)("select", { css: (0, react_1.css) `
|
|
51
|
-
cursor: pointer;
|
|
52
|
-
border: 1px solid black;
|
|
53
|
-
padding: 1px;
|
|
54
|
-
margin-left: 2px;
|
|
55
|
-
`, onChange: ({ target }) => {
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(MeasurementExplorerRoot, { style: { width, height }, children: [(0, jsx_runtime_1.jsxs)(MeasurementExplorerContent, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "dataIndex: " }), (0, jsx_runtime_1.jsx)(MeasurementExplorerSelect, { onChange: ({ target }) => {
|
|
56
65
|
const value = Number(target.value);
|
|
57
66
|
if (value !== undefined && !Number.isNaN(value)) {
|
|
58
67
|
setInfo(({ flipHorizontalAxis }) => ({
|
|
@@ -62,42 +71,26 @@ function MeasurementExplorer(props) {
|
|
|
62
71
|
}
|
|
63
72
|
}, children: data.map((d, i) => (
|
|
64
73
|
// eslint-disable-next-line react/no-array-index-key
|
|
65
|
-
(0, jsx_runtime_1.jsx)("option", { value: i, children: i }, i))) })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "xVariable: " }), (0, jsx_runtime_1.jsx)(
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
border: 1px solid black;
|
|
68
|
-
padding: 1px;
|
|
69
|
-
margin-left: 2px;
|
|
70
|
-
`, onChange: ({ target }) => {
|
|
74
|
+
(0, jsx_runtime_1.jsx)("option", { value: i, children: i }, i))) })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "xVariable: " }), (0, jsx_runtime_1.jsx)(MeasurementExplorerSelect, { onChange: ({ target }) => {
|
|
71
75
|
const value = target.value;
|
|
72
76
|
if (value) {
|
|
73
77
|
setInfo((info) => ({ ...info, xVariableName: value }));
|
|
74
78
|
}
|
|
75
|
-
}, value: info.xVariableName, children: dropdownVariables('x') })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(fa_1.FaExchangeAlt, {
|
|
76
|
-
margin-top: 2px;
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
`, size: "20", onClick: () => setInfo(({ xVariableName, yVariableName, ...info }) => ({
|
|
79
|
+
}, value: info.xVariableName, children: dropdownVariables('x') })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(fa_1.FaExchangeAlt, { style: { marginTop: 2, cursor: 'pointer' }, size: "20", onClick: () => setInfo(({ xVariableName, yVariableName, ...info }) => ({
|
|
79
80
|
...info,
|
|
80
81
|
xVariableName: yVariableName,
|
|
81
82
|
yVariableName: xVariableName,
|
|
82
|
-
})) }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "yVariable :" }), (0, jsx_runtime_1.jsx)(
|
|
83
|
-
cursor: pointer;
|
|
84
|
-
border: 1px solid black;
|
|
85
|
-
padding: 1px;
|
|
86
|
-
margin-left: 2px;
|
|
87
|
-
`, onChange: ({ target }) => {
|
|
83
|
+
})) }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "yVariable :" }), (0, jsx_runtime_1.jsx)(MeasurementExplorerSelect, { onChange: ({ target }) => {
|
|
88
84
|
const value = target.value;
|
|
89
85
|
if (value) {
|
|
90
86
|
setInfo((info) => ({ ...info, yVariableName: value }));
|
|
91
87
|
}
|
|
92
|
-
}, value: info.yVariableName, children: dropdownVariables('y') })] }), (0, jsx_runtime_1.jsxs)(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
padding: 1px;
|
|
99
|
-
margin-left: 2px;
|
|
100
|
-
`, size: "28", onClick: () => setInfo(({ flipHorizontalAxis, ...other }) => ({
|
|
88
|
+
}, value: info.yVariableName, children: dropdownVariables('y') })] }), (0, jsx_runtime_1.jsxs)(MeasurementExplorerAction, { children: ["Flip horizontal axis:", (0, jsx_runtime_1.jsx)(fa_1.FaArrowsAltH, { style: {
|
|
89
|
+
cursor: 'pointer',
|
|
90
|
+
border: '1px solid black',
|
|
91
|
+
padding: 1,
|
|
92
|
+
marginLeft: 2,
|
|
93
|
+
}, size: "28", onClick: () => setInfo(({ flipHorizontalAxis, ...other }) => ({
|
|
101
94
|
flipHorizontalAxis: !flipHorizontalAxis,
|
|
102
95
|
...other,
|
|
103
96
|
})) })] })] }), (0, jsx_runtime_1.jsx)(index_1.MeasurementPlot, { ...props, ...info })] }));
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.BasicComponent = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("
|
|
5
|
-
|
|
6
|
-
const react_1 = require("
|
|
7
|
-
const react_2 = require("react");
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
+
const react_1 = require("react");
|
|
8
10
|
const react_d3_utils_1 = require("react-d3-utils");
|
|
9
11
|
const react_plot_1 = require("react-plot");
|
|
12
|
+
const BasicComponentRoot = styled_1.default.div `
|
|
13
|
+
user-drag: none;
|
|
14
|
+
-webkit-user-drag: none;
|
|
15
|
+
user-select: none;
|
|
16
|
+
-moz-user-select: none;
|
|
17
|
+
-webkit-user-select: none;
|
|
18
|
+
-ms-user-select: none;
|
|
19
|
+
`;
|
|
10
20
|
function BasicComponent(props) {
|
|
11
21
|
const { children, measurement, dataIndex = 0, xVariableName = 'x', yVariableName = 'y', width = '100%', height = '100%', zoom = 'horizontal', wheelZoom = 'vertical', crossHair = true, showHorizontalAxis = true, showVerticalAxis = true, showHorizontalGrid = true, showVerticalGrid = true, flipHorizontalAxis = false, } = props;
|
|
12
22
|
const { info: { title }, data, } = measurement;
|
|
13
|
-
const { x, y } = (0,
|
|
23
|
+
const { x, y } = (0, react_1.useMemo)(() => {
|
|
14
24
|
const { variables } = data[dataIndex];
|
|
15
25
|
const { [xVariableName]: x, [yVariableName]: y } = variables;
|
|
16
26
|
if (x === undefined || y === undefined) {
|
|
@@ -35,13 +45,6 @@ function BasicComponent(props) {
|
|
|
35
45
|
disabled: !crossHair,
|
|
36
46
|
});
|
|
37
47
|
(0, react_plot_1.usePan)();
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
39
|
-
user-drag: none;
|
|
40
|
-
-webkit-user-drag: none;
|
|
41
|
-
user-select: none;
|
|
42
|
-
-moz-user-select: none;
|
|
43
|
-
-webkit-user-select: none;
|
|
44
|
-
-ms-user-select: none;
|
|
45
|
-
`, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { width: width, height: height, children: ({ width, height }) => ((0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: width, height: height, children: [(0, jsx_runtime_1.jsx)(react_plot_1.Heading, { title: title }), children, (0, jsx_runtime_1.jsxs)(react_plot_1.Annotations, { children: [rectZoom.annotations, axisZoom.annotations, crossHairAnnot.annotations] }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showHorizontalAxis, displayPrimaryGridLines: showVerticalGrid, flip: flipHorizontalAxis, position: "bottom", label: `${x.label}${x.units ? `(${x.units})` : ''}` }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showVerticalAxis, displayPrimaryGridLines: showHorizontalGrid, position: "left", label: `${y.label}${y.units ? `(${y.units})` : ''}`, paddingStart: "10", paddingEnd: "10" })] })) }) }));
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(BasicComponentRoot, { style: { width, height }, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { width: width, height: height, children: ({ width, height }) => ((0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: width, height: height, children: [(0, jsx_runtime_1.jsx)(react_plot_1.Heading, { title: title }), children, (0, jsx_runtime_1.jsxs)(react_plot_1.Annotations, { children: [rectZoom.annotations, axisZoom.annotations, crossHairAnnot.annotations] }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showHorizontalAxis, displayPrimaryGridLines: showVerticalGrid, flip: flipHorizontalAxis, position: "bottom", label: `${x.label}${x.units ? `(${x.units})` : ''}` }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showVerticalAxis, displayPrimaryGridLines: showHorizontalGrid, position: "left", label: `${y.label}${y.units ? `(${y.units})` : ''}`, paddingStart: "10", paddingEnd: "10" })] })) }) }));
|
|
46
49
|
}
|
|
47
50
|
exports.BasicComponent = BasicComponent;
|
|
@@ -4,26 +4,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IvPlotView = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("
|
|
8
|
-
|
|
9
|
-
const react_1 = require("@emotion/react");
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
10
9
|
const fa_1 = require("react-icons/fa");
|
|
11
10
|
const react_plot_1 = require("react-plot");
|
|
12
11
|
const index_1 = require("../../../../app-data/index");
|
|
13
12
|
const index_2 = require("../../../../components/index");
|
|
14
13
|
const IvMeasurementsPlot_1 = __importDefault(require("./IvMeasurementsPlot"));
|
|
15
14
|
const IvPlotVariablesSelector_1 = __importDefault(require("./IvPlotVariablesSelector"));
|
|
15
|
+
const IvPlotRoot = styled_1.default.div `
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
height: 100%;
|
|
19
|
+
`;
|
|
20
|
+
const PlotRoot = styled_1.default.div `
|
|
21
|
+
padding: 5px;
|
|
22
|
+
flex: 1;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
`;
|
|
16
26
|
function IvPlotView() {
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
height: 100%;
|
|
21
|
-
`, children: [(0, jsx_runtime_1.jsx)(VerticalToolbar, {}), (0, jsx_runtime_1.jsxs)("div", { css: (0, react_1.css) `
|
|
22
|
-
padding: 5px;
|
|
23
|
-
flex: 1;
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
`, children: [(0, jsx_runtime_1.jsx)(react_plot_1.PlotController, { children: (0, jsx_runtime_1.jsx)(IvMeasurementsPlot_1.default, {}) }), (0, jsx_runtime_1.jsx)(IvPlotVariablesSelector_1.default, {})] })] }));
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(IvPlotRoot, { children: [(0, jsx_runtime_1.jsx)(VerticalToolbar, {}), (0, jsx_runtime_1.jsxs)(PlotRoot, { children: [(0, jsx_runtime_1.jsx)(react_plot_1.PlotController, { children: (0, jsx_runtime_1.jsx)(IvMeasurementsPlot_1.default, {}) }), (0, jsx_runtime_1.jsx)(IvPlotVariablesSelector_1.default, {})] })] }));
|
|
27
28
|
}
|
|
28
29
|
exports.IvPlotView = IvPlotView;
|
|
29
30
|
function VerticalToolbar() {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.MeasurementCheckbox = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("
|
|
5
|
-
|
|
6
|
-
const react_1 = require("
|
|
7
|
-
const
|
|
8
|
-
const checkboxCss = (0, react_1.css) `
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const InputMeasurementCheckBox = styled_1.default.input `
|
|
9
11
|
color: #6366f1;
|
|
10
12
|
border-color: #d1d5db;
|
|
11
13
|
border-radius: 0.25rem;
|
|
@@ -15,12 +17,12 @@ const checkboxCss = (0, react_1.css) `
|
|
|
15
17
|
`;
|
|
16
18
|
function MeasurementCheckbox(props) {
|
|
17
19
|
const { checked, onSelectCheckbox, indeterminate } = props;
|
|
18
|
-
const ref = (0,
|
|
19
|
-
(0,
|
|
20
|
+
const ref = (0, react_1.useRef)(null);
|
|
21
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
20
22
|
if (ref.current && indeterminate !== undefined) {
|
|
21
23
|
ref.current.indeterminate = indeterminate;
|
|
22
24
|
}
|
|
23
25
|
}, [indeterminate]);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(InputMeasurementCheckBox, { type: "checkbox", checked: checked, onChange: onSelectCheckbox, ref: ref }));
|
|
25
27
|
}
|
|
26
28
|
exports.MeasurementCheckbox = MeasurementCheckbox;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("
|
|
4
|
-
|
|
5
|
-
const react_1 = require("
|
|
6
|
-
const react_2 = require("react");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const react_1 = require("react");
|
|
7
9
|
const index_1 = require("../../../app-data/index");
|
|
8
10
|
const index_2 = require("../../../components/index");
|
|
9
11
|
const Portal_1 = require("../../../components/root-layout/Portal");
|
|
10
|
-
const
|
|
12
|
+
const ColorPreviewButton = styled_1.default.button `
|
|
11
13
|
width: 1em;
|
|
12
14
|
height: 1em;
|
|
13
15
|
`;
|
|
14
16
|
function MeasurementColorPreview(props) {
|
|
15
17
|
const { measurementId, kind, color } = props;
|
|
16
18
|
const dispatch = (0, index_1.useAppDispatch)();
|
|
17
|
-
const ref = (0,
|
|
19
|
+
const ref = (0, react_1.useRef)(null);
|
|
18
20
|
const [isOpened, , close, toggle] = (0, index_2.useOnOff)(false);
|
|
19
21
|
const { setReferenceElement, setPopperElement, popperProps } = (0, index_2.useModifiedPopper)({
|
|
20
22
|
placement: 'bottom-start',
|
|
21
23
|
offset: 6,
|
|
22
24
|
});
|
|
23
25
|
(0, index_2.useOnClickOutside)(ref, close);
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ColorPreviewButton, { type: "button", ref: setReferenceElement, onClick: toggle, children: (0, jsx_runtime_1.jsx)(index_2.ColorPreview, { color: color }) }), isOpened && ((0, jsx_runtime_1.jsx)(Portal_1.Portal, { children: (0, jsx_runtime_1.jsx)("div", { ref: (div) => {
|
|
25
27
|
setPopperElement(div);
|
|
26
28
|
ref.current = div;
|
|
27
29
|
}, ...popperProps, children: color.kind === 'fixed' ? ((0, jsx_runtime_1.jsx)(FixedColorPicker, { color: color.color, onChange: (newColor) => dispatch({
|
|
@@ -27,87 +27,76 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.MeasurementsTable = void 0;
|
|
30
|
-
const jsx_runtime_1 = require("
|
|
31
|
-
|
|
32
|
-
const react_1 = require("@emotion/react");
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
33
32
|
const fa_1 = require("react-icons/fa");
|
|
34
33
|
const index_1 = require("../../../app-data/index");
|
|
35
34
|
const index_2 = require("../../../components/index");
|
|
36
35
|
const MeasurementCheckbox_1 = require("./MeasurementCheckbox");
|
|
37
36
|
const MeasurementColorPreview_1 = __importDefault(require("./MeasurementColorPreview"));
|
|
38
37
|
const MeasurementVisibilityToggle_1 = __importStar(require("./MeasurementVisibilityToggle"));
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
38
|
+
const MeasurementsTableContainer = styled_1.default.div `
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 5px;
|
|
42
|
+
`;
|
|
43
|
+
const MeasurementsTableRoot = styled_1.default.table `
|
|
44
|
+
font-size: 0.875rem;
|
|
45
|
+
line-height: 1.25rem;
|
|
46
|
+
border-collapse: collapse;
|
|
47
|
+
table-layout: fixed;
|
|
48
|
+
`;
|
|
49
|
+
const MeasurementsTableHeaderStyled = styled_1.default.tr `
|
|
50
|
+
border-bottom-width: 1px;
|
|
51
|
+
font-weight: 500;
|
|
52
|
+
text-align: left;
|
|
53
|
+
padding-bottom: 10px;
|
|
54
|
+
padding-top: 10px;
|
|
55
|
+
padding-left: 2rem;
|
|
56
|
+
`;
|
|
57
|
+
const MeasurementsTableBody = styled_1.default.tbody `
|
|
58
|
+
background-color: white;
|
|
59
|
+
`;
|
|
60
|
+
const MeasurementsLinkButton = styled_1.default.span `
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
:hover {
|
|
63
|
+
text-decoration: underline;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
const MeasurementsHeaderColumn = styled_1.default.div `
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: row;
|
|
69
|
+
gap: 10px;
|
|
70
|
+
align-items: center;
|
|
71
|
+
padding-left: 5px;
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
`,
|
|
79
|
-
iconsContainer: (0, react_1.css) `
|
|
80
|
-
display: flex;
|
|
81
|
-
justify-content: center;
|
|
82
|
-
align-items: center;
|
|
83
|
-
justify-items: center;
|
|
84
|
-
height: 50px;
|
|
85
|
-
flex-direction: row;
|
|
86
|
-
gap: 0.5rem;
|
|
87
|
-
cursor: default;
|
|
88
|
-
width: 70px;
|
|
89
|
-
`,
|
|
90
|
-
linkButton: (0, react_1.css) `
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
:hover {
|
|
93
|
-
text-decoration: underline;
|
|
94
|
-
}
|
|
95
|
-
`,
|
|
96
|
-
container: (0, react_1.css) `
|
|
97
|
-
display: flex;
|
|
98
|
-
flex-direction: column;
|
|
99
|
-
gap: 5px;
|
|
100
|
-
`,
|
|
101
|
-
headerColumn: (0, react_1.css) `
|
|
102
|
-
display: flex;
|
|
103
|
-
flex-direction: row;
|
|
104
|
-
gap: 10px;
|
|
105
|
-
align-items: center;
|
|
106
|
-
padding-left: 5px;
|
|
73
|
+
border-bottom: 1px solid black;
|
|
74
|
+
`;
|
|
75
|
+
const MeasurementsTableRowData = styled_1.default.tr `
|
|
76
|
+
height: 50px;
|
|
77
|
+
max-height: 50px;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
padding-left: 2rem;
|
|
81
|
+
padding-bottom: 10px;
|
|
82
|
+
padding-top: 10px;
|
|
83
|
+
border-bottom-width: 1px;
|
|
107
84
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
font-size: 0.875rem;
|
|
87
|
+
line-height: 1.25rem;
|
|
88
|
+
`;
|
|
89
|
+
const MeasurementsIconsContainer = styled_1.default.td `
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-items: center;
|
|
94
|
+
height: 50px;
|
|
95
|
+
flex-direction: row;
|
|
96
|
+
gap: 0.5rem;
|
|
97
|
+
cursor: default;
|
|
98
|
+
width: 70px;
|
|
99
|
+
`;
|
|
111
100
|
function MeasurementsTable(props) {
|
|
112
101
|
const { kind } = props;
|
|
113
102
|
const { data: { measurements }, view: { selectedMeasurements }, } = (0, index_1.useAppState)();
|
|
@@ -127,29 +116,27 @@ function MeasurementsTable(props) {
|
|
|
127
116
|
dispatch({ type: 'REMOVE_SELECTED_MEASUREMENTS', payload: { kind } });
|
|
128
117
|
closeRemoveModal();
|
|
129
118
|
}
|
|
130
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
119
|
+
return ((0, jsx_runtime_1.jsxs)(MeasurementsTableContainer, { children: [(0, jsx_runtime_1.jsxs)(MeasurementsHeaderColumn, { children: [(0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.MeasurementSelectedVisibilityChange, { kind: kind, openedEyes: true }), (0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.MeasurementSelectedVisibilityChange, { kind: kind, openedEyes: false }), (0, jsx_runtime_1.jsx)(MeasurementsLinkButton, { onClick: () => onSelectLink(true), children: "Select all" }), (0, jsx_runtime_1.jsx)(MeasurementsLinkButton, { onClick: () => onSelectLink(false), children: "Unselect all" }), (0, jsx_runtime_1.jsx)(fa_1.FaTrash, { style: hasSelectedMeasurements ? { cursor: 'pointer' } : { opacity: 0.6 }, onClick: hasSelectedMeasurements ? openRemoveModal : undefined }), (0, jsx_runtime_1.jsx)(index_2.ConfirmModal, { headerColor: "red", isOpen: isRemoveModalOpen, onConfirm: onRemove, onRequestClose: closeRemoveModal, saveText: "Remove", children: (0, jsx_runtime_1.jsx)("div", { style: { fontWeight: 'bold', padding: 10 }, children: "Remove selected measurements?" }) })] }), (0, jsx_runtime_1.jsxs)(MeasurementsTableRoot, { children: [(0, jsx_runtime_1.jsx)(MeasurementsTableHeader, {}), (0, jsx_runtime_1.jsx)(MeasurementsTableBody, { children: measurements[kind].entries.map((element) => ((0, jsx_runtime_1.jsx)(MeasurementsTableRow, { item: element, kind: kind }, element.id))) })] })] }));
|
|
131
120
|
}
|
|
132
121
|
exports.MeasurementsTable = MeasurementsTable;
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
`,
|
|
150
|
-
};
|
|
122
|
+
const TableHeaderEmpty = styled_1.default.th `
|
|
123
|
+
display: flex;
|
|
124
|
+
gap: 5px;
|
|
125
|
+
align-items: center;
|
|
126
|
+
width: 70px;
|
|
127
|
+
`;
|
|
128
|
+
const TableHeaderFilename = styled_1.default.th `
|
|
129
|
+
width: 60%;
|
|
130
|
+
`;
|
|
131
|
+
const TableHeaderTechnique = styled_1.default.th `
|
|
132
|
+
width: 150px;
|
|
133
|
+
`;
|
|
134
|
+
const TableDataHeaderName = styled_1.default.td `
|
|
135
|
+
width: 60%;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
`;
|
|
151
138
|
function MeasurementsTableHeader() {
|
|
152
|
-
return ((0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)(
|
|
139
|
+
return ((0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)(MeasurementsTableHeaderStyled, { children: [(0, jsx_runtime_1.jsx)(TableHeaderEmpty, {}), (0, jsx_runtime_1.jsx)(TableHeaderFilename, { children: "Filename" }), (0, jsx_runtime_1.jsx)(TableHeaderTechnique, { children: "Technique" })] }) }));
|
|
153
140
|
}
|
|
154
141
|
function MeasurementsTableRow(props) {
|
|
155
142
|
const { item, kind } = props;
|
|
@@ -168,5 +155,5 @@ function MeasurementsTableRow(props) {
|
|
|
168
155
|
payload: { id: item.id, kind, acc: isAlreadyChecked ? 'remove' : 'add' },
|
|
169
156
|
});
|
|
170
157
|
}
|
|
171
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
158
|
+
return ((0, jsx_runtime_1.jsxs)(MeasurementsTableRowData, { children: [(0, jsx_runtime_1.jsxs)(MeasurementsIconsContainer, { children: [(0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.default, { id: item.id, isVisible: measurements[item.id].visible }), (0, jsx_runtime_1.jsx)(MeasurementColorPreview_1.default, { measurementId: item.id, kind: kind, color: measurements[item.id].color }), (0, jsx_runtime_1.jsx)(MeasurementCheckbox_1.MeasurementCheckbox, { checked: selectedMeasurements[kind]?.includes(item.id) || false, onSelectCheckbox: onSelectCheckbox })] }), (0, jsx_runtime_1.jsx)(TableDataHeaderName, { onClick: onSelectRow, title: item.id, children: item.info.file?.name ?? item.info.title }), (0, jsx_runtime_1.jsx)("td", { onClick: onSelectRow, children: item.meta.technique })] }));
|
|
172
159
|
}
|
|
@@ -1,53 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ButtonGroup = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
display: inline-flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
font-weight: 500;
|
|
33
|
-
font-size: 0.875rem;
|
|
34
|
-
line-height: 1.25rem;
|
|
35
|
-
padding-left: 1rem;
|
|
36
|
-
padding-right: 1rem;
|
|
37
|
-
padding-top: 5px;
|
|
38
|
-
padding-bottom: 5px;
|
|
39
|
-
border-width: 1px;
|
|
40
|
-
border-top-right-radius: 0.375rem;
|
|
41
|
-
border-bottom-right-radius: 0.375rem;
|
|
42
|
-
margin-left: -1px;
|
|
43
|
-
`,
|
|
44
|
-
};
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
+
const ButtonGroupRoot = styled_1.default.div `
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
border-radius: 0.375rem;
|
|
12
|
+
isolation: isolate;
|
|
13
|
+
`;
|
|
14
|
+
const ButtonGroupCustomButton = styled_1.default.button `
|
|
15
|
+
position: relative;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
font-size: 0.875rem;
|
|
20
|
+
line-height: 1.25rem;
|
|
21
|
+
padding-left: 1rem;
|
|
22
|
+
padding-right: 1rem;
|
|
23
|
+
padding-top: 5px;
|
|
24
|
+
padding-bottom: 5px;
|
|
25
|
+
border-width: 1px;
|
|
26
|
+
border-top-left-radius: ${({ isLast }) => !isLast && '0.375rem'};
|
|
27
|
+
border-bottom-left-radius: ${({ isLast }) => !isLast && '0.375rem'};
|
|
28
|
+
|
|
29
|
+
border-top-right-radius: ${({ isLast }) => isLast && '0.375rem'};
|
|
30
|
+
border-bottom-right-radius: ${({ isLast }) => isLast && '0.375rem'};
|
|
31
|
+
margin-left: ${({ isLast }) => isLast && '-1px'};
|
|
32
|
+
`;
|
|
45
33
|
function ButtonGroup(props) {
|
|
46
34
|
const { children } = props;
|
|
47
|
-
return (0, jsx_runtime_1.jsx)(
|
|
35
|
+
return (0, jsx_runtime_1.jsx)(ButtonGroupRoot, { children: children });
|
|
48
36
|
}
|
|
49
37
|
exports.ButtonGroup = ButtonGroup;
|
|
50
38
|
ButtonGroup.Button = function ButtonGroupButton(props) {
|
|
51
39
|
const { position, label, onClick } = props;
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(ButtonGroupCustomButton, { type: "button", onClick: onClick, isLast: position === 'last', children: label }));
|
|
53
41
|
};
|