@insync-stageplayer/measurements 0.4.5 → 0.4.8

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 (85) hide show
  1. package/lib/AsyncSubject.d.ts +23 -23
  2. package/lib/AsyncSubject.js +64 -64
  3. package/lib/client/MeasurementDataClient.d.ts +124 -124
  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 +42 -42
  8. package/lib/client/OnlineMeasurementDataClient.d.ts.map +1 -1
  9. package/lib/client/OnlineMeasurementDataClient.js +166 -166
  10. package/lib/client/OnlineMeasurementDataClient.js.map +1 -1
  11. package/lib/client/debug.d.ts +1 -1
  12. package/lib/client/debug.d.ts.map +1 -1
  13. package/lib/client/debug.js +4 -4
  14. package/lib/client/debug.js.map +1 -1
  15. package/lib/client/index.d.ts +2 -2
  16. package/lib/client/index.js +2 -2
  17. package/lib/client/offline/OfflineMeasurementDataClient.d.ts +14 -14
  18. package/lib/client/offline/OfflineMeasurementDataClient.js +41 -41
  19. package/lib/client/offline/offline.d.ts +16 -16
  20. package/lib/client/offline/offline.js +79 -79
  21. package/lib/client/sbf.d.ts +34 -34
  22. package/lib/client/sbf.js +88 -88
  23. package/lib/components/MeasurementsChooser.d.ts +34 -34
  24. package/lib/components/MeasurementsChooser.d.ts.map +1 -1
  25. package/lib/components/MeasurementsChooser.js +95 -88
  26. package/lib/components/MeasurementsChooser.js.map +1 -1
  27. package/lib/components/MeasurementsModuleProvider.d.ts +34 -34
  28. package/lib/components/MeasurementsModuleProvider.d.ts.map +1 -1
  29. package/lib/components/MeasurementsModuleProvider.js +73 -73
  30. package/lib/components/MeasurementsModuleProvider.js.map +1 -1
  31. package/lib/components/MeasurementsTable/CheckboxCell.d.ts +18 -18
  32. package/lib/components/MeasurementsTable/CheckboxCell.js +15 -15
  33. package/lib/components/MeasurementsTable/ColorCell.d.ts +29 -29
  34. package/lib/components/MeasurementsTable/ColorCell.js +57 -57
  35. package/lib/components/MeasurementsTable/ColorPicker.d.ts +3 -3
  36. package/lib/components/MeasurementsTable/ColorPicker.js +10 -10
  37. package/lib/components/MeasurementsTable/ColumnResizer.d.ts +4 -4
  38. package/lib/components/MeasurementsTable/ColumnResizer.js +5 -5
  39. package/lib/components/MeasurementsTable/ColumnSorting.d.ts +13 -13
  40. package/lib/components/MeasurementsTable/ColumnSorting.js +9 -9
  41. package/lib/components/MeasurementsTable/MeasurementsTable.d.ts +55 -55
  42. package/lib/components/MeasurementsTable/MeasurementsTable.d.ts.map +1 -1
  43. package/lib/components/MeasurementsTable/MeasurementsTable.js +182 -180
  44. package/lib/components/MeasurementsTable/MeasurementsTable.js.map +1 -1
  45. package/lib/components/MeasurementsTable/SelectedContext.d.ts +9 -9
  46. package/lib/components/MeasurementsTable/SelectedContext.js +9 -9
  47. package/lib/components/MeasurementsTable/TextColumnFilter.d.ts +8 -8
  48. package/lib/components/MeasurementsTable/TextColumnFilter.d.ts.map +1 -1
  49. package/lib/components/MeasurementsTable/TextColumnFilter.js +15 -15
  50. package/lib/components/MeasurementsTable/TextColumnFilter.js.map +1 -1
  51. package/lib/components/MeasurementsTable/filters.d.ts +2 -2
  52. package/lib/components/MeasurementsTable/filters.js +9 -9
  53. package/lib/components/MeasurementsTable/index.d.ts +1 -1
  54. package/lib/components/MeasurementsTable/index.js +1 -1
  55. package/lib/components/ModalMeasurementChooser.d.ts +19 -19
  56. package/lib/components/ModalMeasurementChooser.d.ts.map +1 -1
  57. package/lib/components/ModalMeasurementChooser.js +29 -29
  58. package/lib/components/ModalMeasurementChooser.js.map +1 -1
  59. package/lib/hooks/useDataScaleValue.d.ts +3 -0
  60. package/lib/hooks/useDataScaleValue.d.ts.map +1 -0
  61. package/lib/hooks/useDataScaleValue.js +9 -0
  62. package/lib/hooks/useDataScaleValue.js.map +1 -0
  63. package/lib/hooks/useMeasurement.d.ts +17 -17
  64. package/lib/hooks/useMeasurement.js +41 -41
  65. package/lib/hooks/useMeasurements.d.ts +9 -9
  66. package/lib/hooks/useMeasurements.js +16 -16
  67. package/lib/hooks/useMeasurementsModule.d.ts +18 -18
  68. package/lib/hooks/useMeasurementsModule.js +12 -12
  69. package/lib/hooks/useTimedMeasurementData.d.ts +26 -26
  70. package/lib/hooks/useTimedMeasurementData.d.ts.map +1 -1
  71. package/lib/hooks/useTimedMeasurementData.js +123 -125
  72. package/lib/hooks/useTimedMeasurementData.js.map +1 -1
  73. package/lib/hooks/useWindowedMeasurementData.d.ts +25 -25
  74. package/lib/hooks/useWindowedMeasurementData.js +119 -119
  75. package/lib/index.d.ts +12 -12
  76. package/lib/index.js +12 -12
  77. package/lib/redux/measurements.slice.d.ts +107 -107
  78. package/lib/redux/measurements.slice.d.ts.map +1 -1
  79. package/lib/redux/measurements.slice.js +71 -71
  80. package/lib/redux/measurements.slice.js.map +1 -1
  81. package/lib/redux/reducer.d.ts +8 -8
  82. package/lib/redux/reducer.js +2 -2
  83. package/lib/types.d.ts +65 -65
  84. package/lib/types.js +46 -46
  85. package/package.json +6 -6
@@ -1,80 +1,80 @@
1
- /**
2
- * Contains functions that use [sbfreader](https://www.npmjs.com/package/sbfreader) to connect to native HDF5/SBF lib.
3
- *
4
- * This is used in the offline stageplayer.
5
- */
6
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
- return new (P || (P = Promise))(function (resolve, reject) {
9
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
- step((generator = generator.apply(thisArg, _arguments || [])).next());
13
- });
14
- };
15
- var __rest = (this && this.__rest) || function (s, e) {
16
- var t = {};
17
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
18
- t[p] = s[p];
19
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
20
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
21
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
22
- t[p[i]] = s[p[i]];
23
- }
24
- return t;
25
- };
26
- // Wrapper around sbfreader, catches errors thrown when HDF5 is not installed.
27
- const getReader = (() => {
28
- let module;
29
- let error;
30
- try {
31
- // eslint-disable-next-line global-require
32
- module = require("sbfreader");
33
- }
34
- catch (err) {
35
- error = new Error("Could not load data reader, please make sure HDF5 1.10.2 is installed.");
36
- }
37
- return () => {
38
- if (error) {
39
- throw error;
40
- }
41
- return module;
42
- };
43
- })();
44
- /**
45
- * Fetches metadata for a HDF/SBF file.
46
- * @param {string} path The file we're retrieving data from.
47
- */
48
- export const fetchMetadata = (path) => __awaiter(void 0, void 0, void 0, function* () {
49
- const fixedPath = path.replace("file://", "");
50
- const response = yield getReader().getDataInfo(fixedPath);
51
- const { datasets = [] } = response;
52
- const result = datasets.map((s) => (Object.assign(Object.assign({}, s), { id: s.name, file: s.hdf5, index: s.index.split("/") })));
53
- return result;
54
- });
55
- /**
56
- * @typedef {Object} FetchDataOptions
57
- * @property {string[]} measurements The measurement we're retrieving data for.
58
- * @property {number} offset
59
- * @property {number} limit
60
- * @property {string} file The file we're retrieving data for.
61
- */
62
- /**
63
- * Fetches data from a measurement file. Contains some hacks to be compatible with sbfreader.
64
- * @param {FetchDataOptions} options
65
- * @returns {Promise<{[key: string]: [number, number][]}>}
66
- */
67
- export const fetchData = (options) => __awaiter(void 0, void 0, void 0, function* () {
68
- const { measurements, offset, limit = 0, file, rows } = options, rest = __rest(options, ["measurements", "offset", "limit", "file", "rows"]);
69
- const libArgs = Object.assign(Object.assign({}, rest), { file: file.replace("file://", ""), streams: measurements.map((id) => ({ id })), resolution: rows === 1 ? undefined : rows, start: offset / 1000,
70
- // sbfreader doesn't like limit of 0.
71
- end: (offset + (limit <= 0 ? 1000000 : limit)) / 1000 });
72
- return getReader()
73
- .getData(libArgs)
74
- .then(({ streams }) => {
75
- return streams.reduce((acc, { name, data }) => (Object.assign(Object.assign({}, acc), { [name]: data
76
- .filter(([x, y]) => !!y)
77
- .map((entry) => [entry[0] * 1000, entry[1]]) })), {});
78
- });
79
- });
1
+ /**
2
+ * Contains functions that use [sbfreader](https://www.npmjs.com/package/sbfreader) to connect to native HDF5/SBF lib.
3
+ *
4
+ * This is used in the offline stageplayer.
5
+ */
6
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
+ return new (P || (P = Promise))(function (resolve, reject) {
9
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
13
+ });
14
+ };
15
+ var __rest = (this && this.__rest) || function (s, e) {
16
+ var t = {};
17
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
18
+ t[p] = s[p];
19
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
20
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
21
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
22
+ t[p[i]] = s[p[i]];
23
+ }
24
+ return t;
25
+ };
26
+ // Wrapper around sbfreader, catches errors thrown when HDF5 is not installed.
27
+ const getReader = (() => {
28
+ let module;
29
+ let error;
30
+ try {
31
+ // eslint-disable-next-line global-require
32
+ module = require("sbfreader");
33
+ }
34
+ catch (err) {
35
+ error = new Error("Could not load data reader, please make sure HDF5 1.10.2 is installed.");
36
+ }
37
+ return () => {
38
+ if (error) {
39
+ throw error;
40
+ }
41
+ return module;
42
+ };
43
+ })();
44
+ /**
45
+ * Fetches metadata for a HDF/SBF file.
46
+ * @param {string} path The file we're retrieving data from.
47
+ */
48
+ export const fetchMetadata = (path) => __awaiter(void 0, void 0, void 0, function* () {
49
+ const fixedPath = path.replace("file://", "");
50
+ const response = yield getReader().getDataInfo(fixedPath);
51
+ const { datasets = [] } = response;
52
+ const result = datasets.map((s) => (Object.assign(Object.assign({}, s), { id: s.name, file: s.hdf5, index: s.index.split("/") })));
53
+ return result;
54
+ });
55
+ /**
56
+ * @typedef {Object} FetchDataOptions
57
+ * @property {string[]} measurements The measurement we're retrieving data for.
58
+ * @property {number} offset
59
+ * @property {number} limit
60
+ * @property {string} file The file we're retrieving data for.
61
+ */
62
+ /**
63
+ * Fetches data from a measurement file. Contains some hacks to be compatible with sbfreader.
64
+ * @param {FetchDataOptions} options
65
+ * @returns {Promise<{[key: string]: [number, number][]}>}
66
+ */
67
+ export const fetchData = (options) => __awaiter(void 0, void 0, void 0, function* () {
68
+ const { measurements, offset, limit = 0, file, rows } = options, rest = __rest(options, ["measurements", "offset", "limit", "file", "rows"]);
69
+ const libArgs = Object.assign(Object.assign({}, rest), { file: file.replace("file://", ""), streams: measurements.map((id) => ({ id })), resolution: rows === 1 ? undefined : rows, start: offset / 1000,
70
+ // sbfreader doesn't like limit of 0.
71
+ end: (offset + (limit <= 0 ? 1000000 : limit)) / 1000 });
72
+ return getReader()
73
+ .getData(libArgs)
74
+ .then(({ streams }) => {
75
+ return streams.reduce((acc, { name, data }) => (Object.assign(Object.assign({}, acc), { [name]: data
76
+ .filter(([x, y]) => !!y)
77
+ .map((entry) => [entry[0] * 1000, entry[1]]) })), {});
78
+ });
79
+ });
80
80
  //# sourceMappingURL=offline.js.map
@@ -1,35 +1,35 @@
1
- import { MeasurementsTypes } from "../types";
2
- /**
3
- * Fetches measurement metadata for a given SBF.
4
- *
5
- * @param endpoint Endpoint to send request to.
6
- * @param file File to return measurement metadata from.
7
- * @returns
8
- */
9
- export declare const fetchDataMetadata: (endpoint: string, file: string) => Promise<{
10
- name: string;
11
- index: string[];
12
- unit: string;
13
- min: number;
14
- max: number;
15
- frequency: number;
16
- file: string;
17
- id: string;
18
- }[]>;
19
- declare type FetchDataOptions = {
20
- file: string;
21
- offset: number;
22
- limit?: number;
23
- rows?: number;
24
- measurements: string[];
25
- };
26
- /**
27
- * Fetch measurement data from a SBF.
28
- *
29
- * @param endpoint The endpoint to retrieve SBF data from.
30
- * @param options The options for retrieving data.
31
- * @returns
32
- */
33
- export declare const fetchData: (endpoint: string, options: FetchDataOptions) => Promise<MeasurementsTypes.DataMap>;
34
- export {};
1
+ import { MeasurementsTypes } from "../types";
2
+ /**
3
+ * Fetches measurement metadata for a given SBF.
4
+ *
5
+ * @param endpoint Endpoint to send request to.
6
+ * @param file File to return measurement metadata from.
7
+ * @returns
8
+ */
9
+ export declare const fetchDataMetadata: (endpoint: string, file: string) => Promise<{
10
+ name: string;
11
+ index: string[];
12
+ unit: string;
13
+ min: number;
14
+ max: number;
15
+ frequency: number;
16
+ file: string;
17
+ id: string;
18
+ }[]>;
19
+ declare type FetchDataOptions = {
20
+ file: string;
21
+ offset: number;
22
+ limit?: number;
23
+ rows?: number;
24
+ measurements: string[];
25
+ };
26
+ /**
27
+ * Fetch measurement data from a SBF.
28
+ *
29
+ * @param endpoint The endpoint to retrieve SBF data from.
30
+ * @param options The options for retrieving data.
31
+ * @returns
32
+ */
33
+ export declare const fetchData: (endpoint: string, options: FetchDataOptions) => Promise<MeasurementsTypes.DataMap>;
34
+ export {};
35
35
  //# sourceMappingURL=sbf.d.ts.map
package/lib/client/sbf.js CHANGED
@@ -1,89 +1,89 @@
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
- /**
11
- * This takes the result from the fetch() call and throws an error if the response not ok.
12
- * @param r A response from fetch()
13
- * @returns
14
- */
15
- const handleDataServerResponse = (r) => {
16
- if (!r.ok)
17
- throw new Error(`Got HTTP error: "${r.status}: ${r.statusText}"`);
18
- return r.json();
19
- };
20
- /**
21
- * Fetches measurement metadata for a given SBF.
22
- *
23
- * @param endpoint Endpoint to send request to.
24
- * @param file File to return measurement metadata from.
25
- * @returns
26
- */
27
- export const fetchDataMetadata = (endpoint, file) => __awaiter(void 0, void 0, void 0, function* () {
28
- var _a;
29
- const args = {
30
- headers: {
31
- Accept: "application/json",
32
- "Content-Type": "application/json",
33
- "X-Files": file,
34
- },
35
- method: "POST",
36
- credentials: "include",
37
- body: JSON.stringify({
38
- getMeta: {
39
- files: [file],
40
- },
41
- }),
42
- };
43
- const response = yield fetch(endpoint, args);
44
- const json = (yield handleDataServerResponse(response));
45
- const measurements = ((_a = json.metadata[0]) === null || _a === void 0 ? void 0 : _a.streams) || [];
46
- return measurements.map((m) => (Object.assign({ file, id: m.name }, m)));
47
- });
48
- /**
49
- * Fetch measurement data from a SBF.
50
- *
51
- * @param endpoint The endpoint to retrieve SBF data from.
52
- * @param options The options for retrieving data.
53
- * @returns
54
- */
55
- export const fetchData = (endpoint, options) => __awaiter(void 0, void 0, void 0, function* () {
56
- var _b;
57
- // We don't support fetching a single point in SBF's. We return an empty result instead.
58
- if (!options.limit === undefined) {
59
- return options.measurements.reduce((acc, c) => (Object.assign(Object.assign({}, acc), { [c]: [[options.offset, "NaN"]] })), {});
60
- }
61
- const sbfArgs = {
62
- getData: {
63
- file: options.file,
64
- start: options.offset,
65
- end: options.offset + (options.limit || 0),
66
- streams: options.measurements,
67
- resolution: options.rows,
68
- },
69
- };
70
- const body = JSON.stringify([sbfArgs]);
71
- const fetchArgs = {
72
- headers: {
73
- Accept: "application/json",
74
- "Content-Type": "application/json",
75
- "X-Files": options.file,
76
- },
77
- credentials: "include",
78
- method: "POST",
79
- body,
80
- };
81
- const response = yield fetch(endpoint, fetchArgs);
82
- const allMeasurements = (yield handleDataServerResponse(response));
83
- const measurements = ((_b = allMeasurements[0]) === null || _b === void 0 ? void 0 : _b.streams) || [];
84
- return measurements.reduce((acc, c) => {
85
- const { name, data } = c;
86
- return Object.assign(Object.assign({}, acc), { [name]: data });
87
- }, {});
88
- });
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
+ /**
11
+ * This takes the result from the fetch() call and throws an error if the response not ok.
12
+ * @param r A response from fetch()
13
+ * @returns
14
+ */
15
+ const handleDataServerResponse = (r) => {
16
+ if (!r.ok)
17
+ throw new Error(`Got HTTP error: "${r.status}: ${r.statusText}"`);
18
+ return r.json();
19
+ };
20
+ /**
21
+ * Fetches measurement metadata for a given SBF.
22
+ *
23
+ * @param endpoint Endpoint to send request to.
24
+ * @param file File to return measurement metadata from.
25
+ * @returns
26
+ */
27
+ export const fetchDataMetadata = (endpoint, file) => __awaiter(void 0, void 0, void 0, function* () {
28
+ var _a;
29
+ const args = {
30
+ headers: {
31
+ Accept: "application/json",
32
+ "Content-Type": "application/json",
33
+ "X-Files": file,
34
+ },
35
+ method: "POST",
36
+ credentials: "include",
37
+ body: JSON.stringify({
38
+ getMeta: {
39
+ files: [file],
40
+ },
41
+ }),
42
+ };
43
+ const response = yield fetch(endpoint, args);
44
+ const json = (yield handleDataServerResponse(response));
45
+ const measurements = ((_a = json.metadata[0]) === null || _a === void 0 ? void 0 : _a.streams) || [];
46
+ return measurements.map((m) => (Object.assign({ file, id: m.name }, m)));
47
+ });
48
+ /**
49
+ * Fetch measurement data from a SBF.
50
+ *
51
+ * @param endpoint The endpoint to retrieve SBF data from.
52
+ * @param options The options for retrieving data.
53
+ * @returns
54
+ */
55
+ export const fetchData = (endpoint, options) => __awaiter(void 0, void 0, void 0, function* () {
56
+ var _b;
57
+ // We don't support fetching a single point in SBF's. We return an empty result instead.
58
+ if (!options.limit === undefined) {
59
+ return options.measurements.reduce((acc, c) => (Object.assign(Object.assign({}, acc), { [c]: [[options.offset, "NaN"]] })), {});
60
+ }
61
+ const sbfArgs = {
62
+ getData: {
63
+ file: options.file,
64
+ start: options.offset,
65
+ end: options.offset + (options.limit || 0),
66
+ streams: options.measurements,
67
+ resolution: options.rows,
68
+ },
69
+ };
70
+ const body = JSON.stringify([sbfArgs]);
71
+ const fetchArgs = {
72
+ headers: {
73
+ Accept: "application/json",
74
+ "Content-Type": "application/json",
75
+ "X-Files": options.file,
76
+ },
77
+ credentials: "include",
78
+ method: "POST",
79
+ body,
80
+ };
81
+ const response = yield fetch(endpoint, fetchArgs);
82
+ const allMeasurements = (yield handleDataServerResponse(response));
83
+ const measurements = ((_b = allMeasurements[0]) === null || _b === void 0 ? void 0 : _b.streams) || [];
84
+ return measurements.reduce((acc, c) => {
85
+ const { name, data } = c;
86
+ return Object.assign(Object.assign({}, acc), { [name]: data });
87
+ }, {});
88
+ });
89
89
  //# sourceMappingURL=sbf.js.map
@@ -1,35 +1,35 @@
1
- import React from "react";
2
- export declare type MeasurementsChooserProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
3
- /**
4
- * If set to true only a single measurement can be selected.
5
- */
6
- single?: boolean;
7
- /**
8
- * The selected measurements.
9
- */
10
- selected?: string[];
11
- /**
12
- * Called whenever a measurement is selected.
13
- *
14
- * @param {string[]} newSelected The newly selected measurements.
15
- */
16
- onChange: (newSelected: string[]) => void;
17
- /**
18
- * Function used to generate a new color for a measurements.
19
- */
20
- generateColor?: () => string;
21
- };
22
- /**
23
- * A component that provides functionality to select measurements. The measurements are grouped
24
- * per file, and displayed inside a table.
25
- *
26
- * The selected measurements should be kept in a separate state, this is a controlled components.
27
- *
28
- * Whenever a measurement is selected, it will check if a measurement has a color. If it doesn't have
29
- * a color yet, it will create a new color, and update the existing measurement.
30
- *
31
- * @param props
32
- * @returns
33
- */
34
- export declare const MeasurementsChooser: React.FC<MeasurementsChooserProps>;
1
+ import React from "react";
2
+ export declare type MeasurementsChooserProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
3
+ /**
4
+ * If set to true only a single measurement can be selected.
5
+ */
6
+ single?: boolean;
7
+ /**
8
+ * The selected measurements.
9
+ */
10
+ selected?: string[];
11
+ /**
12
+ * Called whenever a measurement is selected.
13
+ *
14
+ * @param {string[]} newSelected The newly selected measurements.
15
+ */
16
+ onChange: (newSelected: string[]) => void;
17
+ /**
18
+ * Function used to generate a new color for a measurements.
19
+ */
20
+ generateColor?: () => string;
21
+ };
22
+ /**
23
+ * A component that provides functionality to select measurements. The measurements are grouped
24
+ * per file, and displayed inside a table.
25
+ *
26
+ * The selected measurements should be kept in a separate state, this is a controlled components.
27
+ *
28
+ * Whenever a measurement is selected, it will check if a measurement has a color. If it doesn't have
29
+ * a color yet, it will create a new color, and update the existing measurement.
30
+ *
31
+ * @param props
32
+ * @returns
33
+ */
34
+ export declare const MeasurementsChooser: React.FC<MeasurementsChooserProps>;
35
35
  //# sourceMappingURL=MeasurementsChooser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementsChooser.d.ts","sourceRoot":"","sources":["../../src/components/MeasurementsChooser.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,oBAAY,wBAAwB,GAAG,IAAI,CACzC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA6GlE,CAAC"}
1
+ {"version":3,"file":"MeasurementsChooser.d.ts","sourceRoot":"","sources":["../../src/components/MeasurementsChooser.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAYrD,oBAAY,wBAAwB,GAAG,IAAI,CACzC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuHlE,CAAC"}