@vaadin/number-field 23.1.0-alpha3 → 23.1.0-beta2
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/number-field",
|
|
3
|
-
"version": "23.1.0-
|
|
3
|
+
"version": "23.1.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@polymer/polymer": "^3.0.0",
|
|
36
|
-
"@vaadin/component-base": "23.1.0-
|
|
37
|
-
"@vaadin/field-base": "23.1.0-
|
|
38
|
-
"@vaadin/input-container": "23.1.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "23.1.0-
|
|
40
|
-
"@vaadin/vaadin-material-styles": "23.1.0-
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "23.1.0-
|
|
36
|
+
"@vaadin/component-base": "23.1.0-beta2",
|
|
37
|
+
"@vaadin/field-base": "23.1.0-beta2",
|
|
38
|
+
"@vaadin/input-container": "23.1.0-beta2",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "23.1.0-beta2",
|
|
40
|
+
"@vaadin/vaadin-material-styles": "23.1.0-beta2",
|
|
41
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-beta2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@esm-bundle/chai": "^4.3.4",
|
|
45
45
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
46
46
|
"sinon": "^13.0.2"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "f11f9245a0b5e6bf912725a501c27c24b74e7c8d"
|
|
49
49
|
}
|
|
@@ -86,13 +86,13 @@ declare class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(
|
|
|
86
86
|
addEventListener<K extends keyof NumberFieldEventMap>(
|
|
87
87
|
type: K,
|
|
88
88
|
listener: (this: NumberField, ev: NumberFieldEventMap[K]) => void,
|
|
89
|
-
options?: boolean | AddEventListenerOptions
|
|
89
|
+
options?: boolean | AddEventListenerOptions,
|
|
90
90
|
): void;
|
|
91
91
|
|
|
92
92
|
removeEventListener<K extends keyof NumberFieldEventMap>(
|
|
93
93
|
type: K,
|
|
94
94
|
listener: (this: NumberField, ev: NumberFieldEventMap[K]) => void,
|
|
95
|
-
options?: boolean | EventListenerOptions
|
|
95
|
+
options?: boolean | EventListenerOptions,
|
|
96
96
|
): void;
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -138,7 +138,7 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
138
138
|
hasControls: {
|
|
139
139
|
type: Boolean,
|
|
140
140
|
value: false,
|
|
141
|
-
reflectToAttribute: true
|
|
141
|
+
reflectToAttribute: true,
|
|
142
142
|
},
|
|
143
143
|
|
|
144
144
|
/**
|
|
@@ -146,7 +146,7 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
146
146
|
*/
|
|
147
147
|
min: {
|
|
148
148
|
type: Number,
|
|
149
|
-
observer: '_minChanged'
|
|
149
|
+
observer: '_minChanged',
|
|
150
150
|
},
|
|
151
151
|
|
|
152
152
|
/**
|
|
@@ -154,7 +154,7 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
154
154
|
*/
|
|
155
155
|
max: {
|
|
156
156
|
type: Number,
|
|
157
|
-
observer: '_maxChanged'
|
|
157
|
+
observer: '_maxChanged',
|
|
158
158
|
},
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -164,8 +164,8 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
164
164
|
step: {
|
|
165
165
|
type: Number,
|
|
166
166
|
value: 1,
|
|
167
|
-
observer: '_stepChanged'
|
|
168
|
-
}
|
|
167
|
+
observer: '_stepChanged',
|
|
168
|
+
},
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -200,7 +200,7 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
200
200
|
${tag}[dir='rtl']:not([has-controls]) input[type="number"]::placeholder {
|
|
201
201
|
text-align: left;
|
|
202
202
|
}
|
|
203
|
-
|
|
203
|
+
`,
|
|
204
204
|
];
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -233,7 +233,7 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
233
233
|
this._setFocusElement(input);
|
|
234
234
|
this.stateTarget = input;
|
|
235
235
|
this.ariaTarget = input;
|
|
236
|
-
})
|
|
236
|
+
}),
|
|
237
237
|
);
|
|
238
238
|
this.addController(new LabelledInputController(this.inputElement, this._labelController));
|
|
239
239
|
}
|
|
@@ -288,7 +288,7 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
288
288
|
let value = parseFloat(this.value);
|
|
289
289
|
|
|
290
290
|
if (!this.value) {
|
|
291
|
-
if ((this.min
|
|
291
|
+
if ((this.min === 0 && incr < 0) || (this.max === 0 && incr > 0) || (this.max === 0 && this.min === 0)) {
|
|
292
292
|
incr = 0;
|
|
293
293
|
value = 0;
|
|
294
294
|
} else if ((this.max == null || this.max >= 0) && (this.min == null || this.min <= 0)) {
|
|
@@ -319,7 +319,7 @@ export class NumberField extends InputFieldMixin(SlotStylesMixin(ThemableMixin(E
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
const newValue = this._getIncrement(incr, value);
|
|
322
|
-
if (!this.value || incr
|
|
322
|
+
if (!this.value || incr === 0 || this._incrementIsInsideTheLimits(incr, value)) {
|
|
323
323
|
this._setValue(newValue);
|
|
324
324
|
}
|
|
325
325
|
}
|