@trackunit/filters-graphql-hook 1.9.65 → 1.9.68
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/index.cjs.js +5 -5
- package/index.esm.js +6 -6
- package/package.json +10 -10
package/index.cjs.js
CHANGED
|
@@ -72,20 +72,20 @@ values, outputTypeRecord) => {
|
|
|
72
72
|
}
|
|
73
73
|
if (filtersFilterBar.isStringArrayFilterValue(values)) {
|
|
74
74
|
const result = values.map(value => {
|
|
75
|
-
const valuesFromOutput =
|
|
75
|
+
const valuesFromOutput = sharedUtils.objectValues(outputTypeRecord);
|
|
76
76
|
const convertedValue = valuesFromOutput.find(v => value === v);
|
|
77
77
|
if (!convertedValue) {
|
|
78
|
-
throw Error(`Unknown value: ${value} expect one of: ${JSON.stringify(
|
|
78
|
+
throw Error(`Unknown value: ${value} expect one of: ${JSON.stringify(sharedUtils.objectValues(outputTypeRecord))}`);
|
|
79
79
|
}
|
|
80
80
|
return convertedValue;
|
|
81
81
|
});
|
|
82
82
|
return result.filter(sharedUtils.truthy);
|
|
83
83
|
}
|
|
84
84
|
if (isStringFilterValue(values)) {
|
|
85
|
-
const valuesFromOutput =
|
|
85
|
+
const valuesFromOutput = sharedUtils.objectValues(outputTypeRecord);
|
|
86
86
|
const convertedValue = valuesFromOutput.find(v => values === v);
|
|
87
87
|
if (!convertedValue) {
|
|
88
|
-
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(
|
|
88
|
+
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(sharedUtils.objectValues(outputTypeRecord))}`);
|
|
89
89
|
}
|
|
90
90
|
return [convertedValue];
|
|
91
91
|
}
|
|
@@ -104,7 +104,7 @@ const fixType = (values, outputTypeRecord) => {
|
|
|
104
104
|
}
|
|
105
105
|
const convertedValue = outputTypeRecord[values];
|
|
106
106
|
if (!convertedValue) {
|
|
107
|
-
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(
|
|
107
|
+
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(sharedUtils.objectValues(outputTypeRecord))}`);
|
|
108
108
|
}
|
|
109
109
|
return convertedValue;
|
|
110
110
|
};
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations } from '@trackunit/i18n-library-translation';
|
|
3
3
|
import { isStringArrayFilterValue, isMinMaxFilterValue, isDateRangeValue, isBooleanValue } from '@trackunit/filters-filter-bar';
|
|
4
|
-
import { truthy } from '@trackunit/shared-utils';
|
|
4
|
+
import { objectValues, truthy } from '@trackunit/shared-utils';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { useCurrentUserSystemOfMeasurement, useAssetSorting } from '@trackunit/react-core-hooks';
|
|
7
7
|
import { useMemo } from 'react';
|
|
@@ -70,20 +70,20 @@ values, outputTypeRecord) => {
|
|
|
70
70
|
}
|
|
71
71
|
if (isStringArrayFilterValue(values)) {
|
|
72
72
|
const result = values.map(value => {
|
|
73
|
-
const valuesFromOutput =
|
|
73
|
+
const valuesFromOutput = objectValues(outputTypeRecord);
|
|
74
74
|
const convertedValue = valuesFromOutput.find(v => value === v);
|
|
75
75
|
if (!convertedValue) {
|
|
76
|
-
throw Error(`Unknown value: ${value} expect one of: ${JSON.stringify(
|
|
76
|
+
throw Error(`Unknown value: ${value} expect one of: ${JSON.stringify(objectValues(outputTypeRecord))}`);
|
|
77
77
|
}
|
|
78
78
|
return convertedValue;
|
|
79
79
|
});
|
|
80
80
|
return result.filter(truthy);
|
|
81
81
|
}
|
|
82
82
|
if (isStringFilterValue(values)) {
|
|
83
|
-
const valuesFromOutput =
|
|
83
|
+
const valuesFromOutput = objectValues(outputTypeRecord);
|
|
84
84
|
const convertedValue = valuesFromOutput.find(v => values === v);
|
|
85
85
|
if (!convertedValue) {
|
|
86
|
-
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(
|
|
86
|
+
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(objectValues(outputTypeRecord))}`);
|
|
87
87
|
}
|
|
88
88
|
return [convertedValue];
|
|
89
89
|
}
|
|
@@ -102,7 +102,7 @@ const fixType = (values, outputTypeRecord) => {
|
|
|
102
102
|
}
|
|
103
103
|
const convertedValue = outputTypeRecord[values];
|
|
104
104
|
if (!convertedValue) {
|
|
105
|
-
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(
|
|
105
|
+
throw Error(`Unknown value: ${values} expect one of: ${JSON.stringify(objectValues(outputTypeRecord))}`);
|
|
106
106
|
}
|
|
107
107
|
return convertedValue;
|
|
108
108
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-graphql-hook",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.68",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"graphql": "^16.10.0",
|
|
14
14
|
"@apollo/client": "3.13.8",
|
|
15
15
|
"zod": "^3.23.8",
|
|
16
|
-
"@trackunit/iris-app-build-utilities": "1.6.
|
|
17
|
-
"@trackunit/filters-filter-bar": "1.7.
|
|
18
|
-
"@trackunit/shared-utils": "1.8.
|
|
19
|
-
"@trackunit/iris-app-api": "1.6.
|
|
20
|
-
"@trackunit/react-core-contexts-test": "1.6.
|
|
21
|
-
"@trackunit/i18n-library-translation": "1.6.
|
|
22
|
-
"@trackunit/react-core-contexts-api": "1.7.
|
|
23
|
-
"@trackunit/react-core-hooks": "1.6.
|
|
24
|
-
"@trackunit/react-test-setup": "1.3.
|
|
16
|
+
"@trackunit/iris-app-build-utilities": "1.6.39",
|
|
17
|
+
"@trackunit/filters-filter-bar": "1.7.68",
|
|
18
|
+
"@trackunit/shared-utils": "1.8.39",
|
|
19
|
+
"@trackunit/iris-app-api": "1.6.39",
|
|
20
|
+
"@trackunit/react-core-contexts-test": "1.6.42",
|
|
21
|
+
"@trackunit/i18n-library-translation": "1.6.43",
|
|
22
|
+
"@trackunit/react-core-contexts-api": "1.7.40",
|
|
23
|
+
"@trackunit/react-core-hooks": "1.6.42",
|
|
24
|
+
"@trackunit/react-test-setup": "1.3.39"
|
|
25
25
|
},
|
|
26
26
|
"module": "./index.esm.js",
|
|
27
27
|
"main": "./index.cjs.js",
|