@intuitionrobotics/thunderstorm 0.41.69 → 0.41.72
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
|
@@ -19,39 +19,15 @@
|
|
|
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.Dialog = exports.DialogButton_Cancel = exports.DialogButton_Close = exports.DialogButton_Redo = exports.DialogButton_Undo = exports.DialogButton_Save = exports.DialogButton_Submit = void 0;
|
|
48
|
-
|
|
24
|
+
const React = require("react");
|
|
49
25
|
// noinspection TypeScriptPreferShortImport
|
|
50
|
-
|
|
26
|
+
const DialogModule_1 = require("./DialogModule");
|
|
51
27
|
// noinspection TypeScriptPreferShortImport
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
28
|
+
const BaseComponent_1 = require("../../core/BaseComponent");
|
|
29
|
+
const tools_1 = require("../../utils/tools");
|
|
30
|
+
const modalOverlay = {
|
|
55
31
|
position: "fixed",
|
|
56
32
|
top: 0,
|
|
57
33
|
left: 0,
|
|
@@ -61,7 +37,7 @@ var modalOverlay = {
|
|
|
61
37
|
alignItems: "center",
|
|
62
38
|
justifyContent: "center"
|
|
63
39
|
};
|
|
64
|
-
|
|
40
|
+
const defaultDialogStyle = {
|
|
65
41
|
borderRadius: "4px",
|
|
66
42
|
boxShadow: "0px 2px 5px 0 rgba(0, 0, 0, 0.28)",
|
|
67
43
|
backgroundColor: "#ffffff",
|
|
@@ -74,11 +50,11 @@ var defaultDialogStyle = {
|
|
|
74
50
|
// msTransform: "translate(-50%, -50%)",
|
|
75
51
|
// transform: "translate(-50%, -50%)"
|
|
76
52
|
};
|
|
77
|
-
|
|
53
|
+
const defaultContentStyle = {
|
|
78
54
|
// display: "inline-block",
|
|
79
55
|
padding: "24px 18px 0",
|
|
80
56
|
};
|
|
81
|
-
|
|
57
|
+
const defaultButtonStyle = {
|
|
82
58
|
borderRadius: "4px",
|
|
83
59
|
color: "white",
|
|
84
60
|
fontSize: "11px",
|
|
@@ -88,66 +64,53 @@ var defaultButtonStyle = {
|
|
|
88
64
|
height: "23px",
|
|
89
65
|
width: "68px"
|
|
90
66
|
};
|
|
91
|
-
|
|
67
|
+
const defaultSubmitStyle = {
|
|
92
68
|
backgroundColor: '#00b5ff'
|
|
93
69
|
};
|
|
94
|
-
|
|
70
|
+
const defaultCancelStyle = {
|
|
95
71
|
backgroundColor: "#d9d9d9"
|
|
96
72
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.setAction(onSubmit);
|
|
102
|
-
};
|
|
73
|
+
const DialogButton_Submit = (onSubmit, label) => new DialogModule_1.DialogButton_Builder()
|
|
74
|
+
.setStyle(Object.assign(Object.assign({}, defaultSubmitStyle), defaultButtonStyle))
|
|
75
|
+
.setContent(label || "Submit")
|
|
76
|
+
.setAction(onSubmit);
|
|
103
77
|
exports.DialogButton_Submit = DialogButton_Submit;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.setAction(onSave);
|
|
109
|
-
};
|
|
78
|
+
const DialogButton_Save = (onSave, label) => new DialogModule_1.DialogButton_Builder()
|
|
79
|
+
.setStyle(Object.assign(Object.assign({}, defaultSubmitStyle), defaultButtonStyle))
|
|
80
|
+
.setContent(label || "Save")
|
|
81
|
+
.setAction(onSave);
|
|
110
82
|
exports.DialogButton_Save = DialogButton_Save;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.setAction(onSave);
|
|
116
|
-
};
|
|
83
|
+
const DialogButton_Undo = (onSave, label) => new DialogModule_1.DialogButton_Builder()
|
|
84
|
+
.setStyle(Object.assign(Object.assign({}, defaultSubmitStyle), defaultButtonStyle))
|
|
85
|
+
.setContent(label || "Undo")
|
|
86
|
+
.setAction(onSave);
|
|
117
87
|
exports.DialogButton_Undo = DialogButton_Undo;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.setAction(onSave);
|
|
123
|
-
};
|
|
88
|
+
const DialogButton_Redo = (onSave, label) => new DialogModule_1.DialogButton_Builder()
|
|
89
|
+
.setStyle(Object.assign(Object.assign({}, defaultSubmitStyle), defaultButtonStyle))
|
|
90
|
+
.setContent(label || "Redo")
|
|
91
|
+
.setAction(onSave);
|
|
124
92
|
exports.DialogButton_Redo = DialogButton_Redo;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
.setAction(onSubmit || DialogModule_1.DialogModule.close);
|
|
130
|
-
};
|
|
93
|
+
const DialogButton_Close = (onSubmit, label) => new DialogModule_1.DialogButton_Builder()
|
|
94
|
+
.setStyle(Object.assign(Object.assign({}, defaultSubmitStyle), defaultButtonStyle))
|
|
95
|
+
.setContent(label || "Close")
|
|
96
|
+
.setAction(onSubmit || DialogModule_1.DialogModule.close);
|
|
131
97
|
exports.DialogButton_Close = DialogButton_Close;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.setAction(onSubmit || DialogModule_1.DialogModule.close);
|
|
137
|
-
};
|
|
98
|
+
const DialogButton_Cancel = (onSubmit, label) => new DialogModule_1.DialogButton_Builder()
|
|
99
|
+
.setStyle(Object.assign(Object.assign({}, defaultCancelStyle), defaultButtonStyle))
|
|
100
|
+
.setContent(label || "Cancel")
|
|
101
|
+
.setAction(onSubmit || DialogModule_1.DialogModule.close);
|
|
138
102
|
exports.DialogButton_Cancel = DialogButton_Cancel;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
_this.__showDialog = function (model) {
|
|
103
|
+
class Dialog extends BaseComponent_1.BaseComponent {
|
|
104
|
+
constructor(props) {
|
|
105
|
+
super(props);
|
|
106
|
+
this.__showDialog = (model) => {
|
|
144
107
|
if (model && model.allowIndirectClosing)
|
|
145
108
|
addEventListener("keydown", Dialog.closeWithEsc);
|
|
146
109
|
else
|
|
147
110
|
removeEventListener("keydown", Dialog.closeWithEsc);
|
|
148
|
-
|
|
111
|
+
this.setState({ model });
|
|
149
112
|
};
|
|
150
|
-
|
|
113
|
+
this.renderTitle = (title) => {
|
|
151
114
|
if (!title)
|
|
152
115
|
return "";
|
|
153
116
|
if (typeof title === "string")
|
|
@@ -155,46 +118,42 @@ var Dialog = /** @class */ (function (_super) {
|
|
|
155
118
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: title } }));
|
|
156
119
|
return React.createElement("div", { className: "match_width" }, title);
|
|
157
120
|
};
|
|
158
|
-
|
|
121
|
+
this.renderContent = (content) => {
|
|
159
122
|
if (typeof content === "string")
|
|
160
123
|
return React.createElement("div", { style: defaultContentStyle },
|
|
161
124
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: content } }));
|
|
162
125
|
return content;
|
|
163
126
|
};
|
|
164
|
-
|
|
127
|
+
this.renderButtons = (model) => {
|
|
165
128
|
if (!model)
|
|
166
129
|
return null;
|
|
167
130
|
if (model.buttons.length === 0)
|
|
168
131
|
return "";
|
|
169
|
-
|
|
170
|
-
return React.createElement("div", { className:
|
|
171
|
-
return React.createElement("div", { key: idx, className: button.className, style: button.style, onClick: button.action }, button.content);
|
|
172
|
-
}));
|
|
132
|
+
const actionsStyle = Object.assign({ justifyContent: model.buttons.length > 1 ? "flex-end" : "center" }, (model.actionsStyle ? model.actionsStyle : {}));
|
|
133
|
+
return React.createElement("div", { className: `ll_h_c`, style: actionsStyle }, model.buttons.map((button, idx) => React.createElement("div", { key: idx, className: button.className, style: button.style, onClick: button.action }, button.content)));
|
|
173
134
|
};
|
|
174
|
-
|
|
135
|
+
this.onOverlayClicked = (e) => {
|
|
175
136
|
tools_1.stopPropagation(e);
|
|
176
|
-
if (
|
|
137
|
+
if (this.state.model && !this.state.model.allowIndirectClosing)
|
|
177
138
|
return;
|
|
178
139
|
DialogModule_1.DialogModule.close();
|
|
179
140
|
};
|
|
180
|
-
|
|
181
|
-
return _this;
|
|
141
|
+
this.state = {};
|
|
182
142
|
}
|
|
183
|
-
|
|
143
|
+
static closeWithEsc(e) {
|
|
184
144
|
if (e.keyCode === 27)
|
|
185
145
|
DialogModule_1.DialogModule.close();
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
146
|
+
}
|
|
147
|
+
render() {
|
|
148
|
+
const dialogModel = this.state.model;
|
|
189
149
|
if (!dialogModel)
|
|
190
150
|
return null;
|
|
191
|
-
return (React.createElement("div", { id: "overlay", style:
|
|
192
|
-
React.createElement("div", { className: "ll_v_l", style:
|
|
151
|
+
return (React.createElement("div", { id: "overlay", style: Object.assign(Object.assign({}, modalOverlay), { background: dialogModel.overlayColor, zIndex: dialogModel.zIndex }), onClick: this.onOverlayClicked },
|
|
152
|
+
React.createElement("div", { className: "ll_v_l", style: Object.assign(Object.assign({}, defaultDialogStyle), (dialogModel.style || {})), onClick: tools_1.stopPropagation },
|
|
193
153
|
dialogModel.title && this.renderTitle(dialogModel.title),
|
|
194
154
|
this.renderContent(dialogModel.content),
|
|
195
155
|
this.renderButtons(dialogModel))));
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
}(BaseComponent_1.BaseComponent));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
199
158
|
exports.Dialog = Dialog;
|
|
200
159
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/dialog/Dialog.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file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,WAAW;YACf,OAAO,IAAI,CAAC;QAEb,OAAO,CACN,6BAAK,EAAE,EAAC,SAAS,EAAC,KAAK,kCAAM,YAAY,KAAE,UAAU,EAAE,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,KAAG,OAAO,EAAE,IAAI,CAAC,gBAAgB;YAC3I,6BAAK,SAAS,EAAE,QAAQ,EAAE,KAAK,kCAAM,kBAAkB,GAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,GAChF,OAAO,EAAE,uBAAe;gBAC3B,WAAW,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC;gBACxD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC;gBACvC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAC3B,CACD,CACN,CAAC;IACH,CAAC;CA+CD;AArFD,wBAqFC"}
|
|
@@ -19,120 +19,85 @@
|
|
|
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 __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
36
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
37
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
38
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
39
|
-
r[k] = a[j];
|
|
40
|
-
return r;
|
|
41
|
-
};
|
|
42
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
23
|
exports.DialogModule = exports.Dialog_Builder = exports.DialogButton_Builder = exports.DialogModule_Class = void 0;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_this.close = function () {
|
|
24
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
25
|
+
const thunder_dispatcher_1 = require("../../core/thunder-dispatcher");
|
|
26
|
+
const Stylable_1 = require("../../tools/Stylable");
|
|
27
|
+
const dispatch_showDialog = new thunder_dispatcher_1.ThunderDispatcher("__showDialog");
|
|
28
|
+
class DialogModule_Class extends ts_common_1.Module {
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.close = () => {
|
|
53
32
|
dispatch_showDialog.dispatchUI([]);
|
|
54
33
|
};
|
|
55
|
-
|
|
34
|
+
this.show = (params) => {
|
|
56
35
|
dispatch_showDialog.dispatchUI([params]);
|
|
57
36
|
};
|
|
58
|
-
return _this;
|
|
59
37
|
}
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
return DialogModule_Class;
|
|
63
|
-
}(ts_common_1.Module));
|
|
64
|
-
exports.DialogModule_Class = DialogModule_Class;
|
|
65
|
-
var DialogButton_Builder = /** @class */ (function (_super) {
|
|
66
|
-
__extends(DialogButton_Builder, _super);
|
|
67
|
-
function DialogButton_Builder() {
|
|
68
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
38
|
+
init() {
|
|
69
39
|
}
|
|
70
|
-
|
|
40
|
+
}
|
|
41
|
+
exports.DialogModule_Class = DialogModule_Class;
|
|
42
|
+
class DialogButton_Builder extends Stylable_1.StylableBuilder {
|
|
43
|
+
setContent(content) {
|
|
71
44
|
this.content = content;
|
|
72
45
|
return this;
|
|
73
|
-
}
|
|
74
|
-
|
|
46
|
+
}
|
|
47
|
+
setAction(action) {
|
|
75
48
|
this.action = action;
|
|
76
49
|
return this;
|
|
77
|
-
}
|
|
78
|
-
|
|
50
|
+
}
|
|
51
|
+
build() {
|
|
79
52
|
return {
|
|
80
53
|
style: this.style,
|
|
81
54
|
className: this.className,
|
|
82
55
|
content: this.content,
|
|
83
56
|
action: this.action,
|
|
84
57
|
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
}(Stylable_1.StylableBuilder));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
88
60
|
exports.DialogButton_Builder = DialogButton_Builder;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_this.content = content;
|
|
99
|
-
return _this;
|
|
61
|
+
class Dialog_Builder extends Stylable_1.StylableBuilder {
|
|
62
|
+
constructor(content) {
|
|
63
|
+
super();
|
|
64
|
+
this.zIndex = 100;
|
|
65
|
+
this.buttons = [];
|
|
66
|
+
this.overlayColor = "rgba(29, 29, 48, 0.6)";
|
|
67
|
+
this.allowIndirectClosing = false;
|
|
68
|
+
this.actionsStyle = {};
|
|
69
|
+
this.content = content;
|
|
100
70
|
}
|
|
101
|
-
|
|
71
|
+
setAllowIndirectClosing(allowIndirectClosing) {
|
|
102
72
|
this.allowIndirectClosing = allowIndirectClosing;
|
|
103
73
|
return this;
|
|
104
|
-
}
|
|
105
|
-
|
|
74
|
+
}
|
|
75
|
+
setOverlayColor(overlayColor) {
|
|
106
76
|
this.overlayColor = overlayColor;
|
|
107
77
|
return this;
|
|
108
|
-
}
|
|
109
|
-
|
|
78
|
+
}
|
|
79
|
+
setActionsStyle(actionsStyle) {
|
|
110
80
|
this.actionsStyle = actionsStyle;
|
|
111
81
|
return this;
|
|
112
|
-
}
|
|
113
|
-
|
|
82
|
+
}
|
|
83
|
+
setTitle(title) {
|
|
114
84
|
this.title = title;
|
|
115
85
|
return this;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
var buttons = [];
|
|
119
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
120
|
-
buttons[_i] = arguments[_i];
|
|
121
|
-
}
|
|
86
|
+
}
|
|
87
|
+
setButtons(...buttons) {
|
|
122
88
|
this.buttons = buttons;
|
|
123
89
|
return this;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
this.buttons =
|
|
90
|
+
}
|
|
91
|
+
addButton(button) {
|
|
92
|
+
this.buttons = [...this.buttons, button];
|
|
127
93
|
return this;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (zIndex === void 0) { zIndex = 100; }
|
|
94
|
+
}
|
|
95
|
+
setZIndex(zIndex = 100) {
|
|
131
96
|
this.zIndex = zIndex;
|
|
132
97
|
return this;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
98
|
+
}
|
|
99
|
+
show() {
|
|
100
|
+
const model = {
|
|
136
101
|
style: this.style,
|
|
137
102
|
className: this.className,
|
|
138
103
|
buttons: this.buttons,
|
|
@@ -144,9 +109,8 @@ var Dialog_Builder = /** @class */ (function (_super) {
|
|
|
144
109
|
actionsStyle: this.actionsStyle
|
|
145
110
|
};
|
|
146
111
|
exports.DialogModule.show(model);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
}(Stylable_1.StylableBuilder));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
150
114
|
exports.Dialog_Builder = Dialog_Builder;
|
|
151
115
|
exports.DialogModule = new DialogModule_Class();
|
|
152
116
|
//# sourceMappingURL=DialogModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/dialog/DialogModule.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"DialogModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/dialog/DialogModule.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,4DAAoD;AACpD,sEAAgE;AAChE,mDAAiE;AAsBjE,MAAM,mBAAmB,GAAG,IAAI,sCAAiB,CAAiC,cAAc,CAAC,CAAC;AAElG,MAAa,kBACZ,SAAQ,kBAAU;IAElB;QACC,KAAK,EAAE,CAAC;QAMF,UAAK,GAAG,GAAG,EAAE;YACnB,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QACnC,CAAC,CAAC;QAEK,SAAI,GAAG,CAAC,MAAoB,EAAE,EAAE;YACtC,mBAAmB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;QACzC,CAAC,CAAA;IAXD,CAAC;IAES,IAAI;IACd,CAAC;CASD;AAjBD,gDAiBC;AAGD,MAAa,oBACZ,SAAQ,0BAAe;IAMvB,UAAU,CAAC,OAAwB;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,SAAS,CAAC,MAAkB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,KAAK;QACJ,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CAAC;IACH,CAAC;CACD;AAzBD,oDAyBC;AAED,MAAa,cACZ,SAAQ,0BAAe;IAUvB,YAAY,OAAwB;QACnC,KAAK,EAAE,CAAC;QATT,WAAM,GAAW,GAAG,CAAC;QAGrB,YAAO,GAAwB,EAAE,CAAC;QAClC,iBAAY,GAAU,uBAAuB,CAAC;QAC9C,y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AE,IAAI,CAAC,YAAY;SAC/B,CAAC;QAEF,oBAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACD;AAlED,wCAkEC;AAEY,QAAA,YAAY,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -19,17 +19,6 @@
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var __assign = (this && this.__assign) || function () {
|
|
23
|
-
__assign = Object.assign || function(t) {
|
|
24
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
25
|
-
s = arguments[i];
|
|
26
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
27
|
-
t[p] = s[p];
|
|
28
|
-
}
|
|
29
|
-
return t;
|
|
30
|
-
};
|
|
31
|
-
return __assign.apply(this, arguments);
|
|
32
|
-
};
|
|
33
22
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
34
23
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
35
24
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -39,117 +28,81 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
39
28
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
40
29
|
});
|
|
41
30
|
};
|
|
42
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
43
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
44
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
45
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
46
|
-
function step(op) {
|
|
47
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
48
|
-
while (_) try {
|
|
49
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
50
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
51
|
-
switch (op[0]) {
|
|
52
|
-
case 0: case 1: t = op; break;
|
|
53
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
54
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
55
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
56
|
-
default:
|
|
57
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
58
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
59
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
60
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
61
|
-
if (t[2]) _.ops.pop();
|
|
62
|
-
_.trys.pop(); continue;
|
|
63
|
-
}
|
|
64
|
-
op = body.call(thisArg, _);
|
|
65
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
66
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
32
|
exports.HttpClient = exports.createFormData = void 0;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
33
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
34
|
+
const __1 = require("../../..");
|
|
35
|
+
const backend_1 = require("../../../backend");
|
|
36
|
+
const createFormData = (filename, buffer) => ({ file: { value: buffer, options: { filename } } });
|
|
75
37
|
exports.createFormData = createFormData;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return [2 /*return*/, response.toJSON().body];
|
|
89
|
-
errorResponse = response.body;
|
|
90
|
-
if (!errorResponse)
|
|
91
|
-
throw new backend_1.ApiException(statusCode, "Http request failed without error message: " + ts_common_1.__stringify(body, true));
|
|
92
|
-
throw new backend_1.ApiException(statusCode, "Http request failed: " + errorResponse + " \n For Request: " + ts_common_1.__stringify(body, true));
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}); };
|
|
38
|
+
class HttpClient {
|
|
39
|
+
constructor(baseUrl) {
|
|
40
|
+
this.executeRequest = (body) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const response = yield backend_1.promisifyRequest(body, false);
|
|
42
|
+
const statusCode = response.statusCode;
|
|
43
|
+
if (statusCode >= 200 && statusCode < 300)
|
|
44
|
+
return response.toJSON().body;
|
|
45
|
+
const errorResponse = response.body;
|
|
46
|
+
if (!errorResponse)
|
|
47
|
+
throw new backend_1.ApiException(statusCode, `Http request failed without error message: ${ts_common_1.__stringify(body, true)}`);
|
|
48
|
+
throw new backend_1.ApiException(statusCode, `Http request failed: ${errorResponse} \n For Request: ${ts_common_1.__stringify(body, true)}`);
|
|
49
|
+
});
|
|
96
50
|
this.baseUrl = baseUrl;
|
|
97
51
|
}
|
|
98
|
-
|
|
52
|
+
setDefaultHeaders(defaultHeaders) {
|
|
99
53
|
this.defaultHeaders = defaultHeaders;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
headers:
|
|
104
|
-
uri:
|
|
54
|
+
}
|
|
55
|
+
form(path, buffer, headers) {
|
|
56
|
+
const request = {
|
|
57
|
+
headers: Object.assign(Object.assign({}, this.defaultHeaders), { headers }),
|
|
58
|
+
uri: `${this.baseUrl}${path}`,
|
|
105
59
|
formData: exports.createFormData('logs.zip', buffer),
|
|
106
60
|
method: __1.HttpMethod.POST,
|
|
107
61
|
};
|
|
108
62
|
return this.executeRequest(request);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
63
|
+
}
|
|
64
|
+
get(path, _params, headers) {
|
|
65
|
+
let url = `${this.baseUrl}${path}`;
|
|
66
|
+
let nextOperator = "?";
|
|
113
67
|
if (url.indexOf("?") !== -1)
|
|
114
68
|
nextOperator = "&";
|
|
115
69
|
if (_params)
|
|
116
|
-
url = Object.keys(_params).reduce(
|
|
117
|
-
|
|
70
|
+
url = Object.keys(_params).reduce((fullUrl, paramKey) => {
|
|
71
|
+
const param = _params[paramKey];
|
|
118
72
|
if (!param)
|
|
119
73
|
return url;
|
|
120
|
-
|
|
74
|
+
const temp = `${fullUrl}${nextOperator}${paramKey}=${encodeURIComponent(param)}`;
|
|
121
75
|
nextOperator = "&";
|
|
122
76
|
return temp;
|
|
123
77
|
}, url);
|
|
124
|
-
|
|
125
|
-
headers:
|
|
126
|
-
uri:
|
|
78
|
+
const request = {
|
|
79
|
+
headers: Object.assign(Object.assign({}, this.defaultHeaders), { headers }),
|
|
80
|
+
uri: `${url}`,
|
|
127
81
|
method: __1.HttpMethod.GET,
|
|
128
82
|
json: true
|
|
129
83
|
};
|
|
130
84
|
return this.executeRequest(request);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
headers:
|
|
135
|
-
uri:
|
|
136
|
-
body
|
|
85
|
+
}
|
|
86
|
+
post(path, body, headers) {
|
|
87
|
+
const request = {
|
|
88
|
+
headers: Object.assign(Object.assign({}, this.defaultHeaders), { headers }),
|
|
89
|
+
uri: `${this.baseUrl}${path}`,
|
|
90
|
+
body,
|
|
137
91
|
method: __1.HttpMethod.POST,
|
|
138
92
|
json: true
|
|
139
93
|
};
|
|
140
94
|
return this.executeRequest(request);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
headers:
|
|
145
|
-
uri:
|
|
146
|
-
body
|
|
95
|
+
}
|
|
96
|
+
put(path, body, headers) {
|
|
97
|
+
const request = {
|
|
98
|
+
headers: Object.assign(Object.assign({}, this.defaultHeaders), { headers }),
|
|
99
|
+
uri: `${this.baseUrl}${path}`,
|
|
100
|
+
body,
|
|
147
101
|
method: __1.HttpMethod.PUT,
|
|
148
102
|
json: true
|
|
149
103
|
};
|
|
150
104
|
return this.executeRequest(request);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
}());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
154
107
|
exports.HttpClient = HttpClient;
|
|
155
108
|
//# sourceMappingURL=HttpClient.js.map
|