angular2-bootstrap-confirm
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -5,2 +5,3 @@ import { Confirm } from './src/confirm.directive'; | ||
import { Focus } from './src/focus.directive'; | ||
import { ConfirmPopover } from './src/confirmPopover.component'; | ||
export * from './src/confirm.directive'; | ||
@@ -10,6 +11,7 @@ export { ConfirmOptions } from './src/confirmOptions.provider'; | ||
export * from './src/focus.directive'; | ||
export * from './src/confirmPopover.component'; | ||
declare var _default: { | ||
providers: (typeof ConfirmOptions | typeof Position)[]; | ||
directives: (typeof Confirm | typeof Focus)[]; | ||
directives: (typeof Confirm | typeof Focus | typeof ConfirmPopover)[]; | ||
}; | ||
export default _default; |
@@ -65,2 +65,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var focus_directive_1 = __webpack_require__(6); | ||
var confirmPopover_component_1 = __webpack_require__(4); | ||
__export(__webpack_require__(1)); | ||
@@ -71,6 +72,7 @@ var confirmOptions_provider_2 = __webpack_require__(7); | ||
__export(__webpack_require__(6)); | ||
__export(__webpack_require__(4)); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = { | ||
providers: [confirmOptions_provider_1.ConfirmOptions, position_provider_1.Position], | ||
directives: [confirm_directive_1.Confirm, focus_directive_1.Focus] | ||
directives: [confirm_directive_1.Confirm, focus_directive_1.Focus, confirmPopover_component_1.ConfirmPopover] | ||
}; | ||
@@ -106,3 +108,3 @@ | ||
* class="btn btn-default" | ||
* mwl-confirm | ||
* mwlConfirm | ||
* [title]="title" | ||
@@ -122,7 +124,8 @@ * [message]="message" | ||
*/ | ||
function Confirm(viewContainerRef, elm, defaultOptions, compiler, position, renderer, document) { | ||
function Confirm(viewContainerRef, elm, defaultOptions, cfr, position, renderer, document //tslint:disable-line | ||
) { | ||
this.viewContainerRef = viewContainerRef; | ||
this.elm = elm; | ||
this.defaultOptions = defaultOptions; | ||
this.compiler = compiler; | ||
this.cfr = cfr; | ||
this.position = position; | ||
@@ -243,3 +246,3 @@ this.renderer = renderer; | ||
}); | ||
var componentFactory = this.compiler.compileComponentSync(confirmPopover_component_1.ConfirmPopover); | ||
var componentFactory = this.cfr.resolveComponentFactory(confirmPopover_component_1.ConfirmPopover); | ||
var binding = core_1.ReflectiveInjector.resolve([{ | ||
@@ -382,6 +385,6 @@ provide: confirmOptions_provider_1.PopoverConfirmOptions, | ||
core_1.Directive({ | ||
selector: '[mwl-confirm]' | ||
selector: '[mwlConfirm]' | ||
}), | ||
__param(6, core_1.Inject(platform_browser_1.DOCUMENT)), | ||
__metadata('design:paramtypes', [core_1.ViewContainerRef, core_1.ElementRef, confirmOptions_provider_1.ConfirmOptions, core_1.Compiler, position_provider_1.Position, core_1.Renderer, HTMLDocument]) | ||
__metadata('design:paramtypes', [core_1.ViewContainerRef, core_1.ElementRef, confirmOptions_provider_1.ConfirmOptions, core_1.ComponentFactoryResolver, position_provider_1.Position, core_1.Renderer, Object]) | ||
], Confirm); | ||
@@ -437,3 +440,3 @@ return Confirm; | ||
directives: [common_1.NgIf, common_1.NgTemplateOutlet, focus_directive_1.Focus], | ||
template: "\n <template\n *ngIf=\"options.customTemplate\"\n [ngTemplateOutlet]=\"options.customTemplate\"\n [ngOutletContext]=\"{options: options}\">\n </template>\n <div\n *ngIf=\"!options.customTemplate\"\n [class]=\"'popover ' + options.placement + ' popover-' + options.placement + ' ' + options.popoverClass\">\n <div class=\"popover-arrow arrow\"></div>\n <h3 class=\"popover-title\" [innerHTML]=\"options.title\"></h3>\n <div class=\"popover-content\">\n <p [innerHTML]=\"options.message\"></p>\n <div class=\"row\">\n <div\n class=\"col-xs-6\"\n [class.col-xs-offset-3]=\"options.hideCancelButton\"\n *ngIf=\"!options.hideConfirmButton\">\n <button\n mwl-focus\n [focusOn]=\"options.focusButton === 'confirm'\"\n [class]=\"'btn btn-block btn-' + options.confirmButtonType\"\n (click)=\"options.onConfirm()\"\n [innerHtml]=\"options.confirmText\">\n </button>\n </div>\n <div\n class=\"col-xs-6\"\n [class.col-xs-offset-3]=\"options.hideConfirmButton\"\n *ngIf=\"!options.hideCancelButton\">\n <button\n mwl-focus\n [focusOn]=\"options.focusButton === 'cancel'\"\n [class]=\"'btn btn-block btn-' + options.cancelButtonType\"\n (click)=\"options.onCancel()\"\n [innerHtml]=\"options.cancelText\">\n </button>\n </div>\n </div>\n </div>\n </div>\n " | ||
template: "\n <template\n *ngIf=\"options.customTemplate\"\n [ngTemplateOutlet]=\"options.customTemplate\"\n [ngOutletContext]=\"{options: options}\">\n </template>\n <div\n *ngIf=\"!options.customTemplate\"\n [class]=\"'popover ' + options.placement + ' popover-' + options.placement + ' ' + options.popoverClass\">\n <div class=\"popover-arrow arrow\"></div>\n <h3 class=\"popover-title\" [innerHTML]=\"options.title\"></h3>\n <div class=\"popover-content\">\n <p [innerHTML]=\"options.message\"></p>\n <div class=\"row\">\n <div\n class=\"col-xs-6\"\n [class.col-xs-offset-3]=\"options.hideCancelButton\"\n *ngIf=\"!options.hideConfirmButton\">\n <button\n [mwlFocus]=\"options.focusButton === 'confirm'\"\n [class]=\"'btn btn-block btn-' + options.confirmButtonType\"\n (click)=\"options.onConfirm()\"\n [innerHtml]=\"options.confirmText\">\n </button>\n </div>\n <div\n class=\"col-xs-6\"\n [class.col-xs-offset-3]=\"options.hideConfirmButton\"\n *ngIf=\"!options.hideCancelButton\">\n <button\n [mwlFocus]=\"options.focusButton === 'cancel'\"\n [class]=\"'btn btn-block btn-' + options.cancelButtonType\"\n (click)=\"options.onCancel()\"\n [innerHtml]=\"options.cancelText\">\n </button>\n </div>\n </div>\n </div>\n </div>\n " | ||
}), | ||
@@ -477,3 +480,3 @@ __metadata('design:paramtypes', [confirmOptions_provider_1.PopoverConfirmOptions]) | ||
Focus.prototype.ngOnChanges = function (changes) { | ||
if (changes.focusOn && this.focusOn === true) { | ||
if (changes.mwlFocus && this.mwlFocus === true) { | ||
this.renderer.invokeElementMethod(this.elm.nativeElement, 'focus', []); | ||
@@ -485,6 +488,6 @@ } | ||
__metadata('design:type', Boolean) | ||
], Focus.prototype, "focusOn", void 0); | ||
], Focus.prototype, "mwlFocus", void 0); | ||
Focus = __decorate([ | ||
core_1.Directive({ | ||
selector: '[mwl-focus]' | ||
selector: '[mwlFocus]' | ||
}), | ||
@@ -491,0 +494,0 @@ __metadata('design:paramtypes', [core_1.Renderer, core_1.ElementRef]) |
@@ -5,2 +5,51 @@ # Change Log | ||
<a name="0.8.0"></a> | ||
# [0.8.0](https://github.com/mattlewis92/angular2-bootstrap-confirm/compare/v0.7.0...v0.8.0) (2016-07-02) | ||
### Features | ||
* use `ComponentFactoryResolver` for creating the popover ([99af89f](https://github.com/mattlewis92/angular2-bootstrap-confirm/commit/99af89f)) | ||
* **mwlConfirm:** renamed the selector of the mwlConfirm directive ([54a013c](https://github.com/mattlewis92/angular2-bootstrap-confirm/commit/54a013c)) | ||
* **mwlFocus:** rename focusOn to mwlFocus ([5e3cbe7](https://github.com/mattlewis92/angular2-bootstrap-confirm/commit/5e3cbe7)) | ||
* **mwlFocus:** rename the mwlFocus directive selector to be camelcased ([724ea47](https://github.com/mattlewis92/angular2-bootstrap-confirm/commit/724ea47)) | ||
### BREAKING CHANGES | ||
* mwlFocus: focusOn has been removed in favour of binding directly to the mwlFocus selector. Only relevant if using a custom template. | ||
Before: | ||
``` | ||
mwlFocus [focusOn]="condition" | ||
``` | ||
After | ||
``` | ||
[mwlFocus]="condition" | ||
``` | ||
* mwlFocus: the mwlFocus selector has changed from `mwl-focus` to `mwlFocus`. Only relevant if using a custom template. | ||
* mwlConfirm: the CSS selector of the directive has changed from `mwl-confirm` to `mwlConfirm` | ||
* You must now add a `precompile: [ConfirmPopover]`, to any components metadata that uses the confirm | ||
directive like so: | ||
``` | ||
import {Component} from '@angular/core'; | ||
import {Confirm, ConfirmOptions, ConfirmPopover, Position} from 'angular2-bootstrap-confirm'; | ||
@Component({ | ||
selector: 'my-component', | ||
directives: [ | ||
Confirm | ||
], | ||
precompile: [ | ||
ConfirmPopover | ||
], | ||
... | ||
}) | ||
class MyComponent { | ||
} | ||
``` | ||
<a name="0.7.0"></a> | ||
@@ -7,0 +56,0 @@ # [0.7.0](https://github.com/mattlewis92/angular2-bootstrap-confirm/compare/v0.6.0...v0.7.0) (2016-07-01) |
{ | ||
"name": "angular2-bootstrap-confirm", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "An angular2 bootstrap confirmation popover", | ||
@@ -47,2 +47,3 @@ "main": "./angular2-bootstrap-confirm.js", | ||
"@angular/platform-browser-dynamic": "2.0.0-rc.4", | ||
"chai": "~3.5.0", | ||
"commitizen": "~2.8.1", | ||
@@ -56,10 +57,11 @@ "concurrently": "~2.1.0", | ||
"ghooks": "~1.2.1", | ||
"imports-loader": "~0.6.5", | ||
"istanbul-instrumenter-loader": "~0.2.0", | ||
"jasmine-core": "~2.4.1", | ||
"karma": "~0.13.22", | ||
"karma-coverage": "~1.0.0", | ||
"karma-jasmine": "~1.0.2", | ||
"karma-mocha": "~1.1.1", | ||
"karma-phantomjs-launcher": "~1.0.0", | ||
"karma-sourcemap-loader": "~0.3.7", | ||
"karma-webpack": "~1.7.0", | ||
"mocha": "~2.5.3", | ||
"ng2-bootstrap": "~1.0.16", | ||
@@ -69,2 +71,4 @@ "phantomjs-prebuilt": "~2.1.7", | ||
"rxjs": "5.0.0-beta.6", | ||
"sinon": "~1.17.4", | ||
"sinon-chai": "~2.8.0", | ||
"standard-version": "~2.3.0", | ||
@@ -71,0 +75,0 @@ "ts-loader": "~0.8.2", |
@@ -39,3 +39,3 @@ # Angular2 bootstrap confirm | ||
import {Component} from '@angular/core'; | ||
import {Confirm, ConfirmOptions, Position} from 'angular2-bootstrap-confirm'; | ||
import {Confirm, ConfirmOptions, ConfirmPopover, Position} from 'angular2-bootstrap-confirm'; | ||
import {PositionService} from 'angular2-bootstrap-confirm/position/position'; | ||
@@ -55,6 +55,9 @@ // Or if you're already using the ng2-bootstrap module | ||
], | ||
precompile: [ | ||
ConfirmPopover | ||
], | ||
template: ` | ||
<button | ||
class="btn btn-default" | ||
mwl-confirm | ||
mwlConfirm | ||
[title]="title" | ||
@@ -61,0 +64,0 @@ [message]="message" |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter, ViewContainerRef, ComponentRef, OnDestroy, ElementRef, OnChanges, OnInit, Compiler, Renderer, TemplateRef } from '@angular/core'; | ||
import { EventEmitter, ViewContainerRef, ComponentRef, OnDestroy, ElementRef, OnChanges, OnInit, ComponentFactoryResolver, Renderer, TemplateRef } from '@angular/core'; | ||
import { ConfirmPopover } from './confirmPopover.component'; | ||
@@ -10,3 +10,3 @@ import { ConfirmOptions } from './confirmOptions.provider'; | ||
* class="btn btn-default" | ||
* mwl-confirm | ||
* mwlConfirm | ||
* [title]="title" | ||
@@ -26,3 +26,3 @@ * [message]="message" | ||
private defaultOptions; | ||
private compiler; | ||
private cfr; | ||
private position; | ||
@@ -93,3 +93,3 @@ private renderer; | ||
* | ||
* Then pass customTemplate to the mwl-confirm directive like so `[customTemplate]="customTemplate"` | ||
* Then pass customTemplate to the mwlConfirm directive like so `[customTemplate]="customTemplate"` | ||
*/ | ||
@@ -124,3 +124,3 @@ customTemplate: TemplateRef<any>; | ||
*/ | ||
constructor(viewContainerRef: ViewContainerRef, elm: ElementRef, defaultOptions: ConfirmOptions, compiler: Compiler, position: Position, renderer: Renderer, document: HTMLDocument); | ||
constructor(viewContainerRef: ViewContainerRef, elm: ElementRef, defaultOptions: ConfirmOptions, cfr: ComponentFactoryResolver, position: Position, renderer: Renderer, document: any); | ||
/** | ||
@@ -127,0 +127,0 @@ * @private |
@@ -8,5 +8,5 @@ import { ElementRef, OnChanges, Renderer } from '@angular/core'; | ||
private elm; | ||
focusOn: boolean; | ||
mwlFocus: boolean; | ||
constructor(renderer: Renderer, elm: ElementRef); | ||
ngOnChanges(changes: any): void; | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
95683
1146
126
40