New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular2-select

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-select - npm Package Compare versions

Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8

CHANGELOG.md

48

index.js
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');

@@ -20,23 +11,24 @@ var common_1 = require('@angular/common');

}
SelectModule = __decorate([
core_1.NgModule({
declarations: [
select_component_1.SelectComponent,
select_dropdown_component_1.SelectDropdownComponent
],
exports: [
select_component_1.SelectComponent
],
imports: [
common_1.CommonModule,
forms_1.FormsModule
],
providers: [
diacritics_service_1.DiacriticsService
]
}),
__metadata('design:paramtypes', [])
], SelectModule);
SelectModule.decorators = [
{ type: core_1.NgModule, args: [{
declarations: [
select_component_1.SelectComponent,
select_dropdown_component_1.SelectDropdownComponent
],
exports: [
select_component_1.SelectComponent
],
imports: [
common_1.CommonModule,
forms_1.FormsModule
],
providers: [
diacritics_service_1.DiacriticsService
]
},] },
];
/** @nocollapse */
SelectModule.ctorParameters = [];
return SelectModule;
}());
exports.SelectModule = SelectModule;
{
"name": "angular2-select",
"version": "1.0.0-alpha.7",
"version": "1.0.0-alpha.8",
"description": "Select component for Angular 2 (based on select2 JQuery plugin).",

@@ -28,11 +28,13 @@ "main": "./index.js",

"devDependencies": {
"@angular/common": "~2.0.0",
"@angular/compiler": "~2.0.0",
"@angular/core": "~2.0.0",
"@angular/forms": "~2.0.0",
"@angular/platform-browser": "~2.0.0",
"@angular/platform-browser-dynamic": "~2.0.0",
"@types/core-js": "~0.9.32",
"@types/jasmine": "~2.2.33",
"@types/node": "~6.0.38",
"@angular/common": "~2.0.1",
"@angular/compiler": "~2.0.1",
"@angular/compiler-cli": "^0.6.3",
"@angular/core": "~2.0.1",
"@angular/forms": "~2.0.1",
"@angular/platform-browser": "~2.0.1",
"@angular/platform-browser-dynamic": "~2.0.1",
"@angular/platform-server": "~2.0.1",
"@types/core-js": "~0.9.34",
"@types/jasmine": "~2.2.34",
"@types/node": "~6.0.41",
"core-js": "~2.4.1",

@@ -43,4 +45,2 @@ "del": "~2.2.2",

"gulp-tslint": "~6.1.1",
"gulp-typescript": "~3.0.1",
"merge2": "~1.0.2",
"reflect-metadata": "~0.1.8",

@@ -51,3 +51,3 @@ "rxjs": "~5.0.0-beta.12",

"tslint": "~3.15.1",
"typescript": "~2.0.3",
"typescript": "^2.0.3",
"zone.js": "~0.6.23"

@@ -54,0 +54,0 @@ },

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');

@@ -863,8 +854,9 @@ var DiacriticsService = (function () {

};
DiacriticsService = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [])
], DiacriticsService);
DiacriticsService.decorators = [
{ type: core_1.Injectable },
];
/** @nocollapse */
DiacriticsService.ctorParameters = [];
return DiacriticsService;
}());
exports.DiacriticsService = DiacriticsService;

@@ -0,1 +1,2 @@

/// <reference types="core-js" />
import { AfterViewInit, EventEmitter, OnChanges, OnInit } from '@angular/core';

@@ -2,0 +3,0 @@ import { DiacriticsService } from './diacritics.service';

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');

@@ -69,3 +60,10 @@ var style_1 = require('./style');

SelectDropdownComponent.prototype.onOptionsClick = function (event) {
this.toggleSelect.emit(event.target.dataset.value);
var val = event.target.dataset.value;
if (typeof val !== 'undefined') {
this.toggleSelect.emit(val);
}
else {
// Prevent close dropdown.
event.stopPropagation();
}
};

@@ -98,4 +96,10 @@ SelectDropdownComponent.prototype.onKeydown = function (event) {

SelectDropdownComponent.prototype.initHighlight = function () {
this._highlighted = this.selection.length > 0 ?
this.selection[0] : this.optionsDict[this.optionValues[0]];
if (this.optionValues.length > 0) {
if (this.selection.length > 0) {
this._highlighted = this.selection[0];
}
else {
this._highlighted = this.optionsDict[this.optionValues[0]];
}
}
};

@@ -236,58 +240,30 @@ SelectDropdownComponent.prototype.highlight = function (optionValue) {

};
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], SelectDropdownComponent.prototype, "multiple", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Array)
], SelectDropdownComponent.prototype, "optionValues", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Object)
], SelectDropdownComponent.prototype, "optionsDict", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Array)
], SelectDropdownComponent.prototype, "selection", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Number)
], SelectDropdownComponent.prototype, "width", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Number)
], SelectDropdownComponent.prototype, "top", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Number)
], SelectDropdownComponent.prototype, "left", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', Object)
], SelectDropdownComponent.prototype, "close", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', Object)
], SelectDropdownComponent.prototype, "toggleSelect", void 0);
__decorate([
core_1.ViewChild('input'),
__metadata('design:type', Object)
], SelectDropdownComponent.prototype, "input", void 0);
__decorate([
core_1.ViewChild('optionsList'),
__metadata('design:type', Object)
], SelectDropdownComponent.prototype, "optionsList", void 0);
SelectDropdownComponent = __decorate([
core_1.Component({
selector: 'select-dropdown',
template: "\n<span class=\"select2-container select2-container--default select2-container--open\"\n [ngStyle]=\"{position: 'absolute', top: top + 'px', left: left + 'px'}\">\n <span class=\"select2-dropdown select2-dropdown--below\"\n [ngStyle]=\"{width: width + 'px'}\">\n <span class=\"select2-search select2-search--dropdown\"\n *ngIf=\"!multiple\">\n <input class=\"select2-search__field\"\n #input\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (click)=\"onInputClick($event)\">\n </span>\n <span class=\"select2-results\">\n <ul class=\"select2-results__options\"\n #optionsList\n (mousemove)=\"onOptionsMouseMove($event)\"\n (wheel)=\"onOptionsWheel($event)\"\n (click)=\"onOptionsClick($event)\">\n <li\n *ngFor=\"let optionValue of optionValuesFiltered;\"\n [attr.aria-selected]=\"optionsDict[optionValue].selected\"\n [ngClass]=\"getOptionClass(optionValue)\"\n [attr.data-value]=\"optionValue\">\n {{optionsDict[optionValue].label}}\n </li>\n <li \n *ngIf=\"optionValuesFiltered.length === 0\"\n [ngClass]=\"getOptionClass(null)\">\n {{MSG_NOT_FOUND}}\n </li>\n </ul>\n </span>\n </span>\n</span>\n",
styles: [
style_1.DEFAULT_STYLES
]
}),
__metadata('design:paramtypes', [diacritics_service_1.DiacriticsService])
], SelectDropdownComponent);
SelectDropdownComponent.decorators = [
{ type: core_1.Component, args: [{
selector: 'select-dropdown',
template: "\n<span class=\"select2-container select2-container--default select2-container--open\"\n [ngStyle]=\"{position: 'absolute', top: top + 'px', left: left + 'px'}\">\n <span class=\"select2-dropdown select2-dropdown--below\"\n [ngStyle]=\"{width: width + 'px'}\">\n <span class=\"select2-search select2-search--dropdown\"\n *ngIf=\"!multiple\">\n <input class=\"select2-search__field\"\n #input\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (click)=\"onInputClick($event)\">\n </span>\n <span class=\"select2-results\">\n <ul class=\"select2-results__options\"\n #optionsList\n (mousemove)=\"onOptionsMouseMove($event)\"\n (wheel)=\"onOptionsWheel($event)\"\n (click)=\"onOptionsClick($event)\">\n <li\n *ngFor=\"let optionValue of optionValuesFiltered;\"\n [attr.aria-selected]=\"optionsDict[optionValue].selected\"\n [ngClass]=\"getOptionClass(optionValue)\"\n [attr.data-value]=\"optionValue\">\n {{optionsDict[optionValue].label}}\n </li>\n <li \n *ngIf=\"optionValuesFiltered.length === 0\"\n [ngClass]=\"getOptionClass(null)\">\n {{MSG_NOT_FOUND}}\n </li>\n </ul>\n </span>\n </span>\n</span>\n",
styles: [
style_1.DEFAULT_STYLES
]
},] },
];
/** @nocollapse */
SelectDropdownComponent.ctorParameters = [
{ type: diacritics_service_1.DiacriticsService, },
];
SelectDropdownComponent.propDecorators = {
'multiple': [{ type: core_1.Input },],
'optionValues': [{ type: core_1.Input },],
'optionsDict': [{ type: core_1.Input },],
'selection': [{ type: core_1.Input },],
'width': [{ type: core_1.Input },],
'top': [{ type: core_1.Input },],
'left': [{ type: core_1.Input },],
'close': [{ type: core_1.Output },],
'toggleSelect': [{ type: core_1.Output },],
'input': [{ type: core_1.ViewChild, args: ['input',] },],
'optionsList': [{ type: core_1.ViewChild, args: ['optionsList',] },],
};
return SelectDropdownComponent;
}());
exports.SelectDropdownComponent = SelectDropdownComponent;

@@ -0,1 +1,2 @@

/// <reference types="core-js" />
import { OnChanges, OnInit, EventEmitter, ExistingProvider } from '@angular/core';

@@ -2,0 +3,0 @@ import { ControlValueAccessor } from '@angular/forms';

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var forms_1 = require('@angular/forms');
var style_1 = require('./style');
var select_dropdown_component_1 = require('./select-dropdown.component');
exports.SELECT_VALUE_ACCESSOR = { provide: forms_1.NG_VALUE_ACCESSOR,

@@ -122,6 +112,11 @@ useExisting: core_1.forwardRef(function () { return SelectComponent; }),

var option = _a[_i];
var selected = false;
var existingOption = this.optionsDict[option.value];
if (typeof existingOption !== 'undefined') {
selected = existingOption.selected;
}
opts[option.value] = {
value: option.value,
label: option.label,
selected: false
selected: selected
};

@@ -132,2 +127,3 @@ values.push(option.value);

this.optionsDict = opts;
this.updateSelection();
};

@@ -372,69 +368,33 @@ SelectComponent.prototype.initDefaults = function () {

};
__decorate([
core_1.Input(),
__metadata('design:type', Array)
], SelectComponent.prototype, "options", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], SelectComponent.prototype, "theme", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], SelectComponent.prototype, "multiple", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], SelectComponent.prototype, "placeholder", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], SelectComponent.prototype, "allowClear", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', core_1.EventEmitter)
], SelectComponent.prototype, "opened", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', core_1.EventEmitter)
], SelectComponent.prototype, "closed", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', core_1.EventEmitter)
], SelectComponent.prototype, "selected", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', core_1.EventEmitter)
], SelectComponent.prototype, "deselected", void 0);
__decorate([
core_1.ViewChild('container'),
__metadata('design:type', Object)
], SelectComponent.prototype, "container", void 0);
__decorate([
core_1.ViewChild('selectionSpan'),
__metadata('design:type', Object)
], SelectComponent.prototype, "selectionSpan", void 0);
__decorate([
core_1.ViewChild('dropdown'),
__metadata('design:type', select_dropdown_component_1.SelectDropdownComponent)
], SelectComponent.prototype, "dropdown", void 0);
__decorate([
core_1.ViewChild('searchInput'),
__metadata('design:type', Object)
], SelectComponent.prototype, "searchInput", void 0);
SelectComponent = __decorate([
core_1.Component({
selector: 'ng-select',
template: "\n<div style=\"width:100%;position:relative;\">\n <span style=\"width:100%\"\n #container\n [ngClass]=\"getContainerClass()\"\n (window:resize)=\"onWindowResize()\"\n (window:click)=\"onWindowClick()\">\n <span class=\"selection\">\n <span tabindex=0\n #selectionSpan\n [ngClass]=\"getSelectionClass()\"\n (click)=\"onSelectionClick($event)\"\n (keydown)=\"onKeydown($event)\">\n\n <span class=\"select2-selection__rendered\"\n *ngIf=\"!multiple\">\n <span class=\"select2-selection__placeholder\">\n {{getPlaceholder()}}\n </span>\n </span>\n\n <span class=\"select2-selection__rendered\"\n *ngIf=\"!multiple && selection.length > 0\">\n <span class=\"select2-selection__clear\"\n *ngIf=\"allowClear\"\n (click)=\"onClearAllClick($event)\">\n x\n </span>\n {{selection[0].label}}\n </span>\n\n <ul class=\"select2-selection__rendered\"\n *ngIf=\"multiple\">\n <li class=\"select2-selection__choice\" title=\"{{option.label}}\"\n *ngFor=\"let option of selection\">\n <span class=\"select2-selection__choice__remove\"\n [attr.data-value]=\"option.value\"\n (click)=onClearItemClick($event)>\n \u00D7</span>\n {{option.label}}\n </li>\n <li class=\"select2-search select2-search--inline\">\n <input class=\"select2-search__field\"\n #searchInput\n placeholder=\"{{getPlaceholder()}}\"\n [ngStyle]=\"getInputStyle()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onSearchKeydown($event)\"/>\n </li>\n </ul>\n\n <span class=\"select2-selection__arrow\">\n <b></b>\n </span>\n </span>\n </span>\n </span>\n <select-dropdown\n *ngIf=\"isOpen\"\n #dropdown\n [multiple]=\"multiple\"\n [optionValues]=\"optionValues\"\n [optionsDict]=\"optionsDict\"\n [selection]=\"selection\"\n [width]=\"width\"\n [top]=\"top\"\n [left]=\"left\"\n (toggleSelect)=\"onToggleSelect($event)\"\n (close)=\"onClose($event)\">\n </select-dropdown>\n</div>\n",
styles: [
style_1.DEFAULT_STYLES
],
providers: [
exports.SELECT_VALUE_ACCESSOR
]
}),
__metadata('design:paramtypes', [])
], SelectComponent);
SelectComponent.decorators = [
{ type: core_1.Component, args: [{
selector: 'ng-select',
template: "\n<div style=\"width:100%;position:relative;\">\n <span style=\"width:100%\"\n #container\n [ngClass]=\"getContainerClass()\"\n (window:resize)=\"onWindowResize()\"\n (window:click)=\"onWindowClick()\">\n <span class=\"selection\">\n <span tabindex=0\n #selectionSpan\n [ngClass]=\"getSelectionClass()\"\n (click)=\"onSelectionClick($event)\"\n (keydown)=\"onKeydown($event)\">\n\n <span class=\"select2-selection__rendered\"\n *ngIf=\"!multiple\">\n <span class=\"select2-selection__placeholder\">\n {{getPlaceholder()}}\n </span>\n </span>\n\n <span class=\"select2-selection__rendered\"\n *ngIf=\"!multiple && selection.length > 0\">\n <span class=\"select2-selection__clear\"\n *ngIf=\"allowClear\"\n (click)=\"onClearAllClick($event)\">\n x\n </span>\n {{selection[0].label}}\n </span>\n\n <ul class=\"select2-selection__rendered\"\n *ngIf=\"multiple\">\n <li class=\"select2-selection__choice\" title=\"{{option.label}}\"\n *ngFor=\"let option of selection\">\n <span class=\"select2-selection__choice__remove\"\n [attr.data-value]=\"option.value\"\n (click)=onClearItemClick($event)>\n \u00D7</span>\n {{option.label}}\n </li>\n <li class=\"select2-search select2-search--inline\">\n <input class=\"select2-search__field\"\n #searchInput\n placeholder=\"{{getPlaceholder()}}\"\n [ngStyle]=\"getInputStyle()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onSearchKeydown($event)\"/>\n </li>\n </ul>\n\n <span class=\"select2-selection__arrow\">\n <b></b>\n </span>\n </span>\n </span>\n </span>\n <select-dropdown\n *ngIf=\"isOpen\"\n #dropdown\n [multiple]=\"multiple\"\n [optionValues]=\"optionValues\"\n [optionsDict]=\"optionsDict\"\n [selection]=\"selection\"\n [width]=\"width\"\n [top]=\"top\"\n [left]=\"left\"\n (toggleSelect)=\"onToggleSelect($event)\"\n (close)=\"onClose($event)\">\n </select-dropdown>\n</div>\n",
styles: [
style_1.DEFAULT_STYLES
],
providers: [
exports.SELECT_VALUE_ACCESSOR
]
},] },
];
/** @nocollapse */
SelectComponent.ctorParameters = [];
SelectComponent.propDecorators = {
'options': [{ type: core_1.Input },],
'theme': [{ type: core_1.Input },],
'multiple': [{ type: core_1.Input },],
'placeholder': [{ type: core_1.Input },],
'allowClear': [{ type: core_1.Input },],
'opened': [{ type: core_1.Output },],
'closed': [{ type: core_1.Output },],
'selected': [{ type: core_1.Output },],
'deselected': [{ type: core_1.Output },],
'container': [{ type: core_1.ViewChild, args: ['container',] },],
'selectionSpan': [{ type: core_1.ViewChild, args: ['selectionSpan',] },],
'dropdown': [{ type: core_1.ViewChild, args: ['dropdown',] },],
'searchInput': [{ type: core_1.ViewChild, args: ['searchInput',] },],
};
return SelectComponent;
}());
exports.SelectComponent = SelectComponent;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc