Skip to content

Commit

Permalink
upgrade versions +
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFrankel committed Jan 30, 2018
1 parent f76b500 commit 6d7a326
Show file tree
Hide file tree
Showing 8 changed files with 1,459 additions and 434 deletions.
3 changes: 1 addition & 2 deletions example/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export class AppComponent implements OnInit {
}, 10);
}


private changeExample1(popperRef: PopperContent) {
changeExample1(popperRef: PopperContent) {
setTimeout(() => {
this.elem.nativeElement.querySelector('#example10reference1').dispatchEvent(new Event('click'));
}, 100)
Expand Down
9 changes: 5 additions & 4 deletions example/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ import '@angular/common';
import '@angular/compiler';
import '@angular/core';
import '@angular/forms';
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/platform-browser';
import 'rxjs';

import { enableProdMode } from '@angular/core';
// The browser platform with a compiler
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import {platformBrowser} from '@angular/platform-browser';
//import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

// The app module
import { AppModule } from './app.module';

if (String('<%= BUILD_TYPE %>') === 'prod') { enableProdMode(); }
enableProdMode();

platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowser().bootstrapModule(AppModule);
48 changes: 25 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-popper",
"version": "1.9.8",
"version": "2.0.1",
"description": "ngx-popper is an angular wrapper for popper.js",
"directories": {
"test": "test"
Expand Down Expand Up @@ -34,36 +34,38 @@
},
"homepage": "",
"devDependencies": {
"@angular/common": "^5.0.2",
"@angular/compiler": "^5.0.2",
"@angular/compiler-cli": "^5.0.2",
"@angular/core": "^5.0.2",
"@angular/forms": "^5.0.2",
"@angular/platform-browser": "^5.0.2",
"@angular/platform-browser-dynamic": "^5.0.2",
"@angular/platform-server": "^5.0.2",
"@types/node": "^8.0.53",
"@angular/common": "^5.2.2",
"@angular/compiler": "^5.2.2",
"@angular/compiler-cli": "^5.2.2",
"@angular/core": "^5.2.2",
"@angular/forms": "^5.2.2",
"@angular/platform-browser": "^5.2.2",
"@angular/platform-browser-dynamic": "^5.2.2",
"@angular/platform-server": "^5.2.2",
"@angular/cli": "^1.6.6",
"@ngtools/webpack": "^1.9.6",
"@types/node": "^9.4.0",
"angular2-template-loader": "^0.6.2",
"awesome-typescript-loader": "^3.4.0",
"awesome-typescript-loader": "^3.4.1",
"chalk": "^2.3.0",
"css-loader": "^0.28.7",
"html-loader": "^0.5.1",
"css-loader": "^0.28.9",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^2.30.1",
"ng-packagr": "^1.6.0",
"ng2draggable": "^1.3.2",
"open-browser-webpack-plugin": "0.0.5",
"open-browser-webpack-plugin": "^0.0.5",
"progress-bar-webpack-plugin": "^1.10.0",
"raw-loader": "^0.5.1",
"reflect-metadata": "^0.1.10",
"rxjs": "^5.5.2",
"reflect-metadata": "^0.1.12",
"rxjs": "^5.5.6",
"script-loader": "^0.7.2",
"style-loader": "^0.19.0",
"typescript": "^2.6.1",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.4",
"standard-version": "^4.3.0",
"style-loader": "^0.20.1",
"typescript": "^2.6.2",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1",
"yarn": "^1.3.2",
"zone.js": "^0.8.18",
"ng-packagr": "^1.6.0",
"standard-version": "^4.2.0"
"zone.js": "^0.8.20"
},
"dependencies": {
"popper.js": "1.13.0-next.1"
Expand Down
22 changes: 11 additions & 11 deletions src/popper-directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,25 @@ export class PopperController implements OnInit, OnChanges {
@Output()
popperOnHidden = new EventEmitter<PopperController>();

@HostListener('touchstart', ['$event'])
@HostListener('click', ['$event'])
showOrHideOnClick($event: MouseEvent): void {
@HostListener('touchstart')
@HostListener('click')
showOrHideOnClick(): void {
if (this.disabled || this.showTrigger !== Triggers.CLICK) {
return;
}
this.toggle();
}

@HostListener('touchstart', ['$event'])
@HostListener('mousedown', ['$event'])
showOrHideOnMouseOver($event: MouseEvent): void {
@HostListener('touchstart')
@HostListener('mousedown')
showOrHideOnMouseOver(): void {
if (this.disabled || this.showTrigger !== Triggers.MOUSEDOWN) {
return;
}
this.toggle();
}

@HostListener('mouseenter', ['$event'])
@HostListener('mouseenter')
showOnHover(): void {
if (this.disabled || this.showTrigger !== Triggers.HOVER) {
return;
Expand All @@ -142,10 +142,10 @@ export class PopperController implements OnInit, OnChanges {
this.scheduledHide($event, this.hideTimeout);
}

@HostListener('touchend', ['$event'])
@HostListener('touchcancel', ['$event'])
@HostListener('mouseleave', ['$event'])
hideOnLeave($event: MouseEvent): void {
@HostListener('touchend')
@HostListener('touchcancel')
@HostListener('mouseleave')
hideOnLeave(): void {
if (this.disabled || this.showTrigger !== Triggers.HOVER) {
return;
}
Expand Down
10 changes: 8 additions & 2 deletions src/popper.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ import {PopperContentOptions} from './popper.model';
],
entryComponents: [
PopperContent
]
],
providers: [
{
provide: 'popperDefaults', useValue: {}
}]
})
export class NgxPopperModule {
ngDoBootstrap(){}
ngDoBootstrap() {
}

public static forRoot(popperBaseOptions: PopperContentOptions = {}): ModuleWithProviders {
return {ngModule: NgxPopperModule, providers: [{provide: 'popperDefaults', useValue: popperBaseOptions}]};
}
Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
],
"exclude": [
"node_modules",
"dist"
"dist",
"example-cli"
],
"angularCompilerOptions": {
"skipTemplateCodegen": true
"fullTemplateTypeCheck": true,
"preserveWhiteSpace": false

}
}
16 changes: 12 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const OpenBrowserPlugin = require('open-browser-webpack-plugin');
const chalk = require('chalk');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;

module.exports = {
entry: './example/app/index.ts',
Expand All @@ -18,10 +19,11 @@ module.exports = {
devtool: 'source-map',
module: {
rules: [
{
test: /\.ts?$/,
use: ['awesome-typescript-loader', 'angular2-template-loader']
},
// {
// test: /\.ts?$/,
// use: ['awesome-typescript-loader', 'angular2-template-loader']
// },
{ test: /\.ts$/, loaders: ['@ngtools/webpack'] },
/* Embed files. */
{
test: /\.(html|css)$/,
Expand All @@ -31,6 +33,12 @@ module.exports = {
},
plugins: [
new CheckerPlugin(),
new AngularCompilerPlugin({
tsConfigPath: './tsconfig.json',
entryModule: 'example/app/app.module#AppModule',
sourceMap: true
}),

new HtmlWebpackPlugin({
inject: true,
template: 'example/index.html'
Expand Down
Loading

0 comments on commit 6d7a326

Please sign in to comment.