@trackunit/filters-asset-filter-definitions 1.14.18 → 1.14.19
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 +419 -0
- package/index.esm.js +409 -2
- package/package.json +14 -14
- package/src/defaultFilters/defaults/InsightsAfterTreatmentDieselExhaustFluidTankLevelFilter.d.ts +14 -0
- package/src/defaultFilters/defaults/InsightsBatteryChargerStateFilter.d.ts +18 -0
- package/src/defaultFilters/defaults/InsightsBatteryPotentialFilter.d.ts +14 -0
- package/src/defaultFilters/defaults/InsightsBatteryStateOfChargePercentFilter.d.ts +14 -0
- package/src/defaultFilters/defaults/InsightsCumulativeIdleHoursFilter.d.ts +14 -0
- package/src/defaultFilters/defaults/InsightsFuelLevelFilter.d.ts +14 -0
- package/src/defaultFilters/defaults/RentalActiveContractItemOffRentDatesDateRangeFilter.d.ts +11 -0
- package/src/defaultFilters/defaults/RentalActiveContractItemOnRentDatesDateRangeFilter.d.ts +11 -0
- package/src/defaultFilters/defaults/index.d.ts +7 -0
- package/src/generated/graphql-api/graphql.d.ts +66 -0
- package/src/hooks/useDefaultAssetFilterBarDefinition.d.ts +6 -0
- package/src/translation.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -123,6 +123,8 @@ var defaultTranslations = {
|
|
|
123
123
|
"assetFilters.regions.WESTERN_ASIA": "Western Asia",
|
|
124
124
|
"assetFilters.regions.WESTERN_EUROPE": "Western Europe",
|
|
125
125
|
"assetFilters.regions.WHOLE_WORLD": "Whole world",
|
|
126
|
+
"assetFilters.rentalActiveContractItemOffRentDatesDateRangeFilter.label": "Off rent date",
|
|
127
|
+
"assetFilters.rentalActiveContractItemOnRentDatesDateRangeFilter.label": "On rent date",
|
|
126
128
|
"assetFilters.rentalContractOrderNumberFilter.label": "Order number",
|
|
127
129
|
"assetFilters.rentalContractReferenceCodeDescriptionFilter.label": "Reference code description",
|
|
128
130
|
"assetFilters.rentalContractReferenceCodeDescriptionFilter.searchPlaceholder": "Search by reference code description...",
|
|
@@ -170,6 +172,8 @@ var defaultTranslations = {
|
|
|
170
172
|
"filtersBar.closeFilter": "Close",
|
|
171
173
|
"filtersBar.defaultAssetFilters.activeAssetFilter.hide": "Hide",
|
|
172
174
|
"filtersBar.defaultAssetFilters.activeAssetFilter.show": "Show",
|
|
175
|
+
"filtersBar.defaultAssetFilters.batteryChargerState.OFF": "Off",
|
|
176
|
+
"filtersBar.defaultAssetFilters.batteryChargerState.ON": "On",
|
|
173
177
|
"filtersBar.defaultAssetFilters.followedFilter.ALL": "All Assets",
|
|
174
178
|
"filtersBar.defaultAssetFilters.followedFilter.allLabel": "All Assets",
|
|
175
179
|
"filtersBar.defaultAssetFilters.followedFilter.FOLLOWED": "Followed Only",
|
|
@@ -202,6 +206,12 @@ var defaultTranslations = {
|
|
|
202
206
|
"fleetlist.column.customerIds": "Customers",
|
|
203
207
|
"fleetlist.column.externalReference": "External Reference",
|
|
204
208
|
"fleetlist.column.groupIds": "Groups",
|
|
209
|
+
"fleetlist.column.insights.afterTreatmentDieselExhaustFluidTankLevel": "DEF Level",
|
|
210
|
+
"fleetlist.column.insights.batteryChargerState": "Battery Charger State",
|
|
211
|
+
"fleetlist.column.insights.batteryPotential": "Battery Voltage",
|
|
212
|
+
"fleetlist.column.insights.batteryStateOfChargePercent": "Battery State Of Charge",
|
|
213
|
+
"fleetlist.column.insights.cumulativeIdleHours": "Total Idle Hours",
|
|
214
|
+
"fleetlist.column.insights.fuelLevel": "Fuel Level",
|
|
205
215
|
"fleetlist.column.lastSeen": "Last Seen (GPS)",
|
|
206
216
|
"fleetlist.column.metadata": "Metadata",
|
|
207
217
|
"fleetlist.column.metadataCompleteness": "Metadata Completeness",
|
|
@@ -224,6 +234,7 @@ var defaultTranslations = {
|
|
|
224
234
|
"fleetlist.description": "A complete overview of your fleet.",
|
|
225
235
|
"fleetList.sorting.ACTIVITY": "Activity",
|
|
226
236
|
"fleetList.sorting.ASSET_TYPE": "Asset Type",
|
|
237
|
+
"fleetList.sorting.BATTERY_STATE_OF_CHARGE_PERCENT": "Battery State Of Charge",
|
|
227
238
|
"fleetList.sorting.BRAND": "Brand",
|
|
228
239
|
"fleetList.sorting.CATEGORY": "Type",
|
|
229
240
|
"fleetList.sorting.CRITICALITY": "Criticality",
|
|
@@ -3510,6 +3521,267 @@ const useHourIntervalFilter = () => {
|
|
|
3510
3521
|
return result;
|
|
3511
3522
|
};
|
|
3512
3523
|
|
|
3524
|
+
/**
|
|
3525
|
+
* The `AfterTreatmentDieselExhaustFluidTankLevelFilterView` component provides a filter
|
|
3526
|
+
* for selecting DEF (Diesel Exhaust Fluid) tank level percentage range.
|
|
3527
|
+
*
|
|
3528
|
+
* @param {FilterViewProps<MinMaxFilterValue>} props - Props passed to the filter component
|
|
3529
|
+
* @returns {ReactElement} The JSX element representing the filter
|
|
3530
|
+
*/
|
|
3531
|
+
const InsightsAfterTreatmentDieselExhaustFluidTankLevelFilterView = (props) => {
|
|
3532
|
+
const { setValue } = props;
|
|
3533
|
+
const handleSetValue = react.useCallback((callback) => {
|
|
3534
|
+
setValue(prevValue => {
|
|
3535
|
+
const newValue = callback(prevValue);
|
|
3536
|
+
if (newValue && newValue.max !== undefined && newValue.min === undefined) {
|
|
3537
|
+
return { ...newValue, min: 0 };
|
|
3538
|
+
}
|
|
3539
|
+
return newValue;
|
|
3540
|
+
});
|
|
3541
|
+
}, [setValue]);
|
|
3542
|
+
return jsxRuntime.jsx(filtersFilterBar.DefaultMinMaxFilter, { ...props, loading: false, options: [], setValue: handleSetValue, unit: "%" });
|
|
3543
|
+
};
|
|
3544
|
+
/**
|
|
3545
|
+
* AfterTreatmentDieselExhaustFluidTankLevel filter definition
|
|
3546
|
+
*/
|
|
3547
|
+
const useInsightsAfterTreatmentDieselExhaustFluidTankLevelFilter = (defaultValue) => {
|
|
3548
|
+
const defaultValueMemo = react.useMemo(() => defaultValue ?? {}, [defaultValue]);
|
|
3549
|
+
const [t] = useTranslation();
|
|
3550
|
+
const result = react.useMemo(() => {
|
|
3551
|
+
return {
|
|
3552
|
+
filterKey: "insightsAfterTreatmentDieselExhaustFluidTankLevel",
|
|
3553
|
+
type: "minMax",
|
|
3554
|
+
group: "STATUS",
|
|
3555
|
+
minimumNumber: 0,
|
|
3556
|
+
maximumNumber: 100,
|
|
3557
|
+
defaultValue: defaultValueMemo,
|
|
3558
|
+
valueAsText: (value) => {
|
|
3559
|
+
if (value.min !== undefined && value.max !== undefined) {
|
|
3560
|
+
return `${value.min}% - ${value.max}%`;
|
|
3561
|
+
}
|
|
3562
|
+
if (value.min !== undefined) {
|
|
3563
|
+
return `${value.min}%+`;
|
|
3564
|
+
}
|
|
3565
|
+
if (value.max !== undefined) {
|
|
3566
|
+
return `≤${value.max}%`;
|
|
3567
|
+
}
|
|
3568
|
+
return "";
|
|
3569
|
+
},
|
|
3570
|
+
title: t("fleetlist.column.insights.afterTreatmentDieselExhaustFluidTankLevel"),
|
|
3571
|
+
component: props => jsxRuntime.jsx(InsightsAfterTreatmentDieselExhaustFluidTankLevelFilterView, { ...props }),
|
|
3572
|
+
};
|
|
3573
|
+
}, [t, defaultValueMemo]);
|
|
3574
|
+
return result;
|
|
3575
|
+
};
|
|
3576
|
+
|
|
3577
|
+
/**
|
|
3578
|
+
* The `InsightsBatteryChargerStateFilterView` component serves as a filter view for battery charger state
|
|
3579
|
+
* (on or off). It integrates with the telemetry filter bar and displays options with counts
|
|
3580
|
+
* based on the current asset battery charger state summary.
|
|
3581
|
+
*
|
|
3582
|
+
* @param {FilterViewProps<ValueName>} props - Props containing filter state, filter actions, and definitions.
|
|
3583
|
+
* @returns {ReactElement} Rendered component for the battery charger state filter.
|
|
3584
|
+
*/
|
|
3585
|
+
const InsightsBatteryChargerStateFilterView = (props) => {
|
|
3586
|
+
const [t] = useTranslation();
|
|
3587
|
+
const options = react.useMemo(() => {
|
|
3588
|
+
return [
|
|
3589
|
+
{ key: "true", label: t("filtersBar.defaultAssetFilters.batteryChargerState.ON") },
|
|
3590
|
+
{ key: "false", label: t("filtersBar.defaultAssetFilters.batteryChargerState.OFF") },
|
|
3591
|
+
];
|
|
3592
|
+
}, [t]);
|
|
3593
|
+
return jsxRuntime.jsx(filtersFilterBar.DefaultRadioFilter, { ...props, options: options });
|
|
3594
|
+
};
|
|
3595
|
+
/**
|
|
3596
|
+
* Battery Charger State filter definition
|
|
3597
|
+
* It is a valueName filter that filters assets by battery charger state (charging/not charging)
|
|
3598
|
+
*
|
|
3599
|
+
* @returns {ValueNameFilterDefinition} Battery Charger State filter definition
|
|
3600
|
+
*/
|
|
3601
|
+
const useInsightsBatteryChargerStateFilter = (defaultValue) => {
|
|
3602
|
+
const defaultValueMemo = react.useMemo(() => defaultValue ?? undefined, [defaultValue]);
|
|
3603
|
+
const [t] = useTranslation();
|
|
3604
|
+
const result = react.useMemo(() => {
|
|
3605
|
+
return {
|
|
3606
|
+
filterKey: "insightsBatteryChargerState",
|
|
3607
|
+
type: "valueName",
|
|
3608
|
+
group: "STATUS",
|
|
3609
|
+
defaultValue: defaultValueMemo,
|
|
3610
|
+
title: t("fleetlist.column.insights.batteryChargerState"),
|
|
3611
|
+
valueAsText: (value) => {
|
|
3612
|
+
if (value.value === "true") {
|
|
3613
|
+
return t("filtersBar.defaultAssetFilters.batteryChargerState.ON");
|
|
3614
|
+
}
|
|
3615
|
+
if (value.value === "false") {
|
|
3616
|
+
return t("filtersBar.defaultAssetFilters.batteryChargerState.OFF");
|
|
3617
|
+
}
|
|
3618
|
+
return "";
|
|
3619
|
+
},
|
|
3620
|
+
component: props => jsxRuntime.jsx(InsightsBatteryChargerStateFilterView, { ...props }),
|
|
3621
|
+
};
|
|
3622
|
+
}, [t, defaultValueMemo]);
|
|
3623
|
+
return result;
|
|
3624
|
+
};
|
|
3625
|
+
|
|
3626
|
+
/**
|
|
3627
|
+
* The `BatteryPotentialFilterView` component provides a filter
|
|
3628
|
+
* for selecting battery voltage range.
|
|
3629
|
+
*
|
|
3630
|
+
* @param {FilterViewProps<MinMaxFilterValue>} props - Props passed to the filter component
|
|
3631
|
+
* @returns {ReactElement} The JSX element representing the filter
|
|
3632
|
+
*/
|
|
3633
|
+
const InsightsBatteryPotentialFilterView = (props) => {
|
|
3634
|
+
const { setValue } = props;
|
|
3635
|
+
const handleSetValue = react.useCallback((callback) => {
|
|
3636
|
+
setValue(prevValue => {
|
|
3637
|
+
const newValue = callback(prevValue);
|
|
3638
|
+
if (newValue && newValue.max !== undefined && newValue.min === undefined) {
|
|
3639
|
+
return { ...newValue, min: 0 };
|
|
3640
|
+
}
|
|
3641
|
+
return newValue;
|
|
3642
|
+
});
|
|
3643
|
+
}, [setValue]);
|
|
3644
|
+
return jsxRuntime.jsx(filtersFilterBar.DefaultMinMaxFilter, { ...props, loading: false, options: [], setValue: handleSetValue, unit: "V" });
|
|
3645
|
+
};
|
|
3646
|
+
/**
|
|
3647
|
+
* BatteryPotential filter definition
|
|
3648
|
+
*/
|
|
3649
|
+
const useInsightsBatteryPotentialFilter = (defaultValue) => {
|
|
3650
|
+
const defaultValueMemo = react.useMemo(() => defaultValue ?? {}, [defaultValue]);
|
|
3651
|
+
const [t] = useTranslation();
|
|
3652
|
+
const result = react.useMemo(() => {
|
|
3653
|
+
return {
|
|
3654
|
+
filterKey: "insightsBatteryPotential",
|
|
3655
|
+
type: "minMax",
|
|
3656
|
+
group: "STATUS",
|
|
3657
|
+
minimumNumber: 0,
|
|
3658
|
+
maximumNumber: 1000,
|
|
3659
|
+
defaultValue: defaultValueMemo,
|
|
3660
|
+
valueAsText: (value) => {
|
|
3661
|
+
if (value.min !== undefined && value.max !== undefined) {
|
|
3662
|
+
return `${value.min}V - ${value.max}V`;
|
|
3663
|
+
}
|
|
3664
|
+
if (value.min !== undefined) {
|
|
3665
|
+
return `${value.min}V+`;
|
|
3666
|
+
}
|
|
3667
|
+
if (value.max !== undefined) {
|
|
3668
|
+
return `≤${value.max}V`;
|
|
3669
|
+
}
|
|
3670
|
+
return "";
|
|
3671
|
+
},
|
|
3672
|
+
title: t("fleetlist.column.insights.batteryPotential"),
|
|
3673
|
+
component: props => jsxRuntime.jsx(InsightsBatteryPotentialFilterView, { ...props }),
|
|
3674
|
+
};
|
|
3675
|
+
}, [t, defaultValueMemo]);
|
|
3676
|
+
return result;
|
|
3677
|
+
};
|
|
3678
|
+
|
|
3679
|
+
/**
|
|
3680
|
+
* The `BatteryStateOfChargePercentFilterView` component provides a filter
|
|
3681
|
+
* for selecting battery state of charge percentage range.
|
|
3682
|
+
*
|
|
3683
|
+
* @param {FilterViewProps<MinMaxFilterValue>} props - Props passed to the filter component
|
|
3684
|
+
* @returns {ReactElement} The JSX element representing the filter
|
|
3685
|
+
*/
|
|
3686
|
+
const InsightsBatteryStateOfChargePercentFilterView = (props) => {
|
|
3687
|
+
const { setValue } = props;
|
|
3688
|
+
const handleSetValue = react.useCallback((callback) => {
|
|
3689
|
+
setValue(prevValue => {
|
|
3690
|
+
const newValue = callback(prevValue);
|
|
3691
|
+
if (newValue && newValue.max !== undefined && newValue.min === undefined) {
|
|
3692
|
+
return { ...newValue, min: 0 };
|
|
3693
|
+
}
|
|
3694
|
+
return newValue;
|
|
3695
|
+
});
|
|
3696
|
+
}, [setValue]);
|
|
3697
|
+
return jsxRuntime.jsx(filtersFilterBar.DefaultMinMaxFilter, { ...props, loading: false, options: [], setValue: handleSetValue, unit: "%" });
|
|
3698
|
+
};
|
|
3699
|
+
/**
|
|
3700
|
+
* BatteryStateOfChargePercent filter definition
|
|
3701
|
+
*/
|
|
3702
|
+
const useInsightsBatteryStateOfChargePercentFilter = (defaultValue) => {
|
|
3703
|
+
const defaultValueMemo = react.useMemo(() => defaultValue ?? {}, [defaultValue]);
|
|
3704
|
+
const [t] = useTranslation();
|
|
3705
|
+
const result = react.useMemo(() => {
|
|
3706
|
+
return {
|
|
3707
|
+
filterKey: "insightsBatteryStateOfChargePercent",
|
|
3708
|
+
type: "minMax",
|
|
3709
|
+
group: "STATUS",
|
|
3710
|
+
minimumNumber: 0,
|
|
3711
|
+
maximumNumber: 100,
|
|
3712
|
+
defaultValue: defaultValueMemo,
|
|
3713
|
+
valueAsText: (value) => {
|
|
3714
|
+
if (value.min !== undefined && value.max !== undefined) {
|
|
3715
|
+
return `${value.min}% - ${value.max}%`;
|
|
3716
|
+
}
|
|
3717
|
+
if (value.min !== undefined) {
|
|
3718
|
+
return `${value.min}%+`;
|
|
3719
|
+
}
|
|
3720
|
+
if (value.max !== undefined) {
|
|
3721
|
+
return `≤${value.max}%`;
|
|
3722
|
+
}
|
|
3723
|
+
return "";
|
|
3724
|
+
},
|
|
3725
|
+
title: t("fleetlist.column.insights.batteryStateOfChargePercent"),
|
|
3726
|
+
component: props => jsxRuntime.jsx(InsightsBatteryStateOfChargePercentFilterView, { ...props }),
|
|
3727
|
+
};
|
|
3728
|
+
}, [t, defaultValueMemo]);
|
|
3729
|
+
return result;
|
|
3730
|
+
};
|
|
3731
|
+
|
|
3732
|
+
/**
|
|
3733
|
+
* The `FuelLevelFilterView` component provides a filter
|
|
3734
|
+
* for selecting fuel level percentage range.
|
|
3735
|
+
*
|
|
3736
|
+
* @param {FilterViewProps<MinMaxFilterValue>} props - Props passed to the filter component
|
|
3737
|
+
* @returns {ReactElement} The JSX element representing the filter
|
|
3738
|
+
*/
|
|
3739
|
+
const InsightsFuelLevelFilterView = (props) => {
|
|
3740
|
+
const { setValue } = props;
|
|
3741
|
+
const handleSetValue = react.useCallback((callback) => {
|
|
3742
|
+
setValue(prevValue => {
|
|
3743
|
+
const newValue = callback(prevValue);
|
|
3744
|
+
if (newValue && newValue.max !== undefined && newValue.min === undefined) {
|
|
3745
|
+
return { ...newValue, min: 0 };
|
|
3746
|
+
}
|
|
3747
|
+
return newValue;
|
|
3748
|
+
});
|
|
3749
|
+
}, [setValue]);
|
|
3750
|
+
return jsxRuntime.jsx(filtersFilterBar.DefaultMinMaxFilter, { ...props, loading: false, options: [], setValue: handleSetValue, unit: "%" });
|
|
3751
|
+
};
|
|
3752
|
+
/**
|
|
3753
|
+
* FuelLevel filter definition
|
|
3754
|
+
*/
|
|
3755
|
+
const useInsightsFuelLevelFilter = (defaultValue) => {
|
|
3756
|
+
const defaultValueMemo = react.useMemo(() => defaultValue ?? {}, [defaultValue]);
|
|
3757
|
+
const [t] = useTranslation();
|
|
3758
|
+
const result = react.useMemo(() => {
|
|
3759
|
+
return {
|
|
3760
|
+
filterKey: "insightsFuelLevel",
|
|
3761
|
+
type: "minMax",
|
|
3762
|
+
group: "STATUS",
|
|
3763
|
+
minimumNumber: 0,
|
|
3764
|
+
maximumNumber: 100,
|
|
3765
|
+
defaultValue: defaultValueMemo,
|
|
3766
|
+
valueAsText: (value) => {
|
|
3767
|
+
if (value.min !== undefined && value.max !== undefined) {
|
|
3768
|
+
return `${value.min}% - ${value.max}%`;
|
|
3769
|
+
}
|
|
3770
|
+
if (value.min !== undefined) {
|
|
3771
|
+
return `${value.min}%+`;
|
|
3772
|
+
}
|
|
3773
|
+
if (value.max !== undefined) {
|
|
3774
|
+
return `≤${value.max}%`;
|
|
3775
|
+
}
|
|
3776
|
+
return "";
|
|
3777
|
+
},
|
|
3778
|
+
title: t("fleetlist.column.insights.fuelLevel"),
|
|
3779
|
+
component: props => jsxRuntime.jsx(InsightsFuelLevelFilterView, { ...props }),
|
|
3780
|
+
};
|
|
3781
|
+
}, [t, defaultValueMemo]);
|
|
3782
|
+
return result;
|
|
3783
|
+
};
|
|
3784
|
+
|
|
3513
3785
|
/** The time the asset was last seen. */
|
|
3514
3786
|
exports.AssetLastSeen = void 0;
|
|
3515
3787
|
(function (AssetLastSeen) {
|
|
@@ -3924,6 +4196,70 @@ const useProductionYearFilter = () => {
|
|
|
3924
4196
|
return result;
|
|
3925
4197
|
};
|
|
3926
4198
|
|
|
4199
|
+
const defaultShowInFilterBar$1 = () => true;
|
|
4200
|
+
/**
|
|
4201
|
+
* Rental active contract item off rent dates date range filter definition
|
|
4202
|
+
*
|
|
4203
|
+
* @returns {DateRangeFilterDefinition} Rental active contract item off rent dates date range filter definition
|
|
4204
|
+
*/
|
|
4205
|
+
const useRentalActiveContractItemOffRentDatesDateRangeFilter = ({ showInFilterBar } = {
|
|
4206
|
+
showInFilterBar: defaultShowInFilterBar$1,
|
|
4207
|
+
}) => {
|
|
4208
|
+
const [t] = useTranslation();
|
|
4209
|
+
const stableShowInFilterBar = react.useCallback(() => showInFilterBar(), [showInFilterBar]);
|
|
4210
|
+
const result = react.useMemo(() => {
|
|
4211
|
+
return {
|
|
4212
|
+
filterKey: "rentalActiveContractItemOffRentDatesDateRange",
|
|
4213
|
+
type: "dateRange",
|
|
4214
|
+
group: "CUSTOMERS",
|
|
4215
|
+
title: t("assetFilters.rentalActiveContractItemOffRentDatesDateRangeFilter.label"),
|
|
4216
|
+
showInFilterBar: stableShowInFilterBar,
|
|
4217
|
+
valueAsText: (value) => {
|
|
4218
|
+
if (value.from || value.to) {
|
|
4219
|
+
const from = value.from ? new Date(value.from).toISOString().slice(0, 10) : undefined;
|
|
4220
|
+
const to = value.to ? new Date(value.to).toISOString().slice(0, 10) : undefined;
|
|
4221
|
+
return `${from ?? ""} - ${to ?? ""}`;
|
|
4222
|
+
}
|
|
4223
|
+
return "";
|
|
4224
|
+
},
|
|
4225
|
+
component: (props) => jsxRuntime.jsx(filtersFilterBar.DefaultDateRangeFilter, { ...props, options: [] }),
|
|
4226
|
+
};
|
|
4227
|
+
}, [stableShowInFilterBar, t]);
|
|
4228
|
+
return result;
|
|
4229
|
+
};
|
|
4230
|
+
|
|
4231
|
+
const defaultShowInFilterBar = () => true;
|
|
4232
|
+
/**
|
|
4233
|
+
* Rental active contract item on rent dates date range filter definition
|
|
4234
|
+
*
|
|
4235
|
+
* @returns {DateRangeFilterDefinition} Rental active contract item on rent dates date range filter definition
|
|
4236
|
+
*/
|
|
4237
|
+
const useRentalActiveContractItemOnRentDatesDateRangeFilter = ({ showInFilterBar } = {
|
|
4238
|
+
showInFilterBar: defaultShowInFilterBar,
|
|
4239
|
+
}) => {
|
|
4240
|
+
const [t] = useTranslation();
|
|
4241
|
+
const stableShowInFilterBar = react.useCallback(() => showInFilterBar(), [showInFilterBar]);
|
|
4242
|
+
const result = react.useMemo(() => {
|
|
4243
|
+
return {
|
|
4244
|
+
filterKey: "rentalActiveContractItemOnRentDatesDateRange",
|
|
4245
|
+
type: "dateRange",
|
|
4246
|
+
group: "CUSTOMERS",
|
|
4247
|
+
title: t("assetFilters.rentalActiveContractItemOnRentDatesDateRangeFilter.label"),
|
|
4248
|
+
showInFilterBar: stableShowInFilterBar,
|
|
4249
|
+
valueAsText: (value) => {
|
|
4250
|
+
if (value.from || value.to) {
|
|
4251
|
+
const from = value.from ? new Date(value.from).toISOString().slice(0, 10) : undefined;
|
|
4252
|
+
const to = value.to ? new Date(value.to).toISOString().slice(0, 10) : undefined;
|
|
4253
|
+
return `${from ?? ""} - ${to ?? ""}`;
|
|
4254
|
+
}
|
|
4255
|
+
return "";
|
|
4256
|
+
},
|
|
4257
|
+
component: (props) => jsxRuntime.jsx(filtersFilterBar.DefaultDateRangeFilter, { ...props, options: [] }),
|
|
4258
|
+
};
|
|
4259
|
+
}, [stableShowInFilterBar, t]);
|
|
4260
|
+
return result;
|
|
4261
|
+
};
|
|
4262
|
+
|
|
3927
4263
|
const FETCH_LIMIT$4 = 1000;
|
|
3928
4264
|
/**
|
|
3929
4265
|
* Rental contract order numbers filter view component.
|
|
@@ -5310,6 +5646,59 @@ const mockForGetAccessManagementModeDesiredSummaryQuery = (variables, data) => {
|
|
|
5310
5646
|
}, data || {}));
|
|
5311
5647
|
};
|
|
5312
5648
|
|
|
5649
|
+
/**
|
|
5650
|
+
* The `InsightsCumulativeIdleHoursFilterView` component provides a filter
|
|
5651
|
+
* for selecting cumulative idle hours range.
|
|
5652
|
+
*
|
|
5653
|
+
* @param {FilterViewProps<MinMaxFilterValue>} props - Props passed to the filter component
|
|
5654
|
+
* @returns {ReactElement} The JSX element representing the filter
|
|
5655
|
+
*/
|
|
5656
|
+
const InsightsCumulativeIdleHoursFilterView = (props) => {
|
|
5657
|
+
const { setValue } = props;
|
|
5658
|
+
const handleSetValue = react.useCallback((callback) => {
|
|
5659
|
+
setValue(prevValue => {
|
|
5660
|
+
const newValue = callback(prevValue);
|
|
5661
|
+
if (newValue && newValue.max !== undefined && newValue.min === undefined) {
|
|
5662
|
+
return { ...newValue, min: 0 };
|
|
5663
|
+
}
|
|
5664
|
+
return newValue;
|
|
5665
|
+
});
|
|
5666
|
+
}, [setValue]);
|
|
5667
|
+
return jsxRuntime.jsx(filtersFilterBar.DefaultMinMaxFilter, { ...props, loading: false, options: [], setValue: handleSetValue, unit: "h" });
|
|
5668
|
+
};
|
|
5669
|
+
/**
|
|
5670
|
+
* Cumulative Idle Hours filter definition
|
|
5671
|
+
*/
|
|
5672
|
+
const useInsightsCumulativeIdleHoursFilter = (defaultValue) => {
|
|
5673
|
+
const defaultValueMemo = react.useMemo(() => ({}), [defaultValue]);
|
|
5674
|
+
const [t] = useTranslation();
|
|
5675
|
+
const result = react.useMemo(() => {
|
|
5676
|
+
return {
|
|
5677
|
+
filterKey: "insightsCumulativeIdleHours",
|
|
5678
|
+
type: "minMax",
|
|
5679
|
+
group: "STATUS",
|
|
5680
|
+
minimumNumber: 0,
|
|
5681
|
+
maximumNumber: 100000,
|
|
5682
|
+
defaultValue: defaultValueMemo,
|
|
5683
|
+
valueAsText: (value) => {
|
|
5684
|
+
if (value.min !== undefined && value.max !== undefined) {
|
|
5685
|
+
return `${value.min}h - ${value.max}h`;
|
|
5686
|
+
}
|
|
5687
|
+
if (value.min !== undefined) {
|
|
5688
|
+
return `${value.min}h+`;
|
|
5689
|
+
}
|
|
5690
|
+
if (value.max !== undefined) {
|
|
5691
|
+
return `≤${value.max}h`;
|
|
5692
|
+
}
|
|
5693
|
+
return "";
|
|
5694
|
+
},
|
|
5695
|
+
title: t("fleetlist.column.insights.cumulativeIdleHours"),
|
|
5696
|
+
component: props => jsxRuntime.jsx(InsightsCumulativeIdleHoursFilterView, { ...props }),
|
|
5697
|
+
};
|
|
5698
|
+
}, [t, defaultValueMemo]);
|
|
5699
|
+
return result;
|
|
5700
|
+
};
|
|
5701
|
+
|
|
5313
5702
|
/**
|
|
5314
5703
|
* Default asset filter bar definition, used to define the default filters for the asset related filters.
|
|
5315
5704
|
*
|
|
@@ -5366,6 +5755,12 @@ const useDefaultAssetFilterBarDefinition = () => {
|
|
|
5366
5755
|
const fleetHealthTypes = useDeviceHealthIssueTypeFilter();
|
|
5367
5756
|
const fleetHealthCategories = useDeviceHealthIssueCategoryFilter();
|
|
5368
5757
|
const fleetHealthStatus = useDeviceHealthIssueStatusFilter();
|
|
5758
|
+
const insightsBatteryStateOfChargePercent = useInsightsBatteryStateOfChargePercentFilter();
|
|
5759
|
+
const insightsAfterTreatmentDieselExhaustFluidTankLevel = useInsightsAfterTreatmentDieselExhaustFluidTankLevelFilter();
|
|
5760
|
+
const insightsBatteryChargerState = useInsightsBatteryChargerStateFilter();
|
|
5761
|
+
const insightsBatteryPotential = useInsightsBatteryPotentialFilter();
|
|
5762
|
+
const insightsFuelLevel = useInsightsFuelLevelFilter();
|
|
5763
|
+
const insightsCumulativeIdleHours = useInsightsCumulativeIdleHoursFilter();
|
|
5369
5764
|
return react.useMemo(() => {
|
|
5370
5765
|
return {
|
|
5371
5766
|
assetType,
|
|
@@ -5393,6 +5788,12 @@ const useDefaultAssetFilterBarDefinition = () => {
|
|
|
5393
5788
|
fleetHealthTypes,
|
|
5394
5789
|
fleetHealthCategories,
|
|
5395
5790
|
fleetHealthStatus,
|
|
5791
|
+
insightsBatteryStateOfChargePercent,
|
|
5792
|
+
insightsAfterTreatmentDieselExhaustFluidTankLevel,
|
|
5793
|
+
insightsBatteryChargerState,
|
|
5794
|
+
insightsBatteryPotential,
|
|
5795
|
+
insightsCumulativeIdleHours,
|
|
5796
|
+
insightsFuelLevel,
|
|
5396
5797
|
};
|
|
5397
5798
|
}, [
|
|
5398
5799
|
siteIds,
|
|
@@ -5420,6 +5821,12 @@ const useDefaultAssetFilterBarDefinition = () => {
|
|
|
5420
5821
|
fleetHealthTypes,
|
|
5421
5822
|
fleetHealthCategories,
|
|
5422
5823
|
fleetHealthStatus,
|
|
5824
|
+
insightsBatteryStateOfChargePercent,
|
|
5825
|
+
insightsAfterTreatmentDieselExhaustFluidTankLevel,
|
|
5826
|
+
insightsBatteryChargerState,
|
|
5827
|
+
insightsBatteryPotential,
|
|
5828
|
+
insightsFuelLevel,
|
|
5829
|
+
insightsCumulativeIdleHours,
|
|
5423
5830
|
]);
|
|
5424
5831
|
};
|
|
5425
5832
|
|
|
@@ -5446,6 +5853,11 @@ exports.FollowedFiltersView = FollowedFiltersView;
|
|
|
5446
5853
|
exports.GetFleetGroupSummaryDocument = GetFleetGroupSummaryDocument;
|
|
5447
5854
|
exports.GroupIdsFilterView = GroupIdsFilterView;
|
|
5448
5855
|
exports.HourIntervalFilterView = HourIntervalFilterView;
|
|
5856
|
+
exports.InsightsAfterTreatmentDieselExhaustFluidTankLevelFilterView = InsightsAfterTreatmentDieselExhaustFluidTankLevelFilterView;
|
|
5857
|
+
exports.InsightsBatteryChargerStateFilterView = InsightsBatteryChargerStateFilterView;
|
|
5858
|
+
exports.InsightsBatteryPotentialFilterView = InsightsBatteryPotentialFilterView;
|
|
5859
|
+
exports.InsightsBatteryStateOfChargePercentFilterView = InsightsBatteryStateOfChargePercentFilterView;
|
|
5860
|
+
exports.InsightsFuelLevelFilterView = InsightsFuelLevelFilterView;
|
|
5449
5861
|
exports.LastSeenFiltersView = LastSeenFiltersView;
|
|
5450
5862
|
exports.MetadataCompletenessFilterView = MetadataCompletenessFilterView;
|
|
5451
5863
|
exports.ModelsFilterView = ModelsFilterView;
|
|
@@ -5519,6 +5931,11 @@ exports.useDeviceHealthIssueTypeFilter = useDeviceHealthIssueTypeFilter;
|
|
|
5519
5931
|
exports.useFollowedFilter = useFollowedFilter;
|
|
5520
5932
|
exports.useGroupIdsFilter = useGroupIdsFilter;
|
|
5521
5933
|
exports.useHourIntervalFilter = useHourIntervalFilter;
|
|
5934
|
+
exports.useInsightsAfterTreatmentDieselExhaustFluidTankLevelFilter = useInsightsAfterTreatmentDieselExhaustFluidTankLevelFilter;
|
|
5935
|
+
exports.useInsightsBatteryChargerStateFilter = useInsightsBatteryChargerStateFilter;
|
|
5936
|
+
exports.useInsightsBatteryPotentialFilter = useInsightsBatteryPotentialFilter;
|
|
5937
|
+
exports.useInsightsBatteryStateOfChargePercentFilter = useInsightsBatteryStateOfChargePercentFilter;
|
|
5938
|
+
exports.useInsightsFuelLevelFilter = useInsightsFuelLevelFilter;
|
|
5522
5939
|
exports.useLastSeenFilter = useLastSeenFilter;
|
|
5523
5940
|
exports.useMetadataCompletenessFilter = useMetadataCompletenessFilter;
|
|
5524
5941
|
exports.useModelsFilter = useModelsFilter;
|
|
@@ -5527,6 +5944,8 @@ exports.usePartnerFilter = usePartnerFilter;
|
|
|
5527
5944
|
exports.usePeriodFilter = usePeriodFilter;
|
|
5528
5945
|
exports.usePlacesSearch = usePlacesSearch;
|
|
5529
5946
|
exports.useProductionYearFilter = useProductionYearFilter;
|
|
5947
|
+
exports.useRentalActiveContractItemOffRentDatesDateRangeFilter = useRentalActiveContractItemOffRentDatesDateRangeFilter;
|
|
5948
|
+
exports.useRentalActiveContractItemOnRentDatesDateRangeFilter = useRentalActiveContractItemOnRentDatesDateRangeFilter;
|
|
5530
5949
|
exports.useRentalContractOrderNumberFilter = useRentalContractOrderNumberFilter;
|
|
5531
5950
|
exports.useRentalContractReferenceCodeDescriptionFilter = useRentalContractReferenceCodeDescriptionFilter;
|
|
5532
5951
|
exports.useRentalContractReferenceCodeFilter = useRentalContractReferenceCodeFilter;
|