@luminati-io/uikit 3.4.7 → 3.4.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -33909,7 +33909,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
33909
33909
|
|
33910
33910
|
var useStyles = function useStyles(_ref) {
|
33911
33911
|
var styles = _ref.styles,
|
33912
|
-
size = _ref.size
|
33912
|
+
size = _ref.size,
|
33913
|
+
menuPortalTarget = _ref.menuPortalTarget;
|
33913
33914
|
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
33914
33915
|
return (0,_util_with_user_styles__WEBPACK_IMPORTED_MODULE_5__.withUserStyles)(styles, {
|
33915
33916
|
control: function control(baseStyles, _ref2) {
|
@@ -33976,7 +33977,8 @@ var useStyles = function useStyles(_ref) {
|
|
33976
33977
|
width: '100%',
|
33977
33978
|
backgroundColor: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].color.white,
|
33978
33979
|
borderRadius: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].spacing['02'],
|
33979
|
-
boxShadow: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].box_shadow.md
|
33980
|
+
boxShadow: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].box_shadow.md,
|
33981
|
+
zIndex: menuPortalTarget ? baseStyles.zIndex : _constants__WEBPACK_IMPORTED_MODULE_3__.Z_INDEX.dropdown
|
33980
33982
|
});
|
33981
33983
|
},
|
33982
33984
|
menuPortal: function menuPortal(baseStyles) {
|
@@ -34022,7 +34024,7 @@ var useStyles = function useStyles(_ref) {
|
|
34022
34024
|
});
|
34023
34025
|
}
|
34024
34026
|
});
|
34025
|
-
}, [styles, size]);
|
34027
|
+
}, [styles, size, menuPortalTarget]);
|
34026
34028
|
};
|
34027
34029
|
|
34028
34030
|
/***/ }),
|
@@ -36112,8 +36114,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
36112
36114
|
/*jslint react:true*/
|
36113
36115
|
|
36114
36116
|
|
36115
|
-
_menu__WEBPACK_IMPORTED_MODULE_0__
|
36116
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_menu__WEBPACK_IMPORTED_MODULE_0__
|
36117
|
+
_menu__WEBPACK_IMPORTED_MODULE_0__.Menu.Item = _menu_item__WEBPACK_IMPORTED_MODULE_1__.MenuItem;
|
36118
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_menu__WEBPACK_IMPORTED_MODULE_0__.Menu);
|
36117
36119
|
|
36118
36120
|
/***/ }),
|
36119
36121
|
|
@@ -36126,7 +36128,7 @@ _menu__WEBPACK_IMPORTED_MODULE_0__["default"].Item = _menu_item__WEBPACK_IMPORTE
|
|
36126
36128
|
"use strict";
|
36127
36129
|
__webpack_require__.r(__webpack_exports__);
|
36128
36130
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
36129
|
-
/* harmony export */
|
36131
|
+
/* harmony export */ Menu: () => (/* binding */ Menu)
|
36130
36132
|
/* harmony export */ });
|
36131
36133
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
|
36132
36134
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
|
@@ -36173,7 +36175,6 @@ Menu.propTypes = {
|
|
36173
36175
|
size: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['sm', 'md', 'lg']),
|
36174
36176
|
items: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().any)).isRequired
|
36175
36177
|
};
|
36176
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Menu);
|
36177
36178
|
|
36178
36179
|
/***/ }),
|
36179
36180
|
|
@@ -36186,7 +36187,7 @@ Menu.propTypes = {
|
|
36186
36187
|
"use strict";
|
36187
36188
|
__webpack_require__.r(__webpack_exports__);
|
36188
36189
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
36189
|
-
/* harmony export */
|
36190
|
+
/* harmony export */ MenuItem: () => (/* binding */ MenuItem)
|
36190
36191
|
/* harmony export */ });
|
36191
36192
|
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js");
|
36192
36193
|
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_0__);
|
@@ -36214,7 +36215,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
36214
36215
|
var _excluded = ["type", "text", "secondaryText", "tertiaryText", "description", "size", "children", "variant", "tag", "disabled", "selected", "subMenu", "tooltip", "isFirstItem"],
|
36215
36216
|
_excluded2 = ["isLeft"],
|
36216
36217
|
_excluded3 = ["subItems", "children"],
|
36217
|
-
_excluded4 = ["popover"];
|
36218
|
+
_excluded4 = ["popover", "onClick"];
|
36218
36219
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
36219
36220
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
36220
36221
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -36231,7 +36232,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
36231
36232
|
|
36232
36233
|
|
36233
36234
|
|
36234
|
-
var MenuItem = /*#__PURE__*/
|
36235
|
+
var MenuItem = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function (props, ref) {
|
36235
36236
|
var type = props.type,
|
36236
36237
|
text = props.text,
|
36237
36238
|
secondaryText = props.secondaryText,
|
@@ -36314,7 +36315,7 @@ MenuItem.propTypes = {
|
|
36314
36315
|
subMenu: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
36315
36316
|
tooltip: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)
|
36316
36317
|
};
|
36317
|
-
var MenuItemComp = /*#__PURE__*/
|
36318
|
+
var MenuItemComp = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function (props, ref) {
|
36318
36319
|
var subItems = props.subItems,
|
36319
36320
|
children = props.children,
|
36320
36321
|
rest = _objectWithoutProperties(props, _excluded3);
|
@@ -36342,13 +36343,19 @@ var MenuItemButton = styled_components__WEBPACK_IMPORTED_MODULE_3___default().di
|
|
36342
36343
|
}, function (props) {
|
36343
36344
|
return props['aria-disabled'] ? 'not-allowed' : 'pointer';
|
36344
36345
|
}, _theme__WEBPACK_IMPORTED_MODULE_6__["default"].color.gray_2, _theme__WEBPACK_IMPORTED_MODULE_6__["default"].color.gray_4);
|
36345
|
-
var
|
36346
|
-
var popover =
|
36347
|
-
|
36346
|
+
var MenuItemPopoverTrigger = function MenuItemPopoverTrigger(props) {
|
36347
|
+
var popover = props.popover,
|
36348
|
+
onClick = props.onClick,
|
36349
|
+
rest = _objectWithoutProperties(props, _excluded4);
|
36350
|
+
var _onClick = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (evt) {
|
36351
|
+
onClick === null || onClick === void 0 || onClick(evt);
|
36352
|
+
popover.toggle();
|
36353
|
+
}, [onClick, popover.toggle]);
|
36348
36354
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(MenuItemButton, _extends({}, rest, {
|
36349
|
-
onClick:
|
36355
|
+
onClick: _onClick
|
36350
36356
|
}));
|
36351
|
-
}
|
36357
|
+
};
|
36358
|
+
var MenuItemPopover = (0,_hoc__WEBPACK_IMPORTED_MODULE_4__.withPopover)(MenuItemPopoverTrigger, function (props) {
|
36352
36359
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_13__.MenuContainer, {
|
36353
36360
|
onClick: props.popover.hide
|
36354
36361
|
}, props.subItems);
|
@@ -36416,14 +36423,13 @@ var Description = styled_components__WEBPACK_IMPORTED_MODULE_3___default()(_typo
|
|
36416
36423
|
})(["width:100%;overflow-x:clip;text-overflow:ellipsis;"]);
|
36417
36424
|
var buildSubItems = function buildSubItems(children, itemProps) {
|
36418
36425
|
return Array.isArray(children) && children.length > 0 ? children.map(function (item, ind) {
|
36419
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_10__
|
36426
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_10__.Menu.Item, _extends({
|
36420
36427
|
key: item.key
|
36421
36428
|
}, item, itemProps, {
|
36422
36429
|
isFirstItem: ind == 0
|
36423
36430
|
}));
|
36424
36431
|
}) : undefined;
|
36425
36432
|
};
|
36426
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MenuItem);
|
36427
36433
|
|
36428
36434
|
/***/ }),
|
36429
36435
|
|