@vaadin/number-field 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 +8 -8
- package/src/vaadin-number-field.d.ts +1 -9
- package/src/vaadin-number-field.js +4 -26
- package/theme/lumo/vaadin-number-field-styles.js +3 -5
- package/theme/lumo/vaadin-number-field.js +1 -1
- package/theme/material/vaadin-number-field-styles.js +2 -3
- package/theme/material/vaadin-number-field.js +1 -1
- package/web-types.json +2 -24
- package/web-types.lit.json +2 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/number-field",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/component-base": "
|
|
39
|
-
"@vaadin/field-base": "
|
|
40
|
-
"@vaadin/input-container": "
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
42
|
-
"@vaadin/vaadin-material-styles": "
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
38
|
+
"@vaadin/component-base": "24.0.0-alpha10",
|
|
39
|
+
"@vaadin/field-base": "24.0.0-alpha10",
|
|
40
|
+
"@vaadin/input-container": "24.0.0-alpha10",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "24.0.0-alpha10",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "24.0.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "24.0.0-alpha10"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"web-types.json",
|
|
52
52
|
"web-types.lit.json"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "2e04534d8b47bcd216f89b5f849bafef1a73b174"
|
|
55
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 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 { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
@@ -69,14 +69,6 @@ export interface NumberFieldEventMap extends HTMLElementEventMap, NumberFieldCus
|
|
|
69
69
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
70
70
|
*/
|
|
71
71
|
declare class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(HTMLElement))) {
|
|
72
|
-
/**
|
|
73
|
-
* Set to true to display value increase/decrease controls.
|
|
74
|
-
* @attr {boolean} has-controls
|
|
75
|
-
* @deprecated since 23.3.
|
|
76
|
-
* Use [`stepButtonsVisible`](#/elements/vaadin-number-field#property-stepButtonsVisible) instead
|
|
77
|
-
*/
|
|
78
|
-
hasControls: boolean;
|
|
79
|
-
|
|
80
72
|
/**
|
|
81
73
|
* Set to true to show increase/decrease buttons.
|
|
82
74
|
* @attr {boolean} step-buttons-visible
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 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 '@vaadin/input-container/src/vaadin-input-container.js';
|
|
@@ -100,7 +100,7 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
|
|
|
100
100
|
part="decrease-button"
|
|
101
101
|
on-click="_decreaseValue"
|
|
102
102
|
on-touchend="_decreaseButtonTouchend"
|
|
103
|
-
hidden$="[[!
|
|
103
|
+
hidden$="[[!stepButtonsVisible]]"
|
|
104
104
|
aria-hidden="true"
|
|
105
105
|
slot="prefix"
|
|
106
106
|
></div>
|
|
@@ -113,7 +113,7 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
|
|
|
113
113
|
part="increase-button"
|
|
114
114
|
on-click="_increaseValue"
|
|
115
115
|
on-touchend="_increaseButtonTouchend"
|
|
116
|
-
hidden$="[[!
|
|
116
|
+
hidden$="[[!stepButtonsVisible]]"
|
|
117
117
|
aria-hidden="true"
|
|
118
118
|
slot="suffix"
|
|
119
119
|
></div>
|
|
@@ -134,18 +134,6 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
|
|
|
134
134
|
|
|
135
135
|
static get properties() {
|
|
136
136
|
return {
|
|
137
|
-
/**
|
|
138
|
-
* Set to true to display value increase/decrease controls.
|
|
139
|
-
* @attr {boolean} has-controls
|
|
140
|
-
* @deprecated since 23.3.
|
|
141
|
-
* Use [`stepButtonsVisible`](#/elements/vaadin-number-field#property-stepButtonsVisible) instead
|
|
142
|
-
*/
|
|
143
|
-
hasControls: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
value: false,
|
|
146
|
-
reflectToAttribute: true,
|
|
147
|
-
},
|
|
148
|
-
|
|
149
137
|
/**
|
|
150
138
|
* Set to true to show increase/decrease buttons.
|
|
151
139
|
* @attr {boolean} step-buttons-visible
|
|
@@ -217,7 +205,7 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
|
|
|
217
205
|
direction: rtl;
|
|
218
206
|
}
|
|
219
207
|
|
|
220
|
-
${tag}[dir='rtl']:not([step-buttons-visible])
|
|
208
|
+
${tag}[dir='rtl']:not([step-buttons-visible]) input[type="number"]::placeholder {
|
|
221
209
|
text-align: left;
|
|
222
210
|
}
|
|
223
211
|
`,
|
|
@@ -444,16 +432,6 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
|
|
|
444
432
|
super._onKeyDown(event);
|
|
445
433
|
}
|
|
446
434
|
|
|
447
|
-
/**
|
|
448
|
-
* Determines whether to hide the increase / decrease buttons based on the
|
|
449
|
-
* deprecated `hasControls` property, and the replacement `stepButtonsVisible`
|
|
450
|
-
* property
|
|
451
|
-
* @private
|
|
452
|
-
*/
|
|
453
|
-
_isStepButtonVisible(hasControls, stepButtonsVisible) {
|
|
454
|
-
return hasControls || stepButtonsVisible;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
435
|
/**
|
|
458
436
|
* Native [type=number] inputs don't update their value
|
|
459
437
|
* when you are entering input that the browser is unable to parse
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 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 '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
@@ -13,8 +13,7 @@ const numberField = css`
|
|
|
13
13
|
width: 8em;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
:host([step-buttons-visible]:not([theme~='align-right'])) ::slotted(input)
|
|
17
|
-
:host([has-controls]:not([theme~='align-right'])) ::slotted(input) {
|
|
16
|
+
:host([step-buttons-visible]:not([theme~='align-right'])) ::slotted(input) {
|
|
18
17
|
text-align: center;
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -22,8 +21,7 @@ const numberField = css`
|
|
|
22
21
|
opacity: 0.2;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
:host([step-buttons-visible]) [part='input-field']
|
|
26
|
-
:host([has-controls]) [part='input-field'] {
|
|
24
|
+
:host([step-buttons-visible]) [part='input-field'] {
|
|
27
25
|
padding: 0;
|
|
28
26
|
}
|
|
29
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 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 '@vaadin/input-container/theme/lumo/vaadin-input-container.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 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 { fieldButton } from '@vaadin/vaadin-material-styles/mixins/field-button.js';
|
|
@@ -12,8 +12,7 @@ const numberField = css`
|
|
|
12
12
|
width: 8em;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
:host([step-buttons-visible]) ::slotted(input)
|
|
16
|
-
:host([has-controls]) ::slotted(input) {
|
|
15
|
+
:host([step-buttons-visible]) ::slotted(input) {
|
|
17
16
|
text-align: center;
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 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 '@vaadin/input-container/theme/material/vaadin-input-container.js';
|
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": "
|
|
4
|
+
"version": "24.0.0-alpha10",
|
|
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/
|
|
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.0.0-alpha10/#/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/custom-theme/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
|
@@ -208,17 +208,6 @@
|
|
|
208
208
|
]
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
|
-
{
|
|
212
|
-
"name": "has-controls",
|
|
213
|
-
"description": "Set to true to display value increase/decrease controls.",
|
|
214
|
-
"value": {
|
|
215
|
-
"type": [
|
|
216
|
-
"boolean",
|
|
217
|
-
"null",
|
|
218
|
-
"undefined"
|
|
219
|
-
]
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
211
|
{
|
|
223
212
|
"name": "step-buttons-visible",
|
|
224
213
|
"description": "Set to true to show increase/decrease buttons.",
|
|
@@ -473,17 +462,6 @@
|
|
|
473
462
|
]
|
|
474
463
|
}
|
|
475
464
|
},
|
|
476
|
-
{
|
|
477
|
-
"name": "hasControls",
|
|
478
|
-
"description": "Set to true to display value increase/decrease controls.",
|
|
479
|
-
"value": {
|
|
480
|
-
"type": [
|
|
481
|
-
"boolean",
|
|
482
|
-
"null",
|
|
483
|
-
"undefined"
|
|
484
|
-
]
|
|
485
|
-
}
|
|
486
|
-
},
|
|
487
465
|
{
|
|
488
466
|
"name": "stepButtonsVisible",
|
|
489
467
|
"description": "Set to true to show increase/decrease buttons.",
|
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": "
|
|
4
|
+
"version": "24.0.0-alpha10",
|
|
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/
|
|
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.0.0-alpha10/#/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/custom-theme/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -68,13 +68,6 @@
|
|
|
68
68
|
"kind": "expression"
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
{
|
|
72
|
-
"name": "?hasControls",
|
|
73
|
-
"description": "Set to true to display value increase/decrease controls.",
|
|
74
|
-
"value": {
|
|
75
|
-
"kind": "expression"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
71
|
{
|
|
79
72
|
"name": "?stepButtonsVisible",
|
|
80
73
|
"description": "Set to true to show increase/decrease buttons.",
|