@vaadin/item 25.2.0-alpha8 → 25.2.0-alpha9

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/item",
3
- "version": "25.2.0-alpha8",
3
+ "version": "25.2.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,17 +35,17 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.2.0-alpha8",
39
- "@vaadin/component-base": "25.2.0-alpha8",
40
- "@vaadin/vaadin-themable-mixin": "25.2.0-alpha8",
38
+ "@vaadin/a11y-base": "25.2.0-alpha9",
39
+ "@vaadin/component-base": "25.2.0-alpha9",
40
+ "@vaadin/vaadin-themable-mixin": "25.2.0-alpha9",
41
41
  "lit": "^3.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@vaadin/aura": "25.2.0-alpha8",
45
- "@vaadin/chai-plugins": "25.2.0-alpha8",
46
- "@vaadin/test-runner-commands": "25.2.0-alpha8",
44
+ "@vaadin/aura": "25.2.0-alpha9",
45
+ "@vaadin/chai-plugins": "25.2.0-alpha9",
46
+ "@vaadin/test-runner-commands": "25.2.0-alpha9",
47
47
  "@vaadin/testing-helpers": "^2.0.0",
48
- "@vaadin/vaadin-lumo-styles": "25.2.0-alpha8",
48
+ "@vaadin/vaadin-lumo-styles": "25.2.0-alpha9",
49
49
  "sinon": "^21.0.2"
50
50
  },
51
51
  "customElements": "custom-elements.json",
@@ -53,5 +53,5 @@
53
53
  "web-types.json",
54
54
  "web-types.lit.json"
55
55
  ],
56
- "gitHead": "2b82e20cdfc605b1187e9a24ae42869e1500ab68"
56
+ "gitHead": "a38a03e8a8be45821f39c14054c63634dafe08d0"
57
57
  }
@@ -27,7 +27,7 @@ export const itemStyles = css`
27
27
  :host([disabled]) {
28
28
  cursor: var(--vaadin-disabled-cursor);
29
29
  opacity: 0.5;
30
- pointer-events: none;
30
+ pointer-events: var(--_vaadin-item-disabled-pointer-events, none);
31
31
  }
32
32
 
33
33
  :host([hidden]) {
@@ -76,6 +76,10 @@ export const ItemMixin = (superClass) =>
76
76
  if (attrValue !== null) {
77
77
  this.value = attrValue;
78
78
  }
79
+
80
+ if (this.__shouldAllowFocusWhenDisabled()) {
81
+ this.style.setProperty('--_vaadin-item-disabled-pointer-events', 'auto');
82
+ }
79
83
  }
80
84
 
81
85
  /**
@@ -84,7 +88,7 @@ export const ItemMixin = (superClass) =>
84
88
  * @override
85
89
  */
86
90
  focus(options) {
87
- if (this.disabled) {
91
+ if (this.disabled && !this.__shouldAllowFocusWhenDisabled()) {
88
92
  return;
89
93
  }
90
94
 
@@ -115,7 +119,9 @@ export const ItemMixin = (superClass) =>
115
119
 
116
120
  if (disabled) {
117
121
  this.selected = false;
118
- this.blur();
122
+ if (!this.__shouldAllowFocusWhenDisabled()) {
123
+ this.blur();
124
+ }
119
125
  }
120
126
  }
121
127
 
@@ -142,4 +148,15 @@ export const ItemMixin = (superClass) =>
142
148
  this.click();
143
149
  }
144
150
  }
151
+
152
+ /**
153
+ * Returns whether the component should be focusable when disabled.
154
+ * Returns false by default.
155
+ *
156
+ * @private
157
+ * @return {boolean}
158
+ */
159
+ __shouldAllowFocusWhenDisabled() {
160
+ return false;
161
+ }
145
162
  };
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/item",
4
- "version": "25.2.0-alpha8",
4
+ "version": "25.2.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/item",
4
- "version": "25.2.0-alpha8",
4
+ "version": "25.2.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {