@rio-cloud/rio-uikit 0.16.1-beta-4 → 0.16.1-beta-6
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/lib/components/applicationLayout/ApplicationLayoutSidebar.js +2 -1
- package/lib/components/selects/BaseDropdownMenu.js +29 -23
- package/lib/components/selects/Select.js +11 -5
- package/lib/components/sidebars/Sidebar.js +68 -16
- package/lib/style/css/_exports/rio-website.less +19 -1
- package/lib/version.json +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
16
16
|
var ApplicationLayoutSidebar = function ApplicationLayoutSidebar(_ref) {
|
|
17
17
|
var className = _ref.className,
|
|
18
18
|
children = _ref.children;
|
|
19
|
-
var classes = (0, _classnames.default)('ApplicationLayoutSidebar', className);
|
|
19
|
+
var classes = (0, _classnames.default)('ApplicationLayoutSidebar', className); // TODO: check for className "right" and inject prop "position={Sidebar.RIGHT}"
|
|
20
|
+
|
|
20
21
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
22
|
className: classes
|
|
22
23
|
}, children);
|
|
@@ -79,7 +79,7 @@ var BaseDropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
79
79
|
pullRight: props.pullRight,
|
|
80
80
|
focusedItemIndex: _this.props.focusedItemIndex,
|
|
81
81
|
keyboardUsed: _this.props.keyboardUsed,
|
|
82
|
-
itemDOMValues:
|
|
82
|
+
itemDOMValues: []
|
|
83
83
|
};
|
|
84
84
|
_this.handleOptionChange = _this.handleOptionChange.bind((0, _assertThisInitialized2.default)(_this));
|
|
85
85
|
_this.handleKeydown = _this.handleKeydown.bind((0, _assertThisInitialized2.default)(_this));
|
|
@@ -113,24 +113,29 @@ var BaseDropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
if (!(0, _isEqual.default)(nextProps.options, this.props.options)) {
|
|
116
|
-
// Only update the DOM values if it is explicitly requested
|
|
117
|
-
// otherwise it will reduce the dom values to the filtered options
|
|
118
|
-
var updatedItemDOMValues;
|
|
119
|
-
|
|
120
|
-
if (nextProps.requestItemDOMValues) {
|
|
121
|
-
updatedItemDOMValues = this.setItemDOMValues();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
116
|
this.setState(function () {
|
|
125
117
|
return {
|
|
126
|
-
options: nextProps.options
|
|
127
|
-
itemDOMValues: updatedItemDOMValues ? updatedItemDOMValues : _this2.state.itemDOMValues
|
|
118
|
+
options: nextProps.options
|
|
128
119
|
};
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
120
|
+
}); // Workaround to put the update of DOM values into a setTimeout to have the component
|
|
121
|
+
// re-rendered to fetch the DOM items.
|
|
122
|
+
// This should be refactored when reworking the component as functional component
|
|
123
|
+
|
|
124
|
+
setTimeout(function () {
|
|
125
|
+
// Only update the DOM values if it is explicitly requested
|
|
126
|
+
// otherwise it will reduce the dom values to the filtered options
|
|
127
|
+
if (nextProps.requestItemDOMValues) {
|
|
128
|
+
var items = _this2.setItemDOMValues();
|
|
129
|
+
|
|
130
|
+
_this2.props.updateDOMValues(items);
|
|
131
|
+
|
|
132
|
+
_this2.setState(function () {
|
|
133
|
+
return {
|
|
134
|
+
itemDOMValues: items ? items : _this2.state.itemDOMValues
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}, 0);
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
141
|
}
|
|
@@ -273,10 +278,10 @@ var BaseDropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
273
278
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
274
279
|
className: dropdownMenuClasses
|
|
275
280
|
}, /*#__PURE__*/_react.default.createElement("li", {
|
|
276
|
-
className:
|
|
281
|
+
className: "no-item-message disabled",
|
|
277
282
|
disabled: true
|
|
278
283
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
279
|
-
role:
|
|
284
|
+
role: "button"
|
|
280
285
|
}, /*#__PURE__*/_react.default.createElement("i", null, noItemMessage))));
|
|
281
286
|
}
|
|
282
287
|
|
|
@@ -301,7 +306,7 @@ var BaseDropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
301
306
|
id: option.id,
|
|
302
307
|
icon: option.icon,
|
|
303
308
|
label: option.label,
|
|
304
|
-
type:
|
|
309
|
+
type: "dropdown"
|
|
305
310
|
});
|
|
306
311
|
} // Show focused style only when keyboard is in use
|
|
307
312
|
|
|
@@ -312,15 +317,15 @@ var BaseDropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
312
317
|
key: option.id,
|
|
313
318
|
className: classNames
|
|
314
319
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
315
|
-
role:
|
|
320
|
+
role: "button",
|
|
316
321
|
className: anchorClassNames,
|
|
317
322
|
"data-item-id": option.id,
|
|
318
323
|
"data-item-index": index,
|
|
319
324
|
onClick: !option.disabled ? this.handleOptionChange : undefined
|
|
320
325
|
}, /*#__PURE__*/_react.default.createElement("span", null, option.icon && /*#__PURE__*/_react.default.createElement("span", {
|
|
321
|
-
className:
|
|
326
|
+
className: "margin-right-5"
|
|
322
327
|
}, option.icon), option.label), /*#__PURE__*/_react.default.createElement("input", {
|
|
323
|
-
type:
|
|
328
|
+
type: "hidden",
|
|
324
329
|
value: option.id
|
|
325
330
|
})));
|
|
326
331
|
}
|
|
@@ -416,5 +421,6 @@ BaseDropdownMenu.propTypes = {
|
|
|
416
421
|
autoDropDirection: _propTypes.default.bool,
|
|
417
422
|
noItemMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
418
423
|
focusedItemIndex: _propTypes.default.number.isRequired,
|
|
419
|
-
dropdownClassName: _propTypes.default.string
|
|
424
|
+
dropdownClassName: _propTypes.default.string,
|
|
425
|
+
requestItemDOMValues: _propTypes.default.bool
|
|
420
426
|
};
|
|
@@ -71,7 +71,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
71
71
|
filteredOptions: props.options,
|
|
72
72
|
itemDOMValues: [],
|
|
73
73
|
focusedItemIndex: DEFAULT_FOCUSED_ITEM_INDEX,
|
|
74
|
-
keyboardUsed: false
|
|
74
|
+
keyboardUsed: false,
|
|
75
|
+
requestItemDOMValues: false
|
|
75
76
|
};
|
|
76
77
|
_this.onToggle = _this.onToggle.bind((0, _assertThisInitialized2.default)(_this));
|
|
77
78
|
_this.handleClickOutside = _this.handleClickOutside.bind((0, _assertThisInitialized2.default)(_this));
|
|
@@ -125,7 +126,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
125
126
|
}
|
|
126
127
|
}, {
|
|
127
128
|
key: "updateDOMValues",
|
|
128
|
-
value: function updateDOMValues(
|
|
129
|
+
value: function updateDOMValues() {
|
|
130
|
+
var itemDOMValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
129
131
|
this.setState(function () {
|
|
130
132
|
return {
|
|
131
133
|
itemDOMValues: itemDOMValues,
|
|
@@ -294,7 +296,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
294
296
|
noItemMessage: noItemMessage,
|
|
295
297
|
autoDropDirection: autoDropDirection,
|
|
296
298
|
pullRight: pullRight,
|
|
297
|
-
dropdownClassName: dropdownClassName
|
|
299
|
+
dropdownClassName: dropdownClassName,
|
|
300
|
+
requestItemDOMValues: this.state.requestItemDOMValues
|
|
298
301
|
});
|
|
299
302
|
}
|
|
300
303
|
}, {
|
|
@@ -311,10 +314,13 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
311
314
|
}
|
|
312
315
|
}, {
|
|
313
316
|
key: "filterOptions",
|
|
314
|
-
value: function filterOptions(
|
|
317
|
+
value: function filterOptions() {
|
|
318
|
+
var itemDOMValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
319
|
+
var filterValue = arguments.length > 1 ? arguments[1] : undefined;
|
|
320
|
+
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
315
321
|
var filteredDOMValues = itemDOMValues.filter(function (item) {
|
|
316
322
|
return item.text.toLowerCase().includes(filterValue.toLowerCase());
|
|
317
|
-
}); // Filter the options
|
|
323
|
+
}); // Filter the options according to the filtered DOM values and map the IDs since the filter cannot be done
|
|
318
324
|
// on the options itself as they might contain arbitrary components
|
|
319
325
|
|
|
320
326
|
return options.filter(function (option) {
|
|
@@ -25,14 +25,16 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
25
25
|
|
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
27
|
|
|
28
|
-
var _Resizer = _interopRequireDefault(require("../resizer/Resizer"));
|
|
29
|
-
|
|
30
28
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
31
29
|
|
|
32
30
|
var _throttle = _interopRequireDefault(require("lodash/fp/throttle"));
|
|
33
31
|
|
|
34
32
|
var _head = _interopRequireDefault(require("lodash/fp/head"));
|
|
35
33
|
|
|
34
|
+
var _framerMotion = require("framer-motion");
|
|
35
|
+
|
|
36
|
+
var _Resizer = _interopRequireDefault(require("../resizer/Resizer"));
|
|
37
|
+
|
|
36
38
|
var _addEventListener = _interopRequireDefault(require("../../utils/addEventListener"));
|
|
37
39
|
|
|
38
40
|
var _ownerDocument = _interopRequireDefault(require("../../utils/ownerDocument"));
|
|
@@ -272,7 +274,8 @@ var Sidebar = /*#__PURE__*/function (_Component) {
|
|
|
272
274
|
enableNavigationButtons = _this$props5.enableNavigationButtons,
|
|
273
275
|
disableClose = _this$props5.disableClose,
|
|
274
276
|
bodyRef = _this$props5.bodyRef,
|
|
275
|
-
headerButtons = _this$props5.headerButtons
|
|
277
|
+
headerButtons = _this$props5.headerButtons,
|
|
278
|
+
fly = _this$props5.fly;
|
|
276
279
|
var _this$state2 = this.state,
|
|
277
280
|
width = _this$state2.width,
|
|
278
281
|
isFullscreen = _this$state2.isFullscreen,
|
|
@@ -293,10 +296,57 @@ var Sidebar = /*#__PURE__*/function (_Component) {
|
|
|
293
296
|
} : {
|
|
294
297
|
left: resizeIndicatorPosition
|
|
295
298
|
};
|
|
296
|
-
|
|
299
|
+
var offscreenPos = isRight ? 1000 : -1000;
|
|
300
|
+
var pos = isRight ? width : width; // const initial = { opacity: 0 };
|
|
301
|
+
// if (isRight) {
|
|
302
|
+
// initial.x = -1000;
|
|
303
|
+
// } else {
|
|
304
|
+
// initial.x = -1000;
|
|
305
|
+
// }
|
|
306
|
+
// const contentAnimate = {};
|
|
307
|
+
// if (closed) {
|
|
308
|
+
// if (isRight) {
|
|
309
|
+
// // contentAnimate.x = 10000;
|
|
310
|
+
// // contentAnimate.left = 0;
|
|
311
|
+
// } else {
|
|
312
|
+
// // contentAnimate.x = -1000;
|
|
313
|
+
// contentAnimate.right = 0;
|
|
314
|
+
// }
|
|
315
|
+
// } else {
|
|
316
|
+
// if (isRight) {
|
|
317
|
+
// contentAnimate.x = 0;
|
|
318
|
+
// } else {
|
|
319
|
+
// contentAnimate.x = 0;
|
|
320
|
+
// }
|
|
321
|
+
// contentAnimate.opacity = 1;
|
|
322
|
+
// }
|
|
323
|
+
|
|
324
|
+
var contentStyle = {
|
|
325
|
+
width: width,
|
|
326
|
+
top: 0,
|
|
327
|
+
position: 'absolute'
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
if (isRight) {
|
|
331
|
+
contentStyle.left = 0;
|
|
332
|
+
} else {
|
|
333
|
+
contentStyle.right = 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return /*#__PURE__*/_react.default.createElement(_framerMotion.motion.div, {
|
|
337
|
+
initial: {
|
|
338
|
+
width: closed ? 0 : width
|
|
339
|
+
},
|
|
340
|
+
animate: {
|
|
341
|
+
width: closed ? 0 : width
|
|
342
|
+
},
|
|
343
|
+
transition: {
|
|
344
|
+
duration: 2.2,
|
|
345
|
+
ease: 'easeInOut'
|
|
346
|
+
},
|
|
297
347
|
className: classes,
|
|
298
348
|
style: {
|
|
299
|
-
|
|
349
|
+
overflow: closed ? 'hidden' : 'auto'
|
|
300
350
|
},
|
|
301
351
|
ref: function ref(node) {
|
|
302
352
|
return _this2.sidebarRef = node;
|
|
@@ -304,36 +354,38 @@ var Sidebar = /*#__PURE__*/function (_Component) {
|
|
|
304
354
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
305
355
|
className: resizeLimitClasses,
|
|
306
356
|
style: resizeLimitStyle
|
|
307
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
308
|
-
|
|
357
|
+
}), /*#__PURE__*/_react.default.createElement(_framerMotion.motion.div, {
|
|
358
|
+
// animate={contentAnimate}
|
|
359
|
+
style: contentStyle,
|
|
360
|
+
className: "SidebarContent"
|
|
309
361
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
310
362
|
className: headerClassNames
|
|
311
363
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
312
364
|
className: titleClassNames
|
|
313
365
|
}, title ? title : ''), /*#__PURE__*/_react.default.createElement("div", {
|
|
314
|
-
className:
|
|
366
|
+
className: "SidebarButtons non-printable close"
|
|
315
367
|
}, headerButtons, enableNavigationButtons && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
|
|
316
|
-
className:
|
|
368
|
+
className: "btn btn-muted btn-icon-only",
|
|
317
369
|
onClick: this.handlePrevContent
|
|
318
370
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
319
|
-
className:
|
|
371
|
+
className: " rioglyph rioglyph-chevron-left"
|
|
320
372
|
})), /*#__PURE__*/_react.default.createElement("button", {
|
|
321
|
-
className:
|
|
373
|
+
className: "btn btn-muted btn-icon-only",
|
|
322
374
|
onClick: this.handleNextContent
|
|
323
375
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
324
|
-
className:
|
|
376
|
+
className: " rioglyph rioglyph-chevron-right"
|
|
325
377
|
}))), enableFullscreenToggle && /*#__PURE__*/_react.default.createElement("button", {
|
|
326
|
-
className:
|
|
378
|
+
className: "btn btn-muted btn-icon-only",
|
|
327
379
|
onClick: this.handleFullscreenChange
|
|
328
380
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
329
381
|
className: fullscreenIconClasses
|
|
330
382
|
})), !disableClose && (headerButtons || enableNavigationButtons || enableFullscreenToggle) && /*#__PURE__*/_react.default.createElement("div", {
|
|
331
|
-
className:
|
|
383
|
+
className: "SidebarButtons-spacer"
|
|
332
384
|
}), !disableClose && /*#__PURE__*/_react.default.createElement("button", {
|
|
333
|
-
className:
|
|
385
|
+
className: "btn btn-muted btn-icon-only",
|
|
334
386
|
onClick: onClose
|
|
335
387
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
336
|
-
className:
|
|
388
|
+
className: "rioglyph rioglyph-remove"
|
|
337
389
|
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
338
390
|
className: bodyClassNames,
|
|
339
391
|
ref: bodyRef
|
|
@@ -191,7 +191,7 @@ body .module-content {
|
|
|
191
191
|
|
|
192
192
|
.ApplicationHeader {
|
|
193
193
|
.navbar-brand {
|
|
194
|
-
background-image: url('@{cdnBase}/svg/common/ico_rio.svg') !important;
|
|
194
|
+
//background-image: url('@{cdnBase}/svg/common/ico_rio.svg') !important;
|
|
195
195
|
background-size: cover;
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -671,6 +671,24 @@ body .module-content {
|
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
|
|
674
|
+
&.list-style-position-inside {
|
|
675
|
+
ul, ol {
|
|
676
|
+
list-style-position: inside !important;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
&.large-panel-border {
|
|
681
|
+
> .section-content-container.panel {
|
|
682
|
+
border-width: 3px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
&.panel-border-color-lighter {
|
|
686
|
+
> .section-content-container.panel {
|
|
687
|
+
border-color: @gray-lighter;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
674
692
|
// Section Wrapper Inner Container
|
|
675
693
|
.section-content-container {
|
|
676
694
|
height: 100%;
|
package/lib/version.json
CHANGED
package/package.json
CHANGED