@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
|
@@ -19,47 +19,23 @@
|
|
|
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.DropDown = exports.listStyle = exports.inputStyle = exports.headerStyle = void 0;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
24
|
+
const React = require("react");
|
|
25
|
+
const FilterInput_1 = require("./FilterInput");
|
|
26
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
27
|
+
const KeyboardListener_1 = require("../tools/KeyboardListener");
|
|
28
|
+
const tools_1 = require("../utils/tools");
|
|
29
|
+
const Adapter_1 = require("./adapter/Adapter");
|
|
30
|
+
const Tree_1 = require("./tree/Tree");
|
|
31
|
+
const Overlay_1 = require("./Overlay");
|
|
32
|
+
const defaultWidth = "222px";
|
|
33
|
+
const defaultTitleHeight = "28px";
|
|
34
|
+
const defaultListHeight = "150px";
|
|
59
35
|
// export enum OnEnterOptions {
|
|
60
36
|
// SelectFirstOption= (e:)
|
|
61
37
|
// }
|
|
62
|
-
|
|
38
|
+
const wrapperStyle = {
|
|
63
39
|
display: "inline-block",
|
|
64
40
|
position: 'relative'
|
|
65
41
|
};
|
|
@@ -82,7 +58,7 @@ exports.inputStyle = {
|
|
|
82
58
|
// padding: "0 5px",
|
|
83
59
|
width: "100%",
|
|
84
60
|
};
|
|
85
|
-
|
|
61
|
+
const listContainerStyle = {
|
|
86
62
|
display: "inline-block",
|
|
87
63
|
position: "absolute",
|
|
88
64
|
zIndex: 10,
|
|
@@ -102,86 +78,85 @@ exports.listStyle = {
|
|
|
102
78
|
top: 5,
|
|
103
79
|
width: defaultWidth,
|
|
104
80
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (_this.props.disabled)
|
|
81
|
+
class DropDown extends React.Component {
|
|
82
|
+
constructor(props) {
|
|
83
|
+
super(props);
|
|
84
|
+
this.toggleList = (e) => {
|
|
85
|
+
if (this.props.disabled)
|
|
111
86
|
return;
|
|
112
87
|
tools_1.stopPropagation(e);
|
|
113
|
-
|
|
88
|
+
this.setState(prevState => ({ open: !prevState.open }));
|
|
114
89
|
};
|
|
115
|
-
|
|
116
|
-
|
|
90
|
+
this.onSelected = (item) => {
|
|
91
|
+
this.setState({
|
|
117
92
|
open: false,
|
|
118
93
|
selected: item
|
|
119
94
|
});
|
|
120
|
-
|
|
95
|
+
this.props.onSelected(item);
|
|
121
96
|
};
|
|
122
|
-
|
|
123
|
-
return (React.createElement("div",
|
|
124
|
-
|
|
125
|
-
|
|
97
|
+
this.renderHeader = () => {
|
|
98
|
+
return (React.createElement("div", Object.assign({ id: `${this.props.id}-header`, onClick: this.toggleList }, this.props.headerStylable),
|
|
99
|
+
this.renderSelectedOrFilterInput(),
|
|
100
|
+
this.renderCaret()));
|
|
126
101
|
};
|
|
127
|
-
|
|
128
|
-
if (!
|
|
102
|
+
this.renderTree = () => {
|
|
103
|
+
if (!this.state.open)
|
|
129
104
|
return;
|
|
130
|
-
if (
|
|
105
|
+
if (this.props.autocomplete && !this.state.filterTextLength)
|
|
131
106
|
return;
|
|
132
|
-
|
|
107
|
+
this.props.adapter.data = this.state.filteredOptions;
|
|
133
108
|
return React.createElement("div", { style: listContainerStyle },
|
|
134
|
-
React.createElement("div",
|
|
109
|
+
React.createElement("div", Object.assign({}, this.props.listStylable), this.renderTreeImpl()));
|
|
135
110
|
};
|
|
136
|
-
|
|
111
|
+
this.keyEventHandler = (node, e) => {
|
|
137
112
|
var _a;
|
|
138
|
-
if (
|
|
139
|
-
return
|
|
140
|
-
|
|
113
|
+
if (this.props.inputEventHandler)
|
|
114
|
+
return this.setState(() => {
|
|
115
|
+
const state = this.props.inputEventHandler ? this.props.inputEventHandler(this.state, e) : this.state;
|
|
141
116
|
return state;
|
|
142
117
|
});
|
|
143
|
-
if (e.code === "Enter" &&
|
|
144
|
-
return
|
|
118
|
+
if (e.code === "Enter" && this.state.filteredOptions)
|
|
119
|
+
return this.onSelected(this.state.filteredOptions[0]);
|
|
145
120
|
if (e.code === "Escape")
|
|
146
|
-
return
|
|
121
|
+
return this.setState({ open: false });
|
|
147
122
|
if (e.code === "ArrowDown") {
|
|
148
|
-
return (_a = document.getElementById(
|
|
123
|
+
return (_a = document.getElementById(`${this.props.id}-tree-listener`)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
149
124
|
}
|
|
150
125
|
};
|
|
151
|
-
|
|
152
|
-
if (!
|
|
153
|
-
return (React.createElement("div", { className: 'match_width' },
|
|
126
|
+
this.renderSelectedOrFilterInput = () => {
|
|
127
|
+
if (!this.state.open || !this.props.filter) {
|
|
128
|
+
return (React.createElement("div", { className: 'match_width' }, this.renderSelectedItem(this.state.selected)));
|
|
154
129
|
}
|
|
155
|
-
return React.createElement(FilterInput_1.FilterInput,
|
|
156
|
-
|
|
157
|
-
state.adapter.data =
|
|
158
|
-
console.log(
|
|
159
|
-
console.log(
|
|
130
|
+
return React.createElement(FilterInput_1.FilterInput, Object.assign({ key: this.state.id, id: `${this.props.id}-input`, filter: this.props.filter, list: this.props.adapter.data, onChange: (filteredOptions, filterBy) => {
|
|
131
|
+
this.setState(state => {
|
|
132
|
+
state.adapter.data = this.props.autocomplete && this.props.filter && !filterBy.length ? [] : filteredOptions;
|
|
133
|
+
console.log(`filter: ${this.props.id} (${filterBy}) -> ${ts_common_1.__stringify(filteredOptions)}`);
|
|
134
|
+
console.log(`state.adapter.data: ${ts_common_1.__stringify(state.adapter.data)}`);
|
|
160
135
|
return {
|
|
161
136
|
adapter: state.adapter,
|
|
162
137
|
filterTextLength: filterBy.length
|
|
163
138
|
};
|
|
164
|
-
},
|
|
165
|
-
}, handleKeyEvent:
|
|
139
|
+
}, () => this.props.onFilter && this.props.onFilter(this.state.filteredOptions));
|
|
140
|
+
}, handleKeyEvent: (e) => {
|
|
166
141
|
return;
|
|
167
|
-
}, focus: true },
|
|
142
|
+
}, focus: true }, this.props.inputStylable));
|
|
168
143
|
};
|
|
169
|
-
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
144
|
+
this.renderSelectedItem = (selected) => {
|
|
145
|
+
if (this.props.selectedItemRenderer)
|
|
146
|
+
return this.props.selectedItemRenderer(selected);
|
|
172
147
|
if (selected === undefined)
|
|
173
|
-
return React.createElement("div", null,
|
|
174
|
-
|
|
175
|
-
|
|
148
|
+
return React.createElement("div", null, this.props.inputStylable.placeholder);
|
|
149
|
+
const Renderer = this.props.adapter.treeNodeRenderer;
|
|
150
|
+
const node = {
|
|
176
151
|
propKey: 'string',
|
|
177
152
|
path: 'string',
|
|
178
153
|
item: 'any',
|
|
179
|
-
adapter:
|
|
180
|
-
expandToggler:
|
|
154
|
+
adapter: this.props.adapter,
|
|
155
|
+
expandToggler: (e, expxand) => {
|
|
181
156
|
},
|
|
182
|
-
onClick:
|
|
157
|
+
onClick: (e) => {
|
|
183
158
|
},
|
|
184
|
-
onFocus:
|
|
159
|
+
onFocus: (e) => {
|
|
185
160
|
},
|
|
186
161
|
expanded: true,
|
|
187
162
|
focused: false,
|
|
@@ -189,59 +164,56 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
189
164
|
};
|
|
190
165
|
return React.createElement(Renderer, { item: selected, node: node });
|
|
191
166
|
};
|
|
192
|
-
|
|
193
|
-
|
|
167
|
+
this.renderCaret = () => {
|
|
168
|
+
const caret = this.props.caret;
|
|
194
169
|
if (!caret)
|
|
195
170
|
return;
|
|
196
|
-
return
|
|
171
|
+
return this.state.open ? caret.close : caret.open;
|
|
197
172
|
};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
if ((!
|
|
173
|
+
this.renderTreeImpl = () => {
|
|
174
|
+
const treeKeyEventHandler = treeKeyEventHandlerResolver(this.props.id);
|
|
175
|
+
const id = `${this.props.id}-tree`;
|
|
176
|
+
if ((!this.props.filter || !this.props.autocomplete || this.state.filterTextLength) && this.state.adapter.data.length === 0)
|
|
202
177
|
return React.createElement("div", { style: { textAlign: "center", opacity: 0.5 } }, "No options");
|
|
203
|
-
return React.createElement(Tree_1.Tree, { id: id, key: id, adapter:
|
|
178
|
+
return React.createElement(Tree_1.Tree, { id: id, key: id, adapter: this.state.adapter, indentPx: 0, selectedItem: this.state.selected, onNodeClicked: (path, item) => this.onSelected(item), unMountFromOutside: () => this.setState({ open: false }), keyEventHandler: treeKeyEventHandler });
|
|
204
179
|
};
|
|
205
|
-
|
|
180
|
+
this.state = {
|
|
206
181
|
id: props.id,
|
|
207
|
-
filteredOptions:
|
|
208
|
-
adapter: DropDown.cloneAdapter(
|
|
182
|
+
filteredOptions: this.props.adapter.data,
|
|
183
|
+
adapter: DropDown.cloneAdapter(this.props),
|
|
209
184
|
open: false,
|
|
210
|
-
selected:
|
|
185
|
+
selected: this.props.selected,
|
|
211
186
|
};
|
|
212
|
-
return _this;
|
|
213
187
|
}
|
|
214
|
-
|
|
188
|
+
componentDidUpdate(prevProps) {
|
|
215
189
|
if (this.props.adapter.data !== prevProps.adapter.data || this.props.selected !== prevProps.selected) {
|
|
216
|
-
|
|
190
|
+
const newAdapter = DropDown.cloneAdapter(this.props);
|
|
217
191
|
this.setState({ id: this.props.id, adapter: newAdapter, filteredOptions: newAdapter.data, selected: this.props.selected });
|
|
218
192
|
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return (React.createElement(Overlay_1.Overlay, { showOverlay: this.state.open, onClickOverlay: function () { return _this.setState({ open: false }); } },
|
|
193
|
+
}
|
|
194
|
+
render() {
|
|
195
|
+
return (React.createElement(Overlay_1.Overlay, { showOverlay: this.state.open, onClickOverlay: () => this.setState({ open: false }) },
|
|
223
196
|
React.createElement(KeyboardListener_1.KeyboardListener, { onKeyboardEventListener: this.keyEventHandler },
|
|
224
197
|
React.createElement("div", { id: this.props.id, style: wrapperStyle },
|
|
225
198
|
this.renderHeader(),
|
|
226
199
|
this.renderTree()))));
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
id: ts_common_1.generateHex(8),
|
|
230
|
-
headerStylable: { style: exports.headerStyle },
|
|
231
|
-
listStylable: { style: exports.listStyle },
|
|
232
|
-
inputStylable: { style: exports.inputStyle }
|
|
233
|
-
};
|
|
234
|
-
DropDown.cloneAdapter = function (nextProps) {
|
|
235
|
-
return nextProps.adapter.clone(new Adapter_1.Adapter(nextProps.autocomplete && nextProps.filter ? [] : nextProps.adapter.data));
|
|
236
|
-
};
|
|
237
|
-
return DropDown;
|
|
238
|
-
}(React.Component));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
239
202
|
exports.DropDown = DropDown;
|
|
240
|
-
|
|
241
|
-
|
|
203
|
+
DropDown.defaultProps = {
|
|
204
|
+
id: ts_common_1.generateHex(8),
|
|
205
|
+
headerStylable: { style: exports.headerStyle },
|
|
206
|
+
listStylable: { style: exports.listStyle },
|
|
207
|
+
inputStylable: { style: exports.inputStyle }
|
|
208
|
+
};
|
|
209
|
+
DropDown.cloneAdapter = (nextProps) => {
|
|
210
|
+
return nextProps.adapter.clone(new Adapter_1.Adapter(nextProps.autocomplete && nextProps.filter ? [] : nextProps.adapter.data));
|
|
211
|
+
};
|
|
212
|
+
const treeKeyEventHandlerResolver = (id) => {
|
|
213
|
+
return (node, e) => {
|
|
242
214
|
var _a;
|
|
243
215
|
if (!["Escape", "ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp", "Enter"].includes(e.code))
|
|
244
|
-
(_a = document.getElementById(id
|
|
216
|
+
(_a = document.getElementById(`${id}-input`)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
245
217
|
};
|
|
246
218
|
};
|
|
247
219
|
//# sourceMappingURL=DropDown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDown.js","sourceRoot":"","sources":["../../../src/main/app-frontend/components/DropDown.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"DropDown.js","sourceRoot":"","sources":["../../../src/main/app-frontend/components/DropDown.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,+BAA+B;AAC/B,+CAA0C;AAC1C,4DAGsC;AACtC,gEAA2D;AAC3D,0CAA+C;AAC/C,+CAA2C;AAC3C,sCAAiC;AAEjC,uCAAkC;AAElC,MAAM,YAAY,GAAG,OAAO,CAAC;AAC7B,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC,+BAA+B;AAC/B,8BAA8B;AAC9B,IAAI;AAEJ,MAAM,YAAY,GAAwB;IACzC,OAAO,EAAE,cAAc;IACvB,QAAQ,EAAE,UAAU;CACpB,CAAC;AAEW,QAAA,WAAW,GAAwB;IAC/C,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,WAAW;IACnB,YAAY,EAAE,CAAC;IACf,KAAK,EAAE,OAAO;IACd,eAAe,EAAE,OAAO;IACxB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,kBAAkB;CAC1B,CAAC;AAEW,QAAA,UAAU,GAAwB;IAC9C,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,MAAM;IACf,oBAAoB;IAC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;oBACzC,IAAI,CAAC,YAAY,EAAE;oBACnB,IAAI,CAAC,UAAU,EAAE,CACb,CACY,CACV,CACV,CAAC;IACH,CAAC;;AA/DF,4BAoMC;AAjMO,qBAAY,GAAyB;IAC3C,EAAE,EAAE,uBAAW,CAAC,CAAC,CAAC;IAClB,cAAc,EAAE,EAAC,KAAK,EAAE,mBAAW,EAAC;IACpC,YAAY,EAAE,EAAC,KAAK,EAAE,iBAAS,EAAC;IAChC,aAAa,EAAE,EAAC,KAAK,EAAE,kBAAU,EAAC;CAClC,CAAC;AAsBa,qBAAY,GAAG,CAAC,SAA8B,EAAE,EAAE;IAChE,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,iBAAO,CAAC,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACvH,CAAC,CAAC;AAsKH,MAAM,2BAA2B,GAAG,CAAC,EAAU,EAAE,EAAE;IAClD,OAAO,CAAC,IAAoB,EAAE,CAAgB,EAAE,EAAE;;QACjD,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3F,MAAA,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,0CAAE,KAAK,GAAG;IAClD,CAAC,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -19,62 +19,45 @@
|
|
|
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.FilterInput = void 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_this.notifyChanges = false;
|
|
24
|
+
const React = require("react");
|
|
25
|
+
const filter_tools_1 = require("@intuitionrobotics/ts-common/utils/filter-tools");
|
|
26
|
+
const TS_Input_1 = require("./TS_Input");
|
|
27
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
28
|
+
class FilterInput extends React.Component {
|
|
29
|
+
constructor(props) {
|
|
30
|
+
super(props);
|
|
31
|
+
this.callOnChange = (list, filter) => {
|
|
32
|
+
if (this.notifyChanges)
|
|
33
|
+
this.props.onChange(this.filterInstance.filter(list, this.props.filter), filter, this.props.id);
|
|
34
|
+
this.notifyChanges = false;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
this.filter = (text) => {
|
|
37
|
+
this.filterInstance.setFilter(text);
|
|
38
|
+
this.notifyChanges = true;
|
|
39
|
+
this.callOnChange(this.props.list, text);
|
|
54
40
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return _this;
|
|
41
|
+
this.filterInstance = new filter_tools_1.Filter();
|
|
42
|
+
this.filterInstance.setFilter(props.initialFilterText || '');
|
|
43
|
+
this.notifyChanges = true;
|
|
59
44
|
}
|
|
60
|
-
|
|
45
|
+
componentDidMount() {
|
|
61
46
|
this.callOnChange(this.props.list, "");
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
}
|
|
48
|
+
shouldComponentUpdate(nextProps, nextState, nextContext) {
|
|
49
|
+
const b = this.notifyChanges = !ts_common_1.compare(this.props.list, nextProps.list);
|
|
65
50
|
if (b)
|
|
66
51
|
this.callOnChange(nextProps.list, "");
|
|
67
52
|
return b;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
FilterInput.defaultProps = {
|
|
75
|
-
id: ts_common_1.generateHex(16)
|
|
76
|
-
};
|
|
77
|
-
return FilterInput;
|
|
78
|
-
}(React.Component));
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
const { id, placeholder, focus } = this.props;
|
|
56
|
+
return (React.createElement(TS_Input_1.TS_Input, { type: 'text', id: id, value: this.props.initialFilterText, onChange: (text) => this.filter(text), focus: focus, placeholder: placeholder, className: this.props.className, style: this.props.style, handleKeyEvent: this.props.handleKeyEvent }));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
79
59
|
exports.FilterInput = FilterInput;
|
|
60
|
+
FilterInput.defaultProps = {
|
|
61
|
+
id: ts_common_1.generateHex(16)
|
|
62
|
+
};
|
|
80
63
|
//# sourceMappingURL=FilterInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterInput.js","sourceRoot":"","sources":["../../../src/main/app-frontend/components/FilterInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"FilterInput.js","sourceRoot":"","sources":["../../../src/main/app-frontend/components/FilterInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,+BAA+B;AAC/B,kFAAuE;AACvE,yCAAoC;AAEpC,4DAGsC;AAetC,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S,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAEvC,OAAO,CAAC,CAAC;IACV,CAAC;IAeD,MAAM;QAEL,MAAM,EAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5C,OAAO,CACN,oBAAC,mBAAQ,IACR,IAAI,EAAC,MAAM,EACX,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,EACnC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EACrC,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,GACxC,CACF,CAAC;IACH,CAAC;;AA1DF,kCA4DC;AAvDO,wBAAY,GAAoC;IACtD,EAAE,EAAE,uBAAW,CAAC,EAAE,CAAC;CACnB,CAAC"}
|
|
@@ -19,83 +19,54 @@
|
|
|
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.GenericSelect = void 0;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
_this.state = {
|
|
24
|
+
const React = require("react");
|
|
25
|
+
const react_select_1 = require("react-select");
|
|
26
|
+
class GenericSelect extends React.Component {
|
|
27
|
+
constructor(props) {
|
|
28
|
+
super(props);
|
|
29
|
+
this.state = {
|
|
55
30
|
menuIsOpen: false
|
|
56
31
|
};
|
|
57
|
-
|
|
58
|
-
return _this;
|
|
32
|
+
this.handleSelection = this.handleSelection.bind(this);
|
|
59
33
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var value = null;
|
|
34
|
+
render() {
|
|
35
|
+
const props = this.props;
|
|
36
|
+
const items = [];
|
|
37
|
+
const options = props.options;
|
|
38
|
+
let value = null;
|
|
66
39
|
if (options) {
|
|
67
|
-
|
|
68
|
-
options.forEach(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
if (optionPresentation === props.presentation(
|
|
40
|
+
const selectedOption = props.selectedOption;
|
|
41
|
+
options.forEach((option, idx) => {
|
|
42
|
+
const optionPresentation = props.presentation(option);
|
|
43
|
+
const item = { label: optionPresentation, value: "" + idx };
|
|
44
|
+
if (selectedOption) {
|
|
45
|
+
if (optionPresentation === props.presentation(selectedOption)) {
|
|
73
46
|
value = item;
|
|
74
47
|
}
|
|
75
48
|
}
|
|
76
49
|
items.push(item);
|
|
77
50
|
});
|
|
78
51
|
}
|
|
79
|
-
return React.createElement(react_select_1.default, { options: items, value: value, onChange:
|
|
80
|
-
IndicatorSeparator:
|
|
81
|
-
DropdownIndicator:
|
|
52
|
+
return React.createElement(react_select_1.default, { options: items, value: value, onChange: item => this.handleSelection(item), onMenuClose: () => this.setState({ menuIsOpen: false }), onMenuOpen: () => this.setState({ menuIsOpen: true }), styles: this.props.styles, placeholder: props.placeholder, components: props.components ? props.components : {
|
|
53
|
+
IndicatorSeparator: () => null,
|
|
54
|
+
DropdownIndicator: (_props) => (React.createElement(react_select_1.components.DropdownIndicator, Object.assign({}, _props), this.state.menuIsOpen ? props.iconClose : props.iconOpen))
|
|
82
55
|
}, isDisabled: props.isDisabled });
|
|
83
|
-
}
|
|
84
|
-
|
|
56
|
+
}
|
|
57
|
+
handleSelection(item) {
|
|
85
58
|
if (!this.props.options)
|
|
86
59
|
return;
|
|
87
|
-
|
|
88
|
-
|
|
60
|
+
const idx = Number(item.value);
|
|
61
|
+
const option = this.props.options[idx];
|
|
89
62
|
this.props.onChange(option);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}(React.Component));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
93
65
|
exports.GenericSelect = GenericSelect;
|
|
94
|
-
|
|
95
|
-
|
|
66
|
+
class SelectItem {
|
|
67
|
+
constructor(s) {
|
|
96
68
|
this.value = s;
|
|
97
69
|
this.label = s;
|
|
98
70
|
}
|
|
99
|
-
|
|
100
|
-
}());
|
|
71
|
+
}
|
|
101
72
|
//# sourceMappingURL=GenericSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericSelect.js","sourceRoot":"","sources":["../../../src/main/app-frontend/components/GenericSelect.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"GenericSelect.js","s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";
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.GenericTabs = void 0;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function GenericTabs() {
|
|
21
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
-
}
|
|
23
|
-
GenericTabs.prototype.render = function () {
|
|
4
|
+
const React = require("react");
|
|
5
|
+
class GenericTabs extends React.Component {
|
|
6
|
+
render() {
|
|
24
7
|
return "hi";
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}(React.Component));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
28
10
|
exports.GenericTabs = GenericTabs;
|
|
29
11
|
//# sourceMappingURL=GenericTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTabs.js","sourceRoot":"","sources":["../../../src/main/app-frontend/components/GenericTabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenericTabs.js","sourceRoot":"","sources":["../../../src/main/app-frontend/components/GenericTabs.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,MAAa,WACZ,SAAQ,KAAK,CAAC,SAAa;IAE3B,MAAM;QACL,OAAO,IAAI,CAAC;IACb,CAAC;CAED;AAPD,kCAOC"}
|