@ctrl/ngx-codemirror
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -50,7 +50,7 @@ (function (global, factory) { | ||
_this.codeMirror.on('scroll', _this.scrollChanged.bind(_this)); | ||
_this.codeMirror.on('blur', _this.focusChanged.bind(_this, false)); | ||
_this.codeMirror.on('focus', _this.focusChanged.bind(_this, true)); | ||
_this.codeMirror.on('change', function (cm, change) { return _this._ngZone.run(function () { return _this.codemirrorValueChanged(cm, change); }); }); | ||
_this.codeMirror.setValue(_this.value); | ||
}); | ||
this.codeMirror.on('blur', this.focusChanged.bind(this, false)); | ||
this.codeMirror.on('focus', this.focusChanged.bind(this, true)); | ||
this.codeMirror.on('change', this.codemirrorValueChanged.bind(this)); | ||
this.codeMirror.setValue(this.value); | ||
}; | ||
@@ -57,0 +57,0 @@ CodemirrorComponent.prototype.ngDoCheck = function () { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/forms"],t):t((e.ctrl=e.ctrl||{},e.ctrl["ngx-codemirror"]={}),e.ng.core,e.ng.forms)}(this,function(e,r,t){"use strict";function o(e){return e?e.replace(/\r\n|\r/g,"\n"):e}var i=function(){function e(e,t){this._differs=e,this._ngZone=t,this.className="",this.name="codemirror",this.autoFocus=!1,this.preserveScrollPosition=!1,this.cursorActivity=new r.EventEmitter,this.focusChange=new r.EventEmitter,this.scroll=new r.EventEmitter,this.value="",this.disabled=!1,this.isFocused=!1,this.onChange=function(e){},this.onTouched=function(){}}return Object.defineProperty(e.prototype,"options",{set:function(e){this._options=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;if(this.ref){var t=require("codemirror").fromTextArea;this._ngZone.runOutsideAngular(function(){e.codeMirror=t(e.ref.nativeElement,e._options),e.codeMirror.on("cursorActivity",e.cursorActive.bind(e)),e.codeMirror.on("scroll",e.scrollChanged.bind(e))}),this.codeMirror.on("blur",this.focusChanged.bind(this,!1)),this.codeMirror.on("focus",this.focusChanged.bind(this,!0)),this.codeMirror.on("change",this.codemirrorValueChanged.bind(this)),this.codeMirror.setValue(this.value)}},e.prototype.ngDoCheck=function(){var t=this;if(this._differ){var e=this._differ.diff(this._options);e&&(e.forEachChangedItem(function(e){return t.setOptionIfChanged(e.key,e.currentValue)}),e.forEachAddedItem(function(e){return t.setOptionIfChanged(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){return t.setOptionIfChanged(e.key,e.currentValue)}))}},e.prototype.ngOnDestroy=function(){this.codeMirror&&this.codeMirror.toTextArea()},e.prototype.codemirrorValueChanged=function(e,t){"setValue"!==t.origin&&(this.value=e.getValue(),this.onChange(this.value))},e.prototype.setOptionIfChanged=function(e,t){this.codeMirror&&this.codeMirror.setOption(e,t)},e.prototype.focusChanged=function(e){this.onTouched(),this.isFocused=e,this.focusChange.emit(e)},e.prototype.scrollChanged=function(e){this.scroll.emit(e.getScrollInfo())},e.prototype.cursorActive=function(e){this.cursorActivity.emit(e)},e.prototype.writeValue=function(e){if(null!==e&&e!==undefined)if(this.codeMirror){var t=this.codeMirror.getValue();if(e!==t&&o(t)!==o(e))if(this.value=e,this.preserveScrollPosition){var r=this.codeMirror.getScrollInfo();this.codeMirror.setValue(this.value),this.codeMirror.scrollTo(r.left,r.top)}else this.codeMirror.setValue(this.value)}else this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e,this.setOptionIfChanged("readOnly",this.disabled)},e}();i.decorators=[{type:r.Component,args:[{selector:"ngx-codemirror",template:'\n <textarea\n [name]="name"\n class="ngx-codemirror {{ className }}"\n [class.ngx-codemirror--focused]="isFocused"\n autocomplete="off"\n [autofocus]="autoFocus"\n #ref>\n </textarea>\n ',providers:[{provide:t.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return i}),multi:!0}],preserveWhitespaces:!1,changeDetection:r.ChangeDetectionStrategy.OnPush}]}],i.ctorParameters=function(){return[{type:r.KeyValueDiffers},{type:r.NgZone}]},i.propDecorators={className:[{type:r.Input}],name:[{type:r.Input}],autoFocus:[{type:r.Input}],options:[{type:r.Input}],preserveScrollPosition:[{type:r.Input}],cursorActivity:[{type:r.Output}],focusChange:[{type:r.Output}],scroll:[{type:r.Output}],ref:[{type:r.ViewChild,args:["ref"]}]};var n=function(){};n.decorators=[{type:r.NgModule,args:[{imports:[],exports:[i],declarations:[i],providers:[]}]}],n.ctorParameters=function(){return[]},e.CodemirrorComponent=i,e.CodemirrorModule=n,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/forms"],t):t((e.ctrl=e.ctrl||{},e.ctrl["ngx-codemirror"]={}),e.ng.core,e.ng.forms)}(this,function(e,r,t){"use strict";function o(e){return e?e.replace(/\r\n|\r/g,"\n"):e}var n=function(){function e(e,t){this._differs=e,this._ngZone=t,this.className="",this.name="codemirror",this.autoFocus=!1,this.preserveScrollPosition=!1,this.cursorActivity=new r.EventEmitter,this.focusChange=new r.EventEmitter,this.scroll=new r.EventEmitter,this.value="",this.disabled=!1,this.isFocused=!1,this.onChange=function(e){},this.onTouched=function(){}}return Object.defineProperty(e.prototype,"options",{set:function(e){this._options=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var r=this;if(this.ref){var e=require("codemirror").fromTextArea;this._ngZone.runOutsideAngular(function(){r.codeMirror=e(r.ref.nativeElement,r._options),r.codeMirror.on("cursorActivity",r.cursorActive.bind(r)),r.codeMirror.on("scroll",r.scrollChanged.bind(r)),r.codeMirror.on("blur",r.focusChanged.bind(r,!1)),r.codeMirror.on("focus",r.focusChanged.bind(r,!0)),r.codeMirror.on("change",function(e,t){return r._ngZone.run(function(){return r.codemirrorValueChanged(e,t)})}),r.codeMirror.setValue(r.value)})}},e.prototype.ngDoCheck=function(){var t=this;if(this._differ){var e=this._differ.diff(this._options);e&&(e.forEachChangedItem(function(e){return t.setOptionIfChanged(e.key,e.currentValue)}),e.forEachAddedItem(function(e){return t.setOptionIfChanged(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){return t.setOptionIfChanged(e.key,e.currentValue)}))}},e.prototype.ngOnDestroy=function(){this.codeMirror&&this.codeMirror.toTextArea()},e.prototype.codemirrorValueChanged=function(e,t){"setValue"!==t.origin&&(this.value=e.getValue(),this.onChange(this.value))},e.prototype.setOptionIfChanged=function(e,t){this.codeMirror&&this.codeMirror.setOption(e,t)},e.prototype.focusChanged=function(e){this.onTouched(),this.isFocused=e,this.focusChange.emit(e)},e.prototype.scrollChanged=function(e){this.scroll.emit(e.getScrollInfo())},e.prototype.cursorActive=function(e){this.cursorActivity.emit(e)},e.prototype.writeValue=function(e){if(null!==e&&e!==undefined)if(this.codeMirror){var t=this.codeMirror.getValue();if(e!==t&&o(t)!==o(e))if(this.value=e,this.preserveScrollPosition){var r=this.codeMirror.getScrollInfo();this.codeMirror.setValue(this.value),this.codeMirror.scrollTo(r.left,r.top)}else this.codeMirror.setValue(this.value)}else this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e,this.setOptionIfChanged("readOnly",this.disabled)},e}();n.decorators=[{type:r.Component,args:[{selector:"ngx-codemirror",template:'\n <textarea\n [name]="name"\n class="ngx-codemirror {{ className }}"\n [class.ngx-codemirror--focused]="isFocused"\n autocomplete="off"\n [autofocus]="autoFocus"\n #ref>\n </textarea>\n ',providers:[{provide:t.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return n}),multi:!0}],preserveWhitespaces:!1,changeDetection:r.ChangeDetectionStrategy.OnPush}]}],n.ctorParameters=function(){return[{type:r.KeyValueDiffers},{type:r.NgZone}]},n.propDecorators={className:[{type:r.Input}],name:[{type:r.Input}],autoFocus:[{type:r.Input}],options:[{type:r.Input}],preserveScrollPosition:[{type:r.Input}],cursorActivity:[{type:r.Output}],focusChange:[{type:r.Output}],scroll:[{type:r.Output}],ref:[{type:r.ViewChild,args:["ref"]}]};var i=function(){};i.decorators=[{type:r.NgModule,args:[{imports:[],exports:[n],declarations:[n],providers:[]}]}],i.ctorParameters=function(){return[]},e.CodemirrorComponent=n,e.CodemirrorModule=i,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ctrl-ngx-codemirror.umd.min.js.map |
@@ -77,7 +77,7 @@ import { forwardRef, ChangeDetectionStrategy, Component, EventEmitter, Input, KeyValueDiffers, NgZone, Output, ViewChild, NgModule } from '@angular/core'; | ||
this.codeMirror.on('scroll', this.scrollChanged.bind(this)); | ||
this.codeMirror.on('blur', this.focusChanged.bind(this, false)); | ||
this.codeMirror.on('focus', this.focusChanged.bind(this, true)); | ||
this.codeMirror.on('change', (cm, change) => this._ngZone.run(() => this.codemirrorValueChanged(cm, change))); | ||
this.codeMirror.setValue(this.value); | ||
}); | ||
this.codeMirror.on('blur', this.focusChanged.bind(this, false)); | ||
this.codeMirror.on('focus', this.focusChanged.bind(this, true)); | ||
this.codeMirror.on('change', this.codemirrorValueChanged.bind(this)); | ||
this.codeMirror.setValue(this.value); | ||
} | ||
@@ -84,0 +84,0 @@ /** |
@@ -47,7 +47,7 @@ import { forwardRef, ChangeDetectionStrategy, Component, EventEmitter, Input, KeyValueDiffers, NgZone, Output, ViewChild, NgModule } from '@angular/core'; | ||
_this.codeMirror.on('scroll', _this.scrollChanged.bind(_this)); | ||
_this.codeMirror.on('blur', _this.focusChanged.bind(_this, false)); | ||
_this.codeMirror.on('focus', _this.focusChanged.bind(_this, true)); | ||
_this.codeMirror.on('change', function (cm, change) { return _this._ngZone.run(function () { return _this.codemirrorValueChanged(cm, change); }); }); | ||
_this.codeMirror.setValue(_this.value); | ||
}); | ||
this.codeMirror.on('blur', this.focusChanged.bind(this, false)); | ||
this.codeMirror.on('focus', this.focusChanged.bind(this, true)); | ||
this.codeMirror.on('change', this.codemirrorValueChanged.bind(this)); | ||
this.codeMirror.setValue(this.value); | ||
}; | ||
@@ -54,0 +54,0 @@ CodemirrorComponent.prototype.ngDoCheck = function () { |
{ | ||
"$schema": "../../node_modules/ng-packagr/package.schema.json", | ||
"name": "@ctrl/ngx-codemirror", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "CodeMirror wrapper for Angular", | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
85482