|
|
@ -19,21 +19,23 @@ import { |
|
|
Component, |
|
|
Component, |
|
|
ElementRef, |
|
|
ElementRef, |
|
|
forwardRef, |
|
|
forwardRef, |
|
|
|
|
|
HostBinding, |
|
|
Input, |
|
|
Input, |
|
|
OnDestroy, |
|
|
OnDestroy, |
|
|
OnInit, |
|
|
OnInit, |
|
|
ViewChild |
|
|
ViewChild, |
|
|
|
|
|
ViewEncapsulation |
|
|
} from '@angular/core'; |
|
|
} from '@angular/core'; |
|
|
import { |
|
|
import { |
|
|
|
|
|
AbstractControl, |
|
|
ControlValueAccessor, |
|
|
ControlValueAccessor, |
|
|
UntypedFormControl, |
|
|
|
|
|
NG_VALIDATORS, |
|
|
NG_VALIDATORS, |
|
|
NG_VALUE_ACCESSOR, |
|
|
NG_VALUE_ACCESSOR, |
|
|
Validator, |
|
|
UntypedFormControl, |
|
|
AbstractControl, ValidationErrors |
|
|
ValidationErrors, |
|
|
|
|
|
Validator |
|
|
} from '@angular/forms'; |
|
|
} from '@angular/forms'; |
|
|
import { Ace } from 'ace-builds'; |
|
|
import { Ace } from 'ace-builds'; |
|
|
import { coerceBooleanProperty } from '@angular/cdk/coercion'; |
|
|
|
|
|
import { ActionNotificationHide, ActionNotificationShow } from '@core/notification/notification.actions'; |
|
|
import { ActionNotificationHide, ActionNotificationShow } from '@core/notification/notification.actions'; |
|
|
import { Store } from '@ngrx/store'; |
|
|
import { Store } from '@ngrx/store'; |
|
|
import { AppState } from '@core/core.state'; |
|
|
import { AppState } from '@core/core.state'; |
|
|
@ -48,6 +50,7 @@ export const jsonRequired = (control: AbstractControl): ValidationErrors | null |
|
|
selector: 'tb-json-object-edit', |
|
|
selector: 'tb-json-object-edit', |
|
|
templateUrl: './json-object-edit.component.html', |
|
|
templateUrl: './json-object-edit.component.html', |
|
|
styleUrls: ['./json-object-edit.component.scss'], |
|
|
styleUrls: ['./json-object-edit.component.scss'], |
|
|
|
|
|
encapsulation: ViewEncapsulation.None, |
|
|
providers: [ |
|
|
providers: [ |
|
|
{ |
|
|
{ |
|
|
provide: NG_VALUE_ACCESSOR, |
|
|
provide: NG_VALUE_ACCESSOR, |
|
|
@ -63,6 +66,8 @@ export const jsonRequired = (control: AbstractControl): ValidationErrors | null |
|
|
}) |
|
|
}) |
|
|
export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Validator, OnDestroy { |
|
|
export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Validator, OnDestroy { |
|
|
|
|
|
|
|
|
|
|
|
@HostBinding('style.position') position = 'relative'; |
|
|
|
|
|
|
|
|
@ViewChild('jsonEditor', {static: true}) |
|
|
@ViewChild('jsonEditor', {static: true}) |
|
|
jsonEditorElmRef: ElementRef; |
|
|
jsonEditorElmRef: ElementRef; |
|
|
|
|
|
|
|
|
|