@ui5/webcomponents-base 0.0.0-0a35d6b3d → 0.0.0-0dd36ca4b

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 (208) hide show
  1. package/CHANGELOG.md +653 -0
  2. package/README.md +0 -8
  3. package/config/wdio.conf.cjs +0 -8
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/Boot.d.ts +3 -2
  6. package/dist/Boot.js +7 -5
  7. package/dist/Boot.js.map +1 -1
  8. package/dist/Device.d.ts +1 -2
  9. package/dist/Device.js +5 -12
  10. package/dist/Device.js.map +1 -1
  11. package/dist/IgnoreCustomElements.d.ts +3 -5
  12. package/dist/IgnoreCustomElements.js +3 -5
  13. package/dist/IgnoreCustomElements.js.map +1 -1
  14. package/dist/InitialConfiguration.d.ts +1 -2
  15. package/dist/InitialConfiguration.js +1 -5
  16. package/dist/InitialConfiguration.js.map +1 -1
  17. package/dist/Keys.d.ts +3 -1
  18. package/dist/Keys.js +5 -1
  19. package/dist/Keys.js.map +1 -1
  20. package/dist/ManagedStyles.js +24 -98
  21. package/dist/ManagedStyles.js.map +1 -1
  22. package/dist/MediaRange.d.ts +6 -6
  23. package/dist/MediaRange.js +16 -16
  24. package/dist/MediaRange.js.map +1 -1
  25. package/dist/UI5Element.d.ts +20 -28
  26. package/dist/UI5Element.js +89 -67
  27. package/dist/UI5Element.js.map +1 -1
  28. package/dist/UI5ElementMetadata.d.ts +9 -2
  29. package/dist/UI5ElementMetadata.js +23 -4
  30. package/dist/UI5ElementMetadata.js.map +1 -1
  31. package/dist/asset-registries/Icons.js +1 -1
  32. package/dist/asset-registries/Icons.js.map +1 -1
  33. package/dist/asset-registries/Illustrations.d.ts +1 -0
  34. package/dist/asset-registries/Illustrations.js +12 -19
  35. package/dist/asset-registries/Illustrations.js.map +1 -1
  36. package/dist/asset-registries/LocaleData.js +1 -1
  37. package/dist/asset-registries/LocaleData.js.map +1 -1
  38. package/dist/asset-registries/i18n.d.ts +2 -2
  39. package/dist/asset-registries/i18n.js +2 -2
  40. package/dist/asset-registries/i18n.js.map +1 -1
  41. package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +1 -1
  42. package/dist/asset-registries/util/IconCollectionsByTheme.js +1 -1
  43. package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -1
  44. package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +3 -3
  45. package/dist/asset-registries/util/getIconCollectionByTheme.js +3 -3
  46. package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -1
  47. package/dist/config/Icons.d.ts +7 -7
  48. package/dist/config/Icons.js +7 -7
  49. package/dist/config/Icons.js.map +1 -1
  50. package/dist/config/Language.d.ts +1 -1
  51. package/dist/config/Language.js +6 -3
  52. package/dist/config/Language.js.map +1 -1
  53. package/dist/config/Theme.d.ts +4 -3
  54. package/dist/config/Theme.js +13 -6
  55. package/dist/config/Theme.js.map +1 -1
  56. package/dist/config/ThemeRoot.d.ts +2 -4
  57. package/dist/config/ThemeRoot.js +2 -4
  58. package/dist/config/ThemeRoot.js.map +1 -1
  59. package/dist/config/Timezone.d.ts +1 -1
  60. package/dist/config/Timezone.js +1 -1
  61. package/dist/config/Timezone.js.map +1 -1
  62. package/dist/css/SystemCSSVars.css +0 -8
  63. package/dist/custom-elements-internal.json +2952 -0
  64. package/dist/custom-elements.json +322 -2891
  65. package/dist/decorators/customElement.d.ts +2 -2
  66. package/dist/decorators/customElement.js +9 -4
  67. package/dist/decorators/customElement.js.map +1 -1
  68. package/dist/decorators/event.d.ts +5 -2
  69. package/dist/decorators/event.js.map +1 -1
  70. package/dist/decorators.d.ts +5 -0
  71. package/dist/decorators.js +6 -0
  72. package/dist/decorators.js.map +1 -0
  73. package/dist/delegate/ItemNavigation.d.ts +8 -8
  74. package/dist/delegate/ItemNavigation.js +9 -9
  75. package/dist/delegate/ItemNavigation.js.map +1 -1
  76. package/dist/features/InputElementsFormSupport.d.ts +18 -0
  77. package/dist/features/InputElementsFormSupport.js +40 -0
  78. package/dist/features/InputElementsFormSupport.js.map +1 -0
  79. package/dist/features/OpenUI5Support.d.ts +0 -2
  80. package/dist/features/OpenUI5Support.js +6 -21
  81. package/dist/features/OpenUI5Support.js.map +1 -1
  82. package/dist/features/patchPatcher.d.ts +11 -0
  83. package/dist/features/patchPatcher.js +11 -0
  84. package/dist/features/patchPatcher.js.map +1 -0
  85. package/dist/features/patchPopup.d.ts +14 -0
  86. package/dist/features/patchPopup.js +50 -0
  87. package/dist/features/patchPopup.js.map +1 -0
  88. package/dist/generated/AssetParameters.js +1 -1
  89. package/dist/generated/AssetParameters.js.map +1 -1
  90. package/dist/generated/VersionInfo.js +5 -5
  91. package/dist/generated/VersionInfo.js.map +1 -1
  92. package/dist/generated/css/SystemCSSVars.css.js +1 -1
  93. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  94. package/dist/locale/applyDirection.d.ts +3 -2
  95. package/dist/locale/applyDirection.js +3 -2
  96. package/dist/locale/applyDirection.js.map +1 -1
  97. package/dist/locale/getEffectiveDir.d.ts +1 -1
  98. package/dist/locale/getEffectiveDir.js +3 -19
  99. package/dist/locale/getEffectiveDir.js.map +1 -1
  100. package/dist/renderer/LitRenderer.js +2 -8
  101. package/dist/renderer/LitRenderer.js.map +1 -1
  102. package/dist/renderer/directives/style-map.d.ts +13 -0
  103. package/dist/renderer/directives/style-map.js +59 -59
  104. package/dist/renderer/directives/style-map.js.map +1 -0
  105. package/dist/sap/base/Log.js +698 -188
  106. package/dist/sap/base/assert.js +28 -1
  107. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  108. package/dist/sap/base/security/URLListValidator.js +253 -6
  109. package/dist/sap/base/security/encodeCSS.js +34 -8
  110. package/dist/sap/base/security/encodeXML.js +47 -17
  111. package/dist/sap/base/security/sanitizeHTML.js +35 -13
  112. package/dist/sap/base/strings/toHex.js +27 -2
  113. package/dist/sap/base/util/now.js +24 -3
  114. package/dist/sap/base/util/uid.js +27 -0
  115. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
  116. package/dist/ssr-dom-shim.d.ts +1 -0
  117. package/dist/ssr-dom-shim.js +12 -0
  118. package/dist/ssr-dom-shim.js.map +1 -0
  119. package/dist/ssr-dom.d.ts +0 -0
  120. package/dist/ssr-dom.js +0 -0
  121. package/dist/theming/getConstructableStyle.d.ts +1 -1
  122. package/dist/theming/getConstructableStyle.js +3 -3
  123. package/dist/theming/getConstructableStyle.js.map +1 -1
  124. package/dist/theming/getEffectiveStyle.d.ts +1 -1
  125. package/dist/theming/getEffectiveStyle.js +5 -12
  126. package/dist/theming/getEffectiveStyle.js.map +1 -1
  127. package/dist/types/AriaHasPopup.d.ts +32 -0
  128. package/dist/types/AriaHasPopup.js +34 -0
  129. package/dist/types/AriaHasPopup.js.map +1 -0
  130. package/dist/types/AriaLandmarkRole.d.ts +79 -0
  131. package/dist/types/AriaLandmarkRole.js +81 -0
  132. package/dist/types/AriaLandmarkRole.js.map +1 -0
  133. package/dist/types/AriaRole.d.ts +27 -0
  134. package/dist/types/AriaRole.js +29 -0
  135. package/dist/types/AriaRole.js.map +1 -0
  136. package/dist/types/DOMReference.d.ts +1 -1
  137. package/dist/types/DOMReference.js +1 -1
  138. package/dist/types/DOMReference.js.map +1 -1
  139. package/dist/types/MovePlacement.d.ts +20 -0
  140. package/dist/types/MovePlacement.js +22 -0
  141. package/dist/types/MovePlacement.js.map +1 -0
  142. package/dist/types/Orientation.d.ts +16 -0
  143. package/dist/types/Orientation.js +18 -0
  144. package/dist/types/Orientation.js.map +1 -0
  145. package/dist/types/ValueState.d.ts +3 -3
  146. package/dist/types/ValueState.js +3 -3
  147. package/dist/types/ValueState.js.map +1 -1
  148. package/dist/types.d.ts +24 -1
  149. package/dist/types.js.map +1 -1
  150. package/dist/updateShadowRoot.d.ts +1 -2
  151. package/dist/updateShadowRoot.js +5 -29
  152. package/dist/updateShadowRoot.js.map +1 -1
  153. package/dist/util/PopupUtils.d.ts +1 -3
  154. package/dist/util/PopupUtils.js +1 -15
  155. package/dist/util/PopupUtils.js.map +1 -1
  156. package/dist/util/clamp.js +2 -1
  157. package/dist/util/clamp.js.map +1 -1
  158. package/dist/util/createLinkInHead.d.ts +1 -1
  159. package/dist/util/createLinkInHead.js +1 -1
  160. package/dist/util/createLinkInHead.js.map +1 -1
  161. package/dist/util/detectNavigatorLanguage.d.ts +2 -2
  162. package/dist/util/detectNavigatorLanguage.js +6 -1
  163. package/dist/util/detectNavigatorLanguage.js.map +1 -1
  164. package/dist/util/dragAndDrop/DragRegistry.d.ts +12 -0
  165. package/dist/util/dragAndDrop/DragRegistry.js +68 -0
  166. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -0
  167. package/dist/util/dragAndDrop/findClosestPosition.d.ts +7 -0
  168. package/dist/util/dragAndDrop/findClosestPosition.js +59 -0
  169. package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
  170. package/dist/util/dragAndDrop/longDragOverHandler.d.ts +2 -0
  171. package/dist/util/dragAndDrop/longDragOverHandler.js +25 -0
  172. package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -0
  173. package/dist/util/getClassCopy.d.ts +13 -9
  174. package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -2
  175. package/dist/util/getDesigntimePropertyAsArray.js +2 -1
  176. package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
  177. package/dist/vscode.html-custom-data.json +22 -0
  178. package/index.js +1 -17
  179. package/package-scripts.cjs +12 -10
  180. package/package.json +13 -7
  181. package/src/css/SystemCSSVars.css +0 -8
  182. package/tsconfig.json +3 -0
  183. package/.eslintignore +0 -16
  184. package/.eslintrc.cjs +0 -3
  185. package/bundle.esm.js +0 -67
  186. package/dist/CSP.d.ts +0 -30
  187. package/dist/CSP.js +0 -51
  188. package/dist/CSP.js.map +0 -1
  189. package/dist/StaticAreaItem.d.ts +0 -35
  190. package/dist/StaticAreaItem.js +0 -100
  191. package/dist/StaticAreaItem.js.map +0 -1
  192. package/dist/config/RTL.d.ts +0 -7
  193. package/dist/config/RTL.js +0 -37
  194. package/dist/config/RTL.js.map +0 -1
  195. package/dist/theming/getEffectiveLinksHrefs.d.ts +0 -3
  196. package/dist/theming/getEffectiveLinksHrefs.js +0 -17
  197. package/dist/theming/getEffectiveLinksHrefs.js.map +0 -1
  198. package/dist/theming/preloadLinks.d.ts +0 -3
  199. package/dist/theming/preloadLinks.js +0 -19
  200. package/dist/theming/preloadLinks.js.map +0 -1
  201. package/dist/util/createStyleInHead.d.ts +0 -8
  202. package/dist/util/createStyleInHead.js +0 -18
  203. package/dist/util/createStyleInHead.js.map +0 -1
  204. package/lib/generate-asset-parameters/index.js +0 -27
  205. package/lib/generate-styles/index.js +0 -31
  206. package/lib/generate-version-info/index.js +0 -32
  207. package/src/renderer/directives/style-map.js +0 -72
  208. package/used-modules.txt +0 -10
@@ -1,8 +1,5 @@
1
- import createStyleInHead from "./util/createStyleInHead.js";
2
- import createLinkInHead from "./util/createLinkInHead.js";
3
- import { shouldUseLinks, getUrl } from "./CSP.js";
4
- import { isSafari } from "./Device.js";
5
1
  import { getCurrentRuntimeIndex, compareRuntimes } from "./Runtimes.js";
2
+ const isSSR = typeof document === "undefined";
6
3
  const getStyleId = (name, value) => {
7
4
  return value ? `${name}|${value}` : name;
8
5
  };
@@ -15,114 +12,43 @@ const shouldUpdate = (runtimeIndex) => {
15
12
  const createStyle = (data, name, value = "", theme) => {
16
13
  const content = typeof data === "string" ? data : data.content;
17
14
  const currentRuntimeIndex = getCurrentRuntimeIndex();
18
- if (shouldUseLinks()) {
19
- const attributes = {};
20
- attributes[name] = value;
21
- if (theme) {
22
- attributes["data-ui5-runtime-index"] = currentRuntimeIndex;
23
- attributes["data-ui5-theme"] = theme;
24
- }
25
- const href = getUrl(data.packageName, data.fileName);
26
- createLinkInHead(href, attributes);
27
- }
28
- else if (document.adoptedStyleSheets && !isSafari()) {
29
- const stylesheet = new CSSStyleSheet();
30
- stylesheet.replaceSync(content);
31
- stylesheet._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later
32
- if (theme) {
33
- stylesheet._ui5RuntimeIndex = currentRuntimeIndex;
34
- stylesheet._ui5Theme = theme;
35
- }
36
- document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];
37
- }
38
- else {
39
- const attributes = {};
40
- attributes[name] = value;
41
- if (theme) {
42
- attributes["data-ui5-runtime-index"] = currentRuntimeIndex;
43
- attributes["data-ui5-theme"] = theme;
44
- }
45
- createStyleInHead(content, attributes);
46
- }
15
+ const stylesheet = new CSSStyleSheet();
16
+ stylesheet.replaceSync(content);
17
+ stylesheet._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later
18
+ if (theme) {
19
+ stylesheet._ui5RuntimeIndex = currentRuntimeIndex;
20
+ stylesheet._ui5Theme = theme;
21
+ }
22
+ document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];
47
23
  };
48
24
  const updateStyle = (data, name, value = "", theme) => {
49
25
  const content = typeof data === "string" ? data : data.content;
50
26
  const currentRuntimeIndex = getCurrentRuntimeIndex();
51
- if (shouldUseLinks()) {
52
- const link = document.querySelector(`head>link[${name}="${value}"]`);
53
- const href = getUrl(data.packageName, data.fileName);
54
- if (!theme) {
55
- link.href = href;
56
- }
57
- else {
58
- const linkRuntimeIndex = link.getAttribute("data-ui5-runtime-index") || undefined;
59
- const linkTheme = link.getAttribute("data-ui5-theme");
60
- if (linkTheme !== theme || shouldUpdate(linkRuntimeIndex)) {
61
- link.href = href;
62
- link.setAttribute("data-ui5-runtime-index", String(currentRuntimeIndex));
63
- link.setAttribute("data-ui5-theme", theme);
64
- }
65
- }
27
+ const stylesheet = document.adoptedStyleSheets.find(sh => sh._ui5StyleId === getStyleId(name, value));
28
+ if (!stylesheet) {
29
+ return;
66
30
  }
67
- else if (document.adoptedStyleSheets && !isSafari()) {
68
- const stylesheet = document.adoptedStyleSheets.find(sh => sh._ui5StyleId === getStyleId(name, value));
69
- if (!stylesheet) {
70
- return;
71
- }
72
- if (!theme) {
73
- stylesheet.replaceSync(content || "");
74
- }
75
- else {
76
- const stylesheetRuntimeIndex = stylesheet._ui5RuntimeIndex;
77
- const stylesheetTheme = stylesheet._ui5Theme;
78
- if (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {
79
- stylesheet.replaceSync(content || "");
80
- stylesheet._ui5RuntimeIndex = String(currentRuntimeIndex);
81
- stylesheet._ui5Theme = theme;
82
- }
83
- }
31
+ if (!theme) {
32
+ stylesheet.replaceSync(content || "");
84
33
  }
85
34
  else {
86
- const style = document.querySelector(`head>style[${name}="${value}"]`);
87
- if (!style) {
88
- return;
89
- }
90
- if (!theme) {
91
- style.textContent = content || "";
92
- }
93
- else {
94
- const styleRuntimeIndex = style.getAttribute("data-ui5-runtime-index") || undefined;
95
- const styleTheme = style.getAttribute("data-ui5-theme");
96
- if (styleTheme !== theme || shouldUpdate(styleRuntimeIndex)) {
97
- style.textContent = content || "";
98
- style.setAttribute("data-ui5-runtime-index", String(currentRuntimeIndex));
99
- style.setAttribute("data-ui5-theme", theme);
100
- }
35
+ const stylesheetRuntimeIndex = stylesheet._ui5RuntimeIndex;
36
+ const stylesheetTheme = stylesheet._ui5Theme;
37
+ if (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {
38
+ stylesheet.replaceSync(content || "");
39
+ stylesheet._ui5RuntimeIndex = String(currentRuntimeIndex);
40
+ stylesheet._ui5Theme = theme;
101
41
  }
102
42
  }
103
43
  };
104
44
  const hasStyle = (name, value = "") => {
105
- if (shouldUseLinks()) {
106
- return !!document.querySelector(`head>link[${name}="${value}"]`);
107
- }
108
- const styleElement = document.querySelector(`head>style[${name}="${value}"]`);
109
- if (document.adoptedStyleSheets && !isSafari()) {
110
- return !!styleElement || !!document.adoptedStyleSheets.find(sh => sh._ui5StyleId === getStyleId(name, value));
45
+ if (isSSR) {
46
+ return true;
111
47
  }
112
- return !!styleElement;
48
+ return !!document.adoptedStyleSheets.find(sh => sh._ui5StyleId === getStyleId(name, value));
113
49
  };
114
50
  const removeStyle = (name, value = "") => {
115
- if (shouldUseLinks()) {
116
- const linkElement = document.querySelector(`head>link[${name}="${value}"]`);
117
- linkElement?.parentElement?.removeChild(linkElement);
118
- }
119
- else if (document.adoptedStyleSheets && !isSafari()) {
120
- document.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => sh._ui5StyleId !== getStyleId(name, value));
121
- }
122
- else {
123
- const styleElement = document.querySelector(`head > style[${name}="${value}"]`);
124
- styleElement?.parentElement?.removeChild(styleElement);
125
- }
51
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => sh._ui5StyleId !== getStyleId(name, value));
126
52
  };
127
53
  const createOrUpdateStyle = (data, name, value = "", theme) => {
128
54
  if (hasStyle(name, value)) {
@@ -1 +1 @@
1
- {"version":3,"file":"ManagedStyles.js","sourceRoot":"","sources":["../src/ManagedStyles.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE;IAClD,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,OAAO,IAAI,CAAC;KACZ;IACD,OAAO,eAAe,CAAC,sBAAsB,EAAE,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,2FAA2F;AAC5K,CAA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":["import createStyleInHead from \"./util/createStyleInHead.js\";\nimport createLinkInHead from \"./util/createLinkInHead.js\";\nimport { shouldUseLinks, getUrl } from \"./CSP.js\";\nimport { StyleData, StyleDataCSP } from \"./types.js\";\nimport { isSafari } from \"./Device.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tif (shouldUseLinks()) {\n\t\tconst attributes = {} as Record<string, any>;\n\t\tattributes[name] = value;\n\t\tif (theme) {\n\t\t\tattributes[\"data-ui5-runtime-index\"] = currentRuntimeIndex;\n\t\t\tattributes[\"data-ui5-theme\"] = theme;\n\t\t}\n\t\tconst href = getUrl((data as StyleDataCSP).packageName, (data as StyleDataCSP).fileName);\n\t\tcreateLinkInHead(href, attributes);\n\t} else if (document.adoptedStyleSheets && !isSafari()) {\n\t\tconst stylesheet = new CSSStyleSheet();\n\t\tstylesheet.replaceSync(content);\n\t\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\t\tif (theme) {\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n\t} else {\n\t\tconst attributes = {} as Record<string, any>;\n\t\tattributes[name] = value;\n\t\tif (theme) {\n\t\t\tattributes[\"data-ui5-runtime-index\"] = currentRuntimeIndex;\n\t\t\tattributes[\"data-ui5-theme\"] = theme;\n\t\t}\n\t\tcreateStyleInHead(content, attributes);\n\t}\n};\n\nconst updateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tif (shouldUseLinks()) {\n\t\tconst link = document.querySelector(`head>link[${name}=\"${value}\"]`) as HTMLLinkElement;\n\t\tconst href = getUrl((data as StyleDataCSP).packageName, (data as StyleDataCSP).fileName);\n\n\t\tif (!theme) {\n\t\t\tlink.href = href;\n\t\t} else {\n\t\t\tconst linkRuntimeIndex = link.getAttribute(\"data-ui5-runtime-index\") || undefined;\n\t\t\tconst linkTheme = link.getAttribute(\"data-ui5-theme\");\n\t\t\tif (linkTheme !== theme || shouldUpdate(linkRuntimeIndex)) {\n\t\t\t\tlink.href = href;\n\t\t\t\tlink.setAttribute(\"data-ui5-runtime-index\", String(currentRuntimeIndex));\n\t\t\t\tlink.setAttribute(\"data-ui5-theme\", theme);\n\t\t\t}\n\t\t}\n\t} else if (document.adoptedStyleSheets && !isSafari()) {\n\t\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\t\tif (!stylesheet) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!theme) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t} else {\n\t\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst style = document.querySelector(`head>style[${name}=\"${value}\"]`);\n\t\tif (!style) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!theme) {\n\t\t\tstyle.textContent = content || \"\";\n\t\t} else {\n\t\t\tconst styleRuntimeIndex = style.getAttribute(\"data-ui5-runtime-index\") || undefined;\n\t\t\tconst styleTheme = style.getAttribute(\"data-ui5-theme\");\n\t\t\tif (styleTheme !== theme || shouldUpdate(styleRuntimeIndex)) {\n\t\t\t\tstyle.textContent = content || \"\";\n\t\t\t\tstyle.setAttribute(\"data-ui5-runtime-index\", String(currentRuntimeIndex));\n\t\t\t\tstyle.setAttribute(\"data-ui5-theme\", theme);\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (shouldUseLinks()) {\n\t\treturn !!document.querySelector(`head>link[${name}=\"${value}\"]`);\n\t}\n\n\tconst styleElement = document.querySelector(`head>style[${name}=\"${value}\"]`);\n\n\tif (document.adoptedStyleSheets && !isSafari()) {\n\t\treturn !!styleElement || !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\t}\n\n\treturn !!styleElement;\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tif (shouldUseLinks()) {\n\t\tconst linkElement = document.querySelector(`head>link[${name}=\"${value}\"]`);\n\t\tlinkElement?.parentElement?.removeChild(linkElement);\n\t} else if (document.adoptedStyleSheets && !isSafari()) {\n\t\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n\t} else {\n\t\tconst styleElement = document.querySelector(`head > style[${name}=\"${value}\"]`);\n\t\tstyleElement?.parentElement?.removeChild(styleElement);\n\t}\n};\n\nconst createOrUpdateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(data, name, value, theme);\n\t} else {\n\t\tcreateStyle(data, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: StyleData, style2?: StyleData) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\tconst style2Content = typeof style2 === \"string\" ? style2 : style2.content;\n\tif (typeof style1 === \"string\") {\n\t\treturn `${style1} ${style2Content}`;\n\t}\n\treturn {\n\t\tcontent: `${style1.content} ${style2Content}`,\n\t\tpackageName: style1.packageName,\n\t\tfileName: style1.fileName,\n\t};\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n\nexport type {\n\tStyleData,\n\tStyleDataCSP,\n};\n"]}
1
+ {"version":3,"file":"ManagedStyles.js","sourceRoot":"","sources":["../src/ManagedStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC;AAE9C,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE;IAClD,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,OAAO,IAAI,CAAC;KACZ;IACD,OAAO,eAAe,CAAC,sBAAsB,EAAE,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,2FAA2F;AAC5K,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAe,EAAE,IAAY,EAAE,KAAK,GAAG,EAAE,EAAE,KAAc,EAAE,EAAE;IACjF,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,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B,OAAO,MAAM,CAAC;KACd;IACD,IAAI,MAAM,KAAK,SAAS,EAAE;QACzB,OAAO,MAAM,CAAC;KACd;IACD,MAAM,aAAa,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;IAC3E,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC/B,OAAO,GAAG,MAAM,IAAI,aAAa,EAAE,CAAC;KACpC;IACD,OAAO;QACN,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,IAAI,aAAa,EAAE;QAC7C,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;KACzB,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,WAAW,GACX,CAAC","sourcesContent":["import { StyleData, StyleDataCSP } from \"./types.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(data, name, value, theme);\n\t} else {\n\t\tcreateStyle(data, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: StyleData, style2?: StyleData) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\tconst style2Content = typeof style2 === \"string\" ? style2 : style2.content;\n\tif (typeof style1 === \"string\") {\n\t\treturn `${style1} ${style2Content}`;\n\t}\n\treturn {\n\t\tcontent: `${style1.content} ${style2Content}`,\n\t\tpackageName: style1.packageName,\n\t\tfileName: style1.fileName,\n\t};\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n\nexport type {\n\tStyleData,\n\tStyleDataCSP,\n};\n"]}
@@ -9,12 +9,12 @@ declare enum RANGESETS {
9
9
  * A 4-step range set (S-M-L-XL).
10
10
  *
11
11
  * The ranges of this set are:
12
- * <ul>
13
- * <li><code>"S"</code>: For screens smaller than 600 pixels.</li>
14
- * <li><code>"M"</code>: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.</li>
15
- * <li><code>"L"</code>: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.</li>
16
- * <li><code>"XL"</code>: For screens greater than or equal to 1440 pixels.</li>
17
- * </ul>
12
+ *
13
+ * - `"S"`: For screens smaller than 600 pixels.
14
+ * - `"M"`: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.
15
+ * - `"L"`: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.
16
+ * - `"XL"`: For screens greater than or equal to 1440 pixels.
17
+ *
18
18
  *
19
19
  * @public
20
20
  */
@@ -15,12 +15,12 @@ var RANGESETS;
15
15
  * A 4-step range set (S-M-L-XL).
16
16
  *
17
17
  * The ranges of this set are:
18
- * <ul>
19
- * <li><code>"S"</code>: For screens smaller than 600 pixels.</li>
20
- * <li><code>"M"</code>: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.</li>
21
- * <li><code>"L"</code>: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.</li>
22
- * <li><code>"XL"</code>: For screens greater than or equal to 1440 pixels.</li>
23
- * </ul>
18
+ *
19
+ * - `"S"`: For screens smaller than 600 pixels.
20
+ * - `"M"`: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.
21
+ * - `"L"`: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.
22
+ * - `"XL"`: For screens greater than or equal to 1440 pixels.
23
+ *
24
24
  *
25
25
  * @public
26
26
  */
@@ -29,18 +29,18 @@ var RANGESETS;
29
29
  /**
30
30
  * Initializes a screen width media query range set.
31
31
  *
32
- * This initialization step makes the range set ready to be used for one of the other functions in namespace <code>MediaRange</code>.
32
+ * This initialization step makes the range set ready to be used for one of the other functions in namespace `MediaRange`.
33
33
  *
34
34
  * A range set can be defined as shown in the following example:
35
- * <pre>
35
+ * ```
36
36
  * MediaRange.initRangeSet("MyRangeSet", [200, 400], ["Small", "Medium", "Large"]);
37
- * </pre>
37
+ * ```
38
38
  * This example defines the following named ranges:
39
- * <ul>
40
- * <li><code>"Small"</code>: For screens smaller than 200 pixels.</li>
41
- * <li><code>"Medium"</code>: For screens greater than or equal to 200 pixels and smaller than 400 pixels.</li>
42
- * <li><code>"Large"</code>: For screens greater than or equal to 400 pixels.</li>
43
- * </ul>
39
+ *
40
+ * - `"Small"`: For screens smaller than 200 pixels.
41
+ * - `"Medium"`: For screens greater than or equal to 200 pixels and smaller than 400 pixels.
42
+ * - `"Large"`: For screens greater than or equal to 400 pixels.
43
+ *
44
44
  *
45
45
  * @param name The name of the range set to be initialized.
46
46
  * The name must be a valid id and consist only of letters and numeric digits.
@@ -52,12 +52,12 @@ const initRangeSet = (name, range) => {
52
52
  /**
53
53
  * Returns information about the current active range of the range set with the given name.
54
54
  *
55
- * If the optional parameter <code>width</code> is given, the active range will be determined for that width,
55
+ * If the optional parameter `width` is given, the active range will be determined for that width,
56
56
  * otherwise it is determined for the current window size.
57
57
  *
58
58
  * @param name The name of the range set. The range set must be initialized beforehand ({@link MediaRange.initRangeSet})
59
59
  * @param [width] An optional width, based on which the range should be determined;
60
- * If <code>width</code> is not provided, the window size will be used.
60
+ * If `width` is not provided, the window size will be used.
61
61
  * @returns The name of the current active interval of the range set.
62
62
  * @public
63
63
  */
@@ -1 +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AAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAC/B,IAAI,cAAc,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,cAAc,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;YAC7D,gBAAgB,GAAG,GAAG,CAAC;SACvB;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAG;IAClB,SAAS;IACT,YAAY;IACZ,eAAe;CACf,CAAC;AAEF,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;AAE9E,eAAe,UAAU,CAAC","sourcesContent":["type Range = Map<string, Array<number>>;\n\nconst mediaRanges = new Map<string, Range>();\n\nconst DEAFULT_RANGE_SET: Range = new Map<string, Array<number>>();\nDEAFULT_RANGE_SET.set(\"S\", [0, 599]);\nDEAFULT_RANGE_SET.set(\"M\", [600, 1023]);\nDEAFULT_RANGE_SET.set(\"L\", [1024, 1439]);\nDEAFULT_RANGE_SET.set(\"XL\", [1440, Infinity]);\n\n/**\n * Enumeration containing the names and settings of predefined screen width media query range sets.\n *\n * @public\n */\n enum RANGESETS {\n\t/**\n\t * A 4-step range set (S-M-L-XL).\n\t *\n\t * The ranges of this set are:\n\t * <ul>\n\t * <li><code>\"S\"</code>: For screens smaller than 600 pixels.</li>\n\t * <li><code>\"M\"</code>: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.</li>\n\t * <li><code>\"L\"</code>: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.</li>\n\t * <li><code>\"XL\"</code>: For screens greater than or equal to 1440 pixels.</li>\n\t * </ul>\n\t *\n\t * @public\n\t */\n\tRANGE_4STEPS = \"4Step\",\n}\n\n/**\n * Initializes a screen width media query range set.\n *\n * This initialization step makes the range set ready to be used for one of the other functions in namespace <code>MediaRange</code>.\n *\n * A range set can be defined as shown in the following example:\n * <pre>\n * MediaRange.initRangeSet(\"MyRangeSet\", [200, 400], [\"Small\", \"Medium\", \"Large\"]);\n * </pre>\n * This example defines the following named ranges:\n * <ul>\n * <li><code>\"Small\"</code>: For screens smaller than 200 pixels.</li>\n * <li><code>\"Medium\"</code>: For screens greater than or equal to 200 pixels and smaller than 400 pixels.</li>\n * <li><code>\"Large\"</code>: For screens greater than or equal to 400 pixels.</li>\n * </ul>\n *\n * @param name The name of the range set to be initialized.\n * The name must be a valid id and consist only of letters and numeric digits.\n * @param range The given range set.\n */\nconst initRangeSet = (name: string, range: Range) => {\n\tmediaRanges.set(name, range);\n};\n\n/**\n * Returns information about the current active range of the range set with the given name.\n *\n * If the optional parameter <code>width</code> is given, the active range will be determined for that width,\n * otherwise it is determined for the current window size.\n *\n * @param name The name of the range set. The range set must be initialized beforehand ({@link MediaRange.initRangeSet})\n * @param [width] An optional width, based on which the range should be determined;\n * If <code>width</code> is not provided, the window size will be used.\n * @returns The name of the current active interval of the range set.\n * @public\n */\nconst getCurrentRange = (name: string, width = window.innerWidth): string => {\n\tlet rangeSet = mediaRanges.get(name);\n\n\tif (!rangeSet) {\n\t\trangeSet = mediaRanges.get(RANGESETS.RANGE_4STEPS)!;\n\t}\n\n\tlet currentRangeName;\n\tconst effectiveWidth = Math.floor(width);\n\n\trangeSet.forEach((value, key) => {\n\t\tif (effectiveWidth >= value[0] && effectiveWidth <= value[1]) {\n\t\t\tcurrentRangeName = key;\n\t\t}\n\t});\n\n\treturn currentRangeName || [...rangeSet.keys()][0];\n};\n\n/**\n * API for screen width changes.\n */\nconst MediaRange = {\n\tRANGESETS,\n\tinitRangeSet,\n\tgetCurrentRange,\n};\n\nMediaRange.initRangeSet(MediaRange.RANGESETS.RANGE_4STEPS, DEAFULT_RANGE_SET);\n\nexport default MediaRange;\n"]}
1
+ {"version":3,"file":"MediaRange.js","sourceRoot":"","sources":["../src/Media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IAAI,cAAc,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,cAAc,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;YAC7D,gBAAgB,GAAG,GAAG,CAAC;SACvB;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAG;IAClB,SAAS;IACT,YAAY;IACZ,eAAe;CACf,CAAC;AAEF,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;AAE9E,eAAe,UAAU,CAAC","sourcesContent":["type Range = Map<string, Array<number>>;\n\nconst mediaRanges = new Map<string, Range>();\n\nconst DEAFULT_RANGE_SET: Range = new Map<string, Array<number>>();\nDEAFULT_RANGE_SET.set(\"S\", [0, 599]);\nDEAFULT_RANGE_SET.set(\"M\", [600, 1023]);\nDEAFULT_RANGE_SET.set(\"L\", [1024, 1439]);\nDEAFULT_RANGE_SET.set(\"XL\", [1440, Infinity]);\n\n/**\n * Enumeration containing the names and settings of predefined screen width media query range sets.\n *\n * @public\n */\n enum RANGESETS {\n\t/**\n\t * A 4-step range set (S-M-L-XL).\n\t *\n\t * The ranges of this set are:\n\t *\n\t * - `\"S\"`: For screens smaller than 600 pixels.\n\t * - `\"M\"`: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.\n\t * - `\"L\"`: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.\n\t * - `\"XL\"`: For screens greater than or equal to 1440 pixels.\n\t *\n\t *\n\t * @public\n\t */\n\tRANGE_4STEPS = \"4Step\",\n}\n\n/**\n * Initializes a screen width media query range set.\n *\n * This initialization step makes the range set ready to be used for one of the other functions in namespace `MediaRange`.\n *\n * A range set can be defined as shown in the following example:\n * ```\n * MediaRange.initRangeSet(\"MyRangeSet\", [200, 400], [\"Small\", \"Medium\", \"Large\"]);\n * ```\n * This example defines the following named ranges:\n *\n * - `\"Small\"`: For screens smaller than 200 pixels.\n * - `\"Medium\"`: For screens greater than or equal to 200 pixels and smaller than 400 pixels.\n * - `\"Large\"`: For screens greater than or equal to 400 pixels.\n *\n *\n * @param name The name of the range set to be initialized.\n * The name must be a valid id and consist only of letters and numeric digits.\n * @param range The given range set.\n */\nconst initRangeSet = (name: string, range: Range) => {\n\tmediaRanges.set(name, range);\n};\n\n/**\n * Returns information about the current active range of the range set with the given name.\n *\n * If the optional parameter `width` is given, the active range will be determined for that width,\n * otherwise it is determined for the current window size.\n *\n * @param name The name of the range set. The range set must be initialized beforehand ({@link MediaRange.initRangeSet})\n * @param [width] An optional width, based on which the range should be determined;\n * If `width` is not provided, the window size will be used.\n * @returns The name of the current active interval of the range set.\n * @public\n */\nconst getCurrentRange = (name: string, width = window.innerWidth): string => {\n\tlet rangeSet = mediaRanges.get(name);\n\n\tif (!rangeSet) {\n\t\trangeSet = mediaRanges.get(RANGESETS.RANGE_4STEPS)!;\n\t}\n\n\tlet currentRangeName;\n\tconst effectiveWidth = Math.floor(width);\n\n\trangeSet.forEach((value, key) => {\n\t\tif (effectiveWidth >= value[0] && effectiveWidth <= value[1]) {\n\t\t\tcurrentRangeName = key;\n\t\t}\n\t});\n\n\treturn currentRangeName || [...rangeSet.keys()][0];\n};\n\n/**\n * API for screen width changes.\n */\nconst MediaRange = {\n\tRANGESETS,\n\tinitRangeSet,\n\tgetCurrentRange,\n};\n\nMediaRange.initRangeSet(MediaRange.RANGESETS.RANGE_4STEPS, DEAFULT_RANGE_SET);\n\nexport default MediaRange;\n"]}
@@ -1,9 +1,9 @@
1
+ import "@ui5/webcomponents-base/dist/ssr-dom.js";
1
2
  import UI5ElementMetadata, { Slot, SlotValue, State, PropertyValue, Metadata } from "./UI5ElementMetadata.js";
2
3
  import EventProvider from "./EventProvider.js";
3
- import StaticAreaItem from "./StaticAreaItem.js";
4
4
  import type { TemplateFunction, TemplateFunctionResult } from "./renderer/executeTemplate.js";
5
- import type { PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
6
- type Renderer = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, styleStrOrHrefsArr: string | Array<string> | undefined, forStaticArea: boolean, options: RendererOptions) => void;
5
+ import type { AccessibilityInfo, PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
6
+ type Renderer = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, options: RendererOptions) => void;
7
7
  type RendererOptions = {
8
8
  /**
9
9
  * An object to use as the `this` value for event listeners. It's often
@@ -47,16 +47,11 @@ declare abstract class UI5Element extends HTMLElement {
47
47
  };
48
48
  _doNotSyncAttributes: Set<string>;
49
49
  _state: State;
50
+ _internals?: ElementInternals;
50
51
  _getRealDomRef?: () => HTMLElement;
51
- staticAreaItem?: StaticAreaItem;
52
52
  static template?: TemplateFunction;
53
- static staticAreaTemplate?: TemplateFunction;
54
53
  static _metadata: UI5ElementMetadata;
55
- /**
56
- * @deprecated
57
- */
58
- static render: Renderer;
59
- static renderer?: Renderer;
54
+ static renderer: Renderer;
60
55
  constructor();
61
56
  /**
62
57
  * Returns a unique ID for this UI5 Element
@@ -66,7 +61,6 @@ declare abstract class UI5Element extends HTMLElement {
66
61
  */
67
62
  get _id(): string;
68
63
  render(): object;
69
- renderStatic(): object;
70
64
  /**
71
65
  * Do not call this method from derivatives of UI5Element, use "onEnterDOM" only
72
66
  * @private
@@ -146,6 +140,8 @@ declare abstract class UI5Element extends HTMLElement {
146
140
  * @private
147
141
  */
148
142
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
143
+ formAssociatedCallback(): void;
144
+ static get formAssociated(): boolean;
149
145
  /**
150
146
  * @private
151
147
  */
@@ -202,9 +198,9 @@ declare abstract class UI5Element extends HTMLElement {
202
198
  * 1) children: immediate children (HTML elements or text nodes) were added, removed or reordered in the slot
203
199
  * 2) textcontent: text nodes in the slot changed value (or nested text nodes were added or changed value). Can only trigger for slots of "type: Node"
204
200
  * 3) slotchange: a slot element, slotted inside that slot had its "slotchange" event listener called. This practically means that transitively slotted children changed.
205
- * Can only trigger if the child of a slot is a slot element itself.
201
+ * Can only trigger if the child of a slot is a slot element itself.
206
202
  * 4) childchange: indicates that a UI5Element child in that slot was invalidated and in turn invalidated the component.
207
- * Can only trigger for slots with "invalidateOnChildChange" metadata descriptor
203
+ * Can only trigger for slots with "invalidateOnChildChange" metadata descriptor
208
204
  *
209
205
  * - newValue: the new value of the property (for type="property" only)
210
206
  *
@@ -303,22 +299,19 @@ declare abstract class UI5Element extends HTMLElement {
303
299
  get isUI5Element(): boolean;
304
300
  get classes(): ClassMap;
305
301
  /**
306
- * Do not override this method in derivatives of UI5Element, use metadata properties instead
302
+ * Returns the component accessibility info.
307
303
  * @private
308
304
  */
309
- static get observedAttributes(): string[];
305
+ get accessibilityInfo(): AccessibilityInfo;
310
306
  /**
307
+ * Do not override this method in derivatives of UI5Element, use metadata properties instead
311
308
  * @private
312
309
  */
313
- static _needsShadowDOM(): boolean;
310
+ static get observedAttributes(): string[];
314
311
  /**
315
312
  * @private
316
313
  */
317
- static _needsStaticArea(): boolean;
318
- /**
319
- * @public
320
- */
321
- getStaticAreaItemDomRef(): Promise<ShadowRoot | null>;
314
+ static _needsShadowDOM(): boolean;
322
315
  /**
323
316
  * @private
324
317
  */
@@ -332,12 +325,7 @@ declare abstract class UI5Element extends HTMLElement {
332
325
  * Returns the CSS for this UI5 Web Component Class
333
326
  * @protected
334
327
  */
335
- static get styles(): ComponentStylesData;
336
- /**
337
- * Returns the Static Area CSS for this UI5 Web Component Class
338
- * @protected
339
- */
340
- static get staticAreaStyles(): ComponentStylesData;
328
+ static styles: ComponentStylesData;
341
329
  /**
342
330
  * Returns an array with the dependencies for this UI5 Web Component, which could be:
343
331
  * - composed components (used in its shadow root or static area item)
@@ -373,11 +361,15 @@ declare abstract class UI5Element extends HTMLElement {
373
361
  * @public
374
362
  */
375
363
  static getMetadata(): UI5ElementMetadata;
364
+ get validity(): ValidityState | undefined;
365
+ get validationMessage(): string | undefined;
366
+ checkValidity(): boolean | undefined;
367
+ reportValidity(): boolean | undefined;
376
368
  }
377
369
  /**
378
370
  * Always use duck-typing to cover all runtimes on the page.
379
371
  */
380
372
  declare const instanceOfUI5Element: (object: any) => object is UI5Element;
381
373
  export default UI5Element;
382
- export { instanceOfUI5Element };
374
+ export { instanceOfUI5Element, };
383
375
  export type { ChangeInfo, Renderer, RendererOptions, };