Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ctrl/ngx-codemirror

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ctrl/ngx-codemirror - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

2

bundles/ctrl-ngx-codemirror.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms')) :
typeof define === 'function' && define.amd ? define('@ctrl/ngx-codemirror', ['exports', '@angular/core', '@angular/forms'], factory) :
(global = global || self, factory((global.ctrl = global.ctrl || {}, global.ctrl['ngx-codemirror'] = {}), global.ng.core, global.ng.forms));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ctrl = global.ctrl || {}, global.ctrl['ngx-codemirror'] = {}), global.ng.core, global.ng.forms));
}(this, (function (exports, core, forms) { 'use strict';

@@ -6,0 +6,0 @@

@@ -1,2 +0,2 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@ctrl/ngx-codemirror",["exports","@angular/core","@angular/forms"],r):r(((e=e||self).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.drop=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:!1,configurable:!0}),Object.defineProperty(e.prototype,"codeMirrorGlobal",{get:function(){return this._codeMirror||(this._codeMirror="undefined"!=typeof CodeMirror?CodeMirror:require("codemirror")),this._codeMirror},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this.ref&&this._ngZone.runOutsideAngular((function(){e.codeMirror=e.codeMirrorGlobal.fromTextArea(e.ref.nativeElement,e._options),e.codeMirror.on("cursorActivity",(function(r){return e._ngZone.run((function(){return e.cursorActive(r)}))})),e.codeMirror.on("scroll",e.scrollChanged.bind(e)),e.codeMirror.on("blur",(function(){return e._ngZone.run((function(){return e.focusChanged(!1)}))})),e.codeMirror.on("focus",(function(){return e._ngZone.run((function(){return e.focusChanged(!0)}))})),e.codeMirror.on("change",(function(r,t){return e._ngZone.run((function(){return e.codemirrorValueChanged(r,t)}))})),e.codeMirror.on("drop",(function(r,t){e._ngZone.run((function(){return e.dropFiles(r,t)}))})),e.codeMirror.setValue(e.value)}))},e.prototype.ngDoCheck=function(){var e=this;if(this._differ){var r=this._differ.diff(this._options);r&&(r.forEachChangedItem((function(r){return e.setOptionIfChanged(r.key,r.currentValue)})),r.forEachAddedItem((function(r){return e.setOptionIfChanged(r.key,r.currentValue)})),r.forEachRemovedItem((function(r){return e.setOptionIfChanged(r.key,r.currentValue)})))}},e.prototype.ngOnDestroy=function(){this.codeMirror&&this.codeMirror.toTextArea()},e.prototype.codemirrorValueChanged=function(e,r){"setValue"!==r.origin&&(this.value=e.getValue(),this.onChange(this.value))},e.prototype.setOptionIfChanged=function(e,r){this.codeMirror&&this.codeMirror.setOption(e,r)},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.dropFiles=function(e,r){this.drop.emit([e,r])},e.prototype.writeValue=function(e){if(null!=e)if(this.codeMirror){var r=this.codeMirror.getValue();if(e!==r&&o(r)!==o(e))if(this.value=e,this.preserveScrollPosition){var t=this.codeMirror.getScrollInfo();this.codeMirror.setValue(this.value),this.codeMirror.scrollTo(t.left,t.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 >\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}],drop:[{type:r.Output}],ref:[{type:r.ViewChild,args:["ref",{static:!0}]}]};var i=function(){};i.decorators=[{type:r.NgModule,args:[{exports:[n],declarations:[n]}]}],e.CodemirrorComponent=n,e.CodemirrorModule=i,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@ctrl/ngx-codemirror",["exports","@angular/core","@angular/forms"],r):r(((e="undefined"!=typeof globalThis?globalThis:e||self).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.drop=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:!1,configurable:!0}),Object.defineProperty(e.prototype,"codeMirrorGlobal",{get:function(){return this._codeMirror||(this._codeMirror="undefined"!=typeof CodeMirror?CodeMirror:require("codemirror")),this._codeMirror},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this.ref&&this._ngZone.runOutsideAngular((function(){e.codeMirror=e.codeMirrorGlobal.fromTextArea(e.ref.nativeElement,e._options),e.codeMirror.on("cursorActivity",(function(r){return e._ngZone.run((function(){return e.cursorActive(r)}))})),e.codeMirror.on("scroll",e.scrollChanged.bind(e)),e.codeMirror.on("blur",(function(){return e._ngZone.run((function(){return e.focusChanged(!1)}))})),e.codeMirror.on("focus",(function(){return e._ngZone.run((function(){return e.focusChanged(!0)}))})),e.codeMirror.on("change",(function(r,t){return e._ngZone.run((function(){return e.codemirrorValueChanged(r,t)}))})),e.codeMirror.on("drop",(function(r,t){e._ngZone.run((function(){return e.dropFiles(r,t)}))})),e.codeMirror.setValue(e.value)}))},e.prototype.ngDoCheck=function(){var e=this;if(this._differ){var r=this._differ.diff(this._options);r&&(r.forEachChangedItem((function(r){return e.setOptionIfChanged(r.key,r.currentValue)})),r.forEachAddedItem((function(r){return e.setOptionIfChanged(r.key,r.currentValue)})),r.forEachRemovedItem((function(r){return e.setOptionIfChanged(r.key,r.currentValue)})))}},e.prototype.ngOnDestroy=function(){this.codeMirror&&this.codeMirror.toTextArea()},e.prototype.codemirrorValueChanged=function(e,r){"setValue"!==r.origin&&(this.value=e.getValue(),this.onChange(this.value))},e.prototype.setOptionIfChanged=function(e,r){this.codeMirror&&this.codeMirror.setOption(e,r)},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.dropFiles=function(e,r){this.drop.emit([e,r])},e.prototype.writeValue=function(e){if(null!=e)if(this.codeMirror){var r=this.codeMirror.getValue();if(e!==r&&o(r)!==o(e))if(this.value=e,this.preserveScrollPosition){var t=this.codeMirror.getScrollInfo();this.codeMirror.setValue(this.value),this.codeMirror.scrollTo(t.left,t.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 >\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}],drop:[{type:r.Output}],ref:[{type:r.ViewChild,args:["ref",{static:!0}]}]};var i=function(){};i.decorators=[{type:r.NgModule,args:[{exports:[n],declarations:[n]}]}],e.CodemirrorComponent=n,e.CodemirrorModule=i,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ctrl-ngx-codemirror.umd.min.js.map
{
"$schema": "../../node_modules/ng-packagr/package.schema.json",
"name": "@ctrl/ngx-codemirror",
"version": "4.0.0",
"version": "4.0.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "description": "CodeMirror wrapper for Angular",

@@ -26,3 +26,3 @@ <div align="center">

| 2.2.1 | 8.x |
| 3.1.3 | >= 9.x |
| 3.1.3 | 9.x |
| current | >= 10.x |

@@ -51,3 +51,3 @@

Import `CodemirrorModule` and `FormsModule` and bring in the [codemirror files for parsing the langague](https://codemirror.net/mode/index.html) you wish to use.
Import `CodemirrorModule` and `FormsModule` and bring in the [codemirror files for parsing the language](https://codemirror.net/mode/index.html) you wish to use.

@@ -54,0 +54,0 @@ In your `NgModule`:

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc