@equinor/echo-framework 0.20.23-beta-0 → 0.21.0-beta-0
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 +1 -1
- package/package.json +4 -4
- package/src/index.d.ts +6 -9
- package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +1 -2
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +101 -74
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +1 -1
- package/src/lib/feature/globalSelection/index.d.ts +1 -4
- package/src/lib/feature/globalSelection/selectionMenu/hooks/{useIsAllIGlobalSelectionItemsHidden.d.ts → useAllItemsHiddenByUser.d.ts} +2 -9
- package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuLists.d.ts +7 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.d.ts +28 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.types.d.ts +56 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.utils.d.ts +56 -0
- package/src/lib/feature/globalSelection/hooks/useSelectionCategoriesByGroupId.d.ts +0 -11
- package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuGroups.d.ts +0 -7
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +0 -37
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +0 -84
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +0 -53
- package/src/lib/feature/legend/components/BasicLegendRenderer.d.ts +0 -6
- package/src/lib/feature/legend/components/LegendList.d.ts +0 -5
- package/src/lib/feature/legend/components/basicLegendRenderer.logic.d.ts +0 -5
- package/src/lib/feature/legend/components/pdfMarkers/PositionalItem.d.ts +0 -8
- package/src/lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers.d.ts +0 -24
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +0 -11
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRendererWithPopover.d.ts +0 -13
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersByLegends.d.ts +0 -21
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/iconPositionTransform.d.ts +0 -18
- package/src/lib/feature/legend/hooks/useLegendMarkers.d.ts +0 -19
- package/src/lib/feature/legend/index.d.ts +0 -7
- package/src/lib/feature/legend/legendFacade.d.ts +0 -29
- package/src/lib/feature/legend/legendStore.d.ts +0 -43
- package/src/lib/feature/legend/legendStrategies/legendCollections.d.ts +0 -4
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/WorkOrderLegend.d.ts +0 -1
- package/src/lib/feature/legend/legendUpdater.d.ts +0 -2
- package/src/lib/feature/legend/legendVisibleDataStore.d.ts +0 -61
- package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +0 -11
- package/src/lib/feature/legend/types/legendStrategy.type.d.ts +0 -11
- package/src/lib/feature/legend/types/legendType.d.ts +0 -15
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0-beta-0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 0.7.0 < 0.8.0",
|
|
6
|
-
"@equinor/echo-components": ">= 0.11.0 < 0.12.0",
|
|
6
|
+
"@equinor/echo-components": ">= 0.11.0 < 0.12.0-beta-0",
|
|
7
7
|
"@equinor/echo-core": ">= 0.9.0 < 0.10.0",
|
|
8
8
|
"@equinor/echo-search": ">= 0.15.0 < 0.16.0",
|
|
9
9
|
"@equinor/echo-utils": ">= 0.4.0 < 0.5.0",
|
|
10
|
-
"@equinor/eds-core-react": "0.
|
|
11
|
-
"@equinor/eds-icons": "0.
|
|
10
|
+
"@equinor/eds-core-react": "0.43.0",
|
|
11
|
+
"@equinor/eds-icons": "0.22.0",
|
|
12
12
|
"react": ">= 17.0.2",
|
|
13
13
|
"react-dom": ">= 17.0.2",
|
|
14
14
|
"@tanstack/react-query": ">= 5.14.2 < 6",
|
package/src/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import './lib/globalStyles.css';
|
|
|
3
3
|
import { getPlantsInfo, getTagDetails } from './lib/services/api';
|
|
4
4
|
export * from './lib/components';
|
|
5
5
|
export { PrepviewButton } from './lib/components/prepviewButton/prepviewButton';
|
|
6
|
+
export { useFetchPlantInfo } from './lib/components/requestAccess/hooks/fetchPlantInfo';
|
|
6
7
|
export { RequestProCoSysAccess } from './lib/components/requestAccess/RequestProCoSysAccess';
|
|
7
8
|
export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAccess';
|
|
8
|
-
export { useFetchPlantInfo } from './lib/components/requestAccess/hooks/fetchPlantInfo';
|
|
9
9
|
export { WorkOrderListItem } from './lib/components/workOrderListItem';
|
|
10
10
|
export * from './lib/coreApplication';
|
|
11
11
|
export { fetchEquipmentFromApi } from './lib/feature/equipment/api/api-equipmentWithMeasuringPoints';
|
|
@@ -14,20 +14,17 @@ export * from './lib/feature/globalSelection';
|
|
|
14
14
|
export { SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
|
|
15
15
|
export type { OptimizedWorkOrderDto } from './lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
16
16
|
export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3DButton';
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
17
|
+
export { useAllItemsHiddenByUser } from './lib/feature/globalSelection/selectionMenu/hooks/useAllItemsHiddenByUser';
|
|
18
|
+
export { useSelectionMenuLists } from './lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuLists';
|
|
19
|
+
export { SelectionMenuDefaultListIds } from './lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store';
|
|
20
|
+
export type { SelectionMenuList } from './lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.types';
|
|
19
21
|
export * from './lib/feature/legacyLegend/index';
|
|
20
|
-
export * from './lib/feature/legend';
|
|
21
|
-
export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
|
|
22
|
-
export * from './lib/feature/legend/index';
|
|
23
|
-
export { subscribeToLegendDataChanged } from './lib/feature/legend/legendUpdater';
|
|
24
|
-
export type { LegendDataId, LegendEquipmentId, LegendState, LegendTagId } from './lib/feature/legend/types/legendType';
|
|
25
22
|
export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
|
|
26
23
|
export * from './lib/feature/measuringPoint/index';
|
|
27
24
|
export * from './lib/feature/measuringPoint/types/measuringPoint';
|
|
28
25
|
export * from './lib/feature/openItemsIn3d';
|
|
29
|
-
export { OpenIn3dSelectedItemsMenu } from './lib/feature/openItemsIn3d/OpenIn3dSelectedItemsMenu';
|
|
30
26
|
export { createEcho3dInternalLink } from './lib/feature/openItemsIn3d/logic/createEcho3dInternalLink';
|
|
27
|
+
export { OpenIn3dSelectedItemsMenu } from './lib/feature/openItemsIn3d/OpenIn3dSelectedItemsMenu';
|
|
31
28
|
export { WorkOrderContent } from './lib/feature/workOrder/WorkOrderContent';
|
|
32
29
|
export { RegisteredHookName } from './lib/hooks/hookLibrary';
|
|
33
30
|
export { useCloseActiveTopMenuAtBreakPoint } from './lib/hooks/useCloseActiveTopMenuAtBreakPoint';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GlobalSelectionTypes, OptimizedWorkOrderDto } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
-
import { GlobalSelectionCategoryId } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
3
2
|
export interface SelectionActionBarProps {
|
|
4
3
|
itemId: GlobalSelectionTypes.TagId | OptimizedWorkOrderDto;
|
|
5
|
-
|
|
4
|
+
listId: string;
|
|
6
5
|
}
|
|
7
6
|
export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
|
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
import { ResultValue, TagSummaryDto } from '@equinor/echo-search';
|
|
1
2
|
import { GlobalSelectionTypes } from './globalSelectionStore/globalSelectionStore.types';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A frozen object that provides various API methods for managing global selections.
|
|
5
|
+
*
|
|
6
|
+
* @constant
|
|
7
|
+
* @namespace globalSelectionApi
|
|
8
|
+
*
|
|
9
|
+
* @property {Function} removeItemsByListId - Removes items by their list ID.
|
|
10
|
+
*
|
|
11
|
+
* @property {Object} add - Contains methods for adding items.
|
|
12
|
+
* @property {Function} add.tags - Adds tags to the selection.
|
|
13
|
+
* @property {Function} add.workOrders - Adds work orders to the selection.
|
|
14
|
+
*
|
|
15
|
+
* @property {Object} search - Contains methods for searching items.
|
|
16
|
+
* @property {Function} search.isItemIdInList - Checks if an item ID is in the list.
|
|
17
|
+
* @property {Function} search.isItemIdInTheSelection - Checks if an item ID is in the selection.
|
|
18
|
+
* @property {Function} search.findListById - Finds a selection list by its ID.
|
|
19
|
+
*
|
|
20
|
+
* @property {Object} visibility - Contains methods for setting visibility.
|
|
21
|
+
* @property {Function} visibility.setByItemIds - Sets visibility by item IDs.
|
|
22
|
+
* @property {Function} visibility.setByListId - Sets visibility by list ID.
|
|
23
|
+
*
|
|
24
|
+
* @property {Object} errorStatus - Contains methods for managing error statuses.
|
|
25
|
+
* @property {Function} errorStatus.setByItemIds - Sets error status for items by their IDs.
|
|
26
|
+
* @property {Function} errorStatus.removeByItemIds - Removes error status for items by their IDs.
|
|
27
|
+
* @property {Function} errorStatus.reset - Resets item error statuses.
|
|
28
|
+
*/
|
|
3
29
|
export declare const globalSelectionApi: Readonly<{
|
|
4
30
|
/**
|
|
5
|
-
* @deprecated Use globalSelectionApi.remove.itemsById() instead
|
|
6
31
|
* Removes items from a specified list in the selection menu panel by their IDs.
|
|
7
32
|
*
|
|
8
33
|
* @param {Object} args - The arguments for removing items.
|
|
@@ -16,81 +41,61 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
16
41
|
listId: string;
|
|
17
42
|
itemIds: GlobalSelectionTypes.ItemId[];
|
|
18
43
|
}) => void;
|
|
19
|
-
remove: Readonly<{
|
|
20
|
-
/**
|
|
21
|
-
* Removes items from a specified list in the selection menu panel by their IDs.
|
|
22
|
-
*
|
|
23
|
-
* @param {Object} args - The arguments for removing items.
|
|
24
|
-
* @param {Readonly<GlobalSelectionTypes.ItemId[]>} args.itemIds - An array of item IDs representing the items to be removed.
|
|
25
|
-
* @param {Guid} args.groupId - Optional. The ID of the list where the subList of the items are located.
|
|
26
|
-
* Local selection will be used by default.
|
|
27
|
-
* @param {GlobalSelectionCategoryId} args.category - The ID of the list where the items to be removed are located.
|
|
28
|
-
*/
|
|
29
|
-
itemsById: (args: {
|
|
30
|
-
groupId?: import("dist/libs/echo-utils/src").Guid;
|
|
31
|
-
categoryId: GlobalSelectionCategoryId;
|
|
32
|
-
itemIds: GlobalSelectionTypes.ItemId[];
|
|
33
|
-
}) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Removes a group or category by ID from the selection store.
|
|
36
|
-
*
|
|
37
|
-
* If a categoryId is provided, it removes all items from the specified category within the group.
|
|
38
|
-
* If no categoryId is provided, it removes the entire group and all its items.
|
|
39
|
-
*
|
|
40
|
-
* @param {Object} args - The function arguments.
|
|
41
|
-
* @param {Guid} args.groupId - The ID of the group to remove.
|
|
42
|
-
* @param {GlobalSelectionCategoryId} [args.categoryId] - The ID of the category to remove (optional).
|
|
43
|
-
*/
|
|
44
|
-
listById: (args: {
|
|
45
|
-
groupId: import("dist/libs/echo-utils/src").Guid;
|
|
46
|
-
categoryId?: GlobalSelectionCategoryId;
|
|
47
|
-
}) => void;
|
|
48
|
-
}>;
|
|
49
44
|
add: Readonly<{
|
|
50
45
|
/**
|
|
51
46
|
* Adds tags to a specified list in the selection menu panel.
|
|
52
47
|
*
|
|
53
48
|
* @param {Object} args - The arguments for adding tags.
|
|
54
|
-
* @param {
|
|
55
|
-
* @param {Readonly<
|
|
49
|
+
* @param {string} args.listId - Optional - The ID of the list to which the tags should be added. If not provided, the default tag list ID is used.
|
|
50
|
+
* @param {Readonly<Readonly<TagSummaryDto>[]>} args.items - An array of TagSummaryDto objects representing the tags to be added.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* addTags({ listId: '123', items: [{ id: 'tag1', name: 'Tag 1' }, { id: 'tag2', name: 'Tag 2' }] });
|
|
56
54
|
*/
|
|
57
55
|
tags: (args: {
|
|
58
|
-
|
|
59
|
-
* Removes items from a specified list in the selection menu panel by their IDs.
|
|
60
|
-
*
|
|
61
|
-
* @param {Object} args - The arguments for removing items.
|
|
62
|
-
* @param {Readonly<GlobalSelectionTypes.ItemId[]>} args.itemIds - An array of item IDs representing the items to be removed.
|
|
63
|
-
* @param {Guid} args.groupId - Optional. The ID of the list where the subList of the items are located.
|
|
64
|
-
* Local selection will be used by default.
|
|
65
|
-
* @param {GlobalSelectionCategoryId} args.category - The ID of the list where the items to be removed are located.
|
|
66
|
-
*/: import("dist/libs/echo-utils/src").Guid;
|
|
56
|
+
listId?: string;
|
|
67
57
|
itemIds: Readonly<GlobalSelectionTypes.TagId[]>;
|
|
68
|
-
}) => Promise<import("
|
|
58
|
+
}) => Promise<import("@equinor/echo-search").ResultArray<TagSummaryDto>[]>;
|
|
69
59
|
/**
|
|
70
60
|
* Adds work orders to a specified list in the selection menu panel.
|
|
71
61
|
*
|
|
72
62
|
* @param {Object} args - The arguments for adding work orders.
|
|
73
|
-
* @param {
|
|
63
|
+
* @param {string} args.listId - Optional. The ID of the list to which the work orders should be added. If not provided, the default work order list ID is used.
|
|
74
64
|
* @param {Readonly<Readonly<OptimizedWorkOrderDto>[]>} args.items - An array of OptimizedWorkOrderDto objects representing the work orders to be added.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* addWorkOrders({ listId: '456', items: [{ id: 'wo1', name: 'Work Order 1' }, { id: 'wo2', name: 'Work Order 2' }] });
|
|
75
68
|
*/
|
|
76
69
|
workOrders: (args: {
|
|
77
|
-
|
|
70
|
+
listId?: string;
|
|
78
71
|
items: Readonly<Readonly<import("./globalSelectionStore/globalSelectionStore.types").OptimizedWorkOrderDto>[]>;
|
|
79
72
|
}) => void;
|
|
80
73
|
/**
|
|
81
74
|
* Adds items to a specified list in the selection menu panel.
|
|
82
75
|
*
|
|
83
76
|
* @param {Object} args - The arguments for adding items.
|
|
84
|
-
* @param {
|
|
77
|
+
* @param {string} args.listId - Optional. The ID of the list to which the items should be added. If not provided, the default list ID is used.
|
|
85
78
|
* @param {GlobalSelectionTypes.TagId | OptimizedWorkOrderDto)[]} args.itemIds - ItemIds to be added. Only tags or work orders can be added for now.
|
|
86
79
|
*
|
|
87
80
|
*/
|
|
88
81
|
addItems: (args: {
|
|
89
|
-
|
|
82
|
+
listId?: string;
|
|
90
83
|
itemIds: (GlobalSelectionTypes.TagId | import("./globalSelectionStore/globalSelectionStore.types").OptimizedWorkOrderDto)[];
|
|
91
84
|
}) => void;
|
|
92
85
|
}>;
|
|
93
|
-
search: {
|
|
86
|
+
search: Readonly<{
|
|
87
|
+
/**
|
|
88
|
+
* Checks if a given item ID is present in a specified list.
|
|
89
|
+
*
|
|
90
|
+
* @param args - An object containing the item ID and the list ID.
|
|
91
|
+
* @param {GlobalSelectionTypes.ItemId} args.itemId - The ID of the item to check for.
|
|
92
|
+
* @param {string} args.listId - The ID of the list to search within.
|
|
93
|
+
* @returns {boolean} A boolean indicating whether the item ID is found in the list.
|
|
94
|
+
*/
|
|
95
|
+
isItemIdInList: (args: {
|
|
96
|
+
itemId: GlobalSelectionTypes.ItemId;
|
|
97
|
+
listId: string;
|
|
98
|
+
}) => boolean;
|
|
94
99
|
/**
|
|
95
100
|
* Checks if a given item ID is present in the selection lists.
|
|
96
101
|
*
|
|
@@ -101,27 +106,33 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
101
106
|
isItemIdInTheSelection: (args: {
|
|
102
107
|
itemId: GlobalSelectionTypes.ItemId;
|
|
103
108
|
}) => boolean;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Finds a selection list by its ID from a given list of selection menu lists.
|
|
111
|
+
* If the list is not found at the top level, it searches within the sublists of each top-level list.
|
|
112
|
+
*
|
|
113
|
+
* @param args - The arguments object.
|
|
114
|
+
* @param {string} args.listId - The ID of the selection list to find.
|
|
115
|
+
* @returns {SelectionMenuList | undefined} The selection menu list with the specified ID, or `undefined` if not found.
|
|
116
|
+
*/
|
|
117
|
+
findListById: (listId: string) => import("./selectionMenu/selectionMenuStore/selectionMenu.store.types").SelectionMenuList | undefined;
|
|
118
|
+
}>;
|
|
108
119
|
visibility: Readonly<{
|
|
109
120
|
setByItemIds: (args: {
|
|
110
121
|
itemIds: Readonly<Readonly<GlobalSelectionTypes.ItemId>>[];
|
|
111
122
|
isVisible: boolean;
|
|
112
123
|
}) => void;
|
|
113
124
|
/**
|
|
114
|
-
* Sets the visibility of items in a specified list in
|
|
125
|
+
* Sets the visibility of items in a specified list in the selection menu store.
|
|
115
126
|
*
|
|
116
127
|
* @param {Object} args - The arguments for setting visibility.
|
|
117
|
-
* @param {
|
|
118
|
-
* @param {GlobalSelectionCategoryId} args.categoryId - Optional. The ID of the category for which the visibility should be set.
|
|
119
|
-
* If not passed, every item's visibility in the given group will be set.
|
|
128
|
+
* @param {string} args.listId - The ID of the list for which the visibility should be set.
|
|
120
129
|
* @param {boolean} args.isVisible - The visibility state to set for the items in the list.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* setVisibilityByListId({ listId: '123', isVisible: true });
|
|
121
133
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
categoryId?: GlobalSelectionCategoryId;
|
|
134
|
+
setByListId: (args: {
|
|
135
|
+
listId: string;
|
|
125
136
|
isVisible: boolean;
|
|
126
137
|
}) => void;
|
|
127
138
|
}>;
|
|
@@ -163,22 +174,38 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
163
174
|
*/
|
|
164
175
|
reset: () => void;
|
|
165
176
|
}>;
|
|
166
|
-
utils: Readonly<{
|
|
167
|
-
/**
|
|
168
|
-
* Calculates the total number of items in the selection.
|
|
169
|
-
* Each instance of the same item is counted separately.
|
|
170
|
-
*
|
|
171
|
-
* @param {SelectionTreeTypes.Group[]} [groups] - Optional list of groups to calculate the total number of items for. If not provided, the current state of the selection tree store is used.
|
|
172
|
-
* @returns {number} The total number of items in all categories of the given groups.
|
|
173
|
-
*/
|
|
174
|
-
numberOfItemsInSelection: (groups?: SelectionTreeTypes.Group[]) => number;
|
|
175
|
-
}>;
|
|
176
177
|
/**
|
|
177
178
|
* Removes all items from the selection menu panel.
|
|
178
179
|
*/
|
|
179
180
|
clearSelection: () => void;
|
|
180
|
-
createGroup: (args: {
|
|
181
|
-
label: string;
|
|
182
|
-
subLabel?: string;
|
|
183
|
-
}) => import("dist/libs/echo-utils/src").Guid | undefined;
|
|
184
181
|
}>;
|
|
182
|
+
interface UseGlobalSelectionStore {
|
|
183
|
+
addTagToSelection: (tagId: GlobalSelectionTypes.TagId) => Promise<ResultValue<TagSummaryDto>>;
|
|
184
|
+
removeItemFromSelection: (tagId: GlobalSelectionTypes.TagId) => void;
|
|
185
|
+
}
|
|
186
|
+
interface GlobalSelectionState {
|
|
187
|
+
resetItemErrorStatuses: typeof globalSelectionApi.errorStatus.reset;
|
|
188
|
+
setErrorStatusForItems: typeof globalSelectionApi.errorStatus.setByItemIds;
|
|
189
|
+
}
|
|
190
|
+
interface UseGlobalSelectionStoreFunction extends UseGlobalSelectionStore {
|
|
191
|
+
(): UseGlobalSelectionStore;
|
|
192
|
+
getState: () => GlobalSelectionState;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* @deprecated Do not use this! Will be removed soon.
|
|
196
|
+
* Only made for 3D team to maintain some legacy API they are using.
|
|
197
|
+
* Please use globalSelectionApi instead (find the new functions to call below)
|
|
198
|
+
*
|
|
199
|
+
* Old --> New
|
|
200
|
+
* ---------------------------------------------
|
|
201
|
+
* addTagToSelection() --> globalSelectionApi.add.tags()
|
|
202
|
+
* - Now returns with ResultArray instead of Result: Promise<ResultArray<TagSummaryDto>[]>
|
|
203
|
+
* removeItemFromSelection() --> globalSelectionApi.removeItemsByListId()
|
|
204
|
+
* - Now a listId is required as well.
|
|
205
|
+
* - Use SelectionMenuDefaultListIds.TagList from echo-framework for removing item from the default tag list.
|
|
206
|
+
*
|
|
207
|
+
* resetItemErrorStatuses() --> globalSelectionApi.errorStatus.reset()
|
|
208
|
+
* setErrorStatusForItems() --> globalSelectionApi.errorStatus.setByItemIds()
|
|
209
|
+
*/
|
|
210
|
+
export declare const useGlobalSelectionStore: UseGlobalSelectionStoreFunction;
|
|
211
|
+
export {};
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare function mapToId(item: GlobalSelectionTypes.WorkOrderId): GlobalSelectio
|
|
|
31
31
|
declare function mapToId(item: GlobalSelectionTypes.EquipmentId): GlobalSelectionTypes.EquipmentId;
|
|
32
32
|
declare function mapToId(item: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagId;
|
|
33
33
|
declare function mapToId(item: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemId;
|
|
34
|
-
declare function itemIdToString(itemId:
|
|
34
|
+
declare function itemIdToString(itemId: Record<string, string | number>): string;
|
|
35
35
|
/**
|
|
36
36
|
* A utility object that provides various functions for handling global selections.
|
|
37
37
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { globalSelectionApi } from './globalSelection.api';
|
|
1
|
+
export { globalSelectionApi, useGlobalSelectionStore } from './globalSelection.api';
|
|
2
2
|
export * from './globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStore.utils';
|
|
4
4
|
export { convertGlobalSelectionItemsToPlantTagPairs } from './globalSelectionStore/globalSelectionStoreHelpers';
|
|
@@ -6,7 +6,4 @@ export { useGlobalSelectionItems } from './hooks/useGlobalSelectionItems';
|
|
|
6
6
|
export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
|
|
7
7
|
export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
|
|
8
8
|
export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
|
|
9
|
-
export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesByGroupId';
|
|
10
9
|
export { OpenGlobalSelectionIn3DButton } from './OpenGlobalSelectionIn3DButton';
|
|
11
|
-
export { useSelectionMenuGroups } from './selectionMenu/hooks/useSelectionMenuGroups';
|
|
12
|
-
export * from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { Guid } from '@equinor/echo-utils';
|
|
2
|
-
interface useIsAllIGlobalSelectionItemsHiddenArgs {
|
|
3
|
-
groupId: Guid;
|
|
4
|
-
categoryId?: string;
|
|
5
|
-
}
|
|
6
1
|
/**
|
|
7
2
|
* Custom hook to determine if all items in a selection list are hidden by the user.
|
|
8
3
|
*
|
|
9
|
-
* @param {
|
|
10
|
-
* @param {string} [categoryId] - The ID of the category, inside the given list group.
|
|
4
|
+
* @param {string} listId - The ID of the selection list to check.
|
|
11
5
|
* @returns {boolean} - A boolean indicating whether all items in the list are hidden by the user.
|
|
12
6
|
*
|
|
13
7
|
* This hook uses the `useGlobalSelectionLists` hook to get the current global selection state and
|
|
@@ -15,5 +9,4 @@ interface useIsAllIGlobalSelectionItemsHiddenArgs {
|
|
|
15
9
|
*
|
|
16
10
|
* The hook returns `true` if all items in the list are hidden by the user, and `false` otherwise.
|
|
17
11
|
*/
|
|
18
|
-
export declare const
|
|
19
|
-
export {};
|
|
12
|
+
export declare const useAllItemsHiddenByUser: (listId: string) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SelectionMenuList } from '../selectionMenuStore/selectionMenu.store.types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to get the selection menu lists from the selection menu store, displayed in the left selection panel.
|
|
4
|
+
*
|
|
5
|
+
* @returns {SelectionMenuList[]} - An array of selection menu lists.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSelectionMenuLists(): SelectionMenuList[];
|
package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SelectionMenuStore } from './selectionMenu.store.types';
|
|
2
|
+
export declare enum SelectionMenuDefaultListIds {
|
|
3
|
+
TagList = "DEFAULT_TAG_LIST_ID",
|
|
4
|
+
WorkOrderList = "DEFAULT_WORK_ORDER_LIST_ID"
|
|
5
|
+
}
|
|
6
|
+
export declare const useSelectionMenuStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<SelectionMenuStore>, "setState"> & {
|
|
7
|
+
setState<A extends string | {
|
|
8
|
+
type: string;
|
|
9
|
+
}>(partial: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: SelectionMenuStore) => SelectionMenuStore | Partial<SelectionMenuStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
10
|
+
}, "subscribe"> & {
|
|
11
|
+
subscribe: {
|
|
12
|
+
(listener: (selectedState: SelectionMenuStore, previousSelectedState: SelectionMenuStore) => void): () => void;
|
|
13
|
+
<U>(selector: (state: SelectionMenuStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
14
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
15
|
+
fireImmediately?: boolean;
|
|
16
|
+
} | undefined): () => void;
|
|
17
|
+
};
|
|
18
|
+
}, "setState"> & {
|
|
19
|
+
setState(nextStateOrUpdater: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: import("immer").WritableDraft<SelectionMenuStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
20
|
+
type: string;
|
|
21
|
+
} | undefined): void;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a snapshot of the current selection menu store state.
|
|
25
|
+
*
|
|
26
|
+
* Selection menu: left panel, which holds items from global selection.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getSelectionMenuStoreSnapshot(): SelectionMenuStore;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
|
|
2
|
+
import { Guid } from '@equinor/echo-utils';
|
|
3
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, OptimizedWorkOrderDto } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
4
|
+
import { SelectionMenuDefaultListIds } from './selectionMenu.store';
|
|
5
|
+
export type SelectionMenuItem = SelectionMenuTag | SelectionMenuWorkOrder | SelectionMenuEquipment;
|
|
6
|
+
export interface SelectionMenuTag {
|
|
7
|
+
id: GlobalSelectionTypes.TagId;
|
|
8
|
+
type: GlobalSelectionItemType.Tag;
|
|
9
|
+
}
|
|
10
|
+
export interface SelectionMenuWorkOrder {
|
|
11
|
+
id: GlobalSelectionTypes.WorkOrderId;
|
|
12
|
+
type: GlobalSelectionItemType.WorkOrder;
|
|
13
|
+
}
|
|
14
|
+
export interface SelectionMenuEquipment {
|
|
15
|
+
id: GlobalSelectionTypes.EquipmentId;
|
|
16
|
+
type: GlobalSelectionItemType.Equipment;
|
|
17
|
+
}
|
|
18
|
+
export type SelectionMenuList = SelectionMenuWithItems | SelectionMenuWithSubLists;
|
|
19
|
+
interface SelectionMenuBase {
|
|
20
|
+
id: Guid | SelectionMenuDefaultListIds;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
interface SelectionMenuWithItems extends SelectionMenuBase {
|
|
24
|
+
items: SelectionMenuItem[];
|
|
25
|
+
subLists?: never;
|
|
26
|
+
}
|
|
27
|
+
interface SelectionMenuWithSubLists extends SelectionMenuBase {
|
|
28
|
+
subLists: SelectionMenuWithItems[];
|
|
29
|
+
items?: never;
|
|
30
|
+
}
|
|
31
|
+
export interface SelectionMenuStore {
|
|
32
|
+
lists: SelectionMenuList[];
|
|
33
|
+
addItems: (args: {
|
|
34
|
+
listId?: string;
|
|
35
|
+
itemIds: (GlobalSelectionTypes.TagId | OptimizedWorkOrderDto)[];
|
|
36
|
+
}) => void;
|
|
37
|
+
addTags: (args: {
|
|
38
|
+
listId?: string;
|
|
39
|
+
itemIds: Readonly<GlobalSelectionTypes.TagId[]>;
|
|
40
|
+
}) => Promise<ResultArray<TagSummaryDto>[]>;
|
|
41
|
+
addWorkOrders: (args: {
|
|
42
|
+
listId?: string;
|
|
43
|
+
items: Readonly<Readonly<OptimizedWorkOrderDto>[]>;
|
|
44
|
+
}) => void;
|
|
45
|
+
addList: (args: SelectionMenuList) => void;
|
|
46
|
+
removeItemsByListId: (args: {
|
|
47
|
+
listId: string;
|
|
48
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
49
|
+
}) => void;
|
|
50
|
+
setVisibilityByListId: (args: {
|
|
51
|
+
listId: string;
|
|
52
|
+
isVisible: boolean;
|
|
53
|
+
}) => void;
|
|
54
|
+
resetState: () => void;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import { SelectionMenuList } from './selectionMenu.store.types';
|
|
3
|
+
/**
|
|
4
|
+
* Finds a selection list by its ID from a given list of selection menu lists.
|
|
5
|
+
* If the list is not found at the top level, it searches within the sublists of each top-level list.
|
|
6
|
+
*
|
|
7
|
+
* @param args - The arguments object.
|
|
8
|
+
* @param {string} args.listId - The ID of the selection list to find.
|
|
9
|
+
* @param {SelectionMenuList[]} args.lists - An optional array of selection menu lists to search within.
|
|
10
|
+
* If not provided, the function will use the lists from the selection menu store state.
|
|
11
|
+
* If you want to alter the store state, you should provide the lists as an argument.
|
|
12
|
+
* @returns {SelectionMenuList | undefined} The selection menu list with the specified ID, or `undefined` if not found.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findSelectionListById(args: {
|
|
15
|
+
listId: string;
|
|
16
|
+
lists: SelectionMenuList[];
|
|
17
|
+
}): SelectionMenuList | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a given item ID is present in a specified list.
|
|
20
|
+
*
|
|
21
|
+
* @param args - An object containing the item ID and the list ID.
|
|
22
|
+
* @param {GlobalSelectionTypes.ItemId} args.itemId - The ID of the item to check for.
|
|
23
|
+
* @param {string} args.listId - The ID of the list to search within.
|
|
24
|
+
* @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
|
|
25
|
+
* @returns {boolean} A boolean indicating whether the item ID is found in the list.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isItemIdInList(args: {
|
|
28
|
+
itemId: GlobalSelectionTypes.ItemId;
|
|
29
|
+
listId: string;
|
|
30
|
+
lists: SelectionMenuList[];
|
|
31
|
+
}): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a given item ID is present in the selection lists.
|
|
34
|
+
*
|
|
35
|
+
* @param args - An object containing the item ID to check.
|
|
36
|
+
* @param {GlobalSelectionTypes.ItemId} args.itemId - The item ID to check for presence in the selection lists.
|
|
37
|
+
* @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
|
|
38
|
+
* @returns {boolean} A boolean indicating whether the item ID is present in the selection lists.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isItemIdInTheSelection(args: {
|
|
41
|
+
itemId?: GlobalSelectionTypes.ItemId;
|
|
42
|
+
lists: SelectionMenuList[];
|
|
43
|
+
}): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves an array of itemIds that were not found in the selection menu.
|
|
46
|
+
*
|
|
47
|
+
* @param {Object} args - The arguments containing the list and itemIds to check.
|
|
48
|
+
* @param {SelectionMenuList[]} args.list - The list of SelectionMenuList objects to search through.
|
|
49
|
+
* @param {GlobalSelectionTypes.ItemId[]} args.itemIds - An array of ItemId objects to check for presence in the list.
|
|
50
|
+
* @returns {string[]} An array of itemId strings that correspond to counts of 0 in the selection menu.
|
|
51
|
+
* itemIds object values are concatenated via '-' char
|
|
52
|
+
*/
|
|
53
|
+
export declare function itemsNotFoundInSelectionMenu(args: {
|
|
54
|
+
lists: SelectionMenuList[];
|
|
55
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
56
|
+
}): string[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Guid } from '@equinor/echo-utils';
|
|
2
|
-
import { SelectionTreeTypes } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
3
|
-
/**
|
|
4
|
-
* Custom hook to get the selection categories by group ID from the global selection tree hiearchy.
|
|
5
|
-
*
|
|
6
|
-
* This hook retrieves the categories for a given group ID from the selection tree store.
|
|
7
|
-
*
|
|
8
|
-
* @param {Guid} groupId - The ID of the group to get categories for.
|
|
9
|
-
* @returns {SelectionTreeTypes.Category[] | undefined} The categories for the given group ID, or undefined if not found.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useSelectionCategoriesByGroupId(groupId: Guid): SelectionTreeTypes.Category[] | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SelectionTreeTypes } from '../selectionTreeStore/selectionTree.store.types';
|
|
2
|
-
/**
|
|
3
|
-
* Custom hook to get the selection menu lists from the selection menu store, displayed in the left selection panel.
|
|
4
|
-
*
|
|
5
|
-
* @returns {SelectionTreeTypes.Group[]} - An array of selection menu lists.
|
|
6
|
-
*/
|
|
7
|
-
export declare function useSelectionMenuGroups(): SelectionTreeTypes.Group[];
|
package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { SelectionTreeStore } from './selectionTree.store.types';
|
|
2
|
-
/**
|
|
3
|
-
* Store for the selection menu, in a left panel.
|
|
4
|
-
*
|
|
5
|
-
* Stores the hierachry, tree structure of the items in Global Selection.
|
|
6
|
-
* With this, it is in charge of:
|
|
7
|
-
* - tracking which item belongs to which list
|
|
8
|
-
* - adding items to global selection
|
|
9
|
-
* - remove items from global selection
|
|
10
|
-
* - update items (visibility, removal etc.) via list ids
|
|
11
|
-
* - maintaining the global selection store based on the changes in the items, in the selection menu panel
|
|
12
|
-
*
|
|
13
|
-
* You shouldn't use this store directly in any code, unless you have very special reason to do so.
|
|
14
|
-
*
|
|
15
|
-
* For accessing and using global selection features, use the globalSelectionApi from echo-framework.
|
|
16
|
-
*/
|
|
17
|
-
export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<SelectionTreeStore>, "setState"> & {
|
|
18
|
-
setState<A extends string | {
|
|
19
|
-
type: string;
|
|
20
|
-
}>(partial: SelectionTreeStore | Partial<SelectionTreeStore> | ((state: SelectionTreeStore) => SelectionTreeStore | Partial<SelectionTreeStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
21
|
-
}, "subscribe"> & {
|
|
22
|
-
subscribe: {
|
|
23
|
-
(listener: (selectedState: SelectionTreeStore, previousSelectedState: SelectionTreeStore) => void): () => void;
|
|
24
|
-
<U>(selector: (state: SelectionTreeStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
25
|
-
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
26
|
-
fireImmediately?: boolean;
|
|
27
|
-
} | undefined): () => void;
|
|
28
|
-
};
|
|
29
|
-
}, "setState"> & {
|
|
30
|
-
setState(nextStateOrUpdater: SelectionTreeStore | Partial<SelectionTreeStore> | ((state: import("immer").WritableDraft<SelectionTreeStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
31
|
-
type: string;
|
|
32
|
-
} | undefined): void;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Get a snapshot of the current selection tree store state.
|
|
36
|
-
*/
|
|
37
|
-
export declare function getSelectionTreeStoreSnapshot(): SelectionTreeStore;
|