@equinor/echo-framework 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/index.cjs.js +2 -2
  2. package/package.json +8 -8
  3. package/src/index.d.ts +3 -3
  4. package/src/lib/components/prepview/panels/objects/objects.logic.d.ts +7 -0
  5. package/src/lib/components/prepview/panels/objects/objects.utils.d.ts +14 -0
  6. package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/AddSelectionListWithSameNameDialog.d.ts +8 -0
  7. package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/SelectionActionBarMultiple.d.ts +9 -0
  8. package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.colors.d.ts +2 -0
  9. package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.constants.d.ts +1 -0
  10. package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.orchestration.d.ts +10 -0
  11. package/src/lib/components/prepview/panels/objects/selectionActionBarMultiple/logic/selectionActionBarMultiple.utils.d.ts +3 -0
  12. package/src/lib/components/prepview/panels/tagDocumentRefs/HorizontalDocumentGroups.d.ts +1 -1
  13. package/src/lib/feature/globalSelection/components/selectionActionBar/SelectionActionBar.d.ts +12 -0
  14. package/src/lib/feature/globalSelection/components/selectionActionBar/SelectionActionBarMenuItem.d.ts +12 -0
  15. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +3 -2
  16. package/src/lib/feature/globalSelection/globalSelectionColorService.d.ts +3 -3
  17. package/src/lib/feature/globalSelection/globalSelectionColorService.types.d.ts +1 -0
  18. package/src/lib/feature/globalSelection/hooks/useSelectionAction.d.ts +2 -2
  19. package/src/lib/feature/globalSelection/index.d.ts +2 -2
  20. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addItems.action.d.ts +5 -4
  21. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeAllItemsById.action.d.ts +1 -1
  22. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeItemsById.action.d.ts +1 -1
  23. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +5 -4
  24. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +11 -11
  25. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +4 -3
  26. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +9 -7
  27. package/src/lib/feature/legend/components/BasicLegendRenderer.d.ts +1 -1
  28. package/src/lib/feature/legend/components/LegendSelectorContainer.d.ts +17 -0
  29. package/src/lib/feature/legend/components/pdfMarkers/subComponents/ItemMarkerPopoverContainer.d.ts +9 -0
  30. package/src/lib/feature/legend/components/popover/LegendPopoverContent.d.ts +9 -26
  31. package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +12 -6
  32. package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +0 -4
  33. package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.utils.d.ts +1 -1
  34. package/src/lib/feature/legend/hooks/useLegendUniqueBadges.d.ts +1 -3
  35. package/src/lib/feature/legend/hooks/useLegendUniqueMarkers.d.ts +1 -3
  36. package/src/lib/feature/legend/index.d.ts +8 -5
  37. package/src/lib/feature/legend/legendStrategies/notificationStrategy/api/notificationsLegend.api.d.ts +7 -0
  38. package/src/lib/feature/legend/legendStrategies/notificationStrategy/components/NotificationPopover.d.ts +8 -0
  39. package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationMarkers.d.ts +6 -0
  40. package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationsByTagIds.d.ts +14 -0
  41. package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/getNotificationPopover.d.ts +12 -0
  42. package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/notificationLegend.logic.d.ts +12 -0
  43. package/src/lib/feature/legend/legendStrategies/notificationStrategy/notificationStrategy.types.d.ts +5 -0
  44. package/src/lib/feature/legend/legendStrategies/notificationStrategy/optionConfigs/notificationBadgeLegendOptionConfig.d.ts +6 -0
  45. package/src/lib/feature/legend/legendStrategies/notificationStrategy/optionConfigs/notificationMarkerLegendOptionConfig.d.ts +4 -0
  46. package/src/lib/feature/legend/legendStrategies/notificationStrategy/testing/createTestNotification.d.ts +2 -0
  47. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getColorForNotificationLegendStatus.d.ts +7 -0
  48. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getNotificationTitlesByPropertyName.d.ts +2 -0
  49. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/notificationLegend.utils.d.ts +12 -0
  50. package/src/lib/feature/legend/logic/getColorForLegendStatus.d.ts +5 -0
  51. package/src/lib/feature/legend/logic/normalizeBadges.d.ts +25 -12
  52. package/src/lib/feature/legend/logic/propertyAccessor.utils.d.ts +36 -0
  53. package/src/lib/feature/legend/stores/initializeLegendInStores.d.ts +3 -4
  54. package/src/lib/feature/legend/stores/legendDataStore/legendStore.d.ts +0 -1
  55. package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +5 -5
  56. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +6 -6
  57. package/src/lib/feature/legend/types/legendType.d.ts +26 -19
  58. package/src/lib/hooks/useOpenPdfFile.d.ts +12 -0
  59. package/src/lib/hooks/useScreenValues.d.ts +2 -2
  60. package/src/lib/services/dataLayerPanel/dataLayerPanel.store.d.ts +2 -0
  61. package/src/lib/feature/globalSelection/components/SelectionActionBar/SelectionFeedbackDisplay.d.ts +0 -7
  62. package/src/lib/feature/globalSelection/components/SelectionActionBar/selectionFeedback.types.d.ts +0 -1
  63. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +0 -7
  64. package/src/lib/feature/globalSelection/components/SelectionMenuTrigger/SelectionGroupMenuItem.d.ts +0 -9
  65. package/src/lib/feature/globalSelection/components/SelectionMenuTrigger/SelectionMenuTrigger.d.ts +0 -12
  66. package/src/lib/feature/legend/components/legendTextSelector/LegendTextSelector.d.ts +0 -20
  67. package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverPrimaryRow.d.ts +0 -15
  68. package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverThirdRow.d.ts +0 -16
  69. /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": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 4.2.0 < 5.0.0",
6
- "@equinor/echo-components": ">= 4.2.0 < 5.0.0",
7
- "@equinor/echo-core": ">= 4.2.0 < 5.0.0",
8
- "@equinor/echo-search": ">= 4.2.0 < 5.0.0",
9
- "@equinor/echo-utils": ">= 4.2.0 < 5.0.0",
5
+ "@equinor/echo-base": ">= 4.3.0 < 5.0.0",
6
+ "@equinor/echo-components": ">= 4.3.0 < 5.0.0",
7
+ "@equinor/echo-core": ">= 4.3.0 < 5.0.0",
8
+ "@equinor/echo-search": ">= 4.3.0 < 5.0.0",
9
+ "@equinor/echo-utils": ">= 4.3.0 < 5.0.0",
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.12.10",
22
+ "msw": ">= 2.0.0 < 3",
23
23
  "date-fns": "4.1.0"
24
24
  },
25
25
  "dependencies": {
26
- "dexie": "4.3.0",
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,7 +19,7 @@ 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
24
  export { useIsAllIGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllIGlobalSelectionItemsHidden';
25
25
  export { useSelectionColorFrequencyByIds } from './lib/feature/globalSelection/selectionMenu/hooks/useSelectionColorFrequency';
@@ -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,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, }: HorizontalDocumentGroupsProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function HorizontalDocumentGroups({ documentGroups, tagNo }: HorizontalDocumentGroupsProps): import("react/jsx-runtime").JSX.Element;
7
7
  export { HorizontalDocumentGroups };
@@ -0,0 +1,12 @@
1
+ import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
2
+ export interface SelectionActionBarProps {
3
+ readonly itemId: GlobalSelectionTypes.ItemId;
4
+ readonly className?: string;
5
+ readonly showPopoverUpdateDelay?: boolean;
6
+ }
7
+ export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
8
+ /**
9
+ * Simple wrapper to apply custom styles to the SelectionActionBar when used in the ItemDetails pages,
10
+ * without affecting the SelectionActionBar used elsewhere.
11
+ */
12
+ 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 {};
@@ -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
- * Should be only used in local selection context!
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 getLocalSelectionColorByItemType(itemType: GlobalSelectionItemType): string;
57
+ export declare function getDefaultSelectionColorByItemType(itemType: GlobalSelectionItemType): SelectionColor;
@@ -1,3 +1,4 @@
1
1
  import { Brand } from '@equinor/echo-utils';
2
2
  export declare const SELECTION_PLACEHOLDER_COLOR = "#B0B0B0";
3
+ export type SelectionColor = string;
3
4
  export type HexColor = Brand<string, 'ItemIdString'>;
@@ -1,5 +1,5 @@
1
+ import type { SelectionBarFeedbackType } from '@equinor/echo-components';
1
2
  import { Guid } from '@equinor/echo-utils';
2
- import type { SelectionFeedbackType } from '../components/SelectionActionBar/selectionFeedback.types';
3
3
  import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
4
4
  /**
5
5
  *
@@ -14,7 +14,7 @@ import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionSto
14
14
  */
15
15
  export declare function useSelectionAction(showPopoverUpdateDelay?: boolean): {
16
16
  isLoading: boolean;
17
- feedbackType: SelectionFeedbackType | null;
17
+ feedbackType: SelectionBarFeedbackType | null;
18
18
  addToSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => Promise<void>;
19
19
  removeFromSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => void;
20
20
  changeColor: (itemId: GlobalSelectionTypes.ItemId, color: string) => void;
@@ -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 { isPdmsInternalTagType, PDMS_INTERNAL_TAG_TYPES } from './pdmsTag/pdmsTag.types';
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,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
- getActionResult?: boolean;
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?: Guid;
24
+ affectedGroupId: Guid | undefined;
24
25
  };
25
26
  export type SelectionTreeActionResult = 'ItemsUpdated' | 'ItemsAdded' | 'NewGroupCreated' | 'NoChanges';
26
27
  export {};
@@ -1,5 +1,4 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
- import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
3
2
  import { SelectionGroup, SelectionTreeStore } from './selectionTree.store.types';
4
3
  /**
5
4
  * Zustand store hook for managing the selection tree state in the global selection feature.
@@ -34,13 +33,14 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
34
33
  guid: Guid | undefined;
35
34
  }) => void;
36
35
  addItems: (args: {
37
- itemIds: GlobalSelectionTypes.ItemId[];
36
+ itemIds: ReadonlyArray<import("../..").GlobalSelectionTypes.ItemId>;
38
37
  groupId?: Guid;
38
+ useDefaultSelectionTypeColors?: boolean;
39
39
  }) => Promise<void>;
40
- addTags: (args: import("./actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.TagId>) => import("./selectionTree.store.types").AddTagsReturnType;
41
- addWorkOrders: (args: import("./actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => import("./selectionTree.store.types").AddWorkOrdersReturnType;
42
- addEquipments: (args: import("./actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.EquipmentId>) => import("./selectionTree.store.types").AddEquipmentsReturnType;
43
- addMeasuringPoints: (args: import("./actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.MeasuringPointId>) => import("./selectionTree.store.types").AddMeasuringPointsReturnType;
40
+ addTags: (args: import("./actions/selectionTree.action.types").AddItemArgs<import("../..").GlobalSelectionTypes.TagId>) => import("./selectionTree.store.types").AddTagsReturnType;
41
+ addWorkOrders: (args: import("./actions/selectionTree.action.types").AddItemArgs<import("../..").GlobalSelectionTypes.WorkOrderId>) => import("./selectionTree.store.types").AddWorkOrdersReturnType;
42
+ addEquipments: (args: import("./actions/selectionTree.action.types").AddItemArgs<import("../..").GlobalSelectionTypes.EquipmentId>) => import("./selectionTree.store.types").AddEquipmentsReturnType;
43
+ addMeasuringPoints: (args: import("./actions/selectionTree.action.types").AddItemArgs<import("../..").GlobalSelectionTypes.MeasuringPointId>) => import("./selectionTree.store.types").AddMeasuringPointsReturnType;
44
44
  createGroup: (args: {
45
45
  groupId?: string;
46
46
  label: string;
@@ -59,15 +59,15 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
59
59
  removeItemsById: (args: {
60
60
  groupId?: Guid;
61
61
  categoryId: import("./selectionTree.store.types").GlobalSelectionCategoryId;
62
- itemIds: GlobalSelectionTypes.ItemId[];
62
+ itemIds: ReadonlyArray<import("../..").GlobalSelectionTypes.ItemId>;
63
63
  }) => void;
64
64
  removeAllItemsById: (args: {
65
- itemIds: GlobalSelectionTypes.ItemId[];
65
+ itemIds: ReadonlyArray<import("../..").GlobalSelectionTypes.ItemId>;
66
66
  }) => void;
67
67
  moveItems: (args: {
68
68
  sourceGroupId: Guid;
69
69
  sourceCategoryId?: import("./selectionTree.store.types").GlobalSelectionCategoryId;
70
- sourceItemId?: GlobalSelectionTypes.ItemId;
70
+ sourceItemId?: import("../..").GlobalSelectionTypes.ItemId;
71
71
  targetGroupId: Guid;
72
72
  }) => void;
73
73
  setVisibilityById: (args: {
@@ -85,7 +85,7 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
85
85
  categories: {
86
86
  id: import("./selectionTree.store.types").GlobalSelectionCategoryId;
87
87
  label: string;
88
- items: Map<GlobalSelectionTypes.ItemIdString, {
88
+ items: Map<import("../..").GlobalSelectionTypes.ItemIdString, {
89
89
  id: {
90
90
  workOrderId: string;
91
91
  } | {
@@ -102,7 +102,7 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
102
102
  } | {
103
103
  measuringPointId: string;
104
104
  };
105
- type: import("../../globalSelectionStore/globalSelectionStore.types").GlobalSelectionItemType;
105
+ type: import("../..").GlobalSelectionItemType;
106
106
  }>;
107
107
  }[];
108
108
  groupId: Guid;
@@ -35,8 +35,9 @@ export interface SelectionTreeStore extends SelectionTreeData {
35
35
  guid: Guid | undefined;
36
36
  }) => void;
37
37
  addItems: (args: {
38
- itemIds: GlobalSelectionTypes.ItemId[];
38
+ itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
39
39
  groupId?: Guid;
40
+ useDefaultSelectionTypeColors?: boolean;
40
41
  }) => Promise<void>;
41
42
  addTags: (args: AddItemArgs<GlobalSelectionTypes.TagId>) => AddTagsReturnType;
42
43
  addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => AddWorkOrdersReturnType;
@@ -60,10 +61,10 @@ export interface SelectionTreeStore extends SelectionTreeData {
60
61
  removeItemsById: (args: {
61
62
  groupId?: Guid;
62
63
  categoryId: GlobalSelectionCategoryId;
63
- itemIds: GlobalSelectionTypes.ItemId[];
64
+ itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
64
65
  }) => void;
65
66
  removeAllItemsById: (args: {
66
- itemIds: GlobalSelectionTypes.ItemId[];
67
+ itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
67
68
  }) => void;
68
69
  moveItems: (args: {
69
70
  sourceGroupId: Guid;
@@ -50,7 +50,7 @@ export declare function findSelectionCategoryById(args: {
50
50
  */
51
51
  export declare function itemsNotFoundInSelectionTree(args: {
52
52
  groups: SelectionTreeTypes.Group[];
53
- itemIds: GlobalSelectionTypes.ItemId[];
53
+ itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
54
54
  }): GlobalSelectionTypes.ItemId[];
55
55
  /**
56
56
  * Get an array of group IDs where any of the item IDs are found.
@@ -64,7 +64,7 @@ export declare function itemsNotFoundInSelectionTree(args: {
64
64
  * @returns {Object[]} An array of group IDs, with labels and sublabels, where any of the item IDs are found.
65
65
  */
66
66
  export declare function getGroupIdsByItemIds(args: {
67
- itemIds: GlobalSelectionTypes.ItemId[];
67
+ itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
68
68
  groups: SelectionTreeTypes.Group[];
69
69
  }): {
70
70
  id: Guid;
@@ -103,8 +103,8 @@ export declare function isSelectionEmpty(groups: SelectionTreeTypes.Group[]): bo
103
103
  * @param {GlobalSelectionTypes.ItemId[]} itemIds - The list of item IDs to be checked and potentially removed.
104
104
  * @returns {void}
105
105
  */
106
- export declare function removeStaleItemsFromGlobalSelection(groups: SelectionTreeTypes.Group[], itemIds: GlobalSelectionTypes.ItemId[]): void;
107
- export declare function getItemsByIdsFromGlobalSelectionStore(itemIds: GlobalSelectionTypes.ItemId[]): GlobalSelectionTypes.SelectionItem[];
106
+ export declare function removeStaleItemsFromGlobalSelection(groups: SelectionTreeTypes.Group[], itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>): void;
107
+ export declare function getItemsByIdsFromGlobalSelectionStore(itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>): GlobalSelectionTypes.SelectionItem[];
108
108
  /**
109
109
  * Returns an array of selection colors sorted by their frequency for the specified item IDs within a group.
110
110
  *
@@ -122,7 +122,7 @@ export declare function getItemsByIdsFromGlobalSelectionStore(itemIds: GlobalSel
122
122
  */
123
123
  export declare function getSelectionColorFrequencyByIds(args: {
124
124
  groupId: string;
125
- itemIds: GlobalSelectionTypes.ItemId[];
125
+ itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
126
126
  allGroups: ReadonlyArray<SelectionTreeTypes.Group>;
127
127
  }): string[];
128
128
  /**
@@ -143,8 +143,9 @@ export declare function handleItemColorization(args: {
143
143
  itemType: GlobalSelectionItemType;
144
144
  treeState: SelectionTreeStore;
145
145
  affectedGroupId?: Guid;
146
- itemIds: GlobalSelectionTypes.ItemId[];
146
+ itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
147
147
  handleColorConflicts?: boolean;
148
+ useDefaultSelectionTypeColors?: boolean;
148
149
  }): string | undefined;
149
150
  /**
150
151
  * Assigns a color to a set of items within a specified group in the selection tree.
@@ -164,5 +165,6 @@ export declare function assignColorToItemsInGroup(args: {
164
165
  itemType: GlobalSelectionItemType;
165
166
  allGroups: ReadonlyArray<SelectionTreeTypes.Group>;
166
167
  groupId: string;
167
- itemIdsToColor: GlobalSelectionTypes.ItemId[];
168
+ itemIdsToColor: ReadonlyArray<GlobalSelectionTypes.ItemId>;
169
+ useDefaultSelectionTypeColors?: boolean;
168
170
  }): string | undefined;
@@ -1,6 +1,6 @@
1
1
  import { LegendId } from '../types/legendType';
2
2
  interface LegendSelectorMenuProps {
3
- legendId: LegendId;
3
+ readonly legendId: LegendId;
4
4
  }
5
5
  export declare const BasicLegendRenderer: import("react").NamedExoticComponent<LegendSelectorMenuProps>;
6
6
  export {};
@@ -0,0 +1,17 @@
1
+ import { LegendChipProps } from '@equinor/echo-components';
2
+ import { type LegendOptionConfig } from '../types/legendType';
3
+ interface LegendSelectorContainerProps {
4
+ readonly selectedOption: LegendOptionConfig;
5
+ readonly onSelectedOptionChange?: (option: LegendOptionConfig) => void;
6
+ readonly options: ReadonlyArray<LegendOptionConfig>;
7
+ readonly legendChips: ReadonlyArray<LegendChipProps>;
8
+ /** Whether this is a marker or badge selector (affects icon displayed) */
9
+ readonly variant: 'marker' | 'badge';
10
+ }
11
+ /**
12
+ * A reusable container for legend selectors that handles both option selection
13
+ * and display option selection (how the badge text is rendered) based on LegendOptionConfigs.
14
+ * Display options are only available for badge variants with enableDisplayOptions: true.
15
+ */
16
+ export declare const LegendSelectorContainer: (props: LegendSelectorContainerProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type LegendId } from '../../../types/legendType';
2
+ interface ItemMarkerPopoverContainerProps {
3
+ legendId: LegendId;
4
+ elements: ReadonlyArray<React.ReactElement>;
5
+ isPopoverActive: boolean;
6
+ handleClose: () => void;
7
+ }
8
+ export declare const ItemMarkerPopoverContainer: ({ legendId, elements, isPopoverActive, handleClose }: ItemMarkerPopoverContainerProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -1,41 +1,24 @@
1
- import { FC } from 'react';
2
- import { Marker } from '../../types/legendMarkerBadge.type';
3
1
  import { LegendDataId, LegendId } from '../../types/legendType';
4
2
  export interface LegendPopoverContentProps {
5
3
  legendId: LegendId;
6
4
  legendDataId: LegendDataId;
7
- title: string | React.ReactNode;
8
- description: string;
9
- tertiary?: LegendPopoverTertiaryLabels | React.ReactNode;
10
5
  onPopoverClicked?: () => void;
11
6
  children?: React.ReactNode;
12
- excludedLegendTitles?: ReadonlyArray<string>;
7
+ excludedChipLegendTitles?: ReadonlyArray<string>;
13
8
  showAddToSelectionButton?: boolean;
14
- getMarkersForChipsCreation?: () => ReadonlyArray<Marker>;
15
9
  }
16
- export type LegendPopoverTertiaryLabels = {
17
- first: string;
18
- second?: string;
19
- third?: string;
20
- };
21
10
  /**
22
11
  * Renders the content for a legend popover, typically used as the content for the ItemMarkerPopover component.
23
- *
24
- * Uses `legendId` and `legendDataId` to look up and render relevant `LegendChip` components for the given legend item.
25
- * Displays a title, description, and optional tertiary content (either a structured object with up to three strings, or a custom ReactNode).
26
- * Additional custom content can be rendered via `children`.
27
- * Optionally, chips can be created from markers provided by the `getMarkersForChipsCreation` callback.
12
+ * The content includes dynamically generated chips based on the markers associated with the provided legendId and legendDataId.
13
+ * It is possible to exclude certain chips based on their legend titles using props. Chips with excluded titles will not be rendered in the popover.
14
+ * The component also includes an optional "Add to Selection" button that allows users to add the item to their global selection groups.
28
15
  *
29
16
  * @component
30
- * @param {object} props - Component props
31
17
  * @param {LegendId} props.legendId - The identifier used to look up legend strategy.
32
18
  * @param {LegendDataId} props.legendDataId - The identifier for retrieving the markers.
33
- * @param {string | React.ReactNode} props.title - The main title of the popover.
34
- * @param {string} props.description - The description or supporting text.
35
- * @param {LegendPopoverTertiaryLabels | React.ReactNode} [props.tertiary] - Optional tertiary content. If an object, displays up to three labeled strings; if a ReactNode, renders as-is.
36
- * @param {() => void} [props.onPopoverClicked] - Optional callback for popover click events.
37
- * @param {React.ReactNode} [props.children] - Optional custom content to render below the predefined main content.
38
- * @param {ReadonlyArray<string>} [props.excludedLegendTitles] - Optional array of titles to exclude from the legend chips.
39
- * @param {() => ReadonlyArray<Marker>} [props.getMarkersForChipsCreation] - Optional callback that returns the markers to be used for chip creation.
19
+ * @param {() => void} [props.onPopoverClicked] - Optional callback for popover content click events.
20
+ * @param {React.ReactNode} [props.children] - Optional custom content to render inside the popover content area, will be above chips.
21
+ * @param {ReadonlyArray<string>} [props.excludedChipLegendTitles] - Optional array of titles to exclude from the legend chips.
22
+ * @param {boolean} [props.showAddToSelectionButton] - Optional flag to show or hide the "Add to Selection" button.
40
23
  */
41
- export declare const LegendPopoverContent: FC<LegendPopoverContentProps>;
24
+ export declare const LegendPopoverContent: (props: LegendPopoverContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,7 @@
1
- import { LegendChipProps } from '@equinor/echo-components';
2
1
  import { LegendState } from '../../types/legendType';
3
2
  import { Marker } from './../../types/legendMarkerBadge.type';
4
3
  /**
5
- * Returns an array of visible LegendChipProps for the given markers and legend state.
4
+ * Returns an array of visible PopoverChip for the given markers and legend state.
6
5
  *
7
6
  * Filters out markers and badges that are hidden (using isHiddenMarker/isHiddenBadge) or whose titles match any value in the
8
7
  * excludedLegendTitles array (case-insensitive). Badge chips are only included if selectedMarkerOption !== selectedBadgeOption.
@@ -11,11 +10,18 @@ import { Marker } from './../../types/legendMarkerBadge.type';
11
10
  * @param {ReadonlyArray<Marker>} params.markers - The list of marker objects to process.
12
11
  * @param {LegendState} params.legend - The legend state, used for filtering and selection logic.
13
12
  * @param {ReadonlyArray<string>} [params.excludedLegendTitles] - Optional array of titles to exclude from the chips (case-insensitive).
14
- * @returns {LegendChipProps[]} The filtered and mapped array of LegendChipProps for rendering.
13
+ * @returns {PopoverChip[]} The filtered and mapped array of PopoverChip for rendering.
15
14
  */
16
- export declare function getLegendChipsFromMarkers({ markers, legendSelectedBadgeOption, legendSelectedMarkerOption, excludedLegendTitles }: {
15
+ interface GetPopoverChipsParams {
17
16
  markers: ReadonlyArray<Marker>;
18
- excludedLegendTitles?: ReadonlyArray<string>;
19
17
  legendSelectedBadgeOption?: LegendState['selectedBadgeOption'];
20
18
  legendSelectedMarkerOption?: LegendState['selectedMarkerOption'];
21
- }): LegendChipProps[];
19
+ excludedLegendTitles?: ReadonlyArray<string>;
20
+ }
21
+ interface PopoverChip {
22
+ text: string;
23
+ backgroundColor: string;
24
+ textColor: string;
25
+ }
26
+ export declare function getPopoverChips({ markers, legendSelectedBadgeOption, legendSelectedMarkerOption, excludedLegendTitles }: GetPopoverChipsParams): PopoverChip[];
27
+ export {};
@@ -1,9 +1,5 @@
1
1
  import { SelectionGroup } from '../../globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
2
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
3
  /**
8
4
  * Gets all potential group keys a marker could generate.
9
5
  * Used for per-marker hidden state subscriptions.
@@ -18,4 +18,4 @@ export declare const useUniqueVisibleData: () => LegendDataId[];
18
18
  * Common logic for creating markers from data using strategy.
19
19
  * Selection-based grouping is handled at the viewport rendering level.
20
20
  */
21
- export declare const useCreateMarkers: (legendId: LegendId, data: LegendDataId[], isViewport?: boolean) => ReadonlyArray<Marker>;
21
+ export declare const useCreateMarkers: (legendId: LegendId, data: LegendDataId[]) => ReadonlyArray<Marker>;
@@ -4,6 +4,4 @@ import { LegendId } from '../types/legendType';
4
4
  * Returns all unique badges for the given legendId, determined by unique title + color.
5
5
  * This will also return markers that are not visible on screen.
6
6
  */
7
- export declare function useLegendUniqueBadges(legendId: LegendId, options?: {
8
- isViewport?: boolean;
9
- }): ReadonlyArray<Badge>;
7
+ export declare function useLegendUniqueBadges(legendId: LegendId): ReadonlyArray<Badge>;
@@ -4,6 +4,4 @@ import { LegendId } from '../types/legendType';
4
4
  * Returns all unique markers for the given legendId, determined by unique displayKey (title + color).
5
5
  * This will also return markers that are not visible on screen.
6
6
  */
7
- export declare function useLegendUniqueMarkers(legendId: LegendId, options?: {
8
- isViewport?: boolean;
9
- }): ReadonlyArray<Marker>;
7
+ export declare function useLegendUniqueMarkers(legendId: LegendId): ReadonlyArray<Marker>;