datastake-daf 0.6.357 → 0.6.359
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 +15 -16
- package/package.json +1 -1
- package/src/@daf/core/components/Graphs/StakeholderMappings/index.jsx +13 -7
- package/src/@daf/core/components/Graphs/components/Edges/TooltipEdge.jsx +1 -2
- package/src/@daf/core/components/Graphs/components/Nodes/PrimaryNode.jsx +4 -3
package/dist/components/index.js
CHANGED
|
@@ -51038,6 +51038,7 @@ function PrimaryNode({
|
|
|
51038
51038
|
}
|
|
51039
51039
|
}), /*#__PURE__*/jsxRuntime.jsxs(Style$f, {
|
|
51040
51040
|
className: "flex",
|
|
51041
|
+
$isPdf: data?.isPdf,
|
|
51041
51042
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51042
51043
|
className: "left flex flex-column justify-center",
|
|
51043
51044
|
style: {
|
|
@@ -51148,6 +51149,7 @@ function PrimaryNode({
|
|
|
51148
51149
|
}
|
|
51149
51150
|
const Style$f = dt.div`
|
|
51150
51151
|
width: ${MAIN_NODE_WIDTH}px;
|
|
51152
|
+
height: ${props => props.$isPdf ? `${MAIN_NODE_HEIGHT}px` : 'auto'};
|
|
51151
51153
|
display: flex;
|
|
51152
51154
|
background: white;
|
|
51153
51155
|
border-radius: 8px;
|
|
@@ -51167,7 +51169,7 @@ const Style$f = dt.div`
|
|
|
51167
51169
|
flex: 1;
|
|
51168
51170
|
|
|
51169
51171
|
.top {
|
|
51170
|
-
padding: 16px 12px;
|
|
51172
|
+
padding: ${props => props.$isPdf ? '12px 12px' : '16px 12px'};
|
|
51171
51173
|
border-bottom: 1px solid var(--base-gray-30);
|
|
51172
51174
|
|
|
51173
51175
|
span {
|
|
@@ -51194,7 +51196,7 @@ const Style$f = dt.div`
|
|
|
51194
51196
|
}
|
|
51195
51197
|
|
|
51196
51198
|
.bottom {
|
|
51197
|
-
padding: 16px;
|
|
51199
|
+
padding: ${props => props.$isPdf ? '12px' : '16px'};
|
|
51198
51200
|
display: flex;
|
|
51199
51201
|
margin-top: 6px;
|
|
51200
51202
|
margin-bottom: 6px;
|
|
@@ -51745,20 +51747,12 @@ function ToolTipEdge({
|
|
|
51745
51747
|
data,
|
|
51746
51748
|
targetPosition
|
|
51747
51749
|
}) {
|
|
51748
|
-
console.log({
|
|
51749
|
-
sourcePosition,
|
|
51750
|
-
sourceX,
|
|
51751
|
-
sourceY,
|
|
51752
|
-
targetX,
|
|
51753
|
-
targetY,
|
|
51754
|
-
targetPosition
|
|
51755
|
-
});
|
|
51756
51750
|
const [smoothPath] = react.getSmoothStepPath({
|
|
51757
51751
|
sourceX,
|
|
51758
51752
|
sourceY,
|
|
51759
51753
|
sourcePosition,
|
|
51760
51754
|
targetX,
|
|
51761
|
-
targetY
|
|
51755
|
+
targetY,
|
|
51762
51756
|
targetPosition,
|
|
51763
51757
|
borderRadius: 15
|
|
51764
51758
|
});
|
|
@@ -52667,7 +52661,8 @@ function positionDataNodes(_ref2) {
|
|
|
52667
52661
|
total,
|
|
52668
52662
|
mainNode,
|
|
52669
52663
|
type,
|
|
52670
|
-
hasContent
|
|
52664
|
+
hasContent,
|
|
52665
|
+
isPdf = false
|
|
52671
52666
|
} = _ref2;
|
|
52672
52667
|
const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
|
|
52673
52668
|
const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
|
|
@@ -52689,7 +52684,7 @@ function positionDataNodes(_ref2) {
|
|
|
52689
52684
|
const X_SPACE_FROM_ICON_NODE = 130;
|
|
52690
52685
|
const MIN_SPACE_REQUIRED = Y_SPACE_FROM_SIBLINGS + DATA_NODE_HEIGHT;
|
|
52691
52686
|
const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
52692
|
-
const iconNodeCenterY = iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
|
|
52687
|
+
const iconNodeCenterY = isPdf ? iconNode.position.y + ICON_NODE_HEIGHT / 2 : iconNode.position.y + ICON_NODE_HEIGHT / 2 + (hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
|
|
52693
52688
|
const startY = iconNodeCenterY - totalHeight / 2;
|
|
52694
52689
|
const END_Y = startY + totalHeight;
|
|
52695
52690
|
const yOffset = index * MIN_SPACE_REQUIRED;
|
|
@@ -52765,7 +52760,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52765
52760
|
onClick: (data === null || data === void 0 ? void 0 : data.onClick) || undefined,
|
|
52766
52761
|
totalSources: data === null || data === void 0 ? void 0 : data.totalSources,
|
|
52767
52762
|
backgroundColor: (data === null || data === void 0 ? void 0 : data.backgroundColor) || "#ade9e1",
|
|
52768
|
-
iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a"
|
|
52763
|
+
iconColor: (data === null || data === void 0 ? void 0 : data.iconColor) || "#08949a",
|
|
52764
|
+
isPdf
|
|
52769
52765
|
},
|
|
52770
52766
|
position: {
|
|
52771
52767
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -52787,6 +52783,7 @@ function StakeholderMappings(_ref3) {
|
|
|
52787
52783
|
order: child.order,
|
|
52788
52784
|
isLeftSide: child.order % 2 !== 0,
|
|
52789
52785
|
emptyName: child.emptyName,
|
|
52786
|
+
isPdf,
|
|
52790
52787
|
onSelect: !isSelectable ? undefined : nodeId => {
|
|
52791
52788
|
if (selectedIconNodes.includes(nodeId)) {
|
|
52792
52789
|
setSelectedIconNodes(prev => prev.filter(id => id !== nodeId));
|
|
@@ -52849,7 +52846,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52849
52846
|
total: 1,
|
|
52850
52847
|
mainNode,
|
|
52851
52848
|
type: "nameNode",
|
|
52852
|
-
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
|
|
52849
|
+
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,
|
|
52850
|
+
isPdf
|
|
52853
52851
|
})
|
|
52854
52852
|
}];
|
|
52855
52853
|
}
|
|
@@ -52943,7 +52941,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52943
52941
|
total,
|
|
52944
52942
|
mainNode,
|
|
52945
52943
|
type: child.type || "primaryNode",
|
|
52946
|
-
hasContent: node !== null && node !== void 0 && (_node$data15 = node.data) !== null && _node$data15 !== void 0 && _node$data15.content ? true : false
|
|
52944
|
+
hasContent: node !== null && node !== void 0 && (_node$data15 = node.data) !== null && _node$data15 !== void 0 && _node$data15.content ? true : false,
|
|
52945
|
+
isPdf
|
|
52947
52946
|
})
|
|
52948
52947
|
};
|
|
52949
52948
|
});
|
package/package.json
CHANGED
|
@@ -72,6 +72,7 @@ function positionDataNodes({
|
|
|
72
72
|
mainNode,
|
|
73
73
|
type,
|
|
74
74
|
hasContent,
|
|
75
|
+
isPdf = false,
|
|
75
76
|
}) {
|
|
76
77
|
const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
|
|
77
78
|
const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
|
|
@@ -95,10 +96,11 @@ function positionDataNodes({
|
|
|
95
96
|
|
|
96
97
|
const totalHeight = total * MIN_SPACE_REQUIRED;
|
|
97
98
|
|
|
98
|
-
const iconNodeCenterY =
|
|
99
|
-
iconNode.position.y +
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
const iconNodeCenterY = isPdf
|
|
100
|
+
? iconNode.position.y + ICON_NODE_HEIGHT / 2
|
|
101
|
+
: iconNode.position.y +
|
|
102
|
+
ICON_NODE_HEIGHT / 2 +
|
|
103
|
+
(hasContent ? 26.5 : type === "primaryNode" ? 15 : 16.5);
|
|
102
104
|
const startY = iconNodeCenterY - totalHeight / 2;
|
|
103
105
|
const END_Y = startY + totalHeight;
|
|
104
106
|
|
|
@@ -183,6 +185,7 @@ function StakeholderMappings({
|
|
|
183
185
|
totalSources: data?.totalSources,
|
|
184
186
|
backgroundColor: data?.backgroundColor || "#ade9e1",
|
|
185
187
|
iconColor: data?.iconColor || "#08949a",
|
|
188
|
+
isPdf,
|
|
186
189
|
},
|
|
187
190
|
position: {
|
|
188
191
|
x: centerX - MAIN_NODE_WIDTH / 2,
|
|
@@ -206,6 +209,7 @@ function StakeholderMappings({
|
|
|
206
209
|
order: child.order,
|
|
207
210
|
isLeftSide: child.order % 2 !== 0,
|
|
208
211
|
emptyName: child.emptyName,
|
|
212
|
+
isPdf,
|
|
209
213
|
onSelect: !isSelectable
|
|
210
214
|
? undefined
|
|
211
215
|
: (nodeId) => {
|
|
@@ -285,7 +289,8 @@ function StakeholderMappings({
|
|
|
285
289
|
hasContent:
|
|
286
290
|
node?.data?.content !== undefined && node?.data?.content !== null
|
|
287
291
|
? true
|
|
288
|
-
|
|
292
|
+
: false,
|
|
293
|
+
isPdf,
|
|
289
294
|
}),
|
|
290
295
|
},
|
|
291
296
|
];
|
|
@@ -372,7 +377,7 @@ function StakeholderMappings({
|
|
|
372
377
|
|
|
373
378
|
return {
|
|
374
379
|
id: `${child.id}-${iconNodeId}`,
|
|
375
|
-
|
|
380
|
+
type: child.type || "primaryNode",
|
|
376
381
|
data: {
|
|
377
382
|
name: child.name,
|
|
378
383
|
id: child.id,
|
|
@@ -392,7 +397,8 @@ function StakeholderMappings({
|
|
|
392
397
|
total,
|
|
393
398
|
mainNode,
|
|
394
399
|
type: child.type || "primaryNode",
|
|
395
|
-
|
|
400
|
+
hasContent: node?.data?.content ? true : false,
|
|
401
|
+
isPdf,
|
|
396
402
|
}),
|
|
397
403
|
};
|
|
398
404
|
});
|
|
@@ -30,13 +30,12 @@ export default function ToolTipEdge({
|
|
|
30
30
|
data,
|
|
31
31
|
targetPosition,
|
|
32
32
|
}) {
|
|
33
|
-
console.log({sourcePosition, sourceX, sourceY, targetX, targetY, targetPosition})
|
|
34
33
|
const [smoothPath] = getSmoothStepPath({
|
|
35
34
|
sourceX,
|
|
36
35
|
sourceY,
|
|
37
36
|
sourcePosition,
|
|
38
37
|
targetX,
|
|
39
|
-
targetY
|
|
38
|
+
targetY,
|
|
40
39
|
targetPosition,
|
|
41
40
|
borderRadius: 15,
|
|
42
41
|
});
|
|
@@ -30,7 +30,7 @@ export default function PrimaryNode({ id, data }) {
|
|
|
30
30
|
opacity: 0,
|
|
31
31
|
}}
|
|
32
32
|
/>
|
|
33
|
-
<Style className="flex">
|
|
33
|
+
<Style className="flex" $isPdf={data?.isPdf}>
|
|
34
34
|
<div
|
|
35
35
|
className="left flex flex-column justify-center"
|
|
36
36
|
style={{
|
|
@@ -133,6 +133,7 @@ export default function PrimaryNode({ id, data }) {
|
|
|
133
133
|
|
|
134
134
|
const Style = styled.div`
|
|
135
135
|
width: ${MAIN_NODE_WIDTH}px;
|
|
136
|
+
height: ${(props) => (props.$isPdf ? `${MAIN_NODE_HEIGHT}px` : 'auto')};
|
|
136
137
|
display: flex;
|
|
137
138
|
background: white;
|
|
138
139
|
border-radius: 8px;
|
|
@@ -152,7 +153,7 @@ const Style = styled.div`
|
|
|
152
153
|
flex: 1;
|
|
153
154
|
|
|
154
155
|
.top {
|
|
155
|
-
padding: 16px 12px;
|
|
156
|
+
padding: ${(props) => (props.$isPdf ? '12px 12px' : '16px 12px')};
|
|
156
157
|
border-bottom: 1px solid var(--base-gray-30);
|
|
157
158
|
|
|
158
159
|
span {
|
|
@@ -179,7 +180,7 @@ const Style = styled.div`
|
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
.bottom {
|
|
182
|
-
padding: 16px;
|
|
183
|
+
padding: ${(props) => (props.$isPdf ? '12px' : '16px')};
|
|
183
184
|
display: flex;
|
|
184
185
|
margin-top: 6px;
|
|
185
186
|
margin-bottom: 6px;
|