From b8fa7ae8abe25f0893147d52428cf2fe332f0089 Mon Sep 17 00:00:00 2001 From: syedajafri Date: Wed, 5 Apr 2017 17:20:09 -0400 Subject: [PATCH 01/16] Allowing form control to be passed in as input --- demo/src/app/app.module.ts | 2 ++ demo/src/app/components/select/single-demo.html | 1 + demo/src/app/components/select/single-demo.ts | 2 ++ src/select/select.module.ts | 3 ++- src/select/select.ts | 5 ++++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/demo/src/app/app.module.ts b/demo/src/app/app.module.ts index cf0faed0..7c35a4a0 100644 --- a/demo/src/app/app.module.ts +++ b/demo/src/app/app.module.ts @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; +import { ReactiveFormsModule } from '@angular/forms'; import { TabsModule, ButtonsModule } from 'ng2-bootstrap'; import { SelectModule } from 'ng2-select'; @@ -26,6 +27,7 @@ import { SampleSectionComponent } from './components/sample-section.component'; imports: [ BrowserModule, FormsModule, + ReactiveFormsModule, SelectModule, TabsModule.forRoot(), ButtonsModule.forRoot(), diff --git a/demo/src/app/components/select/single-demo.html b/demo/src/app/components/select/single-demo.html index 7c610da5..3872aad4 100644 --- a/demo/src/app/components/select/single-demo.html +++ b/demo/src/app/components/select/single-demo.html @@ -1,6 +1,7 @@

Select a single city

) { From 7c35725f7c680542833385b4493ff4dd207ca8a9 Mon Sep 17 00:00:00 2001 From: syedajafri Date: Wed, 5 Apr 2017 17:54:17 -0400 Subject: [PATCH 02/16] Enabling and disabling by using formControl instead of [disabled] due to warnings about possible changed after checked' errors --- demo/src/app/components/select/single-demo.ts | 2 +- src/select/select.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/demo/src/app/components/select/single-demo.ts b/demo/src/app/components/select/single-demo.ts index 2cef96db..103a14b6 100644 --- a/demo/src/app/components/select/single-demo.ts +++ b/demo/src/app/components/select/single-demo.ts @@ -20,7 +20,7 @@ export class SingleDemoComponent { private value:any = {}; private _disabledV:string = '0'; private disabled:boolean = false; - private singleControl = new FormControl('', [Validators.required]); + private singleControl:FormControl = new FormControl(); private get disabledV():string { return this._disabledV; diff --git a/src/select/select.ts b/src/select/select.ts index 0de964c7..d579f5d7 100755 --- a/src/select/select.ts +++ b/src/select/select.ts @@ -146,7 +146,6 @@ let styles = ` [formControl]="formControl" (keydown)="inputEvent($event)" (keyup)="inputEvent($event, true)" - [disabled]="disabled" class="form-control ui-select-search" *ngIf="inputMode" placeholder="{{active.length <= 0 ? placeholder : ''}}"> @@ -210,7 +209,6 @@ let styles = ` (keydown)="inputEvent($event)" (keyup)="inputEvent($event, true)" (click)="matchClick($event)" - [disabled]="disabled" autocomplete="false" autocorrect="off" autocapitalize="off" @@ -281,7 +279,10 @@ export class SelectComponent implements OnInit, ControlValueAccessor { public set disabled(value:boolean) { this._disabled = value; if (this._disabled === true) { + this.formControl.disable(); this.hideOptions(); + } else { + this.formControl.enable(); } } From 1b888e6d9c7c33533d2155ba0b376b0d77e17671 Mon Sep 17 00:00:00 2001 From: syedajafri Date: Wed, 5 Apr 2017 18:09:33 -0400 Subject: [PATCH 03/16] upgraded zone.js because of zone.js bug that gave obscure error when I was 'missing' ReactiveFormsModule detailed here: https://github.com/angular/angular-cli/issues/3975 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 02c4ddcd..231f3dc3 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "typescript": "2.1.5", "wallaby-webpack": "0.0.30", "webdriver-manager": "11.1.1", - "zone.js": "0.7.5" + "zone.js": "0.7.6" }, "contributors": [ { From 80681bc8345b3a4fb8adcee0b01d8e17ada57102 Mon Sep 17 00:00:00 2001 From: syedajafri Date: Wed, 5 Apr 2017 18:12:28 -0400 Subject: [PATCH 04/16] Removed formControl from single-demo.html that I was using for debugging purposes --- demo/src/app/components/select/single-demo.html | 1 - demo/src/app/components/select/single-demo.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/demo/src/app/components/select/single-demo.html b/demo/src/app/components/select/single-demo.html index 3872aad4..7c610da5 100644 --- a/demo/src/app/components/select/single-demo.html +++ b/demo/src/app/components/select/single-demo.html @@ -1,7 +1,6 @@

Select a single city

Date: Wed, 5 Apr 2017 18:23:07 -0400 Subject: [PATCH 05/16] Removed ReactiveForms dependency from AppModules --- demo/src/app/app.module.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/demo/src/app/app.module.ts b/demo/src/app/app.module.ts index 7c35a4a0..cf0faed0 100644 --- a/demo/src/app/app.module.ts +++ b/demo/src/app/app.module.ts @@ -2,7 +2,6 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; -import { ReactiveFormsModule } from '@angular/forms'; import { TabsModule, ButtonsModule } from 'ng2-bootstrap'; import { SelectModule } from 'ng2-select'; @@ -27,7 +26,6 @@ import { SampleSectionComponent } from './components/sample-section.component'; imports: [ BrowserModule, FormsModule, - ReactiveFormsModule, SelectModule, TabsModule.forRoot(), ButtonsModule.forRoot(), From c3d587c689c86b135e764c864f9850c12011d64f Mon Sep 17 00:00:00 2001 From: syedajafri Date: Wed, 5 Apr 2017 18:30:39 -0400 Subject: [PATCH 06/16] Removed Validators, and FormControl import from single.component.ts --- demo/src/app/components/select/single-demo.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/demo/src/app/components/select/single-demo.ts b/demo/src/app/components/select/single-demo.ts index 6e73898b..f7200c9c 100644 --- a/demo/src/app/components/select/single-demo.ts +++ b/demo/src/app/components/select/single-demo.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core'; -import { FormControl, Validators } from '@angular/forms'; @Component({ selector: 'single-demo', From 778d40efdd9f7b760f04e92520e9c76a6809c7f9 Mon Sep 17 00:00:00 2001 From: syedajafri Date: Tue, 23 May 2017 15:57:37 -0400 Subject: [PATCH 07/16] Changed references from ng2-select to ng-next-select. Added contributors --- package.json | 34 +++++++++++++++++----------------- src/package.json | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 02c4ddcd..d22b1e16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "ng2-select-base", - "version": "1.2.0", + "name": "ng-next-select-base", + "version": "1.3.0", "private": true, "description": "Angular2 based replacement for select boxes", "scripts": { @@ -22,25 +22,27 @@ "test-coverage": "ng test -sr -cc", "version": "npm run flow.changelog && git add -A" }, - "main": "bundles/ng2-select.umd.js", + "main": "bundles/ng-next-select.umd.js", "module": "index.js", "typings": "index.d.ts", "keywords": [ "angular2", "select", "selectify", - "angularjs" + "angularjs", + "ng2-select", + "ngx-select" ], - "author": "Vyacheslav Chub ", + "author": "Syed Jafri ", "license": "MIT", "repository": { "type": "git", - "url": "git+ssh://git@github.com/valor-software/ng2-select.git" + "url": "git+ssh://git@github.com/psilospore/ng-next-select.git" }, "bugs": { - "url": "https://github.com/valor-software/ng2-select/issues" + "url": "https://github.com/psilospore/ng-next-select/issues" }, - "homepage": "https://github.com/valor-software/ng2-select#readme", + "homepage": "https://github.com//psilospore/ng-next-select#readme", "peerDependencies": { "@angular/common": "^2.3.0", "@angular/core": "^2.3.0" @@ -114,19 +116,17 @@ }, "contributors": [ { - "name": "Vyacheslav Chub", - "email": "vyacheslav.chub@valor-software.com", - "url": "https://github.com/buchslava" + "name": "Syed Jafri", + "email": "syedjafri99+ng-next-select@gmail.com", + "url": "https://github.com/psilospore" }, { - "name": "Dmitriy Shekhovtsov", - "email": "valorkin@gmail.com", - "url": "https://github.com/valorkin" + "name": "Dylan Bostian", + "url": "https://github.com/dboss3" }, { - "name": "Oleksandr Telnov", - "email": "otelnov@gmail.com", - "url": "https://github.com/otelnov" + "name": "Chris Williams", + "url": "https://github.com/howthatdo" } ] } diff --git a/src/package.json b/src/package.json index 216af652..3e963f71 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { - "name": "ng2-select", - "version": "1.2.0", + "name": "ng-next-select", + "version": "1.3.0", "peerDependencies": { "@angular/common": "*", "@angular/core": "*" From e29362775d44401e0bfaa10981eff7bc97589c02 Mon Sep 17 00:00:00 2001 From: syedajafri Date: Wed, 24 May 2017 14:01:44 -0400 Subject: [PATCH 08/16] Added more info in readme --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 638b2172..ade141df 100755 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ -# Native UI Select Angular component ([demo](http://valor-software.com/ng2-select/)) -## ng2-select [![npm version](https://badge.fury.io/js/ng2-select.svg)](http://badge.fury.io/js/ng2-select) [![npm downloads](https://img.shields.io/npm/dm/ng2-select.svg)](https://npmjs.org/ng2-select)[![slack](https://ngx-slack.herokuapp.com/badge.svg)](https://ngx-slack.herokuapp.com) +# Native UI Select Angular component -[![Angular 2 Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://github.com/mgechev/angular2-style-guide) -[![Build Status](https://travis-ci.org/valor-software/ng2-select.svg?branch=development)](https://travis-ci.org/valor-software/ng2-select) +## Description + +This is a library based on a fork from [ng2-select](https://github.com/valor-software/ng2-select). +We would love any PRs if you have enhancements in mind. We intend on maintaining this library for a while and in the event that our organization does not need this +library anymore and/or we become too busy to maintain it we are open to adding other co-maintainers. ## Quick start -1. A recommended way to install ***ng2-select*** is through [npm](https://www.npmjs.com/search?q=ng2-select) package manager using the following command: +1. A recommended way to install ***ng-next-select*** is through [npm](https://www.npmjs.com/search?q=ng-next-select) package manager using the following command: `npm i ng2-select --save` @@ -43,11 +45,11 @@ Please follow this guidelines when reporting bugs and feature requests: -1. Use [GitHub Issues](https://github.com/valor-software/ng2-select/issues) board to report bugs and feature requests (not our email address) +1. Use [GitHub Issues](https://github.com/psilospore/ng-next-select/issues) board to report bugs and feature requests (not our email address) 2. Please **always** write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it. Thanks for understanding! ### License -The MIT License (see the [LICENSE](https://github.com/valor-software/ng2-select/blob/master/LICENSE) file for the full text) +The MIT License (see the [LICENSE](https://github.com/psilospore/ng-next-select/blob/master/LICENSE) file for the full text) From e2dc056d19d2b7b60a960701b4818a13951e6281 Mon Sep 17 00:00:00 2001 From: syedajafri Date: Wed, 24 May 2017 16:38:13 -0400 Subject: [PATCH 09/16] Added references to readme --- README.md | 5 +---- package.json | 5 +++-- src/package.json | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ade141df..1d99e709 100755 --- a/README.md +++ b/README.md @@ -10,13 +10,10 @@ library anymore and/or we become too busy to maintain it we are open to adding o 1. A recommended way to install ***ng-next-select*** is through [npm](https://www.npmjs.com/search?q=ng-next-select) package manager using the following command: - `npm i ng2-select --save` + `npm i ng-next-select --save` 2. Include `ng2-select.css` in your project -3. More information regarding of using ***ng2-select*** is located in - [demo](http://valor-software.github.io/ng2-select/) and [demo sources](https://github.com/valor-software/ng2-select/tree/master/demo). - ## API ### Properties diff --git a/package.json b/package.json index d22b1e16..dbe0fefb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-next-select-base", - "version": "1.3.0", + "version": "1.3.1", "private": true, "description": "Angular2 based replacement for select boxes", "scripts": { @@ -128,5 +128,6 @@ "name": "Chris Williams", "url": "https://github.com/howthatdo" } - ] + ], + "readme": "README.md" } diff --git a/src/package.json b/src/package.json index 3e963f71..52074c9c 100644 --- a/src/package.json +++ b/src/package.json @@ -1,8 +1,9 @@ { "name": "ng-next-select", - "version": "1.3.0", + "version": "1.3.1", "peerDependencies": { "@angular/common": "*", "@angular/core": "*" - } + }, + "readme": "../README.md" } From 15ba3bd7a95943a8b8086b59222a5710ddd30dee Mon Sep 17 00:00:00 2001 From: syedajafri Date: Thu, 25 May 2017 16:46:39 -0400 Subject: [PATCH 10/16] Renamed additional references from ng2-select to ng-next-select. Included migration section in readme --- README.md | 9 ++++++++- angular-cli.json | 2 +- demo/src/app/app.component.ts | 2 +- demo/src/app/app.module.ts | 2 +- demo/src/doc.md | 2 +- demo/src/index.html | 2 +- src/{ng2-select.ts => ng-next-select.ts} | 0 src/spec/select-pipes.spec.ts | 4 ++-- src/tsconfig.json | 2 +- 9 files changed, 16 insertions(+), 9 deletions(-) rename src/{ng2-select.ts => ng-next-select.ts} (100%) diff --git a/README.md b/README.md index 1d99e709..f3e07791 100755 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ library anymore and/or we become too busy to maintain it we are open to adding o `npm i ng-next-select --save` -2. Include `ng2-select.css` in your project +2. Include `ng-next-select.css` in your project ## API @@ -47,6 +47,13 @@ Please follow this guidelines when reporting bugs and feature requests: Thanks for understanding! +# Migration from Valor's ng2-select + +1. Import our library in your package.json instead of ng2-select +2. Rename ng2-select.css to ng-next-select.css + +TODO + ### License The MIT License (see the [LICENSE](https://github.com/psilospore/ng-next-select/blob/master/LICENSE) file for the full text) diff --git a/angular-cli.json b/angular-cli.json index 77d77115..1563f9b4 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -1,6 +1,6 @@ { "project": { - "name": "ng2-select" + "name": "ng-next-select" }, "apps": [ { diff --git a/demo/src/app/app.component.ts b/demo/src/app/app.component.ts index dafe080a..be87cb4a 100644 --- a/demo/src/app/app.component.ts +++ b/demo/src/app/app.component.ts @@ -7,7 +7,7 @@ let gettingStarted = require('html-loader!markdown-loader!../getting-started.md' template: `
-

ng2-select

+

ng-next-select

Native Angular2 component for Select

View on GitHub
diff --git a/demo/src/app/app.module.ts b/demo/src/app/app.module.ts index cf0faed0..d00407da 100644 --- a/demo/src/app/app.module.ts +++ b/demo/src/app/app.module.ts @@ -4,7 +4,7 @@ import { BrowserModule } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { TabsModule, ButtonsModule } from 'ng2-bootstrap'; -import { SelectModule } from 'ng2-select'; +import { SelectModule } from 'ng-next-select'; import { AppComponent } from './app.component'; import { SelectSectionComponent } from './components/select-section'; import { ChildrenDemoComponent } from './components/select/children-demo'; diff --git a/demo/src/doc.md b/demo/src/doc.md index 5c1c9fe2..9cf52e62 100644 --- a/demo/src/doc.md +++ b/demo/src/doc.md @@ -1,6 +1,6 @@ ### Usage ```typescript -import {SelectModule} from 'ng2-select'; +import {SelectModule} from 'ng-next-select'; ``` ### Annotations diff --git a/demo/src/index.html b/demo/src/index.html index a7333e41..0cb1f781 100644 --- a/demo/src/index.html +++ b/demo/src/index.html @@ -14,7 +14,7 @@ - +