@intuitionrobotics/thunderstorm 0.41.69 → 0.41.70
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/app-backend/api/v1/utils/version/_assert.js +1 -1
- package/app-backend/api/v1/utils/version/_assert.js.map +1 -1
- package/app-backend/api/v1/utils/version/assert.js +13 -58
- package/app-backend/api/v1/utils/version/assert.js.map +1 -1
- package/app-backend/core/BaseStorm.js +34 -87
- package/app-backend/core/BaseStorm.js.map +1 -1
- package/app-backend/core/Storm.js +42 -112
- package/app-backend/core/Storm.js.map +1 -1
- package/app-backend/exceptions.js +11 -27
- package/app-backend/exceptions.js.map +1 -1
- package/app-backend/modules/CleanupScheduler.js +24 -92
- package/app-backend/modules/CleanupScheduler.js.map +1 -1
- package/app-backend/modules/FirestoreBackupScheduler.js +47 -138
- package/app-backend/modules/FirestoreBackupScheduler.js.map +1 -1
- package/app-backend/modules/ForceUpgrade.js +31 -82
- package/app-backend/modules/ForceUpgrade.js.map +1 -1
- package/app-backend/modules/http/AxiosHttpModule.js +116 -184
- package/app-backend/modules/http/AxiosHttpModule.js.map +1 -1
- package/app-backend/modules/proxy/RemoteProxy.js +40 -90
- package/app-backend/modules/proxy/RemoteProxy.js.map +1 -1
- package/app-backend/modules/proxy/RemoteProxyCaller.js +49 -122
- package/app-backend/modules/proxy/RemoteProxyCaller.js.map +1 -1
- package/app-backend/modules/server/HttpServer.js +153 -216
- package/app-backend/modules/server/HttpServer.js.map +1 -1
- package/app-backend/modules/server/server-api.js +236 -361
- package/app-backend/modules/server/server-api.js.map +1 -1
- package/app-backend/modules/server/server-errors.js +51 -91
- package/app-backend/modules/server/server-errors.js.map +1 -1
- package/app-backend/utils/LogClient_File.js +23 -42
- package/app-backend/utils/LogClient_File.js.map +1 -1
- package/app-backend/utils/file.js +7 -50
- package/app-backend/utils/file.js.map +1 -1
- package/app-backend/utils/promisify-request.js +13 -43
- package/app-backend/utils/promisify-request.js.map +1 -1
- package/app-backend/utils/to-be-removed.js +7 -8
- package/app-backend/utils/to-be-removed.js.map +1 -1
- package/app-backend/utils/types.js +1 -1
- package/app-backend/utils/types.js.map +1 -1
- package/app-frontend/components/ActionButton.js +5 -5
- package/app-frontend/components/ActionButton.js.map +1 -1
- package/app-frontend/components/DropDown.js +91 -119
- package/app-frontend/components/DropDown.js.map +1 -1
- package/app-frontend/components/FilterInput.js +31 -48
- package/app-frontend/components/FilterInput.js.map +1 -1
- package/app-frontend/components/GenericSelect.js +30 -59
- package/app-frontend/components/GenericSelect.js.map +1 -1
- package/app-frontend/components/GenericTabs.js +5 -23
- package/app-frontend/components/GenericTabs.js.map +1 -1
- package/app-frontend/components/Overlay.js +15 -34
- package/app-frontend/components/Overlay.js.map +1 -1
- package/app-frontend/components/TS_Input.js +43 -60
- package/app-frontend/components/TS_Input.js.map +1 -1
- package/app-frontend/components/TS_Table.js +31 -48
- package/app-frontend/components/TS_Table.js.map +1 -1
- package/app-frontend/components/TS_TextArea.js +21 -48
- package/app-frontend/components/TS_TextArea.js.map +1 -1
- package/app-frontend/components/Tabs.js +16 -33
- package/app-frontend/components/Tabs.js.map +1 -1
- package/app-frontend/components/adapter/Adapter.js +103 -154
- package/app-frontend/components/adapter/Adapter.js.map +1 -1
- package/app-frontend/components/adapter/BaseRenderer.js +9 -32
- package/app-frontend/components/adapter/BaseRenderer.js.map +1 -1
- package/app-frontend/components/checkbox/TS_Checkbox.js +12 -29
- package/app-frontend/components/checkbox/TS_Checkbox.js.map +1 -1
- package/app-frontend/components/checkbox/TS_CheckboxField.js +16 -34
- package/app-frontend/components/checkbox/TS_CheckboxField.js.map +1 -1
- package/app-frontend/components/form/Form.js +21 -39
- package/app-frontend/components/form/Form.js.map +1 -1
- package/app-frontend/components/playground/Example_NewProps.js +25 -53
- package/app-frontend/components/playground/Example_NewProps.js.map +1 -1
- package/app-frontend/components/playground/Playground.js +21 -49
- package/app-frontend/components/playground/Playground.js.map +1 -1
- package/app-frontend/components/tree/MenuComponent.js +11 -27
- package/app-frontend/components/tree/MenuComponent.js.map +1 -1
- package/app-frontend/components/tree/MultiTypeAdaptor.js +16 -32
- package/app-frontend/components/tree/MultiTypeAdaptor.js.map +1 -1
- package/app-frontend/components/tree/SimpleTreeNodeRenderer.js +18 -52
- package/app-frontend/components/tree/SimpleTreeNodeRenderer.js.map +1 -1
- package/app-frontend/components/tree/Tree.js +142 -178
- package/app-frontend/components/tree/Tree.js.map +1 -1
- package/app-frontend/components/treeicons.js +5 -5
- package/app-frontend/components/treeicons.js.map +1 -1
- package/app-frontend/core/AbstractThunder.js +27 -43
- package/app-frontend/core/AbstractThunder.js.map +1 -1
- package/app-frontend/core/AppPage.js +16 -32
- package/app-frontend/core/AppPage.js.map +1 -1
- package/app-frontend/core/AppWrapper.js +9 -10
- package/app-frontend/core/AppWrapper.js.map +1 -1
- package/app-frontend/core/BaseComponent.js +62 -106
- package/app-frontend/core/BaseComponent.js.map +1 -1
- package/app-frontend/core/SimpleScriptInjector.js +12 -31
- package/app-frontend/core/SimpleScriptInjector.js.map +1 -1
- package/app-frontend/core/Thunder.js +32 -48
- package/app-frontend/core/Thunder.js.map +1 -1
- package/app-frontend/core/thunder-dispatcher.js +18 -67
- package/app-frontend/core/thunder-dispatcher.js.map +1 -1
- package/app-frontend/modules/ConnectivityModule.js +16 -32
- package/app-frontend/modules/ConnectivityModule.js.map +1 -1
- package/app-frontend/modules/ForceUpgrade.js +17 -33
- package/app-frontend/modules/ForceUpgrade.js.map +1 -1
- package/app-frontend/modules/HistoryModule.js +51 -79
- package/app-frontend/modules/HistoryModule.js.map +1 -1
- package/app-frontend/modules/ResourcesModule.js +12 -28
- package/app-frontend/modules/ResourcesModule.js.map +1 -1
- package/app-frontend/modules/StorageModule.js +47 -68
- package/app-frontend/modules/StorageModule.js.map +1 -1
- package/app-frontend/modules/ThunderstormModule.js +15 -31
- package/app-frontend/modules/ThunderstormModule.js.map +1 -1
- package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js +24 -41
- package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js.map +1 -1
- package/app-frontend/modules/component-loader/entry-component-loading-module.js +19 -36
- package/app-frontend/modules/component-loader/entry-component-loading-module.js.map +1 -1
- package/app-frontend/modules/dialog/Dialog.js +55 -96
- package/app-frontend/modules/dialog/Dialog.js.map +1 -1
- package/app-frontend/modules/dialog/DialogModule.js +48 -84
- package/app-frontend/modules/dialog/DialogModule.js.map +1 -1
- package/app-frontend/modules/http/HttpClient.js +46 -93
- package/app-frontend/modules/http/HttpClient.js.map +1 -1
- package/app-frontend/modules/http/XhrHttpModule.js +66 -88
- package/app-frontend/modules/http/XhrHttpModule.js.map +1 -1
- package/app-frontend/modules/locale/LocaleModule.js +23 -50
- package/app-frontend/modules/locale/LocaleModule.js.map +1 -1
- package/app-frontend/modules/menu/MenuAndButton.js +23 -40
- package/app-frontend/modules/menu/MenuAndButton.js.map +1 -1
- package/app-frontend/modules/menu/MenuModule.js +25 -42
- package/app-frontend/modules/menu/MenuModule.js.map +1 -1
- package/app-frontend/modules/menu/PopupMenu.js +37 -64
- package/app-frontend/modules/menu/PopupMenu.js.map +1 -1
- package/app-frontend/modules/routing/RoutingModule.js +47 -66
- package/app-frontend/modules/routing/RoutingModule.js.map +1 -1
- package/app-frontend/modules/routing/route.js +31 -33
- package/app-frontend/modules/routing/route.js.map +1 -1
- package/app-frontend/modules/toaster/BaseToaster.js +18 -36
- package/app-frontend/modules/toaster/BaseToaster.js.map +1 -1
- package/app-frontend/modules/toaster/Toaster.js +12 -38
- package/app-frontend/modules/toaster/Toaster.js.map +1 -1
- package/app-frontend/modules/toaster/ToasterModule.js +61 -88
- package/app-frontend/modules/toaster/ToasterModule.js.map +1 -1
- package/app-frontend/modules/tooltip/Tooltip.js +25 -52
- package/app-frontend/modules/tooltip/Tooltip.js.map +1 -1
- package/app-frontend/modules/tooltip/TooltipModule.js +32 -51
- package/app-frontend/modules/tooltip/TooltipModule.js.map +1 -1
- package/app-frontend/tools/KeyboardListener.js +24 -41
- package/app-frontend/tools/KeyboardListener.js.map +1 -1
- package/app-frontend/tools/Stylable.js +14 -28
- package/app-frontend/tools/Stylable.js.map +1 -1
- package/app-frontend/utils/tools.js +8 -8
- package/app-frontend/utils/tools.js.map +1 -1
- package/app-frontend/widgets/FieldEditor.js +16 -32
- package/app-frontend/widgets/FieldEditor.js.map +1 -1
- package/app-frontend/widgets/FieldEditorClick.js +32 -49
- package/app-frontend/widgets/FieldEditorClick.js.map +1 -1
- package/app-frontend/widgets/FieldEditorWithButtons.js +33 -49
- package/app-frontend/widgets/FieldEditorWithButtons.js.map +1 -1
- package/app-frontend/widgets/click-to-drag/ClickToDrag.js +25 -41
- package/app-frontend/widgets/click-to-drag/ClickToDrag.js.map +1 -1
- package/app-frontend/widgets/click-to-drag/OverlayWithDocumentListener.js +22 -38
- package/app-frontend/widgets/click-to-drag/OverlayWithDocumentListener.js.map +1 -1
- package/package.json +4 -4
- package/shared/BaseHttpModule.js +44 -64
- package/shared/BaseHttpModule.js.map +1 -1
- package/shared/BaseHttpRequest.js +122 -176
- package/shared/BaseHttpRequest.js.map +1 -1
- package/shared/request-types.js +4 -19
- package/shared/request-types.js.map +1 -1
- package/test-backend/StormTester.js +37 -90
- package/test-backend/StormTester.js.map +1 -1
|
@@ -1,37 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
3
|
exports.PopupMenu = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const MenuModule_1 = require("./MenuModule");
|
|
6
|
+
const BaseComponent_1 = require("../../core/BaseComponent");
|
|
7
|
+
const tools_1 = require("../../utils/tools");
|
|
8
|
+
const Tree_1 = require("../../components/tree/Tree");
|
|
9
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
10
|
+
const defaultStyle = {
|
|
35
11
|
width: 225,
|
|
36
12
|
overflowX: "hidden",
|
|
37
13
|
overflowY: "scroll",
|
|
@@ -42,7 +18,7 @@ var defaultStyle = {
|
|
|
42
18
|
backgroundColor: "#fff",
|
|
43
19
|
position: "absolute"
|
|
44
20
|
};
|
|
45
|
-
|
|
21
|
+
const overlayStyle = {
|
|
46
22
|
cursor: "default",
|
|
47
23
|
position: "fixed",
|
|
48
24
|
top: 0,
|
|
@@ -53,59 +29,57 @@ var overlayStyle = {
|
|
|
53
29
|
width: "100vw",
|
|
54
30
|
zIndex: 3333
|
|
55
31
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var element = _this.state.element;
|
|
32
|
+
class PopupMenu extends BaseComponent_1.BaseComponent {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.overlayRef = React.createRef();
|
|
36
|
+
this.__onMenuDisplay = (element) => this.setState({ element });
|
|
37
|
+
this.__onMenuHide = (id) => {
|
|
38
|
+
const element = this.state.element;
|
|
64
39
|
if (!element || element.id !== id)
|
|
65
40
|
return;
|
|
66
|
-
|
|
41
|
+
this.setState({ element: undefined });
|
|
67
42
|
};
|
|
68
|
-
|
|
69
|
-
if (
|
|
43
|
+
this.stopClickCascading = (e) => {
|
|
44
|
+
if (this.overlayRef.current === e.target)
|
|
70
45
|
tools_1.stopPropagation(e);
|
|
71
46
|
};
|
|
72
|
-
|
|
47
|
+
this.closeMenu = (e) => {
|
|
73
48
|
var _a, _b;
|
|
74
49
|
if (e.which === 3)
|
|
75
50
|
return;
|
|
76
|
-
if (
|
|
51
|
+
if (this.overlayRef.current !== e.target)
|
|
77
52
|
return;
|
|
78
53
|
tools_1.stopPropagation(e);
|
|
79
|
-
|
|
54
|
+
const id = (_b = (_a = this.state) === null || _a === void 0 ? void 0 : _a.element) === null || _b === void 0 ? void 0 : _b.id;
|
|
80
55
|
id && MenuModule_1.MenuModule.hide(id);
|
|
81
|
-
|
|
56
|
+
this.setState({ element: undefined });
|
|
82
57
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
58
|
+
this.style = (pos, css) => (Object.assign(Object.assign(Object.assign({}, defaultStyle), css), pos));
|
|
59
|
+
this.eventListenersEffect = () => {
|
|
60
|
+
const _current = this.overlayRef.current;
|
|
86
61
|
if (!_current)
|
|
87
62
|
return;
|
|
88
63
|
// _current.addEventListener("mousedown", this.stopClickCascading, false);
|
|
89
|
-
_current.addEventListener("mousedown",
|
|
64
|
+
_current.addEventListener("mousedown", this.closeMenu, false);
|
|
90
65
|
};
|
|
91
|
-
return _this;
|
|
92
66
|
}
|
|
93
|
-
|
|
67
|
+
componentDidMount() {
|
|
94
68
|
this.eventListenersEffect();
|
|
95
|
-
}
|
|
96
|
-
|
|
69
|
+
}
|
|
70
|
+
componentDidUpdate() {
|
|
97
71
|
this.eventListenersEffect();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
72
|
+
}
|
|
73
|
+
componentWillUnmount() {
|
|
74
|
+
const current = this.overlayRef.current;
|
|
101
75
|
if (current) {
|
|
102
76
|
current.removeEventListener("mousedown", this.stopClickCascading, false);
|
|
103
77
|
current.removeEventListener("mouseup", this.closeMenu, false);
|
|
104
78
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
107
81
|
var _a;
|
|
108
|
-
|
|
82
|
+
const element = (_a = this.state) === null || _a === void 0 ? void 0 : _a.element;
|
|
109
83
|
if (!element)
|
|
110
84
|
return null;
|
|
111
85
|
//tree instead of menu component
|
|
@@ -113,9 +87,8 @@ var PopupMenu = /** @class */ (function (_super) {
|
|
|
113
87
|
React.createElement("div", { id: "overlay", ref: this.overlayRef, style: overlayStyle },
|
|
114
88
|
React.createElement("div", { style: this.style(element.pos, element.css) },
|
|
115
89
|
React.createElement(Tree_1.Tree, { id: ts_common_1.generateHex(8), adapter: element.adapter, onNodeClicked: element.onNodeClicked, indentPx: 0 }))));
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
}(BaseComponent_1.BaseComponent));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
119
92
|
exports.PopupMenu = PopupMenu;
|
|
120
93
|
;
|
|
121
94
|
//# sourceMappingURL=PopupMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupMenu.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/menu/PopupMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PopupMenu.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/menu/PopupMenu.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,6CAIsB;AACtB,4DAAuD;AACvD,6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AAI,CAAC,KAAK,0CAAE,OAAO,CAAC;QACpC,IAAI,CAAC,OAAO;YACX,OAAO,IAAI,CAAC;QACf,gCAAgC;QAC9B,OAAO,6BAAK,KAAK,EAAE,EAAC,QAAQ,EAAE,UAAU,EAAC;YACxC,6BAAK,EAAE,EAAC,SAAS,EAAC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,YAAY;gBAC1D,6BAAK,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;oBAC/C,oBAAC,WAAI,IACJ,EAAE,EAAE,uBAAW,CAAC,CAAC,CAAC,EAClB,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,aAAa,EAAE,OAAO,CAAC,aAAa,EACpC,QAAQ,EAAE,CAAC,GACV,CACG,CACD,CACD,CAAC;IACR,CAAC;CAWD;AApFD,8BAoFC;AAAA,CAAC"}
|
|
@@ -19,87 +19,68 @@
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var __extends = (this && this.__extends) || (function () {
|
|
23
|
-
var extendStatics = function (d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
return function (d, b) {
|
|
30
|
-
extendStatics(d, b);
|
|
31
|
-
function __() { this.constructor = d; }
|
|
32
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
23
|
exports.RoutingModule = void 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_this.createRouteNode = route_1.defaultRouteNode;
|
|
52
|
-
return _this;
|
|
24
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
25
|
+
const React = require("react");
|
|
26
|
+
const route_1 = require("./route");
|
|
27
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
28
|
+
const HistoryModule_1 = require("../HistoryModule");
|
|
29
|
+
class RoutingModule_Class extends ts_common_1.Module {
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.routes = {};
|
|
33
|
+
this.ordinalRoutes = [];
|
|
34
|
+
this.getMyRouteKey = () => Object.keys(this.routes).find(key => this.routes[key].path === HistoryModule_1.BrowserHistoryModule.getCurrent().pathname);
|
|
35
|
+
this.createNavLinkNode = route_1.defaultNavLinkNode;
|
|
36
|
+
this.createLinkNode = route_1.defaultLinkNode;
|
|
37
|
+
this.createRouteNode = route_1.defaultRouteNode;
|
|
53
38
|
}
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
for (
|
|
58
|
-
var item = _a[_i];
|
|
39
|
+
init() {
|
|
40
|
+
}
|
|
41
|
+
clearRoutes() {
|
|
42
|
+
for (const item of this.ordinalRoutes) {
|
|
59
43
|
delete this.routes[item];
|
|
60
44
|
}
|
|
61
45
|
this.ordinalRoutes.splice(0);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
}
|
|
47
|
+
addRoute(key, route, component) {
|
|
48
|
+
const previousRoute = this.routes[key];
|
|
65
49
|
if (previousRoute)
|
|
66
|
-
throw new ts_common_1.BadImplementationException(
|
|
50
|
+
throw new ts_common_1.BadImplementationException(`Route key '${key}' MUST be unique!!\n Found two routes with matching key: '${route}' && '${previousRoute.path}'`);
|
|
67
51
|
ts_common_1.addItemToArray(this.ordinalRoutes, key);
|
|
68
52
|
return this.routes[key] = new route_1.RoutePath(key, route, component);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
53
|
+
}
|
|
54
|
+
getRoute(key) {
|
|
55
|
+
const route = this.routes[key];
|
|
72
56
|
if (!route)
|
|
73
|
-
throw new ts_common_1.BadImplementationException(
|
|
57
|
+
throw new ts_common_1.BadImplementationException(`No Route for key '${key}'... Did you forget to add it??`);
|
|
74
58
|
return route;
|
|
75
|
-
}
|
|
76
|
-
|
|
59
|
+
}
|
|
60
|
+
getPath(key) {
|
|
77
61
|
return this.getRoute(key).path;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
HistoryModule_1.BrowserHistoryModule.push({ pathname
|
|
83
|
-
}
|
|
84
|
-
|
|
62
|
+
}
|
|
63
|
+
goToRoute(key, params) {
|
|
64
|
+
const pathname = this.getPath(key);
|
|
65
|
+
const search = route_1.RoutePath.composeStringQuery(params);
|
|
66
|
+
HistoryModule_1.BrowserHistoryModule.push({ pathname, search });
|
|
67
|
+
}
|
|
68
|
+
redirect(key) {
|
|
85
69
|
return React.createElement(react_router_dom_1.Redirect, { to: exports.RoutingModule.getPath(key) });
|
|
86
|
-
}
|
|
70
|
+
}
|
|
87
71
|
// need to figure out how to create parameterized urls from this call !!
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
RoutingModule_Class.prototype.getNavLink = function (key) {
|
|
72
|
+
getNavLinks(keys) {
|
|
73
|
+
return keys.map(key => this.getRoute(key)).filter(route => route.visible && route.visible()).map(route => this.createNavLinkNode(route));
|
|
74
|
+
}
|
|
75
|
+
getNavLink(key) {
|
|
93
76
|
return this.createNavLinkNode(this.getRoute(key));
|
|
94
|
-
}
|
|
95
|
-
|
|
77
|
+
}
|
|
78
|
+
getLink(key) {
|
|
96
79
|
return this.createLinkNode(this.getRoute(key));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return RoutingModule_Class;
|
|
103
|
-
}(ts_common_1.Module));
|
|
80
|
+
}
|
|
81
|
+
getRoutesMap(keys) {
|
|
82
|
+
return React.createElement(react_router_dom_1.Switch, null, (keys || this.ordinalRoutes).map(key => this.createRouteNode(this.getRoute(key))));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
104
85
|
exports.RoutingModule = new RoutingModule_Class();
|
|
105
86
|
//# sourceMappingURL=RoutingModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoutingModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/routing/RoutingModule.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"RoutingModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/routing/RoutingModule.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,4DAIsC;AACtC,+BAA+B;AAC/B,mCAMiB;AACjB,uDAG0B;AAC1B,oDAAsD;AAGtD,MAAM,mBACL,SAAQ,kBAAU;IAQlB;QACC,KAAK,EAAE,CAAC;QARQ,WAAM,GAAiC,EAAE,CAAC;QAC1C,kBAAa,GAAa,EAAE,CAAC;QAwD9C,kBAAa,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,oCAAoB,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAC;QAhDhI,IAAI,CAAC,iBAAiB,GAAG,0BAAkB,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,uBAAe,CAAC;QACtC,IAAI,CAAC,eAAe,GAAG,wBAAgB,CAAC;IACzC,CAAC;IAED,IAAI;IACJ,CAAC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QACnB,OAAO,oBAAC,2BAAQ,IAAC,EAAE,EAAE,qBAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IACpD,CAAC;IAID,wEAAwE;IACxE,WAAW,CAAC,IAAc;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1I,CAAC;IAED,UAAU,CAAC,GAAW;QACrB,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,YAAY,CAAC,IAAe;QAC3B,OAAO,oBAAC,yBAAM,QACZ,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAC1E,CAAC;IACX,CAAC;CACD;AAEY,QAAA,aAAa,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -21,73 +21,71 @@
|
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.defaultRouteNode = exports.defaultLinkNode = exports.defaultNavLinkNode = exports.RoutePath = void 0;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _this = this;
|
|
24
|
+
const React = require("react");
|
|
25
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
26
|
+
const ReactEntryComponentInjector_1 = require("../component-loader/ReactEntryComponentInjector");
|
|
27
|
+
class RoutePath {
|
|
28
|
+
constructor(key, route, component) {
|
|
30
29
|
this.exact = false;
|
|
31
|
-
this.visible =
|
|
30
|
+
this.visible = () => !!this.label;
|
|
32
31
|
this.key = key;
|
|
33
32
|
this.path = route;
|
|
34
33
|
this.component = component;
|
|
35
34
|
}
|
|
36
|
-
|
|
35
|
+
setLogMessage(logMessage) {
|
|
37
36
|
// @ts-ignore
|
|
38
37
|
this.logMessage = logMessage;
|
|
39
38
|
return this;
|
|
40
|
-
}
|
|
41
|
-
|
|
39
|
+
}
|
|
40
|
+
setLabel(label) {
|
|
42
41
|
// @ts-ignore
|
|
43
42
|
this.label = label;
|
|
44
43
|
return this;
|
|
45
|
-
}
|
|
46
|
-
|
|
44
|
+
}
|
|
45
|
+
setVisible(visible) {
|
|
47
46
|
// @ts-ignore
|
|
48
47
|
this.visible = visible;
|
|
49
48
|
return this;
|
|
50
|
-
}
|
|
51
|
-
|
|
49
|
+
}
|
|
50
|
+
setEnabled(enabled) {
|
|
52
51
|
// @ts-ignore
|
|
53
52
|
this.enabled = enabled;
|
|
54
53
|
return this;
|
|
55
|
-
}
|
|
56
|
-
|
|
54
|
+
}
|
|
55
|
+
setExact(exact) {
|
|
57
56
|
// @ts-ignore
|
|
58
57
|
this.exact = exact;
|
|
59
58
|
return this;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
}
|
|
60
|
+
compose(params) {
|
|
61
|
+
const paramsAsString = RoutePath.composeStringQuery(params);
|
|
63
62
|
return this.path + paramsAsString;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
}
|
|
64
|
+
static composeStringQuery(params) {
|
|
65
|
+
let paramsAsString = "";
|
|
67
66
|
if (params)
|
|
68
|
-
paramsAsString = Object.keys(params).reduce(
|
|
69
|
-
|
|
67
|
+
paramsAsString = Object.keys(params).reduce((toRet, key) => {
|
|
68
|
+
let param = params[key];
|
|
70
69
|
if (typeof param === "function")
|
|
71
70
|
param = param();
|
|
72
|
-
return toRet
|
|
71
|
+
return `${toRet}&${key}=${param}`;
|
|
73
72
|
}, paramsAsString);
|
|
74
73
|
if (paramsAsString.length > 0)
|
|
75
|
-
paramsAsString =
|
|
74
|
+
paramsAsString = `?${paramsAsString.substring(1)}`;
|
|
76
75
|
return paramsAsString;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
}());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
80
78
|
exports.RoutePath = RoutePath;
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
const activeStyle = { color: 'blue' };
|
|
80
|
+
const defaultNavLinkNode = (route) => {
|
|
83
81
|
return React.createElement(react_router_dom_1.NavLink, { key: route.key, to: route.path, activeStyle: activeStyle }, route.label);
|
|
84
82
|
};
|
|
85
83
|
exports.defaultNavLinkNode = defaultNavLinkNode;
|
|
86
|
-
|
|
84
|
+
const defaultLinkNode = (route, node) => {
|
|
87
85
|
return React.createElement(react_router_dom_1.Link, { key: route.key, to: route.path }, node || route.label || route.key);
|
|
88
86
|
};
|
|
89
87
|
exports.defaultLinkNode = defaultLinkNode;
|
|
90
|
-
|
|
88
|
+
const defaultRouteNode = (route) => {
|
|
91
89
|
if (typeof route.component === "string")
|
|
92
90
|
return React.createElement(ReactEntryComponentInjector_1.ReactEntryComponentInjector, { src: route.component });
|
|
93
91
|
return React.createElement(react_router_dom_1.Route, { exact: route.exact, key: route.key, path: route.path, component: route.component });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/routing/route.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/routing/route.t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IAAC,GAAG,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC;IAE7D,OAAO,oBAAC,wBAAK,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,CAAC;AACpG,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
|
|
@@ -19,56 +19,38 @@
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var __extends = (this && this.__extends) || (function () {
|
|
23
|
-
var extendStatics = function (d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
return function (d, b) {
|
|
30
|
-
extendStatics(d, b);
|
|
31
|
-
function __() { this.constructor = d; }
|
|
32
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
23
|
exports.BaseToaster = void 0;
|
|
37
|
-
|
|
24
|
+
const React = require("react");
|
|
38
25
|
// noinspection TypeScriptPreferShortImport
|
|
39
|
-
|
|
26
|
+
const ToasterModule_1 = require("./ToasterModule");
|
|
40
27
|
// noinspection TypeScriptPreferShortImport
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_this.setState({ model: model });
|
|
28
|
+
const BaseComponent_1 = require("../../core/BaseComponent");
|
|
29
|
+
class BaseToaster extends BaseComponent_1.BaseComponent {
|
|
30
|
+
constructor(props) {
|
|
31
|
+
super(props);
|
|
32
|
+
this.__showToast = (model) => {
|
|
33
|
+
this.setState({ model });
|
|
48
34
|
if (!model)
|
|
49
35
|
return;
|
|
50
|
-
|
|
36
|
+
const duration = model.duration;
|
|
51
37
|
if (duration <= 0)
|
|
52
38
|
return;
|
|
53
|
-
|
|
39
|
+
this.debounce(() => ToasterModule_1.ToastModule.hideToast(model), 'closing_action', duration);
|
|
54
40
|
};
|
|
55
|
-
|
|
41
|
+
this.renderActions = (toast) => {
|
|
56
42
|
if (!toast.actions || toast.actions.length === 0)
|
|
57
|
-
return React.createElement("button", { onClick:
|
|
58
|
-
return React.createElement("div", { className: 'll_v_l' }, React.Children.map(toast.actions,
|
|
59
|
-
return React.cloneElement(action, { key: idx });
|
|
60
|
-
}));
|
|
43
|
+
return React.createElement("button", { onClick: () => ToasterModule_1.ToastModule.hideToast(toast) }, "X");
|
|
44
|
+
return React.createElement("div", { className: 'll_v_l' }, React.Children.map(toast.actions, (action, idx) => React.cloneElement(action, { key: idx })));
|
|
61
45
|
};
|
|
62
|
-
|
|
63
|
-
return _this;
|
|
46
|
+
this.state = {};
|
|
64
47
|
}
|
|
65
|
-
|
|
66
|
-
|
|
48
|
+
render() {
|
|
49
|
+
const toast = this.state.model;
|
|
67
50
|
if (!(toast === null || toast === void 0 ? void 0 : toast.content))
|
|
68
51
|
return null;
|
|
69
52
|
return this.renderToaster(toast);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}(BaseComponent_1.BaseComponent));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
73
55
|
exports.BaseToaster = BaseToaster;
|
|
74
56
|
//# sourceMappingURL=BaseToaster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseToaster.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/toaster/BaseToaster.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"BaseTo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,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAC/B,IAAI,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAA;YAClB,OAAO,IAAI,CAAC;QAEb,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CAYD;AAvCD,kCAuCC"}
|
|
@@ -19,43 +19,18 @@
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var __extends = (this && this.__extends) || (function () {
|
|
23
|
-
var extendStatics = function (d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
return function (d, b) {
|
|
30
|
-
extendStatics(d, b);
|
|
31
|
-
function __() { this.constructor = d; }
|
|
32
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __assign = (this && this.__assign) || function () {
|
|
36
|
-
__assign = Object.assign || function(t) {
|
|
37
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38
|
-
s = arguments[i];
|
|
39
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
40
|
-
t[p] = s[p];
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
};
|
|
44
|
-
return __assign.apply(this, arguments);
|
|
45
|
-
};
|
|
46
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
23
|
exports.Toaster = void 0;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return _super.call(this, props) || this;
|
|
24
|
+
const React = require("react");
|
|
25
|
+
const BaseToaster_1 = require("./BaseToaster");
|
|
26
|
+
class Toaster extends BaseToaster_1.BaseToaster {
|
|
27
|
+
constructor(props) {
|
|
28
|
+
super(props);
|
|
54
29
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
30
|
+
renderToaster(toast) {
|
|
31
|
+
const horizontal = toast.positionHorizontal;
|
|
32
|
+
const vertical = toast.positionVertical;
|
|
33
|
+
const style = {
|
|
59
34
|
justifyContent: "space-between",
|
|
60
35
|
borderRadius: "4px",
|
|
61
36
|
letterSpacing: "4px",
|
|
@@ -70,11 +45,10 @@ var Toaster = /** @class */ (function (_super) {
|
|
|
70
45
|
transform: horizontal === "center" ? "translateX(-50%)" : "unset",
|
|
71
46
|
zIndex: 9999
|
|
72
47
|
};
|
|
73
|
-
return (React.createElement("div", { className:
|
|
48
|
+
return (React.createElement("div", { className: `ll_h_t ${toast.className}`, style: Object.assign(Object.assign({}, style), toast.style) },
|
|
74
49
|
typeof toast.content === "string" ? React.createElement("div", { dangerouslySetInnerHTML: { __html: toast.content } }) : toast.content,
|
|
75
50
|
this.renderActions(toast)));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
}(BaseToaster_1.BaseToaster));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
79
53
|
exports.Toaster = Toaster;
|
|
80
54
|
//# sourceMappingURL=Toaster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/toaster/Toaster.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/toaster/Toaster.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,+BAA+B;AAG/B,+CAGuB;AAEvB,MAAa,OACZ,SAAQ,yBAAW;IAEn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