@equinor/echo-framework 0.23.2 → 0.23.4-beta-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{47deeba42768c5d1.svg → 063009f06499d102.svg} +8 -8
- package/README.md +28 -28
- package/{1bd97dd2170d0f64.svg → f4c85313e79b1662.svg} +850 -850
- package/index.cjs.d.ts +2 -2
- 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/addItemsToSelectionFactory.d.ts +17 -0
- 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 +17 -6
- 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 +2 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTags.action.d.ts +2 -13
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addWorkOrders.action.d.ts +2 -6
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/createAddItemsFactory.d.ts +5 -8
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +5 -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 +9 -18
- 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/actions/addItemsToSelection.action.d.ts +0 -18
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionNullItems.d.ts +0 -4
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
|
|
2
1
|
import { Guid } from '@equinor/echo-utils';
|
|
3
|
-
import { GlobalSelectionItemType, GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
4
3
|
import { AddByLabel, AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
|
|
5
|
-
export type SelectionItemTypeToItemIdMap = {
|
|
6
|
-
[GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
|
|
7
|
-
[GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
|
|
8
|
-
[GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
|
|
9
|
-
};
|
|
10
4
|
export declare enum GlobalSelectionCategoryId {
|
|
11
5
|
Tags = "DEFAULT_TAG_LIST_ID",
|
|
12
|
-
WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID"
|
|
6
|
+
WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID",
|
|
7
|
+
Equipments = "DEFAULT_EQUIPMENT_LIST_ID"
|
|
13
8
|
}
|
|
14
9
|
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
10
|
export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
|
|
21
11
|
id: SelectionItemTypeToItemIdMap[T];
|
|
22
12
|
type: T;
|
|
@@ -48,13 +38,12 @@ export interface SelectionTreeData {
|
|
|
48
38
|
}
|
|
49
39
|
export interface SelectionTreeStore {
|
|
50
40
|
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
41
|
addItems: (args: {
|
|
56
42
|
itemIds: GlobalSelectionTypes.ItemId[];
|
|
57
43
|
} & AddByLabel) => void;
|
|
44
|
+
addTags: (args: AddItemArgs<GlobalSelectionTypes.TagId>) => AddTagsReturnType;
|
|
45
|
+
addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => AddWorkOrdersReturnType;
|
|
46
|
+
addEquipments: (args: AddItemArgs<GlobalSelectionTypes.EquipmentId>) => AddEquipmentsReturnType;
|
|
58
47
|
createGroup: (args: {
|
|
59
48
|
label: string;
|
|
60
49
|
subLabel: string;
|
|
@@ -86,4 +75,6 @@ export declare namespace SelectionTreeTypes {
|
|
|
86
75
|
type Group = SelectionGroup;
|
|
87
76
|
type ActionResult = SelectionTreeActionResult;
|
|
88
77
|
}
|
|
89
|
-
export type AddTagsReturnType
|
|
78
|
+
export type AddTagsReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.Tag>>;
|
|
79
|
+
export type AddWorkOrdersReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.WorkOrder>>;
|
|
80
|
+
export type AddEquipmentsReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.Equipment>>;
|
|
@@ -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;
|
package/src/lib/utils/index.d.ts
CHANGED
package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelection.action.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ResultArray } from '@equinor/echo-search';
|
|
2
|
-
import { StoreApi } from 'zustand';
|
|
3
|
-
import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionStore, GlobalSelectionTypes } from '../globalSelectionStore.types';
|
|
4
|
-
type FetchFunction<T, U> = (itemIds: Readonly<U[]>) => Promise<ResultArray<T>[]>;
|
|
5
|
-
type NullItemGenerator<T, U> = (itemId: U) => T;
|
|
6
|
-
type ItemIdTypeMap = {
|
|
7
|
-
[GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
|
|
8
|
-
[GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
|
|
9
|
-
[GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
|
|
10
|
-
};
|
|
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: {
|
|
13
|
-
itemIds: ItemIdTypeMap[T][];
|
|
14
|
-
}, itemType: T, fetchFunction: FetchFunction<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>, nullItemGenerator: NullItemGenerator<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>): Promise<{
|
|
15
|
-
fetchResult: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
|
|
16
|
-
actionResult: GlobalSelectionTypes.ActionResult;
|
|
17
|
-
}>;
|
|
18
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { WorkOrderData } from '@equinor/echo-search';
|
|
2
|
-
import { GlobalSelectionTypes } from './globalSelectionStore.types';
|
|
3
|
-
export declare function createNullTagSummaryDb(itemId: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagDto;
|
|
4
|
-
export declare function createNullWorkOrderData(itemId: GlobalSelectionTypes.WorkOrderId): WorkOrderData;
|