@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 +2 -2
- package/vaadin-themable-mixin.js +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/vaadin-themable-mixin",
|
|
3
|
-
"version": "23.0.
|
|
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": "
|
|
43
|
+
"gitHead": "4d687bdd48ba78d55f3371a78b70818e4dfca1a3"
|
|
44
44
|
}
|
package/vaadin-themable-mixin.js
CHANGED
|
@@ -179,7 +179,15 @@ function getThemes(tagName) {
|
|
|
179
179
|
* @returns {boolean}
|
|
180
180
|
*/
|
|
181
181
|
function hasThemes(tagName) {
|
|
182
|
-
|
|
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 ||
|
|
208
|
+
if (!template || classHasThemes(this)) {
|
|
201
209
|
return;
|
|
202
210
|
}
|
|
203
211
|
|