@vaadin/integer-field 24.8.5 → 24.9.0-alpha1

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/integer-field",
3
- "version": "24.8.5",
3
+ "version": "24.9.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,14 +35,14 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/component-base": "~24.8.5",
39
- "@vaadin/number-field": "~24.8.5",
40
- "@vaadin/vaadin-lumo-styles": "~24.8.5",
41
- "@vaadin/vaadin-material-styles": "~24.8.5"
38
+ "@vaadin/component-base": "24.9.0-alpha1",
39
+ "@vaadin/number-field": "24.9.0-alpha1",
40
+ "@vaadin/vaadin-lumo-styles": "24.9.0-alpha1",
41
+ "@vaadin/vaadin-material-styles": "24.9.0-alpha1"
42
42
  },
43
43
  "devDependencies": {
44
- "@vaadin/chai-plugins": "~24.8.5",
45
- "@vaadin/test-runner-commands": "~24.8.5",
44
+ "@vaadin/chai-plugins": "24.9.0-alpha1",
45
+ "@vaadin/test-runner-commands": "24.9.0-alpha1",
46
46
  "@vaadin/testing-helpers": "^1.1.0",
47
47
  "sinon": "^18.0.0"
48
48
  },
@@ -50,5 +50,5 @@
50
50
  "web-types.json",
51
51
  "web-types.lit.json"
52
52
  ],
53
- "gitHead": "a519b0d2b1d09d1ddaa4ff6829819f8a2be30ad8"
53
+ "gitHead": "cc13d59f0e3cd1a3b0c19c1a900a5308446fe7ac"
54
54
  }
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/integer-field",
4
- "version": "24.8.5",
4
+ "version": "24.9.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-integer-field",
11
- "description": "`<vaadin-integer-field>` is an input field web component that only accepts entering integer numbers.\n\n```html\n<vaadin-integer-field label=\"X\"></vaadin-integer-field>\n```\n\n### Styling\n\n`<vaadin-integer-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.8.5/#/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\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.",
11
+ "description": "`<vaadin-integer-field>` is an input field web component that only accepts entering integer numbers.\n\n```html\n<vaadin-integer-field label=\"X\"></vaadin-integer-field>\n```\n\n### Styling\n\n`<vaadin-integer-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.9.0-alpha1/#/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\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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/integer-field",
4
- "version": "24.8.5",
4
+ "version": "24.9.0-alpha1",
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-integer-field",
19
- "description": "`<vaadin-integer-field>` is an input field web component that only accepts entering integer numbers.\n\n```html\n<vaadin-integer-field label=\"X\"></vaadin-integer-field>\n```\n\n### Styling\n\n`<vaadin-integer-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.8.5/#/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\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.",
19
+ "description": "`<vaadin-integer-field>` is an input field web component that only accepts entering integer numbers.\n\n```html\n<vaadin-integer-field label=\"X\"></vaadin-integer-field>\n```\n\n### Styling\n\n`<vaadin-integer-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.9.0-alpha1/#/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\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
  {
@@ -1,77 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
7
- import { NumberField } from '@vaadin/number-field/src/vaadin-lit-number-field.js';
8
-
9
- /**
10
- * LitElement based version of `<vaadin-integer-field>` web component.
11
- *
12
- * ## Disclaimer
13
- *
14
- * This component is an experiment and not yet a part of Vaadin platform.
15
- * There is no ETA regarding specific Vaadin version where it'll land.
16
- * Feel free to try this code in your apps as per Apache 2.0 license.
17
- */
18
- export class IntegerField extends NumberField {
19
- static get is() {
20
- return 'vaadin-integer-field';
21
- }
22
-
23
- constructor() {
24
- super();
25
-
26
- this.allowedCharPattern = '[-+\\d]';
27
- }
28
-
29
- /**
30
- * Override an observer from `InputMixin` to clear the value
31
- * when trying to type invalid characters.
32
- * @param {string | undefined} newVal
33
- * @param {string | undefined} oldVal
34
- * @protected
35
- * @override
36
- */
37
- _valueChanged(newVal, oldVal) {
38
- if (newVal !== '' && !this.__isInteger(newVal)) {
39
- console.warn(`Trying to set non-integer value "${newVal}" to <vaadin-integer-field>. Clearing the value.`);
40
- this.value = '';
41
- return;
42
- }
43
- super._valueChanged(newVal, oldVal);
44
- }
45
-
46
- /**
47
- * Override an observer from `NumberField` to reset the step
48
- * property when an invalid step is set.
49
- * @param {number} newVal
50
- * @param {HTMLElement | undefined} inputElement
51
- * @protected
52
- * @override
53
- */
54
- _stepChanged(step, inputElement) {
55
- if (step != null && !this.__hasOnlyDigits(step)) {
56
- console.warn(
57
- `<vaadin-integer-field> The \`step\` property must be a positive integer but \`${step}\` was provided, so the property was reset to \`null\`.`,
58
- );
59
- this.step = null;
60
- return;
61
- }
62
-
63
- super._stepChanged(step, inputElement);
64
- }
65
-
66
- /** @private */
67
- __isInteger(value) {
68
- return /^(-\d)?\d*$/u.test(String(value));
69
- }
70
-
71
- /** @private */
72
- __hasOnlyDigits(value) {
73
- return /^\d+$/u.test(String(value));
74
- }
75
- }
76
-
77
- defineCustomElement(IntegerField);
@@ -1,2 +0,0 @@
1
- import '@vaadin/number-field/theme/lumo/vaadin-lit-number-field.js';
2
- import '../../src/vaadin-lit-integer-field.js';
@@ -1,2 +0,0 @@
1
- import '@vaadin/number-field/theme/lumo/vaadin-lit-number-field.js';
2
- import '../../src/vaadin-lit-integer-field.js';
@@ -1,2 +0,0 @@
1
- import '@vaadin/number-field/theme/material/vaadin-lit-number-field.js';
2
- import '../../src/vaadin-lit-integer-field.js';
@@ -1,2 +0,0 @@
1
- import '@vaadin/number-field/theme/material/vaadin-lit-number-field.js';
2
- import '../../src/vaadin-lit-integer-field.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-integer-field.js';
@@ -1,3 +0,0 @@
1
- import './theme/lumo/vaadin-lit-integer-field.js';
2
-
3
- export * from './src/vaadin-lit-integer-field.js';