ng2-tag-input
Advanced tools
Comparing version 0.2.9 to 0.3.0
@@ -16,2 +16,5 @@ import { ElementRef, EventEmitter, Renderer, OnInit } from '@angular/core'; | ||
onlyFromAutocomplete: boolean; | ||
errorMessages: { | ||
[key: string]: string; | ||
}; | ||
onAdd: EventEmitter<string>; | ||
@@ -37,2 +40,3 @@ onRemove: EventEmitter<string>; | ||
handleKeydown($event: any, item: string): void; | ||
errors: string[]; | ||
private setInputValue(value); | ||
@@ -43,3 +47,2 @@ private getControl(); | ||
private maxItemsReached; | ||
private escapeDropdown($event); | ||
ngOnInit(): void; | ||
@@ -46,0 +49,0 @@ ngAfterViewChecked(): void; |
@@ -40,2 +40,3 @@ "use strict"; | ||
this.onlyFromAutocomplete = false; | ||
this.errorMessages = {}; | ||
this.onAdd = new core_1.EventEmitter(); | ||
@@ -100,2 +101,12 @@ this.onRemove = new core_1.EventEmitter(); | ||
}; | ||
Object.defineProperty(TagInputComponent.prototype, "errors", { | ||
get: function () { | ||
var _this = this; | ||
return Object.keys(this.errorMessages) | ||
.filter(function (err) { return _this.form.get('item').hasError(err); }) | ||
.map(function (err) { return _this.errorMessages[err]; }); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
TagInputComponent.prototype.setInputValue = function (value) { | ||
@@ -126,9 +137,2 @@ var item = value ? this.transform(value) : ''; | ||
}); | ||
TagInputComponent.prototype.escapeDropdown = function ($event) { | ||
var isArrowUp = $event.keyCode === 38; | ||
var isFirstItemsSelected = this.dropdown.menu.items.first.isSelected; | ||
if (isArrowUp && isFirstItemsSelected) { | ||
this.focus(); | ||
} | ||
}; | ||
TagInputComponent.prototype.ngOnInit = function () { | ||
@@ -212,2 +216,6 @@ events_actions_1.addListener.call(this, constants_1.KEYDOWN, events_actions_1.backSpaceListener); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Object) | ||
], TagInputComponent.prototype, "errorMessages", void 0); | ||
__decorate([ | ||
core_1.Output(), | ||
@@ -214,0 +222,0 @@ __metadata('design:type', Object) |
{ | ||
"name": "ng2-tag-input", | ||
"version": "0.2.9", | ||
"version": "0.3.0", | ||
"description": "Tag Input component for Angular 2", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -64,2 +64,3 @@ # Angular2 Tag Input [![Build Status](https://travis-ci.org/Gbuomprisco/ng2-tag-input.svg?branch=develop)](https://travis-ci.org/Gbuomprisco/ng2-tag-input) | ||
- **`validators`** - [**`?Validators[]`**] - an array of Validators (custom or Angular's) that will validate the tag before adding it to the list of items. It is possible to use multiple validators. | ||
- **`errorMessages`** - [**`?Object{error: message}`**] - an object whose key is the name of the error (ex. required) and the value is the message you want to display to your users | ||
- **`autocomplete`** - [**`?boolean`**] - if true, it adds an autocomplete component from which is possible to select items | ||
@@ -66,0 +67,0 @@ - **`autocompleteItems`** - [**`?string[]`**] - an array of items to populate the autocomplete dropdown |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
259215
3063
131