@datarailsshared/dr_renderer 1.2.96 → 1.2.99
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/package.json +1 -1
- package/src/highcharts_renderer.js +6 -0
- package/src/pivot.css +5 -0
- package/src/published_items_renderer.js +92 -69
package/package.json
CHANGED
|
@@ -6771,6 +6771,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6771
6771
|
tooltip = ''
|
|
6772
6772
|
}
|
|
6773
6773
|
|
|
6774
|
+
all_vals = highchartsRenderer.decodeFunc(all_vals);
|
|
6775
|
+
tooltip = highchartsRenderer.decodeFunc(tooltip);
|
|
6776
|
+
|
|
6774
6777
|
return {
|
|
6775
6778
|
label: displayname + all_vals,
|
|
6776
6779
|
tooltip: displayname + tooltip
|
|
@@ -6808,6 +6811,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6808
6811
|
all_vals = ' (All)';
|
|
6809
6812
|
}
|
|
6810
6813
|
|
|
6814
|
+
all_vals = highchartsRenderer.decodeFunc(all_vals);
|
|
6815
|
+
tooltip = highchartsRenderer.decodeFunc(tooltip);
|
|
6816
|
+
|
|
6811
6817
|
return {
|
|
6812
6818
|
label: displayname + all_vals,
|
|
6813
6819
|
tooltip: displayname + tooltip
|
package/src/pivot.css
CHANGED
|
@@ -24,6 +24,11 @@ table.pvtTable thead tr th, table.pvtTable tbody tr th {
|
|
|
24
24
|
font-weight: 700;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
table.pvtTable thead tr th > i,
|
|
28
|
+
table.pvtTable tbody tr th > i {
|
|
29
|
+
font-size: 10px;
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
table.pvtTable .pvtColLabel {text-align: center;}
|
|
28
33
|
table.pvtTable .pvtTotalLabel {text-align: right;}
|
|
29
34
|
|
|
@@ -18,74 +18,78 @@ let getPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
publishedItemsRenderer.resizeTable = function (options,
|
|
21
|
+
publishedItemsRenderer.resizeTable = function (options, iframeWindow) {
|
|
22
22
|
options.alreadySetTimeout = null;
|
|
23
|
-
const publish_item_image =
|
|
24
|
-
const table =
|
|
25
|
-
const body =
|
|
26
|
-
let body_zoom = body.style.zoom;
|
|
27
|
-
body_zoom = parseFloat(body_zoom);
|
|
23
|
+
const publish_item_image = iframeWindow.document.getElementById('publish_item_image');
|
|
24
|
+
const table = iframeWindow.document.getElementsByTagName("table")[0];
|
|
25
|
+
const body = iframeWindow.document.getElementsByTagName("body")[0];
|
|
28
26
|
|
|
29
|
-
if (
|
|
30
|
-
|
|
27
|
+
if (table && options.responsive) {
|
|
28
|
+
publishedItemsRenderer.zoomTable(iframeWindow, table, body);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
zoom = parseFloat(zoom);
|
|
31
|
+
publishedItemsRenderer.resizePublishedImage(publish_item_image, iframeWindow, body);
|
|
32
|
+
}
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
publishedItemsRenderer.zoomTable = function(iframeWindow, table, body) {
|
|
35
|
+
let body_zoom = body.style.zoom;
|
|
36
|
+
body_zoom = parseFloat(body_zoom) || 1;
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
publishedItemsRenderer.resizeTable(options, window);
|
|
53
|
-
}, 10);
|
|
54
|
-
}
|
|
55
|
-
} else if (height >= window.innerHeight || width >= window.innerWidth) {
|
|
56
|
-
zoom -= 0.05;
|
|
57
|
-
height = (positionInfo.height + positionInfo.y * 2) * zoom * body_zoom;
|
|
58
|
-
width = (positionInfo.width + positionInfo.x * 2) * zoom * body_zoom;
|
|
38
|
+
let zoom = table.style.zoom;
|
|
39
|
+
zoom = parseFloat(zoom) || 1;
|
|
40
|
+
|
|
41
|
+
const positionInfo = table.getBoundingClientRect();
|
|
42
|
+
let width = Math.ceil((positionInfo.width + iframeWindow.innerWidth - iframeWindow.document.body.offsetWidth) * zoom * body_zoom);
|
|
43
|
+
|
|
44
|
+
if (width < iframeWindow.innerWidth) {
|
|
45
|
+
zoom += 0.05;
|
|
46
|
+
|
|
47
|
+
width = Math.ceil((positionInfo.width + iframeWindow.innerWidth - iframeWindow.document.body.offsetWidth) * zoom * body_zoom);
|
|
48
|
+
if (width < iframeWindow.innerWidth) {
|
|
59
49
|
table.style.zoom = zoom;
|
|
60
|
-
if (height >= window.innerHeight || width >= window.innerWidth) {
|
|
61
|
-
setTimeout(function () {
|
|
62
|
-
publishedItemsRenderer.resizeTable(options, window);
|
|
63
|
-
}, 10);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (publish_item_image) {
|
|
68
|
-
if (publish_item_image.style.height === '100%') {
|
|
69
|
-
publish_item_image.style.height = 'auto';
|
|
70
|
-
publish_item_image.style.width = '100%';
|
|
71
|
-
publish_item_image.style.marginTop = "";
|
|
72
50
|
setTimeout(function () {
|
|
73
|
-
publishedItemsRenderer.
|
|
51
|
+
publishedItemsRenderer.zoomTable(iframeWindow, table, body);
|
|
74
52
|
}, 10);
|
|
75
53
|
}
|
|
54
|
+
} else if (width >= iframeWindow.innerWidth) {
|
|
55
|
+
zoom -= 0.05;
|
|
76
56
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const temp = (window.innerHeight - height) / 2;
|
|
84
|
-
publish_item_image.style.marginTop = (temp / body_zoom + imgPositionInfo.y) + "px";
|
|
57
|
+
width = Math.ceil((positionInfo.width + iframeWindow.innerWidth - iframeWindow.document.body.offsetWidth) * zoom * body_zoom);
|
|
58
|
+
table.style.zoom = zoom;
|
|
59
|
+
if (width >= iframeWindow.innerWidth) {
|
|
60
|
+
setTimeout(function () {
|
|
61
|
+
publishedItemsRenderer.zoomTable(iframeWindow, table, body);
|
|
62
|
+
}, 10);
|
|
85
63
|
}
|
|
86
64
|
}
|
|
87
65
|
}
|
|
88
66
|
|
|
67
|
+
publishedItemsRenderer.resizePublishedImage = function(publish_item_image, iframeWindow, body) {
|
|
68
|
+
if (!publish_item_image) return;
|
|
69
|
+
|
|
70
|
+
let body_zoom = body.style.zoom;
|
|
71
|
+
body_zoom = parseFloat(body_zoom) || 1;
|
|
72
|
+
|
|
73
|
+
if (publish_item_image.style.height === '100%') {
|
|
74
|
+
publish_item_image.style.height = 'auto';
|
|
75
|
+
publish_item_image.style.width = '100%';
|
|
76
|
+
publish_item_image.style.marginTop = "";
|
|
77
|
+
setTimeout(function () {
|
|
78
|
+
publishedItemsRenderer.resizePublishedImage(publish_item_image, iframeWindow, body);
|
|
79
|
+
}, 10);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const imgPositionInfo = publish_item_image.getBoundingClientRect();
|
|
83
|
+
const height = (imgPositionInfo.height + imgPositionInfo.y * 2) * body_zoom;
|
|
84
|
+
if (height > iframeWindow.innerHeight) {
|
|
85
|
+
publish_item_image.style.height = '100%';
|
|
86
|
+
publish_item_image.style.width = 'auto';
|
|
87
|
+
} else if (height < iframeWindow.innerHeight) {
|
|
88
|
+
const temp = (iframeWindow.innerHeight - height) / 2;
|
|
89
|
+
publish_item_image.style.marginTop = (temp / body_zoom + imgPositionInfo.y) + "px";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
89
93
|
publishedItemsRenderer.resetTableZoom = function (document) {
|
|
90
94
|
const table = document.getElementsByTagName("table")[0];
|
|
91
95
|
if (table) {
|
|
@@ -93,16 +97,22 @@ let getPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
publishedItemsRenderer.changedAutoResize = function (options,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
publishedItemsRenderer.changedAutoResize = function (options, iframeWindow, document) {
|
|
101
|
+
Object.assign(iframeWindow.__options__, options);
|
|
102
|
+
const table = document.getElementsByTagName("table")[0];
|
|
103
|
+
if (table) {
|
|
104
|
+
table.style.margin = options.responsive ? '0 auto' : '';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!options.responsive) {
|
|
108
|
+
publishedItemsRenderer.resetTableZoom(document);
|
|
109
|
+
} else {
|
|
110
|
+
if (!options.alreadySetTimeout) {
|
|
111
|
+
options.alreadySetTimeout = setTimeout(function () {
|
|
112
|
+
publishedItemsRenderer.resizeTable(options, iframeWindow);
|
|
113
|
+
}, 100);
|
|
105
114
|
}
|
|
115
|
+
}
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
publishedItemsRenderer.changedInputValue = function (firstTime, scope, options) {
|
|
@@ -312,18 +322,18 @@ let getPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
|
312
322
|
}
|
|
313
323
|
}
|
|
314
324
|
|
|
315
|
-
publishedItemsRenderer.addEventListeners = function (document,
|
|
325
|
+
publishedItemsRenderer.addEventListeners = function (document, iframeWindow, scope, options) {
|
|
316
326
|
document.addEventListener("DOMContentLoaded", function () {
|
|
317
327
|
if (!options.alreadySetTimeout) {
|
|
318
328
|
options.alreadySetTimeout = setTimeout(function () {
|
|
319
|
-
publishedItemsRenderer.resizeTable(options,
|
|
329
|
+
publishedItemsRenderer.resizeTable(options, iframeWindow);
|
|
320
330
|
}, 50);
|
|
321
331
|
}
|
|
322
332
|
});
|
|
323
|
-
|
|
333
|
+
iframeWindow.addEventListener("resize", function () {
|
|
324
334
|
if (!options.alreadySetTimeout) {
|
|
325
335
|
options.alreadySetTimeout = setTimeout(function () {
|
|
326
|
-
publishedItemsRenderer.resizeTable(
|
|
336
|
+
publishedItemsRenderer.resizeTable(iframeWindow.__options__, iframeWindow);
|
|
327
337
|
}, 100);
|
|
328
338
|
}
|
|
329
339
|
});
|
|
@@ -334,7 +344,7 @@ let getPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
|
334
344
|
let td_elem = all_a_hrefs[i].closest('td');
|
|
335
345
|
td_elem.classList.add("apply_hover");
|
|
336
346
|
td_elem.addEventListener('click', function (event) {
|
|
337
|
-
publishedItemsRenderer.formulaCellClicked(event, scope, options,
|
|
347
|
+
publishedItemsRenderer.formulaCellClicked(event, scope, options, iframeWindow)
|
|
338
348
|
});
|
|
339
349
|
}
|
|
340
350
|
}
|
|
@@ -348,17 +358,30 @@ let getPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
|
348
358
|
return this.options.inputValuesData;
|
|
349
359
|
}
|
|
350
360
|
|
|
351
|
-
publishedItemsRenderer.initPublishedItem = function (document,
|
|
361
|
+
publishedItemsRenderer.initPublishedItem = function (document, iframeWindow, scope, options) {
|
|
352
362
|
this.document = document;
|
|
353
363
|
this.scope = scope;
|
|
354
364
|
this.options = options;
|
|
365
|
+
iframeWindow.__options__ = options;
|
|
355
366
|
publishedItemsRenderer.prepareInputCells(document, scope, options, this.isScenarioMode);
|
|
356
|
-
publishedItemsRenderer.
|
|
367
|
+
publishedItemsRenderer.applyInitDocumentStyles(document, iframeWindow);
|
|
368
|
+
publishedItemsRenderer.addEventListeners(document, iframeWindow, scope, options);
|
|
357
369
|
|
|
358
370
|
setTimeout(function () {
|
|
359
371
|
publishedItemsRenderer.changedInputValue(true, scope, options);
|
|
360
372
|
}, 500);
|
|
361
373
|
}
|
|
374
|
+
|
|
375
|
+
publishedItemsRenderer.applyInitDocumentStyles = function(document, iframeWindow) {
|
|
376
|
+
const table = document.getElementsByTagName('table')[0];
|
|
377
|
+
if (table) {
|
|
378
|
+
table.style.overflow = 'hidden';
|
|
379
|
+
table.style.margin = iframeWindow.__options__.responsive ? '0 auto' : '';
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const body = document.body;
|
|
383
|
+
body.style.margin = '0';
|
|
384
|
+
}
|
|
362
385
|
}
|
|
363
386
|
|
|
364
387
|
module.exports = getPublishedItemsRenderer;
|