@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.
- package/index.cjs.js +8 -2
- package/package.json +5 -2
- 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 +11 -11
- 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/panToEcho3d/panTo3DButton.d.ts +4 -2
- package/src/lib/feature/globalSelection/panToEcho3d/usePanTo3DWeb.d.ts +2 -2
- 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/actions/selectionTree.action.types.d.ts +1 -0
- 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/feature/legend/legendUpdater.d.ts +1 -0
- package/src/lib/feature/legend/legendVisibleDataStore.d.ts +1 -0
- package/src/lib/feature/legend/types/legendType.d.ts +1 -1
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/PointCountSelector.d.ts +15 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/graphStyleControls.d.ts +7 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/measuringHistoryGraphDialog.d.ts +8 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/measuringHistoryGraphTooltip.d.ts +2 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/viewInFullScreenButton.d.ts +5 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/hooks/useActiveStyleGraph.d.ts +5 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/hooks/useMeasuringChartConfig.d.ts +10 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringDocumentsHistoryGraph.d.ts +14 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringPointHistoryGraphSection.d.ts +6 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringPointHistoryItem.d.ts +6 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/{measuringPointHistoryList.d.ts → measuringPointHistoryList/measuringPointHistoryList.d.ts} +1 -1
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/types/activeStyleType.d.ts +7 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/types/measuringDocumentsHistoryGraphType.d.ts +7 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/utils/createMeasuringChartConfig.d.ts +4 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/utils/measuringPointHistoryListUtils.d.ts +63 -0
- package/src/lib/feature/measuringPoint/types/measuringPoint.d.ts +2 -15
- 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
|
@@ -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>;
|
|
@@ -52,6 +52,7 @@ export declare const useLegendVisibleDataStore: import("zustand").UseBoundStore<
|
|
|
52
52
|
type: string;
|
|
53
53
|
} | undefined): void;
|
|
54
54
|
}>;
|
|
55
|
+
export declare function legendVisibleDataSnapshot(): LegendVisibleDataStore;
|
|
55
56
|
/**
|
|
56
57
|
* Visible items are all items on screen that should be affected by the legend.
|
|
57
58
|
* @returns A function for adding visible items by type and key, which is automatically removed when the component unmounts.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Brand } from '@equinor/echo-utils';
|
|
2
2
|
import { GlobalSelectionTypes } from '../../globalSelection';
|
|
3
|
-
type TemporaryLegendIdsForTesting = '
|
|
3
|
+
type TemporaryLegendIdsForTesting = 'Tag Legend' | 'Work Orders with Custom UI';
|
|
4
4
|
export type KnownLegendIds = 'Equipment' | TemporaryLegendIdsForTesting;
|
|
5
5
|
export type LegendId = KnownLegendIds | Brand<string, 'LegendId'>;
|
|
6
6
|
export declare function createLegendId(id: string): LegendId;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PointCountSelector lets users choose how many data points to display,
|
|
3
|
+
* such as the last 5, 10, 15, 20, or all available points.
|
|
4
|
+
*
|
|
5
|
+
* @param maxPoints - The total number of points available for selection.
|
|
6
|
+
* @param pointCount - The currently selected number of points to display.
|
|
7
|
+
* @param onChange - Callback when the user selects a different point count.
|
|
8
|
+
*/
|
|
9
|
+
interface PointCountSelectorProps {
|
|
10
|
+
maxPoints: number;
|
|
11
|
+
pointCount: number;
|
|
12
|
+
onChange: (selectedValue: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const PointCountSelector: React.FC<PointCountSelectorProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActiveStyle, HandleInterpolationChange } from '../types/activeStyleType';
|
|
2
|
+
type GraphStyleControlsProps = {
|
|
3
|
+
activeStyle: ActiveStyle;
|
|
4
|
+
onInterpolationChange: HandleInterpolationChange;
|
|
5
|
+
};
|
|
6
|
+
export declare const GraphStyleControls: React.FC<GraphStyleControlsProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AgCartesianChartOptions } from 'ag-charts-community';
|
|
2
|
+
import { MeasurementDto } from '../../../../types/measuringPoint';
|
|
3
|
+
import { ActiveStyle, HandleInterpolationChange } from '../types/activeStyleType';
|
|
4
|
+
export declare function useMeasuringChartConfig(measurements: MeasurementDto[], activeStyle: ActiveStyle, setActiveStyle: (style: ActiveStyle) => void, isFullscreen: boolean): {
|
|
5
|
+
chartConfig: AgCartesianChartOptions;
|
|
6
|
+
sortedMeasurements: import("../utils/measuringPointHistoryListUtils").SortedMeasurement[];
|
|
7
|
+
pointCount: number;
|
|
8
|
+
setPointCount: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
9
|
+
updateInterpolation: HandleInterpolationChange;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MeasurementDto } from '../../../types/measuringPoint';
|
|
3
|
+
import { ActiveStyle, SetActiveStyle } from './types/activeStyleType';
|
|
4
|
+
type MeasuringDocumentsHistoryGraphProps = {
|
|
5
|
+
measurements: MeasurementDto[];
|
|
6
|
+
activeStyle: ActiveStyle;
|
|
7
|
+
setActiveStyle: SetActiveStyle;
|
|
8
|
+
isFullSize?: boolean;
|
|
9
|
+
specifiedHeight?: string;
|
|
10
|
+
specifiedPadding?: string;
|
|
11
|
+
graphStyleControls?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const MeasuringDocumentsHistoryGraph: React.FC<MeasuringDocumentsHistoryGraphProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MeasurementDto } from '../../../types/measuringPoint';
|
|
2
|
+
interface MeasuringPointHistoryGraphSectionProps {
|
|
3
|
+
measurements: MeasurementDto[];
|
|
4
|
+
}
|
|
5
|
+
export declare const MeasuringPointHistoryGraphSection: React.FC<MeasuringPointHistoryGraphSectionProps>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Position, Type } from './measuringDocumentsHistoryGraphType';
|
|
2
|
+
export type ActiveStyle = {
|
|
3
|
+
type: Type;
|
|
4
|
+
position?: Position;
|
|
5
|
+
};
|
|
6
|
+
export type HandleInterpolationChange = (type: ActiveStyle['type'], position?: ActiveStyle['position']) => void;
|
|
7
|
+
export type SetActiveStyle = (style: ActiveStyle) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AgBaseAxisLabelOptions } from 'ag-charts-community';
|
|
2
|
+
import { SortedMeasurement } from '../utils/measuringPointHistoryListUtils';
|
|
3
|
+
export declare const strongRed: string;
|
|
4
|
+
export declare const strongRedFade: string;
|
|
5
|
+
export type Type = 'linear' | 'smooth' | 'step';
|
|
6
|
+
export type Position = 'start' | 'middle' | 'end';
|
|
7
|
+
export declare const createLabel: (fullScreenDialogOpen: boolean | undefined, sortedMeasurements: SortedMeasurement[], yAxisLabel?: boolean) => AgBaseAxisLabelOptions;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AgCartesianChartOptions } from 'ag-charts-community';
|
|
2
|
+
import { ActiveStyle } from '../types/activeStyleType';
|
|
3
|
+
import { SortedMeasurement } from './measuringPointHistoryListUtils';
|
|
4
|
+
export declare function createMeasuringChartConfig(data: SortedMeasurement[], activeStyle: ActiveStyle, fullScreen?: boolean): AgCartesianChartOptions;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AgAxisLabelFormatterParams, AgCartesianChartOptions } from 'ag-charts-community';
|
|
2
|
+
import { MeasurementDto } from '../../../../types/measuringPoint';
|
|
3
|
+
import { ActiveStyle } from '../types/activeStyleType';
|
|
4
|
+
export interface SortedMeasurement {
|
|
5
|
+
date: string;
|
|
6
|
+
condition: number;
|
|
7
|
+
fullDateTime: Date;
|
|
8
|
+
unit: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Filters the given list of measurements to include only those with valid quantitative or qualitative readings.
|
|
12
|
+
*
|
|
13
|
+
* @param {MeasurementDto[]} measurements - The list of measurements to filter.
|
|
14
|
+
* @returns {MeasurementDto[]} - The filtered list of measurements.
|
|
15
|
+
*/
|
|
16
|
+
export declare const filterMeasurements: (measurements: MeasurementDto[]) => MeasurementDto[];
|
|
17
|
+
/**
|
|
18
|
+
* Maps a MeasurementDto to a simplified sortable measurement object.
|
|
19
|
+
*
|
|
20
|
+
* @param {MeasurementDto} measurement - The measurement to transform.
|
|
21
|
+
* @returns {Omit<SortedMeasurement, 'date'> & { fullDateTime: Date, date: Date }} - The transformed measurement with full datetime info.
|
|
22
|
+
*/
|
|
23
|
+
export declare const mapToSortableMeasurement: (measurement: MeasurementDto) => Omit<SortedMeasurement, "date"> & {
|
|
24
|
+
fullDateTime: Date;
|
|
25
|
+
date: Date;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Sorts the given list of measurements by their measurement date and maps them to a simplified structure.
|
|
29
|
+
*
|
|
30
|
+
* @param {MeasurementDto[]} measurements - The list of measurements to sort and map.
|
|
31
|
+
* @returns {SortedMeasurement[]} - The sorted and mapped list of measurements.
|
|
32
|
+
*/
|
|
33
|
+
export declare const sortMeasurements: (measurements: MeasurementDto[]) => SortedMeasurement[];
|
|
34
|
+
/**
|
|
35
|
+
* Formats the x-axis labels for the chart, where only a specified number of labels are displayed.
|
|
36
|
+
*
|
|
37
|
+
* @param {AgAxisLabelFormatterParams} params - The parameters for the axis label formatter.
|
|
38
|
+
* @returns {string} - The formatted label for the x-axis.
|
|
39
|
+
*/
|
|
40
|
+
export declare function xAxisLabelFormatter(args: {
|
|
41
|
+
params: AgAxisLabelFormatterParams;
|
|
42
|
+
sortedMeasurements: SortedMeasurement[];
|
|
43
|
+
numberOfLabels: 3 | number;
|
|
44
|
+
}): any;
|
|
45
|
+
/**
|
|
46
|
+
* Updates the chart interpolation style for the given chart options.
|
|
47
|
+
*
|
|
48
|
+
* @param {AgCartesianChartOptions} chartOptions - The chart options to update.
|
|
49
|
+
* @param {boolean} enableInterpolation - Whether to enable or disable interpolation.
|
|
50
|
+
* @returns {AgCartesianChartOptions} - The updated chart options with the interpolation setting applied.
|
|
51
|
+
*/
|
|
52
|
+
export declare function updateChartInterpolation(prevConfig: AgCartesianChartOptions, type: ActiveStyle['type'], position: ActiveStyle['position'] | undefined, isFullscreen: boolean): AgCartesianChartOptions;
|
|
53
|
+
/**
|
|
54
|
+
* Formats a measurement value for display in the chart tooltip or list.
|
|
55
|
+
*
|
|
56
|
+
* @param {number} value - The measurement value to format.
|
|
57
|
+
* @param {string} unit - The unit of the measurement.
|
|
58
|
+
* @returns {string} - The formatted measurement value with the unit.
|
|
59
|
+
*/
|
|
60
|
+
export declare function formatMeasurement(measurement: {
|
|
61
|
+
quantitativeReading?: number;
|
|
62
|
+
quantitativeReadingUnitId?: string | null;
|
|
63
|
+
}): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MeasuringPointData } from '@equinor/echo-search';
|
|
1
2
|
export interface MeasurementDto {
|
|
2
3
|
measurementId: string;
|
|
3
4
|
measuringPointId: string;
|
|
@@ -14,20 +15,6 @@ export interface MeasurementDto {
|
|
|
14
15
|
qualitativeCodeId?: string;
|
|
15
16
|
longText?: object;
|
|
16
17
|
}
|
|
17
|
-
export interface MeasuringPointDto {
|
|
18
|
-
readonly measuringPointId: string;
|
|
19
|
-
readonly measuringPosition?: string;
|
|
20
|
-
readonly measuringPoint?: string;
|
|
21
|
-
readonly functionalLocationId?: string;
|
|
22
|
-
readonly tagPlantId?: string;
|
|
23
|
-
readonly tagId?: string;
|
|
24
|
-
readonly equipmentId?: string;
|
|
25
|
-
readonly quantitativeCharacteristicId?: string;
|
|
26
|
-
readonly quantitativeCharacteristicUnit?: string;
|
|
27
|
-
readonly positionDetails_CoordinateSystemName?: string;
|
|
28
|
-
readonly positionDetails_E3DReferenceNumber?: string;
|
|
29
|
-
readonly positionDetails_CoordinateEast?: string;
|
|
30
|
-
readonly positionDetails_CoordinateNorth?: string;
|
|
31
|
-
readonly positionDetails_CoordinateUp?: string;
|
|
18
|
+
export interface MeasuringPointDto extends MeasuringPointData {
|
|
32
19
|
readonly measurements: MeasurementDto[];
|
|
33
20
|
}
|
|
@@ -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
|
@@ -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;
|