@equinor/echo-framework 2.4.1 → 2.4.3
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 +3 -3
- package/package.json +7 -7
- package/src/index.d.ts +1 -0
- package/src/lib/components/searchListItem/searchListItem.d.ts +2 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +8 -4
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/tagFetch.logic.d.ts +10 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +30 -2
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +42 -31
- package/src/lib/feature/globalSelection/index.d.ts +2 -0
- package/src/lib/feature/globalSelection/pdmsTag/pdmsTag.types.d.ts +13 -0
- package/src/lib/feature/globalSelection/pdmsTag/pdmsTag.utils.d.ts +6 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +7 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +1 -0
- package/src/lib/feature/legend/components/LegendFeedbackMessage.d.ts +12 -0
- package/src/lib/feature/legend/components/pdfMarkers/PositionalItem.d.ts +1 -1
- package/src/lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers.d.ts +1 -9
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +2 -2
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRenderer.d.ts +1 -4
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MarkerWithPopover.d.ts +2 -2
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/{MultipleMarkersBySingleLegend.d.ts → components/MultipleMarkersBySingleLegend/MultipleMarkersBySingleLegend.d.ts} +2 -3
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/MultipleMarkersBySingleLegendContainer.d.ts +4 -0
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts +2 -2
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.d.ts +34 -0
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.types.d.ts +37 -0
- package/src/lib/feature/legend/components/selectionLegend/hooks/useAllMarkerItemIdsForEnabledLegends.d.ts +12 -0
- package/src/lib/feature/legend/components/selectionLegend/hooks/useSelectionGroupsForLegendRenderer.d.ts +4 -1
- package/src/lib/feature/legend/components/selectionLegend/hooks/useSelectionGroupsForLegendRenderer.utils.d.ts +8 -4
- package/src/lib/feature/legend/components/selectionLegend/selectionLegend.utils.d.ts +4 -7
- package/src/lib/feature/legend/hooks/useGroupedMarkers.d.ts +17 -10
- package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +13 -0
- package/src/lib/feature/legend/hooks/useItemToSelectionGroupsMapSubscription.d.ts +29 -0
- package/src/lib/feature/legend/hooks/useLegendHiddenItemsSubscription.d.ts +33 -0
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.d.ts +10 -2
- package/src/lib/feature/legend/hooks/useSelectionItemColorSubscription.d.ts +16 -0
- package/src/lib/feature/legend/hooks/useUniqueBadgeItemIdStrings.d.ts +6 -0
- package/src/lib/feature/legend/legendFacade.d.ts +11 -0
- package/src/lib/feature/legend/stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.d.ts +22 -0
- package/src/lib/feature/legend/stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.types.d.ts +21 -0
- package/src/lib/feature/legend/stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.utils.d.ts +14 -0
- package/src/lib/feature/legend/stores/legendDataStore/legendStore.d.ts +0 -1
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +14 -0
- package/src/lib/feature/legend/stores/legendVisibleDataStore/legendVisibleDataStore.d.ts +9 -2
- package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +2 -2
- package/src/lib/hooks/useOpenWorkOrderDetails.d.ts +38 -0
- package/src/lib/services/dataLayerPanel/dataLayerPanel.store.d.ts +1 -1
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.d.ts +0 -22
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types.d.ts +0 -22
- package/src/lib/feature/legend/components/selectionLegend/hooks/useAllGroupedMarkersForLegends.d.ts +0 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SelectionGroup } from '../../globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
2
|
+
import { Marker } from '../types/legendMarkerBadge.type';
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a marker has badges from multiple different item IDs.
|
|
5
|
+
*/
|
|
6
|
+
export declare const hasBadgesFromMultipleItemIds: (marker: Marker) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Gets all potential group keys a marker could generate.
|
|
9
|
+
* Used for per-marker hidden state subscriptions.
|
|
10
|
+
* @param marker - The marker to get group keys for
|
|
11
|
+
* @param itemToGroupsMap - Pre-built map of itemIdString -> selectionGroups - handled in store
|
|
12
|
+
*/
|
|
13
|
+
export declare const getPotentialGroupKeysForMarker: (marker: Marker, itemToGroupsMap: Map<string, SelectionGroup[]>) => string[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../globalSelection';
|
|
2
|
+
import { ItemToSelectionGroupsMap } from '../stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.types';
|
|
3
|
+
interface ItemToSelectionGroupsMapSubscriptionResult {
|
|
4
|
+
/** The complete itemToSelectionGroupsMap for looking up item -> selection groups */
|
|
5
|
+
itemToSelectionGroupsMap: ItemToSelectionGroupsMap;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Subscribes to group membership changes for multiple items (e.g., all badges on a marker).
|
|
9
|
+
*
|
|
10
|
+
* This hook is designed for markers that have multiple badges, it watches all of them
|
|
11
|
+
* and only triggers a re-render when any of the watched items change group membership.
|
|
12
|
+
* Returns the full itemToSelectionGroupsMap so the caller can look up selection groups for each badge.
|
|
13
|
+
*
|
|
14
|
+
* @param watchItemIds - Array of item ID strings to watch (e.g., all badge item IDs from a marker)
|
|
15
|
+
* @returns Object containing the complete itemToSelectionGroupsMap for lookups
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // Get all badge item IDs from this marker
|
|
20
|
+
* const badgeItemIds = useMemo(() =>
|
|
21
|
+
* marker.badges.map(b => globalSelectionUtils.itemIdToString(b.getItemId())).sort(),
|
|
22
|
+
* [marker]
|
|
23
|
+
* );
|
|
24
|
+
* // Subscribe to group changes for ALL badges on this marker
|
|
25
|
+
* const { itemToSelectionGroupsMap } = useItemToSelectionGroupsMapSubscription(badgeItemIds);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const useItemToSelectionGroupsMapSubscription: (watchItemIds: GlobalSelectionTypes.ItemIdString[]) => ItemToSelectionGroupsMapSubscriptionResult;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LegendUIState } from '../stores/legendUIStore/legendUIStore.types';
|
|
2
|
+
import { LegendId } from '../types/legendType';
|
|
3
|
+
/** Explicit keys from LegendUIState that contain hidden items. Will error if keys don't exist. */
|
|
4
|
+
type HiddenItemsKey = keyof Pick<LegendUIState, 'hiddenMarkers' | 'hiddenBadges'>;
|
|
5
|
+
/**
|
|
6
|
+
* Subscribes to hidden state changes for multiple keys (e.g., all group keys from a marker).
|
|
7
|
+
*
|
|
8
|
+
* This hook is designed for markers that may belong to multiple groups, it watches all
|
|
9
|
+
* potential keys and only triggers a re-render when ANY of the watched keys change visibility.
|
|
10
|
+
*
|
|
11
|
+
* How it works:
|
|
12
|
+
* - Takes an array of keys (e.g., all possible group keys for this marker's badges)
|
|
13
|
+
* - Combines them into one subscription that tracks which of YOUR keys are hidden
|
|
14
|
+
* - Only re-renders when visibility of one of YOUR keys changes, not when any hidden state changes
|
|
15
|
+
*
|
|
16
|
+
* @param legendId - The legend ID to subscribe to
|
|
17
|
+
* @param potentialKeys - Array of keys to watch for visibility changes (e.g., group keys, badge keys)
|
|
18
|
+
* @param storeKey - Which hidden array to subscribe to (from LegendUIState)
|
|
19
|
+
* @returns The full hidden items array from the store (for filtering logic)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Get all potential group keys for this marker's badges
|
|
24
|
+
* const groupKeys = useMemo(() =>
|
|
25
|
+
* getPotentialGroupKeysForMarker(marker, itemToGroupsMap).map(k => k.toString()).sort(),
|
|
26
|
+
* [marker, itemToGroupsMap]
|
|
27
|
+
* );
|
|
28
|
+
* // Subscribe to visibility changes for ALL these group keys
|
|
29
|
+
* const hiddenMarkers = useLegendHiddenItemsSubscription(legendId, groupKeys, 'hiddenMarkers');
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const useLegendHiddenItemsSubscription: (legendId: LegendId, potentialKeys: string[], storeKey: HiddenItemsKey) => string[];
|
|
33
|
+
export {};
|
|
@@ -3,9 +3,17 @@ import { LegendDataId, LegendId } from '../../types/legendType';
|
|
|
3
3
|
export interface UseLegendMarkerProps {
|
|
4
4
|
legendId: LegendId;
|
|
5
5
|
itemIds: LegendDataId[];
|
|
6
|
-
hiddenMarkers: string[];
|
|
7
6
|
}
|
|
8
7
|
/**
|
|
9
|
-
* Returns the visible
|
|
8
|
+
* Returns the visible marker for the given legendId and itemIds.
|
|
9
|
+
* If the legend is disabled or the marker is hidden, returns undefined.
|
|
10
|
+
*
|
|
11
|
+
* Performance optimization:
|
|
12
|
+
* Uses per-marker subscription to hidden state - only re-renders when THIS specific
|
|
13
|
+
* marker's visibility changes, not when any marker in the legend is hidden/shown.
|
|
14
|
+
*
|
|
15
|
+
* @param props.legendId - The legend to get the marker from
|
|
16
|
+
* @param props.itemIds - The item IDs to create the marker from
|
|
17
|
+
* @returns The marker if visible and legend is enabled, undefined otherwise
|
|
10
18
|
*/
|
|
11
19
|
export declare function useLegendMarker(props: UseLegendMarkerProps): Marker | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../globalSelection';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a per-marker subscription to selection item color changes.
|
|
4
|
+
*
|
|
5
|
+
* Selection color is the color assigned to items in the global selection store
|
|
6
|
+
* (item.metaData.color). This is used for the marker highlight color on the PDF.
|
|
7
|
+
* Note: This is NOT the same as badge.getColor() which is the badge's own color.
|
|
8
|
+
*
|
|
9
|
+
* This is a performance optimization that only triggers re-renders when
|
|
10
|
+
* the selection color of THIS marker's specific items changes, not when any
|
|
11
|
+
* item's color changes in the global selection.
|
|
12
|
+
*
|
|
13
|
+
* @param itemIdStrings - Sorted array of item ID strings to watch
|
|
14
|
+
* @returns A combined key string representing current selection item colors for these items
|
|
15
|
+
*/
|
|
16
|
+
export declare const useSelectionItemColorSubscription: (itemIdStrings: GlobalSelectionTypes.ItemIdString[]) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../globalSelection';
|
|
2
|
+
import { Marker } from '../types/legendMarkerBadge.type';
|
|
3
|
+
/**
|
|
4
|
+
* Returns unique item ID strings from all badges on the marker.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useUniqueBadgeItemIdStrings: (marker?: Marker) => GlobalSelectionTypes.ItemIdString[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LegendFeedbackVariant } from './components/LegendFeedbackMessage';
|
|
1
2
|
import { getLegendStrategy, injectLegendStrategy } from './legendStrategies/legendCollections';
|
|
2
3
|
import { isLegendDataIdEqualWithTag } from './logic/isLegendDataIdEqualWithTag';
|
|
3
4
|
import { legendExistsInLegendStore, legendSnapShot, legendStoreSubscribe, useAllLegends, useLegendById } from './stores/legendDataStore/legendStore';
|
|
@@ -24,6 +25,11 @@ export declare const legendFacade: Readonly<{
|
|
|
24
25
|
exists: typeof legendExistsInLegendUIStore;
|
|
25
26
|
accordion: {
|
|
26
27
|
toggle: (legendId: LegendId, newValue: boolean) => void;
|
|
28
|
+
setFeedback: (legendId: LegendId, feedback: {
|
|
29
|
+
message: string;
|
|
30
|
+
variant?: LegendFeedbackVariant;
|
|
31
|
+
} | undefined) => void;
|
|
32
|
+
resetFeedback: (legendId: LegendId) => void;
|
|
27
33
|
};
|
|
28
34
|
markers: {
|
|
29
35
|
setHidden: (params: {
|
|
@@ -31,6 +37,11 @@ export declare const legendFacade: Readonly<{
|
|
|
31
37
|
marker: string;
|
|
32
38
|
isHidden: boolean;
|
|
33
39
|
}) => void;
|
|
40
|
+
setHiddenBatch: (updates: Array<{
|
|
41
|
+
legendId: LegendId;
|
|
42
|
+
marker: string;
|
|
43
|
+
isHidden: boolean;
|
|
44
|
+
}>) => void;
|
|
34
45
|
};
|
|
35
46
|
badges: {
|
|
36
47
|
setHidden: (params: {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ItemToSelectionGroupsMapStore } from './itemToSelectionGroupsMapStore.types';
|
|
2
|
+
/**
|
|
3
|
+
* Store that maintains pre-computed maps for fast item -> group lookups.
|
|
4
|
+
* Automatically rebuilds when selection groups change.
|
|
5
|
+
*
|
|
6
|
+
* Usage for per-marker subscriptions:
|
|
7
|
+
* ```tsx
|
|
8
|
+
* // Subscribe only to specific item IDs
|
|
9
|
+
* const groupKey = useItemToSelectionGroupsMapStore((state) =>
|
|
10
|
+
* state.itemToSelectionGroupKeyMap.get(myItemIdString)
|
|
11
|
+
* );
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const useItemToSelectionGroupsMapStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ItemToSelectionGroupsMapStore>, "setState"> & {
|
|
15
|
+
setState<A extends string | {
|
|
16
|
+
type: string;
|
|
17
|
+
}>(partial: ItemToSelectionGroupsMapStore | Partial<ItemToSelectionGroupsMapStore> | ((state: ItemToSelectionGroupsMapStore) => ItemToSelectionGroupsMapStore | Partial<ItemToSelectionGroupsMapStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* For read-only access without subscription, use getItemToSelectionGroupsMapStoreState().
|
|
21
|
+
*/
|
|
22
|
+
export declare const getItemToSelectionGroupsMapStoreState: () => ItemToSelectionGroupsMapStore;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Brand } from '@equinor/echo-utils';
|
|
2
|
+
import type { GlobalSelectionTypes } from '../../../globalSelection/globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
import { SelectionGroup } from '../../../globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
4
|
+
export type ItemToSelectionGroupsMap = Map<GlobalSelectionTypes.ItemIdString, SelectionGroup[]>;
|
|
5
|
+
export type ItemToSelectionGroupKeyMap = Map<GlobalSelectionTypes.ItemIdString, SelectionGroupsCombinedKey>;
|
|
6
|
+
/**
|
|
7
|
+
* A combined key representing sorted joined selectionGroup ids, e.g. "groupId1::groupId2"
|
|
8
|
+
*/
|
|
9
|
+
export type SelectionGroupsCombinedKey = Brand<string, 'SelectionGroupsCombinedKey'>;
|
|
10
|
+
interface ItemToSelectionGroupsMapStoreState {
|
|
11
|
+
/** Map of itemIdString -> SelectionGroup[] for getting full group objects */
|
|
12
|
+
itemToSelectionGroupsMap: ItemToSelectionGroupsMap;
|
|
13
|
+
/** Map of itemIdString -> "groupId1::groupId2" for fast key comparison */
|
|
14
|
+
itemToSelectionGroupKeyMap: ItemToSelectionGroupKeyMap;
|
|
15
|
+
}
|
|
16
|
+
interface ItemToSelectionGroupsMapStoreActions {
|
|
17
|
+
/** Rebuilds both maps from current selection groups */
|
|
18
|
+
rebuildMaps: () => void;
|
|
19
|
+
}
|
|
20
|
+
export type ItemToSelectionGroupsMapStore = ItemToSelectionGroupsMapStoreState & ItemToSelectionGroupsMapStoreActions;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SelectionGroup } from '../../../globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
2
|
+
import { ItemToSelectionGroupKeyMap, ItemToSelectionGroupsMap } from './itemToSelectionGroupsMapStore.types';
|
|
3
|
+
/**
|
|
4
|
+
* Builds a map of itemIdString -> sorted joined groupIds for fast comparison.
|
|
5
|
+
* You should never need to call this directly; use the store instead.
|
|
6
|
+
* @internal Only for use within the store and tests.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildItemToSelectionGroupKeyMap(itemToSelectionGroupsMap: ItemToSelectionGroupsMap): ItemToSelectionGroupKeyMap;
|
|
9
|
+
/**
|
|
10
|
+
* Builds a map of itemIdString -> selectionGroups for fast lookup.
|
|
11
|
+
* You should never need to call this directly; use the store instead.
|
|
12
|
+
* @internal Only for use within the store and tests.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildItemToSelectionGroupsMap(selectionGroups: SelectionGroup[]): ItemToSelectionGroupsMap;
|
|
@@ -87,7 +87,6 @@ export declare function legendStoreSubscribe<U>(selector: (state: LegendStore) =
|
|
|
87
87
|
equalityFn?: (a: U, b: U) => boolean;
|
|
88
88
|
fireImmediately?: boolean;
|
|
89
89
|
}): () => void;
|
|
90
|
-
export declare const getLegendStoreState: () => LegendStore;
|
|
91
90
|
/**
|
|
92
91
|
* TEST ONLY: Reset legend store to a specific state.
|
|
93
92
|
* Only use this in tests for setup/cleanup.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import type { LegendFeedbackVariant } from '../../components/LegendFeedbackMessage';
|
|
1
2
|
import { MarkerId } from '../../components/pdfMarkers/utils/markerId.utils';
|
|
2
3
|
import { LegendId } from '../../types/legendType';
|
|
3
4
|
export interface LegendUIState {
|
|
5
|
+
readonly accordionFeedback?: {
|
|
6
|
+
message: string;
|
|
7
|
+
variant?: LegendFeedbackVariant;
|
|
8
|
+
};
|
|
4
9
|
readonly isAccordionExpanded: boolean;
|
|
5
10
|
readonly hiddenMarkers: string[];
|
|
6
11
|
readonly hiddenBadges: string[];
|
|
@@ -25,6 +30,11 @@ export interface LegendUIStoreActions {
|
|
|
25
30
|
marker: string;
|
|
26
31
|
isHidden: boolean;
|
|
27
32
|
}) => void;
|
|
33
|
+
setHiddenMarkersBatch: (updates: Array<{
|
|
34
|
+
legendId: LegendId;
|
|
35
|
+
marker: string;
|
|
36
|
+
isHidden: boolean;
|
|
37
|
+
}>) => void;
|
|
28
38
|
setHiddenBadge: (args: {
|
|
29
39
|
legendId: LegendId;
|
|
30
40
|
badge: string;
|
|
@@ -35,5 +45,9 @@ export interface LegendUIStoreActions {
|
|
|
35
45
|
setSelectionLegendIsHighlightVisible: (visible: boolean) => void;
|
|
36
46
|
setActivePopoverId: (popoverId: MarkerId | undefined) => void;
|
|
37
47
|
setActivePopoverElements: (elements: ReadonlyArray<React.ReactElement>) => void;
|
|
48
|
+
setAccordionFeedback: (legendId: LegendId, feedback: {
|
|
49
|
+
message: string;
|
|
50
|
+
variant?: LegendFeedbackVariant;
|
|
51
|
+
} | undefined) => void;
|
|
38
52
|
}
|
|
39
53
|
export type LegendUIStore = LegendUIStoreValues & LegendUIStoreActions;
|
|
@@ -58,10 +58,17 @@ export declare const useLegendVisibleDataStore: import("zustand").UseBoundStore<
|
|
|
58
58
|
setState(nextStateOrUpdater: LegendVisibleDataStore | Partial<LegendVisibleDataStore> | ((state: {
|
|
59
59
|
data: {
|
|
60
60
|
Tag: {
|
|
61
|
-
[x: string]: {
|
|
61
|
+
[x: string]: ({
|
|
62
|
+
tagNo: string;
|
|
63
|
+
instCode: string;
|
|
64
|
+
internalTagType: import("../../../globalSelection").PdmsInternalTagType;
|
|
65
|
+
plantNo: string;
|
|
66
|
+
plantCode: string;
|
|
67
|
+
} | {
|
|
62
68
|
instCode: string;
|
|
63
69
|
tagNo: string;
|
|
64
|
-
|
|
70
|
+
internalTagType?: never | undefined;
|
|
71
|
+
})[];
|
|
65
72
|
};
|
|
66
73
|
Equipment: {
|
|
67
74
|
[x: string]: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { LegendDataId } from './legendType';
|
|
2
2
|
export interface Marker {
|
|
3
3
|
getTitle: () => string;
|
|
4
4
|
getColor: () => string;
|
|
@@ -15,5 +15,5 @@ export interface Badge {
|
|
|
15
15
|
* Returns a key that can be used for clustering or grouping badges together if they share the same key.
|
|
16
16
|
*/
|
|
17
17
|
getDisplayKey: () => string;
|
|
18
|
-
getItemId: () =>
|
|
18
|
+
getItemId: () => LegendDataId;
|
|
19
19
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type WorkOrderArgs = {
|
|
2
|
+
workOrderId: string;
|
|
3
|
+
panelKey?: string;
|
|
4
|
+
keepLastNavigationItem?: boolean;
|
|
5
|
+
allowToggle?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Custom React hook that provides a function to open a work order's details in a left panel.
|
|
9
|
+
*
|
|
10
|
+
* This hook manages the navigation state for work order details, ensuring that the correct panel is opened
|
|
11
|
+
* and populated with the appropriate content. If the work order is already open in the specified panel,
|
|
12
|
+
* it will close the panel instead.
|
|
13
|
+
*
|
|
14
|
+
* @returns {(args: WorkOrderArgs) => void} A callback function to open a work order's details panel.
|
|
15
|
+
* - `args.workOrderId` (string): The unique identifier of the work order to open.
|
|
16
|
+
* - `args.panelKey` (string, optional): The key of the panel to open the work order in. Defaults to `ECHO_CORE_SEARCH` if not provided.
|
|
17
|
+
* - `args.keepLastNavigationItem` (boolean, optional): Whether to keep the last navigation item in the panel.
|
|
18
|
+
* - `args.allowToggle` (boolean, optional): Whether toggling the panel is allowed.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const openWorkOrder = useOpenWorkOrderDetails();
|
|
22
|
+
* openWorkOrder({ workOrderId: '123', panelKey: 'workOrderPanel' });
|
|
23
|
+
*/
|
|
24
|
+
export declare function useOpenWorkOrderDetails(): OpenWorkOrderFn;
|
|
25
|
+
/**
|
|
26
|
+
* Opens a work order in the left panel navigation.
|
|
27
|
+
*
|
|
28
|
+
* If the specified work order is already open in the given panel, it will close the active panel.
|
|
29
|
+
* Otherwise, it sets the specified panel as active and adds the work order content to the left panel.
|
|
30
|
+
*
|
|
31
|
+
* @param args - The arguments required to open the work order.
|
|
32
|
+
* @param args.workOrderId - The unique identifier of the work order to open.
|
|
33
|
+
* @param args.panelKey - (Optional) The key of the panel to open the work order in. Defaults to `ECHO_CORE_SEARCH` if not provided.
|
|
34
|
+
* @param args.keepLastNavigationItem - (Optional) Whether to keep the last navigation item in the panel.
|
|
35
|
+
* @param args.allowToggle - (Optional) Whether toggling the panel is allowed.
|
|
36
|
+
*/
|
|
37
|
+
export type OpenWorkOrderFn = (args: WorkOrderArgs) => void;
|
|
38
|
+
export {};
|
|
@@ -31,7 +31,7 @@ interface DataLayerPanelActions {
|
|
|
31
31
|
toggleIocAnnotations: () => void;
|
|
32
32
|
setIsDataFromStidAnnoDetails: (value: boolean) => void;
|
|
33
33
|
}
|
|
34
|
-
type DataLayerPanelStore = DataLayerPanelState & DataLayerPanelActions;
|
|
34
|
+
export type DataLayerPanelStore = DataLayerPanelState & DataLayerPanelActions;
|
|
35
35
|
export declare const useDataLayerPanelStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<DataLayerPanelStore>, "setState"> & {
|
|
36
36
|
setState<A extends string | {
|
|
37
37
|
type: string;
|
package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SelectionGroup } from '../../../../globalSelection';
|
|
2
|
-
import { Marker } from '../../../types/legendMarkerBadge.type';
|
|
3
|
-
import { GroupedMarker } from './splitMarkerByBadgeSelectionGroup.types';
|
|
4
|
-
/**
|
|
5
|
-
* Splits a marker into multiple variants based on badge selection groups.
|
|
6
|
-
*
|
|
7
|
-
* Each variant represents a selection group and contains only badges from that group.
|
|
8
|
-
*
|
|
9
|
-
* Example: Marker with 3 equipment badges at Tag1 position:
|
|
10
|
-
* - Badge A (in SelectionGroupRed)
|
|
11
|
-
* - Badge B (in SelectionGroupRed)
|
|
12
|
-
* - Badge C (in SelectionGroupBlue)
|
|
13
|
-
*
|
|
14
|
-
* Returns 2 marker variants:
|
|
15
|
-
* - Marker variant 1: Badges [A, B], red highlight
|
|
16
|
-
* - Marker variant 2: Badge [C], blue highlight
|
|
17
|
-
*
|
|
18
|
-
* @param marker - The marker to split by badge selection groups
|
|
19
|
-
* @param selectionGroups - Global selection groups
|
|
20
|
-
* @returns Array of marker variants (one per selection group found in badges)
|
|
21
|
-
*/
|
|
22
|
-
export declare function splitMarkerByBadgeSelectionGroup(selectionGroups: SelectionGroup[], marker?: Marker): GroupedMarker[];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Guid } from '@equinor/echo-utils';
|
|
2
|
-
import { GlobalSelectionItemType } from '../../../../globalSelection';
|
|
3
|
-
import { Badge, Marker } from '../../../types/legendMarkerBadge.type';
|
|
4
|
-
export interface GroupKey {
|
|
5
|
-
/** Helper to get the full string representation of the group key based on groupId, color, and optional itemType */
|
|
6
|
-
toString: () => string;
|
|
7
|
-
groupId: Guid;
|
|
8
|
-
color: string;
|
|
9
|
-
/** Optional item type for local selection which will be split by type */
|
|
10
|
-
itemType?: GlobalSelectionItemType;
|
|
11
|
-
}
|
|
12
|
-
export interface BadgeGroup {
|
|
13
|
-
groupKey: GroupKey;
|
|
14
|
-
highlightColor: string;
|
|
15
|
-
badges: Badge[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Markers that has been processed based on Selection Groups will have a group key.
|
|
19
|
-
*/
|
|
20
|
-
export interface GroupedMarker extends Marker {
|
|
21
|
-
getGroupKey: () => GroupKey;
|
|
22
|
-
}
|
package/src/lib/feature/legend/components/selectionLegend/hooks/useAllGroupedMarkersForLegends.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns all markers for all legends with grouping. Hidden markers are included.
|
|
3
|
-
* Only markers from enabled legends are returned.
|
|
4
|
-
*/
|
|
5
|
-
export declare const useAllGroupedMarkersForLegends: () => import("../../pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types").GroupedMarker[] | undefined;
|