@vaadin/select 23.1.0 → 23.1.3

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/select",
3
- "version": "23.1.0",
3
+ "version": "23.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,25 +36,25 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.2.0",
39
- "@vaadin/button": "^23.1.0",
40
- "@vaadin/component-base": "^23.1.0",
41
- "@vaadin/field-base": "^23.1.0",
42
- "@vaadin/input-container": "^23.1.0",
43
- "@vaadin/item": "^23.1.0",
44
- "@vaadin/list-box": "^23.1.0",
45
- "@vaadin/lit-renderer": "^23.1.0",
46
- "@vaadin/vaadin-list-mixin": "^23.1.0",
47
- "@vaadin/vaadin-lumo-styles": "^23.1.0",
48
- "@vaadin/vaadin-material-styles": "^23.1.0",
49
- "@vaadin/vaadin-overlay": "^23.1.0",
50
- "@vaadin/vaadin-themable-mixin": "^23.1.0"
39
+ "@vaadin/button": "^23.1.3",
40
+ "@vaadin/component-base": "^23.1.3",
41
+ "@vaadin/field-base": "^23.1.3",
42
+ "@vaadin/input-container": "^23.1.3",
43
+ "@vaadin/item": "^23.1.3",
44
+ "@vaadin/list-box": "^23.1.3",
45
+ "@vaadin/lit-renderer": "^23.1.3",
46
+ "@vaadin/vaadin-list-mixin": "^23.1.3",
47
+ "@vaadin/vaadin-lumo-styles": "^23.1.3",
48
+ "@vaadin/vaadin-material-styles": "^23.1.3",
49
+ "@vaadin/vaadin-overlay": "^23.1.3",
50
+ "@vaadin/vaadin-themable-mixin": "^23.1.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@esm-bundle/chai": "^4.3.4",
54
- "@vaadin/polymer-legacy-adapter": "^23.1.0",
54
+ "@vaadin/polymer-legacy-adapter": "^23.1.3",
55
55
  "@vaadin/testing-helpers": "^0.3.2",
56
56
  "lit": "^2.0.0",
57
57
  "sinon": "^13.0.2"
58
58
  },
59
- "gitHead": "322bba42b83f908a78cd972b06acadc5da95a69d"
59
+ "gitHead": "3066c296ad0ef652bc49417005523398199f1bf2"
60
60
  }
@@ -245,23 +245,16 @@ declare class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixi
245
245
  */
246
246
  requestContentUpdate(): void;
247
247
 
248
- /**
249
- * Returns true if `value` is valid, and sets the `invalid` flag appropriately.
250
- *
251
- * @returns True if the value is valid and sets the `invalid` flag appropriately
252
- */
253
- validate(): boolean;
254
-
255
248
  addEventListener<K extends keyof SelectEventMap>(
256
249
  type: K,
257
250
  listener: (this: Select, ev: SelectEventMap[K]) => void,
258
- options?: boolean | AddEventListenerOptions,
251
+ options?: AddEventListenerOptions | boolean,
259
252
  ): void;
260
253
 
261
254
  removeEventListener<K extends keyof SelectEventMap>(
262
255
  type: K,
263
256
  listener: (this: Select, ev: SelectEventMap[K]) => void,
264
- options?: boolean | EventListenerOptions,
257
+ options?: EventListenerOptions | boolean,
265
258
  ): void;
266
259
  }
267
260
 
@@ -673,8 +673,9 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
673
673
  /** @private */
674
674
  _updateSelectedItem(value, items) {
675
675
  if (items) {
676
+ const valueAsString = value == null ? value : value.toString();
676
677
  this._menuElement.selected = items.reduce((prev, item, idx) => {
677
- return prev === undefined && item.value === value ? idx : prev;
678
+ return prev === undefined && item.value === valueAsString ? idx : prev;
678
679
  }, undefined);
679
680
  if (!this._selectedChanging) {
680
681
  this._valueChanging = true;
@@ -710,12 +711,12 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
710
711
  }
711
712
 
712
713
  /**
713
- * Returns true if `value` is valid, and sets the `invalid` flag appropriately.
714
+ * Returns true if the current value satisfies all constraints (if any)
714
715
  *
715
- * @return {boolean} True if the value is valid and sets the `invalid` flag appropriately
716
+ * @return {boolean}
716
717
  */
717
- validate() {
718
- return !(this.invalid = !(this.disabled || !this.required || this.value));
718
+ checkValidity() {
719
+ return this.disabled || !this.required || !!this.value;
719
720
  }
720
721
 
721
722
  /**