@ui5/webcomponents-base 2.21.0-rc.2 → 2.21.0-rc.4
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/CHANGELOG.md +22 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/asset-registries/Icons.d.ts +1 -0
- package/dist/asset-registries/Icons.js +1 -0
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/custom-elements-internal.json +132 -117
- package/dist/custom-elements.json +132 -117
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/asset-registries/Icons.js +1 -1
- package/dist/prod/asset-registries/Icons.js.map +2 -2
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/sap/base/Log.js +15 -29
- package/dist/prod/sap/base/assert.js +1 -1
- package/dist/prod/sap/base/config/MemoryConfigurationProvider.js +1 -1
- package/dist/prod/sap/base/security/URLListValidator.js +9 -5
- package/dist/prod/sap/base/security/encodeCSS.js +1 -1
- package/dist/prod/sap/base/security/encodeXML.js +1 -1
- package/dist/prod/sap/base/security/sanitizeHTML.js +1 -1
- package/dist/prod/sap/base/strings/toHex.js +1 -1
- package/dist/prod/sap/base/util/now.js +7 -13
- package/dist/prod/sap/base/util/uid.js +1 -1
- package/dist/prod/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
- package/dist/prod/util/generateHighlightedMarkupFirstMatch.js +2 -0
- package/dist/prod/util/generateHighlightedMarkupFirstMatch.js.map +7 -0
- package/dist/sap/base/Log.js +15 -29
- package/dist/sap/base/assert.js +1 -1
- package/dist/sap/base/config/MemoryConfigurationProvider.js +1 -1
- package/dist/sap/base/security/URLListValidator.js +9 -5
- package/dist/sap/base/security/encodeCSS.js +1 -1
- package/dist/sap/base/security/encodeXML.js +1 -1
- package/dist/sap/base/security/sanitizeHTML.js +1 -1
- package/dist/sap/base/strings/toHex.js +1 -1
- package/dist/sap/base/util/now.js +7 -13
- package/dist/sap/base/util/uid.js +1 -1
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
- package/dist/util/generateHighlightedMarkupFirstMatch.d.ts +10 -0
- package/dist/util/generateHighlightedMarkupFirstMatch.js +36 -0
- package/dist/util/generateHighlightedMarkupFirstMatch.js.map +1 -0
- package/package.json +4 -4
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
// @evo-todo window.performance does not exist on node.js, but there is a module performance-now. Maybe use it
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
* Returns a high resolution timestamp in microseconds
|
|
5
|
-
* The timestamp is based on 01/01/1970 00:00:00 (UNIX epoch) as float with microsecond precision
|
|
6
|
-
* with millisecond precision, if high resolution timestamps are not available.
|
|
2
|
+
* Returns a high resolution timestamp in microseconds.
|
|
3
|
+
* The timestamp is based on 01/01/1970 00:00:00 (UNIX epoch) as float with microsecond precision.
|
|
7
4
|
* The fractional part of the timestamp represents fractions of a millisecond.
|
|
8
5
|
* Converting to a <code>Date</code> is possible by using <code>require(["sap/base/util/now"], function(now){new Date(now());}</code>
|
|
9
6
|
*
|
|
@@ -11,18 +8,15 @@
|
|
|
11
8
|
* @since 1.58
|
|
12
9
|
* @public
|
|
13
10
|
* @alias module:sap/base/util/now
|
|
14
|
-
* @returns {float} timestamp in microseconds
|
|
11
|
+
* @returns {float} timestamp in microseconds
|
|
15
12
|
*/ /*!
|
|
16
13
|
* OpenUI5
|
|
17
|
-
* (c) Copyright
|
|
14
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
18
15
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
19
16
|
*/
|
|
20
17
|
/*global performance */
|
|
21
18
|
|
|
22
|
-
var fnNow =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return iNavigationStart + performance.now();
|
|
26
|
-
};
|
|
27
|
-
}();
|
|
19
|
+
var fnNow = function now() {
|
|
20
|
+
return performance.timeOrigin + performance.now();
|
|
21
|
+
};
|
|
28
22
|
export default fnNow;
|
|
@@ -118,7 +118,11 @@ var cssSchema = (function () {
|
|
|
118
118
|
'inset' ], [ 'invert' ], [ 'justify' ], [ 'local' ], [ 'medium' ], [
|
|
119
119
|
'mix' ], [ 'none' ], [ 'normal' ], [ 'once' ], [ 'repeat' ], [ 'scroll'
|
|
120
120
|
], [ 'separate' ], [ 'small-caps' ], [ 'spell-out' ], [ 'transparent' ],
|
|
121
|
-
[ 'visible' ]
|
|
121
|
+
[ 'visible' ],
|
|
122
|
+
// ##### BEGIN: MODIFIED BY SAP
|
|
123
|
+
[ 'flex', 'inline-flex', 'grid', 'inline-grid', 'flow-root', 'contents' ], [ 'initial', 'revert', 'revert-layer', 'unset' ]
|
|
124
|
+
// ##### END: MODIFIED BY SAP
|
|
125
|
+
];
|
|
122
126
|
return {
|
|
123
127
|
'-moz-border-radius': {
|
|
124
128
|
'cssExtra': c[ 0 ],
|
|
@@ -440,7 +444,9 @@ var cssSchema = (function () {
|
|
|
440
444
|
},
|
|
441
445
|
'display': {
|
|
442
446
|
'cssPropBits': 32,
|
|
443
|
-
|
|
447
|
+
// ##### BEGIN: MODIFIED BY SAP
|
|
448
|
+
'cssLitGroup': [ L[ 2 ], L[ 47 ], L[ 54 ], L[ 64 ], L[ 65 ] ]
|
|
449
|
+
// ##### END: MODIFIED BY SAP
|
|
444
450
|
},
|
|
445
451
|
'elevation': {
|
|
446
452
|
'cssPropBits': 5,
|
|
@@ -707,6 +713,12 @@ var cssSchema = (function () {
|
|
|
707
713
|
'cssPropBits': 0,
|
|
708
714
|
'cssLitGroup': [ L[ 18 ], L[ 47 ], L[ 54 ] ]
|
|
709
715
|
},
|
|
716
|
+
// ##### BEGIN: MODIFIED BY SAP
|
|
717
|
+
'text-decoration-line': {
|
|
718
|
+
'cssPropBits': 0,
|
|
719
|
+
'cssLitGroup': [ L[ 18 ], L[ 47 ], L[ 54 ] ]
|
|
720
|
+
},
|
|
721
|
+
// ##### END: MODIFIED BY SAP
|
|
710
722
|
'text-indent': {
|
|
711
723
|
'cssPropBits': 5,
|
|
712
724
|
'cssLitGroup': [ L[ 47 ] ]
|
|
@@ -2004,7 +2016,7 @@ if (typeof window !== 'undefined') {
|
|
|
2004
2016
|
}
|
|
2005
2017
|
/*!
|
|
2006
2018
|
* OpenUI5
|
|
2007
|
-
* (c) Copyright
|
|
2019
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
2008
2020
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
2009
2021
|
*/
|
|
2010
2022
|
// Based on coding from the HTML4 Sanitizer by Google Inc.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate markup for a raw string where the first match following StartsWithPerTerm pattern is wrapped with `<b>` tag.
|
|
3
|
+
* StartsWithPerTerm pattern: finds the first word (at start or after whitespace) that starts with the search text.
|
|
4
|
+
* All inputs to this function are considered literal text, and special characters will always be escaped.
|
|
5
|
+
* @param {string} text The text to add highlighting to
|
|
6
|
+
* @param {string} textToHighlight The text which should be highlighted (case-insensitive)
|
|
7
|
+
* @return {string} the markup HTML which contains the first match surrounded with a `<b>` tag.
|
|
8
|
+
*/
|
|
9
|
+
declare function generateHighlightedMarkupFirstMatch(text: string, textToHighlight: string): string;
|
|
10
|
+
export default generateHighlightedMarkupFirstMatch;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import escapeRegex from "./escapeRegex.js";
|
|
2
|
+
// @ts-expect-error
|
|
3
|
+
import encodeXML from "../sap/base/security/encodeXML.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generate markup for a raw string where the first match following StartsWithPerTerm pattern is wrapped with `<b>` tag.
|
|
6
|
+
* StartsWithPerTerm pattern: finds the first word (at start or after whitespace) that starts with the search text.
|
|
7
|
+
* All inputs to this function are considered literal text, and special characters will always be escaped.
|
|
8
|
+
* @param {string} text The text to add highlighting to
|
|
9
|
+
* @param {string} textToHighlight The text which should be highlighted (case-insensitive)
|
|
10
|
+
* @return {string} the markup HTML which contains the first match surrounded with a `<b>` tag.
|
|
11
|
+
*/
|
|
12
|
+
function generateHighlightedMarkupFirstMatch(text, textToHighlight) {
|
|
13
|
+
const normalizedText = text || "";
|
|
14
|
+
if (!normalizedText || !textToHighlight) {
|
|
15
|
+
return encodeXML(normalizedText);
|
|
16
|
+
}
|
|
17
|
+
const filterValue = textToHighlight.toLowerCase();
|
|
18
|
+
const lowerText = normalizedText.toLowerCase();
|
|
19
|
+
const matchLength = textToHighlight.length;
|
|
20
|
+
// Find the first word that starts with textToHighlight (StartsWithPerTerm pattern)
|
|
21
|
+
let matchIndex = lowerText.search(new RegExp(`(^|\\s)${escapeRegex(filterValue)}`));
|
|
22
|
+
if (matchIndex !== -1 && lowerText[matchIndex] === " ") {
|
|
23
|
+
matchIndex++; // Skip the space
|
|
24
|
+
}
|
|
25
|
+
// If no match found, return encoded text
|
|
26
|
+
if (matchIndex === -1) {
|
|
27
|
+
return encodeXML(normalizedText);
|
|
28
|
+
}
|
|
29
|
+
// Build highlighted markup with only the first match
|
|
30
|
+
const beforeMatch = encodeXML(normalizedText.substring(0, matchIndex));
|
|
31
|
+
const match = encodeXML(normalizedText.substring(matchIndex, matchIndex + matchLength));
|
|
32
|
+
const afterMatch = encodeXML(normalizedText.substring(matchIndex + matchLength));
|
|
33
|
+
return `${beforeMatch}<b>${match}</b>${afterMatch}`;
|
|
34
|
+
}
|
|
35
|
+
export default generateHighlightedMarkupFirstMatch;
|
|
36
|
+
//# sourceMappingURL=generateHighlightedMarkupFirstMatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateHighlightedMarkupFirstMatch.js","sourceRoot":"","sources":["../../src/util/generateHighlightedMarkupFirstMatch.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,mBAAmB;AACnB,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAE1D;;;;;;;GAOG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/base/security/encodeXML.js\";\n\n/**\n * Generate markup for a raw string where the first match following StartsWithPerTerm pattern is wrapped with `<b>` tag.\n * StartsWithPerTerm pattern: finds the first word (at start or after whitespace) that starts with the search text.\n * All inputs to this function are considered literal text, and special characters will always be escaped.\n * @param {string} text The text to add highlighting to\n * @param {string} textToHighlight The text which should be highlighted (case-insensitive)\n * @return {string} the markup HTML which contains the first match surrounded with a `<b>` tag.\n */\nfunction generateHighlightedMarkupFirstMatch(text: string, textToHighlight: string): string {\n\tconst normalizedText = text || \"\";\n\n\tif (!normalizedText || !textToHighlight) {\n\t\treturn encodeXML(normalizedText) as string;\n\t}\n\n\tconst filterValue = textToHighlight.toLowerCase();\n\tconst lowerText = normalizedText.toLowerCase();\n\tconst matchLength = textToHighlight.length;\n\n\t// Find the first word that starts with textToHighlight (StartsWithPerTerm pattern)\n\tlet matchIndex = lowerText.search(new RegExp(`(^|\\\\s)${escapeRegex(filterValue)}`));\n\tif (matchIndex !== -1 && lowerText[matchIndex] === \" \") {\n\t\tmatchIndex++; // Skip the space\n\t}\n\n\t// If no match found, return encoded text\n\tif (matchIndex === -1) {\n\t\treturn encodeXML(normalizedText) as string;\n\t}\n\n\t// Build highlighted markup with only the first match\n\tconst beforeMatch = encodeXML(normalizedText.substring(0, matchIndex)) as string;\n\tconst match = encodeXML(normalizedText.substring(matchIndex, matchIndex + matchLength)) as string;\n\tconst afterMatch = encodeXML(normalizedText.substring(matchIndex + matchLength)) as string;\n\n\treturn `${beforeMatch}<b>${match}</b>${afterMatch}`;\n}\n\nexport default generateHighlightedMarkupFirstMatch;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "2.21.0-rc.
|
|
3
|
+
"version": "2.21.0-rc.4",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@custom-elements-manifest/analyzer": "^0.10.10",
|
|
66
|
-
"@openui5/sap.ui.core": "1.
|
|
66
|
+
"@openui5/sap.ui.core": "1.146.0",
|
|
67
67
|
"@sap-theming/theming-base-content": "11.34.1",
|
|
68
68
|
"@ui5/cypress-internal": "0.1.0",
|
|
69
|
-
"@ui5/webcomponents-tools": "2.21.0-rc.
|
|
69
|
+
"@ui5/webcomponents-tools": "2.21.0-rc.4",
|
|
70
70
|
"clean-css": "^5.2.2",
|
|
71
71
|
"cypress": "15.9.0",
|
|
72
72
|
"mocha": "^11.7.2",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"customElements": "dist/custom-elements.json",
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "3afe33f1a00c7174d9da5e232b0744f970a4caea"
|
|
89
89
|
}
|