@vaadin/component-base 25.3.0-alpha10 → 25.3.0-alpha11
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/custom-elements.json +2 -1
- package/package.json +5 -4
- package/src/define.js +1 -1
- package/src/dir-mixin.d.ts +14 -0
- package/src/dir-mixin.js +10 -0
package/custom-elements.json
CHANGED
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
{
|
|
51
51
|
"name": "superClass"
|
|
52
52
|
}
|
|
53
|
-
]
|
|
53
|
+
],
|
|
54
|
+
"deprecated": "This mixin is deprecated and will be removed in Vaadin 26,\nafter which components will no longer set the `dir` attribute on themselves.\nUse the `:dir(rtl)` CSS selector to style components in right-to-left mode,\nand `element.matches(':dir(rtl)')` to detect it in JavaScript."
|
|
54
55
|
}
|
|
55
56
|
],
|
|
56
57
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/component-base",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
"lit": "^3.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@vaadin/
|
|
41
|
+
"@polymer/polymer": "^3.0.0",
|
|
42
|
+
"@vaadin/chai-plugins": "25.3.0-alpha11",
|
|
43
|
+
"@vaadin/test-runner-commands": "25.3.0-alpha11",
|
|
43
44
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
44
45
|
"sinon": "^22.0.0"
|
|
45
46
|
},
|
|
46
47
|
"customElements": "custom-elements.json",
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "7e0c61a37e68d8971def9cdf28ad0548a0f530a9"
|
|
48
49
|
}
|
package/src/define.js
CHANGED
|
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
|
|
|
13
13
|
|
|
14
14
|
const experimentalMap = {};
|
|
15
15
|
|
|
16
|
-
export function defineCustomElement(CustomElement, version = '25.3.0-
|
|
16
|
+
export function defineCustomElement(CustomElement, version = '25.3.0-alpha11') {
|
|
17
17
|
Object.defineProperty(CustomElement, 'version', {
|
|
18
18
|
get() {
|
|
19
19
|
return version;
|
package/src/dir-mixin.d.ts
CHANGED
|
@@ -7,9 +7,23 @@ import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A mixin to handle `dir` attribute based on the one set on the `<html>` element.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated This mixin is deprecated and will be removed in Vaadin 26,
|
|
12
|
+
* after which components will no longer set the `dir` attribute on themselves.
|
|
13
|
+
* Use the `:dir(rtl)` CSS selector to style components in right-to-left mode,
|
|
14
|
+
* and `element.matches(':dir(rtl)')` to detect it in JavaScript.
|
|
10
15
|
*/
|
|
11
16
|
export declare function DirMixin<T extends Constructor<HTMLElement>>(base: T): Constructor<DirMixinClass> & T;
|
|
12
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated This mixin is deprecated and will be removed in Vaadin 26,
|
|
20
|
+
* after which components will no longer set the `dir` attribute on themselves.
|
|
21
|
+
* Use the `:dir(rtl)` CSS selector to style components in right-to-left mode,
|
|
22
|
+
* and `element.matches(':dir(rtl)')` to detect it in JavaScript.
|
|
23
|
+
*/
|
|
13
24
|
export declare class DirMixinClass {
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use `this.matches(':dir(rtl)')` instead.
|
|
27
|
+
*/
|
|
14
28
|
protected readonly __isRTL: boolean;
|
|
15
29
|
}
|
package/src/dir-mixin.js
CHANGED
|
@@ -33,6 +33,11 @@ directionObserver.observe(document.documentElement, { attributes: true, attribut
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* A mixin to handle `dir` attribute based on the one set on the `<html>` element.
|
|
36
|
+
*
|
|
37
|
+
* @deprecated This mixin is deprecated and will be removed in Vaadin 26,
|
|
38
|
+
* after which components will no longer set the `dir` attribute on themselves.
|
|
39
|
+
* Use the `:dir(rtl)` CSS selector to style components in right-to-left mode,
|
|
40
|
+
* and `element.matches(':dir(rtl)')` to detect it in JavaScript.
|
|
36
41
|
*/
|
|
37
42
|
export const DirMixin = (superClass) =>
|
|
38
43
|
class VaadinDirMixin extends superClass {
|
|
@@ -60,6 +65,7 @@ export const DirMixin = (superClass) =>
|
|
|
60
65
|
/**
|
|
61
66
|
* @return {boolean}
|
|
62
67
|
* @protected
|
|
68
|
+
* @deprecated Use `this.matches(':dir(rtl)')` instead.
|
|
63
69
|
*/
|
|
64
70
|
get __isRTL() {
|
|
65
71
|
return this.getAttribute('dir') === 'rtl';
|
|
@@ -106,6 +112,10 @@ export const DirMixin = (superClass) =>
|
|
|
106
112
|
this.__unsubscribe();
|
|
107
113
|
}
|
|
108
114
|
|
|
115
|
+
// The two overrides below are only invoked by Polymer's property reflection.
|
|
116
|
+
// Vaadin components no longer extend `PolymerElement`, but some add-ons still
|
|
117
|
+
// apply this mixin to `PolymerElement`, so the overrides are kept for them.
|
|
118
|
+
|
|
109
119
|
/** @protected */
|
|
110
120
|
_valueToNodeAttribute(node, value, attribute) {
|
|
111
121
|
// Override default Polymer attribute reflection to match native behavior of HTMLElement.dir property
|