datastake-daf 0.6.373 → 0.6.375
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/components/index.js +181 -93
- package/dist/hooks/index.js +8 -8
- package/dist/utils/index.js +11 -11
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/ColumnChart/ColumnChart.stories.jsx +28 -0
- package/src/@daf/core/components/Graphs/StakeholderMappings/StakeholderMappings.stories.jsx +18 -0
- package/src/@daf/core/components/Graphs/StakeholderMappings/index.jsx +69 -24
- package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +40 -37
- package/src/@daf/core/components/Graphs/components/Edges/DefaultEdge.jsx +22 -11
- package/src/@daf/core/components/Graphs/components/Edges/TooltipEdge.jsx +24 -12
- package/src/@daf/core/components/Graphs/components/Nodes/NameNode.jsx +49 -33
- package/src/@daf/core/components/Graphs/components/Nodes/PrimaryNode.jsx +18 -7
- package/src/@daf/utils/filters.js +88 -83
- package/.env +0 -8
- package/.vscode/settings.json +0 -13
package/dist/components/index.js
CHANGED
|
@@ -46903,13 +46903,13 @@ const getType = namespace => {
|
|
|
46903
46903
|
}
|
|
46904
46904
|
};
|
|
46905
46905
|
|
|
46906
|
-
const defaultFilterKeys = [
|
|
46906
|
+
const defaultFilterKeys = ['search', 'sortDir', 'sortBy', 'timeframe', 'activeTab'];
|
|
46907
46907
|
function hasJsonStructure(str) {
|
|
46908
|
-
if (typeof str !==
|
|
46908
|
+
if (typeof str !== 'string') return false;
|
|
46909
46909
|
try {
|
|
46910
46910
|
const result = JSON.parse(str);
|
|
46911
46911
|
const type = Object.prototype.toString.call(result);
|
|
46912
|
-
return type ===
|
|
46912
|
+
return type === '[object Object]' || type === '[object Array]';
|
|
46913
46913
|
} catch (err) {
|
|
46914
46914
|
return false;
|
|
46915
46915
|
}
|
|
@@ -46931,16 +46931,16 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
|
|
|
46931
46931
|
}
|
|
46932
46932
|
}
|
|
46933
46933
|
});
|
|
46934
|
-
if (params.has(
|
|
46934
|
+
if (params.has('searchParams')) {
|
|
46935
46935
|
try {
|
|
46936
|
-
o.searchParams = JSON.parse(params.get(
|
|
46936
|
+
o.searchParams = JSON.parse(params.get('searchParams'));
|
|
46937
46937
|
} catch (e) {
|
|
46938
|
-
o.searchParams = params.get(
|
|
46938
|
+
o.searchParams = params.get('searchParams').split(',');
|
|
46939
46939
|
}
|
|
46940
46940
|
}
|
|
46941
46941
|
if (doPagination) {
|
|
46942
|
-
o.page = Number(params.get(
|
|
46943
|
-
o.pageSize = Number(params.get(
|
|
46942
|
+
o.page = Number(params.get('page')) || 1;
|
|
46943
|
+
o.pageSize = Number(params.get('pageSize')) || defaultPageSize;
|
|
46944
46944
|
}
|
|
46945
46945
|
Object.keys(selectFiltersConfig).forEach(k => {
|
|
46946
46946
|
if (params.has(k)) {
|
|
@@ -46969,8 +46969,8 @@ const filterParams = value => {
|
|
|
46969
46969
|
} = activeFilters || {};
|
|
46970
46970
|
const params = {};
|
|
46971
46971
|
params.pagination = JSON.stringify({
|
|
46972
|
-
|
|
46973
|
-
|
|
46972
|
+
page,
|
|
46973
|
+
size: pageSize
|
|
46974
46974
|
});
|
|
46975
46975
|
if (search && searchParams) {
|
|
46976
46976
|
params.search = JSON.stringify({
|
|
@@ -46985,7 +46985,7 @@ const filterParams = value => {
|
|
|
46985
46985
|
});
|
|
46986
46986
|
}
|
|
46987
46987
|
if (Object.keys(filters).length) {
|
|
46988
|
-
if (value.sourceId && value.sourceId ===
|
|
46988
|
+
if (value.sourceId && value.sourceId === 'overview') {
|
|
46989
46989
|
params.filters = JSON.stringify(filters);
|
|
46990
46990
|
} else {
|
|
46991
46991
|
params.filters = JSON.stringify({
|
|
@@ -51013,12 +51013,14 @@ function DualAxesChart(_ref) {
|
|
|
51013
51013
|
});
|
|
51014
51014
|
}
|
|
51015
51015
|
|
|
51016
|
+
// components/Nodes/PrimaryNode.jsx
|
|
51016
51017
|
const MAIN_NODE_WIDTH = 300;
|
|
51017
51018
|
const MAIN_NODE_HEIGHT = 150;
|
|
51018
51019
|
function PrimaryNode({
|
|
51019
51020
|
id,
|
|
51020
51021
|
data
|
|
51021
51022
|
}) {
|
|
51023
|
+
const isPdf = data?.isPdf; // Get isPdf from data prop
|
|
51022
51024
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51023
51025
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
|
|
51024
51026
|
type: "source",
|
|
@@ -51037,8 +51039,9 @@ function PrimaryNode({
|
|
|
51037
51039
|
opacity: 0
|
|
51038
51040
|
}
|
|
51039
51041
|
}), /*#__PURE__*/jsxRuntime.jsxs(Style$f, {
|
|
51042
|
+
$isPdf: isPdf,
|
|
51040
51043
|
className: "flex",
|
|
51041
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51044
|
+
children: [" ", /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51042
51045
|
className: "left flex flex-column justify-center",
|
|
51043
51046
|
style: {
|
|
51044
51047
|
background: data.backgroundColor || "#ade9e1",
|
|
@@ -51073,7 +51076,7 @@ function PrimaryNode({
|
|
|
51073
51076
|
},
|
|
51074
51077
|
children: data?.name || ""
|
|
51075
51078
|
})
|
|
51076
|
-
}), data.
|
|
51079
|
+
}), !data.isPdf && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51077
51080
|
className: "go-to",
|
|
51078
51081
|
onClick: () => {
|
|
51079
51082
|
if (typeof data.onClick === "function") {
|
|
@@ -51148,13 +51151,18 @@ function PrimaryNode({
|
|
|
51148
51151
|
}
|
|
51149
51152
|
const Style$f = dt.div`
|
|
51150
51153
|
width: ${MAIN_NODE_WIDTH}px;
|
|
51154
|
+
height: ${MAIN_NODE_HEIGHT}px; /* Explicitly set height */
|
|
51151
51155
|
display: flex;
|
|
51152
51156
|
background: white;
|
|
51153
51157
|
border-radius: 8px;
|
|
51154
|
-
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
51155
|
-
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
51156
51158
|
overflow: hidden;
|
|
51157
|
-
|
|
51159
|
+
${props => props.$isPdf ? `
|
|
51160
|
+
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;
|
|
51161
|
+
` : `
|
|
51162
|
+
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;
|
|
51163
|
+
`}
|
|
51164
|
+
-webkit-print-color-adjust: exact;
|
|
51165
|
+
print-color-adjust: exact;
|
|
51158
51166
|
|
|
51159
51167
|
.left {
|
|
51160
51168
|
width: 32px;
|
|
@@ -51246,7 +51254,8 @@ PrimaryNode.propTypes = {
|
|
|
51246
51254
|
icon: PropTypes__default["default"].string,
|
|
51247
51255
|
backgroundColor: PropTypes__default["default"].string,
|
|
51248
51256
|
totalSources: PropTypes__default["default"].number,
|
|
51249
|
-
onClick: PropTypes__default["default"].func
|
|
51257
|
+
onClick: PropTypes__default["default"].func,
|
|
51258
|
+
isPdf: PropTypes__default["default"].bool
|
|
51250
51259
|
})
|
|
51251
51260
|
};
|
|
51252
51261
|
|
|
@@ -51367,6 +51376,7 @@ const Style$e = dt.div`
|
|
|
51367
51376
|
}
|
|
51368
51377
|
`;
|
|
51369
51378
|
|
|
51379
|
+
// components/Nodes/NameNode.jsx
|
|
51370
51380
|
const NAME_CARD_WIDTH = 315;
|
|
51371
51381
|
const {
|
|
51372
51382
|
useToken: useToken$7
|
|
@@ -51378,6 +51388,7 @@ function NameNode({
|
|
|
51378
51388
|
token
|
|
51379
51389
|
} = useToken$7();
|
|
51380
51390
|
const translateFN = typeof data?.t === "function" ? data.t : key => key;
|
|
51391
|
+
const isPdf = data?.isPdf;
|
|
51381
51392
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51382
51393
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
|
|
51383
51394
|
type: "source",
|
|
@@ -51396,6 +51407,7 @@ function NameNode({
|
|
|
51396
51407
|
opacity: 0
|
|
51397
51408
|
}
|
|
51398
51409
|
}), /*#__PURE__*/jsxRuntime.jsxs(Style$d, {
|
|
51410
|
+
$isPdf: isPdf,
|
|
51399
51411
|
style: {
|
|
51400
51412
|
opacity: data.isEmpty ? 0.5 : 1
|
|
51401
51413
|
},
|
|
@@ -51446,7 +51458,7 @@ function NameNode({
|
|
|
51446
51458
|
}
|
|
51447
51459
|
})
|
|
51448
51460
|
}) : null]
|
|
51449
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51461
|
+
}), !isPdf && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51450
51462
|
style: {
|
|
51451
51463
|
marginLeft: "auto"
|
|
51452
51464
|
},
|
|
@@ -51483,27 +51495,34 @@ function NameNode({
|
|
|
51483
51495
|
});
|
|
51484
51496
|
}
|
|
51485
51497
|
const Style$d = dt.div`
|
|
51486
|
-
|
|
51487
|
-
|
|
51488
|
-
|
|
51489
|
-
|
|
51490
|
-
|
|
51491
|
-
|
|
51492
|
-
|
|
51493
|
-
|
|
51498
|
+
width: ${NAME_CARD_WIDTH}px;
|
|
51499
|
+
height: 55px;
|
|
51500
|
+
display: flex;
|
|
51501
|
+
background: white;
|
|
51502
|
+
border-radius: 8px;
|
|
51503
|
+
overflow: hidden;
|
|
51504
|
+
${props => props.$isPdf ? `
|
|
51505
|
+
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;
|
|
51506
|
+
` : `
|
|
51507
|
+
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;
|
|
51508
|
+
`}
|
|
51509
|
+
-webkit-print-color-adjust: exact;
|
|
51510
|
+
print-color-adjust: exact;
|
|
51494
51511
|
|
|
51495
|
-
|
|
51496
|
-
|
|
51497
|
-
|
|
51498
|
-
|
|
51499
|
-
|
|
51500
|
-
|
|
51512
|
+
.left {
|
|
51513
|
+
width: 32px;
|
|
51514
|
+
background: red;
|
|
51515
|
+
border-top-left-radius: 12px;
|
|
51516
|
+
border-bottom-left-radius: 12px;
|
|
51517
|
+
}
|
|
51501
51518
|
|
|
51502
|
-
|
|
51503
|
-
|
|
51504
|
-
|
|
51505
|
-
|
|
51506
|
-
|
|
51519
|
+
.right {
|
|
51520
|
+
padding: 0px 12px;
|
|
51521
|
+
width: 100%;
|
|
51522
|
+
display: flex;
|
|
51523
|
+
align-items: center;
|
|
51524
|
+
border-bottom: none;
|
|
51525
|
+
}
|
|
51507
51526
|
`;
|
|
51508
51527
|
|
|
51509
51528
|
const Style$c = dt.div`
|
|
@@ -51729,6 +51748,7 @@ function ExpandedNode({
|
|
|
51729
51748
|
});
|
|
51730
51749
|
}
|
|
51731
51750
|
|
|
51751
|
+
// components/Edges/TooltipEdge.jsx
|
|
51732
51752
|
function ToolTipEdge({
|
|
51733
51753
|
sourceX,
|
|
51734
51754
|
sourceY,
|
|
@@ -51738,7 +51758,20 @@ function ToolTipEdge({
|
|
|
51738
51758
|
data,
|
|
51739
51759
|
targetPosition
|
|
51740
51760
|
}) {
|
|
51741
|
-
const
|
|
51761
|
+
const {
|
|
51762
|
+
isOnlyOne,
|
|
51763
|
+
isPdf
|
|
51764
|
+
} = data; // Destructure isPdf from data
|
|
51765
|
+
|
|
51766
|
+
const [edgePath] = isPdf && isOnlyOne // Condition for straight path in PDF for single nodes
|
|
51767
|
+
? react.getStraightPath({
|
|
51768
|
+
sourceX,
|
|
51769
|
+
sourceY,
|
|
51770
|
+
sourcePosition,
|
|
51771
|
+
targetX,
|
|
51772
|
+
targetY,
|
|
51773
|
+
targetPosition
|
|
51774
|
+
}) : react.getSmoothStepPath({
|
|
51742
51775
|
sourceX,
|
|
51743
51776
|
sourceY,
|
|
51744
51777
|
sourcePosition,
|
|
@@ -51755,8 +51788,8 @@ function ToolTipEdge({
|
|
|
51755
51788
|
});
|
|
51756
51789
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51757
51790
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.BaseEdge, {
|
|
51758
|
-
path:
|
|
51759
|
-
}), /*#__PURE__*/jsxRuntime.jsx(react.EdgeLabelRenderer, {
|
|
51791
|
+
path: edgePath
|
|
51792
|
+
}), " ", /*#__PURE__*/jsxRuntime.jsx(react.EdgeLabelRenderer, {
|
|
51760
51793
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51761
51794
|
className: "button-edge__label nodrag nopan",
|
|
51762
51795
|
style: {
|
|
@@ -51954,6 +51987,7 @@ function VerticalPathEdge({
|
|
|
51954
51987
|
});
|
|
51955
51988
|
}
|
|
51956
51989
|
|
|
51990
|
+
// components/Edges/DefaultEdge.jsx
|
|
51957
51991
|
const ACTIVE_OPACITY = 1;
|
|
51958
51992
|
const DISABLED_OPACITY = 0.5;
|
|
51959
51993
|
const EDGE_STROKE = "#9DA4AE";
|
|
@@ -51973,12 +52007,22 @@ function DefaultEdge({
|
|
|
51973
52007
|
associatedNodes = [],
|
|
51974
52008
|
renderTooltipItems = () => [],
|
|
51975
52009
|
getTotal = () => 0,
|
|
51976
|
-
tooltipTitle
|
|
52010
|
+
tooltipTitle,
|
|
52011
|
+
isPdf // Destructure isPdf from data
|
|
51977
52012
|
} = data;
|
|
51978
52013
|
const isSelected = associatedNodes?.includes(source) && associatedNodes?.includes(target) && activeNode;
|
|
51979
52014
|
const opacity = activeNode ? isSelected ? ACTIVE_OPACITY : DISABLED_OPACITY : ACTIVE_OPACITY;
|
|
51980
52015
|
const arrowHeadId = `arrow-head-${id}`;
|
|
51981
|
-
const [edgePath] =
|
|
52016
|
+
const [edgePath] = isPdf // Use straight path for PDF
|
|
52017
|
+
? react.getStraightPath({
|
|
52018
|
+
sourceX,
|
|
52019
|
+
sourceY,
|
|
52020
|
+
sourcePosition: data.type === "left" ? react.Position.Left : react.Position.Right,
|
|
52021
|
+
targetX,
|
|
52022
|
+
targetY,
|
|
52023
|
+
targetPosition: data.type === "left" ? react.Position.Right : react.Position.Left
|
|
52024
|
+
}) : react.getSmoothStepPath({
|
|
52025
|
+
// Use smooth path for normal rendering
|
|
51982
52026
|
sourceX,
|
|
51983
52027
|
sourceY,
|
|
51984
52028
|
targetX,
|
|
@@ -52078,6 +52122,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52078
52122
|
t,
|
|
52079
52123
|
withDuration = true,
|
|
52080
52124
|
onFilterChange,
|
|
52125
|
+
isPdf,
|
|
52081
52126
|
...props
|
|
52082
52127
|
}, ref) {
|
|
52083
52128
|
const {
|
|
@@ -52134,7 +52179,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52134
52179
|
duration: withDuration ? 300 : undefined
|
|
52135
52180
|
},
|
|
52136
52181
|
...props,
|
|
52137
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
52182
|
+
children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
52138
52183
|
position: "bottom-right",
|
|
52139
52184
|
showFitView: false,
|
|
52140
52185
|
showInteractive: false,
|
|
@@ -52651,37 +52696,67 @@ function positionDataNodes(_ref2) {
|
|
|
52651
52696
|
total,
|
|
52652
52697
|
mainNode,
|
|
52653
52698
|
type,
|
|
52654
|
-
hasContent
|
|
52699
|
+
hasContent,
|
|
52700
|
+
isPdf
|
|
52655
52701
|
} = _ref2;
|
|
52656
52702
|
const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
|
|
52657
52703
|
const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
|
|
52658
|
-
|
|
52659
|
-
|
|
52660
|
-
|
|
52661
|
-
|
|
52662
|
-
|
|
52663
|
-
|
|
52704
|
+
|
|
52705
|
+
// const siblingSpace = () => {
|
|
52706
|
+
// if (type === "primaryNode") {
|
|
52707
|
+
// if (iconNode?.data.children?.length === 1 && hasContent) {
|
|
52708
|
+
// return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
|
|
52709
|
+
// }
|
|
52710
|
+
// return DEFAULT_PRIMARY_NODE_SPACE;
|
|
52711
|
+
// }
|
|
52712
|
+
// if (iconNode?.data?.children?.length === 0) {
|
|
52713
|
+
// return NO_CHILDREN_SIBLING_SPACE;
|
|
52714
|
+
// }
|
|
52715
|
+
// return DEFAULT_SIBLING_SPACE;
|
|
52716
|
+
// };
|
|
52717
|
+
|
|
52718
|
+
// const Y_SPACE_FROM_SIBLINGS = siblingSpace();
|
|
52719
|
+
const X_SPACE_FROM_ICON_NODE = 130;
|
|
52720
|
+
// const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
|
|
52721
|
+
|
|
52722
|
+
// const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
52723
|
+
|
|
52724
|
+
iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
|
|
52725
|
+
// const startY = iconNodeCenterY - totalHeight / 2;
|
|
52726
|
+
// const END_Y = startY + totalHeight;
|
|
52727
|
+
|
|
52728
|
+
// const yOffset = index * MIN_SPACE_REQUIRED;
|
|
52729
|
+
let yPosition;
|
|
52730
|
+
const iconNodeHandleCenterY = iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 10 : 0);
|
|
52731
|
+
if (type === "nameNode" && total === 1 || isPdf) {
|
|
52732
|
+
yPosition = iconNodeHandleCenterY - DATA_NODE_HEIGHT / 2 - 7;
|
|
52733
|
+
} else {
|
|
52734
|
+
const siblingSpace = () => {
|
|
52735
|
+
var _iconNode$data;
|
|
52736
|
+
if (type === "primaryNode") {
|
|
52737
|
+
var _iconNode$data$childr;
|
|
52738
|
+
if ((iconNode === null || iconNode === void 0 || (_iconNode$data$childr = iconNode.data.children) === null || _iconNode$data$childr === void 0 ? void 0 : _iconNode$data$childr.length) === 1 && hasContent) {
|
|
52739
|
+
return SINGLE_CHILDREN_PRIMARY_WITH_CONTENT_SPACE;
|
|
52740
|
+
}
|
|
52741
|
+
return DEFAULT_PRIMARY_NODE_SPACE;
|
|
52664
52742
|
}
|
|
52665
|
-
|
|
52666
|
-
|
|
52667
|
-
|
|
52668
|
-
return
|
|
52743
|
+
if ((iconNode === null || iconNode === void 0 || (_iconNode$data = iconNode.data) === null || _iconNode$data === void 0 || (_iconNode$data = _iconNode$data.children) === null || _iconNode$data === void 0 ? void 0 : _iconNode$data.length) === 0) {
|
|
52744
|
+
return NO_CHILDREN_SIBLING_SPACE;
|
|
52745
|
+
}
|
|
52746
|
+
return DEFAULT_SIBLING_SPACE;
|
|
52747
|
+
};
|
|
52748
|
+
const Y_SPACE_FROM_SIBLINGS = siblingSpace();
|
|
52749
|
+
const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
|
|
52750
|
+
const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
52751
|
+
const startY = iconNodeHandleCenterY - totalHeight / 2;
|
|
52752
|
+
const END_Y = startY + totalHeight;
|
|
52753
|
+
const yOffset = index * MIN_SPACE_REQUIRED;
|
|
52754
|
+
yPosition = startY + yOffset;
|
|
52755
|
+
if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52756
|
+
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
|
|
52757
|
+
} else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52758
|
+
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
|
|
52669
52759
|
}
|
|
52670
|
-
return DEFAULT_SIBLING_SPACE;
|
|
52671
|
-
};
|
|
52672
|
-
const Y_SPACE_FROM_SIBLINGS = siblingSpace();
|
|
52673
|
-
const X_SPACE_FROM_ICON_NODE = 130;
|
|
52674
|
-
const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
|
|
52675
|
-
const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
52676
|
-
const iconNodeCenterY = iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
|
|
52677
|
-
const startY = iconNodeCenterY - totalHeight / 2;
|
|
52678
|
-
const END_Y = startY + totalHeight;
|
|
52679
|
-
const yOffset = index * MIN_SPACE_REQUIRED;
|
|
52680
|
-
let yPosition = startY + yOffset;
|
|
52681
|
-
if (isAboveMainNode && END_Y >= mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52682
|
-
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 - totalHeight + yOffset;
|
|
52683
|
-
} else if (!isAboveMainNode && startY < mainNode.position.y + DATA_NODE_HEIGHT / 2) {
|
|
52684
|
-
yPosition = mainNode.position.y + DATA_NODE_HEIGHT / 2 + yOffset;
|
|
52685
52760
|
}
|
|
52686
52761
|
return {
|
|
52687
52762
|
x: isLeftSide ? iconNode.position.x - (DATA_NODE_WIDTH + X_SPACE_FROM_ICON_NODE) : iconNode.position.x + (X_SPACE_FROM_ICON_NODE + ICON_NODE_WIDTH),
|
|
@@ -52727,7 +52802,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52727
52802
|
isEmpty: true,
|
|
52728
52803
|
name: emptyString,
|
|
52729
52804
|
icon: (data === null || data === void 0 ? void 0 : data.icon) || "DashboardStakeholder",
|
|
52730
|
-
t: t
|
|
52805
|
+
t: t,
|
|
52806
|
+
isPdf: isPdf
|
|
52731
52807
|
},
|
|
52732
52808
|
position: {
|
|
52733
52809
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -52749,7 +52825,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52749
52825
|
onClick: (data === null || data === void 0 ? void 0 : data.onClick) || undefined,
|
|
52750
52826
|
totalSources: data === null || data === void 0 ? void 0 : data.totalSources,
|
|
52751
52827
|
backgroundColor: (data === null || data === void 0 ? void 0 : data.backgroundColor) || "#ade9e1",
|
|
52752
|
-
iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a"
|
|
52828
|
+
iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a",
|
|
52829
|
+
isPdf: isPdf
|
|
52753
52830
|
},
|
|
52754
52831
|
position: {
|
|
52755
52832
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -52799,11 +52876,13 @@ function StakeholderMappings(_ref3) {
|
|
|
52799
52876
|
setSelectedIconNodes(openIconNOdes.map(node => node.id));
|
|
52800
52877
|
}
|
|
52801
52878
|
const dataNodes = openIconNOdes.flatMap(node => {
|
|
52879
|
+
var _node$data, _node$data2;
|
|
52802
52880
|
const children = node.data.children || [];
|
|
52803
52881
|
const total = (children === null || children === void 0 ? void 0 : children.length) || 0;
|
|
52804
52882
|
const iconNodeId = node.id;
|
|
52883
|
+
(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;
|
|
52805
52884
|
if (children.length === 0) {
|
|
52806
|
-
var _node$
|
|
52885
|
+
var _node$data3, _node$data4, _node$data5, _node$data6, _node$data7;
|
|
52807
52886
|
iconEdges.push({
|
|
52808
52887
|
id: "".concat(node.id, "-empty"),
|
|
52809
52888
|
source: node.id,
|
|
@@ -52811,7 +52890,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52811
52890
|
type: "tooltipEdge",
|
|
52812
52891
|
data: {
|
|
52813
52892
|
isEmpty: true,
|
|
52814
|
-
isOnlyOne: true
|
|
52893
|
+
isOnlyOne: true,
|
|
52894
|
+
isPdf: isPdf
|
|
52815
52895
|
},
|
|
52816
52896
|
targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
|
|
52817
52897
|
});
|
|
@@ -52821,9 +52901,10 @@ function StakeholderMappings(_ref3) {
|
|
|
52821
52901
|
type: "nameNode",
|
|
52822
52902
|
data: {
|
|
52823
52903
|
isEmpty: true,
|
|
52824
|
-
name: ((_node$
|
|
52825
|
-
icon: (_node$
|
|
52826
|
-
t: t
|
|
52904
|
+
name: ((_node$data3 = node.data) === null || _node$data3 === void 0 ? void 0 : _node$data3.emptyName) || "No".concat((_node$data4 = node.data) === null || _node$data4 === void 0 ? void 0 : _node$data4.name, " identified"),
|
|
52905
|
+
icon: (_node$data5 = node.data) === null || _node$data5 === void 0 ? void 0 : _node$data5.type,
|
|
52906
|
+
t: t,
|
|
52907
|
+
isPdf: isPdf
|
|
52827
52908
|
},
|
|
52828
52909
|
position: positionDataNodes({
|
|
52829
52910
|
isLeftSide: node.data.order % 2 !== 0,
|
|
@@ -52833,21 +52914,22 @@ function StakeholderMappings(_ref3) {
|
|
|
52833
52914
|
total: 1,
|
|
52834
52915
|
mainNode,
|
|
52835
52916
|
type: "nameNode",
|
|
52836
|
-
hasContent: (node === null || node === void 0 || (_node$
|
|
52917
|
+
hasContent: (node === null || node === void 0 || (_node$data6 = node.data) === null || _node$data6 === void 0 ? void 0 : _node$data6.content) !== undefined && (node === null || node === void 0 || (_node$data7 = node.data) === null || _node$data7 === void 0 ? void 0 : _node$data7.content) !== null ? true : false
|
|
52837
52918
|
})
|
|
52838
52919
|
}];
|
|
52839
52920
|
}
|
|
52840
52921
|
if (isPdf) {
|
|
52841
|
-
var _node$
|
|
52922
|
+
var _node$data8, _node$data9, _node$data10, _node$data11, _node$data12, _node$data13, _node$data14, _node$data15, _node$data16;
|
|
52842
52923
|
iconEdges.push({
|
|
52843
52924
|
id: "".concat(node.id, "-empty"),
|
|
52844
52925
|
source: node.id,
|
|
52845
52926
|
target: node.data.name + "-name-node",
|
|
52846
52927
|
type: "tooltipEdge",
|
|
52847
52928
|
data: {
|
|
52848
|
-
name: node === null || node === void 0 || (_node$
|
|
52849
|
-
content: node === null || node === void 0 || (_node$
|
|
52850
|
-
isOnlyOne: true
|
|
52929
|
+
name: node === null || node === void 0 || (_node$data8 = node.data) === null || _node$data8 === void 0 ? void 0 : _node$data8.name,
|
|
52930
|
+
content: node === null || node === void 0 || (_node$data9 = node.data) === null || _node$data9 === void 0 ? void 0 : _node$data9.content,
|
|
52931
|
+
isOnlyOne: true,
|
|
52932
|
+
isPdf: true
|
|
52851
52933
|
},
|
|
52852
52934
|
targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
|
|
52853
52935
|
});
|
|
@@ -52856,11 +52938,11 @@ function StakeholderMappings(_ref3) {
|
|
|
52856
52938
|
id: node.data.name + "-name-node",
|
|
52857
52939
|
type: "nameNode",
|
|
52858
52940
|
data: {
|
|
52859
|
-
name: node === null || node === void 0 || (_node$
|
|
52860
|
-
content: node === null || node === void 0 || (_node$
|
|
52861
|
-
icon: (_node$
|
|
52862
|
-
backgroundColor: node === null || node === void 0 || (_node$
|
|
52863
|
-
iconColor: node === null || node === void 0 || (_node$
|
|
52941
|
+
name: node === null || node === void 0 || (_node$data10 = node.data) === null || _node$data10 === void 0 ? void 0 : _node$data10.name,
|
|
52942
|
+
content: node === null || node === void 0 || (_node$data11 = node.data) === null || _node$data11 === void 0 ? void 0 : _node$data11.content,
|
|
52943
|
+
icon: (_node$data12 = node.data) === null || _node$data12 === void 0 ? void 0 : _node$data12.type,
|
|
52944
|
+
backgroundColor: node === null || node === void 0 || (_node$data13 = node.data) === null || _node$data13 === void 0 ? void 0 : _node$data13.activeColour,
|
|
52945
|
+
iconColor: node === null || node === void 0 || (_node$data14 = node.data) === null || _node$data14 === void 0 ? void 0 : _node$data14.hoverColor,
|
|
52864
52946
|
isPdf: true,
|
|
52865
52947
|
t: t
|
|
52866
52948
|
},
|
|
@@ -52868,16 +52950,17 @@ function StakeholderMappings(_ref3) {
|
|
|
52868
52950
|
isLeftSide: node.data.order % 2 !== 0,
|
|
52869
52951
|
isAboveMainNode: node.data.order <= 2,
|
|
52870
52952
|
iconNode: node,
|
|
52953
|
+
isPdf: true,
|
|
52871
52954
|
index: 0,
|
|
52872
52955
|
total: 1,
|
|
52873
52956
|
mainNode,
|
|
52874
52957
|
type: "nameNode",
|
|
52875
|
-
hasContent: (node === null || node === void 0 || (_node$
|
|
52958
|
+
hasContent: (node === null || node === void 0 || (_node$data15 = node.data) === null || _node$data15 === void 0 ? void 0 : _node$data15.content) !== undefined && (node === null || node === void 0 || (_node$data16 = node.data) === null || _node$data16 === void 0 ? void 0 : _node$data16.content) !== null ? true : false
|
|
52876
52959
|
})
|
|
52877
52960
|
}];
|
|
52878
52961
|
}
|
|
52879
52962
|
return children.map((child, index) => {
|
|
52880
|
-
var _node$
|
|
52963
|
+
var _node$data17;
|
|
52881
52964
|
iconEdges.push({
|
|
52882
52965
|
id: "".concat(node.id, "-").concat(child.id),
|
|
52883
52966
|
source: node.id,
|
|
@@ -52889,7 +52972,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52889
52972
|
value: child.value,
|
|
52890
52973
|
tooltipHeader: child.tooltipHeader,
|
|
52891
52974
|
tooltipLabel: (child === null || child === void 0 ? void 0 : child.tooltipLabel) || "Holding",
|
|
52892
|
-
totalSources: child.totalSources || 0
|
|
52975
|
+
totalSources: child.totalSources || 0,
|
|
52976
|
+
isPdf: isPdf
|
|
52893
52977
|
},
|
|
52894
52978
|
targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
|
|
52895
52979
|
});
|
|
@@ -52916,7 +53000,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52916
53000
|
backgroundColor: child.backgroundColor || "#ade9e1",
|
|
52917
53001
|
iconColor: child.iconColor || "#08949a",
|
|
52918
53002
|
icon: child.icon || "UserCircle",
|
|
52919
|
-
content: children.length
|
|
53003
|
+
content: children.length,
|
|
53004
|
+
isPdf: isPdf
|
|
52920
53005
|
},
|
|
52921
53006
|
position: positionDataNodes({
|
|
52922
53007
|
isLeftSide,
|
|
@@ -52926,7 +53011,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52926
53011
|
total,
|
|
52927
53012
|
mainNode,
|
|
52928
53013
|
type: child.type || "primaryNode",
|
|
52929
|
-
hasContent: node !== null && node !== void 0 && (_node$
|
|
53014
|
+
hasContent: node !== null && node !== void 0 && (_node$data17 = node.data) !== null && _node$data17 !== void 0 && _node$data17.content ? true : false,
|
|
53015
|
+
isPdf: isPdf
|
|
52930
53016
|
})
|
|
52931
53017
|
};
|
|
52932
53018
|
});
|
|
@@ -52940,7 +53026,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52940
53026
|
type: "default",
|
|
52941
53027
|
data: {
|
|
52942
53028
|
group: child.id,
|
|
52943
|
-
type: "mainNode"
|
|
53029
|
+
type: "mainNode",
|
|
53030
|
+
isPdf: isPdf
|
|
52944
53031
|
}
|
|
52945
53032
|
};
|
|
52946
53033
|
});
|
|
@@ -52966,7 +53053,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52966
53053
|
duration: 300
|
|
52967
53054
|
});
|
|
52968
53055
|
},
|
|
52969
|
-
ref: reactFlowWrapper
|
|
53056
|
+
ref: reactFlowWrapper,
|
|
53057
|
+
isPdf: isPdf
|
|
52970
53058
|
});
|
|
52971
53059
|
}
|
|
52972
53060
|
var index$1 = withProvider(StakeholderMappings);
|
package/dist/hooks/index.js
CHANGED
|
@@ -12,13 +12,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
|
|
13
13
|
var L__default = /*#__PURE__*/_interopDefaultLegacy(L);
|
|
14
14
|
|
|
15
|
-
const defaultFilterKeys = [
|
|
15
|
+
const defaultFilterKeys = ['search', 'sortDir', 'sortBy', 'timeframe', 'activeTab'];
|
|
16
16
|
function hasJsonStructure(str) {
|
|
17
|
-
if (typeof str !==
|
|
17
|
+
if (typeof str !== 'string') return false;
|
|
18
18
|
try {
|
|
19
19
|
const result = JSON.parse(str);
|
|
20
20
|
const type = Object.prototype.toString.call(result);
|
|
21
|
-
return type ===
|
|
21
|
+
return type === '[object Object]' || type === '[object Array]';
|
|
22
22
|
} catch (err) {
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
@@ -40,16 +40,16 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
if (params.has(
|
|
43
|
+
if (params.has('searchParams')) {
|
|
44
44
|
try {
|
|
45
|
-
o.searchParams = JSON.parse(params.get(
|
|
45
|
+
o.searchParams = JSON.parse(params.get('searchParams'));
|
|
46
46
|
} catch (e) {
|
|
47
|
-
o.searchParams = params.get(
|
|
47
|
+
o.searchParams = params.get('searchParams').split(',');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
if (doPagination) {
|
|
51
|
-
o.page = Number(params.get(
|
|
52
|
-
o.pageSize = Number(params.get(
|
|
51
|
+
o.page = Number(params.get('page')) || 1;
|
|
52
|
+
o.pageSize = Number(params.get('pageSize')) || defaultPageSize;
|
|
53
53
|
}
|
|
54
54
|
Object.keys(selectFiltersConfig).forEach(k => {
|
|
55
55
|
if (params.has(k)) {
|
package/dist/utils/index.js
CHANGED
|
@@ -6022,13 +6022,13 @@ const editErrorHandler = ({
|
|
|
6022
6022
|
}
|
|
6023
6023
|
};
|
|
6024
6024
|
|
|
6025
|
-
const defaultFilterKeys = [
|
|
6025
|
+
const defaultFilterKeys = ['search', 'sortDir', 'sortBy', 'timeframe', 'activeTab'];
|
|
6026
6026
|
function hasJsonStructure(str) {
|
|
6027
|
-
if (typeof str !==
|
|
6027
|
+
if (typeof str !== 'string') return false;
|
|
6028
6028
|
try {
|
|
6029
6029
|
const result = JSON.parse(str);
|
|
6030
6030
|
const type = Object.prototype.toString.call(result);
|
|
6031
|
-
return type ===
|
|
6031
|
+
return type === '[object Object]' || type === '[object Array]';
|
|
6032
6032
|
} catch (err) {
|
|
6033
6033
|
return false;
|
|
6034
6034
|
}
|
|
@@ -6050,16 +6050,16 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
|
|
|
6050
6050
|
}
|
|
6051
6051
|
}
|
|
6052
6052
|
});
|
|
6053
|
-
if (params.has(
|
|
6053
|
+
if (params.has('searchParams')) {
|
|
6054
6054
|
try {
|
|
6055
|
-
o.searchParams = JSON.parse(params.get(
|
|
6055
|
+
o.searchParams = JSON.parse(params.get('searchParams'));
|
|
6056
6056
|
} catch (e) {
|
|
6057
|
-
o.searchParams = params.get(
|
|
6057
|
+
o.searchParams = params.get('searchParams').split(',');
|
|
6058
6058
|
}
|
|
6059
6059
|
}
|
|
6060
6060
|
if (doPagination) {
|
|
6061
|
-
o.page = Number(params.get(
|
|
6062
|
-
o.pageSize = Number(params.get(
|
|
6061
|
+
o.page = Number(params.get('page')) || 1;
|
|
6062
|
+
o.pageSize = Number(params.get('pageSize')) || defaultPageSize;
|
|
6063
6063
|
}
|
|
6064
6064
|
Object.keys(selectFiltersConfig).forEach(k => {
|
|
6065
6065
|
if (params.has(k)) {
|
|
@@ -6088,8 +6088,8 @@ const filterParams = value => {
|
|
|
6088
6088
|
} = activeFilters || {};
|
|
6089
6089
|
const params = {};
|
|
6090
6090
|
params.pagination = JSON.stringify({
|
|
6091
|
-
|
|
6092
|
-
|
|
6091
|
+
page,
|
|
6092
|
+
size: pageSize
|
|
6093
6093
|
});
|
|
6094
6094
|
if (search && searchParams) {
|
|
6095
6095
|
params.search = JSON.stringify({
|
|
@@ -6104,7 +6104,7 @@ const filterParams = value => {
|
|
|
6104
6104
|
});
|
|
6105
6105
|
}
|
|
6106
6106
|
if (Object.keys(filters).length) {
|
|
6107
|
-
if (value.sourceId && value.sourceId ===
|
|
6107
|
+
if (value.sourceId && value.sourceId === 'overview') {
|
|
6108
6108
|
params.filters = JSON.stringify(filters);
|
|
6109
6109
|
} else {
|
|
6110
6110
|
params.filters = JSON.stringify({
|