@datarailsshared/dr_renderer 1.2.89 → 1.2.92

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.89",
3
+ "version": "1.2.92",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -4,6 +4,8 @@ let initDRPivotTable = function($, window, document) {
4
4
  var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
5
5
 
6
6
  var DRPivotData, sortDateStrings, getSort, processKey, SubtotalRenderer, getFormattedNumber, largeToSmallSort, largeToSmallSortByAbsolute, NovixRenderer;
7
+ const newTableColors = ['rgb(127, 196, 255)', 'rgb(200, 243,243)', 'rgb(247, 161, 173)', 'rgb(255, 237, 178)', 'rgb(221, 239, 255)',
8
+ 'rgb(171, 216, 255)', 'rgb(174, 231, 220)', 'rgb(227, 255, 236)', 'rgb(162, 215, 227)', 'rgb(223, 239, 236)'];
7
9
 
8
10
  var delim = " , ";
9
11
  const useNewUx = document.ReportHippo && document.ReportHippo && document.ReportHippo.user &&
@@ -259,8 +261,9 @@ let initDRPivotTable = function($, window, document) {
259
261
 
260
262
  DRPivotData.prototype.getAggregator = function(rowKey, colKey) {
261
263
  var agg, flatColKey, flatRowKey;
262
- flatRowKey = rowKey.join(delim);
263
- flatColKey = colKey.join(delim);
264
+ let hebrewMarkRegex = new RegExp(String.fromCharCode(8206), 'g');
265
+ flatRowKey = rowKey.join(delim).replace(hebrewMarkRegex, '');
266
+ flatColKey = colKey.join(delim).replace(hebrewMarkRegex, '');
264
267
  if (rowKey.length === 0 && colKey.length === 0) {
265
268
  agg = this.allTotal;
266
269
  } else if (rowKey.length === 0) {
@@ -481,7 +484,7 @@ let initDRPivotTable = function($, window, document) {
481
484
  }
482
485
 
483
486
  SubtotalRenderer = function(pivotData, opts, charttype, tooMuch = false, error_params) {
484
- 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;
485
488
  var createTotalValsBolder, createGrandTotalBolder, getHeaderColorProperties, colorizeRowLabelHeaders, colorizeTableIfNeed, valueNoDashes, getColorsWithOffsetForTable, offsetColors, handleFreezePanesScroll, selectFreezableElements, removeRowHeaderNullValue;
486
489
  var getAdditionalAggregation, buildAdditionalHeaderCols, buildAdditionalHeaderRows, buildAdditionalColValues, buildAdditionalRowValues, buildAdditionalRowTotals, buildAdditionalColTotals;
487
490
  var additionalFieldsCol, additionalFieldsRow, additionalFieldsList;
@@ -646,8 +649,10 @@ let initDRPivotTable = function($, window, document) {
646
649
  if (opts.paletteOptions.widgetPalette) {
647
650
  const mc_palette = _.find(_.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
648
651
  colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
649
- } else if (opts.paletteOptions.dashboardPalette.colors) {
652
+ } else if (opts.paletteOptions.dashboardPalette && opts.paletteOptions.dashboardPalette.colors) {
650
653
  colors = opts.paletteOptions.dashboardPalette.colors;
654
+ } else {
655
+ colors = newTableColors;
651
656
  }
652
657
 
653
658
  var isNewDesign = useNewUx && opts.chartOptions.table_options.use_new_table_design;
@@ -775,24 +780,30 @@ let initDRPivotTable = function($, window, document) {
775
780
  applyInlineStyles = function(element, className) {
776
781
  const tableDesignOptions = opts.chartOptions.table_design_options;
777
782
  let optionName;
778
- if (!className || !tableDesignOptions) return element;
779
-
780
- if (element.className.includes('pvtAxisLabel') ||
781
- element.className.includes('pvtColLabel')) {
782
- optionName = 'columns';
783
- } else if (element.className.includes('pvtRowLabel')) {
784
- optionName = 'rows';
785
- } else if (element.className.includes('pvtVal') &&
786
- !element.className.includes('pvtTotal')) {
787
- optionName = 'values';
788
- } else if (element.className.includes('colTotal') ||
789
- element.className.includes('rowTotal') ||
790
- element.className.includes('pvtGrandTotal')) {
791
- optionName = 'totals';
792
- }
793
- element.style.fontSize = tableDesignOptions[optionName + '_font_size'] + 'px';
794
- element.style.textAlign = tableDesignOptions[optionName + '_align_text'];
795
- element.style.fontFamily = tableDesignOptions[optionName + '_font_style'];
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
+
796
807
  return element;
797
808
  }
798
809
  createElement = function(elementType, className, textContent, attributes, eventHandlers) {
@@ -7188,7 +7188,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7188
7188
  return filters;
7189
7189
  };
7190
7190
 
7191
- highchartsRenderer.prepareDrillDownGraphFilters = function (rowKey, colKey, widget) {
7191
+ highchartsRenderer.prepareDrillDownGraphFilters = function (r_key, c_key, widget) {
7192
+ let rowKey = r_key;
7193
+ let colKey = c_key;
7194
+ let widgetOptions = typeof widget.options === 'string' ? JSON.parse(widget.options) : widget.options;
7195
+ if (lodash.get(widgetOptions, 'chartOptions.table_options.transpose_table', false)) {
7196
+ rowKey = c_key;
7197
+ colKey = r_key;
7198
+ }
7199
+
7192
7200
  let filters = lodash.cloneDeep(widget.filters);
7193
7201
  for (let i = 0; i < rowKey.length; i++) {
7194
7202
  let filter = lodash.find(filters, {name: widget.rows[i].name});