@equinor/echo-framework 0.23.1 → 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.
Files changed (61) hide show
  1. package/index.cjs.js +8 -2
  2. package/package.json +5 -2
  3. package/src/index.d.ts +2 -2
  4. package/src/lib/components/index.d.ts +1 -0
  5. package/src/lib/components/plantSelector/plantSelector.d.ts +2 -2
  6. package/src/lib/components/plantSelector/plantSelectorHelper.d.ts +4 -3
  7. package/src/lib/components/prepview/notification/header/NotificationHeader.d.ts +1 -1
  8. package/src/lib/components/searchListItem/searchListItem.d.ts +86 -0
  9. package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemHeader.d.ts +2 -2
  10. package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemSubHeader.d.ts +2 -4
  11. package/src/lib/feature/equipment/components/equipmentItemHeader/linkToSapEquipment.d.ts +2 -2
  12. package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts +3 -4
  13. package/src/lib/feature/equipment/components/equipmentItemInfo/equipmentItemInfo.d.ts +2 -2
  14. package/src/lib/feature/equipment/components/equipmentListItem.d.ts +9 -4
  15. package/src/lib/feature/equipment/components/equipmentTabs/equipmentTabs.d.ts +2 -2
  16. package/src/lib/feature/equipment/components/fullEquipmentItem/fullEquipmentItem.d.ts +2 -2
  17. package/src/lib/feature/equipment/hooks/useOpenEquipmentDetails.d.ts +2 -2
  18. package/src/lib/feature/equipment/utils/equipmentUtils.d.ts +11 -11
  19. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +1 -2
  20. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +5 -19
  21. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addEquipmentsToSelection.action.d.ts +6 -0
  22. package/src/lib/feature/globalSelection/globalSelectionStore/actions/{addItemsToSelection.action.d.ts → addItemsToSelectionFactory.d.ts} +6 -2
  23. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +7 -0
  24. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addWorkOrdersToSelection.action.d.ts +6 -0
  25. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +8 -2
  26. package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullEquipment.d.ts +2 -0
  27. package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullTag.d.ts +2 -0
  28. package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullWorkOrder.d.ts +3 -0
  29. package/src/lib/feature/globalSelection/panToEcho3d/panTo3DButton.d.ts +4 -2
  30. package/src/lib/feature/globalSelection/panToEcho3d/usePanTo3DWeb.d.ts +2 -2
  31. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addEquipments.action.d.ts +3 -0
  32. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTags.action.d.ts +2 -12
  33. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addWorkOrders.action.d.ts +1 -4
  34. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/createAddItemsFactory.d.ts +1 -4
  35. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +1 -0
  36. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/initialData.d.ts +1 -0
  37. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +6 -12
  38. package/src/lib/feature/hooks/useAddTagToLegendRegistry.d.ts +2 -2
  39. package/src/lib/feature/legend/legendUpdater.d.ts +1 -0
  40. package/src/lib/feature/legend/legendVisibleDataStore.d.ts +1 -0
  41. package/src/lib/feature/legend/types/legendType.d.ts +1 -1
  42. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/PointCountSelector.d.ts +15 -0
  43. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/graphStyleControls.d.ts +7 -0
  44. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/measuringHistoryGraphDialog.d.ts +8 -0
  45. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/measuringHistoryGraphTooltip.d.ts +2 -0
  46. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/viewInFullScreenButton.d.ts +5 -0
  47. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/hooks/useActiveStyleGraph.d.ts +5 -0
  48. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/hooks/useMeasuringChartConfig.d.ts +10 -0
  49. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringDocumentsHistoryGraph.d.ts +14 -0
  50. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringPointHistoryGraphSection.d.ts +6 -0
  51. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringPointHistoryItem.d.ts +6 -0
  52. package/src/lib/feature/measuringPoint/components/measuringPointDetails/{measuringPointHistoryList.d.ts → measuringPointHistoryList/measuringPointHistoryList.d.ts} +1 -1
  53. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/types/activeStyleType.d.ts +7 -0
  54. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/types/measuringDocumentsHistoryGraphType.d.ts +7 -0
  55. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/utils/createMeasuringChartConfig.d.ts +4 -0
  56. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/utils/measuringPointHistoryListUtils.d.ts +63 -0
  57. package/src/lib/feature/measuringPoint/types/measuringPoint.d.ts +2 -15
  58. package/src/lib/utils/highlightTextUtil.d.ts +26 -0
  59. package/src/lib/utils/index.d.ts +1 -0
  60. package/src/lib/utils/stringUtils.d.ts +5 -0
  61. 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.1",
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",
@@ -21,7 +21,10 @@
21
21
  "immer": "10.1.1"
22
22
  },
23
23
  "dependencies": {
24
- "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"
25
28
  },
26
29
  "main": "./index.cjs.js",
27
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, SelectionMenuDefaultListIds } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
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 declare const addSapPlantIdSuffix: (text: string, plantId?: string) => string;
3
- export declare const findPlant: (plants: Plant[], plantName: string) => Plant | undefined;
4
- export declare const filterPlants: (option: string, inputValue: string, plants: Plant[]) => boolean;
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, }: NotificationHeaderProps): JSX.Element | null;
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 { Equipment } from '../../types/equipment';
1
+ import { EquipmentData } from '@equinor/echo-search';
2
2
  interface EquipmentItemHeaderProps {
3
- equipment: Equipment;
3
+ equipmentProps: Pick<EquipmentData, 'equipmentId' | 'equipmentDescription'>;
4
4
  }
5
5
  export declare const EquipmentItemHeader: React.FC<EquipmentItemHeaderProps>;
6
6
  export {};
@@ -1,8 +1,6 @@
1
- import { Equipment } from '../../types/equipment';
1
+ import { EquipmentData } from '@equinor/echo-search';
2
2
  interface EquipmentItemSubHeaderProps {
3
- equipment: Equipment;
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 {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  interface LinkToSapEquipmentProps {
3
- plantNo: string;
4
- tagNo: string;
3
+ plantNo?: string;
4
+ tagNo?: string;
5
5
  }
6
6
  export declare const LinkToSapEquipment: React.FC<React.PropsWithChildren<LinkToSapEquipmentProps>>;
7
7
  export {};
@@ -1,7 +1,6 @@
1
- import { Equipment } from '../../types/equipment';
1
+ import { EquipmentData } from '@equinor/echo-search';
2
2
  interface ShowEquipmentIn3DButtonArgs {
3
- equipment: Equipment;
4
- tagNo: string;
3
+ equipmentProps: Pick<EquipmentData, 'equipmentId' | 'e3DRef' | 'tagId'>;
5
4
  }
6
- export declare const ShowEquipmentIn3DButton: ({ equipment, tagNo }: ShowEquipmentIn3DButtonArgs) => import("react/jsx-runtime").JSX.Element;
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
- equipment: Equipment;
5
- tagNo: string;
6
- plantNo: string;
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,7 +1,7 @@
1
1
  interface FullEquipmentItemProps {
2
2
  equipmentId: string;
3
- tagNo: string;
4
- plantNo: string;
3
+ tagNo: string | undefined;
4
+ plantNo: string | undefined;
5
5
  }
6
6
  export declare const FullEquipmentItem: React.FC<FullEquipmentItemProps>;
7
7
  export {};
@@ -4,8 +4,8 @@
4
4
  */
5
5
  export declare function useOpenEquipmentDetails(): (args: {
6
6
  equipmentId: string;
7
- tagNo: string;
8
- plantNo: string;
7
+ tagNo: string | undefined;
8
+ plantNo: string | undefined;
9
9
  panelKey?: string;
10
10
  keepLastNavigationItem?: boolean;
11
11
  }) => void;
@@ -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,22 +10,22 @@ 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: (equipment: Equipment) => boolean;
13
+ export declare const is3DEquipment: (equipmentProps: Partial<Pick<EquipmentData, "e3DRef" | "categoryId">>) => boolean;
14
14
  export declare const sortMeasurementsInMeasuringPointsByNewestFirst: (measuringPoints: MeasuringPointDto[]) => {
15
+ measurements: import("../../measuringPoint").MeasurementDto[];
15
16
  measuringPointId: string;
16
- measuringPosition?: string;
17
- measuringPoint?: string;
18
- functionalLocationId?: string;
19
- tagPlantId?: string;
20
- tagId?: string;
21
- equipmentId?: string;
22
- quantitativeCharacteristicId?: string;
23
- quantitativeCharacteristicUnit?: string;
17
+ measuringPosition: string;
18
+ measuringPoint: string;
19
+ functionalLocationId: string | undefined;
20
+ tagPlantId: string | undefined;
21
+ tagId: string | undefined;
22
+ equipmentId: string | undefined;
23
+ quantitativeCharacteristicId: string | undefined;
24
+ quantitativeCharacteristicUnit: string | undefined;
24
25
  positionDetails_CoordinateSystemName?: string;
25
26
  positionDetails_E3DReferenceNumber?: string;
26
27
  positionDetails_CoordinateEast?: string;
27
28
  positionDetails_CoordinateNorth?: string;
28
29
  positionDetails_CoordinateUp?: string;
29
- measurements: import("../../measuringPoint").MeasurementDto[];
30
30
  }[];
31
31
  export {};
@@ -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
- categoryId: GlobalSelectionCategoryId;
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 { AddItemArgs } from './selectionMenu/selectionTreeStore/actions/selectionTree.action.types';
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: AddTagsType;
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>) => void;
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 addItemsToSelection<T extends GlobalSelectionItemType>(set: SetFunction, get: StoreApi<GlobalSelectionStore>['getState'], args: {
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
- }, itemType: T, fetchFunction: FetchFunction<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>, nullItemGenerator: NullItemGenerator<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>): Promise<{
18
+ }) => Promise<{
15
19
  fetchResult: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
16
20
  actionResult: GlobalSelectionTypes.ActionResult;
17
21
  }>;
@@ -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
+ }>;
@@ -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: 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,2 @@
1
+ import { GlobalSelectionTypes } from '../globalSelectionStore.types';
2
+ export declare function createNullEquipmentData(itemId: GlobalSelectionTypes.EquipmentId): GlobalSelectionTypes.EquipmentDto;
@@ -0,0 +1,2 @@
1
+ import { GlobalSelectionTypes } from '../globalSelectionStore.types';
2
+ export declare function createNullTagSummaryDb(itemId: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagDto;
@@ -0,0 +1,3 @@
1
+ import { WorkOrderData } from '@equinor/echo-search';
2
+ import { GlobalSelectionTypes } from '../globalSelectionStore.types';
3
+ export declare function createNullWorkOrderData(itemId: GlobalSelectionTypes.WorkOrderId): WorkOrderData;
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
2
+ import { GlobalSelectionItemType, GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
3
3
  interface PanTo3DButtonProps {
4
- item: GlobalSelectionTypes.SelectionItem;
4
+ itemId: GlobalSelectionTypes.ItemId;
5
+ itemType: GlobalSelectionItemType;
6
+ disabled: boolean;
5
7
  }
6
8
  export declare const PanTo3DButton: React.FC<PanTo3DButtonProps>;
7
9
  export {};
@@ -1,4 +1,4 @@
1
- import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
1
+ import { GlobalSelectionItemType, GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
2
2
  export declare const usePanTo3dWeb: () => {
3
- panTo3D: (item: GlobalSelectionTypes.SelectionItem) => Promise<void>;
3
+ panTo3D: (itemId: GlobalSelectionTypes.ItemId, itemType: GlobalSelectionItemType) => Promise<void>;
4
4
  };
@@ -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>[]>>;
@@ -1,13 +1,3 @@
1
- import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
- import { StoreApi } from 'zustand';
1
+ import { TagSummaryDto } from '@equinor/echo-search';
3
2
  import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
4
- import { SelectionTreeStore } from '../selectionTree.store.types';
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<unknown>[]> | {
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<unknown>[]> | {
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 {};
@@ -11,6 +11,7 @@ export type AddItemArgs<ItemIdType extends GlobalSelectionTypes.ItemId> = {
11
11
  } & AddByLabel;
12
12
  export type AddItemsResponse<FetchResponseType> = {
13
13
  fetchResults: FetchResponseType;
14
+ itemsAdded: Readonly<GlobalSelectionTypes.ItemId[]>;
14
15
  actionResult: SelectionTreeActionResult;
15
16
  };
16
17
  export type SelectionTreeActionResult = 'ItemsUpdated' | 'ItemsAdded' | 'NewGroupCreated' | 'NoChanges';
@@ -4,6 +4,7 @@ export declare const selectionTreeInitialData: Readonly<{
4
4
  categoryOrder: {
5
5
  tagIndex: number;
6
6
  workOrderIndex: number;
7
+ equipmentIndex: number;
7
8
  };
8
9
  localSelectionGroupIndex: 0;
9
10
  getInitialCategories: () => SelectionCategory[];