@equinor/echo-framework 0.21.1 → 0.21.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.
- package/index.cjs.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/prepview/Prepview.d.ts +2 -2
- package/src/lib/components/prepview/utils/index.d.ts +0 -1
- package/src/lib/components/prepview/workorder/WorkOrder.d.ts +5 -5
- package/src/lib/components/prepviewButton/prepviewButton.d.ts +4 -4
- package/src/lib/feature/globalSelection/components/RemoveSelectionItemsConfirmDialog.d.ts +2 -0
- package/src/lib/feature/globalSelection/eventHub/globalSelectionEventHubActions.d.ts +6 -0
- package/src/lib/feature/globalSelection/eventHub/globalSelectionEventHubEvents.d.ts +11 -0
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +21 -1
- package/src/lib/feature/globalSelection/index.d.ts +1 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeAllItemsById.action.d.ts +16 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +3 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +33 -7
- package/src/lib/types/eventTypes/plantEvent.d.ts +5 -0
- package/src/lib/components/prepview/utils/workorder.d.ts +0 -1
- package/src/lib/components/prepview/workorder/pm15/PM15WorkOrder.d.ts +0 -6
- package/src/lib/components/prepview/workorder/pm15/equipment/WOEquipment.d.ts +0 -5
- package/src/lib/components/prepview/workorder/pm15/equipment/WOEquipmentHorizontal.d.ts +0 -6
- package/src/lib/components/prepview/workorder/pm15/equipment/WOEquipmentVertical.d.ts +0 -6
- package/src/lib/components/prepview/workorder/pm15/equipment/equipmentHelper.d.ts +0 -18
- package/src/lib/components/prepview/workorder/pm15/equipment/index.d.ts +0 -1
- package/src/lib/components/prepview/workorder/pm15/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SideSheetOrientation, WorkOrderDateType } from '@equinor/echo-components';
|
|
3
|
+
import { SEBadgeType, SNBadgeType, WoBadgeType } from './colors';
|
|
3
4
|
import { Coordinates, HistoricNotificationItem, HistoricPunchItem, HistoricWorkOrderItem, ItemTypes, WorkOrderEquipment } from './types';
|
|
4
5
|
import { WorkItemType } from './utils';
|
|
5
|
-
import { SEBadgeType, SNBadgeType, WoBadgeType } from './colors';
|
|
6
6
|
interface PrepviewProps {
|
|
7
7
|
orientation: SideSheetOrientation;
|
|
8
8
|
headerAction?: React.ReactNode;
|
|
@@ -25,5 +25,5 @@ interface PrepviewProps {
|
|
|
25
25
|
}
|
|
26
26
|
declare function Prepview(props: PrepviewProps): JSX.Element | null;
|
|
27
27
|
export * from './types/shared';
|
|
28
|
-
export {
|
|
28
|
+
export { WorkItemType } from './utils';
|
|
29
29
|
export { Prepview };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WorkOrderDateType } from '@equinor/echo-components';
|
|
2
2
|
interface WorkOrderProps {
|
|
3
|
-
workOrderId: string;
|
|
4
|
-
headerAction?: React.ReactNode;
|
|
5
|
-
workOrderDateType?: WorkOrderDateType;
|
|
3
|
+
readonly workOrderId: string;
|
|
4
|
+
readonly headerAction?: React.ReactNode;
|
|
5
|
+
readonly workOrderDateType?: WorkOrderDateType;
|
|
6
6
|
}
|
|
7
|
-
declare
|
|
8
|
-
export {
|
|
7
|
+
export declare const WorkOrder: React.FC<WorkOrderProps>;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface PrepviewButtonProps {
|
|
3
|
-
workOrderId?: string
|
|
4
|
-
notificationId?: string
|
|
5
|
-
punchId?: string
|
|
6
|
-
instCode?: string
|
|
3
|
+
workOrderId?: string;
|
|
4
|
+
notificationId?: string;
|
|
5
|
+
punchId?: string;
|
|
6
|
+
instCode?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const PrepviewButton: React.FC<PrepviewButtonProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OpenRemoveSelectionItemsConfirmDialogEvent } from './globalSelectionEventHubEvents';
|
|
2
|
+
/**
|
|
3
|
+
* Emit a statuses for item type event on echo core eventHub with a specific payload.
|
|
4
|
+
* @param {OpenRemoveSelectionItemsConfirmDialogEvent} payload
|
|
5
|
+
*/
|
|
6
|
+
export declare const emitOpenRemoveSelectionItemsConfirmDialog: (payload: OpenRemoveSelectionItemsConfirmDialogEvent) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
export interface OpenRemoveSelectionItemsConfirmDialogEvent {
|
|
4
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
5
|
+
affectedGroups: {
|
|
6
|
+
id: Guid;
|
|
7
|
+
label: string;
|
|
8
|
+
subLabel?: string;
|
|
9
|
+
}[];
|
|
10
|
+
onDialogConfirm: () => void;
|
|
11
|
+
}
|
|
@@ -35,6 +35,18 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
35
35
|
categoryId: GlobalSelectionCategoryId;
|
|
36
36
|
itemIds: GlobalSelectionTypes.ItemId[];
|
|
37
37
|
}) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Removes all items by their IDs, from all groups, from the state.
|
|
40
|
+
*
|
|
41
|
+
* If the given item ids are in more than one group, then a confirmation dialog will be shown to confirm the action.
|
|
42
|
+
*
|
|
43
|
+
* @param {Object} args - The arguments object.
|
|
44
|
+
* @param {GlobalSelectionTypes.ItemId[]} args.itemIds - The array of item IDs to remove.
|
|
45
|
+
* @returns {void}
|
|
46
|
+
*/
|
|
47
|
+
allItemsById: (args: {
|
|
48
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
49
|
+
}) => void;
|
|
38
50
|
/**
|
|
39
51
|
* Removes a group or category by ID from the selection store.
|
|
40
52
|
*
|
|
@@ -89,7 +101,15 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
89
101
|
*
|
|
90
102
|
*/
|
|
91
103
|
addItems: (args: {
|
|
92
|
-
groupId
|
|
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;
|
|
93
113
|
itemIds: (GlobalSelectionTypes.TagId | import("./globalSelectionStore/globalSelectionStore.types").OptimizedWorkOrderDto)[];
|
|
94
114
|
}) => void;
|
|
95
115
|
}>;
|
|
@@ -9,4 +9,5 @@ export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrde
|
|
|
9
9
|
export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesByGroupId';
|
|
10
10
|
export { OpenGlobalSelectionIn3DButton } from './OpenGlobalSelectionIn3DButton';
|
|
11
11
|
export { useSelectionMenuGroups } from './selectionMenu/hooks/useSelectionMenuGroups';
|
|
12
|
+
export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
|
|
12
13
|
export * from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WritableDraft } from 'immer';
|
|
2
|
+
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
import { SelectionTreeStore } from '../selectionTree.store.types';
|
|
4
|
+
type SetFunction = (set: (state: WritableDraft<SelectionTreeStore>) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Removes all items by their IDs, from all groups, from the state.
|
|
7
|
+
*
|
|
8
|
+
* @param {SetFunction} set - The function to update the state.
|
|
9
|
+
* @param {Object} args - The arguments object.
|
|
10
|
+
* @param {GlobalSelectionTypes.ItemId[]} args.itemIds - The array of item IDs to remove.
|
|
11
|
+
* @returns {void}
|
|
12
|
+
*/
|
|
13
|
+
export declare function removeAllItemsById(set: SetFunction, args: {
|
|
14
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
15
|
+
}): void;
|
|
16
|
+
export {};
|
|
@@ -66,6 +66,9 @@ export interface SelectionTreeStore {
|
|
|
66
66
|
categoryId: GlobalSelectionCategoryId;
|
|
67
67
|
itemIds: GlobalSelectionTypes.ItemId[];
|
|
68
68
|
}) => void;
|
|
69
|
+
removeAllItemsById: (args: {
|
|
70
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
71
|
+
}) => void;
|
|
69
72
|
setVisibilityById: (args: {
|
|
70
73
|
groupId: Guid;
|
|
71
74
|
categoryId?: GlobalSelectionCategoryId;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
2
|
import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
import { GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionTree.store.types';
|
|
4
|
+
import { WritableDraft } from 'immer';
|
|
4
5
|
/**
|
|
5
6
|
* Check if an item ID is present in the selection tree.
|
|
6
7
|
*
|
|
@@ -53,18 +54,43 @@ export declare function itemsNotFoundInSelectionTree(args: {
|
|
|
53
54
|
itemIds: GlobalSelectionTypes.ItemId[];
|
|
54
55
|
}): GlobalSelectionTypes.ItemId[];
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
+
* Get an array of group IDs where any of the item IDs are found.
|
|
57
58
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* @param args
|
|
62
|
-
* @param args.
|
|
63
|
-
* @
|
|
59
|
+
* This function searches through the selection tree groups and returns an array of group IDs
|
|
60
|
+
* where any of the specified item IDs are found.
|
|
61
|
+
*
|
|
62
|
+
* @param {Object} args - The function arguments.
|
|
63
|
+
* @param {GlobalSelectionTypes.ItemId[]} args.itemIds - The array of item IDs to search for.
|
|
64
|
+
* @param {SelectionTreeTypes.Group[]} args.groups - The selection tree groups to search within.
|
|
65
|
+
* @returns {string[]} An array of group IDs, with labels and sublabels, where any of the item IDs are found.
|
|
64
66
|
*/
|
|
67
|
+
export declare function getGroupIdsByItemIds(args: {
|
|
68
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
69
|
+
groups: SelectionTreeTypes.Group[];
|
|
70
|
+
}): {
|
|
71
|
+
id: Guid;
|
|
72
|
+
label: string;
|
|
73
|
+
subLabel?: string;
|
|
74
|
+
}[];
|
|
65
75
|
export declare function areItemsTheSameInGroup(args: {
|
|
66
76
|
itemIds: GlobalSelectionTypes.TagId[];
|
|
67
77
|
groups: SelectionTreeTypes.Group[];
|
|
68
78
|
groupId: Guid;
|
|
69
79
|
categoryId: GlobalSelectionCategoryId;
|
|
70
80
|
}): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Removes an empty group from the list of groups, except if it's the local (default) selection.
|
|
83
|
+
*
|
|
84
|
+
* @param {WritableDraft<SelectionTreeTypes.Group[]>} allGroups - The list of all groups.
|
|
85
|
+
* @param {SelectionTreeTypes.Group} targetGroup - The group to check and potentially remove.
|
|
86
|
+
* @returns {void}
|
|
87
|
+
*/
|
|
88
|
+
export declare function removeGroupIfEmpty(allGroups: WritableDraft<SelectionTreeTypes.Group[]>, targetGroup: SelectionTreeTypes.Group): void;
|
|
89
|
+
/**
|
|
90
|
+
* Removes items from the global selection if they are not present in the tree store anymore.
|
|
91
|
+
*
|
|
92
|
+
* @param {SelectionTreeTypes.Group[]} groups - The list of groups in the selection tree.
|
|
93
|
+
* @param {GlobalSelectionTypes.ItemId[]} itemIds - The list of item IDs to be checked and potentially removed.
|
|
94
|
+
* @returns {void}
|
|
95
|
+
*/
|
|
96
|
+
export declare function removeItemsFromGlobalSelection(groups: SelectionTreeTypes.Group[], itemIds: GlobalSelectionTypes.ItemId[]): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MaintenanceApiNameForWorkOrders: Record<string, string>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WorkOrderEquipment } from '../../../types';
|
|
2
|
-
interface WOEquipmentHorizontalProps {
|
|
3
|
-
equipment: WorkOrderEquipment[];
|
|
4
|
-
}
|
|
5
|
-
declare function WOEquipmentHorizontal({ equipment }: WOEquipmentHorizontalProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export { WOEquipmentHorizontal };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WorkOrderEquipment } from '../../../types';
|
|
2
|
-
interface WOEquipmentVerticalProps {
|
|
3
|
-
equipment: WorkOrderEquipment[];
|
|
4
|
-
}
|
|
5
|
-
declare function WOEquipmentVertical({ equipment }: WOEquipmentVerticalProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export { WOEquipmentVertical };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ColorMap } from "@equinor/echo-components";
|
|
2
|
-
import { EquipmentStatus } from "../../../types";
|
|
3
|
-
/**
|
|
4
|
-
* EquipmentTitleRow determines if the primary row of the Equipment ListItem shall have icons or not
|
|
5
|
-
*/
|
|
6
|
-
interface EquipmentTitleRowProps {
|
|
7
|
-
equipmentId: string;
|
|
8
|
-
compact?: boolean;
|
|
9
|
-
notificationStatus?: EquipmentStatus;
|
|
10
|
-
equipmentStatus?: EquipmentStatus;
|
|
11
|
-
certificateStatus?: EquipmentStatus;
|
|
12
|
-
}
|
|
13
|
-
export declare function EquipmentTitleRow({ equipmentId, compact, notificationStatus, equipmentStatus, certificateStatus, }: EquipmentTitleRowProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
/**
|
|
15
|
-
* Used to display the visual for equipment items
|
|
16
|
-
*/
|
|
17
|
-
export declare function displayEquipmentVisual(colorMap?: ColorMap, compact?: boolean): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './WOEquipment';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PM15WorkOrder';
|