@progress/kendo-angular-dropdowns
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -37,2 +37,7 @@ import '@telerik/kendo-theme-default/styles/packages/dropdowns'; | ||
/** | ||
* Specifies whether the ComboBox allows user-defined values that are not present in the data set. | ||
* | ||
*/ | ||
allowCustom: boolean; | ||
/** | ||
* Sets or gets the `open` property of the ComboBox. | ||
@@ -80,2 +85,7 @@ * | ||
/** | ||
* A user-defined callback returning normalized custom values. | ||
* Typically used when the data items are not of type `string`. | ||
*/ | ||
normalizeValue: Function; | ||
/** | ||
* Configures the popup of the DropDownList. The available options of the `IPopupSettings` are: | ||
@@ -160,3 +170,3 @@ * | ||
ngOnDestroy(): void; | ||
ngOnChanges(changes: any): void; | ||
ngOnChanges(): void; | ||
/** | ||
@@ -163,0 +173,0 @@ * @hidden |
@@ -117,5 +117,17 @@ (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap | ||
this.selected = []; | ||
/** | ||
* Specifies whether the ComboBox allows user-defined values that are not present in the data set. | ||
* | ||
*/ | ||
this.allowCustom = false; | ||
this._open = false; | ||
this._previousValue = undefined; | ||
/** | ||
* A user-defined callback returning normalized custom values. | ||
* Typically used when the data items are not of type `string`. | ||
*/ | ||
this.normalizeValue = function (value) { | ||
return value; | ||
}; | ||
/** | ||
* Configures the popup of the DropDownList. The available options of the `IPopupSettings` are: | ||
@@ -325,3 +337,3 @@ * | ||
}; | ||
ComboBoxComponent.prototype.ngOnChanges = function (changes) { | ||
ComboBoxComponent.prototype.ngOnChanges = function () { | ||
if (this.valuePrimitive === undefined) { | ||
@@ -487,25 +499,14 @@ this.valuePrimitive = this.valueField ? false : true; | ||
if (isCustom === void 0) { isCustom = false; } | ||
var customItem; | ||
var primitiveValue = kendo_dropdowns_common_1.DropDownsUtil.getter(newValue, this.valueField) || newValue; | ||
this.open = false; | ||
if (isCustom) { | ||
if (newValue === (kendo_dropdowns_common_1.DropDownsUtil.getter(this.value, this.textField) || this.value)) { | ||
return; | ||
this.dataItem = undefined; | ||
if (this.allowCustom) { | ||
this.value = this.normalizeValue(newValue); | ||
} | ||
else { | ||
customItem = (_a = {}, | ||
_a[this.textField] = newValue, | ||
_a[this.valueField] = undefined, | ||
_a | ||
); | ||
this.text = undefined; | ||
this.value = undefined; | ||
} | ||
} | ||
else if (this.dataItem === newValue) { | ||
//prevent changes if same item is selected from the list by click or Enter key | ||
return; | ||
} | ||
if (isCustom) { | ||
this.dataItem = undefined; | ||
this.value = this.valuePrimitive ? newValue : customItem; | ||
} | ||
else { | ||
@@ -518,3 +519,2 @@ this.dataItem = newValue; | ||
this.valueChange.emit(this.value); | ||
var _a; | ||
}; | ||
@@ -541,2 +541,6 @@ ComboBoxComponent.prototype.iconClick = function () { | ||
core_1.Input(), | ||
__metadata('design:type', Boolean) | ||
], ComboBoxComponent.prototype, "allowCustom", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Boolean), | ||
@@ -568,2 +572,6 @@ __metadata('design:paramtypes', [Boolean]) | ||
__decorate([ | ||
core_1.Input('valueNormalizer'), | ||
__metadata('design:type', Function) | ||
], ComboBoxComponent.prototype, "normalizeValue", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
@@ -570,0 +578,0 @@ __metadata('design:type', Object) |
{ | ||
"name": "@progress/kendo-angular-dropdowns", | ||
"description": "Dropdowns Package for Angular 2", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "registry": "https://registry.npm.telerik.com" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
621472
5803