@ng-util/monaco-editor 15.0.0 → 16.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChange, SimpleChanges } from '@angular/core';
1
+ import { AfterViewInit, DestroyRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChange, SimpleChanges } from '@angular/core';
2
2
  import { Subscription } from 'rxjs';
3
3
  import { NuMonacoEditorConfig } from './monaco-editor.config';
4
4
  import { NuMonacoEditorEvent, NuMonacoEditorEventType } from './monaco-editor.types';
@@ -7,6 +7,7 @@ export declare abstract class NuMonacoEditorBase implements AfterViewInit, OnCha
7
7
  protected el: ElementRef<HTMLElement>;
8
8
  protected doc: any;
9
9
  protected ngZone: NgZone;
10
+ protected destroy$: DestroyRef;
10
11
  protected _editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;
11
12
  protected _options: monaco.editor.IStandaloneEditorConstructionOptions;
12
13
  protected _resize$: Subscription | null;
@@ -18,7 +19,7 @@ export declare abstract class NuMonacoEditorBase implements AfterViewInit, OnCha
18
19
  set options(val: monaco.editor.IStandaloneEditorConstructionOptions);
19
20
  get options(): monaco.editor.IStandaloneEditorConstructionOptions;
20
21
  event: EventEmitter<NuMonacoEditorEvent>;
21
- constructor(el: ElementRef<HTMLElement>, config: NuMonacoEditorConfig, doc: any, ngZone: NgZone);
22
+ constructor(el: ElementRef<HTMLElement>, config: NuMonacoEditorConfig, doc: any, ngZone: NgZone, destroy$: DestroyRef);
22
23
  protected abstract initMonaco(_options: monaco.editor.IStandaloneEditorConstructionOptions, _initEvent: boolean): void;
23
24
  protected notifyEvent(type: NuMonacoEditorEventType, other?: NuMonacoEditorEvent): void;
24
25
  protected setDisabled(): this;
@@ -32,5 +33,5 @@ export declare abstract class NuMonacoEditorBase implements AfterViewInit, OnCha
32
33
  } & SimpleChanges): void;
33
34
  ngOnDestroy(): void;
34
35
  static ɵfac: i0.ɵɵFactoryDeclaration<NuMonacoEditorBase, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorBase, "nu-monaco-base", never, { "height": "height"; "delay": "delay"; "disabled": "disabled"; "options": "options"; }, { "event": "event"; }, never, never, true, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorBase, "nu-monaco-base", never, { "height": { "alias": "height"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "event": "event"; }, never, never, true, never>;
36
37
  }
@@ -7,5 +7,5 @@ export declare class NuMonacoEditorDiffComponent extends NuMonacoEditorBase {
7
7
  get editor(): monaco.editor.IStandaloneDiffEditor;
8
8
  initMonaco(options: monaco.editor.IStandaloneEditorConstructionOptions, initEvent: boolean): void;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<NuMonacoEditorDiffComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorDiffComponent, "nu-monaco-diff-editor", ["nuMonacoDiffEditor"], { "old": "old"; "new": "new"; }, {}, never, never, true, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorDiffComponent, "nu-monaco-diff-editor", ["nuMonacoDiffEditor"], { "old": { "alias": "old"; "required": false; }; "new": { "alias": "new"; "required": false; }; }, {}, never, never, true, never>;
11
11
  }
@@ -15,5 +15,5 @@ export declare class NuMonacoEditorComponent extends NuMonacoEditorBase implemen
15
15
  registerOnTouched(fn: any): void;
16
16
  setDisabledState(_isDisabled: boolean): void;
17
17
  static ɵfac: i0.ɵɵFactoryDeclaration<NuMonacoEditorComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorComponent, "nu-monaco-editor", ["nuMonacoEditor"], { "model": "model"; "autoFormat": "autoFormat"; }, {}, never, never, true, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<NuMonacoEditorComponent, "nu-monaco-editor", ["nuMonacoEditor"], { "model": { "alias": "model"; "required": false; }; "autoFormat": { "alias": "autoFormat"; "required": false; }; }, {}, never, never, true, never>;
19
19
  }
@@ -19,4 +19,8 @@ export interface NuMonacoEditorConfig {
19
19
  * The event before the first preload of the monaco editor library is completed, use this function to set nls availableLanguages.
20
20
  */
21
21
  monacoPreLoad?: () => void;
22
+ /**
23
+ * Trigger automatic format delay time, default: `100`
24
+ */
25
+ autoFormatTime?: number;
22
26
  }
@@ -8,7 +8,7 @@ export interface NuMonacoEditorDiffModel {
8
8
  code: string;
9
9
  language?: string;
10
10
  }
11
- export declare type NuMonacoEditorEventType = 'load-error' | 'init' | 're-init' | 'resize' | 'update-diff';
11
+ export type NuMonacoEditorEventType = 'load-error' | 'init' | 're-init' | 'resize' | 'update-diff';
12
12
  export interface NuMonacoEditorEvent {
13
13
  type?: NuMonacoEditorEventType;
14
14
  editor?: monaco.editor.IStandaloneCodeEditor | monaco.editor.IStandaloneDiffEditor;