@ui5/webcomponents-base 1.2.3 → 1.2.6

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/hash.txt CHANGED
@@ -1 +1 @@
1
- 42MoGANzmVs12vzVkLFTocs99Xg=
1
+ 8abI3ADVmmvd8nxOCjZSfY/ukIo=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "1.2.3",
3
+ "version": "1.2.6",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -37,7 +37,7 @@
37
37
  "devDependencies": {
38
38
  "@buxlabs/amd-to-es6": "0.16.1",
39
39
  "@openui5/sap.ui.core": "1.94.0",
40
- "@ui5/webcomponents-tools": "1.2.3",
40
+ "@ui5/webcomponents-tools": "1.2.6",
41
41
  "chromedriver": "99.0.0",
42
42
  "clean-css": "^5.2.2",
43
43
  "copy-and-watch": "^0.1.5",
@@ -9,9 +9,26 @@ import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from "../Cus
9
9
  * @returns {*}
10
10
  */
11
11
  const executeTemplate = (template, component) => {
12
- const tagsToScope = component.constructor.getUniqueDependencies().map(dep => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);
12
+ const tagsToScope = getTagsToScope(component);
13
13
  const scope = getCustomElementsScopingSuffix();
14
14
  return template(component, tagsToScope, scope);
15
15
  };
16
16
 
17
+ /**
18
+ * Returns all tags, used inside component's template subject to scoping.
19
+ * @param component - the component
20
+ * @returns {Array[]}
21
+ * @private
22
+ */
23
+ const getTagsToScope = component => {
24
+ const componentTag = component.constructor.getMetadata().getPureTag();
25
+ const tagsToScope = component.constructor.getUniqueDependencies().map(dep => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);
26
+
27
+ if (shouldScopeCustomElement(componentTag)) {
28
+ tagsToScope.push(componentTag);
29
+ }
30
+
31
+ return tagsToScope;
32
+ };
33
+
17
34
  export default executeTemplate;