@equinor/echo-framework 0.25.1 → 0.25.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.
Files changed (45) hide show
  1. package/{f4c85313e79b1662.svg → 1bd97dd2170d0f64.svg} +850 -850
  2. package/{063009f06499d102.svg → 47deeba42768c5d1.svg} +8 -8
  3. package/README.md +28 -28
  4. package/index.cjs.js +8 -8
  5. package/index.d.ts +2 -0
  6. package/package.json +2 -2
  7. package/src/index.d.ts +5 -4
  8. package/src/lib/components/contextualAppLinks/hooks/useContextualAppLinksContext.d.ts +1 -1
  9. package/src/lib/feature/globalSelection/OpenGlobalSelectionIn3DButton.utils.d.ts +14 -0
  10. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +5 -5
  11. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts +0 -14
  12. package/src/lib/feature/globalSelection/index.d.ts +0 -2
  13. package/src/lib/feature/legend/legendFacade.d.ts +53 -0
  14. package/src/lib/feature/legend/legendStore.d.ts +12 -3
  15. package/src/lib/feature/legend/legendVisibleDataAsTagsStore.d.ts +41 -0
  16. package/src/lib/feature/legend/legendVisibleDataAsTagsStore.logic.d.ts +3 -0
  17. package/src/lib/feature/legend/legendVisibleDataAsTagsStore.type.d.ts +7 -0
  18. package/src/lib/feature/legend/legendVisibleDataStore.d.ts +15 -1
  19. package/src/lib/feature/legend/logic/isLegendDataIdEqualWithTag.d.ts +12 -0
  20. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +0 -5
  21. package/src/lib/feature/measuringPoint/index.d.ts +1 -0
  22. package/src/lib/feature/workOrder/components/PanelTagInfo/PanelTagInfo.d.ts +5 -0
  23. package/src/lib/feature/workOrder/components/PanelTagInfo/api/api-prepview-workOrder-tagInfo.d.ts +6 -0
  24. package/src/lib/feature/workOrder/components/PanelTagInfo/hooks/usePrepviewWorkOrderTagInfo.d.ts +6 -0
  25. package/src/lib/feature/workOrder/components/PanelTagInfo/types/tagInfo.d.ts +32 -0
  26. package/src/lib/feature/workOrder/components/WorkOrderItemHeader.d.ts +2 -2
  27. package/src/lib/feature/workOrder/components/WorkOrderItemHeader.types.d.ts +2 -0
  28. package/src/lib/feature/workOrder/components/WorkOrderItemTabInfo/WorkOrderItemTabInfo.d.ts +7 -0
  29. package/src/lib/feature/workOrder/components/WorkOrderPanelObjects/WorkOrderPanelObjects.d.ts +5 -0
  30. package/src/lib/feature/workOrder/components/WorkOrderPanelObjects/api/api-prepview-workOrder-objects.d.ts +6 -0
  31. package/src/lib/feature/workOrder/components/WorkOrderPanelObjects/components/WorkOrderObjectItem.d.ts +6 -0
  32. package/src/lib/feature/workOrder/components/WorkOrderPanelObjects/hooks/usePrepviewWorkOrderObjects.d.ts +6 -0
  33. package/src/lib/feature/workOrder/components/WorkOrderPanelObjects/types/workOrder-objects.d.ts +24 -0
  34. package/src/lib/feature/workOrder/components/WorkOrderPanelOperations/WorkOrderPanelOperations.d.ts +5 -0
  35. package/src/lib/feature/workOrder/components/WorkOrderPanelOperations/api/api-prepview-workOrder-operations.d.ts +6 -0
  36. package/src/lib/feature/workOrder/components/WorkOrderPanelOperations/components/WorkOrderOperationItem.d.ts +6 -0
  37. package/src/lib/feature/workOrder/components/WorkOrderPanelOperations/components/WorkOrderOperationItemHeader.d.ts +11 -0
  38. package/src/lib/feature/workOrder/components/WorkOrderPanelOperations/hooks/usePrepviewWorkOrderOperations.d.ts +6 -0
  39. package/src/lib/feature/workOrder/components/WorkOrderPanelOperations/types/workOrder-operations.d.ts +39 -0
  40. package/src/lib/feature/workOrder/types/workOrder.d.ts +15 -0
  41. package/src/lib/feature/workOrder/utils/workOrderUtils.d.ts +2 -2
  42. package/src/lib/hooks/index.d.ts +1 -1
  43. package/src/lib/utils/handleErrors.d.ts +2 -1
  44. package/index.cjs.d.ts +0 -2
  45. package/src/lib/feature/legend/legendUpdater.d.ts +0 -3
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./src/index";
2
+ export { default } from "./src/index";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.25.1",
3
+ "version": "0.25.3",
4
4
  "peerDependencies": {
5
5
  "@equinor/echo-base": ">= 0.7.5 < 0.8.0",
6
6
  "@equinor/echo-components": ">= 0.12.4 < 0.13.0",
@@ -29,5 +29,5 @@
29
29
  },
30
30
  "main": "./index.cjs.js",
31
31
  "type": "commonjs",
32
- "types": "./index.cjs.d.ts"
32
+ "types": "./index.d.ts"
33
33
  }
package/src/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { getLegendStatusColor } from './lib/feature/legacyLegend/utils/legendUtils';
2
2
  import './lib/globalStyles.css';
3
+ import * as hooks from './lib/hooks';
3
4
  import { getPlantsInfo, getTagDetails } from './lib/services/api';
4
5
  export * from './lib/components';
5
6
  export { NotificationListItem } from './lib/components/notificationListItem';
@@ -21,7 +22,7 @@ export { GlobalSelectionCategoryId } from './lib/feature/globalSelection/selecti
21
22
  export * from './lib/feature/legacyLegend/index';
22
23
  export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
23
24
  export * from './lib/feature/legend/index';
24
- export { subscribeToLegendDataChanged } from './lib/feature/legend/legendUpdater';
25
+ export { legendVisibleTagsSubscribeToStore } from './lib/feature/legend/legendVisibleDataAsTagsStore';
25
26
  export type { LegendDataId, LegendEquipmentId, LegendState, LegendTagId } from './lib/feature/legend/types/legendType';
26
27
  export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
27
28
  export * from './lib/feature/measuringPoint/index';
@@ -84,8 +85,8 @@ declare const EchoFramework: Readonly<{
84
85
  }>;
85
86
  }>;
86
87
  Hooks: Readonly<{
88
+ useClosePanelByKey: typeof hooks.useClosePanelByKey;
87
89
  useInstCodeSafe: () => string;
88
- useClosePanelByKey(panelKey?: string): () => void;
89
90
  useEchoHistory(): (path: string, params?: {
90
91
  [key: string]: string;
91
92
  } | undefined, state?: any) => void;
@@ -117,12 +118,12 @@ declare const EchoFramework: Readonly<{
117
118
  tagNo: string;
118
119
  instCode: string;
119
120
  }): {
120
- tagDetails: import("dist/libs/echo-search/src").TagDetailsDto | undefined;
121
+ tagDetails: import("@equinor/echo-search").TagDetailsDto | undefined;
121
122
  isTagDetailsLoading: boolean;
122
123
  hasError: boolean;
123
124
  };
124
125
  useSetActiveTagNo: () => import("./lib/types/hookLibrary").SetActiveTagNo;
125
- useContextMenuDataInfo: (tagNo: string, expanded: boolean, setActivePanel?: () => void) => import("dist/libs/echo-components/src").DataInformation[];
126
+ useContextMenuDataInfo: (tagNo: string, expanded: boolean, setActivePanel?: () => void) => import("@equinor/echo-components").DataInformation[];
126
127
  useTagData: () => import("./lib/types/hookLibrary").TagData;
127
128
  useIsContextMenuInfoLoading: () => boolean;
128
129
  useSetActiveCommPackNo: () => import("./lib/types/hookLibrary").SetActiveCommPackNo;
@@ -1,4 +1,4 @@
1
1
  export declare function useContextualAppLinksContext(): {
2
- tag: import("dist/libs/echo-search/src").TagSummaryDto;
2
+ tag: import("@equinor/echo-search").TagSummaryDto;
3
3
  instCode: string;
4
4
  };
@@ -0,0 +1,14 @@
1
+ import { PlantAndTagForOpenIn3d } from '../openItemsIn3d/logic/openItemsIn3d.utils';
2
+ /**
3
+ * Converts global selection items to plant tag pairs.
4
+ *
5
+ * This function processes different types of global selection items (Tag, WorkOrder, Equipment)
6
+ * and converts them into an array of `PlantAndTagForOpenIn3d` objects. It ensures that all
7
+ * enum cases are handled by using a switch statement and the `assertUnreachable` function.
8
+ *
9
+ * The resulting array is then filtered to remove duplicates based on the combination of
10
+ * `instCode`, `pdmsPlantCode`, and `tagNo`.
11
+ *
12
+ * @returns {Promise<PlantAndTagForOpenIn3d[]>} A promise that resolves to an array of plant tag pairs.
13
+ */
14
+ export declare function convertGlobalSelectionItemsToPlantTagPairs(): Promise<PlantAndTagForOpenIn3d[]>;
@@ -27,7 +27,7 @@ export declare const globalSelectionApi: Readonly<{
27
27
  * @param {GlobalSelectionCategoryId} args.category - The ID of the list where the items to be removed are located.
28
28
  */
29
29
  itemsById: (args: {
30
- groupId?: import("dist/libs/echo-utils/src").Guid;
30
+ groupId?: import("@equinor/echo-utils").Guid;
31
31
  categoryId: GlobalSelectionCategoryId;
32
32
  itemIds: GlobalSelectionTypes.ItemId[];
33
33
  }) => void;
@@ -54,7 +54,7 @@ export declare const globalSelectionApi: Readonly<{
54
54
  * @param {GlobalSelectionCategoryId} [args.categoryId] - The ID of the category to remove (optional).
55
55
  */
56
56
  listById: (args: {
57
- groupId: import("dist/libs/echo-utils/src").Guid;
57
+ groupId: import("@equinor/echo-utils").Guid;
58
58
  categoryId?: GlobalSelectionCategoryId;
59
59
  }) => void;
60
60
  }>;
@@ -124,7 +124,7 @@ export declare const globalSelectionApi: Readonly<{
124
124
  }) => boolean;
125
125
  findGroupByLabel: (args: {
126
126
  label: string;
127
- }) => import("dist/libs/echo-utils/src").Guid | undefined;
127
+ }) => import("@equinor/echo-utils").Guid | undefined;
128
128
  };
129
129
  visibility: Readonly<{
130
130
  setByItemIds: (args: {
@@ -141,7 +141,7 @@ export declare const globalSelectionApi: Readonly<{
141
141
  * @param {boolean} args.isVisible - The visibility state to set for the items in the list.
142
142
  */
143
143
  setById: (args: {
144
- groupId: import("dist/libs/echo-utils/src").Guid;
144
+ groupId: import("@equinor/echo-utils").Guid;
145
145
  categoryId?: GlobalSelectionCategoryId;
146
146
  isVisible: boolean;
147
147
  }) => void;
@@ -202,5 +202,5 @@ export declare const globalSelectionApi: Readonly<{
202
202
  groupId?: string;
203
203
  label: string;
204
204
  subLabel: string;
205
- }) => import("dist/libs/echo-utils/src").Guid;
205
+ }) => import("@equinor/echo-utils").Guid;
206
206
  }>;
@@ -1,18 +1,4 @@
1
- import { PlantAndTagForOpenIn3d } from '../../openItemsIn3d/logic/openItemsIn3d.utils';
2
1
  import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemSystemStatus } from './globalSelectionStore.types';
3
- /**
4
- * Converts global selection items to plant tag pairs.
5
- *
6
- * This function processes different types of global selection items (Tag, WorkOrder, Equipment)
7
- * and converts them into an array of `PlantAndTagForOpenIn3d` objects. It ensures that all
8
- * enum cases are handled by using a switch statement and the `assertUnreachable` function.
9
- *
10
- * The resulting array is then filtered to remove duplicates based on the combination of
11
- * `instCode`, `pdmsPlantCode`, and `tagNo`.
12
- *
13
- * @returns {Promise<PlantAndTagForOpenIn3d[]>} A promise that resolves to an array of plant tag pairs.
14
- */
15
- export declare function convertGlobalSelectionItemsToPlantTagPairs(): Promise<PlantAndTagForOpenIn3d[]>;
16
2
  export declare function toGlobalSelectionItem<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(item: T, type: K, systemStatus: SelectionItemSystemStatus): GlobalSelectionTypes.GenericItem<K>;
17
3
  export declare function toGlobalSelectionItems<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(items: T[], type: K, systemStatus: SelectionItemSystemStatus): GlobalSelectionTypes.GenericItem<K>[];
18
4
  export declare function setNotFoundStatusByItemIds(args: {
@@ -1,10 +1,8 @@
1
- export { MeasuringPointListItem } from '../measuringPoint/components/MeasuringPointListItem';
2
1
  export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
3
2
  export { globalSelectionApi } from './globalSelection.api';
4
3
  export { globalSelectionInternal } from './globalSelection.internal';
5
4
  export * from './globalSelectionStore/globalSelectionStore.types';
6
5
  export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStore.utils';
7
- export { convertGlobalSelectionItemsToPlantTagPairs } from './globalSelectionStore/globalSelectionStoreHelpers';
8
6
  export { useGlobalSelectionByItemId } from './hooks/useGlobalSelectionByItemId';
9
7
  export { useGlobalSelectionItems } from './hooks/useGlobalSelectionItems';
10
8
  export { useGlobalSelectionItemsByType } from './hooks/useGlobalSelectionItemsByType';
@@ -1,5 +1,7 @@
1
1
  import { legendSnapShot, useAllLegends, useLegendById } from './legendStore';
2
2
  import { getLegendStrategy, injectLegendStrategy } from './legendStrategies/legendCollections';
3
+ import { visibleDataAsTagsSnapshot } from './legendVisibleDataAsTagsStore';
4
+ import { isLegendDataIdEqualWithTag } from './logic/isLegendDataIdEqualWithTag';
3
5
  import { createLegendId } from './types/legendType';
4
6
  /**
5
7
  * Public facade for the legend.
@@ -9,6 +11,15 @@ export declare const legendFacade: Readonly<{
9
11
  inject: typeof injectLegendStrategy;
10
12
  get: typeof getLegendStrategy;
11
13
  };
14
+ store: {
15
+ 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?: {
18
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
19
+ fireImmediately?: boolean;
20
+ } | undefined): () => void;
21
+ };
22
+ };
12
23
  storeSnapshot: typeof legendSnapShot;
13
24
  legend: {
14
25
  createId: typeof createLegendId;
@@ -48,5 +59,47 @@ export declare const legendFacade: Readonly<{
48
59
  }[T][];
49
60
  removePreviousItems?: boolean;
50
61
  }) => void;
62
+ 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?: {
65
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
66
+ fireImmediately?: boolean;
67
+ } | undefined): () => void;
68
+ };
69
+ };
70
+ visibleDataAsTags: {
71
+ useStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>, "setState"> & {
72
+ setState<A extends string | {
73
+ 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;
75
+ }, "subscribe"> & {
76
+ 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?: {
79
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
80
+ fireImmediately?: boolean;
81
+ } | undefined): () => void;
82
+ };
83
+ }, "setState"> & {
84
+ setState(nextStateOrUpdater: import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: import("immer").WritableDraft<import("./legendVisibleDataAsTagsStore").VisibleDataAsTagsStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
85
+ type: string;
86
+ } | undefined): void;
87
+ }>;
88
+ snapShot: typeof visibleDataAsTagsSnapshot;
89
+ };
90
+ utils: {
91
+ isLegendDataIdEqualWithTag: typeof isLegendDataIdEqualWithTag;
51
92
  };
52
93
  }>;
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,11 +1,13 @@
1
1
  import { PersistOptions } from 'zustand/middleware';
2
2
  import { LegendId, LegendState } from './types/legendType';
3
3
  type LegendsDictionary = Record<LegendId, LegendState>;
4
- interface LegendStoreData {
4
+ export interface LegendStoreData {
5
5
  legends: LegendsDictionary;
6
6
  }
7
- interface LegendStoreActions {
8
- updateLegend: (legendId: LegendId, updates: Partial<LegendState>) => void;
7
+ export interface LegendStoreActions {
8
+ updateLegend: (legendId: LegendId, updates: Partial<Omit<LegendState, 'isLoading'>>) => void;
9
+ startLoading: (legendId: LegendId) => void;
10
+ finishLoading: (legendId: LegendId) => void;
9
11
  setHiddenMarker: (args: {
10
12
  legendId: LegendId;
11
13
  marker: string;
@@ -49,4 +51,11 @@ export declare const useLegendStore: import("zustand").UseBoundStore<Omit<Omit<O
49
51
  export declare function useLegendById(legendId: LegendId): LegendState;
50
52
  export declare function useAllLegends(): LegendState[];
51
53
  export declare function legendSnapShot(): LegendStore;
54
+ export declare const legendStoreSubscribe: {
55
+ (listener: (selectedState: LegendStore, previousSelectedState: LegendStore) => void): () => void;
56
+ <U>(selector: (state: LegendStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
57
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
58
+ fireImmediately?: boolean;
59
+ } | undefined): () => void;
60
+ };
52
61
  export {};
@@ -0,0 +1,41 @@
1
+ import { TagWithEquipmentId } from './legendVisibleDataAsTagsStore.type';
2
+ interface VisibleDataAsTagsStoreState {
3
+ readonly tags: TagWithEquipmentId[];
4
+ readonly isPending: boolean;
5
+ }
6
+ interface VisibleDataAsTagsStoreActions {
7
+ /**
8
+ * Will add tags that are in visible data store, the rest will be discarded.
9
+ * This is to ensure that we only keep tags that are relevant to the current visible data
10
+ */
11
+ updateTags: (tags: TagWithEquipmentId[]) => void;
12
+ setIsPending: (isPending: boolean) => void;
13
+ }
14
+ export interface VisibleDataAsTagsStore extends VisibleDataAsTagsStoreState, VisibleDataAsTagsStoreActions {
15
+ }
16
+ /**
17
+ * Goal here is to convert the visible data store items (like equipment) to tags.
18
+ * It also includes the TagSummary, and thereby have loading state.
19
+ *
20
+ * This one might be more convenient to use than the legendVisibleDataStore.
21
+ */
22
+ export declare const useVisibleDataAsTagsStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<VisibleDataAsTagsStore>, "setState"> & {
23
+ setState<A extends string | {
24
+ type: string;
25
+ }>(partial: VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore> | ((state: VisibleDataAsTagsStore) => VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore>), replace?: boolean | undefined, action?: A | undefined): void;
26
+ }, "subscribe"> & {
27
+ subscribe: {
28
+ (listener: (selectedState: VisibleDataAsTagsStore, previousSelectedState: VisibleDataAsTagsStore) => void): () => void;
29
+ <U>(selector: (state: VisibleDataAsTagsStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
30
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
31
+ fireImmediately?: boolean;
32
+ } | undefined): () => void;
33
+ };
34
+ }, "setState"> & {
35
+ setState(nextStateOrUpdater: VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore> | ((state: import("immer").WritableDraft<VisibleDataAsTagsStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
36
+ type: string;
37
+ } | undefined): void;
38
+ }>;
39
+ export declare function visibleDataAsTagsSnapshot(): VisibleDataAsTagsStore;
40
+ export declare function legendVisibleTagsSubscribeToStore(): void;
41
+ export {};
@@ -0,0 +1,3 @@
1
+ import { TagWithEquipmentId } from './legendVisibleDataAsTagsStore.type';
2
+ import { LegendEquipmentId } from './types/legendType';
3
+ export declare function fetchTagsByEquipment(equipmentIds: ReadonlyArray<LegendEquipmentId>, abortController: AbortController): Promise<TagWithEquipmentId[] | undefined>;
@@ -0,0 +1,7 @@
1
+ import { TagSummaryDto } from '@equinor/echo-search';
2
+ export interface TagWithEquipmentId {
3
+ readonly tagNo: string;
4
+ readonly instCode: string;
5
+ readonly equipmentId: string | undefined;
6
+ readonly tagSummary: TagSummaryDto;
7
+ }
@@ -34,7 +34,14 @@ interface LegendVisibleDataStoreActions {
34
34
  useDataByType: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
35
35
  getAll(): LegendDataId[];
36
36
  }
37
- type LegendVisibleDataStore = LegendVisibleData & LegendVisibleDataStoreActions;
37
+ export type LegendVisibleDataStore = LegendVisibleData & LegendVisibleDataStoreActions;
38
+ export declare function getLegendVisibleDataInitialValues(): LegendVisibleData;
39
+ /**
40
+ * This is meant to be a simple store, that contains all visible data ItemIds on screen that should be visible in the legend.
41
+ * It should only contain ItemIds, not the actual data. Meaning we don't need to handle fetch states here like loading.
42
+ *
43
+ * LegendVisibleDataConvertedToTagsStore might be more convenient to use in the legend strategies that don't relay on the EquipmentId.
44
+ */
38
45
  export declare const useLegendVisibleDataStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<LegendVisibleDataStore>, "setState"> & {
39
46
  setState<A extends string | {
40
47
  type: string;
@@ -68,5 +75,12 @@ export declare const visibleData: {
68
75
  getAll: () => LegendDataId[];
69
76
  useByType: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
70
77
  useAddWithAutoRemove: typeof useAddWithAutoRemove;
78
+ subscribe: {
79
+ (listener: (selectedState: LegendVisibleDataStore, previousSelectedState: LegendVisibleDataStore) => void): () => void;
80
+ <U>(selector: (state: LegendVisibleDataStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
81
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
82
+ fireImmediately?: boolean;
83
+ } | undefined): () => void;
84
+ };
71
85
  };
72
86
  export {};
@@ -0,0 +1,12 @@
1
+ import { LegendDataId } from '../types/legendType';
2
+ interface TagWithEquipmentId {
3
+ tagNo: string;
4
+ instCode: string;
5
+ equipmentId: string | undefined;
6
+ }
7
+ /**
8
+ * Checks if the given `legendDataId` is equal to the provided `tag` based on their properties.
9
+ * It first tries to match the `equipmentId`, and if no match, it tries the `tagId`
10
+ */
11
+ export declare function isLegendDataIdEqualWithTag(legendDataId: LegendDataId, tag: TagWithEquipmentId): boolean;
12
+ export {};
@@ -9,11 +9,6 @@ export interface LegendStrategy {
9
9
  * A unique identifier for the legend. Use a friendly UI name since it's displayed in legend component.
10
10
  */
11
11
  legendId: LegendId;
12
- /**
13
- * not implemented yet TODO #155599 - Data Service
14
- * Idea is to notify the legend that it should batch fetch data for the given visibleItemIds, and we will automatically show loading status in UI.
15
- */
16
- fetchData?: (visibleItemIds: ReadonlyArray<LegendDataId>) => Promise<void>;
17
12
  /**
18
13
  * Marker options that is selectable by the user.
19
14
  */
@@ -1,4 +1,5 @@
1
1
  export { failureMechanismConfig, MeasuringPointDetails, MeasuringPointHeader } from './components';
2
+ export { MeasuringPointListItem } from './components/MeasuringPointListItem';
2
3
  export { useOpenMeasuringPointDetails } from './hooks';
3
4
  export type { DocumentRelationships } from './types/documentRelationships';
4
5
  export type { MeasurementDto, MeasuringPointDto } from './types/measuringPoint';
@@ -0,0 +1,5 @@
1
+ interface PanelTagInfoProps {
2
+ readonly workOrderId: string;
3
+ }
4
+ export declare const PanelTagInfo: (props: PanelTagInfoProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewTagInfo } from '../types/tagInfo';
2
+ interface PrepviewWorkOrderTagInfoRequest {
3
+ readonly workOrderId: string;
4
+ }
5
+ export declare function getPrepviewWorkOrderTagInfo(args: PrepviewWorkOrderTagInfoRequest): Promise<PrepviewTagInfo>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewTagInfo } from '../types/tagInfo';
2
+ export declare const usePrepviewWorkOrderTagInfo: (workOrderId: string) => {
3
+ isLoading: boolean;
4
+ error: Error | null;
5
+ tagInfo?: PrepviewTagInfo;
6
+ };
@@ -0,0 +1,32 @@
1
+ export interface PrepviewTagInfoDto {
2
+ id: string;
3
+ functionalLocation: string;
4
+ location?: string | null;
5
+ area?: string | null;
6
+ overallCriticality?: string | null;
7
+ abcIndicator?: string | null;
8
+ redundancy?: string | null;
9
+ consequenceHse?: string | null;
10
+ consequenceProd?: string | null;
11
+ consequenceCost?: string | null;
12
+ consequenceFail?: string | null;
13
+ repairStrategy?: string | null;
14
+ criticalSparePartDemandTime?: string | null;
15
+ unsafeFailure?: Array<string>;
16
+ }
17
+ export interface PrepviewTagInfo {
18
+ id: string;
19
+ functionalLocation: string;
20
+ location?: string;
21
+ area?: string;
22
+ overallCriticality?: string;
23
+ abcIndicator?: string;
24
+ redundancy?: string;
25
+ consequenceHse?: string;
26
+ consequenceProd?: string;
27
+ consequenceCost?: string;
28
+ consequenceFail?: string;
29
+ repairStrategy?: string;
30
+ criticalSparePartDemandTime?: string;
31
+ unsafeFailure?: Array<string>;
32
+ }
@@ -1,6 +1,6 @@
1
- import { PrepViewWorkOrder } from '../types/workOrder';
1
+ import { WorkOrderItemHeaderData } from './WorkOrderItemHeader.types';
2
2
  interface WorkOrderHeaderProps {
3
- readonly data: PrepViewWorkOrder;
3
+ readonly data: WorkOrderItemHeaderData;
4
4
  }
5
5
  export declare const WorkOrderItemHeader: (props: WorkOrderHeaderProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -0,0 +1,2 @@
1
+ import { PrepViewWorkOrder } from '../types/workOrder';
2
+ export type WorkOrderItemHeaderData = Pick<PrepViewWorkOrder, 'id' | 'description' | 'orderType' | 'isActive' | 'workCenterId' | 'basicFinishDateStatus' | 'requiredEndDateTime' | 'requiredEndDateStatus' | 'maintenancePlanDate' | 'basicFinishDateTime' | 'basicStartDateTime' | 'planningPlant' | 'maintenancePlant' | 'plantId'>;
@@ -0,0 +1,7 @@
1
+ import { PrepViewWorkOrder } from '../../types/workOrder';
2
+ type WorkOrderItemTabInfoData = Pick<PrepViewWorkOrder, 'tagId' | 'instCode' | 'tagCategory' | 'id' | 'description' | 'workCenterId' | 'requiredEndDateTime' | 'basicFinishDateTime' | 'basicStartDateTime' | 'planningPlant' | 'maintenancePlant' | 'activeStatusIds' | 'personResponsible' | 'locationId' | 'plannerGroupId' | 'system' | 'systemId' | 'createdDateTime' | 'changedDateTime' | 'priority' | 'revisionId' | 'equipmentId' | 'longText'>;
3
+ interface WorkOrderItemTabInfoProps {
4
+ readonly data: WorkOrderItemTabInfoData;
5
+ }
6
+ export declare const WorkOrderItemTabInfo: (props: WorkOrderItemTabInfoProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ interface WorkOrderPanelObjectsProps {
2
+ readonly workOrderId: string;
3
+ }
4
+ export declare const WorkOrderPanelObjects: ({ workOrderId }: WorkOrderPanelObjectsProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewWorkOrderObject } from '../types/workOrder-objects';
2
+ interface PrepviewWorkOrderObjectsRequest {
3
+ readonly workOrderId: string;
4
+ }
5
+ export declare function getPrepviewWorkOrderObjects(args: PrepviewWorkOrderObjectsRequest): Promise<PrepviewWorkOrderObject[]>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewWorkOrderObject } from '../types/workOrder-objects';
2
+ interface WorkOrderObjectItemProps {
3
+ object: PrepviewWorkOrderObject;
4
+ }
5
+ export declare const WorkOrderObjectItem: (props: WorkOrderObjectItemProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewWorkOrderObject } from '../types/workOrder-objects';
2
+ export declare const usePrepviewWorkOrderObjects: (workOrderId: string) => {
3
+ isLoading: boolean;
4
+ error: Error | null;
5
+ objects?: PrepviewWorkOrderObject[];
6
+ };
@@ -0,0 +1,24 @@
1
+ type MaintenanceRecordType = 'M1' | 'M2' | 'M3' | 'M4' | 'M5' | 'M6' | 'M9';
2
+ export interface PrepviewWorkOrderObjectDto {
3
+ functionalLocationId?: string | null;
4
+ tagId?: string | null;
5
+ tag?: string | null;
6
+ tagPlantId?: string | null;
7
+ notificationId?: string | null;
8
+ notificationTypeId?: MaintenanceRecordType;
9
+ notificationIsActive?: boolean | null;
10
+ notificationDescription?: string | null;
11
+ equipment?: string | null;
12
+ equipmentId?: string | null;
13
+ }
14
+ export interface PrepviewWorkOrderObject {
15
+ tagId?: string;
16
+ tag?: string;
17
+ tagPlantId?: string;
18
+ notificationId?: string;
19
+ equipmentId?: string;
20
+ equipment?: string;
21
+ notificationTypeId?: MaintenanceRecordType;
22
+ functionalLocationId: string;
23
+ }
24
+ export {};
@@ -0,0 +1,5 @@
1
+ interface WorkOrderPanelOperationsProps {
2
+ readonly workOrderId: string;
3
+ }
4
+ export declare const WorkOrderPanelOperations: ({ workOrderId }: WorkOrderPanelOperationsProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewWorkOrderOperation } from '../types/workOrder-operations';
2
+ interface PrepviewWorkOrderOperationsRequest {
3
+ readonly workOrderId: string;
4
+ }
5
+ export declare const getPrepviewWorkOrderOperations: (args: PrepviewWorkOrderOperationsRequest) => Promise<PrepviewWorkOrderOperation[]>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewWorkOrderOperation } from '../types/workOrder-operations';
2
+ interface WorkOrderOperationItemProps {
3
+ readonly operation: PrepviewWorkOrderOperation;
4
+ }
5
+ export declare const WorkOrderOperationItem: (props: WorkOrderOperationItemProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,11 @@
1
+ interface WorkOrderOperationItemHeaderProps {
2
+ operationNumber: string;
3
+ isCompleted?: boolean;
4
+ hasPrts?: boolean;
5
+ title?: string;
6
+ plantName?: string;
7
+ earliestStartDateTime?: Date;
8
+ earliestFinishDateTime?: Date;
9
+ }
10
+ export declare const WorkOrderOperationItemHeader: (props: WorkOrderOperationItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepviewWorkOrderOperation } from '../types/workOrder-operations';
2
+ export declare const usePrepviewWorkOrderOperations: (workOrderId: string) => {
3
+ isLoading: boolean;
4
+ error: Error | null;
5
+ operations?: PrepviewWorkOrderOperation[];
6
+ };
@@ -0,0 +1,39 @@
1
+ type MapLocationDtoReadable = {
2
+ id?: string | null;
3
+ };
4
+ export interface PrepviewWorkOrderOperationDto {
5
+ operationNumber: string;
6
+ isActive?: boolean;
7
+ hasPrts?: boolean | null;
8
+ title?: string | null;
9
+ plantId?: string | null;
10
+ plantName?: string | null;
11
+ workCenterId?: string | null;
12
+ earliestStartDateTime?: string | null;
13
+ earliestFinishDateTime?: string | null;
14
+ longText?: string | null;
15
+ activeStatusIds?: string | null;
16
+ plannedDuration?: string | null;
17
+ plannedWorkHours?: string | null;
18
+ actualWorkHours?: string | null;
19
+ actualPercentageComplete?: number | null;
20
+ capacityCount?: number | null;
21
+ mapLocation?: MapLocationDtoReadable | null;
22
+ }
23
+ export interface PrepviewWorkOrderOperation {
24
+ activeStatusIds?: string;
25
+ title?: string;
26
+ workCenterId?: string;
27
+ plantName?: string;
28
+ earliestStartDateTime?: Date;
29
+ earliestFinishDateTime?: Date;
30
+ plannedDuration?: string;
31
+ plannedWorkHours?: string;
32
+ actualWorkHours?: string;
33
+ actualPercentageComplete?: number;
34
+ operationNumber: string;
35
+ capacityCount?: number;
36
+ hasPrts?: boolean;
37
+ longText?: string;
38
+ }
39
+ export {};
@@ -66,5 +66,20 @@ export interface PrepViewWorkOrder {
66
66
  planningPlant?: string;
67
67
  maintenancePlant?: string;
68
68
  plantId?: string;
69
+ instCode?: string;
70
+ tagId?: string;
71
+ tagCategory?: string;
72
+ activeStatusIds?: string;
73
+ personResponsible?: string;
74
+ locationId?: string;
75
+ plannerGroupId?: string;
76
+ system?: string;
77
+ systemId?: string;
78
+ createdDateTime?: string;
79
+ changedDateTime?: string;
80
+ priority?: string;
81
+ revisionId?: string;
82
+ equipmentId?: string;
83
+ longText?: string;
69
84
  }
70
85
  export {};
@@ -1,3 +1,3 @@
1
1
  import { WorkOrderListItemData } from '../../../components/workOrderListItem/types/types';
2
- import { PrepViewWorkOrder } from '../types/workOrder';
3
- export declare function mapWorkOrderDetailsToWorkOrderItem(details: PrepViewWorkOrder): WorkOrderListItemData;
2
+ import { WorkOrderItemHeaderData } from '../components/WorkOrderItemHeader.types';
3
+ export declare function mapHeaderDataToListItemData(headerData: WorkOrderItemHeaderData): WorkOrderListItemData;