Skip to content

Commit a3b597c

Browse files
author
lo kesh
committed
feat: repo initialized
1 parent ad3fadc commit a3b597c

17 files changed

+6321
-38
lines changed

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
sudo: required
2+
dist: trusty
3+
addons:
4+
apt:
5+
sources:
6+
- google-chrome
7+
packages:
8+
- google-chrome-stable
9+
language: node_js
10+
node_js:
11+
- node
12+
before_script:
13+
- export DISPLAY=:99.0
14+
- sh -e /etc/init.d/xvfb start
15+
- sleep 3
16+
cache:
17+
yarn: true
18+
notifications:
19+
email: false
20+
after_success:
21+
- npm run semantic-release
22+
- npm run build
23+
- npm run ngh
24+
branches:
25+
except:
26+
- /^v\d+\.\d+\.\d+$/

package.json

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
2-
"name": "ngx-choosy",
3-
"version": "0.0.0",
2+
"name": "@nglibrary/ngx-choosy-documentation",
3+
"version": "0.0.0-development",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
77
"start": "ng serve",
8-
"build": "ng build",
9-
"test": "ng test",
8+
"build": "ng build --prod --base-href \"https://nglibrary.github.io/ngx-choosy-documentation/\"",
9+
"test-app": "ng test",
10+
"test": "echo \"No test specified\" && exit 0",
1011
"lint": "ng lint",
11-
"e2e": "ng e2e"
12+
"e2e": "ng e2e",
13+
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
14+
"ngh": "ngh --repo=https://[email protected]/nglibrary/ngx-choosy-documentation.git"
1215
},
13-
"private": true,
1416
"dependencies": {
1517
"@angular/animations": "^4.0.0",
1618
"@angular/common": "^4.0.0",
@@ -21,28 +23,38 @@
2123
"@angular/platform-browser": "^4.0.0",
2224
"@angular/platform-browser-dynamic": "^4.0.0",
2325
"@angular/router": "^4.0.0",
26+
"@nglibrary/ngx-choosy": "^1.0.0",
27+
"bootstrap-sass": "^3.3.7",
28+
"classlist.js": "^1.1.20150312",
2429
"core-js": "^2.4.1",
2530
"rxjs": "^5.1.0",
2631
"zone.js": "^0.8.4"
2732
},
2833
"devDependencies": {
29-
"@angular/cli": "1.1.3",
34+
"@angular/cli": "1.2.2",
3035
"@angular/compiler-cli": "^4.0.0",
3136
"@angular/language-service": "^4.0.0",
32-
"@types/jasmine": "2.5.45",
33-
"@types/node": "~6.0.60",
34-
"codelyzer": "~3.0.1",
37+
"@types/jasmine": "2.5.53",
38+
"@types/node": "~8.0.13",
39+
"angular-cli-ghpages": "^0.5.1",
40+
"codelyzer": "~3.1.2",
3541
"jasmine-core": "~2.6.2",
3642
"jasmine-spec-reporter": "~4.1.0",
3743
"karma": "~1.7.0",
38-
"karma-chrome-launcher": "~2.1.1",
44+
"karma-chrome-launcher": "~2.2.0",
3945
"karma-cli": "~1.0.1",
4046
"karma-coverage-istanbul-reporter": "^1.2.1",
4147
"karma-jasmine": "~1.1.0",
4248
"karma-jasmine-html-reporter": "^0.2.2",
49+
"ng-validators": "^0.2.1",
4350
"protractor": "~5.1.2",
44-
"ts-node": "~3.0.4",
45-
"tslint": "~5.3.2",
46-
"typescript": "~2.3.3"
51+
"ts-node": "~3.2.0",
52+
"tslint": "~5.5.0",
53+
"typescript": "~2.4.1",
54+
"semantic-release": "^6.3.6"
55+
},
56+
"repository": {
57+
"type": "git",
58+
"url": "https://github.com/nglibrary/ngx-choosy-documentation.git"
4759
}
4860
}

src/app/app.component.html

Lines changed: 91 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,93 @@
1-
<!--The whole content below can be removed with the new code.-->
2-
<div style="text-align:center">
3-
<h1>
4-
Welcome to {{title}}!!
5-
</h1>
6-
<img width="300" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJz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9zdmc+DQo=" />
1+
<div class="top">
2+
<nav class="navbar navbar-default" role="navigation">
3+
<!-- Brand and toggle get grouped for better mobile display -->
4+
<div class="navbar-header">
5+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
6+
<span class="sr-only">Toggle navigation</span>
7+
<span class="icon-bar"></span>
8+
<span class="icon-bar"></span>
9+
<span class="icon-bar"></span>
10+
</button>
11+
<a class="navbar-brand" href="#">@nglibrary/ngx-choosy</a>
12+
</div>
13+
14+
<!-- Collect the nav links, forms, and other content for toggling -->
15+
<div class="collapse navbar-collapse navbar-ex1-collapse">
16+
<ul class="nav navbar-nav navbar-right">
17+
<li><a href="#">Documentation</a></li>
18+
<li><a href="#">Issues?</a></li>
19+
<li><a href="#">Twitter</a></li>
20+
</ul>
21+
</div>
22+
<!-- /.navbar-collapse -->
23+
</nav>
24+
25+
<div class="container" id="mass">
26+
<h1>ngx-choosy</h1>
27+
<p>A friendly selectbox and dropdown directive for Angular 4+</p>
28+
<div class="actions">
29+
<button class="btn btn-primary"> Github</button>
30+
<button class="btn btn-default">Documentation</button>
31+
</div>
32+
</div>
33+
</div>
34+
35+
<div class="wrapper">
36+
<div class="container">
37+
<div class="row">
38+
<div class="col-md-3">
39+
40+
<ul class="list-group">
41+
<li class="list-group-item" *ngFor="let item of menu" [ngClass]="{'current':item.name=='Demo'}">
42+
<span>{{item.name}}</span> <i data-feather="chevron-right"></i></li>
43+
</ul>
44+
45+
</div>
46+
<div class="col-md-9">
47+
<div id="content">
48+
<h1>Basic demo</h1>
49+
<p>
50+
<strong>ngx-choosy</strong> turns any input element in to a dropdown select box. Thus, it does not apply any
51+
styles to your input. It also gives a freedom to style your input fields to your needs.
52+
</p>
53+
<br/>
54+
<div class="example">
55+
<h2><i data-feather="play"></i> Single select dropdown</h2>
56+
<div class="row">
57+
<div class="col-md-6">
58+
<div class="form-group">
59+
<label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label>
60+
<input type="text" placeholder="choose" class="form-control" choosySingleSelect [options]="universities" />
61+
</div>
62+
</div>
63+
</div>
64+
</div>
65+
66+
<div class="example">
67+
<h2><i data-feather="play"></i> Custom template</h2>
68+
<div class="row">
69+
<div class="col-md-6">
70+
<div class="form-group">
71+
<label class="sr-only" for="exampleInputAmount">Colors</label>
72+
<div class="input-group">
73+
<input type="text" placeholder="choose" class="form-control" choosySingleSelect [options]="addresses" [config]="{displayValue:'street',search:{keys:['value.street','value.country']}}"
74+
[template]="add" (isOpen)="foobar=$event" (choosy)="addressEvent($event)" />
75+
<div class="input-group-addon" (click)="openAddressDd($event)">
76+
<i class="fa" [ngClass]="{'fa-angle-up':foobar,'fa-angle-down':!foobar}"></i>
77+
</div>
78+
</div>
79+
</div>
80+
</div>
81+
</div>
82+
</div>
83+
</div>
84+
</div>
85+
</div>
86+
</div>
787
</div>
8-
<h2>Here are some links to help you start: </h2>
9-
<ul>
10-
<li>
11-
<h2><a target="_blank" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12-
</li>
13-
<li>
14-
<h2><a target="_blank" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15-
</li>
16-
<li>
17-
<h2><a target="_blank" href="http://angularjs.blogspot.ca/">Angular blog</a></h2>
18-
</li>
19-
</ul>
2088

89+
90+
<ng-template let-item #add>
91+
<div><strong>{{item.street}}</strong></div>
92+
<div>{{item.city}} &middot; {{item.country}}</div>
93+
</ng-template>

src/app/app.component.ts

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
11
import { Component } from '@angular/core';
2+
import * as f from 'feather-icons';
3+
import {
4+
addresses,
5+
colors,
6+
products,
7+
universities,
8+
users
9+
} from './data';
10+
211

312
@Component({
413
selector: 'app-root',
514
templateUrl: './app.component.html',
615
styleUrls: ['./app.component.scss']
716
})
817
export class AppComponent {
9-
title = 'app';
18+
addresses: any[];
19+
colors: any[];
20+
products: any[];
21+
universities: any[];
22+
users: any[];
23+
24+
ex5Event;
25+
addEv;
26+
es5IsOpen = false;
27+
fthr = f;
28+
menu = [];
29+
ngOnInit() {
30+
this.addresses = addresses;
31+
this.colors = colors;
32+
this.products = products;
33+
this.universities = universities;
34+
this.users = users;
35+
this.menu = [
36+
{ name: 'Demo' },
37+
{ name: 'Installation' },
38+
{ name: 'Single select' },
39+
{ name: 'Multi select' },
40+
{ name: 'Button dropdown' },
41+
{ name: 'Autocomplete' },
42+
{ name: 'Configuration' },
43+
{ name: 'Changelog' }
44+
];
45+
46+
}
47+
ngAfterViewInit() {
48+
49+
this.fthr.replace();
50+
}
51+
ex5(event) {
52+
this.ex5Event = event;
53+
}
54+
addressEvent(event) {
55+
this.addEv = event;
56+
}
57+
openAddressDd($event) {
58+
console.log('open', this.addEv);
59+
this.addEv.actions.toggle();
60+
}
1061
}

src/app/app.module.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { BrowserModule } from '@angular/platform-browser';
21
import { NgModule } from '@angular/core';
3-
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { NgxChoosyModule } from '@nglibrary/ngx-choosy';
44
import { AppComponent } from './app.component';
55

66
@NgModule({
77
declarations: [
88
AppComponent
99
],
1010
imports: [
11-
BrowserModule
11+
BrowserModule,
12+
NgxChoosyModule
1213
],
1314
providers: [],
1415
bootstrap: [AppComponent]

0 commit comments

Comments
 (0)