@openui5/sap.ui.support 1.116.0 → 1.117.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 +6 -6
- package/src/sap/ui/support/.library +1 -1
- package/src/sap/ui/support/RuleAnalyzer.js +1 -1
- package/src/sap/ui/support/jQuery.sap.support.js +1 -1
- package/src/sap/ui/support/library.js +2 -2
- package/src/sap/ui/support/supportRules/Main.js +2 -2
- package/src/sap/ui/support/supportRules/RuleSet.js +28 -4
- package/src/sap/ui/support/supportRules/RuleSetLoader.js +66 -85
- package/src/sap/ui/support/supportRules/Storage.js +1 -1
- package/src/sap/ui/support/supportRules/WindowCommunicationBus.js +1 -1
- package/src/sap/ui/support/supportRules/ui/controllers/PresetsController.js +1 -1
- package/ui5.yaml +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.support",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.117.0",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.ui.support",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"url": "https://github.com/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.m": "1.
|
|
18
|
-
"@openui5/sap.ui.codeeditor": "1.
|
|
19
|
-
"@openui5/sap.ui.core": "1.
|
|
20
|
-
"@openui5/sap.ui.fl": "1.
|
|
21
|
-
"@openui5/sap.ui.layout": "1.
|
|
17
|
+
"@openui5/sap.m": "1.117.0",
|
|
18
|
+
"@openui5/sap.ui.codeeditor": "1.117.0",
|
|
19
|
+
"@openui5/sap.ui.core": "1.117.0",
|
|
20
|
+
"@openui5/sap.ui.fl": "1.117.0",
|
|
21
|
+
"@openui5/sap.ui.layout": "1.117.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.117.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>UI5 library: sap.ui.support</documentation>
|
|
12
12
|
|
|
@@ -23,7 +23,7 @@ sap.ui.define(["sap/ui/core/library"],
|
|
|
23
23
|
* @namespace
|
|
24
24
|
* @alias sap.ui.support
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.117.0
|
|
27
27
|
* @since 1.50
|
|
28
28
|
* @public
|
|
29
29
|
*/
|
|
@@ -37,7 +37,7 @@ sap.ui.define(["sap/ui/core/library"],
|
|
|
37
37
|
controls: [],
|
|
38
38
|
elements: [],
|
|
39
39
|
noLibraryCSS: true,
|
|
40
|
-
version: "1.
|
|
40
|
+
version: "1.117.0",
|
|
41
41
|
extensions: {
|
|
42
42
|
//Configuration used for rule loading of Support Assistant
|
|
43
43
|
"sap.ui.support": {
|
|
@@ -128,7 +128,7 @@ function (Log, VersionInfo, ManagedObject, Core, Element, Component, Analyzer, C
|
|
|
128
128
|
this._oCoreFacade = CoreFacade(Core);
|
|
129
129
|
this._oExecutionScope = null;
|
|
130
130
|
this._createElementSpies();
|
|
131
|
-
Core.attachLibraryChanged(RuleSetLoader._onLibraryChanged);
|
|
131
|
+
Core.attachLibraryChanged(RuleSetLoader._onLibraryChanged.bind(RuleSetLoader));
|
|
132
132
|
|
|
133
133
|
// Make sure that we load UI frame, when no parameter supplied
|
|
134
134
|
// but tools is required to load, or when parameter is there
|
|
@@ -607,7 +607,7 @@ function (Log, VersionInfo, ManagedObject, Core, Element, Component, Analyzer, C
|
|
|
607
607
|
|
|
608
608
|
var copyElementsFromCoreObject = function (coreObject, elemNames) {
|
|
609
609
|
for (var i in coreObject) {
|
|
610
|
-
if (Object.
|
|
610
|
+
if (Object.hasOwn(coreObject,i)) {
|
|
611
611
|
var element = coreObject[i];
|
|
612
612
|
var elementCopy = {
|
|
613
613
|
content: [],
|
|
@@ -11,10 +11,9 @@ sap.ui.define([
|
|
|
11
11
|
"sap/base/Log",
|
|
12
12
|
"sap/base/util/Version",
|
|
13
13
|
"sap/ui/support/library",
|
|
14
|
-
"sap/ui/support/supportRules/Storage"
|
|
15
|
-
"sap/ui/support/supportRules/Constants"
|
|
14
|
+
"sap/ui/support/supportRules/Storage"
|
|
16
15
|
],
|
|
17
|
-
function (Log, Version, library, storage
|
|
16
|
+
function (Log, Version, library, storage) {
|
|
18
17
|
"use strict";
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -35,7 +34,7 @@ function (Log, Version, library, storage, constants) {
|
|
|
35
34
|
* @private
|
|
36
35
|
* @alias sap.ui.support.RuleSet
|
|
37
36
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
37
|
+
* @version 1.117.0
|
|
39
38
|
* @param {object} oSettings Name of the initiated
|
|
40
39
|
*/
|
|
41
40
|
var RuleSet = function (oSettings) {
|
|
@@ -219,6 +218,31 @@ function (Log, Version, library, storage, constants) {
|
|
|
219
218
|
}
|
|
220
219
|
};
|
|
221
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Merge the rules (or array of rules) of another RuleSet, into this RuleSet.
|
|
223
|
+
* @public
|
|
224
|
+
* @param {sap.ui.support.RuleSet|sap.ui.support.RuleConfiguration[]} vRuleSetOrRules Rules to be merged
|
|
225
|
+
*/
|
|
226
|
+
RuleSet.prototype.mergeRuleSet = function (vRuleSetOrRules) {
|
|
227
|
+
var aRules = vRuleSetOrRules;
|
|
228
|
+
|
|
229
|
+
if (vRuleSetOrRules instanceof RuleSet) {
|
|
230
|
+
aRules = vRuleSetOrRules.getRules();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
for (var i = 0; i < aRules.length; i++) {
|
|
234
|
+
var vRule = aRules[i];
|
|
235
|
+
|
|
236
|
+
if (Array.isArray(vRule)) {
|
|
237
|
+
for (var k = 0; k < vRule.length; k++) {
|
|
238
|
+
this.addRule(vRule[k]);
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
this.addRule(vRule);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
222
246
|
/**
|
|
223
247
|
* Stores which rules are selected to be run by the analyzer on the next check
|
|
224
248
|
* @public
|
|
@@ -63,6 +63,7 @@ sap.ui.define([
|
|
|
63
63
|
var RuleSetLoader = {};
|
|
64
64
|
|
|
65
65
|
RuleSetLoader._mRuleSets = {};
|
|
66
|
+
RuleSetLoader._mRequireLibraryRuleSet = {};
|
|
66
67
|
|
|
67
68
|
RuleSetLoader.getRuleSets = function () {
|
|
68
69
|
return this._mRuleSets;
|
|
@@ -85,39 +86,31 @@ sap.ui.define([
|
|
|
85
86
|
* @returns {Promise<CommunicationBus>} mainPromise Has promises for all libraries regarding rulesets in the SupportAssistant
|
|
86
87
|
*/
|
|
87
88
|
RuleSetLoader._fetchSupportRuleSets = function (fnReadyCbk, mLibraries) {
|
|
88
|
-
var
|
|
89
|
-
mLoadedLibraries = mLibraries || sap.ui.getCore().getLoadedLibraries(),
|
|
89
|
+
var mLoadedLibraries = mLibraries || sap.ui.getCore().getLoadedLibraries(),
|
|
90
90
|
oLibNamesWithRulesPromise = this._fetchLibraryNamesWithSupportRules(mLoadedLibraries);
|
|
91
91
|
|
|
92
|
-
var oMainPromise = new Promise(function (resolve) {
|
|
93
|
-
|
|
94
92
|
// VersionInfo.load() returns the web application's version.
|
|
95
93
|
// Temp Workaround: Using the core library's version correctly returns the version of the framework
|
|
96
|
-
|
|
94
|
+
return VersionInfo.load({ library: "sap.ui.core" })
|
|
95
|
+
.then(function (oCoreLibInfo) {
|
|
97
96
|
RuleSet.versionInfo = oCoreLibInfo;
|
|
98
97
|
|
|
99
|
-
oLibNamesWithRulesPromise
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (fnReadyCbk && typeof fnReadyCbk === "function") {
|
|
111
|
-
fnReadyCbk();
|
|
112
|
-
}
|
|
113
|
-
});
|
|
98
|
+
return oLibNamesWithRulesPromise;
|
|
99
|
+
})
|
|
100
|
+
.then(function (oLibNamesWithRules) {
|
|
101
|
+
return Promise.all(this._fetchLibraryFiles(oLibNamesWithRules, this._fetchRuleSet));
|
|
102
|
+
}.bind(this))
|
|
103
|
+
.then(function () {
|
|
104
|
+
this._bRulesCreated = true;
|
|
105
|
+
CommunicationBus.publish(channelNames.UPDATE_SUPPORT_RULES, {
|
|
106
|
+
sRuleSet: RuleSerializer.serialize(this._mRuleSets),
|
|
107
|
+
oVersionInfo: RuleSet.versionInfo
|
|
114
108
|
});
|
|
115
109
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return oMainPromise;
|
|
110
|
+
if (fnReadyCbk && typeof fnReadyCbk === "function") {
|
|
111
|
+
fnReadyCbk();
|
|
112
|
+
}
|
|
113
|
+
}.bind(this));
|
|
121
114
|
};
|
|
122
115
|
|
|
123
116
|
/**
|
|
@@ -222,7 +215,6 @@ sap.ui.define([
|
|
|
222
215
|
*/
|
|
223
216
|
RuleSetLoader._fetchLibraryFiles = function (aLibNames, fnProcessFile, bSupressProgressReporting) {
|
|
224
217
|
var aAjaxPromises = [],
|
|
225
|
-
that = this,
|
|
226
218
|
supportModulePath = sap.ui.require.toUrl("sap/ui/support"),
|
|
227
219
|
supportModulesRoot = supportModulePath.replace("sap/ui/support", ""),
|
|
228
220
|
bCanLoadInternalRules = Utils.canLoadInternalRules(),
|
|
@@ -243,44 +235,50 @@ sap.ui.define([
|
|
|
243
235
|
CommunicationBus.publish(channelNames.CURRENT_LOADING_PROGRESS, { value: iPercentileProgressValue });
|
|
244
236
|
}
|
|
245
237
|
|
|
238
|
+
// CHECK FOR PUBLIC RULES
|
|
246
239
|
if (aLibNames.publicRules.length > 0) {
|
|
247
240
|
aLibNames.publicRules.forEach(function (oLibName) {
|
|
248
|
-
var
|
|
241
|
+
var customizableLibName = this._registerLibraryPath(oLibName, supportModulePath, supportModulesRoot).customizableLibName;
|
|
249
242
|
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
243
|
+
if (this._mRequireLibraryRuleSet[customizableLibName]) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
253
246
|
|
|
254
|
-
|
|
255
|
-
if (!bSilentMode && !bSupressProgressReporting) {
|
|
256
|
-
oLibPublicRulesPromise.then(function () {
|
|
257
|
-
reportCurrentLoadingProgress();
|
|
258
|
-
});
|
|
259
|
-
}
|
|
247
|
+
var oLibPublicRulesPromise = this._requireRuleSet(customizableLibName, fnProcessFile);
|
|
260
248
|
|
|
261
|
-
|
|
249
|
+
// Do not report progress if in silent mode
|
|
250
|
+
if (!bSilentMode && !bSupressProgressReporting) {
|
|
251
|
+
oLibPublicRulesPromise.then(function () {
|
|
252
|
+
reportCurrentLoadingProgress();
|
|
253
|
+
});
|
|
262
254
|
}
|
|
263
|
-
|
|
255
|
+
|
|
256
|
+
this._mRequireLibraryRuleSet[customizableLibName] = oLibPublicRulesPromise;
|
|
257
|
+
aAjaxPromises.push(oLibPublicRulesPromise);
|
|
258
|
+
}.bind(this));
|
|
264
259
|
}
|
|
265
260
|
|
|
261
|
+
// CHECK FOR INTERNAL RULES
|
|
266
262
|
if (bCanLoadInternalRules && aLibNames.internalRules.length > 0) {
|
|
267
263
|
aLibNames.internalRules.forEach(function (oLibName) {
|
|
268
|
-
var
|
|
264
|
+
var internalLibName = this._registerLibraryPath(oLibName, supportModulePath, supportModulesRoot).internalLibName;
|
|
269
265
|
|
|
270
|
-
if (
|
|
271
|
-
|
|
272
|
-
|
|
266
|
+
if (this._mRequireLibraryRuleSet[internalLibName]) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
273
269
|
|
|
274
|
-
|
|
275
|
-
if (!bSilentMode && !bSupressProgressReporting) {
|
|
276
|
-
oLibPrivateRulesPromise.then(function () {
|
|
277
|
-
reportCurrentLoadingProgress();
|
|
278
|
-
});
|
|
279
|
-
}
|
|
270
|
+
var oLibPrivateRulesPromise = this._requireRuleSet(internalLibName, fnProcessFile);
|
|
280
271
|
|
|
281
|
-
|
|
272
|
+
// Do not report progress if in silent mode
|
|
273
|
+
if (!bSilentMode && !bSupressProgressReporting) {
|
|
274
|
+
oLibPrivateRulesPromise.then(function () {
|
|
275
|
+
reportCurrentLoadingProgress();
|
|
276
|
+
});
|
|
282
277
|
}
|
|
283
|
-
|
|
278
|
+
|
|
279
|
+
this._mRequireLibraryRuleSet[internalLibName] = oLibPrivateRulesPromise;
|
|
280
|
+
aAjaxPromises.push(oLibPrivateRulesPromise);
|
|
281
|
+
}.bind(this));
|
|
284
282
|
}
|
|
285
283
|
|
|
286
284
|
return aAjaxPromises;
|
|
@@ -291,15 +289,11 @@ sap.ui.define([
|
|
|
291
289
|
* @param {string} libraryName The name of the library
|
|
292
290
|
* @param {string} supportModulePath Module path of the SupportAssistant
|
|
293
291
|
* @param {string} supportModulesRoot Root path of the SupportAssistant
|
|
294
|
-
* @returns {{internalLibName: string, customizableLibName: string}
|
|
292
|
+
* @returns {{internalLibName: string, customizableLibName: string}} Object, containing the library names
|
|
295
293
|
* for the internal rules or null if there isn't such a library loaded in the RuleSets array
|
|
296
294
|
* @private
|
|
297
295
|
*/
|
|
298
296
|
RuleSetLoader._registerLibraryPath = function (libraryName, supportModulePath, supportModulesRoot) {
|
|
299
|
-
if (this._mRuleSets[libraryName]) {
|
|
300
|
-
return null;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
297
|
var libResourceName = libraryName.replace(/\./g, "/");
|
|
304
298
|
var customizableLibResourceName = libResourceName;
|
|
305
299
|
var loadFromSupportOrigin = this._getLoadFromSupportOrigin();
|
|
@@ -357,31 +351,30 @@ sap.ui.define([
|
|
|
357
351
|
*/
|
|
358
352
|
RuleSetLoader._fetchRuleSet = function (sLibName) {
|
|
359
353
|
try {
|
|
360
|
-
var sNormalizedLibName,
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
oLibSupport = ObjectPath.get(sLibName).library.support;
|
|
354
|
+
var sNormalizedLibName = sLibName.replace("." + sCustomSuffix, "").replace(".internal", ""),
|
|
355
|
+
oLibSupport = ObjectPath.get(sLibName).library.support,
|
|
356
|
+
oRuleSet = this._mRuleSets[sNormalizedLibName];
|
|
364
357
|
|
|
365
358
|
if (!oLibSupport) {
|
|
366
359
|
// This case usually happens when the library flag bExport is set to true.
|
|
367
360
|
throw "The library.support file was not fetched successfully.";
|
|
368
361
|
}
|
|
369
362
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
if (!(oLibSupportCopy.ruleset instanceof RuleSet)) {
|
|
375
|
-
oLibSupportCopy = this._createRuleSet(oLibSupportCopy);
|
|
363
|
+
// ruleset already exists, just merge the new rules into it
|
|
364
|
+
if (oRuleSet) {
|
|
365
|
+
oRuleSet.ruleset.mergeRuleSet(oLibSupport.ruleset);
|
|
366
|
+
return;
|
|
376
367
|
}
|
|
377
368
|
|
|
378
|
-
|
|
379
|
-
|
|
369
|
+
// create the ruleset for the first time
|
|
370
|
+
if (oLibSupport.ruleset instanceof RuleSet) {
|
|
371
|
+
oRuleSet = extend({}, oLibSupport);
|
|
380
372
|
} else {
|
|
381
|
-
|
|
373
|
+
oRuleSet = this._createRuleSet(oLibSupport);
|
|
382
374
|
}
|
|
383
375
|
|
|
384
|
-
this._mRuleSets[sNormalizedLibName] =
|
|
376
|
+
this._mRuleSets[sNormalizedLibName] = oRuleSet;
|
|
377
|
+
|
|
385
378
|
} catch (e) {
|
|
386
379
|
Log.error("[" + constants.SUPPORT_ASSISTANT_NAME + "] Failed to load RuleSet for " + sLibName + " library", e);
|
|
387
380
|
}
|
|
@@ -439,9 +432,8 @@ sap.ui.define([
|
|
|
439
432
|
* @param {Event} oEvent Contains information about the library and newly created rules
|
|
440
433
|
*/
|
|
441
434
|
RuleSetLoader._onLibraryChanged = function (oEvent) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
that._oMainPromise = RuleSetLoader._fetchSupportRuleSets();
|
|
435
|
+
if (oEvent.getParameter("stereotype") === "library" && this._bRulesCreated) {
|
|
436
|
+
this._oMainPromise = this._fetchSupportRuleSets();
|
|
445
437
|
}
|
|
446
438
|
};
|
|
447
439
|
|
|
@@ -451,7 +443,7 @@ sap.ui.define([
|
|
|
451
443
|
* @param {function} fnReadyCbk the function to be called after the rules are loaded initially.
|
|
452
444
|
*/
|
|
453
445
|
RuleSetLoader.updateRuleSets = function (fnReadyCbk) {
|
|
454
|
-
this._oMainPromise =
|
|
446
|
+
this._oMainPromise = this._fetchSupportRuleSets(fnReadyCbk);
|
|
455
447
|
};
|
|
456
448
|
|
|
457
449
|
/**
|
|
@@ -468,18 +460,7 @@ sap.ui.define([
|
|
|
468
460
|
};
|
|
469
461
|
var oRuleSet = new RuleSet(oLib);
|
|
470
462
|
|
|
471
|
-
|
|
472
|
-
var ruleset = oLibrarySupport.ruleset[i];
|
|
473
|
-
|
|
474
|
-
// If the ruleset contains arrays of rules make sure we add them.
|
|
475
|
-
if (Array.isArray(ruleset)) {
|
|
476
|
-
for (var k = 0; k < ruleset.length; k++) {
|
|
477
|
-
oRuleSet.addRule(ruleset[k]);
|
|
478
|
-
}
|
|
479
|
-
} else {
|
|
480
|
-
oRuleSet.addRule(ruleset);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
463
|
+
oRuleSet.mergeRuleSet(oLibrarySupport.ruleset);
|
|
483
464
|
|
|
484
465
|
return {
|
|
485
466
|
lib: oLib,
|
|
@@ -24,7 +24,7 @@ sap.ui.define([
|
|
|
24
24
|
* @class
|
|
25
25
|
* @alias sap.ui.support.WindowCommunicationBus
|
|
26
26
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
27
|
+
* @version 1.117.0
|
|
28
28
|
* @private
|
|
29
29
|
*/
|
|
30
30
|
var WindowCommunicationBus = BaseObject.extend("sap.ui.support.supportRules.WindowCommunicationBus", {
|
package/ui5.yaml
CHANGED