@openui5/sap.ui.webc.common 1.117.1 → 1.118.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.
- package/package.json +2 -2
- package/src/sap/ui/webc/common/.library +1 -1
- package/src/sap/ui/webc/common/WebComponent.js +106 -466
- package/src/sap/ui/webc/common/WebComponentMetadata.js +33 -245
- package/src/sap/ui/webc/common/library.js +3 -3
- package/src/sap/ui/webc/common/thirdparty/base/config/Theme.js +50 -79
- package/src/sap/ui/webc/common/thirdparty/base/config/ThemeRoot.js +45 -68
- package/src/sap/ui/webc/common/thirdparty/base/theming/applyTheme.js +79 -74
- package/ui5.yaml +7 -0
- package/src/sap/ui/webc/common/WebComponentRenderer.js +0 -320
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@openui5/sap.ui.webc.common",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.118.0",
|
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",
|
@@ -19,6 +19,6 @@
|
|
19
19
|
"build": "rimraf src/sap/ui/webc/common/thirdparty/ && ui5-webc-prebuild"
|
20
20
|
},
|
21
21
|
"dependencies": {
|
22
|
-
"@openui5/sap.ui.core": "1.
|
22
|
+
"@openui5/sap.ui.core": "1.118.0"
|
23
23
|
}
|
24
24
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
<name>sap.ui.webc.common</name>
|
5
5
|
<vendor>SAP SE</vendor>
|
6
|
-
<version>1.
|
6
|
+
<version>1.118.0</version>
|
7
7
|
<copyright>OpenUI5
|
8
8
|
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
9
9
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
@@ -6,469 +6,109 @@
|
|
6
6
|
|
7
7
|
// Provides the base class for all Web Component wrappers.
|
8
8
|
sap.ui.define([
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
metadata : {
|
116
|
-
stereotype : "webcomponent",
|
117
|
-
"abstract" : true,
|
118
|
-
library : "sap.ui.webc.common",
|
119
|
-
properties: {
|
120
|
-
__isBusy: {
|
121
|
-
type: "boolean",
|
122
|
-
visibility: "hidden",
|
123
|
-
defaultValue: false,
|
124
|
-
mapping: {
|
125
|
-
type: "attribute",
|
126
|
-
to: "__is-busy"
|
127
|
-
}
|
128
|
-
}
|
129
|
-
}
|
130
|
-
},
|
131
|
-
|
132
|
-
constructor : function(sId, mSettings) {
|
133
|
-
Control.apply(this, arguments);
|
134
|
-
|
135
|
-
this.__busyIndicatorTimeout = null;
|
136
|
-
|
137
|
-
this.__onInvalidationBound = this.__onInvalidation.bind(this);
|
138
|
-
this.__handleCustomEventBound = this.__handleCustomEvent.bind(this);
|
139
|
-
|
140
|
-
this.__delegates = {
|
141
|
-
onBeforeRendering: this.__onBeforeRenderingDelegate,
|
142
|
-
onAfterRendering: this.__onAfterRenderingDelegate
|
143
|
-
};
|
144
|
-
this.addDelegate(this.__delegates, true, this, false);
|
145
|
-
},
|
146
|
-
|
147
|
-
renderer: WebComponentRenderer
|
148
|
-
|
149
|
-
}, /* Metadata constructor */ WebComponentMetadata);
|
150
|
-
|
151
|
-
/**
|
152
|
-
* Assigns the __slot property which tells RenderManager to render the sap.ui.core.Element (oElement) with a "slot" attribute
|
153
|
-
*
|
154
|
-
* @param oElement
|
155
|
-
* @param sAggregationName
|
156
|
-
* @private
|
157
|
-
*/
|
158
|
-
WebComponent.prototype._setSlot = function(oElement, sAggregationName) {
|
159
|
-
var aDenyList = ["tooltip", "customData", "layoutData", "dependents", "dragDropConfig"];
|
160
|
-
if (oElement && !aDenyList.includes(sAggregationName)) {
|
161
|
-
var sSlot = this.getMetadata().getAggregationSlot(sAggregationName);
|
162
|
-
oElement.__slot = sSlot;
|
163
|
-
}
|
164
|
-
};
|
165
|
-
|
166
|
-
/**
|
167
|
-
* Removes the __slot property from the sap.ui.core.Element instance
|
168
|
-
*
|
169
|
-
* @param oElement
|
170
|
-
* @private
|
171
|
-
*/
|
172
|
-
WebComponent.prototype._unsetSlot = function(oElement) {
|
173
|
-
if (oElement) {
|
174
|
-
delete oElement.__slot;
|
175
|
-
}
|
176
|
-
};
|
177
|
-
|
178
|
-
/**
|
179
|
-
* Set the slot for each newly added child control, based on its aggregation
|
180
|
-
*
|
181
|
-
* @override
|
182
|
-
* @param sAggregationName
|
183
|
-
* @param oObject
|
184
|
-
* @param bSuppressInvalidate
|
185
|
-
* @returns {this}
|
186
|
-
*/
|
187
|
-
WebComponent.prototype.setAggregation = function(sAggregationName, oObject, bSuppressInvalidate) {
|
188
|
-
var vResult = Control.prototype.setAggregation.apply(this, arguments);
|
189
|
-
this._setSlot(oObject, sAggregationName);
|
190
|
-
return vResult;
|
191
|
-
};
|
192
|
-
|
193
|
-
/**
|
194
|
-
* Set the slot for each newly added child control, based on its aggregation
|
195
|
-
*
|
196
|
-
* @override
|
197
|
-
* @param sAggregationName
|
198
|
-
* @param oObject
|
199
|
-
* @param iIndex
|
200
|
-
* @param bSuppressInvalidate
|
201
|
-
* @returns {this}
|
202
|
-
*/
|
203
|
-
WebComponent.prototype.insertAggregation = function(sAggregationName, oObject, iIndex, bSuppressInvalidate) {
|
204
|
-
var vResult = Control.prototype.insertAggregation.apply(this, arguments);
|
205
|
-
this._setSlot(oObject, sAggregationName);
|
206
|
-
return vResult;
|
207
|
-
};
|
208
|
-
|
209
|
-
/**
|
210
|
-
* Set the slot for each newly added child control, based on its aggregation
|
211
|
-
*
|
212
|
-
* @override
|
213
|
-
* @param sAggregationName
|
214
|
-
* @param oObject
|
215
|
-
* @param bSuppressInvalidate
|
216
|
-
* @returns {this}
|
217
|
-
*/
|
218
|
-
WebComponent.prototype.addAggregation = function(sAggregationName, oObject, bSuppressInvalidate) {
|
219
|
-
var vResult = Control.prototype.addAggregation.apply(this, arguments);
|
220
|
-
this._setSlot(oObject, sAggregationName);
|
221
|
-
return vResult;
|
222
|
-
};
|
223
|
-
|
224
|
-
/**
|
225
|
-
* Remove the slot for each removed child control
|
226
|
-
*
|
227
|
-
* @override
|
228
|
-
* @param sAggregationName
|
229
|
-
* @param vObject
|
230
|
-
* @param bSuppressInvalidate
|
231
|
-
* @returns {sap.ui.base.ManagedObject}
|
232
|
-
*/
|
233
|
-
WebComponent.prototype.removeAggregation = function(sAggregationName, vObject, bSuppressInvalidate) {
|
234
|
-
var oChild = Control.prototype.removeAggregation.apply(this, arguments);
|
235
|
-
this._unsetSlot(oChild);
|
236
|
-
return oChild;
|
237
|
-
};
|
238
|
-
|
239
|
-
/**
|
240
|
-
* Remove the slot for each removed child control
|
241
|
-
*
|
242
|
-
* @override
|
243
|
-
* @param sAggregationName
|
244
|
-
* @param bSuppressInvalidate
|
245
|
-
* @returns {*}
|
246
|
-
*/
|
247
|
-
WebComponent.prototype.removeAllAggregation = function(sAggregationName, bSuppressInvalidate) {
|
248
|
-
var aChildren = Control.prototype.removeAllAggregation.apply(this, arguments);
|
249
|
-
aChildren.forEach(function(oChild) {
|
250
|
-
this._unsetSlot(oChild);
|
251
|
-
}, this);
|
252
|
-
|
253
|
-
return aChildren;
|
254
|
-
};
|
255
|
-
|
256
|
-
/**
|
257
|
-
* @private
|
258
|
-
*/
|
259
|
-
WebComponent.prototype.__onBeforeRenderingDelegate = function() {
|
260
|
-
this.__detachCustomEventsListeners();
|
261
|
-
};
|
262
|
-
|
263
|
-
/**
|
264
|
-
* @private
|
265
|
-
*/
|
266
|
-
WebComponent.prototype.__onAfterRenderingDelegate = function() {
|
267
|
-
this.__attachCustomEventsListeners();
|
268
|
-
|
269
|
-
var oDomRef = this.getDomRef();
|
270
|
-
window.customElements.whenDefined(oDomRef.localName).then(function() {
|
271
|
-
if (typeof oDomRef.attachInvalidate === "function") {
|
272
|
-
oDomRef.attachInvalidate(this.__onInvalidationBound);
|
273
|
-
}
|
274
|
-
|
275
|
-
if (oDomRef._individualSlot) {
|
276
|
-
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 ""
|
277
|
-
}
|
278
|
-
this.__updateObjectProperties(oDomRef);
|
279
|
-
}.bind(this));
|
280
|
-
};
|
281
|
-
|
282
|
-
/**
|
283
|
-
* Updates all object properties (can't be done via the renderer)
|
284
|
-
* @param oDomRef
|
285
|
-
* @private
|
286
|
-
*/
|
287
|
-
WebComponent.prototype.__updateObjectProperties = function(oDomRef) {
|
288
|
-
var oAttrProperties = this.getMetadata().getPropertiesByMapping("attribute");
|
289
|
-
for (var sPropName in oAttrProperties) {
|
290
|
-
if (this.isPropertyInitial(sPropName)) {
|
291
|
-
continue; // do not set properties that were not explicitly set/bound
|
292
|
-
}
|
293
|
-
|
294
|
-
var oPropData = oAttrProperties[sPropName];
|
295
|
-
var vPropValue = oPropData.get(this);
|
296
|
-
|
297
|
-
if (oPropData.type === "object" || typeof vPropValue === "object") {
|
298
|
-
var sWebComponentPropName = oPropData._sMapTo ? oPropData._sMapTo : sPropName;
|
299
|
-
oDomRef[sWebComponentPropName] = vPropValue;
|
300
|
-
}
|
301
|
-
}
|
302
|
-
};
|
303
|
-
|
304
|
-
WebComponent.prototype.setBusy = function(bBusy) {
|
305
|
-
var bCurrentBusyState = this.getBusy();
|
306
|
-
|
307
|
-
this.setProperty("busy", bBusy, true);
|
308
|
-
|
309
|
-
if (bCurrentBusyState !== bBusy) {
|
310
|
-
if (bBusy) {
|
311
|
-
this.__busyIndicatorTimeout = setTimeout(function() {
|
312
|
-
this.setProperty("__isBusy", bBusy);
|
313
|
-
}.bind(this), this.getBusyIndicatorDelay());
|
314
|
-
} else {
|
315
|
-
this.setProperty("__isBusy", bBusy);
|
316
|
-
clearTimeout(this.__busyIndicatorTimeout);
|
317
|
-
}
|
318
|
-
}
|
319
|
-
|
320
|
-
return this;
|
321
|
-
};
|
322
|
-
|
323
|
-
/**
|
324
|
-
* Synchronize user-controlled properties (such as checked, value)
|
325
|
-
* @param oChangeInfo
|
326
|
-
* @private
|
327
|
-
*/
|
328
|
-
WebComponent.prototype.__onInvalidation = function(oChangeInfo) {
|
329
|
-
if (oChangeInfo.type === "property") {
|
330
|
-
var sPropName = oChangeInfo.name;
|
331
|
-
var vNewValue = oChangeInfo.newValue;
|
332
|
-
var oPropData = this.getMetadata().getProperty(sPropName);
|
333
|
-
if (oPropData) {
|
334
|
-
this.setProperty(sPropName, vNewValue, true); // must suppress invalidation as this is intended to only sync the managed object state, not to trigger a rerender
|
335
|
-
}
|
336
|
-
}
|
337
|
-
};
|
338
|
-
|
339
|
-
WebComponent.prototype.__attachCustomEventsListeners = function() {
|
340
|
-
var oEvents = this.getMetadata().getEvents();
|
341
|
-
for (var sEventName in oEvents) {
|
342
|
-
var sCustomEventName = hyphenate(sEventName);
|
343
|
-
this.getDomRef().addEventListener(sCustomEventName, this.__handleCustomEventBound);
|
344
|
-
}
|
345
|
-
};
|
346
|
-
|
347
|
-
WebComponent.prototype.__detachCustomEventsListeners = function() {
|
348
|
-
var oDomRef = this.getDomRef();
|
349
|
-
if (!oDomRef) {
|
350
|
-
return;
|
351
|
-
}
|
352
|
-
|
353
|
-
var oEvents = this.getMetadata().getEvents();
|
354
|
-
for (var sEventName in oEvents) {
|
355
|
-
if (oEvents.hasOwnProperty(sEventName)) {
|
356
|
-
var sCustomEventName = hyphenate(sEventName);
|
357
|
-
oDomRef.removeEventListener(sCustomEventName, this.__handleCustomEventBound);
|
358
|
-
}
|
359
|
-
}
|
360
|
-
};
|
361
|
-
|
362
|
-
WebComponent.prototype.__handleCustomEvent = function(oEvent) {
|
363
|
-
var sCustomEventName = oEvent.type;
|
364
|
-
var sEventName = camelize(sCustomEventName);
|
365
|
-
|
366
|
-
// Prepare the event data object
|
367
|
-
var oEventData = this.__formatEventData(oEvent.detail);
|
368
|
-
|
369
|
-
// Finally fire the semantic event on the control instance
|
370
|
-
var oEventObj = this.getMetadata().getEvent(sEventName);
|
371
|
-
var bPrevented = !oEventObj.fire(this, oEventData);
|
372
|
-
if (bPrevented) {
|
373
|
-
oEvent.preventDefault();
|
374
|
-
}
|
375
|
-
};
|
376
|
-
|
377
|
-
WebComponent.prototype.__formatEventData = function(vDetail) {
|
378
|
-
// If the event data is an object, recursively convert all object dom element properties to control references
|
379
|
-
if (typeof vDetail === "object") {
|
380
|
-
return fnConvert(vDetail);
|
381
|
-
}
|
382
|
-
|
383
|
-
// If not an object, this is a DOM event such as click, just return an empty object
|
384
|
-
return {};
|
385
|
-
};
|
386
|
-
|
387
|
-
WebComponent.prototype.__callPublicMethod = function(name, args) {
|
388
|
-
if (!this.getDomRef()) {
|
389
|
-
throw new Error("Method called before custom element has been created by: " + this.getId());
|
390
|
-
}
|
391
|
-
|
392
|
-
var converted = Array.from(args).map(function(arg) { // convert any public method parameter that is a Control instance to a DOM Ref
|
393
|
-
if (arg instanceof Element) {
|
394
|
-
return arg.getDomRef();
|
395
|
-
}
|
396
|
-
return arg;
|
397
|
-
});
|
398
|
-
|
399
|
-
var vResult = this.getDomRef()[name].apply(this.getDomRef(), converted);
|
400
|
-
if (typeof vResult === "object") {
|
401
|
-
vResult = fnConvert(vResult);
|
402
|
-
}
|
403
|
-
|
404
|
-
return vResult;
|
405
|
-
};
|
406
|
-
|
407
|
-
WebComponent.prototype.__callPublicGetter = function(name) {
|
408
|
-
if (!this.getDomRef()) {
|
409
|
-
throw new Error("Getter called before custom element has been created by: " + this.getId());
|
410
|
-
}
|
411
|
-
|
412
|
-
var vResult = this.getDomRef()[name];
|
413
|
-
if (typeof vResult === "object") {
|
414
|
-
vResult = fnConvert(vResult);
|
415
|
-
}
|
416
|
-
|
417
|
-
return vResult;
|
418
|
-
};
|
419
|
-
|
420
|
-
WebComponent.prototype.destroy = function() {
|
421
|
-
var oDomRef = this.getDomRef();
|
422
|
-
this.__detachCustomEventsListeners();
|
423
|
-
if (oDomRef && typeof oDomRef.detachInvalidate === "function") {
|
424
|
-
oDomRef.detachInvalidate(this.__onInvalidationBound);
|
425
|
-
}
|
426
|
-
|
427
|
-
return Control.prototype.destroy.apply(this, arguments);
|
428
|
-
};
|
429
|
-
|
430
|
-
/**
|
431
|
-
* Maps the "enabled" property to the "disabled" attribute
|
432
|
-
* @param bEnabled
|
433
|
-
* @returns {boolean}
|
434
|
-
* @private
|
435
|
-
*/
|
436
|
-
WebComponent.prototype._mapEnabled = function(bEnabled) {
|
437
|
-
return !bEnabled;
|
438
|
-
};
|
439
|
-
|
440
|
-
/**
|
441
|
-
* Maps the "textDirection" property to the "dir" attribute
|
442
|
-
* @param sTextDirection
|
443
|
-
* @returns {string}
|
444
|
-
* @private
|
445
|
-
*/
|
446
|
-
WebComponent.prototype._mapTextDirection = function(sTextDirection) {
|
447
|
-
if (sTextDirection === TextDirection.Inherit) {
|
448
|
-
return null;
|
449
|
-
}
|
450
|
-
|
451
|
-
return sTextDirection.toLowerCase();
|
452
|
-
};
|
453
|
-
|
454
|
-
/**
|
455
|
-
* Generates a string containing the ID's from the association ariaLabelledBy.
|
456
|
-
* @param {string[]} aAriaLabelledBy an array of IDs associated with this control
|
457
|
-
* @returns {string} sAriaLabelledBy
|
458
|
-
*/
|
459
|
-
WebComponent.prototype._getAriaLabelledByForRendering = function (aAriaLabelledBy) {
|
460
|
-
var aFilteredIds = LabelEnablement.getReferencingLabels(this);
|
461
|
-
|
462
|
-
if (Array.isArray(aAriaLabelledBy)) {
|
463
|
-
aAriaLabelledBy.forEach(function (sId) {
|
464
|
-
if (aFilteredIds.indexOf(sId) < 0) {
|
465
|
-
aFilteredIds.unshift(sId);
|
466
|
-
}
|
467
|
-
});
|
468
|
-
}
|
469
|
-
|
470
|
-
return aFilteredIds.join(" ");
|
471
|
-
};
|
472
|
-
|
473
|
-
return WebComponent;
|
474
|
-
});
|
9
|
+
"sap/ui/core/webc/WebComponent",
|
10
|
+
"./WebComponentMetadata",
|
11
|
+
"sap/ui/core/webc/WebComponentRenderer"
|
12
|
+
],
|
13
|
+
function(
|
14
|
+
CoreWebComponent,
|
15
|
+
WebComponentMetadata,
|
16
|
+
CoreWebComponentRenderer
|
17
|
+
) {
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Constructs and initializes a Web Component Wrapper with the given <code>sId</code> and settings.
|
22
|
+
*
|
23
|
+
* @param {string} [sId] Optional ID for the new control; generated automatically if no non-empty ID is given
|
24
|
+
* Note: this can be omitted, no matter whether <code>mSettings</code> will be given or not!
|
25
|
+
* @param {object} [mSettings] Object with initial settings for the new control
|
26
|
+
*
|
27
|
+
* @class Base Class for Web Components.
|
28
|
+
* Web Components are agnostic UI elements which can be integrated into the UI5
|
29
|
+
* programming model by using this wrapper control. This wrapper control takes
|
30
|
+
* care to propagate the properties, the aggregations and the events. It also
|
31
|
+
* ensures to render the control and put the aggregated controls in the dedicated
|
32
|
+
* slots of the Web Component.
|
33
|
+
*
|
34
|
+
* @extends sap.ui.core.webc.WebComponent
|
35
|
+
* @author SAP SE
|
36
|
+
* @version 1.118.0
|
37
|
+
* @public
|
38
|
+
* @since 1.92.0
|
39
|
+
* @alias sap.ui.webc.common.WebComponent
|
40
|
+
* @experimental Since 1.92.0 The API might change. It is not intended for productive usage yet!
|
41
|
+
* @deprecated Since 1.118.0 Use sap.ui.core.webc.WebComponent instead!
|
42
|
+
*/
|
43
|
+
var WebComponent = CoreWebComponent.extend("sap.ui.webc.common.WebComponent", {
|
44
|
+
|
45
|
+
constructor : function(sId, mSettings) {
|
46
|
+
CoreWebComponent.apply(this, arguments);
|
47
|
+
},
|
48
|
+
|
49
|
+
renderer: CoreWebComponentRenderer
|
50
|
+
|
51
|
+
}, /* Metadata constructor */ WebComponentMetadata);
|
52
|
+
|
53
|
+
/**
|
54
|
+
* @typedef {sap.ui.core.webc.WebComponent.MetadataOptions} sap.ui.webc.common.WebComponent.MetadataOptions
|
55
|
+
*
|
56
|
+
* The structure of the "metadata" object which is passed when inheriting from sap.ui.core.Element using its static "extend" method.
|
57
|
+
* See {@link sap.ui.core.Element.extend} for details on its usage.
|
58
|
+
*
|
59
|
+
* @public
|
60
|
+
*/
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Defines a new subclass of WebComponent with the name <code>sClassName</code> and enriches it with
|
64
|
+
* the information contained in <code>oClassInfo</code>.
|
65
|
+
*
|
66
|
+
* <code>oClassInfo</code> can contain the same information that {@link sap.ui.base.ManagedObject.extend} already accepts,
|
67
|
+
* plus the <code>dnd</code> property in the metadata object literal to configure drag-and-drop behavior
|
68
|
+
* (see {@link sap.ui.core.webc.WebComponent.MetadataOptions MetadataOptions} for details). Objects describing aggregations can also
|
69
|
+
* have a <code>dnd</code> property when used for a class extending <code>WebComponent</code>
|
70
|
+
* (see {@link sap.ui.base.ManagedObject.MetadataOptions.AggregationDnD AggregationDnD}).
|
71
|
+
*
|
72
|
+
* Example:
|
73
|
+
* <pre>
|
74
|
+
* WebComponent.extend('sap.mylib.MyElement', {
|
75
|
+
* metadata : {
|
76
|
+
* library : 'sap.mylib',
|
77
|
+
* tag : 'my-webcomponent',
|
78
|
+
* properties : {
|
79
|
+
* value : 'string',
|
80
|
+
* width : {
|
81
|
+
* type: 'sap.ui.core.CSSSize',
|
82
|
+
* mapping: 'style'
|
83
|
+
* }
|
84
|
+
* },
|
85
|
+
* defaultAggregation: "content",
|
86
|
+
* aggregations : {
|
87
|
+
* content : {
|
88
|
+
* type: 'sap.ui.core.Control',
|
89
|
+
* multiple : true
|
90
|
+
* },
|
91
|
+
* header : {
|
92
|
+
* type : 'sap.ui.core.Control',
|
93
|
+
* multiple : false,
|
94
|
+
* slot: 'header'
|
95
|
+
* }
|
96
|
+
* }
|
97
|
+
* }
|
98
|
+
* });
|
99
|
+
* </pre>
|
100
|
+
*
|
101
|
+
* @param {string} sClassName Name of the class to be created
|
102
|
+
* @param {object} [oClassInfo] Object literal with information about the class
|
103
|
+
* @param {sap.ui.webc.common.WebComponent.MetadataOptions} [oClassInfo.metadata] the metadata object describing the class: tag, properties, aggregations, events etc.
|
104
|
+
* @param {function} [FNMetaImpl] Constructor function for the metadata object. If not given, it defaults to <code>sap.ui.core.ElementMetadata</code>.
|
105
|
+
* @returns {function} Created class / constructor function
|
106
|
+
*
|
107
|
+
* @public
|
108
|
+
* @static
|
109
|
+
* @name sap.ui.webc.common.WebComponent.extend
|
110
|
+
* @function
|
111
|
+
*/
|
112
|
+
|
113
|
+
return WebComponent;
|
114
|
+
});
|