@vaadin/vaadin-themable-mixin 23.0.6 → 23.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-themable-mixin",
3
- "version": "23.0.6",
3
+ "version": "23.0.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,5 +40,5 @@
40
40
  "@vaadin/testing-helpers": "^0.3.2",
41
41
  "sinon": "^9.2.4"
42
42
  },
43
- "gitHead": "82ca8522e24a63343fb28bcb4c686e55d25c8858"
43
+ "gitHead": "4d687bdd48ba78d55f3371a78b70818e4dfca1a3"
44
44
  }
@@ -179,7 +179,15 @@ function getThemes(tagName) {
179
179
  * @returns {boolean}
180
180
  */
181
181
  function hasThemes(tagName) {
182
- const elementClass = customElements.get(tagName);
182
+ return classHasThemes(customElements.get(tagName));
183
+ }
184
+
185
+ /**
186
+ * Check if the custom element type has themes applied.
187
+ * @param {Function} elementClass
188
+ * @returns {boolean}
189
+ */
190
+ function classHasThemes(elementClass) {
183
191
  return elementClass && Object.prototype.hasOwnProperty.call(elementClass, '__themes');
184
192
  }
185
193
 
@@ -197,7 +205,7 @@ export const ThemableMixin = (superClass) =>
197
205
  super.finalize();
198
206
 
199
207
  const template = this.prototype._template;
200
- if (!template || hasThemes(this.is)) {
208
+ if (!template || classHasThemes(this)) {
201
209
  return;
202
210
  }
203
211