@file-viewer/docx 0.3.34 → 0.3.36
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/docx-preview.js
CHANGED
|
@@ -5973,7 +5973,7 @@
|
|
|
5973
5973
|
row.className = values.classNameOfCnfStyle(c);
|
|
5974
5974
|
break;
|
|
5975
5975
|
case "tblHeader":
|
|
5976
|
-
row.isHeader = globalXmlParser.boolAttr(c, "val");
|
|
5976
|
+
row.isHeader = globalXmlParser.boolAttr(c, "val", true);
|
|
5977
5977
|
break;
|
|
5978
5978
|
case "gridBefore":
|
|
5979
5979
|
row.gridBefore = globalXmlParser.intAttr(c, "val");
|
|
@@ -8702,6 +8702,7 @@
|
|
|
8702
8702
|
this.tableCellPositions = [];
|
|
8703
8703
|
this.currentCellPosition = null;
|
|
8704
8704
|
this.currentTableRow = null;
|
|
8705
|
+
this.repeatedTableHeaderRows = new WeakSet();
|
|
8705
8706
|
this.footnoteMap = {};
|
|
8706
8707
|
this.endnoteMap = {};
|
|
8707
8708
|
this.currentEndnoteIds = [];
|
|
@@ -8755,6 +8756,7 @@
|
|
|
8755
8756
|
this.endnoteMap = {};
|
|
8756
8757
|
this.noteNumbering = new NoteNumbering();
|
|
8757
8758
|
this.renderedNoteIds = new Set();
|
|
8759
|
+
this.repeatedTableHeaderRows = new WeakSet();
|
|
8758
8760
|
this.noteSectionIds = new Map();
|
|
8759
8761
|
this.notePageIndex = 1;
|
|
8760
8762
|
this.dynamicNoteState = new WeakMap();
|
|
@@ -9539,8 +9541,14 @@
|
|
|
9539
9541
|
return;
|
|
9540
9542
|
const continuation = result.length > 0;
|
|
9541
9543
|
let fragmentRows = currentRows;
|
|
9542
|
-
if (continuation && headerRows.length > 0 && !currentRows.some(row => row.isHeader))
|
|
9543
|
-
|
|
9544
|
+
if (continuation && headerRows.length > 0 && !currentRows.some(row => row.isHeader)) {
|
|
9545
|
+
const repeatedHeaders = headerRows.map(row => {
|
|
9546
|
+
const copy = { ...row };
|
|
9547
|
+
this.repeatedTableHeaderRows.add(copy);
|
|
9548
|
+
return copy;
|
|
9549
|
+
});
|
|
9550
|
+
fragmentRows = [...repeatedHeaders, ...currentRows];
|
|
9551
|
+
}
|
|
9544
9552
|
result.push({
|
|
9545
9553
|
table: { ...table, children: fragmentRows },
|
|
9546
9554
|
breakAfter
|
|
@@ -10012,6 +10020,8 @@
|
|
|
10012
10020
|
const rect = child.getBoundingClientRect();
|
|
10013
10021
|
bottom = Math.max(bottom, rect.bottom);
|
|
10014
10022
|
if (child.tagName.toLowerCase() == "article") {
|
|
10023
|
+
if (rect.bottom > bodyBottom + tolerance)
|
|
10024
|
+
return true;
|
|
10015
10025
|
for (const block of Array.from(child.children)) {
|
|
10016
10026
|
const blockRect = block.getBoundingClientRect();
|
|
10017
10027
|
bottom = Math.max(bottom, blockRect.bottom);
|
|
@@ -10196,7 +10206,7 @@
|
|
|
10196
10206
|
getPageBodyBottom(page) {
|
|
10197
10207
|
const lists = Array.from(page.children).filter(node => node.dataset.docxNoteList);
|
|
10198
10208
|
const view = page.ownerDocument?.defaultView;
|
|
10199
|
-
if (!
|
|
10209
|
+
if (!view)
|
|
10200
10210
|
return page.getBoundingClientRect().bottom;
|
|
10201
10211
|
let bottom = this.getPageNoteBottom(page);
|
|
10202
10212
|
for (const list of lists) {
|
|
@@ -14013,6 +14023,8 @@ section.${c}>footer { z-index: 1; }
|
|
|
14013
14023
|
const row = this.toHTML(elem, ns.html, "tr", children);
|
|
14014
14024
|
if (elem.isHeader)
|
|
14015
14025
|
row.dataset.docxRepeatHeader = "true";
|
|
14026
|
+
if (this.repeatedTableHeaderRows.has(elem))
|
|
14027
|
+
row.dataset.docxRepeatedHeader = "true";
|
|
14016
14028
|
return row;
|
|
14017
14029
|
}
|
|
14018
14030
|
renderTableCellPlaceholder(colSpan) {
|