@equinor/echo-framework 0.26.8 → 0.26.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +3 -3
- package/package.json +3 -3
- package/src/lib/components/fullScreenButtons/FullScreenModeButton.d.ts +8 -1
- package/src/lib/components/prepview/panels/objects/HorizontalObjects.d.ts +1 -1
- package/src/lib/components/prepview/panels/objects/Objects.d.ts +1 -1
- package/src/lib/feature/equipment/hooks/useOpenEquipmentDetails.d.ts +18 -11
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.repository.d.ts +2 -2
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +1 -3
- package/src/lib/feature/measuringPoint/hooks/useOpenMeasuringPointDetails.d.ts +18 -8
- package/src/lib/hooks/hookLibrary.d.ts +20 -1
- package/src/lib/hooks/useOpenPrepview.d.ts +25 -0
- package/src/lib/types/hookLibrary.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 0.26.8 < 0.27.0",
|
|
6
|
-
"@equinor/echo-components": ">= 0.26.
|
|
6
|
+
"@equinor/echo-components": ">= 0.26.9 < 0.27.0",
|
|
7
7
|
"@equinor/echo-core": ">= 0.26.8 < 0.27.0",
|
|
8
8
|
"@equinor/echo-search": ">= 0.26.8 < 0.27.0",
|
|
9
|
-
"@equinor/echo-utils": ">= 0.26.
|
|
9
|
+
"@equinor/echo-utils": ">= 0.26.9 < 0.27.0",
|
|
10
10
|
"@equinor/eds-core-react": "0.43.0",
|
|
11
11
|
"@equinor/eds-icons": "0.22.0",
|
|
12
12
|
"react": ">= 17.0.2",
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface FullScreenModeButtonProps {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
dataTestId?: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
toolTipDisabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const FullScreenModeButton: React.FC<FullScreenModeButtonProps>;
|
|
9
|
+
export {};
|
|
@@ -2,5 +2,5 @@ import { PrepviewObject } from '../../types';
|
|
|
2
2
|
interface HorizontalObjectProps {
|
|
3
3
|
objects: PrepviewObject[];
|
|
4
4
|
}
|
|
5
|
-
declare function HorizontalObject({ objects }: HorizontalObjectProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function HorizontalObject({ objects }: Readonly<HorizontalObjectProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export { HorizontalObject };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
workOrderId: string;
|
|
3
3
|
}
|
|
4
|
-
declare function ObjectsPanel({ workOrderId }: Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ObjectsPanel({ workOrderId }: Readonly<Props>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export { ObjectsPanel };
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Custom
|
|
2
|
+
* Custom hook that returns a function to open equipment details in a side panel.
|
|
3
3
|
*
|
|
4
|
-
* The returned function accepts an object
|
|
5
|
-
*
|
|
6
|
-
* If the equipment item is already open in the specified panel, it will close the panel instead.
|
|
4
|
+
* The returned function accepts an `OpenEquipmentArgs` object, which specifies the equipment to display,
|
|
5
|
+
* the panel to use, and additional options such as toggling and navigation behavior.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
7
|
+
* If `allowToggle` is true and the equipment is already open in the specified panel, the panel will be closed.
|
|
8
|
+
* Otherwise, the panel will be activated and populated with the equipment details.
|
|
9
|
+
*
|
|
10
|
+
* @returns A function that opens equipment details in the left panel based on the provided arguments.
|
|
9
11
|
*
|
|
10
12
|
* @example
|
|
11
13
|
* const openEquipmentDetails = useOpenEquipmentDetails();
|
|
12
14
|
* openEquipmentDetails({ equipmentId: '123', tagNo: 'TAG-001', plantNo: 'PLANT-01' });
|
|
13
15
|
*
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
* @
|
|
16
|
+
* Returns a function that opens the equipment details panel with the specified arguments.
|
|
17
|
+
* @param args - The arguments for opening the equipment details panel.
|
|
18
|
+
* @param args.equipmentId - The unique identifier of the equipment to display.
|
|
19
|
+
* @param args.tagNo - (Optional) The tag number of the equipment.
|
|
20
|
+
* @param args.plantNo - (Optional) The plant number associated with the equipment.
|
|
21
|
+
* @param args.panelKey - (Optional) The key of the panel to open. Defaults to the core search panel if not provided.
|
|
22
|
+
* @param args.keepLastNavigationItem - (Optional) Whether to keep the last navigation item in the panel.
|
|
23
|
+
* @param args.allowToggle - (Optional) If true, toggles the panel open/closed if the same item is already open.
|
|
24
|
+
*
|
|
25
|
+
* @returns A function that, when called with the above arguments, opens the equipment details panel accordingly.
|
|
20
26
|
*/
|
|
21
27
|
export declare function useOpenEquipmentDetails(): (args: {
|
|
22
28
|
equipmentId: string;
|
|
@@ -24,4 +30,5 @@ export declare function useOpenEquipmentDetails(): (args: {
|
|
|
24
30
|
plantNo?: string;
|
|
25
31
|
panelKey?: string;
|
|
26
32
|
keepLastNavigationItem?: boolean;
|
|
33
|
+
allowToggle?: boolean;
|
|
27
34
|
}) => void;
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.repository.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PersistOptions } from 'zustand/middleware';
|
|
2
2
|
import { PersistedSelectionGroup } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
3
3
|
import { GlobalSelectionStore } from './globalSelectionStore.types';
|
|
4
|
-
declare function
|
|
4
|
+
declare function loadAndPopulateStoreMetadataFromDisk(store: GlobalSelectionStore): Promise<void>;
|
|
5
5
|
declare function loadAndPopulateStoreMetadataFromApi(store: GlobalSelectionStore, data: PersistedSelectionGroup[]): Promise<void>;
|
|
6
6
|
export declare const globalSelectionRepository: {
|
|
7
|
-
|
|
7
|
+
loadAndPopulateStoreMetadataFromDisk: typeof loadAndPopulateStoreMetadataFromDisk;
|
|
8
8
|
loadAndPopulateStoreMetadataFromApi: typeof loadAndPopulateStoreMetadataFromApi;
|
|
9
9
|
persistOptions: PersistOptions<GlobalSelectionStore, GlobalSelectionStore>;
|
|
10
10
|
};
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts
CHANGED
|
@@ -102,9 +102,7 @@ export type GlobalSelectionAddItemResult<DataType> = {
|
|
|
102
102
|
fetchResult: DataType;
|
|
103
103
|
actionResult: GlobalSelectionActionResult;
|
|
104
104
|
};
|
|
105
|
-
export type PersistedGlobalSelectionMetaData = Pick<GlobalSelectionMetaData, 'color'
|
|
106
|
-
isHidden: boolean;
|
|
107
|
-
};
|
|
105
|
+
export type PersistedGlobalSelectionMetaData = Pick<GlobalSelectionMetaData, 'color' | 'isHiddenByUser'>;
|
|
108
106
|
export declare namespace GlobalSelectionTypes {
|
|
109
107
|
type WorkOrderId = Pick<GlobalSelectionWorkOrderDto, 'workOrderId'>;
|
|
110
108
|
type EquipmentId = Pick<GlobalSelectionEquipmentDto, 'equipmentId'>;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import { MeasuringPointData } from '@equinor/echo-search';
|
|
2
2
|
import { MeasurementDto } from '../types/measuringPoint';
|
|
3
3
|
/**
|
|
4
|
-
* Custom hook that provides a function to open the measuring point details panel
|
|
4
|
+
* Custom hook that provides a function to open the measuring point details panel.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* The returned function, `openMeasuringPointDetails`, opens the measuring point details panel with the specified arguments.
|
|
7
|
+
* It can optionally toggle the panel, keep the last navigation item, and pass measurement data to the details component.
|
|
8
8
|
*
|
|
9
|
-
* @returns
|
|
9
|
+
* @returns A function to open the measuring point details panel.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* const openMeasuringPointDetails = useOpenMeasuringPointDetails();
|
|
13
13
|
* openMeasuringPointDetails({
|
|
14
|
-
* measuringPointProps: { measuringPointId:
|
|
15
|
-
* panelKey: '
|
|
16
|
-
* keepLastNavigationItem:
|
|
17
|
-
* measurements: [
|
|
14
|
+
* measuringPointProps: { measuringPointId: 123, ... },
|
|
15
|
+
* panelKey: 'MY_PANEL',
|
|
16
|
+
* keepLastNavigationItem: true,
|
|
17
|
+
* measurements: [...],
|
|
18
|
+
* allowToggle: false
|
|
18
19
|
* });
|
|
20
|
+
*
|
|
21
|
+
* @function
|
|
22
|
+
* @param {Object} args - Arguments for opening the measuring point details panel.
|
|
23
|
+
* @param {MeasuringPointProps} args.measuringPointProps - The properties of the measuring point, including its ID and position.
|
|
24
|
+
* @param {string} [args.panelKey] - The key of the panel to open. Defaults to ECHO_CORE_SEARCH if not provided.
|
|
25
|
+
* @param {boolean} [args.keepLastNavigationItem] - Whether to keep the last navigation item in the panel.
|
|
26
|
+
* @param {MeasurementDto[]} [args.measurements] - Optional array of measurement data associated with the measuring point. If not provided, the UI component will fetch the measurements.
|
|
27
|
+
* @param {boolean} [args.allowToggle] - Whether to allow toggling the panel open/closed if the item is already open.
|
|
19
28
|
*/
|
|
20
29
|
export declare function useOpenMeasuringPointDetails(): (args: MeasuringPointArgs) => void;
|
|
21
30
|
type MeasuringPointArgs = {
|
|
@@ -23,5 +32,6 @@ type MeasuringPointArgs = {
|
|
|
23
32
|
measurements?: MeasurementDto[];
|
|
24
33
|
panelKey?: string;
|
|
25
34
|
keepLastNavigationItem?: boolean;
|
|
35
|
+
allowToggle?: boolean;
|
|
26
36
|
};
|
|
27
37
|
export {};
|
|
@@ -11,7 +11,26 @@ export declare enum RegisteredHookName {
|
|
|
11
11
|
export declare const HookLibrary: Readonly<{
|
|
12
12
|
/**
|
|
13
13
|
* Hook for setting the selected tag application wide.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* @param {SetActiveTagNoArgs | string} argsORtagNo - Arguments for setting the active tag and controlling tag details panel behavior.
|
|
16
|
+
* If you pass a string, it will be handled as the tagNo
|
|
17
|
+
* @property {string} argsORtagNo.tagNo - The tag number to activate and open details for.
|
|
18
|
+
* @property {TagItemContentTabsType} [argsORtagNo.activeTagTab] - The main tab to activate in the tag details panel (e.g., Info, History, etc.).
|
|
19
|
+
* @property {SubTabType} [argsORtagNo.activeTagSubTab] - The sub-tab to activate within the main tab, if applicable.
|
|
20
|
+
* @property {string} [argsORtagNo.instCode] - The installation code associated with the tag (for multi-installation contexts).
|
|
21
|
+
* @property {string} [argsORtagNo.activePanelKey] - The key of the panel to activate (if using multiple panels).
|
|
22
|
+
* @property {boolean} [argsORtagNo.keepLastNavigationItem] - If true, keeps the last navigation item in the breadcrumb/search flow.
|
|
23
|
+
* @property {boolean} [argsORtagNo.openInPanel] - If true, opens the tag details in a side panel instead of the main view.
|
|
24
|
+
* @property {boolean} [argsORtagNo.displayMessageOnItemNotFound] - If true, displays a message if the tag is not found.
|
|
25
|
+
* @property {boolean} [argsORtagNo.allowToggle] - If true, enables toggle mode (e.g., toggling selection or panel state).
|
|
26
|
+
* @property {boolean} [argsORtagNo.omitTagNoFromUrl] - If true, omits the tag number from the URL (used only by echo maps; planned for removal).
|
|
27
|
+
*
|
|
28
|
+
* @param {TagItemContentTabsType} [activeTagTab] - The active tab for the tag item.
|
|
29
|
+
* @param {SubTabType} [activeTagSubTab] - The active sub-tab for the tag item.
|
|
30
|
+
* @param {string} [instCode] - The installation code associated with the tag.
|
|
31
|
+
* @param {boolean} [openInPanel] - Whether to open the tag details in a panel.
|
|
32
|
+
* @param {boolean} [displayMessageOnItemNotFound] - Whether to display a message if the tag is not found.
|
|
33
|
+
* @returns {void}
|
|
15
34
|
*/
|
|
16
35
|
useSetActiveTagNo: () => SetActiveTagNo;
|
|
17
36
|
/**
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom React hook that returns a function to open a "Prepview" panel with specified content and navigation state.
|
|
3
|
+
*
|
|
4
|
+
* This hook integrates with the panel management system and search hooks for MC and Comm packages.
|
|
5
|
+
* The returned function allows opening a panel with a "Prepview" component, handling toggling, navigation state,
|
|
6
|
+
* and package/tag click events.
|
|
7
|
+
*
|
|
8
|
+
* @returns A function that opens a "Prepview" panel with the provided input and options.
|
|
9
|
+
*
|
|
10
|
+
* @param args - The arguments for opening the Prepview panel.
|
|
11
|
+
* @param args.prepviewInput - Input object containing optional identifiers for the item to display:
|
|
12
|
+
* - `notificationId` (optional): The notification ID.
|
|
13
|
+
* - `workOrderId` (optional): The work order ID.
|
|
14
|
+
* - `punchId` (optional): The punch ID.
|
|
15
|
+
* - `instCode` (optional): The instrument code.
|
|
16
|
+
* @param args.panelKey - The key identifying the panel to open.
|
|
17
|
+
* @param args.keepLastNavigationItem - (optional) Whether to keep the last navigation item in the panel.
|
|
18
|
+
* @param args.allowToggle - (optional) If true, toggles the panel closed if the same item is already open.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* - At least one of `notificationId`, `workOrderId`, or `punchId` should be provided in `prepviewInput`.
|
|
22
|
+
* - Handles package and tag click events by invoking appropriate search or navigation actions.
|
|
23
|
+
* - If `allowToggle` is true and the item is already open in the panel, the panel will be closed.
|
|
24
|
+
*/
|
|
1
25
|
export declare function useOpenPrepview(): (args: {
|
|
2
26
|
prepviewInput: {
|
|
3
27
|
notificationId?: string;
|
|
@@ -7,4 +31,5 @@ export declare function useOpenPrepview(): (args: {
|
|
|
7
31
|
};
|
|
8
32
|
panelKey: string;
|
|
9
33
|
keepLastNavigationItem?: boolean;
|
|
34
|
+
allowToggle?: boolean;
|
|
10
35
|
}) => void;
|
|
@@ -7,6 +7,7 @@ export type SetActiveTagNo = (argsORtagNo: string | {
|
|
|
7
7
|
keepLastNavigationItem?: boolean;
|
|
8
8
|
openInPanel?: boolean;
|
|
9
9
|
displayMessageOnItemNotFound?: boolean;
|
|
10
|
+
allowToggle?: boolean;
|
|
10
11
|
omitTagNoFromUrl?: boolean;
|
|
11
12
|
}, activeTagTab?: string, activeTagSubTab?: string, instCode?: string, openInPanel?: boolean, displayMessageOnItemNotFound?: boolean) => void;
|
|
12
13
|
export type TagData = [(tagNo: string, instCode: string) => void];
|