@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.
Files changed (41) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/.tsbuildinfobuild +1 -1
  3. package/dist/asset-registries/Icons.d.ts +1 -0
  4. package/dist/asset-registries/Icons.js +1 -0
  5. package/dist/asset-registries/Icons.js.map +1 -1
  6. package/dist/custom-elements-internal.json +132 -117
  7. package/dist/custom-elements.json +132 -117
  8. package/dist/generated/VersionInfo.js +3 -3
  9. package/dist/generated/VersionInfo.js.map +1 -1
  10. package/dist/prod/asset-registries/Icons.js +1 -1
  11. package/dist/prod/asset-registries/Icons.js.map +2 -2
  12. package/dist/prod/generated/VersionInfo.js +1 -1
  13. package/dist/prod/generated/VersionInfo.js.map +1 -1
  14. package/dist/prod/sap/base/Log.js +15 -29
  15. package/dist/prod/sap/base/assert.js +1 -1
  16. package/dist/prod/sap/base/config/MemoryConfigurationProvider.js +1 -1
  17. package/dist/prod/sap/base/security/URLListValidator.js +9 -5
  18. package/dist/prod/sap/base/security/encodeCSS.js +1 -1
  19. package/dist/prod/sap/base/security/encodeXML.js +1 -1
  20. package/dist/prod/sap/base/security/sanitizeHTML.js +1 -1
  21. package/dist/prod/sap/base/strings/toHex.js +1 -1
  22. package/dist/prod/sap/base/util/now.js +7 -13
  23. package/dist/prod/sap/base/util/uid.js +1 -1
  24. package/dist/prod/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
  25. package/dist/prod/util/generateHighlightedMarkupFirstMatch.js +2 -0
  26. package/dist/prod/util/generateHighlightedMarkupFirstMatch.js.map +7 -0
  27. package/dist/sap/base/Log.js +15 -29
  28. package/dist/sap/base/assert.js +1 -1
  29. package/dist/sap/base/config/MemoryConfigurationProvider.js +1 -1
  30. package/dist/sap/base/security/URLListValidator.js +9 -5
  31. package/dist/sap/base/security/encodeCSS.js +1 -1
  32. package/dist/sap/base/security/encodeXML.js +1 -1
  33. package/dist/sap/base/security/sanitizeHTML.js +1 -1
  34. package/dist/sap/base/strings/toHex.js +1 -1
  35. package/dist/sap/base/util/now.js +7 -13
  36. package/dist/sap/base/util/uid.js +1 -1
  37. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
  38. package/dist/util/generateHighlightedMarkupFirstMatch.d.ts +10 -0
  39. package/dist/util/generateHighlightedMarkupFirstMatch.js +36 -0
  40. package/dist/util/generateHighlightedMarkupFirstMatch.js.map +1 -0
  41. 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 if supported by the environment, otherwise in milliseconds.
5
- * The timestamp is based on 01/01/1970 00:00:00 (UNIX epoch) as float with microsecond precision or
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 if supported by the environment otherwise in milliseconds
11
+ * @returns {float} timestamp in microseconds
15
12
  */ /*!
16
13
  * OpenUI5
17
- * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
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 = !(typeof window != "undefined" && window.performance && performance.now && performance.timing) ? Date.now : function () {
23
- var iNavigationStart = performance.timing.navigationStart;
24
- return function perfnow() {
25
- return iNavigationStart + performance.now();
26
- };
27
- }();
19
+ var fnNow = function now() {
20
+ return performance.timeOrigin + performance.now();
21
+ };
28
22
  export default fnNow;
@@ -4,7 +4,7 @@
4
4
  * @private
5
5
  */ /*!
6
6
  * OpenUI5
7
- * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
7
+ * (c) Copyright 2026 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
9
9
  */
10
10
 
@@ -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
- 'cssLitGroup': [ L[ 2 ], L[ 47 ], L[ 54 ] ]
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 2009-2024 SAP SE or an SAP affiliate company.
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;AACH,SAAS,mCAAmC,CAAC,IAAY,EAAE,eAAuB;IACjF,MAAM,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC;IAElC,IAAI,CAAC,cAAc,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,OAAO,SAAS,CAAC,cAAc,CAAW,CAAC;IAC5C,CAAC;IAED,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC;IAClD,MAAM,SAAS,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;IAC/C,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC;IAE3C,mFAAmF;IACnF,IAAI,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,UAAU,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IACpF,IAAI,UAAU,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC;QACxD,UAAU,EAAE,CAAC,CAAC,iBAAiB;IAChC,CAAC;IAED,yCAAyC;IACzC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC,cAAc,CAAW,CAAC;IAC5C,CAAC;IAED,qDAAqD;IACrD,MAAM,WAAW,GAAG,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAW,CAAC;IACjF,MAAM,KAAK,GAAG,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,CAAC,CAAW,CAAC;IAClG,MAAM,UAAU,GAAG,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,GAAG,WAAW,CAAC,CAAW,CAAC;IAE3F,OAAO,GAAG,WAAW,MAAM,KAAK,OAAO,UAAU,EAAE,CAAC;AACrD,CAAC;AAED,eAAe,mCAAmC,CAAC","sourcesContent":["import escapeRegex from \"./escapeRegex.js\";\n// @ts-expect-error\nimport encodeXML from \"../sap/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.2",
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.120.17",
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.2",
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": "41f7af366ca45a15b31f7f74d349420dcd87fe1f"
88
+ "gitHead": "3afe33f1a00c7174d9da5e232b0744f970a4caea"
89
89
  }