@equinor/echo-framework 5.0.0-beta-r19 → 5.0.0-beta-r19-1
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 +2 -2
- package/package.json +8 -8
- package/src/index.d.ts +4 -4
- package/src/lib/components/prepview/panels/objects/objects.logic.d.ts +7 -0
- package/src/lib/components/prepview/panels/objects/objects.utils.d.ts +14 -0
- package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/AddSelectionListWithSameNameDialog.d.ts +8 -0
- package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/SelectionActionBarMultiple.d.ts +9 -0
- package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.colors.d.ts +2 -0
- package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.constants.d.ts +1 -0
- package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.logic.d.ts +4 -0
- package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.orchestration.d.ts +10 -0
- package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.utils.d.ts +3 -0
- package/src/lib/components/prepview/panels/tagDocumentRefs/HorizontalDocumentGroups.d.ts +1 -1
- package/src/lib/feature/equipment/components/fullEquipmentItem/fullEquipmentItem.d.ts +3 -3
- package/src/lib/feature/globalSelection/components/selectionActionBar/SelectionActionBar.d.ts +14 -0
- package/src/lib/feature/globalSelection/components/selectionActionBar/SelectionActionBarMenuItem.d.ts +12 -0
- package/src/lib/feature/globalSelection/components/selectionActionBar/hooks/useSelectionAction.d.ts +28 -0
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +3 -2
- package/src/lib/feature/globalSelection/globalSelectionColorService.d.ts +3 -3
- package/src/lib/feature/globalSelection/globalSelectionColorService.types.d.ts +1 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsByStrategy.action.d.ts +17 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +13 -16
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +9 -16
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +2 -36
- package/src/lib/feature/globalSelection/globalSelectionStore/selectionActionFeedbackStore.d.ts +30 -0
- package/src/lib/feature/globalSelection/hooks/useGlobalSelectionLists.d.ts +5 -3
- package/src/lib/feature/globalSelection/hooks/useIsInGlobalSelection.d.ts +0 -1
- package/src/lib/feature/globalSelection/hooks/useSelectionCategoriesByGroupId.d.ts +3 -2
- package/src/lib/feature/globalSelection/index.d.ts +2 -2
- package/src/lib/feature/globalSelection/selectionMenu/hooks/{useIsAllIGlobalSelectionItemsHidden.d.ts → useIsAllGlobalSelectionItemsHidden.d.ts} +4 -6
- package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionColorFrequency.d.ts +5 -2
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addItems.action.d.ts +5 -4
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeAllItemsById.action.d.ts +1 -1
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeItemsById.action.d.ts +1 -1
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +5 -4
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +11 -11
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +4 -3
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +9 -7
- package/src/lib/feature/globalSelection/strategies/equipmentSelection.strategy.d.ts +3 -0
- package/src/lib/feature/globalSelection/strategies/index.d.ts +2 -0
- package/src/lib/feature/globalSelection/strategies/isItemIdOfType.d.ts +2 -0
- package/src/lib/feature/globalSelection/strategies/measuringPointSelection.strategy.d.ts +3 -0
- package/src/lib/feature/globalSelection/strategies/registerStrategies.d.ts +1 -0
- package/src/lib/feature/globalSelection/strategies/selectionItemTypeRegistry.d.ts +37 -0
- package/src/lib/feature/globalSelection/strategies/selectionItemTypeStrategy.types.d.ts +50 -0
- package/src/lib/feature/globalSelection/strategies/tagSelection.strategy.d.ts +3 -0
- package/src/lib/feature/globalSelection/strategies/workOrderSelection.strategy.d.ts +3 -0
- package/src/lib/feature/legend/components/BasicLegendRenderer.d.ts +1 -1
- package/src/lib/feature/legend/components/LegendSelectorContainer.d.ts +17 -0
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/ItemMarkerPopoverContainer.d.ts +9 -0
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MarkerWithPopover.d.ts +1 -1
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/multipleMarkersBySingleLegend.logic.d.ts +1 -1
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/useStalePopoverMarkers.d.ts +3 -3
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts +1 -2
- package/src/lib/feature/legend/components/pdfMarkers/utils/markerId.utils.d.ts +1 -2
- package/src/lib/feature/legend/components/popover/LegendPopoverContent.d.ts +9 -26
- package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +12 -6
- package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +0 -4
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.utils.d.ts +1 -1
- package/src/lib/feature/legend/hooks/useLegendUniqueBadges.d.ts +1 -3
- package/src/lib/feature/legend/hooks/useLegendUniqueMarkers.d.ts +1 -3
- package/src/lib/feature/legend/index.d.ts +8 -5
- package/src/lib/feature/legend/legendAnalytics.d.ts +1 -1
- package/src/lib/feature/legend/legendFacade.d.ts +8 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/api/fetchNotificationDetailsByIds.d.ts +8 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/api/notificationsLegend.api.d.ts +7 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/components/NotificationPopover.d.ts +8 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationDetailsByIds.d.ts +2 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationLegendData.d.ts +5 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationMarkers.d.ts +10 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useOpenNotificationsByTagIds.d.ts +14 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/getNotificationPopover.d.ts +6 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/notificationLegend.logic.d.ts +12 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/notificationStrategy.types.d.ts +13 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/optionConfigs/notificationBadgeLegendOptionConfig.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/optionConfigs/notificationMarkerLegendOptionConfig.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/testing/createTestNotification.d.ts +2 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getColorForNotificationLegendStatus.d.ts +7 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getNotificationTitlesByPropertyName.d.ts +2 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/notificationLegend.utils.d.ts +17 -0
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/workOrder.utils.d.ts +14 -0
- package/src/lib/feature/legend/logic/getColorForLegendStatus.d.ts +5 -0
- package/src/lib/feature/legend/logic/normalizeBadges.d.ts +25 -12
- package/src/lib/feature/legend/logic/propertyAccessor.utils.d.ts +36 -0
- package/src/lib/feature/legend/stores/initializeLegendInStores.d.ts +3 -4
- package/src/lib/feature/legend/stores/legendDataStore/legendStore.d.ts +0 -1
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +3 -14
- package/src/lib/feature/legend/stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore.d.ts +8 -0
- package/src/lib/feature/legend/types/legendStrategy.type.d.ts +6 -6
- package/src/lib/feature/legend/types/legendType.d.ts +26 -19
- package/src/lib/feature/measuringPoint/index.d.ts +1 -1
- package/src/lib/feature/openItemsIn3d/logic/createEcho3dInternalLink.d.ts +1 -0
- package/src/lib/feature/shared/markerId.types.d.ts +11 -0
- package/src/lib/hooks/useOpenPdfFile.d.ts +12 -0
- package/src/lib/hooks/useScreenValues.d.ts +2 -2
- package/src/lib/services/dataLayerPanel/dataLayerPanel.store.d.ts +2 -0
- package/src/lib/utils/index.d.ts +1 -0
- package/src/lib/utils/notification.utils.d.ts +2 -0
- package/src/lib/feature/globalSelection/components/SelectionActionBar/SelectionFeedbackDisplay.d.ts +0 -7
- package/src/lib/feature/globalSelection/components/SelectionActionBar/selectionFeedback.types.d.ts +0 -1
- package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +0 -7
- package/src/lib/feature/globalSelection/components/SelectionMenuTrigger/SelectionGroupMenuItem.d.ts +0 -9
- package/src/lib/feature/globalSelection/components/SelectionMenuTrigger/SelectionMenuTrigger.d.ts +0 -12
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addEquipmentsToSelection.action.d.ts +0 -7
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelectionFactory.d.ts +0 -21
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addMeasuringPointsToSelection.action.d.ts +0 -7
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +0 -12
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addWorkOrdersToSelection.action.d.ts +0 -7
- package/src/lib/feature/globalSelection/hooks/useSelectionAction.d.ts +0 -21
- package/src/lib/feature/legend/components/legendTextSelector/LegendTextSelector.d.ts +0 -20
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverPrimaryRow.d.ts +0 -15
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverThirdRow.d.ts +0 -16
- package/src/lib/icons/index.d.ts +0 -13
- package/src/lib/icons/search.d.ts +0 -3
- /package/src/lib/feature/globalSelection/components/{RemoveSelectionItemsConfirmDialog.d.ts → selectionActionBar/RemoveSelectionItemsConfirmDialog.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "5.0.0-beta-r19",
|
|
3
|
+
"version": "5.0.0-beta-r19-1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@equinor/echo-base": "5.0.0-beta-r19",
|
|
6
|
-
"@equinor/echo-components": "5.0.0-beta-r19",
|
|
7
|
-
"@equinor/echo-core": "5.0.0-beta-r19",
|
|
8
|
-
"@equinor/echo-search": "5.0.0-beta-r19",
|
|
9
|
-
"@equinor/echo-utils": "5.0.0-beta-r19",
|
|
5
|
+
"@equinor/echo-base": "5.0.0-beta-r19-1",
|
|
6
|
+
"@equinor/echo-components": "5.0.0-beta-r19-1",
|
|
7
|
+
"@equinor/echo-core": "5.0.0-beta-r19-1",
|
|
8
|
+
"@equinor/echo-search": "5.0.0-beta-r19-1",
|
|
9
|
+
"@equinor/echo-utils": "5.0.0-beta-r19-1",
|
|
10
10
|
"@equinor/eds-core-react": "0.49.0",
|
|
11
11
|
"@equinor/eds-icons": "0.22.0",
|
|
12
12
|
"@equinor/eds-tokens": "2.1.0",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"react-router-dom": ">= 6.30.3 < 7",
|
|
20
20
|
"zustand": ">= 4.4.7 < 5",
|
|
21
21
|
"immer": ">= 11.1.4 < 12.0.0",
|
|
22
|
-
"msw": "2.
|
|
22
|
+
"msw": ">= 2.0.0 < 3",
|
|
23
23
|
"date-fns": "4.1.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"dexie": "4.
|
|
26
|
+
"dexie": "4.4.2",
|
|
27
27
|
"mark.js": "8.11.1",
|
|
28
28
|
"ag-charts-community": "12.3.1",
|
|
29
29
|
"ag-charts-react": "12.3.1",
|
package/src/index.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ export { ReturnToExternalAppButton } from './lib/feature/echoView/ReturnToExtern
|
|
|
19
19
|
export { fetchEquipmentFromApi } from './lib/feature/equipment/api/api-equipmentWithMeasuringPoints';
|
|
20
20
|
export * from './lib/feature/equipment/index';
|
|
21
21
|
export * from './lib/feature/globalSelection';
|
|
22
|
-
export { SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
|
|
22
|
+
export { ItemDetailsSelectionActionBar, SelectionActionBar } from './lib/feature/globalSelection/components/selectionActionBar/SelectionActionBar';
|
|
23
23
|
export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3DButton';
|
|
24
|
-
export {
|
|
24
|
+
export { useIsAllGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllGlobalSelectionItemsHidden';
|
|
25
25
|
export { useSelectionColorFrequencyByIds } from './lib/feature/globalSelection/selectionMenu/hooks/useSelectionColorFrequency';
|
|
26
26
|
export { useSelectionTreeAutoSave } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/useSelectionTreeAutoSave';
|
|
27
27
|
export { GlobalSelectionCategoryId } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
@@ -137,8 +137,8 @@ declare const EchoFramework: Readonly<{
|
|
|
137
137
|
usePlantAvailableIn3dWeb(plantCode?: string): boolean;
|
|
138
138
|
useScreenOrientation(): import("./lib/types/hookLibrary").ScreenOrientation;
|
|
139
139
|
useScreenValues(): {
|
|
140
|
-
isScreenMobileSize: boolean;
|
|
141
|
-
screenOrientation: import("./lib/types/hookLibrary").ScreenOrientation;
|
|
140
|
+
readonly isScreenMobileSize: boolean;
|
|
141
|
+
readonly screenOrientation: import("./lib/types/hookLibrary").ScreenOrientation;
|
|
142
142
|
};
|
|
143
143
|
useSelectionGroupLabelsPerItem: () => Map<string, string[]>;
|
|
144
144
|
useTabTitle(): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GlobalSelectionTypes } from '../../../../feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import type { PrepviewObject } from '../../types/workorder';
|
|
3
|
+
export declare function fetchWorkOrderObjectsWithSelectionIds(workOrderId: string): Promise<{
|
|
4
|
+
workOrderObjects: PrepviewObject[];
|
|
5
|
+
tagIds: GlobalSelectionTypes.TagId[];
|
|
6
|
+
equipmentIds: GlobalSelectionTypes.EquipmentId[];
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../../../feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import type { PrepviewObject } from '../../types/workorder';
|
|
3
|
+
/**
|
|
4
|
+
* Extracts tag IDs from the given work order objects.
|
|
5
|
+
* @param workOrderObjects The work order objects to extract tag IDs from.
|
|
6
|
+
* @returns A promise that resolves to an array of tag IDs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractTagIdsFromWorkOrderObjects(workOrderObjects: ReadonlyArray<PrepviewObject>): Promise<GlobalSelectionTypes.TagId[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Extracts equipment IDs from the given work order objects.
|
|
11
|
+
* @param workOrderObjects The work order objects to extract equipment IDs from.
|
|
12
|
+
* @returns An array of equipment IDs.
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractEquipmentIdsFromWorkOrderObjects(workOrderObjects: ReadonlyArray<PrepviewObject>): GlobalSelectionTypes.EquipmentId[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AddSelectionListWithSameNameDialogProps {
|
|
3
|
+
readonly isOpen: boolean;
|
|
4
|
+
readonly onClose: () => void;
|
|
5
|
+
readonly onAddNewList: () => void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare const AddSelectionListWithSameNameDialog: React.FC<AddSelectionListWithSameNameDialogProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../../../../feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
export interface SelectionActionBarMultipleProps {
|
|
3
|
+
readonly selectionItemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
4
|
+
readonly hiddenSelectionItemIds?: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
5
|
+
readonly labelSelectionGroup: string;
|
|
6
|
+
readonly subLabelSelectionGroup?: string;
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const SelectionActionBarMultiple: React.FC<SelectionActionBarMultipleProps>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { GlobalSelectionItemType } from '../../../../../../feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
export declare function getUniqueSelectionItemTypes(itemTypes: ReadonlyArray<GlobalSelectionItemType>): ReadonlyArray<GlobalSelectionItemType>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OBJECT_LIST_FOR_WORK_ORDER_LABEL_PREFIX = "Object list for WO ";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { GlobalSelectionTypes } from '../../../../../../feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
export declare function findWorkOrderColorInSelection(hiddenSelectionItemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>): string | undefined;
|
|
4
|
+
export declare function overrideGroupItemColors(groupId: Guid, color: string): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { type GlobalSelectionTypes } from '../../../../../../feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
import { SelectionTreeTypes } from '../../../../../../feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
4
|
+
export declare function addSelectionItemsToNewSelectionGroup(args: {
|
|
5
|
+
readonly selectionItemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
6
|
+
readonly hiddenSelectionItemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly subLabel: string;
|
|
9
|
+
readonly selectionGroups: ReadonlyArray<SelectionTreeTypes.Group>;
|
|
10
|
+
}): Promise<Guid>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SelectionTreeTypes } from '../../../../../../feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
2
|
+
export declare function doesSelectionGroupLabelExist(label: string, groups: ReadonlyArray<SelectionTreeTypes.Group>): boolean;
|
|
3
|
+
export declare function getNextAvailableGroupLabel(label: string, groups: ReadonlyArray<SelectionTreeTypes.Group>): string;
|
|
@@ -3,5 +3,5 @@ interface HorizontalDocumentGroupsProps {
|
|
|
3
3
|
documentGroups: Array<PrepviewDocumentGroup>;
|
|
4
4
|
tagNo: string;
|
|
5
5
|
}
|
|
6
|
-
declare function HorizontalDocumentGroups({ documentGroups, tagNo
|
|
6
|
+
declare function HorizontalDocumentGroups({ documentGroups, tagNo }: HorizontalDocumentGroupsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { HorizontalDocumentGroups };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface FullEquipmentItemProps {
|
|
2
|
-
equipmentId: string;
|
|
3
|
-
tagNo: string | undefined;
|
|
4
|
-
plantNo: string | undefined;
|
|
2
|
+
readonly equipmentId: string;
|
|
3
|
+
readonly tagNo: string | undefined;
|
|
4
|
+
readonly plantNo: string | undefined;
|
|
5
5
|
}
|
|
6
6
|
export declare const FullEquipmentItem: React.FC<FullEquipmentItemProps>;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MarkerId } from '../../../shared/markerId.types';
|
|
2
|
+
import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
export interface SelectionActionBarProps {
|
|
4
|
+
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
5
|
+
readonly className?: string;
|
|
6
|
+
/** MarkerId of the marker that owns this action bar. Scopes feedback to this popover only. */
|
|
7
|
+
readonly markerId?: MarkerId;
|
|
8
|
+
}
|
|
9
|
+
export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
|
|
10
|
+
/**
|
|
11
|
+
* Simple wrapper to apply custom styles to the SelectionActionBar when used in the ItemDetails pages,
|
|
12
|
+
* without affecting the SelectionActionBar used elsewhere.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ItemDetailsSelectionActionBar: (props: SelectionActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
import { type SelectionGroup } from '../../selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
4
|
+
interface SelectionActionBarMenuItemProps {
|
|
5
|
+
readonly isInGroup: boolean;
|
|
6
|
+
readonly group: SelectionGroup;
|
|
7
|
+
readonly addToSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => void;
|
|
8
|
+
readonly removeFromSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => void;
|
|
9
|
+
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
10
|
+
}
|
|
11
|
+
export declare const SelectionActionBarMenuItem: (props: SelectionActionBarMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
package/src/lib/feature/globalSelection/components/selectionActionBar/hooks/useSelectionAction.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import type { MarkerId } from '../../../../shared/markerId.types';
|
|
3
|
+
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
4
|
+
/**
|
|
5
|
+
* Hook to manage selection actions for global selection.
|
|
6
|
+
*
|
|
7
|
+
* Feedback state (isFeedbackActive, feedbackType, actionMarkerId) is stored in a dedicated
|
|
8
|
+
* micro Zustand store so it survives component remounts during the stale-marker holding period
|
|
9
|
+
* (e.g. when a remove action causes the colored marker variant to disappear and
|
|
10
|
+
* useStalePopoverMarkers briefly unmounts/remounts the popover tree).
|
|
11
|
+
*
|
|
12
|
+
* While isFeedbackActive is true, useMarkerPopover delays popover content refresh and
|
|
13
|
+
* useStalePopoverMarkers keeps the old marker rendered so the feedback stays visible —
|
|
14
|
+
* but only for the marker identified by actionPopoverId, not globally.
|
|
15
|
+
*
|
|
16
|
+
* @param markerId - Optional ID of the popover that owns this action bar. When provided,
|
|
17
|
+
* feedback state is scoped to this popover: only the matching popover sees feedback,
|
|
18
|
+
* and other popovers remain unaffected. Pass `undefined` for non-popover contexts
|
|
19
|
+
* (e.g. ItemDetails pages).
|
|
20
|
+
* @returns Object containing loading state, feedback type, and functions to add/remove items from selection.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSelectionAction(markerId?: MarkerId): {
|
|
23
|
+
isFeedbackActive: boolean;
|
|
24
|
+
feedbackType: import("@equinor/echo-components").SelectionBarFeedbackType | undefined;
|
|
25
|
+
addToSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => Promise<void>;
|
|
26
|
+
removeFromSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => void;
|
|
27
|
+
changeColor: (itemId: GlobalSelectionTypes.ItemId, color: string) => void;
|
|
28
|
+
};
|
|
@@ -29,7 +29,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
29
29
|
itemsById: (args: {
|
|
30
30
|
groupId?: import("@equinor/echo-utils").Guid;
|
|
31
31
|
categoryId: GlobalSelectionCategoryId;
|
|
32
|
-
itemIds: GlobalSelectionTypes.ItemId
|
|
32
|
+
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
33
33
|
}) => void;
|
|
34
34
|
/**
|
|
35
35
|
* Removes all items by their IDs, from all groups, from the state.
|
|
@@ -109,8 +109,9 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
109
109
|
*
|
|
110
110
|
*/
|
|
111
111
|
addItems: (args: {
|
|
112
|
-
itemIds: GlobalSelectionTypes.ItemId
|
|
112
|
+
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
113
113
|
groupId?: import("@equinor/echo-utils").Guid;
|
|
114
|
+
useDefaultSelectionTypeColors?: boolean;
|
|
114
115
|
}) => Promise<void>;
|
|
115
116
|
}>;
|
|
116
117
|
search: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SelectionColor } from './globalSelectionColorService.types';
|
|
1
2
|
import { GlobalSelectionItemType } from './globalSelectionStore/globalSelectionStore.types';
|
|
2
3
|
type ColorServiceState = {
|
|
3
4
|
/**
|
|
@@ -43,8 +44,7 @@ export declare const SELECTION_COLOR_PICKER_COLORS: Readonly<string>[];
|
|
|
43
44
|
declare const UNIFIED_COLOR_POOL: string[];
|
|
44
45
|
export { UNIFIED_COLOR_POOL };
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
47
|
+
* *
|
|
48
48
|
* Returns the color associated with a given `GlobalSelectionItemType`.
|
|
49
49
|
*
|
|
50
50
|
* This function maps specific item types to their corresponding selection colors,
|
|
@@ -54,4 +54,4 @@ export { UNIFIED_COLOR_POOL };
|
|
|
54
54
|
* @param itemType - The type of the global selection item for which to retrieve the color.
|
|
55
55
|
* @returns The color string associated with the specified item type.
|
|
56
56
|
*/
|
|
57
|
-
export declare function
|
|
57
|
+
export declare function getDefaultSelectionColorByItemType(itemType: GlobalSelectionItemType): SelectionColor;
|
package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsByStrategy.action.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ResultArray } from '@equinor/echo-search';
|
|
2
|
+
import type { StoreApi } from 'zustand';
|
|
3
|
+
import type { SelectionItemTypeStrategy } from '../../strategies/selectionItemTypeStrategy.types';
|
|
4
|
+
import type { GlobalSelectionAddItemResult, GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionStore, SelectionItemTypeToItemIdMap } from '../globalSelectionStore.types';
|
|
5
|
+
type SetFunction = (updater: (state: GlobalSelectionStore) => void, shouldReplace?: boolean, action?: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Generic store action that adds items of any type to the global selection store.
|
|
8
|
+
*
|
|
9
|
+
* Handles two paths based on whether the strategy implements `resolveSync`:
|
|
10
|
+
* 1. Resolved items (e.g. PDMS tags): written directly as `loadedSuccessfully` — no loading flicker.
|
|
11
|
+
* 2. Remaining items: written as `isLoading` placeholders, then fetched via `strategy.fetchAsync`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function addItemsByStrategyAction<T extends GlobalSelectionItemType>(set: SetFunction, get: StoreApi<GlobalSelectionStore>['getState'], strategy: SelectionItemTypeStrategy<T>, args: {
|
|
14
|
+
itemIds: ReadonlyArray<SelectionItemTypeToItemIdMap[T]>;
|
|
15
|
+
color?: string;
|
|
16
|
+
}): Promise<GlobalSelectionAddItemResult<ResultArray<GlobalSelectionItemTypeToDataMap[T]>[]>>;
|
|
17
|
+
export {};
|
|
@@ -35,22 +35,11 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
35
35
|
};
|
|
36
36
|
}, "setState"> & {
|
|
37
37
|
setState(nextStateOrUpdater: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
tagIds: GlobalSelectionTypes.TagId[];
|
|
44
|
-
color?: string;
|
|
45
|
-
}) => Promise<import("./globalSelectionStore.types").GlobalSelectionAddItemResult<import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").TagSummaryDto>[]>>;
|
|
46
|
-
addEquipmentsToSelection: (args: {
|
|
47
|
-
equipmentIds: GlobalSelectionTypes.EquipmentId[];
|
|
48
|
-
color?: string;
|
|
49
|
-
}) => Promise<import("./globalSelectionStore.types").GlobalSelectionAddItemResult<import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").EquipmentData>[]>>;
|
|
50
|
-
addMeasuringPointsToSelection: (args: {
|
|
51
|
-
measuringPointIds: GlobalSelectionTypes.MeasuringPointId[];
|
|
52
|
-
color?: string;
|
|
53
|
-
}) => Promise<import("./globalSelectionStore.types").GlobalSelectionAddItemResult<import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").MeasuringPointData>[]>>;
|
|
38
|
+
addItemsToSelection: <T extends GlobalSelectionItemType>(args: {
|
|
39
|
+
readonly itemType: T;
|
|
40
|
+
readonly itemIds: ReadonlyArray<import("./globalSelectionStore.types").SelectionItemTypeToItemIdMap[T]>;
|
|
41
|
+
readonly color?: string;
|
|
42
|
+
}) => Promise<import("./globalSelectionStore.types").GlobalSelectionAddItemResult<import("@equinor/echo-search").ResultArray<import("./globalSelectionStore.types").GlobalSelectionItemTypeToDataMap[T]>[]>>;
|
|
54
43
|
removeItemsFromSelection: (args: {
|
|
55
44
|
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
56
45
|
}) => void;
|
|
@@ -160,6 +149,14 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
|
|
|
160
149
|
type: string;
|
|
161
150
|
value: string;
|
|
162
151
|
}[];
|
|
152
|
+
coordinates: {
|
|
153
|
+
tagSeqNo: number;
|
|
154
|
+
xEasting: number;
|
|
155
|
+
yNorthing: number;
|
|
156
|
+
zElevation: number;
|
|
157
|
+
uom: string;
|
|
158
|
+
linePosition: number | undefined;
|
|
159
|
+
}[];
|
|
163
160
|
tagNo: string;
|
|
164
161
|
description: string;
|
|
165
162
|
projectCode: string;
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts
CHANGED
|
@@ -59,22 +59,15 @@ interface ItemErrorStatusUpdates {
|
|
|
59
59
|
readonly errorStatus: string;
|
|
60
60
|
}
|
|
61
61
|
export interface GlobalSelectionStore extends GlobalSelectionStoreData {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
equipmentIds: GlobalSelectionTypes.EquipmentId[];
|
|
72
|
-
color?: string;
|
|
73
|
-
}) => Promise<GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>>;
|
|
74
|
-
addMeasuringPointsToSelection: (args: {
|
|
75
|
-
measuringPointIds: GlobalSelectionTypes.MeasuringPointId[];
|
|
76
|
-
color?: string;
|
|
77
|
-
}) => Promise<GlobalSelectionAddItemResult<ResultArray<MeasuringPointData>[]>>;
|
|
62
|
+
/**
|
|
63
|
+
* Generic method to add items of any type to the selection.
|
|
64
|
+
* Replaces the 4 per-type methods below. Use this for all new code.
|
|
65
|
+
*/
|
|
66
|
+
addItemsToSelection<T extends GlobalSelectionItemType>(args: {
|
|
67
|
+
readonly itemType: T;
|
|
68
|
+
readonly itemIds: ReadonlyArray<SelectionItemTypeToItemIdMap[T]>;
|
|
69
|
+
readonly color?: string;
|
|
70
|
+
}): Promise<GlobalSelectionAddItemResult<ResultArray<GlobalSelectionItemTypeToDataMap[T]>[]>>;
|
|
78
71
|
removeItemsFromSelection: (args: {
|
|
79
72
|
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
80
73
|
}) => void;
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts
CHANGED
|
@@ -2,54 +2,20 @@ import { ResultArray } from '@equinor/echo-search';
|
|
|
2
2
|
import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from './globalSelectionStore.types';
|
|
3
3
|
import { isEquipmentId, isMeasuringPointId, isTagId, isWorkOrderId } from './itemIdTypeGuards';
|
|
4
4
|
declare function idsEqual(itemA: GlobalSelectionTypes.ItemId, itemB: GlobalSelectionTypes.ItemId): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Overloaded function that maps an item to its corresponding ID type based on the item's properties.
|
|
7
|
-
* The return type is specific to the type of item passed to the function.
|
|
8
|
-
*
|
|
9
|
-
* @param {GlobalSelectionTypes.WorkOrderId} item - The work order item to be mapped.
|
|
10
|
-
* @returns {GlobalSelectionTypes.WorkOrderId} - The mapped work order ID.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* @param {GlobalSelectionTypes.EquipmentId} item - The equipment item to be mapped.
|
|
14
|
-
* @returns {GlobalSelectionTypes.EquipmentId} - The mapped equipment ID.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* @param {GlobalSelectionTypes.TagId} item - The tag item to be mapped.
|
|
18
|
-
* @returns {GlobalSelectionTypes.TagId} - The mapped tag ID.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Maps an item to its corresponding ID object by checking the item's type and returning the appropriate ID object,
|
|
22
|
-
* removing leading zeros from the ID string and trimming whitespace.
|
|
23
|
-
* If the item type is not recognized, an error is thrown.
|
|
24
|
-
*
|
|
25
|
-
* @param {GlobalSelectionTypes.ItemId} item - The data to be mapped to its ID type.
|
|
26
|
-
* @returns {GlobalSelectionTypes.ItemId} - The mapped tag ID.
|
|
27
|
-
*/
|
|
28
|
-
declare function mapToId(item: GlobalSelectionTypes.WorkOrderId): GlobalSelectionTypes.WorkOrderId;
|
|
29
|
-
declare function mapToId(item: GlobalSelectionTypes.EquipmentId): GlobalSelectionTypes.EquipmentId;
|
|
30
|
-
declare function mapToId(item: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagId;
|
|
31
|
-
declare function mapToId(item: GlobalSelectionTypes.MeasuringPointId): GlobalSelectionTypes.MeasuringPointId;
|
|
32
5
|
declare function mapToId(item: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemId;
|
|
33
|
-
/**
|
|
34
|
-
* Converts an item ID to a string representation for use as Map keys.
|
|
35
|
-
* This is a ONE-WAY conversion - the string cannot be converted back to the original ID.
|
|
36
|
-
*
|
|
37
|
-
* For tags: Always returns `tagNo-instCode` regardless of whether it's a STID or PDMS tag.
|
|
38
|
-
* This ensures both tag types use the same key format for O(1) Map lookups.
|
|
39
|
-
*
|
|
40
|
-
* To preserve full ID properties (e.g., PDMS properties for API saving), use `mapToId` instead.
|
|
41
|
-
*/
|
|
42
6
|
declare function itemIdToString(itemId: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemIdString;
|
|
43
7
|
export declare function mapIdToItemType(itemId: GlobalSelectionTypes.ItemId): GlobalSelectionItemType;
|
|
44
8
|
/**
|
|
45
9
|
* A utility object that provides various functions for handling global selections.
|
|
46
10
|
*
|
|
47
11
|
* @namespace globalSelectionUtils
|
|
12
|
+
* @property {Function} isMeasuringPointId - Checks if the passed object is a global selection MeasuringPointID.
|
|
48
13
|
* @property {Function} isWorkOrderId - Checks if the passed object is a global selection WorkOrderID.
|
|
49
14
|
* @property {Function} isEquipmentId - Checks if the passed object is a global selection EquipmentID.
|
|
50
15
|
* @property {Function} isTagId - Checks if the passed object is a global selection TagID.
|
|
51
16
|
* @property {Function} idsEqual - Compares two global selection item IDs for equality.
|
|
52
17
|
* @property {Function} mapToId - Maps an object to its global selection item ID, preserving all properties (including PDMS).
|
|
18
|
+
* @property {Function} mapIdToItemType - Returns the GlobalSelectionItemType enum value for a given ItemId.
|
|
53
19
|
* @property {Function} itemIdToString - ONE-WAY conversion to string for Map keys. Cannot be reversed. For tags, uses only tagNo-instCode.
|
|
54
20
|
*/
|
|
55
21
|
export declare const globalSelectionUtils: Readonly<{
|
package/src/lib/feature/globalSelection/globalSelectionStore/selectionActionFeedbackStore.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SelectionBarFeedbackType } from '@equinor/echo-components';
|
|
2
|
+
import type { MarkerId } from '../../shared/markerId.types';
|
|
3
|
+
/**
|
|
4
|
+
* How long selection-action feedback stays visible.
|
|
5
|
+
* Legend popovers reuse this same duration when holding stale markers rendered,
|
|
6
|
+
* so the popover lifecycle matches the feedback lifecycle exactly.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FEEDBACK_DISPLAY_DURATION_MS = 2000;
|
|
9
|
+
export interface SelectionActionFeedback {
|
|
10
|
+
readonly isFeedbackActive: boolean;
|
|
11
|
+
readonly feedbackType: SelectionBarFeedbackType | undefined;
|
|
12
|
+
/** MarkerId of the marker that initiated the action. Consumers compare this to their own markerId. */
|
|
13
|
+
readonly actionMarkerId: MarkerId | undefined;
|
|
14
|
+
}
|
|
15
|
+
interface SelectionActionFeedbackStore extends SelectionActionFeedback {
|
|
16
|
+
/**
|
|
17
|
+
* Updates the selection action feedback state (isFeedbackActive + feedbackType).
|
|
18
|
+
* Stored in a dedicated micro store so it survives component remounts during
|
|
19
|
+
* the stale-marker holding period. While `isFeedbackActive` is true, useMarkerPopover
|
|
20
|
+
* delays popover content refresh and useStalePopoverMarkers keeps the old marker
|
|
21
|
+
* rendered so the feedback ("Added ✓", "Removed ✓") stays visible.
|
|
22
|
+
*/
|
|
23
|
+
setFeedback: (feedback: SelectionActionFeedback) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useSelectionActionFeedbackStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SelectionActionFeedbackStore>, "setState"> & {
|
|
26
|
+
setState<A extends string | {
|
|
27
|
+
type: string;
|
|
28
|
+
}>(partial: SelectionActionFeedbackStore | Partial<SelectionActionFeedbackStore> | ((state: SelectionActionFeedbackStore) => SelectionActionFeedbackStore | Partial<SelectionActionFeedbackStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
29
|
+
}>;
|
|
30
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
export interface GlobalSelectionList {
|
|
3
|
+
readonly items: readonly GlobalSelectionTypes.SelectionItem[];
|
|
4
|
+
}
|
|
1
5
|
/**
|
|
2
6
|
* Hook for returning all lists stored in the global selection.
|
|
3
7
|
*/
|
|
4
|
-
export declare function useGlobalSelectionLists():
|
|
5
|
-
items: (import("..").GlobalSelectionGenericItem<import("..").GlobalSelectionItemType.WorkOrder> | import("..").GlobalSelectionGenericItem<import("..").GlobalSelectionItemType.Tag> | import("..").GlobalSelectionGenericItem<import("..").GlobalSelectionItemType.Equipment> | import("..").GlobalSelectionGenericItem<import("..").GlobalSelectionItemType.MeasuringPoint>)[];
|
|
6
|
-
}[];
|
|
8
|
+
export declare function useGlobalSelectionLists(): readonly GlobalSelectionList[];
|
|
@@ -2,7 +2,6 @@ import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionSto
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook to check if an item is in the global selection
|
|
4
4
|
* @param {GlobalSelectionTypes.ItemId} itemId - The itemId
|
|
5
|
-
* @param {GlobalSelectionItemType} itemType - The item type
|
|
6
5
|
* @returns {boolean} - True if the item is in global selection, false otherwise
|
|
7
6
|
*/
|
|
8
7
|
export declare function useIsInGlobalSelection(itemId: GlobalSelectionTypes.ItemId): boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
2
|
import { SelectionTreeTypes } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
3
3
|
/**
|
|
4
|
-
* Custom hook to get the selection categories by group ID from the global selection tree
|
|
4
|
+
* Custom hook to get the selection categories by group ID from the global selection tree hierarchy.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Zustand's Object.is equality check on the selector return value ensures re-renders only
|
|
7
|
+
* happen when this specific group's categories change, not on unrelated group mutations.
|
|
7
8
|
*
|
|
8
9
|
* @param {Guid} groupId - The ID of the group to get categories for.
|
|
9
10
|
* @returns {SelectionTreeTypes.Category[] | undefined} The categories for the given group ID, or undefined if not found.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './globalSelectionStore/globalSelectionStore.types';
|
|
2
2
|
export * from './selectionMenu/selectionTreeStore/selectionTree.api.types';
|
|
3
3
|
export * from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
4
|
-
export {
|
|
4
|
+
export { PDMS_INTERNAL_TAG_TYPES, isPdmsInternalTagType } from './pdmsTag/pdmsTag.types';
|
|
5
5
|
export type { PdmsInternalTagType, PdmsTagId, PdmsTagSummaryDto, StidTagId } from './pdmsTag/pdmsTag.types';
|
|
6
6
|
export { useAreAllItemsVisible } from './hooks/useAreAllItemsVisible';
|
|
7
7
|
export { useGlobalSelectionByItemId } from './hooks/useGlobalSelectionByItemId';
|
|
@@ -18,7 +18,7 @@ export { useCurrentSelectionId } from './selectionMenu/hooks/useCurrentSelection
|
|
|
18
18
|
export { useFetchSelectionHistory } from './selectionMenu/hooks/useFetchSelectionHistory';
|
|
19
19
|
export { useGlobalSelectionGroups } from './selectionMenu/hooks/useGlobalSelectionGroups';
|
|
20
20
|
export { useMostUsedSelectionColorByIds } from './selectionMenu/hooks/useSelectionColorFrequency';
|
|
21
|
-
export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
|
|
21
|
+
export { RemoveSelectionItemsConfirmDialog } from './components/selectionActionBar/RemoveSelectionItemsConfirmDialog';
|
|
22
22
|
export { globalSelectionApi } from './globalSelection.api';
|
|
23
23
|
export { globalSelectionInternal } from './globalSelection.internal';
|
|
24
24
|
export { SELECTION_COLOR_PICKER_COLORS } from './globalSelectionColorService';
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
|
-
interface UseIsAllIGlobalSelectionItemsHiddenArgs {
|
|
3
|
-
groupId: Guid;
|
|
4
|
-
categoryId?: string;
|
|
5
|
-
}
|
|
6
2
|
/**
|
|
7
3
|
* Custom hook to determine if all items in a selection list are hidden by the user.
|
|
8
4
|
*
|
|
@@ -15,5 +11,7 @@ interface UseIsAllIGlobalSelectionItemsHiddenArgs {
|
|
|
15
11
|
*
|
|
16
12
|
* The hook returns `true` if all items in the list are hidden by the user, and `false` otherwise.
|
|
17
13
|
*/
|
|
18
|
-
export declare const
|
|
19
|
-
|
|
14
|
+
export declare const useIsAllGlobalSelectionItemsHidden: (args: {
|
|
15
|
+
groupId: Guid;
|
|
16
|
+
categoryId?: string;
|
|
17
|
+
}) => boolean;
|
|
@@ -5,14 +5,17 @@ import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelection
|
|
|
5
5
|
* This hook retrieves the global selection items and filters them based on the provided item IDs,
|
|
6
6
|
* extracts their associated colors, and sorts the colors by frequency.
|
|
7
7
|
*
|
|
8
|
+
* Callers must provide a referentially stable `itemIds` array (e.g. via `useMemo`)
|
|
9
|
+
* to avoid unnecessary recomputation on every render.
|
|
10
|
+
*
|
|
8
11
|
* @param itemIds - An array of item IDs to match against global selection items.
|
|
9
12
|
* @returns An array of color strings sorted by frequency, most frequent first.
|
|
10
13
|
*/
|
|
11
|
-
export declare function useSelectionColorFrequencyByIds(itemIds: GlobalSelectionTypes.ItemId
|
|
14
|
+
export declare function useSelectionColorFrequencyByIds(itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>): readonly string[];
|
|
12
15
|
/**
|
|
13
16
|
* Returns the most frequently used selection color from the provided item IDs.
|
|
14
17
|
*
|
|
15
18
|
* @param itemIds - An array of item IDs to analyze for color frequency.
|
|
16
19
|
* @returns The most used selection color as a string, or `undefined` if no colors are present.
|
|
17
20
|
*/
|
|
18
|
-
export declare function useMostUsedSelectionColorByIds(itemIds: GlobalSelectionTypes.ItemId
|
|
21
|
+
export declare function useMostUsedSelectionColorByIds(itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>): string | undefined;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
2
|
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
import { SelectionTreeStore } from '../selectionTree.store.types';
|
|
4
|
+
export type AddItemsActionArgs = {
|
|
5
|
+
readonly itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
6
|
+
readonly groupId?: Guid;
|
|
7
|
+
readonly useDefaultSelectionTypeColors?: boolean;
|
|
8
|
+
};
|
|
4
9
|
/**
|
|
5
10
|
* Adds items to the selection tree store by categorizing them into tags, work orders,
|
|
6
11
|
* equipments, and measuring points, then dispatching the appropriate add actions for each type.
|
|
@@ -10,7 +15,3 @@ import { SelectionTreeStore } from '../selectionTree.store.types';
|
|
|
10
15
|
* @returns A promise that resolves when all items have been added to the store.
|
|
11
16
|
*/
|
|
12
17
|
export declare function addItems(get: () => SelectionTreeStore, args: AddItemsActionArgs): Promise<void>;
|
|
13
|
-
export type AddItemsActionArgs = {
|
|
14
|
-
itemIds: GlobalSelectionTypes.ItemId[];
|
|
15
|
-
groupId?: Guid;
|
|
16
|
-
};
|
|
@@ -10,6 +10,6 @@ type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace?: bo
|
|
|
10
10
|
* @returns {void}
|
|
11
11
|
*/
|
|
12
12
|
export declare function removeAllItemsById(set: SetFunction, args: {
|
|
13
|
-
itemIds: GlobalSelectionTypes.ItemId
|
|
13
|
+
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
14
14
|
}): void;
|
|
15
15
|
export {};
|
|
@@ -19,6 +19,6 @@ export declare function removeItemsById(set: SetFunction, args: RemoveItemsByIdA
|
|
|
19
19
|
type RemoveItemsByIdArgs = {
|
|
20
20
|
groupId?: Guid;
|
|
21
21
|
categoryId: GlobalSelectionCategoryId;
|
|
22
|
-
itemIds: GlobalSelectionTypes.ItemId
|
|
22
|
+
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
23
23
|
};
|
|
24
24
|
export {};
|
|
@@ -2,9 +2,10 @@ import { ResultArray } from '@equinor/echo-search';
|
|
|
2
2
|
import { Guid } from '@equinor/echo-utils';
|
|
3
3
|
import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
4
4
|
type AddItemArgsBase<ItemIdType extends GlobalSelectionTypes.ItemId> = {
|
|
5
|
-
itemIds: Readonly<ItemIdType[]>;
|
|
6
|
-
replaceItems?: boolean;
|
|
7
|
-
|
|
5
|
+
readonly itemIds: Readonly<ItemIdType[]>;
|
|
6
|
+
readonly replaceItems?: boolean;
|
|
7
|
+
readonly useDefaultSelectionTypeColors?: boolean;
|
|
8
|
+
readonly getActionResult?: boolean;
|
|
8
9
|
};
|
|
9
10
|
type AddItemArgsExclusive = {
|
|
10
11
|
groupId: Guid;
|
|
@@ -20,7 +21,7 @@ export type AddItemsResponse<T extends GlobalSelectionItemType> = {
|
|
|
20
21
|
fetchResults: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
|
|
21
22
|
itemsAdded: Readonly<SelectionItemTypeToItemIdMap[T][]>;
|
|
22
23
|
actionResult: SelectionTreeActionResult;
|
|
23
|
-
affectedGroupId
|
|
24
|
+
affectedGroupId: Guid | undefined;
|
|
24
25
|
};
|
|
25
26
|
export type SelectionTreeActionResult = 'ItemsUpdated' | 'ItemsAdded' | 'NewGroupCreated' | 'NoChanges';
|
|
26
27
|
export {};
|