datastake-daf 0.6.443 → 0.6.445

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.
@@ -14606,8 +14606,10 @@ function PdfView(_ref2) {
14606
14606
  incrHeight += HEADER_HEIGHT;
14607
14607
  }
14608
14608
  const newHeight = incrHeight + height;
14609
+
14610
+ // ADD THIS CONDITION HERE - before the page break logic
14609
14611
  if (i === keys.length - 1) {
14610
- ref.current.style.paddingBottom = '30px';
14612
+ ref.current.style.paddingBottom = '80px';
14611
14613
  }
14612
14614
  if (newHeight > PAGE_HEIGHT - 30 - FOOTER_HEIGHT - HEADER_HEIGHT) {
14613
14615
  const dif = Math.abs(PAGE_HEIGHT - incrHeight);
@@ -14620,17 +14622,15 @@ function PdfView(_ref2) {
14620
14622
  } = sectionsConfig[keys[i - 1]];
14621
14623
  topRef.current.style.marginBottom = "".concat(dif + HEADER_HEIGHT - 24, "px");
14622
14624
  incrHeight = height + 24 + HEADER_HEIGHT;
14623
- // console.log('margin', dif);
14624
14625
  }
14625
14626
  } else {
14626
14627
  incrHeight = newHeight + 24;
14627
14628
  }
14628
- // console.groupEnd();
14629
14629
  });
14630
14630
  setPages(_pages);
14631
14631
  }
14632
14632
  }, [sectionsConfig]);
14633
- React.useEffect(() => {
14633
+ React.useLayoutEffect(() => {
14634
14634
  doSizing();
14635
14635
  }, [doSizing]);
14636
14636
  const onChangeHeight = React.useCallback((index, conf) => {
@@ -14668,7 +14668,8 @@ function PdfView(_ref2) {
14668
14668
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
14669
14669
  className: contClassName,
14670
14670
  style: {
14671
- position: 'relative'
14671
+ position: 'relative',
14672
+ minHeight: pages.length * PAGE_HEIGHT
14672
14673
  },
14673
14674
  children: [renderDashboard(), pages.map(page => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
14674
14675
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.443",
3
+ "version": "0.6.445",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -66,40 +66,39 @@ export default function PdfView({
66
66
 
67
67
  keys.forEach((k, i) => {
68
68
  const { height, ref } = sectionsConfig[k];
69
-
69
+
70
70
  if (i === 0) {
71
71
  ref.current.style.marginTop = `${HEADER_HEIGHT}px`;
72
72
  incrHeight += HEADER_HEIGHT;
73
73
  }
74
-
74
+
75
75
  const newHeight = incrHeight + height;
76
-
76
+
77
+ // ADD THIS CONDITION HERE - before the page break logic
77
78
  if (i === keys.length - 1) {
78
- ref.current.style.paddingBottom = '30px';
79
+ ref.current.style.paddingBottom = '80px';
79
80
  }
80
-
81
+
81
82
  if (newHeight > PAGE_HEIGHT - 30 - FOOTER_HEIGHT - HEADER_HEIGHT) {
82
83
  const dif = Math.abs(PAGE_HEIGHT - incrHeight);
83
84
  ref.current.style.marginTop = '30px';
84
85
  _page += 1;
85
86
  _pages.push(_page);
86
-
87
+
87
88
  if (sectionsConfig[keys[i - 1]]) {
88
89
  const { ref: topRef } = sectionsConfig[keys[i - 1]];
89
90
  topRef.current.style.marginBottom = `${dif + HEADER_HEIGHT - 24}px`;
90
91
  incrHeight = height + 24 + HEADER_HEIGHT;
91
- // console.log('margin', dif);
92
92
  }
93
93
  } else {
94
94
  incrHeight = newHeight + 24;
95
95
  }
96
- // console.groupEnd();
97
- })
96
+ });
98
97
  setPages(_pages);
99
98
  }
100
99
  }, [sectionsConfig]);
101
100
 
102
- useEffect(() => {
101
+ useLayoutEffect(() => {
103
102
  doSizing();
104
103
  }, [doSizing]);
105
104
 
@@ -138,7 +137,7 @@ export default function PdfView({
138
137
  // <section>
139
138
 
140
139
  return (
141
- <div className={contClassName} style={{ position: 'relative' }}>
140
+ <div className={contClassName} style={{ position: 'relative', minHeight: pages.length * PAGE_HEIGHT }}>
142
141
  {renderDashboard()}
143
142
  {pages.map((page) => (
144
143
  <>