@equinor/echo-framework 0.18.7 → 0.18.8-beta-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.18.7",
3
+ "version": "0.18.8-beta-0",
4
4
  "peerDependencies": {
5
5
  "@equinor/echo-base": ">= 0.7.0 < 0.8.0",
6
6
  "@equinor/echo-components": ">= 0.11.0 < 0.12.0",
package/src/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { RequestProCoSysAccess } from './lib/components/requestAccess/RequestPro
8
8
  export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAccess';
9
9
  export * from './lib/coreApplication';
10
10
  export * from './lib/feature/equipment/index';
11
+ export * from './lib/feature/globalSelection';
11
12
  export * from './lib/feature/legend/index';
12
13
  export { getLatestMeasurementDate, sortMeasuringPointsByMeasurementDate } from './lib/feature/measuringPoint/components/measuringPoints.utils';
13
14
  export * from './lib/feature/measuringPoint/index';
@@ -17,7 +18,6 @@ export { useIsCompactLayout } from './lib/hooks/useIsCompactLayout';
17
18
  export { useIsFullScreenModeEnabled } from './lib/hooks/useIsFullScreenModeEnabled';
18
19
  export { useScreenOrientation } from './lib/hooks/useScreenOrientation';
19
20
  export { useScreenValues } from './lib/hooks/useScreenValues';
20
- export * from './lib/services/activeSelectionStore';
21
21
  export { getPlantsCachedOrApi, getPlantsFromApi } from './lib/services/api/api-plants';
22
22
  export { RegisteredComponentName } from './lib/services/componentRegistry/componentRegistry';
23
23
  export * from './lib/services/eventHubActions';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ColorMap, SideSheetOrientation } from '@equinor/echo-components';
2
+ import { ColorMap, SideSheetOrientation, WorkOrderDateType } from '@equinor/echo-components';
3
3
  import { PrepviewEvents } from './context/PrepviewContext';
4
4
  interface PrepviewProps {
5
5
  orientation: SideSheetOrientation;
@@ -12,6 +12,7 @@ interface PrepviewProps {
12
12
  headerAction?: React.ReactNode;
13
13
  events?: PrepviewEvents;
14
14
  colorMap?: ColorMap;
15
+ workOrderDateType?: WorkOrderDateType;
15
16
  }
16
17
  declare function Prepview(props: PrepviewProps): JSX.Element | null;
17
18
  export { MaintenanceApiNameForWorkOrders, WorkItemType } from './utils';
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import { WorkOrderDateType } from '@equinor/echo-components';
2
3
  interface WorkOrderProps {
3
4
  workOrderId: string;
4
5
  closePanel: () => void;
5
6
  headerAction?: React.ReactNode;
7
+ workOrderDateType?: WorkOrderDateType;
6
8
  }
7
9
  declare function WorkOrder(props: WorkOrderProps): JSX.Element | null;
8
10
  export { WorkOrder };
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import { WorkOrderDateType } from '@equinor/echo-components';
2
3
  import { WorkOrderDetails } from '../../types';
3
4
  interface WorkOrderHeaderProps {
4
5
  workOrderDetails: WorkOrderDetails;
5
6
  headerAction?: React.ReactNode;
7
+ workOrderDateType?: WorkOrderDateType;
6
8
  }
7
- declare function WorkOrderHeader({ workOrderDetails, headerAction, }: WorkOrderHeaderProps): JSX.Element | null;
9
+ declare function WorkOrderHeader({ workOrderDetails, headerAction, workOrderDateType, }: WorkOrderHeaderProps): JSX.Element | null;
8
10
  export { WorkOrderHeader };
@@ -0,0 +1,97 @@
1
+ import { WorkOrderDto } from '@equinor/echo-search';
2
+ export declare enum GlobalSelectionItemType {
3
+ WorkOrder = "WorkOrder"
4
+ }
5
+ export type GlobalSelectionList = {
6
+ label: string;
7
+ key: string;
8
+ type: GlobalSelectionItemType;
9
+ items: GlobalSelectionItem[];
10
+ };
11
+ type GlobalSelectionItem = {
12
+ id: string;
13
+ type: GlobalSelectionItemType;
14
+ data: Partial<WorkOrderDto>;
15
+ metaData: {
16
+ isVisible: boolean;
17
+ color: string;
18
+ };
19
+ };
20
+ export interface GlobalSelectionStore {
21
+ lists: GlobalSelectionList[];
22
+ actions: {
23
+ addWorkOrderToSelection: (args: {
24
+ workOrder: Partial<WorkOrderDto>;
25
+ }) => void;
26
+ replaceWorkOrderSelection: (args: {
27
+ workOrders: Partial<WorkOrderDto>[];
28
+ }) => void;
29
+ resetState: () => void;
30
+ };
31
+ }
32
+ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<GlobalSelectionStore>, "setState"> & {
33
+ setState<A extends string | {
34
+ type: string;
35
+ }>(partial: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: GlobalSelectionStore) => GlobalSelectionStore | Partial<GlobalSelectionStore>), replace?: boolean | undefined, action?: A | undefined): void;
36
+ }, "subscribe"> & {
37
+ subscribe: {
38
+ (listener: (selectedState: GlobalSelectionStore, previousSelectedState: GlobalSelectionStore) => void): () => void;
39
+ <U>(selector: (state: GlobalSelectionStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
40
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
41
+ fireImmediately?: boolean | undefined;
42
+ } | undefined): () => void;
43
+ };
44
+ }, "setState"> & {
45
+ setState(nextStateOrUpdater: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: {
46
+ lists: {
47
+ label: string;
48
+ key: string;
49
+ type: GlobalSelectionItemType;
50
+ items: {
51
+ id: string;
52
+ type: GlobalSelectionItemType;
53
+ data: {
54
+ workOrderId?: string | undefined;
55
+ orderTypeId?: string | undefined;
56
+ locationId?: string | undefined;
57
+ systemId?: string | undefined;
58
+ title?: string | undefined;
59
+ activeStatusIds?: string[] | undefined;
60
+ systemStatusIds?: string[] | undefined;
61
+ userStatusIds?: string[] | undefined;
62
+ basicStartDateTime?: Date | undefined;
63
+ basicFinishDateTime?: Date | undefined;
64
+ changedDateTime?: Date | undefined;
65
+ createdDateTime?: Date | undefined;
66
+ functionalLocationId?: string | undefined;
67
+ phaseId?: string | undefined;
68
+ planningPlantId?: string | undefined;
69
+ tagId?: string | undefined;
70
+ workCenterId?: string | undefined;
71
+ revisionId?: string | undefined;
72
+ plannerGroupId?: string | undefined;
73
+ maintenanceRecordId?: string | undefined;
74
+ maintenancePlanDate?: Date | undefined;
75
+ maintenancePlantId?: string | undefined;
76
+ tagPlantId?: string | undefined;
77
+ };
78
+ metaData: {
79
+ isVisible: boolean;
80
+ color: string;
81
+ };
82
+ }[];
83
+ }[];
84
+ actions: {
85
+ addWorkOrderToSelection: (args: {
86
+ workOrder: Partial<WorkOrderDto>;
87
+ }) => void;
88
+ replaceWorkOrderSelection: (args: {
89
+ workOrders: Partial<WorkOrderDto>[];
90
+ }) => void;
91
+ resetState: () => void;
92
+ };
93
+ }) => void), shouldReplace?: boolean | undefined, action?: string | {
94
+ type: string;
95
+ } | undefined): void;
96
+ }>;
97
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Hook for returning all lists stored in the global selection.
3
+ */
4
+ export declare function useGlobalSelectionLists(): import("../globalSelectionStore/globalSelectionStore").GlobalSelectionList[];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Returns with the stored Work Orders in the global selection
3
+ * @returns {Partial<WorkOrderDto>[]} Array of Work Orders
4
+ */
5
+ export declare function useGlobalSelectionWorkOrders(): {
6
+ id: string;
7
+ type: import("../globalSelectionStore/globalSelectionStore").GlobalSelectionItemType;
8
+ data: Partial<import("dist/libs/echo-search/src").WorkOrderDto>;
9
+ metaData: {
10
+ isVisible: boolean;
11
+ color: string;
12
+ };
13
+ }[];
@@ -0,0 +1,3 @@
1
+ export { useGlobalSelectionStore } from './globalSelectionStore/globalSelectionStore';
2
+ export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
3
+ export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
@@ -1,10 +0,0 @@
1
- import { TagSummaryDto } from '@equinor/echo-search';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- /**
4
- * Get the tag summaries for those tags, which are part of the active selection.
5
- * Works with deep linking: if the selected instCode is different then the instCode in the URL
6
- * it will fetch the tag summaries from STID API.
7
- * Otherwise it will get it from echo-search.
8
- * @returns {UseQueryResult<TagSummaryDto[]>}
9
- */
10
- export declare function useActiveSelectedTagSummaries(): UseQueryResult<TagSummaryDto[]>;
@@ -1,27 +0,0 @@
1
- import * as zustand from 'zustand';
2
- export declare const useActiveSelectionStore: zustand.UseBoundStore<Omit<zustand.StoreApi<ActiveSelectionState>, "subscribe"> & {
3
- subscribe: {
4
- (listener: (selectedState: ActiveSelectionState, previousSelectedState: ActiveSelectionState) => void): () => void;
5
- <U>(selector: (state: ActiveSelectionState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
6
- equalityFn?: ((a: U, b: U) => boolean) | undefined;
7
- fireImmediately?: boolean | undefined;
8
- } | undefined): () => void;
9
- };
10
- }>;
11
- export type ActiveSelectionItemType = 'tagNos' | 'workOrderIds' | 'measuringPointIds';
12
- export type ActiveSelectionItems = {
13
- [key in ActiveSelectionItemType]: string[];
14
- };
15
- export interface ActiveSelectionState {
16
- items: ActiveSelectionItems;
17
- userRequestAction: string | null;
18
- actions: ActiveSelectionActions;
19
- }
20
- interface ActiveSelectionActions {
21
- addToSelectionByType: (itemType: ActiveSelectionItemType, items: string[]) => void;
22
- removeFromSelectionByType: (itemType: ActiveSelectionItemType, items: string[]) => void;
23
- clearSelectionByType: (itemType: ActiveSelectionItemType) => void;
24
- clearSelectionForAllTypes: () => void;
25
- replaceSelection: (items: ActiveSelectionItems, action?: string) => void;
26
- }
27
- export {};
@@ -1,2 +0,0 @@
1
- export * from './activeSelectionData.hooks';
2
- export * from './activeSelectionStore';