datastake-daf 0.6.412 → 0.6.413

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.
@@ -13282,9 +13282,10 @@ const SECTION_SPACING = 24; // Space between sections
13282
13282
  const FIRST_PAGE_TOP_PADDING = 30; // Padding after header on first page
13283
13283
  const NEW_PAGE_TOP_PADDING = 30; // Padding after header on new pages
13284
13284
  const LAST_SECTION_BOTTOM_PADDING = 30; // Padding after last section
13285
+ const PAGE_BOTTOM_MARGIN = 30; // Safety margin before footer
13285
13286
 
13286
- // Available content height per page (excluding header and footer)
13287
- const AVAILABLE_HEIGHT = PAGE_HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT;
13287
+ // Available content height per page (excluding header, footer, and safety margins)
13288
+ const AVAILABLE_HEIGHT = PAGE_HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT - PAGE_BOTTOM_MARGIN;
13288
13289
  const Row = _ref => {
13289
13290
  let {
13290
13291
  widgets,
@@ -13362,13 +13363,15 @@ function PdfView(_ref2) {
13362
13363
  currentPageContentHeight = height + FIRST_PAGE_TOP_PADDING;
13363
13364
  if (isLastSection) {
13364
13365
  ref.current.style.paddingBottom = "".concat(LAST_SECTION_BOTTOM_PADDING, "px");
13366
+ currentPageContentHeight += LAST_SECTION_BOTTOM_PADDING;
13365
13367
  }
13366
13368
  return;
13367
13369
  }
13368
13370
 
13369
13371
  // Calculate space needed for this section including spacing before it
13370
13372
  const spacingBefore = isFirstSectionOnPage ? NEW_PAGE_TOP_PADDING : SECTION_SPACING;
13371
- const totalSpaceNeeded = spacingBefore + height;
13373
+ const bottomPadding = isLastSection ? LAST_SECTION_BOTTOM_PADDING : 0;
13374
+ const totalSpaceNeeded = spacingBefore + height + bottomPadding;
13372
13375
 
13373
13376
  // Check if we need to move to next page
13374
13377
  if (currentPageContentHeight + totalSpaceNeeded > AVAILABLE_HEIGHT) {
@@ -13380,11 +13383,11 @@ function PdfView(_ref2) {
13380
13383
  const usedSpace = currentPageContentHeight;
13381
13384
  const remainingSpace = AVAILABLE_HEIGHT - usedSpace;
13382
13385
  const previousKey = keys[i - 1];
13383
- sectionsConfig[previousKey].ref.current.style.marginBottom = "".concat(remainingSpace, "px");
13386
+ sectionsConfig[previousKey].ref.current.style.marginBottom = "".concat(remainingSpace + PAGE_BOTTOM_MARGIN, "px");
13384
13387
 
13385
13388
  // This section starts the new page
13386
13389
  ref.current.style.marginTop = "".concat(HEADER_HEIGHT + NEW_PAGE_TOP_PADDING, "px");
13387
- currentPageContentHeight = height + NEW_PAGE_TOP_PADDING;
13390
+ currentPageContentHeight = height + NEW_PAGE_TOP_PADDING + bottomPadding;
13388
13391
  } else {
13389
13392
  // Section fits on current page
13390
13393
  ref.current.style.marginTop = "".concat(spacingBefore, "px");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.412",
3
+ "version": "0.6.413",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -10,9 +10,10 @@ const SECTION_SPACING = 24; // Space between sections
10
10
  const FIRST_PAGE_TOP_PADDING = 30; // Padding after header on first page
11
11
  const NEW_PAGE_TOP_PADDING = 30; // Padding after header on new pages
12
12
  const LAST_SECTION_BOTTOM_PADDING = 30; // Padding after last section
13
+ const PAGE_BOTTOM_MARGIN = 30; // Safety margin before footer
13
14
 
14
- // Available content height per page (excluding header and footer)
15
- const AVAILABLE_HEIGHT = PAGE_HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT;
15
+ // Available content height per page (excluding header, footer, and safety margins)
16
+ const AVAILABLE_HEIGHT = PAGE_HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT - PAGE_BOTTOM_MARGIN;
16
17
 
17
18
  const Row = ({ widgets, i, onChangeHeight = () => { } }) => {
18
19
  const ref = useRef();
@@ -87,13 +88,15 @@ export default function PdfView({
87
88
 
88
89
  if (isLastSection) {
89
90
  ref.current.style.paddingBottom = `${LAST_SECTION_BOTTOM_PADDING}px`;
91
+ currentPageContentHeight += LAST_SECTION_BOTTOM_PADDING;
90
92
  }
91
93
  return;
92
94
  }
93
95
 
94
96
  // Calculate space needed for this section including spacing before it
95
97
  const spacingBefore = isFirstSectionOnPage ? NEW_PAGE_TOP_PADDING : SECTION_SPACING;
96
- const totalSpaceNeeded = spacingBefore + height;
98
+ const bottomPadding = isLastSection ? LAST_SECTION_BOTTOM_PADDING : 0;
99
+ const totalSpaceNeeded = spacingBefore + height + bottomPadding;
97
100
 
98
101
  // Check if we need to move to next page
99
102
  if (currentPageContentHeight + totalSpaceNeeded > AVAILABLE_HEIGHT) {
@@ -105,11 +108,11 @@ export default function PdfView({
105
108
  const usedSpace = currentPageContentHeight;
106
109
  const remainingSpace = AVAILABLE_HEIGHT - usedSpace;
107
110
  const previousKey = keys[i - 1];
108
- sectionsConfig[previousKey].ref.current.style.marginBottom = `${remainingSpace}px`;
111
+ sectionsConfig[previousKey].ref.current.style.marginBottom = `${remainingSpace + PAGE_BOTTOM_MARGIN}px`;
109
112
 
110
113
  // This section starts the new page
111
114
  ref.current.style.marginTop = `${HEADER_HEIGHT + NEW_PAGE_TOP_PADDING}px`;
112
- currentPageContentHeight = height + NEW_PAGE_TOP_PADDING;
115
+ currentPageContentHeight = height + NEW_PAGE_TOP_PADDING + bottomPadding;
113
116
  } else {
114
117
  // Section fits on current page
115
118
  ref.current.style.marginTop = `${spacingBefore}px`;