@trackunit/filters-graphql-hook 0.0.403 → 0.0.406
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 +13 -0
- package/index.esm.js +13 -1
- package/package.json +1 -1
- package/src/fixTypes.d.ts +4 -0
- package/src/generated/graphql-api/graphql.d.ts +2 -0
package/index.cjs.js
CHANGED
|
@@ -170,6 +170,17 @@ input) => {
|
|
|
170
170
|
}
|
|
171
171
|
return undefined;
|
|
172
172
|
};
|
|
173
|
+
/**
|
|
174
|
+
*
|
|
175
|
+
*/
|
|
176
|
+
const positiveValueBooleanOrNull = (
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
178
|
+
input) => {
|
|
179
|
+
if (input && typeof input === "object" && "booleanValue" in input && input.booleanValue) {
|
|
180
|
+
return input.booleanValue;
|
|
181
|
+
}
|
|
182
|
+
return null;
|
|
183
|
+
};
|
|
173
184
|
|
|
174
185
|
const assetActivityState = {
|
|
175
186
|
IDLING: "IDLING",
|
|
@@ -355,6 +366,7 @@ const useActiveAssetFilters = (filters) => {
|
|
|
355
366
|
systemOfMeasurement: systemOfMeasurement,
|
|
356
367
|
customerIds: valueNameArrayOrUndefined(filters.customerIds),
|
|
357
368
|
telematicsDeviceIsConnected: valueBooleanOrUndefined(filters.telematicsConnected),
|
|
369
|
+
activeFilter: positiveValueBooleanOrNull(filters.activeFilter),
|
|
358
370
|
};
|
|
359
371
|
}, [filters, customFields, systemOfMeasurement]);
|
|
360
372
|
return filter;
|
|
@@ -432,6 +444,7 @@ exports.fixType = fixType;
|
|
|
432
444
|
exports.fixTypes = fixTypes;
|
|
433
445
|
exports.isStringArrayValue = isStringArrayValue;
|
|
434
446
|
exports.isValueName = isValueName;
|
|
447
|
+
exports.positiveValueBooleanOrNull = positiveValueBooleanOrNull;
|
|
435
448
|
exports.stringArrayOrUndefined = stringArrayOrUndefined;
|
|
436
449
|
exports.useActiveAssetFilters = useActiveAssetFilters;
|
|
437
450
|
exports.useAssetQueryFilters = useAssetQueryFilters;
|
package/index.esm.js
CHANGED
|
@@ -168,6 +168,17 @@ input) => {
|
|
|
168
168
|
}
|
|
169
169
|
return undefined;
|
|
170
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
*/
|
|
174
|
+
const positiveValueBooleanOrNull = (
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
176
|
+
input) => {
|
|
177
|
+
if (input && typeof input === "object" && "booleanValue" in input && input.booleanValue) {
|
|
178
|
+
return input.booleanValue;
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
};
|
|
171
182
|
|
|
172
183
|
const assetActivityState = {
|
|
173
184
|
IDLING: "IDLING",
|
|
@@ -353,6 +364,7 @@ const useActiveAssetFilters = (filters) => {
|
|
|
353
364
|
systemOfMeasurement: systemOfMeasurement,
|
|
354
365
|
customerIds: valueNameArrayOrUndefined(filters.customerIds),
|
|
355
366
|
telematicsDeviceIsConnected: valueBooleanOrUndefined(filters.telematicsConnected),
|
|
367
|
+
activeFilter: positiveValueBooleanOrNull(filters.activeFilter),
|
|
356
368
|
};
|
|
357
369
|
}, [filters, customFields, systemOfMeasurement]);
|
|
358
370
|
return filter;
|
|
@@ -424,4 +436,4 @@ const useAssetQueryFilters = (props) => {
|
|
|
424
436
|
*/
|
|
425
437
|
setupLibraryTranslations();
|
|
426
438
|
|
|
427
|
-
export { CustomFieldPrefix, convertToAssetSortInput, fixType, fixTypes, isStringArrayValue, isValueName, stringArrayOrUndefined, useActiveAssetFilters, useAssetQueryFilters, useAssetSortInput, useCustomFieldFilters, valueBooleanOrUndefined, valueNameArrayOrUndefined, valuesIfNotEmpty };
|
|
439
|
+
export { CustomFieldPrefix, convertToAssetSortInput, fixType, fixTypes, isStringArrayValue, isValueName, positiveValueBooleanOrNull, stringArrayOrUndefined, useActiveAssetFilters, useAssetQueryFilters, useAssetSortInput, useCustomFieldFilters, valueBooleanOrUndefined, valueNameArrayOrUndefined, valuesIfNotEmpty };
|
package/package.json
CHANGED
package/src/fixTypes.d.ts
CHANGED
|
@@ -39,3 +39,7 @@ export declare const valueNameArrayOrUndefined: (input: any) => string[] | undef
|
|
|
39
39
|
* Check if value is boolean or undefined
|
|
40
40
|
*/
|
|
41
41
|
export declare const valueBooleanOrUndefined: (input: any) => boolean | undefined;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
export declare const positiveValueBooleanOrNull: (input: any) => boolean | null;
|
|
@@ -433,6 +433,8 @@ export declare const systemOfMeasurement: {
|
|
|
433
433
|
};
|
|
434
434
|
export type SystemOfMeasurement = (typeof systemOfMeasurement)[keyof typeof systemOfMeasurement];
|
|
435
435
|
export type AssetFiltersInput = {
|
|
436
|
+
/** Filter by if the asset is active */
|
|
437
|
+
activeFilter?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
436
438
|
/** List of activities */
|
|
437
439
|
activities?: InputMaybe<Array<AssetActivityState>>;
|
|
438
440
|
/** A list of asset ID's to do a bulk lookup for. */
|