@agilemotion/oui-react-js 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationContext.js +244 -250
- package/dist/BasicApp.js +53 -97
- package/dist/BasicAppHome.js +86 -122
- package/dist/DynamicJS.js +65 -88
- package/dist/RestUtils.js +284 -315
- package/dist/TypedValue.js +15 -18
- package/dist/Utils.js +224 -262
- package/dist/assets/jss/components/authNavbarStyle.js +162 -164
- package/dist/assets/jss/components/buttonStyle.js +1 -1
- package/dist/assets/jss/components/cardAvatarStyle.js +1 -1
- package/dist/assets/jss/components/cardBodyStyle.js +1 -1
- package/dist/assets/jss/components/cardFooterStyle.js +1 -1
- package/dist/assets/jss/components/cardHeaderStyle.js +1 -1
- package/dist/assets/jss/components/cardIconStyle.js +1 -1
- package/dist/assets/jss/components/cardStyle.js +1 -1
- package/dist/assets/jss/components/cardTextStyle.js +1 -1
- package/dist/assets/jss/components/customDropdownStyle.js +192 -194
- package/dist/assets/jss/components/customInputStyle.js +1 -1
- package/dist/assets/jss/components/dropdownStyle.js +107 -109
- package/dist/assets/jss/components/footerStyle.js +1 -1
- package/dist/assets/jss/components/headerLinksStyle.js +95 -97
- package/dist/assets/jss/components/headerStyle.js +60 -62
- package/dist/assets/jss/components/navbarLinksStyle.js +137 -139
- package/dist/assets/jss/components/navbarStyle.js +71 -73
- package/dist/assets/jss/components/sidebarStyle.js +453 -455
- package/dist/assets/jss/components/typographyStyle.js +1 -1
- package/dist/assets/jss/rootStyle.js +57 -57
- package/dist/assets/jss/views/layoutStyle.js +42 -44
- package/dist/assets/jss/views/loginBasicStyle.js +1 -1
- package/dist/assets/jss/views/loginStyle.js +87 -89
- package/dist/components/AlertBar.js +21 -23
- package/dist/components/AlertItem.js +23 -25
- package/dist/components/AlertTemplate.js +29 -30
- package/dist/components/Button.js +35 -37
- package/dist/components/ConfirmationDialog.js +3 -3
- package/dist/components/DataGrid.js +250 -276
- package/dist/components/DataGridColumn.js +34 -36
- package/dist/components/DataGridFilter.js +92 -94
- package/dist/components/DataGridHeading.js +32 -38
- package/dist/components/DocumentViewer.js +12 -11
- package/dist/components/Graph.js +34 -50
- package/dist/components/GraphNode.js +53 -56
- package/dist/components/HtmlPanel.js +6 -8
- package/dist/components/Icon.js +28 -58
- package/dist/components/LoadingIndicator.js +2 -2
- package/dist/components/PopupView.js +15 -17
- package/dist/components/RegularButton.js +20 -20
- package/dist/components/TabPage.js +23 -25
- package/dist/components/TabPanel.js +34 -34
- package/dist/components/TableCellContent.js +34 -34
- package/dist/components/TitleBar.js +16 -16
- package/dist/components/Toolbar.js +112 -118
- package/dist/components/Tooltip.js +35 -43
- package/dist/components/Tree.js +54 -60
- package/dist/components/card/Card.js +17 -17
- package/dist/components/card/CardAvatar.js +10 -10
- package/dist/components/card/CardBody.js +14 -14
- package/dist/components/card/CardFooter.js +13 -13
- package/dist/components/card/CardHeader.js +14 -14
- package/dist/components/card/CardIcon.js +7 -7
- package/dist/components/card/CardText.js +7 -7
- package/dist/components/customInput/CustomInput.js +17 -17
- package/dist/components/dashboard/BasicApp.js +25 -25
- package/dist/components/dashboard/BasicBusinessApp.js +116 -119
- package/dist/components/dashboard/components/Header.js +11 -11
- package/dist/components/dashboard/components/LeftDrawer.js +3 -3
- package/dist/components/dashboard/components/UserIdentity.js +2 -2
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +85 -127
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +151 -191
- package/dist/components/footer/Footer.js +8 -8
- package/dist/components/footer/HomeFooter.js +34 -66
- package/dist/components/form/BaseField.js +78 -78
- package/dist/components/form/Checkbox.js +8 -10
- package/dist/components/form/DatePicker.js +15 -19
- package/dist/components/form/FieldSet.js +62 -88
- package/dist/components/form/Form.js +317 -318
- package/dist/components/form/GridField.js +81 -86
- package/dist/components/form/LabelField.js +10 -12
- package/dist/components/form/LookupField.js +40 -42
- package/dist/components/form/Section.js +37 -39
- package/dist/components/form/SelectItem.js +35 -39
- package/dist/components/form/TextField.js +18 -22
- package/dist/components/form/TimePicker.js +15 -19
- package/dist/components/form/TransferList.js +83 -91
- package/dist/components/form/UploadField.js +135 -145
- package/dist/components/grid/GridContainer.js +6 -6
- package/dist/components/grid/GridItem.js +6 -6
- package/dist/components/layout/CollapsiblePanel.js +18 -20
- package/dist/components/layout/Layout.js +70 -72
- package/dist/components/layout/View.js +134 -136
- package/dist/components/layout/ViewPort.js +56 -98
- package/dist/components/menu/CollapsibleMenu.js +26 -28
- package/dist/components/menu/MenuBars.js +53 -59
- package/dist/components/menu/MenuButton.js +70 -77
- package/dist/components/menu/MenuItem.js +15 -17
- package/dist/components/menu/MenuLink.js +9 -11
- package/dist/components/menu/PopupMenu.js +12 -16
- package/dist/components/navbars/AuthNavbar.js +12 -12
- package/dist/components/navbars/HomeNavbar.js +175 -222
- package/dist/components/navbars/NavbarLinks.js +45 -46
- package/dist/components/typography/Danger.js +3 -3
- package/dist/components/typography/Info.js +3 -3
- package/dist/components/typography/Link.js +3 -3
- package/dist/event/ActionHandlers.js +43 -57
- package/dist/event/Event.js +13 -16
- package/dist/event/EventListener.js +36 -39
- package/dist/event/EventType.js +1 -5
- package/dist/event/LoadDataActionHandler.js +8 -20
- package/dist/event/Observable.js +162 -198
- package/dist/event/RouteActionHandler.js +76 -88
- package/dist/event/ScriptActionHandler.js +8 -20
- package/dist/event/ServiceCallActionHandler.js +28 -40
- package/dist/event/SignalGraphActionHandler.js +7 -19
- package/dist/js/Addresses.js +15 -27
- package/dist/js/DynamicLib.js +11 -14
- package/dist/js/Validators.js +5 -6
- package/dist/redux/store/ConfigureStore.js +6 -6
- package/dist/redux/store/DashboardStore.js +83 -95
- package/dist/redux/store/History.js +1 -1
- package/dist/redux/store/SecurityStore.js +41 -45
- package/dist/security/TokenManager.js +30 -44
- package/dist/theme-default.js +1 -1
- package/dist/view/Dashboard.js +108 -114
- package/dist/view/Settings.js +2 -4
- package/dist/view/security/ChangePasswordBasic.js +96 -100
- package/dist/view/security/ForgotPassword.js +52 -56
- package/dist/view/security/ForgotPasswordBasic.js +48 -54
- package/dist/view/security/Login.js +58 -62
- package/dist/view/security/LoginBasic.js +50 -54
- package/dist/view/security/ResetPassword.js +58 -62
- package/dist/view/security/ResetPasswordBasic.js +89 -93
- package/dist/view/security/Security.js +12 -12
- package/package.json +1 -1
|
@@ -37,56 +37,52 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
37
37
|
|
|
38
38
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39
39
|
|
|
40
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
40
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
41
41
|
|
|
42
42
|
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
43
43
|
|
|
44
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
'&:first-child': {
|
|
64
|
-
borderRadius: theme.shape.borderRadius
|
|
65
|
-
}
|
|
46
|
+
const useStyles = (0, _styles.makeStyles)(theme => ({
|
|
47
|
+
spacer: {
|
|
48
|
+
borderLeft: '2px solid' + theme.palette.secondary.main,
|
|
49
|
+
height: '100%'
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
const StyledToggleButtonGroup = (0, _core.withStyles)(theme => ({
|
|
53
|
+
grouped: {
|
|
54
|
+
margin: theme.spacing(0.5),
|
|
55
|
+
border: 'none',
|
|
56
|
+
padding: theme.spacing(0, 1),
|
|
57
|
+
'&:not(:first-child)': {
|
|
58
|
+
borderRadius: theme.shape.borderRadius
|
|
59
|
+
},
|
|
60
|
+
'&:first-child': {
|
|
61
|
+
borderRadius: theme.shape.borderRadius
|
|
66
62
|
}
|
|
67
|
-
}
|
|
68
|
-
})(_ToggleButtonGroup.default);
|
|
63
|
+
}
|
|
64
|
+
}))(_ToggleButtonGroup.default);
|
|
69
65
|
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
const Toolbar = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
67
|
+
const classes = useStyles();
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const _React$useState = _react.default.useState([]),
|
|
70
|
+
_React$useState2 = _slicedToArray(_React$useState, 1),
|
|
71
|
+
itemHandles = _React$useState2[0];
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
const _React$useState3 = _react.default.useState('left'),
|
|
74
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
75
|
+
alignment = _React$useState4[0];
|
|
80
76
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
const _React$useState5 = _react.default.useState([]),
|
|
78
|
+
_React$useState6 = _slicedToArray(_React$useState5, 1),
|
|
79
|
+
loadedComponents = _React$useState6[0];
|
|
84
80
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
const mutex = new _asyncMutex.Mutex();
|
|
82
|
+
let itemKeyCounter = 0;
|
|
83
|
+
let sectionKeyCounter = 0;
|
|
88
84
|
|
|
89
|
-
_react.default.useEffect(
|
|
85
|
+
_react.default.useEffect(() => {
|
|
90
86
|
props.handle.api = api();
|
|
91
87
|
|
|
92
88
|
_Observable.default.addSubscriptions(props.config.eventHandlingConfig, props.handle, props.viewId);
|
|
@@ -95,7 +91,7 @@ var Toolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
95
91
|
});
|
|
96
92
|
|
|
97
93
|
function createItemHandle() {
|
|
98
|
-
|
|
94
|
+
let handle = {};
|
|
99
95
|
itemHandles.push(handle);
|
|
100
96
|
return handle;
|
|
101
97
|
}
|
|
@@ -131,100 +127,98 @@ var Toolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
131
127
|
var release, allLoaded, _iterator, _step, section, _iterator2, _step2, item;
|
|
132
128
|
|
|
133
129
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
134
|
-
while (1) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
130
|
+
while (1) switch (_context.prev = _context.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
_context.next = 2;
|
|
133
|
+
return mutex.acquire();
|
|
134
|
+
|
|
135
|
+
case 2:
|
|
136
|
+
release = _context.sent;
|
|
137
|
+
_context.prev = 3;
|
|
138
|
+
loadedComponents.push(id);
|
|
139
|
+
allLoaded = true;
|
|
140
|
+
|
|
141
|
+
if (!(_Utils.default.isNull(props.config.sections) || _Utils.default.isNull(props.config.sections.length === 0))) {
|
|
142
|
+
_context.next = 9;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
150
145
|
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
console.error("Toolbar without sections");
|
|
147
|
+
return _context.abrupt("return");
|
|
153
148
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
case 9:
|
|
150
|
+
_iterator = _createForOfIteratorHelper(props.config.sections);
|
|
151
|
+
_context.prev = 10;
|
|
157
152
|
|
|
158
|
-
|
|
153
|
+
_iterator.s();
|
|
159
154
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
155
|
+
case 12:
|
|
156
|
+
if ((_step = _iterator.n()).done) {
|
|
157
|
+
_context.next = 21;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
165
160
|
|
|
166
|
-
|
|
161
|
+
section = _step.value;
|
|
167
162
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
163
|
+
if (!(_Utils.default.isNull(section.items) || _Utils.default.isNull(section.items.length === 0))) {
|
|
164
|
+
_context.next = 17;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
172
167
|
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
console.error("Toolbar section without items");
|
|
169
|
+
return _context.abrupt("return");
|
|
175
170
|
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
case 17:
|
|
172
|
+
_iterator2 = _createForOfIteratorHelper(section.items);
|
|
178
173
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
try {
|
|
175
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
176
|
+
item = _step2.value;
|
|
182
177
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
178
|
+
if (!loadedComponents.includes(item.id) && item.type !== 'toolbarSpacer') {
|
|
179
|
+
allLoaded = false;
|
|
186
180
|
}
|
|
187
|
-
} catch (err) {
|
|
188
|
-
_iterator2.e(err);
|
|
189
|
-
} finally {
|
|
190
|
-
_iterator2.f();
|
|
191
181
|
}
|
|
182
|
+
} catch (err) {
|
|
183
|
+
_iterator2.e(err);
|
|
184
|
+
} finally {
|
|
185
|
+
_iterator2.f();
|
|
186
|
+
}
|
|
192
187
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
188
|
+
case 19:
|
|
189
|
+
_context.next = 12;
|
|
190
|
+
break;
|
|
196
191
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
192
|
+
case 21:
|
|
193
|
+
_context.next = 26;
|
|
194
|
+
break;
|
|
200
195
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
case 23:
|
|
197
|
+
_context.prev = 23;
|
|
198
|
+
_context.t0 = _context["catch"](10);
|
|
204
199
|
|
|
205
|
-
|
|
200
|
+
_iterator.e(_context.t0);
|
|
206
201
|
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
case 26:
|
|
203
|
+
_context.prev = 26;
|
|
209
204
|
|
|
210
|
-
|
|
205
|
+
_iterator.f();
|
|
211
206
|
|
|
212
|
-
|
|
207
|
+
return _context.finish(26);
|
|
213
208
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
209
|
+
case 29:
|
|
210
|
+
if (allLoaded === true) {
|
|
211
|
+
props.loadCompleteHandler(props.config.id);
|
|
212
|
+
}
|
|
218
213
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
214
|
+
case 30:
|
|
215
|
+
_context.prev = 30;
|
|
216
|
+
release();
|
|
217
|
+
return _context.finish(30);
|
|
223
218
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
219
|
+
case 33:
|
|
220
|
+
case "end":
|
|
221
|
+
return _context.stop();
|
|
228
222
|
}
|
|
229
223
|
}, _callee, null, [[3,, 30, 33], [10, 23, 26, 29]]);
|
|
230
224
|
}));
|
|
@@ -232,7 +226,7 @@ var Toolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
232
226
|
}
|
|
233
227
|
|
|
234
228
|
function renderSection(section, counter) {
|
|
235
|
-
|
|
229
|
+
let itemCounter = 0;
|
|
236
230
|
return /*#__PURE__*/_react.default.createElement(StyledToggleButtonGroup, {
|
|
237
231
|
size: "small",
|
|
238
232
|
value: alignment,
|
|
@@ -241,7 +235,7 @@ var Toolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
241
235
|
"aria-label": "text alignment"
|
|
242
236
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
243
237
|
className: "row"
|
|
244
|
-
}, section.items.map(
|
|
238
|
+
}, section.items.map(item => {
|
|
245
239
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
246
240
|
style: {
|
|
247
241
|
margin: '4px'
|
|
@@ -257,28 +251,28 @@ var Toolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
257
251
|
})));
|
|
258
252
|
}
|
|
259
253
|
|
|
260
|
-
|
|
254
|
+
const api = () => {
|
|
261
255
|
return {
|
|
262
256
|
get id() {
|
|
263
257
|
// Toolbar
|
|
264
258
|
return props.config.id;
|
|
265
259
|
},
|
|
266
260
|
|
|
267
|
-
getChildren:
|
|
261
|
+
getChildren: () => {
|
|
268
262
|
return itemHandles;
|
|
269
263
|
}
|
|
270
264
|
};
|
|
271
265
|
};
|
|
272
266
|
|
|
273
267
|
function render(toolbar) {
|
|
274
|
-
|
|
268
|
+
let counter = 0;
|
|
275
269
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
276
270
|
className: "row",
|
|
277
271
|
ref: ref,
|
|
278
272
|
style: {
|
|
279
273
|
padding: '0 0 8px 0'
|
|
280
274
|
}
|
|
281
|
-
}, toolbar.sections.map(
|
|
275
|
+
}, toolbar.sections.map(section => {
|
|
282
276
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
283
277
|
className: "col-*-*",
|
|
284
278
|
key: ++sectionKeyCounter
|
|
@@ -287,7 +281,7 @@ var Toolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
287
281
|
}
|
|
288
282
|
|
|
289
283
|
function getBorderBottom() {
|
|
290
|
-
|
|
284
|
+
let border = _Utils.default.getComponentAttribute(props.config, 'border', null);
|
|
291
285
|
|
|
292
286
|
if (border === 'none') {
|
|
293
287
|
return 'none';
|
|
@@ -17,39 +17,33 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
|
|
18
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
tooltip: {
|
|
46
|
-
backgroundColor: '#f44336'
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
});
|
|
20
|
+
const LightTooltip = (0, _styles.withStyles)(theme => ({
|
|
21
|
+
tooltip: {
|
|
22
|
+
backgroundColor: theme.palette.common.white,
|
|
23
|
+
color: 'rgba(0, 0, 0, 0.87)',
|
|
24
|
+
boxShadow: theme.shadows[1],
|
|
25
|
+
fontSize: 11
|
|
26
|
+
}
|
|
27
|
+
}))(_Tooltip.default);
|
|
28
|
+
const useStylesBootstrap = (0, _styles.makeStyles)(theme => ({
|
|
29
|
+
arrow: {
|
|
30
|
+
color: theme.palette.common.black
|
|
31
|
+
},
|
|
32
|
+
tooltip: {
|
|
33
|
+
backgroundColor: theme.palette.common.black
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
const useStylesError = (0, _styles.makeStyles)(theme => ({
|
|
37
|
+
arrow: {
|
|
38
|
+
color: '#f44336'
|
|
39
|
+
},
|
|
40
|
+
tooltip: {
|
|
41
|
+
backgroundColor: '#f44336'
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
50
44
|
|
|
51
45
|
function BootstrapTooltip(props) {
|
|
52
|
-
|
|
46
|
+
const classes = useStylesBootstrap();
|
|
53
47
|
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, _extends({
|
|
54
48
|
arrow: true,
|
|
55
49
|
classes: classes
|
|
@@ -57,24 +51,22 @@ function BootstrapTooltip(props) {
|
|
|
57
51
|
}
|
|
58
52
|
|
|
59
53
|
function ErrorTooltip(props) {
|
|
60
|
-
|
|
54
|
+
const classes = useStylesError();
|
|
61
55
|
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, _extends({
|
|
62
56
|
arrow: true,
|
|
63
57
|
classes: classes
|
|
64
58
|
}, props));
|
|
65
59
|
}
|
|
66
60
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
77
|
-
})(_Tooltip.default);
|
|
61
|
+
const HtmlTooltip = (0, _styles.withStyles)(theme => ({
|
|
62
|
+
tooltip: {
|
|
63
|
+
backgroundColor: '#f5f5f9',
|
|
64
|
+
color: 'rgba(0, 0, 0, 0.87)',
|
|
65
|
+
maxWidth: 220,
|
|
66
|
+
fontSize: theme.typography.pxToRem(12),
|
|
67
|
+
border: '1px solid #dadde9'
|
|
68
|
+
}
|
|
69
|
+
}))(_Tooltip.default);
|
|
78
70
|
|
|
79
71
|
function CustomTooltip(props) {
|
|
80
72
|
return /*#__PURE__*/_react.default.createElement("div", null, props.type === 'LIGHT' ? /*#__PURE__*/_react.default.createElement(LightTooltip, {
|
package/dist/components/Tree.js
CHANGED
|
@@ -45,7 +45,7 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
45
45
|
|
|
46
46
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
47
47
|
|
|
48
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
48
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
49
49
|
|
|
50
50
|
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
51
51
|
|
|
@@ -92,7 +92,7 @@ function CloseSquare(props) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
function TransitionComponent(props) {
|
|
95
|
-
|
|
95
|
+
const style = (0, _web.useSpring)({
|
|
96
96
|
from: {
|
|
97
97
|
opacity: 0,
|
|
98
98
|
transform: 'translate3d(20px,0,0)'
|
|
@@ -113,25 +113,21 @@ TransitionComponent.propTypes = {
|
|
|
113
113
|
*/
|
|
114
114
|
in: _propTypes.default.bool
|
|
115
115
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
opacity: 0.3
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
group: {
|
|
124
|
-
marginLeft: 7,
|
|
125
|
-
paddingLeft: 18,
|
|
126
|
-
borderLeft: "1px dashed ".concat((0, _styles.fade)(theme.palette.text.primary, 0.4))
|
|
116
|
+
const StyledTreeItem = (0, _styles.withStyles)(theme => ({
|
|
117
|
+
iconContainer: {
|
|
118
|
+
'& .close': {
|
|
119
|
+
opacity: 0.3
|
|
127
120
|
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
121
|
+
},
|
|
122
|
+
group: {
|
|
123
|
+
marginLeft: 7,
|
|
124
|
+
paddingLeft: 18,
|
|
125
|
+
borderLeft: "1px dashed ".concat((0, _styles.fade)(theme.palette.text.primary, 0.4))
|
|
126
|
+
}
|
|
127
|
+
}))(props => /*#__PURE__*/_react.default.createElement(_TreeItem.default, _extends({}, props, {
|
|
128
|
+
TransitionComponent: TransitionComponent
|
|
129
|
+
})));
|
|
130
|
+
const useStyles = (0, _styles.makeStyles)({
|
|
135
131
|
root: {
|
|
136
132
|
height: 264,
|
|
137
133
|
flexGrow: 1,
|
|
@@ -139,35 +135,35 @@ var useStyles = (0, _styles.makeStyles)({
|
|
|
139
135
|
}
|
|
140
136
|
});
|
|
141
137
|
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
const Tree = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
139
|
+
const classes = useStyles();
|
|
144
140
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
const _React$useState = _react.default.useState(null),
|
|
142
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
143
|
+
root = _React$useState2[0],
|
|
144
|
+
setRoot = _React$useState2[1];
|
|
149
145
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
const _React$useState3 = _react.default.useState([]),
|
|
147
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
148
|
+
selectedRows = _React$useState4[0];
|
|
153
149
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
const _React$useState5 = _react.default.useState([]),
|
|
151
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
152
|
+
expanded = _React$useState6[0],
|
|
153
|
+
setExpanded = _React$useState6[1];
|
|
158
154
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
const _React$useState7 = _react.default.useState(true),
|
|
156
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
157
|
+
initializing = _React$useState8[0],
|
|
158
|
+
setInitializing = _React$useState8[1];
|
|
163
159
|
|
|
164
|
-
_react.default.useEffect(
|
|
160
|
+
_react.default.useEffect(() => {
|
|
165
161
|
props.handle.api = api();
|
|
166
162
|
|
|
167
163
|
if (initializing) {
|
|
168
|
-
|
|
164
|
+
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
169
165
|
|
|
170
|
-
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig,
|
|
166
|
+
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, () => {
|
|
171
167
|
return ref;
|
|
172
168
|
}, props.viewId);
|
|
173
169
|
|
|
@@ -178,10 +174,10 @@ var Tree = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
178
174
|
});
|
|
179
175
|
|
|
180
176
|
function loadData(eventConfig, componentConfig) {
|
|
181
|
-
|
|
177
|
+
let service = !_Utils.default.isNull(componentConfig.dataService) ? componentConfig.dataService : eventConfig !== null ? eventConfig.dataService : null;
|
|
182
178
|
|
|
183
179
|
if (!_Utils.default.isNull(service)) {
|
|
184
|
-
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId,
|
|
180
|
+
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {
|
|
185
181
|
try {
|
|
186
182
|
expand(result.data);
|
|
187
183
|
setRoot(result.data);
|
|
@@ -191,25 +187,25 @@ var Tree = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
191
187
|
|
|
192
188
|
_Utils.default.publishSystemErrorMessage(props.viewId);
|
|
193
189
|
}
|
|
194
|
-
},
|
|
190
|
+
}, e => {
|
|
195
191
|
props.console.error(e);
|
|
196
192
|
|
|
197
193
|
_Utils.default.publishSystemErrorMessage(props.viewId);
|
|
198
|
-
},
|
|
194
|
+
}, parameter => {
|
|
199
195
|
props.loadCompleteHandler(props.config.id);
|
|
200
196
|
});
|
|
201
197
|
} else if (!_Utils.default.isNull(componentConfig.value)) {
|
|
202
|
-
|
|
198
|
+
let value = _ApplicationContext.default.isExpression(componentConfig.value) ? _ApplicationContext.default.resolveExpressionValue(componentConfig.value) : componentConfig.value;
|
|
203
199
|
}
|
|
204
200
|
}
|
|
205
201
|
|
|
206
|
-
_react.default.useEffect(
|
|
202
|
+
_react.default.useEffect(() => {
|
|
207
203
|
if (!initializing) {
|
|
208
204
|
loadData(null, props.config);
|
|
209
205
|
}
|
|
210
206
|
}, [initializing]);
|
|
211
207
|
|
|
212
|
-
|
|
208
|
+
const api = () => {
|
|
213
209
|
return {
|
|
214
210
|
get id() {
|
|
215
211
|
return props.config.id;
|
|
@@ -220,7 +216,7 @@ var Tree = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
220
216
|
},
|
|
221
217
|
|
|
222
218
|
get root() {
|
|
223
|
-
|
|
219
|
+
let rootReference = null;
|
|
224
220
|
|
|
225
221
|
if (!_Utils.default.isNull(root)) {
|
|
226
222
|
rootReference = {};
|
|
@@ -237,40 +233,38 @@ var Tree = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
237
233
|
return rootReference;
|
|
238
234
|
},
|
|
239
235
|
|
|
240
|
-
getChildren:
|
|
236
|
+
getChildren: () => {
|
|
241
237
|
return [];
|
|
242
238
|
}
|
|
243
239
|
};
|
|
244
240
|
};
|
|
245
241
|
|
|
246
|
-
|
|
247
|
-
|
|
242
|
+
const handleSelectionChange = (id, name) => {
|
|
243
|
+
let node = {};
|
|
248
244
|
node.id = id;
|
|
249
245
|
node.label = name;
|
|
250
246
|
selectedRows.splice(0, selectedRows.length);
|
|
251
247
|
selectedRows.push(node);
|
|
252
|
-
|
|
248
|
+
let event = new _Event.default(props.handle, props.viewId);
|
|
253
249
|
|
|
254
250
|
_Observable.default.fireEvent(_EventType.default.SELECTION_CHANGE, event);
|
|
255
251
|
};
|
|
256
252
|
|
|
257
|
-
|
|
253
|
+
const render = item => {
|
|
258
254
|
return /*#__PURE__*/_react.default.createElement(StyledTreeItem, {
|
|
259
255
|
nodeId: item.map.id.toString(),
|
|
260
256
|
label: item.map.name,
|
|
261
257
|
key: item.map.id,
|
|
262
|
-
onLabelClick:
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
onClick: function onClick() {
|
|
258
|
+
onLabelClick: e => e.preventDefault(),
|
|
259
|
+
onClick: () => {
|
|
266
260
|
handleSelectionChange(item.map.id, item.map.name);
|
|
267
261
|
}
|
|
268
|
-
}, !_Utils.default.isNull(item.children) && item.children.length > 0 ? item.children.map(
|
|
262
|
+
}, !_Utils.default.isNull(item.children) && item.children.length > 0 ? item.children.map(child => {
|
|
269
263
|
return render(child);
|
|
270
264
|
}) : null);
|
|
271
265
|
};
|
|
272
266
|
|
|
273
|
-
|
|
267
|
+
const expand = item => {
|
|
274
268
|
expanded.push("".concat(item.map.id));
|
|
275
269
|
|
|
276
270
|
if (!_Utils.default.isNull(item.children)) {
|
|
@@ -279,7 +273,7 @@ var Tree = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
279
273
|
|
|
280
274
|
try {
|
|
281
275
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
282
|
-
|
|
276
|
+
const child = _step.value;
|
|
283
277
|
expand(child);
|
|
284
278
|
}
|
|
285
279
|
} catch (err) {
|