@itilite/iui-user-management 0.4.10 → 0.4.11
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/index.css +111 -0
- package/dist/index.js +118 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +118 -4
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -14,6 +14,8 @@ import { withStyles, makeStyles } from '@material-ui/core/styles';
|
|
|
14
14
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
15
15
|
import Switch from '@material-ui/core/Switch';
|
|
16
16
|
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
17
|
+
import Button from '@material-ui/core/Button';
|
|
18
|
+
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography } from '@material-ui/core';
|
|
17
19
|
import InfoIcon from '@material-ui/icons/Info';
|
|
18
20
|
|
|
19
21
|
function _extends() {
|
|
@@ -1681,7 +1683,6 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1681
1683
|
var _res$data;
|
|
1682
1684
|
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Opps, Something went wrong.');
|
|
1683
1685
|
dispatch(stopLoader());
|
|
1684
|
-
reject();
|
|
1685
1686
|
}
|
|
1686
1687
|
})["catch"](function (err) {
|
|
1687
1688
|
reject(err);
|
|
@@ -1824,11 +1825,9 @@ var createUser = function createUser(payload) {
|
|
|
1824
1825
|
} else {
|
|
1825
1826
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1826
1827
|
reject(res.data.errors);
|
|
1827
|
-
return;
|
|
1828
1828
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1829
1829
|
IUIToastMessageService.warningNotify(res.data.message);
|
|
1830
1830
|
}
|
|
1831
|
-
reject();
|
|
1832
1831
|
}
|
|
1833
1832
|
})["catch"](function (err) {
|
|
1834
1833
|
var _err$response5;
|
|
@@ -7438,6 +7437,121 @@ var BulkDownloadIcon = function BulkDownloadIcon(props) {
|
|
|
7438
7437
|
}));
|
|
7439
7438
|
};
|
|
7440
7439
|
|
|
7440
|
+
var classes = {"containedBtn":"_2A4_u","customMiniBox":"_QGIKG","muiBtn":"_3iFbO","outlinedBtn":"_3lQYD","menuList":"_1C8bJ","menuListContainer":"_1N83W","menuItemContainer":"_3VtcE","menuItemtext":"_2xqnU","subTxt":"_3CVzX"};
|
|
7441
|
+
|
|
7442
|
+
var DropdownBtn = function DropdownBtn(props) {
|
|
7443
|
+
var _clsx;
|
|
7444
|
+
var _props$buttonText = props.buttonText,
|
|
7445
|
+
buttonText = _props$buttonText === void 0 ? '' : _props$buttonText,
|
|
7446
|
+
_props$disableRipple = props.disableRipple,
|
|
7447
|
+
disableRipple = _props$disableRipple === void 0 ? true : _props$disableRipple,
|
|
7448
|
+
_props$onClickHandler = props.onClickHandler,
|
|
7449
|
+
onClickHandler = _props$onClickHandler === void 0 ? function () {} : _props$onClickHandler,
|
|
7450
|
+
_props$menuListInfo = props.menuListInfo,
|
|
7451
|
+
menuListInfo = _props$menuListInfo === void 0 ? [] : _props$menuListInfo,
|
|
7452
|
+
_props$endIcon = props.endIcon,
|
|
7453
|
+
endIcon = _props$endIcon === void 0 ? /*#__PURE__*/React.createElement(ExpandMoreIcon, {
|
|
7454
|
+
width: "10",
|
|
7455
|
+
height: "10"
|
|
7456
|
+
}) : _props$endIcon,
|
|
7457
|
+
_props$outlinedBtn = props.outlinedBtn,
|
|
7458
|
+
outlinedBtn = _props$outlinedBtn === void 0 ? true : _props$outlinedBtn,
|
|
7459
|
+
_props$placement = props.placement,
|
|
7460
|
+
placement = _props$placement === void 0 ? 'auto-center' : _props$placement,
|
|
7461
|
+
className = props.className,
|
|
7462
|
+
menuListClass = props.menuListClass;
|
|
7463
|
+
var _React$useState = React.useState(false),
|
|
7464
|
+
open = _React$useState[0],
|
|
7465
|
+
setOpen = _React$useState[1];
|
|
7466
|
+
var anchorRef = React.useRef(null);
|
|
7467
|
+
var handleToggle = function handleToggle() {
|
|
7468
|
+
setOpen(function (prevOpen) {
|
|
7469
|
+
return !prevOpen;
|
|
7470
|
+
});
|
|
7471
|
+
};
|
|
7472
|
+
var handleClose = function handleClose(event) {
|
|
7473
|
+
if (anchorRef.current && anchorRef.current.contains(event.target)) {
|
|
7474
|
+
return;
|
|
7475
|
+
}
|
|
7476
|
+
setOpen(false);
|
|
7477
|
+
onClickHandler(event);
|
|
7478
|
+
};
|
|
7479
|
+
var handleListKeyDown = function handleListKeyDown(event) {
|
|
7480
|
+
if (event.key === 'Tab') {
|
|
7481
|
+
event.preventDefault();
|
|
7482
|
+
setOpen(false);
|
|
7483
|
+
}
|
|
7484
|
+
};
|
|
7485
|
+
var handleMenuClick = function handleMenuClick(val) {
|
|
7486
|
+
setOpen(false);
|
|
7487
|
+
if (val.disable) return false;
|
|
7488
|
+
if (val.handler && typeof val.handler === 'function') val.handler();
|
|
7489
|
+
};
|
|
7490
|
+
|
|
7491
|
+
var prevOpen = React.useRef(open);
|
|
7492
|
+
React.useEffect(function () {
|
|
7493
|
+
if (prevOpen.current === true && open === false) {
|
|
7494
|
+
anchorRef.current.focus();
|
|
7495
|
+
}
|
|
7496
|
+
prevOpen.current = open;
|
|
7497
|
+
}, [open]);
|
|
7498
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
7499
|
+
endIcon: endIcon,
|
|
7500
|
+
className: clsx(classes.muiBtn, className, (_clsx = {}, _clsx[classes.outlinedBtn] = outlinedBtn, _clsx)),
|
|
7501
|
+
disableRipple: disableRipple,
|
|
7502
|
+
variant: "outlined",
|
|
7503
|
+
ref: anchorRef,
|
|
7504
|
+
"aria-controls": open ? 'menu-list-grow' : undefined,
|
|
7505
|
+
"aria-haspopup": "true",
|
|
7506
|
+
onClick: handleToggle
|
|
7507
|
+
}, buttonText), /*#__PURE__*/React.createElement(Popper, {
|
|
7508
|
+
open: open,
|
|
7509
|
+
anchorEl: anchorRef.current,
|
|
7510
|
+
role: undefined,
|
|
7511
|
+
transition: true,
|
|
7512
|
+
disablePortal: true,
|
|
7513
|
+
style: {
|
|
7514
|
+
zIndex: '9'
|
|
7515
|
+
},
|
|
7516
|
+
placement: placement
|
|
7517
|
+
}, function (_ref) {
|
|
7518
|
+
var _clsx2;
|
|
7519
|
+
var TransitionProps = _ref.TransitionProps,
|
|
7520
|
+
placement = _ref.placement;
|
|
7521
|
+
return /*#__PURE__*/React.createElement(Grow, _extends({}, TransitionProps, {
|
|
7522
|
+
style: {
|
|
7523
|
+
transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
|
|
7524
|
+
}
|
|
7525
|
+
}), /*#__PURE__*/React.createElement(Paper, {
|
|
7526
|
+
className: classes.menuListContainer,
|
|
7527
|
+
elevation: 0
|
|
7528
|
+
}, /*#__PURE__*/React.createElement(ClickAwayListener, {
|
|
7529
|
+
onClickAway: handleClose
|
|
7530
|
+
}, /*#__PURE__*/React.createElement(MenuList, {
|
|
7531
|
+
autoFocusItem: open,
|
|
7532
|
+
className: clsx(classes.menuList, (_clsx2 = {}, _clsx2[classes.outlinedBtn] = outlinedBtn, _clsx2), menuListClass),
|
|
7533
|
+
id: "menu-list-grow",
|
|
7534
|
+
onKeyDown: function onKeyDown(e) {
|
|
7535
|
+
return handleListKeyDown(e);
|
|
7536
|
+
}
|
|
7537
|
+
}, menuListInfo.map(function (val, _i) {
|
|
7538
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
7539
|
+
onClick: function onClick() {
|
|
7540
|
+
return handleMenuClick(val);
|
|
7541
|
+
},
|
|
7542
|
+
key: _i,
|
|
7543
|
+
className: clsx(classes.menuItemContainer, val.disable && 'iui__cursor-not-allowed'),
|
|
7544
|
+
disableRipple: true
|
|
7545
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
7546
|
+
className: clsx(classes.menuItemtext, val && val.disable && 'iui__opacity--60')
|
|
7547
|
+
}, val.label), val.subText && /*#__PURE__*/React.createElement(IUITypography, {
|
|
7548
|
+
variant: "subtitle2",
|
|
7549
|
+
className: clsx(classes.menuItemtext, classes.subTxt)
|
|
7550
|
+
}, val.subText));
|
|
7551
|
+
})))));
|
|
7552
|
+
}));
|
|
7553
|
+
};
|
|
7554
|
+
|
|
7441
7555
|
var AntSwitch = withStyles(function (theme) {
|
|
7442
7556
|
return {
|
|
7443
7557
|
root: {
|
|
@@ -7678,7 +7792,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
7678
7792
|
style: {
|
|
7679
7793
|
marginLeft: '50px'
|
|
7680
7794
|
}
|
|
7681
|
-
}, /*#__PURE__*/React.createElement(
|
|
7795
|
+
}, /*#__PURE__*/React.createElement(DropdownBtn, {
|
|
7682
7796
|
buttonText: /*#__PURE__*/React.createElement(MoreHorizIcon, {
|
|
7683
7797
|
fontSize: "medium",
|
|
7684
7798
|
color: "#6B7280"
|