@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.
Files changed (113) hide show
  1. package/lib/AsyncSubject.d.ts +23 -23
  2. package/lib/AsyncSubject.js +64 -64
  3. package/lib/client/MeasurementDataClient.d.ts +135 -130
  4. package/lib/client/MeasurementDataClient.d.ts.map +1 -1
  5. package/lib/client/MeasurementDataClient.js +99 -99
  6. package/lib/client/MeasurementDataClient.js.map +1 -1
  7. package/lib/client/OnlineMeasurementDataClient.d.ts +44 -44
  8. package/lib/client/OnlineMeasurementDataClient.d.ts.map +1 -1
  9. package/lib/client/OnlineMeasurementDataClient.js +211 -211
  10. package/lib/client/OnlineMeasurementDataClient.js.map +1 -1
  11. package/lib/client/debug.d.ts +1 -1
  12. package/lib/client/debug.js +4 -4
  13. package/lib/client/index.d.ts +3 -3
  14. package/lib/client/index.js +3 -3
  15. package/lib/client/offline/OfflineMeasurementDataClient.d.ts +16 -16
  16. package/lib/client/offline/OfflineMeasurementDataClient.js +47 -47
  17. package/lib/client/offline/offline.d.ts +16 -16
  18. package/lib/client/offline/offline.js +82 -82
  19. package/lib/client/sbf.d.ts +35 -35
  20. package/lib/client/sbf.js +88 -88
  21. package/lib/client/signalviewer/SignalViewerDataClient.d.ts +37 -37
  22. package/lib/client/signalviewer/SignalViewerDataClient.d.ts.map +1 -1
  23. package/lib/client/signalviewer/SignalViewerDataClient.js +163 -164
  24. package/lib/client/signalviewer/SignalViewerDataClient.js.map +1 -1
  25. package/lib/client/signalviewer/SignalViewerDataClient.worker.d.ts +79 -73
  26. package/lib/client/signalviewer/SignalViewerDataClient.worker.d.ts.map +1 -1
  27. package/lib/client/signalviewer/SignalViewerDataClient.worker.js +342 -211
  28. package/lib/client/signalviewer/SignalViewerDataClient.worker.js.map +1 -1
  29. package/lib/components/Icon/CloseIcon.d.ts +6 -6
  30. package/lib/components/Icon/CloseIcon.js +24 -24
  31. package/lib/components/Icon/Icon.test.d.ts +1 -1
  32. package/lib/components/Icon/Icon.test.js +11 -11
  33. package/lib/components/MeasurementsChooser.d.ts +38 -38
  34. package/lib/components/MeasurementsChooser.d.ts.map +1 -1
  35. package/lib/components/MeasurementsChooser.js +178 -181
  36. package/lib/components/MeasurementsChooser.js.map +1 -1
  37. package/lib/components/MeasurementsModuleProvider.d.ts +34 -34
  38. package/lib/components/MeasurementsModuleProvider.d.ts.map +1 -1
  39. package/lib/components/MeasurementsModuleProvider.js +100 -79
  40. package/lib/components/MeasurementsModuleProvider.js.map +1 -1
  41. package/lib/components/MeasurementsTable/CheckboxCell.d.ts +35 -35
  42. package/lib/components/MeasurementsTable/CheckboxCell.js +28 -28
  43. package/lib/components/MeasurementsTable/ColorCell.d.ts +29 -29
  44. package/lib/components/MeasurementsTable/ColorCell.d.ts.map +1 -1
  45. package/lib/components/MeasurementsTable/ColorCell.js +58 -58
  46. package/lib/components/MeasurementsTable/ColorPicker.d.ts +6 -3
  47. package/lib/components/MeasurementsTable/ColorPicker.d.ts.map +1 -1
  48. package/lib/components/MeasurementsTable/ColorPicker.js +10 -10
  49. package/lib/components/MeasurementsTable/ColumnResizer.d.ts +4 -4
  50. package/lib/components/MeasurementsTable/ColumnResizer.js +5 -5
  51. package/lib/components/MeasurementsTable/ColumnSorting.d.ts +13 -13
  52. package/lib/components/MeasurementsTable/ColumnSorting.d.ts.map +1 -1
  53. package/lib/components/MeasurementsTable/ColumnSorting.js +10 -10
  54. package/lib/components/MeasurementsTable/MeasurementsTable.d.ts +72 -72
  55. package/lib/components/MeasurementsTable/MeasurementsTable.d.ts.map +1 -1
  56. package/lib/components/MeasurementsTable/MeasurementsTable.js +229 -217
  57. package/lib/components/MeasurementsTable/MeasurementsTable.js.map +1 -1
  58. package/lib/components/MeasurementsTable/MeasurementsTable.test.d.ts +1 -1
  59. package/lib/components/MeasurementsTable/MeasurementsTable.test.js +102 -102
  60. package/lib/components/MeasurementsTable/MeasurementsTableNoldus.d.ts +72 -72
  61. package/lib/components/MeasurementsTable/MeasurementsTableNoldus.d.ts.map +1 -1
  62. package/lib/components/MeasurementsTable/MeasurementsTableNoldus.js +193 -193
  63. package/lib/components/MeasurementsTable/SelectedContext.d.ts +10 -10
  64. package/lib/components/MeasurementsTable/SelectedContext.js +10 -10
  65. package/lib/components/MeasurementsTable/TextColumnFilter.d.ts +8 -8
  66. package/lib/components/MeasurementsTable/TextColumnFilter.d.ts.map +1 -1
  67. package/lib/components/MeasurementsTable/TextColumnFilter.js +15 -15
  68. package/lib/components/MeasurementsTable/filters.d.ts +3 -3
  69. package/lib/components/MeasurementsTable/filters.js +9 -9
  70. package/lib/components/MeasurementsTable/index.d.ts +2 -2
  71. package/lib/components/MeasurementsTable/index.js +2 -2
  72. package/lib/components/ModalMeasurementChooser.d.ts +19 -19
  73. package/lib/components/ModalMeasurementChooser.js +35 -35
  74. package/lib/conversion/UnitConversion.d.ts +13 -0
  75. package/lib/conversion/UnitConversion.d.ts.map +1 -0
  76. package/lib/conversion/UnitConversion.js +266 -0
  77. package/lib/conversion/UnitConversion.js.map +1 -0
  78. package/lib/hooks/useMarkerData.d.ts +6 -4
  79. package/lib/hooks/useMarkerData.d.ts.map +1 -1
  80. package/lib/hooks/useMarkerData.js +93 -63
  81. package/lib/hooks/useMarkerData.js.map +1 -1
  82. package/lib/hooks/useMeasurement.d.ts +41 -17
  83. package/lib/hooks/useMeasurement.d.ts.map +1 -1
  84. package/lib/hooks/useMeasurement.js +41 -41
  85. package/lib/hooks/useMeasurements.d.ts +11 -11
  86. package/lib/hooks/useMeasurements.js +22 -22
  87. package/lib/hooks/useMeasurementsModule.d.ts +20 -20
  88. package/lib/hooks/useMeasurementsModule.js +12 -12
  89. package/lib/hooks/useOverlayMeasurementData.d.ts +1 -1
  90. package/lib/hooks/useOverlayMeasurementData.js +23 -23
  91. package/lib/hooks/useTimedMeasurementData.d.ts +26 -26
  92. package/lib/hooks/useTimedMeasurementData.d.ts.map +1 -1
  93. package/lib/hooks/useTimedMeasurementData.js +125 -125
  94. package/lib/hooks/useTimedMeasurementData.js.map +1 -1
  95. package/lib/hooks/useWindowedMeasurementData.d.ts +25 -25
  96. package/lib/hooks/useWindowedMeasurementData.d.ts.map +1 -1
  97. package/lib/hooks/useWindowedMeasurementData.js +120 -120
  98. package/lib/hooks/useWindowedMeasurementData.js.map +1 -1
  99. package/lib/index.d.ts +15 -14
  100. package/lib/index.d.ts.map +1 -1
  101. package/lib/index.js +15 -14
  102. package/lib/index.js.map +1 -1
  103. package/lib/redux/measurements.slice.d.ts +75 -122
  104. package/lib/redux/measurements.slice.d.ts.map +1 -1
  105. package/lib/redux/measurements.slice.js +90 -89
  106. package/lib/redux/measurements.slice.js.map +1 -1
  107. package/lib/redux/reducer.d.ts +3 -10
  108. package/lib/redux/reducer.d.ts.map +1 -1
  109. package/lib/redux/reducer.js +2 -2
  110. package/lib/redux/reducer.js.map +1 -1
  111. package/lib/types.d.ts +93 -93
  112. package/lib/types.js +51 -51
  113. package/package.json +7 -10
@@ -1,35 +1,35 @@
1
- import React from "react";
2
- import { MeasurementDataClient } from "../client";
3
- import { measurementsAdapter, MeasurementsModuleState } from "../redux/measurements.slice";
4
- declare type MeasurementsModuleStateSelector = (state: any) => MeasurementsModuleState;
5
- declare type MeasurementsModuleValue = {
6
- client: MeasurementDataClient;
7
- selector: MeasurementsModuleStateSelector;
8
- entitiesSelectors: {
9
- measurements: ReturnType<typeof measurementsAdapter.getSelectors>;
10
- };
11
- };
12
- export declare const MeasurementsModuleContext: React.Context<MeasurementsModuleValue>;
13
- declare type MeasurementsModuleProviderProps = {
14
- /**
15
- * The selector to return the measurements module slice from the redux state.
16
- */
17
- selector: MeasurementsModuleStateSelector;
18
- /**
19
- * The MeasurementDataClient to use for retrieving metadata/measurement data.
20
- */
21
- client: MeasurementDataClient;
22
- };
23
- /**
24
- * Exposes the functionality contained in this module to its children components.
25
- *
26
- * Also takes care of performing requests for retrieving measurements metadata.
27
- *
28
- * TODO: Maybe this is not the best place for performing the requests for retrieving metadata.
29
- *
30
- * @param props
31
- * @returns
32
- */
33
- export declare const MeasurementsModuleProvider: React.FC<MeasurementsModuleProviderProps>;
34
- export {};
1
+ import React from "react";
2
+ import { MeasurementDataClient } from "../client";
3
+ import { measurementsAdapter, MeasurementsModuleState } from "../redux/measurements.slice";
4
+ declare type MeasurementsModuleStateSelector = (state: any) => MeasurementsModuleState;
5
+ declare type MeasurementsModuleValue = {
6
+ client: MeasurementDataClient;
7
+ selector: MeasurementsModuleStateSelector;
8
+ entitiesSelectors: {
9
+ measurements: ReturnType<typeof measurementsAdapter.getSelectors>;
10
+ };
11
+ };
12
+ export declare const MeasurementsModuleContext: React.Context<MeasurementsModuleValue>;
13
+ declare type MeasurementsModuleProviderProps = {
14
+ /**
15
+ * The selector to return the measurements module slice from the redux state.
16
+ */
17
+ selector: MeasurementsModuleStateSelector;
18
+ /**
19
+ * The MeasurementDataClient to use for retrieving metadata/measurement data.
20
+ */
21
+ client: MeasurementDataClient;
22
+ };
23
+ /**
24
+ * Exposes the functionality contained in this module to its children components.
25
+ *
26
+ * Also takes care of performing requests for retrieving measurements metadata.
27
+ *
28
+ * TODO: Maybe this is not the best place for performing the requests for retrieving metadata.
29
+ *
30
+ * @param props
31
+ * @returns
32
+ */
33
+ export declare const MeasurementsModuleProvider: React.FC<MeasurementsModuleProviderProps>;
34
+ export {};
35
35
  //# sourceMappingURL=MeasurementsModuleProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementsModuleProvider.d.ts","sourceRoot":"","sources":["../../src/components/MeasurementsModuleProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAGL,mBAAmB,EAGnB,uBAAuB,EAIxB,MAAM,6BAA6B,CAAC;AAErC,aAAK,+BAA+B,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,uBAAuB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AM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CA+E9E,CAAC"}
@@ -1,80 +1,101 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import React, { useEffect, useMemo } from "react";
11
- import { useDispatch, useSelector } from "react-redux";
12
- import { invalidate, measurementsAdapter, measurementsError, measurementsLoading, measurementsReceived, setGloballyUniqueMeasurementColors, setDataScale, } from "../redux/measurements.slice";
13
- export const MeasurementsModuleContext = React.createContext({});
14
- /**
15
- * Fetches all measurements for all given files using the provided client.
16
- * @param client The MeasurementDataClient used to retrieve measurement metadata.
17
- * @param files A list of files we want to retrieve measurements from.
18
- * @returns
19
- */
20
- function fetchMeasurementsForFiles(client, files) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- const promises = files.map((f) => client.fetchMetadata(f.path).then((measurements) => {
23
- return measurements.map((m) => (Object.assign(Object.assign(Object.assign({}, m), f.timing), { file: f.path, id: `${f.group}:${m.index.join("/")}` })));
24
- }));
25
- const all = yield Promise.all(promises);
26
- return all.reduce((acc, c) => acc.concat(c), []);
27
- });
28
- }
29
- /**
30
- * Exposes the functionality contained in this module to its children components.
31
- *
32
- * Also takes care of performing requests for retrieving measurements metadata.
33
- *
34
- * TODO: Maybe this is not the best place for performing the requests for retrieving metadata.
35
- *
36
- * @param props
37
- * @returns
38
- */
39
- export const MeasurementsModuleProvider = (props) => {
40
- const { selector, client, children } = props;
41
- const dispatch = useDispatch();
42
- const entitiesSelectors = useMemo(() => {
43
- return {
44
- measurements: measurementsAdapter.getSelectors(selector),
45
- };
46
- }, [selector]);
47
- const { files, loading, didInvalidate, globallyUniqueMeasurementColors, dataScale, } = useSelector((s) => {
48
- const state = selector(s);
49
- return state;
50
- });
51
- useEffect(() => {
52
- dispatch(invalidate);
53
- }, [dispatch, files]);
54
- useEffect(() => {
55
- if (files.length === 0 || !didInvalidate || loading)
56
- return;
57
- (function doFetchMeasurements() {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- dispatch(measurementsLoading());
60
- let measurements;
61
- try {
62
- measurements = yield fetchMeasurementsForFiles(client, files);
63
- }
64
- catch (err) {
65
- dispatch(measurementsError(err.message || "Something went wrong retrieving data"));
66
- return;
67
- }
68
- dispatch(measurementsReceived(measurements));
69
- });
70
- })();
71
- }, [files, didInvalidate, client, dispatch, loading]);
72
- useEffect(() => {
73
- dispatch(setGloballyUniqueMeasurementColors(globallyUniqueMeasurementColors));
74
- }, [dispatch, globallyUniqueMeasurementColors]);
75
- useEffect(() => {
76
- dispatch(setDataScale(dataScale));
77
- }, [dispatch, dataScale]);
78
- return (React.createElement(MeasurementsModuleContext.Provider, { value: { client, selector, entitiesSelectors } }, children));
79
- };
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import React, { useEffect, useMemo } from "react";
11
+ import { useDispatch, useSelector } from "react-redux";
12
+ import { invalidate, measurementsAdapter, measurementsError, measurementsLoading, measurementsReceived, setGloballyUniqueMeasurementColors, setDataScale, } from "../redux/measurements.slice";
13
+ export const MeasurementsModuleContext = React.createContext({});
14
+ /**
15
+ * Fetches all measurements for all given files using the provided client.
16
+ * @param client The MeasurementDataClient used to retrieve measurement metadata.
17
+ * @param files A list of files we want to retrieve measurements from.
18
+ * @returns
19
+ */
20
+ function fetchMeasurementsForFiles(client, files) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const promises = files.map((f) => client.fetchMetadata(f.path).then((measurementsData) => {
23
+ let measurements;
24
+ // if a file errors, don't throw an error, but return error and continue to be able to retrieve other files
25
+ if ("code" in measurementsData) {
26
+ if (measurementsData.code !== 200) {
27
+ return [{ error: f.path }];
28
+ }
29
+ else {
30
+ measurements = measurementsData.response;
31
+ }
32
+ }
33
+ else {
34
+ measurements = measurementsData;
35
+ }
36
+ return measurements.map((m) => (Object.assign(Object.assign(Object.assign({}, m), f.timing), { file: f.path, id: `${f.group}:${m.index.join("/")}` })));
37
+ }));
38
+ const all = yield Promise.all(promises);
39
+ return all.reduce((acc, c) => acc.concat(c), []);
40
+ });
41
+ }
42
+ /**
43
+ * Exposes the functionality contained in this module to its children components.
44
+ *
45
+ * Also takes care of performing requests for retrieving measurements metadata.
46
+ *
47
+ * TODO: Maybe this is not the best place for performing the requests for retrieving metadata.
48
+ *
49
+ * @param props
50
+ * @returns
51
+ */
52
+ export const MeasurementsModuleProvider = (props) => {
53
+ const { selector, client, children } = props;
54
+ const dispatch = useDispatch();
55
+ const entitiesSelectors = useMemo(() => {
56
+ return {
57
+ measurements: measurementsAdapter.getSelectors(selector),
58
+ };
59
+ }, [selector]);
60
+ const { files, loading, didInvalidate, globallyUniqueMeasurementColors, dataScale, } = useSelector((s) => {
61
+ const state = selector(s);
62
+ return state;
63
+ });
64
+ useEffect(() => {
65
+ dispatch(invalidate);
66
+ }, [dispatch, files]);
67
+ useEffect(() => {
68
+ if (files.length === 0 || !didInvalidate || loading)
69
+ return;
70
+ (function doFetchMeasurements() {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ dispatch(measurementsLoading());
73
+ let measurements = [];
74
+ try {
75
+ measurements = yield fetchMeasurementsForFiles(client, files);
76
+ }
77
+ catch (err) {
78
+ dispatch(measurementsError(err.message || "Something went wrong retrieving data"));
79
+ return;
80
+ }
81
+ // return measurements from files without errors
82
+ const loadedMeasurements = measurements.filter((m) => !("error" in m));
83
+ dispatch(measurementsReceived(loadedMeasurements));
84
+ // if one or multiple errors occurred, dispatch error message but return the corectly retrieved measurements
85
+ const errorMeasurements = measurements.filter((m) => "error" in m);
86
+ if (errorMeasurements.length > 0) {
87
+ dispatch(measurementsError(new Error("Error retrieving metadata for files: " +
88
+ errorMeasurements.map((m) => m.error).join(", "))));
89
+ }
90
+ });
91
+ })();
92
+ }, [files, didInvalidate, client, dispatch, loading]);
93
+ useEffect(() => {
94
+ dispatch(setGloballyUniqueMeasurementColors(globallyUniqueMeasurementColors));
95
+ }, [dispatch, globallyUniqueMeasurementColors]);
96
+ useEffect(() => {
97
+ dispatch(setDataScale(dataScale));
98
+ }, [dispatch, dataScale]);
99
+ return (React.createElement(MeasurementsModuleContext.Provider, { value: { client, selector, entitiesSelectors } }, children));
100
+ };
80
101
  //# sourceMappingURL=MeasurementsModuleProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementsModuleProvider.js","sourceRoot":"","sources":["../../src/components/MeasurementsModuleProvider.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,EAEL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EAEnB,oBAAoB,EACpB,kCAAkC,EAClC,YAAY,GACb,MAAM,6BAA6B,CAAC;AAYrC,MAAM,CAAC,MAAM,yBAAyB,GACpC,KAAK,CAAC,aAAa,CAA0B,EAA6B,CAAC,CAAC;AAE9E;;;;;GAKG;AAEH,SAAe,yBAAyB,C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,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IAE1B,OAAO,CACL,oBAAC,yBAAyB,CAAC,QAAQ,IACjC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAE7C,QAAQ,CAC0B,CACtC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,36 +1,36 @@
1
- import React from "react";
2
- declare type CheckboxCellProps = {
3
- /**
4
- * The id of the row.
5
- */
6
- id: string;
7
- rowToDisable: boolean;
8
- };
9
- declare type YAxisCheckboxCellProps = {
10
- /**
11
- * The id of the row.
12
- */
13
- yaxisLeftPos: string;
14
- };
15
- /**
16
- * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
17
- * selected rows.
18
- *
19
- * It will either render a radio (for single selection mode) or a checkbox (for multiple selection).
20
- *
21
- * @param props
22
- * @returns
23
- */
24
- export declare const CheckboxCell: React.FC<CheckboxCellProps>;
25
- /**
26
- * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
27
- * selected rows.
28
- *
29
- * It will render a radio.
30
- *
31
- * @param props
32
- * @returns
33
- */
34
- export declare const YAxisCheckboxCell: React.FC<YAxisCheckboxCellProps>;
35
- export {};
1
+ import React from "react";
2
+ declare type CheckboxCellProps = {
3
+ /**
4
+ * The id of the row.
5
+ */
6
+ id: string;
7
+ rowToDisable: boolean;
8
+ };
9
+ declare type YAxisCheckboxCellProps = {
10
+ /**
11
+ * The id of the row.
12
+ */
13
+ yaxisLeftPos: string;
14
+ };
15
+ /**
16
+ * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
17
+ * selected rows.
18
+ *
19
+ * It will either render a radio (for single selection mode) or a checkbox (for multiple selection).
20
+ *
21
+ * @param props
22
+ * @returns
23
+ */
24
+ export declare const CheckboxCell: React.FC<CheckboxCellProps>;
25
+ /**
26
+ * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
27
+ * selected rows.
28
+ *
29
+ * It will render a radio.
30
+ *
31
+ * @param props
32
+ * @returns
33
+ */
34
+ export declare const YAxisCheckboxCell: React.FC<YAxisCheckboxCellProps>;
35
+ export {};
36
36
  //# sourceMappingURL=CheckboxCell.d.ts.map
@@ -1,29 +1,29 @@
1
- import React, { useContext } from "react";
2
- import { SelectedContext } from "./SelectedContext";
3
- /**
4
- * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
5
- * selected rows.
6
- *
7
- * It will either render a radio (for single selection mode) or a checkbox (for multiple selection).
8
- *
9
- * @param props
10
- * @returns
11
- */
12
- export const CheckboxCell = ({ id, rowToDisable, }) => {
13
- const { selected, single } = useContext(SelectedContext);
14
- return (React.createElement("input", { type: single ? "radio" : "checkbox", checked: selected.indexOf(id) !== -1, onChange: () => { }, disabled: rowToDisable }));
15
- };
16
- /**
17
- * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
18
- * selected rows.
19
- *
20
- * It will render a radio.
21
- *
22
- * @param props
23
- * @returns
24
- */
25
- export const YAxisCheckboxCell = ({ yaxisLeftPos, }) => {
26
- const { selected } = useContext(SelectedContext);
27
- return (React.createElement("input", { type: "checkbox", checked: selected.indexOf(yaxisLeftPos) !== -1, onChange: () => { } }));
28
- };
1
+ import React, { useContext } from "react";
2
+ import { SelectedContext } from "./SelectedContext";
3
+ /**
4
+ * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
5
+ * selected rows.
6
+ *
7
+ * It will either render a radio (for single selection mode) or a checkbox (for multiple selection).
8
+ *
9
+ * @param props
10
+ * @returns
11
+ */
12
+ export const CheckboxCell = ({ id, rowToDisable, }) => {
13
+ const { selected, single } = useContext(SelectedContext);
14
+ return (React.createElement("input", { type: single ? "radio" : "checkbox", checked: selected.indexOf(id) !== -1, onChange: () => { }, disabled: rowToDisable }));
15
+ };
16
+ /**
17
+ * A component used in MeasurementTable to show if this row is selected. Uses SelectedContext to keep track of currently
18
+ * selected rows.
19
+ *
20
+ * It will render a radio.
21
+ *
22
+ * @param props
23
+ * @returns
24
+ */
25
+ export const YAxisCheckboxCell = ({ yaxisLeftPos, }) => {
26
+ const { selected } = useContext(SelectedContext);
27
+ return (React.createElement("input", { type: "checkbox", checked: selected.indexOf(yaxisLeftPos) !== -1, onChange: () => { } }));
28
+ };
29
29
  //# sourceMappingURL=CheckboxCell.js.map
@@ -1,30 +1,30 @@
1
- /**
2
- * Contains components to render a ColorCell inside the MeasurementsTable.
3
- */
4
- import React from "react";
5
- declare type ColorCellProps = {
6
- /**
7
- * The current color.
8
- */
9
- color?: string;
10
- /**
11
- * Called when another color is selected.
12
- */
13
- onChange?: (color: string) => void;
14
- /**
15
- * Should show color picker?
16
- */
17
- showColorPicker: boolean;
18
- /**
19
- * Triggered when colorpicker visibility is changed.
20
- */
21
- onChangeColorPickerVisibility: (shouldShow: boolean) => void;
22
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange">;
23
- /**
24
- * Displays a color input inside MeasurementsTable. Will display a color picker when clicked.
25
- * @param props
26
- * @returns
27
- */
28
- export declare const ColorCell: (props: ColorCellProps) => JSX.Element;
29
- export {};
1
+ /**
2
+ * Contains components to render a ColorCell inside the MeasurementsTable.
3
+ */
4
+ import React from "react";
5
+ declare type ColorCellProps = {
6
+ /**
7
+ * The current color.
8
+ */
9
+ color?: string;
10
+ /**
11
+ * Called when another color is selected.
12
+ */
13
+ onChange?: (color: string) => void;
14
+ /**
15
+ * Should show color picker?
16
+ */
17
+ showColorPicker: boolean;
18
+ /**
19
+ * Triggered when colorpicker visibility is changed.
20
+ */
21
+ onChangeColorPickerVisibility: (shouldShow: boolean) => void;
22
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange">;
23
+ /**
24
+ * Displays a color input inside MeasurementsTable. Will display a color picker when clicked.
25
+ * @param props
26
+ * @returns
27
+ */
28
+ export declare const ColorCell: (props: ColorCellProps) => React.JSX.Element;
29
+ export {};
30
30
  //# sourceMappingURL=ColorCell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorCell.d.ts","sourceRoot":"","sources":["../../../src/components/MeasurementsTable/ColorCell.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAkD,MAAM,OAAO,CAAC;AAqCvE,aAAK,cAAc,GAAG;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,6BAA6B,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAW3D;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAW,cAAc,gBAyD9C,CAAC"}
1
+ {"version":3,"file":"ColorCell.d.ts","sourceRoot":"","sources":["../../../src/components/MeasurementsTable/ColorCell.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAkD,MAAM,OAAO,CAAC;AAqCvE,aAAK,cAAc,GAAG;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,6BAA6B,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAW3D;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAW,cAAc,sBAyD9C,CAAC"}
@@ -1,65 +1,65 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- /**
13
- * Contains components to render a ColorCell inside the MeasurementsTable.
14
- */
15
- import React, { useRef, useState, useCallback, Suspense } from "react";
16
- import { Popout, IndeterminateLoadingIndicator, } from "@insync-stageplayer/ui-components";
17
- import styled from "styled-components";
18
- import useClickAway from "react-use/lib/useClickAway";
19
- import useDebounce from "react-use/lib/useDebounce";
20
- /**
21
- * A lazily loaded component. The ColorPicker uses an external library which is quite big.
22
- * So we want to use React.lazy so that we can split up the code in webpack.
23
- */
24
- const LoadingColorPicker = React.lazy(() => import("./ColorPicker"));
25
- /**
26
- * Will display a loading indicator while we're lazily loading ColorPicker.
27
- * @param props
28
- * @returns
29
- */
30
- const LoadableColorPicker = (props) => {
31
- return (React.createElement(Suspense, { fallback: React.createElement(IndeterminateLoadingIndicator, null, "Loading...") },
32
- React.createElement(LoadingColorPicker, Object.assign({}, props))));
33
- };
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ /**
13
+ * Contains components to render a ColorCell inside the MeasurementsTable.
14
+ */
15
+ import React, { useRef, useState, useCallback, Suspense } from "react";
16
+ import { Popout, IndeterminateLoadingIndicator, } from "@insync-stageplayer/ui-components";
17
+ import styled from "styled-components";
18
+ import useClickAway from "react-use/lib/useClickAway";
19
+ import useDebounce from "react-use/lib/useDebounce";
20
+ /**
21
+ * A lazily loaded component. The ColorPicker uses an external library which is quite big.
22
+ * So we want to use React.lazy so that we can split up the code in webpack.
23
+ */
24
+ const LoadingColorPicker = React.lazy(() => import("./ColorPicker"));
25
+ /**
26
+ * Will display a loading indicator while we're lazily loading ColorPicker.
27
+ * @param props
28
+ * @returns
29
+ */
30
+ const LoadableColorPicker = (props) => {
31
+ return (React.createElement(Suspense, { fallback: React.createElement(IndeterminateLoadingIndicator, null, "Loading...") },
32
+ React.createElement(LoadingColorPicker, Object.assign({}, props))));
33
+ };
34
34
  const StyledDiv = styled.div `
35
35
  height: 1em;
36
36
  width: 1em;
37
37
  border-radius: 0.2em;
38
38
  cursor: pointer;
39
39
  background-color: ${(props) => props.color ? props.color : props.theme.colors.action.active};
40
- `;
41
- /**
42
- * Displays a color input inside MeasurementsTable. Will display a color picker when clicked.
43
- * @param props
44
- * @returns
45
- */
46
- export const ColorCell = (props) => {
47
- const { color, onChange, onChangeColorPickerVisibility, showColorPicker } = props, rest = __rest(props, ["color", "onChange", "onChangeColorPickerVisibility", "showColorPicker"]);
48
- const pickerRef = useRef(null);
49
- const [changedColor, setChangedColor] = useState(undefined);
50
- const handleColorChange = useCallback((v) => {
51
- setChangedColor(v.hex);
52
- }, []);
53
- useClickAway(pickerRef, () => {
54
- onChangeColorPickerVisibility(false);
55
- });
56
- // Debounce the onChange callback, otherwise might result in many unneccesary rerenders.
57
- useDebounce(() => {
58
- if (changedColor && onChange) {
59
- onChange && onChange(changedColor);
60
- }
61
- }, 250, [changedColor]);
62
- return (React.createElement(Popout, { content: React.createElement("div", { ref: pickerRef },
63
- React.createElement(LoadableColorPicker, { onChange: handleColorChange, disableAlpha: true, color: changedColor || color })), visible: showColorPicker }, ({ ref: popoutRef }) => (React.createElement(StyledDiv, Object.assign({ ref: popoutRef, color: changedColor || color, tabIndex: 0, role: "button", "aria-pressed": "false", onFocus: () => onChangeColorPickerVisibility(true) }, rest)))));
64
- };
40
+ `;
41
+ /**
42
+ * Displays a color input inside MeasurementsTable. Will display a color picker when clicked.
43
+ * @param props
44
+ * @returns
45
+ */
46
+ export const ColorCell = (props) => {
47
+ const { color, onChange, onChangeColorPickerVisibility, showColorPicker } = props, rest = __rest(props, ["color", "onChange", "onChangeColorPickerVisibility", "showColorPicker"]);
48
+ const pickerRef = useRef(null);
49
+ const [changedColor, setChangedColor] = useState(undefined);
50
+ const handleColorChange = useCallback((v) => {
51
+ setChangedColor(v.hex);
52
+ }, []);
53
+ useClickAway(pickerRef, () => {
54
+ onChangeColorPickerVisibility(false);
55
+ });
56
+ // Debounce the onChange callback, otherwise might result in many unneccesary rerenders.
57
+ useDebounce(() => {
58
+ if (changedColor && onChange) {
59
+ onChange && onChange(changedColor);
60
+ }
61
+ }, 250, [changedColor]);
62
+ return (React.createElement(Popout, { content: React.createElement("div", { ref: pickerRef },
63
+ React.createElement(LoadableColorPicker, { onChange: handleColorChange, disableAlpha: true, color: changedColor || color })), visible: showColorPicker }, ({ ref: popoutRef }) => (React.createElement(StyledDiv, Object.assign({ ref: popoutRef, color: changedColor || color, tabIndex: 0, role: "button", "aria-pressed": "false", onFocus: () => onChangeColorPickerVisibility(true) }, rest)))));
64
+ };
65
65
  //# sourceMappingURL=ColorCell.js.map
@@ -1,4 +1,7 @@
1
- /// <reference types="react" />
2
- declare const ColorPicker: (props: any) => JSX.Element;
3
- export default ColorPicker;
1
+ /**
2
+ * A wrapper around react-color library.
3
+ */
4
+ import React from "react";
5
+ declare const ColorPicker: (props: any) => React.JSX.Element;
6
+ export default ColorPicker;
4
7
  //# sourceMappingURL=ColorPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/MeasurementsTable/ColorPicker.tsx"],"names":[],"mappings":";AAMA,QAAA,MAAM,WAAW,UAAW,GAAG,gBAM9B,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/MeasurementsTable/ColorPicker.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,WAAW,UAAW,GAAG,sBAM9B,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,11 +1,11 @@
1
- /**
2
- * A wrapper around react-color library.
3
- */
4
- import React from "react";
5
- import { ChromePicker } from "react-color";
6
- const ColorPicker = (props) => {
7
- return (React.createElement("div", { style: { zIndex: 9999 } },
8
- React.createElement(ChromePicker, Object.assign({}, props))));
9
- };
10
- export default ColorPicker;
1
+ /**
2
+ * A wrapper around react-color library.
3
+ */
4
+ import React from "react";
5
+ import { ChromePicker } from "react-color";
6
+ const ColorPicker = (props) => {
7
+ return (React.createElement("div", { style: { zIndex: 9999 } },
8
+ React.createElement(ChromePicker, Object.assign({}, props))));
9
+ };
10
+ export default ColorPicker;
11
11
  //# sourceMappingURL=ColorPicker.js.map