Skip to content

Commit 8e1a462

Browse files
authored
Merge pull request #10 from edcarroll/develop
v0.3.0 into Master
2 parents 347aab6 + 75f8049 commit 8e1a462

File tree

976 files changed

+2955
-133669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

976 files changed

+2955
-133669
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 4
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
max_line_length = 0
14+
trim_trailing_whitespace = false

.gitignore

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
1-
# Node
2-
node_modules
3-
npm-debug.log
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
42

5-
# TypeScript
6-
*.js
7-
!make.js
8-
!demo/make-demo.js
9-
*.map
10-
*.d.ts
11-
typings
12-
bundles
13-
!demo/js/**/*.js
14-
demo/js/**/*.json
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
1510

16-
# JetBrains
17-
.idea
11+
# IDEs and editors
12+
/.idea
1813
.project
19-
.settings
14+
.classpath
15+
*.launch
16+
.settings/
2017

21-
# Windows
22-
Thumbs.db
23-
Desktop.ini
18+
# misc
19+
/.sass-cache
20+
/connect.lock
21+
/coverage/*
22+
/libpeerconnection.log
23+
npm-debug.log
24+
testem.log
25+
/typings
2426

25-
# Mac
27+
# e2e
28+
/e2e/*.js
29+
/e2e/*.map
30+
31+
#System Files
2632
.DS_Store
27-
**/.DS_Store
33+
Thumbs.db
34+
35+
# TypeScript
36+
*.js
37+
*.map
38+
*.d.ts

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ npm-debug.log
77
# *.js
88
# *.map
99
# *.d.ts
10-
typings
1110
demo
1211

1312
# JetBrains
@@ -21,4 +20,4 @@ Desktop.ini
2120

2221
# Mac
2322
.DS_Store
24-
**/.DS_Store
23+
**/.DS_Store

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- '4.2.1'
4+
- '6'

README.md

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,39 @@ Semantic UI Angular 2 Integrations, written in pure AngularJS - **no JQuery requ
99
## Installation
1010

1111
To install this library, run:
12-
1312
```bash
1413
$ npm install ng2-semantic-ui --save
1514
```
1615

17-
Add a reference to your `index.html` file: (also ensure you have a reference to the Semantic UI CSS file)
18-
16+
Next include the Semantic UI CSS file in your `index.html` (you can include a manually compiled one if you use themes):
1917
```html
20-
<script src="node_modules/ng2-semantic-ui/bundles/ng2-semantic-ui.min.js"></script>
18+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/semantic.min.css">
2119
```
2220

23-
Start using the directives:
21+
Once installed you need to import the main module:
22+
```ts
23+
import {SuiModule} from 'ng2-semantic-ui';
24+
```
2425

26+
Finally import the main module into your application module:
2527
```ts
26-
import {DIRECTIVES} from `ng2-semantic-ui/ng2-semantic-ui';
28+
import {SuiModule} from 'ng2-semantic-ui';
29+
30+
@NgModule({
31+
declarations: [AppComponent, ...],
32+
imports: [SuiModule, ...],
33+
bootstrap: [AppComponent]
34+
})
35+
export class AppModule {}
2736
```
2837

38+
Now you're good to go!
39+
40+
## Dependencies
41+
42+
* [Angular 2](https://angular.io) (2.0.0-rc.5)
43+
* [Semantic UI CSS](http://semantic-ui.com/) (jQuery is **not** required)
44+
2945
## Components
3046

3147
The current list of available components with links to their docs is below:
@@ -39,54 +55,21 @@ The current list of available components with links to their docs is below:
3955
* [Progress](http://edcarroll.github.io/ng2-semantic-ui/#/components/progress)
4056
* [Rating](http://edcarroll.github.io/ng2-semantic-ui/#/components/rating)
4157
* [Search](http://edcarroll.github.io/ng2-semantic-ui/#/components/search)
58+
* [Select](http://edcarroll.github.io/ng2-semantic-ui/#/components/select)
4259
* [Tab](http://edcarroll.github.io/ng2-semantic-ui/#/components/tab)
4360

44-
## Quick start (from scratch)
45-
46-
Clone the [angular2-quickstart](https://github.com/valor-software/angular2-quickstart) repository, and set everything up.
47-
48-
Add the following lines to your `index.html`:
49-
```html
50-
<script src="node_modules/ng2-semantic-ui/bundles/ng2-semantic-ui.min.js"></script>
51-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.css">
52-
```
53-
54-
Update your `app.component.ts` to be the following:
55-
56-
```ts
57-
import {Component} from 'angular2/core';
58-
import {CHECKBOX_DIRECTIVES} from 'ng2-semantic-ui/ng2-semantic-ui';
59-
60-
@Component({
61-
selector: 'my-app',
62-
directives: [CHECKBOX_DIRECTIVES],
63-
template: `
64-
<sui-checkbox>Checkbox example</sui-checkbox>
65-
`
66-
})
67-
export class AppComponent {}
68-
```
69-
70-
And you're good to go!
71-
7261
## Development
7362

7463
To generate all library `*.js`, `*.js.map` and `*.d.ts` files:
7564

7665
```bash
77-
$ npm run tsc
78-
```
79-
80-
To run the demo app:
81-
```bash
82-
$ npm run demo
66+
$ npm run compile
67+
# use compile:w to watch for changes
8368
```
8469

85-
To compile the demo app without running it:
86-
70+
To run the demo app (you must have [Angular-CLI](https://github.com/angular/angular-cli) installed):
8771
```bash
88-
$ npm run tsc-demo
89-
# use tsc-demo:w to watch for changes
72+
$ ng serve
9073
```
9174

9275
## License

angular-cli.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"project": {
3+
"version": "1.0.0-beta.11-webpack.2",
4+
"name": "ng2-semantic-ui"
5+
},
6+
"apps": [
7+
{
8+
"main": "demo/main.ts",
9+
"tsconfig": "demo/tsconfig.json",
10+
"mobile": false
11+
}
12+
],
13+
"addons": [],
14+
"packages": [],
15+
"e2e": {
16+
"protractor": {
17+
"config": "demo/config/protractor.conf.js"
18+
}
19+
},
20+
"test": {
21+
"karma": {
22+
"config": "demo/config/karma.conf.js"
23+
}
24+
},
25+
"defaults": {
26+
"prefix": "demo",
27+
"sourceDir": "demo",
28+
"styleExt": "css",
29+
"prefixInterfaces": false,
30+
"lazyRoutePrefix": "+"
31+
}
32+
}

components/accordion.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/accordion/accordion-panel.component.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import {Component, Input, Output, EventEmitter} from '@angular/core';
2+
import {SuiAccordionService} from "./accordion.service";
3+
4+
@Component({
5+
selector: 'sui-accordion-panel',
6+
exportAs: 'suiAccordionPanel',
7+
template: `
8+
<div class="title" [class.active]="isOpen" (click)="toggleOpen($event)">
9+
<ng-content select="[title]"></ng-content>
10+
</div>
11+
<div [suiCollapse]="!isOpen">
12+
<div class="content" [class.active]="isOpen">
13+
<ng-content select="[content]"></ng-content>
14+
</div>
15+
</div>
16+
`,
17+
styles: [`
18+
.content {
19+
padding: .5em 0 1em
20+
}
21+
22+
:host:last-child .content {
23+
padding-bottom: 0
24+
}
25+
`]
26+
})
27+
export class SuiAccordionPanel {
28+
private _service:SuiAccordionService;
29+
public set service(service:SuiAccordionService) {
30+
this._service = service;
31+
}
32+
33+
@Input() public isDisabled:boolean;
34+
35+
@Input()
36+
public get isOpen():boolean {
37+
return this._isOpen;
38+
}
39+
@Output() public isOpenChange:EventEmitter<boolean> = new EventEmitter<boolean>(false);
40+
41+
public set isOpen(value:boolean) {
42+
this._isOpen = value;
43+
if (value && this._service) {
44+
this._service.closeOtherPanels(this);
45+
}
46+
this.isOpenChange.emit(this._isOpen);
47+
}
48+
49+
private _isOpen:boolean = false;
50+
51+
public toggleOpen(event:MouseEvent):any {
52+
event.preventDefault();
53+
if (!this.isDisabled) {
54+
this.isOpen = !this.isOpen;
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)