react-science 0.25.0 → 0.26.2
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.js +29 -7
- package/lib/app/explorer/MeasurementExplorerWithState.js +2 -2
- package/lib/app/helpers/MeasurementPlot.js +28 -19
- package/lib/app/helpers/react-plot.js +1 -1
- package/lib/app/kinds/mass/MassPlotView.js +2 -2
- package/lib/app/kinds/mass/MeasurementMassPlot.js +49 -33
- package/lib/app/panels/measurement-info/MeasurementInfoPanel.js +13 -58
- package/lib/app-data/state/data/data.helpers.js +32 -8
- package/lib/components/forms/Checkbox.js +4 -5
- package/lib/components/forms/Input.js +3 -87
- package/lib/components/forms/TextArea.js +25 -0
- package/lib/components/forms/index.js +2 -0
- package/lib/components/forms/radio-group/ButtonRadioItem.js +76 -0
- package/lib/components/forms/radio-group/ClassicRadioItem.js +92 -0
- package/lib/components/forms/radio-group/RadioGroup.js +69 -0
- package/lib/components/forms/radio-group/index.js +17 -0
- package/lib/components/forms/styles.js +80 -0
- package/lib/components/forms/utils/SubText.js +20 -0
- package/lib/components/forms/utils/index.js +17 -0
- package/lib/components/header/PanelHeader.js +51 -0
- package/lib/components/header/index.js +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/info-panel/InfoPanel.js +94 -0
- package/lib/components/info-panel/index.js +17 -0
- package/lib/components/modal/ConfirmModal.js +3 -2
- package/lib/components/modal/Modal.js +3 -1
- package/lib/components/table/Table.js +2 -2
- package/lib/components/toolbar/PanelPreferencesToolbar.js +26 -0
- package/lib/components/toolbar/index.js +1 -0
- package/lib-esm/app/explorer/MeasurementExplorer.d.ts.map +1 -1
- package/lib-esm/app/explorer/MeasurementExplorer.js +30 -8
- package/lib-esm/app/explorer/MeasurementExplorer.js.map +1 -1
- package/lib-esm/app/explorer/MeasurementExplorerWithState.d.ts.map +1 -1
- package/lib-esm/app/explorer/MeasurementExplorerWithState.js +2 -2
- package/lib-esm/app/explorer/MeasurementExplorerWithState.js.map +1 -1
- package/lib-esm/app/helpers/MeasurementPlot.d.ts +3 -3
- package/lib-esm/app/helpers/MeasurementPlot.d.ts.map +1 -1
- package/lib-esm/app/helpers/MeasurementPlot.js +28 -19
- package/lib-esm/app/helpers/MeasurementPlot.js.map +1 -1
- package/lib-esm/app/helpers/react-plot.d.ts.map +1 -1
- package/lib-esm/app/helpers/react-plot.js +1 -1
- package/lib-esm/app/helpers/react-plot.js.map +1 -1
- package/lib-esm/app/kinds/mass/MassPlotView.d.ts.map +1 -1
- package/lib-esm/app/kinds/mass/MassPlotView.js +2 -2
- package/lib-esm/app/kinds/mass/MassPlotView.js.map +1 -1
- package/lib-esm/app/kinds/mass/MeasurementMassPlot.d.ts.map +1 -1
- package/lib-esm/app/kinds/mass/MeasurementMassPlot.js +49 -33
- package/lib-esm/app/kinds/mass/MeasurementMassPlot.js.map +1 -1
- package/lib-esm/app/panels/measurement-info/MeasurementInfoPanel.d.ts.map +1 -1
- package/lib-esm/app/panels/measurement-info/MeasurementInfoPanel.js +15 -60
- package/lib-esm/app/panels/measurement-info/MeasurementInfoPanel.js.map +1 -1
- package/lib-esm/app-data/state/data/data.helpers.d.ts +20 -12
- package/lib-esm/app-data/state/data/data.helpers.d.ts.map +1 -1
- package/lib-esm/app-data/state/data/data.helpers.js +30 -7
- package/lib-esm/app-data/state/data/data.helpers.js.map +1 -1
- package/lib-esm/components/forms/Checkbox.d.ts.map +1 -1
- package/lib-esm/components/forms/Checkbox.js +1 -2
- package/lib-esm/components/forms/Checkbox.js.map +1 -1
- package/lib-esm/components/forms/Input.d.ts +4 -2
- package/lib-esm/components/forms/Input.d.ts.map +1 -1
- package/lib-esm/components/forms/Input.js +3 -87
- package/lib-esm/components/forms/Input.js.map +1 -1
- package/lib-esm/components/forms/TextArea.d.ts +8 -0
- package/lib-esm/components/forms/TextArea.d.ts.map +1 -0
- package/lib-esm/components/forms/TextArea.js +19 -0
- package/lib-esm/components/forms/TextArea.js.map +1 -0
- package/lib-esm/components/forms/index.d.ts +2 -0
- package/lib-esm/components/forms/index.d.ts.map +1 -1
- package/lib-esm/components/forms/index.js +2 -0
- package/lib-esm/components/forms/index.js.map +1 -1
- package/lib-esm/components/forms/radio-group/ButtonRadioItem.d.ts +3 -0
- package/lib-esm/components/forms/radio-group/ButtonRadioItem.d.ts.map +1 -0
- package/lib-esm/components/forms/radio-group/ButtonRadioItem.js +50 -0
- package/lib-esm/components/forms/radio-group/ButtonRadioItem.js.map +1 -0
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.d.ts +3 -0
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.d.ts.map +1 -0
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.js +66 -0
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.js.map +1 -0
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts +18 -0
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts.map +1 -0
- package/lib-esm/components/forms/radio-group/RadioGroup.js +43 -0
- package/lib-esm/components/forms/radio-group/RadioGroup.js.map +1 -0
- package/lib-esm/components/forms/radio-group/index.d.ts +2 -0
- package/lib-esm/components/forms/radio-group/index.d.ts.map +1 -0
- package/lib-esm/components/forms/radio-group/index.js +2 -0
- package/lib-esm/components/forms/radio-group/index.js.map +1 -0
- package/lib-esm/components/forms/styles.d.ts +26 -0
- package/lib-esm/components/forms/styles.d.ts.map +1 -0
- package/lib-esm/components/forms/styles.js +75 -0
- package/lib-esm/components/forms/styles.js.map +1 -0
- package/lib-esm/components/forms/utils/SubText.d.ts +7 -0
- package/lib-esm/components/forms/utils/SubText.d.ts.map +1 -0
- package/lib-esm/components/forms/utils/SubText.js +17 -0
- package/lib-esm/components/forms/utils/SubText.js.map +1 -0
- package/lib-esm/components/forms/utils/index.d.ts +2 -0
- package/lib-esm/components/forms/utils/index.d.ts.map +1 -0
- package/lib-esm/components/forms/utils/index.js +2 -0
- package/lib-esm/components/forms/utils/index.js.map +1 -0
- package/lib-esm/components/header/PanelHeader.d.ts +10 -0
- package/lib-esm/components/header/PanelHeader.d.ts.map +1 -0
- package/lib-esm/components/header/PanelHeader.js +48 -0
- package/lib-esm/components/header/PanelHeader.js.map +1 -0
- package/lib-esm/components/header/index.d.ts +1 -0
- package/lib-esm/components/header/index.d.ts.map +1 -1
- package/lib-esm/components/header/index.js +1 -0
- package/lib-esm/components/header/index.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 +15 -0
- package/lib-esm/components/info-panel/InfoPanel.d.ts.map +1 -0
- package/lib-esm/components/info-panel/InfoPanel.js +91 -0
- package/lib-esm/components/info-panel/InfoPanel.js.map +1 -0
- package/lib-esm/components/info-panel/index.d.ts +2 -0
- package/lib-esm/components/info-panel/index.d.ts.map +1 -0
- package/lib-esm/components/info-panel/index.js +2 -0
- package/lib-esm/components/info-panel/index.js.map +1 -0
- package/lib-esm/components/modal/ConfirmModal.d.ts.map +1 -1
- package/lib-esm/components/modal/ConfirmModal.js +3 -2
- package/lib-esm/components/modal/ConfirmModal.js.map +1 -1
- package/lib-esm/components/modal/Modal.d.ts.map +1 -1
- package/lib-esm/components/modal/Modal.js +3 -1
- package/lib-esm/components/modal/Modal.js.map +1 -1
- package/lib-esm/components/table/Table.d.ts +2 -3
- package/lib-esm/components/table/Table.d.ts.map +1 -1
- package/lib-esm/components/table/Table.js +2 -2
- package/lib-esm/components/table/Table.js.map +1 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.d.ts +7 -0
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -0
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.js +23 -0
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.js.map +1 -0
- package/lib-esm/components/toolbar/index.d.ts +1 -0
- package/lib-esm/components/toolbar/index.d.ts.map +1 -1
- package/lib-esm/components/toolbar/index.js +1 -0
- package/lib-esm/components/toolbar/index.js.map +1 -1
- package/package.json +16 -14
- package/src/app/explorer/MeasurementExplorer.tsx +34 -12
- package/src/app/explorer/MeasurementExplorerWithState.tsx +2 -2
- package/src/app/helpers/MeasurementPlot.tsx +44 -33
- package/src/app/helpers/react-plot.tsx +6 -4
- package/src/app/kinds/mass/MassPlotView.tsx +2 -2
- package/src/app/kinds/mass/MeasurementMassPlot.tsx +57 -37
- package/src/app/panels/measurement-info/MeasurementInfoPanel.tsx +14 -84
- package/src/app-data/state/data/data.helpers.ts +49 -16
- package/src/components/forms/Checkbox.tsx +2 -3
- package/src/components/forms/Input.tsx +14 -125
- package/src/components/forms/TextArea.tsx +45 -0
- package/src/components/forms/index.ts +2 -0
- package/src/components/forms/radio-group/ButtonRadioItem.tsx +77 -0
- package/src/components/forms/radio-group/ClassicRadioItem.tsx +95 -0
- package/src/components/forms/radio-group/RadioGroup.tsx +83 -0
- package/src/components/forms/radio-group/index.ts +1 -0
- package/src/components/forms/styles.ts +96 -0
- package/src/components/forms/utils/SubText.tsx +31 -0
- package/src/components/forms/utils/index.ts +1 -0
- package/src/components/header/PanelHeader.tsx +75 -0
- package/src/components/header/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/components/info-panel/InfoPanel.tsx +150 -0
- package/src/components/info-panel/index.ts +1 -0
- package/src/components/modal/ConfirmModal.tsx +3 -2
- package/src/components/modal/Modal.tsx +3 -1
- package/src/components/table/Table.tsx +3 -5
- package/src/components/toolbar/PanelPreferencesToolbar.tsx +46 -0
- package/src/components/toolbar/index.ts +1 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ButtonRadioItem = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
+
/** @jsxImportSource @emotion/react */
|
|
29
|
+
const react_1 = require("@emotion/react");
|
|
30
|
+
const RadioGroup = __importStar(require("@radix-ui/react-radio-group"));
|
|
31
|
+
const styles_1 = require("../styles");
|
|
32
|
+
const buttonStyles = {
|
|
33
|
+
container: (0, react_1.css)({
|
|
34
|
+
border: '1px solid rgba(0, 0, 0, 0.25)',
|
|
35
|
+
borderRightWidth: 0,
|
|
36
|
+
position: 'relative',
|
|
37
|
+
}),
|
|
38
|
+
item: (disabled, variant) => (0, react_1.css)({
|
|
39
|
+
opacity: disabled ? 0.25 : 1,
|
|
40
|
+
padding: variant === 'default' ? '0px 15px' : '0px 7px',
|
|
41
|
+
width: '100%',
|
|
42
|
+
height: '100%',
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
':hover': {
|
|
45
|
+
'& > label': {
|
|
46
|
+
color: disabled ? '' : styles_1.enabledColor,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
indicator: (0, react_1.css)({
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
top: -1,
|
|
53
|
+
left: -1,
|
|
54
|
+
right: -1,
|
|
55
|
+
bottom: -1,
|
|
56
|
+
zIndex: 10,
|
|
57
|
+
border: '1px solid',
|
|
58
|
+
borderColor: styles_1.enabledColor,
|
|
59
|
+
'& ~ label': {
|
|
60
|
+
color: styles_1.enabledColor,
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
label: (variant) => (0, react_1.css)({
|
|
64
|
+
cursor: 'pointer',
|
|
65
|
+
fontSize: variant === 'small' ? '1em' : '1.125em',
|
|
66
|
+
lineHeight: variant === 'default' ? '30px' : '22px',
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
function ButtonRadioItem(prop) {
|
|
70
|
+
const { value, label, disabled = false, onSelect, variant, name } = prop;
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: buttonStyles.container, children: (0, jsx_runtime_1.jsxs)(RadioGroup.Item, { css: buttonStyles.item(disabled, variant), value: value, id: `${value}${name}`, onClick: () => {
|
|
72
|
+
if (!disabled)
|
|
73
|
+
onSelect?.(prop);
|
|
74
|
+
}, children: [(0, jsx_runtime_1.jsx)(RadioGroup.Indicator, { css: buttonStyles.indicator }), (0, jsx_runtime_1.jsx)("label", { css: buttonStyles.label(variant), htmlFor: `${value}${name}`, style: {}, children: label })] }) }));
|
|
75
|
+
}
|
|
76
|
+
exports.ButtonRadioItem = ButtonRadioItem;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ClassicRadioItem = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
+
/** @jsxImportSource @emotion/react */
|
|
29
|
+
const react_1 = require("@emotion/react");
|
|
30
|
+
const RadioGroup = __importStar(require("@radix-ui/react-radio-group"));
|
|
31
|
+
const styles_1 = require("../styles");
|
|
32
|
+
const classicStyles = {
|
|
33
|
+
container: (disabled) => (0, react_1.css)({
|
|
34
|
+
display: 'flex',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
flexDirection: 'row-reverse',
|
|
37
|
+
opacity: disabled ? 0.25 : 1,
|
|
38
|
+
overflow: 'hidden',
|
|
39
|
+
border: 'none',
|
|
40
|
+
}),
|
|
41
|
+
item: (disabled, variant) => (0, react_1.css)({
|
|
42
|
+
position: 'relative',
|
|
43
|
+
width: variant === 'default' ? 16 : 14,
|
|
44
|
+
height: variant === 'default' ? 16 : 14,
|
|
45
|
+
borderRadius: '50%',
|
|
46
|
+
border: '1px solid grey',
|
|
47
|
+
backgroundColor: disabled ? styles_1.disabledColor : 'white',
|
|
48
|
+
':hover': {
|
|
49
|
+
borderColor: disabled ? 'grey' : styles_1.enabledColor,
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
indicator: (0, react_1.css)({
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
top: -1,
|
|
55
|
+
left: -1,
|
|
56
|
+
right: -1,
|
|
57
|
+
bottom: -1,
|
|
58
|
+
zIndex: 10,
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
backgroundColor: styles_1.enabledColor,
|
|
63
|
+
borderRadius: '50%',
|
|
64
|
+
}),
|
|
65
|
+
circle: (0, react_1.css)({
|
|
66
|
+
width: '40%',
|
|
67
|
+
height: '40%',
|
|
68
|
+
borderRadius: '50%',
|
|
69
|
+
backgroundColor: 'white',
|
|
70
|
+
}),
|
|
71
|
+
label: (disabled) => (0, react_1.css)({
|
|
72
|
+
cursor: 'pointer',
|
|
73
|
+
lineHeight: 1,
|
|
74
|
+
paddingLeft: 5,
|
|
75
|
+
fontSize: '12px',
|
|
76
|
+
':hover': {
|
|
77
|
+
'& ~ button': {
|
|
78
|
+
borderColor: disabled ? 'grey' : styles_1.enabledColor,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
function ClassicRadioItem(props) {
|
|
84
|
+
const { value, label, disabled = false, onSelect, variant, name } = props;
|
|
85
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: classicStyles.container(disabled), children: [(0, jsx_runtime_1.jsx)("label", { css: classicStyles.label(disabled), style: {
|
|
86
|
+
fontSize: variant === 'small' ? '1em' : '1.125em',
|
|
87
|
+
}, htmlFor: `${value}${name}`, children: label }), (0, jsx_runtime_1.jsx)(RadioGroup.Item, { css: classicStyles.item(disabled, variant), value: value, id: `${value}${name}`, onClick: () => {
|
|
88
|
+
if (!disabled)
|
|
89
|
+
onSelect?.(props);
|
|
90
|
+
}, children: (0, jsx_runtime_1.jsx)(RadioGroup.Indicator, { css: classicStyles.indicator, children: (0, jsx_runtime_1.jsx)("div", { css: classicStyles.circle }) }) })] }));
|
|
91
|
+
}
|
|
92
|
+
exports.ClassicRadioItem = ClassicRadioItem;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.RadioGroup = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
+
/** @jsxImportSource @emotion/react */
|
|
29
|
+
const react_1 = require("@emotion/react");
|
|
30
|
+
const RadioGroupRadix = __importStar(require("@radix-ui/react-radio-group"));
|
|
31
|
+
const ButtonRadioItem_1 = require("./ButtonRadioItem");
|
|
32
|
+
const ClassicRadioItem_1 = require("./ClassicRadioItem");
|
|
33
|
+
const rootStyles = {
|
|
34
|
+
basic: (0, react_1.css)({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'row',
|
|
37
|
+
width: 'fit-content',
|
|
38
|
+
}),
|
|
39
|
+
button: (variant) => (0, react_1.css)({
|
|
40
|
+
' & > *:first-of-type, & > *:first-of-type span': {
|
|
41
|
+
borderRadius: variant === 'default' ? '6px 0 0 6px' : '4px 0 0 4px',
|
|
42
|
+
},
|
|
43
|
+
' & > *:last-of-type, & > *:last-of-type span': {
|
|
44
|
+
borderRightWidth: 1,
|
|
45
|
+
borderRadius: variant === 'default' ? '0 6px 6px 0' : '0 4px 4px 0',
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
function RadioGroup(props) {
|
|
50
|
+
const { selected, type = 'classic', disabled: groupDisabled = false, options = [], onSelect, name = '', variant = 'default', } = props;
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(RadioGroupRadix.Root, { css: [
|
|
52
|
+
rootStyles.basic,
|
|
53
|
+
type === 'classic' ? null : rootStyles.button(variant),
|
|
54
|
+
], style: {
|
|
55
|
+
gap: type === 'classic' ? (variant === 'default' ? 10 : 5) : 0,
|
|
56
|
+
}, value: selected?.value, name: name, disabled: groupDisabled, children: options?.map(({ value, label, disabled }) => {
|
|
57
|
+
const childProps = {
|
|
58
|
+
key: value,
|
|
59
|
+
value,
|
|
60
|
+
label,
|
|
61
|
+
disabled: groupDisabled || disabled,
|
|
62
|
+
onSelect,
|
|
63
|
+
variant,
|
|
64
|
+
name,
|
|
65
|
+
};
|
|
66
|
+
return type === 'classic' ? ((0, jsx_runtime_1.jsx)(ClassicRadioItem_1.ClassicRadioItem, { ...childProps })) : ((0, jsx_runtime_1.jsx)(ButtonRadioItem_1.ButtonRadioItem, { ...childProps }));
|
|
67
|
+
}) }));
|
|
68
|
+
}
|
|
69
|
+
exports.RadioGroup = RadioGroup;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./RadioGroup"), exports);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InputContainer = exports.GroupStyled = exports.LabelStyled = exports.disabledColor = exports.enabledColor = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
exports.enabledColor = '#1677ff';
|
|
9
|
+
exports.disabledColor = '#b8b8b8';
|
|
10
|
+
exports.LabelStyled = styled_1.default.label `
|
|
11
|
+
padding: ${(props) => props.variant === 'default'
|
|
12
|
+
? props.hasTrailing
|
|
13
|
+
? '2px 9px 4px 9px'
|
|
14
|
+
: '2px 9px'
|
|
15
|
+
: props.hasTrailing
|
|
16
|
+
? '1px 7px 1px 7px'
|
|
17
|
+
: '1px 7px'};
|
|
18
|
+
|
|
19
|
+
font-size: ${(props) => (props.variant === 'small' ? '1em' : '1.125em')};
|
|
20
|
+
line-height: '17px';
|
|
21
|
+
|
|
22
|
+
background-color: white;
|
|
23
|
+
border-width: 1px;
|
|
24
|
+
align-items: center;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
flex: 1 1 0%;
|
|
27
|
+
display: flex;
|
|
28
|
+
position: relative;
|
|
29
|
+
|
|
30
|
+
border-top-right-radius: ${(props) => props.hasLeading && !props.hasTrailing && '0.375rem'};
|
|
31
|
+
|
|
32
|
+
border-bottom-right-radius: ${(props) => props.hasLeading && !props.hasTrailing && '0.375rem'};
|
|
33
|
+
|
|
34
|
+
border-top-left-radius: ${(props) => props.hasTrailing && !props.hasLeading && '0.375rem'};
|
|
35
|
+
|
|
36
|
+
border-bottom-left-radius: ${(props) => props.hasTrailing && !props.hasLeading && '0.375rem'};
|
|
37
|
+
|
|
38
|
+
border-radius: ${(props) => !props.hasLeading && !props.hasTrailing && '0.375rem'};
|
|
39
|
+
|
|
40
|
+
border-color: var(--custom-border-color);
|
|
41
|
+
`;
|
|
42
|
+
function getStyleColor(hasError, hasValid) {
|
|
43
|
+
if (hasError) {
|
|
44
|
+
return {
|
|
45
|
+
default: '#ffa39e',
|
|
46
|
+
hover: '#f95d55',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (hasValid) {
|
|
50
|
+
return {
|
|
51
|
+
default: '#6adc24',
|
|
52
|
+
hover: '#62cb21',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
default: 'rgb(217, 217, 217)',
|
|
57
|
+
hover: '#4096ff',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
exports.GroupStyled = styled_1.default.div `
|
|
61
|
+
display: flex;
|
|
62
|
+
border-radius: 0.375rem;
|
|
63
|
+
margin-top: 0.25rem;
|
|
64
|
+
|
|
65
|
+
.addon {
|
|
66
|
+
color: ${({ hasError }) => hasError && '#f95d55'};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
--custom-border-color: ${({ hasError, hasValid }) => getStyleColor(hasError, hasValid).default};
|
|
70
|
+
|
|
71
|
+
:hover,
|
|
72
|
+
:focus-within {
|
|
73
|
+
--custom-border-color: ${({ hasError, hasValid }) => getStyleColor(hasError, hasValid).hover};
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
exports.InputContainer = styled_1.default.div `
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 2px;
|
|
80
|
+
`;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubText = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function SubText(props) {
|
|
6
|
+
const { error, help, valid: validProps } = props;
|
|
7
|
+
const valid = typeof validProps === 'string' ? validProps : undefined;
|
|
8
|
+
const text = error || valid || help;
|
|
9
|
+
return (0, jsx_runtime_1.jsx)("p", { style: { color: getColor(error, validProps) }, children: text });
|
|
10
|
+
}
|
|
11
|
+
exports.SubText = SubText;
|
|
12
|
+
function getColor(error, valid) {
|
|
13
|
+
if (error) {
|
|
14
|
+
return '#f95d55';
|
|
15
|
+
}
|
|
16
|
+
if (valid && typeof valid !== 'boolean') {
|
|
17
|
+
return '#62cb21';
|
|
18
|
+
}
|
|
19
|
+
return 'gray';
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SubText"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanelHeader = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/** @jsxImportSource @emotion/react */
|
|
6
|
+
const react_1 = require("@emotion/react");
|
|
7
|
+
const react_2 = require("react");
|
|
8
|
+
const fa_1 = require("react-icons/fa");
|
|
9
|
+
const Button_1 = require("../button/Button");
|
|
10
|
+
const styles = {
|
|
11
|
+
container: (0, react_1.css)({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'space-between',
|
|
16
|
+
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
17
|
+
}),
|
|
18
|
+
leftContainer: (0, react_1.css)({
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flexDirection: 'row',
|
|
21
|
+
flex: 1,
|
|
22
|
+
'& > button': {
|
|
23
|
+
padding: '0 5px',
|
|
24
|
+
minWidth: 'auto',
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
counterLabel: (0, react_1.css)({
|
|
28
|
+
margin: 0,
|
|
29
|
+
textAlign: 'right',
|
|
30
|
+
lineHeight: '22px',
|
|
31
|
+
whiteSpace: 'nowrap',
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
function PanelHeader({ total, current, children, onClickSettings, }) {
|
|
35
|
+
const labelRef = (0, react_2.useRef)(null);
|
|
36
|
+
(0, react_2.useEffect)(() => {
|
|
37
|
+
if (!labelRef.current)
|
|
38
|
+
return;
|
|
39
|
+
if (current !== undefined && total !== undefined) {
|
|
40
|
+
labelRef.current.textContent = `${current} / ${total}`;
|
|
41
|
+
}
|
|
42
|
+
else if (current !== undefined) {
|
|
43
|
+
labelRef.current.textContent = `[ ${current} ]`;
|
|
44
|
+
}
|
|
45
|
+
else if (total !== undefined) {
|
|
46
|
+
labelRef.current.textContent = `[ ${total} ]`;
|
|
47
|
+
}
|
|
48
|
+
}, [current, total]);
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles.container, children: [(0, jsx_runtime_1.jsx)("div", { css: styles.leftContainer, children: children }), (0, jsx_runtime_1.jsx)("p", { ref: labelRef, css: styles.counterLabel }), onClickSettings && ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClickSettings, color: { basic: 'black', hover: 'black' }, backgroundColor: { basic: 'white', hover: '#f7f7f7' }, children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }))] }));
|
|
50
|
+
}
|
|
51
|
+
exports.PanelHeader = PanelHeader;
|
package/lib/components/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __exportStar(require("./forms/index"), exports);
|
|
|
36
36
|
__exportStar(require("./fullscreen/index"), exports);
|
|
37
37
|
__exportStar(require("./header/index"), exports);
|
|
38
38
|
__exportStar(require("./hooks/index"), exports);
|
|
39
|
+
__exportStar(require("./info-panel/index"), exports);
|
|
39
40
|
__exportStar(require("./layout-manager/index"), exports);
|
|
40
41
|
__exportStar(require("./modal/index"), exports);
|
|
41
42
|
__exportStar(require("./root-layout/index"), exports);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InfoPanel = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/** @jsxImportSource @emotion/react */
|
|
6
|
+
const react_1 = require("@emotion/react");
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
const react_2 = require("@headlessui/react");
|
|
10
|
+
const react_3 = require("react");
|
|
11
|
+
const fa_1 = require("react-icons/fa");
|
|
12
|
+
const index_1 = require("../index");
|
|
13
|
+
const Table_1 = require("../table/Table");
|
|
14
|
+
const style = {
|
|
15
|
+
container: (0, react_1.css)({
|
|
16
|
+
padding: '5px',
|
|
17
|
+
}),
|
|
18
|
+
chevron: (open) => (0, react_1.css)({
|
|
19
|
+
rotate: open ? '90deg' : '0deg',
|
|
20
|
+
transition: 'all 0.3s ease-in-out',
|
|
21
|
+
}),
|
|
22
|
+
button: (0, react_1.css)({
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
gap: 5,
|
|
26
|
+
padding: '5px 2px',
|
|
27
|
+
}),
|
|
28
|
+
table: (0, react_1.css) `
|
|
29
|
+
width: 100%;
|
|
30
|
+
td:first-of-type {
|
|
31
|
+
width: 30%;
|
|
32
|
+
}
|
|
33
|
+
`,
|
|
34
|
+
};
|
|
35
|
+
function InfoPanel(props) {
|
|
36
|
+
const [search, setSearch] = (0, react_3.useState)('');
|
|
37
|
+
const { title = 'Information', data = [], titleStyle, inputStyle, tableStyle, } = props;
|
|
38
|
+
function viewData(data) {
|
|
39
|
+
return Object.keys(data)
|
|
40
|
+
.map((key) => {
|
|
41
|
+
const value = data[key];
|
|
42
|
+
if (!key.toLowerCase().includes(search.toLowerCase()) &&
|
|
43
|
+
!valueSearch(value, search)) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(Table_1.Table.Row, { children: [(0, jsx_runtime_1.jsx)(index_1.ValueRenderers.Text, { value: key }), valueCell(value)] }, key));
|
|
47
|
+
})
|
|
48
|
+
.filter((row) => row !== null);
|
|
49
|
+
}
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: style.container, children: [(0, jsx_runtime_1.jsx)("div", { style: titleStyle, children: title }), (0, jsx_runtime_1.jsx)(index_1.Input, { placeholder: "search for a parameter ...", value: search, onChange: ({ target }) => {
|
|
51
|
+
if (target.value !== undefined)
|
|
52
|
+
setSearch(target.value);
|
|
53
|
+
}, style: inputStyle }), data.map(({ description, data }) => {
|
|
54
|
+
const content = viewData(data);
|
|
55
|
+
return content.length > 0 ? ((0, jsx_runtime_1.jsx)(react_2.Disclosure, { defaultOpen: true, children: ({ open }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Disclosure.Button, { css: style.button, children: [(0, jsx_runtime_1.jsx)(fa_1.FaChevronRight, { css: style.chevron(open) }), description] }), (0, jsx_runtime_1.jsx)(react_2.Disclosure.Panel, { children: (0, jsx_runtime_1.jsxs)(Table_1.Table, { css: style.table, style: tableStyle, children: [(0, jsx_runtime_1.jsxs)(Table_1.Table.Header, { children: [(0, jsx_runtime_1.jsx)(index_1.ValueRenderers.Title, { value: "Parameter" }), (0, jsx_runtime_1.jsx)(index_1.ValueRenderers.Title, { value: "Value" })] }), content] }) })] })) }, description)) : null;
|
|
56
|
+
})] }));
|
|
57
|
+
}
|
|
58
|
+
exports.InfoPanel = InfoPanel;
|
|
59
|
+
/**
|
|
60
|
+
* Get the value cell depending on the type of the value
|
|
61
|
+
* @param value - ValueRenderers value.
|
|
62
|
+
* @returns - ValueRenderers component.
|
|
63
|
+
*/
|
|
64
|
+
function valueCell(value) {
|
|
65
|
+
switch (typeof value) {
|
|
66
|
+
case 'number':
|
|
67
|
+
return (0, jsx_runtime_1.jsx)(index_1.ValueRenderers.Number, { value: value });
|
|
68
|
+
case 'object':
|
|
69
|
+
return (0, jsx_runtime_1.jsx)(index_1.ValueRenderers.Object, { value: value });
|
|
70
|
+
case 'string':
|
|
71
|
+
return (0, jsx_runtime_1.jsx)(index_1.ValueRenderers.Text, { value: value });
|
|
72
|
+
default:
|
|
73
|
+
(0, jsx_runtime_1.jsx)(index_1.ValueRenderers.Text, { value: value });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Search a string in different type of values
|
|
78
|
+
*
|
|
79
|
+
* @param value - Value to search in.
|
|
80
|
+
* @param search - Value to search for.
|
|
81
|
+
* @returns - If search exist in value
|
|
82
|
+
*/
|
|
83
|
+
function valueSearch(value, search) {
|
|
84
|
+
switch (typeof value) {
|
|
85
|
+
case 'number':
|
|
86
|
+
return String(value).includes(search.toLowerCase());
|
|
87
|
+
case 'object':
|
|
88
|
+
return JSON.stringify(value).toLowerCase().includes(search.toLowerCase());
|
|
89
|
+
case 'string':
|
|
90
|
+
return value.toLowerCase().includes(search.toLowerCase());
|
|
91
|
+
default:
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./InfoPanel"), exports);
|
|
@@ -24,8 +24,6 @@ const ConfirmModalContents = styled_1.default.div `
|
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
background-color: white;
|
|
26
26
|
width: 100%;
|
|
27
|
-
border-width: 1px;
|
|
28
|
-
border-color: transparent;
|
|
29
27
|
border-radius: 0.5rem;
|
|
30
28
|
box-shadow:
|
|
31
29
|
0 0 0 0,
|
|
@@ -36,6 +34,9 @@ const ConfirmModalChildrenRoot = styled_1.default.div `
|
|
|
36
34
|
color: ${({ headerColor }) => headerColor};
|
|
37
35
|
display: flex;
|
|
38
36
|
flex: 1 1 0%;
|
|
37
|
+
font-weight: bold;
|
|
38
|
+
padding: 20px;
|
|
39
|
+
font-size: 14px;
|
|
39
40
|
`;
|
|
40
41
|
const ConfirmModalFooter = styled_1.default.div `
|
|
41
42
|
border-top: 2px solid rgb(247, 247, 247);
|
|
@@ -13,7 +13,9 @@ const ModalCloseButton_1 = __importDefault(require("./ModalCloseButton"));
|
|
|
13
13
|
const useDialog_1 = require("./useDialog");
|
|
14
14
|
const DialogRoot = styled_1.default.dialog `
|
|
15
15
|
background-color: transparent;
|
|
16
|
-
|
|
16
|
+
:focus {
|
|
17
|
+
outline: none;
|
|
18
|
+
}
|
|
17
19
|
::backdrop {
|
|
18
20
|
background-color: rgba(113, 113, 122, 0.75);
|
|
19
21
|
}
|
|
@@ -44,10 +44,10 @@ function splitChildren(children) {
|
|
|
44
44
|
return { Rows, Header };
|
|
45
45
|
}
|
|
46
46
|
function Table(props) {
|
|
47
|
-
const { border = true,
|
|
47
|
+
const { border = true, children, ...tableProps } = props;
|
|
48
48
|
const { Header, Rows } = splitChildren(children);
|
|
49
49
|
const tableContextValue = (0, react_2.useMemo)(() => ({ border }), [border]);
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(TableContext.Provider, { value: tableContextValue, children: (0, jsx_runtime_1.jsxs)("table", {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(TableContext.Provider, { value: tableContextValue, children: (0, jsx_runtime_1.jsxs)("table", { ...tableProps, children: [Header, (0, jsx_runtime_1.jsx)("tbody", { children: Rows })] }) }));
|
|
51
51
|
}
|
|
52
52
|
exports.Table = Table;
|
|
53
53
|
function useRowChildren(children) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanelPreferencesToolbar = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/** @jsxImportSource @emotion/react */
|
|
6
|
+
const react_1 = require("@emotion/react");
|
|
7
|
+
const fa_1 = require("react-icons/fa");
|
|
8
|
+
const Button_1 = require("../button/Button");
|
|
9
|
+
const styles = {
|
|
10
|
+
toolbar: (0, react_1.css)({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'row-reverse',
|
|
13
|
+
fontSize: 16,
|
|
14
|
+
padding: 3,
|
|
15
|
+
'& > button': {
|
|
16
|
+
padding: 0,
|
|
17
|
+
paddingLeft: 9,
|
|
18
|
+
minWidth: 'auto',
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
function PanelPreferencesToolbar(props) {
|
|
23
|
+
const { onClose, onSave } = props;
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles.toolbar, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClose, color: { basic: '#ca0000', hover: '#ca0000' }, backgroundColor: { basic: 'white', hover: 'white' }, children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onSave, color: { basic: 'green', hover: 'green' }, backgroundColor: { basic: 'white', hover: 'white' }, children: (0, jsx_runtime_1.jsx)(fa_1.FaCheck, {}) })] }));
|
|
25
|
+
}
|
|
26
|
+
exports.PanelPreferencesToolbar = PanelPreferencesToolbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeasurementExplorer.d.ts","sourceRoot":"","sources":["../../../src/app/explorer/MeasurementExplorer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,YAAY,CAAC;CAAG;AAC3D,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAyBD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"MeasurementExplorer.d.ts","sourceRoot":"","sources":["../../../src/app/explorer/MeasurementExplorer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,YAAY,CAAC;CAAG;AAC3D,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAyBD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA0JlE"}
|