@trackunit/filters-asset-filter-definitions 1.5.63 → 1.5.65
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
CHANGED
|
@@ -3037,17 +3037,18 @@ const OwnerAccountIdsFilterView = (props) => {
|
|
|
3037
3037
|
*
|
|
3038
3038
|
* @returns {ValueNameArrayFilterDefinition} OwnerAccountIds filter definition
|
|
3039
3039
|
*/
|
|
3040
|
-
const useOwnerAccountIdsFilter = () => {
|
|
3040
|
+
const useOwnerAccountIdsFilter = (defaultValue) => {
|
|
3041
3041
|
const [t] = useTranslation();
|
|
3042
3042
|
const result = react.useMemo(() => {
|
|
3043
3043
|
return {
|
|
3044
3044
|
filterKey: "ownerAccountIds",
|
|
3045
3045
|
type: "valueNameArray",
|
|
3046
3046
|
group: "OTHER",
|
|
3047
|
+
defaultValue: defaultValue ?? [],
|
|
3047
3048
|
title: t("assetFilters.ownerAccountNameFilter.label"),
|
|
3048
3049
|
component: props => jsxRuntime.jsx(OwnerAccountIdsFilterView, { ...props }),
|
|
3049
3050
|
};
|
|
3050
|
-
}, [t]);
|
|
3051
|
+
}, [defaultValue, t]);
|
|
3051
3052
|
return result;
|
|
3052
3053
|
};
|
|
3053
3054
|
|
|
@@ -4191,7 +4192,7 @@ const useSiteDepotOwnershipIdsFilter = ({ showInStarredMenu, showInFilterBar, de
|
|
|
4191
4192
|
*
|
|
4192
4193
|
* @returns {FilterBarDefinition} Default asset filter bar definition
|
|
4193
4194
|
*/
|
|
4194
|
-
const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled, serviceManagementEnabled, areaShowWithSearch, }) => {
|
|
4195
|
+
const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled, serviceManagementEnabled, areaShowWithSearch, ownerFilterDefaultValue, }) => {
|
|
4195
4196
|
const assetType = useAssetTypeFilter();
|
|
4196
4197
|
const metadataCompleteness = useMetadataCompletenessFilter();
|
|
4197
4198
|
const groups = useGroupIdsFilter();
|
|
@@ -4215,7 +4216,7 @@ const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled,
|
|
|
4215
4216
|
showInFilterBar: () => sitesEnabled || false,
|
|
4216
4217
|
isOnSite: true,
|
|
4217
4218
|
});
|
|
4218
|
-
const ownerAccountIds = useOwnerAccountIdsFilter();
|
|
4219
|
+
const ownerAccountIds = useOwnerAccountIdsFilter(ownerFilterDefaultValue);
|
|
4219
4220
|
const search = useSearchFilter({ localStorageKey: "assetSearch" });
|
|
4220
4221
|
const area = useAreaFilter({
|
|
4221
4222
|
showWithSearch: () => areaShowWithSearch ?? false,
|
package/index.esm.js
CHANGED
|
@@ -3035,17 +3035,18 @@ const OwnerAccountIdsFilterView = (props) => {
|
|
|
3035
3035
|
*
|
|
3036
3036
|
* @returns {ValueNameArrayFilterDefinition} OwnerAccountIds filter definition
|
|
3037
3037
|
*/
|
|
3038
|
-
const useOwnerAccountIdsFilter = () => {
|
|
3038
|
+
const useOwnerAccountIdsFilter = (defaultValue) => {
|
|
3039
3039
|
const [t] = useTranslation();
|
|
3040
3040
|
const result = useMemo(() => {
|
|
3041
3041
|
return {
|
|
3042
3042
|
filterKey: "ownerAccountIds",
|
|
3043
3043
|
type: "valueNameArray",
|
|
3044
3044
|
group: "OTHER",
|
|
3045
|
+
defaultValue: defaultValue ?? [],
|
|
3045
3046
|
title: t("assetFilters.ownerAccountNameFilter.label"),
|
|
3046
3047
|
component: props => jsx(OwnerAccountIdsFilterView, { ...props }),
|
|
3047
3048
|
};
|
|
3048
|
-
}, [t]);
|
|
3049
|
+
}, [defaultValue, t]);
|
|
3049
3050
|
return result;
|
|
3050
3051
|
};
|
|
3051
3052
|
|
|
@@ -4189,7 +4190,7 @@ const useSiteDepotOwnershipIdsFilter = ({ showInStarredMenu, showInFilterBar, de
|
|
|
4189
4190
|
*
|
|
4190
4191
|
* @returns {FilterBarDefinition} Default asset filter bar definition
|
|
4191
4192
|
*/
|
|
4192
|
-
const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled, serviceManagementEnabled, areaShowWithSearch, }) => {
|
|
4193
|
+
const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled, serviceManagementEnabled, areaShowWithSearch, ownerFilterDefaultValue, }) => {
|
|
4193
4194
|
const assetType = useAssetTypeFilter();
|
|
4194
4195
|
const metadataCompleteness = useMetadataCompletenessFilter();
|
|
4195
4196
|
const groups = useGroupIdsFilter();
|
|
@@ -4213,7 +4214,7 @@ const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled,
|
|
|
4213
4214
|
showInFilterBar: () => sitesEnabled || false,
|
|
4214
4215
|
isOnSite: true,
|
|
4215
4216
|
});
|
|
4216
|
-
const ownerAccountIds = useOwnerAccountIdsFilter();
|
|
4217
|
+
const ownerAccountIds = useOwnerAccountIdsFilter(ownerFilterDefaultValue);
|
|
4217
4218
|
const search = useSearchFilter({ localStorageKey: "assetSearch" });
|
|
4218
4219
|
const area = useAreaFilter({
|
|
4219
4220
|
showWithSearch: () => areaShowWithSearch ?? false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-asset-filter-definitions",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.65",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
"@tanstack/react-router": "1.114.29",
|
|
18
18
|
"string-ts": "^2.0.0",
|
|
19
19
|
"tailwind-merge": "^2.0.0",
|
|
20
|
-
"@trackunit/iris-app-build-utilities": "1.3.
|
|
21
|
-
"@trackunit/filters-filter-bar": "1.3.
|
|
22
|
-
"@trackunit/react-core-hooks": "1.3.
|
|
23
|
-
"@trackunit/react-filter-components": "1.3.
|
|
24
|
-
"@trackunit/react-form-components": "1.3.
|
|
25
|
-
"@trackunit/filters-graphql-hook": "1.5.
|
|
26
|
-
"@trackunit/utilization-indicator": "1.3.
|
|
27
|
-
"@trackunit/geo-json-utils": "1.3.
|
|
28
|
-
"@trackunit/react-components": "1.4.
|
|
29
|
-
"@trackunit/shared-utils": "1.5.
|
|
30
|
-
"@trackunit/translations-machine-type": "1.3.
|
|
31
|
-
"@trackunit/criticality-indicator": "1.3.
|
|
32
|
-
"@trackunit/iris-app-api": "1.3.
|
|
33
|
-
"@trackunit/react-core-contexts-test": "1.3.
|
|
34
|
-
"@trackunit/i18n-library-translation": "1.3.
|
|
35
|
-
"@trackunit/react-core-contexts-api": "1.4.
|
|
36
|
-
"@trackunit/react-test-setup": "1.0.
|
|
20
|
+
"@trackunit/iris-app-build-utilities": "1.3.122",
|
|
21
|
+
"@trackunit/filters-filter-bar": "1.3.189",
|
|
22
|
+
"@trackunit/react-core-hooks": "1.3.127",
|
|
23
|
+
"@trackunit/react-filter-components": "1.3.158",
|
|
24
|
+
"@trackunit/react-form-components": "1.3.158",
|
|
25
|
+
"@trackunit/filters-graphql-hook": "1.5.64",
|
|
26
|
+
"@trackunit/utilization-indicator": "1.3.154",
|
|
27
|
+
"@trackunit/geo-json-utils": "1.3.117",
|
|
28
|
+
"@trackunit/react-components": "1.4.140",
|
|
29
|
+
"@trackunit/shared-utils": "1.5.117",
|
|
30
|
+
"@trackunit/translations-machine-type": "1.3.134",
|
|
31
|
+
"@trackunit/criticality-indicator": "1.3.149",
|
|
32
|
+
"@trackunit/iris-app-api": "1.3.122",
|
|
33
|
+
"@trackunit/react-core-contexts-test": "1.3.128",
|
|
34
|
+
"@trackunit/i18n-library-translation": "1.3.131",
|
|
35
|
+
"@trackunit/react-core-contexts-api": "1.4.123",
|
|
36
|
+
"@trackunit/react-test-setup": "1.0.7"
|
|
37
37
|
},
|
|
38
38
|
"module": "./index.esm.js",
|
|
39
39
|
"main": "./index.cjs.js",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ValueNameArrayFilterDefinition } from "@trackunit/filters-filter-bar";
|
|
1
|
+
import { ValueName, ValueNameArrayFilterDefinition } from "@trackunit/filters-filter-bar";
|
|
2
2
|
/**
|
|
3
3
|
* OwnerAccountIds filter definition
|
|
4
4
|
*
|
|
5
5
|
* @returns {ValueNameArrayFilterDefinition} OwnerAccountIds filter definition
|
|
6
6
|
*/
|
|
7
|
-
export declare const useOwnerAccountIdsFilter: () => ValueNameArrayFilterDefinition;
|
|
7
|
+
export declare const useOwnerAccountIdsFilter: (defaultValue?: ValueName[]) => ValueNameArrayFilterDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FilterStateValues } from "@trackunit/filters-filter-bar";
|
|
1
|
+
import { FilterStateValues, ValueName } from "@trackunit/filters-filter-bar";
|
|
2
2
|
interface DefaultAssetFilterBarDefinitionProps {
|
|
3
3
|
/**
|
|
4
4
|
* A flag indicating whether site filters are enabled
|
|
@@ -16,13 +16,17 @@ interface DefaultAssetFilterBarDefinitionProps {
|
|
|
16
16
|
* A flag indicating whether area filter is enabled
|
|
17
17
|
*/
|
|
18
18
|
areaShowWithSearch: boolean | null;
|
|
19
|
+
/**
|
|
20
|
+
* A value setting the initial value of the "Owner" filter
|
|
21
|
+
*/
|
|
22
|
+
ownerFilterDefaultValue?: ValueName[];
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Default asset filter bar definition, used to define the default filters for the asset related filters.
|
|
22
26
|
*
|
|
23
27
|
* @returns {FilterBarDefinition} Default asset filter bar definition
|
|
24
28
|
*/
|
|
25
|
-
export declare const useDefaultAssetFilterBarDefinition: ({ sitesEnabled, owningDepotEnabled, serviceManagementEnabled, areaShowWithSearch, }: DefaultAssetFilterBarDefinitionProps) => {
|
|
29
|
+
export declare const useDefaultAssetFilterBarDefinition: ({ sitesEnabled, owningDepotEnabled, serviceManagementEnabled, areaShowWithSearch, ownerFilterDefaultValue, }: DefaultAssetFilterBarDefinitionProps) => {
|
|
26
30
|
search: import("@trackunit/filters-filter-bar").StringFilterDefinition;
|
|
27
31
|
siteIds: import("@trackunit/filters-filter-bar").ValueNameArrayFilterDefinition;
|
|
28
32
|
groups: import("@trackunit/filters-filter-bar").ValueNameArrayFilterDefinition;
|