@vaadin/field-base 24.1.5 → 24.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/field-base",
3
- "version": "24.1.5",
3
+ "version": "24.2.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,14 +32,14 @@
32
32
  "dependencies": {
33
33
  "@open-wc/dedupe-mixin": "^1.3.0",
34
34
  "@polymer/polymer": "^3.0.0",
35
- "@vaadin/a11y-base": "~24.1.5",
36
- "@vaadin/component-base": "~24.1.5",
35
+ "@vaadin/a11y-base": "24.2.0-alpha10",
36
+ "@vaadin/component-base": "24.2.0-alpha10",
37
37
  "lit": "^2.0.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@esm-bundle/chai": "^4.3.4",
41
- "@vaadin/testing-helpers": "^0.4.2",
41
+ "@vaadin/testing-helpers": "^0.5.0",
42
42
  "sinon": "^13.0.2"
43
43
  },
44
- "gitHead": "2150f0696b9205ed3651033301927516b87cf88f"
44
+ "gitHead": "ca16b5f88b00ae05fb6d7c7e9874525048e389f0"
45
45
  }
@@ -47,6 +47,8 @@ export const CheckedMixin = dedupingMixin(
47
47
  _onChange(event) {
48
48
  const input = event.target;
49
49
 
50
+ this.dirty = true;
51
+
50
52
  this._toggleChecked(input.checked);
51
53
 
52
54
  // Clicking the checkbox or radio-button in Safari
@@ -28,6 +28,15 @@ export declare class InputMixinClass {
28
28
  */
29
29
  value: string;
30
30
 
31
+ /**
32
+ * Whether the field is dirty.
33
+ *
34
+ * The field is automatically marked as dirty once the user triggers
35
+ * an `input` or `change` event. Additionally, the field can be manually
36
+ * marked as dirty by setting the property to `true`.
37
+ */
38
+ dirty: boolean;
39
+
31
40
  /**
32
41
  * Indicates whether the value is different from the default one.
33
42
  * Override if the `value` property has a type other than `string`.
@@ -53,6 +53,19 @@ export const InputMixin = dedupingMixin(
53
53
  notify: true,
54
54
  },
55
55
 
56
+ /**
57
+ * Whether the field is dirty.
58
+ *
59
+ * The field is automatically marked as dirty once the user triggers
60
+ * an `input` or `change` event. Additionally, the field can be manually
61
+ * marked as dirty by setting the property to `true`.
62
+ */
63
+ dirty: {
64
+ type: Boolean,
65
+ value: false,
66
+ notify: true,
67
+ },
68
+
56
69
  /**
57
70
  * Whether the input element has a non-empty value.
58
71
  *
@@ -194,7 +207,7 @@ export const InputMixin = dedupingMixin(
194
207
  }
195
208
 
196
209
  /**
197
- * An input event listener used to update `_hasInputValue` property.
210
+ * An input event listener used to update `_hasInputValue` and `dirty` properties.
198
211
  * Do not override this method.
199
212
  *
200
213
  * @param {Event} event
@@ -202,6 +215,7 @@ export const InputMixin = dedupingMixin(
202
215
  */
203
216
  __onInput(event) {
204
217
  this._setHasInputValue(event);
218
+ this.dirty = true;
205
219
  this._onInput(event);
206
220
  }
207
221
 
@@ -1,8 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd..
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import type { CSSResult } from 'lit';
7
-
8
- export const screenReaderOnly: CSSResult;
@@ -1,28 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd..
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
-
7
- /**
8
- * @note Taken from Gaël Poupard gist
9
- * @author Gaël Poupard
10
- * @see https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
11
- */
12
- import { css } from 'lit';
13
-
14
- export const screenReaderOnly = css`
15
- .sr-only {
16
- border: 0 !important;
17
- clip: rect(1px, 1px, 1px, 1px) !important;
18
- -webkit-clip-path: inset(50%) !important;
19
- clip-path: inset(50%) !important;
20
- height: 1px !important;
21
- margin: -1px !important;
22
- overflow: hidden !important;
23
- padding: 0 !important;
24
- position: absolute !important;
25
- width: 1px !important;
26
- white-space: nowrap !important;
27
- }
28
- `;