@vaadin/vaadin-themable-mixin 23.3.3 → 24.0.0-alpha10

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.3.3",
3
+ "version": "24.0.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,5 +40,5 @@
40
40
  "@vaadin/testing-helpers": "^0.3.2",
41
41
  "sinon": "^13.0.2"
42
42
  },
43
- "gitHead": "1529ed623e053d28a3c1c66af55ebe402743ddd0"
43
+ "gitHead": "2e04534d8b47bcd216f89b5f849bafef1a73b174"
44
44
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  export { registerStyles, css, unsafeCSS } from './vaadin-themable-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  export { registerStyles, css, unsafeCSS } from './vaadin-themable-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { css, CSSResult, unsafeCSS } from 'lit';
@@ -77,7 +77,7 @@ function getAllThemes() {
77
77
  */
78
78
  function matchesThemeFor(themeFor, tagName) {
79
79
  return (themeFor || '').split(' ').some((themeForToken) => {
80
- return new RegExp(`^${themeForToken.split('*').join('.*')}$`).test(tagName);
80
+ return new RegExp(`^${themeForToken.split('*').join('.*')}$`, 'u').test(tagName);
81
81
  });
82
82
  }
83
83
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { Constructor } from '@open-wc/dedupe-mixin';
@@ -25,28 +25,7 @@ export declare class ThemePropertyMixinClass {
25
25
  * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components/#sub-components).
26
26
  * page for more information.
27
27
  *
28
- * @deprecated The `theme` property is not supposed for public use and will be dropped in Vaadin 24.
29
- * Please, use the `theme` attribute instead.
30
28
  * @protected
31
29
  */
32
- theme: string | null | undefined;
33
-
34
- /**
35
- * Helper property with theme attribute value facilitating propagation
36
- * in shadow DOM.
37
- *
38
- * Enables the component implementation to propagate the `theme`
39
- * attribute value to the sub-components in Shadow DOM by binding
40
- * the sub-component’s "theme" attribute to the `theme` property of
41
- * the host.
42
- *
43
- * **NOTE:** Extending the mixin only provides the property for binding,
44
- * and does not make the propagation alone.
45
- *
46
- * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components/#sub-components).
47
- * page for more information.
48
- *
49
- * @protected
50
- */
51
- readonly _theme: string | null | undefined;
30
+ protected readonly _theme: string | null | undefined;
52
31
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  /**
@@ -10,31 +10,6 @@ export const ThemePropertyMixin = (superClass) =>
10
10
  class VaadinThemePropertyMixin extends superClass {
11
11
  static get properties() {
12
12
  return {
13
- /**
14
- * Helper property with theme attribute value facilitating propagation
15
- * in shadow DOM.
16
- *
17
- * Enables the component implementation to propagate the `theme`
18
- * attribute value to the sub-components in Shadow DOM by binding
19
- * the sub-component’s "theme" attribute to the `theme` property of
20
- * the host.
21
- *
22
- * **NOTE:** Extending the mixin only provides the property for binding,
23
- * and does not make the propagation alone.
24
- *
25
- * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components/#sub-components).
26
- * page for more information.
27
- *
28
- * @deprecated The `theme` property is not supposed for public use and will be dropped in Vaadin 24.
29
- * Please, use the `theme` attribute instead.
30
- * @protected
31
- */
32
- theme: {
33
- type: String,
34
- reflectToAttribute: true,
35
- observer: '__deprecatedThemePropertyChanged',
36
- },
37
-
38
13
  /**
39
14
  * Helper property with theme attribute value facilitating propagation
40
15
  * in shadow DOM.
@@ -59,8 +34,16 @@ export const ThemePropertyMixin = (superClass) =>
59
34
  };
60
35
  }
61
36
 
62
- /** @private */
63
- __deprecatedThemePropertyChanged(theme) {
64
- this._set_theme(theme);
37
+ static get observedAttributes() {
38
+ return [...super.observedAttributes, 'theme'];
39
+ }
40
+
41
+ /** @protected */
42
+ attributeChangedCallback(name, oldValue, newValue) {
43
+ super.attributeChangedCallback(name, oldValue, newValue);
44
+
45
+ if (name === 'theme') {
46
+ this._set_theme(newValue);
47
+ }
65
48
  }
66
49
  };