From fb21995abdf01d4da1b464a21ab1c7c80bbd3ac4 Mon Sep 17 00:00:00 2001 From: Dmitriy Shekhovtsov Date: Fri, 4 Nov 2016 13:56:23 +0200 Subject: [PATCH 01/53] initial commit: removed obsolet dependecies --- .ng2-config.js => old-conf/.ng2-config.js | 0 gulpfile.js => old-conf/gulpfile.js | 0 karma.conf.js => old-conf/karma.conf.js | 0 protractor.conf.js => old-conf/protractor.conf.js | 0 spec-bundle.js => old-conf/spec-bundle.js | 0 webpack.config.js => old-conf/webpack.config.js | 0 package.json | 9 +-------- 7 files changed, 1 insertion(+), 8 deletions(-) rename .ng2-config.js => old-conf/.ng2-config.js (100%) rename gulpfile.js => old-conf/gulpfile.js (100%) rename karma.conf.js => old-conf/karma.conf.js (100%) rename protractor.conf.js => old-conf/protractor.conf.js (100%) rename spec-bundle.js => old-conf/spec-bundle.js (100%) rename webpack.config.js => old-conf/webpack.config.js (100%) diff --git a/.ng2-config.js b/old-conf/.ng2-config.js similarity index 100% rename from .ng2-config.js rename to old-conf/.ng2-config.js diff --git a/gulpfile.js b/old-conf/gulpfile.js similarity index 100% rename from gulpfile.js rename to old-conf/gulpfile.js diff --git a/karma.conf.js b/old-conf/karma.conf.js similarity index 100% rename from karma.conf.js rename to old-conf/karma.conf.js diff --git a/protractor.conf.js b/old-conf/protractor.conf.js similarity index 100% rename from protractor.conf.js rename to old-conf/protractor.conf.js diff --git a/spec-bundle.js b/old-conf/spec-bundle.js similarity index 100% rename from spec-bundle.js rename to old-conf/spec-bundle.js diff --git a/webpack.config.js b/old-conf/webpack.config.js similarity index 100% rename from webpack.config.js rename to old-conf/webpack.config.js diff --git a/package.json b/package.json index 7335ca198d..4658c24e9a 100644 --- a/package.json +++ b/package.json @@ -79,12 +79,7 @@ "cpy-cli": "1.0.1", "cross-env": "3.1.2", "del-cli": "0.2.0", - "es6-promise": "4.0.5", - "es6-shim": "0.35.1", - "es7-reflect-metadata": "1.6.0", "eslint-config-valorsoft": "0.1.0", - "file-loader": "0.9.0", - "gh-pages": "0.11.0", "gitignore-to-glob": "0.2.1", "google-code-prettify": "1.0.5", "gulp": "3.9.1", @@ -94,7 +89,6 @@ "jasmine-data-provider": "2.2.0", "lite-server": "2.2.2", "marked": "0.3.6", - "ng2-webpack-config": "0.0.5", "pre-commit": "1.1.3", "reflect-metadata": "0.1.8", "require-dir": "0.3.1", @@ -102,8 +96,7 @@ "systemjs-builder": "0.15.32", "tslint-config-valorsoft": "1.1.1", "typedoc": "0.5.0", - "typescript": "2.0.6", - "protractor": "4.0.9", + "typescript": "2.0.7", "wallaby-webpack": "0.0.26", "zone.js": "0.6.25" } From f42ce1878f3e390b8926d3e606b0cbdff067708f Mon Sep 17 00:00:00 2001 From: Dmitriy Shekhovtsov Date: Fri, 4 Nov 2016 15:23:48 +0200 Subject: [PATCH 02/53] moving files --- .gitignore | 30 ++++-- angular-cli.json | 59 ++++++++++++ .../getting-started/getting-started.ts | 24 ----- demo/custom-typings.d.ts | 6 -- demo/demo.template.html | 6 -- demo/polyfills.ts | 28 ------ demo/router.config.ts | 91 ------------------ demo/vendor.ts | 24 ----- e2e/app.e2e-spec.ts | 14 +++ e2e/app.po.ts | 11 +++ e2e/tsconfig.json | 16 +++ karma.conf.js | 40 ++++++++ ng-cli-src/assets/.gitkeep | 0 {demo => ng-cli-src}/favicon.ico | Bin ng-cli-src/index.html | 14 +++ package.json | 38 +++++--- protractor.conf.js | 32 ++++++ src/app/app.component.html | 6 ++ src/app/app.component.spec.ts | 33 +++++++ {demo => src/app}/app.component.ts | 11 +-- src/app/app.module.ts | 25 +++++ src/app/app.routing.ts | 91 ++++++++++++++++++ .../app}/getting-started/dependencies.md | 0 .../getting-started.component.js | 32 ++++++ .../getting-started.component.ts | 21 ++++ .../getting-started.template.html | 0 .../app}/getting-started/installation.md | 0 .../getting-started/reading-documentation.md | 0 src/app/index.ts | 2 + {demo => src}/assets/css/glyphicons.css | 0 .../assets/css/prettify-angulario.css | 0 {demo => src}/assets/css/style.css | 0 .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin {demo => src}/assets/images/active.svg | 0 {demo => src}/assets/images/anactive.svg | 0 {demo => src}/assets/images/bar-doc.png | Bin {demo => src}/assets/images/border-dot.png | Bin {demo => src}/assets/images/link-doc.png | Bin {demo => src}/assets/images/logo.png | Bin {demo => src}/assets/images/menu-left.svg | 0 {demo => src}/assets/images/menu-right.svg | 0 {demo => src}/assets/images/repa-down.png | Bin {demo => src}/assets/images/repa-up.png | Bin {demo => src}/assets/images/search-doc.png | Bin {demo => src}/assets/js/prettify.min.js | 0 src/environments/environment.prod.ts | 3 + src/environments/environment.ts | 8 ++ src/favicon.ico | Bin 0 -> 5430 bytes {demo => src}/index.html | 4 +- src/main.ts | 12 +++ src/polyfills.ts | 19 ++++ src/styles.css | 1 + src/test.ts | 34 +++++++ src/tsconfig.json | 21 ++++ src/typings.d.ts | 10 ++ tsconfig.json | 28 ------ tsconfig.publish.json | 1 + 61 files changed, 562 insertions(+), 233 deletions(-) create mode 100644 angular-cli.json delete mode 100644 demo/components/getting-started/getting-started.ts delete mode 100644 demo/custom-typings.d.ts delete mode 100644 demo/demo.template.html delete mode 100644 demo/polyfills.ts delete mode 100644 demo/router.config.ts delete mode 100644 demo/vendor.ts create mode 100644 e2e/app.e2e-spec.ts create mode 100644 e2e/app.po.ts create mode 100644 e2e/tsconfig.json create mode 100644 karma.conf.js create mode 100644 ng-cli-src/assets/.gitkeep rename {demo => ng-cli-src}/favicon.ico (100%) create mode 100644 ng-cli-src/index.html create mode 100644 protractor.conf.js create mode 100644 src/app/app.component.html create mode 100644 src/app/app.component.spec.ts rename {demo => src/app}/app.component.ts (80%) create mode 100644 src/app/app.module.ts create mode 100644 src/app/app.routing.ts rename {demo/components => src/app}/getting-started/dependencies.md (100%) create mode 100644 src/app/getting-started/getting-started.component.js create mode 100644 src/app/getting-started/getting-started.component.ts rename {demo/components => src/app}/getting-started/getting-started.template.html (100%) rename {demo/components => src/app}/getting-started/installation.md (100%) rename {demo/components => src/app}/getting-started/reading-documentation.md (100%) create mode 100644 src/app/index.ts rename {demo => src}/assets/css/glyphicons.css (100%) rename {demo => src}/assets/css/prettify-angulario.css (100%) rename {demo => src}/assets/css/style.css (100%) rename {demo => src}/assets/fonts/glyphicons-halflings-regular.eot (100%) rename {demo => src}/assets/fonts/glyphicons-halflings-regular.svg (100%) rename {demo => src}/assets/fonts/glyphicons-halflings-regular.ttf (100%) rename {demo => src}/assets/fonts/glyphicons-halflings-regular.woff (100%) rename {demo => src}/assets/fonts/glyphicons-halflings-regular.woff2 (100%) rename {demo => src}/assets/images/active.svg (100%) rename {demo => src}/assets/images/anactive.svg (100%) rename {demo => src}/assets/images/bar-doc.png (100%) rename {demo => src}/assets/images/border-dot.png (100%) rename {demo => src}/assets/images/link-doc.png (100%) rename {demo => src}/assets/images/logo.png (100%) rename {demo => src}/assets/images/menu-left.svg (100%) rename {demo => src}/assets/images/menu-right.svg (100%) rename {demo => src}/assets/images/repa-down.png (100%) rename {demo => src}/assets/images/repa-up.png (100%) rename {demo => src}/assets/images/search-doc.png (100%) rename {demo => src}/assets/js/prettify.min.js (100%) create mode 100644 src/environments/environment.prod.ts create mode 100644 src/environments/environment.ts create mode 100644 src/favicon.ico rename {demo => src}/index.html (98%) create mode 100644 src/main.ts create mode 100644 src/polyfills.ts create mode 100644 src/styles.css create mode 100644 src/test.ts create mode 100644 src/tsconfig.json create mode 100644 src/typings.d.ts delete mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index e81e71b425..00e7bd2490 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,29 @@ # Dependency directory # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git /node_modules -npm-debug.log +/bower_components -# type script artifacts -/typings +# IDEs and editors +/.idea +/.vscode +.project +.classpath +*.launch +.settings/ -# WebStorm -.idea +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log +/typings # ignore build and dist for now /bundles /demo-build /dist -/coverage /ts /doc @@ -35,3 +45,11 @@ factories /**/*.metadata.json /**/*.ngfactory.ts + +# e2e +/e2e/*.js +/e2e/*.map + +#System Files +.DS_Store +Thumbs.db diff --git a/angular-cli.json b/angular-cli.json new file mode 100644 index 0000000000..687628e2ec --- /dev/null +++ b/angular-cli.json @@ -0,0 +1,59 @@ +{ + "project": { + "version": "1.0.0-beta.19-3", + "name": "ng2-bootstrap" + }, + "apps": [ + { + "root": "src", + "outDir": "demo/dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "test": "test.ts", + "tsconfig": "tsconfig.json", + "prefix": "app", + "mobile": false, + "styles": [ + "styles.css" + ], + "scripts": [], + "environments": { + "source": "environments/environment.ts", + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "addons": [], + "packages": [], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "css", + "prefixInterfaces": false, + "inline": { + "style": false, + "template": false + }, + "spec": { + "class": false, + "component": true, + "directive": true, + "module": false, + "pipe": true, + "service": true + } + } +} diff --git a/demo/components/getting-started/getting-started.ts b/demo/components/getting-started/getting-started.ts deleted file mode 100644 index 1e27fc200b..0000000000 --- a/demo/components/getting-started/getting-started.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component } from '@angular/core'; - -let name = `Native Angular 2 directives for bootstrap`; - -// webpack html imports -let template = require('./getting-started.template.html'); - -let desc = ` -`; -let dependencies = require('./dependencies.md'); -let installation = require('./installation.md'); -let readingDocumentation = require('./reading-documentation.md'); - -@Component({ - selector: 'accordion-section', - template: template -}) -export class GettingStartedSectionComponent { - public name:string = name; - public desc:string = desc; - public dependencies:string = dependencies; - public installation:string = installation; - public readingDocumentation:string = readingDocumentation; -} diff --git a/demo/custom-typings.d.ts b/demo/custom-typings.d.ts deleted file mode 100644 index 6791fb2959..0000000000 --- a/demo/custom-typings.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare const ENV:string; -// google code-prettify -declare const PR:any; - -declare const require:any; -declare const global:any; diff --git a/demo/demo.template.html b/demo/demo.template.html deleted file mode 100644 index 7cf33786fc..0000000000 --- a/demo/demo.template.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -
- -
diff --git a/demo/polyfills.ts b/demo/polyfills.ts deleted file mode 100644 index d27ff360cd..0000000000 --- a/demo/polyfills.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Polyfills -// (these modules are what are in 'angular2/bundles/angular2-polyfills' so don't use that here) - -// import 'ie-shim'; // Internet Explorer -// import 'es6-shim'; -// import 'es6-promise'; -// import 'es7-reflect-metadata'; - -// Prefer CoreJS over the polyfills above -import 'core-js/es6'; -import 'core-js/es7/reflect'; -require('zone.js/dist/zone'); -require('reflect-metadata'); - -// Typescript emit helpers polyfill -import 'ts-helpers'; - -if ('production' === ENV) { - // Production - -} else { - // Development - - (Error as any).stackTraceLimit = Infinity; - - require('zone.js/dist/long-stack-trace-zone'); - -} diff --git a/demo/router.config.ts b/demo/router.config.ts deleted file mode 100644 index c6c48e1d1a..0000000000 --- a/demo/router.config.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { RouterModule, Routes } from '@angular/router'; - -import { AccordionSectionComponent } from './components/accordion-section'; -import { AlertSectionComponent } from './components/alert-section'; -import { ButtonsSectionComponent } from './components/buttons-section'; -import { CarouselSectionComponent } from './components/carousel-section'; -import { CollapseSectionComponent } from './components/collapse-section'; -import { DatepickerSectionComponent } from './components/datepicker-section'; -import { DropdownSectionComponent } from './components/dropdown-section'; -import { GettingStartedSectionComponent } from './components/getting-started/getting-started'; -import { ModalSectionComponent } from './components/modal-section'; -import { PaginationSectionComponent } from './components/pagination-section'; -import { ProgressbarSectionComponent } from './components/progressbar-section'; -import { RatingSectionComponent } from './components/rating-section'; -import { TabsSectionComponent } from './components/tabs-section'; -import { TimepickerSectionComponent } from './components/timepicker-section'; -import { TooltipSectionComponent } from './components/tooltip-section'; -import { TypeaheadSectionComponent } from './components/typeahead-section'; - -export const routes:Routes = [ - { - path: '', - data: ['Getting started'], - component: GettingStartedSectionComponent - }, { - path: 'accordion', - data: ['Accordion'], - component: AccordionSectionComponent - }, { - path: 'alerts', - data: ['Alerts'], - component: AlertSectionComponent - }, { - path: 'buttons', - data: ['Buttons'], - component: ButtonsSectionComponent - }, { - path: 'carousel', - data: ['Carousel'], - component: CarouselSectionComponent - }, { - path: 'collapse', - data: ['Collapse'], - component: CollapseSectionComponent - }, { - path: 'datepicker', - data: ['Datepicker'], - component: DatepickerSectionComponent - }, { - path: 'dropdowns', - data: ['Dropdowns'], - component: DropdownSectionComponent - }, { - path: 'modals', - data: ['Modals'], - component: ModalSectionComponent - }, { - path: 'pagination', - data: ['Pagination'], - component: PaginationSectionComponent - }, { - path: 'progressbar', - data: ['Progressbar'], - component: ProgressbarSectionComponent - }, { - path: 'rating', - data: ['Rating'], - component: RatingSectionComponent - }, { - path: 'tabs', - data: ['Tabs'], - component: TabsSectionComponent - }, { - path: 'timepicker', - data: ['Timepicker'], - component: TimepickerSectionComponent - }, { - path: 'tooltip', - data: ['Tooltip'], - component: TooltipSectionComponent - }, { - path: 'typeahead', - data: ['Typeahead'], - component: TypeaheadSectionComponent - }, { - path: '**', - redirectTo: '/' - } -]; - -export const routing = RouterModule.forRoot(routes, {useHash: true}); diff --git a/demo/vendor.ts b/demo/vendor.ts deleted file mode 100644 index 9291416136..0000000000 --- a/demo/vendor.ts +++ /dev/null @@ -1,24 +0,0 @@ -// For vendors for example jQuery, Lodash, angular2-jwt just import them here unless you plan on -// chunking vendors files for async loading. You would need to import the async loaded vendors -// at the entry point of the async loaded file. Also see custom-typings.d.ts as you also need to -// run `typings install x` where `x` is your module - -// Angular 2 -import '@angular/common'; -import '@angular/core'; -import '@angular/forms'; -import '@angular/platform-browser'; -import '@angular/platform-browser-dynamic'; -import '@angular/router'; - -// RxJS -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/mergeMap'; - -if ('production' === ENV) { - // Production - -} else { - // Development - -} diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts new file mode 100644 index 0000000000..65b4707aa4 --- /dev/null +++ b/e2e/app.e2e-spec.ts @@ -0,0 +1,14 @@ +import { Ng2BootstrapPage } from './app.po'; + +describe('ng2-bootstrap App', function() { + let page: Ng2BootstrapPage; + + beforeEach(() => { + page = new Ng2BootstrapPage(); + }); + + it('should display message saying app works', () => { + page.navigateTo(); + expect(page.getParagraphText()).toEqual('app works!'); + }); +}); diff --git a/e2e/app.po.ts b/e2e/app.po.ts new file mode 100644 index 0000000000..3a03da9f5d --- /dev/null +++ b/e2e/app.po.ts @@ -0,0 +1,11 @@ +import { browser, element, by } from 'protractor'; + +export class Ng2BootstrapPage { + navigateTo() { + return browser.get('/'); + } + + getParagraphText() { + return element(by.css('app-root h1')).getText(); + } +} diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json new file mode 100644 index 0000000000..656bdb14ff --- /dev/null +++ b/e2e/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "declaration": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "commonjs", + "moduleResolution": "node", + "outDir": "../dist/out-tsc-e2e", + "sourceMap": true, + "target": "es5", + "typeRoots": [ + "../node_modules/@types" + ] + } +} diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000000..864bcaf9af --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,40 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/0.13/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', 'angular-cli'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-remap-istanbul'), + require('angular-cli/plugins/karma') + ], + files: [ + { pattern: './src/test.ts', watched: false } + ], + preprocessors: { + './src/test.ts': ['angular-cli'] + }, + remapIstanbulReporter: { + reports: { + html: 'coverage', + lcovonly: './coverage/coverage.lcov' + } + }, + angularCli: { + config: './angular-cli.json', + environment: 'dev' + }, + reporters: config.angularCli && config.angularCli.codeCoverage + ? ['progress', 'karma-remap-istanbul'] + : ['progress'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; diff --git a/ng-cli-src/assets/.gitkeep b/ng-cli-src/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/demo/favicon.ico b/ng-cli-src/favicon.ico similarity index 100% rename from demo/favicon.ico rename to ng-cli-src/favicon.ico diff --git a/ng-cli-src/index.html b/ng-cli-src/index.html new file mode 100644 index 0000000000..e4598b24af --- /dev/null +++ b/ng-cli-src/index.html @@ -0,0 +1,14 @@ + + + + + Ng2Bootstrap + + + + + + + Loading... + + diff --git a/package.json b/package.json index 4658c24e9a..69c89e9b47 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "test:watch": "cross-env NODE_ENV=test karma start --auto-watch --no-single-run", "preversion": "npm test", "version": "npm run flow.changelog && git add -A", - "postversion": "git push origin development && git push --tags" + "postversion": "git push origin development && git push --tags", + "pree2e": "webdriver-manager update" }, "main": "bundles/ng2-bootstrap.umd.js", "module": "ng2-bootstrap.js", @@ -59,16 +60,17 @@ "@angular/forms": "^2.0.0" }, "devDependencies": { - "@angular/common": "2.1.0", - "@angular/compiler": "2.1.0", - "@angular/compiler-cli": "2.1.0", - "@angular/core": "2.1.0", - "@angular/forms": "2.1.0", - "@angular/platform-browser": "2.1.0", - "@angular/platform-browser-dynamic": "2.1.0", - "@angular/platform-server": "2.1.0", - "@angular/router": "3.1.0", + "@angular/common": "2.1.2", + "@angular/compiler": "2.1.2", + "@angular/compiler-cli": "2.1.2", + "@angular/core": "2.1.2", + "@angular/forms": "2.1.2", + "@angular/platform-browser": "2.1.2", + "@angular/platform-browser-dynamic": "2.1.2", + "@angular/platform-server": "2.1.2", + "@angular/router": "3.1.2", "@types/jasmine": "2.5.35", + "@types/node": "6.0.42", "@types/webpack": "1.12.35", "async": "2.1.1", "bootstrap": "3.3.7", @@ -98,6 +100,20 @@ "typedoc": "0.5.0", "typescript": "2.0.7", "wallaby-webpack": "0.0.26", - "zone.js": "0.6.25" + "zone.js": "0.6.25", + "ts-helpers": "^1.1.1", + "angular-cli": "1.0.0-beta.19-3", + "codelyzer": "1.0.0-beta.1", + "jasmine-core": "2.4.1", + "jasmine-spec-reporter": "2.5.0", + "karma": "1.2.0", + "karma-chrome-launcher": "^2.0.0", + "karma-cli": "^1.0.1", + "karma-jasmine": "^1.0.2", + "karma-remap-istanbul": "^0.2.1", + "protractor": "4.0.9", + "ts-node": "1.2.1", + "tslint": "3.13.0", + "webdriver-manager": "10.2.5" } } diff --git a/protractor.conf.js b/protractor.conf.js new file mode 100644 index 0000000000..169743b34d --- /dev/null +++ b/protractor.conf.js @@ -0,0 +1,32 @@ +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/docs/referenceConf.js + +/*global jasmine */ +var SpecReporter = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './e2e/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + useAllAngular2AppRoots: true, + beforeLaunch: function() { + require('ts-node').register({ + project: 'e2e' + }); + }, + onPrepare: function() { + jasmine.getEnv().addReporter(new SpecReporter()); + } +}; diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000000..acff59f3d0 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1,6 @@ + + + +
+ +
diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts new file mode 100644 index 0000000000..807802e068 --- /dev/null +++ b/src/app/app.component.spec.ts @@ -0,0 +1,33 @@ +/* tslint:disable:no-unused-variable */ + +import { TestBed, async } from '@angular/core/testing'; +import { AppComponent } from './app.component'; + +describe('App: Ng2Bootstrap', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [ + AppComponent + ], + }); + }); + + it('should create the app', async(() => { + let fixture = TestBed.createComponent(AppComponent); + let app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); + + it(`should have as title 'app works!'`, async(() => { + let fixture = TestBed.createComponent(AppComponent); + let app = fixture.debugElement.componentInstance; + expect(app.title).toEqual('app works!'); + })); + + it('should render title in a h1 tag', async(() => { + let fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + let compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('h1').textContent).toContain('app works!'); + })); +}); diff --git a/demo/app.component.ts b/src/app/app.component.ts similarity index 80% rename from demo/app.component.ts rename to src/app/app.component.ts index d314fa9826..f95265fb14 100644 --- a/demo/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,7 @@ import { AfterContentInit, Component, ViewContainerRef } from '@angular/core'; import { NavigationEnd, Router } from '@angular/router'; -import { Ng2BootstrapConfig, Ng2BootstrapTheme } from '../ng2-bootstrap'; +import { Ng2BootstrapConfig, Ng2BootstrapTheme } from '../../dist/ng2-bootstrap'; let w:any = window; @@ -9,14 +9,11 @@ if (w && w.__theme === 'bs4') { Ng2BootstrapConfig.theme = Ng2BootstrapTheme.BS4; } -let template = require('./demo.template.html'); - @Component({ - selector: 'demo', - template + selector: 'bs-demo', + templateUrl: './app.component.html' }) - -export class DemoComponent implements AfterContentInit { +export class AppComponent implements AfterContentInit { public isBs3:boolean = Ng2BootstrapConfig.theme === Ng2BootstrapTheme.BS3; private viewContainerRef:ViewContainerRef; diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000000..20cf4467d5 --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,25 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; +import { AppComponent } from './app.component'; + +import { routes } from './app.routing'; + +import { GettingStartedComponent } from './getting-started/getting-started.component'; + +@NgModule({ + declarations: [ + AppComponent, + GettingStartedComponent + ], + imports: [ + BrowserModule, + FormsModule, + RouterModule.forRoot(routes, {useHash: true}) + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { +} diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts new file mode 100644 index 0000000000..1b762adbaf --- /dev/null +++ b/src/app/app.routing.ts @@ -0,0 +1,91 @@ +import { RouterModule, Routes } from '@angular/router'; +import { GettingStartedComponent } from './getting-started/getting-started.component'; +// +// import { AccordionSectionComponent } from './components/accordion-section'; +// import { AlertSectionComponent } from './components/alert-section'; +// import { ButtonsSectionComponent } from './components/buttons-section'; +// import { CarouselSectionComponent } from './components/carousel-section'; +// import { CollapseSectionComponent } from './components/collapse-section'; +// import { DatepickerSectionComponent } from './components/datepicker-section'; +// import { DropdownSectionComponent } from './components/dropdown-section'; +// import { GettingStartedSectionComponent } from './components/getting-started/getting-started'; +// import { ModalSectionComponent } from './components/modal-section'; +// import { PaginationSectionComponent } from './components/pagination-section'; +// import { ProgressbarSectionComponent } from './components/progressbar-section'; +// import { RatingSectionComponent } from './components/rating-section'; +// import { TabsSectionComponent } from './components/tabs-section'; +// import { TimepickerSectionComponent } from './components/timepicker-section'; +// import { TooltipSectionComponent } from './components/tooltip-section'; +// import { TypeaheadSectionComponent } from './components/typeahead-section'; + +export const routes:Routes = [ + { + path: '', + data: ['Getting started'], + component: GettingStartedComponent + }, +// { +// path: 'accordion', +// data: ['Accordion'], +// component: AccordionSectionComponent +// }, { +// path: 'alerts', +// data: ['Alerts'], +// component: AlertSectionComponent +// }, { +// path: 'buttons', +// data: ['Buttons'], +// component: ButtonsSectionComponent +// }, { +// path: 'carousel', +// data: ['Carousel'], +// component: CarouselSectionComponent +// }, { +// path: 'collapse', +// data: ['Collapse'], +// component: CollapseSectionComponent +// }, { +// path: 'datepicker', +// data: ['Datepicker'], +// component: DatepickerSectionComponent +// }, { +// path: 'dropdowns', +// data: ['Dropdowns'], +// component: DropdownSectionComponent +// }, { +// path: 'modals', +// data: ['Modals'], +// component: ModalSectionComponent +// }, { +// path: 'pagination', +// data: ['Pagination'], +// component: PaginationSectionComponent +// }, { +// path: 'progressbar', +// data: ['Progressbar'], +// component: ProgressbarSectionComponent +// }, { +// path: 'rating', +// data: ['Rating'], +// component: RatingSectionComponent +// }, { +// path: 'tabs', +// data: ['Tabs'], +// component: TabsSectionComponent +// }, { +// path: 'timepicker', +// data: ['Timepicker'], +// component: TimepickerSectionComponent +// }, { +// path: 'tooltip', +// data: ['Tooltip'], +// component: TooltipSectionComponent +// }, { +// path: 'typeahead', +// data: ['Typeahead'], +// component: TypeaheadSectionComponent +// }, { +// path: '**', +// redirectTo: '/' +// } +]; diff --git a/demo/components/getting-started/dependencies.md b/src/app/getting-started/dependencies.md similarity index 100% rename from demo/components/getting-started/dependencies.md rename to src/app/getting-started/dependencies.md diff --git a/src/app/getting-started/getting-started.component.js b/src/app/getting-started/getting-started.component.js new file mode 100644 index 0000000000..70e93bf808 --- /dev/null +++ b/src/app/getting-started/getting-started.component.js @@ -0,0 +1,32 @@ +"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 core_1 = require('@angular/core'); +var name = "Native Angular 2 directives for bootstrap"; +// webpack html imports +var template = require('./getting-started.template.html'); +var desc = "\n"; +var dependencies = require('./dependencies.md'); +var installation = require('./installation.md'); +var readingDocumentation = require('./reading-documentation.md'); +var GettingStartedSectionComponent = (function () { + function GettingStartedSectionComponent() { + this.name = name; + this.desc = desc; + this.dependencies = dependencies; + this.installation = installation; + this.readingDocumentation = readingDocumentation; + } + GettingStartedSectionComponent = __decorate([ + core_1.Component({ + selector: 'accordion-section', + template: template + }) + ], GettingStartedSectionComponent); + return GettingStartedSectionComponent; +}()); +exports.GettingStartedSectionComponent = GettingStartedSectionComponent; diff --git a/src/app/getting-started/getting-started.component.ts b/src/app/getting-started/getting-started.component.ts new file mode 100644 index 0000000000..66da1ab0b6 --- /dev/null +++ b/src/app/getting-started/getting-started.component.ts @@ -0,0 +1,21 @@ +import { Component } from '@angular/core'; + +let desc = ``; +// let dependencies = require('./dependencies.md'); +let dependencies = ''; +// let installation = require('./installation.md'); +let installation = ''; +// let readingDocumentation = require('./reading-documentation.md'); +let readingDocumentation = ''; + +@Component({ + selector: 'getting-started', + templateUrl: './getting-started.template.html' +}) +export class GettingStartedComponent { + public name:string = `Native Angular 2 directives for bootstrap`; + public desc:string = desc; + public dependencies:string = dependencies; + public installation:string = installation; + public readingDocumentation:string = readingDocumentation; +} diff --git a/demo/components/getting-started/getting-started.template.html b/src/app/getting-started/getting-started.template.html similarity index 100% rename from demo/components/getting-started/getting-started.template.html rename to src/app/getting-started/getting-started.template.html diff --git a/demo/components/getting-started/installation.md b/src/app/getting-started/installation.md similarity index 100% rename from demo/components/getting-started/installation.md rename to src/app/getting-started/installation.md diff --git a/demo/components/getting-started/reading-documentation.md b/src/app/getting-started/reading-documentation.md similarity index 100% rename from demo/components/getting-started/reading-documentation.md rename to src/app/getting-started/reading-documentation.md diff --git a/src/app/index.ts b/src/app/index.ts new file mode 100644 index 0000000000..875bdb2f25 --- /dev/null +++ b/src/app/index.ts @@ -0,0 +1,2 @@ +export * from './app.component'; +export * from './app.module'; diff --git a/demo/assets/css/glyphicons.css b/src/assets/css/glyphicons.css similarity index 100% rename from demo/assets/css/glyphicons.css rename to src/assets/css/glyphicons.css diff --git a/demo/assets/css/prettify-angulario.css b/src/assets/css/prettify-angulario.css similarity index 100% rename from demo/assets/css/prettify-angulario.css rename to src/assets/css/prettify-angulario.css diff --git a/demo/assets/css/style.css b/src/assets/css/style.css similarity index 100% rename from demo/assets/css/style.css rename to src/assets/css/style.css diff --git a/demo/assets/fonts/glyphicons-halflings-regular.eot b/src/assets/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from demo/assets/fonts/glyphicons-halflings-regular.eot rename to src/assets/fonts/glyphicons-halflings-regular.eot diff --git a/demo/assets/fonts/glyphicons-halflings-regular.svg b/src/assets/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from demo/assets/fonts/glyphicons-halflings-regular.svg rename to src/assets/fonts/glyphicons-halflings-regular.svg diff --git a/demo/assets/fonts/glyphicons-halflings-regular.ttf b/src/assets/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from demo/assets/fonts/glyphicons-halflings-regular.ttf rename to src/assets/fonts/glyphicons-halflings-regular.ttf diff --git a/demo/assets/fonts/glyphicons-halflings-regular.woff b/src/assets/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from demo/assets/fonts/glyphicons-halflings-regular.woff rename to src/assets/fonts/glyphicons-halflings-regular.woff diff --git a/demo/assets/fonts/glyphicons-halflings-regular.woff2 b/src/assets/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from demo/assets/fonts/glyphicons-halflings-regular.woff2 rename to src/assets/fonts/glyphicons-halflings-regular.woff2 diff --git a/demo/assets/images/active.svg b/src/assets/images/active.svg similarity index 100% rename from demo/assets/images/active.svg rename to src/assets/images/active.svg diff --git a/demo/assets/images/anactive.svg b/src/assets/images/anactive.svg similarity index 100% rename from demo/assets/images/anactive.svg rename to src/assets/images/anactive.svg diff --git a/demo/assets/images/bar-doc.png b/src/assets/images/bar-doc.png similarity index 100% rename from demo/assets/images/bar-doc.png rename to src/assets/images/bar-doc.png diff --git a/demo/assets/images/border-dot.png b/src/assets/images/border-dot.png similarity index 100% rename from demo/assets/images/border-dot.png rename to src/assets/images/border-dot.png diff --git a/demo/assets/images/link-doc.png b/src/assets/images/link-doc.png similarity index 100% rename from demo/assets/images/link-doc.png rename to src/assets/images/link-doc.png diff --git a/demo/assets/images/logo.png b/src/assets/images/logo.png similarity index 100% rename from demo/assets/images/logo.png rename to src/assets/images/logo.png diff --git a/demo/assets/images/menu-left.svg b/src/assets/images/menu-left.svg similarity index 100% rename from demo/assets/images/menu-left.svg rename to src/assets/images/menu-left.svg diff --git a/demo/assets/images/menu-right.svg b/src/assets/images/menu-right.svg similarity index 100% rename from demo/assets/images/menu-right.svg rename to src/assets/images/menu-right.svg diff --git a/demo/assets/images/repa-down.png b/src/assets/images/repa-down.png similarity index 100% rename from demo/assets/images/repa-down.png rename to src/assets/images/repa-down.png diff --git a/demo/assets/images/repa-up.png b/src/assets/images/repa-up.png similarity index 100% rename from demo/assets/images/repa-up.png rename to src/assets/images/repa-up.png diff --git a/demo/assets/images/search-doc.png b/src/assets/images/search-doc.png similarity index 100% rename from demo/assets/images/search-doc.png rename to src/assets/images/search-doc.png diff --git a/demo/assets/js/prettify.min.js b/src/assets/js/prettify.min.js similarity index 100% rename from demo/assets/js/prettify.min.js rename to src/assets/js/prettify.min.js diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts new file mode 100644 index 0000000000..3612073bc3 --- /dev/null +++ b/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000000..00313f1664 --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,8 @@ +// The file contents for the current environment will overwrite these during build. +// The build system defaults to the dev environment which uses `environment.ts`, but if you do +// `ng build --env=prod` then `environment.prod.ts` will be used instead. +// The list of which env maps to which file can be found in `angular-cli.json`. + +export const environment = { + production: false +}; diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8081c7ceaf2be08bf59010158c586170d9d2d517 GIT binary patch literal 5430 zcmc(je{54#6vvCoAI3i*G5%$U7!sA3wtMZ$fH6V9C`=eXGJb@R1%(I_{vnZtpD{6n z5Pl{DmxzBDbrB>}`90e12m8T*36WoeDLA&SD_hw{H^wM!cl_RWcVA!I+x87ee975; z@4kD^=bYPn&pmG@(+JZ`rqQEKxW<}RzhW}I!|ulN=fmjVi@x{p$cC`)5$a!)X&U+blKNvN5tg=uLvuLnuqRM;Yc*swiexsoh#XPNu{9F#c`G zQLe{yWA(Y6(;>y|-efAy11k<09(@Oo1B2@0`PtZSkqK&${ zgEY}`W@t{%?9u5rF?}Y7OL{338l*JY#P!%MVQY@oqnItpZ}?s z!r?*kwuR{A@jg2Chlf0^{q*>8n5Ir~YWf*wmsh7B5&EpHfd5@xVaj&gqsdui^spyL zB|kUoblGoO7G(MuKTfa9?pGH0@QP^b#!lM1yHWLh*2iq#`C1TdrnO-d#?Oh@XV2HK zKA{`eo{--^K&MW66Lgsktfvn#cCAc*(}qsfhrvOjMGLE?`dHVipu1J3Kgr%g?cNa8 z)pkmC8DGH~fG+dlrp(5^-QBeEvkOvv#q7MBVLtm2oD^$lJZx--_=K&Ttd=-krx(Bb zcEoKJda@S!%%@`P-##$>*u%T*mh+QjV@)Qa=Mk1?#zLk+M4tIt%}wagT{5J%!tXAE;r{@=bb%nNVxvI+C+$t?!VJ@0d@HIyMJTI{vEw0Ul ze(ha!e&qANbTL1ZneNl45t=#Ot??C0MHjjgY8%*mGisN|S6%g3;Hlx#fMNcL<87MW zZ>6moo1YD?P!fJ#Jb(4)_cc50X5n0KoDYfdPoL^iV`k&o{LPyaoqMqk92wVM#_O0l z09$(A-D+gVIlq4TA&{1T@BsUH`Bm=r#l$Z51J-U&F32+hfUP-iLo=jg7Xmy+WLq6_tWv&`wDlz#`&)Jp~iQf zZP)tu>}pIIJKuw+$&t}GQuqMd%Z>0?t%&BM&Wo^4P^Y z)c6h^f2R>X8*}q|bblAF?@;%?2>$y+cMQbN{X$)^R>vtNq_5AB|0N5U*d^T?X9{xQnJYeU{ zoZL#obI;~Pp95f1`%X3D$Mh*4^?O?IT~7HqlWguezmg?Ybq|7>qQ(@pPHbE9V?f|( z+0xo!#m@Np9PljsyxBY-UA*{U*la#8Wz2sO|48_-5t8%_!n?S$zlGe+NA%?vmxjS- zHE5O3ZarU=X}$7>;Okp(UWXJxI%G_J-@IH;%5#Rt$(WUX?6*Ux!IRd$dLP6+SmPn= z8zjm4jGjN772R{FGkXwcNv8GBcZI#@Y2m{RNF_w8(Z%^A*!bS*!}s6sh*NnURytky humW;*g7R+&|Ledvc- - + Loading... - +