From f028c05b0ecfc5e120b507eb283fba761e2e93d1 Mon Sep 17 00:00:00 2001 From: Edward Carroll Date: Thu, 1 Sep 2016 17:38:18 +0100 Subject: [PATCH 1/3] Added support for individual component loading --- README.md | 7 ++++++- components/index.ts | 14 +++++++++++++- demo/app/app.module.ts | 4 ++-- .../getting-started/getting-started.page.html | 4 ++++ .../pages/getting-started/getting-started.page.ts | 3 ++- ng2-semantic-ui.ts | 4 +--- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3d5a7ede4..bc086f760 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ import {SuiModule} from 'ng2-semantic-ui/ng2-semantic-ui'; export class AppModule {} ``` +N.B. you can import individual component modules: +```ts +import {SuiCheckboxModule, SuiRatingModule} from 'ng2-semantic-ui/ng2-semantic-ui'; +``` + Now you're good to go! ## Dependencies @@ -56,7 +61,7 @@ The current list of available components with links to their docs is below: * [Rating](http://edcarroll.github.io/ng2-semantic-ui/#/components/rating) * [Search](http://edcarroll.github.io/ng2-semantic-ui/#/components/search) * [Select](http://edcarroll.github.io/ng2-semantic-ui/#/components/select) -* [Tab](http://edcarroll.github.io/ng2-semantic-ui/#/components/tab) +* [Tabs](http://edcarroll.github.io/ng2-semantic-ui/#/components/tabs) ## Development diff --git a/components/index.ts b/components/index.ts index 5f9906bf0..5d666a1bc 100644 --- a/components/index.ts +++ b/components/index.ts @@ -1,8 +1,8 @@ import {NgModule} from "@angular/core"; -import {SuiCollapseModule} from "./collapse/collapse.module"; import {SuiAccordionModule} from "./accordion/accordion.module"; import {SuiCheckboxModule} from "./checkbox/checkbox.module"; +import {SuiCollapseModule} from "./collapse/collapse.module"; import {SuiDimmerModule} from "./dimmer/dimmer.module"; import {SuiDropdownModule} from "./dropdown/dropdown.module"; import {SuiMessageModule} from "./message/message.module"; @@ -28,3 +28,15 @@ import {SuiSelectModule} from "./select/select.module"; ] }) export class SuiModule {} + +export {SuiAccordionModule}; +export {SuiCheckboxModule}; +export {SuiCollapseModule}; +export {SuiDimmerModule}; +export {SuiDropdownModule}; +export {SuiMessageModule}; +export {SuiProgressModule}; +export {SuiRatingModule}; +export {SuiSearchModule}; +export {SuiTabsModule}; +export {SuiSelectModule}; diff --git a/demo/app/app.module.ts b/demo/app/app.module.ts index 10499f50c..1ad820b12 100644 --- a/demo/app/app.module.ts +++ b/demo/app/app.module.ts @@ -53,8 +53,8 @@ import {CodeblockComponent} from './components/codeblock/codeblock.component'; BrowserModule, CommonModule, FormsModule, - routing, - SuiModule + SuiModule, + routing ], providers: [], entryComponents: [AppComponent], diff --git a/demo/app/pages/getting-started/getting-started.page.html b/demo/app/pages/getting-started/getting-started.page.html index e5d13e9dd..9e14998b5 100644 --- a/demo/app/pages/getting-started/getting-started.page.html +++ b/demo/app/pages/getting-started/getting-started.page.html @@ -23,6 +23,10 @@

Installation

+

N.B. you can import individual component modules:

+
+ +

Now you're good to go!

Dependencies

diff --git a/demo/app/pages/getting-started/getting-started.page.ts b/demo/app/pages/getting-started/getting-started.page.ts index 1a03f5084..58cfb0f64 100644 --- a/demo/app/pages/getting-started/getting-started.page.ts +++ b/demo/app/pages/getting-started/getting-started.page.ts @@ -18,5 +18,6 @@ import {SuiModule} from 'ng2-semantic-ui/ng2-semantic-ui'; bootstrap: [AppComponent] }) export class AppModule {} -` +`; + public individualImportCode:string = `import {SuiCheckboxModule, SuiRatingModule} from 'ng2-semantic-ui/ng2-semantic-ui';`; } diff --git a/ng2-semantic-ui.ts b/ng2-semantic-ui.ts index edbb566db..07635cbbc 100644 --- a/ng2-semantic-ui.ts +++ b/ng2-semantic-ui.ts @@ -1,3 +1 @@ -import {SuiModule} from './components'; - -export {SuiModule} from './components'; +export * from './components'; From 7a658ff9b3d0b7a70b1ad7f07e69c263a97f3c7a Mon Sep 17 00:00:00 2001 From: Edward Carroll Date: Thu, 1 Sep 2016 18:41:22 +0100 Subject: [PATCH 2/3] Fixed select bug for rc.6 --- components/select/select.ts | 3 +-- demo/test.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/select/select.ts b/components/select/select.ts index 4c1f9b9bf..8c4cb4b8f 100644 --- a/components/select/select.ts +++ b/components/select/select.ts @@ -14,7 +14,6 @@ import {Subscription} from "rxjs"; @Component({ selector: 'sui-select', exportAs: 'suiSelect', - directives: [SuiSelectMultiLabel], inputs: ['placeholder', 'options', 'optionsField', 'isSearchable', 'searchDelay', 'isDisabled', 'allowMultiple', 'maxSelected', 'optionTemplate'], outputs: ['selectedOptionChange'], host: { @@ -315,4 +314,4 @@ export class SuiSelectValueAccessor extends SuiSearchValueAccessor implements Co } } -export const SUI_SELECT_DIRECTIVES = [SuiSelect, SuiSelectOption, SuiSelectValueAccessor]; +export const SUI_SELECT_DIRECTIVES = [SuiSelect, SuiSelectOption, SuiSelectValueAccessor, SuiSelectMultiLabel]; diff --git a/demo/test.ts b/demo/test.ts index cef85f112..67c7e4868 100644 --- a/demo/test.ts +++ b/demo/test.ts @@ -18,6 +18,7 @@ declare var __karma__: any; __karma__.loaded = function () {}; +//noinspection TypeScriptUnresolvedVariable,TypeScriptUnresolvedFunction Promise.all([ System.import('@angular/core/testing'), System.import('@angular/platform-browser-dynamic/testing') From 201aa77a0c15c3ad94946ad6bc8d2c011fe7545a Mon Sep 17 00:00:00 2001 From: Edward Carroll Date: Thu, 1 Sep 2016 21:57:35 +0100 Subject: [PATCH 3/3] Bumped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39dfbdacb..839c84f79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng2-semantic-ui", - "version": "0.3.1", + "version": "0.3.2", "description": "Angular 2 Semantic UI Components", "repository": { "type": "git",