@equinor/echo-framework 2.2.1 → 2.2.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 +6 -6
- package/src/index.d.ts +3 -2
- package/src/lib/feature/globalSelection/index.d.ts +1 -0
- package/src/lib/feature/legend/components/BasicLegendRenderer.d.ts +0 -1
- package/src/lib/feature/legend/components/LegendRendererWrapper.d.ts +6 -0
- package/src/lib/feature/legend/components/basicLegendRenderer.logic.d.ts +2 -2
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +24 -4
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRenderer.d.ts +2 -0
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersByLegends.d.ts +4 -27
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersBySingleLegend.d.ts +10 -0
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/usePopoverHandler.d.ts +2 -2
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/usePopoverHandler.types.d.ts +14 -0
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.d.ts +22 -0
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types.d.ts +19 -0
- package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +3 -2
- package/src/lib/feature/legend/components/selectionLegend/SelectionLegend.d.ts +1 -0
- package/src/lib/feature/legend/components/selectionLegend/SelectionLegendChip.d.ts +7 -0
- package/src/lib/feature/legend/components/selectionLegend/hooks/useAllGroupedMarkersForLegends.d.ts +5 -0
- package/src/lib/feature/legend/components/selectionLegend/hooks/useIsSelectionLegendVisible.d.ts +6 -0
- package/src/lib/feature/legend/components/selectionLegend/selectionLegend.utils.d.ts +34 -0
- package/src/lib/feature/legend/hooks/useGroupedMarkers.d.ts +16 -0
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.d.ts +11 -0
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.utils.d.ts +21 -0
- package/src/lib/feature/legend/hooks/useLegendUniqueBadges.d.ts +9 -0
- package/src/lib/feature/legend/hooks/useLegendUniqueMarkers.d.ts +9 -0
- package/src/lib/feature/legend/index.d.ts +7 -3
- package/src/lib/feature/legend/legendFacade.d.ts +44 -35
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/WorkOrderLegend.d.ts +1 -1
- package/src/lib/feature/legend/logic/normalizeBadges.d.ts +33 -0
- package/src/lib/feature/legend/stores/initializeLegendInStores.d.ts +2 -0
- package/src/lib/feature/legend/{legendStore.d.ts → stores/legendDataStore/legendStore.d.ts} +48 -13
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.d.ts +32 -0
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +25 -0
- package/src/lib/feature/legend/{legendVisibleDataAsTagsStore.logic.d.ts → stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore.logic.d.ts} +1 -1
- package/src/lib/feature/legend/{legendVisibleDataStore.d.ts → stores/legendVisibleDataStore/legendVisibleDataStore.d.ts} +1 -1
- package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +6 -6
- package/src/lib/feature/legend/types/legendStrategy.type.d.ts +7 -2
- package/src/lib/feature/legend/types/legendType.d.ts +7 -13
- package/src/lib/feature/legend/hooks/useLegendMarkers.d.ts +0 -19
- /package/src/lib/feature/legend/{legendVisibleDataAsTagsStore.d.ts → stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore.d.ts} +0 -0
- /package/src/lib/feature/legend/{legendVisibleDataAsTagsStore.type.d.ts → stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore.type.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@equinor/echo-base": ">= 2.2.
|
|
6
|
-
"@equinor/echo-components": ">= 2.2.
|
|
7
|
-
"@equinor/echo-core": ">= 2.2.
|
|
8
|
-
"@equinor/echo-search": ">= 2.2.
|
|
9
|
-
"@equinor/echo-utils": ">= 2.2.
|
|
5
|
+
"@equinor/echo-base": ">= 2.2.3 < 3.0.0",
|
|
6
|
+
"@equinor/echo-components": ">= 2.2.3 < 3.0.0",
|
|
7
|
+
"@equinor/echo-core": ">= 2.2.3 < 3.0.0",
|
|
8
|
+
"@equinor/echo-search": ">= 2.2.3 < 3.0.0",
|
|
9
|
+
"@equinor/echo-utils": ">= 2.2.3 < 3.0.0",
|
|
10
10
|
"@equinor/eds-core-react": "0.49.0",
|
|
11
11
|
"@equinor/eds-icons": "0.22.0",
|
|
12
12
|
"react": ">= 17.0.2",
|
package/src/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ export * from './lib/feature/legacyLegend/index';
|
|
|
26
26
|
export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
|
|
27
27
|
export { PopoverLoading } from './lib/feature/legend/components/pdfMarkers/subComponents/components/PopoverLoading';
|
|
28
28
|
export * from './lib/feature/legend/index';
|
|
29
|
-
export { legendVisibleTagsSubscribeToStore } from './lib/feature/legend/legendVisibleDataAsTagsStore';
|
|
29
|
+
export { legendVisibleTagsSubscribeToStore } from './lib/feature/legend/stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore';
|
|
30
|
+
export { knownLegendIds } from './lib/feature/legend/types/legendType';
|
|
30
31
|
export type { LegendDataId, LegendEquipmentId, LegendState, LegendTagId } from './lib/feature/legend/types/legendType';
|
|
31
32
|
export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
|
|
32
33
|
export * from './lib/feature/measuringPoint/index';
|
|
@@ -50,7 +51,7 @@ export { RegisteredComponentName } from './lib/services/componentRegistry/compon
|
|
|
50
51
|
export * from './lib/services/dataLayerPanel';
|
|
51
52
|
export { EchoViewInspectionToolMode } from './lib/services/echoViewService/echoView.type';
|
|
52
53
|
export type { EchoView, EchoViewEcmPdfInspectionToolConfig, EchoViewSyncSettings } from './lib/services/echoViewService/echoView.type';
|
|
53
|
-
export { echoViewService, echoViewServiceAPI, setEchoView
|
|
54
|
+
export { clearEchoView, echoViewService, echoViewServiceAPI, setEchoView } from './lib/services/echoViewService/echoViewService';
|
|
54
55
|
export * from './lib/services/eventHubActions';
|
|
55
56
|
export * from './lib/services/leftPanelNavigation';
|
|
56
57
|
export * from './lib/services/locationService/locationService';
|
|
@@ -8,6 +8,7 @@ export { useGlobalSelectionItemsByType } from './hooks/useGlobalSelectionItemsBy
|
|
|
8
8
|
export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
|
|
9
9
|
export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
|
|
10
10
|
export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
|
|
11
|
+
export { useIsInGlobalSelection } from './hooks/useIsInGlobalSelection';
|
|
11
12
|
export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesByGroupId';
|
|
12
13
|
export { useCurrentSelectionId } from './selectionMenu/hooks/useCurrentSelectionId';
|
|
13
14
|
export { useFetchSelectionHistory } from './selectionMenu/hooks/useFetchSelectionHistory';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LegendChipProps } from '@equinor/echo-components';
|
|
2
2
|
import { Badge, Marker } from '../types/legendMarkerBadge.type';
|
|
3
3
|
import { LegendState } from '../types/legendType';
|
|
4
|
-
export declare const getMarkerChips: (markers: ReadonlyArray<Marker>, legend: LegendState) => LegendChipProps[];
|
|
5
|
-
export declare const getBadgeChips: (badges: ReadonlyArray<Badge>, legend: LegendState) => LegendChipProps[];
|
|
4
|
+
export declare const getMarkerChips: (markers: ReadonlyArray<Marker>, legend: LegendState, hiddenMarkers: string[]) => LegendChipProps[];
|
|
5
|
+
export declare const getBadgeChips: (badges: ReadonlyArray<Badge>, legend: LegendState, hiddenBadges: string[]) => LegendChipProps[];
|
package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { ItemMarkerSize } from '@equinor/echo-components';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Marker } from '../../../types/legendMarkerBadge.type';
|
|
4
4
|
interface LegendColoredMarkerIconProps {
|
|
5
|
-
legendId: LegendId;
|
|
6
|
-
itemId: LegendDataId;
|
|
7
5
|
hasPointer: boolean;
|
|
8
6
|
isActive: boolean;
|
|
9
7
|
onClick: () => void;
|
|
8
|
+
hiddenBadges: string[];
|
|
9
|
+
marker: Marker;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Renders a colored marker icon with optional pointer and badges.
|
|
13
|
+
*
|
|
14
|
+
* @param {boolean} hasPointer - Flag to indicate if the marker should have a pointer, currently in lower right corner.
|
|
15
|
+
* @param {boolean} isActive - Flag to indicate if the marker is active (selected).
|
|
16
|
+
* @param {() => void} onClick - Callback invoked when the marker is clicked.
|
|
17
|
+
* @param {string[]} hiddenBadges - Array of badge titles that should be hidden.
|
|
18
|
+
* @param {Marker} marker - The marker data to be rendered.
|
|
19
|
+
*
|
|
20
|
+
* @returns {JSX.Element | null} The rendered colored marker icon or null if no marker is provided.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <LegendColoredMarkerIcon
|
|
24
|
+
* hasPointer={true}
|
|
25
|
+
* isActive={false}
|
|
26
|
+
* onClick={() => console.log('Marker clicked')}
|
|
27
|
+
* hiddenBadges={['Badge1', 'Badge2']}
|
|
28
|
+
* marker={markerData}
|
|
29
|
+
* />
|
|
30
|
+
*/
|
|
31
|
+
export declare const LegendColoredMarkerIcon: React.FC<LegendColoredMarkerIconProps>;
|
|
12
32
|
export declare const MARKER_ICON_WIDTH = ItemMarkerSize.Default;
|
|
13
33
|
export {};
|
package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRenderer.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ interface LegendPositionItem {
|
|
|
4
4
|
itemId: LegendDataId;
|
|
5
5
|
positionString: string;
|
|
6
6
|
hasPointer: boolean;
|
|
7
|
+
/** Unique identifier that doesn't change on viewport changes */
|
|
8
|
+
uniqueIdentifier: string;
|
|
7
9
|
}
|
|
8
10
|
interface LegendMarkersRendererProps {
|
|
9
11
|
positionItems: ReadonlyArray<LegendPositionItem>;
|
package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersByLegends.d.ts
CHANGED
|
@@ -1,35 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { LegendDataId } from '../../../types/legendType';
|
|
2
|
+
import { PopoverContent, RequestPopoverHandler } from './hooks/usePopoverHandler.types';
|
|
3
3
|
interface MultipleMarkersByLegendsProps {
|
|
4
4
|
itemId: LegendDataId;
|
|
5
5
|
hasPointer: boolean;
|
|
6
6
|
onOpenPopover: RequestPopoverHandler;
|
|
7
7
|
onClosePopover: () => void;
|
|
8
8
|
currentPopover?: PopoverContent;
|
|
9
|
-
|
|
9
|
+
uniqueIdentifier: string;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export interface PopoverContent {
|
|
13
|
-
elements: ReadonlyArray<JSX.Element>;
|
|
14
|
-
activeItem: ActiveItem;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* We use active for the icon. Several icons might be active if they have the same tagNo on the PDF, but only 1 of them is open.
|
|
18
|
-
*/
|
|
19
|
-
interface ActiveItem {
|
|
20
|
-
itemId: LegendDataId;
|
|
21
|
-
legendId: LegendId;
|
|
22
|
-
positionString: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Renders 1 marker for each legend.
|
|
26
|
-
*
|
|
27
|
-
* @param {LegendDataId} itemId - The ID of the legend item.
|
|
28
|
-
* @param {boolean} hasPointer - Flag to indicate if the marker should have a pointer, currently in lower right corner.
|
|
29
|
-
* @param {RequestPopoverHandler} onOpenPopover - Callback invoked when a marker is clicked; fetchPopoverContent should be called to fetch/populate the popover.
|
|
30
|
-
* @param {() => void} onClosePopover - Callback invoked to close the popover
|
|
31
|
-
* @param {(value: PopoverContent | undefined) => void} setOpenItem - Callback function to handle opening the popover.
|
|
32
|
-
*/
|
|
33
|
-
export declare const MultipleMarkersByLegendsComponent: React.FC<MultipleMarkersByLegendsProps>;
|
|
34
|
-
export declare const MultipleMarkersByLegends: React.NamedExoticComponent<MultipleMarkersByLegendsProps>;
|
|
11
|
+
export declare const MultipleMarkersByLegends: import("react").MemoExoticComponent<(props: MultipleMarkersByLegendsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
35
12
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LegendDataId, LegendId } from '../../../types/legendType';
|
|
2
|
+
interface MultipleMarkersBySingleLegendComponentProps {
|
|
3
|
+
legendId: LegendId;
|
|
4
|
+
itemId: LegendDataId;
|
|
5
|
+
hasPointer: boolean;
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const MultipleMarkersBySingleLegend: import("react").MemoExoticComponent<(props: MultipleMarkersBySingleLegendComponentProps) => import("react/jsx-runtime").JSX.Element[] | null>;
|
|
10
|
+
export {};
|
package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/usePopoverHandler.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LegendDataId, LegendId } from '../../../../types/legendType';
|
|
2
|
-
import { PopoverContent } from '
|
|
2
|
+
import { PopoverContent } from './usePopoverHandler.types';
|
|
3
3
|
export declare function usePopoverHandler(): {
|
|
4
4
|
currentPopover: PopoverContent | undefined;
|
|
5
|
-
handleOpenPopover: (itemId: LegendDataId, legendId: LegendId,
|
|
5
|
+
handleOpenPopover: (itemId: LegendDataId, legendId: LegendId, uniqueIdentifier: string, fetchPopoverContent: () => Promise<ReadonlyArray<React.JSX.Element>>) => Promise<void>;
|
|
6
6
|
handleClosePopover: () => void;
|
|
7
7
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LegendDataId, LegendId } from '../../../../types/legendType';
|
|
2
|
+
export type RequestPopoverHandler = (itemId: LegendDataId, legendId: LegendId, uniqueIdentifier: string, fetchPopoverContent: () => Promise<ReadonlyArray<React.JSX.Element>>) => void;
|
|
3
|
+
export interface PopoverContent {
|
|
4
|
+
elements: ReadonlyArray<JSX.Element>;
|
|
5
|
+
activeItem: ActiveItem;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* We use active for the icon. Several icons might be active if they have the same tagNo on the PDF, but only 1 of them is open.
|
|
9
|
+
*/
|
|
10
|
+
export interface ActiveItem {
|
|
11
|
+
itemId: LegendDataId;
|
|
12
|
+
legendId: LegendId;
|
|
13
|
+
uniqueIdentifier: string;
|
|
14
|
+
}
|
package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { Badge, Marker } from '../../../types/legendMarkerBadge.type';
|
|
3
|
+
export interface GroupKey {
|
|
4
|
+
/** Helper to get the full string representation of the group key based on groupId and color */
|
|
5
|
+
toString: () => string;
|
|
6
|
+
groupId: Guid;
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BadgeGroup {
|
|
10
|
+
groupKey: GroupKey;
|
|
11
|
+
highlightColor: string;
|
|
12
|
+
badges: Badge[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Markers that has been processed based on Selection Groups will have a group key.
|
|
16
|
+
*/
|
|
17
|
+
export interface GroupedMarker extends Marker {
|
|
18
|
+
getGroupKey: () => GroupKey;
|
|
19
|
+
}
|
|
@@ -13,8 +13,9 @@ import { Marker } from './../../types/legendMarkerBadge.type';
|
|
|
13
13
|
* @param {ReadonlyArray<string>} [params.excludedLegendTitles] - Optional array of titles to exclude from the chips (case-insensitive).
|
|
14
14
|
* @returns {LegendChipProps[]} The filtered and mapped array of LegendChipProps for rendering.
|
|
15
15
|
*/
|
|
16
|
-
export declare function getLegendChipsFromMarkers({ markers,
|
|
16
|
+
export declare function getLegendChipsFromMarkers({ markers, legendSelectedBadgeOption, legendSelectedMarkerOption, excludedLegendTitles }: {
|
|
17
17
|
markers: ReadonlyArray<Marker>;
|
|
18
|
-
legend: LegendState;
|
|
19
18
|
excludedLegendTitles?: ReadonlyArray<string>;
|
|
19
|
+
legendSelectedBadgeOption?: LegendState['selectedBadgeOption'];
|
|
20
|
+
legendSelectedMarkerOption?: LegendState['selectedMarkerOption'];
|
|
20
21
|
}): LegendChipProps[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SelectionLegendRenderer: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface LegendItemProps {
|
|
2
|
+
label: string;
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
onClick: (isDisabled: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const SelectionLegendChip: import("react").MemoExoticComponent<(props: LegendItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export {};
|
package/src/lib/feature/legend/components/selectionLegend/hooks/useAllGroupedMarkersForLegends.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { GlobalSelectionTypes, SelectionGroup } from '../../../globalSelection';
|
|
3
|
+
import { GroupKey } from '../pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
|
|
4
|
+
/**
|
|
5
|
+
* TODO: Remove this flag when Selection Legend is stable and ready for production
|
|
6
|
+
* Flag to enable/disable Selection Legend feature
|
|
7
|
+
*/
|
|
8
|
+
export declare const isSelectionLegendEnabled: () => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Key used for badges that don't belong to any selection group
|
|
11
|
+
*/
|
|
12
|
+
export declare const NOT_IN_SELECTION_GROUP_KEY: GroupKey;
|
|
13
|
+
/**
|
|
14
|
+
* Extracts all item IDs from selection group categories
|
|
15
|
+
*/
|
|
16
|
+
export declare const extractSelectionGroupItemIds: (selectionGroup: SelectionGroup) => GlobalSelectionTypes.ItemId[];
|
|
17
|
+
/**
|
|
18
|
+
* Gets the most frequently used color for a selection group
|
|
19
|
+
*/
|
|
20
|
+
export declare const getSelectionGroupMostUsedColor: (selectionGroup: SelectionGroup, allGroups: SelectionGroup[]) => string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a standardized group key for a selection group.
|
|
23
|
+
* This key is used across the legend system to:
|
|
24
|
+
* - Identify marker variants split by selection groups (viewport)
|
|
25
|
+
* - Toggle visibility of selection groups (SelectionLegendRenderer)
|
|
26
|
+
* - Filter hidden selection groups (groupMarkersBySelection)
|
|
27
|
+
*
|
|
28
|
+
* Format as string: `group_${groupId}_${color}`
|
|
29
|
+
*
|
|
30
|
+
* @param groupId - The unique identifier of the selection group
|
|
31
|
+
* @param color - The highlight color for the group
|
|
32
|
+
* @returns The standardized group key
|
|
33
|
+
*/
|
|
34
|
+
export declare const createSelectionGroupKey: (groupId: Guid, color: string) => GroupKey;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GroupedMarker } from '../components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
|
|
2
|
+
import { Marker } from '../types/legendMarkerBadge.type';
|
|
3
|
+
import { LegendId } from '../types/legendType';
|
|
4
|
+
/**
|
|
5
|
+
* Will process markers and group them based on groups in Selection.
|
|
6
|
+
* This also adds additional logic for counting badges where this is needed.
|
|
7
|
+
* @param legendId
|
|
8
|
+
* @param markers
|
|
9
|
+
* @param hiddenMarkers If included hidden markers will be filtered out
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const useGroupedMarkers: (args: {
|
|
13
|
+
legendId: LegendId;
|
|
14
|
+
markers: Marker[];
|
|
15
|
+
hiddenMarkers?: string[];
|
|
16
|
+
}) => GroupedMarker[] | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Marker } from '../../types/legendMarkerBadge.type';
|
|
2
|
+
import { LegendDataId, LegendId } from '../../types/legendType';
|
|
3
|
+
export interface UseLegendMarkerProps {
|
|
4
|
+
legendId: LegendId;
|
|
5
|
+
itemIds: LegendDataId[];
|
|
6
|
+
hiddenMarkers: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns the visible markers for the given legendId and itemId.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useLegendMarker(props: UseLegendMarkerProps): Marker | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for legend visible markers functionality.
|
|
3
|
+
*
|
|
4
|
+
* This module contains shared utilities, helper functions, and debugging tools
|
|
5
|
+
* used across the legend marker hooks.
|
|
6
|
+
*/
|
|
7
|
+
import { Marker } from '../../types/legendMarkerBadge.type';
|
|
8
|
+
import { LegendDataId, LegendId } from '../../types/legendType';
|
|
9
|
+
/**
|
|
10
|
+
* Development helper to track hook calls
|
|
11
|
+
*/
|
|
12
|
+
export declare const trackMarkerCallsInDevelopment: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Helper to get unique data from the legend visible data store
|
|
15
|
+
*/
|
|
16
|
+
export declare const useUniqueVisibleData: () => LegendDataId[];
|
|
17
|
+
/**
|
|
18
|
+
* Common logic for creating markers from data using strategy.
|
|
19
|
+
* Selection-based grouping is handled at the viewport rendering level.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useCreateMarkers: (legendId: LegendId, data: LegendDataId[], isViewport?: boolean) => ReadonlyArray<Marker>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Badge } from '../types/legendMarkerBadge.type';
|
|
2
|
+
import { LegendId } from '../types/legendType';
|
|
3
|
+
/**
|
|
4
|
+
* Returns all unique badges for the given legendId, determined by unique title + color.
|
|
5
|
+
* This will also return markers that are not visible on screen.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useLegendUniqueBadges(legendId: LegendId, options?: {
|
|
8
|
+
isViewport?: boolean;
|
|
9
|
+
}): ReadonlyArray<Badge>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Marker } from '../types/legendMarkerBadge.type';
|
|
2
|
+
import { LegendId } from '../types/legendType';
|
|
3
|
+
/**
|
|
4
|
+
* Returns all unique markers for the given legendId, determined by unique displayKey (title + color).
|
|
5
|
+
* This will also return markers that are not visible on screen.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useLegendUniqueMarkers(legendId: LegendId, options?: {
|
|
8
|
+
isViewport?: boolean;
|
|
9
|
+
}): ReadonlyArray<Marker>;
|
|
@@ -7,10 +7,14 @@ export { MultipleMarkersByLegends } from './components/pdfMarkers/subComponents/
|
|
|
7
7
|
export { LegendPopoverContent } from './components/popover/LegendPopoverContent';
|
|
8
8
|
export type { LegendPopoverContentProps, LegendPopoverTertiaryLabels } from './components/popover/LegendPopoverContent';
|
|
9
9
|
export { legendFacade } from './legendFacade';
|
|
10
|
-
export { legendSnapShot } from './legendStore';
|
|
11
10
|
export { getLegendStrategy } from './legendStrategies/legendCollections';
|
|
11
|
+
export { legendSnapShot } from './stores/legendDataStore/legendStore';
|
|
12
12
|
export type { Badge, Marker } from './types/legendMarkerBadge.type';
|
|
13
13
|
export type { LegendStrategy } from './types/legendStrategy.type';
|
|
14
14
|
export type { LegendId, LegendOptionConfig } from './types/legendType';
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
15
|
+
export { useLegendUniqueBadges } from './hooks/useLegendUniqueBadges';
|
|
16
|
+
export { useLegendUniqueMarkers } from './hooks/useLegendUniqueMarkers';
|
|
17
|
+
export { COUNT_MODE_KEYWORD } from './logic/normalizeBadges';
|
|
18
|
+
export { useLegendVisibleDataStore } from './stores/legendVisibleDataStore/legendVisibleDataStore';
|
|
19
|
+
export { isWorkOrderLegendFeatureEnabled } from './legendStrategies/workOrderStrategy/WorkOrderLegend';
|
|
20
|
+
export { useLegendUIStore } from './stores/legendUIStore/legendUIStore';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { legendSnapShot, useAllLegends, useLegendById } from './legendStore';
|
|
2
1
|
import { getLegendStrategy, injectLegendStrategy } from './legendStrategies/legendCollections';
|
|
3
|
-
import { visibleDataAsTagsSnapshot } from './legendVisibleDataAsTagsStore';
|
|
4
2
|
import { isLegendDataIdEqualWithTag } from './logic/isLegendDataIdEqualWithTag';
|
|
5
|
-
import {
|
|
3
|
+
import { legendExistsInLegendStore, legendSnapShot, useAllLegends, useLegendById } from './stores/legendDataStore/legendStore';
|
|
4
|
+
import { legendExistsInLegendUIStore, useLegendUIById } from './stores/legendUIStore/legendUIStore';
|
|
5
|
+
import { visibleDataAsTagsSnapshot } from './stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore';
|
|
6
|
+
import { LegendId } from './types/legendType';
|
|
6
7
|
/**
|
|
7
8
|
* Public facade for the legend.
|
|
8
9
|
*/
|
|
@@ -11,26 +12,41 @@ export declare const legendFacade: Readonly<{
|
|
|
11
12
|
inject: typeof injectLegendStrategy;
|
|
12
13
|
get: typeof getLegendStrategy;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
+
data: {
|
|
16
|
+
useAll: typeof useAllLegends;
|
|
17
|
+
useById: typeof useLegendById;
|
|
18
|
+
exists: typeof legendExistsInLegendStore;
|
|
19
|
+
snapshot: typeof legendSnapShot;
|
|
15
20
|
subscribe: {
|
|
16
|
-
(listener: (selectedState: import("./legendStore").LegendStoreData & import("./legendStore").LegendStoreActions, previousSelectedState: import("./legendStore").LegendStoreData & import("./legendStore").LegendStoreActions) => void): () => void;
|
|
17
|
-
<U>(selector: (state: import("./legendStore").LegendStoreData & import("./legendStore").LegendStoreActions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
21
|
+
(listener: (selectedState: import("./stores/legendDataStore/legendStore").LegendStoreData & import("./stores/legendDataStore/legendStore").LegendStoreActions, previousSelectedState: import("./stores/legendDataStore/legendStore").LegendStoreData & import("./stores/legendDataStore/legendStore").LegendStoreActions) => void): () => void;
|
|
22
|
+
<U>(selector: (state: import("./stores/legendDataStore/legendStore").LegendStoreData & import("./stores/legendDataStore/legendStore").LegendStoreActions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
18
23
|
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
19
24
|
fireImmediately?: boolean;
|
|
20
25
|
} | undefined): () => void;
|
|
21
26
|
};
|
|
22
27
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
ui: {
|
|
29
|
+
useById: typeof useLegendUIById;
|
|
30
|
+
exists: typeof legendExistsInLegendUIStore;
|
|
31
|
+
accordion: {
|
|
32
|
+
toggle: (legendId: LegendId, newValue: boolean) => void;
|
|
33
|
+
};
|
|
34
|
+
markers: {
|
|
35
|
+
setHidden: (params: {
|
|
36
|
+
legendId: LegendId;
|
|
37
|
+
marker: string;
|
|
38
|
+
isHidden: boolean;
|
|
39
|
+
}) => void;
|
|
40
|
+
};
|
|
41
|
+
badges: {
|
|
42
|
+
setHidden: (params: {
|
|
43
|
+
legendId: LegendId;
|
|
44
|
+
badge: string;
|
|
45
|
+
isHidden: boolean;
|
|
46
|
+
}) => void;
|
|
30
47
|
};
|
|
31
|
-
useBy: typeof useLegendById;
|
|
32
|
-
useAll: typeof useAllLegends;
|
|
33
48
|
};
|
|
49
|
+
exists: (legendId: LegendId) => boolean;
|
|
34
50
|
visibleData: {
|
|
35
51
|
getBy: <T extends keyof {
|
|
36
52
|
Tag: import("./types/legendType").LegendTagId;
|
|
@@ -60,46 +76,39 @@ export declare const legendFacade: Readonly<{
|
|
|
60
76
|
removePreviousItems?: boolean;
|
|
61
77
|
}) => void;
|
|
62
78
|
subscribe: {
|
|
63
|
-
(listener: (selectedState: import("./legendVisibleDataStore").LegendVisibleDataStore, previousSelectedState: import("./legendVisibleDataStore").LegendVisibleDataStore) => void): () => void;
|
|
64
|
-
<U>(selector: (state: import("./legendVisibleDataStore").LegendVisibleDataStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
79
|
+
(listener: (selectedState: import("./stores/legendVisibleDataStore/legendVisibleDataStore").LegendVisibleDataStore, previousSelectedState: import("./stores/legendVisibleDataStore/legendVisibleDataStore").LegendVisibleDataStore) => void): () => void;
|
|
80
|
+
<U>(selector: (state: import("./stores/legendVisibleDataStore/legendVisibleDataStore").LegendVisibleDataStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
65
81
|
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
66
82
|
fireImmediately?: boolean;
|
|
67
83
|
} | undefined): () => void;
|
|
68
84
|
};
|
|
69
85
|
};
|
|
70
86
|
visibleDataAsTags: {
|
|
71
|
-
useStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>, "setState"> & {
|
|
87
|
+
useStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>, "setState"> & {
|
|
72
88
|
setState<A extends string | {
|
|
73
89
|
type: string;
|
|
74
|
-
}>(partial: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
90
|
+
}>(partial: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
75
91
|
}, "subscribe"> & {
|
|
76
92
|
subscribe: {
|
|
77
|
-
(listener: (selectedState: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore, previousSelectedState: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => void): () => void;
|
|
78
|
-
<U>(selector: (state: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
93
|
+
(listener: (selectedState: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore, previousSelectedState: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => void): () => void;
|
|
94
|
+
<U>(selector: (state: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
79
95
|
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
80
96
|
fireImmediately?: boolean;
|
|
81
97
|
} | undefined): () => void;
|
|
82
98
|
};
|
|
83
99
|
}, "setState"> & {
|
|
84
|
-
setState(nextStateOrUpdater: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: import("immer").WritableDraft<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
100
|
+
setState(nextStateOrUpdater: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: import("immer").WritableDraft<import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
85
101
|
type: string;
|
|
86
102
|
} | undefined): void;
|
|
87
103
|
}>;
|
|
88
|
-
|
|
104
|
+
snapshot: typeof visibleDataAsTagsSnapshot;
|
|
89
105
|
};
|
|
90
106
|
utils: {
|
|
91
107
|
isLegendDataIdEqualWithTag: typeof isLegendDataIdEqualWithTag;
|
|
92
108
|
};
|
|
109
|
+
knownLegendIds: {
|
|
110
|
+
equipmentLegendId: LegendId;
|
|
111
|
+
tagLegendId: LegendId;
|
|
112
|
+
workOrderLegendId: LegendId;
|
|
113
|
+
};
|
|
93
114
|
}>;
|
|
94
|
-
/**
|
|
95
|
-
<PositionalLegendMarkers
|
|
96
|
-
items={visibleItemsWithPosition}
|
|
97
|
-
pdfRotation={pdfRotation}
|
|
98
|
-
currentPageScale={currentPageScale}
|
|
99
|
-
pdfZoom={pdfZoom}
|
|
100
|
-
/>
|
|
101
|
-
|
|
102
|
-
*/
|
|
103
|
-
export type { LegendStoreActions, LegendStoreData } from './legendStore';
|
|
104
|
-
export type { VisibleDataAsTagsStore } from './legendVisibleDataAsTagsStore';
|
|
105
|
-
export type { LegendVisibleDataStore } from './legendVisibleDataStore';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const isWorkOrderLegendFeatureEnabled: () => boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Badge } from '../types/legendMarkerBadge.type';
|
|
2
|
+
/**
|
|
3
|
+
* Keyword used to identify count mode in badge text options. This changes
|
|
4
|
+
* the way we normalize badges.
|
|
5
|
+
*/
|
|
6
|
+
export declare const COUNT_MODE_KEYWORD = "Count";
|
|
7
|
+
/**
|
|
8
|
+
* Determines if count mode should be enabled based on badge text options.
|
|
9
|
+
* Count mode is enabled when any option value exactly equals 'Count'.
|
|
10
|
+
*
|
|
11
|
+
* @param badgeTextOptions - Badge text configuration options from legend state
|
|
12
|
+
* @returns Whether count mode should be enabled
|
|
13
|
+
*/
|
|
14
|
+
export declare function isCountMode(badgeTextOptions: Record<string, string> | undefined): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Creates badges with count displayed as title.
|
|
17
|
+
* Takes all badges (including duplicates) and unique badges, and returns unique badges
|
|
18
|
+
* with their titles replaced by the count of how many times they appear.
|
|
19
|
+
*
|
|
20
|
+
* @param allBadges - All badges including duplicates
|
|
21
|
+
* @param uniqueBadges - Unique badges to be displayed
|
|
22
|
+
* @returns Array of badges with count as title
|
|
23
|
+
*/
|
|
24
|
+
export declare function createBadgesWithCount(allBadges: ReadonlyArray<Badge>, uniqueBadges: ReadonlyArray<Badge>): Badge[];
|
|
25
|
+
/**
|
|
26
|
+
* Normalizes badges for display by removing duplicates and optionally applying count mode.
|
|
27
|
+
* Count mode is determined from the badge text options configuration.
|
|
28
|
+
*
|
|
29
|
+
* @param badges - Array of badges to normalize
|
|
30
|
+
* @param badgeTextOptions - Badge text configuration options from legend state
|
|
31
|
+
* @returns Normalized array of badges
|
|
32
|
+
*/
|
|
33
|
+
export declare function normalizeBadges(badges: ReadonlyArray<Badge>, badgeTextOptions: Record<string, string> | undefined): Badge[];
|