@datarailsshared/dr_renderer 1.2.434 → 1.2.436
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
package/src/dataformatter.js
CHANGED
@@ -350,7 +350,7 @@ var DataFormatterImpl = function () {
|
|
350
350
|
|
351
351
|
n = this.roundDecimals(n, decimals).toString().split('.');
|
352
352
|
var integerPart = n[0];
|
353
|
-
var decimalPart = n[1] || 0;
|
353
|
+
var decimalPart = String(n[1] || 0).padEnd(decimals, '0');
|
354
354
|
|
355
355
|
return this.applyNumberPattern(integerPart, patternIntegerPart) + this.locale.decimalSeparator + this.applyNumberPattern(decimalPart, patternDecimalPart, n[1] && n[1][0] == '0' ? '' : 'right');
|
356
356
|
}
|
@@ -2376,14 +2376,14 @@ describe('highcharts_renderer', () => {
|
|
2376
2376
|
|
2377
2377
|
it('Should return widget format if it\'s graph', () => {
|
2378
2378
|
aggregatorObject.widget_values_format = '\"$\"#,###.###';
|
2379
|
-
expect(aggregatorObject.format(2, false)).toBe('$2.
|
2379
|
+
expect(aggregatorObject.format(2, false)).toBe('$2.000');
|
2380
2380
|
});
|
2381
2381
|
|
2382
2382
|
it('Should return widget format if it\'s only_formats', () => {
|
2383
2383
|
aggregator = highchartsRenderer.rhPivotAggregatorUniqValues(arg, widget_values_format, false, render_options, calculated_info);
|
2384
2384
|
aggregatorObject = aggregator({}, '', '');
|
2385
2385
|
aggregatorObject.widget_values_format = '\"$\"#,###.###';
|
2386
|
-
expect(aggregatorObject.format(2, true)).toBe('$2.
|
2386
|
+
expect(aggregatorObject.format(2, true)).toBe('$2.000');
|
2387
2387
|
});
|
2388
2388
|
|
2389
2389
|
it('Should return uniq values if it\'s table and not only_formats', () => {
|
@@ -4731,7 +4731,7 @@ describe('highcharts_renderer', () => {
|
|
4731
4731
|
};
|
4732
4732
|
const type = 'colFormats';
|
4733
4733
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4734
|
-
expect(formattedKey).toEqual(['$1000.
|
4734
|
+
expect(formattedKey).toEqual(['$1000.00']);
|
4735
4735
|
});
|
4736
4736
|
|
4737
4737
|
it('should return properly formatted rowKey as array', () => {
|
@@ -4743,7 +4743,7 @@ describe('highcharts_renderer', () => {
|
|
4743
4743
|
};
|
4744
4744
|
const type = 'rowFormats';
|
4745
4745
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4746
|
-
expect(formattedKey).toEqual(['$1000.
|
4746
|
+
expect(formattedKey).toEqual(['$1000.00']);
|
4747
4747
|
});
|
4748
4748
|
|
4749
4749
|
it('should return properly formatted colKey as string', () => {
|
@@ -4755,7 +4755,7 @@ describe('highcharts_renderer', () => {
|
|
4755
4755
|
};
|
4756
4756
|
const type = 'colFormats';
|
4757
4757
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4758
|
-
expect(formattedKey).toEqual('$1000.
|
4758
|
+
expect(formattedKey).toEqual('$1000.00');
|
4759
4759
|
});
|
4760
4760
|
|
4761
4761
|
it('should return properly formatted rowKey as string', () => {
|
@@ -4767,7 +4767,7 @@ describe('highcharts_renderer', () => {
|
|
4767
4767
|
};
|
4768
4768
|
const type = 'rowFormats';
|
4769
4769
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4770
|
-
expect(formattedKey).toEqual('$1000.
|
4770
|
+
expect(formattedKey).toEqual('$1000.00');
|
4771
4771
|
});
|
4772
4772
|
|
4773
4773
|
it('should return formatted multivalue colKey as string', () => {
|
@@ -4778,7 +4778,7 @@ describe('highcharts_renderer', () => {
|
|
4778
4778
|
};
|
4779
4779
|
const type = 'colFormats';
|
4780
4780
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4781
|
-
expect(formattedKey).toEqual('$1000.
|
4781
|
+
expect(formattedKey).toEqual('$1000.00 , ₪2000.00');
|
4782
4782
|
});
|
4783
4783
|
|
4784
4784
|
it('should return formatted multivalue colKey as array', () => {
|
@@ -4789,7 +4789,7 @@ describe('highcharts_renderer', () => {
|
|
4789
4789
|
};
|
4790
4790
|
const type = 'colFormats';
|
4791
4791
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4792
|
-
expect(formattedKey).toEqual(['$1000.
|
4792
|
+
expect(formattedKey).toEqual(['$1000.00', '₪2000.00']);
|
4793
4793
|
});
|
4794
4794
|
|
4795
4795
|
it('should return not formatted second value (test as array)', () => {
|
@@ -4800,7 +4800,7 @@ describe('highcharts_renderer', () => {
|
|
4800
4800
|
};
|
4801
4801
|
const type = 'colFormats';
|
4802
4802
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4803
|
-
expect(formattedKey).toEqual(['$1000.
|
4803
|
+
expect(formattedKey).toEqual(['$1000.00', '2000']);
|
4804
4804
|
});
|
4805
4805
|
|
4806
4806
|
it('should return not formatted first value (test as array)', () => {
|
@@ -4811,7 +4811,7 @@ describe('highcharts_renderer', () => {
|
|
4811
4811
|
};
|
4812
4812
|
const type = 'colFormats';
|
4813
4813
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4814
|
-
expect(formattedKey).toEqual(['1000', '$2000.
|
4814
|
+
expect(formattedKey).toEqual(['1000', '$2000.00']);
|
4815
4815
|
});
|
4816
4816
|
|
4817
4817
|
describe('formatting Dates', () => {
|
@@ -4906,7 +4906,7 @@ describe('highcharts_renderer', () => {
|
|
4906
4906
|
const isCols = true;
|
4907
4907
|
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
4908
4908
|
expect(formattedKeys).toEqual(
|
4909
|
-
[['$1.
|
4909
|
+
[['$1.00', '₪11.00'], ['$2.00', '₪32.00'], ['[null]', '₪43.00'], ['$5.00', '₪54.00'], ['Others', '₪33.00'], ['$6.00', '₪98.00']]
|
4910
4910
|
);
|
4911
4911
|
});
|
4912
4912
|
|
@@ -4915,7 +4915,7 @@ describe('highcharts_renderer', () => {
|
|
4915
4915
|
const isCols = true;
|
4916
4916
|
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
4917
4917
|
expect(formattedKeys).toEqual(
|
4918
|
-
[['1', '₪11.
|
4918
|
+
[['1', '₪11.00'], ['2', '₪32.00'], ['[null]', '₪43.00'], ['5', '₪54.00'], ['Others', '₪33.00'], ['6', '₪98.00']]
|
4919
4919
|
);
|
4920
4920
|
});
|
4921
4921
|
|
@@ -4924,7 +4924,7 @@ describe('highcharts_renderer', () => {
|
|
4924
4924
|
const isCols = true;
|
4925
4925
|
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
4926
4926
|
expect(formattedKeys).toEqual(
|
4927
|
-
[['$1.
|
4927
|
+
[['$1.00', '11'], ['$2.00', '32'], ['[null]', '43'], ['$5.00', '54'], ['Others', '33'], ['$6.00', '98']]
|
4928
4928
|
);
|
4929
4929
|
});
|
4930
4930
|
|
@@ -4933,7 +4933,7 @@ describe('highcharts_renderer', () => {
|
|
4933
4933
|
const isCols = false;
|
4934
4934
|
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
4935
4935
|
expect(formattedKeys).toEqual(
|
4936
|
-
[['$1.
|
4936
|
+
[['$1.00', '₪11.00'], ['$2.00', '₪32.00'], ['[null]', '₪43.00'], ['$5.00', '₪54.00'], ['Others', '₪33.00'], ['$6.00', '₪98.00']]
|
4937
4937
|
);
|
4938
4938
|
});
|
4939
4939
|
|
@@ -4942,7 +4942,7 @@ describe('highcharts_renderer', () => {
|
|
4942
4942
|
const isCols = false;
|
4943
4943
|
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
4944
4944
|
expect(formattedKeys).toEqual(
|
4945
|
-
[['1', '₪11.
|
4945
|
+
[['1', '₪11.00'], ['2', '₪32.00'], ['[null]', '₪43.00'], ['5', '₪54.00'], ['Others', '₪33.00'], ['6', '₪98.00']]
|
4946
4946
|
);
|
4947
4947
|
});
|
4948
4948
|
|
@@ -4951,7 +4951,7 @@ describe('highcharts_renderer', () => {
|
|
4951
4951
|
const isCols = false;
|
4952
4952
|
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
4953
4953
|
expect(formattedKeys).toEqual(
|
4954
|
-
[['$1.
|
4954
|
+
[['$1.00', '11'], ['$2.00', '32'], ['[null]', '43'], ['$5.00', '54'], ['Others', '33'], ['$6.00', '98']]
|
4955
4955
|
);
|
4956
4956
|
});
|
4957
4957
|
});
|
@@ -5390,11 +5390,11 @@ describe('highcharts_renderer', () => {
|
|
5390
5390
|
const formatCases = [
|
5391
5391
|
{
|
5392
5392
|
format: '$"#,###.##',
|
5393
|
-
expected: '$12,345.
|
5393
|
+
expected: '$12,345.00'
|
5394
5394
|
},
|
5395
5395
|
{
|
5396
5396
|
format: '%"#,###.##',
|
5397
|
-
expected: '%1,234,500.
|
5397
|
+
expected: '%1,234,500.00'
|
5398
5398
|
},
|
5399
5399
|
{
|
5400
5400
|
format: '#,###',
|
@@ -5429,7 +5429,7 @@ describe('highcharts_renderer', () => {
|
|
5429
5429
|
const tooltipHtml = tooltipFunction.call(displayTooltipContext);
|
5430
5430
|
|
5431
5431
|
expect(tooltipHtml).toEqual(
|
5432
|
-
'<br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.
|
5432
|
+
'<br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.00</span>'
|
5433
5433
|
);
|
5434
5434
|
});
|
5435
5435
|
|
@@ -5443,7 +5443,7 @@ describe('highcharts_renderer', () => {
|
|
5443
5443
|
expect(tooltipHtml).toEqual(
|
5444
5444
|
`<span style="font-weight: bold;">
|
5445
5445
|
col 1
|
5446
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.
|
5446
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.00</span>`
|
5447
5447
|
+ '<br/>% Out of Axis (Category): 10%'
|
5448
5448
|
);
|
5449
5449
|
});
|
@@ -5458,7 +5458,7 @@ describe('highcharts_renderer', () => {
|
|
5458
5458
|
expect(tooltipHtml).toEqual(
|
5459
5459
|
`<span style="font-weight: bold;">
|
5460
5460
|
col 1
|
5461
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.
|
5461
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.00</span>`
|
5462
5462
|
+ '<br/>% Out of Legend (Series): 1%'
|
5463
5463
|
);
|
5464
5464
|
});
|
@@ -5474,7 +5474,7 @@ describe('highcharts_renderer', () => {
|
|
5474
5474
|
expect(tooltipHtml).toEqual(
|
5475
5475
|
`<span style="font-weight: bold;">
|
5476
5476
|
col 1
|
5477
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.
|
5477
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.00</span>`
|
5478
5478
|
+ '<br/>% Out of Axis (Category): 10%, % Out of Legend (Series): 1%'
|
5479
5479
|
);
|
5480
5480
|
});
|
@@ -5494,7 +5494,7 @@ describe('highcharts_renderer', () => {
|
|
5494
5494
|
expect(tooltipHtml).toEqual(
|
5495
5495
|
`<span style="font-weight: bold;">
|
5496
5496
|
col 1
|
5497
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.
|
5497
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.00</span>`
|
5498
5498
|
+ '<br/>% Out of X-AXIS: 10%, % Out of DATA-SERIES: 1%'
|
5499
5499
|
);
|
5500
5500
|
});
|
@@ -5510,7 +5510,7 @@ describe('highcharts_renderer', () => {
|
|
5510
5510
|
expect(tooltipHtml).toEqual(
|
5511
5511
|
`<span style="font-weight: bold;">
|
5512
5512
|
col 1,col 2
|
5513
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$54,321.
|
5513
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$54,321.00</span>`
|
5514
5514
|
);
|
5515
5515
|
});
|
5516
5516
|
|
@@ -5525,7 +5525,7 @@ describe('highcharts_renderer', () => {
|
|
5525
5525
|
expect(tooltipHtml).toEqual(
|
5526
5526
|
`<span style="font-weight: bold;">
|
5527
5527
|
col 1
|
5528
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1 , row 2</span>: <span>\u200E$11,111.
|
5528
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1 , row 2</span>: <span>\u200E$11,111.00</span>`
|
5529
5529
|
);
|
5530
5530
|
});
|
5531
5531
|
|
@@ -5539,7 +5539,7 @@ describe('highcharts_renderer', () => {
|
|
5539
5539
|
expect(tooltipHtml).toEqual(
|
5540
5540
|
`<span style="font-weight: bold;">
|
5541
5541
|
${ othersName }
|
5542
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$99,999.
|
5542
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$99,999.00</span>`
|
5543
5543
|
);
|
5544
5544
|
});
|
5545
5545
|
|
@@ -5569,7 +5569,7 @@ describe('highcharts_renderer', () => {
|
|
5569
5569
|
expect(tooltipHtml).toEqual(
|
5570
5570
|
`<span style="font-weight: bold;">
|
5571
5571
|
row 1 :
|
5572
|
-
</span><span>\u200E$12,345.
|
5572
|
+
</span><span>\u200E$12,345.00</span>`
|
5573
5573
|
);
|
5574
5574
|
});
|
5575
5575
|
|
@@ -5599,7 +5599,7 @@ describe('highcharts_renderer', () => {
|
|
5599
5599
|
expect(tooltipHtml).toEqual(
|
5600
5600
|
`<span style="font-weight: bold;">
|
5601
5601
|
col 1 :
|
5602
|
-
</span><span>\u200E$88,888.
|
5602
|
+
</span><span>\u200E$88,888.00</span>`
|
5603
5603
|
);
|
5604
5604
|
});
|
5605
5605
|
|
@@ -5631,7 +5631,7 @@ describe('highcharts_renderer', () => {
|
|
5631
5631
|
expect(tooltipHtml).toEqual(
|
5632
5632
|
`<span style="font-weight: bold;">
|
5633
5633
|
Total 1
|
5634
|
-
</span>: <span>\u200E$100.
|
5634
|
+
</span>: <span>\u200E$100.00</span>`
|
5635
5635
|
);
|
5636
5636
|
});
|
5637
5637
|
|
@@ -5653,7 +5653,7 @@ describe('highcharts_renderer', () => {
|
|
5653
5653
|
highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
|
5654
5654
|
const tooltipHtml = tooltipFunction.call(displayTooltipContext);
|
5655
5655
|
|
5656
|
-
expect(tooltipHtml).toEqual('<span>\u200E$123,450.
|
5656
|
+
expect(tooltipHtml).toEqual('<span>\u200E$123,450.00</span>');
|
5657
5657
|
});
|
5658
5658
|
|
5659
5659
|
it('should return proper tooltip html (for trendline point)', () => {
|
@@ -5675,7 +5675,7 @@ describe('highcharts_renderer', () => {
|
|
5675
5675
|
|
5676
5676
|
expect(tooltipHtml).toEqual(`<span style="font-weight: bold;">
|
5677
5677
|
col 1
|
5678
|
-
</span><br/><span style="font-weight: bold; color: green;">\u200ETrend Line</span>: <span>\u200E$55,555.
|
5678
|
+
</span><br/><span style="font-weight: bold; color: green;">\u200ETrend Line</span>: <span>\u200E$55,555.00</span>`
|
5679
5679
|
);
|
5680
5680
|
});
|
5681
5681
|
});
|