@openui5/sap.ui.webc.common 1.92.0 → 1.93.3

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/.reuse/dep5 CHANGED
@@ -464,3 +464,8 @@ Copyright:
464
464
  License: Apache-2.0
465
465
  Comment: these files contain content from SAP and JSDoc 3: plugin.js is overall written by SAP, but contains code taken from JSDoc 3.6.7 (see the respective comments)
466
466
 
467
+ Files: src/sap.ui.core/src/sap/ui/core/themes/base/base.less src/themelib_sap_belize/src/sap/ui/core/themes/*/base.less src/themelib_sap_fiori_3/src/sap/ui/core/themes/*/base.less src/themelib_sap_horizon/src/sap/ui/core/themes/*/base.less
468
+ Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
469
+ License: Apache-2.0
470
+ Comment: these files belong to: SAP Theming Base Content
471
+
package/THIRDPARTY.txt CHANGED
@@ -197,7 +197,7 @@ License: BSD-3-Clause
197
197
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
198
198
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
199
199
 
200
- Component: URI.js, version: 1.19.6
200
+ Component: URI.js, version: 1.19.7
201
201
  Copyright: Rodney Rehm
202
202
  License: MIT
203
203
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
@@ -462,6 +462,15 @@ License: Apache-2.0
462
462
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
463
463
  Contained in: lib/jsdoc/ui5/plugin.js
464
464
 
465
+ Component: SAP Theming Base Content, version: 11.1.34
466
+ Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
467
+ License: Apache-2.0
468
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
469
+ Contained in: src/sap.ui.core/src/sap/ui/core/themes/base/base.less
470
+ src/themelib_sap_belize/src/sap/ui/core/themes/*/base.less
471
+ src/themelib_sap_fiori_3/src/sap/ui/core/themes/*/base.less
472
+ src/themelib_sap_horizon/src/sap/ui/core/themes/*/base.less
473
+
465
474
 
466
475
  ALL LICENSE TEXTS:
467
476
  ==================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.webc.common",
3
- "version": "1.92.0",
3
+ "version": "1.93.3",
4
4
  "description": "OpenUI5 UI Library sap.ui.webc.common",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -16,6 +16,6 @@
16
16
  "url": "https://github.com/SAP/openui5.git"
17
17
  },
18
18
  "dependencies": {
19
- "@openui5/sap.ui.core": "1.92.0"
19
+ "@openui5/sap.ui.core": "1.93.3"
20
20
  }
21
21
  }
@@ -3,7 +3,7 @@
3
3
 
4
4
  <name>sap.ui.webc.common</name>
5
5
  <vendor>SAP SE</vendor>
6
- <version>1.92.0</version>
6
+ <version>1.93.3</version>
7
7
  <copyright>OpenUI5
8
8
  * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
9
9
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
@@ -93,7 +93,7 @@ sap.ui.define([
93
93
  *
94
94
  * @extends sap.ui.core.Control
95
95
  * @author SAP SE
96
- * @version 1.92.0
96
+ * @version 1.93.3
97
97
  * @public
98
98
  * @since 1.92.0
99
99
  * @alias sap.ui.webc.common.WebComponent
@@ -239,6 +239,25 @@ sap.ui.define([
239
239
  if (oDomRef._individualSlot) {
240
240
  this.__slot = oDomRef._individualSlot; // If the component creates individual slots for children, f.e. columns-3 or default-1, update the __slot property, otherwise RenderManager will set the normal slot name, f.e. columns or ""
241
241
  }
242
+ this.__updateObjectProperties(oDomRef);
243
+ };
244
+
245
+ /**
246
+ * Updates all object properties (can't be done via the renderer)
247
+ * @param oDomRef
248
+ * @private
249
+ */
250
+ WebComponent.prototype.__updateObjectProperties = function(oDomRef) {
251
+ var oAttrProperties = this.getMetadata().getPropertiesByMapping("attribute");
252
+ for (var sPropName in oAttrProperties) {
253
+ var oPropData = oAttrProperties[sPropName];
254
+
255
+ if (oPropData.type === "object") {
256
+ var sWebComponentPropName = oPropData._sMapTo ? oPropData._sMapTo : sPropName;
257
+ var vPropValue = oPropData.get(this);
258
+ oDomRef[sWebComponentPropName] = vPropValue;
259
+ }
260
+ }
242
261
  };
243
262
 
244
263
  /**
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @class
24
24
  * @author SAP SE
25
- * @version 1.92.0
25
+ * @version 1.93.3
26
26
  * @since 1.92.0
27
27
  * @experimental Since 1.92.0 The API might change. It is not intended for productive usage yet!
28
28
  * @alias sap.ui.webc.common.WebComponentMetadata
@@ -70,6 +70,22 @@ sap.ui.define([
70
70
  WebComponentAggregation.prototype.constructor = WebComponentAggregation;
71
71
  WebComponentMetadata.prototype.metaFactoryAggregation = WebComponentAggregation;
72
72
 
73
+ // Enrich association factory
74
+ var OriginalAssociation = ElementMetadata.prototype.metaFactoryAssociation;
75
+ var WebComponentAssociation = function(oClass, name, info) {
76
+ OriginalAssociation.apply(this, arguments);
77
+
78
+ if (!info.mapping || typeof info.mapping !== "object") {
79
+ this._sMapping = ""; // For associations, "mapping" must be an object, because "to" is required
80
+ } else {
81
+ this._sMapping = "property"; // Associations map only to properties, no matter what is set, it's always "property" mapping
82
+ this._sMapTo = info.mapping.to; // The property, to which the association is related
83
+ }
84
+ };
85
+ WebComponentAssociation.prototype = Object.create(OriginalAssociation.prototype);
86
+ WebComponentAssociation.prototype.constructor = WebComponentAssociation;
87
+ WebComponentMetadata.prototype.metaFactoryAssociation = WebComponentAssociation;
88
+
73
89
  WebComponentMetadata.prototype.applySettings = function(oClassInfo) {
74
90
  var oStaticInfo = oClassInfo.metadata;
75
91
 
@@ -160,6 +176,25 @@ sap.ui.define([
160
176
  return mFiltered;
161
177
  };
162
178
 
179
+ /**
180
+ * Returns a map of all associations that control properties (have mapping to properties)
181
+ * returns {Object}
182
+ */
183
+ WebComponentMetadata.prototype.getAssociationsWithMapping = function() {
184
+ var mFiltered = {};
185
+ var mAssociations = this.getAllAssociations();
186
+ for (var sAssocName in mAssociations) {
187
+ if (mAssociations.hasOwnProperty(sAssocName)) {
188
+ var oAssocData = mAssociations[sAssocName];
189
+ if (oAssocData._sMapping) {
190
+ mFiltered[sAssocName] = oAssocData;
191
+ }
192
+ }
193
+ }
194
+
195
+ return mFiltered;
196
+ };
197
+
163
198
  /**
164
199
  * Retrieves the renderer for the described web component class.
165
200
  * Note: this is always the default renderer and Web Component wrappers should not define their own renderers.
@@ -38,6 +38,8 @@ sap.ui.define([
38
38
  this.renderAttributeProperties(oRm, oWebComponent);
39
39
  // Properties with mapping="style"
40
40
  this.renderStyleProperties(oRm, oWebComponent);
41
+ // Properties, managed by associations
42
+ this.renderAssociationProperties(oRm, oWebComponent);
41
43
  // Hook for customization
42
44
  this.customRenderInOpeningTag(oRm, oWebComponent);
43
45
  // Attributes/Styles that the component sets internally
@@ -70,6 +72,10 @@ sap.ui.define([
70
72
  var oAttrProperties = oWebComponent.getMetadata().getPropertiesByMapping("attribute");
71
73
  for (var sPropName in oAttrProperties) {
72
74
  var oPropData = oAttrProperties[sPropName];
75
+ if (oPropData.type === "object") {
76
+ continue; // Properties of type "object" are set during onAfterRendering
77
+ }
78
+
73
79
  var sAttrName = oPropData._sMapTo ? oPropData._sMapTo : hyphenate(sPropName);
74
80
  var vPropValue = oPropData.get(oWebComponent);
75
81
  if (oPropData._fnMappingFormatter) {
@@ -176,6 +182,25 @@ sap.ui.define([
176
182
  }
177
183
  };
178
184
 
185
+ /**
186
+ * Renders properties, controlled by associations
187
+ * @private
188
+ * @param oRm
189
+ * @param oWebComponent
190
+ */
191
+ WebComponentRenderer.renderAssociationProperties = function(oRm, oWebComponent) {
192
+ var oAssociations = oWebComponent.getMetadata().getAssociationsWithMapping();
193
+ for (var sAssocName in oAssociations) {
194
+ var oAssocData = oAssociations[sAssocName];
195
+ var vAssocValue = oAssocData.get(oWebComponent);
196
+ var sPropName = oAssocData._sMapTo; // The name of the property to be set with the association's ID value
197
+ var sPropValue = typeof vAssocValue === "object" ? vAssocValue.getId() : vAssocValue; // The ID, held by the association
198
+ if (sPropValue) { // Only set the property, if the association is set
199
+ oRm.attr(sPropName, sPropValue);
200
+ }
201
+ }
202
+ };
203
+
179
204
  /**
180
205
  * Renders text inside the component, if it has a property of type textContent
181
206
  * Normally a single property of this type is expected (such as button text), but if more than one are set, they are all rendered
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  // delegate further initialization of this library to the Core
23
23
  sap.ui.getCore().initLibrary({
24
24
  name : "sap.ui.webc.common",
25
- version: "1.92.0",
25
+ version: "1.93.3",
26
26
  dependencies : ["sap.ui.core"],
27
27
  noLibraryCSS: true,
28
28
  designtime: "sap/ui/webc/common/designtime/library.designtime",
@@ -45,7 +45,7 @@ sap.ui.define([
45
45
  * @namespace
46
46
  * @alias sap.ui.webc
47
47
  * @author SAP SE
48
- * @version 1.92.0
48
+ * @version 1.93.3
49
49
  * @public
50
50
  * @since 1.92.0
51
51
  * @experimental Since 1.92.0
@@ -57,7 +57,7 @@ sap.ui.define([
57
57
  * @namespace
58
58
  * @alias sap.ui.webc.common
59
59
  * @author SAP SE
60
- * @version 1.92.0
60
+ * @version 1.93.3
61
61
  * @public
62
62
  * @since 1.92.0
63
63
  * @experimental Since 1.92.0