@equinor/echo-framework 0.20.15 → 0.20.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +12 -5
- package/src/lib/components/formattedLongText/formattedLongText.d.ts +6 -0
- package/src/lib/components/index.d.ts +2 -1
- package/src/lib/components/prepview/colors/ColorMapping.d.ts +1 -1
- package/src/lib/components/prepview/types/shared.d.ts +35 -13
- package/src/lib/components/prepview/types/workorder.d.ts +15 -0
- package/src/lib/components/prepview/workorder/pm15/equipment/equipmentHelper.d.ts +18 -0
- package/src/lib/coreApplication/EchoTopBar.d.ts +0 -1
- package/src/lib/feature/equipment/components/equipmentItemInfo/equipmentItemInfo.d.ts +1 -0
- package/src/lib/feature/equipment/components/equipmentTabs/MeasuringPointsForEquipmentItem.d.ts +3 -2
- package/src/lib/feature/equipment/components/equipmentTabs/MeasuringPointsForEquipmentItemList.d.ts +6 -0
- package/src/lib/feature/equipment/components/equipmentTabs/equipmentTabs.d.ts +3 -1
- package/src/lib/feature/equipment/hooks/useEquipmentWithMeasuringPoints.d.ts +1 -1
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +199 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +33 -6
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +16 -66
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +25 -1
- package/src/lib/feature/globalSelection/hooks/useGlobalSelectionLists.d.ts +16 -1
- package/src/lib/feature/globalSelection/hooks/useGlobalSelectionTags.d.ts +1 -1
- package/src/lib/feature/globalSelection/index.d.ts +1 -1
- package/src/lib/feature/globalSelection/selectionMenu/hooks/useAllItemsHiddenByUser.d.ts +12 -0
- package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuLists.d.ts +7 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.d.ts +43 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.types.d.ts +52 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.utils.d.ts +56 -0
- package/src/lib/feature/hooks/useAddTagToLegendRegistry.d.ts +1 -1
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/mediaItemView/NavigationButton.d.ts +8 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/mediaItemView/desktopMediaView.d.ts +10 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/mediaItemView/mediaViewUtils.d.ts +3 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/mediaItemView/mobileMediaView.d.ts +10 -0
- package/src/lib/feature/openItemsIn3d/OpenIn3dSelectedItemsMenu.d.ts +8 -0
- package/src/lib/feature/openItemsIn3d/index.d.ts +1 -1
- package/src/lib/feature/openItemsIn3d/logic/openItemsIn3d.utils.d.ts +0 -21
- package/src/lib/feature/openItemsIn3d/openIn3dMenu.d.ts +1 -2
- package/src/lib/services/locationService/locationService.d.ts +10 -0
- package/src/lib/services/stores/createSimpleStore.d.ts +29 -0
- package/src/lib/services/userSetting/index.d.ts +1 -0
- package/src/lib/services/userSetting/userSettingStore.d.ts +25 -0
- package/src/lib/types/eventTypes/legendEvent.d.ts +1 -1
- package/src/lib/types/hookLibrary.d.ts +1 -0
- package/src/lib/types/navigation/internalApplicationLinks.d.ts +2 -1
- package/src/lib/utils/openIn3d/index.d.ts +1 -1
- package/src/lib/utils/openIn3d/tagLists.d.ts +0 -5
- package/src/lib/feature/openItemsIn3d/SelectedItemsMenu.d.ts +0 -10
- /package/src/lib/feature/{legend → legacyLegend}/index.d.ts +0 -0
- /package/src/lib/feature/{legend → legacyLegend}/legend.d.ts +0 -0
- /package/src/lib/feature/{legend → legacyLegend}/utils/createChipStatusProps.d.ts +0 -0
- /package/src/lib/feature/{legend → legacyLegend}/utils/legendUtils.d.ts +0 -0
- /package/src/lib/feature/{legend → legacyLegend}/utils/statusHelper.d.ts +0 -0
package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import { GlobalSelectionItemType, GlobalSelectionTypes } from './globalSelectionStore.types';
|
|
2
2
|
export declare function toGlobalSelectionItem<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(item: T, type: K): GlobalSelectionTypes.GenericItem<K>;
|
|
3
3
|
export declare function toGlobalSelectionItems<T extends GlobalSelectionTypes.ItemTypeToDataMap[K], K extends GlobalSelectionItemType>(items: T[], type: K): GlobalSelectionTypes.GenericItem<K>[];
|
|
4
|
-
export declare function findGlobalSelectionListByKey(state: GlobalSelectionTypes.Store, key: string): GlobalSelectionTypes.ListUnion | undefined;
|
|
5
4
|
declare function idsEqual(itemA: GlobalSelectionTypes.ItemId, itemB: GlobalSelectionTypes.ItemId): boolean;
|
|
6
5
|
declare function isWorkOrderId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.WorkOrderId;
|
|
7
6
|
declare function isEquipmentId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.EquipmentId;
|
|
8
7
|
declare function isTagId(itemId: GlobalSelectionTypes.ItemId): itemId is GlobalSelectionTypes.TagId;
|
|
8
|
+
/**
|
|
9
|
+
* Overloaded function that maps an item to its corresponding ID type based on the item's properties.
|
|
10
|
+
* The return type is specific to the type of item passed to the function.
|
|
11
|
+
*
|
|
12
|
+
* @param {GlobalSelectionTypes.WorkOrderId} item - The work order item to be mapped.
|
|
13
|
+
* @returns {GlobalSelectionTypes.WorkOrderId} - The mapped work order ID.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @param {GlobalSelectionTypes.EquipmentId} item - The equipment item to be mapped.
|
|
17
|
+
* @returns {GlobalSelectionTypes.EquipmentId} - The mapped equipment ID.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @param {GlobalSelectionTypes.TagId} item - The tag item to be mapped.
|
|
21
|
+
* @returns {GlobalSelectionTypes.TagId} - The mapped tag ID.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Maps an item to its corresponding ID object by checking the item's type and returning the appropriate ID object.
|
|
25
|
+
* If the item type is not recognized, an error is thrown.
|
|
26
|
+
*
|
|
27
|
+
* @param {GlobalSelectionTypes.ItemId} item - The data to be mapped to its ID type.
|
|
28
|
+
* @returns {GlobalSelectionTypes.ItemId} - The mapped tag ID.
|
|
29
|
+
*/
|
|
30
|
+
declare function mapToId(item: GlobalSelectionTypes.WorkOrderId): GlobalSelectionTypes.WorkOrderId;
|
|
31
|
+
declare function mapToId(item: GlobalSelectionTypes.EquipmentId): GlobalSelectionTypes.EquipmentId;
|
|
32
|
+
declare function mapToId(item: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagId;
|
|
9
33
|
declare function mapToId(item: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemId;
|
|
10
34
|
declare function itemIdToString(itemId: Record<string, string | number>): string;
|
|
11
35
|
/**
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hook for returning all lists stored in the global selection.
|
|
3
3
|
*/
|
|
4
|
-
export declare function useGlobalSelectionLists():
|
|
4
|
+
export declare function useGlobalSelectionLists(): ({
|
|
5
|
+
label: string;
|
|
6
|
+
type: import("..").GlobalSelectionItemType.WorkOrder;
|
|
7
|
+
items: import("..").GlobalSelectionTypes.GenericItem<import("..").GlobalSelectionItemType.WorkOrder>[];
|
|
8
|
+
itemsBeingLoaded: import("..").GlobalSelectionTypes.ItemId[];
|
|
9
|
+
} | {
|
|
10
|
+
label: string;
|
|
11
|
+
type: import("..").GlobalSelectionItemType.Tag;
|
|
12
|
+
items: import("..").GlobalSelectionTypes.GenericItem<import("..").GlobalSelectionItemType.Tag>[];
|
|
13
|
+
itemsBeingLoaded: import("..").GlobalSelectionTypes.ItemId[];
|
|
14
|
+
} | {
|
|
15
|
+
label: string;
|
|
16
|
+
type: import("..").GlobalSelectionItemType.Equipment;
|
|
17
|
+
items: import("..").GlobalSelectionTypes.GenericItem<import("..").GlobalSelectionItemType.Equipment>[];
|
|
18
|
+
itemsBeingLoaded: import("..").GlobalSelectionTypes.ItemId[];
|
|
19
|
+
})[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
2
|
/**
|
|
3
3
|
* Returns with the stored Tags from the global selection store
|
|
4
|
-
* @returns {
|
|
4
|
+
* @returns {GlobalSelectionTypes.TagItem[]} Array of Tags with some global selection meta data.
|
|
5
5
|
*/
|
|
6
6
|
export declare function useGlobalSelectionTags(): GlobalSelectionTypes.TagItem[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { globalSelectionApi, useGlobalSelectionStore } from './globalSelection.api';
|
|
2
2
|
export * from './globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
export { globalSelectionUtils } from './globalSelectionStore/globalSelectionStore.utils';
|
|
4
4
|
export { convertGlobalSelectionItemsToPlantTagPairs } from './globalSelectionStore/globalSelectionStoreHelpers';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to determine if all items in a selection list are hidden by the user.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} listId - The ID of the selection list to check.
|
|
5
|
+
* @returns {boolean} - A boolean indicating whether all items in the list are hidden by the user.
|
|
6
|
+
*
|
|
7
|
+
* This hook uses the `useGlobalSelectionLists` hook to get the current global selection state and
|
|
8
|
+
* It then checks if all items in the target list are hidden by the user by comparing item IDs and their metadata.
|
|
9
|
+
*
|
|
10
|
+
* The hook returns `true` if all items in the list are hidden by the user, and `false` otherwise.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useAllItemsHiddenByUser: (listId: string) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SelectionMenuList } from '../selectionMenuStore/selectionMenu.store.types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to get the selection menu lists from the selection menu store, displayed in the left selection panel.
|
|
4
|
+
*
|
|
5
|
+
* @returns {SelectionMenuList[]} - An array of selection menu lists.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSelectionMenuLists(): SelectionMenuList[];
|
package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SelectionMenuStore } from './selectionMenu.store.types';
|
|
2
|
+
export declare enum SelectionMenuDefaultListIds {
|
|
3
|
+
TagList = "DEFAULT_TAG_LIST_ID",
|
|
4
|
+
WorkOrderList = "DEFAULT_WORK_ORDER_LIST_ID"
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Store for the selection menu, in a left panel.
|
|
8
|
+
*
|
|
9
|
+
* Stores the hierachry, tree structure of the items in Global Selection.
|
|
10
|
+
* With this, it is in charge of:
|
|
11
|
+
* - tracking which item belongs to which list
|
|
12
|
+
* - adding items to global selection
|
|
13
|
+
* - remove items from global selection
|
|
14
|
+
* - update items (visibility, removal etc.) via list ids
|
|
15
|
+
* - maintaining the global selection store based on the changes in the items, in the selection menu panel
|
|
16
|
+
*
|
|
17
|
+
* You shouldn't use this store directly in any code, unless you have very special reason to do so.
|
|
18
|
+
*
|
|
19
|
+
* For accessing and using global selection features, use the globalSelectionApi from echo-framework.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useSelectionMenuStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<SelectionMenuStore>, "setState"> & {
|
|
22
|
+
setState<A extends string | {
|
|
23
|
+
type: string;
|
|
24
|
+
}>(partial: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: SelectionMenuStore) => SelectionMenuStore | Partial<SelectionMenuStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
25
|
+
}, "subscribe"> & {
|
|
26
|
+
subscribe: {
|
|
27
|
+
(listener: (selectedState: SelectionMenuStore, previousSelectedState: SelectionMenuStore) => void): () => void;
|
|
28
|
+
<U>(selector: (state: SelectionMenuStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
29
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
30
|
+
fireImmediately?: boolean;
|
|
31
|
+
} | undefined): () => void;
|
|
32
|
+
};
|
|
33
|
+
}, "setState"> & {
|
|
34
|
+
setState(nextStateOrUpdater: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: import("immer").WritableDraft<SelectionMenuStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
35
|
+
type: string;
|
|
36
|
+
} | undefined): void;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Get a snapshot of the current selection menu store state.
|
|
40
|
+
*
|
|
41
|
+
* Selection menu: left panel, which holds items from global selection.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getSelectionMenuStoreSnapshot(): SelectionMenuStore;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
|
|
2
|
+
import { Guid } from '@equinor/echo-utils';
|
|
3
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, OptimizedWorkOrderDto } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
4
|
+
import { SelectionMenuDefaultListIds } from './selectionMenu.store';
|
|
5
|
+
export type SelectionMenuItem = SelectionMenuTag | SelectionMenuWorkOrder | SelectionMenuEquipment;
|
|
6
|
+
export interface SelectionMenuTag {
|
|
7
|
+
id: GlobalSelectionTypes.TagId;
|
|
8
|
+
type: GlobalSelectionItemType.Tag;
|
|
9
|
+
}
|
|
10
|
+
export interface SelectionMenuWorkOrder {
|
|
11
|
+
id: GlobalSelectionTypes.WorkOrderId;
|
|
12
|
+
type: GlobalSelectionItemType.WorkOrder;
|
|
13
|
+
}
|
|
14
|
+
export interface SelectionMenuEquipment {
|
|
15
|
+
id: GlobalSelectionTypes.EquipmentId;
|
|
16
|
+
type: GlobalSelectionItemType.Equipment;
|
|
17
|
+
}
|
|
18
|
+
export type SelectionMenuList = SelectionMenuWithItems | SelectionMenuWithSubLists;
|
|
19
|
+
interface SelectionMenuBase {
|
|
20
|
+
id: Guid | SelectionMenuDefaultListIds;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
interface SelectionMenuWithItems extends SelectionMenuBase {
|
|
24
|
+
items: SelectionMenuItem[];
|
|
25
|
+
subLists?: never;
|
|
26
|
+
}
|
|
27
|
+
interface SelectionMenuWithSubLists extends SelectionMenuBase {
|
|
28
|
+
subLists: SelectionMenuWithItems[];
|
|
29
|
+
items?: never;
|
|
30
|
+
}
|
|
31
|
+
export interface SelectionMenuStore {
|
|
32
|
+
lists: SelectionMenuList[];
|
|
33
|
+
addTags: (args: {
|
|
34
|
+
listId?: string;
|
|
35
|
+
itemIds: Readonly<GlobalSelectionTypes.TagId[]>;
|
|
36
|
+
}) => Promise<ResultArray<TagSummaryDto>[]>;
|
|
37
|
+
addWorkOrders: (args: {
|
|
38
|
+
listId?: string;
|
|
39
|
+
items: Readonly<Readonly<OptimizedWorkOrderDto>[]>;
|
|
40
|
+
}) => void;
|
|
41
|
+
addList: (args: SelectionMenuList) => void;
|
|
42
|
+
removeItemsByListId: (args: {
|
|
43
|
+
listId: string;
|
|
44
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
45
|
+
}) => void;
|
|
46
|
+
setVisibilityByListId: (args: {
|
|
47
|
+
listId: string;
|
|
48
|
+
isVisible: boolean;
|
|
49
|
+
}) => void;
|
|
50
|
+
resetState: () => void;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import { SelectionMenuList } from './selectionMenu.store.types';
|
|
3
|
+
/**
|
|
4
|
+
* Finds a selection list by its ID from a given list of selection menu lists.
|
|
5
|
+
* If the list is not found at the top level, it searches within the sublists of each top-level list.
|
|
6
|
+
*
|
|
7
|
+
* @param args - The arguments object.
|
|
8
|
+
* @param {string} args.listId - The ID of the selection list to find.
|
|
9
|
+
* @param {SelectionMenuList[]} args.lists - An optional array of selection menu lists to search within.
|
|
10
|
+
* If not provided, the function will use the lists from the selection menu store state.
|
|
11
|
+
* If you want to alter the store state, you should provide the lists as an argument.
|
|
12
|
+
* @returns {SelectionMenuList | undefined} The selection menu list with the specified ID, or `undefined` if not found.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findSelectionListById(args: {
|
|
15
|
+
listId: string;
|
|
16
|
+
lists: SelectionMenuList[];
|
|
17
|
+
}): SelectionMenuList | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a given item ID is present in a specified list.
|
|
20
|
+
*
|
|
21
|
+
* @param args - An object containing the item ID and the list ID.
|
|
22
|
+
* @param {GlobalSelectionTypes.ItemId} args.itemId - The ID of the item to check for.
|
|
23
|
+
* @param {string} args.listId - The ID of the list to search within.
|
|
24
|
+
* @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
|
|
25
|
+
* @returns {boolean} A boolean indicating whether the item ID is found in the list.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isItemIdInList(args: {
|
|
28
|
+
itemId: GlobalSelectionTypes.ItemId;
|
|
29
|
+
listId: string;
|
|
30
|
+
lists: SelectionMenuList[];
|
|
31
|
+
}): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a given item ID is present in the selection lists.
|
|
34
|
+
*
|
|
35
|
+
* @param args - An object containing the item ID to check.
|
|
36
|
+
* @param {GlobalSelectionTypes.ItemId} args.itemId - The item ID to check for presence in the selection lists.
|
|
37
|
+
* @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
|
|
38
|
+
* @returns {boolean} A boolean indicating whether the item ID is present in the selection lists.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isItemIdInTheSelection(args: {
|
|
41
|
+
itemId?: GlobalSelectionTypes.ItemId;
|
|
42
|
+
lists: SelectionMenuList[];
|
|
43
|
+
}): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves an array of itemIds that were not found in the selection menu.
|
|
46
|
+
*
|
|
47
|
+
* @param {Object} args - The arguments containing the list and itemIds to check.
|
|
48
|
+
* @param {SelectionMenuList[]} args.list - The list of SelectionMenuList objects to search through.
|
|
49
|
+
* @param {GlobalSelectionTypes.ItemId[]} args.itemIds - An array of ItemId objects to check for presence in the list.
|
|
50
|
+
* @returns {string[]} An array of itemId strings that correspond to counts of 0 in the selection menu.
|
|
51
|
+
* itemIds object values are concatenated via '-' char
|
|
52
|
+
*/
|
|
53
|
+
export declare function itemsNotFoundInSelectionMenu(args: {
|
|
54
|
+
lists: SelectionMenuList[];
|
|
55
|
+
itemIds: GlobalSelectionTypes.ItemId[];
|
|
56
|
+
}): string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface DesktopMediaViewProps {
|
|
3
|
+
imageSrc: string;
|
|
4
|
+
showPrevious: () => void;
|
|
5
|
+
showNext: () => void;
|
|
6
|
+
showNextIcon: boolean;
|
|
7
|
+
showPrevIcon: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const DesktopMediaView: React.FC<React.PropsWithChildren<DesktopMediaViewProps>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MobileMediaViewProps {
|
|
3
|
+
imageSrc: string;
|
|
4
|
+
showPrevious: () => void;
|
|
5
|
+
showNext: () => void;
|
|
6
|
+
showNextIcon: boolean;
|
|
7
|
+
showPrevIcon: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const MobileMediaView: React.FC<React.PropsWithChildren<MobileMediaViewProps>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface OpenIn3dSelectedItemsMenuProps {
|
|
3
|
+
onOpenIn3dButtonClick: () => void;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const OpenIn3dSelectedItemsMenu: React.FC<OpenIn3dSelectedItemsMenuProps>;
|
|
8
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { tagIdPlantIdToPlantTagPairs } from './logic/convertToPlantTagPairs';
|
|
2
2
|
export type { Plant3dInfo, PlantAndTagForOpenIn3d } from './logic/openItemsIn3d.utils';
|
|
3
|
+
export { OpenIn3dSelectedItemsMenu } from './OpenIn3dSelectedItemsMenu';
|
|
3
4
|
export { OpenItemsIn3dDialog } from './openItemsIn3dDialog';
|
|
4
|
-
export { SelectedItemsMenu } from './SelectedItemsMenu';
|
|
@@ -8,27 +8,6 @@
|
|
|
8
8
|
export declare function getUniquePlantsWithItemCount(args: {
|
|
9
9
|
items: PlantAndTagForOpenIn3d[];
|
|
10
10
|
}): Plant3dInfoCount[];
|
|
11
|
-
/**
|
|
12
|
-
* Retrieves the items from the given array that have the same plant number as the selected plant number.
|
|
13
|
-
*
|
|
14
|
-
* @param selectedItems - The array of PlantTagPair objects.
|
|
15
|
-
* @param selectedPlantNo - The selected plant number.
|
|
16
|
-
* @returns An array of PlantTagPair objects that have the same plant number as the selected plant number.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getItemsForSelectedPlantNo(selectedItems: PlantAndTagForOpenIn3d[], selectedPlantNo: string): PlantAndTagForOpenIn3d[];
|
|
19
|
-
/**
|
|
20
|
-
* Checks if there are more then one unique plant numbers in the passed PlantTagPair[].
|
|
21
|
-
*
|
|
22
|
-
* @param items - The array of PlantTagPair objects to check.
|
|
23
|
-
* @returns A boolean indicating whether multiple, unique plant numbers are present in the passed array.
|
|
24
|
-
*/
|
|
25
|
-
export declare function isMultiplePlantNoSelected(items: PlantAndTagForOpenIn3d[]): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Retrieves the plant SAP ID from an array of PlantTagPair. It will return with the first, non empty plant SAP ID found.
|
|
28
|
-
* @param items - The array of PlantTagPair items.
|
|
29
|
-
* @returns The plant SAP ID if found, otherwise undefined.
|
|
30
|
-
*/
|
|
31
|
-
export declare function getFirstPlantSapIdFromItems(items: PlantAndTagForOpenIn3d[]): string | undefined;
|
|
32
11
|
export interface Plant3dInfo {
|
|
33
12
|
instCode: string;
|
|
34
13
|
sapId: string | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ObjectsToSendTo3dTypes } from '../../utils/openIn3d/tagLists';
|
|
3
2
|
interface OpenIn3dMenuProps {
|
|
4
|
-
onOpenIn3dButtonClick: (
|
|
3
|
+
onOpenIn3dButtonClick: () => void;
|
|
5
4
|
disabled: boolean;
|
|
6
5
|
}
|
|
7
6
|
export declare const OpenIn3dMenu: React.FC<OpenIn3dMenuProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InternalApplicationLinks } from '../../types/navigation';
|
|
2
|
+
export declare function setLocationServicePathname(pathname: InternalApplicationLinks | string): void;
|
|
3
|
+
declare function isOnPage(applicationLink: InternalApplicationLinks | string): boolean;
|
|
4
|
+
export declare const locationService: Readonly<{
|
|
5
|
+
isOnPage: typeof isOnPage;
|
|
6
|
+
isOnPdfViewer: () => boolean;
|
|
7
|
+
isOnEcho3dPage: () => boolean;
|
|
8
|
+
isOnHomePage: () => boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type SimpleStore<T, Name extends string> = {
|
|
2
|
+
[K in Name]: T;
|
|
3
|
+
} & {
|
|
4
|
+
[K in `set${Capitalize<Name>}`]: (value: T) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Factory for creating a simple Zustand store with a value and a setter function. If more is needed, use a normal zustand store instead.
|
|
8
|
+
*
|
|
9
|
+
* The store will have the following structure:
|
|
10
|
+
* - A value corresponding to the `name` parameter.
|
|
11
|
+
* - A setter function dynamically named `set<Name>` to update the value.
|
|
12
|
+
*
|
|
13
|
+
* @template T The type of the value stored in the store (can be any type: string, number, object, etc.).
|
|
14
|
+
* @template Name The name of the state, used for both the key and the setter function.
|
|
15
|
+
*
|
|
16
|
+
* @param {T} initialValue The initial value of the store.
|
|
17
|
+
* @param {Name} name The name of the state, which will be used for the store key and setter function.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const useCountStore = createSimpleStore(0, 'count');
|
|
21
|
+
*
|
|
22
|
+
* const { count, setCount } = useCountStore();
|
|
23
|
+
* console.log(count); // 0
|
|
24
|
+
*
|
|
25
|
+
* setCount(10);
|
|
26
|
+
* console.log(count); // 10
|
|
27
|
+
*/
|
|
28
|
+
export declare function createSimpleStore<T, Name extends string>(initialValue: T, name: Name): import("zustand").UseBoundStore<import("zustand").StoreApi<SimpleStore<T, Name>>>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useUserSettingsStore, userSettingsSnapshot } from './userSettingStore';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface UserSettings {
|
|
2
|
+
measuringPointsEnabled: boolean;
|
|
3
|
+
setMeasuringPointsEnabled: (value: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function userSettingsSnapshot(): UserSettings;
|
|
6
|
+
export declare const useUserSettingsStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<UserSettings>, "setState"> & {
|
|
7
|
+
setState<A extends string | {
|
|
8
|
+
type: string;
|
|
9
|
+
}>(partial: UserSettings | Partial<UserSettings> | ((state: UserSettings) => UserSettings | Partial<UserSettings>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
10
|
+
}, "persist"> & {
|
|
11
|
+
persist: {
|
|
12
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<UserSettings, unknown>>) => void;
|
|
13
|
+
clearStorage: () => void;
|
|
14
|
+
rehydrate: () => Promise<void> | void;
|
|
15
|
+
hasHydrated: () => boolean;
|
|
16
|
+
onHydrate: (fn: (state: UserSettings) => void) => () => void;
|
|
17
|
+
onFinishHydration: (fn: (state: UserSettings) => void) => () => void;
|
|
18
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<UserSettings, unknown>>;
|
|
19
|
+
};
|
|
20
|
+
}, "setState"> & {
|
|
21
|
+
setState(nextStateOrUpdater: UserSettings | Partial<UserSettings> | ((state: import("immer").WritableDraft<UserSettings>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
22
|
+
type: string;
|
|
23
|
+
} | undefined): void;
|
|
24
|
+
}>;
|
|
25
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export type SetActiveTagNo = (argsORtagNo: string | {
|
|
|
7
7
|
keepLastNavigationItem?: boolean;
|
|
8
8
|
openInPanel?: boolean;
|
|
9
9
|
displayMessageOnItemNotFound?: boolean;
|
|
10
|
+
omitTagNoFromUrl?: boolean;
|
|
10
11
|
}, activeTagTab?: string, activeTagSubTab?: string, instCode?: string, openInPanel?: boolean, displayMessageOnItemNotFound?: boolean) => void;
|
|
11
12
|
export type TagData = [(tagNo: string, instCode: string) => void];
|
|
12
13
|
export type SetActiveCommPackNo = (argsORcommPackNo: string | {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { generateTemporaryTagListObject, getRandomColor, getTemporarilyEchoHubListFor3d } from './tagLists';
|
|
2
2
|
export type { HubListReturnType } from './tagLists';
|
|
@@ -3,10 +3,6 @@ export declare const getTemporarilyEchoHubListFor3d: (instCode: string, request:
|
|
|
3
3
|
app3dUrl: string;
|
|
4
4
|
web3dUrl: string;
|
|
5
5
|
}>;
|
|
6
|
-
export declare enum ObjectsToSendTo3dTypes {
|
|
7
|
-
workOrders = "workOrders",
|
|
8
|
-
tags = "tags"
|
|
9
|
-
}
|
|
10
6
|
export type HubListReturnType = {
|
|
11
7
|
app3dUrl: string;
|
|
12
8
|
web3dUrl: string;
|
|
@@ -23,7 +19,6 @@ export type HubListReturnType = {
|
|
|
23
19
|
* @return {*} {TemporaryEchoHubListDto} temporary tag list object
|
|
24
20
|
*/
|
|
25
21
|
export declare const generateTemporaryTagListObject: (args: {
|
|
26
|
-
ObjectsToSendTo3d: ObjectsToSendTo3dTypes;
|
|
27
22
|
sourceModuleName: string;
|
|
28
23
|
createdBy: string;
|
|
29
24
|
plantCode: string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ObjectsToSendTo3dTypes } from '../../utils';
|
|
3
|
-
interface SelectedItemsProps {
|
|
4
|
-
onOpenIn3dButtonClick: (ObjectsToSendTo3d: ObjectsToSendTo3dTypes) => void;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const SelectedItemsMenu: React.FC<SelectedItemsProps>;
|
|
9
|
-
export declare function getIsGlobalSelectionEnabled(): boolean;
|
|
10
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|