@equinor/echo-framework 0.7.11 → 0.7.12
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/dist/components/panel/corePanelLeft.d.ts +4 -1
- package/dist/components/panel/corePanelRight.d.ts +4 -1
- package/dist/coreApplication/EchoBarComponent.d.ts +6 -0
- package/dist/coreApplication/EchoContent.d.ts +1 -0
- package/dist/coreApplication/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useIsLandscape.d.ts +1 -0
- package/dist/hooks/useScreenOrientation.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/src/components/containers/layout.module.css.js +4 -1
- package/dist/src/components/containers/layouts.js +57 -9
- package/dist/src/components/footer/footer.module.css.js +1 -1
- package/dist/src/components/panel/corePanelLeft.js +5 -2
- package/dist/src/components/panel/corePanelLeft.module.css.js +1 -1
- package/dist/src/components/panel/corePanelRight.js +4 -2
- package/dist/src/components/panel/corePanelRight.module.css.js +1 -1
- package/dist/src/coreApplication/EchoBarComponent.js +190 -0
- package/dist/src/coreApplication/EchoContent.js +7 -2
- package/dist/src/coreApplication/EchoContent.module.css.js +20 -0
- package/dist/src/globalStyles.css.js +1 -1
- package/dist/src/hooks/index.js +6 -0
- package/dist/src/hooks/useIsLandscape.js +52 -0
- package/dist/src/hooks/useScreenOrientation.js +44 -0
- package/dist/src/index.js +15 -0
- package/package.json +2 -2
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsLandscape(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useScreenOrientation(): "landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary";
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import './theme/theme.css';
|
|
|
5
5
|
import { getLegendStatusColor } from './utils/legendUtils';
|
|
6
6
|
export * from './components';
|
|
7
7
|
export * from './coreApplication';
|
|
8
|
+
export * from './hooks';
|
|
8
9
|
export { RegisteredHookName } from './hooks/hookLibrary';
|
|
9
10
|
export { RegisteredComponentName } from './services/componentRegistry/componentRegistry';
|
|
10
11
|
export * from './services/eventHubActions';
|
|
@@ -33,6 +34,8 @@ declare const EchoFramework: Readonly<{
|
|
|
33
34
|
useEchoHistory(): (path: string, params?: {
|
|
34
35
|
[key: string]: string;
|
|
35
36
|
} | undefined, state?: any) => void;
|
|
37
|
+
useIsLandscape(): boolean;
|
|
38
|
+
useScreenOrientation(): "landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary";
|
|
36
39
|
useTagDetails({ tagNo, instCode }: {
|
|
37
40
|
tagNo: string;
|
|
38
41
|
instCode: string;
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".layout-module_applicationWrapper__adzds{animation:layout-module_fadeIn__-OF4H 2s;background-color:#fff;background-image:url(../../images/frontpage-brand-placeholder-vert.jpg);background-size:cover;height:100%;overflow:auto;width:100%}@keyframes layout-module_fadeIn__-OF4H{0%{opacity:0}to{opacity:1}}@media screen and (min-width:640px){.layout-module_applicationWrapper__adzds{background-image:none}}.layout-module_mainLayoutWrapper__4kuIT{height:100%;overflow:hidden;width:100%}.layout-module_bgTransparent__bBfb-{background-color:transparent}.layout-module_footerDisclaimer__-F6dv{font-size:.7rem}.layout-module_footerLogo__CBb-F{max-height:2.5rem}.layout-module_fullBodyHeight__hQfe5{min-height:calc(100vh - 75px)!important;padding-bottom:16px}.layout-module_navbarBrand__2IOPY{color:red}::selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}.layout-module_colorLayout__VHJcU{background-color:#eaf4f9;height:100%;overflow:hidden;position:relative;width:100%}.layout-module_pdfViewerNative__hnAgy{background-color:#323639;height:100%;overflow:hidden;padding-top:6.5rem;position:relative;width:100%}.layout-module_noPadding__7amV4{padding:0}.layout-module_noMargin__1eUBf{margin:0}";
|
|
9
|
+
var css_248z = ".layout-module_echoContentContainer__0debO{height:100%}.layout-module_applicationWrapper__adzds{animation:layout-module_fadeIn__-OF4H 2s;background-color:#fff;background-image:url(../../images/frontpage-brand-placeholder-vert.jpg);background-size:cover;height:100%;overflow:auto;position:relative;width:100%}@keyframes layout-module_fadeIn__-OF4H{0%{opacity:0}to{opacity:1}}@media screen and (min-width:640px){.layout-module_applicationWrapper__adzds{background-image:none}}.layout-module_mainLayoutWrapper__4kuIT{height:100%;overflow:hidden;width:100%}.layout-module_bgTransparent__bBfb-{background-color:transparent}.layout-module_footerDisclaimer__-F6dv{font-size:.7rem}.layout-module_footerLogo__CBb-F{max-height:2.5rem}.layout-module_fullBodyHeight__hQfe5{min-height:calc(100vh - 75px)!important;padding-bottom:16px}.layout-module_navbarBrand__2IOPY{color:red}::selection{background-color:#cce2ff;color:rgba(0,0,0,.87)}.layout-module_colorLayout__VHJcU{background-color:#eaf4f9;height:100%;overflow:hidden;position:relative;width:100%}.layout-module_pdfViewerNative__hnAgy{background-color:#323639;height:100%;overflow:hidden;padding-top:6.5rem;position:relative;width:100%}.layout-module_cameraLayout__iVPug{background-color:\"transparent\"}.layout-module_cameraLayout__iVPug,.layout-module_defaultLayout__3MIwa{height:100%;position:relative;width:100%}.layout-module_noPadding__7amV4{padding:0}.layout-module_noMargin__1eUBf{margin:0}@media screen and (orientation:landscape){.layout-module_echoContentContainer__0debO{display:flex;flex-direction:row}.layout-module_applicationWrapper__adzds,.layout-module_cameraLayout__iVPug,.layout-module_colorLayout__VHJcU,.layout-module_defaultLayout__3MIwa,.layout-module_pdfViewerNative__hnAgy{width:calc(100% - 48px)}}@media screen and (orientation:portrait){.layout-module_applicationWrapper__adzds,.layout-module_cameraLayout__iVPug,.layout-module_colorLayout__VHJcU,.layout-module_defaultLayout__3MIwa,.layout-module_pdfViewerNative__hnAgy{height:calc(100% - 48px)}}";
|
|
10
10
|
var style = {
|
|
11
|
+
"echoContentContainer": "layout-module_echoContentContainer__0debO",
|
|
11
12
|
"applicationWrapper": "layout-module_applicationWrapper__adzds",
|
|
12
13
|
"fadeIn": "layout-module_fadeIn__-OF4H",
|
|
13
14
|
"mainLayoutWrapper": "layout-module_mainLayoutWrapper__4kuIT",
|
|
@@ -18,6 +19,8 @@ var style = {
|
|
|
18
19
|
"navbarBrand": "layout-module_navbarBrand__2IOPY",
|
|
19
20
|
"colorLayout": "layout-module_colorLayout__VHJcU",
|
|
20
21
|
"pdfViewerNative": "layout-module_pdfViewerNative__hnAgy",
|
|
22
|
+
"cameraLayout": "layout-module_cameraLayout__iVPug",
|
|
23
|
+
"defaultLayout": "layout-module_defaultLayout__3MIwa",
|
|
21
24
|
"noPadding": "layout-module_noPadding__7amV4",
|
|
22
25
|
"noMargin": "layout-module_noMargin__1eUBf"
|
|
23
26
|
};
|
|
@@ -8,6 +8,16 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
8
8
|
|
|
9
9
|
var React = require('react');
|
|
10
10
|
|
|
11
|
+
var EchoBarComponent = require('../../coreApplication/EchoBarComponent.js');
|
|
12
|
+
|
|
13
|
+
require('@equinor/echo-core');
|
|
14
|
+
|
|
15
|
+
require('react-router-dom');
|
|
16
|
+
|
|
17
|
+
var useScreenOrientation = require('../../hooks/useScreenOrientation.js');
|
|
18
|
+
|
|
19
|
+
require('@equinor/echo-search');
|
|
20
|
+
|
|
11
21
|
var layout_module = require('./layout.module.css.js');
|
|
12
22
|
|
|
13
23
|
function _interopDefaultLegacy(e) {
|
|
@@ -20,39 +30,77 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
20
30
|
|
|
21
31
|
var MainLayout = function MainLayout(_ref) {
|
|
22
32
|
var children = _ref.children;
|
|
33
|
+
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
34
|
+
var isLandscape = screenOrientation === 'landscape-primary' || screenOrientation === 'landscape-secondary';
|
|
23
35
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
24
36
|
className: layout_module["default"].applicationWrapper
|
|
25
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
37
|
+
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
38
|
+
isLandscape: isLandscape
|
|
39
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26
40
|
className: layout_module["default"].mainLayoutWrapper
|
|
27
|
-
}, children)
|
|
41
|
+
}, children), !isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
42
|
+
isLandscape: isLandscape
|
|
43
|
+
}));
|
|
28
44
|
};
|
|
29
45
|
|
|
30
46
|
var ColorLayout = function ColorLayout(_ref2) {
|
|
31
47
|
var children = _ref2.children;
|
|
48
|
+
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
49
|
+
var isLandscape = screenOrientation === 'landscape-primary' || screenOrientation === 'landscape-secondary';
|
|
32
50
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
51
|
+
className: layout_module["default"].echoContentContainer
|
|
52
|
+
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
53
|
+
isLandscape: isLandscape
|
|
54
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
33
55
|
className: layout_module["default"].colorLayout
|
|
34
|
-
}, children)
|
|
56
|
+
}, children), !isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
57
|
+
isLandscape: isLandscape
|
|
58
|
+
}));
|
|
35
59
|
};
|
|
36
60
|
|
|
37
61
|
var PdfViewerNative = function PdfViewerNative(_ref3) {
|
|
38
62
|
var children = _ref3.children;
|
|
63
|
+
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
64
|
+
var isLandscape = screenOrientation === 'landscape-primary' || screenOrientation === 'landscape-secondary';
|
|
39
65
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
66
|
+
className: layout_module["default"].echoContentContainer
|
|
67
|
+
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
68
|
+
isLandscape: isLandscape
|
|
69
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
40
70
|
className: layout_module["default"].pdfViewerNative
|
|
41
|
-
}, children)
|
|
71
|
+
}, children), !isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
72
|
+
isLandscape: isLandscape
|
|
73
|
+
}));
|
|
42
74
|
};
|
|
43
75
|
|
|
44
76
|
var CameraLayout = function CameraLayout(_ref4) {
|
|
45
77
|
var children = _ref4.children;
|
|
78
|
+
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
79
|
+
var isLandscape = screenOrientation === 'landscape-primary' || screenOrientation === 'landscape-secondary';
|
|
46
80
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
81
|
+
className: layout_module["default"].echoContentContainer
|
|
82
|
+
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
83
|
+
isLandscape: isLandscape
|
|
84
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
85
|
+
className: layout_module["default"].cameraLayout
|
|
86
|
+
}, children), !isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
87
|
+
isLandscape: isLandscape
|
|
88
|
+
}));
|
|
51
89
|
};
|
|
52
90
|
|
|
53
91
|
var DefaultLayout = function DefaultLayout(_ref5) {
|
|
54
92
|
var children = _ref5.children;
|
|
55
|
-
|
|
93
|
+
var screenOrientation = useScreenOrientation.useScreenOrientation();
|
|
94
|
+
var isLandscape = screenOrientation === 'landscape-primary' || screenOrientation === 'landscape-secondary';
|
|
95
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
96
|
+
className: layout_module["default"].echoContentContainer
|
|
97
|
+
}, isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
98
|
+
isLandscape: isLandscape
|
|
99
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
100
|
+
className: layout_module["default"].defaultLayout
|
|
101
|
+
}, children), !isLandscape && /*#__PURE__*/React__default["default"].createElement(EchoBarComponent.EchoBarComponent, {
|
|
102
|
+
isLandscape: isLandscape
|
|
103
|
+
}));
|
|
56
104
|
};
|
|
57
105
|
|
|
58
106
|
exports.CameraLayout = CameraLayout;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".footer-module_echoFooter__6xy2c{background:#fff;bottom:0;display:flex;left:0;position:fixed}@media screen and (min-width:360px){.footer-module_echoFooter__6xy2c{height:33px}}@media screen and (min-width:640px){.footer-module_echoFooter__6xy2c{height:56px;width:100%}}p.footer-module_footerDisclaimer__sJJ5f{font-size:10px;width:100%}.footer-module_footerLogo__ttZmv{display:none;float:right;margin:0 0 12px;max-height:2.5rem;padding:12px 16px;width:74px}.footer-module_tosFooter__9mGDz{background:#fff;bottom:0;height:33px;left:0;position:fixed;width:100%}@media screen and (min-width:640px){p.footer-module_footerDisclaimer__sJJ5f{line-height:32px;margin:0;padding:12px 16px}.footer-module_footerLogo__ttZmv{display:block}.footer-module_tosFooter__9mGDz{height:56px}}";
|
|
9
|
+
var css_248z = ".footer-module_echoFooter__6xy2c{background:#fff;bottom:0;display:flex;left:0;position:fixed}@media screen and (max-width:767px) and (orientation:portrait){.footer-module_echoFooter__6xy2c{bottom:48px}}@media screen and (max-width:927px) and (orientation:landscape){.footer-module_echoFooter__6xy2c{left:48px}}@media screen and (min-width:360px){.footer-module_echoFooter__6xy2c{height:33px}}@media screen and (min-width:640px){.footer-module_echoFooter__6xy2c{height:56px;width:100%}}p.footer-module_footerDisclaimer__sJJ5f{font-size:10px;width:100%}.footer-module_footerLogo__ttZmv{display:none;float:right;margin:0 0 12px;max-height:2.5rem;padding:12px 16px;width:74px}.footer-module_tosFooter__9mGDz{background:#fff;bottom:0;height:33px;left:0;position:fixed;width:100%}@media screen and (min-width:640px){p.footer-module_footerDisclaimer__sJJ5f{line-height:32px;margin:0;padding:12px 16px}.footer-module_footerLogo__ttZmv{display:block}.footer-module_tosFooter__9mGDz{height:56px}}";
|
|
10
10
|
var style = {
|
|
11
11
|
"echoFooter": "footer-module_echoFooter__6xy2c",
|
|
12
12
|
"footerDisclaimer": "footer-module_footerDisclaimer__sJJ5f",
|
|
@@ -40,7 +40,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
40
40
|
|
|
41
41
|
edsIons.edsIcons();
|
|
42
42
|
|
|
43
|
-
var CorePanelLeft = function CorePanelLeft() {
|
|
43
|
+
var CorePanelLeft = function CorePanelLeft(_ref) {
|
|
44
|
+
var isToggleButtonVisible = _ref.isToggleButtonVisible;
|
|
45
|
+
|
|
44
46
|
var _a;
|
|
45
47
|
|
|
46
48
|
var _EchoCore$usePanels = EchoCore.usePanels(),
|
|
@@ -72,7 +74,8 @@ var CorePanelLeft = function CorePanelLeft() {
|
|
|
72
74
|
style: panelUI.panelButton
|
|
73
75
|
}, panels.map(function (panel, i) {
|
|
74
76
|
var Icon = panel.icon;
|
|
75
|
-
|
|
77
|
+
var showPanel = isToggleButtonVisible || panel.key !== 'echoCoreMain';
|
|
78
|
+
return showPanel && /*#__PURE__*/React__default["default"].createElement(panelButton["default"], {
|
|
76
79
|
key: i,
|
|
77
80
|
onClick: function onClick(e) {
|
|
78
81
|
e.stopPropagation();
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".corePanelLeft-module_wrapper__d2Omx{height:100%;left:-550px;max-width:550px;position:fixed;top:0;transition:
|
|
9
|
+
var css_248z = ".corePanelLeft-module_wrapper__d2Omx{height:100%;left:-550px;max-width:550px;position:fixed;top:0;transition:all .4s ease-in-out;width:550px;z-index:2}@media screen and (max-width:550px){.corePanelLeft-module_wrapperClosed__Zd1CL{left:-75vw;max-width:75vw;width:75vw}.corePanelLeft-module_active__-A3TW{width:100%}}.corePanelLeft-module_active__-A3TW{left:0;z-index:var(--echo-framework-z-level-panel)}.corePanelLeft-module_drawer__Wdb3G{background-color:#fff;border-left:2px solid #f7f7f7;box-shadow:0 6px 4px #00000040;display:flex;flex-direction:column;height:100%;opacity:0;overflow-y:hidden;position:relative;transition:opacity .4s ease-in-out;width:auto}.corePanelLeft-module_active__-A3TW .corePanelLeft-module_drawer__Wdb3G{opacity:1}.corePanelLeft-module_buttonContainer__bs-Uu{display:flex;flex-direction:column;position:absolute;right:-70px;top:0}@media screen and (max-width:927px) and (orientation:landscape){.corePanelLeft-module_buttonContainer__bs-Uu{right:-118px}}.corePanelLeft-module_button__SqyKk{margin-left:var(--medium);margin-top:var(--small)}";
|
|
10
10
|
var style = {
|
|
11
11
|
"wrapper": "corePanelLeft-module_wrapper__d2Omx",
|
|
12
12
|
"wrapperClosed": "corePanelLeft-module_wrapperClosed__Zd1CL",
|
|
@@ -42,7 +42,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
42
42
|
|
|
43
43
|
edsIons.edsIcons();
|
|
44
44
|
|
|
45
|
-
var CorePanelRight = function CorePanelRight() {
|
|
45
|
+
var CorePanelRight = function CorePanelRight(_ref) {
|
|
46
|
+
var isToggleButtonVisible = _ref.isToggleButtonVisible;
|
|
47
|
+
|
|
46
48
|
var _a;
|
|
47
49
|
|
|
48
50
|
var _EchoCore$usePanels = EchoCore.usePanels('right'),
|
|
@@ -74,7 +76,7 @@ var CorePanelRight = function CorePanelRight() {
|
|
|
74
76
|
style: panelUI.panelButton
|
|
75
77
|
}, panels.map(function (panel, i) {
|
|
76
78
|
var PanelIcon = panel.icon;
|
|
77
|
-
return /*#__PURE__*/React__default["default"].createElement(panelButton["default"], {
|
|
79
|
+
return isToggleButtonVisible && /*#__PURE__*/React__default["default"].createElement(panelButton["default"], {
|
|
78
80
|
key: i,
|
|
79
81
|
label: panel.label,
|
|
80
82
|
variant: panel.key === EchoCore.ECHO_CORE_MAIN ? panelButton.Variants.NotificationButton : panelButton.Variants.OpenCloseButton,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var styleInject_es = require('../../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
8
|
|
|
9
|
-
var css_248z = ".corePanelRight-module_wrapper__YN3Zr{height:100%;max-width:
|
|
9
|
+
var css_248z = ".corePanelRight-module_wrapper__YN3Zr{height:100%;max-width:550px;position:fixed;right:-352px;top:0;transition:all .4s ease-in-out;width:352px;z-index:2}@media screen and (max-width:550px){.corePanelRight-module_active__RIMQt{width:100%}}.corePanelRight-module_active__RIMQt{right:0;z-index:var(--echo-framework-z-level-panel)}@media screen and (max-width:927px) and (orientation:landscape){.corePanelRight-module_wrapper__YN3Zr{left:-352px}.corePanelRight-module_active__RIMQt{left:0;z-index:var(--echo-framework-z-level-panel)}}.corePanelRight-module_drawer__1-ucH{background-color:#fff;border-left:2px solid #f7f7f7;box-shadow:0 6px 4px #00000040;display:flex;flex-direction:column;height:100%;opacity:0;overflow-y:auto;position:relative;transition:opacity .4s ease-in-out;width:auto}.corePanelRight-module_active__RIMQt .corePanelRight-module_drawer__1-ucH{opacity:1}.corePanelRight-module_buttonContainer__62imJ{display:flex;flex-direction:column;left:-90px;position:absolute;top:0}.corePanelRight-module_button__WBdfZ{margin-left:var(--medium);margin-top:var(--small)}";
|
|
10
10
|
var style = {
|
|
11
11
|
"wrapper": "corePanelRight-module_wrapper__YN3Zr",
|
|
12
12
|
"active": "corePanelRight-module_active__RIMQt",
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(exports, '__esModule', {
|
|
18
|
+
value: true
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var echoBase = require('@equinor/echo-base');
|
|
22
|
+
|
|
23
|
+
var echoComponents = require('@equinor/echo-components');
|
|
24
|
+
|
|
25
|
+
var EchoCore = require('@equinor/echo-core');
|
|
26
|
+
|
|
27
|
+
var edsCoreReact = require('@equinor/eds-core-react');
|
|
28
|
+
|
|
29
|
+
var React = require('react');
|
|
30
|
+
|
|
31
|
+
var reactRouterDom = require('react-router-dom');
|
|
32
|
+
|
|
33
|
+
var logo_ee = require('../icons/logo_ee.js');
|
|
34
|
+
|
|
35
|
+
var EchoContent_module = require('./EchoContent.module.css.js');
|
|
36
|
+
|
|
37
|
+
function _interopDefaultLegacy(e) {
|
|
38
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
39
|
+
'default': e
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
44
|
+
|
|
45
|
+
var EchoBarComponent = function EchoBarComponent(_ref) {
|
|
46
|
+
var isLandscape = _ref.isLandscape;
|
|
47
|
+
|
|
48
|
+
var _React$useState = React.useState(false),
|
|
49
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
|
+
shouldRenderBar = _React$useState2[0],
|
|
51
|
+
setShouldRenderBar = _React$useState2[1];
|
|
52
|
+
|
|
53
|
+
var _React$useState3 = React.useState(''),
|
|
54
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
55
|
+
activeKey = _React$useState4[0],
|
|
56
|
+
setActiveKey = _React$useState4[1];
|
|
57
|
+
|
|
58
|
+
var _React$useState5 = React.useState(false),
|
|
59
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
60
|
+
isSyncing = _React$useState6[0],
|
|
61
|
+
setIsSyncing = _React$useState6[1];
|
|
62
|
+
|
|
63
|
+
var _EchoCore$usePanels = EchoCore.usePanels(),
|
|
64
|
+
setActivePanel = _EchoCore$usePanels.setActivePanel;
|
|
65
|
+
|
|
66
|
+
var goToInternalLink = EchoCore.useInternalLink();
|
|
67
|
+
|
|
68
|
+
var _EchoCore$usePlantSet = EchoCore.usePlantSettings(),
|
|
69
|
+
selectedInstCode = _EchoCore$usePlantSet.instCode;
|
|
70
|
+
|
|
71
|
+
var history = reactRouterDom.useHistory();
|
|
72
|
+
var shouldRenderBottomBar = React.useCallback(function () {
|
|
73
|
+
var isMounted = true;
|
|
74
|
+
|
|
75
|
+
if (window.innerWidth < 768 && !isLandscape || window.innerWidth < 927 && isLandscape && isMounted) {
|
|
76
|
+
setShouldRenderBar(true);
|
|
77
|
+
} else {
|
|
78
|
+
setShouldRenderBar(false);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return function () {
|
|
82
|
+
isMounted = false;
|
|
83
|
+
};
|
|
84
|
+
}, [isLandscape]);
|
|
85
|
+
React.useEffect(function () {
|
|
86
|
+
var isMounted = true;
|
|
87
|
+
var unSubscribeSyncing = echoBase.eventHub.subscribe('isSyncing', function (active) {
|
|
88
|
+
if (isMounted) {
|
|
89
|
+
setIsSyncing(active);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return function () {
|
|
93
|
+
isMounted = false;
|
|
94
|
+
unSubscribeSyncing();
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
var onClickButton = function onClickButton(key) {
|
|
99
|
+
setActivePanel('');
|
|
100
|
+
|
|
101
|
+
if (key === activeKey) {
|
|
102
|
+
if (key === 'menu' || key === 'search') {
|
|
103
|
+
setActivePanel('');
|
|
104
|
+
} else {
|
|
105
|
+
history.go(-1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setActiveKey('');
|
|
109
|
+
} else {
|
|
110
|
+
setActiveKey(key);
|
|
111
|
+
|
|
112
|
+
switch (key) {
|
|
113
|
+
case 'home':
|
|
114
|
+
return history.push("/?instCode=".concat(selectedInstCode));
|
|
115
|
+
|
|
116
|
+
case 'search':
|
|
117
|
+
return setActivePanel(EchoCore.ECHO_CORE_SEARCH);
|
|
118
|
+
|
|
119
|
+
case 'camera':
|
|
120
|
+
return goToInternalLink('/camera');
|
|
121
|
+
|
|
122
|
+
case 'menu':
|
|
123
|
+
return setActivePanel(EchoCore.ECHO_CORE_MAIN);
|
|
124
|
+
|
|
125
|
+
default:
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
setActiveKey('');
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
React.useEffect(function () {
|
|
134
|
+
shouldRenderBottomBar();
|
|
135
|
+
window.addEventListener('resize', shouldRenderBottomBar);
|
|
136
|
+
return function () {
|
|
137
|
+
window.removeEventListener('resize', shouldRenderBottomBar);
|
|
138
|
+
};
|
|
139
|
+
}, [shouldRenderBottomBar, shouldRenderBar]);
|
|
140
|
+
var EchoIcon = logo_ee.icon;
|
|
141
|
+
return shouldRenderBar ? /*#__PURE__*/React__default["default"].createElement(echoComponents.EchoBottomBar, {
|
|
142
|
+
style: {
|
|
143
|
+
zIndex: 'var( --echo-framework-z-level-bottom-bar)'
|
|
144
|
+
}
|
|
145
|
+
}, /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
146
|
+
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'home' ? EchoContent_module["default"].activeButton : '')
|
|
147
|
+
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
148
|
+
variant: "ghost_icon",
|
|
149
|
+
onClick: function onClick() {
|
|
150
|
+
return onClickButton('home');
|
|
151
|
+
}
|
|
152
|
+
}, /*#__PURE__*/React__default["default"].createElement(EchoIcon, null))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
153
|
+
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'search' ? EchoContent_module["default"].activeButton : '')
|
|
154
|
+
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
155
|
+
variant: "ghost_icon",
|
|
156
|
+
onClick: function onClick() {
|
|
157
|
+
return onClickButton('search');
|
|
158
|
+
}
|
|
159
|
+
}, /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
160
|
+
name: 'search',
|
|
161
|
+
color: echoComponents.themeConst.echoText
|
|
162
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
163
|
+
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'camera' ? EchoContent_module["default"].activeButton : '')
|
|
164
|
+
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
165
|
+
variant: "ghost_icon",
|
|
166
|
+
onClick: function onClick() {
|
|
167
|
+
return onClickButton('camera');
|
|
168
|
+
}
|
|
169
|
+
}, /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
170
|
+
name: 'camera',
|
|
171
|
+
color: echoComponents.themeConst.echoText
|
|
172
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
173
|
+
className: "".concat(EchoContent_module["default"].barButtons, " ").concat(activeKey === 'menu' ? EchoContent_module["default"].activeButton : '')
|
|
174
|
+
}, /*#__PURE__*/React__default["default"].createElement(edsCoreReact.Button, {
|
|
175
|
+
variant: "ghost_icon",
|
|
176
|
+
onClick: function onClick() {
|
|
177
|
+
return onClickButton('menu');
|
|
178
|
+
}
|
|
179
|
+
}, isSyncing ? /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
180
|
+
className: EchoContent_module["default"].spinningIcon,
|
|
181
|
+
color: echoComponents.themeConst.echoText,
|
|
182
|
+
name: 'sync'
|
|
183
|
+
}) : /*#__PURE__*/React__default["default"].createElement(echoComponents.Icon, {
|
|
184
|
+
name: 'menu',
|
|
185
|
+
color: echoComponents.themeConst.echoText
|
|
186
|
+
}))))) : null;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
exports.EchoBarComponent = EchoBarComponent;
|
|
190
|
+
exports["default"] = EchoBarComponent;
|
|
@@ -24,8 +24,13 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
24
24
|
|
|
25
25
|
var EchoContent = function EchoContent(_ref) {
|
|
26
26
|
var children = _ref.children,
|
|
27
|
-
Legend = _ref.Legend
|
|
28
|
-
|
|
27
|
+
Legend = _ref.Legend,
|
|
28
|
+
isToggleButtonVisible = _ref.isToggleButtonVisible;
|
|
29
|
+
return /*#__PURE__*/React__default["default"].createElement(EchoCore.ModuleContextProvider, null, /*#__PURE__*/React__default["default"].createElement(corePanelLeft["default"], {
|
|
30
|
+
isToggleButtonVisible: isToggleButtonVisible
|
|
31
|
+
}), /*#__PURE__*/React__default["default"].createElement(corePanelRight["default"], {
|
|
32
|
+
isToggleButtonVisible: isToggleButtonVisible
|
|
33
|
+
}), children, Legend && /*#__PURE__*/React__default["default"].createElement(Legend, null));
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
exports.EchoContent = EchoContent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var styleInject_es = require('../../node_modules/style-inject/dist/style-inject.es.js');
|
|
8
|
+
|
|
9
|
+
var css_248z = ".EchoContent-module_mobileWrapper__I1UNf{height:calc(100% - 60px);position:relative}.EchoContent-module_echoContentContainer__-yhpr{height:100%}.EchoContent-module_echoModuleContainer__NsbOv{width:100%}.EchoContent-module_barButtons__F8xrV{height:100%;text-align:center;width:100%}.EchoContent-module_activeButton__5xhQu{border-top:2px solid var(--equiGreen1)}@media screen and (max-width:927px) and (orientation:landscape){.EchoContent-module_activeButton__5xhQu{border-right:2px solid var(--equiGreen1);border-top:0}}@media screen and (orientation:landscape){.EchoContent-module_echoContentContainer__-yhpr{display:flex;flex-direction:row}}@media screen and (orientation:portrait){.EchoContent-module_echoModuleContainer__NsbOv{height:calc(100% - 48px);overflow:hidden}}@keyframes EchoContent-module_spinAnimation__gNXNq{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.EchoContent-module_spinningIcon__am10d{animation:EchoContent-module_spinAnimation__gNXNq 1.5s linear infinite reverse}";
|
|
10
|
+
var style = {
|
|
11
|
+
"mobileWrapper": "EchoContent-module_mobileWrapper__I1UNf",
|
|
12
|
+
"echoContentContainer": "EchoContent-module_echoContentContainer__-yhpr",
|
|
13
|
+
"echoModuleContainer": "EchoContent-module_echoModuleContainer__NsbOv",
|
|
14
|
+
"barButtons": "EchoContent-module_barButtons__F8xrV",
|
|
15
|
+
"activeButton": "EchoContent-module_activeButton__5xhQu",
|
|
16
|
+
"spinningIcon": "EchoContent-module_spinningIcon__am10d",
|
|
17
|
+
"spinAnimation": "EchoContent-module_spinAnimation__gNXNq"
|
|
18
|
+
};
|
|
19
|
+
styleInject_es["default"](css_248z);
|
|
20
|
+
exports["default"] = style;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
var styleInject_es = require('../node_modules/style-inject/dist/style-inject.es.js');
|
|
4
4
|
|
|
5
|
-
var css_248z = "#eds-tooltip-container>div{z-index:var(--echo-framework-z-level-tooltip)}:root{--echo-framework-z-level-panel:500;--echo-framework-z-level-toaster-message:600;--echo-framework-z-level-modal:700;--echo-framework-z-level-overlay:800;--echo-framework-z-level-tooltip:900}";
|
|
5
|
+
var css_248z = "#eds-tooltip-container>div{z-index:var(--echo-framework-z-level-tooltip)}:root{--echo-framework-z-level-panel:500;--echo-framework-z-level-toaster-message:600;--echo-framework-z-level-modal:700;--echo-framework-z-level-overlay:800;--echo-framework-z-level-tooltip:900;--echo-framework-z-level-bottom-bar:1000}";
|
|
6
6
|
styleInject_es["default"](css_248z);
|
package/dist/src/hooks/index.js
CHANGED
|
@@ -6,7 +6,13 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
|
|
7
7
|
var useEchoHistory = require('./useEchoHistory.js');
|
|
8
8
|
|
|
9
|
+
var useIsLandscape = require('./useIsLandscape.js');
|
|
10
|
+
|
|
11
|
+
var useScreenOrientation = require('./useScreenOrientation.js');
|
|
12
|
+
|
|
9
13
|
var useTagDetails = require('./useTagDetails.js');
|
|
10
14
|
|
|
11
15
|
exports.useEchoHistory = useEchoHistory.useEchoHistory;
|
|
16
|
+
exports.useIsLandscape = useIsLandscape.useIsLandscape;
|
|
17
|
+
exports.useScreenOrientation = useScreenOrientation.useScreenOrientation;
|
|
12
18
|
exports.useTagDetails = useTagDetails.useTagDetails;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports, '__esModule', {
|
|
16
|
+
value: true
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var React = require('react');
|
|
20
|
+
|
|
21
|
+
function
|
|
22
|
+
/* content: React.RefObject<HTMLDivElement> */
|
|
23
|
+
useIsLandscape() {
|
|
24
|
+
var _React$useState = React.useState(false),
|
|
25
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26
|
+
isLandscape = _React$useState2[0],
|
|
27
|
+
setIsLandscape = _React$useState2[1];
|
|
28
|
+
|
|
29
|
+
var checkScreenOrientation = React.useCallback(function () {
|
|
30
|
+
var isMounted = true;
|
|
31
|
+
|
|
32
|
+
if (window.innerHeight < window.innerWidth * 0.75 && isMounted) {
|
|
33
|
+
setIsLandscape(true);
|
|
34
|
+
} else {
|
|
35
|
+
setIsLandscape(false);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return function () {
|
|
39
|
+
isMounted = false;
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
React.useEffect(function () {
|
|
43
|
+
checkScreenOrientation();
|
|
44
|
+
window.addEventListener('resize', checkScreenOrientation);
|
|
45
|
+
return function () {
|
|
46
|
+
window.removeEventListener('resize', checkScreenOrientation);
|
|
47
|
+
};
|
|
48
|
+
}, [checkScreenOrientation]);
|
|
49
|
+
return isLandscape;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
exports.useIsLandscape = useIsLandscape;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports, '__esModule', {
|
|
16
|
+
value: true
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var React = require('react');
|
|
20
|
+
|
|
21
|
+
var getOrientation = function getOrientation() {
|
|
22
|
+
return window.screen.orientation.type;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function useScreenOrientation() {
|
|
26
|
+
var _React$useState = React.useState(getOrientation()),
|
|
27
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
28
|
+
orientation = _React$useState2[0],
|
|
29
|
+
setOrientation = _React$useState2[1];
|
|
30
|
+
|
|
31
|
+
var updateOrientation = function updateOrientation(event) {
|
|
32
|
+
setOrientation(getOrientation());
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
React.useEffect(function () {
|
|
36
|
+
window.addEventListener('orientationchange', updateOrientation);
|
|
37
|
+
return function () {
|
|
38
|
+
window.removeEventListener('orientationchange', updateOrientation);
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
41
|
+
return orientation;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.useScreenOrientation = useScreenOrientation;
|
package/dist/src/index.js
CHANGED
|
@@ -94,6 +94,8 @@ var toaster = require('./components/toaster/toaster.js');
|
|
|
94
94
|
|
|
95
95
|
var toasters = require('./components/toaster/toasters.js');
|
|
96
96
|
|
|
97
|
+
var EchoBarComponent = require('./coreApplication/EchoBarComponent.js');
|
|
98
|
+
|
|
97
99
|
var EchoContent = require('./coreApplication/EchoContent.js');
|
|
98
100
|
|
|
99
101
|
var EchoContentPanels = require('./coreApplication/EchoContentPanels.js');
|
|
@@ -112,6 +114,14 @@ var plantInfo = require('./utils/plantInfo.js');
|
|
|
112
114
|
|
|
113
115
|
var startup = require('./utils/startup.js');
|
|
114
116
|
|
|
117
|
+
var useEchoHistory = require('./hooks/useEchoHistory.js');
|
|
118
|
+
|
|
119
|
+
var useIsLandscape = require('./hooks/useIsLandscape.js');
|
|
120
|
+
|
|
121
|
+
var useScreenOrientation = require('./hooks/useScreenOrientation.js');
|
|
122
|
+
|
|
123
|
+
var useTagDetails = require('./hooks/useTagDetails.js');
|
|
124
|
+
|
|
115
125
|
var registerEchopediaComponent = componentRegistry.componentRegistry.registerComponent;
|
|
116
126
|
var EchoFramework = Object.freeze({
|
|
117
127
|
Utils: Object.freeze({
|
|
@@ -193,6 +203,7 @@ exports.useLayout = useLayout.useLayout;
|
|
|
193
203
|
exports.TagNumber = tagNumber.TagNumber;
|
|
194
204
|
exports.Toaster = toaster.Toaster;
|
|
195
205
|
exports.Toasters = toasters.Toasters;
|
|
206
|
+
exports.EchoBarComponent = EchoBarComponent.EchoBarComponent;
|
|
196
207
|
exports.EchoContent = EchoContent.EchoContent;
|
|
197
208
|
exports.mainMenu = EchoContentPanels.mainMenu;
|
|
198
209
|
exports.searchPanel = EchoContentPanels.searchPanel;
|
|
@@ -234,5 +245,9 @@ exports.getPlantBySapId = plantInfo.getPlantBySapId;
|
|
|
234
245
|
exports.getPlantCodesOnInstallation = plantInfo.getPlantCodesOnInstallation;
|
|
235
246
|
exports.getPlantsOnInstallation = plantInfo.getPlantsOnInstallation;
|
|
236
247
|
exports.startup = startup.startup;
|
|
248
|
+
exports.useEchoHistory = useEchoHistory.useEchoHistory;
|
|
249
|
+
exports.useIsLandscape = useIsLandscape.useIsLandscape;
|
|
250
|
+
exports.useScreenOrientation = useScreenOrientation.useScreenOrientation;
|
|
251
|
+
exports.useTagDetails = useTagDetails.useTagDetails;
|
|
237
252
|
exports["default"] = EchoFramework;
|
|
238
253
|
exports.registerEchopediaComponent = registerEchopediaComponent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.12",
|
|
4
4
|
"description": "Modules and components for EchoWeb, utilizing EchoCore",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -114,4 +114,4 @@
|
|
|
114
114
|
"dependencies": {
|
|
115
115
|
"@microsoft/signalr": "^6.0.3"
|
|
116
116
|
}
|
|
117
|
-
}
|
|
117
|
+
}
|