@irontec/ivoz-ui 1.7.5 → 1.7.8
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.
|
@@ -2,9 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
export const CircleChart = (props) => {
|
|
3
3
|
const { data, width = 250, height = 250, offsetX = 125, offsetY = 125, radio = 110, } = props;
|
|
4
4
|
const circumference = Math.PI * 2 * radio;
|
|
5
|
+
let cumulativeOffset = 0;
|
|
5
6
|
return (_jsx("svg", Object.assign({ width: width, height: height, style: { display: 'flex' } }, { children: data.map((circleData, index) => {
|
|
6
7
|
const circlePercentage = parseFloat(circleData.percentage.replace('%', ''));
|
|
7
8
|
const segmentLength = (circumference * circlePercentage) / 100;
|
|
8
|
-
|
|
9
|
+
const strokeDasharray = `${segmentLength} ${circumference - segmentLength}`;
|
|
10
|
+
const strokeDashoffset = cumulativeOffset;
|
|
11
|
+
cumulativeOffset -= segmentLength;
|
|
12
|
+
return (_jsx("circle", { cx: offsetX, cy: offsetY, r: radio, fill: 'transparent', stroke: circleData.color, strokeWidth: '25', strokeDasharray: strokeDasharray, strokeDashoffset: strokeDashoffset }, `${circleData.color}-${index}`));
|
|
9
13
|
}) })));
|
|
10
14
|
};
|
|
@@ -7,6 +7,7 @@ import useRouteChain from '../../../../hooks/useRouteChain';
|
|
|
7
7
|
import _ from '../../../../services/translations/translate';
|
|
8
8
|
import { StyledCollapsedBreadcrumbsLink, StyledCollapsedBreadcrumbsNavigateNextIcon, StyledCollapsedBreadcrumbsTypography, } from './styles/Links.styles';
|
|
9
9
|
import useParentRow from '../../../../hooks/useParentRow';
|
|
10
|
+
import { useTranslation } from 'react-i18next';
|
|
10
11
|
const getEntityItemLink = (routeItem, match) => {
|
|
11
12
|
var _a;
|
|
12
13
|
const baseUrl = process.env.BASE_URL || '/';
|
|
@@ -21,6 +22,7 @@ const Breadcrumbs = (props) => {
|
|
|
21
22
|
const { routeMap, desktop = true } = props;
|
|
22
23
|
const match = useCurrentPathMatch();
|
|
23
24
|
const formRow = useStoreState((state) => state.form.row);
|
|
25
|
+
const { i18n } = useTranslation();
|
|
24
26
|
const routeItems = useRouteChain({
|
|
25
27
|
routeMap,
|
|
26
28
|
match,
|
|
@@ -56,7 +58,8 @@ const Breadcrumbs = (props) => {
|
|
|
56
58
|
const isLast = key + 1 === routeItems.length;
|
|
57
59
|
const params = Object.values(match.params);
|
|
58
60
|
const entityId = params[key];
|
|
59
|
-
const
|
|
61
|
+
const currentLang = i18n.resolvedLanguage;
|
|
62
|
+
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.replace('${language}', currentLang || 'en'), rel: 'noreferrer', style: { height: '24px' } }, { children: _jsx("img", { src: 'assets/img/breadcrumb-link.svg' }) })))] }), key));
|
|
60
63
|
breadcrumbs.push(element);
|
|
61
64
|
if (isLast || !entityId) {
|
|
62
65
|
return;
|