@equinor/echo-framework 0.23.2 → 0.23.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 +8 -2
- package/package.json +6 -5
- package/src/index.d.ts +2 -2
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/components/plantSelector/plantSelector.d.ts +2 -2
- package/src/lib/components/plantSelector/plantSelectorHelper.d.ts +4 -3
- package/src/lib/components/prepview/notification/header/NotificationHeader.d.ts +1 -1
- package/src/lib/components/searchListItem/searchListItem.d.ts +86 -0
- package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemHeader.d.ts +2 -2
- package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemSubHeader.d.ts +2 -4
- package/src/lib/feature/equipment/components/equipmentItemHeader/linkToSapEquipment.d.ts +2 -2
- package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts +3 -4
- package/src/lib/feature/equipment/components/equipmentItemInfo/equipmentItemInfo.d.ts +2 -2
- package/src/lib/feature/equipment/components/equipmentListItem.d.ts +9 -4
- package/src/lib/feature/equipment/components/equipmentTabs/equipmentTabs.d.ts +2 -2
- package/src/lib/feature/equipment/components/fullEquipmentItem/fullEquipmentItem.d.ts +2 -2
- package/src/lib/feature/equipment/hooks/useOpenEquipmentDetails.d.ts +2 -2
- package/src/lib/feature/equipment/utils/equipmentUtils.d.ts +2 -2
- package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +1 -2
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +5 -19
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addEquipmentsToSelection.action.d.ts +6 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/{addItemsToSelection.action.d.ts → addItemsToSelectionFactory.d.ts} +6 -2
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +7 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addWorkOrdersToSelection.action.d.ts +6 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +8 -2
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullEquipment.d.ts +2 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullTag.d.ts +2 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullWorkOrder.d.ts +3 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addEquipments.action.d.ts +3 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTags.action.d.ts +2 -12
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addWorkOrders.action.d.ts +1 -4
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/createAddItemsFactory.d.ts +1 -4
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/initialData.d.ts +1 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +6 -12
- package/src/lib/feature/hooks/useAddTagToLegendRegistry.d.ts +2 -2
- package/src/lib/utils/highlightTextUtil.d.ts +26 -0
- package/src/lib/utils/index.d.ts +1 -0
- package/src/lib/utils/stringUtils.d.ts +5 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionNullItems.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.3",
|
|
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",
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
19
|
"react-router-dom": "5.3.4",
|
|
20
20
|
"zustand": ">= 4.4.7 < 5",
|
|
21
|
-
"immer": "10.1.1"
|
|
22
|
-
"ag-charts-react": ">= 11.1.1 < 12.0.0",
|
|
23
|
-
"ag-charts-community": ">= 11.1.1 < 12.0.0"
|
|
21
|
+
"immer": "10.1.1"
|
|
24
22
|
},
|
|
25
23
|
"dependencies": {
|
|
26
|
-
"dexie": "4.0.11"
|
|
24
|
+
"dexie": "4.0.11",
|
|
25
|
+
"mark.js": "8.11.1",
|
|
26
|
+
"ag-charts-community": "11.2.4",
|
|
27
|
+
"ag-charts-react": "11.2.4"
|
|
27
28
|
},
|
|
28
29
|
"main": "./index.cjs.js",
|
|
29
30
|
"type": "commonjs",
|
package/src/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export * from './lib/feature/globalSelection';
|
|
|
14
14
|
export { SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
|
|
15
15
|
export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3DButton';
|
|
16
16
|
export { useIsAllIGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllIGlobalSelectionItemsHidden';
|
|
17
|
-
export { GlobalSelectionCategoryId
|
|
17
|
+
export { GlobalSelectionCategoryId } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
18
18
|
export * from './lib/feature/legacyLegend/index';
|
|
19
19
|
export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
|
|
20
20
|
export * from './lib/feature/legend/index';
|
|
@@ -47,7 +47,7 @@ export type { EchoHubPlant } from './lib/types/echoHubPlant';
|
|
|
47
47
|
export * from './lib/types/eventTypes';
|
|
48
48
|
export * from './lib/types/extensions';
|
|
49
49
|
export type { BucketPanelKey, BucketSourceKey } from './lib/types/grid/bucketSideDrawer.types';
|
|
50
|
-
export type { SetActiveTagNo, TagData } from './lib/types/hookLibrary';
|
|
50
|
+
export type { SetActiveCommPackNo, SetActiveMcPackNo, SetActiveTagNo, TagData } from './lib/types/hookLibrary';
|
|
51
51
|
export type { ModelPermissions } from './lib/types/modelPermissions';
|
|
52
52
|
export { InternalApplicationLinks } from './lib/types/navigation/internalApplicationLinks';
|
|
53
53
|
export { PingableSources } from './lib/types/pingableSources';
|
|
@@ -21,6 +21,7 @@ export * from './prepviewButton/prepviewButton';
|
|
|
21
21
|
export * from './projectSelector';
|
|
22
22
|
export * from './realTimeData';
|
|
23
23
|
export * from './router';
|
|
24
|
+
export { SearchListItem } from './searchListItem/searchListItem';
|
|
24
25
|
export * from './searchMenu';
|
|
25
26
|
export * from './spinner/spinner';
|
|
26
27
|
export * from './tagNumber';
|
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Dropdown component for displaying a searchable plant selector.
|
|
4
4
|
* @param {PlantSelectorProps} {
|
|
5
|
-
* variant: The style type for the dropdown component. Either default or compact.
|
|
6
5
|
* isDisabled: Flag which decides whether the dropdown should be disabled or not.
|
|
7
6
|
* stayOnPath: Flag which decides if you should stay on your current path after selecting a plant.
|
|
7
|
+
* textSize: Size of the text in the dropdown. Can be 'small', 'medium' or 'large'.
|
|
8
|
+
* noneBackground: Flag which decides if the background of the dropdown should be transparent or not.
|
|
8
9
|
* }
|
|
9
10
|
* @return {*}
|
|
10
11
|
*/
|
|
@@ -13,7 +14,6 @@ interface PlantSelectorProps {
|
|
|
13
14
|
stayOnPath?: boolean;
|
|
14
15
|
textSize?: 'small' | 'medium' | 'large';
|
|
15
16
|
noneBackground?: boolean;
|
|
16
|
-
autoWidth?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare const PlantSelector: React.FC<PlantSelectorProps>;
|
|
19
19
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Plant } from '@equinor/echo-core';
|
|
2
|
-
export
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
2
|
+
export type MinimalPlant = Pick<Plant, 'instCode' | 'description' | 'sapPlantId'>;
|
|
3
|
+
export declare function filterPlant(plant: MinimalPlant, inputValue: string): boolean;
|
|
4
|
+
export declare function formatPlantOptionText(plantName: string, plantId: string | null): string;
|
|
5
|
+
export declare function handleAutoSelectOnFocus(autocompleteRef: React.RefObject<HTMLDivElement>): void;
|
|
@@ -3,5 +3,5 @@ interface NotificationHeaderProps {
|
|
|
3
3
|
notificationDetails: NotificationDetails;
|
|
4
4
|
headerAction?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare function NotificationHeader({ notificationDetails, headerAction
|
|
6
|
+
declare function NotificationHeader({ notificationDetails, headerAction }: NotificationHeaderProps): JSX.Element | null;
|
|
7
7
|
export { NotificationHeader };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SearchListItem component renders a styled list item with optional visual or icon, title, subtitle, and other customizable properties.
|
|
4
|
+
*
|
|
5
|
+
* @param {SearchListItemProps} props - The properties for the SearchListItem component.
|
|
6
|
+
* @returns {JSX.Element} The rendered SearchListItem component.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SearchListItem: React.FC<SearchListItemProps>;
|
|
9
|
+
interface VisualComponent {
|
|
10
|
+
icon?: never;
|
|
11
|
+
visual?: {
|
|
12
|
+
label: string;
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
textColor: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface IconOptions {
|
|
18
|
+
icon?: {
|
|
19
|
+
name: string;
|
|
20
|
+
color?: string;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
};
|
|
23
|
+
visual?: never;
|
|
24
|
+
}
|
|
25
|
+
type WithVisualOrIconOptions = VisualComponent | IconOptions;
|
|
26
|
+
type BaseProps = {
|
|
27
|
+
title: string;
|
|
28
|
+
subTitle?: string | React.ReactNode;
|
|
29
|
+
tertiary?: string | React.ReactNode;
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
className?: string;
|
|
32
|
+
cardClassName?: string;
|
|
33
|
+
hideActions?: boolean;
|
|
34
|
+
hideBorder?: boolean;
|
|
35
|
+
isHighlightable?: boolean;
|
|
36
|
+
itemActions?: React.ReactNode;
|
|
37
|
+
footer?: React.ReactNode;
|
|
38
|
+
};
|
|
39
|
+
type SearchListItemProps = BaseProps & WithVisualOrIconOptions;
|
|
40
|
+
export {};
|
|
41
|
+
/**
|
|
42
|
+
* Base properties for the SearchListItem component.
|
|
43
|
+
*
|
|
44
|
+
* @typedef {Object} BaseProps
|
|
45
|
+
* @property {string} title - The primary title of the list item.
|
|
46
|
+
* @property {string | React.ReactNode} [subTitle] - The secondary subtitle of the list item.
|
|
47
|
+
* @property {string | React.ReactNode} [tertiary] - The tertiary content of the list item.
|
|
48
|
+
* @property {() => void} [onClick] - Callback function triggered when the list item is clicked.
|
|
49
|
+
* @property {string} [className] - Additional CSS class for the list item wrapper.
|
|
50
|
+
* @property {string} [cardClassName] - Additional CSS class for the card element.
|
|
51
|
+
* @property {boolean} [hideActions] - Whether to hide the item actions.
|
|
52
|
+
* @property {boolean} [hideBorder] - Whether to hide the bottom border of the list item.
|
|
53
|
+
* @property {boolean} [isHighlightable] - Whether the text is highlightable.
|
|
54
|
+
* @property {React.ReactNode} [itemActions] - Custom actions to display in the list item.
|
|
55
|
+
* @property {React.ReactNode} [footer] - Footer content for the list item.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Visual component properties for the SearchListItem component.
|
|
59
|
+
*
|
|
60
|
+
* @typedef {Object} VisualComponent
|
|
61
|
+
* @property {Object} visual - Visual properties for the list item.
|
|
62
|
+
* @property {string} visual.label - The label text for the visual.
|
|
63
|
+
* @property {string} visual.backgroundColor - The background color for the visual.
|
|
64
|
+
* @property {string} visual.textColor - The text color for the visual.
|
|
65
|
+
* @property {never} [icon] - Icon should not be used when visual is provided.
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Icon options for the SearchListItem component.
|
|
69
|
+
*
|
|
70
|
+
* @typedef {Object} IconOptions
|
|
71
|
+
* @property {Object} icon - Icon properties for the list item.
|
|
72
|
+
* @property {string} icon.name - The name of the icon.
|
|
73
|
+
* @property {string} [icon.color] - The color of the icon.
|
|
74
|
+
* @property {string} [icon.backgroundColor] - The background color of the icon.
|
|
75
|
+
* @property {never} [visual] - Visual should not be used when icon is provided.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Combined type for either visual or icon options.
|
|
79
|
+
*
|
|
80
|
+
* @typedef {VisualComponent | IconOptions} WithVisualOrIconOptions
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Props for the SearchListItem component.
|
|
84
|
+
*
|
|
85
|
+
* @typedef {BaseProps & WithVisualOrIconOptions} SearchListItemProps
|
|
86
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
2
|
interface EquipmentItemHeaderProps {
|
|
3
|
-
|
|
3
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'equipmentDescription'>;
|
|
4
4
|
}
|
|
5
5
|
export declare const EquipmentItemHeader: React.FC<EquipmentItemHeaderProps>;
|
|
6
6
|
export {};
|
package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemSubHeader.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
2
|
interface EquipmentItemSubHeaderProps {
|
|
3
|
-
|
|
4
|
-
tagNo: string;
|
|
5
|
-
plantNo: string;
|
|
3
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'e3DRef' | 'categoryId' | 'tagId' | 'tagPlantId'>;
|
|
6
4
|
}
|
|
7
5
|
export declare const EquipmentItemSubHeader: React.FC<EquipmentItemSubHeaderProps>;
|
|
8
6
|
export {};
|
package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
2
|
interface ShowEquipmentIn3DButtonArgs {
|
|
3
|
-
|
|
4
|
-
tagNo: string;
|
|
3
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'e3DRef' | 'tagId'>;
|
|
5
4
|
}
|
|
6
|
-
export declare const ShowEquipmentIn3DButton: ({
|
|
5
|
+
export declare const ShowEquipmentIn3DButton: ({ equipmentProps }: ShowEquipmentIn3DButtonArgs) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { Equipment } from '../../types/equipment';
|
|
3
3
|
interface EquipmentItemInfoProps {
|
|
4
4
|
equipment: Equipment;
|
|
5
|
-
tagNo: string;
|
|
6
|
-
plantNo: string;
|
|
5
|
+
tagNo: string | undefined;
|
|
6
|
+
plantNo: string | undefined;
|
|
7
7
|
}
|
|
8
8
|
export declare const EquipmentItemInfo: React.FC<EquipmentItemInfoProps>;
|
|
9
9
|
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { Equipment } from '../types/equipment';
|
|
3
3
|
interface EquipmentListItemProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
equipmentProps: Pick<EquipmentData, 'equipmentId' | 'tagId' | 'tagPlantId' | 'equipmentDescription' | 'partType'>;
|
|
5
|
+
className?: string;
|
|
6
|
+
cardClassName?: string;
|
|
7
|
+
hideActions?: boolean;
|
|
8
|
+
hideBorder?: boolean;
|
|
9
|
+
isHighlightable?: boolean;
|
|
10
|
+
itemActions?: React.ReactNode;
|
|
11
|
+
footer?: React.ReactNode;
|
|
7
12
|
}
|
|
8
13
|
export declare const EquipmentListItem: React.FC<EquipmentListItemProps>;
|
|
9
14
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Equipment } from '../../types/equipment';
|
|
2
2
|
interface EquipmentTabsProps {
|
|
3
3
|
equipment: Equipment;
|
|
4
|
-
tagNo: string;
|
|
5
|
-
plantNo: string;
|
|
4
|
+
tagNo: string | undefined;
|
|
5
|
+
plantNo: string | undefined;
|
|
6
6
|
}
|
|
7
7
|
export declare const EquipmentTabs: React.FC<EquipmentTabsProps>;
|
|
8
8
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Link } from '@equinor/echo-core';
|
|
2
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
3
|
import { MeasuringPointDto } from '../../measuringPoint';
|
|
3
|
-
import { Equipment } from '../types/equipment';
|
|
4
4
|
interface OpenMeasuringPointsArgs {
|
|
5
5
|
equipmentId: string;
|
|
6
6
|
e3dRef: string;
|
|
@@ -10,7 +10,7 @@ interface OpenMeasuringPointsArgs {
|
|
|
10
10
|
tagNo: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const openEquipmentIn3dWeb: ({ equipmentId, e3dRef, goToLink, pathname, instCode, tagNo }: OpenMeasuringPointsArgs) => Promise<void>;
|
|
13
|
-
export declare const is3DEquipment: (
|
|
13
|
+
export declare const is3DEquipment: (equipmentProps: Partial<Pick<EquipmentData, "e3DRef" | "categoryId">>) => boolean;
|
|
14
14
|
export declare const sortMeasurementsInMeasuringPointsByNewestFirst: (measuringPoints: MeasuringPointDto[]) => {
|
|
15
15
|
measurements: import("../../measuringPoint").MeasurementDto[];
|
|
16
16
|
measuringPointId: string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
-
import { GlobalSelectionCategoryId } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
3
2
|
export interface SelectionActionBarProps {
|
|
4
3
|
itemId: GlobalSelectionTypes.ItemId;
|
|
5
|
-
|
|
4
|
+
onAddItemClick: () => void;
|
|
6
5
|
className?: string;
|
|
7
6
|
}
|
|
8
7
|
export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { GlobalSelectionTypes } from './globalSelectionStore/globalSelectionStore.types';
|
|
2
|
-
import {
|
|
3
|
-
import { AddTagsReturnType, GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
4
|
-
type AddTagsType = <T extends boolean | undefined = undefined>(args: AddItemArgs<GlobalSelectionTypes.TagId> & {
|
|
5
|
-
getActionResult?: T;
|
|
6
|
-
}) => Promise<AddTagsReturnType<T>>;
|
|
2
|
+
import { GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionMenu/selectionTreeStore/selectionTree.store.types';
|
|
7
3
|
export declare const globalSelectionApi: Readonly<{
|
|
8
4
|
/**
|
|
9
5
|
* @deprecated Use globalSelectionApi.remove.itemsById() instead
|
|
@@ -59,15 +55,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
59
55
|
*/
|
|
60
56
|
listById: (args: {
|
|
61
57
|
groupId: import("dist/libs/echo-utils/src").Guid;
|
|
62
|
-
categoryId
|
|
63
|
-
* Removes all items by their IDs, from all groups, from the state.
|
|
64
|
-
*
|
|
65
|
-
* If the given item ids are in more than one group, then a confirmation dialog will be shown to confirm the action.
|
|
66
|
-
*
|
|
67
|
-
* @param {Object} args - The arguments object.
|
|
68
|
-
* @param {GlobalSelectionTypes.ItemId[]} args.itemIds - The array of item IDs to remove.
|
|
69
|
-
* @returns {void}
|
|
70
|
-
*/: GlobalSelectionCategoryId;
|
|
58
|
+
categoryId?: GlobalSelectionCategoryId;
|
|
71
59
|
}) => void;
|
|
72
60
|
}>;
|
|
73
61
|
add: Readonly<{
|
|
@@ -78,8 +66,6 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
78
66
|
* @param {AddItemArgs} args - The arguments for adding tags.
|
|
79
67
|
* @param {Array<string>} args.itemIds - The IDs of the items to add tags to.
|
|
80
68
|
* @param {boolean} [args.replaceItems=false] - Whether to replace existing items with the new tags.
|
|
81
|
-
* @param {boolean} [args.getActionResult] - Optional, temporary. Will be removed. When passed the function will return with the actionResult as well.
|
|
82
|
-
* Otherwise it just returns with ResultArray<TagSummaryDto>[]>.
|
|
83
69
|
* @returns {Promise<AddTagsResponse>} response The response of the add tags action.
|
|
84
70
|
* @returns {Array<Object>} response.tagFetchResults - The results of the tag fetch operation.
|
|
85
71
|
* @returns {string} response.actionResult - The result of the action, if 'getActionResult' is set to true. It can be the following:
|
|
@@ -88,7 +74,7 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
88
74
|
* - 'ItemsUpdated': Existing items were replaced with new tags.
|
|
89
75
|
* - 'ItemsAdded': New tags were added to the existing items.
|
|
90
76
|
*/
|
|
91
|
-
tags:
|
|
77
|
+
tags: (args: import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.TagId>) => Promise<import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemsResponse<import("dist/libs/echo-search/src").ResultArray<import("dist/libs/echo-search/src").TagSummaryDto>[]>>;
|
|
92
78
|
/**
|
|
93
79
|
* Adds work orders to a specified list in the selection menu panel.
|
|
94
80
|
*
|
|
@@ -96,7 +82,8 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
96
82
|
* @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".
|
|
97
83
|
* @param {Readonly<Readonly<GlobalSelectionTypes.WorkOrderId>[]>} args.items - An array of WorkOrderId objects representing the work orders to be added.
|
|
98
84
|
*/
|
|
99
|
-
workOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) =>
|
|
85
|
+
workOrders: (args: import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => Promise<import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemsResponse<import("dist/libs/echo-search/src").ResultArray<import("dist/libs/echo-search/src").WorkOrderData>[]>>;
|
|
86
|
+
equipments: (args: import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.EquipmentId>) => Promise<import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemsResponse<import("dist/libs/echo-search/src").ResultArray<import("dist/libs/echo-search/src").EquipmentData>[]>>;
|
|
100
87
|
/**
|
|
101
88
|
* Adds items to a specified list in the selection menu panel.
|
|
102
89
|
*
|
|
@@ -201,4 +188,3 @@ export declare const globalSelectionApi: Readonly<{
|
|
|
201
188
|
subLabel: string;
|
|
202
189
|
}) => import("dist/libs/echo-utils/src").Guid;
|
|
203
190
|
}>;
|
|
204
|
-
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const addEquipmentsToSelectionAction: (set: (set: (state: import("../globalSelectionStore.types").GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../globalSelectionStore.types").GlobalSelectionStore>["getState"], args: {
|
|
2
|
+
itemIds: import("../globalSelectionStore.types").GlobalSelectionTypes.EquipmentId[];
|
|
3
|
+
}) => Promise<{
|
|
4
|
+
fetchResult: import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").EquipmentData>[];
|
|
5
|
+
actionResult: import("../globalSelectionStore.types").GlobalSelectionTypes.ActionResult;
|
|
6
|
+
}>;
|
|
@@ -9,9 +9,13 @@ type ItemIdTypeMap = {
|
|
|
9
9
|
[GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
|
|
10
10
|
};
|
|
11
11
|
type SetFunction = (set: (state: GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function addItemsToSelectionFactory<T extends GlobalSelectionItemType>(args: {
|
|
13
|
+
itemType: T;
|
|
14
|
+
fetchFunction: FetchFunction<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>;
|
|
15
|
+
nullItemGenerator: NullItemGenerator<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>;
|
|
16
|
+
}): (set: SetFunction, get: StoreApi<GlobalSelectionStore>["getState"], args: {
|
|
13
17
|
itemIds: ItemIdTypeMap[T][];
|
|
14
|
-
}
|
|
18
|
+
}) => Promise<{
|
|
15
19
|
fetchResult: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
|
|
16
20
|
actionResult: GlobalSelectionTypes.ActionResult;
|
|
17
21
|
}>;
|
package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../globalSelectionStore.types';
|
|
2
|
+
export declare const addTagsToSelectionAction: (set: (set: (state: import("../globalSelectionStore.types").GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../globalSelectionStore.types").GlobalSelectionStore>["getState"], args: {
|
|
3
|
+
itemIds: GlobalSelectionTypes.TagId[];
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
fetchResult: import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").TagSummaryDto>[];
|
|
6
|
+
actionResult: GlobalSelectionTypes.ActionResult;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const addWorkOrdersToSelectionAction: (set: (set: (state: import("../globalSelectionStore.types").GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../globalSelectionStore.types").GlobalSelectionStore>["getState"], args: {
|
|
2
|
+
itemIds: import("../globalSelectionStore.types").GlobalSelectionTypes.WorkOrderId[];
|
|
3
|
+
}) => Promise<{
|
|
4
|
+
fetchResult: import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").WorkOrderData>[];
|
|
5
|
+
actionResult: import("../globalSelectionStore.types").GlobalSelectionTypes.ActionResult;
|
|
6
|
+
}>;
|
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
|
|
1
|
+
import { EquipmentData, ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
|
|
2
2
|
import { Brand } from '@equinor/echo-utils';
|
|
3
3
|
import { Equipment } from '../../equipment';
|
|
4
4
|
export declare enum GlobalSelectionItemType {
|
|
@@ -8,10 +8,11 @@ export declare enum GlobalSelectionItemType {
|
|
|
8
8
|
}
|
|
9
9
|
type GlobalSelectionTagDto = TagSummaryDto;
|
|
10
10
|
type GlobalSelectionWorkOrderDto = WorkOrderData;
|
|
11
|
+
type GlobalSelectionEquipmentDto = EquipmentData;
|
|
11
12
|
export interface GlobalSelectionItemTypeToDataMap {
|
|
12
13
|
WorkOrder: GlobalSelectionWorkOrderDto;
|
|
13
14
|
Tag: GlobalSelectionTagDto;
|
|
14
|
-
Equipment:
|
|
15
|
+
Equipment: GlobalSelectionEquipmentDto;
|
|
15
16
|
}
|
|
16
17
|
type GlobalSelectionList<T extends GlobalSelectionItemType> = {
|
|
17
18
|
label: string;
|
|
@@ -52,6 +53,9 @@ export interface GlobalSelectionStore extends GlobalSelectionStoreData {
|
|
|
52
53
|
addTagsToSelection: (args: {
|
|
53
54
|
tagIds: GlobalSelectionTypes.TagId[];
|
|
54
55
|
}) => Promise<GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>>;
|
|
56
|
+
addEquipmentsToSelection: (args: {
|
|
57
|
+
equipmentIds: GlobalSelectionTypes.EquipmentId[];
|
|
58
|
+
}) => Promise<GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>>;
|
|
55
59
|
removeItemsFromSelection: (args: {
|
|
56
60
|
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
57
61
|
}) => void;
|
|
@@ -85,6 +89,7 @@ export declare namespace GlobalSelectionTypes {
|
|
|
85
89
|
type ItemIdString = Brand<string, 'ItemIdString'>;
|
|
86
90
|
type TagDto = GlobalSelectionTagDto;
|
|
87
91
|
type WorkOrderDto = GlobalSelectionWorkOrderDto;
|
|
92
|
+
type EquipmentDto = GlobalSelectionEquipmentDto;
|
|
88
93
|
type EquipmentItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Equipment>;
|
|
89
94
|
type WorkOrderItem = GlobalSelectionGenericItem<GlobalSelectionItemType.WorkOrder>;
|
|
90
95
|
type TagItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Tag>;
|
|
@@ -100,6 +105,7 @@ export declare namespace GlobalSelectionTypes {
|
|
|
100
105
|
type ListUnion = GlobalSelectionListUnion;
|
|
101
106
|
type ItemTypeToDataMap = GlobalSelectionItemTypeToDataMap;
|
|
102
107
|
type AddTagResult = GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>;
|
|
108
|
+
type AddEquipmentsResult = GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>;
|
|
103
109
|
type ActionResult = GlobalSelectionActionResult;
|
|
104
110
|
type ItemSystemStatus = SelectionItemSystemStatus;
|
|
105
111
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EquipmentData } from '@equinor/echo-search';
|
|
2
|
+
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
3
|
+
export declare const addEquipmentsAction: (set: (set: (state: 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.EquipmentId>) => Promise<import("./selectionTree.action.types").AddItemsResponse<import("@equinor/echo-search").ResultArray<EquipmentData>[]>>;
|
package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTags.action.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { StoreApi } from 'zustand';
|
|
1
|
+
import { TagSummaryDto } from '@equinor/echo-search';
|
|
3
2
|
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
4
|
-
|
|
5
|
-
import { AddItemArgs, AddItemsResponse } from './selectionTree.action.types';
|
|
6
|
-
type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
7
|
-
export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddItemArgs<GlobalSelectionTypes.TagId> & {
|
|
8
|
-
getActionResult: true;
|
|
9
|
-
}): Promise<AddItemsResponse<ResultArray<TagSummaryDto>[]>>;
|
|
10
|
-
export declare function addTagsAction(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], args: AddItemArgs<GlobalSelectionTypes.TagId> & {
|
|
11
|
-
getActionResult?: false;
|
|
12
|
-
}): Promise<ResultArray<TagSummaryDto>[]>;
|
|
13
|
-
export {};
|
|
3
|
+
export declare const addTagsAction: (set: (set: (state: 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.TagId>) => Promise<import("./selectionTree.action.types").AddItemsResponse<import("@equinor/echo-search").ResultArray<TagSummaryDto>[]>>;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { WorkOrderData } from '@equinor/echo-search';
|
|
2
2
|
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
3
|
-
export declare const addWorkOrdersAction: (set: (set: (state: 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<
|
|
4
|
-
fetchResults: import("@equinor/echo-search").ResultArray<WorkOrderData>[][];
|
|
5
|
-
actionResult: string;
|
|
6
|
-
}>;
|
|
3
|
+
export declare const addWorkOrdersAction: (set: (set: (state: 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<WorkOrderData>[]>>;
|
|
@@ -9,8 +9,5 @@ export declare function addItemsActionFactory<G_ItemId extends GlobalSelectionTy
|
|
|
9
9
|
itemType: GlobalSelectionItemType;
|
|
10
10
|
itemCategory: GlobalSelectionCategoryId;
|
|
11
11
|
categoryOrderIndex: number;
|
|
12
|
-
}): (set: SetFunction, get: StoreApi<SelectionTreeStore>["getState"], args: AddItemArgs<G_ItemId>) => Promise<AddItemsResponse<ResultArray<
|
|
13
|
-
fetchResults: ResultArray<G_ResponseData>[][];
|
|
14
|
-
actionResult: string;
|
|
15
|
-
}>;
|
|
12
|
+
}): (set: SetFunction, get: StoreApi<SelectionTreeStore>["getState"], args: AddItemArgs<G_ItemId>) => Promise<AddItemsResponse<ResultArray<G_ResponseData>[]>>;
|
|
16
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
|
|
1
|
+
import { EquipmentData, ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
|
|
2
2
|
import { Guid } from '@equinor/echo-utils';
|
|
3
3
|
import { GlobalSelectionItemType, GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
4
4
|
import { AddByLabel, AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
|
|
@@ -9,14 +9,10 @@ export type SelectionItemTypeToItemIdMap = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare enum GlobalSelectionCategoryId {
|
|
11
11
|
Tags = "DEFAULT_TAG_LIST_ID",
|
|
12
|
-
WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID"
|
|
12
|
+
WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID",
|
|
13
|
+
Equipments = "DEFAULT_EQUIPMENT_LIST_ID"
|
|
13
14
|
}
|
|
14
15
|
export declare const globalSelectionDefaultGroupId: Guid;
|
|
15
|
-
/** @deprecated Use GlobalSelectionCategoryId instead */
|
|
16
|
-
export declare enum SelectionMenuDefaultListIds {
|
|
17
|
-
TagList = "DEFAULT_TAG_LIST_ID",
|
|
18
|
-
WorkOrderList = "DEFAULT_WORK_ORDER_LIST_ID"
|
|
19
|
-
}
|
|
20
16
|
export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
|
|
21
17
|
id: SelectionItemTypeToItemIdMap[T];
|
|
22
18
|
type: T;
|
|
@@ -48,13 +44,12 @@ export interface SelectionTreeData {
|
|
|
48
44
|
}
|
|
49
45
|
export interface SelectionTreeStore {
|
|
50
46
|
groups: SelectionGroup[];
|
|
51
|
-
addTags: <T extends boolean | undefined = undefined>(args: AddItemArgs<GlobalSelectionTypes.TagId> & {
|
|
52
|
-
getActionResult?: T;
|
|
53
|
-
}) => Promise<AddTagsReturnType<T>>;
|
|
54
|
-
addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => void;
|
|
55
47
|
addItems: (args: {
|
|
56
48
|
itemIds: GlobalSelectionTypes.ItemId[];
|
|
57
49
|
} & AddByLabel) => void;
|
|
50
|
+
addTags: (args: AddItemArgs<GlobalSelectionTypes.TagId>) => Promise<AddItemsResponse<ResultArray<TagSummaryDto>[]>>;
|
|
51
|
+
addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => Promise<AddItemsResponse<ResultArray<WorkOrderData>[]>>;
|
|
52
|
+
addEquipments: (args: AddItemArgs<GlobalSelectionTypes.EquipmentId>) => Promise<AddItemsResponse<ResultArray<EquipmentData>[]>>;
|
|
58
53
|
createGroup: (args: {
|
|
59
54
|
label: string;
|
|
60
55
|
subLabel: string;
|
|
@@ -86,4 +81,3 @@ export declare namespace SelectionTreeTypes {
|
|
|
86
81
|
type Group = SelectionGroup;
|
|
87
82
|
type ActionResult = SelectionTreeActionResult;
|
|
88
83
|
}
|
|
89
|
-
export type AddTagsReturnType<T extends boolean | undefined = undefined> = T extends true ? AddItemsResponse<ResultArray<TagSummaryDto>[]> : ResultArray<TagSummaryDto>[];
|
|
@@ -6,7 +6,7 @@ import { LegendItemStatus } from '../legacyLegend';
|
|
|
6
6
|
* Adds one given tag item to the legend registry service, which tracks the legend status of the registered items.
|
|
7
7
|
* Returns with the updated itemIdToStatusMap, which contains this newly added item by id as well.
|
|
8
8
|
*
|
|
9
|
-
* @param {string}
|
|
9
|
+
* @param {string} tagNo The given tag's id to be stored in the registry.
|
|
10
10
|
* @returns {Record<string, LegendItemStatus>} A legend status map: keys are the item ids, values are the legend statuses.
|
|
11
11
|
*/
|
|
12
|
-
export declare function useAddTagToLegendRegistry(
|
|
12
|
+
export declare function useAddTagToLegendRegistry(tagNo: string): Record<string, LegendItemStatus>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS class name to be added to components that should be highlightable.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* // Add this class to the `className` of a component to make it highlightable.
|
|
6
|
+
* <div className={highlightableComponentCssClass}>...</div>
|
|
7
|
+
*/
|
|
8
|
+
export declare const highlightableComponentCssClass = "highlightableComponentCssClass";
|
|
9
|
+
/**
|
|
10
|
+
* Highlights text within elements that have the `highlightableComponentCssClass` class.
|
|
11
|
+
*
|
|
12
|
+
* This function uses the `mark.js` library to highlight text matching the `search` query parameter
|
|
13
|
+
* in the URL. It applies the `highlightedText` CSS class to the matched text. The styling for
|
|
14
|
+
* `highlightedText` should be defined in `./public/index.css`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Add the following to a React component to enable text highlighting:
|
|
18
|
+
* useEffect(() => {
|
|
19
|
+
* highlightText();
|
|
20
|
+
* }, []);
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* - The `search` query parameter is retrieved using `getLinkParams` from `@equinor/echo-utils`.
|
|
24
|
+
* - Punctuation characters are ignored during the matching process.
|
|
25
|
+
*/
|
|
26
|
+
export declare const highlightText: () => void;
|