@equinor/echo-framework 0.16.0-beta-1 → 0.16.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/{f4c85313e79b1662.svg → 1bd97dd2170d0f64.svg} +850 -850
- package/{063009f06499d102.svg → 47deeba42768c5d1.svg} +8 -8
- package/README.md +28 -28
- package/index.cjs.d.ts +2 -2
- package/index.cjs.js +1 -1
- package/package.json +2 -3
- package/src/index.d.ts +3 -5
- package/src/lib/components/index.d.ts +0 -3
- package/src/lib/coreApplication/index.d.ts +0 -1
- package/src/lib/feature/legend/index.d.ts +5 -0
- package/src/lib/{types → feature/legend}/legend.d.ts +3 -0
- package/src/lib/feature/legend/utils/createChipStatusProps.d.ts +7 -0
- package/src/lib/{utils → feature/legend/utils}/legendUtils.d.ts +1 -1
- package/src/lib/feature/legend/utils/statusHelper.d.ts +27 -0
- package/src/lib/services/activeSelectionStore/activeSelectionStore.d.ts +19 -0
- package/src/lib/services/activeSelectionStore/index.d.ts +1 -0
- package/src/lib/types/eventTypes/legendEvent.d.ts +1 -1
- package/src/lib/types/toasterMessage.d.ts +1 -0
- package/src/lib/components/footer/footer.d.ts +0 -10
- package/src/lib/components/footer/index.d.ts +0 -1
- package/src/lib/components/pageMenu/Navigation/applicationList.d.ts +0 -3
- package/src/lib/components/pageMenu/defaultAccordionItem.d.ts +0 -12
- package/src/lib/components/pageMenu/index.d.ts +0 -3
- package/src/lib/components/pageMenu/pageMenu.d.ts +0 -15
- package/src/lib/components/pageMenu/pageMenuDrawerItem.d.ts +0 -16
- package/src/lib/components/pageMenu/settings/asset.d.ts +0 -6
- package/src/lib/components/pageMenu/settings/profile.d.ts +0 -6
- package/src/lib/components/pageMenu/settings/settings.d.ts +0 -7
- package/src/lib/components/pageMenu/version/version.d.ts +0 -3
- package/src/lib/components/searchMenu/index.d.ts +0 -1
- package/src/lib/components/searchMenu/searchMenu.d.ts +0 -3
- package/src/lib/coreApplication/EchoContentPanels.d.ts +0 -9
- package/src/lib/services/deviceInformation/deepDeviceInfo.d.ts +0 -41
- package/src/lib/services/deviceInformation/deviceInfo.d.ts +0 -45
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.16.0
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 0.7.0 < 0.8.0",
|
|
6
|
-
"@equinor/echo-components": "0.9.0
|
|
6
|
+
"@equinor/echo-components": ">= 0.9.0 < 0.10.0",
|
|
7
7
|
"@equinor/echo-core": ">= 0.9.0 < 0.10.0",
|
|
8
8
|
"@equinor/echo-search": ">= 0.15.0 < 0.16.0",
|
|
9
9
|
"@equinor/echo-utils": ">= 0.3.0 < 0.4.0",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"history": "5.3.0",
|
|
17
17
|
"lodash": "4.17.21",
|
|
18
18
|
"react-router-dom": "5.3.4",
|
|
19
|
-
"ua-parser-js": "1.0.36",
|
|
20
19
|
"zustand": "4.4.1"
|
|
21
20
|
},
|
|
22
21
|
"main": "./index.cjs.js",
|
package/src/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { getLegendStatusColor } from './lib/feature/legend/utils/legendUtils';
|
|
2
3
|
import './lib/globalStyles.css';
|
|
3
4
|
import { getPlantsInfo, getTagDetails } from './lib/services/api';
|
|
4
|
-
import { getLegendStatusColor } from './lib/utils/legendUtils';
|
|
5
5
|
export * from './lib/components';
|
|
6
6
|
export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAccess';
|
|
7
7
|
export * from './lib/coreApplication';
|
|
8
|
+
export * from './lib/feature/legend/index';
|
|
8
9
|
export { RegisteredHookName } from './lib/hooks/hookLibrary';
|
|
9
10
|
export { useIsCompactLayout } from './lib/hooks/useIsCompactLayout';
|
|
10
11
|
export { useIsFullScreenModeEnabled } from './lib/hooks/useIsFullScreenModeEnabled';
|
|
11
12
|
export { useScreenOrientation } from './lib/hooks/useScreenOrientation';
|
|
12
13
|
export { useScreenValues } from './lib/hooks/useScreenValues';
|
|
14
|
+
export * from './lib/services/activeSelectionStore';
|
|
13
15
|
export { RegisteredComponentName } from './lib/services/componentRegistry/componentRegistry';
|
|
14
|
-
export { DetailedDeviceInformationProvider, detailedDeviceInformationProvider } from './lib/services/deviceInformation/deepDeviceInfo';
|
|
15
|
-
export { DeviceInformation, deviceInfo } from './lib/services/deviceInformation/deviceInfo';
|
|
16
16
|
export * from './lib/services/eventHubActions';
|
|
17
17
|
export * from './lib/services/searchItemDetails/searchItemDetails.store';
|
|
18
18
|
export { SearchItemDetailsSideSheet } from './lib/services/searchItemDetails/searchItemDetailsSideSheet';
|
|
@@ -22,11 +22,9 @@ export type { EchoHubPlant } from './lib/types/echoHubPlant';
|
|
|
22
22
|
export * from './lib/types/eventTypes';
|
|
23
23
|
export * from './lib/types/extensions';
|
|
24
24
|
export type { SetActiveTagNo, TagData } from './lib/types/hookLibrary';
|
|
25
|
-
export { LegendStatus, LegendType } from './lib/types/legend';
|
|
26
25
|
export type { ModelPermissions } from './lib/types/modelPermissions';
|
|
27
26
|
export { PingableSources } from './lib/types/pingableSources';
|
|
28
27
|
export * from './lib/utils';
|
|
29
|
-
export { getLegendStatusColor, legendTypeToLegendStatus, toLegendStatusOrString, valueToEnum } from './lib/utils/legendUtils';
|
|
30
28
|
export * from './lib/utils/startup';
|
|
31
29
|
export declare const registerEchopediaComponent: ({ name, component }: {
|
|
32
30
|
name: import("./lib/services/componentRegistry/componentRegistry").RegisteredComponentName;
|
|
@@ -6,11 +6,9 @@ export * from './echo3DButton';
|
|
|
6
6
|
export { EchoLogo } from './echoLogo/echoLogo';
|
|
7
7
|
export * from './errorBoundary';
|
|
8
8
|
export * from './externalLinkButton/externalLinkButton';
|
|
9
|
-
export * from './footer';
|
|
10
9
|
export * from './fullScreenButtons';
|
|
11
10
|
export * from './lazyLoading';
|
|
12
11
|
export * from './mediator';
|
|
13
|
-
export * from './pageMenu';
|
|
14
12
|
export * from './panel';
|
|
15
13
|
export * from './panelButton';
|
|
16
14
|
export * from './plantSelector';
|
|
@@ -18,6 +16,5 @@ export * from './prepview';
|
|
|
18
16
|
export * from './projectSelector';
|
|
19
17
|
export * from './realTimeData';
|
|
20
18
|
export * from './router';
|
|
21
|
-
export * from './searchMenu';
|
|
22
19
|
export * from './tagNumber';
|
|
23
20
|
export * from './toaster';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { LegendStatus, LegendType } from './legend';
|
|
2
|
+
export type { LegendItemStatus } from './legend';
|
|
3
|
+
export { createChipStatusProps } from './utils/createChipStatusProps';
|
|
4
|
+
export { getLegendStatusColor, legendTypeToLegendStatus, toLegendStatusOrString, valueToEnum } from './utils/legendUtils';
|
|
5
|
+
export { statusHelper } from './utils/statusHelper';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
export type LegendItemStatus = LegendStatus | string;
|
|
1
2
|
export declare enum LegendStatus {
|
|
2
3
|
Unknown = "Unknown",
|
|
4
|
+
Multiple = "Multiple",
|
|
5
|
+
ApiError = "Api Error: Failed to get data for legend",
|
|
3
6
|
AsBuilt = "AsBuilt",
|
|
4
7
|
Planned = "Planned",
|
|
5
8
|
Reserved = "Reserved",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TagIconChipsProps } from '@equinor/echo-components';
|
|
2
|
+
import { LegendItemStatus } from '../legend';
|
|
3
|
+
export declare function createChipStatusProps(args: {
|
|
4
|
+
tagCategoryDescription: string;
|
|
5
|
+
status: LegendItemStatus;
|
|
6
|
+
isChipsEnabled: boolean;
|
|
7
|
+
}): TagIconChipsProps;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LegendItemStatus } from '../legend';
|
|
2
|
+
/**
|
|
3
|
+
* Converts to a list of single statuses
|
|
4
|
+
* @example "M1+M2+M3" becomes: ["M1", "M2", "M3"]
|
|
5
|
+
*/
|
|
6
|
+
declare function toSingleStatuses(statusesConcatedWithPlus?: LegendItemStatus): LegendItemStatus[];
|
|
7
|
+
/**
|
|
8
|
+
* Returns a string with all statuses joined by +
|
|
9
|
+
* * @example ["M1", "M2", "M3"] becomes: "M1+M2+M3"
|
|
10
|
+
*/
|
|
11
|
+
declare function toMultiStatus(statuses: ReadonlyArray<LegendItemStatus>): LegendItemStatus;
|
|
12
|
+
declare function hasMultiStatuses(statuses: LegendItemStatus): boolean;
|
|
13
|
+
declare function isSingleStatus(status: LegendItemStatus): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Converts to a list of single statuses
|
|
16
|
+
* @example ["M1", "M2", "M1+M2+M3"] becomes: ["M1", "M2", "M3", "Multiple"]
|
|
17
|
+
* @example ["M1", "M2"] stays the same: ["M1", "M2"]
|
|
18
|
+
*/
|
|
19
|
+
declare function multiListToSingleList(statuses: ReadonlyArray<LegendItemStatus>): string[];
|
|
20
|
+
export declare const statusHelper: {
|
|
21
|
+
toMultiStatus: typeof toMultiStatus;
|
|
22
|
+
toSingleStatuses: typeof toSingleStatuses;
|
|
23
|
+
hasMultiStatuses: typeof hasMultiStatuses;
|
|
24
|
+
isSingleStatus: typeof isSingleStatus;
|
|
25
|
+
multiListToSingleList: typeof multiListToSingleList;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as zustand from 'zustand';
|
|
2
|
+
export declare const useActiveSelectionStore: zustand.UseBoundStore<zustand.StoreApi<ActiveSelectionState>>;
|
|
3
|
+
export type ActiveSelectionItemType = 'tagNos' | 'workOrderIds' | 'measuringPointIds';
|
|
4
|
+
export type ActiveSelectionItems = {
|
|
5
|
+
[key in ActiveSelectionItemType]: string[];
|
|
6
|
+
};
|
|
7
|
+
export interface ActiveSelectionState {
|
|
8
|
+
items: ActiveSelectionItems;
|
|
9
|
+
userRequestAction: string | null;
|
|
10
|
+
actions: ActiveSelectionActions;
|
|
11
|
+
}
|
|
12
|
+
interface ActiveSelectionActions {
|
|
13
|
+
addToSelectionByType: (itemType: ActiveSelectionItemType, items: string[]) => void;
|
|
14
|
+
removeFromSelectionByType: (itemType: ActiveSelectionItemType, items: string[]) => void;
|
|
15
|
+
clearSelectionByType: (itemType: ActiveSelectionItemType) => void;
|
|
16
|
+
clearSelectionForAllTypes: () => void;
|
|
17
|
+
replaceSelection: (items: ActiveSelectionItems, action?: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './activeSelectionStore';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './footer';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type DefaultAccordionItemProps = {
|
|
3
|
-
isExpanded: boolean;
|
|
4
|
-
handleClick: () => void;
|
|
5
|
-
title: string;
|
|
6
|
-
subtitle?: string;
|
|
7
|
-
iconName: string;
|
|
8
|
-
iconTitle: string;
|
|
9
|
-
children: React.ReactChild | React.ReactChild[];
|
|
10
|
-
};
|
|
11
|
-
declare const DefaultAccordionItem: React.FC<DefaultAccordionItemProps>;
|
|
12
|
-
export default DefaultAccordionItem;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface PageMenuProps {
|
|
3
|
-
trackEventOpenExternalLink: (linkTo: string) => void;
|
|
4
|
-
isSyncing: boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Component for displaying a side menu including Home button, Profile, About Echo link and Terms & Conditions link.
|
|
8
|
-
* @param {PageMenuProps} {
|
|
9
|
-
* trackEventOpenExternalLink: Function for tracking event in appInsight.
|
|
10
|
-
* isSyncing: Flag to determine whether the app is currently syncing data or not.
|
|
11
|
-
* }
|
|
12
|
-
* @return {*}
|
|
13
|
-
*/
|
|
14
|
-
export declare const PageMenu: React.FC<PageMenuProps>;
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ExternalLinkProps {
|
|
3
|
-
link: string;
|
|
4
|
-
linkText: string;
|
|
5
|
-
trackEvent: string;
|
|
6
|
-
}
|
|
7
|
-
interface PageMenuDrawerItemProps {
|
|
8
|
-
iconName: string;
|
|
9
|
-
iconTitle: string;
|
|
10
|
-
trackEventOpenExternalLink: (linkTo: string) => void;
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
externalLink?: ExternalLinkProps;
|
|
13
|
-
classNames?: string;
|
|
14
|
-
}
|
|
15
|
-
declare const PageMenuDrawerItem: React.FC<PageMenuDrawerItemProps>;
|
|
16
|
-
export default PageMenuDrawerItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './searchMenu';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Panel } from '@equinor/echo-core';
|
|
2
|
-
/**
|
|
3
|
-
* Core Main menu panel registered at client startup
|
|
4
|
-
*/
|
|
5
|
-
export declare const mainMenu: Panel;
|
|
6
|
-
/**
|
|
7
|
-
* Core Application search panel registered at client startup
|
|
8
|
-
*/
|
|
9
|
-
export declare const searchPanel: Panel;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/// <reference types="user-agent-data-types" />
|
|
2
|
-
import UAParser from 'ua-parser-js';
|
|
3
|
-
import { DetailedDeviceInformation } from '../../types/device';
|
|
4
|
-
/**
|
|
5
|
-
* This object is concerned with gathering and holding information about the users device.
|
|
6
|
-
* This object will be read-only after initialization and should as a rule throw errors if the
|
|
7
|
-
* deviceInformation property is altered after intialization.
|
|
8
|
-
*/
|
|
9
|
-
declare class DetailedDeviceInformationProvider {
|
|
10
|
-
/** Represents the user agent string parser.
|
|
11
|
-
* This method is treated as a fallback if the User-Agent Client Hints API does not provide a coherent value
|
|
12
|
-
* or if the browser does not yet support it.
|
|
13
|
-
*/
|
|
14
|
-
private readonly _uaParser;
|
|
15
|
-
/**
|
|
16
|
-
* Stores the system report from a call to the underlying system.
|
|
17
|
-
* - If this is undefined, it is not yet initialized (it happens asynchronously).
|
|
18
|
-
*/
|
|
19
|
-
private readonly _uaDataValues;
|
|
20
|
-
/** Holds the current device information and should be the single source of truth.
|
|
21
|
-
*
|
|
22
|
-
* It can be undefined because we have to asynchronously fetch underlying system information.
|
|
23
|
-
*/
|
|
24
|
-
private readonly _deviceInformation;
|
|
25
|
-
private constructor();
|
|
26
|
-
get deviceInformation(): DetailedDeviceInformation;
|
|
27
|
-
get uaDataValues(): UADataValues | null | undefined;
|
|
28
|
-
get uaParser(): UAParser.UAParserInstance;
|
|
29
|
-
/** Constructs the parser and returns it. */
|
|
30
|
-
static initialize(): DetailedDeviceInformationProvider;
|
|
31
|
-
private static getPlatform;
|
|
32
|
-
private static getWebBrowser;
|
|
33
|
-
private static getOperatingSystem;
|
|
34
|
-
/**
|
|
35
|
-
* TODO: Get the device model from Client Hints API.
|
|
36
|
-
* This requires top-level await support, which in turn has to be implemented to modules downstream.
|
|
37
|
-
*/
|
|
38
|
-
private static getDeviceModel;
|
|
39
|
-
}
|
|
40
|
-
declare const detailedDeviceInformationProvider: DetailedDeviceInformationProvider;
|
|
41
|
-
export { DetailedDeviceInformationProvider, detailedDeviceInformationProvider };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Browser, DetailedDeviceInformation, DeviceType, IDeviceSummary, ScreenDimensions, ScreenOrientation, UserInput } from '../../types/device';
|
|
2
|
-
import { detailedDeviceInformationProvider } from './deepDeviceInfo';
|
|
3
|
-
type Props = {
|
|
4
|
-
detailedDeviceInfo: typeof detailedDeviceInformationProvider;
|
|
5
|
-
};
|
|
6
|
-
declare class DeviceInformation {
|
|
7
|
-
/**
|
|
8
|
-
* Represents the current viewport orientation.
|
|
9
|
-
* If the viewport is square, it will default to portrait.
|
|
10
|
-
*/
|
|
11
|
-
private _orientation;
|
|
12
|
-
/**
|
|
13
|
-
* Represents an abstracted device type: desktop, tablet or mobile.
|
|
14
|
-
*/
|
|
15
|
-
private readonly _deviceType;
|
|
16
|
-
/**
|
|
17
|
-
* Represents the current input source.
|
|
18
|
-
* Note: On a touchscreen device which has a mouse plugged in, it will return the mouse.
|
|
19
|
-
*/
|
|
20
|
-
private readonly _userInput;
|
|
21
|
-
private readonly _browser?;
|
|
22
|
-
/**
|
|
23
|
-
* Represents the viewport (layout and visual) and (full)screen dimensions.
|
|
24
|
-
* WebKit browsers prior to 15 will only support layout dimensions.
|
|
25
|
-
*/
|
|
26
|
-
private _dimensions;
|
|
27
|
-
protected orientationIsLandscapeQuery: MediaQueryList;
|
|
28
|
-
private _detailedDeviceInfo;
|
|
29
|
-
constructor(props: Props);
|
|
30
|
-
private getUpdatedScreenDimensions;
|
|
31
|
-
private getBrowser;
|
|
32
|
-
private getUserInput;
|
|
33
|
-
/** Returns the current viewing medium.*/
|
|
34
|
-
private getDeviceType;
|
|
35
|
-
private getOrientation;
|
|
36
|
-
getDeviceDetails(): DetailedDeviceInformation;
|
|
37
|
-
get orientation(): ScreenOrientation;
|
|
38
|
-
get deviceType(): DeviceType;
|
|
39
|
-
get userInput(): UserInput;
|
|
40
|
-
get screenDimensions(): ScreenDimensions;
|
|
41
|
-
get browser(): Browser | undefined;
|
|
42
|
-
getDeviceSummary(): IDeviceSummary;
|
|
43
|
-
}
|
|
44
|
-
declare const deviceInfo: DeviceInformation;
|
|
45
|
-
export { deviceInfo, DeviceInformation };
|