ees-jsoneditor 2.0.0 → 2.1.0
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.
- package/README.md +3 -3
- package/package.json +1 -1
- package/projects/ees-jsoneditor/README.md +2 -2
- package/projects/ees-jsoneditor/src/lib/jsoneditor.component.spec.ts +6 -6
- package/projects/ees-jsoneditor/src/lib/jsoneditor.component.ts +2 -2
- package/src/app/demo/demo.component.spec.ts +2 -2
- package/src/app/demo/demo.component.ts +4 -4
package/README.md
CHANGED
|
@@ -31,19 +31,19 @@ Import the standalone component as below:
|
|
|
31
31
|
|
|
32
32
|
```ts
|
|
33
33
|
import { Component, ViewChild } from '@angular/core';
|
|
34
|
-
import {
|
|
34
|
+
import { EeJsonEditorComponent, JsonEditorOptions } from 'ees-jsoneditor';
|
|
35
35
|
|
|
36
36
|
@Component({
|
|
37
37
|
selector: 'app-root',
|
|
38
38
|
template: '<json-editor [options]="editorOptions" [data]="data"></json-editor>',
|
|
39
39
|
styleUrls: ['./app.component.css'],
|
|
40
|
-
imports: [
|
|
40
|
+
imports: [EeJsonEditorComponent]
|
|
41
41
|
})
|
|
42
42
|
export class AppComponent {
|
|
43
43
|
public editorOptions: JsonEditorOptions;
|
|
44
44
|
public data: any;
|
|
45
45
|
// optional
|
|
46
|
-
@ViewChild(
|
|
46
|
+
@ViewChild(EeJsonEditorComponent, { static: false }) editor: EeJsonEditorComponent;
|
|
47
47
|
|
|
48
48
|
constructor() {
|
|
49
49
|
this.editorOptions = new JsonEditorOptions()
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ Then setup your component models as below :
|
|
|
48
48
|
|
|
49
49
|
```ts
|
|
50
50
|
import { Component, ViewChild } from '@angular/core';
|
|
51
|
-
import {
|
|
51
|
+
import { EeJsonEditorComponent, JsonEditorOptions } from 'ees-jsoneditor';
|
|
52
52
|
|
|
53
53
|
@Component({
|
|
54
54
|
selector: 'app-root',
|
|
@@ -58,7 +58,7 @@ import { InfinityJsonEditorComponent, JsonEditorOptions } from 'ees-jsoneditor';
|
|
|
58
58
|
export class AppComponent {
|
|
59
59
|
public editorOptions: JsonEditorOptions;
|
|
60
60
|
public data: any;
|
|
61
|
-
@ViewChild(
|
|
61
|
+
@ViewChild(EeJsonEditorComponent, { static: false }) editor: EeJsonEditorComponent;
|
|
62
62
|
|
|
63
63
|
constructor() {
|
|
64
64
|
this.editorOptions = new JsonEditorOptions()
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { EeJsonEditorComponent } from './jsoneditor.component';
|
|
4
4
|
|
|
5
|
-
describe('
|
|
6
|
-
let component:
|
|
7
|
-
let fixture: ComponentFixture<
|
|
5
|
+
describe('EeJsonEditorComponent', () => {
|
|
6
|
+
let component: EeJsonEditorComponent;
|
|
7
|
+
let fixture: ComponentFixture<EeJsonEditorComponent>;
|
|
8
8
|
|
|
9
9
|
beforeEach(waitForAsync(() => {
|
|
10
10
|
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [
|
|
11
|
+
declarations: [ EeJsonEditorComponent ]
|
|
12
12
|
})
|
|
13
13
|
.compileComponents();
|
|
14
14
|
}));
|
|
15
15
|
|
|
16
16
|
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(
|
|
17
|
+
fixture = TestBed.createComponent(EeJsonEditorComponent);
|
|
18
18
|
component = fixture.componentInstance;
|
|
19
19
|
fixture.detectChanges();
|
|
20
20
|
});
|
|
@@ -27,7 +27,7 @@ import { IError, JsonEditorMode, JsonEditorOptions, JsonEditorTreeNode } from '.
|
|
|
27
27
|
providers: [
|
|
28
28
|
{
|
|
29
29
|
provide: NG_VALUE_ACCESSOR,
|
|
30
|
-
useExisting: forwardRef(() =>
|
|
30
|
+
useExisting: forwardRef(() => EeJsonEditorComponent),
|
|
31
31
|
multi: true
|
|
32
32
|
}
|
|
33
33
|
],
|
|
@@ -35,7 +35,7 @@ import { IError, JsonEditorMode, JsonEditorOptions, JsonEditorTreeNode } from '.
|
|
|
35
35
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
-
export class
|
|
38
|
+
export class EeJsonEditorComponent implements ControlValueAccessor, OnInit, OnDestroy {
|
|
39
39
|
@ViewChild('jsonEditorContainer', { static: true }) jsonEditorContainer: ElementRef;
|
|
40
40
|
@Input() options: JsonEditorOptions = new JsonEditorOptions();
|
|
41
41
|
@Output()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
-
import {
|
|
2
|
+
import { EeJsonEditorComponent } from 'ees-jsoneditor';
|
|
3
3
|
import { DemoComponent } from './demo.component';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ describe('DemoComponent', () => {
|
|
|
10
10
|
beforeEach(waitForAsync(() => {
|
|
11
11
|
TestBed.configureTestingModule({
|
|
12
12
|
imports: [
|
|
13
|
-
|
|
13
|
+
EeJsonEditorComponent,
|
|
14
14
|
FormsModule,
|
|
15
15
|
ReactiveFormsModule,
|
|
16
16
|
DemoComponent
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { EeJsonEditorComponent, JsonEditorOptions } from '../../../projects/ees-jsoneditor/src/public-api';
|
|
3
3
|
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
|
4
4
|
import { schema } from './schema.value';
|
|
5
5
|
import { ShowComponent } from './show.component';
|
|
@@ -7,15 +7,15 @@ import { CommonModule } from '@angular/common';
|
|
|
7
7
|
|
|
8
8
|
@Component({
|
|
9
9
|
standalone: true,
|
|
10
|
-
imports: [CommonModule, ReactiveFormsModule,
|
|
10
|
+
imports: [CommonModule, ReactiveFormsModule, EeJsonEditorComponent, ShowComponent],
|
|
11
11
|
selector: 'app-demo',
|
|
12
12
|
templateUrl: './demo.component.html',
|
|
13
13
|
styleUrls: ['./demo.component.css']
|
|
14
14
|
})
|
|
15
15
|
export class DemoComponent implements OnInit {
|
|
16
16
|
|
|
17
|
-
@ViewChild('editor', { static: false }) editor:
|
|
18
|
-
@ViewChild('editorTwo', { static: false }) editorTwo:
|
|
17
|
+
@ViewChild('editor', { static: false }) editor: EeJsonEditorComponent;
|
|
18
|
+
@ViewChild('editorTwo', { static: false }) editorTwo: EeJsonEditorComponent;
|
|
19
19
|
|
|
20
20
|
public editorOptions: JsonEditorOptions;
|
|
21
21
|
public data: any;
|