@refinitiv-ui/efx-grid 6.1.0 → 6.1.2
Sign up to get free protection for your applications and to get access to all the features.
package/lib/grid/index.js
CHANGED
@@ -76,6 +76,18 @@ CellWriter.prototype.setTooltip = function (str) {
|
|
76
76
|
this._elem.removeAttribute("title");
|
77
77
|
}
|
78
78
|
};
|
79
|
+
/** @public
|
80
|
+
* @ignore
|
81
|
+
* @param {string} type
|
82
|
+
* @param {*=} tooltip
|
83
|
+
*/
|
84
|
+
CellWriter.prototype.setTooltipInfo = function(type, tooltip) {
|
85
|
+
};
|
86
|
+
/** @public
|
87
|
+
* @ignore
|
88
|
+
*/
|
89
|
+
CellWriter.prototype.updateTooltip = function() {
|
90
|
+
};
|
79
91
|
|
80
92
|
/** @public
|
81
93
|
* @param {string} str
|
@@ -29,10 +29,11 @@ let _getPageSize = function (options) {
|
|
29
29
|
pageHeight = options["pageHeight"];
|
30
30
|
}
|
31
31
|
}
|
32
|
-
|
32
|
+
// WARNING: clientWidth and clientHeight still include padding from the element
|
33
|
+
if (!pageWidth || pageWidth < 0) {
|
33
34
|
pageWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
34
35
|
}
|
35
|
-
if (!pageHeight) {
|
36
|
+
if (!pageHeight || pageHeight < 0) {
|
36
37
|
pageHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
37
38
|
}
|
38
39
|
|
@@ -109,7 +110,7 @@ let _setColumnAlignment = function (tbl, colIndex, alignment) {
|
|
109
110
|
if (!cells) return;
|
110
111
|
for (let i = cells.length; --i >= 0;) {
|
111
112
|
let cell = cells[i];
|
112
|
-
cell.
|
113
|
+
cell.style.textAlign = alignment;
|
113
114
|
}
|
114
115
|
};
|
115
116
|
|
@@ -215,13 +216,13 @@ GridPrinter.getPreFlightInfo = function (grid, options) {
|
|
215
216
|
}
|
216
217
|
pfInfo._calculated = false;
|
217
218
|
if (GridPrinter._options["pageWidth"]) {
|
218
|
-
|
219
|
+
pfInfo.pageWidth = GridPrinter._options["pageWidth"];
|
219
220
|
}
|
220
221
|
if (GridPrinter._options["pageHeight"]) {
|
221
|
-
|
222
|
+
pfInfo.pageHeight = GridPrinter._options["pageHeight"];
|
222
223
|
}
|
223
224
|
|
224
|
-
let pageSize = _getPageSize(
|
225
|
+
let pageSize = _getPageSize(pfInfo);
|
225
226
|
let pageWidth = pfInfo.pageWidth = pageSize.pageWidth;
|
226
227
|
let pageHeight = pfInfo.pageHeight = pageSize.pageHeight;
|
227
228
|
|
@@ -320,14 +321,21 @@ GridPrinter.getPreFlightInfo = function (grid, options) {
|
|
320
321
|
// Find cutoff point for each page
|
321
322
|
let titleSect = grid.getSection("title");
|
322
323
|
let headerHeight = pfInfo.headerHeight = (titleSect.isVisible()) ? titleSect.getDefaultRowHeight() : 0;
|
324
|
+
let availableSpace = pageHeight - headerHeight;
|
325
|
+
|
323
326
|
let rowHeight = pfInfo.rowHeight = grid.getSection("content").getDefaultRowHeight();
|
324
|
-
let maxRowPerPage =
|
327
|
+
let maxRowPerPage = totalRowCount;
|
328
|
+
if(availableSpace < (totalRowCount * rowHeight)) {
|
329
|
+
maxRowPerPage = Math.floor(availableSpace / rowHeight);
|
330
|
+
}
|
331
|
+
|
325
332
|
if (!(maxRowPerPage > 0)) { // NaN, negative number, or zero is not allowed.
|
326
333
|
maxRowPerPage = 1; // number of content rows
|
327
334
|
}
|
328
335
|
pfInfo.maxRowPerPage = maxRowPerPage;
|
329
336
|
|
330
|
-
|
337
|
+
// Number of grid require to render all of the rows. Grid must fit a single page
|
338
|
+
let gridCount = pfInfo.gridCount = (totalRowCount > maxRowPerPage) ? Math.ceil(totalRowCount / maxRowPerPage) : 1;
|
331
339
|
// let lastPageRowCount = totalRowCount - (totalRowCount / maxRowPerPage | 0);
|
332
340
|
pfInfo.pageCount = gridCount * colSetCount;
|
333
341
|
|
@@ -517,15 +525,6 @@ GridPrinter._applyCss = function () {
|
|
517
525
|
"color: black;",
|
518
526
|
"background-color: white;"
|
519
527
|
],
|
520
|
-
".tr-printing-root .tr-align-left", [
|
521
|
-
"text-align: left;"
|
522
|
-
],
|
523
|
-
".tr-printing-root .tr-align-right", [
|
524
|
-
"text-align: right;"
|
525
|
-
],
|
526
|
-
".tr-printing-root .tr-align-center", [
|
527
|
-
"text-align: center;"
|
528
|
-
],
|
529
528
|
".tr-printing-root .cell ef-icon", [
|
530
529
|
"margin-top: 3px;"
|
531
530
|
],
|
package/lib/versions.json
CHANGED
package/package.json
CHANGED