@equinor/echo-framework 0.21.4-beta-0 → 0.21.4

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 (40) hide show
  1. package/index.cjs.js +1 -1
  2. package/package.json +2 -2
  3. package/src/index.d.ts +4 -1
  4. package/src/lib/feature/equipment/types/equipment.d.ts +2 -0
  5. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +2 -2
  6. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +8 -19
  7. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelection.action.d.ts +19 -0
  8. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionNullItems.d.ts +4 -0
  9. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +6 -12
  10. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +24 -47
  11. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +2 -2
  12. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts +14 -0
  13. package/src/lib/feature/globalSelection/hooks/useGlobalSelectionItemsByType.d.ts +7 -0
  14. package/src/lib/feature/globalSelection/index.d.ts +2 -1
  15. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/{addTag.action.d.ts → addTags.action.d.ts} +5 -4
  16. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addWorkOrders.action.d.ts +6 -0
  17. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/createAddItemsFactory.d.ts +17 -0
  18. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/{addTag.action.types.d.ts → selectionTree.action.types.d.ts} +4 -5
  19. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +16 -24
  20. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +3 -3
  21. package/src/lib/feature/legend/components/BasicLegendRenderer.d.ts +7 -0
  22. package/src/lib/feature/legend/components/LegendList.d.ts +5 -0
  23. package/src/lib/feature/legend/components/basicLegendRenderer.logic.d.ts +5 -0
  24. package/src/lib/feature/legend/components/pdfMarkers/PositionalItem.d.ts +14 -0
  25. package/src/lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers.d.ts +24 -0
  26. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +11 -0
  27. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRendererWithPopover.d.ts +16 -0
  28. package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersByLegends.d.ts +39 -0
  29. package/src/lib/feature/legend/components/pdfMarkers/subComponents/iconPositionTransform.d.ts +18 -0
  30. package/src/lib/feature/legend/hooks/useLegendMarkers.d.ts +19 -0
  31. package/src/lib/feature/legend/index.d.ts +8 -0
  32. package/src/lib/feature/legend/legendFacade.d.ts +52 -0
  33. package/src/lib/feature/legend/legendStore.d.ts +52 -0
  34. package/src/lib/feature/legend/legendStrategies/legendCollections.d.ts +4 -0
  35. package/src/lib/feature/legend/legendStrategies/workOrderStrategy/WorkOrderLegend.d.ts +1 -0
  36. package/src/lib/feature/legend/legendUpdater.d.ts +2 -0
  37. package/src/lib/feature/legend/legendVisibleDataStore.d.ts +71 -0
  38. package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +11 -0
  39. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +37 -0
  40. package/src/lib/feature/legend/types/legendType.d.ts +26 -0
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.21.4-beta-0",
3
+ "version": "0.21.4",
4
4
  "peerDependencies": {
5
5
  "@equinor/echo-base": ">= 0.7.0 < 0.8.0",
6
6
  "@equinor/echo-components": ">= 0.12.0 < 0.13.0",
7
- "@equinor/echo-core": "0.9.18-beta-0",
7
+ "@equinor/echo-core": ">= 0.9.0 < 0.10.0",
8
8
  "@equinor/echo-search": ">= 0.15.0 < 0.16.0",
9
9
  "@equinor/echo-utils": ">= 0.4.0 < 0.5.0",
10
10
  "@equinor/eds-core-react": "0.43.0",
package/src/index.d.ts CHANGED
@@ -12,11 +12,14 @@ export { fetchEquipmentFromApi } from './lib/feature/equipment/api/api-equipment
12
12
  export * from './lib/feature/equipment/index';
13
13
  export * from './lib/feature/globalSelection';
14
14
  export { SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
15
- export type { OptimizedWorkOrderDto } from './lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types';
16
15
  export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3DButton';
17
16
  export { useIsAllIGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllIGlobalSelectionItemsHidden';
18
17
  export { GlobalSelectionCategoryId, SelectionMenuDefaultListIds } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
19
18
  export * from './lib/feature/legacyLegend/index';
19
+ export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
20
+ export * from './lib/feature/legend/index';
21
+ export { subscribeToLegendDataChanged } from './lib/feature/legend/legendUpdater';
22
+ export type { LegendDataId, LegendEquipmentId, LegendState, LegendTagId } from './lib/feature/legend/types/legendType';
20
23
  export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
21
24
  export * from './lib/feature/measuringPoint/index';
22
25
  export * from './lib/feature/measuringPoint/types/measuringPoint';
@@ -28,6 +28,8 @@ export interface Equipment {
28
28
  readonly tagId: string | undefined;
29
29
  readonly tagPlantId: string | undefined;
30
30
  readonly userStatusIds: string[];
31
+ readonly partType?: string;
32
+ readonly partTypeText?: string;
31
33
  }
32
34
  export declare enum EquipmentCategoryId {
33
35
  L = "L",
@@ -1,7 +1,7 @@
1
- import { GlobalSelectionTypes, OptimizedWorkOrderDto } from '../globalSelectionStore/globalSelectionStore.types';
1
+ import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
2
2
  import { GlobalSelectionCategoryId } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
3
3
  export interface SelectionActionBarProps {
4
- itemId: GlobalSelectionTypes.TagId | OptimizedWorkOrderDto;
4
+ itemId: GlobalSelectionTypes.ItemId;
5
5
  categoryId: GlobalSelectionCategoryId;
6
6
  }
7
7
  export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
@@ -1,7 +1,7 @@
1
1
  import { GlobalSelectionTypes } from './globalSelectionStore/globalSelectionStore.types';
2
- import { AddTagsArgs } from './selectionMenu/selectionTreeStore/actions/addTag.action.types';
2
+ import { AddItemArgs } from './selectionMenu/selectionTreeStore/actions/selectionTree.action.types';
3
3
  import { AddTagsReturnType, GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionMenu/selectionTreeStore/selectionTree.store.types';
4
- type AddTagsType = <T extends boolean | undefined = undefined>(args: AddTagsArgs & {
4
+ type AddTagsType = <T extends boolean | undefined = undefined>(args: AddItemArgs<GlobalSelectionTypes.TagId> & {
5
5
  getActionResult?: T;
6
6
  }) => Promise<AddTagsReturnType<T>>;
7
7
  export declare const globalSelectionApi: Readonly<{
@@ -67,7 +67,7 @@ export declare const globalSelectionApi: Readonly<{
67
67
  * Adds tags to a selection and updates the state accordingly.
68
68
  * Creates a group if label and sublabel are passed and the group doesn't exist.
69
69
  *
70
- * @param {AddTagsArgs} args - The arguments for adding tags.
70
+ * @param {AddItemArgs} args - The arguments for adding tags.
71
71
  * @param {Array<string>} args.itemIds - The IDs of the items to add tags to.
72
72
  * @param {boolean} [args.replaceItems=false] - Whether to replace existing items with the new tags.
73
73
  * @param {boolean} [args.getActionResult] - Optional, temporary. Will be removed. When passed the function will return with the actionResult as well.
@@ -86,31 +86,20 @@ export declare const globalSelectionApi: Readonly<{
86
86
  *
87
87
  * @param {Object} args - The arguments for adding work orders.
88
88
  * @param {Guid} args.groupId - Optional. The ID of the list to which the work orders should be added. If not provided, it will be added to the "Local Selection".
89
- * @param {Readonly<Readonly<OptimizedWorkOrderDto>[]>} args.items - An array of OptimizedWorkOrderDto objects representing the work orders to be added.
89
+ * @param {Readonly<Readonly<GlobalSelectionTypes.WorkOrderId>[]>} args.items - An array of WorkOrderId objects representing the work orders to be added.
90
90
  */
91
- workOrders: (args: {
92
- groupId?: import("dist/libs/echo-utils/src").Guid;
93
- items: Readonly<Readonly<import("./globalSelectionStore/globalSelectionStore.types").OptimizedWorkOrderDto>[]>;
94
- }) => void;
91
+ workOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => void;
95
92
  /**
96
93
  * Adds items to a specified list in the selection menu panel.
97
94
  *
98
95
  * @param {Object} args - The arguments for adding items.
99
96
  * @param {Guid} args.groupId - Optional. The ID of the list to which the items should be added. If not provided, the default list ID is used.
100
- * @param {GlobalSelectionTypes.TagId | OptimizedWorkOrderDto)[]} args.itemIds - ItemIds to be added. Only tags or work orders can be added for now.
97
+ * @param {GlobalSelectionTypes.ItemId[]} args.itemIds - ItemIds to be added. Only tags or work orders can be added for now.
101
98
  *
102
99
  */
103
100
  addItems: (args: {
104
- groupId? /**
105
- * Removes items from a specified list in the selection menu panel by their IDs.
106
- *
107
- * @param {Object} args - The arguments for removing items.
108
- * @param {Readonly<GlobalSelectionTypes.ItemId[]>} args.itemIds - An array of item IDs representing the items to be removed.
109
- * @param {Guid} args.groupId - Optional. The ID of the list where the subList of the items are located.
110
- * Local selection will be used by default.
111
- * @param {GlobalSelectionCategoryId} args.category - The ID of the list where the items to be removed are located.
112
- */: import("dist/libs/echo-utils/src").Guid;
113
- itemIds: (GlobalSelectionTypes.TagId | import("./globalSelectionStore/globalSelectionStore.types").OptimizedWorkOrderDto)[];
101
+ groupId?: import("dist/libs/echo-utils/src").Guid;
102
+ itemIds: GlobalSelectionTypes.ItemId[];
114
103
  }) => void;
115
104
  }>;
116
105
  search: {
@@ -0,0 +1,19 @@
1
+ import { ResultArray } from '@equinor/echo-search';
2
+ import { WritableDraft } from 'immer';
3
+ import { StoreApi } from 'zustand';
4
+ import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionStore, GlobalSelectionTypes } from '../globalSelectionStore.types';
5
+ type FetchFunction<T, U> = (itemIds: Readonly<U[]>) => Promise<ResultArray<T>[]>;
6
+ type NullItemGenerator<T, U> = (itemId: U) => T;
7
+ type ItemIdTypeMap = {
8
+ [GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
9
+ [GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
10
+ [GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
11
+ };
12
+ type SetFunction = (set: (state: WritableDraft<GlobalSelectionStore>) => void, shouldReplace?: boolean | undefined, action?: string) => void;
13
+ export declare function addItemsToSelection<T extends GlobalSelectionItemType>(set: SetFunction, get: StoreApi<GlobalSelectionStore>['getState'], args: {
14
+ itemIds: ItemIdTypeMap[T][];
15
+ }, itemType: T, fetchFunction: FetchFunction<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>, nullItemGenerator: NullItemGenerator<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>): Promise<{
16
+ fetchResult: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
17
+ actionResult: GlobalSelectionTypes.ActionResult;
18
+ }>;
19
+ export {};
@@ -0,0 +1,4 @@
1
+ import { WorkOrderData } from '@equinor/echo-search';
2
+ import { GlobalSelectionTypes } from './globalSelectionStore.types';
3
+ export declare function createNullTagSummaryDb(itemId: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagDto;
4
+ export declare function createNullWorkOrderData(itemId: GlobalSelectionTypes.WorkOrderId): WorkOrderData;
@@ -1,5 +1,5 @@
1
1
  import { WritableDraft } from 'immer';
2
- import { GlobalSelectionItemType, GlobalSelectionTypes } from './globalSelectionStore.types';
2
+ import { GlobalSelectionStore, GlobalSelectionTypes } from './globalSelectionStore.types';
3
3
  export declare const initialWorkOrderList: WritableDraft<GlobalSelectionTypes.WorkOrderList>;
4
4
  export declare const initialTagList: WritableDraft<GlobalSelectionTypes.TagList>;
5
5
  export declare const initialEquipmentList: WritableDraft<GlobalSelectionTypes.EquipmentList>;
@@ -21,29 +21,23 @@ export declare const initialEquipmentList: WritableDraft<GlobalSelectionTypes.Eq
21
21
  *
22
22
  * For accessing and using global selection features, use the globalSelectionApi from echo-framework.
23
23
  */
24
- export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<import("./globalSelectionStore.types").GlobalSelectionStore>, "setState"> & {
24
+ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<GlobalSelectionStore>, "setState"> & {
25
25
  setState<A extends string | {
26
26
  type: string;
27
- }>(partial: import("./globalSelectionStore.types").GlobalSelectionStore | Partial<import("./globalSelectionStore.types").GlobalSelectionStore> | ((state: import("./globalSelectionStore.types").GlobalSelectionStore) => import("./globalSelectionStore.types").GlobalSelectionStore | Partial<import("./globalSelectionStore.types").GlobalSelectionStore>), replace?: boolean | undefined, action?: A | undefined): void;
27
+ }>(partial: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: GlobalSelectionStore) => GlobalSelectionStore | Partial<GlobalSelectionStore>), replace?: boolean | undefined, action?: A | undefined): void;
28
28
  }, "subscribe"> & {
29
29
  subscribe: {
30
- (listener: (selectedState: import("./globalSelectionStore.types").GlobalSelectionStore, previousSelectedState: import("./globalSelectionStore.types").GlobalSelectionStore) => void): () => void;
31
- <U>(selector: (state: import("./globalSelectionStore.types").GlobalSelectionStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
30
+ (listener: (selectedState: GlobalSelectionStore, previousSelectedState: GlobalSelectionStore) => void): () => void;
31
+ <U>(selector: (state: GlobalSelectionStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
32
32
  equalityFn?: ((a: U, b: U) => boolean) | undefined;
33
33
  fireImmediately?: boolean;
34
34
  } | undefined): () => void;
35
35
  };
36
36
  }, "setState"> & {
37
- setState(nextStateOrUpdater: import("./globalSelectionStore.types").GlobalSelectionStore | Partial<import("./globalSelectionStore.types").GlobalSelectionStore> | ((state: WritableDraft<import("./globalSelectionStore.types").GlobalSelectionStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
37
+ setState(nextStateOrUpdater: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: WritableDraft<GlobalSelectionStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
38
38
  type: string;
39
39
  } | undefined): void;
40
40
  }>;
41
- /**
42
- * Determine if a given selection type has any items being loaded.
43
- * @param {GlobalSelectionItemType} selectionType - A specific type from GlobalSelectionItemType for the list to check.
44
- * @returns {boolean} - Returns true if there are any items being loaded in the specified selection type.
45
- */
46
- export declare function useIsGlobalSelectionListLoading<K extends GlobalSelectionItemType>(selectionType: K): boolean;
47
41
  /**
48
42
  * Get a snapshot of the current global selection store state.
49
43
  *
@@ -1,13 +1,18 @@
1
- import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
1
+ import { ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
2
2
  import { Equipment } from '../../equipment';
3
3
  export declare enum GlobalSelectionItemType {
4
4
  WorkOrder = "WorkOrder",
5
5
  Tag = "Tag",
6
6
  Equipment = "Equipment"
7
7
  }
8
- interface GlobalSelectionItemTypeToDataMap {
9
- WorkOrder: OptimizedWorkOrderDto;
10
- Tag: TagSummaryDto;
8
+ export type DeepWritable<T> = {
9
+ -readonly [P in keyof T]: DeepWritable<T[P]>;
10
+ };
11
+ type GlobalSelectionTagDto = TagSummaryDto;
12
+ type GlobalSelectionWorkOrderDto = WorkOrderData;
13
+ export interface GlobalSelectionItemTypeToDataMap {
14
+ WorkOrder: GlobalSelectionWorkOrderDto;
15
+ Tag: GlobalSelectionTagDto;
11
16
  Equipment: Equipment;
12
17
  }
13
18
  type GlobalSelectionList<T extends GlobalSelectionItemType> = {
@@ -19,10 +24,8 @@ type GlobalSelectionList<T extends GlobalSelectionItemType> = {
19
24
  export type GlobalSelectionObject = {
20
25
  [K in GlobalSelectionItemType]: GlobalSelectionList<K>;
21
26
  };
22
- /**
23
- * @deprecated We plan to make this private in the future: Use the public GlobalSelectionTypes namespace to access this type.
24
- */
25
- export type GlobalSelectionGenericItem<T extends GlobalSelectionItemType> = {
27
+ export type SelectionItemSystemStatus = 'isLoading' | 'notFound' | 'loadedSuccessfully';
28
+ type GlobalSelectionGenericItem<T extends GlobalSelectionItemType> = {
26
29
  id: GlobalSelectionTypes.ItemId;
27
30
  type: T;
28
31
  data: GlobalSelectionTypes.ItemTypeToDataMap[T];
@@ -30,6 +33,7 @@ export type GlobalSelectionGenericItem<T extends GlobalSelectionItemType> = {
30
33
  color: string;
31
34
  isHiddenByUser: boolean;
32
35
  errorStatus?: string;
36
+ systemStatus: SelectionItemSystemStatus;
33
37
  };
34
38
  };
35
39
  type EquipmentGlobalSelectionList = GlobalSelectionTypes.List<GlobalSelectionItemType.Equipment>;
@@ -43,11 +47,11 @@ interface ItemErrorStatusUpdates {
43
47
  export interface GlobalSelectionStore {
44
48
  lists: GlobalSelectionObject;
45
49
  addWorkOrdersToSelection: (args: {
46
- workOrders: Readonly<OptimizedWorkOrderDto[]>;
47
- }) => void;
50
+ workOrderIds: GlobalSelectionTypes.WorkOrderId[];
51
+ }) => Promise<GlobalSelectionAddItemResult<ResultArray<WorkOrderData>[]>>;
48
52
  addTagsToSelection: (args: {
49
- tagIds: Readonly<GlobalSelectionTypes.TagId[]>;
50
- }) => Promise<AddTagActionResult>;
53
+ tagIds: GlobalSelectionTypes.TagId[];
54
+ }) => Promise<GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>>;
51
55
  removeItemsFromSelection: (args: {
52
56
  itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
53
57
  }) => void;
@@ -65,15 +69,17 @@ export interface GlobalSelectionStore {
65
69
  }) => void;
66
70
  }
67
71
  type GlobalSelectionActionResult = 'NoChanges' | 'ItemsAdded';
68
- type AddTagActionResult = {
69
- fetchResult: ResultArray<TagSummaryDto>[];
72
+ export type GlobalSelectionAddItemResult<DataType> = {
73
+ fetchResult: DataType;
70
74
  actionResult: GlobalSelectionActionResult;
71
75
  };
72
76
  export declare namespace GlobalSelectionTypes {
73
- type WorkOrderId = Pick<OptimizedWorkOrderDto, 'workOrderId'>;
77
+ type WorkOrderId = Pick<GlobalSelectionWorkOrderDto, 'workOrderId'>;
74
78
  type EquipmentId = Pick<Equipment, 'equipmentId'>;
75
79
  type TagId = Pick<TagSummaryDto, 'tagNo' | 'instCode'>;
76
80
  type ItemId = WorkOrderId | EquipmentId | TagId;
81
+ type TagDto = GlobalSelectionTagDto;
82
+ type WorkOrderDto = GlobalSelectionWorkOrderDto;
77
83
  type EquipmentItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Equipment>;
78
84
  type WorkOrderItem = GlobalSelectionGenericItem<GlobalSelectionItemType.WorkOrder>;
79
85
  type TagItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Tag>;
@@ -88,37 +94,8 @@ export declare namespace GlobalSelectionTypes {
88
94
  type EquipmentList = EquipmentGlobalSelectionList;
89
95
  type ListUnion = GlobalSelectionListUnion;
90
96
  type ItemTypeToDataMap = GlobalSelectionItemTypeToDataMap;
91
- type AddTagResult = AddTagActionResult;
92
- }
93
- export interface OptimizedWorkOrderDto {
94
- workOrderId: string;
95
- tagId: string | undefined;
96
- tagPlantId: string;
97
- workCenterId?: string;
98
- workCenterPlantId: string;
99
- plannerGroupId: string;
100
- workOrderTypeId: string;
101
- revisionCodeId: string;
102
- systemId?: string;
103
- isOpen: boolean;
104
- hasStatusTECO: boolean;
105
- hasStatusRDOP: boolean;
106
- hasStatusCANC: boolean;
107
- hasStatusSTRT: boolean;
108
- hasStatusRDEX: boolean;
109
- hasStatusPREP: boolean;
110
- hasStatusPRCO: boolean;
111
- title: string;
112
- plantId: string;
113
- planningPlantId: string;
114
- sortField: string;
115
- locationId: string;
116
- revisionId: string;
117
- basicStartDateTime?: string | null;
118
- basicEndDateTime?: string | null;
119
- createdDateTime?: string | null;
120
- _links: {
121
- related: string;
122
- };
97
+ type AddTagResult = GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>;
98
+ type ActionResult = GlobalSelectionActionResult;
99
+ type ItemSystemStatus = SelectionItemSystemStatus;
123
100
  }
124
101
  export {};
@@ -1,6 +1,4 @@
1
1
  import { GlobalSelectionItemType, GlobalSelectionTypes } from './globalSelectionStore.types';
2
- export declare function toGlobalSelectionItem<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(item: T, type: K): GlobalSelectionTypes.GenericItem<K>;
3
- export declare function toGlobalSelectionItems<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(items: T[], type: K): GlobalSelectionTypes.GenericItem<K>[];
4
2
  declare function idsEqual(itemA: GlobalSelectionTypes.ItemId, itemB: GlobalSelectionTypes.ItemId): boolean;
5
3
  declare function isWorkOrderId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.WorkOrderId;
6
4
  declare function isEquipmentId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.EquipmentId;
@@ -32,6 +30,7 @@ declare function mapToId(item: GlobalSelectionTypes.EquipmentId): GlobalSelectio
32
30
  declare function mapToId(item: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagId;
33
31
  declare function mapToId(item: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemId;
34
32
  declare function itemIdToString(itemId: GlobalSelectionTypes.ItemId): string;
33
+ export declare function mapIdToItemType(itemId: GlobalSelectionTypes.ItemId): GlobalSelectionItemType;
35
34
  /**
36
35
  * A utility object that provides various functions for handling global selections.
37
36
  *
@@ -49,6 +48,7 @@ export declare const globalSelectionUtils: Readonly<{
49
48
  isTagId: typeof isTagId;
50
49
  idsEqual: typeof idsEqual;
51
50
  mapToId: typeof mapToId;
51
+ mapIdToItemType: typeof mapIdToItemType;
52
52
  itemIdToString: typeof itemIdToString;
53
53
  }>;
54
54
  export {};
@@ -1,4 +1,6 @@
1
+ import { WritableDraft } from 'immer';
1
2
  import { PlantAndTagForOpenIn3d } from '../../openItemsIn3d/logic/openItemsIn3d.utils';
3
+ import { DeepWritable, GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemSystemStatus } from './globalSelectionStore.types';
2
4
  /**
3
5
  * Converts global selection items to plant tag pairs.
4
6
  *
@@ -12,3 +14,15 @@ import { PlantAndTagForOpenIn3d } from '../../openItemsIn3d/logic/openItemsIn3d.
12
14
  * @returns {Promise<PlantAndTagForOpenIn3d[]>} A promise that resolves to an array of plant tag pairs.
13
15
  */
14
16
  export declare function convertGlobalSelectionItemsToPlantTagPairs(): Promise<PlantAndTagForOpenIn3d[]>;
17
+ export declare function toGlobalSelectionItem<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(item: T, type: K, systemStatus: SelectionItemSystemStatus): GlobalSelectionTypes.GenericItem<K>;
18
+ export declare function toGlobalSelectionItems<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(items: T[], type: K, systemStatus: SelectionItemSystemStatus): GlobalSelectionTypes.GenericItem<K>[];
19
+ export declare function finalizeLoadStateByItemType<T extends GlobalSelectionItemType>(args: {
20
+ itemType: GlobalSelectionItemType;
21
+ state: WritableDraft<GlobalSelectionTypes.Store>;
22
+ itemDataToStore: DeepWritable<GlobalSelectionTypes.ItemTypeToDataMap[T]>[];
23
+ }): void;
24
+ export declare function setNotFoundStatusByItemIds(args: {
25
+ itemType: GlobalSelectionItemType;
26
+ state: WritableDraft<GlobalSelectionTypes.Store>;
27
+ notFoundItemIds: GlobalSelectionTypes.ItemId[];
28
+ }): void;
@@ -0,0 +1,7 @@
1
+ import { GlobalSelectionItemType, GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
2
+ /**
3
+ *
4
+ * @param {GlobalSelectionItemType} itemType
5
+ * @returns Array of given item types stored in global selection.
6
+ */
7
+ export declare function useGlobalSelectionItemsByType<T extends GlobalSelectionItemType>(itemType: T): GlobalSelectionTypes.GenericItem<T>[];
@@ -1,13 +1,14 @@
1
+ export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
1
2
  export { globalSelectionApi } from './globalSelection.api';
2
3
  export * from './globalSelectionStore/globalSelectionStore.types';
3
4
  export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStore.utils';
4
5
  export { convertGlobalSelectionItemsToPlantTagPairs } from './globalSelectionStore/globalSelectionStoreHelpers';
5
6
  export { useGlobalSelectionItems } from './hooks/useGlobalSelectionItems';
7
+ export { useGlobalSelectionItemsByType } from './hooks/useGlobalSelectionItemsByType';
6
8
  export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
7
9
  export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
8
10
  export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
9
11
  export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesByGroupId';
10
12
  export { OpenGlobalSelectionIn3DButton } from './OpenGlobalSelectionIn3DButton';
11
13
  export { useSelectionMenuGroups } from './selectionMenu/hooks/useSelectionMenuGroups';
12
- export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
13
14
  export * from './selectionMenu/selectionTreeStore/selectionTree.store.types';
@@ -1,13 +1,14 @@
1
1
  import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
2
  import { WritableDraft } from 'immer';
3
3
  import { StoreApi } from 'zustand';
4
+ import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
4
5
  import { SelectionTreeStore } from '../selectionTree.store.types';
5
- import { AddTagsArgs, AddTagsResponse } from './addTag.action.types';
6
+ import { AddItemArgs, AddItemsResponse } from './selectionTree.action.types';
6
7
  type SetFunction = (set: (state: WritableDraft<SelectionTreeStore>) => void, shouldReplace?: boolean | undefined, action?: string) => void;
7
- export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddTagsArgs & {
8
+ export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddItemArgs<GlobalSelectionTypes.TagId> & {
8
9
  getActionResult: true;
9
- }): Promise<AddTagsResponse>;
10
- export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddTagsArgs & {
10
+ }): Promise<AddItemsResponse<ResultArray<TagSummaryDto>[]>>;
11
+ export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddItemArgs<GlobalSelectionTypes.TagId> & {
11
12
  getActionResult?: false;
12
13
  }): Promise<ResultArray<TagSummaryDto>[]>;
13
14
  export {};
@@ -0,0 +1,6 @@
1
+ import { WorkOrderData } from '@equinor/echo-search';
2
+ import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
3
+ export declare const addWorkOrdersAction: (set: (set: (state: import("immer").WritableDraft<import("../selectionTree.store.types").SelectionTreeStore>) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../selectionTree.store.types").SelectionTreeStore>["getState"], args: import("./selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => Promise<import("./selectionTree.action.types").AddItemsResponse<import("@equinor/echo-search").ResultArray<unknown>[]> | {
4
+ fetchResults: import("@equinor/echo-search").ResultArray<WorkOrderData>[][];
5
+ actionResult: string;
6
+ }>;
@@ -0,0 +1,17 @@
1
+ import { ResultArray } from '@equinor/echo-search';
2
+ import { WritableDraft } from 'immer';
3
+ import { StoreApi } from 'zustand';
4
+ import { GlobalSelectionAddItemResult, GlobalSelectionItemType, GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
5
+ import { GlobalSelectionCategoryId, SelectionTreeStore } from '../selectionTree.store.types';
6
+ import { AddItemArgs, AddItemsResponse } from './selectionTree.action.types';
7
+ type SetFunction = (set: (state: WritableDraft<SelectionTreeStore>) => void, shouldReplace?: boolean | undefined, action?: string) => void;
8
+ export declare function addItemsActionFactory<G_ItemId extends GlobalSelectionTypes.ItemId, G_ResponseData>(args: {
9
+ addItemToGlobalSelection: (uniqueNewItems: G_ItemId[]) => Promise<GlobalSelectionAddItemResult<ResultArray<G_ResponseData>[]>>;
10
+ itemType: GlobalSelectionItemType;
11
+ itemCategory: GlobalSelectionCategoryId;
12
+ categoryOrderIndex: number;
13
+ }): (set: SetFunction, get: StoreApi<SelectionTreeStore>["getState"], args: AddItemArgs<G_ItemId>) => Promise<AddItemsResponse<ResultArray<unknown>[]> | {
14
+ fetchResults: ResultArray<G_ResponseData>[][];
15
+ actionResult: string;
16
+ }>;
17
+ export {};
@@ -1,7 +1,6 @@
1
- import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
1
  import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
3
- export type AddTagsArgs = {
4
- itemIds: Readonly<GlobalSelectionTypes.TagId[]>;
2
+ export type AddItemArgs<ItemIdType extends GlobalSelectionTypes.ItemId> = {
3
+ itemIds: Readonly<ItemIdType[]>;
5
4
  replaceItems?: boolean;
6
5
  getActionResult?: boolean;
7
6
  } & ({
@@ -11,8 +10,8 @@ export type AddTagsArgs = {
11
10
  label?: undefined;
12
11
  subLabel?: undefined;
13
12
  });
14
- export type AddTagsResponse = {
15
- fetchResults: ResultArray<TagSummaryDto>[];
13
+ export type AddItemsResponse<FetchResponseType> = {
14
+ fetchResults: FetchResponseType;
16
15
  actionResult: SelectionTreeActionResult;
17
16
  };
18
17
  export type SelectionTreeActionResult = 'ItemsUpdated' | 'ItemsAdded' | 'NewGroupCreated' | 'NoChanges';
@@ -1,8 +1,12 @@
1
1
  import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
2
  import { Guid } from '@equinor/echo-utils';
3
- import { GlobalSelectionItemType, GlobalSelectionTypes, OptimizedWorkOrderDto } from '../../globalSelectionStore/globalSelectionStore.types';
4
- import { AddTagsArgs, AddTagsResponse, SelectionTreeActionResult } from './actions/addTag.action.types';
5
- type SelectionItem = SelectionMenuTag | SelectionMenuWorkOrder | SelectionMenuEquipment;
3
+ import { GlobalSelectionItemType, GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
4
+ import { AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
5
+ export type SelectionItemTypeToItemIdMap = {
6
+ [GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
7
+ [GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
8
+ [GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
9
+ };
6
10
  export declare enum GlobalSelectionCategoryId {
7
11
  Tags = "DEFAULT_TAG_LIST_ID",
8
12
  WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID"
@@ -13,25 +17,17 @@ export declare enum SelectionMenuDefaultListIds {
13
17
  TagList = "DEFAULT_TAG_LIST_ID",
14
18
  WorkOrderList = "DEFAULT_WORK_ORDER_LIST_ID"
15
19
  }
16
- export interface SelectionMenuTag {
17
- id: GlobalSelectionTypes.TagId;
18
- type: GlobalSelectionItemType.Tag;
19
- }
20
- export interface SelectionMenuWorkOrder {
21
- id: GlobalSelectionTypes.WorkOrderId;
22
- type: GlobalSelectionItemType.WorkOrder;
23
- }
24
- export interface SelectionMenuEquipment {
25
- id: GlobalSelectionTypes.EquipmentId;
26
- type: GlobalSelectionItemType.Equipment;
27
- }
20
+ type SelectionItem<T extends GlobalSelectionItemType> = {
21
+ id: SelectionItemTypeToItemIdMap[T];
22
+ type: T;
23
+ };
28
24
  interface SelectionBase {
29
25
  label: string;
30
26
  subLabel?: string;
31
27
  }
32
28
  export interface SelectionCategory extends SelectionBase {
33
29
  id: GlobalSelectionCategoryId;
34
- items: SelectionItem[];
30
+ items: SelectionItem<GlobalSelectionItemType>[];
35
31
  }
36
32
  export interface SelectionGroup extends SelectionBase {
37
33
  id: Guid;
@@ -39,16 +35,13 @@ export interface SelectionGroup extends SelectionBase {
39
35
  }
40
36
  export interface SelectionTreeStore {
41
37
  groups: SelectionGroup[];
42
- addTags: <T extends boolean | undefined = undefined>(args: AddTagsArgs & {
38
+ addTags: <T extends boolean | undefined = undefined>(args: AddItemArgs<GlobalSelectionTypes.TagId> & {
43
39
  getActionResult?: T;
44
40
  }) => Promise<AddTagsReturnType<T>>;
45
- addWorkOrders: (args: {
46
- groupId?: Guid;
47
- items: Readonly<Readonly<OptimizedWorkOrderDto>[]>;
48
- }) => void;
41
+ addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => void;
49
42
  addItems: (args: {
50
43
  groupId?: Guid;
51
- itemIds: (GlobalSelectionTypes.TagId | OptimizedWorkOrderDto)[];
44
+ itemIds: GlobalSelectionTypes.ItemId[];
52
45
  }) => void;
53
46
  createGroup: (args: {
54
47
  label: string;
@@ -79,8 +72,7 @@ export interface SelectionTreeStore {
79
72
  export declare namespace SelectionTreeTypes {
80
73
  type Category = SelectionCategory;
81
74
  type Group = SelectionGroup;
82
- type Item = SelectionItem;
83
75
  type ActionResult = SelectionTreeActionResult;
84
76
  }
85
- export type AddTagsReturnType<T extends boolean | undefined = undefined> = T extends true ? AddTagsResponse : ResultArray<TagSummaryDto>[];
77
+ export type AddTagsReturnType<T extends boolean | undefined = undefined> = T extends true ? AddItemsResponse<ResultArray<TagSummaryDto>[]> : ResultArray<TagSummaryDto>[];
86
78
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
+ import { WritableDraft } from 'immer';
2
3
  import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
3
4
  import { GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionTree.store.types';
4
- import { WritableDraft } from 'immer';
5
5
  /**
6
6
  * Check if an item ID is present in the selection tree.
7
7
  *
@@ -72,8 +72,8 @@ export declare function getGroupIdsByItemIds(args: {
72
72
  label: string;
73
73
  subLabel?: string;
74
74
  }[];
75
- export declare function areItemsTheSameInGroup(args: {
76
- itemIds: GlobalSelectionTypes.TagId[];
75
+ export declare function areItemsTheSameInGroup<ItemType extends GlobalSelectionTypes.ItemId>(args: {
76
+ itemIds: ItemType[];
77
77
  groups: SelectionTreeTypes.Group[];
78
78
  groupId: Guid;
79
79
  categoryId: GlobalSelectionCategoryId;
@@ -0,0 +1,7 @@
1
+ import { LegendId } from '../types/legendType';
2
+ interface LegendSelectorMenuProps {
3
+ legendId: LegendId;
4
+ isExpanded?: boolean;
5
+ }
6
+ export declare const BasicLegendRenderer: import("react").NamedExoticComponent<LegendSelectorMenuProps>;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ /**
3
+ * This will render all legends in lower left, with customLegendComponent if available, otherwise BasicLegendRenderer.
4
+ */
5
+ export declare const LegendList: FC;
@@ -0,0 +1,5 @@
1
+ import { LegendChipProps } from '@equinor/echo-components';
2
+ import { Badge, Marker } from '../types/legendMarkerBadge.type';
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[];
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface PositionalItemProps {
3
+ /**
4
+ * This is the CSS position string, that will be used in --transform: var(--position);
5
+ */
6
+ position: string;
7
+ isOpen: boolean;
8
+ children: React.ReactNode;
9
+ }
10
+ /**
11
+ * An item that can be positioned anywhere in the absolute container.
12
+ */
13
+ export declare const PositionalItem: React.FC<PositionalItemProps>;
14
+ export {};
@@ -0,0 +1,24 @@
1
+ import { Point } from '@equinor/echo-utils';
2
+ import React from 'react';
3
+ import { LegendDataId } from '../../types/legendType';
4
+ interface LegendPositionItem {
5
+ itemId: LegendDataId;
6
+ position: Point;
7
+ hasPointer: boolean;
8
+ }
9
+ interface PositionalLegendMarkersProps {
10
+ items: ReadonlyArray<LegendPositionItem>;
11
+ pdfRotation: number;
12
+ currentPageScale: number;
13
+ pdfZoom: number;
14
+ }
15
+ /**
16
+ * Component that renders positional legend markers on a PDF or on other view.
17
+ *
18
+ * @param {ReadonlyArray<LegendPositionItem>} items - Array of position items.
19
+ * @param {number} pdfRotation - The rotation angle of the PDF.
20
+ * @param {number} currentPageScale - The current scale of the PDF page.
21
+ * @param {number} pdfZoom - The zoom level of the PDF.
22
+ */
23
+ export declare const PositionalLegendMarkers: React.FC<PositionalLegendMarkersProps>;
24
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { LegendDataId, LegendId } from '../../../types/legendType';
3
+ interface LegendColoredMarkerIconProps {
4
+ legendId: LegendId;
5
+ itemId: LegendDataId;
6
+ hasPointer: boolean;
7
+ isActive: boolean;
8
+ onClick: () => void;
9
+ }
10
+ export declare const MemoizedLegendColoredMarkerIcon: React.NamedExoticComponent<LegendColoredMarkerIconProps>;
11
+ export {};