@datarailsshared/dr_renderer 1.2.91 → 1.2.94
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/dr_pivottable.js +25 -19
- package/src/highcharts_renderer.js +15 -3
- package/src/index.js +2 -2
- package/src/pivot.css +1 -1
- package/src/pivottable.js +1 -1
package/package.json
CHANGED
package/src/dr_pivottable.js
CHANGED
|
@@ -484,7 +484,7 @@ let initDRPivotTable = function($, window, document) {
|
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
SubtotalRenderer = function(pivotData, opts, charttype, tooMuch = false, error_params) {
|
|
487
|
-
var addClass, allTotal, arrowCollapsed, arrowExpanded, buildColHeaderHeader, buildColHeaderHeaders, buildColHeaderHeadersClickEvents, buildColHeaders, buildColTotals, buildColTotalsHeader, buildGrandTotal, buildRowHeaderHeaders, buildRowHeaderHeadersClickEvents, buildRowHeaders, buildRowTotalsHeader, buildValues, classColCollapsed, classColExpanded, classColHide, classColShow, classCollapsed, classExpanded, classRowCollapsed, classRowExpanded, classRowHide, classRowShow, clickStatusCollapsed, clickStatusExpanded, colAttrs, colDisableAfter, colKeys, colTotals, collapseCol, collapseColsAt, collapseHideDescendantRow, collapseRow, collapseRowsAt, collapseShowColSubtotal, collapseShowRowSubtotal, createElement, defaults, expandChildCol, expandChildRow, expandCol, expandColsAt, expandHideColSubtotal, expandHideRowSubtotal, expandRow, expandRowsAt, expandShowColSubtotal, expandShowRowSubtotal, getTableEventHandlers, hasClass, hideDescendantCol, isColDisable, isColDisableExpandCollapse, isColHideOnExpand, isRowDisable, isRowDisableExpandCollapse, isRowHideOnExpand, main, getSubtotalInBrackets, processKeys, encodeHtmlEntities, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, removeClass, replaceClass, rowAttrs, rowDisableAfter, rowKeys, rowTotals, setAttributes, showChildCol, showChildRow, toggleCol, toggleColHeaderHeader, toggleRow, toggleRowHeaderHeader, tree, assumptionSubscribe;
|
|
487
|
+
var addClass, allTotal, arrowCollapsed, arrowExpanded, buildColHeaderHeader, buildColHeaderHeaders, buildColHeaderHeadersClickEvents, buildColHeaders, buildColTotals, buildColTotalsHeader, buildGrandTotal, buildRowHeaderHeaders, buildRowHeaderHeadersClickEvents, buildRowHeaders, buildRowTotalsHeader, buildValues, classColCollapsed, classColExpanded, classColHide, classColShow, classCollapsed, classExpanded, classRowCollapsed, classRowExpanded, classRowHide, classRowShow, clickStatusCollapsed, clickStatusExpanded, colAttrs, colDisableAfter, colKeys, colTotals, collapseCol, collapseColsAt, collapseHideDescendantRow, collapseRow, collapseRowsAt, collapseShowColSubtotal, collapseShowRowSubtotal, applyInlineStyles, createElement, defaults, expandChildCol, expandChildRow, expandCol, expandColsAt, expandHideColSubtotal, expandHideRowSubtotal, expandRow, expandRowsAt, expandShowColSubtotal, expandShowRowSubtotal, getTableEventHandlers, hasClass, hideDescendantCol, isColDisable, isColDisableExpandCollapse, isColHideOnExpand, isRowDisable, isRowDisableExpandCollapse, isRowHideOnExpand, main, getSubtotalInBrackets, processKeys, encodeHtmlEntities, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, removeClass, replaceClass, rowAttrs, rowDisableAfter, rowKeys, rowTotals, setAttributes, showChildCol, showChildRow, toggleCol, toggleColHeaderHeader, toggleRow, toggleRowHeaderHeader, tree, assumptionSubscribe;
|
|
488
488
|
var createTotalValsBolder, createGrandTotalBolder, getHeaderColorProperties, colorizeRowLabelHeaders, colorizeTableIfNeed, valueNoDashes, getColorsWithOffsetForTable, offsetColors, handleFreezePanesScroll, selectFreezableElements, removeRowHeaderNullValue;
|
|
489
489
|
var getAdditionalAggregation, buildAdditionalHeaderCols, buildAdditionalHeaderRows, buildAdditionalColValues, buildAdditionalRowValues, buildAdditionalRowTotals, buildAdditionalColTotals;
|
|
490
490
|
var additionalFieldsCol, additionalFieldsRow, additionalFieldsList;
|
|
@@ -780,24 +780,30 @@ let initDRPivotTable = function($, window, document) {
|
|
|
780
780
|
applyInlineStyles = function(element, className) {
|
|
781
781
|
const tableDesignOptions = opts.chartOptions.table_design_options;
|
|
782
782
|
let optionName;
|
|
783
|
-
if (!className
|
|
784
|
-
|
|
785
|
-
if
|
|
786
|
-
element.className
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
783
|
+
if (!className) return element;
|
|
784
|
+
|
|
785
|
+
if(element.className){
|
|
786
|
+
if (_.includes(element.className, 'pvtAxisLabel') ||
|
|
787
|
+
_.includes(element.className, 'pvtColLabel')) {
|
|
788
|
+
optionName = 'columns';
|
|
789
|
+
}else if (_.includes(element.className,'pvtRowLabel')) {
|
|
790
|
+
optionName = 'rows';
|
|
791
|
+
} else if (_.includes(element.className,'pvtVal') &&
|
|
792
|
+
!_.includes(element.className,'pvtTotal')) {
|
|
793
|
+
optionName = 'values';
|
|
794
|
+
} else if (_.includes(element.className,'colTotal') ||
|
|
795
|
+
_.includes(element.className,'rowTotal') ||
|
|
796
|
+
_.includes(element.className,'pvtGrandTotal')) {
|
|
797
|
+
optionName = 'totals';
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
if(optionName && tableDesignOptions){
|
|
802
|
+
element.style.fontSize = tableDesignOptions[optionName + '_font_size'] + 'px';
|
|
803
|
+
element.style.textAlign = tableDesignOptions[optionName + '_align_text'];
|
|
804
|
+
element.style.fontFamily = tableDesignOptions[optionName + '_font_style'];
|
|
805
|
+
}
|
|
806
|
+
|
|
801
807
|
return element;
|
|
802
808
|
}
|
|
803
809
|
createElement = function(elementType, className, textContent, attributes, eventHandlers) {
|
|
@@ -323,8 +323,20 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
highchartsRenderer.downloadFile = function (title, graph_id, type) {
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
let chart = null;
|
|
327
|
+
|
|
328
|
+
const chartElement = $('#' + graph_id).find('div.chart');
|
|
329
|
+
if (chartElement.highcharts) {
|
|
330
|
+
chart = chartElement.highcharts();
|
|
331
|
+
} else {
|
|
332
|
+
const graphId = Number(graph_id.split('_')[1]);
|
|
333
|
+
chart = lodash.find(window.Highcharts.charts, function(value) {
|
|
334
|
+
return value.options.widgetId === graphId;
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (!chart) return;
|
|
339
|
+
|
|
328
340
|
/*if(chart.title && chart.title.textStr){
|
|
329
341
|
png_name = chart.title.textStr
|
|
330
342
|
}else{
|
|
@@ -334,7 +346,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
334
346
|
if (type === 'png') {
|
|
335
347
|
chart.exportChartLocal({
|
|
336
348
|
//type: 'application/png',
|
|
337
|
-
filename:
|
|
349
|
+
filename: title
|
|
338
350
|
});
|
|
339
351
|
}
|
|
340
352
|
if (type === 'XLS') {
|
package/src/index.js
CHANGED
|
@@ -20,8 +20,8 @@ dr_render_factory.getInitHighchartsRenderer = function($, document, Highcharts,
|
|
|
20
20
|
return getHighchartsRenderer($, document, Highcharts, default_colors, highchartsRenderer, DataFormatter, lodash, moment_lib);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
dr_render_factory.getInitPublishedItemsRenderer = function (publishedItemsRenderer) {
|
|
24
|
-
return getPublishedItemsRenderer(publishedItemsRenderer);
|
|
23
|
+
dr_render_factory.getInitPublishedItemsRenderer = function (publishedItemsRenderer, bind = {}) {
|
|
24
|
+
return getPublishedItemsRenderer.bind(bind)(publishedItemsRenderer);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
//const $ = require( "jquery" )( window );
|
package/src/pivot.css
CHANGED
|
@@ -394,7 +394,7 @@ table.pvtTable.newPvtTable tbody tr td:hover {
|
|
|
394
394
|
|
|
395
395
|
table.pvtTable.newPvtTable tbody tr td.hover:after,
|
|
396
396
|
table.pvtTable.newPvtTable tbody tr td:hover:after {
|
|
397
|
-
content: "\
|
|
397
|
+
content: "\e923";
|
|
398
398
|
width: 2px;
|
|
399
399
|
color: #85889c;
|
|
400
400
|
font: normal normal normal 14px/1 DataRails;
|
package/src/pivottable.js
CHANGED
|
@@ -926,7 +926,7 @@ let initPivotTable = function($, window, document) {
|
|
|
926
926
|
return PivotData;
|
|
927
927
|
|
|
928
928
|
})();
|
|
929
|
-
$.pivotUtilities = {
|
|
929
|
+
window.$.pivotUtilities = $.pivotUtilities = {
|
|
930
930
|
aggregatorTemplates: aggregatorTemplates,
|
|
931
931
|
aggregators: aggregators,
|
|
932
932
|
renderers: renderers,
|