@irontec/ivoz-ui 1.7.3 → 1.7.5
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import NavigateBeforeRoundedIcon from '@mui/icons-material/NavigateBeforeRounded';
|
|
3
3
|
import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
|
|
4
4
|
import { useStoreState } from 'store';
|
|
@@ -6,6 +6,7 @@ import useCurrentPathMatch from '../../../../hooks/useCurrentPathMatch';
|
|
|
6
6
|
import useRouteChain from '../../../../hooks/useRouteChain';
|
|
7
7
|
import _ from '../../../../services/translations/translate';
|
|
8
8
|
import { StyledCollapsedBreadcrumbsLink, StyledCollapsedBreadcrumbsNavigateNextIcon, StyledCollapsedBreadcrumbsTypography, } from './styles/Links.styles';
|
|
9
|
+
import useParentRow from '../../../../hooks/useParentRow';
|
|
9
10
|
const getEntityItemLink = (routeItem, match) => {
|
|
10
11
|
var _a;
|
|
11
12
|
const baseUrl = process.env.BASE_URL || '/';
|
|
@@ -48,11 +49,30 @@ const Breadcrumbs = (props) => {
|
|
|
48
49
|
const to = routeItems.length > 0 ? getEntityItemLink(routeItem, match) : baseUrl;
|
|
49
50
|
return (_jsxs(StyledCollapsedBreadcrumbsLink, Object.assign({ className: 'back-mobile', to: to }, { children: [_jsx(NavigateBeforeRoundedIcon, {}), " ", appendSegment || title] })));
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
const breadcrumbs = [];
|
|
53
|
+
routeItems.forEach((routeItem, key) => {
|
|
54
|
+
const to = getEntityItemLink(routeItem, match);
|
|
55
|
+
const entity = routeItem.entity;
|
|
56
|
+
const isLast = key + 1 === routeItems.length;
|
|
57
|
+
const params = Object.values(match.params);
|
|
58
|
+
const entityId = params[key];
|
|
59
|
+
const element = (_jsxs("span", Object.assign({ style: { display: 'flex', gap: '12px' } }, { children: [_jsx(StyledCollapsedBreadcrumbsLink, Object.assign({ to: to }, { children: entity.title })), isLast && entity.link && !appendSegment && (_jsx("a", Object.assign({ target: '_blank', href: entity.link, rel: 'noreferrer', style: { height: '24px' } }, { children: _jsx("img", { src: 'assets/img/breadcrumb-link.svg' }) })))] }), key));
|
|
60
|
+
breadcrumbs.push(element);
|
|
61
|
+
if (isLast || !entityId) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
breadcrumbs.push(_jsx(BreadcrumbItem, { entity: entity, id: entityId }, key));
|
|
65
|
+
});
|
|
66
|
+
return (_jsxs(MuiBreadcrumbs, Object.assign({ separator: _jsx(StyledCollapsedBreadcrumbsNavigateNextIcon, {}), "aria-label": 'breadcrumb' }, { children: [breadcrumbs, appendSegment && (_jsx(StyledCollapsedBreadcrumbsTypography, { children: appendSegment }))] })));
|
|
67
|
+
};
|
|
68
|
+
const BreadcrumbItem = ({ entity, id }) => {
|
|
69
|
+
const item = useParentRow({
|
|
70
|
+
parentEntity: entity,
|
|
71
|
+
parentId: id,
|
|
72
|
+
});
|
|
73
|
+
if (!item) {
|
|
74
|
+
return _jsx(_Fragment, {});
|
|
75
|
+
}
|
|
76
|
+
return (_jsx(StyledCollapsedBreadcrumbsTypography, { children: entity.toStr(item) }));
|
|
57
77
|
};
|
|
58
78
|
export default Breadcrumbs;
|
|
@@ -23,9 +23,7 @@ export default function ConfirmDialog(props) {
|
|
|
23
23
|
setInputVal(val || '');
|
|
24
24
|
}, []);
|
|
25
25
|
const handleKeyDown = (event) => {
|
|
26
|
-
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
}
|
|
26
|
+
event.stopPropagation();
|
|
29
27
|
};
|
|
30
28
|
const sumbitEnabled = !doubleCheck || inputVal == doubleCheckExpectedStr;
|
|
31
29
|
return (_jsxs(Dialog, Object.assign({ open: open, TransitionComponent: Transition, keepMounted: true, onClose: handleClose, "aria-labelledby": 'alert-dialog-slide-title', "aria-describedby": 'alert-dialog-slide-description', onKeyDown: handleKeyDown }, { children: [_jsx(CloseRoundedIcon, { className: 'close-icon', onClick: handleClose }), _jsx("img", { src: 'assets/img/delete-dialog.svg', className: 'modal-icon' }), _jsx(DialogTitle, Object.assign({ id: 'alert-dialog-slide-title' }, { children: _('Remove element') })), _jsxs(DialogContent, { children: [_jsx(DialogContentText, Object.assign({ id: 'alert-dialog-slide-description' }, { children: text })), doubleCheck && (_jsx(StyledDialogContentText, Object.assign({ id: 'alert-dialog-double-check-description' }, { children: _('Please type the item name, as shown in bold font above, to continue') }))), doubleCheck && (_jsx(StyledSearchTextField, { type: 'text', hasChanged: false, defaultValue: inputVal, onChange: onChangeHandler }))] }), _jsxs(DialogActions, { children: [_jsx(OutlinedButton, Object.assign({ onClick: handleClose, sx: { flexGrow: '1' }, color: 'error' }, { children: _('No, keep it') })), _jsx(SolidButton, Object.assign({ disabled: !sumbitEnabled, onClick: handleApply, sx: { flexGrow: '1' }, color: 'error' }, { children: _('Yes, delete it') }))] })] })));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ListContent } from '../../components/List/Content/';
|
|
3
3
|
const List = (props) => {
|
|
4
|
-
return
|
|
4
|
+
return _jsx(ListContent, Object.assign({}, props));
|
|
5
5
|
};
|
|
6
6
|
export default List;
|