datastake-daf 0.6.352 → 0.6.354
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 +37 -24
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/ColumnChart/ColumnChart.stories.jsx +28 -0
- package/src/@daf/core/components/Graphs/StakeholderMappings/index.jsx +2 -0
- package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +40 -37
- package/src/@daf/core/components/Graphs/components/Edges/TooltipEdge.jsx +2 -3
- package/src/@daf/core/components/Graphs/components/Nodes/NameNode.jsx +42 -32
package/dist/components/index.js
CHANGED
|
@@ -51378,6 +51378,7 @@ function NameNode({
|
|
|
51378
51378
|
token
|
|
51379
51379
|
} = useToken$7();
|
|
51380
51380
|
const translateFN = typeof data?.t === "function" ? data.t : key => key;
|
|
51381
|
+
const isPdf = data?.isPdf;
|
|
51381
51382
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51382
51383
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
|
|
51383
51384
|
type: "source",
|
|
@@ -51396,6 +51397,7 @@ function NameNode({
|
|
|
51396
51397
|
opacity: 0
|
|
51397
51398
|
}
|
|
51398
51399
|
}), /*#__PURE__*/jsxRuntime.jsxs(Style$d, {
|
|
51400
|
+
$isPdf: isPdf,
|
|
51399
51401
|
style: {
|
|
51400
51402
|
opacity: data.isEmpty ? 0.5 : 1
|
|
51401
51403
|
},
|
|
@@ -51446,7 +51448,7 @@ function NameNode({
|
|
|
51446
51448
|
}
|
|
51447
51449
|
})
|
|
51448
51450
|
}) : null]
|
|
51449
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51451
|
+
}), !isPdf && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51450
51452
|
style: {
|
|
51451
51453
|
marginLeft: "auto"
|
|
51452
51454
|
},
|
|
@@ -51483,27 +51485,32 @@ function NameNode({
|
|
|
51483
51485
|
});
|
|
51484
51486
|
}
|
|
51485
51487
|
const Style$d = dt.div`
|
|
51486
|
-
|
|
51487
|
-
|
|
51488
|
-
|
|
51489
|
-
|
|
51490
|
-
|
|
51491
|
-
|
|
51492
|
-
|
|
51493
|
-
|
|
51488
|
+
width: ${NAME_CARD_WIDTH}px;
|
|
51489
|
+
display: flex;
|
|
51490
|
+
background: white;
|
|
51491
|
+
border-radius: 8px;
|
|
51492
|
+
/* Box-shadows for screen */
|
|
51493
|
+
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
51494
|
+
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
51495
|
+
overflow: hidden;
|
|
51496
|
+
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
51497
|
+
/* Ensure borders/colors survive PDF rendering */
|
|
51498
|
+
border: ${props => props.$isPdf ? '1px solid var(--base-gray-30)' : 'none'};
|
|
51499
|
+
-webkit-print-color-adjust: exact;
|
|
51500
|
+
print-color-adjust: exact;
|
|
51494
51501
|
|
|
51495
|
-
|
|
51496
|
-
|
|
51497
|
-
|
|
51498
|
-
|
|
51499
|
-
|
|
51500
|
-
|
|
51502
|
+
.left {
|
|
51503
|
+
width: 32px;
|
|
51504
|
+
background: red;
|
|
51505
|
+
border-top-left-radius: 12px;
|
|
51506
|
+
border-bottom-left-radius: 12px;
|
|
51507
|
+
}
|
|
51501
51508
|
|
|
51502
|
-
|
|
51503
|
-
|
|
51504
|
-
|
|
51505
|
-
|
|
51506
|
-
|
|
51509
|
+
.right {
|
|
51510
|
+
padding: 16px 12px;
|
|
51511
|
+
width: 100%;
|
|
51512
|
+
border-bottom: 1px solid var(--base-gray-30);
|
|
51513
|
+
}
|
|
51507
51514
|
`;
|
|
51508
51515
|
|
|
51509
51516
|
const Style$c = dt.div`
|
|
@@ -51738,6 +51745,9 @@ function ToolTipEdge({
|
|
|
51738
51745
|
data,
|
|
51739
51746
|
targetPosition
|
|
51740
51747
|
}) {
|
|
51748
|
+
console.log({
|
|
51749
|
+
data
|
|
51750
|
+
});
|
|
51741
51751
|
const [smoothPath] = react.getSmoothStepPath({
|
|
51742
51752
|
sourceX,
|
|
51743
51753
|
sourceY,
|
|
@@ -51760,7 +51770,7 @@ function ToolTipEdge({
|
|
|
51760
51770
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51761
51771
|
className: "button-edge__label nodrag nopan",
|
|
51762
51772
|
style: {
|
|
51763
|
-
transform: `translate(-50%, -50%) translate(${
|
|
51773
|
+
transform: `translate(-50%, -50%) translate(${center[0] + (sourcePosition === "right" ? 30 : -30)}px, ${targetY}px)`,
|
|
51764
51774
|
position: "absolute",
|
|
51765
51775
|
zIndex: 1000
|
|
51766
51776
|
},
|
|
@@ -52078,6 +52088,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52078
52088
|
t,
|
|
52079
52089
|
withDuration = true,
|
|
52080
52090
|
onFilterChange,
|
|
52091
|
+
isPdf,
|
|
52081
52092
|
...props
|
|
52082
52093
|
}, ref) {
|
|
52083
52094
|
const {
|
|
@@ -52134,7 +52145,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52134
52145
|
duration: withDuration ? 300 : undefined
|
|
52135
52146
|
},
|
|
52136
52147
|
...props,
|
|
52137
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
52148
|
+
children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
52138
52149
|
position: "bottom-right",
|
|
52139
52150
|
showFitView: false,
|
|
52140
52151
|
showInteractive: false,
|
|
@@ -52847,7 +52858,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52847
52858
|
data: {
|
|
52848
52859
|
name: node === null || node === void 0 || (_node$data6 = node.data) === null || _node$data6 === void 0 ? void 0 : _node$data6.name,
|
|
52849
52860
|
content: node === null || node === void 0 || (_node$data7 = node.data) === null || _node$data7 === void 0 ? void 0 : _node$data7.content,
|
|
52850
|
-
isOnlyOne: true
|
|
52861
|
+
isOnlyOne: true,
|
|
52862
|
+
isPdf: true
|
|
52851
52863
|
},
|
|
52852
52864
|
targetHandle: node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target"
|
|
52853
52865
|
});
|
|
@@ -52966,7 +52978,8 @@ function StakeholderMappings(_ref3) {
|
|
|
52966
52978
|
duration: 300
|
|
52967
52979
|
});
|
|
52968
52980
|
},
|
|
52969
|
-
ref: reactFlowWrapper
|
|
52981
|
+
ref: reactFlowWrapper,
|
|
52982
|
+
isPdf: isPdf
|
|
52970
52983
|
});
|
|
52971
52984
|
}
|
|
52972
52985
|
var index$1 = withProvider(StakeholderMappings);
|
package/package.json
CHANGED
|
@@ -457,6 +457,34 @@ 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
|
+
},
|
|
460
488
|
},
|
|
461
489
|
render: (args) => {
|
|
462
490
|
return <Widget title="Pdf Column Chart" className={"with-border-header"}>
|
|
@@ -301,6 +301,7 @@ function StakeholderMappings({
|
|
|
301
301
|
name: node?.data?.name,
|
|
302
302
|
content: node?.data?.content,
|
|
303
303
|
isOnlyOne: true,
|
|
304
|
+
isPdf: true,
|
|
304
305
|
},
|
|
305
306
|
targetHandle:
|
|
306
307
|
node.data.order % 2 === 0 ? "left-handle-target" : "right-handle-target",
|
|
@@ -444,6 +445,7 @@ function StakeholderMappings({
|
|
|
444
445
|
});
|
|
445
446
|
}}
|
|
446
447
|
ref={reactFlowWrapper}
|
|
448
|
+
isPdf={isPdf}
|
|
447
449
|
/>
|
|
448
450
|
);
|
|
449
451
|
}
|
|
@@ -32,6 +32,7 @@ const BaseGraph = forwardRef(function BaseGraph(
|
|
|
32
32
|
t,
|
|
33
33
|
withDuration = true,
|
|
34
34
|
onFilterChange,
|
|
35
|
+
isPdf,
|
|
35
36
|
...props
|
|
36
37
|
},
|
|
37
38
|
ref,
|
|
@@ -87,43 +88,45 @@ const BaseGraph = forwardRef(function BaseGraph(
|
|
|
87
88
|
}}
|
|
88
89
|
{...props}
|
|
89
90
|
>
|
|
90
|
-
|
|
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
|
-
|
|
91
|
+
{!isPdf && (
|
|
92
|
+
<Controls position="bottom-right" showFitView={false} showInteractive={false}>
|
|
93
|
+
<ControlButton
|
|
94
|
+
onClick={() => {
|
|
95
|
+
fitView({
|
|
96
|
+
padding: 0.1,
|
|
97
|
+
nodes: [...nodesToFit],
|
|
98
|
+
duration: withDuration ? 300 : undefined,
|
|
99
|
+
});
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<AimOutlined height={20} width={20} />
|
|
103
|
+
</ControlButton>
|
|
104
|
+
<ControlButton
|
|
105
|
+
onClick={() => {
|
|
106
|
+
const viewport = getViewport();
|
|
107
|
+
setViewport({
|
|
108
|
+
x: viewport.x,
|
|
109
|
+
y: viewport.y + 20,
|
|
110
|
+
zoom: viewport.zoom,
|
|
111
|
+
});
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<UpOutlined height={20} width={20}></UpOutlined>
|
|
115
|
+
</ControlButton>
|
|
116
|
+
<ControlButton
|
|
117
|
+
onClick={() => {
|
|
118
|
+
const viewport = getViewport();
|
|
119
|
+
setViewport({
|
|
120
|
+
x: viewport.x,
|
|
121
|
+
y: viewport.y - 20,
|
|
122
|
+
zoom: viewport.zoom,
|
|
123
|
+
});
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
<DownOutlined height={20} width={20}></DownOutlined>
|
|
127
|
+
</ControlButton>
|
|
128
|
+
</Controls>
|
|
129
|
+
)}
|
|
127
130
|
</ReactFlow>
|
|
128
131
|
</div>
|
|
129
132
|
</ComponentWithFocus>
|
|
@@ -30,6 +30,7 @@ export default function ToolTipEdge({
|
|
|
30
30
|
data,
|
|
31
31
|
targetPosition,
|
|
32
32
|
}) {
|
|
33
|
+
console.log({data})
|
|
33
34
|
const [smoothPath] = getSmoothStepPath({
|
|
34
35
|
sourceX,
|
|
35
36
|
sourceY,
|
|
@@ -55,9 +56,7 @@ export default function ToolTipEdge({
|
|
|
55
56
|
className="button-edge__label nodrag nopan"
|
|
56
57
|
style={{
|
|
57
58
|
transform: `translate(-50%, -50%) translate(${
|
|
58
|
-
|
|
59
|
-
? center[0]
|
|
60
|
-
: center[0] + (sourcePosition === "right" ? 30 : -30)
|
|
59
|
+
center[0] + (sourcePosition === "right" ? 30 : -30)
|
|
61
60
|
}px, ${targetY}px)`,
|
|
62
61
|
position: "absolute",
|
|
63
62
|
zIndex: 1000,
|
|
@@ -13,6 +13,8 @@ const { useToken } = theme;
|
|
|
13
13
|
export default function NameNode({ data }) {
|
|
14
14
|
const { token } = useToken();
|
|
15
15
|
const translateFN = typeof data?.t === "function" ? data.t : (key) => key;
|
|
16
|
+
const isPdf = data?.isPdf;
|
|
17
|
+
|
|
16
18
|
return (
|
|
17
19
|
<>
|
|
18
20
|
<Handle
|
|
@@ -34,6 +36,7 @@ export default function NameNode({ data }) {
|
|
|
34
36
|
}}
|
|
35
37
|
/>
|
|
36
38
|
<Style
|
|
39
|
+
$isPdf={isPdf}
|
|
37
40
|
style={{
|
|
38
41
|
opacity: data.isEmpty ? 0.5 : 1,
|
|
39
42
|
}}
|
|
@@ -95,19 +98,21 @@ export default function NameNode({ data }) {
|
|
|
95
98
|
) : null}
|
|
96
99
|
</div>
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
{!isPdf && (
|
|
102
|
+
<div
|
|
103
|
+
style={{
|
|
104
|
+
marginLeft: "auto",
|
|
105
|
+
}}
|
|
106
|
+
className="go-to"
|
|
107
|
+
onClick={() => {
|
|
108
|
+
if (typeof data.onClick === "function") {
|
|
109
|
+
data.onClick();
|
|
110
|
+
}
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<CustomIcon height={14} width={14} name="LinkNewTab" />
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
111
116
|
</div>
|
|
112
117
|
</Style>
|
|
113
118
|
<Handle
|
|
@@ -129,25 +134,30 @@ export default function NameNode({ data }) {
|
|
|
129
134
|
}
|
|
130
135
|
|
|
131
136
|
const Style = styled.div`
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
width: ${NAME_CARD_WIDTH}px;
|
|
138
|
+
display: flex;
|
|
139
|
+
background: white;
|
|
140
|
+
border-radius: 8px;
|
|
141
|
+
/* Box-shadows for screen */
|
|
142
|
+
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
143
|
+
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
146
|
+
/* Ensure borders/colors survive PDF rendering */
|
|
147
|
+
border: ${(props) => (props.$isPdf ? '1px solid var(--base-gray-30)' : 'none')};
|
|
148
|
+
-webkit-print-color-adjust: exact;
|
|
149
|
+
print-color-adjust: exact;
|
|
140
150
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
.left {
|
|
152
|
+
width: 32px;
|
|
153
|
+
background: red;
|
|
154
|
+
border-top-left-radius: 12px;
|
|
155
|
+
border-bottom-left-radius: 12px;
|
|
156
|
+
}
|
|
147
157
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
158
|
+
.right {
|
|
159
|
+
padding: 16px 12px;
|
|
160
|
+
width: 100%;
|
|
161
|
+
border-bottom: 1px solid var(--base-gray-30);
|
|
162
|
+
}
|
|
153
163
|
`;
|