@j2inn/fin5-ui-utils 1.0.8-react-router.6 → 1.0.9
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/fin5Top/useFin5AppURLHashParameter.d.ts +0 -3
- package/dist/fin5Top/useFin5AppURLHashParameter.js +9 -11
- package/dist/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/react/components/navigation/BasicLayout.d.ts +10 -25
- package/dist/react/components/navigation/BasicLayout.js +36 -19
- package/dist/react/components/navigation/BasicLayout.js.map +1 -1
- package/dist/react/components/navigation/{customRouting/Router.d.ts → Router.d.ts} +1 -1
- package/dist/react/components/navigation/{customRouting/Router.js → Router.js} +2 -2
- package/dist/react/components/navigation/Router.js.map +1 -0
- package/dist_es/fin5Top/fin5FileUpload.d.ts +24 -0
- package/dist_es/fin5Top/fin5FileUpload.js +48 -0
- package/dist_es/fin5Top/fin5FileUpload.js.map +1 -0
- package/dist_es/fin5Top/finEdge2Cloud.d.ts +6 -0
- package/dist_es/fin5Top/finEdge2Cloud.js +12 -0
- package/dist_es/fin5Top/finEdge2Cloud.js.map +1 -0
- package/dist_es/fin5Top/useFin5AppURLHashParameter.d.ts +0 -3
- package/dist_es/fin5Top/useFin5AppURLHashParameter.js +6 -5
- package/dist_es/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
- package/dist_es/index.d.ts +4 -6
- package/dist_es/index.js +4 -6
- package/dist_es/index.js.map +1 -1
- package/dist_es/jobs/jobUtils.d.ts +14 -0
- package/dist_es/jobs/jobUtils.js +10 -0
- package/dist_es/jobs/jobUtils.js.map +1 -0
- package/dist_es/react/components/RecordImage.d.ts +20 -0
- package/dist_es/react/components/RecordImage.js +25 -0
- package/dist_es/react/components/RecordImage.js.map +1 -0
- package/dist_es/react/components/charts/QRCode.d.ts +25 -0
- package/dist_es/react/components/charts/QRCode.js +54 -0
- package/dist_es/react/components/charts/QRCode.js.map +1 -0
- package/dist_es/react/components/charts/pie/PieChart.d.ts +93 -0
- package/dist_es/react/components/charts/pie/PieChart.js +176 -0
- package/dist_es/react/components/charts/pie/PieChart.js.map +1 -0
- package/dist_es/react/components/charts/pie/SimplePieChart.d.ts +20 -0
- package/dist_es/react/components/charts/pie/SimplePieChart.js +26 -0
- package/dist_es/react/components/charts/pie/SimplePieChart.js.map +1 -0
- package/dist_es/react/components/navigation/BasicLayout.d.ts +10 -25
- package/dist_es/react/components/navigation/BasicLayout.js +31 -13
- package/dist_es/react/components/navigation/BasicLayout.js.map +1 -1
- package/dist_es/react/components/navigation/HeaderSiderLayout.d.ts +13 -0
- package/dist_es/react/components/navigation/HeaderSiderLayout.js +81 -0
- package/dist_es/react/components/navigation/HeaderSiderLayout.js.map +1 -0
- package/dist_es/react/components/navigation/MenuTrigger.d.ts +9 -0
- package/dist_es/react/components/navigation/MenuTrigger.js +29 -0
- package/dist_es/react/components/navigation/MenuTrigger.js.map +1 -0
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -0
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js +19 -0
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js.map +1 -0
- package/dist_es/react/components/navigation/ReactRouterLayout.d.ts +32 -2
- package/dist_es/react/components/navigation/ReactRouterLayout.js +66 -18
- package/dist_es/react/components/navigation/ReactRouterLayout.js.map +1 -1
- package/dist_es/react/hooks/useFin5BinUrl.d.ts +6 -0
- package/dist_es/react/hooks/useFin5BinUrl.js +12 -0
- package/dist_es/react/hooks/useFin5BinUrl.js.map +1 -0
- package/package.json +2 -4
- package/dist/react/components/navigation/ReactRouterLayout.d.ts +0 -16
- package/dist/react/components/navigation/ReactRouterLayout.js +0 -80
- package/dist/react/components/navigation/ReactRouterLayout.js.map +0 -1
- package/dist/react/components/navigation/customRouting/Router.js.map +0 -1
- package/dist/react/components/navigation/customRouting/RouterLayout.d.ts +0 -11
- package/dist/react/components/navigation/customRouting/RouterLayout.js +0 -62
- package/dist/react/components/navigation/customRouting/RouterLayout.js.map +0 -1
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export declare const IN_IFRAME: boolean;
|
|
2
|
-
export declare const getTopLocation: () => Location;
|
|
3
|
-
export declare const getFin5HashFrameParameters: () => URLSearchParams;
|
|
4
|
-
export declare const fin5SkipHashUpdate: () => Promise<undefined> | undefined;
|
|
5
2
|
export declare const getHashParameters: () => URLSearchParams;
|
|
6
3
|
/**
|
|
7
4
|
* Use a parameter in the hash of a custom app running in FIN 5 as state.
|
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2022, J2 Innovations. All Rights Reserved
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useFin5AppURLHashParameters = exports.useFin5AppURLHashParameter = exports.getHashParameters = exports.
|
|
6
|
+
exports.useFin5AppURLHashParameters = exports.useFin5AppURLHashParameter = exports.getHashParameters = exports.IN_IFRAME = void 0;
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const fin5Top_1 = require("./fin5Top");
|
|
9
|
+
exports.IN_IFRAME = window !== top && (0, fin5Top_1.isWindowTopFin5)();
|
|
10
|
+
const getTop = () => exports.IN_IFRAME && window.top ? window.top : window;
|
|
10
11
|
const getApp = () => getTop()?.app;
|
|
11
12
|
const getTopLocation = () => getTop().location;
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
exports.getFin5HashFrameParameters = getFin5HashFrameParameters;
|
|
15
|
-
const getFin5FrameURL = () => (0, exports.getFin5HashFrameParameters)().get('url');
|
|
13
|
+
const getFin5HashFrameParameters = () => new URLSearchParams(getTopLocation().hash.slice(1).split('?')[1]);
|
|
14
|
+
const getFin5FrameURL = () => getFin5HashFrameParameters().get('url');
|
|
16
15
|
const getPartialURLHashFragment = (url) => `#${url?.split('#')[1] ?? ''}`;
|
|
17
16
|
const getHash = () => {
|
|
18
17
|
return exports.IN_IFRAME
|
|
@@ -20,13 +19,12 @@ const getHash = () => {
|
|
|
20
19
|
: window.location.hash;
|
|
21
20
|
};
|
|
22
21
|
const fin5SkipHashUpdate = () => getApp()?.set('skipHashUpdate', true);
|
|
23
|
-
exports.fin5SkipHashUpdate = fin5SkipHashUpdate;
|
|
24
22
|
const setHash = (hash) => {
|
|
25
23
|
if (exports.IN_IFRAME) {
|
|
26
|
-
return
|
|
27
|
-
const frameParameters =
|
|
24
|
+
return fin5SkipHashUpdate()?.then(() => {
|
|
25
|
+
const frameParameters = getFin5HashFrameParameters();
|
|
28
26
|
frameParameters.set('url', frameParameters.get('url')?.split('#')[0] + '#' + hash);
|
|
29
|
-
|
|
27
|
+
getTopLocation().hash = `#${getTopLocation().hash.slice(1).split('?')[0]}?${frameParameters.toString()}`;
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
30
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFin5AppURLHashParameter.js","sourceRoot":"","sources":["../../src/fin5Top/useFin5AppURLHashParameter.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAA2C;AAE9B,QAAA,SAAS,GAAG,MAAM,KAAK,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"useFin5AppURLHashParameter.js","sourceRoot":"","sources":["../../src/fin5Top/useFin5AppURLHashParameter.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAA2C;AAC3C,uCAA2C;AAE9B,QAAA,SAAS,GAAG,MAAM,KAAK,GAAG,IAAI,IAAA,yBAAe,GAAE,CAAA;AAM5D,MAAM,MAAM,GAAG,GAA2B,EAAE,CAC3C,iBAAS,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAA;AAC9C,MAAM,MAAM,GAAG,GAAoB,EAAE,CAAC,MAAM,EAAE,EAAE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/getFin5BinUrl';
|
|
|
3
3
|
export * from './fin5Top/openFin5Alarm';
|
|
4
4
|
export * from './fin5Top/openFin5Historian';
|
|
5
5
|
export * from './fin5Top/useFin5AppURLHashParameter';
|
|
6
|
-
export * from './react/components/ErrorBoundary';
|
|
7
6
|
export * from './react/components/ErrorDisplayer';
|
|
7
|
+
export * from './react/components/ErrorBoundary';
|
|
8
8
|
export * from './react/components/Loader';
|
|
9
9
|
export * from './react/components/LoadingSpinner';
|
|
10
|
-
export * from './react/components/graphics/GraphicViewer';
|
|
11
|
-
export * from './react/components/graphics/GraphicsTabViewer';
|
|
12
10
|
export * from './react/components/navigation/BasicLayout';
|
|
13
11
|
export * from './react/components/navigation/MenuPage';
|
|
14
|
-
export * from './react/components/navigation/
|
|
15
|
-
export * from './react/components/
|
|
16
|
-
export * from './react/components/
|
|
12
|
+
export * from './react/components/navigation/Router';
|
|
13
|
+
export * from './react/components/graphics/GraphicsTabViewer';
|
|
14
|
+
export * from './react/components/graphics/GraphicViewer';
|
|
17
15
|
export * from './react/components/resolvable/configurationForm/ConfigurationForm';
|
|
18
16
|
export * from './react/components/resolvable/configurationForm/ConfigurationFormEntry';
|
|
19
17
|
export * from './react/components/resolvable/configurationForm/getSectionDefault';
|
package/dist/index.js
CHANGED
|
@@ -28,17 +28,15 @@ __exportStar(require("./fin5Top/useFin5AppURLHashParameter"), exports);
|
|
|
28
28
|
//////////////////////////////////////////////////////////////////////////
|
|
29
29
|
// React components
|
|
30
30
|
//////////////////////////////////////////////////////////////////////////
|
|
31
|
-
__exportStar(require("./react/components/ErrorBoundary"), exports);
|
|
32
31
|
__exportStar(require("./react/components/ErrorDisplayer"), exports);
|
|
32
|
+
__exportStar(require("./react/components/ErrorBoundary"), exports);
|
|
33
33
|
__exportStar(require("./react/components/Loader"), exports);
|
|
34
34
|
__exportStar(require("./react/components/LoadingSpinner"), exports);
|
|
35
|
-
__exportStar(require("./react/components/graphics/GraphicViewer"), exports);
|
|
36
|
-
__exportStar(require("./react/components/graphics/GraphicsTabViewer"), exports);
|
|
37
35
|
__exportStar(require("./react/components/navigation/BasicLayout"), exports);
|
|
38
36
|
__exportStar(require("./react/components/navigation/MenuPage"), exports);
|
|
39
|
-
__exportStar(require("./react/components/navigation/
|
|
40
|
-
__exportStar(require("./react/components/
|
|
41
|
-
__exportStar(require("./react/components/
|
|
37
|
+
__exportStar(require("./react/components/navigation/Router"), exports);
|
|
38
|
+
__exportStar(require("./react/components/graphics/GraphicsTabViewer"), exports);
|
|
39
|
+
__exportStar(require("./react/components/graphics/GraphicViewer"), exports);
|
|
42
40
|
__exportStar(require("./react/components/resolvable/configurationForm/ConfigurationForm"), exports);
|
|
43
41
|
__exportStar(require("./react/components/resolvable/configurationForm/ConfigurationFormEntry"), exports);
|
|
44
42
|
__exportStar(require("./react/components/resolvable/configurationForm/getSectionDefault"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,0EAA0E;AAC1E,4BAA4B;AAC5B,0EAA0E;AAE1E,oDAAiC;AACjC,0DAAuC;AACvC,0DAAuC;AACvC,8DAA2C;AAC3C,uEAAoD;AAEpD,0EAA0E;AAC1E,mBAAmB;AACnB,0EAA0E;AAE1E,mEAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,0EAA0E;AAC1E,4BAA4B;AAC5B,0EAA0E;AAE1E,oDAAiC;AACjC,0DAAuC;AACvC,0DAAuC;AACvC,8DAA2C;AAC3C,uEAAoD;AAEpD,0EAA0E;AAC1E,mBAAmB;AACnB,0EAA0E;AAE1E,oEAAiD;AACjD,mEAAgD;AAChD,4DAAyC;AACzC,oEAAiD;AACjD,4EAAyD;AACzD,yEAAsD;AACtD,uEAAoD;AACpD,gFAA6D;AAC7D,4EAAyD;AACzD,oGAAiF;AACjF,yGAAsF;AACtF,oGAAiF;AAEjF,0EAA0E;AAC1E,6BAA6B;AAC7B,0EAA0E;AAE1E,+DAA4C;AAC5C,+DAA4C"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { ThemeDef } from '@j2inn/ui';
|
|
2
1
|
import { LayoutProps, MenuProps, SiderProps } from 'antd';
|
|
3
|
-
import
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import { MenuPage } from './MenuPage';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare const useStyles: (data?: (StyleVariables & {
|
|
12
|
-
theme?: ThemeDef | undefined;
|
|
13
|
-
}) | undefined) => import("jss").Classes<"content" | "header" | "sider" | "menuTrigger">;
|
|
14
|
-
export interface BasicLayoutProps<T extends MenuPage> extends PropsWithChildren {
|
|
15
|
-
pages?: T[];
|
|
4
|
+
export interface BasicLayoutProps {
|
|
5
|
+
/**
|
|
6
|
+
* List of pages for the menu and the routing
|
|
7
|
+
*/
|
|
8
|
+
page?: string;
|
|
9
|
+
pages?: MenuPage[];
|
|
16
10
|
defaultPage?: string;
|
|
17
|
-
|
|
18
|
-
onSelect?: (key: string) => void;
|
|
11
|
+
onPageChange?: (page: string) => void;
|
|
19
12
|
compactSider?: boolean;
|
|
20
13
|
layoutProps?: LayoutProps;
|
|
21
14
|
mobileHeaderProps?: LayoutProps;
|
|
@@ -24,14 +17,6 @@ export interface BasicLayoutProps<T extends MenuPage> extends PropsWithChildren
|
|
|
24
17
|
menuProps?: Omit<MenuProps, 'items' | 'selectedKeys' | 'onSelect'>;
|
|
25
18
|
}
|
|
26
19
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @param pages
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export declare const getMenuPages: (pages: MenuPage[]) => MenuPage<Record<string, unknown>>[];
|
|
32
|
-
/**
|
|
33
|
-
* Basic layout with sider and mobile navigation management.
|
|
34
|
-
* Routing management can be plugged in, for examples @see ReactRouterLayout @see RouterLayout
|
|
20
|
+
* Basic layout that combines menu and routing into one.
|
|
35
21
|
*/
|
|
36
|
-
export declare
|
|
37
|
-
export {};
|
|
22
|
+
export declare const BasicLayout: React.FC<BasicLayoutProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2022, J2 Innovations. All Rights Reserved
|
|
4
4
|
*/
|
|
5
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
@@ -29,21 +29,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.BasicLayout =
|
|
32
|
+
exports.BasicLayout = void 0;
|
|
33
33
|
const icons_1 = require("@ant-design/icons");
|
|
34
34
|
const ui_1 = require("@j2inn/ui");
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
const react_jss_1 = require("react-jss");
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const ErrorDisplayer_1 = require("../ErrorDisplayer");
|
|
39
|
+
const MenuPage_1 = require("./MenuPage");
|
|
40
|
+
const Router_1 = require("./Router");
|
|
41
|
+
const HEADER_HEIGHT = 45;
|
|
42
|
+
const useStyles = (0, react_jss_1.createUseStyles)((theme) => {
|
|
40
43
|
return {
|
|
41
44
|
header: {
|
|
42
45
|
position: 'fixed',
|
|
43
46
|
width: '100%',
|
|
44
47
|
zIndex: 1000,
|
|
45
48
|
padding: 0,
|
|
46
|
-
height:
|
|
49
|
+
height: HEADER_HEIGHT,
|
|
47
50
|
lineHeight: '45px',
|
|
48
51
|
},
|
|
49
52
|
sider: {
|
|
@@ -54,7 +57,7 @@ exports.useStyles = (0, react_jss_1.createUseStyles)((theme) => {
|
|
|
54
57
|
top: 0,
|
|
55
58
|
bottom: 0,
|
|
56
59
|
zIndex: 999,
|
|
57
|
-
paddingTop: ({ isMobile }) => isMobile ?
|
|
60
|
+
paddingTop: ({ isMobile }) => isMobile ? HEADER_HEIGHT : 0,
|
|
58
61
|
},
|
|
59
62
|
menuTrigger: {
|
|
60
63
|
width: 45,
|
|
@@ -71,7 +74,7 @@ exports.useStyles = (0, react_jss_1.createUseStyles)((theme) => {
|
|
|
71
74
|
},
|
|
72
75
|
content: ({ isMobile, compactSider, siderWidth = 200, }) => ({
|
|
73
76
|
paddingLeft: isMobile ? 0 : compactSider ? 45 : siderWidth,
|
|
74
|
-
paddingTop: isMobile ?
|
|
77
|
+
paddingTop: isMobile ? HEADER_HEIGHT : 0,
|
|
75
78
|
}),
|
|
76
79
|
};
|
|
77
80
|
});
|
|
@@ -91,7 +94,7 @@ const getMenuPages = (pages) => {
|
|
|
91
94
|
if (show) {
|
|
92
95
|
const copiedPage = Object.assign({}, page);
|
|
93
96
|
if (copiedPage.children) {
|
|
94
|
-
const filteredChildren =
|
|
97
|
+
const filteredChildren = getMenuPages(copiedPage.children);
|
|
95
98
|
copiedPage.children = filteredChildren.length
|
|
96
99
|
? filteredChildren
|
|
97
100
|
: undefined;
|
|
@@ -101,18 +104,26 @@ const getMenuPages = (pages) => {
|
|
|
101
104
|
});
|
|
102
105
|
return menuPages;
|
|
103
106
|
};
|
|
104
|
-
exports.getMenuPages = getMenuPages;
|
|
105
107
|
/**
|
|
106
|
-
* Basic layout
|
|
107
|
-
* Routing management can be plugged in, for examples @see ReactRouterLayout @see RouterLayout
|
|
108
|
+
* Basic layout that combines menu and routing into one.
|
|
108
109
|
*/
|
|
109
|
-
|
|
110
|
+
const BasicLayout = ({ pages = [], defaultPage = pages?.[0].key ?? '', onPageChange, compactSider, layoutProps, mobileHeaderProps, siderProps, contentProps, menuProps, page, }) => {
|
|
111
|
+
const [currentPage, setCurrentPage] = (0, react_1.useState)(page ?? defaultPage);
|
|
112
|
+
(0, react_1.useEffect)(() => {
|
|
113
|
+
if (page) {
|
|
114
|
+
setCurrentPage(page);
|
|
115
|
+
}
|
|
116
|
+
}, [page]);
|
|
117
|
+
// Fire onChange
|
|
118
|
+
(0, react_1.useEffect)(() => {
|
|
119
|
+
onPageChange?.(currentPage);
|
|
120
|
+
}, [currentPage]);
|
|
110
121
|
// manage mobile navigation
|
|
111
122
|
const [isMobile, setIsMobile] = (0, react_1.useState)(false);
|
|
112
123
|
const [hiddenSider, setHiddenSider] = (0, react_1.useState)(false);
|
|
113
124
|
const siderWidth = siderProps?.width;
|
|
114
|
-
const classes =
|
|
115
|
-
const menuPages = (0, react_1.useMemo)(() =>
|
|
125
|
+
const classes = useStyles({ isMobile, compactSider, siderWidth });
|
|
126
|
+
const menuPages = (0, react_1.useMemo)(() => getMenuPages(pages), [pages]);
|
|
116
127
|
return (react_1.default.createElement(ui_1.Layout, { hasSider: true, ...layoutProps },
|
|
117
128
|
isMobile && (react_1.default.createElement(Header, { ...mobileHeaderProps, className: (0, classnames_1.default)(classes.header, mobileHeaderProps?.className) }, hiddenSider ? (react_1.default.createElement(icons_1.MenuUnfoldOutlined, { className: classes.menuTrigger, onClick: () => {
|
|
118
129
|
setHiddenSider(!hiddenSider);
|
|
@@ -125,15 +136,21 @@ function BasicLayout({ pages = [], defaultPage, selectedPages = [], onSelect, co
|
|
|
125
136
|
}, collapsed: (isMobile && hiddenSider) || compactSider, collapsedWidth: isMobile && hiddenSider
|
|
126
137
|
? 0
|
|
127
138
|
: compactSider
|
|
128
|
-
?
|
|
139
|
+
? HEADER_HEIGHT
|
|
129
140
|
: 0, trigger: null },
|
|
130
|
-
react_1.default.createElement(ui_1.Menu, { ...menuProps,
|
|
141
|
+
react_1.default.createElement(ui_1.Menu, { ...menuProps, items: menuPages, selectedKeys: [currentPage], onSelect: ({ key }) => {
|
|
131
142
|
if (!hiddenSider) {
|
|
132
143
|
setHiddenSider(true);
|
|
133
144
|
}
|
|
134
|
-
|
|
145
|
+
const page = (0, MenuPage_1.findPageByName)(pages, key);
|
|
146
|
+
if (page?.component) {
|
|
147
|
+
setCurrentPage(key);
|
|
148
|
+
}
|
|
135
149
|
} })),
|
|
136
|
-
react_1.default.createElement(Content, { ...contentProps, className: (0, classnames_1.default)(classes.content, contentProps?.className) },
|
|
137
|
-
|
|
150
|
+
react_1.default.createElement(Content, { ...contentProps, className: (0, classnames_1.default)(classes.content, contentProps?.className) },
|
|
151
|
+
react_1.default.createElement(Router_1.Router, { pages: pages, currentPage: currentPage, fallbackComponent: react_1.default.createElement(ErrorDisplayer_1.ErrorDisplayer, { error: new Error('Page Not Found'), extra: [
|
|
152
|
+
react_1.default.createElement(ui_1.Button, { type: 'primary', key: 'refresh', onClick: () => setCurrentPage(defaultPage) }, "Go Home"),
|
|
153
|
+
] }) }))));
|
|
154
|
+
};
|
|
138
155
|
exports.BasicLayout = BasicLayout;
|
|
139
156
|
//# sourceMappingURL=BasicLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicLayout.js","sourceRoot":"","sources":["../../../../src/react/components/navigation/BasicLayout.tsx"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"BasicLayout.js","sourceRoot":"","sources":["../../../../src/react/components/navigation/BasicLayout.tsx"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAAwE;AACxE,kCAA0D;AAE1D,4DAAmC;AACnC,+CAA2D;AAC3D,yCAA2C;AAC3C,sDAAkD;AAClD,yCAAqD;AACrD,qCAAiC;AAEjC,MAAM,aAAa,GAAG,EAAE,CAAA;AAQxB,MAAM,SAAS,GAAG,IAAA,2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cAElC;qBACT,GACA,GAEF,CACO,CACF,CACT,CAAA;AACF,CAAC,CAAA;AArHY,QAAA,WAAW,eAqHvB"}
|
|
@@ -28,8 +28,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Router = void 0;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const LoadingSpinner_1 = require("
|
|
32
|
-
const MenuPage_1 = require("
|
|
31
|
+
const LoadingSpinner_1 = require("../LoadingSpinner");
|
|
32
|
+
const MenuPage_1 = require("./MenuPage");
|
|
33
33
|
/**
|
|
34
34
|
* Renders the currently selected page from a tree of pages
|
|
35
35
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../../src/react/components/navigation/Router.tsx"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAMc;AACd,sDAAkD;AAClD,yCAAqD;AASrD;;GAEG;AACH,SAAgB,MAAM,CAAqB,EAC1C,KAAK,GAAG,EAAE,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,GACkB;IACnC,MAAM,IAAI,GAAG,IAAA,eAAO,EACnB,GAAG,EAAE,CAAC,IAAA,yBAAc,EAAC,KAAK,EAAE,WAAW,CAAC,EACxC,CAAC,KAAK,EAAE,WAAW,CAAC,CACpB,CAAA;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,YAAY,EAAE,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,OAAO,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CACxB,8BAAC,gBAAQ,IAAC,QAAQ,EAAE,8BAAC,+BAAc,OAAG,IACpC,eAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CACvC,CACX,CAAC,CAAC,CAAC,CACH,iBAAiB,IAAI;QAAM,WAAW;0BAAsB,CAC5D,CAAA;AACF,CAAC;AAtBD,wBAsBC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HDict } from 'haystack-core';
|
|
2
|
+
/**
|
|
3
|
+
* Upload a File to FIN5, using the FINStack /fileUpload API. Files can then be viewed using Folio menu.
|
|
4
|
+
* @param projectName The name of the project where the files will be uploaded
|
|
5
|
+
* @param file The File to upload
|
|
6
|
+
* @param additionalTags Any additional tag that needs to be added to the file record. The tags should be
|
|
7
|
+
* provided as URL search parameters. To add a marker tag, set the value of the param to `'true'`.
|
|
8
|
+
* @returns the file record as an HDict
|
|
9
|
+
* @example
|
|
10
|
+
* <input type='file' onChange={async (e) => {
|
|
11
|
+
* const file = e.target.files?.[0]
|
|
12
|
+
* if (file) {
|
|
13
|
+
* const params = new URLSearchParams()
|
|
14
|
+
* params.set('myMarker', 'true')
|
|
15
|
+
* params.set('myStrTag', 'abc')
|
|
16
|
+
* const rec = await fin5FileUpload(
|
|
17
|
+
* 'myprojectname',
|
|
18
|
+
* file,
|
|
19
|
+
* params
|
|
20
|
+
* )
|
|
21
|
+
* }
|
|
22
|
+
* }} />
|
|
23
|
+
*/
|
|
24
|
+
export declare const fin5FileUpload: (projectName: string, file: File, additionalTags?: URLSearchParams) => Promise<HDict>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ZincReader } from 'haystack-core';
|
|
2
|
+
import { finCsrfFetch } from 'haystack-nclient';
|
|
3
|
+
/**
|
|
4
|
+
* Upload a File to FIN5, using the FINStack /fileUpload API. Files can then be viewed using Folio menu.
|
|
5
|
+
* @param projectName The name of the project where the files will be uploaded
|
|
6
|
+
* @param file The File to upload
|
|
7
|
+
* @param additionalTags Any additional tag that needs to be added to the file record. The tags should be
|
|
8
|
+
* provided as URL search parameters. To add a marker tag, set the value of the param to `'true'`.
|
|
9
|
+
* @returns the file record as an HDict
|
|
10
|
+
* @example
|
|
11
|
+
* <input type='file' onChange={async (e) => {
|
|
12
|
+
* const file = e.target.files?.[0]
|
|
13
|
+
* if (file) {
|
|
14
|
+
* const params = new URLSearchParams()
|
|
15
|
+
* params.set('myMarker', 'true')
|
|
16
|
+
* params.set('myStrTag', 'abc')
|
|
17
|
+
* const rec = await fin5FileUpload(
|
|
18
|
+
* 'myprojectname',
|
|
19
|
+
* file,
|
|
20
|
+
* params
|
|
21
|
+
* )
|
|
22
|
+
* }
|
|
23
|
+
* }} />
|
|
24
|
+
*/
|
|
25
|
+
export const fin5FileUpload = async (projectName, file, additionalTags = new URLSearchParams()) => {
|
|
26
|
+
if (!additionalTags.has('dis')) {
|
|
27
|
+
additionalTags.set('dis', file.name);
|
|
28
|
+
}
|
|
29
|
+
// URL base (http://localhost) will be ignored, it's just needed to build the URL
|
|
30
|
+
const url = new URL(`/api/${projectName}/ext/finstack/fileUpload`, 'http://localhost');
|
|
31
|
+
additionalTags.forEach((value, name) => url.searchParams.set(name, value));
|
|
32
|
+
const content = await file.arrayBuffer();
|
|
33
|
+
const response = await finCsrfFetch(`${url.pathname}${url.search}`, {
|
|
34
|
+
method: 'POST',
|
|
35
|
+
headers: {
|
|
36
|
+
'Content-Type': 'application/octet-stream',
|
|
37
|
+
},
|
|
38
|
+
body: new Uint8Array(content),
|
|
39
|
+
});
|
|
40
|
+
const zincReader = new ZincReader(await response.text());
|
|
41
|
+
const grid = zincReader.readValue();
|
|
42
|
+
const dict = grid.first;
|
|
43
|
+
if (!dict) {
|
|
44
|
+
throw new Error('Unexpected response, no record found');
|
|
45
|
+
}
|
|
46
|
+
return dict;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=fin5FileUpload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fin5FileUpload.js","sourceRoot":"","sources":["../../src/fin5Top/fin5FileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,YAAY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rfFetch } from 'haystack-nclient';
|
|
2
|
+
/**
|
|
3
|
+
* Get the URI to register the FIN instance to Edge2Cloud.
|
|
4
|
+
* The URI can be used to provide a link, or to create the registration QR code.
|
|
5
|
+
* @returns the URI as a string
|
|
6
|
+
*/
|
|
7
|
+
export const getEdge2CloudRegistrationUri = async () => {
|
|
8
|
+
const response = await finCsrfFetch('/finEdge2Cloud/devreg');
|
|
9
|
+
const json = await response.json();
|
|
10
|
+
return json.uri;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=finEdge2Cloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finEdge2Cloud.js","sourceRoot":"","sources":["../../src/fin5Top/finEdge2Cloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,IAAqB,EAAE;IACvE,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,uBAAuB,CAAC,CAAA;IAC5D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAClC,OAAO,IAAI,CAAC,GAAG,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export declare const IN_IFRAME: boolean;
|
|
2
|
-
export declare const getTopLocation: () => Location;
|
|
3
|
-
export declare const getFin5HashFrameParameters: () => URLSearchParams;
|
|
4
|
-
export declare const fin5SkipHashUpdate: () => Promise<undefined> | undefined;
|
|
5
2
|
export declare const getHashParameters: () => URLSearchParams;
|
|
6
3
|
/**
|
|
7
4
|
* Use a parameter in the hash of a custom app running in FIN 5 as state.
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* Copyright (c) 2022, J2 Innovations. All Rights Reserved
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
|
-
|
|
6
|
-
const
|
|
5
|
+
import { isWindowTopFin5 } from './fin5Top';
|
|
6
|
+
export const IN_IFRAME = window !== top && isWindowTopFin5();
|
|
7
|
+
const getTop = () => IN_IFRAME && window.top ? window.top : window;
|
|
7
8
|
const getApp = () => getTop()?.app;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const getTopLocation = () => getTop().location;
|
|
10
|
+
const getFin5HashFrameParameters = () => new URLSearchParams(getTopLocation().hash.slice(1).split('?')[1]);
|
|
10
11
|
const getFin5FrameURL = () => getFin5HashFrameParameters().get('url');
|
|
11
12
|
const getPartialURLHashFragment = (url) => `#${url?.split('#')[1] ?? ''}`;
|
|
12
13
|
const getHash = () => {
|
|
@@ -14,7 +15,7 @@ const getHash = () => {
|
|
|
14
15
|
? getPartialURLHashFragment(getFin5FrameURL())
|
|
15
16
|
: window.location.hash;
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
+
const fin5SkipHashUpdate = () => getApp()?.set('skipHashUpdate', true);
|
|
18
19
|
const setHash = (hash) => {
|
|
19
20
|
if (IN_IFRAME) {
|
|
20
21
|
return fin5SkipHashUpdate()?.then(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFin5AppURLHashParameter.js","sourceRoot":"","sources":["../../src/fin5Top/useFin5AppURLHashParameter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,KAAK,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"useFin5AppURLHashParameter.js","sourceRoot":"","sources":["../../src/fin5Top/useFin5AppURLHashParameter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,KAAK,GAAG,IAAI,eA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AAC,CAAA"}
|
package/dist_es/index.d.ts
CHANGED
|
@@ -3,17 +3,15 @@ export * from './fin5Top/getFin5BinUrl';
|
|
|
3
3
|
export * from './fin5Top/openFin5Alarm';
|
|
4
4
|
export * from './fin5Top/openFin5Historian';
|
|
5
5
|
export * from './fin5Top/useFin5AppURLHashParameter';
|
|
6
|
-
export * from './react/components/ErrorBoundary';
|
|
7
6
|
export * from './react/components/ErrorDisplayer';
|
|
7
|
+
export * from './react/components/ErrorBoundary';
|
|
8
8
|
export * from './react/components/Loader';
|
|
9
9
|
export * from './react/components/LoadingSpinner';
|
|
10
|
-
export * from './react/components/graphics/GraphicViewer';
|
|
11
|
-
export * from './react/components/graphics/GraphicsTabViewer';
|
|
12
10
|
export * from './react/components/navigation/BasicLayout';
|
|
13
11
|
export * from './react/components/navigation/MenuPage';
|
|
14
|
-
export * from './react/components/navigation/
|
|
15
|
-
export * from './react/components/
|
|
16
|
-
export * from './react/components/
|
|
12
|
+
export * from './react/components/navigation/Router';
|
|
13
|
+
export * from './react/components/graphics/GraphicsTabViewer';
|
|
14
|
+
export * from './react/components/graphics/GraphicViewer';
|
|
17
15
|
export * from './react/components/resolvable/configurationForm/ConfigurationForm';
|
|
18
16
|
export * from './react/components/resolvable/configurationForm/ConfigurationFormEntry';
|
|
19
17
|
export * from './react/components/resolvable/configurationForm/getSectionDefault';
|
package/dist_es/index.js
CHANGED
|
@@ -12,17 +12,15 @@ export * from './fin5Top/useFin5AppURLHashParameter';
|
|
|
12
12
|
//////////////////////////////////////////////////////////////////////////
|
|
13
13
|
// React components
|
|
14
14
|
//////////////////////////////////////////////////////////////////////////
|
|
15
|
-
export * from './react/components/ErrorBoundary';
|
|
16
15
|
export * from './react/components/ErrorDisplayer';
|
|
16
|
+
export * from './react/components/ErrorBoundary';
|
|
17
17
|
export * from './react/components/Loader';
|
|
18
18
|
export * from './react/components/LoadingSpinner';
|
|
19
|
-
export * from './react/components/graphics/GraphicViewer';
|
|
20
|
-
export * from './react/components/graphics/GraphicsTabViewer';
|
|
21
19
|
export * from './react/components/navigation/BasicLayout';
|
|
22
20
|
export * from './react/components/navigation/MenuPage';
|
|
23
|
-
export * from './react/components/navigation/
|
|
24
|
-
export * from './react/components/
|
|
25
|
-
export * from './react/components/
|
|
21
|
+
export * from './react/components/navigation/Router';
|
|
22
|
+
export * from './react/components/graphics/GraphicsTabViewer';
|
|
23
|
+
export * from './react/components/graphics/GraphicViewer';
|
|
26
24
|
export * from './react/components/resolvable/configurationForm/ConfigurationForm';
|
|
27
25
|
export * from './react/components/resolvable/configurationForm/ConfigurationFormEntry';
|
|
28
26
|
export * from './react/components/resolvable/configurationForm/getSectionDefault';
|
package/dist_es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0EAA0E;AAC1E,4BAA4B;AAC5B,0EAA0E;AAE1E,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sCAAsC,CAAA;AAEpD,0EAA0E;AAC1E,mBAAmB;AACnB,0EAA0E;AAE1E,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0EAA0E;AAC1E,4BAA4B;AAC5B,0EAA0E;AAE1E,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sCAAsC,CAAA;AAEpD,0EAA0E;AAC1E,mBAAmB;AACnB,0EAA0E;AAE1E,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,2BAA2B,CAAA;AACzC,cAAc,mCAAmC,CAAA;AACjD,cAAc,2CAA2C,CAAA;AACzD,cAAc,wCAAwC,CAAA;AACtD,cAAc,sCAAsC,CAAA;AACpD,cAAc,+CAA+C,CAAA;AAC7D,cAAc,2CAA2C,CAAA;AACzD,cAAc,mEAAmE,CAAA;AACjF,cAAc,wEAAwE,CAAA;AACtF,cAAc,mEAAmE,CAAA;AAEjF,0EAA0E;AAC1E,6BAA6B;AAC7B,0EAA0E;AAE1E,cAAc,8BAA8B,CAAA;AAC5C,cAAc,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HDict, HNum, HStr } from 'haystack-core';
|
|
2
|
+
export declare enum JobStatus {
|
|
3
|
+
doneOk = "doneOk",
|
|
4
|
+
doneErr = "doneErr",
|
|
5
|
+
running = "running"
|
|
6
|
+
}
|
|
7
|
+
export interface JobStatusDict extends HDict {
|
|
8
|
+
jobStatus: HStr;
|
|
9
|
+
progress: HNum;
|
|
10
|
+
progressMsg: HStr;
|
|
11
|
+
}
|
|
12
|
+
export declare const isJobSuccessful: (jobStatus: JobStatusDict) => boolean;
|
|
13
|
+
export declare const isJobError: (jobStatus: JobStatusDict) => boolean;
|
|
14
|
+
export declare const isJobRunning: (jobStatus: JobStatusDict) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var JobStatus;
|
|
2
|
+
(function (JobStatus) {
|
|
3
|
+
JobStatus["doneOk"] = "doneOk";
|
|
4
|
+
JobStatus["doneErr"] = "doneErr";
|
|
5
|
+
JobStatus["running"] = "running";
|
|
6
|
+
})(JobStatus || (JobStatus = {}));
|
|
7
|
+
export const isJobSuccessful = (jobStatus) => jobStatus.jobStatus.value === JobStatus.doneOk;
|
|
8
|
+
export const isJobError = (jobStatus) => jobStatus.jobStatus.value === JobStatus.doneErr;
|
|
9
|
+
export const isJobRunning = (jobStatus) => jobStatus.jobStatus.value === JobStatus.running;
|
|
10
|
+
//# sourceMappingURL=jobUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobUtils.js","sourceRoot":"","sources":["../../src/jobs/jobUtils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACpB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;AACpB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAQD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAwB,EAAE,EAAE,CAC3D,SAAS,CAAC,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,MAAM,CAAA;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAwB,EAAE,EAAE,CACtD,SAAS,CAAC,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,OAAO,CAAA;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAwB,EAAE,EAAE,CACxD,SAAS,CAAC,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,OAAO,CAAA"}
|