@intuitionrobotics/thunderstorm 0.41.68 → 0.41.71
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,83 +19,64 @@
|
|
|
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.ToastModule = exports.ToastModule_Class = exports.ToastBuilder = exports.ToastType = void 0;
|
|
37
|
-
|
|
24
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
38
25
|
// noinspection TypeScriptPreferShortImport
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
const thunder_dispatcher_1 = require("../../core/thunder-dispatcher");
|
|
27
|
+
const Stylable_1 = require("../../tools/Stylable");
|
|
41
28
|
var ToastType;
|
|
42
29
|
(function (ToastType) {
|
|
43
30
|
ToastType[ToastType["success"] = 0] = "success";
|
|
44
31
|
ToastType[ToastType["error"] = 1] = "error";
|
|
45
32
|
ToastType[ToastType["info"] = 2] = "info";
|
|
46
33
|
})(ToastType = exports.ToastType || (exports.ToastType = {}));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
ToastBuilder.prototype.setType = function (type) {
|
|
34
|
+
const Interval_DefaultToast = 6 * ts_common_1.Second;
|
|
35
|
+
class ToastBuilder extends Stylable_1.StylableBuilder {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.bgColor = "#eeffef";
|
|
39
|
+
this.duration = Interval_DefaultToast;
|
|
40
|
+
this.type = ToastType.info;
|
|
41
|
+
this.positionVertical = "top";
|
|
42
|
+
this.positionHorizontal = "center";
|
|
43
|
+
this.actions = [];
|
|
44
|
+
this.content = "NO CONTENT";
|
|
45
|
+
}
|
|
46
|
+
setType(type) {
|
|
62
47
|
this.type = type;
|
|
63
48
|
return this;
|
|
64
|
-
}
|
|
65
|
-
|
|
49
|
+
}
|
|
50
|
+
setContent(content) {
|
|
66
51
|
this.content = content;
|
|
67
52
|
return this;
|
|
68
|
-
}
|
|
69
|
-
|
|
53
|
+
}
|
|
54
|
+
setBackground(bgColor) {
|
|
70
55
|
this.bgColor = bgColor;
|
|
71
56
|
return this;
|
|
72
|
-
}
|
|
73
|
-
|
|
57
|
+
}
|
|
58
|
+
setDuration(duration) {
|
|
74
59
|
this.duration = duration;
|
|
75
60
|
return this;
|
|
76
|
-
}
|
|
77
|
-
|
|
61
|
+
}
|
|
62
|
+
setActions(actions) {
|
|
78
63
|
this.actions = actions || [];
|
|
79
64
|
return this;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var actions = [];
|
|
83
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
84
|
-
actions[_i] = arguments[_i];
|
|
85
|
-
}
|
|
65
|
+
}
|
|
66
|
+
addActions(...actions) {
|
|
86
67
|
ts_common_1.addAllItemToArray(this.actions, actions);
|
|
87
68
|
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
69
|
+
}
|
|
70
|
+
setVerticalPosition(positionVertical) {
|
|
90
71
|
this.positionVertical = positionVertical;
|
|
91
72
|
return this;
|
|
92
|
-
}
|
|
93
|
-
|
|
73
|
+
}
|
|
74
|
+
setHorizontalPosition(positionHorizontal) {
|
|
94
75
|
this.positionHorizontal = positionHorizontal;
|
|
95
76
|
return this;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
77
|
+
}
|
|
78
|
+
show() {
|
|
79
|
+
const toast = {
|
|
99
80
|
duration: this.duration,
|
|
100
81
|
type: this.type,
|
|
101
82
|
content: this.content,
|
|
@@ -108,28 +89,26 @@ var ToastBuilder = /** @class */ (function (_super) {
|
|
|
108
89
|
};
|
|
109
90
|
// @ts-ignore
|
|
110
91
|
exports.ToastModule.toastImpl(toast);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
}(Stylable_1.StylableBuilder));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
114
94
|
exports.ToastBuilder = ToastBuilder;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
var message = _message;
|
|
95
|
+
const dispatch_showToast = new thunder_dispatcher_1.ThunderDispatcher("__showToast");
|
|
96
|
+
class ToastModule_Class extends ts_common_1.Module {
|
|
97
|
+
constructor() {
|
|
98
|
+
super();
|
|
99
|
+
this.DefaultBuilder = new ToastBuilder();
|
|
100
|
+
this.adjustStringMessage = (_message) => {
|
|
101
|
+
let message = _message;
|
|
123
102
|
message = message.replace(/\n#### (.*?)\n/g, "\n<h4>$1</h4>\n");
|
|
124
103
|
message = message.replace(/\n### (.*?)\n/g, "\n<h3>$1</h3>\n");
|
|
125
104
|
message = message.replace(/\n## (.*?)\n/g, "\n<h2>$1</h2>\n");
|
|
126
105
|
message = message.replace(/\n# (.*?)\n/g, "\n<h1>$1</h1>\n");
|
|
127
106
|
message = message.replace(/(<\/?.*?>)\n/g, "$1");
|
|
128
107
|
message = message.replace(/([^>]?)\n/g, "$1<br/> ");
|
|
129
|
-
|
|
108
|
+
const ignore = message.match(/`(.*?)`/g);
|
|
130
109
|
if (ignore && ignore.length > 0)
|
|
131
|
-
message = ignore.reduce(
|
|
132
|
-
|
|
110
|
+
message = ignore.reduce((input, toEscape) => {
|
|
111
|
+
const replaceValue = toEscape.substring(1, toEscape.length - 1)
|
|
133
112
|
.replace(/([^\\]?)_/g, "$1\\_")
|
|
134
113
|
.replace(/([^\\]?)\*/g, "$1\\*");
|
|
135
114
|
return input.replace(toEscape, replaceValue);
|
|
@@ -140,29 +119,24 @@ var ToastModule_Class = /** @class */ (function (_super) {
|
|
|
140
119
|
message = message.replace(/\\\*/g, "*");
|
|
141
120
|
return message;
|
|
142
121
|
};
|
|
143
|
-
|
|
122
|
+
this.hideToast = (toast) => {
|
|
144
123
|
// in the future we can add more than one toast and manage a stack of them!!
|
|
145
124
|
dispatch_showToast.dispatchUI([]);
|
|
146
125
|
};
|
|
147
|
-
return _this;
|
|
148
126
|
}
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (interval === void 0) { interval = Interval_DefaultToast; }
|
|
127
|
+
init() {
|
|
128
|
+
}
|
|
129
|
+
toastError(errorMessage, interval = Interval_DefaultToast) {
|
|
153
130
|
this.toast(errorMessage, ToastType.error, interval);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (interval === void 0) { interval = Interval_DefaultToast; }
|
|
131
|
+
}
|
|
132
|
+
toastSuccess(successMessage, interval = Interval_DefaultToast) {
|
|
157
133
|
this.toast(successMessage, ToastType.success, interval);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (interval === void 0) { interval = Interval_DefaultToast; }
|
|
134
|
+
}
|
|
135
|
+
toastInfo(infoMessage, interval = Interval_DefaultToast) {
|
|
161
136
|
this.toast(infoMessage, ToastType.info, interval);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var color;
|
|
137
|
+
}
|
|
138
|
+
toast(_message, type, interval = Interval_DefaultToast) {
|
|
139
|
+
let color;
|
|
166
140
|
switch (type) {
|
|
167
141
|
case ToastType.success:
|
|
168
142
|
color = "#2ee06f";
|
|
@@ -177,17 +151,16 @@ var ToastModule_Class = /** @class */ (function (_super) {
|
|
|
177
151
|
color = "#e8e8e8";
|
|
178
152
|
break;
|
|
179
153
|
}
|
|
180
|
-
|
|
154
|
+
let content = _message;
|
|
181
155
|
if (typeof _message === "string")
|
|
182
156
|
content = exports.ToastModule.adjustStringMessage(_message);
|
|
183
157
|
// console.log("_message:", _message)
|
|
184
158
|
this.DefaultBuilder.setContent(content).setDuration(interval).setBackground(color).setType(type).show();
|
|
185
|
-
}
|
|
186
|
-
|
|
159
|
+
}
|
|
160
|
+
toastImpl(toast) {
|
|
187
161
|
dispatch_showToast.dispatchUI([toast]);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
}(ts_common_1.Module));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
191
164
|
exports.ToastModule_Class = ToastModule_Class;
|
|
192
165
|
exports.ToastModule = new ToastModule_Class();
|
|
193
166
|
//# sourceMappingURL=ToasterModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToasterModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/toaster/ToasterModule.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"ToasterModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/toaster/ToasterModule.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,4DAIsC;AACtC,2CAA2C;AAC3C,sEAAgE;AAChE,mDAAiE;AAGjE,IAAY,SAIX;AAJD,WAAY,SAAS;IACpB,+CAAS,CAAA;IACT,2CAAO,CAAA;IACP,yCAAM,CAAA;AACP,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAoBD,MAAM,qBAAqB,GAAG,CAAC,GAAG,kBAAM,CAAC;AAEzC,MAAa,YACZ,SAAQ,0BAAe;IADxB;;QAGS,YAAO,GAAU,SAAS,CAAC;QAC3B,aAAQ,GAAW,qBAAqB,CAAC;QACzC,SAAI,GAAc,SAAS,CAAC,IAAI,CAAC;QACjC,qBAAgB,GAAqB,KAAK,CAAC;QAC3C,uBAAkB,GAAuB,QAAQ,CAAC;QAClD,YAAO,GAAyB,EAAE,CAAC;QACnC,YAAO,GAAoB,YAAY,CAAC;IA0DjD,CAAC;IAxDA,OAAO,CAAC,IAAe;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,UAAU,CAAC,OAAwB;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,aAA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,QAAQ,CAAC;QACvB,IAAI,OAAO,QAAQ,KAAK,QAAQ;YAC/B,OAAO,GAAG,mBAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAErD,qCAAqC;QACrC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACzG,CAAC;IA+BO,SAAS,CAAC,KAAkB;QACnC,kBAAkB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;IACvC,CAAC;CACD;AApFD,8CAoFC;AAEY,QAAA,WAAW,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -19,36 +19,12 @@
|
|
|
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.Tooltip = exports.TooltipDefaultStyle = void 0;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
const React = require("react");
|
|
25
|
+
const TooltipModule_1 = require("./TooltipModule");
|
|
26
|
+
const BaseComponent_1 = require("../../core/BaseComponent");
|
|
27
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
52
28
|
exports.TooltipDefaultStyle = {
|
|
53
29
|
backgroundColor: "#f9f9f9",
|
|
54
30
|
borderRadius: "3px",
|
|
@@ -58,38 +34,35 @@ exports.TooltipDefaultStyle = {
|
|
|
58
34
|
padding: "1px 3px",
|
|
59
35
|
position: "fixed",
|
|
60
36
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_this.setState(function () { return ({ model: model }); });
|
|
37
|
+
class Tooltip extends BaseComponent_1.BaseComponent {
|
|
38
|
+
constructor(props) {
|
|
39
|
+
super(props);
|
|
40
|
+
this.ref = React.createRef();
|
|
41
|
+
this.__showTooltip = (model) => {
|
|
42
|
+
this.setState(() => ({ model }));
|
|
68
43
|
if (!model)
|
|
69
44
|
return;
|
|
70
|
-
|
|
45
|
+
const duration = model.duration;
|
|
71
46
|
if (duration <= 0)
|
|
72
47
|
return;
|
|
73
|
-
if (
|
|
74
|
-
clearTimeout(
|
|
75
|
-
|
|
48
|
+
if (this.timeoutInterval)
|
|
49
|
+
clearTimeout(this.timeoutInterval);
|
|
50
|
+
this.timeoutInterval = ts_common_1._setTimeout(TooltipModule_1.TooltipModule.hide, duration, model);
|
|
76
51
|
};
|
|
77
|
-
|
|
78
|
-
return _this;
|
|
52
|
+
this.state = {};
|
|
79
53
|
}
|
|
80
|
-
|
|
81
|
-
|
|
54
|
+
render() {
|
|
55
|
+
const { model } = this.state;
|
|
82
56
|
if (!model || !model.content)
|
|
83
57
|
return null;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
top: top
|
|
88
|
-
left: left
|
|
58
|
+
const top = model.location && model.location.y;
|
|
59
|
+
const left = model.location && model.location.x;
|
|
60
|
+
const positionStyle = {
|
|
61
|
+
top: `${top}px`,
|
|
62
|
+
left: `${left}px`
|
|
89
63
|
};
|
|
90
|
-
return React.createElement("div", { ref: this.ref, id: "tooltip", style:
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
}(BaseComponent_1.BaseComponent));
|
|
64
|
+
return React.createElement("div", { ref: this.ref, id: "tooltip", style: Object.assign(Object.assign({}, (model.style || exports.TooltipDefaultStyle)), positionStyle) }, typeof model.content === "string" ? React.createElement("div", { dangerouslySetInnerHTML: { __html: model.content } }) : model.content);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
94
67
|
exports.Tooltip = Tooltip;
|
|
95
68
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,+BAA+B;AAE/B,mDAIyB;AACzB,4DAAuD;AACvD,4DAAyD;AAI5C,QAAA,mBAAmB,GAAkB;IACjD,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE,qBAAqB;IAChC,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,OAAO;CACj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AAC,GAAK,aAAa,KACzG,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,6BAAK,uBAAuB,EAAE,EAAC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CACxG,CAAA;IACP,CAAC;CACD;AA7CD,0BA6CC"}
|
|
@@ -19,75 +19,56 @@
|
|
|
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.TooltipBuilder = exports.TooltipModule = exports.TooltipModule_Class = void 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_this.show = function (tooltip, e) {
|
|
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_showTooltip = new thunder_dispatcher_1.ThunderDispatcher("__showTooltip");
|
|
28
|
+
const Interval_DefaultTooltip = 6 * ts_common_1.Second;
|
|
29
|
+
class TooltipModule_Class extends ts_common_1.Module {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.show = (tooltip, e) => {
|
|
47
33
|
if (!tooltip.location && e)
|
|
48
34
|
tooltip.location = { x: e.pageX + 10, y: e.pageY + 15 };
|
|
49
35
|
dispatch_showTooltip.dispatchUI([tooltip]);
|
|
50
36
|
};
|
|
51
|
-
|
|
52
|
-
return _this;
|
|
37
|
+
this.hide = () => dispatch_showTooltip.dispatchUI([]);
|
|
53
38
|
}
|
|
54
|
-
|
|
55
|
-
}(ts_common_1.Module));
|
|
39
|
+
}
|
|
56
40
|
exports.TooltipModule_Class = TooltipModule_Class;
|
|
57
41
|
exports.TooltipModule = new TooltipModule_Class();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return _this;
|
|
42
|
+
class TooltipBuilder extends Stylable_1.StylableBuilder {
|
|
43
|
+
constructor(content, e) {
|
|
44
|
+
super();
|
|
45
|
+
this.location = { x: 0, y: 0 };
|
|
46
|
+
this.duration = Interval_DefaultTooltip;
|
|
47
|
+
this.setLocation = (x, y) => {
|
|
48
|
+
this.location = { x, y };
|
|
49
|
+
return this;
|
|
67
50
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return
|
|
51
|
+
this.setDuration = (duration) => {
|
|
52
|
+
this.duration = duration;
|
|
53
|
+
return this;
|
|
71
54
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
content:
|
|
75
|
-
location:
|
|
76
|
-
style:
|
|
77
|
-
className:
|
|
78
|
-
duration:
|
|
55
|
+
this.show = () => {
|
|
56
|
+
const model = {
|
|
57
|
+
content: this.content,
|
|
58
|
+
location: this.location,
|
|
59
|
+
style: this.style,
|
|
60
|
+
className: this.className,
|
|
61
|
+
duration: this.duration,
|
|
79
62
|
};
|
|
80
63
|
exports.TooltipModule.show(model);
|
|
81
64
|
};
|
|
82
|
-
|
|
65
|
+
this.content = content;
|
|
83
66
|
if (e)
|
|
84
|
-
|
|
67
|
+
this.location = {
|
|
85
68
|
x: e.pageX + 10,
|
|
86
69
|
y: e.pageY + 15
|
|
87
70
|
};
|
|
88
|
-
return _this;
|
|
89
71
|
}
|
|
90
|
-
|
|
91
|
-
}(Stylable_1.StylableBuilder));
|
|
72
|
+
}
|
|
92
73
|
exports.TooltipBuilder = TooltipBuilder;
|
|
93
74
|
//# sourceMappingURL=TooltipModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/tooltip/TooltipModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"TooltipModule.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/tooltip/TooltipModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,4DAGsC;AACtC,sEAAgE;AAChE,mDAG8B;AAe9B,MAAM,oBAAoB,GAAG,IAAI,sCAAiB,CAAmC,eAAe,CAAC,CAAC;AACtG,MAAM,uBAAuB,GAAG,CAAC,GAAG,kBAAM,CAAC;AAE3C,MAAa,mBACZ,SAAQ,kBAAU;IADnB;;QAIC,SAAI,GAAG,CAAC,OAAsB,EAAE,CAAc,EAAE,EAAE;YACjD,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC;gBACzB,OAAO,CAAC,QAAQ,GAAG,EAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE,EAAC,CAAC;YAEvD,oBAAoB,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;QAC3C,CAAC,CAAC;QAEF,SAAI,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAA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
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
-
var __extends = (this && this.__extends) || (function () {
|
|
20
|
-
var extendStatics = function (d, b) {
|
|
21
|
-
extendStatics = Object.setPrototypeOf ||
|
|
22
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
23
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
24
|
-
return extendStatics(d, b);
|
|
25
|
-
};
|
|
26
|
-
return function (d, b) {
|
|
27
|
-
extendStatics(d, b);
|
|
28
|
-
function __() { this.constructor = d; }
|
|
29
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
30
|
-
};
|
|
31
|
-
})();
|
|
32
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
20
|
exports.KeyboardListener = void 0;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_this.props.onFocus && _this.props.onFocus();
|
|
21
|
+
const React = require("react");
|
|
22
|
+
class KeyboardListener extends React.Component {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.keyboardEventHandler = (e) => this.node && this.props.onKeyboardEventListener && this.props.onKeyboardEventListener(this.node, e);
|
|
26
|
+
this.onFocus = () => {
|
|
27
|
+
this.addKeyboardListener();
|
|
28
|
+
this.props.onFocus && this.props.onFocus();
|
|
43
29
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
this.onBlur = () => {
|
|
31
|
+
this.removeKeyboardListener();
|
|
32
|
+
this.props.onBlur && this.props.onBlur();
|
|
47
33
|
};
|
|
48
|
-
return _this;
|
|
49
34
|
}
|
|
50
|
-
|
|
35
|
+
addKeyboardListener() {
|
|
51
36
|
var _a;
|
|
52
|
-
|
|
37
|
+
const onKeyboardEventListener = this.props.onKeyboardEventListener;
|
|
53
38
|
if (!onKeyboardEventListener)
|
|
54
39
|
return;
|
|
55
40
|
(_a = this.node) === null || _a === void 0 ? void 0 : _a.addEventListener("keydown", this.keyboardEventHandler);
|
|
56
|
-
}
|
|
57
|
-
|
|
41
|
+
}
|
|
42
|
+
removeKeyboardListener() {
|
|
58
43
|
var _a;
|
|
59
|
-
|
|
44
|
+
const onKeyboardEventListener = this.props.onKeyboardEventListener;
|
|
60
45
|
if (!onKeyboardEventListener)
|
|
61
46
|
return;
|
|
62
47
|
(_a = this.node) === null || _a === void 0 ? void 0 : _a.removeEventListener("keydown", this.keyboardEventHandler);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (_this.node)
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return React.createElement("div", { id: this.props.id ? `${this.props.id}-listener` : '', ref: (node) => {
|
|
51
|
+
if (this.node)
|
|
68
52
|
return;
|
|
69
|
-
|
|
70
|
-
|
|
53
|
+
this.node = node;
|
|
54
|
+
this.forceUpdate();
|
|
71
55
|
}, tabIndex: 1, onFocus: this.onFocus, onBlur: this.onBlur }, this.props.children);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
}(React.Component));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
75
58
|
exports.KeyboardListener = KeyboardListener;
|
|
76
59
|
//# sourceMappingURL=KeyboardListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardListener.js","sourceRoot":"","sources":["../../../src/main/app-frontend/tools/KeyboardListener.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG
|
|
1
|
+
{"version":3,"file":"KeyboardListener.js","sourceRoot":"","sources":["../../../src/main/app-frontend/tools/KeyboardListener.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,+BAA+B;AAU/B,MAAa,gBACZ,SAAQ,KAAK,CAAC,SAAY;IAD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