@insync-stageplayer/measurements 0.5.37 → 0.6.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/AsyncSubject.d.ts +23 -23
- package/lib/AsyncSubject.js +64 -64
- package/lib/client/MeasurementDataClient.d.ts +135 -130
- package/lib/client/MeasurementDataClient.d.ts.map +1 -1
- package/lib/client/MeasurementDataClient.js +99 -99
- package/lib/client/MeasurementDataClient.js.map +1 -1
- package/lib/client/OnlineMeasurementDataClient.d.ts +44 -44
- package/lib/client/OnlineMeasurementDataClient.d.ts.map +1 -1
- package/lib/client/OnlineMeasurementDataClient.js +211 -211
- package/lib/client/OnlineMeasurementDataClient.js.map +1 -1
- package/lib/client/debug.d.ts +1 -1
- package/lib/client/debug.js +4 -4
- package/lib/client/index.d.ts +3 -3
- package/lib/client/index.js +3 -3
- package/lib/client/offline/OfflineMeasurementDataClient.d.ts +16 -16
- package/lib/client/offline/OfflineMeasurementDataClient.js +47 -47
- package/lib/client/offline/offline.d.ts +16 -16
- package/lib/client/offline/offline.js +82 -82
- package/lib/client/sbf.d.ts +35 -35
- package/lib/client/sbf.js +88 -88
- package/lib/client/signalviewer/SignalViewerDataClient.d.ts +37 -37
- package/lib/client/signalviewer/SignalViewerDataClient.d.ts.map +1 -1
- package/lib/client/signalviewer/SignalViewerDataClient.js +163 -164
- package/lib/client/signalviewer/SignalViewerDataClient.js.map +1 -1
- package/lib/client/signalviewer/SignalViewerDataClient.worker.d.ts +79 -73
- package/lib/client/signalviewer/SignalViewerDataClient.worker.d.ts.map +1 -1
- package/lib/client/signalviewer/SignalViewerDataClient.worker.js +342 -211
- package/lib/client/signalviewer/SignalViewerDataClient.worker.js.map +1 -1
- package/lib/components/Icon/CloseIcon.d.ts +6 -6
- package/lib/components/Icon/CloseIcon.js +24 -24
- package/lib/components/Icon/Icon.test.d.ts +1 -1
- package/lib/components/Icon/Icon.test.js +11 -11
- package/lib/components/MeasurementsChooser.d.ts +38 -38
- package/lib/components/MeasurementsChooser.d.ts.map +1 -1
- package/lib/components/MeasurementsChooser.js +178 -181
- package/lib/components/MeasurementsChooser.js.map +1 -1
- package/lib/components/MeasurementsModuleProvider.d.ts +34 -34
- package/lib/components/MeasurementsModuleProvider.d.ts.map +1 -1
- package/lib/components/MeasurementsModuleProvider.js +100 -79
- package/lib/components/MeasurementsModuleProvider.js.map +1 -1
- package/lib/components/MeasurementsTable/CheckboxCell.d.ts +35 -35
- package/lib/components/MeasurementsTable/CheckboxCell.js +28 -28
- package/lib/components/MeasurementsTable/ColorCell.d.ts +29 -29
- package/lib/components/MeasurementsTable/ColorCell.d.ts.map +1 -1
- package/lib/components/MeasurementsTable/ColorCell.js +58 -58
- package/lib/components/MeasurementsTable/ColorPicker.d.ts +6 -3
- package/lib/components/MeasurementsTable/ColorPicker.d.ts.map +1 -1
- package/lib/components/MeasurementsTable/ColorPicker.js +10 -10
- package/lib/components/MeasurementsTable/ColumnResizer.d.ts +4 -4
- package/lib/components/MeasurementsTable/ColumnResizer.js +5 -5
- package/lib/components/MeasurementsTable/ColumnSorting.d.ts +13 -13
- package/lib/components/MeasurementsTable/ColumnSorting.d.ts.map +1 -1
- package/lib/components/MeasurementsTable/ColumnSorting.js +10 -10
- package/lib/components/MeasurementsTable/MeasurementsTable.d.ts +72 -72
- package/lib/components/MeasurementsTable/MeasurementsTable.d.ts.map +1 -1
- package/lib/components/MeasurementsTable/MeasurementsTable.js +229 -217
- package/lib/components/MeasurementsTable/MeasurementsTable.js.map +1 -1
- package/lib/components/MeasurementsTable/MeasurementsTable.test.d.ts +1 -1
- package/lib/components/MeasurementsTable/MeasurementsTable.test.js +102 -102
- package/lib/components/MeasurementsTable/MeasurementsTableNoldus.d.ts +72 -72
- package/lib/components/MeasurementsTable/MeasurementsTableNoldus.d.ts.map +1 -1
- package/lib/components/MeasurementsTable/MeasurementsTableNoldus.js +193 -193
- package/lib/components/MeasurementsTable/SelectedContext.d.ts +10 -10
- package/lib/components/MeasurementsTable/SelectedContext.js +10 -10
- package/lib/components/MeasurementsTable/TextColumnFilter.d.ts +8 -8
- package/lib/components/MeasurementsTable/TextColumnFilter.d.ts.map +1 -1
- package/lib/components/MeasurementsTable/TextColumnFilter.js +15 -15
- package/lib/components/MeasurementsTable/filters.d.ts +3 -3
- package/lib/components/MeasurementsTable/filters.js +9 -9
- package/lib/components/MeasurementsTable/index.d.ts +2 -2
- package/lib/components/MeasurementsTable/index.js +2 -2
- package/lib/components/ModalMeasurementChooser.d.ts +19 -19
- package/lib/components/ModalMeasurementChooser.js +35 -35
- package/lib/conversion/UnitConversion.d.ts +13 -0
- package/lib/conversion/UnitConversion.d.ts.map +1 -0
- package/lib/conversion/UnitConversion.js +266 -0
- package/lib/conversion/UnitConversion.js.map +1 -0
- package/lib/hooks/useMarkerData.d.ts +6 -4
- package/lib/hooks/useMarkerData.d.ts.map +1 -1
- package/lib/hooks/useMarkerData.js +93 -63
- package/lib/hooks/useMarkerData.js.map +1 -1
- package/lib/hooks/useMeasurement.d.ts +41 -17
- package/lib/hooks/useMeasurement.d.ts.map +1 -1
- package/lib/hooks/useMeasurement.js +41 -41
- package/lib/hooks/useMeasurements.d.ts +11 -11
- package/lib/hooks/useMeasurements.js +22 -22
- package/lib/hooks/useMeasurementsModule.d.ts +20 -20
- package/lib/hooks/useMeasurementsModule.js +12 -12
- package/lib/hooks/useOverlayMeasurementData.d.ts +1 -1
- package/lib/hooks/useOverlayMeasurementData.js +23 -23
- package/lib/hooks/useTimedMeasurementData.d.ts +26 -26
- package/lib/hooks/useTimedMeasurementData.d.ts.map +1 -1
- package/lib/hooks/useTimedMeasurementData.js +125 -125
- package/lib/hooks/useTimedMeasurementData.js.map +1 -1
- package/lib/hooks/useWindowedMeasurementData.d.ts +25 -25
- package/lib/hooks/useWindowedMeasurementData.d.ts.map +1 -1
- package/lib/hooks/useWindowedMeasurementData.js +120 -120
- package/lib/hooks/useWindowedMeasurementData.js.map +1 -1
- package/lib/index.d.ts +15 -14
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +15 -14
- package/lib/index.js.map +1 -1
- package/lib/redux/measurements.slice.d.ts +75 -122
- package/lib/redux/measurements.slice.d.ts.map +1 -1
- package/lib/redux/measurements.slice.js +90 -89
- package/lib/redux/measurements.slice.js.map +1 -1
- package/lib/redux/reducer.d.ts +3 -10
- package/lib/redux/reducer.d.ts.map +1 -1
- package/lib/redux/reducer.js +2 -2
- package/lib/redux/reducer.js.map +1 -1
- package/lib/types.d.ts +93 -93
- package/lib/types.js +51 -51
- package/package.json +7 -10
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { shallow, configure } from "enzyme";
|
|
3
|
-
import Adapter from "enzyme-adapter-react-16";
|
|
4
|
-
import { SelectedContext } from "./SelectedContext";
|
|
5
|
-
import { CheckboxCell, YAxisCheckboxCell } from "./CheckboxCell";
|
|
6
|
-
import ColorPicker from "./ColorPicker";
|
|
7
|
-
import { ColumnSorting } from "./ColumnSorting";
|
|
8
|
-
import { textMatcher, textFilter } from "./filters";
|
|
9
|
-
configure({ adapter: new Adapter() });
|
|
10
|
-
describe("CheckboxCell component", () => {
|
|
11
|
-
test("Renders a radio input when single selection mode is on", () => {
|
|
12
|
-
const wrapper = shallow(React.createElement(SelectedContext.Provider, { value: { selected: [], single: true } },
|
|
13
|
-
React.createElement(CheckboxCell, { id: "1", rowToDisable: false })));
|
|
14
|
-
expect(wrapper.find("input[type='checkbox']")).toHaveLength(0);
|
|
15
|
-
});
|
|
16
|
-
test("Renders a checkbox input when single selection mode is off", () => {
|
|
17
|
-
const wrapper = shallow(React.createElement(SelectedContext.Provider, { value: { selected: [], single: false } },
|
|
18
|
-
React.createElement(CheckboxCell, { id: "1", rowToDisable: false })));
|
|
19
|
-
expect(wrapper.find("input[type='radio']")).toHaveLength(0);
|
|
20
|
-
});
|
|
21
|
-
test("Renders a disabled input when rowToDisable is true", () => {
|
|
22
|
-
const wrapper = shallow(React.createElement(CheckboxCell, { id: "1", rowToDisable: true }));
|
|
23
|
-
expect(wrapper.find("input").prop("disabled")).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
test("Renders a checkbox input when in multiple selection mode", () => {
|
|
26
|
-
const wrapper = shallow(React.createElement(CheckboxCell, { id: "1", rowToDisable: false }));
|
|
27
|
-
expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true);
|
|
28
|
-
});
|
|
29
|
-
test("Sets the checked prop to false when the id is not in the selected array", () => {
|
|
30
|
-
const wrapper = shallow(React.createElement(CheckboxCell, { id: "1", rowToDisable: false }));
|
|
31
|
-
expect(wrapper.find("input").prop("checked")).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
test("Renders a checkbox input when not in single selection mode", () => {
|
|
34
|
-
const wrapper = shallow(React.createElement(CheckboxCell, { id: "0", rowToDisable: false }));
|
|
35
|
-
expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
describe("YAxisCheckboxCell component", () => {
|
|
39
|
-
test("Renders a checkbox input", () => {
|
|
40
|
-
const wrapper = shallow(React.createElement(YAxisCheckboxCell, { yaxisLeftPos: "1" }));
|
|
41
|
-
expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true);
|
|
42
|
-
});
|
|
43
|
-
test("Sets the 'checked' prop based on the 'selected' context value", () => {
|
|
44
|
-
const contextValue = { selected: ["1"], single: false };
|
|
45
|
-
jest.spyOn(React, "useContext").mockReturnValue(contextValue);
|
|
46
|
-
const wrapper = shallow(React.createElement(YAxisCheckboxCell, { yaxisLeftPos: "1" }));
|
|
47
|
-
expect(wrapper.find('input[type="checkbox"]').prop("checked")).toBe(true);
|
|
48
|
-
});
|
|
49
|
-
test("Sets the 'checked' prop to false when 'yaxisLeftPos' is not in the 'selected' context value", () => {
|
|
50
|
-
const contextValue = { selected: ["2"], single: false };
|
|
51
|
-
jest.spyOn(React, "useContext").mockReturnValue(contextValue);
|
|
52
|
-
const wrapper = shallow(React.createElement(YAxisCheckboxCell, { yaxisLeftPos: "1" }));
|
|
53
|
-
expect(wrapper.find('input[type="checkbox"]').prop("checked")).toBe(false);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
describe("ColorCell component", () => {
|
|
57
|
-
test("Component is rendered", () => {
|
|
58
|
-
const wrapper = shallow(React.createElement(ColorPicker, null));
|
|
59
|
-
expect(wrapper.exists()).toBe(true);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
describe("ColumnSorting component", () => {
|
|
63
|
-
const column = {
|
|
64
|
-
id: "date",
|
|
65
|
-
Header: "Date",
|
|
66
|
-
accessor: (d) => d.date,
|
|
67
|
-
isSorted: true,
|
|
68
|
-
isSortedDesc: false,
|
|
69
|
-
};
|
|
70
|
-
test("Should render an up arrow when the column is sorted in ascending order", () => {
|
|
71
|
-
column.isSortedDesc = false;
|
|
72
|
-
const wrapper = shallow(React.createElement(ColumnSorting, { column: column }));
|
|
73
|
-
expect(wrapper.find("span").text()).toEqual(" ↑");
|
|
74
|
-
});
|
|
75
|
-
test("Should render a down arrow when the column is sorted in descending order", () => {
|
|
76
|
-
column.isSortedDesc = true;
|
|
77
|
-
const wrapper = shallow(React.createElement(ColumnSorting, { column: column }));
|
|
78
|
-
expect(wrapper.find("span").text()).toEqual(" ↓");
|
|
79
|
-
});
|
|
80
|
-
test("Should not render when the column is not sorted", () => {
|
|
81
|
-
column.isSorted = false;
|
|
82
|
-
const wrapper = shallow(React.createElement(ColumnSorting, { column: column }));
|
|
83
|
-
expect(wrapper.find("span").exists()).toEqual(false);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
describe("TextMatcher", () => {
|
|
87
|
-
const rows = [
|
|
88
|
-
{ values: { name: "Alice", age: 30 } },
|
|
89
|
-
{ values: { name: "Bob", age: 40 } },
|
|
90
|
-
{ values: { name: "Charlie", age: 50 } },
|
|
91
|
-
];
|
|
92
|
-
test("Returns all rows when filter value is empty", () => {
|
|
93
|
-
const filteredRows = textFilter(rows, "name", "");
|
|
94
|
-
expect(filteredRows).toEqual(rows);
|
|
95
|
-
});
|
|
96
|
-
test("Returns false when row value does not contain search string", () => {
|
|
97
|
-
const row = { values: { name: "Bob" } };
|
|
98
|
-
const matcher = textMatcher("li", "name");
|
|
99
|
-
const result = matcher(row);
|
|
100
|
-
expect(result).toBe(false);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { shallow, configure } from "enzyme";
|
|
3
|
+
import Adapter from "enzyme-adapter-react-16";
|
|
4
|
+
import { SelectedContext } from "./SelectedContext";
|
|
5
|
+
import { CheckboxCell, YAxisCheckboxCell } from "./CheckboxCell";
|
|
6
|
+
import ColorPicker from "./ColorPicker";
|
|
7
|
+
import { ColumnSorting } from "./ColumnSorting";
|
|
8
|
+
import { textMatcher, textFilter } from "./filters";
|
|
9
|
+
configure({ adapter: new Adapter() });
|
|
10
|
+
describe("CheckboxCell component", () => {
|
|
11
|
+
test("Renders a radio input when single selection mode is on", () => {
|
|
12
|
+
const wrapper = shallow(React.createElement(SelectedContext.Provider, { value: { selected: [], single: true } },
|
|
13
|
+
React.createElement(CheckboxCell, { id: "1", rowToDisable: false })));
|
|
14
|
+
expect(wrapper.find("input[type='checkbox']")).toHaveLength(0);
|
|
15
|
+
});
|
|
16
|
+
test("Renders a checkbox input when single selection mode is off", () => {
|
|
17
|
+
const wrapper = shallow(React.createElement(SelectedContext.Provider, { value: { selected: [], single: false } },
|
|
18
|
+
React.createElement(CheckboxCell, { id: "1", rowToDisable: false })));
|
|
19
|
+
expect(wrapper.find("input[type='radio']")).toHaveLength(0);
|
|
20
|
+
});
|
|
21
|
+
test("Renders a disabled input when rowToDisable is true", () => {
|
|
22
|
+
const wrapper = shallow(React.createElement(CheckboxCell, { id: "1", rowToDisable: true }));
|
|
23
|
+
expect(wrapper.find("input").prop("disabled")).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
test("Renders a checkbox input when in multiple selection mode", () => {
|
|
26
|
+
const wrapper = shallow(React.createElement(CheckboxCell, { id: "1", rowToDisable: false }));
|
|
27
|
+
expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
test("Sets the checked prop to false when the id is not in the selected array", () => {
|
|
30
|
+
const wrapper = shallow(React.createElement(CheckboxCell, { id: "1", rowToDisable: false }));
|
|
31
|
+
expect(wrapper.find("input").prop("checked")).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
test("Renders a checkbox input when not in single selection mode", () => {
|
|
34
|
+
const wrapper = shallow(React.createElement(CheckboxCell, { id: "0", rowToDisable: false }));
|
|
35
|
+
expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe("YAxisCheckboxCell component", () => {
|
|
39
|
+
test("Renders a checkbox input", () => {
|
|
40
|
+
const wrapper = shallow(React.createElement(YAxisCheckboxCell, { yaxisLeftPos: "1" }));
|
|
41
|
+
expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
test("Sets the 'checked' prop based on the 'selected' context value", () => {
|
|
44
|
+
const contextValue = { selected: ["1"], single: false };
|
|
45
|
+
jest.spyOn(React, "useContext").mockReturnValue(contextValue);
|
|
46
|
+
const wrapper = shallow(React.createElement(YAxisCheckboxCell, { yaxisLeftPos: "1" }));
|
|
47
|
+
expect(wrapper.find('input[type="checkbox"]').prop("checked")).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
test("Sets the 'checked' prop to false when 'yaxisLeftPos' is not in the 'selected' context value", () => {
|
|
50
|
+
const contextValue = { selected: ["2"], single: false };
|
|
51
|
+
jest.spyOn(React, "useContext").mockReturnValue(contextValue);
|
|
52
|
+
const wrapper = shallow(React.createElement(YAxisCheckboxCell, { yaxisLeftPos: "1" }));
|
|
53
|
+
expect(wrapper.find('input[type="checkbox"]').prop("checked")).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe("ColorCell component", () => {
|
|
57
|
+
test("Component is rendered", () => {
|
|
58
|
+
const wrapper = shallow(React.createElement(ColorPicker, null));
|
|
59
|
+
expect(wrapper.exists()).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe("ColumnSorting component", () => {
|
|
63
|
+
const column = {
|
|
64
|
+
id: "date",
|
|
65
|
+
Header: "Date",
|
|
66
|
+
accessor: (d) => d.date,
|
|
67
|
+
isSorted: true,
|
|
68
|
+
isSortedDesc: false,
|
|
69
|
+
};
|
|
70
|
+
test("Should render an up arrow when the column is sorted in ascending order", () => {
|
|
71
|
+
column.isSortedDesc = false;
|
|
72
|
+
const wrapper = shallow(React.createElement(ColumnSorting, { column: column }));
|
|
73
|
+
expect(wrapper.find("span").text()).toEqual(" ↑");
|
|
74
|
+
});
|
|
75
|
+
test("Should render a down arrow when the column is sorted in descending order", () => {
|
|
76
|
+
column.isSortedDesc = true;
|
|
77
|
+
const wrapper = shallow(React.createElement(ColumnSorting, { column: column }));
|
|
78
|
+
expect(wrapper.find("span").text()).toEqual(" ↓");
|
|
79
|
+
});
|
|
80
|
+
test("Should not render when the column is not sorted", () => {
|
|
81
|
+
column.isSorted = false;
|
|
82
|
+
const wrapper = shallow(React.createElement(ColumnSorting, { column: column }));
|
|
83
|
+
expect(wrapper.find("span").exists()).toEqual(false);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe("TextMatcher", () => {
|
|
87
|
+
const rows = [
|
|
88
|
+
{ values: { name: "Alice", age: 30 } },
|
|
89
|
+
{ values: { name: "Bob", age: 40 } },
|
|
90
|
+
{ values: { name: "Charlie", age: 50 } },
|
|
91
|
+
];
|
|
92
|
+
test("Returns all rows when filter value is empty", () => {
|
|
93
|
+
const filteredRows = textFilter(rows, "name", "");
|
|
94
|
+
expect(filteredRows).toEqual(rows);
|
|
95
|
+
});
|
|
96
|
+
test("Returns false when row value does not contain search string", () => {
|
|
97
|
+
const row = { values: { name: "Bob" } };
|
|
98
|
+
const matcher = textMatcher("li", "name");
|
|
99
|
+
const result = matcher(row);
|
|
100
|
+
expect(result).toBe(false);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
103
|
//# sourceMappingURL=MeasurementsTable.test.js.map
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A component that displays a list of measurements. Provides searching/sorting/selecting capabilities.
|
|
3
|
-
*
|
|
4
|
-
* Also allows a user to change the colors of measurements.
|
|
5
|
-
*/
|
|
6
|
-
import React from "react";
|
|
7
|
-
import { MeasurementsTypes } from "../..";
|
|
8
|
-
import "bootstrap/dist/css/bootstrap.css";
|
|
9
|
-
declare type MeasurementsTableNoldusProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
10
|
-
/**
|
|
11
|
-
* If set to `true` only a single measurement can be selected (will render a radio instead of checkboxes).
|
|
12
|
-
*/
|
|
13
|
-
single?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* The measurements we want to display in the table.
|
|
16
|
-
*/
|
|
17
|
-
measurements: MeasurementsTypes.Measurement[];
|
|
18
|
-
/**
|
|
19
|
-
* The currently selected measurements (this is a controlled component).
|
|
20
|
-
*/
|
|
21
|
-
selected?: string[];
|
|
22
|
-
/**
|
|
23
|
-
* The currently selected measurements (this is a controlled component).
|
|
24
|
-
*/
|
|
25
|
-
yAxisLeftSelected?: string[];
|
|
26
|
-
/**
|
|
27
|
-
* The widths of the columns in percentages.
|
|
28
|
-
*/
|
|
29
|
-
widths?: number[];
|
|
30
|
-
/**
|
|
31
|
-
* Callback when a measurement is selected.
|
|
32
|
-
* @param selected The selected measurements.
|
|
33
|
-
*/
|
|
34
|
-
onChange?: (selected: string[]) => void;
|
|
35
|
-
/**
|
|
36
|
-
* Callback when a measurement is selected.
|
|
37
|
-
* @param selected The selected measurements.
|
|
38
|
-
*/
|
|
39
|
-
onYAxisPosChange?: (selected: string[]) => void;
|
|
40
|
-
/**
|
|
41
|
-
* A function that can be used to format the frequency displayed in the frequency column.
|
|
42
|
-
* @param v The raw frequency number.
|
|
43
|
-
*/
|
|
44
|
-
formatFrequency?: (v: number) => string;
|
|
45
|
-
/**
|
|
46
|
-
* Callback when color of meaurement is changed.
|
|
47
|
-
*/
|
|
48
|
-
onColorChange?: (id: string, color: string) => void;
|
|
49
|
-
/**
|
|
50
|
-
* Use globally unique measurement colors or not
|
|
51
|
-
*/
|
|
52
|
-
globallyUniqueMeasurementColors?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Data viewer id this measurementstable is used for
|
|
55
|
-
*/
|
|
56
|
-
dataViewerId: string;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* A component to render a list of measurements in a table. This table provides functionalities like:
|
|
60
|
-
*
|
|
61
|
-
* Please read up here https://react-table.tanstack.com/ for more information as to how this component works internally.
|
|
62
|
-
*
|
|
63
|
-
* - Sorting
|
|
64
|
-
* - Resizable columns
|
|
65
|
-
* - Changing measurement colors
|
|
66
|
-
* - Searching measurements
|
|
67
|
-
* - Selecting measurements
|
|
68
|
-
* @param props
|
|
69
|
-
* @returns
|
|
70
|
-
*/
|
|
71
|
-
export declare const MeasurementsTableNoldus: (props: MeasurementsTableNoldusProps) => JSX.Element;
|
|
72
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* A component that displays a list of measurements. Provides searching/sorting/selecting capabilities.
|
|
3
|
+
*
|
|
4
|
+
* Also allows a user to change the colors of measurements.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { MeasurementsTypes } from "../..";
|
|
8
|
+
import "bootstrap/dist/css/bootstrap.css";
|
|
9
|
+
declare type MeasurementsTableNoldusProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
10
|
+
/**
|
|
11
|
+
* If set to `true` only a single measurement can be selected (will render a radio instead of checkboxes).
|
|
12
|
+
*/
|
|
13
|
+
single?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The measurements we want to display in the table.
|
|
16
|
+
*/
|
|
17
|
+
measurements: MeasurementsTypes.Measurement[];
|
|
18
|
+
/**
|
|
19
|
+
* The currently selected measurements (this is a controlled component).
|
|
20
|
+
*/
|
|
21
|
+
selected?: string[];
|
|
22
|
+
/**
|
|
23
|
+
* The currently selected measurements (this is a controlled component).
|
|
24
|
+
*/
|
|
25
|
+
yAxisLeftSelected?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* The widths of the columns in percentages.
|
|
28
|
+
*/
|
|
29
|
+
widths?: number[];
|
|
30
|
+
/**
|
|
31
|
+
* Callback when a measurement is selected.
|
|
32
|
+
* @param selected The selected measurements.
|
|
33
|
+
*/
|
|
34
|
+
onChange?: (selected: string[]) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback when a measurement is selected.
|
|
37
|
+
* @param selected The selected measurements.
|
|
38
|
+
*/
|
|
39
|
+
onYAxisPosChange?: (selected: string[]) => void;
|
|
40
|
+
/**
|
|
41
|
+
* A function that can be used to format the frequency displayed in the frequency column.
|
|
42
|
+
* @param v The raw frequency number.
|
|
43
|
+
*/
|
|
44
|
+
formatFrequency?: (v: number) => string;
|
|
45
|
+
/**
|
|
46
|
+
* Callback when color of meaurement is changed.
|
|
47
|
+
*/
|
|
48
|
+
onColorChange?: (id: string, color: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Use globally unique measurement colors or not
|
|
51
|
+
*/
|
|
52
|
+
globallyUniqueMeasurementColors?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Data viewer id this measurementstable is used for
|
|
55
|
+
*/
|
|
56
|
+
dataViewerId: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A component to render a list of measurements in a table. This table provides functionalities like:
|
|
60
|
+
*
|
|
61
|
+
* Please read up here https://react-table.tanstack.com/ for more information as to how this component works internally.
|
|
62
|
+
*
|
|
63
|
+
* - Sorting
|
|
64
|
+
* - Resizable columns
|
|
65
|
+
* - Changing measurement colors
|
|
66
|
+
* - Searching measurements
|
|
67
|
+
* - Selecting measurements
|
|
68
|
+
* @param props
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
export declare const MeasurementsTableNoldus: (props: MeasurementsTableNoldusProps) => React.JSX.Element;
|
|
72
|
+
export {};
|
|
73
73
|
//# sourceMappingURL=MeasurementsTableNoldus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeasurementsTableNoldus.d.ts","sourceRoot":"","sources":["../../../src/components/MeasurementsTable/MeasurementsTableNoldus.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAmB9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,kCAAkC,CAAC;AAG1C,aAAK,4BAA4B,GAAG,IAAI,CACtC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,iBAAiB,CAAC,WAAW,EAAE,CAAC;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD;;OAEG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAiHF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,UAC3B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"MeasurementsTableNoldus.d.ts","sourceRoot":"","sources":["../../../src/components/MeasurementsTable/MeasurementsTableNoldus.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAyC,MAAM,OAAO,CAAC;AAmB9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,kCAAkC,CAAC;AAG1C,aAAK,4BAA4B,GAAG,IAAI,CACtC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,iBAAiB,CAAC,WAAW,EAAE,CAAC;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD;;OAEG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAiHF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,UAC3B,4BAA4B,sBAmOpC,CAAC"}
|