@vaadin/field-base 23.1.0-beta4 → 23.1.0-rc3

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": "23.1.0-beta4",
3
+ "version": "23.1.0-rc3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@open-wc/dedupe-mixin": "^1.3.0",
34
34
  "@polymer/polymer": "^3.0.0",
35
- "@vaadin/component-base": "23.1.0-beta4",
35
+ "@vaadin/component-base": "23.1.0-rc3",
36
36
  "lit": "^2.0.0"
37
37
  },
38
38
  "devDependencies": {
@@ -40,5 +40,5 @@
40
40
  "@vaadin/testing-helpers": "^0.3.2",
41
41
  "sinon": "^13.0.2"
42
42
  },
43
- "gitHead": "06e283473964ecb3085aacf3eddb5333d052a045"
43
+ "gitHead": "49c312fbe0228adb559296d45655bbfd4eac6235"
44
44
  }
@@ -9,13 +9,13 @@
9
9
  * either the component itself or slotted `<input>` element.
10
10
  */
11
11
  export class FieldAriaController {
12
- constructor(host: HTMLElement);
13
-
14
12
  /**
15
13
  * The controller host element.
16
14
  */
17
15
  host: HTMLElement;
18
16
 
17
+ constructor(host: HTMLElement);
18
+
19
19
  /**
20
20
  * Sets a target element to which ARIA attributes are added.
21
21
  */
@@ -5,7 +5,6 @@
5
5
  */
6
6
  import { Constructor } from '@open-wc/dedupe-mixin';
7
7
  import { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
8
- import { SlotMixinClass } from '@vaadin/component-base/src/slot-mixin.js';
9
8
  import { LabelMixinClass } from './label-mixin.js';
10
9
  import { ValidateMixinClass } from './validate-mixin.js';
11
10
 
@@ -18,7 +17,6 @@ export declare function FieldMixin<T extends Constructor<HTMLElement>>(
18
17
  Constructor<ControllerMixinClass> &
19
18
  Constructor<FieldMixinClass> &
20
19
  Constructor<LabelMixinClass> &
21
- Constructor<SlotMixinClass> &
22
20
  Constructor<ValidateMixinClass>;
23
21
 
24
22
  export declare class FieldMixinClass {
@@ -49,11 +47,7 @@ export declare class FieldMixinClass {
49
47
 
50
48
  protected _ariaTargetChanged(target: HTMLElement): void;
51
49
 
52
- protected _updateErrorMessage(invalid: boolean, errorMessage: string | null | undefined): void;
53
-
54
50
  protected _requiredChanged(required: boolean): void;
55
51
 
56
- protected _helperIdChanged(helperId: string): void;
57
-
58
52
  protected _invalidChanged(invalid: boolean): void;
59
53
  }
@@ -49,9 +49,6 @@ export const FieldMixin = (superclass) =>
49
49
  type: String,
50
50
  observer: '_helperTextChanged',
51
51
  },
52
-
53
- /** @protected */
54
- _helperId: String,
55
52
  };
56
53
  }
57
54
 
@@ -169,7 +166,7 @@ export const FieldMixin = (superclass) =>
169
166
  this._errorController.setInvalid(invalid);
170
167
 
171
168
  // This timeout is needed to prevent NVDA from announcing the error message twice:
172
- // 1. Once adding the `[role=alert]` attribute by the `_updateErrorMessage` method (OK).
169
+ // 1. Once adding the `[role=alert]` attribute when updating `has-error-message` (OK).
173
170
  // 2. Once linking the error ID with the ARIA target here (unwanted).
174
171
  // Related issue: https://github.com/vaadin/web-components/issues/3061.
175
172
  setTimeout(() => {
@@ -127,15 +127,16 @@ export const InputControlMixin = (superclass) =>
127
127
  /**
128
128
  * Override an event listener inherited from `KeydownMixin` to clear on Esc.
129
129
  * Components that extend this mixin can prevent this behavior by overriding
130
- * this method without calling `super._onKeyDown` to provide custom logic.
130
+ * this method without calling `super._onEscape` to provide custom logic.
131
131
  * @param {KeyboardEvent} event
132
132
  * @protected
133
133
  * @override
134
134
  */
135
- _onKeyDown(event) {
136
- super._onKeyDown(event);
135
+ _onEscape(event) {
136
+ super._onEscape(event);
137
137
 
138
- if (event.key === 'Escape' && this.clearButtonVisible && !!this.value) {
138
+ if (this.clearButtonVisible && !!this.value) {
139
+ event.stopPropagation();
139
140
  this.__clear();
140
141
  }
141
142
  }
@@ -179,7 +179,7 @@ export const InputFieldMixin = (superclass) =>
179
179
  }
180
180
 
181
181
  /**
182
- * Override an event listener from `ClearButtonMixin`
182
+ * Override an event listener from `InputControlMixin`
183
183
  * to avoid adding a separate listener.
184
184
  * @param {!KeyboardEvent} event
185
185
  * @protected
@@ -9,6 +9,11 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
9
9
  * A controller to manage the label element.
10
10
  */
11
11
  export class LabelController extends SlotController {
12
+ /**
13
+ * ID attribute value set on the label element.
14
+ */
15
+ labelId: string;
16
+
12
17
  /**
13
18
  * String used for the label.
14
19
  */
@@ -18,9 +23,4 @@ export class LabelController extends SlotController {
18
23
  * Set label based on corresponding host property.
19
24
  */
20
25
  setLabel(label: string | null | undefined): void;
21
-
22
- /**
23
- * ID attribute value set on the label element.
24
- */
25
- labelId: string;
26
26
  }
@@ -4,15 +4,12 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { Constructor } from '@open-wc/dedupe-mixin';
7
- import { SlotMixinClass } from '@vaadin/component-base/src/slot-mixin.js';
8
7
  import { LabelController } from './label-controller.js';
9
8
 
10
9
  /**
11
10
  * A mixin to provide label via corresponding property or named slot.
12
11
  */
13
- export declare function LabelMixin<T extends Constructor<HTMLElement>>(
14
- base: T,
15
- ): T & Constructor<LabelMixinClass> & Constructor<SlotMixinClass>;
12
+ export declare function LabelMixin<T extends Constructor<HTMLElement>>(base: T): T & Constructor<LabelMixinClass>;
16
13
 
17
14
  export declare class LabelMixinClass {
18
15
  /**
@@ -6,14 +6,6 @@
6
6
  import { ReactiveController } from 'lit';
7
7
 
8
8
  export class SlotTargetController implements ReactiveController {
9
- constructor(
10
- sourceSlot: HTMLSlotElement,
11
- targetFactory: () => HTMLElement,
12
- copyCallback?: (nodes: HTMLElement[]) => void,
13
- );
14
-
15
- hostConnected(): void;
16
-
17
9
  /**
18
10
  * The source `<slot>` element to copy nodes from.
19
11
  */
@@ -28,4 +20,12 @@ export class SlotTargetController implements ReactiveController {
28
20
  * Function called after copying nodes to target.
29
21
  */
30
22
  protected copyCallback?: (nodes: HTMLElement[]) => void;
23
+
24
+ constructor(
25
+ sourceSlot: HTMLSlotElement,
26
+ targetFactory: () => HTMLElement,
27
+ copyCallback?: (nodes: HTMLElement[]) => void,
28
+ );
29
+
30
+ hostConnected(): void;
31
31
  }