datastake-daf 0.6.371 → 0.6.372
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/.env +8 -0
- package/.vscode/settings.json +13 -0
- package/dist/components/index.js +93 -178
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/ColumnChart/ColumnChart.stories.jsx +0 -28
- package/src/@daf/core/components/Graphs/StakeholderMappings/index.jsx +5 -51
- package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +37 -40
- package/src/@daf/core/components/Graphs/components/Edges/DefaultEdge.jsx +11 -22
- package/src/@daf/core/components/Graphs/components/Edges/TooltipEdge.jsx +12 -24
- package/src/@daf/core/components/Graphs/components/Nodes/NameNode.jsx +33 -51
- package/src/@daf/core/components/Graphs/components/Nodes/PrimaryNode.jsx +6 -19
package/.env
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": ["cukura"],
|
|
3
|
+
"files.autoSave": "afterDelay",
|
|
4
|
+
"editor.wordWrap": "on",
|
|
5
|
+
"editor.autoClosingBrackets": "always",
|
|
6
|
+
"editor.autoClosingComments": "always",
|
|
7
|
+
"editor.autoClosingQuotes": "always",
|
|
8
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
9
|
+
"editor.formatOnPaste": true,
|
|
10
|
+
"editor.formatOnSave": true,
|
|
11
|
+
"notebook.defaultFormatter": "esbenp.prettier-vscode",
|
|
12
|
+
"javascript.format.semicolons": "insert"
|
|
13
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -12668,7 +12668,7 @@ const {
|
|
|
12668
12668
|
Paragraph: Paragraph$1
|
|
12669
12669
|
} = antd.Typography;
|
|
12670
12670
|
const checkHasActiveFilterValues = filtersConfig => {
|
|
12671
|
-
if (!
|
|
12671
|
+
if (!filtersConfig?.filtersConfig || !filtersConfig?.selectedFilters) return false;
|
|
12672
12672
|
const filterConfigKeys = Object.keys(filtersConfig.filtersConfig);
|
|
12673
12673
|
const selectedFilters = filtersConfig.selectedFilters;
|
|
12674
12674
|
return filterConfigKeys.some(key => {
|
|
@@ -12676,28 +12676,27 @@ const checkHasActiveFilterValues = filtersConfig => {
|
|
|
12676
12676
|
return value !== undefined && value !== null && value !== "";
|
|
12677
12677
|
});
|
|
12678
12678
|
};
|
|
12679
|
-
const useHeader =
|
|
12680
|
-
|
|
12681
|
-
|
|
12682
|
-
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
const hasActiveFilterValues = React.useMemo(() => checkHasActiveFilterValues(filtersConfig), [filtersConfig === null || filtersConfig === void 0 ? void 0 : filtersConfig.filtersConfig, filtersConfig === null || filtersConfig === void 0 ? void 0 : filtersConfig.selectedFilters]);
|
|
12679
|
+
const useHeader = ({
|
|
12680
|
+
title = "",
|
|
12681
|
+
tooltip = "",
|
|
12682
|
+
supportText = "",
|
|
12683
|
+
tags = [],
|
|
12684
|
+
actionButtons: _actionButtons = [],
|
|
12685
|
+
titleTooltip,
|
|
12686
|
+
className,
|
|
12687
|
+
addedHeader = null,
|
|
12688
|
+
addedHeaderFirst,
|
|
12689
|
+
extraButtons: _extraButtons = [],
|
|
12690
|
+
onDownload,
|
|
12691
|
+
downloadDisabled,
|
|
12692
|
+
goBackTo,
|
|
12693
|
+
loading,
|
|
12694
|
+
renderExtraComponents,
|
|
12695
|
+
app = "",
|
|
12696
|
+
isViewMode = false,
|
|
12697
|
+
filtersConfig = {}
|
|
12698
|
+
}) => {
|
|
12699
|
+
const hasActiveFilterValues = React.useMemo(() => checkHasActiveFilterValues(filtersConfig), [filtersConfig?.filtersConfig, filtersConfig?.selectedFilters]);
|
|
12701
12700
|
const [showFilters, setShowFilters] = React.useState(() => checkHasActiveFilterValues(filtersConfig));
|
|
12702
12701
|
const hasFilters = filtersConfig && Object.keys(filtersConfig).length > 0;
|
|
12703
12702
|
React.useEffect(() => {
|
|
@@ -12739,9 +12738,9 @@ const useHeader = _ref => {
|
|
|
12739
12738
|
const buttonCont = React.useRef();
|
|
12740
12739
|
const [mainContWidth, setMainContWidth] = React.useState(600);
|
|
12741
12740
|
const [buttonContWidth, setButtonContWidth] = React.useState(0);
|
|
12742
|
-
const hasSupportText = !!
|
|
12743
|
-
const hasTags = !!
|
|
12744
|
-
const hasButtons = React.useMemo(() => !!(actionButtons
|
|
12741
|
+
const hasSupportText = !!supportText?.length;
|
|
12742
|
+
const hasTags = !!tags?.length;
|
|
12743
|
+
const hasButtons = React.useMemo(() => !!(actionButtons?.length || extraButtons?.length), [actionButtons, extraButtons]);
|
|
12745
12744
|
React.useEffect(() => {
|
|
12746
12745
|
const mainContObserver = new ResizeObserver(entries => {
|
|
12747
12746
|
const _mainEntry = entries[0];
|
|
@@ -51013,14 +51012,12 @@ function DualAxesChart(_ref) {
|
|
|
51013
51012
|
});
|
|
51014
51013
|
}
|
|
51015
51014
|
|
|
51016
|
-
// components/Nodes/PrimaryNode.jsx
|
|
51017
51015
|
const MAIN_NODE_WIDTH = 300;
|
|
51018
51016
|
const MAIN_NODE_HEIGHT = 150;
|
|
51019
51017
|
function PrimaryNode({
|
|
51020
51018
|
id,
|
|
51021
51019
|
data
|
|
51022
51020
|
}) {
|
|
51023
|
-
const isPdf = data?.isPdf; // Get isPdf from data prop
|
|
51024
51021
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51025
51022
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
|
|
51026
51023
|
type: "source",
|
|
@@ -51039,9 +51036,8 @@ function PrimaryNode({
|
|
|
51039
51036
|
opacity: 0
|
|
51040
51037
|
}
|
|
51041
51038
|
}), /*#__PURE__*/jsxRuntime.jsxs(Style$f, {
|
|
51042
|
-
$isPdf: isPdf,
|
|
51043
51039
|
className: "flex",
|
|
51044
|
-
children: [
|
|
51040
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51045
51041
|
className: "left flex flex-column justify-center",
|
|
51046
51042
|
style: {
|
|
51047
51043
|
background: data.backgroundColor || "#ade9e1",
|
|
@@ -51151,20 +51147,13 @@ function PrimaryNode({
|
|
|
51151
51147
|
}
|
|
51152
51148
|
const Style$f = dt.div`
|
|
51153
51149
|
width: ${MAIN_NODE_WIDTH}px;
|
|
51154
|
-
height: ${MAIN_NODE_HEIGHT}px; /* Explicitly set height */
|
|
51155
51150
|
display: flex;
|
|
51156
51151
|
background: white;
|
|
51157
51152
|
border-radius: 8px;
|
|
51153
|
+
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
51154
|
+
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
51158
51155
|
overflow: hidden;
|
|
51159
|
-
|
|
51160
|
-
${props => props.$isPdf ? `
|
|
51161
|
-
border: 1px solid var(--base-gray-30); /* Ensure a visible border in PDF */
|
|
51162
|
-
box-shadow: none; /* Remove shadow for PDF */
|
|
51163
|
-
` : `
|
|
51164
|
-
box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
|
|
51165
|
-
`}
|
|
51166
|
-
-webkit-print-color-adjust: exact;
|
|
51167
|
-
print-color-adjust: exact;
|
|
51156
|
+
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
51168
51157
|
|
|
51169
51158
|
.left {
|
|
51170
51159
|
width: 32px;
|
|
@@ -51256,8 +51245,7 @@ PrimaryNode.propTypes = {
|
|
|
51256
51245
|
icon: PropTypes__default["default"].string,
|
|
51257
51246
|
backgroundColor: PropTypes__default["default"].string,
|
|
51258
51247
|
totalSources: PropTypes__default["default"].number,
|
|
51259
|
-
onClick: PropTypes__default["default"].func
|
|
51260
|
-
isPdf: PropTypes__default["default"].bool
|
|
51248
|
+
onClick: PropTypes__default["default"].func
|
|
51261
51249
|
})
|
|
51262
51250
|
};
|
|
51263
51251
|
|
|
@@ -51378,9 +51366,7 @@ const Style$e = dt.div`
|
|
|
51378
51366
|
}
|
|
51379
51367
|
`;
|
|
51380
51368
|
|
|
51381
|
-
// components/Nodes/NameNode.jsx
|
|
51382
51369
|
const NAME_CARD_WIDTH = 315;
|
|
51383
|
-
const NAME_CARD_HEIGHT = 37;
|
|
51384
51370
|
const {
|
|
51385
51371
|
useToken: useToken$7
|
|
51386
51372
|
} = antd.theme;
|
|
@@ -51391,7 +51377,6 @@ function NameNode({
|
|
|
51391
51377
|
token
|
|
51392
51378
|
} = useToken$7();
|
|
51393
51379
|
const translateFN = typeof data?.t === "function" ? data.t : key => key;
|
|
51394
|
-
const isPdf = data?.isPdf;
|
|
51395
51380
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51396
51381
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
|
|
51397
51382
|
type: "source",
|
|
@@ -51410,7 +51395,6 @@ function NameNode({
|
|
|
51410
51395
|
opacity: 0
|
|
51411
51396
|
}
|
|
51412
51397
|
}), /*#__PURE__*/jsxRuntime.jsxs(Style$d, {
|
|
51413
|
-
$isPdf: isPdf,
|
|
51414
51398
|
style: {
|
|
51415
51399
|
opacity: data.isEmpty ? 0.5 : 1
|
|
51416
51400
|
},
|
|
@@ -51461,7 +51445,7 @@ function NameNode({
|
|
|
51461
51445
|
}
|
|
51462
51446
|
})
|
|
51463
51447
|
}) : null]
|
|
51464
|
-
}),
|
|
51448
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51465
51449
|
style: {
|
|
51466
51450
|
marginLeft: "auto"
|
|
51467
51451
|
},
|
|
@@ -51498,35 +51482,27 @@ function NameNode({
|
|
|
51498
51482
|
});
|
|
51499
51483
|
}
|
|
51500
51484
|
const Style$d = dt.div`
|
|
51501
|
-
|
|
51502
|
-
|
|
51503
|
-
|
|
51504
|
-
|
|
51505
|
-
|
|
51506
|
-
|
|
51507
|
-
|
|
51508
|
-
|
|
51509
|
-
box-shadow: none;
|
|
51510
|
-
` : `
|
|
51511
|
-
box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
|
|
51512
|
-
`}
|
|
51513
|
-
-webkit-print-color-adjust: exact;
|
|
51514
|
-
print-color-adjust: exact;
|
|
51485
|
+
width: ${NAME_CARD_WIDTH}px;
|
|
51486
|
+
display: flex;
|
|
51487
|
+
background: white;
|
|
51488
|
+
border-radius: 8px;
|
|
51489
|
+
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
51490
|
+
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
51491
|
+
overflow: hidden;
|
|
51492
|
+
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
51515
51493
|
|
|
51516
|
-
|
|
51517
|
-
|
|
51518
|
-
|
|
51519
|
-
|
|
51520
|
-
|
|
51521
|
-
|
|
51494
|
+
.left {
|
|
51495
|
+
width: 32px;
|
|
51496
|
+
background: red;
|
|
51497
|
+
border-top-left-radius: 12px;
|
|
51498
|
+
border-bottom-left-radius: 12px;
|
|
51499
|
+
}
|
|
51522
51500
|
|
|
51523
|
-
|
|
51524
|
-
|
|
51525
|
-
|
|
51526
|
-
|
|
51527
|
-
|
|
51528
|
-
border-bottom: none;
|
|
51529
|
-
}
|
|
51501
|
+
.right {
|
|
51502
|
+
padding: 16px 12px;
|
|
51503
|
+
width: 100%
|
|
51504
|
+
border-bottom: 1px solid var(--base-gray-30);
|
|
51505
|
+
}
|
|
51530
51506
|
`;
|
|
51531
51507
|
|
|
51532
51508
|
const Style$c = dt.div`
|
|
@@ -51752,7 +51728,6 @@ function ExpandedNode({
|
|
|
51752
51728
|
});
|
|
51753
51729
|
}
|
|
51754
51730
|
|
|
51755
|
-
// components/Edges/TooltipEdge.jsx
|
|
51756
51731
|
function ToolTipEdge({
|
|
51757
51732
|
sourceX,
|
|
51758
51733
|
sourceY,
|
|
@@ -51762,20 +51737,7 @@ function ToolTipEdge({
|
|
|
51762
51737
|
data,
|
|
51763
51738
|
targetPosition
|
|
51764
51739
|
}) {
|
|
51765
|
-
const {
|
|
51766
|
-
isOnlyOne,
|
|
51767
|
-
isPdf
|
|
51768
|
-
} = data; // Destructure isPdf from data
|
|
51769
|
-
|
|
51770
|
-
const [edgePath] = isPdf && isOnlyOne // Condition for straight path in PDF for single nodes
|
|
51771
|
-
? react.getStraightPath({
|
|
51772
|
-
sourceX,
|
|
51773
|
-
sourceY,
|
|
51774
|
-
sourcePosition,
|
|
51775
|
-
targetX,
|
|
51776
|
-
targetY,
|
|
51777
|
-
targetPosition
|
|
51778
|
-
}) : react.getSmoothStepPath({
|
|
51740
|
+
const [smoothPath] = react.getSmoothStepPath({
|
|
51779
51741
|
sourceX,
|
|
51780
51742
|
sourceY,
|
|
51781
51743
|
sourcePosition,
|
|
@@ -51792,8 +51754,8 @@ function ToolTipEdge({
|
|
|
51792
51754
|
});
|
|
51793
51755
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51794
51756
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.BaseEdge, {
|
|
51795
|
-
path:
|
|
51796
|
-
}),
|
|
51757
|
+
path: smoothPath
|
|
51758
|
+
}), /*#__PURE__*/jsxRuntime.jsx(react.EdgeLabelRenderer, {
|
|
51797
51759
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51798
51760
|
className: "button-edge__label nodrag nopan",
|
|
51799
51761
|
style: {
|
|
@@ -51991,7 +51953,6 @@ function VerticalPathEdge({
|
|
|
51991
51953
|
});
|
|
51992
51954
|
}
|
|
51993
51955
|
|
|
51994
|
-
// components/Edges/DefaultEdge.jsx
|
|
51995
51956
|
const ACTIVE_OPACITY = 1;
|
|
51996
51957
|
const DISABLED_OPACITY = 0.5;
|
|
51997
51958
|
const EDGE_STROKE = "#9DA4AE";
|
|
@@ -52011,22 +51972,12 @@ function DefaultEdge({
|
|
|
52011
51972
|
associatedNodes = [],
|
|
52012
51973
|
renderTooltipItems = () => [],
|
|
52013
51974
|
getTotal = () => 0,
|
|
52014
|
-
tooltipTitle
|
|
52015
|
-
isPdf // Destructure isPdf from data
|
|
51975
|
+
tooltipTitle
|
|
52016
51976
|
} = data;
|
|
52017
51977
|
const isSelected = associatedNodes?.includes(source) && associatedNodes?.includes(target) && activeNode;
|
|
52018
51978
|
const opacity = activeNode ? isSelected ? ACTIVE_OPACITY : DISABLED_OPACITY : ACTIVE_OPACITY;
|
|
52019
51979
|
const arrowHeadId = `arrow-head-${id}`;
|
|
52020
|
-
const [edgePath] =
|
|
52021
|
-
? react.getStraightPath({
|
|
52022
|
-
sourceX,
|
|
52023
|
-
sourceY,
|
|
52024
|
-
sourcePosition: data.type === "left" ? react.Position.Left : react.Position.Right,
|
|
52025
|
-
targetX,
|
|
52026
|
-
targetY,
|
|
52027
|
-
targetPosition: data.type === "left" ? react.Position.Right : react.Position.Left
|
|
52028
|
-
}) : react.getSmoothStepPath({
|
|
52029
|
-
// Use smooth path for normal rendering
|
|
51980
|
+
const [edgePath] = react.getSmoothStepPath({
|
|
52030
51981
|
sourceX,
|
|
52031
51982
|
sourceY,
|
|
52032
51983
|
targetX,
|
|
@@ -52126,7 +52077,6 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52126
52077
|
t,
|
|
52127
52078
|
withDuration = true,
|
|
52128
52079
|
onFilterChange,
|
|
52129
|
-
isPdf,
|
|
52130
52080
|
...props
|
|
52131
52081
|
}, ref) {
|
|
52132
52082
|
const {
|
|
@@ -52183,7 +52133,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52183
52133
|
duration: withDuration ? 300 : undefined
|
|
52184
52134
|
},
|
|
52185
52135
|
...props,
|
|
52186
|
-
children:
|
|
52136
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
52187
52137
|
position: "bottom-right",
|
|
52188
52138
|
showFitView: false,
|
|
52189
52139
|
showInteractive: false,
|
|
@@ -52700,8 +52650,7 @@ function positionDataNodes(_ref2) {
|
|
|
52700
52650
|
total,
|
|
52701
52651
|
mainNode,
|
|
52702
52652
|
type,
|
|
52703
|
-
hasContent
|
|
52704
|
-
isPdf
|
|
52653
|
+
hasContent
|
|
52705
52654
|
} = _ref2;
|
|
52706
52655
|
const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
|
|
52707
52656
|
const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
|
|
@@ -52719,40 +52668,19 @@ function positionDataNodes(_ref2) {
|
|
|
52719
52668
|
}
|
|
52720
52669
|
return DEFAULT_SIBLING_SPACE;
|
|
52721
52670
|
};
|
|
52722
|
-
siblingSpace();
|
|
52671
|
+
const Y_SPACE_FROM_SIBLINGS = siblingSpace();
|
|
52723
52672
|
const X_SPACE_FROM_ICON_NODE = 130;
|
|
52724
|
-
|
|
52725
|
-
|
|
52726
|
-
const
|
|
52727
|
-
|
|
52728
|
-
|
|
52729
|
-
|
|
52730
|
-
|
|
52731
|
-
|
|
52732
|
-
|
|
52733
|
-
|
|
52734
|
-
|
|
52735
|
-
return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
|
|
52736
|
-
}
|
|
52737
|
-
return DEFAULT_PRIMARY_NODE_SPACE;
|
|
52738
|
-
}
|
|
52739
|
-
if ((iconNode === null || iconNode === void 0 || (_iconNode$data2 = iconNode.data) === null || _iconNode$data2 === void 0 || (_iconNode$data2 = _iconNode$data2.children) === null || _iconNode$data2 === void 0 ? void 0 : _iconNode$data2.length) === 0) {
|
|
52740
|
-
return NO_CHILDREN_SIBLING_SPACE;
|
|
52741
|
-
}
|
|
52742
|
-
return DEFAULT_SIBLING_SPACE;
|
|
52743
|
-
};
|
|
52744
|
-
const Y_SPACE_FROM_SIBLINGS = siblingSpace();
|
|
52745
|
-
const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
|
|
52746
|
-
const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
52747
|
-
const startY = iconNodeHandleCenterY - totalHeight / 2;
|
|
52748
|
-
const END_Y = startY + totalHeight;
|
|
52749
|
-
const yOffset = index * MIN_SPACE_REQUIRED;
|
|
52750
|
-
yPosition = startY + yOffset;
|
|
52751
|
-
if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52752
|
-
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
|
|
52753
|
-
} else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52754
|
-
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
|
|
52755
|
-
}
|
|
52673
|
+
const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
|
|
52674
|
+
const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
52675
|
+
const iconNodeCenterY = iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
|
|
52676
|
+
const startY = iconNodeCenterY - totalHeight / 2;
|
|
52677
|
+
const END_Y = startY + totalHeight;
|
|
52678
|
+
const yOffset = index * MIN_SPACE_REQUIRED;
|
|
52679
|
+
let yPosition = startY + yOffset;
|
|
52680
|
+
if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52681
|
+
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
|
|
52682
|
+
} else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52683
|
+
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
|
|
52756
52684
|
}
|
|
52757
52685
|
return {
|
|
52758
52686
|
x: isLeftSide ? iconNode.position.x - (DATA_NODE_WIDTH + X_SPACE_FROM_ICON_NODE) : iconNode.position.x + (X_SPACE_FROM_ICON_NODE + ICON_NODE_WIDTH),
|
|
@@ -52798,8 +52726,7 @@ function StakeholderMappings(_ref3) {
|
|
|
52798
52726
|
isEmpty: true,
|
|
52799
52727
|
name: emptyString,
|
|
52800
52728
|
icon: (data === null || data === void 0 ? void 0 : data.icon) || "DashboardStakeholder",
|
|
52801
|
-
t: t
|
|
52802
|
-
isPdf: isPdf
|
|
52729
|
+
t: t
|
|
52803
52730
|
},
|
|
52804
52731
|
position: {
|
|
52805
52732
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -52821,8 +52748,7 @@ function StakeholderMappings(_ref3) {
|
|
|
52821
52748
|
onClick: (data === null || data === void 0 ? void 0 : data.onClick) || undefined,
|
|
52822
52749
|
totalSources: data === null || data === void 0 ? void 0 : data.totalSources,
|
|
52823
52750
|
backgroundColor: (data === null || data === void 0 ? void 0 : data.backgroundColor) || "#ade9e1",
|
|
52824
|
-
iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a"
|
|
52825
|
-
isPdf: isPdf
|
|
52751
|
+
iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a"
|
|
52826
52752
|
},
|
|
52827
52753
|
position: {
|
|
52828
52754
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -52872,13 +52798,11 @@ function StakeholderMappings(_ref3) {
|
|
|
52872
52798
|
setSelectedIconNodes(openIconNOdes.map(node => node.id));
|
|
52873
52799
|
}
|
|
52874
52800
|
const dataNodes = openIconNOdes.flatMap(node => {
|
|
52875
|
-
var _node$data, _node$data2;
|
|
52876
52801
|
const children = node.data.children || [];
|
|
52877
52802
|
const total = (children === null || children === void 0 ? void 0 : children.length) || 0;
|
|
52878
52803
|
const iconNodeId = node.id;
|
|
52879
|
-
(node === null || node === void 0 || (_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data.content) !== undefined && (node === null || node === void 0 || (_node$data2 = node.data) === null || _node$data2 === void 0 ? void 0 : _node$data2.content) !== null;
|
|
52880
52804
|
if (children.length === 0) {
|
|
52881
|
-
var _node$
|
|
52805
|
+
var _node$data, _node$data2, _node$data3, _node$data4, _node$data5;
|
|
52882
52806
|
iconEdges.push({
|
|
52883
52807
|
id: "".concat(node.id, "-empty"),
|
|
52884
52808
|
source: node.id,
|
|
@@ -52886,8 +52810,7 @@ function StakeholderMappings(_ref3) {
|
|
|
52886
52810
|
type: "tooltipEdge",
|
|
52887
52811
|
data: {
|
|
52888
52812
|
isEmpty: true,
|
|
52889
|
-
isOnlyOne: true
|
|
52890
|
-
isPdf: isPdf
|
|
52813
|
+
isOnlyOne: true
|
|
52891
52814
|
},
|
|
52892
52815
|
targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
|
|
52893
52816
|
});
|
|
@@ -52897,10 +52820,9 @@ function StakeholderMappings(_ref3) {
|
|
|
52897
52820
|
type: "nameNode",
|
|
52898
52821
|
data: {
|
|
52899
52822
|
isEmpty: true,
|
|
52900
|
-
name: ((_node$
|
|
52901
|
-
icon: (_node$
|
|
52902
|
-
t: t
|
|
52903
|
-
isPdf: isPdf
|
|
52823
|
+
name: ((_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data.emptyName) || "No".concat((_node$data2 = node.data) === null || _node$data2 === void 0 ? void 0 : _node$data2.name, " identified"),
|
|
52824
|
+
icon: (_node$data3 = node.data) === null || _node$data3 === void 0 ? void 0 : _node$data3.type,
|
|
52825
|
+
t: t
|
|
52904
52826
|
},
|
|
52905
52827
|
position: positionDataNodes({
|
|
52906
52828
|
isLeftSide: node.data.order % 2 !== 0,
|
|
@@ -52910,22 +52832,21 @@ function StakeholderMappings(_ref3) {
|
|
|
52910
52832
|
total: 1,
|
|
52911
52833
|
mainNode,
|
|
52912
52834
|
type: "nameNode",
|
|
52913
|
-
hasContent: (node === null || node === void 0 || (_node$
|
|
52835
|
+
hasContent: (node === null || node === void 0 || (_node$data4 = node.data) === null || _node$data4 === void 0 ? void 0 : _node$data4.content) !== undefined && (node === null || node === void 0 || (_node$data5 = node.data) === null || _node$data5 === void 0 ? void 0 : _node$data5.content) !== null ? true : false
|
|
52914
52836
|
})
|
|
52915
52837
|
}];
|
|
52916
52838
|
}
|
|
52917
52839
|
if (isPdf) {
|
|
52918
|
-
var _node$
|
|
52840
|
+
var _node$data6, _node$data7, _node$data8, _node$data9, _node$data10, _node$data11, _node$data12, _node$data13, _node$data14;
|
|
52919
52841
|
iconEdges.push({
|
|
52920
52842
|
id: "".concat(node.id, "-empty"),
|
|
52921
52843
|
source: node.id,
|
|
52922
52844
|
target: node.data.name + "-name-node",
|
|
52923
52845
|
type: "tooltipEdge",
|
|
52924
52846
|
data: {
|
|
52925
|
-
name: node === null || node === void 0 || (_node$
|
|
52926
|
-
content: node === null || node === void 0 || (_node$
|
|
52927
|
-
isOnlyOne: true
|
|
52928
|
-
isPdf: true
|
|
52847
|
+
name: node === null || node === void 0 || (_node$data6 = node.data) === null || _node$data6 === void 0 ? void 0 : _node$data6.name,
|
|
52848
|
+
content: node === null || node === void 0 || (_node$data7 = node.data) === null || _node$data7 === void 0 ? void 0 : _node$data7.content,
|
|
52849
|
+
isOnlyOne: true
|
|
52929
52850
|
},
|
|
52930
52851
|
targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
|
|
52931
52852
|
});
|
|
@@ -52934,11 +52855,11 @@ function StakeholderMappings(_ref3) {
|
|
|
52934
52855
|
id: node.data.name + "-name-node",
|
|
52935
52856
|
type: "nameNode",
|
|
52936
52857
|
data: {
|
|
52937
|
-
name: node === null || node === void 0 || (_node$
|
|
52938
|
-
content: node === null || node === void 0 || (_node$
|
|
52939
|
-
icon: (_node$
|
|
52940
|
-
backgroundColor: node === null || node === void 0 || (_node$
|
|
52941
|
-
iconColor: node === null || node === void 0 || (_node$
|
|
52858
|
+
name: node === null || node === void 0 || (_node$data8 = node.data) === null || _node$data8 === void 0 ? void 0 : _node$data8.name,
|
|
52859
|
+
content: node === null || node === void 0 || (_node$data9 = node.data) === null || _node$data9 === void 0 ? void 0 : _node$data9.content,
|
|
52860
|
+
icon: (_node$data10 = node.data) === null || _node$data10 === void 0 ? void 0 : _node$data10.type,
|
|
52861
|
+
backgroundColor: node === null || node === void 0 || (_node$data11 = node.data) === null || _node$data11 === void 0 ? void 0 : _node$data11.activeColour,
|
|
52862
|
+
iconColor: node === null || node === void 0 || (_node$data12 = node.data) === null || _node$data12 === void 0 ? void 0 : _node$data12.hoverColor,
|
|
52942
52863
|
isPdf: true,
|
|
52943
52864
|
t: t
|
|
52944
52865
|
},
|
|
@@ -52946,17 +52867,16 @@ function StakeholderMappings(_ref3) {
|
|
|
52946
52867
|
isLeftSide: node.data.order % 2 !== 0,
|
|
52947
52868
|
isAboveMainNode: node.data.order <= 2,
|
|
52948
52869
|
iconNode: node,
|
|
52949
|
-
isPdf: true,
|
|
52950
52870
|
index: 0,
|
|
52951
52871
|
total: 1,
|
|
52952
52872
|
mainNode,
|
|
52953
52873
|
type: "nameNode",
|
|
52954
|
-
hasContent: (node === null || node === void 0 || (_node$
|
|
52874
|
+
hasContent: (node === null || node === void 0 || (_node$data13 = node.data) === null || _node$data13 === void 0 ? void 0 : _node$data13.content) !== undefined && (node === null || node === void 0 || (_node$data14 = node.data) === null || _node$data14 === void 0 ? void 0 : _node$data14.content) !== null ? true : false
|
|
52955
52875
|
})
|
|
52956
52876
|
}];
|
|
52957
52877
|
}
|
|
52958
52878
|
return children.map((child, index) => {
|
|
52959
|
-
var _node$
|
|
52879
|
+
var _node$data15;
|
|
52960
52880
|
iconEdges.push({
|
|
52961
52881
|
id: "".concat(node.id, "-").concat(child.id),
|
|
52962
52882
|
source: node.id,
|
|
@@ -52968,8 +52888,7 @@ function StakeholderMappings(_ref3) {
|
|
|
52968
52888
|
value: child.value,
|
|
52969
52889
|
tooltipHeader: child.tooltipHeader,
|
|
52970
52890
|
tooltipLabel: (child === null || child === void 0 ? void 0 : child.tooltipLabel) || "Holding",
|
|
52971
|
-
totalSources: child.totalSources || 0
|
|
52972
|
-
isPdf: isPdf
|
|
52891
|
+
totalSources: child.totalSources || 0
|
|
52973
52892
|
},
|
|
52974
52893
|
targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
|
|
52975
52894
|
});
|
|
@@ -52996,8 +52915,7 @@ function StakeholderMappings(_ref3) {
|
|
|
52996
52915
|
backgroundColor: child.backgroundColor || "#ade9e1",
|
|
52997
52916
|
iconColor: child.iconColor || "#08949a",
|
|
52998
52917
|
icon: child.icon || "UserCircle",
|
|
52999
|
-
content: children.length
|
|
53000
|
-
isPdf: isPdf
|
|
52918
|
+
content: children.length
|
|
53001
52919
|
},
|
|
53002
52920
|
position: positionDataNodes({
|
|
53003
52921
|
isLeftSide,
|
|
@@ -53007,8 +52925,7 @@ function StakeholderMappings(_ref3) {
|
|
|
53007
52925
|
total,
|
|
53008
52926
|
mainNode,
|
|
53009
52927
|
type: child.type || "primaryNode",
|
|
53010
|
-
hasContent: node !== null && node !== void 0 && (_node$
|
|
53011
|
-
isPdf: isPdf
|
|
52928
|
+
hasContent: node !== null && node !== void 0 && (_node$data15 = node.data) !== null && _node$data15 !== void 0 && _node$data15.content ? true : false
|
|
53012
52929
|
})
|
|
53013
52930
|
};
|
|
53014
52931
|
});
|
|
@@ -53022,8 +52939,7 @@ function StakeholderMappings(_ref3) {
|
|
|
53022
52939
|
type: "default",
|
|
53023
52940
|
data: {
|
|
53024
52941
|
group: child.id,
|
|
53025
|
-
type: "mainNode"
|
|
53026
|
-
isPdf: isPdf
|
|
52942
|
+
type: "mainNode"
|
|
53027
52943
|
}
|
|
53028
52944
|
};
|
|
53029
52945
|
});
|
|
@@ -53049,8 +52965,7 @@ function StakeholderMappings(_ref3) {
|
|
|
53049
52965
|
duration: 300
|
|
53050
52966
|
});
|
|
53051
52967
|
},
|
|
53052
|
-
ref: reactFlowWrapper
|
|
53053
|
-
isPdf: isPdf
|
|
52968
|
+
ref: reactFlowWrapper
|
|
53054
52969
|
});
|
|
53055
52970
|
}
|
|
53056
52971
|
var index$1 = withProvider(StakeholderMappings);
|
package/package.json
CHANGED
|
@@ -457,34 +457,6 @@ export const Pdf = {
|
|
|
457
457
|
showBackground: true,
|
|
458
458
|
isPercentage: true,
|
|
459
459
|
shouldSeperateLegendName: true,
|
|
460
|
-
formattedXAxis: (s) => {
|
|
461
|
-
if (!s) return "";
|
|
462
|
-
|
|
463
|
-
const limit = 20;
|
|
464
|
-
let result = "";
|
|
465
|
-
let line = "";
|
|
466
|
-
|
|
467
|
-
for (let word of s.split(" ")) {
|
|
468
|
-
if ((line + word).length <= limit) {
|
|
469
|
-
line += (line ? " " : "") + word;
|
|
470
|
-
} else if (word.length > limit) {
|
|
471
|
-
// break long word with hyphen
|
|
472
|
-
while (word.length > limit) {
|
|
473
|
-
result += word.slice(0, limit - 1) + "-\n";
|
|
474
|
-
word = word.slice(limit - 1);
|
|
475
|
-
}
|
|
476
|
-
line = word;
|
|
477
|
-
} else {
|
|
478
|
-
// move current line into result
|
|
479
|
-
if (line) result += line + "\n";
|
|
480
|
-
line = word;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
if (line) result += line;
|
|
485
|
-
|
|
486
|
-
return result;
|
|
487
|
-
},
|
|
488
460
|
},
|
|
489
461
|
render: (args) => {
|
|
490
462
|
return <Widget title="Pdf Column Chart" className={"with-border-header"}>
|
|
@@ -72,7 +72,6 @@ function positionDataNodes({
|
|
|
72
72
|
mainNode,
|
|
73
73
|
type,
|
|
74
74
|
hasContent,
|
|
75
|
-
isPdf,
|
|
76
75
|
}) {
|
|
77
76
|
const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
|
|
78
77
|
const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
|
|
@@ -104,46 +103,13 @@ function positionDataNodes({
|
|
|
104
103
|
const END_Y = startY + totalHeight;
|
|
105
104
|
|
|
106
105
|
const yOffset = index * MIN_SPACE_REQUIRED;
|
|
107
|
-
let yPosition;
|
|
108
106
|
|
|
107
|
+
let yPosition = startY + yOffset;
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
yPosition = iconNodeHandleCenterY - (DATA_NODE_HEIGHT / 2);
|
|
115
|
-
} else {
|
|
116
|
-
|
|
117
|
-
const siblingSpace = () => {
|
|
118
|
-
if (type === "primaryNode") {
|
|
119
|
-
if (iconNode?.data.children?.length === 1 && hasContent) {
|
|
120
|
-
return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
|
|
121
|
-
}
|
|
122
|
-
return DEFAULT_PRIMARY_NODE_SPACE;
|
|
123
|
-
}
|
|
124
|
-
if (iconNode?.data?.children?.length === 0) {
|
|
125
|
-
return NO_CHILDREN_SIBLING_SPACE;
|
|
126
|
-
}
|
|
127
|
-
return DEFAULT_SIBLING_SPACE;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const Y_SPACE_FROM_SIBLINGS = siblingSpace();
|
|
131
|
-
const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
|
|
132
|
-
|
|
133
|
-
const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
134
|
-
|
|
135
|
-
const startY = iconNodeHandleCenterY - totalHeight / 2;
|
|
136
|
-
const END_Y = startY + totalHeight;
|
|
137
|
-
|
|
138
|
-
const yOffset = index * MIN_SPACE_REQUIRED;
|
|
139
|
-
|
|
140
|
-
yPosition = startY + yOffset;
|
|
141
|
-
|
|
142
|
-
if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
143
|
-
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
|
|
144
|
-
} else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
145
|
-
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
|
|
146
|
-
}
|
|
109
|
+
if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
110
|
+
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
|
|
111
|
+
} else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
112
|
+
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
|
|
147
113
|
}
|
|
148
114
|
|
|
149
115
|
return {
|
|
@@ -194,7 +160,6 @@ function StakeholderMappings({
|
|
|
194
160
|
name: emptyString,
|
|
195
161
|
icon: data?.icon || "DashboardStakeholder",
|
|
196
162
|
t: t,
|
|
197
|
-
isPdf: isPdf,
|
|
198
163
|
},
|
|
199
164
|
position: {
|
|
200
165
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -218,7 +183,6 @@ function StakeholderMappings({
|
|
|
218
183
|
totalSources: data?.totalSources,
|
|
219
184
|
backgroundColor: data?.backgroundColor || "#ade9e1",
|
|
220
185
|
iconColor: data?.iconColor || "#08949a",
|
|
221
|
-
isPdf: isPdf,
|
|
222
186
|
},
|
|
223
187
|
position: {
|
|
224
188
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -283,7 +247,6 @@ function StakeholderMappings({
|
|
|
283
247
|
const children = node.data.children || [];
|
|
284
248
|
const total = children?.length || 0;
|
|
285
249
|
const iconNodeId = node.id;
|
|
286
|
-
const iconNodeHasContent = node?.data?.content !== undefined && node?.data?.content !== null;
|
|
287
250
|
|
|
288
251
|
if (children.length === 0) {
|
|
289
252
|
iconEdges.push({
|
|
@@ -294,7 +257,6 @@ function StakeholderMappings({
|
|
|
294
257
|
data: {
|
|
295
258
|
isEmpty: true,
|
|
296
259
|
isOnlyOne: true,
|
|
297
|
-
isPdf: isPdf,
|
|
298
260
|
},
|
|
299
261
|
targetHandle:
|
|
300
262
|
node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target",
|
|
@@ -311,7 +273,6 @@ function StakeholderMappings({
|
|
|
311
273
|
name: node.data?.emptyName || `No${node.data?.name} identified`,
|
|
312
274
|
icon: node.data?.type,
|
|
313
275
|
t: t,
|
|
314
|
-
isPdf: isPdf,
|
|
315
276
|
},
|
|
316
277
|
position: positionDataNodes({
|
|
317
278
|
isLeftSide: node.data.order % 2 !== 0,
|
|
@@ -340,7 +301,6 @@ function StakeholderMappings({
|
|
|
340
301
|
name: node?.data?.name,
|
|
341
302
|
content: node?.data?.content,
|
|
342
303
|
isOnlyOne: true,
|
|
343
|
-
isPdf: true,
|
|
344
304
|
},
|
|
345
305
|
targetHandle:
|
|
346
306
|
node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target",
|
|
@@ -365,7 +325,6 @@ function StakeholderMappings({
|
|
|
365
325
|
isLeftSide: node.data.order % 2 !== 0,
|
|
366
326
|
isAboveMainNode: node.data.order <= 2,
|
|
367
327
|
iconNode: node,
|
|
368
|
-
isPdf: true,
|
|
369
328
|
index: 0,
|
|
370
329
|
total: 1,
|
|
371
330
|
mainNode,
|
|
@@ -392,7 +351,6 @@ function StakeholderMappings({
|
|
|
392
351
|
tooltipHeader: child.tooltipHeader,
|
|
393
352
|
tooltipLabel: child?.tooltipLabel || "Holding",
|
|
394
353
|
totalSources: child.totalSources || 0,
|
|
395
|
-
isPdf: isPdf,
|
|
396
354
|
},
|
|
397
355
|
targetHandle:
|
|
398
356
|
node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target",
|
|
@@ -424,7 +382,6 @@ function StakeholderMappings({
|
|
|
424
382
|
iconColor: child.iconColor || "#08949a",
|
|
425
383
|
icon: child.icon || "UserCircle",
|
|
426
384
|
content: children.length,
|
|
427
|
-
isPdf: isPdf,
|
|
428
385
|
},
|
|
429
386
|
position: positionDataNodes({
|
|
430
387
|
isLeftSide,
|
|
@@ -435,7 +392,6 @@ function StakeholderMappings({
|
|
|
435
392
|
mainNode,
|
|
436
393
|
type: child.type || "primaryNode",
|
|
437
394
|
hasContent: node?.data?.content ? true : false,
|
|
438
|
-
isPdf: isPdf,
|
|
439
395
|
}),
|
|
440
396
|
};
|
|
441
397
|
});
|
|
@@ -451,7 +407,6 @@ function StakeholderMappings({
|
|
|
451
407
|
data: {
|
|
452
408
|
group: child.id,
|
|
453
409
|
type: "mainNode",
|
|
454
|
-
isPdf: isPdf,
|
|
455
410
|
},
|
|
456
411
|
};
|
|
457
412
|
});
|
|
@@ -489,7 +444,6 @@ function StakeholderMappings({
|
|
|
489
444
|
});
|
|
490
445
|
}}
|
|
491
446
|
ref={reactFlowWrapper}
|
|
492
|
-
isPdf={isPdf}
|
|
493
447
|
/>
|
|
494
448
|
);
|
|
495
449
|
}
|
|
@@ -32,7 +32,6 @@ const BaseGraph = forwardRef(function BaseGraph(
|
|
|
32
32
|
t,
|
|
33
33
|
withDuration = true,
|
|
34
34
|
onFilterChange,
|
|
35
|
-
isPdf,
|
|
36
35
|
...props
|
|
37
36
|
},
|
|
38
37
|
ref,
|
|
@@ -88,45 +87,43 @@ const BaseGraph = forwardRef(function BaseGraph(
|
|
|
88
87
|
}}
|
|
89
88
|
{...props}
|
|
90
89
|
>
|
|
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
|
-
</Controls>
|
|
129
|
-
)}
|
|
90
|
+
<Controls position="bottom-right" showFitView={false} showInteractive={false}>
|
|
91
|
+
<ControlButton
|
|
92
|
+
onClick={() => {
|
|
93
|
+
fitView({
|
|
94
|
+
padding: 0.1,
|
|
95
|
+
nodes: [...nodesToFit],
|
|
96
|
+
duration: withDuration ? 300 : undefined,
|
|
97
|
+
});
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<AimOutlined height={20} width={20} />
|
|
101
|
+
</ControlButton>
|
|
102
|
+
<ControlButton
|
|
103
|
+
onClick={() => {
|
|
104
|
+
const viewport = getViewport();
|
|
105
|
+
setViewport({
|
|
106
|
+
x: viewport.x,
|
|
107
|
+
y: viewport.y + 20,
|
|
108
|
+
zoom: viewport.zoom,
|
|
109
|
+
});
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
<UpOutlined height={20} width={20}></UpOutlined>
|
|
113
|
+
</ControlButton>
|
|
114
|
+
<ControlButton
|
|
115
|
+
onClick={() => {
|
|
116
|
+
const viewport = getViewport();
|
|
117
|
+
setViewport({
|
|
118
|
+
x: viewport.x,
|
|
119
|
+
y: viewport.y - 20,
|
|
120
|
+
zoom: viewport.zoom,
|
|
121
|
+
});
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
<DownOutlined height={20} width={20}></DownOutlined>
|
|
125
|
+
</ControlButton>
|
|
126
|
+
</Controls>
|
|
130
127
|
</ReactFlow>
|
|
131
128
|
</div>
|
|
132
129
|
</ComponentWithFocus>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// components/Edges/DefaultEdge.jsx
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { Popover } from "antd";
|
|
4
|
-
import { BaseEdge, EdgeLabelRenderer, getSmoothStepPath, Position
|
|
3
|
+
import { BaseEdge, EdgeLabelRenderer, getSmoothStepPath, Position } from "@xyflow/react";
|
|
5
4
|
import { renderTooltipJsx } from "../../../../../utils/tooltip.js";
|
|
6
5
|
// import { activeOpacity, disabledOpacity, edgeStroke, edgeStrokeActive } from '../../config';
|
|
7
6
|
|
|
@@ -26,31 +25,21 @@ export default function DefaultEdge({
|
|
|
26
25
|
renderTooltipItems = () => [],
|
|
27
26
|
getTotal = () => 0,
|
|
28
27
|
tooltipTitle,
|
|
29
|
-
isPdf, // Destructure isPdf from data
|
|
30
28
|
} = data;
|
|
31
29
|
const isSelected =
|
|
32
30
|
associatedNodes?.includes(source) && associatedNodes?.includes(target) && activeNode;
|
|
33
31
|
const opacity = activeNode ? (isSelected ? ACTIVE_OPACITY : DISABLED_OPACITY) : ACTIVE_OPACITY;
|
|
34
32
|
const arrowHeadId = `arrow-head-${id}`;
|
|
35
33
|
|
|
36
|
-
const [edgePath] =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
: getSmoothStepPath({ // Use smooth path for normal rendering
|
|
46
|
-
sourceX,
|
|
47
|
-
sourceY,
|
|
48
|
-
targetX,
|
|
49
|
-
targetY,
|
|
50
|
-
sourcePosition: data.type === "left" ? Position.Left : Position.Right,
|
|
51
|
-
targetPosition: data.type === "left" ? Position.Right : Position.Left,
|
|
52
|
-
borderRadius: 20,
|
|
53
|
-
});
|
|
34
|
+
const [edgePath] = getSmoothStepPath({
|
|
35
|
+
sourceX,
|
|
36
|
+
sourceY,
|
|
37
|
+
targetX,
|
|
38
|
+
targetY,
|
|
39
|
+
sourcePosition: data.type === "left" ? Position.Left : Position.Right,
|
|
40
|
+
targetPosition: data.type === "left" ? Position.Right : Position.Left,
|
|
41
|
+
borderRadius: 20,
|
|
42
|
+
});
|
|
54
43
|
|
|
55
44
|
const centerY = data.moreLeft ? sourceY : targetY;
|
|
56
45
|
|
|
@@ -134,4 +123,4 @@ export default function DefaultEdge({
|
|
|
134
123
|
/>
|
|
135
124
|
</g>
|
|
136
125
|
);
|
|
137
|
-
}
|
|
126
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
// components/Edges/TooltipEdge.jsx
|
|
2
1
|
import { Popover, Tag } from "antd";
|
|
3
2
|
import {
|
|
4
3
|
BaseEdge,
|
|
5
4
|
EdgeLabelRenderer,
|
|
6
5
|
getEdgeCenter,
|
|
7
6
|
getSmoothStepPath,
|
|
8
|
-
|
|
7
|
+
// getStraightPath,
|
|
9
8
|
} from "@xyflow/react";
|
|
10
9
|
import { renderTooltipJsx } from "../../../../../utils/tooltip.js";
|
|
11
10
|
import CustomIcon from "../../../Icon/CustomIcon.jsx";
|
|
@@ -31,26 +30,15 @@ export default function ToolTipEdge({
|
|
|
31
30
|
data,
|
|
32
31
|
targetPosition,
|
|
33
32
|
}) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
targetPosition,
|
|
44
|
-
})
|
|
45
|
-
: getSmoothStepPath({
|
|
46
|
-
sourceX,
|
|
47
|
-
sourceY,
|
|
48
|
-
sourcePosition,
|
|
49
|
-
targetX,
|
|
50
|
-
targetY,
|
|
51
|
-
targetPosition,
|
|
52
|
-
borderRadius: 15,
|
|
53
|
-
});
|
|
33
|
+
const [smoothPath] = getSmoothStepPath({
|
|
34
|
+
sourceX,
|
|
35
|
+
sourceY,
|
|
36
|
+
sourcePosition,
|
|
37
|
+
targetX,
|
|
38
|
+
targetY,
|
|
39
|
+
targetPosition,
|
|
40
|
+
borderRadius: 15,
|
|
41
|
+
});
|
|
54
42
|
|
|
55
43
|
const center = getEdgeCenter({
|
|
56
44
|
sourceX,
|
|
@@ -61,7 +49,7 @@ export default function ToolTipEdge({
|
|
|
61
49
|
|
|
62
50
|
return (
|
|
63
51
|
<>
|
|
64
|
-
<BaseEdge path={
|
|
52
|
+
<BaseEdge path={smoothPath} />
|
|
65
53
|
<EdgeLabelRenderer>
|
|
66
54
|
<div
|
|
67
55
|
className="button-edge__label nodrag nopan"
|
|
@@ -119,4 +107,4 @@ export default function ToolTipEdge({
|
|
|
119
107
|
</EdgeLabelRenderer>
|
|
120
108
|
</>
|
|
121
109
|
);
|
|
122
|
-
}
|
|
110
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// components/Nodes/NameNode.jsx
|
|
2
1
|
import React from "react";
|
|
3
2
|
import styled from "styled-components";
|
|
4
3
|
import { Handle, Position } from "@xyflow/react";
|
|
@@ -6,7 +5,6 @@ import CustomIcon from "../../../Icon/CustomIcon.jsx";
|
|
|
6
5
|
import { Tooltip } from "antd";
|
|
7
6
|
import { theme } from "antd";
|
|
8
7
|
import { truncateString } from "../../../../../../helpers/StringHelper.js";
|
|
9
|
-
import { ICON_NODE_HEIGHT } from "./index.jsx";
|
|
10
8
|
|
|
11
9
|
export const NAME_CARD_WIDTH = 315;
|
|
12
10
|
export const NAME_CARD_HEIGHT = 37;
|
|
@@ -15,8 +13,6 @@ const { useToken } = theme;
|
|
|
15
13
|
export default function NameNode({ data }) {
|
|
16
14
|
const { token } = useToken();
|
|
17
15
|
const translateFN = typeof data?.t === "function" ? data.t : (key) => key;
|
|
18
|
-
const isPdf = data?.isPdf;
|
|
19
|
-
|
|
20
16
|
return (
|
|
21
17
|
<>
|
|
22
18
|
<Handle
|
|
@@ -38,7 +34,6 @@ export default function NameNode({ data }) {
|
|
|
38
34
|
}}
|
|
39
35
|
/>
|
|
40
36
|
<Style
|
|
41
|
-
$isPdf={isPdf}
|
|
42
37
|
style={{
|
|
43
38
|
opacity: data.isEmpty ? 0.5 : 1,
|
|
44
39
|
}}
|
|
@@ -100,21 +95,19 @@ export default function NameNode({ data }) {
|
|
|
100
95
|
) : null}
|
|
101
96
|
</div>
|
|
102
97
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</div>
|
|
117
|
-
)}
|
|
98
|
+
<div
|
|
99
|
+
style={{
|
|
100
|
+
marginLeft: "auto",
|
|
101
|
+
}}
|
|
102
|
+
className="go-to"
|
|
103
|
+
onClick={() => {
|
|
104
|
+
if (typeof data.onClick === "function") {
|
|
105
|
+
data.onClick();
|
|
106
|
+
}
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
<CustomIcon height={14} width={14} name="LinkNewTab" />
|
|
110
|
+
</div>
|
|
118
111
|
</div>
|
|
119
112
|
</Style>
|
|
120
113
|
<Handle
|
|
@@ -136,36 +129,25 @@ export default function NameNode({ data }) {
|
|
|
136
129
|
}
|
|
137
130
|
|
|
138
131
|
const Style = styled.div`
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
? `
|
|
148
|
-
border: 1px solid var(--base-gray-30);
|
|
149
|
-
box-shadow: none;
|
|
150
|
-
`
|
|
151
|
-
: `
|
|
152
|
-
box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
|
|
153
|
-
`}
|
|
154
|
-
-webkit-print-color-adjust: exact;
|
|
155
|
-
print-color-adjust: exact;
|
|
132
|
+
width: ${NAME_CARD_WIDTH}px;
|
|
133
|
+
display: flex;
|
|
134
|
+
background: white;
|
|
135
|
+
border-radius: 8px;
|
|
136
|
+
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
137
|
+
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
156
140
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
141
|
+
.left {
|
|
142
|
+
width: 32px;
|
|
143
|
+
background: red;
|
|
144
|
+
border-top-left-radius: 12px;
|
|
145
|
+
border-bottom-left-radius: 12px;
|
|
146
|
+
}
|
|
163
147
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
`;
|
|
148
|
+
.right {
|
|
149
|
+
padding: 16px 12px;
|
|
150
|
+
width: 100%
|
|
151
|
+
border-bottom: 1px solid var(--base-gray-30);
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// components/Nodes/PrimaryNode.jsx
|
|
2
1
|
import React from "react";
|
|
3
2
|
import styled from "styled-components";
|
|
4
|
-
import { Handle, Position } from "@xyflow/react";
|
|
3
|
+
import { Handle, Position } from "@xyflow/react"; //
|
|
5
4
|
import CustomIcon from "../../../Icon/CustomIcon.jsx";
|
|
6
5
|
import { Tooltip } from "antd";
|
|
7
6
|
import PropTypes from "prop-types";
|
|
@@ -11,7 +10,6 @@ export const MAIN_NODE_WIDTH = 300;
|
|
|
11
10
|
export const MAIN_NODE_HEIGHT = 150;
|
|
12
11
|
|
|
13
12
|
export default function PrimaryNode({ id, data }) {
|
|
14
|
-
const isPdf = data?.isPdf; // Get isPdf from data prop
|
|
15
13
|
return (
|
|
16
14
|
<>
|
|
17
15
|
<Handle
|
|
@@ -32,7 +30,7 @@ export default function PrimaryNode({ id, data }) {
|
|
|
32
30
|
opacity: 0,
|
|
33
31
|
}}
|
|
34
32
|
/>
|
|
35
|
-
<Style
|
|
33
|
+
<Style className="flex">
|
|
36
34
|
<div
|
|
37
35
|
className="left flex flex-column justify-center"
|
|
38
36
|
style={{
|
|
@@ -135,23 +133,13 @@ export default function PrimaryNode({ id, data }) {
|
|
|
135
133
|
|
|
136
134
|
const Style = styled.div`
|
|
137
135
|
width: ${MAIN_NODE_WIDTH}px;
|
|
138
|
-
height: ${MAIN_NODE_HEIGHT}px; /* Explicitly set height */
|
|
139
136
|
display: flex;
|
|
140
137
|
background: white;
|
|
141
138
|
border-radius: 8px;
|
|
139
|
+
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
140
|
+
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
142
141
|
overflow: hidden;
|
|
143
|
-
|
|
144
|
-
${(props) =>
|
|
145
|
-
props.$isPdf
|
|
146
|
-
? `
|
|
147
|
-
border: 1px solid var(--base-gray-30); /* Ensure a visible border in PDF */
|
|
148
|
-
box-shadow: none; /* Remove shadow for PDF */
|
|
149
|
-
`
|
|
150
|
-
: `
|
|
151
|
-
box-shadow: 0px 3.76px 10.03px 0px #00000014, 0px 1.88px 3.76px -2.51px #0000001f, 0px 5.64px 17.56px 5.02px #0000000d;
|
|
152
|
-
`}
|
|
153
|
-
-webkit-print-color-adjust: exact;
|
|
154
|
-
print-color-adjust: exact;
|
|
142
|
+
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
155
143
|
|
|
156
144
|
.left {
|
|
157
145
|
width: 32px;
|
|
@@ -245,6 +233,5 @@ PrimaryNode.propTypes = {
|
|
|
245
233
|
backgroundColor: PropTypes.string,
|
|
246
234
|
totalSources: PropTypes.number,
|
|
247
235
|
onClick: PropTypes.func,
|
|
248
|
-
isPdf: PropTypes.bool,
|
|
249
236
|
}),
|
|
250
|
-
};
|
|
237
|
+
};
|