@vaadin/field-base 23.1.0-alpha3 → 23.1.0-alpha4

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-alpha3",
3
+ "version": "23.1.0-alpha4",
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-alpha3",
35
+ "@vaadin/component-base": "23.1.0-alpha4",
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": "8c9e64e8dfa158dd52a9bf6da351ff038c88ca85"
43
+ "gitHead": "aacdb7fe09811894751f0378ff7fb66071892c71"
44
44
  }
@@ -12,7 +12,7 @@ import { InputMixinClass } from './input-mixin.js';
12
12
  * A mixin to manage the checked state.
13
13
  */
14
14
  export declare function CheckedMixin<T extends Constructor<object>>(
15
- base: T
15
+ base: T,
16
16
  ): T &
17
17
  Constructor<CheckedMixinClass> &
18
18
  Constructor<DelegateStateMixinClass> &
@@ -29,8 +29,8 @@ export const CheckedMixin = dedupingMixin(
29
29
  type: Boolean,
30
30
  value: false,
31
31
  notify: true,
32
- reflectToAttribute: true
33
- }
32
+ reflectToAttribute: true,
33
+ },
34
34
  };
35
35
  }
36
36
 
@@ -50,5 +50,5 @@ export const CheckedMixin = dedupingMixin(
50
50
  _toggleChecked(checked) {
51
51
  this.checked = checked;
52
52
  }
53
- }
53
+ },
54
54
  );
@@ -12,7 +12,7 @@ import { TabindexMixinClass } from '@vaadin/component-base/src/tabindex-mixin.js
12
12
  * A mixin to forward focus to an element in the light DOM.
13
13
  */
14
14
  export declare function DelegateFocusMixin<T extends Constructor<HTMLElement>>(
15
- base: T
15
+ base: T,
16
16
  ): T &
17
17
  Constructor<DelegateFocusMixinClass> &
18
18
  Constructor<DisabledMixinClass> &
@@ -23,7 +23,7 @@ export const DelegateFocusMixin = dedupingMixin(
23
23
  * Specify that this control should have input focus when the page loads.
24
24
  */
25
25
  autofocus: {
26
- type: Boolean
26
+ type: Boolean,
27
27
  },
28
28
 
29
29
  /**
@@ -41,7 +41,7 @@ export const DelegateFocusMixin = dedupingMixin(
41
41
  focusElement: {
42
42
  type: Object,
43
43
  readOnly: true,
44
- observer: '_focusElementChanged'
44
+ observer: '_focusElementChanged',
45
45
  },
46
46
 
47
47
  /**
@@ -53,8 +53,8 @@ export const DelegateFocusMixin = dedupingMixin(
53
53
  * @override
54
54
  */
55
55
  _lastTabIndex: {
56
- value: 0
57
- }
56
+ value: 0,
57
+ },
58
58
  };
59
59
  }
60
60
 
@@ -224,5 +224,5 @@ export const DelegateFocusMixin = dedupingMixin(
224
224
  this.tabindex = undefined;
225
225
  }
226
226
  }
227
- }
227
+ },
228
228
  );
@@ -9,7 +9,7 @@ import { Constructor } from '@open-wc/dedupe-mixin';
9
9
  * A mixin to delegate properties and attributes to a target element.
10
10
  */
11
11
  export declare function DelegateStateMixin<T extends Constructor<HTMLElement>>(
12
- base: T
12
+ base: T,
13
13
  ): T & Constructor<DelegateStateMixinClass>;
14
14
 
15
15
  export declare class DelegateStateMixinClass {
@@ -21,8 +21,8 @@ export const DelegateStateMixin = dedupingMixin(
21
21
  */
22
22
  stateTarget: {
23
23
  type: Object,
24
- observer: '_stateTargetChanged'
25
- }
24
+ observer: '_stateTargetChanged',
25
+ },
26
26
  };
27
27
  }
28
28
 
@@ -121,5 +121,5 @@ export const DelegateStateMixin = dedupingMixin(
121
121
 
122
122
  this.stateTarget[name] = value;
123
123
  }
124
- }
124
+ },
125
125
  );
@@ -18,7 +18,7 @@ export class ErrorController extends SlotController {
18
18
  this.__updateErrorId(node);
19
19
 
20
20
  this.__updateHasError();
21
- }
21
+ },
22
22
  );
23
23
  }
24
24
 
@@ -13,7 +13,7 @@ import { ValidateMixinClass } from './validate-mixin.js';
13
13
  * A mixin to provide common field logic: label, error message and helper text.
14
14
  */
15
15
  export declare function FieldMixin<T extends Constructor<HTMLElement>>(
16
- superclass: T
16
+ superclass: T,
17
17
  ): T &
18
18
  Constructor<ControllerMixinClass> &
19
19
  Constructor<FieldMixinClass> &
@@ -28,7 +28,7 @@ export const FieldMixin = (superclass) =>
28
28
  */
29
29
  ariaTarget: {
30
30
  type: Object,
31
- observer: '_ariaTargetChanged'
31
+ observer: '_ariaTargetChanged',
32
32
  },
33
33
 
34
34
  /**
@@ -38,7 +38,7 @@ export const FieldMixin = (superclass) =>
38
38
  */
39
39
  errorMessage: {
40
40
  type: String,
41
- observer: '_errorMessageChanged'
41
+ observer: '_errorMessageChanged',
42
42
  },
43
43
 
44
44
  /**
@@ -47,11 +47,11 @@ export const FieldMixin = (superclass) =>
47
47
  */
48
48
  helperText: {
49
49
  type: String,
50
- observer: '_helperTextChanged'
50
+ observer: '_helperTextChanged',
51
51
  },
52
52
 
53
53
  /** @protected */
54
- _helperId: String
54
+ _helperId: String,
55
55
  };
56
56
  }
57
57
 
@@ -151,7 +151,7 @@ export class HelperController extends SlotController {
151
151
  attributeFilter: ['id'],
152
152
  childList: true,
153
153
  subtree: true,
154
- characterData: true
154
+ characterData: true,
155
155
  });
156
156
  }
157
157
 
@@ -167,9 +167,9 @@ export class HelperController extends SlotController {
167
167
  new CustomEvent('helper-changed', {
168
168
  detail: {
169
169
  hasHelper,
170
- node: this.node
171
- }
172
- })
170
+ node: this.node,
171
+ },
172
+ }),
173
173
  );
174
174
  }
175
175
 
@@ -13,7 +13,7 @@ import { ValidateMixinClass } from './validate-mixin.js';
13
13
  * A mixin to combine multiple input validation constraints.
14
14
  */
15
15
  export declare function InputConstraintsMixin<T extends Constructor<HTMLElement>>(
16
- base: T
16
+ base: T,
17
17
  ): T &
18
18
  Constructor<DelegateStateMixinClass> &
19
19
  Constructor<DisabledMixinClass> &
@@ -108,11 +108,11 @@ export const InputConstraintsMixin = dedupingMixin(
108
108
  this.dispatchEvent(
109
109
  new CustomEvent('change', {
110
110
  detail: {
111
- sourceEvent: event
111
+ sourceEvent: event,
112
112
  },
113
113
  bubbles: event.bubbles,
114
- cancelable: event.cancelable
115
- })
114
+ cancelable: event.cancelable,
115
+ }),
116
116
  );
117
117
  }
118
118
 
@@ -121,5 +121,5 @@ export const InputConstraintsMixin = dedupingMixin(
121
121
  // 0 is valid for `minlength` and `maxlength`
122
122
  return Boolean(constraint) || constraint === 0;
123
123
  }
124
- }
124
+ },
125
125
  );
@@ -20,7 +20,7 @@ import { ValidateMixinClass } from './validate-mixin.js';
20
20
  * A mixin to provide shared logic for the editable form input controls.
21
21
  */
22
22
  export declare function InputControlMixin<T extends Constructor<HTMLElement>>(
23
- base: T
23
+ base: T,
24
24
  ): T &
25
25
  Constructor<ControllerMixinClass> &
26
26
  Constructor<DelegateFocusMixinClass> &
@@ -19,7 +19,7 @@ import { InputConstraintsMixin } from './input-constraints-mixin.js';
19
19
  */
20
20
  export const InputControlMixin = (superclass) =>
21
21
  class InputControlMixinClass extends DelegateFocusMixin(
22
- InputConstraintsMixin(FieldMixin(KeyboardMixin(superclass)))
22
+ InputConstraintsMixin(FieldMixin(KeyboardMixin(superclass))),
23
23
  ) {
24
24
  static get properties() {
25
25
  return {
@@ -28,7 +28,7 @@ export const InputControlMixin = (superclass) =>
28
28
  */
29
29
  autoselect: {
30
30
  type: Boolean,
31
- value: false
31
+ value: false,
32
32
  },
33
33
 
34
34
  /**
@@ -38,7 +38,7 @@ export const InputControlMixin = (superclass) =>
38
38
  clearButtonVisible: {
39
39
  type: Boolean,
40
40
  reflectToAttribute: true,
41
- value: false
41
+ value: false,
42
42
  },
43
43
 
44
44
  /**
@@ -46,7 +46,7 @@ export const InputControlMixin = (superclass) =>
46
46
  */
47
47
  name: {
48
48
  type: String,
49
- reflectToAttribute: true
49
+ reflectToAttribute: true,
50
50
  },
51
51
 
52
52
  /**
@@ -54,7 +54,7 @@ export const InputControlMixin = (superclass) =>
54
54
  */
55
55
  placeholder: {
56
56
  type: String,
57
- reflectToAttribute: true
57
+ reflectToAttribute: true,
58
58
  },
59
59
 
60
60
  /**
@@ -63,7 +63,7 @@ export const InputControlMixin = (superclass) =>
63
63
  readonly: {
64
64
  type: Boolean,
65
65
  value: false,
66
- reflectToAttribute: true
66
+ reflectToAttribute: true,
67
67
  },
68
68
 
69
69
  /**
@@ -71,8 +71,8 @@ export const InputControlMixin = (superclass) =>
71
71
  */
72
72
  title: {
73
73
  type: String,
74
- reflectToAttribute: true
75
- }
74
+ reflectToAttribute: true,
75
+ },
76
76
  };
77
77
  }
78
78
 
@@ -156,11 +156,11 @@ export const InputControlMixin = (superclass) =>
156
156
  this.dispatchEvent(
157
157
  new CustomEvent('change', {
158
158
  detail: {
159
- sourceEvent: event
159
+ sourceEvent: event,
160
160
  },
161
161
  bubbles: event.bubbles,
162
- cancelable: event.cancelable
163
- })
162
+ cancelable: event.cancelable,
163
+ }),
164
164
  );
165
165
  }
166
166
 
@@ -27,10 +27,10 @@ export class InputController extends SlotController {
27
27
  host._inputId = `${host.localName}-${uniqueId}`;
28
28
  node.id = host._inputId;
29
29
 
30
- if (typeof callback == 'function') {
30
+ if (typeof callback === 'function') {
31
31
  callback(node);
32
32
  }
33
- }
33
+ },
34
34
  );
35
35
  }
36
36
  }
@@ -21,7 +21,7 @@ import { ValidateMixinClass } from './validate-mixin.js';
21
21
  * A mixin to provide logic for vaadin-text-field and related components.
22
22
  */
23
23
  export declare function InputFieldMixin<T extends Constructor<HTMLElement>>(
24
- base: T
24
+ base: T,
25
25
  ): T &
26
26
  Constructor<ControllerMixinClass> &
27
27
  Constructor<DelegateFocusMixinClass> &
@@ -21,7 +21,7 @@ export const InputFieldMixin = (superclass) =>
21
21
  * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete
22
22
  */
23
23
  autocomplete: {
24
- type: String
24
+ type: String,
25
25
  },
26
26
 
27
27
  /**
@@ -32,7 +32,7 @@ export const InputFieldMixin = (superclass) =>
32
32
  * off: Disable autocorrection.
33
33
  */
34
34
  autocorrect: {
35
- type: String
35
+ type: String,
36
36
  },
37
37
 
38
38
  /**
@@ -45,7 +45,7 @@ export const InputFieldMixin = (superclass) =>
45
45
  * none: No capitalization.
46
46
  */
47
47
  autocapitalize: {
48
- type: String
48
+ type: String,
49
49
  },
50
50
 
51
51
  /**
@@ -61,8 +61,8 @@ export const InputFieldMixin = (superclass) =>
61
61
  */
62
62
  _enabledCharPattern: {
63
63
  type: String,
64
- observer: '_enabledCharPatternChanged'
65
- }
64
+ observer: '_enabledCharPatternChanged',
65
+ },
66
66
  };
67
67
  }
68
68
 
@@ -238,8 +238,8 @@ export const InputFieldMixin = (superclass) =>
238
238
  /** @private */
239
239
  _enabledCharPatternChanged(charPattern) {
240
240
  if (charPattern) {
241
- this.__enabledCharRegExp = new RegExp('^' + charPattern + '$');
242
- this.__enabledTextRegExp = new RegExp('^' + charPattern + '*$');
241
+ this.__enabledCharRegExp = new RegExp(`^${charPattern}$`);
242
+ this.__enabledTextRegExp = new RegExp(`^${charPattern}*$`);
243
243
  }
244
244
  }
245
245
  };
@@ -31,7 +31,7 @@ export const InputMixin = dedupingMixin(
31
31
  inputElement: {
32
32
  type: Object,
33
33
  readOnly: true,
34
- observer: '_inputElementChanged'
34
+ observer: '_inputElementChanged',
35
35
  },
36
36
 
37
37
  /**
@@ -40,7 +40,7 @@ export const InputMixin = dedupingMixin(
40
40
  */
41
41
  type: {
42
42
  type: String,
43
- readOnly: true
43
+ readOnly: true,
44
44
  },
45
45
 
46
46
  /**
@@ -50,8 +50,8 @@ export const InputMixin = dedupingMixin(
50
50
  type: String,
51
51
  value: '',
52
52
  observer: '_valueChanged',
53
- notify: true
54
- }
53
+ notify: true,
54
+ },
55
55
  };
56
56
  }
57
57
 
@@ -105,7 +105,7 @@ export const InputMixin = dedupingMixin(
105
105
  return;
106
106
  }
107
107
 
108
- if (value != undefined) {
108
+ if (value != null) {
109
109
  this.inputElement.value = value;
110
110
  } else {
111
111
  this.inputElement.value = '';
@@ -176,5 +176,5 @@ export const InputMixin = dedupingMixin(
176
176
  // Setting a value programmatically, sync it to input element.
177
177
  this._forwardInputValue(newVal);
178
178
  }
179
- }
179
+ },
180
180
  );
@@ -22,7 +22,7 @@ export class LabelController extends SlotController {
22
22
  this.__updateDefaultLabel(this.label);
23
23
 
24
24
  this.__observeLabel(node);
25
- }
25
+ },
26
26
  );
27
27
  }
28
28
 
@@ -138,7 +138,7 @@ export class LabelController extends SlotController {
138
138
  attributeFilter: ['id'],
139
139
  childList: true,
140
140
  subtree: true,
141
- characterData: true
141
+ characterData: true,
142
142
  });
143
143
  }
144
144
 
@@ -154,9 +154,9 @@ export class LabelController extends SlotController {
154
154
  new CustomEvent('label-changed', {
155
155
  detail: {
156
156
  hasLabel,
157
- node: this.node
158
- }
159
- })
157
+ node: this.node,
158
+ },
159
+ }),
160
160
  );
161
161
  }
162
162
 
@@ -11,7 +11,7 @@ import { LabelController } from './label-controller.js';
11
11
  * A mixin to provide label via corresponding property or named slot.
12
12
  */
13
13
  export declare function LabelMixin<T extends Constructor<HTMLElement>>(
14
- base: T
14
+ base: T,
15
15
  ): T & Constructor<LabelMixinClass> & Constructor<SlotMixinClass>;
16
16
 
17
17
  export declare class LabelMixinClass {
@@ -24,8 +24,8 @@ export const LabelMixin = dedupingMixin(
24
24
  */
25
25
  label: {
26
26
  type: String,
27
- observer: '_labelChanged'
28
- }
27
+ observer: '_labelChanged',
28
+ },
29
29
  };
30
30
  }
31
31
 
@@ -50,5 +50,5 @@ export const LabelMixin = dedupingMixin(
50
50
  _labelChanged(label) {
51
51
  this._labelController.setLabel(label);
52
52
  }
53
- }
53
+ },
54
54
  );
@@ -14,7 +14,7 @@ import { ValidateMixinClass } from './validate-mixin.js';
14
14
  * A mixin to provide `pattern` and `preventInvalidInput` properties.
15
15
  */
16
16
  export declare function PatternMixin<T extends Constructor<HTMLElement>>(
17
- base: T
17
+ base: T,
18
18
  ): T &
19
19
  Constructor<DelegateStateMixinClass> &
20
20
  Constructor<DisabledMixinClass> &
@@ -22,7 +22,7 @@ export const PatternMixin = (superclass) =>
22
22
  * The pattern must match the entire value, not just some subset.
23
23
  */
24
24
  pattern: {
25
- type: String
25
+ type: String,
26
26
  },
27
27
 
28
28
  /**
@@ -31,8 +31,8 @@ export const PatternMixin = (superclass) =>
31
31
  * @attr {boolean} prevent-invalid-input
32
32
  */
33
33
  preventInvalidInput: {
34
- type: Boolean
35
- }
34
+ type: Boolean,
35
+ },
36
36
  };
37
37
  }
38
38
 
@@ -14,7 +14,7 @@ import { DelegateFocusMixinClass } from './delegate-focus-mixin.js';
14
14
  * A mixin to forward focus to an element in the shadow DOM.
15
15
  */
16
16
  export declare function ShadowFocusMixin<T extends Constructor<HTMLElement>>(
17
- base: T
17
+ base: T,
18
18
  ): T &
19
19
  Constructor<DelegateFocusMixinClass> &
20
20
  Constructor<DisabledMixinClass> &
@@ -25,8 +25,8 @@ export const ShadowFocusMixin = (superClass) =>
25
25
  */
26
26
  tabindex: {
27
27
  type: Number,
28
- value: 0
29
- }
28
+ value: 0,
29
+ },
30
30
  };
31
31
  }
32
32
 
@@ -10,7 +10,7 @@ import { Constructor } from '@open-wc/dedupe-mixin';
10
10
  * This is useful e.g. to hide native `<input type="number">` controls.
11
11
  */
12
12
  export declare function SlotStylesMixin<T extends Constructor<HTMLElement>>(
13
- base: T
13
+ base: T,
14
14
  ): T & Constructor<SlotStylesMixinClass>;
15
15
 
16
16
  export declare class SlotStylesMixinClass {
@@ -72,5 +72,5 @@ export const SlotStylesMixin = dedupingMixin(
72
72
  }
73
73
  });
74
74
  }
75
- }
75
+ },
76
76
  );
@@ -9,7 +9,7 @@ export class SlotTargetController implements ReactiveController {
9
9
  constructor(
10
10
  sourceSlot: HTMLSlotElement,
11
11
  targetFactory: () => HTMLElement,
12
- copyCallback?: (nodes: HTMLElement[]) => void
12
+ copyCallback?: (nodes: HTMLElement[]) => void,
13
13
  );
14
14
 
15
15
  hostConnected(): void;
@@ -73,7 +73,7 @@ export class SlotTargetController {
73
73
  // Exclude whitespace text nodes
74
74
  const nodes = this.sourceSlot
75
75
  .assignedNodes({ flatten: true })
76
- .filter((node) => !(node.nodeType == Node.TEXT_NODE && node.textContent.trim() === ''));
76
+ .filter((node) => !(node.nodeType === Node.TEXT_NODE && node.textContent.trim() === ''));
77
77
 
78
78
  if (nodes.length > 0) {
79
79
  slotTarget.innerHTML = '';
@@ -107,7 +107,7 @@ export class SlotTargetController {
107
107
  attributes: true,
108
108
  childList: true,
109
109
  subtree: true,
110
- characterData: true
110
+ characterData: true,
111
111
  });
112
112
  });
113
113
 
@@ -30,10 +30,10 @@ export class TextAreaController extends SlotController {
30
30
  host._textareaId = `${host.localName}-${uniqueId}`;
31
31
  node.id = host._textareaId;
32
32
 
33
- if (typeof callback == 'function') {
33
+ if (typeof callback === 'function') {
34
34
  callback(node);
35
35
  }
36
- }
36
+ },
37
37
  );
38
38
  }
39
39
  }
@@ -22,7 +22,7 @@ export const ValidateMixin = dedupingMixin(
22
22
  type: Boolean,
23
23
  reflectToAttribute: true,
24
24
  notify: true,
25
- value: false
25
+ value: false,
26
26
  },
27
27
 
28
28
  /**
@@ -30,8 +30,8 @@ export const ValidateMixin = dedupingMixin(
30
30
  */
31
31
  required: {
32
32
  type: Boolean,
33
- reflectToAttribute: true
34
- }
33
+ reflectToAttribute: true,
34
+ },
35
35
  };
36
36
  }
37
37
 
@@ -52,5 +52,5 @@ export const ValidateMixin = dedupingMixin(
52
52
  checkValidity() {
53
53
  return !this.required || !!this.value;
54
54
  }
55
- }
55
+ },
56
56
  );