@sapui5/sap.zen.crosstab 1.136.9 → 1.136.12

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": "@sapui5/sap.zen.crosstab",
3
- "version": "1.136.9",
3
+ "version": "1.136.12",
4
4
  "description": "SAPUI5 Library sap.zen.crosstab",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -6,7 +6,7 @@
6
6
  </deprecation>
7
7
  <vendor>SAP SE</vendor>
8
8
  <copyright>(c) Copyright 2010-2019 SAP SE or an SAP affiliate company.</copyright>
9
- <version>1.136.9</version>
9
+ <version>1.136.12</version>
10
10
  <documentation>Design Studio Crosstab library. NOT INTENDED FOR STANDALONE USAGE.</documentation>
11
11
  <appData>
12
12
  <jsdoc xmlns="http://www.sap.com/ui5/buildext/jsdoc" >
@@ -13,10 +13,10 @@ sap.ui.define(
13
13
  "sap/zen/crosstab/utils/Utils",
14
14
  "sap/zen/crosstab/library"
15
15
  ],
16
- function(
16
+ function (
17
17
  jQuery, Control, IHeaderCell, CellStyleHandler, HeaderCellRenderer,
18
18
  RenderingConstants
19
- ){
19
+ ) {
20
20
  "use strict";
21
21
  // Provides control sap.zen.crosstab.HeaderCell.
22
22
  jQuery.sap.declare("sap.zen.crosstab.HeaderCell");
@@ -36,131 +36,131 @@ sap.ui.define(
36
36
  * @alias sap.zen.crosstab.HeaderCell
37
37
  */
38
38
  var HeaderCell = Control.extend("sap.zen.crosstab.HeaderCell", /** @lends sap.zen.crosstab.HeaderCell.prototype */ {
39
- metadata : {
39
+ metadata: {
40
40
 
41
- library : "sap.zen.crosstab",
42
- properties : {
41
+ library: "sap.zen.crosstab",
42
+ properties: {
43
43
 
44
44
  /**
45
45
  * Rowspan of the cell
46
46
  */
47
- rowSpan : {type : "int", group : "Misc", defaultValue : null},
47
+ rowSpan: { type: "int", group: "Misc", defaultValue: null },
48
48
 
49
49
  /**
50
50
  * Colspan of the cell
51
51
  */
52
- colSpan : {type : "int", group : "Misc", defaultValue : null},
52
+ colSpan: { type: "int", group: "Misc", defaultValue: null },
53
53
 
54
54
  /**
55
55
  * Text of the cell
56
56
  */
57
- text : {type : "string", group : "Misc", defaultValue : null},
57
+ text: { type: "string", group: "Misc", defaultValue: null },
58
58
 
59
59
  /**
60
60
  * helper to format the cell
61
61
  */
62
- formatter : {type : "object", group : "Misc", defaultValue : null},
62
+ formatter: { type: "object", group: "Misc", defaultValue: null },
63
63
 
64
64
  /**
65
65
  * whether to merge the cell if the keys are equal
66
66
  */
67
- mergeKey : {type : "string", group : "Misc", defaultValue : null},
67
+ mergeKey: { type: "string", group: "Misc", defaultValue: null },
68
68
 
69
69
  /**
70
70
  * sorting
71
71
  */
72
- sort : {type : "string", group : "Misc", defaultValue : null},
72
+ sort: { type: "string", group: "Misc", defaultValue: null },
73
73
 
74
74
  /**
75
75
  * sort action
76
76
  */
77
- sortAction : {type : "string", group : "Misc", defaultValue : null},
77
+ sortAction: { type: "string", group: "Misc", defaultValue: null },
78
78
 
79
79
  /**
80
80
  * area of the cell
81
81
  */
82
- area : {type : "object", group : "Misc", defaultValue : null},
82
+ area: { type: "object", group: "Misc", defaultValue: null },
83
83
 
84
84
  /**
85
85
  * the effective col span
86
86
  */
87
- effectiveColSpan : {type : "int", group : "Misc", defaultValue : null},
87
+ effectiveColSpan: { type: "int", group: "Misc", defaultValue: null },
88
88
 
89
89
  /**
90
90
  * the effective row span
91
91
  */
92
- effectiveRowSpan : {type : "int", group : "Misc", defaultValue : null},
92
+ effectiveRowSpan: { type: "int", group: "Misc", defaultValue: null },
93
93
 
94
94
  /**
95
95
  * the row of the cell in the crosstab
96
96
  */
97
- row : {type : "int", group : "Misc", defaultValue : null},
97
+ row: { type: "int", group: "Misc", defaultValue: null },
98
98
 
99
99
  /**
100
100
  * the column of the cell in the crosstab
101
101
  */
102
- col : {type : "int", group : "Misc", defaultValue : null},
102
+ col: { type: "int", group: "Misc", defaultValue: null },
103
103
 
104
104
  /**
105
105
  * the level of the cell
106
106
  */
107
- level : {type : "int", group : "Misc", defaultValue : null},
107
+ level: { type: "int", group: "Misc", defaultValue: null },
108
108
 
109
109
  /**
110
110
  * the drillstate of the cell
111
111
  */
112
- drillState : {type : "string", group : "Misc", defaultValue : null},
112
+ drillState: { type: "string", group: "Misc", defaultValue: null },
113
113
 
114
114
  /**
115
115
  * the hierarchy action of the cell
116
116
  */
117
- hierarchyAction : {type : "string", group : "Misc", defaultValue : null},
117
+ hierarchyAction: { type: "string", group: "Misc", defaultValue: null },
118
118
 
119
119
  /**
120
120
  * the hierarchy tooltip
121
121
  */
122
- hierarchyTooltip : {type : "string", group : "Misc", defaultValue : null},
122
+ hierarchyTooltip: { type: "string", group: "Misc", defaultValue: null },
123
123
 
124
124
  /**
125
125
  * the IE8 row span
126
126
  * @deprecated As of version 1.89.0, the concept has been discarded.
127
127
  */
128
- htmlIE8RowSpan : {type : "int", group : "Misc", defaultValue : 1},
128
+ htmlIE8RowSpan: { type: "int", group: "Misc", defaultValue: 1 },
129
129
 
130
130
  /**
131
131
  * the text sort index
132
132
  */
133
- sortTextIndex : {type : "int", group : "Misc", defaultValue : null},
133
+ sortTextIndex: { type: "int", group: "Misc", defaultValue: null },
134
134
 
135
135
  /**
136
136
  * the row of the tabe
137
137
  */
138
- tableRow : {type : "int", group : "Misc", defaultValue : null},
138
+ tableRow: { type: "int", group: "Misc", defaultValue: null },
139
139
 
140
140
  /**
141
141
  * the column of the table
142
142
  */
143
- tableCol : {type : "int", group : "Misc", defaultValue : null},
143
+ tableCol: { type: "int", group: "Misc", defaultValue: null },
144
144
 
145
145
  /**
146
146
  * the alignment of the cell
147
147
  */
148
- alignment : {type : "string", group : "Misc", defaultValue : null},
148
+ alignment: { type: "string", group: "Misc", defaultValue: null },
149
149
 
150
150
  /**
151
151
  * the id of the associated member
152
152
  */
153
- memberId : {type : "string", group : "Misc", defaultValue : null},
153
+ memberId: { type: "string", group: "Misc", defaultValue: null },
154
154
 
155
155
  /**
156
156
  * the id of the parent of the associated member
157
157
  */
158
- parentMemberId : {type : "string", group : "Misc", defaultValue : null},
158
+ parentMemberId: { type: "string", group: "Misc", defaultValue: null },
159
159
 
160
160
  /**
161
161
  * the node alignment
162
162
  */
163
- nodeAlignment : {type : "string", group : "Misc", defaultValue : null}
163
+ nodeAlignment: { type: "string", group: "Misc", defaultValue: null }
164
164
  }
165
165
  },
166
166
  renderer: HeaderCellRenderer
@@ -182,11 +182,11 @@ sap.ui.define(
182
182
  this.bIsRevertDrop = false;
183
183
  };
184
184
 
185
- HeaderCell.prototype.getCellType = function() {
185
+ HeaderCell.prototype.getCellType = function () {
186
186
  return RenderingConstants.TYPE_HEADER_CELL;
187
187
  };
188
188
 
189
- HeaderCell.prototype.isHeaderCell = function() {
189
+ HeaderCell.prototype.isHeaderCell = function () {
190
190
  return true;
191
191
  };
192
192
 
@@ -224,7 +224,7 @@ sap.ui.define(
224
224
  };
225
225
 
226
226
  HeaderCell.prototype.hasStyle = function (sStyle) {
227
- var iStyleId =CellStyleHandler.getStyleId(
227
+ var iStyleId = CellStyleHandler.getStyleId(
228
228
  sStyle,
229
229
  RenderingConstants.TYPE_HEADER_CELL
230
230
  );
@@ -304,39 +304,39 @@ sap.ui.define(
304
304
  return this.iNumberOfLineBreaks;
305
305
  };
306
306
 
307
- HeaderCell.prototype.getScalingAxis = function() {
307
+ HeaderCell.prototype.getScalingAxis = function () {
308
308
  return this.sScalingAxis;
309
309
  };
310
310
 
311
- HeaderCell.prototype.setScalingAxis = function(sScalingAxis) {
311
+ HeaderCell.prototype.setScalingAxis = function (sScalingAxis) {
312
312
  this.sScalingAxis = sScalingAxis;
313
313
  };
314
314
 
315
- HeaderCell.prototype.isPivotCell = function() {
315
+ HeaderCell.prototype.isPivotCell = function () {
316
316
  return this.bIsPivotCell;
317
317
  };
318
318
 
319
- HeaderCell.prototype.setPivotCell = function(bIsPivotCell) {
319
+ HeaderCell.prototype.setPivotCell = function (bIsPivotCell) {
320
320
  this.bIsPivotCell = bIsPivotCell;
321
321
  };
322
322
 
323
- HeaderCell.prototype.isSplitPivotCell = function() {
323
+ HeaderCell.prototype.isSplitPivotCell = function () {
324
324
  return this.bIsSplitPivotCell;
325
325
  };
326
326
 
327
- HeaderCell.prototype.setSplitPivotCell = function(bIsSplitPivotCell) {
327
+ HeaderCell.prototype.setSplitPivotCell = function (bIsSplitPivotCell) {
328
328
  this.bIsSplitPivotCell = bIsSplitPivotCell;
329
329
  };
330
330
 
331
- HeaderCell.prototype.isRevertDrop = function() {
331
+ HeaderCell.prototype.isRevertDrop = function () {
332
332
  return this.bIsRevertDrop;
333
333
  };
334
334
 
335
- HeaderCell.prototype.setRevertDrop = function(bIsRevertDrop) {
335
+ HeaderCell.prototype.setRevertDrop = function (bIsRevertDrop) {
336
336
  this.bIsRevertDrop = bIsRevertDrop;
337
337
  };
338
338
 
339
- HeaderCell.prototype.getFormattedText = function() {
339
+ HeaderCell.prototype.getFormattedText = function () {
340
340
  var lText = this.getText();
341
341
 
342
342
  var oArea = this.getArea();
@@ -350,8 +350,20 @@ sap.ui.define(
350
350
  }
351
351
  var oFormatter = this.getFormatter();
352
352
  if (oFormatter) {
353
- lText = oFormatter.format(lText);
353
+ var lTextFormatted = oFormatter.format(lText);
354
+
355
+ // Formatter above is ignoring the pattern provided
356
+ if (lTextFormatted === lText && oFormatter.customFormat && oFormatter.customFormat.name === "ScalingFactor") {
357
+ const rNumberPattern = /[0#.,]+/;
358
+ const sPattern = oFormatter.customFormat.formatString;
359
+ if (sPattern && sPattern.length > 0) {
360
+ lTextFormatted = sPattern.replace(rNumberPattern, lText);
361
+ }
362
+ }
363
+
364
+ lText = lTextFormatted;
354
365
  }
366
+
355
367
  return lText;
356
368
  };
357
369
 
@@ -13,7 +13,7 @@ sap.ui.define(
13
13
  "sap/zen/crosstab/HeaderCell",
14
14
  "sap/zen/crosstab/CellStyleHandler"
15
15
  ],
16
- function(
16
+ function (
17
17
  jQuery, TextConstants, Utils, RenderingConstants, CrosstabCellApi,
18
18
  DataCell, HeaderCell, CellStyleHandler
19
19
  ) {
@@ -42,7 +42,7 @@ sap.ui.define(
42
42
  var oColHeaderHierarchyLevels = {};
43
43
  var oRowHeaderHierarchyLevels = {};
44
44
 
45
- function createDefaultCrosstabTextCache () {
45
+ function createDefaultCrosstabTextCache() {
46
46
  if (!sap.zen.CrosstabTextCache) {
47
47
  sap.zen.CrosstabTextCache = {};
48
48
  sap.zen.CrosstabTextCache.filled = false;
@@ -69,14 +69,14 @@ sap.ui.define(
69
69
  sap.zen.CrosstabTextCache.defaultProvided = true;
70
70
  }
71
71
 
72
- function readTranslatedTexts (oTexts) {
72
+ function readTranslatedTexts(oTexts) {
73
73
  if (sap.zen.CrosstabTextCache.filled === false) {
74
74
  var oPropertyBag = oCrosstab.getPropertyBag();
75
75
  if (oTexts) {
76
76
  oPropertyBag.addText(TextConstants.ROW_TEXT_KEY, oTexts.rowtext || "Row");
77
77
  oPropertyBag.addText(TextConstants.COL_TEXT_KEY, oTexts.coltext || "Column");
78
78
  oPropertyBag.addText(TextConstants.COLWIDTH_ADJUST_TEXT_KEY, oTexts.colwidthtext
79
- || "Double Click to adjust Column Width");
79
+ || "Double Click to adjust Column Width");
80
80
  oPropertyBag.addText(
81
81
  TextConstants.MOBILE_MENUITEM_COLWIDTH_ADJUST_TEXT_KEY,
82
82
  oTexts.mobilemenuitemcolwidthtext || "Adjust Column Width"
@@ -88,7 +88,7 @@ sap.ui.define(
88
88
  }
89
89
  }
90
90
 
91
- function provideDefaultSortingTexts (oPropertyBag) {
91
+ function provideDefaultSortingTexts(oPropertyBag) {
92
92
  var oSortingLookup = {};
93
93
  oSortingLookup.alttext = "Unsorted. Select to sort ascending";
94
94
  oSortingLookup.tooltipidx = 0;
@@ -105,7 +105,7 @@ sap.ui.define(
105
105
  oPropertyBag.addSortingTextLookup("2", oSortingLookup);
106
106
  }
107
107
 
108
- function extractSortingTexts (oTexts, oPropertyBag) {
108
+ function extractSortingTexts(oTexts, oPropertyBag) {
109
109
  var oSortingTextList = oTexts.sorting;
110
110
  if (!oSortingTextList) {
111
111
  provideDefaultSortingTexts(oPropertyBag);
@@ -268,7 +268,7 @@ sap.ui.define(
268
268
  }
269
269
 
270
270
  // selection handling
271
- if(oJsonTableControl.selectionmode) {
271
+ if (oJsonTableControl.selectionmode) {
272
272
  oCrosstab.setSelectionProperties(oJsonTableControl.selectionmode, oJsonTableControl.selectionspace, oJsonTableControl.disablehovering, oJsonTableControl.singleonselectevent);
273
273
  }
274
274
 
@@ -305,7 +305,7 @@ sap.ui.define(
305
305
 
306
306
  };
307
307
 
308
- function setUserColWidthsToAreas (oCrosstabData) {
308
+ function setUserColWidthsToAreas(oCrosstabData) {
309
309
  var widthList = oCrosstabData.usercolwidths;
310
310
  if (widthList) {
311
311
  for (var i = 0; i < widthList.length; i++) {
@@ -365,14 +365,14 @@ sap.ui.define(
365
365
  }
366
366
  }
367
367
 
368
- function extractCrossRequestInfo () {
368
+ function extractCrossRequestInfo() {
369
369
  var oCrossRequestManager = oCrosstab.getRenderEngine().getCrossRequestManager();
370
370
 
371
371
  if (oCrossRequestManager) {
372
372
  // set scroll parameters that come from the server if any
373
373
  if (oJsonTableControl.clienthpos !== undefined && oJsonTableControl.clientvpos !== undefined
374
- && oJsonTableControl.clienthscrolledtoend !== undefined
375
- && oJsonTableControl.clientvscrolledtoend !== undefined) {
374
+ && oJsonTableControl.clienthscrolledtoend !== undefined
375
+ && oJsonTableControl.clientvscrolledtoend !== undefined) {
376
376
  // plausibility check
377
377
  if (oJsonTableControl.clienthscrolledtoend === true) {
378
378
  oJsonTableControl.clienthpos = oJsonTableControl.totaldatacols - 1;
@@ -420,9 +420,9 @@ sap.ui.define(
420
420
  }
421
421
  }
422
422
  if (oJsonTableControl.clientheaderhpos && bSetHeaderScrollPositions) {
423
- oCrossRequestManager.setHeaderScrollData({"iHPos": parseInt(oJsonTableControl.clientheaderhpos, 10)});
423
+ oCrossRequestManager.setHeaderScrollData({ "iHPos": parseInt(oJsonTableControl.clientheaderhpos, 10) });
424
424
  } else {
425
- oCrossRequestManager.setHeaderScrollData({"iHPos": 0});
425
+ oCrossRequestManager.setHeaderScrollData({ "iHPos": 0 });
426
426
  }
427
427
  }
428
428
  }
@@ -450,13 +450,13 @@ sap.ui.define(
450
450
  oCrosstab.setRowHeaderHierarchyLevels(oRowHeaderHierarchyLevels);
451
451
  };
452
452
 
453
- function checkHeaderAreasToBeFilled () {
453
+ function checkHeaderAreasToBeFilled() {
454
454
  bFillDimensionHeaderArea = oCrosstabAreasToBeFilled[oDimensionHeaderArea.getAreaType()];
455
455
  bFillRowHeaderArea = oCrosstabAreasToBeFilled[oRowHeaderArea.getAreaType()];
456
456
  bFillColHeaderArea = oCrosstabAreasToBeFilled[oColHeaderArea.getAreaType()];
457
457
  }
458
458
 
459
- function handleMsgInTable (oJsonTableControl) {
459
+ function handleMsgInTable(oJsonTableControl) {
460
460
  oDimensionHeaderArea.setRowCnt(2);
461
461
  oDimensionHeaderArea.setColCnt(1);
462
462
 
@@ -471,7 +471,7 @@ sap.ui.define(
471
471
 
472
472
  function removeSelections() {
473
473
  var oSelectionHandler = oCrosstab.getSelectionHandler();
474
- if(oSelectionHandler){
474
+ if (oSelectionHandler) {
475
475
  oSelectionHandler.setSelection(null);
476
476
  }
477
477
  }
@@ -488,7 +488,7 @@ sap.ui.define(
488
488
  addRowHeaderCell(oJsonCellControl, iModelRow + iRowOffset, iModelCol);
489
489
  }
490
490
  };
491
- function createDataCell (iRow, iCol) {
491
+ function createDataCell(iRow, iCol) {
492
492
  var oDataCell = new DataCell();
493
493
  oDataCell.setArea(oDataArea);
494
494
  oDataCell.setRow(iRow);
@@ -542,7 +542,7 @@ sap.ui.define(
542
542
  );
543
543
  };
544
544
 
545
- function createHeaderCell (oArea, iRow, iCol) {
545
+ function createHeaderCell(oArea, iRow, iCol) {
546
546
  var oHeaderCell = new HeaderCell();
547
547
  oHeaderCell.setArea(oArea);
548
548
  oHeaderCell.setRow(iRow);
@@ -581,7 +581,7 @@ sap.ui.define(
581
581
 
582
582
  var exceptionVisualizations = oJsonCellControl.exceptionvisualizations;
583
583
  if (exceptionVisualizations) {
584
- for ( var index in exceptionVisualizations) {
584
+ for (var index in exceptionVisualizations) {
585
585
  if (
586
586
  Object.prototype.hasOwnProperty.call(exceptionVisualizations, index)
587
587
  ) {
@@ -629,7 +629,7 @@ sap.ui.define(
629
629
  if (oJsonCellControl.passivetype) {
630
630
  oCommonCell.setPassiveCellType(oJsonCellControl.passivetype);
631
631
  }
632
- if(oJsonCellControl.additionalstyles) {
632
+ if (oJsonCellControl.additionalstyles) {
633
633
  for (var i = 0; i < oJsonCellControl.additionalstyles.length; i++) {
634
634
  oCommonCell.addStyle(oJsonCellControl.additionalstyles[i].style.stylename);
635
635
  }
@@ -751,6 +751,10 @@ sap.ui.define(
751
751
  oFormatter = sap.ui.core.format.NumberFormat.getCurrencyInstance(oFormatOptions);
752
752
  }
753
753
  }
754
+ if (oJsonCellControl.customFormat) {
755
+ oFormatter.customFormat = oJsonCellControl.customFormat;
756
+ oFormatter.customFormat.formatString = oJsonCellControl.formatString;
757
+ }
754
758
 
755
759
  return oFormatter;
756
760
  }
@@ -33,7 +33,7 @@ sap.ui.define(
33
33
  "sap.zen.crosstab.HeaderCell"
34
34
  ],
35
35
  elements: [],
36
- version: "1.136.9"
36
+ version: "1.136.12"
37
37
  });
38
38
  return thisLib;
39
39
  }