@vaadin/vaadin-combo-box
Advanced tools
Comparing version 5.4.12 to 5.5.0
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-combo-box", | ||
"version": "5.4.12", | ||
"version": "5.5.0", | ||
"main": "vaadin-combo-box.js", | ||
@@ -49,6 +49,2 @@ "author": "Vaadin Ltd", | ||
}, | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify", | ||
"test": "wct --npm" | ||
}, | ||
"devDependencies": { | ||
@@ -65,3 +61,7 @@ "@web-padawan/gen-typescript-declarations": "^1.6.2", | ||
"@vaadin/vaadin-dialog": "^2.5.0" | ||
}, | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify", | ||
"test": "wct --npm" | ||
} | ||
} |
@@ -126,2 +126,7 @@ /** | ||
/** | ||
* Whether the input element has a non-empty value. | ||
*/ | ||
_hasInputValue: boolean|null|undefined; | ||
/** | ||
* Path for label of the item. If `items` is an array of objects, the | ||
@@ -205,7 +210,16 @@ * `itemLabelPath` is used to fetch the displayed string label for each | ||
_inputValueChanged(e: Event): void; | ||
_inputElementValueChanged(inputElementValue: any): void; | ||
_revertInputValue(): void; | ||
_setInvalid(invalid: boolean): void; | ||
/** | ||
* Returns true if `value` is valid, and sets the `invalid` flag appropriately. | ||
* Override this method to define whether the given `invalid` state should be set. | ||
*/ | ||
_shouldSetInvalid(_invalid: boolean): boolean; | ||
/** | ||
* Validates the field and sets the `invalid` property based on the result. | ||
* | ||
* The method fires a `validated` event with the result of the validation. | ||
* | ||
* @returns True if the value is valid and sets the `invalid` flag appropriately | ||
@@ -212,0 +226,0 @@ */ |
@@ -170,2 +170,12 @@ /** | ||
/** | ||
* Whether the input element has a non-empty value. | ||
* @protected | ||
*/ | ||
_hasInputValue: { | ||
type: Boolean, | ||
value: false, | ||
observer: '_hasInputValueChanged', | ||
}, | ||
/** | ||
* Path for label of the item. If `items` is an array of objects, the | ||
@@ -265,3 +275,4 @@ * `itemLabelPath` is used to fetch the displayed string label for each | ||
'_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)', | ||
'_toggleElementChanged(_toggleElement)' | ||
'_toggleElementChanged(_toggleElement)', | ||
'_inputElementValueChanged(_inputElementValue)' | ||
]; | ||
@@ -637,2 +648,3 @@ } | ||
if (this.allowCustomValue) { | ||
this._inputElementValue = ''; | ||
this.value = ''; | ||
@@ -769,2 +781,6 @@ } | ||
_inputElementValueChanged(inputElementValue) { | ||
this._hasInputValue = inputElementValue != null ? inputElementValue.length > 0 : false; | ||
} | ||
/** @private */ | ||
@@ -1097,8 +1113,45 @@ _filterFromInput(e) { | ||
/** | ||
* Returns true if `value` is valid, and sets the `invalid` flag appropriately. | ||
* Observer to notify about the change of private property. | ||
* | ||
* @private | ||
*/ | ||
_hasInputValueChanged(hasValue, oldHasValue) { | ||
if (hasValue || oldHasValue) { | ||
this.dispatchEvent(new CustomEvent('has-input-value-changed')); | ||
} | ||
} | ||
/** | ||
* @param {boolean} invalid | ||
* @protected | ||
*/ | ||
_setInvalid(invalid) { | ||
if (this._shouldSetInvalid(invalid)) { | ||
this.invalid = invalid; | ||
} | ||
} | ||
/** | ||
* Override this method to define whether the given `invalid` state should be set. | ||
* | ||
* @param {boolean} _invalid | ||
* @return {boolean} | ||
* @protected | ||
*/ | ||
_shouldSetInvalid(_invalid) { | ||
return true; | ||
} | ||
/** | ||
* Validates the field and sets the `invalid` property based on the result. | ||
* | ||
* The method fires a `validated` event with the result of the validation. | ||
* | ||
* @return {boolean} True if the value is valid and sets the `invalid` flag appropriately | ||
*/ | ||
validate() { | ||
return !(this.invalid = !this.checkValidity()); | ||
const isValid = this.checkValidity(); | ||
this._setInvalid(!isValid); | ||
this.dispatchEvent(new CustomEvent('validated', {detail: {valid: isValid}})); | ||
return isValid; | ||
} | ||
@@ -1214,2 +1267,10 @@ | ||
*/ | ||
/** | ||
* Fired whenever the field is validated. | ||
* | ||
* @event validated | ||
* @param {Object} detail | ||
* @param {boolean} detail.valid the result of the validation. | ||
*/ | ||
}; |
@@ -232,3 +232,3 @@ /** | ||
static get version() { | ||
return '5.4.12'; | ||
return '5.5.0'; | ||
} | ||
@@ -235,0 +235,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148096
3806