@rio-cloud/rio-uikit 0.15.0 → 0.15.1
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/ApplicationLayout.js +5 -9
- package/lib/components/dropdown/ButtonDropdown.js +152 -181
- package/lib/es/SortDirection.d.ts +5 -0
- package/lib/style/css/_exports/rio-website.less +14 -0
- package/lib/style/css/bootstrap/dropdowns.less +10 -3
- package/lib/style/css/bootstrap/forms.less +38 -36
- package/lib/style/css/bootstrap/input-groups.less +4 -0
- package/lib/style/css/bootstrap/mixins/forms.less +1 -1
- package/lib/style/css/rio-theme/dropdowns.less +2 -2
- package/lib/style/css/rio-theme/forms.less +49 -20
- package/lib/style/css/rio-theme/input-groups.less +44 -25
- package/lib/style/css/rio-theme/variables.less +1 -0
- package/lib/style/css/utils/rounded.less +1 -0
- package/lib/style/fonts/rioglyph/rioglyph.less +1 -1
- package/lib/types.ts +4 -2
- package/lib/utils/buttonEffect.js +9 -4
- package/lib/utils/deviceUtils.js +2 -44
- package/lib/utils/init.js +159 -0
- package/lib/version.json +1 -1
- package/package.json +17 -6
|
@@ -21,21 +21,17 @@ var _ApplicationLayoutSidebar = _interopRequireDefault(require("./ApplicationLay
|
|
|
21
21
|
|
|
22
22
|
var _ApplicationLayoutBody = _interopRequireDefault(require("./ApplicationLayoutBody"));
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var _deviceUtils = require("../../utils/deviceUtils");
|
|
24
|
+
var _init = require("../../utils/init");
|
|
27
25
|
|
|
28
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
27
|
|
|
30
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
// initializes document bootstrapping - keep the import to avoid being tree-shaked
|
|
31
|
+
var ApplicationLayout = function ApplicationLayout(_ref) {
|
|
32
|
+
var className = _ref.className,
|
|
33
|
+
children = _ref.children;
|
|
35
34
|
var classes = (0, _classnames.default)('ApplicationLayout', className);
|
|
36
|
-
(0, _useEffectOnce.default)(function () {
|
|
37
|
-
return (0, _deviceUtils.initdocumentBootstrapping)(document);
|
|
38
|
-
});
|
|
39
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
36
|
className: classes
|
|
41
37
|
}, children);
|
|
@@ -7,33 +7,31 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
17
|
|
|
20
|
-
var
|
|
18
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
21
19
|
|
|
22
|
-
var
|
|
20
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
24
|
-
var
|
|
22
|
+
var _reactPopper = require("react-popper");
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var _isNil = _interopRequireDefault(require("lodash/fp/isNil"));
|
|
29
27
|
|
|
30
|
-
var
|
|
28
|
+
var _noop = _interopRequireDefault(require("lodash/fp/noop"));
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _logDeprecatedWarnings = _interopRequireDefault(require("../../utils/logDeprecatedWarnings"));
|
|
33
31
|
|
|
34
|
-
var
|
|
32
|
+
var _portalRoot = require("../../utils/portalRoot");
|
|
35
33
|
|
|
36
|
-
var
|
|
34
|
+
var _useClickOutside = _interopRequireDefault(require("../../hooks/useClickOutside"));
|
|
37
35
|
|
|
38
36
|
var _getMenuItems = _interopRequireDefault(require("../menuItems/getMenuItems"));
|
|
39
37
|
|
|
@@ -41,8 +39,6 @@ var _MenuItems = _interopRequireDefault(require("../menuItems/MenuItems"));
|
|
|
41
39
|
|
|
42
40
|
var _menuItemsPropTypes = _interopRequireDefault(require("./menuItemsPropTypes"));
|
|
43
41
|
|
|
44
|
-
var _getDropDirection = _interopRequireDefault(require("../../utils/getDropDirection"));
|
|
45
|
-
|
|
46
42
|
var _DropdownToggleButton = _interopRequireDefault(require("./DropdownToggleButton"));
|
|
47
43
|
|
|
48
44
|
var _SplitCaretButton = _interopRequireDefault(require("./SplitCaretButton"));
|
|
@@ -53,170 +49,149 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
53
49
|
|
|
54
50
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
61
|
-
|
|
62
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
63
|
-
|
|
64
|
-
var ButtonDropdown = /*#__PURE__*/function (_PureComponent) {
|
|
65
|
-
(0, _inherits2.default)(ButtonDropdown, _PureComponent);
|
|
66
|
-
|
|
67
|
-
var _super = _createSuper(ButtonDropdown);
|
|
52
|
+
var getPlacement = function getPlacement(pullRight, dropup) {
|
|
53
|
+
if (pullRight && dropup) {
|
|
54
|
+
return 'top-end';
|
|
55
|
+
}
|
|
68
56
|
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
if (!pullRight && dropup) {
|
|
58
|
+
return 'top-start';
|
|
59
|
+
}
|
|
71
60
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
_this.isUncontrolled = (0, _isNil.default)(props.open);
|
|
75
|
-
_this.state = {
|
|
76
|
-
open: _this.isUncontrolled && props.open,
|
|
77
|
-
dropup: props.dropup,
|
|
78
|
-
pullRight: props.pullRight
|
|
79
|
-
};
|
|
80
|
-
_this.toggleOpen = _this.toggleOpen.bind((0, _assertThisInitialized2.default)(_this));
|
|
81
|
-
_this.handleSplitLabelButtonClick = _this.handleSplitLabelButtonClick.bind((0, _assertThisInitialized2.default)(_this));
|
|
82
|
-
_this.refDropdownMenu = /*#__PURE__*/_react.default.createRef();
|
|
83
|
-
_this.refDropdownToggle = /*#__PURE__*/_react.default.createRef();
|
|
84
|
-
return _this;
|
|
61
|
+
if (pullRight && !dropup) {
|
|
62
|
+
return 'bottom-end';
|
|
85
63
|
}
|
|
86
64
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.props.disableOnClickOutside();
|
|
132
|
-
this.props.onClose();
|
|
133
|
-
}
|
|
134
|
-
}, {
|
|
135
|
-
key: "handleClickOutside",
|
|
136
|
-
value: function handleClickOutside() {
|
|
137
|
-
this.closeMenu();
|
|
138
|
-
}
|
|
139
|
-
}, {
|
|
140
|
-
key: "handleSplitLabelButtonClick",
|
|
141
|
-
value: function handleSplitLabelButtonClick() {
|
|
142
|
-
this.closeMenu();
|
|
143
|
-
|
|
144
|
-
if (this.props.onLabelButtonClick) {
|
|
145
|
-
this.props.onLabelButtonClick();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}, {
|
|
149
|
-
key: "isDropUp",
|
|
150
|
-
value: function isDropUp() {
|
|
151
|
-
return this.isAutoDropActive() ? this.state.dropup : this.props.dropup;
|
|
65
|
+
return 'bottom-start';
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var ButtonDropdown = function ButtonDropdown(props) {
|
|
69
|
+
var id = props.id,
|
|
70
|
+
items = props.items,
|
|
71
|
+
bsSize = props.bsSize,
|
|
72
|
+
bsStyle = props.bsStyle,
|
|
73
|
+
disabled = props.disabled,
|
|
74
|
+
iconOnly = props.iconOnly,
|
|
75
|
+
title = props.title,
|
|
76
|
+
splitButton = props.splitButton,
|
|
77
|
+
customDropdown = props.customDropdown,
|
|
78
|
+
toggleClassName = props.toggleClassName,
|
|
79
|
+
dropdownClassName = props.dropdownClassName,
|
|
80
|
+
className = props.className,
|
|
81
|
+
open = props.open,
|
|
82
|
+
dropup = props.dropup,
|
|
83
|
+
pullRight = props.pullRight,
|
|
84
|
+
noCaret = props.noCaret,
|
|
85
|
+
onOpen = props.onOpen,
|
|
86
|
+
onClose = props.onClose,
|
|
87
|
+
onLabelButtonClick = props.onLabelButtonClick,
|
|
88
|
+
usePortal = props.usePortal;
|
|
89
|
+
|
|
90
|
+
var _useState = (0, _react.useState)(open),
|
|
91
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
92
|
+
internalOpen = _useState2[0],
|
|
93
|
+
setInternalOpen = _useState2[1];
|
|
94
|
+
|
|
95
|
+
var _React$useState = _react.default.useState(null),
|
|
96
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
97
|
+
refDropdownToggle = _React$useState2[0],
|
|
98
|
+
setRefDropdownToggle = _React$useState2[1];
|
|
99
|
+
|
|
100
|
+
var _React$useState3 = _react.default.useState(null),
|
|
101
|
+
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
102
|
+
refDropdownMenu = _React$useState4[0],
|
|
103
|
+
setRefDropdownMenu = _React$useState4[1];
|
|
104
|
+
|
|
105
|
+
var modifiers = [{
|
|
106
|
+
name: 'flip',
|
|
107
|
+
options: {
|
|
108
|
+
fallbackPlacements: ['top-start', 'top-end']
|
|
152
109
|
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
110
|
+
}];
|
|
111
|
+
|
|
112
|
+
var _usePopper = (0, _reactPopper.usePopper)(refDropdownToggle, refDropdownMenu, {
|
|
113
|
+
placement: getPlacement(pullRight, dropup),
|
|
114
|
+
modifiers: modifiers
|
|
115
|
+
}),
|
|
116
|
+
styles = _usePopper.styles,
|
|
117
|
+
attributes = _usePopper.attributes;
|
|
118
|
+
|
|
119
|
+
var wrapperRef = (0, _useClickOutside.default)(function () {
|
|
120
|
+
return closeMenu();
|
|
121
|
+
});
|
|
122
|
+
var dropdownRoot = (0, _portalRoot.getOrCreatePortalRoot)();
|
|
123
|
+
var isUncontrolled = (0, _isNil.default)(open);
|
|
124
|
+
var shouldShowCaret = !noCaret && !splitButton && !iconOnly;
|
|
125
|
+
(0, _react.useEffect)(function () {
|
|
126
|
+
if (!isUncontrolled) {
|
|
127
|
+
// console.log('update open from outside: ' + open);
|
|
128
|
+
setInternalOpen(open);
|
|
157
129
|
}
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
130
|
+
}, [isUncontrolled, open]);
|
|
131
|
+
|
|
132
|
+
var toggleOpen = function toggleOpen(event) {
|
|
133
|
+
var isOpen = isUncontrolled ? internalOpen : open;
|
|
134
|
+
|
|
135
|
+
if (isOpen) {
|
|
136
|
+
closeMenu();
|
|
137
|
+
} else {
|
|
138
|
+
openMenu(event);
|
|
166
139
|
}
|
|
167
|
-
}
|
|
168
|
-
key: "isOpen",
|
|
169
|
-
value: function isOpen() {
|
|
170
|
-
var _ref2 = this.isUncontrolled ? this.state : this.props,
|
|
171
|
-
open = _ref2.open;
|
|
140
|
+
};
|
|
172
141
|
|
|
173
|
-
|
|
142
|
+
var openMenu = function openMenu(event) {
|
|
143
|
+
if (isUncontrolled) {
|
|
144
|
+
setInternalOpen(true);
|
|
174
145
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
bsStyle = _this$props2.bsStyle,
|
|
183
|
-
disabled = _this$props2.disabled,
|
|
184
|
-
iconOnly = _this$props2.iconOnly,
|
|
185
|
-
title = _this$props2.title,
|
|
186
|
-
splitButton = _this$props2.splitButton,
|
|
187
|
-
customDropdown = _this$props2.customDropdown,
|
|
188
|
-
toggleClassName = _this$props2.toggleClassName,
|
|
189
|
-
dropdownClassName = _this$props2.dropdownClassName,
|
|
190
|
-
className = _this$props2.className;
|
|
191
|
-
var wrapperClasses = (0, _classnames.default)('dropdown', 'btn-group', this.isOpen() && 'open', this.isDropUp() && 'dropup', className);
|
|
192
|
-
var handleDropdownButtonClick = splitButton ? this.handleSplitLabelButtonClick : this.toggleOpen;
|
|
193
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
194
|
-
className: wrapperClasses
|
|
195
|
-
}, /*#__PURE__*/_react.default.createElement(_DropdownToggleButton.default, {
|
|
196
|
-
id: id,
|
|
197
|
-
splitButton: splitButton,
|
|
198
|
-
bsStyle: bsStyle,
|
|
199
|
-
bsSize: bsSize,
|
|
200
|
-
iconOnly: iconOnly,
|
|
201
|
-
disabled: disabled,
|
|
202
|
-
ref: this.refDropdownToggle,
|
|
203
|
-
onClick: handleDropdownButtonClick,
|
|
204
|
-
className: toggleClassName
|
|
205
|
-
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, title, this.shouldShowCaret() && /*#__PURE__*/_react.default.createElement(_Caret.default, null))), splitButton && /*#__PURE__*/_react.default.createElement(_SplitCaretButton.default, {
|
|
206
|
-
id: id,
|
|
207
|
-
bsStyle: bsStyle,
|
|
208
|
-
disabled: disabled,
|
|
209
|
-
className: toggleClassName,
|
|
210
|
-
onClick: this.toggleOpen
|
|
211
|
-
}), /*#__PURE__*/_react.default.createElement(_MenuItems.default, {
|
|
212
|
-
className: dropdownClassName,
|
|
213
|
-
pullRight: this.isPullRight(),
|
|
214
|
-
ref: this.refDropdownMenu
|
|
215
|
-
}, customDropdown ? customDropdown : (0, _getMenuItems.default)(items, this.toggleOpen)));
|
|
146
|
+
|
|
147
|
+
onOpen(event);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
var closeMenu = function closeMenu() {
|
|
151
|
+
if (isUncontrolled) {
|
|
152
|
+
setInternalOpen(false);
|
|
216
153
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
154
|
+
|
|
155
|
+
onClose();
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var handleSplitLabelButtonClick = function handleSplitLabelButtonClick() {
|
|
159
|
+
closeMenu();
|
|
160
|
+
onLabelButtonClick();
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var handleDropdownButtonClick = splitButton ? handleSplitLabelButtonClick : toggleOpen;
|
|
164
|
+
var isOpen = isUncontrolled ? internalOpen : open;
|
|
165
|
+
var wrapperClasses = (0, _classnames.default)('dropdown', 'btn-group', isOpen && 'open', className);
|
|
166
|
+
var dropdownClasses = (0, _classnames.default)(usePortal && 'dropdown-portal', dropdownClassName);
|
|
167
|
+
|
|
168
|
+
var dropdownMenu = /*#__PURE__*/_react.default.createElement(_MenuItems.default, (0, _extends2.default)({
|
|
169
|
+
className: dropdownClasses,
|
|
170
|
+
ref: setRefDropdownMenu,
|
|
171
|
+
style: styles.popper
|
|
172
|
+
}, attributes.popper), customDropdown ? customDropdown : (0, _getMenuItems.default)(items, toggleOpen));
|
|
173
|
+
|
|
174
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
+
className: wrapperClasses,
|
|
176
|
+
ref: wrapperRef
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement(_DropdownToggleButton.default, {
|
|
178
|
+
id: id,
|
|
179
|
+
splitButton: splitButton,
|
|
180
|
+
bsStyle: bsStyle,
|
|
181
|
+
bsSize: bsSize,
|
|
182
|
+
iconOnly: iconOnly,
|
|
183
|
+
disabled: disabled,
|
|
184
|
+
ref: setRefDropdownToggle,
|
|
185
|
+
onClick: handleDropdownButtonClick,
|
|
186
|
+
className: toggleClassName
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, title, shouldShowCaret && /*#__PURE__*/_react.default.createElement(_Caret.default, null))), splitButton && /*#__PURE__*/_react.default.createElement(_SplitCaretButton.default, {
|
|
188
|
+
id: id,
|
|
189
|
+
bsStyle: bsStyle,
|
|
190
|
+
disabled: disabled,
|
|
191
|
+
className: toggleClassName,
|
|
192
|
+
onClick: toggleOpen
|
|
193
|
+
}), isOpen && usePortal && /*#__PURE__*/_reactDom.default.createPortal(dropdownMenu, dropdownRoot), isOpen && !usePortal && dropdownMenu);
|
|
194
|
+
};
|
|
220
195
|
|
|
221
196
|
ButtonDropdown.defaultProps = {
|
|
222
197
|
id: Math.random().toString(36).substr(2, 16),
|
|
@@ -226,12 +201,13 @@ ButtonDropdown.defaultProps = {
|
|
|
226
201
|
pullRight: false,
|
|
227
202
|
splitButton: false,
|
|
228
203
|
dropup: false,
|
|
229
|
-
autoDropDirection: true,
|
|
230
204
|
bsStyle: 'default',
|
|
231
205
|
disabled: false,
|
|
232
|
-
onOpen:
|
|
233
|
-
onClose:
|
|
206
|
+
onOpen: _noop.default,
|
|
207
|
+
onClose: _noop.default,
|
|
208
|
+
onLabelButtonClick: _noop.default,
|
|
234
209
|
toggleClassName: '',
|
|
210
|
+
usePortal: false,
|
|
235
211
|
className: ''
|
|
236
212
|
};
|
|
237
213
|
ButtonDropdown.propTypes = {
|
|
@@ -245,7 +221,7 @@ ButtonDropdown.propTypes = {
|
|
|
245
221
|
iconOnly: _propTypes.default.bool,
|
|
246
222
|
noCaret: _propTypes.default.bool,
|
|
247
223
|
splitButton: _propTypes.default.bool,
|
|
248
|
-
|
|
224
|
+
usePortal: _propTypes.default.bool,
|
|
249
225
|
items: _menuItemsPropTypes.default.isRequired,
|
|
250
226
|
disabled: _propTypes.default.bool,
|
|
251
227
|
className: _propTypes.default.string,
|
|
@@ -258,10 +234,5 @@ ButtonDropdown.propTypes = {
|
|
|
258
234
|
onOpen: _propTypes.default.func,
|
|
259
235
|
onClose: _propTypes.default.func
|
|
260
236
|
};
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
function Container(props) {
|
|
264
|
-
return /*#__PURE__*/_react.default.createElement(EnhancedComponent, (0, _extends2.default)({}, props, {
|
|
265
|
-
disableOnClickOutside: true
|
|
266
|
-
}));
|
|
267
|
-
}
|
|
237
|
+
var _default = ButtonDropdown;
|
|
238
|
+
exports.default = _default;
|
|
@@ -1521,6 +1521,20 @@ body .module-content {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
1523
|
|
|
1524
|
+
&-marketplace-details-panel {
|
|
1525
|
+
&-rimless-bottom {
|
|
1526
|
+
.section-layout-container-row {
|
|
1527
|
+
padding-bottom: 0 !important;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
&-rimless-top {
|
|
1532
|
+
.section-layout-container-row {
|
|
1533
|
+
padding-top: 0 !important;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1524
1538
|
&-marketplace-col-4-as-col-6 {
|
|
1525
1539
|
.section-layout {
|
|
1526
1540
|
.section-layout-container {
|
|
@@ -34,20 +34,27 @@
|
|
|
34
34
|
border-radius: @border-radius-base;
|
|
35
35
|
border: 1px solid @dropdown-border;
|
|
36
36
|
box-shadow:0 6px 12px rgba(0,0,0,.175);
|
|
37
|
-
display: none; // none by default, but block on "open" of the menu
|
|
38
37
|
float: left;
|
|
39
38
|
font-size: @font-size-base;
|
|
40
39
|
left: 0;
|
|
41
40
|
list-style: none;
|
|
42
|
-
margin:
|
|
41
|
+
margin-bottom: 0;
|
|
43
42
|
min-width: 160px;
|
|
44
43
|
padding: 5px 0;
|
|
45
44
|
position: absolute;
|
|
46
45
|
text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
|
|
47
46
|
top: 100%;
|
|
48
|
-
width: 100%;
|
|
49
47
|
z-index: @zindex-dropdown;
|
|
50
48
|
|
|
49
|
+
// display: none by default
|
|
50
|
+
display: none;
|
|
51
|
+
|
|
52
|
+
// but display: block when portaled
|
|
53
|
+
#uikit-root & {
|
|
54
|
+
display: block;
|
|
55
|
+
width: auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
51
58
|
// Aligns the dropdown menu to right
|
|
52
59
|
//
|
|
53
60
|
// Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
|
|
@@ -391,32 +391,35 @@ input[type="checkbox"] {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
// Feedback icon (requires .glyphicon classes)
|
|
394
|
-
.form-control-feedback {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
394
|
+
// .form-control-feedback {
|
|
395
|
+
// background-color: #ffcc00;
|
|
396
|
+
// border-bottom-right-radius: @border-radius-base;
|
|
397
|
+
// border-top-right-radius: @border-radius-base;
|
|
398
|
+
// display: block;
|
|
399
|
+
// height: @input-height-base - 2;
|
|
400
|
+
// line-height: @input-height-base - 2;
|
|
401
|
+
// pointer-events: none;
|
|
402
|
+
// position: absolute;
|
|
403
|
+
// right: 2px;
|
|
404
|
+
// text-align: center;
|
|
405
|
+
// top: 2px;
|
|
406
|
+
// width: @input-height-base - 2;
|
|
407
|
+
// z-index: 2; // Ensure icon is above input groups
|
|
408
|
+
// }
|
|
409
|
+
// .input-lg + .form-control-feedback,
|
|
410
|
+
// .input-group-lg + .form-control-feedback,
|
|
411
|
+
// .form-group-lg .form-control-feedback {
|
|
412
|
+
// width: @input-height-large - 2;
|
|
413
|
+
// height: @input-height-large - 2;
|
|
414
|
+
// line-height: @input-height-large - 2;
|
|
415
|
+
// }
|
|
416
|
+
// .input-sm + .form-control-feedback,
|
|
417
|
+
// .input-group-sm + .form-control-feedback,
|
|
418
|
+
// .form-group-sm .form-control-feedback {
|
|
419
|
+
// width: @input-height-small - 2;
|
|
420
|
+
// height: @input-height-small - 2;
|
|
421
|
+
// line-height: @input-height-small - 2;
|
|
422
|
+
// }
|
|
420
423
|
|
|
421
424
|
// Feedback states
|
|
422
425
|
.has-success {
|
|
@@ -429,16 +432,15 @@ input[type="checkbox"] {
|
|
|
429
432
|
.form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
|
|
430
433
|
}
|
|
431
434
|
|
|
432
|
-
// Reposition feedback icon if input has visible label above
|
|
433
|
-
.has-feedback label {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
}
|
|
435
|
+
// // Reposition feedback icon if input has visible label above
|
|
436
|
+
// .has-feedback label {
|
|
437
|
+
// & ~ .form-control-feedback {
|
|
438
|
+
// top: (@line-height-computed + 5); // Height of the `label` and its margin
|
|
439
|
+
// }
|
|
440
|
+
// &.sr-only ~ .form-control-feedback {
|
|
441
|
+
// top: 0;
|
|
442
|
+
// }
|
|
443
|
+
// }
|
|
442
444
|
|
|
443
445
|
|
|
444
446
|
// Help text
|
|
@@ -130,7 +130,9 @@
|
|
|
130
130
|
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
|
|
131
131
|
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn,
|
|
132
132
|
.input-group-addon + .form-control:not(:last-child),
|
|
133
|
+
.input-group-addon + .form-control-feedback-wrapper:not(:last-child) .form-control,
|
|
133
134
|
.input-group:not(.ClearableInput) > .form-control:nth-child(1):not(:last-child),
|
|
135
|
+
.input-group:not(.ClearableInput) > .form-control-feedback-wrapper:first-child:not(:last-child) .form-control,
|
|
134
136
|
.input-group > .ClearableInput:not(:last-child) > .form-control,
|
|
135
137
|
.input-group .input-group-addon + .AutoSuggest .ClearableInput > .form-control,
|
|
136
138
|
.input-group .AutoSuggest:not(:last-child) .ClearableInput > .form-control,
|
|
@@ -142,6 +144,8 @@
|
|
|
142
144
|
.input-group-addon:last-child { border-left: 0 }
|
|
143
145
|
|
|
144
146
|
.input-group .input-group-btn + .form-control:last-child,
|
|
147
|
+
.input-group-addon-label + .form-control,
|
|
148
|
+
.input-group-addon-label + .form-control-feedback-wrapper .form-control,
|
|
145
149
|
.input-group-addon:last-child,
|
|
146
150
|
.input-group-btn:last-child > .btn,
|
|
147
151
|
.input-group-btn:last-child > .btn-group > .btn,
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
@dropdown-max-height: 211px; // Used for Select and AutoSuggest components
|
|
20
20
|
|
|
21
21
|
.btn-group.open .dropdown-toggle {
|
|
22
|
-
box-shadow: none;
|
|
22
|
+
box-shadow: none !important;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.dropdown-menu {
|
|
26
26
|
.shadow-hard-to-bottom();
|
|
27
|
-
margin: -1px 0 0 0;
|
|
27
|
+
// margin: -1px 0 0 0;
|
|
28
28
|
padding: 0;
|
|
29
29
|
|
|
30
30
|
> li {
|
|
@@ -53,6 +53,10 @@ label .checkbox-text {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.form-group {
|
|
56
|
+
&:first-child:last-child {
|
|
57
|
+
margin-bottom: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
label:not(.checkbox),
|
|
57
61
|
label:not(.radio) {
|
|
58
62
|
.default-label(@font-size-12);
|
|
@@ -96,11 +100,33 @@ label .checkbox-text {
|
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
102
|
|
|
103
|
+
.form-control-feedback {
|
|
104
|
+
border-radius: 1000px;
|
|
105
|
+
display: block;
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
position: absolute;
|
|
108
|
+
right:3px;
|
|
109
|
+
text-align: center;
|
|
110
|
+
top: 3px;
|
|
111
|
+
width: @input-height-base - 3;
|
|
112
|
+
}
|
|
113
|
+
|
|
99
114
|
// feedback
|
|
100
115
|
&.has-feedback {
|
|
116
|
+
|
|
117
|
+
// Reposition feedback icon if input has visible label above
|
|
118
|
+
label {
|
|
119
|
+
& ~ .form-control-feedback {
|
|
120
|
+
top: 27px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&.sr-only ~ .form-control-feedback {
|
|
124
|
+
top: 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
101
128
|
.form-control {
|
|
102
129
|
padding-right: @input-height-base;
|
|
103
|
-
//border-bottom-right-radius: 0;
|
|
104
130
|
}
|
|
105
131
|
|
|
106
132
|
.form-control-feedback-wrapper {
|
|
@@ -113,45 +139,48 @@ label .checkbox-text {
|
|
|
113
139
|
|
|
114
140
|
.form-control-feedback {
|
|
115
141
|
font-size: 16px;
|
|
116
|
-
line-height: @input-height-base;
|
|
142
|
+
line-height: @input-height-base - 6;
|
|
117
143
|
}
|
|
118
144
|
|
|
119
145
|
// small
|
|
120
146
|
&.form-group-sm .form-control,
|
|
121
147
|
.input-sm {
|
|
122
148
|
padding-right: @input-height-small;
|
|
123
|
-
|
|
124
|
-
~ .form-control-feedback {
|
|
125
|
-
font-size: 16px;
|
|
126
|
-
line-height: @input-height-small;
|
|
127
|
-
}
|
|
128
149
|
}
|
|
129
150
|
|
|
130
|
-
&.form-group-sm
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
&.form-group-sm .form-control-feedback,
|
|
152
|
+
.input-sm + .form-control-feedback {
|
|
153
|
+
font-size: 16px;
|
|
154
|
+
line-height: @input-height-small - 6;
|
|
133
155
|
}
|
|
134
156
|
|
|
157
|
+
// &.form-group-sm label ~ .form-control-feedback,
|
|
158
|
+
// label ~ .input-sm ~ .form-control-feedback {
|
|
159
|
+
// top: 26px;
|
|
160
|
+
// }
|
|
161
|
+
|
|
135
162
|
// large
|
|
136
163
|
&.form-group-lg .form-control,
|
|
137
164
|
.input-lg {
|
|
138
165
|
padding-right: @input-height-large;
|
|
139
|
-
|
|
140
|
-
~ .form-control-feedback {
|
|
141
|
-
font-size: 22px;
|
|
142
|
-
line-height: @input-height-large;
|
|
143
|
-
}
|
|
144
166
|
}
|
|
145
167
|
|
|
146
|
-
&.form-group-lg
|
|
147
|
-
|
|
148
|
-
|
|
168
|
+
&.form-group-lg .form-control-feedback,
|
|
169
|
+
.input-lg + .form-control-feedback {
|
|
170
|
+
font-size: 22px;
|
|
171
|
+
line-height: @input-height-large - 6;
|
|
149
172
|
}
|
|
150
173
|
|
|
174
|
+
// &.form-group-lg label ~ .form-control-feedback,
|
|
175
|
+
// label ~ .input-lg ~ .form-control-feedback {
|
|
176
|
+
// top: 26px;
|
|
177
|
+
// }
|
|
178
|
+
|
|
151
179
|
.help-block {
|
|
180
|
+
border-radius: @border-radius-small;
|
|
152
181
|
font-size: @font-size-small;
|
|
153
|
-
margin: 0;
|
|
154
|
-
padding: 5px
|
|
182
|
+
margin: 1px 0 0 0;
|
|
183
|
+
padding: 2px 5px;
|
|
155
184
|
position: absolute;
|
|
156
185
|
right: 0;
|
|
157
186
|
transition: color 0.2s ease ~"," background 0.2s ease;
|
|
@@ -9,13 +9,18 @@
|
|
|
9
9
|
position: relative;
|
|
10
10
|
align-items: center;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
.form-control, .form-control-feedback-wrapper {
|
|
13
14
|
z-index: 0;
|
|
14
15
|
width: 0;
|
|
15
16
|
display: block;
|
|
16
17
|
flex: 1 1 auto;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
.form-control-feedback-wrapper .form-control {
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
.input-group-addon {
|
|
20
25
|
.input-size(
|
|
21
26
|
@input-height-base;
|
|
@@ -39,16 +44,23 @@
|
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
46
|
|
|
47
|
+
&.input-group-addon-label {
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
background-color: @gray-lightest;
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
&:first-child {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
&:not(.input-group-addon-label) {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
border: none;
|
|
56
|
+
left: 0;
|
|
57
|
+
padding: 0;
|
|
58
|
+
position: absolute;
|
|
59
|
+
text-align: center;
|
|
60
|
+
top: 0;
|
|
61
|
+
width: 32px;
|
|
62
|
+
z-index: 4;
|
|
63
|
+
}
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
&:last-child {
|
|
@@ -62,30 +74,37 @@
|
|
|
62
74
|
);
|
|
63
75
|
border-right: none;
|
|
64
76
|
box-shadow: 1px 0 0 0 @input-border;
|
|
65
|
-
padding-left: 0 !important;
|
|
66
77
|
position: relative;
|
|
67
|
-
transform: translateX(-1px);
|
|
68
78
|
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
|
|
69
79
|
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
&:not(.input-group-addon-label) {
|
|
81
|
+
padding-left: 0 !important;
|
|
82
|
+
transform: translateX(-1px);
|
|
73
83
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
.form-group.has-error & {
|
|
85
|
+
box-shadow: 1px 0 0 0 @brand-danger;
|
|
86
|
+
}
|
|
77
87
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
88
|
+
.form-group.has-warning & {
|
|
89
|
+
box-shadow: 1px 0 0 0 @brand-warning;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.form-group.has-success & {
|
|
93
|
+
box-shadow: 1px 0 0 0 @brand-success;
|
|
94
|
+
}
|
|
81
95
|
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
.form-group.has-feedback & {
|
|
97
|
+
background: @input-bg;
|
|
98
|
+
}
|
|
84
99
|
}
|
|
100
|
+
|
|
101
|
+
|
|
85
102
|
}
|
|
86
103
|
|
|
87
|
-
|
|
88
|
-
|
|
104
|
+
&:not(.input-group-addon-label) {
|
|
105
|
+
+ .form-control, + .form-control-feedback-wrapper .form-control {
|
|
106
|
+
padding-left: 30px;
|
|
107
|
+
}
|
|
89
108
|
}
|
|
90
109
|
|
|
91
110
|
> .rioglyph {
|
package/lib/types.ts
CHANGED
|
@@ -1465,7 +1465,7 @@ export interface SimpleButtonDropdownProps {
|
|
|
1465
1465
|
iconOnly?: boolean;
|
|
1466
1466
|
noCaret?: boolean;
|
|
1467
1467
|
splitButton?: boolean;
|
|
1468
|
-
|
|
1468
|
+
usePortal?: boolean;
|
|
1469
1469
|
items: MenuItemProps[];
|
|
1470
1470
|
className?: string;
|
|
1471
1471
|
dropdownClassName?: string;
|
|
@@ -1568,8 +1568,10 @@ export interface SimpleTooltipProps {
|
|
|
1568
1568
|
| OverlayTriggerPlacement.LEFT_START
|
|
1569
1569
|
| OverlayTriggerPlacement.LEFT
|
|
1570
1570
|
| OverlayTriggerPlacement.LEFT_END;
|
|
1571
|
-
|
|
1571
|
+
content: string | React.ReactNode;
|
|
1572
1572
|
trigger?: 'click' | 'hover' | 'focus';
|
|
1573
|
+
targetRef?: React.MutableRefObject<object>;
|
|
1574
|
+
children: React.ReactNode;
|
|
1573
1575
|
}
|
|
1574
1576
|
|
|
1575
1577
|
export interface SaveDialogProps {
|
|
@@ -37,10 +37,15 @@ var isTargetEligibleForEffect = function isTargetEligibleForEffect(target) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
var className = target.className;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
|
|
41
|
+
if (typeof className === 'string' || typeof className === 'array') {
|
|
42
|
+
var isButton = className.includes('btn ');
|
|
43
|
+
var isNotButtonComponent = !className.includes('btn-component');
|
|
44
|
+
var isNotDisabled = !className.includes('disabled');
|
|
45
|
+
return isButton && isNotButtonComponent && isNotDisabled;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return false;
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
var enableButtonRipple = function enableButtonRipple(event) {
|
package/lib/utils/deviceUtils.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.isDesktop = exports.
|
|
9
|
-
|
|
10
|
-
var _throttle = _interopRequireDefault(require("lodash/fp/throttle"));
|
|
6
|
+
exports.isDesktop = exports.inIframe = exports.hasTouch = void 0;
|
|
11
7
|
|
|
12
8
|
// As "cssuseragent" is accessing the html dom object directly without checking whether it exists or not, we need to
|
|
13
9
|
// use old shool require() to have a conditional import only when html really exists. This avoids issues when
|
|
@@ -54,44 +50,6 @@ var inIframe = function inIframe() {
|
|
|
54
50
|
} catch (e) {
|
|
55
51
|
return true;
|
|
56
52
|
}
|
|
57
|
-
}; // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
exports.inIframe = inIframe;
|
|
61
|
-
|
|
62
|
-
var calcViewportUnits = function calcViewportUnits() {
|
|
63
|
-
var vh = window.innerHeight * 0.01;
|
|
64
|
-
return "--vh: ".concat(vh, "px");
|
|
65
53
|
};
|
|
66
54
|
|
|
67
|
-
|
|
68
|
-
if (!document || !document.documentElement) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
var html = document.documentElement;
|
|
73
|
-
|
|
74
|
-
var setViewportUnits = function setViewportUnits() {
|
|
75
|
-
html.setAttribute('style', calcViewportUnits());
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
window.addEventListener('orientationchange', (0, _throttle.default)(1000, setViewportUnits));
|
|
79
|
-
window.addEventListener('resize', (0, _throttle.default)(1000, setViewportUnits));
|
|
80
|
-
setViewportUnits();
|
|
81
|
-
|
|
82
|
-
if (!window.CSS || !window.CSS.supports || !window.CSS.supports('gap: 1px')) {
|
|
83
|
-
html.classList.add('css-no-gap');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (html && inIframe()) {
|
|
87
|
-
html.classList.add('window-iframe');
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
exports.initdocumentBootstrapping = initdocumentBootstrapping;
|
|
92
|
-
|
|
93
|
-
var autoInitDocumentBootstrapping = function (document) {
|
|
94
|
-
initdocumentBootstrapping(document);
|
|
95
|
-
}(document);
|
|
96
|
-
|
|
97
|
-
exports.autoInitDocumentBootstrapping = autoInitDocumentBootstrapping;
|
|
55
|
+
exports.inIframe = inIframe;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.initDocumentBootstrapping = exports.autoInitDocumentBootstrapping = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
+
|
|
16
|
+
var _throttle = _interopRequireDefault(require("lodash/fp/throttle"));
|
|
17
|
+
|
|
18
|
+
var _deviceUtils = require("./deviceUtils");
|
|
19
|
+
|
|
20
|
+
var _version = _interopRequireDefault(require("../version.json"));
|
|
21
|
+
|
|
22
|
+
var uikitVersion = _version.default.version;
|
|
23
|
+
|
|
24
|
+
var isProdEnv = function isProdEnv() {
|
|
25
|
+
return process.env.NODE_ENV === 'production';
|
|
26
|
+
}; // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var calcViewportUnits = function calcViewportUnits() {
|
|
30
|
+
var vh = window.innerHeight * 0.01;
|
|
31
|
+
return "--vh: ".concat(vh, "px");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var logStyled = function logStyled(log) {
|
|
35
|
+
return console.log('%c%s', 'color: #697a8b;', log);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var printPoweredByRIO = function printPoweredByRIO() {
|
|
39
|
+
logStyled('- - - - - - - - - - - - - - - - - - - - - - -');
|
|
40
|
+
logStyled(" ____ ___ ___ _ _ ___ _ _____ _____\n | _ \\|_ _/ _ \\ | | | |_ _| |/ /_ _|_ _|\n | |_) || | | | | | | | || || ' / | | | |\n | _ < | | |_| | | |_| || || . \\ | | | |\n |_| \\_\\___\\___/ \\___/|___|_|\\_\\___| |_|\n");
|
|
41
|
+
var message = [" Version ".concat(uikitVersion, " | https://uikit.developers.rio.cloud")];
|
|
42
|
+
isProdEnv() && message.push('\n\n You are a Developer? RIO is hiring! | https://rio.cloud/en/career');
|
|
43
|
+
logStyled(message.join(''));
|
|
44
|
+
logStyled('- - - - - - - - - - - - - - - - - - - - - -');
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var checkForReleaseVersion = /*#__PURE__*/function () {
|
|
48
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
49
|
+
var remoteVersionsListUrl, response, data;
|
|
50
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
51
|
+
while (1) {
|
|
52
|
+
switch (_context.prev = _context.next) {
|
|
53
|
+
case 0:
|
|
54
|
+
if (isProdEnv()) {
|
|
55
|
+
_context.next = 2;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return _context.abrupt("return");
|
|
60
|
+
|
|
61
|
+
case 2:
|
|
62
|
+
remoteVersionsListUrl = 'https://uikit.developers.rio.cloud/versionsList.json';
|
|
63
|
+
_context.prev = 3;
|
|
64
|
+
_context.next = 6;
|
|
65
|
+
return fetch(remoteVersionsListUrl, {
|
|
66
|
+
method: 'get',
|
|
67
|
+
mode: 'no-cors'
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
case 6:
|
|
71
|
+
response = _context.sent;
|
|
72
|
+
_context.next = 9;
|
|
73
|
+
return response.json();
|
|
74
|
+
|
|
75
|
+
case 9:
|
|
76
|
+
data = _context.sent;
|
|
77
|
+
|
|
78
|
+
if (data.latest_release !== uikitVersion) {
|
|
79
|
+
console.log("\uD83C\uDD95 UIKIT version ".concat(data.latest_release, " is the latest released version! Your are using ").concat(uikitVersion));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_context.next = 16;
|
|
83
|
+
break;
|
|
84
|
+
|
|
85
|
+
case 13:
|
|
86
|
+
_context.prev = 13;
|
|
87
|
+
_context.t0 = _context["catch"](3);
|
|
88
|
+
// console.warn(error);
|
|
89
|
+
console.warn("Faild to fetch versionsList from ".concat(remoteVersionsListUrl));
|
|
90
|
+
|
|
91
|
+
case 16:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, _callee, null, [[3, 13]]);
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
return function checkForReleaseVersion() {
|
|
100
|
+
return _ref.apply(this, arguments);
|
|
101
|
+
};
|
|
102
|
+
}();
|
|
103
|
+
|
|
104
|
+
var checkMatchingUkitVersions = function checkMatchingUkitVersions() {
|
|
105
|
+
Array.from(document.querySelectorAll('link[rel="stylesheet"]')).forEach(function (cssLink) {
|
|
106
|
+
var href = cssLink.href;
|
|
107
|
+
|
|
108
|
+
if (href.includes('uikit.developers.rio.cloud')) {
|
|
109
|
+
var _URL$pathname$split = new URL(href).pathname.split('/'),
|
|
110
|
+
_URL$pathname$split2 = (0, _slicedToArray2.default)(_URL$pathname$split, 2),
|
|
111
|
+
uikitVersionCSS = _URL$pathname$split2[1];
|
|
112
|
+
|
|
113
|
+
if (!href.includes(uikitVersion)) {
|
|
114
|
+
console.warn(['You are using different UIKIT JS and CSS versions.\n', "Your current JS version is ".concat(uikitVersion, " and "), "your current CSS version is ".concat(uikitVersionCSS, ".\n"), 'If this is not on purpose, please fix it. Otherwise, this may lead to UI bugs.'].join(''));
|
|
115
|
+
}
|
|
116
|
+
} else if (href.includes('cdn.rio.cloud/libs/rio-uikit')) {
|
|
117
|
+
console.error('You are still using an old "cdn.rio.cloud" css import. This will lead to mayor UI bugs!');
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var initDocumentBootstrapping = function initDocumentBootstrapping(document) {
|
|
123
|
+
if (!document || !document.documentElement) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
console.group('UIKIT');
|
|
128
|
+
console.log('Init document bootstrapping');
|
|
129
|
+
var html = document.documentElement;
|
|
130
|
+
|
|
131
|
+
var setViewportUnits = function setViewportUnits() {
|
|
132
|
+
return html.setAttribute('style', calcViewportUnits());
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
window.addEventListener('orientationchange', (0, _throttle.default)(1000, setViewportUnits));
|
|
136
|
+
window.addEventListener('resize', (0, _throttle.default)(1000, setViewportUnits));
|
|
137
|
+
setViewportUnits();
|
|
138
|
+
|
|
139
|
+
if (!window.CSS || !window.CSS.supports || !window.CSS.supports('gap: 1px')) {
|
|
140
|
+
html.classList.add('css-no-gap');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (html && (0, _deviceUtils.inIframe)()) {
|
|
144
|
+
html.classList.add('window-iframe');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
printPoweredByRIO();
|
|
148
|
+
checkForReleaseVersion();
|
|
149
|
+
checkMatchingUkitVersions();
|
|
150
|
+
console.groupEnd('UIKIT');
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
exports.initDocumentBootstrapping = initDocumentBootstrapping;
|
|
154
|
+
|
|
155
|
+
var autoInitDocumentBootstrapping = function (document) {
|
|
156
|
+
initDocumentBootstrapping(document);
|
|
157
|
+
}(document);
|
|
158
|
+
|
|
159
|
+
exports.autoInitDocumentBootstrapping = autoInitDocumentBootstrapping;
|
package/lib/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rio-cloud/rio-uikit",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "The RIO UIKIT component library",
|
|
5
5
|
"repository": "https://collaboration.msi.audi.com/stash/projects/RIOFRONT/repos/uikit-web/browse",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "NODE_ENV=production babel src --out-dir lib --copy-files && NODE_ENV=production webpack --progress --stats-children && echo '👉
|
|
7
|
+
"build": "NODE_ENV=production babel src --out-dir lib --copy-files && NODE_ENV=production webpack --progress --stats-children && echo '👉 For a npm release use update-build 👈'",
|
|
8
|
+
"update-build": "npm update && npm run build",
|
|
8
9
|
"check-licenses": "node tools/check-licenses.js .",
|
|
9
10
|
"check-updates": "node tools/checkUpdates.js",
|
|
10
11
|
"license-check": "license-checker --production --json --onlyAllow \"`cat whitelist.txt`\" --excludePackages \"rio-livemonitor@0.1.3\" --out licenses.txt",
|
|
11
12
|
"git-tasks": "node tools/gitTasks.js",
|
|
12
13
|
"lint": "$(npm bin)/eslint --ignore-pattern 'src/vendor/*' 'src/**/*.js' 'test/**/*.js'",
|
|
13
14
|
"lint-tasks": "node tools/lintTasks.js",
|
|
14
|
-
"analyze": "source-map-explorer 'dist/0.15.
|
|
15
|
+
"analyze": "source-map-explorer 'dist/0.15.1/*.js'",
|
|
16
|
+
"analyze-bundle": "BUILD_OPTION=BundleAnalyzer npm run build",
|
|
15
17
|
"prepare": "ls -la .",
|
|
16
18
|
"prepack": "NODE_ENV=production babel src --out-dir lib --copy-files && NODE_ENV=production webpack --progress",
|
|
17
|
-
"test": "NODE_ENV=test jest",
|
|
18
|
-
"test-dev": "NODE_ENV=test jest --watch"
|
|
19
|
+
"test": "NODE_ENV=test TZ=UTC jest",
|
|
20
|
+
"test-dev": "NODE_ENV=test TZ=UTC jest --watch"
|
|
19
21
|
},
|
|
20
22
|
"author": "TB Digital Services GmbH",
|
|
21
23
|
"license": "Apache-2.0",
|
|
@@ -64,6 +66,7 @@
|
|
|
64
66
|
"git-tools": "^0.3.0",
|
|
65
67
|
"html-loader": "^3.1.0",
|
|
66
68
|
"jest": "^27.4.7",
|
|
69
|
+
"jest-junit": "^12.0.0",
|
|
67
70
|
"jsdom": "^19.0.0",
|
|
68
71
|
"jsdom-global": "^3.0.2",
|
|
69
72
|
"less": "^4.1.1",
|
|
@@ -122,6 +125,7 @@
|
|
|
122
125
|
"react-motion": "^0.5.2",
|
|
123
126
|
"react-notifications": "^1.7.3",
|
|
124
127
|
"react-onclickoutside": "^6.10.0",
|
|
128
|
+
"react-popper": "^2.2.5",
|
|
125
129
|
"react-sortable-hoc": "^2.0.0",
|
|
126
130
|
"react-transition-group": "^4.4.1",
|
|
127
131
|
"recharts": "^2.1.8",
|
|
@@ -151,6 +155,13 @@
|
|
|
151
155
|
"testEnvironment": "jsdom",
|
|
152
156
|
"moduleNameMapper": {
|
|
153
157
|
"\\.svg": "<rootDir>/__mocks__/svg.js"
|
|
154
|
-
}
|
|
158
|
+
},
|
|
159
|
+
"reporters": [
|
|
160
|
+
"default",
|
|
161
|
+
"jest-junit"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"jest-junit": {
|
|
165
|
+
"outputDirectory": "./results/jest"
|
|
155
166
|
}
|
|
156
167
|
}
|