@vaadin/number-field 24.6.0-alpha9 → 24.6.0-rc1
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 +10 -10
- package/src/vaadin-lit-number-field.js +0 -25
- package/src/vaadin-number-field-mixin.js +6 -0
- package/src/vaadin-number-field.js +0 -11
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/number-field",
|
|
3
|
-
"version": "24.6.0-
|
|
3
|
+
"version": "24.6.0-rc1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.6.0-
|
|
40
|
-
"@vaadin/component-base": "24.6.0-
|
|
41
|
-
"@vaadin/field-base": "24.6.0-
|
|
42
|
-
"@vaadin/input-container": "24.6.0-
|
|
43
|
-
"@vaadin/vaadin-lumo-styles": "24.6.0-
|
|
44
|
-
"@vaadin/vaadin-material-styles": "24.6.0-
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "24.6.0-
|
|
39
|
+
"@vaadin/a11y-base": "24.6.0-rc1",
|
|
40
|
+
"@vaadin/component-base": "24.6.0-rc1",
|
|
41
|
+
"@vaadin/field-base": "24.6.0-rc1",
|
|
42
|
+
"@vaadin/input-container": "24.6.0-rc1",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "24.6.0-rc1",
|
|
44
|
+
"@vaadin/vaadin-material-styles": "24.6.0-rc1",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "24.6.0-rc1",
|
|
46
46
|
"lit": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "24.6.0-
|
|
49
|
+
"@vaadin/chai-plugins": "24.6.0-rc1",
|
|
50
50
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
51
51
|
"sinon": "^18.0.0"
|
|
52
52
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"web-types.json",
|
|
55
55
|
"web-types.lit.json"
|
|
56
56
|
],
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "d62ba309e3286777ad3ea7e015d50a2c4976bb42"
|
|
58
58
|
}
|
|
@@ -8,7 +8,6 @@ import { html, LitElement } from 'lit';
|
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
12
11
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
13
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
13
|
import { NumberFieldMixin } from './vaadin-number-field-mixin.js';
|
|
@@ -84,30 +83,6 @@ class NumberField extends NumberFieldMixin(ThemableMixin(ElementMixin(PolylitMix
|
|
|
84
83
|
<slot name="tooltip"></slot>
|
|
85
84
|
`;
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
/** @protected */
|
|
89
|
-
ready() {
|
|
90
|
-
super.ready();
|
|
91
|
-
|
|
92
|
-
this._tooltipController = new TooltipController(this);
|
|
93
|
-
this.addController(this._tooltipController);
|
|
94
|
-
this._tooltipController.setPosition('top');
|
|
95
|
-
this._tooltipController.setAriaTarget(this.inputElement);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Override method from `InputConstraintsMixin`
|
|
100
|
-
* to create observer after the initial update
|
|
101
|
-
* and preserve invalid state set as attribute.
|
|
102
|
-
*
|
|
103
|
-
* @protected
|
|
104
|
-
* @override
|
|
105
|
-
*/
|
|
106
|
-
async _createConstraintsObserver() {
|
|
107
|
-
await this.updateComplete;
|
|
108
|
-
|
|
109
|
-
super._createConstraintsObserver();
|
|
110
|
-
}
|
|
111
86
|
}
|
|
112
87
|
|
|
113
88
|
defineCustomElement(NumberField);
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { getDeepActiveElement } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
7
|
+
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller';
|
|
7
8
|
import { InputController } from '@vaadin/field-base/src/input-controller.js';
|
|
8
9
|
import { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';
|
|
9
10
|
import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
|
|
@@ -127,6 +128,11 @@ export const NumberFieldMixin = (superClass) =>
|
|
|
127
128
|
);
|
|
128
129
|
|
|
129
130
|
this.addController(new LabelledInputController(this.inputElement, this._labelController));
|
|
131
|
+
|
|
132
|
+
this._tooltipController = new TooltipController(this);
|
|
133
|
+
this.addController(this._tooltipController);
|
|
134
|
+
this._tooltipController.setPosition('top');
|
|
135
|
+
this._tooltipController.setAriaTarget(this.inputElement);
|
|
130
136
|
}
|
|
131
137
|
|
|
132
138
|
/**
|
|
@@ -7,7 +7,6 @@ import '@vaadin/input-container/src/vaadin-input-container.js';
|
|
|
7
7
|
import { html, PolymerElement } from '@polymer/polymer';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
-
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
11
10
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
12
11
|
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
12
|
import { NumberFieldMixin } from './vaadin-number-field-mixin.js';
|
|
@@ -128,16 +127,6 @@ export class NumberField extends NumberFieldMixin(ThemableMixin(ElementMixin(Pol
|
|
|
128
127
|
<slot name="tooltip"></slot>
|
|
129
128
|
`;
|
|
130
129
|
}
|
|
131
|
-
|
|
132
|
-
/** @protected */
|
|
133
|
-
ready() {
|
|
134
|
-
super.ready();
|
|
135
|
-
|
|
136
|
-
this._tooltipController = new TooltipController(this);
|
|
137
|
-
this.addController(this._tooltipController);
|
|
138
|
-
this._tooltipController.setPosition('top');
|
|
139
|
-
this._tooltipController.setAriaTarget(this.inputElement);
|
|
140
|
-
}
|
|
141
130
|
}
|
|
142
131
|
|
|
143
132
|
defineCustomElement(NumberField);
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/number-field",
|
|
4
|
-
"version": "24.6.0-
|
|
4
|
+
"version": "24.6.0-rc1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-number-field",
|
|
11
|
-
"description": "`<vaadin-number-field>` is an input field web component that only accepts numeric input.\n\n```html\n<vaadin-number-field label=\"Balance\"></vaadin-number-field>\n```\n\n### Styling\n\n`<vaadin-number-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-
|
|
11
|
+
"description": "`<vaadin-number-field>` is an input field web component that only accepts numeric input.\n\n```html\n<vaadin-number-field label=\"Balance\"></vaadin-number-field>\n```\n\n### Styling\n\n`<vaadin-number-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-rc1/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n------------------|-------------------------\n`increase-button` | Increase (\"plus\") button\n`decrease-button` | Decrease (\"minus\") button\n\nNote, the `input-prevented` state attribute is only supported when `allowedCharPattern` is set.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | -\n\nNote, there is currently no way to detect unparsable => unparsable changes because the browser\ndoesn't provide access to unparsable values of native [type=number] inputs.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/number-field",
|
|
4
|
-
"version": "24.6.0-
|
|
4
|
+
"version": "24.6.0-rc1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-number-field",
|
|
19
|
-
"description": "`<vaadin-number-field>` is an input field web component that only accepts numeric input.\n\n```html\n<vaadin-number-field label=\"Balance\"></vaadin-number-field>\n```\n\n### Styling\n\n`<vaadin-number-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-
|
|
19
|
+
"description": "`<vaadin-number-field>` is an input field web component that only accepts numeric input.\n\n```html\n<vaadin-number-field label=\"Balance\"></vaadin-number-field>\n```\n\n### Styling\n\n`<vaadin-number-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-rc1/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n------------------|-------------------------\n`increase-button` | Increase (\"plus\") button\n`decrease-button` | Decrease (\"minus\") button\n\nNote, the `input-prevented` state attribute is only supported when `allowedCharPattern` is set.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | -\n\nNote, there is currently no way to detect unparsable => unparsable changes because the browser\ndoesn't provide access to unparsable values of native [type=number] inputs.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|