@sapui5/sap.zen.crosstab 1.107.0 → 1.108.0

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.
@@ -7,11 +7,12 @@ sap.ui.define(
7
7
  "jquery.sap.global",
8
8
  "sap/ui/core/Control",
9
9
  "sap/zen/crosstab/CellStyleHandler",
10
+ "sap/zen/crosstab/DataCellRenderer",
10
11
  "sap/zen/crosstab/rendering/RenderingConstants",
11
12
  "sap/zen/crosstab/utils/Utils",
12
13
  "sap/zen/crosstab/library"
13
14
  ],
14
- function(jQuery, Control, CellStyleHandler, RenderingConstants, Utils){
15
+ function(jQuery, Control, CellStyleHandler, DataCellRenderer, RenderingConstants, Utils){
15
16
  "use strict";
16
17
  // Provides control sap.zen.crosstab.DataCell.
17
18
  jQuery.sap.declare("sap.zen.crosstab.DataCell");
@@ -28,42 +29,45 @@ sap.ui.define(
28
29
  * @constructor
29
30
  * @public
30
31
  * @deprecated since 1.89.0
31
- * @name sap.zen.crosstab.DataCell
32
+ * @alias sap.zen.crosstab.DataCell
32
33
  */
33
- Control.extend("sap.zen.crosstab.DataCell", /** @lends sap.zen.crosstab.DataCell.prototype */ { metadata : {
34
- library : "sap.zen.crosstab",
35
- properties : {
36
- /**
37
- * the text of the data cell
38
- */
39
- text : {type : "string", group : "Misc", defaultValue : null},
34
+ var DataCell = Control.extend("sap.zen.crosstab.DataCell", /** @lends sap.zen.crosstab.DataCell.prototype */ {
35
+ metadata : {
36
+ library : "sap.zen.crosstab",
37
+ properties : {
38
+ /**
39
+ * the text of the data cell
40
+ */
41
+ text : {type : "string", group : "Misc", defaultValue : null},
40
42
 
41
- /**
42
- * the area of the data cell
43
- */
44
- area : {type : "object", group : "Misc", defaultValue : null},
43
+ /**
44
+ * the area of the data cell
45
+ */
46
+ area : {type : "object", group : "Misc", defaultValue : null},
45
47
 
46
- /**
47
- * the row of the data cell
48
- */
49
- row : {type : "int", group : "Misc", defaultValue : null},
48
+ /**
49
+ * the row of the data cell
50
+ */
51
+ row : {type : "int", group : "Misc", defaultValue : null},
50
52
 
51
- /**
52
- * the column of the data cell
53
- */
54
- col : {type : "int", group : "Misc", defaultValue : null},
53
+ /**
54
+ * the column of the data cell
55
+ */
56
+ col : {type : "int", group : "Misc", defaultValue : null},
55
57
 
56
- /**
57
- * the table row of the data cell
58
- */
59
- tableRow : {type : "int", group : "Misc", defaultValue : null},
58
+ /**
59
+ * the table row of the data cell
60
+ */
61
+ tableRow : {type : "int", group : "Misc", defaultValue : null},
60
62
 
61
- /**
62
- * the table column of the data cell
63
- */
64
- tableCol : {type : "int", group : "Misc", defaultValue : null}
65
- }
66
- }});
63
+ /**
64
+ * the table column of the data cell
65
+ */
66
+ tableCol : {type : "int", group : "Misc", defaultValue : null}
67
+ }
68
+ },
69
+ renderer: DataCellRenderer
70
+ });
67
71
 
68
72
 
69
73
  /**
@@ -75,11 +79,7 @@ sap.ui.define(
75
79
  * @public
76
80
  */
77
81
 
78
- ///**
79
- // * This file defines behavior for the control,
80
- // */
81
-
82
- sap.zen.crosstab.DataCell.prototype.init = function () {
82
+ DataCell.prototype.init = function () {
83
83
  "use strict";
84
84
  this.aStyles = [];
85
85
  this.bLoading = false;
@@ -88,22 +88,22 @@ sap.ui.define(
88
88
  this.sPassiveCellType = RenderingConstants.PASSIVE_CELL_TYPE_NORMAL;
89
89
  this.iNumberOfLineBreaks = 0;
90
90
  };
91
- sap.zen.crosstab.DataCell.prototype.getCellType = function() {
91
+ DataCell.prototype.getCellType = function() {
92
92
  return RenderingConstants.TYPE_DATA_CELL;
93
93
  };
94
- sap.zen.crosstab.DataCell.prototype.isHeaderCell = function() {
94
+ DataCell.prototype.isHeaderCell = function() {
95
95
  return false;
96
96
  };
97
- sap.zen.crosstab.DataCell.prototype.getCssClassNames = function (bIsIE8, bIsRtl, bIsMsIE) {
97
+ DataCell.prototype.getCssClassNames = function (bIsIE8, bIsRtl, bIsMsIE) {
98
98
  return CellStyleHandler.getCssClasses(this.aStyles, bIsIE8, bIsRtl, bIsMsIE);
99
99
  };
100
- sap.zen.crosstab.DataCell.prototype.getStyleIdList = function () {
100
+ DataCell.prototype.getStyleIdList = function () {
101
101
  return this.aStyles;
102
102
  };
103
- sap.zen.crosstab.DataCell.prototype.setStyleIdList = function (aNewStyles) {
103
+ DataCell.prototype.setStyleIdList = function (aNewStyles) {
104
104
  this.aStyles = aNewStyles;
105
105
  };
106
- sap.zen.crosstab.DataCell.prototype.addStyle = function (sStyle) {
106
+ DataCell.prototype.addStyle = function (sStyle) {
107
107
  var iStyleId = CellStyleHandler.getStyleId(
108
108
  sStyle,
109
109
  RenderingConstants.TYPE_DATA_CELL
@@ -112,7 +112,7 @@ sap.ui.define(
112
112
  this.aStyles.push(iStyleId);
113
113
  }
114
114
  };
115
- sap.zen.crosstab.DataCell.prototype.removeStyle = function (sStyle) {
115
+ DataCell.prototype.removeStyle = function (sStyle) {
116
116
  var iStyleId = CellStyleHandler.getStyleId(
117
117
  sStyle, RenderingConstants.TYPE_DATA_CELL
118
118
  );
@@ -121,7 +121,7 @@ sap.ui.define(
121
121
  this.aStyles.splice(iIndex, 1);
122
122
  }
123
123
  };
124
- sap.zen.crosstab.DataCell.prototype.hasStyle = function (sStyle) {
124
+ DataCell.prototype.hasStyle = function (sStyle) {
125
125
  var iStyleId = CellStyleHandler.getStyleId(
126
126
  sStyle, RenderingConstants.TYPE_DATA_CELL
127
127
  );
@@ -132,54 +132,54 @@ sap.ui.define(
132
132
  return true;
133
133
  }
134
134
  };
135
- sap.zen.crosstab.DataCell.prototype.getColSpan = function () {
135
+ DataCell.prototype.getColSpan = function () {
136
136
  return 1;
137
137
  };
138
- sap.zen.crosstab.DataCell.prototype.getRowSpan = function () {
138
+ DataCell.prototype.getRowSpan = function () {
139
139
  return 1;
140
140
  };
141
- sap.zen.crosstab.DataCell.prototype.getEffectiveColSpan = function () {
141
+ DataCell.prototype.getEffectiveColSpan = function () {
142
142
  return 1;
143
143
  };
144
- sap.zen.crosstab.DataCell.prototype.getEffectiveRowSpan = function () {
144
+ DataCell.prototype.getEffectiveRowSpan = function () {
145
145
  return 1;
146
146
  };
147
- sap.zen.crosstab.DataCell.prototype.isLoading = function () {
147
+ DataCell.prototype.isLoading = function () {
148
148
  return this.bLoading;
149
149
  };
150
- sap.zen.crosstab.DataCell.prototype.setLoading = function (bLoading) {
150
+ DataCell.prototype.setLoading = function (bLoading) {
151
151
  this.bLoading = bLoading;
152
152
  };
153
- sap.zen.crosstab.DataCell.prototype.isSelectable = function () {
153
+ DataCell.prototype.isSelectable = function () {
154
154
  return false;
155
155
  };
156
- sap.zen.crosstab.DataCell.prototype.getUnescapedText = function () {
156
+ DataCell.prototype.getUnescapedText = function () {
157
157
  return Utils.unEscapeDisplayString(this.getText());
158
158
  };
159
- sap.zen.crosstab.DataCell.prototype.setEntryEnabled = function (bIsEntryEnabled) {
159
+ DataCell.prototype.setEntryEnabled = function (bIsEntryEnabled) {
160
160
  this.bIsEntryEnabled = bIsEntryEnabled;
161
161
  };
162
- sap.zen.crosstab.DataCell.prototype.isEntryEnabled = function () {
162
+ DataCell.prototype.isEntryEnabled = function () {
163
163
  return this.bIsEntryEnabled;
164
164
  };
165
- sap.zen.crosstab.DataCell.prototype.setUnit = function (sUnit) {
165
+ DataCell.prototype.setUnit = function (sUnit) {
166
166
  this.sUnit = sUnit;
167
167
  };
168
- sap.zen.crosstab.DataCell.prototype.getUnit = function () {
168
+ DataCell.prototype.getUnit = function () {
169
169
  return this.sUnit;
170
170
  };
171
- sap.zen.crosstab.DataCell.prototype.getPassiveCellType = function () {
171
+ DataCell.prototype.getPassiveCellType = function () {
172
172
  return this.sPassiveCellType;
173
173
  };
174
- sap.zen.crosstab.DataCell.prototype.setPassiveCellType = function (sPCellType) {
174
+ DataCell.prototype.setPassiveCellType = function (sPCellType) {
175
175
  this.sPassiveCellType = sPCellType;
176
176
  };
177
- sap.zen.crosstab.DataCell.prototype.setNumberOfLineBreaks = function (iNumberOfLineBreaks) {
177
+ DataCell.prototype.setNumberOfLineBreaks = function (iNumberOfLineBreaks) {
178
178
  this.iNumberOfLineBreaks = iNumberOfLineBreaks;
179
179
  };
180
- sap.zen.crosstab.DataCell.prototype.getNumberOfLineBreaks = function () {
180
+ DataCell.prototype.getNumberOfLineBreaks = function () {
181
181
  return this.iNumberOfLineBreaks;
182
182
  };
183
- return sap.zen.crosstab.DataCell;
183
+ return DataCell;
184
184
  }
185
185
  );
@@ -4,27 +4,27 @@
4
4
  /*global sap*/
5
5
  sap.ui.define(
6
6
  [
7
- "jquery.sap.global",
8
7
  "sap/zen/crosstab/rendering/RenderingConstants",
9
8
  "sap/zen/crosstab/IDataCell"
10
9
  ],
11
- function(jQuery, RenderingConstants, IDataCell){
10
+ function(RenderingConstants, IDataCell){
12
11
  "use strict";
13
- jQuery.sap.declare("sap.zen.crosstab.DataCellRenderer");
14
12
  /**
15
- * @class DataCell renderer.
16
- * @static
13
+ * @namespace DataCell renderer.
14
+ * @alias sap.zen.crosstab.DataCell
17
15
  */
18
- sap.zen.crosstab.DataCellRenderer = {};
16
+ var DataCellRenderer = {
17
+ apiVersion: 2
18
+ };
19
19
  /**
20
20
  * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
21
21
  *
22
22
  * @param {sap.ui.core.RenderManager}
23
- * oRenderManager the RenderManager that can be used for writing to the Render-Output-Buffer
24
- * @param {sap.ui.core.Control}
23
+ * rm the RenderManager that can be used for writing to the Render-Output-Buffer
24
+ * @param {sap.zen.crosstab.DataCell}
25
25
  * oControl an object representation of the control that should be rendered
26
26
  */
27
- sap.zen.crosstab.DataCellRenderer.render = function (oRenderManager, oControl) {
27
+ DataCellRenderer.render = function (rm, oControl) {
28
28
  "use strict";
29
29
  var oArea = oControl.getArea();
30
30
  var oCrosstab = oArea.getCrosstab();
@@ -36,34 +36,28 @@ sap.ui.define(
36
36
  oAdditionalStyles = oCallbackResult.additionalStyles;
37
37
  sRenderText = oCallbackResult.renderText;
38
38
  }
39
- // convenience variable
40
- var rm = oRenderManager;
41
39
  // write the HTML into the render manager
42
- rm.write("<td");
43
- rm.writeControlData(oControl);
40
+ rm.openStart("td", oControl);
44
41
  var sCssClasses = oControl.getCssClassNames(oCrosstab.isIE8Mode(), oCrosstab.getPropertyBag().isRtl(), oCrosstab.getUtils().isMsIE());
45
- rm.writeAttributeEscaped("class", sCssClasses);
46
- rm.writeAttributeEscaped("tabindex", RenderingConstants.TABINDEX);
47
- rm.write(">"); // SPAN element
48
- rm.write("<div");
49
- rm.writeAttributeEscaped("id", oControl.getId() + "_contentDiv");
50
- rm.writeAttributeEscaped("tabindex", RenderingConstants.TABINDEX);
51
- var sClasses = "sapzencrosstab-DataCellContentDiv";
42
+ rm.attr("class", sCssClasses);
43
+ rm.attr("tabindex", RenderingConstants.TABINDEX);
44
+ rm.openEnd(); // SPAN element
45
+ rm.openStart("div", oControl.getId() + "_contentDiv");
46
+ rm.attr("tabindex", RenderingConstants.TABINDEX);
47
+ rm.class("sapzencrosstab-DataCellContentDiv");
52
48
  if (oControl.isLoading()) {
53
- sClasses += " sapzencrosstab-LoadingCellContentDiv";
49
+ rm.class("sapzencrosstab-LoadingCellContentDiv");
54
50
  }
55
- rm.writeAttributeEscaped("class", sClasses);
56
51
  if (oAdditionalStyles) {
57
52
  for ( var sStyleKey in oAdditionalStyles) {
58
- rm.addStyle(sStyleKey, oAdditionalStyles[sStyleKey]);
53
+ rm.sStyle(sStyleKey, oAdditionalStyles[sStyleKey]);
59
54
  }
60
55
  }
61
- rm.writeStyles();
62
- rm.write(">");
63
- rm.writeEscaped(sRenderText);
64
- rm.write("</div>");
65
- rm.write("</td>");
56
+ rm.openEnd();
57
+ rm.text(sRenderText);
58
+ rm.close("div");
59
+ rm.close("td");
66
60
  };
67
- return sap.zen.crosstab.DataCellRenderer;
68
- }
61
+ return DataCellRenderer;
62
+ }, true
69
63
  );