@ui5/webcomponents-base 0.32.0 → 1.0.0-rc.16

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 (143) hide show
  1. package/.eslintignore +3 -1
  2. package/CHANGELOG.md +35 -0
  3. package/README.md +26 -2
  4. package/bundle.esm.js +6 -2
  5. package/dist/CSP.js +59 -0
  6. package/dist/Device.js +7 -0
  7. package/dist/EventProvider.js +19 -25
  8. package/dist/FontFace.js +7 -95
  9. package/dist/InitialConfiguration.js +31 -14
  10. package/dist/Keys.js +15 -0
  11. package/dist/ManagedStyles.js +83 -0
  12. package/dist/Render.js +3 -1
  13. package/dist/StaticAreaItem.js +27 -10
  14. package/dist/SystemCSSVars.js +4 -25
  15. package/dist/UI5Element.js +48 -62
  16. package/dist/UI5ElementMetadata.js +9 -1
  17. package/dist/asset-registries/Icons.js +29 -8
  18. package/dist/asset-registries/Illustrations.js +30 -0
  19. package/dist/asset-registries/LocaleData.js +11 -2
  20. package/dist/assets-meta/IconCollectionsAlias.js +18 -0
  21. package/dist/config/Theme.js +14 -0
  22. package/dist/css/FontFace.css +45 -0
  23. package/dist/css/OverrideFontFace.css +32 -0
  24. package/dist/css/SystemCSSVars.css +17 -0
  25. package/dist/delegate/ItemNavigation.js +66 -0
  26. package/dist/delegate/ScrollEnablement.js +7 -1
  27. package/dist/generated/AssetParameters.js +1 -1
  28. package/dist/generated/css/FontFace.css.js +5 -0
  29. package/dist/generated/css/OverrideFontFace.css.js +5 -0
  30. package/dist/generated/css/SystemCSSVars.css.js +5 -0
  31. package/dist/i18nBundle.js +36 -2
  32. package/dist/renderer/LitRenderer.js +24 -21
  33. package/dist/renderer/directives/style-map.js +72 -0
  34. package/dist/resources/bundle.esm.js +17 -101
  35. package/dist/resources/bundle.esm.js.map +1 -1
  36. package/dist/sap/base/Log.js +241 -0
  37. package/dist/sap/base/assert.js +8 -0
  38. package/dist/sap/base/security/URLListValidator.js +148 -0
  39. package/dist/sap/base/security/sanitizeHTML.js +16 -0
  40. package/dist/sap/base/util/now.js +7 -0
  41. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +3585 -0
  42. package/dist/test-resources/elements/WithStaticArea.js +2 -1
  43. package/dist/test-resources/pages/AllTestElements.html +3 -0
  44. package/dist/test-resources/pages/i18n.html +1 -3
  45. package/dist/test-resources/specs/ConfigurationChange.spec.js +9 -9
  46. package/dist/test-resources/specs/ConfigurationScript.spec.js +24 -24
  47. package/dist/test-resources/specs/ConfigurationURL.spec.js +64 -18
  48. package/dist/test-resources/specs/CustomTheme.spec.js +7 -7
  49. package/dist/test-resources/specs/EventProvider.spec.js +63 -0
  50. package/dist/test-resources/specs/StaticArea.spec.js +55 -13
  51. package/dist/test-resources/specs/Theming.spec.js +11 -11
  52. package/dist/test-resources/specs/UI5ElementInvalidation.js +29 -29
  53. package/dist/test-resources/specs/UI5ElementLifecycle.js +11 -11
  54. package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +11 -11
  55. package/dist/test-resources/specs/UI5ElementMetadataExt.js +8 -8
  56. package/dist/test-resources/specs/UI5ElementPropertyValidation.js +6 -6
  57. package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +36 -36
  58. package/dist/test-resources/specs/UI5ElementShadowDOM.js +9 -9
  59. package/dist/test-resources/specs/UI5ElementSlots.js +9 -9
  60. package/dist/theming/applyTheme.js +5 -8
  61. package/dist/theming/getEffectiveLinksHrefs.js +20 -0
  62. package/dist/theming/getStylesString.js +4 -2
  63. package/dist/theming/getThemeDesignerTheme.js +2 -1
  64. package/dist/theming/preloadLinks.js +23 -0
  65. package/dist/types/DataType.js +12 -0
  66. package/dist/types/Float.js +4 -0
  67. package/dist/types/Integer.js +4 -0
  68. package/dist/types/InvisibleMessageMode.js +30 -0
  69. package/dist/updateShadowRoot.js +8 -4
  70. package/dist/util/AriaLabelHelper.js +4 -4
  71. package/dist/util/FocusableElements.js +5 -1
  72. package/dist/util/HTMLSanitizer.js +7 -0
  73. package/dist/util/InvisibleMessage.js +58 -0
  74. package/dist/util/PopupUtils.js +1 -1
  75. package/dist/util/TabbableElements.js +1 -1
  76. package/dist/util/createLinkInHead.js +19 -0
  77. package/dist/util/encodeXML.js +35 -0
  78. package/dist/util/escapeRegex.js +10 -0
  79. package/dist/util/generateHighlightedMarkup.js +42 -0
  80. package/dist/util/getClassCopy.js +7 -2
  81. package/dist/util/isNodeTabbable.js +4 -4
  82. package/hash.txt +1 -1
  83. package/index.js +1 -1
  84. package/lib/generate-asset-parameters/index.js +0 -1
  85. package/lib/generate-styles/index.js +18 -0
  86. package/package-scripts.js +25 -3
  87. package/package.json +16 -8
  88. package/src/CSP.js +59 -0
  89. package/src/Device.js +7 -0
  90. package/src/EventProvider.js +19 -25
  91. package/src/FontFace.js +7 -95
  92. package/src/InitialConfiguration.js +31 -14
  93. package/src/Keys.js +15 -0
  94. package/src/ManagedStyles.js +83 -0
  95. package/src/Render.js +3 -1
  96. package/src/StaticAreaItem.js +27 -10
  97. package/src/SystemCSSVars.js +4 -25
  98. package/src/UI5Element.js +48 -62
  99. package/src/UI5ElementMetadata.js +9 -1
  100. package/src/asset-registries/Icons.js +29 -8
  101. package/src/asset-registries/Illustrations.js +30 -0
  102. package/src/asset-registries/LocaleData.js +11 -2
  103. package/src/assets-meta/IconCollectionsAlias.js +18 -0
  104. package/src/config/Theme.js +14 -0
  105. package/src/css/FontFace.css +45 -0
  106. package/src/css/OverrideFontFace.css +32 -0
  107. package/src/css/SystemCSSVars.css +17 -0
  108. package/src/delegate/ItemNavigation.js +66 -0
  109. package/src/delegate/ScrollEnablement.js +7 -1
  110. package/src/i18nBundle.js +36 -2
  111. package/src/renderer/LitRenderer.js +24 -21
  112. package/src/renderer/directives/style-map.js +72 -0
  113. package/src/theming/applyTheme.js +5 -8
  114. package/src/theming/getEffectiveLinksHrefs.js +20 -0
  115. package/src/theming/getStylesString.js +4 -2
  116. package/src/theming/getThemeDesignerTheme.js +2 -1
  117. package/src/theming/preloadLinks.js +23 -0
  118. package/src/types/DataType.js +12 -0
  119. package/src/types/Float.js +4 -0
  120. package/src/types/Integer.js +4 -0
  121. package/src/types/InvisibleMessageMode.js +30 -0
  122. package/src/updateShadowRoot.js +8 -4
  123. package/src/util/AriaLabelHelper.js +4 -4
  124. package/src/util/FocusableElements.js +5 -1
  125. package/src/util/HTMLSanitizer.js +7 -0
  126. package/src/util/InvisibleMessage.js +58 -0
  127. package/src/util/PopupUtils.js +1 -1
  128. package/src/util/TabbableElements.js +1 -1
  129. package/src/util/createLinkInHead.js +19 -0
  130. package/src/util/encodeXML.js +35 -0
  131. package/src/util/escapeRegex.js +10 -0
  132. package/src/util/generateHighlightedMarkup.js +42 -0
  133. package/src/util/getClassCopy.js +7 -2
  134. package/src/util/isNodeTabbable.js +4 -4
  135. package/used-modules.txt +7 -0
  136. package/dist/config/AssetsPath.js +0 -17
  137. package/dist/renderer/ifDefined.js +0 -21
  138. package/dist/renderer/scopeHTML.js +0 -32
  139. package/dist/theming/createThemePropertiesStyleTag.js +0 -20
  140. package/src/config/AssetsPath.js +0 -17
  141. package/src/renderer/ifDefined.js +0 -21
  142. package/src/renderer/scopeHTML.js +0 -32
  143. package/src/theming/createThemePropertiesStyleTag.js +0 -20
@@ -1,5 +1,10 @@
1
- const getClassCopy = klass => {
2
- return class classCopy extends klass {};
1
+ const getClassCopy = (klass, constructorCallback) => {
2
+ return class classCopy extends klass {
3
+ constructor() {
4
+ super();
5
+ constructorCallback && constructorCallback();
6
+ }
7
+ };
3
8
  };
4
9
 
5
10
  export default getClassCopy;
@@ -15,14 +15,14 @@ const isNodeTabbable = node => {
15
15
  return false;
16
16
  }
17
17
 
18
- if (nodeName === "a" || /input|select|textarea|button|object/.test(nodeName)) {
19
- return !node.disabled;
20
- }
21
-
22
18
  const tabIndex = node.getAttribute("tabindex");
23
19
  if (tabIndex !== null && tabIndex !== undefined) {
24
20
  return parseInt(tabIndex) >= 0;
25
21
  }
22
+
23
+ if (nodeName === "a" || /input|select|textarea|button|object/.test(nodeName)) {
24
+ return !node.disabled;
25
+ }
26
26
  };
27
27
 
28
28
  export default isNodeTabbable;
@@ -0,0 +1,7 @@
1
+ # Needed files from OpenUI5
2
+
3
+ sap/base/util/now.js
4
+ sap/base/Log.js
5
+ sap/base/assert.js
6
+ sap/base/security/URLListValidator.js
7
+ sap/base/security/sanitizeHTML.js
@@ -1,17 +0,0 @@
1
- import { getAssetsPath as getConfiguredAssetsPath } from "../InitialConfiguration.js";
2
-
3
- let assetsPath;
4
-
5
- const getAssetsPath = () => {
6
- if (assetsPath === undefined) {
7
- assetsPath = getConfiguredAssetsPath();
8
- }
9
-
10
- return assetsPath;
11
- };
12
-
13
- const setAssetsPath = newAssetsPath => {
14
- assetsPath = newAssetsPath;
15
- };
16
-
17
- export { getAssetsPath, setAssetsPath }; // eslint-disable-line
@@ -1,21 +0,0 @@
1
- import {
2
- AttributePart,
3
- directive,
4
- noChange,
5
- } from "lit-html/lit-html.js";
6
-
7
- /*
8
- lit-html directive that removes and attribute if it is undefined
9
- */
10
- export default directive(value => part => {
11
- if ((value === undefined) && part instanceof AttributePart) {
12
- if (value !== part.value) {
13
- const name = part.committer.name;
14
- part.committer.element.removeAttribute(name);
15
- }
16
- } else if (part.committer && part.committer.element && part.committer.element.getAttribute(part.committer.name) === value) {
17
- part.setValue(noChange);
18
- } else {
19
- part.setValue(value);
20
- }
21
- });
@@ -1,32 +0,0 @@
1
- const cache = new Map();
2
-
3
- const scopeHTML = (strings, tags, suffix) => {
4
- if (suffix && tags && tags.length) {
5
- strings = strings.map(string => {
6
- if (cache.has(string)) {
7
- return cache.get(string);
8
- }
9
-
10
- /*
11
- const allTags = [...string.matchAll(/<(ui5-.*?)[> ]/g)].map(x => x[1]);
12
- allTags.forEach(t => {
13
- if (!tags.includes(t)) {
14
- throw new Error(`${t} not found in ${string}`);
15
- // console.log(t, " in ", string);
16
- }
17
- });
18
- */
19
-
20
- let result = string;
21
- tags.forEach(tag => {
22
- result = result.replace(new RegExp(`(</?)(${tag})(/?[> \t\n])`, "g"), `$1$2-${suffix}$3`);
23
- });
24
- cache.set(string, result);
25
- return result;
26
- });
27
- }
28
-
29
- return strings;
30
- };
31
-
32
- export default scopeHTML;
@@ -1,20 +0,0 @@
1
- import createStyleInHead from "../util/createStyleInHead.js";
2
-
3
- /**
4
- * Creates/updates a style element holding all CSS Custom Properties
5
- * @param cssText
6
- * @param packageName
7
- */
8
- const createThemePropertiesStyleTag = (cssText, packageName) => {
9
- const styleElement = document.head.querySelector(`style[data-ui5-theme-properties="${packageName}"]`);
10
- if (styleElement) {
11
- styleElement.textContent = cssText || ""; // in case of undefined
12
- } else {
13
- const attributes = {
14
- "data-ui5-theme-properties": packageName,
15
- };
16
- createStyleInHead(cssText, attributes);
17
- }
18
- };
19
-
20
- export default createThemePropertiesStyleTag;
@@ -1,17 +0,0 @@
1
- import { getAssetsPath as getConfiguredAssetsPath } from "../InitialConfiguration.js";
2
-
3
- let assetsPath;
4
-
5
- const getAssetsPath = () => {
6
- if (assetsPath === undefined) {
7
- assetsPath = getConfiguredAssetsPath();
8
- }
9
-
10
- return assetsPath;
11
- };
12
-
13
- const setAssetsPath = newAssetsPath => {
14
- assetsPath = newAssetsPath;
15
- };
16
-
17
- export { getAssetsPath, setAssetsPath }; // eslint-disable-line
@@ -1,21 +0,0 @@
1
- import {
2
- AttributePart,
3
- directive,
4
- noChange,
5
- } from "lit-html/lit-html.js";
6
-
7
- /*
8
- lit-html directive that removes and attribute if it is undefined
9
- */
10
- export default directive(value => part => {
11
- if ((value === undefined) && part instanceof AttributePart) {
12
- if (value !== part.value) {
13
- const name = part.committer.name;
14
- part.committer.element.removeAttribute(name);
15
- }
16
- } else if (part.committer && part.committer.element && part.committer.element.getAttribute(part.committer.name) === value) {
17
- part.setValue(noChange);
18
- } else {
19
- part.setValue(value);
20
- }
21
- });
@@ -1,32 +0,0 @@
1
- const cache = new Map();
2
-
3
- const scopeHTML = (strings, tags, suffix) => {
4
- if (suffix && tags && tags.length) {
5
- strings = strings.map(string => {
6
- if (cache.has(string)) {
7
- return cache.get(string);
8
- }
9
-
10
- /*
11
- const allTags = [...string.matchAll(/<(ui5-.*?)[> ]/g)].map(x => x[1]);
12
- allTags.forEach(t => {
13
- if (!tags.includes(t)) {
14
- throw new Error(`${t} not found in ${string}`);
15
- // console.log(t, " in ", string);
16
- }
17
- });
18
- */
19
-
20
- let result = string;
21
- tags.forEach(tag => {
22
- result = result.replace(new RegExp(`(</?)(${tag})(/?[> \t\n])`, "g"), `$1$2-${suffix}$3`);
23
- });
24
- cache.set(string, result);
25
- return result;
26
- });
27
- }
28
-
29
- return strings;
30
- };
31
-
32
- export default scopeHTML;
@@ -1,20 +0,0 @@
1
- import createStyleInHead from "../util/createStyleInHead.js";
2
-
3
- /**
4
- * Creates/updates a style element holding all CSS Custom Properties
5
- * @param cssText
6
- * @param packageName
7
- */
8
- const createThemePropertiesStyleTag = (cssText, packageName) => {
9
- const styleElement = document.head.querySelector(`style[data-ui5-theme-properties="${packageName}"]`);
10
- if (styleElement) {
11
- styleElement.textContent = cssText || ""; // in case of undefined
12
- } else {
13
- const attributes = {
14
- "data-ui5-theme-properties": packageName,
15
- };
16
- createStyleInHead(cssText, attributes);
17
- }
18
- };
19
-
20
- export default createThemePropertiesStyleTag;