ees-jsoneditor 2.0.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.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +183 -0
  3. package/angular.json +169 -0
  4. package/e2e/app.e2e-spec.ts +17 -0
  5. package/e2e/app.po.ts +11 -0
  6. package/e2e/tsconfig.e2e.json +12 -0
  7. package/package.json +79 -0
  8. package/projects/ees-jsoneditor/.eslintrc.json +37 -0
  9. package/projects/ees-jsoneditor/README.md +200 -0
  10. package/projects/ees-jsoneditor/ng-package.json +7 -0
  11. package/projects/ees-jsoneditor/package.json +27 -0
  12. package/projects/ees-jsoneditor/src/lib/jsoneditor.component.spec.ts +25 -0
  13. package/projects/ees-jsoneditor/src/lib/jsoneditor.component.ts +269 -0
  14. package/projects/ees-jsoneditor/src/lib/jsoneditoroptions.ts +166 -0
  15. package/projects/ees-jsoneditor/src/public-api.ts +6 -0
  16. package/projects/ees-jsoneditor/tsconfig.lib.json +14 -0
  17. package/projects/ees-jsoneditor/tsconfig.lib.prod.json +10 -0
  18. package/projects/ees-jsoneditor/tsconfig.spec.json +14 -0
  19. package/renovate.json +38 -0
  20. package/src/app/app.component.css +0 -0
  21. package/src/app/app.component.html +6 -0
  22. package/src/app/app.component.spec.ts +27 -0
  23. package/src/app/app.component.ts +13 -0
  24. package/src/app/app.config.ts +8 -0
  25. package/src/app/app.routes.ts +7 -0
  26. package/src/app/demo/demo.component.css +1 -0
  27. package/src/app/demo/demo.component.html +65 -0
  28. package/src/app/demo/demo.component.spec.ts +31 -0
  29. package/src/app/demo/demo.component.ts +211 -0
  30. package/src/app/demo/schema.value.ts +111 -0
  31. package/src/app/demo/show.component.ts +15 -0
  32. package/src/assets/.gitkeep +0 -0
  33. package/src/assets/printDemo.png +0 -0
  34. package/src/environments/environment.prod.ts +3 -0
  35. package/src/environments/environment.ts +8 -0
  36. package/src/favicon.ico +0 -0
  37. package/src/index.html +14 -0
  38. package/src/main.ts +6 -0
  39. package/src/styles.scss +2 -0
  40. package/tsconfig.app.json +14 -0
  41. package/tsconfig.json +39 -0
  42. package/tsconfig.spec.json +14 -0
@@ -0,0 +1,200 @@
1
+ # Angular Json Editor
2
+
3
+
4
+ Angular Json Editor (wrapper for [jsoneditor](https://github.com/josdejong/jsoneditor)). View/Edit Json file with formatting.
5
+
6
+ [StackBlitz template](https://stackblitz.com/edit/ees-jsoneditor)
7
+
8
+ Working with latest Angular 20.
9
+
10
+ ![Demo Image](/src/assets/printDemo.png)
11
+
12
+ ## Installation
13
+
14
+ To install this library with npm, run below command:
15
+
16
+ $ npm install --save jsoneditor ees-jsoneditor
17
+
18
+
19
+ Example:
20
+
21
+ ```html
22
+ <json-editor [options]="editorOptions" [data]="data" (change)="getData($event)"></json-editor>
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### Configuration
28
+
29
+ First, Import Angular JsonEditor module in root
30
+
31
+ ```ts
32
+ import { NgJsonEditorModule } from 'ees-jsoneditor'
33
+
34
+ @NgModule({
35
+ declarations: [
36
+ AppComponent
37
+ ],
38
+ imports: [
39
+ ....,
40
+ NgJsonEditorModule
41
+ ],
42
+ providers: [],
43
+ bootstrap: [AppComponent]
44
+ })
45
+ export class AppModule { }
46
+ ```
47
+ Then setup your component models as below :
48
+
49
+ ```ts
50
+ import { Component, ViewChild } from '@angular/core';
51
+ import { InfinityJsonEditorComponent, JsonEditorOptions } from 'ees-jsoneditor';
52
+
53
+ @Component({
54
+ selector: 'app-root',
55
+ template: '<json-editor [options]="editorOptions" [data]="data"></json-editor>',
56
+ styleUrls: ['./app.component.css']
57
+ })
58
+ export class AppComponent {
59
+ public editorOptions: JsonEditorOptions;
60
+ public data: any;
61
+ @ViewChild(InfinityJsonEditorComponent, { static: false }) editor: InfinityJsonEditorComponent;
62
+
63
+ constructor() {
64
+ this.editorOptions = new JsonEditorOptions()
65
+ this.editorOptions.modes = ['code', 'text', 'tree', 'view']; // set all allowed modes
66
+ //this.options.mode = 'code'; //set only one mode
67
+
68
+ this.data = {"products":[{"name":"car","product":[{"name":"honda","model":[{"id":"civic","name":"civic"},{"id":"accord","name":"accord"},{"id":"crv","name":"crv"},{"id":"pilot","name":"pilot"},{"id":"odyssey","name":"odyssey"}]}]}]}
69
+ }
70
+
71
+ }
72
+ ```
73
+ Note : For better styling, add below line to your main style.css file
74
+
75
+ ```js
76
+ @import "~jsoneditor/dist/jsoneditor.min.css";
77
+ ```
78
+
79
+
80
+ ### Forms
81
+
82
+ Build it integrated with ReactiveForms:
83
+
84
+ ```ts
85
+ this.form = this.fb.group({
86
+ myinput: [this.data]
87
+ });
88
+ ```
89
+ ```html
90
+ <form [formGroup]="form" (submit)="submit()">
91
+ <json-editor [options]="editorOptions2" formControlName="myinput">
92
+ </json-editor>
93
+ </form>
94
+ ```
95
+
96
+ ### Extra Features
97
+
98
+ Besides all the
99
+ [configuration options](https://github.com/josdejong/jsoneditor/blob/master/docs/api.md)
100
+ from the original jsoneditor, Angular Json Editor supports one additional option:
101
+
102
+ _expandAll_ - to automatically expand all nodes upon json loaded with the _data_ input.
103
+
104
+ # Troubleshoot
105
+
106
+ If you have issue with the height of the component, you can try one of those solutions:
107
+
108
+ When you import CSS:
109
+
110
+ ```css
111
+ @import "~jsoneditor/dist/jsoneditor.min.css";
112
+ textarea.jsoneditor-text{min-height:350px;}
113
+ ```
114
+
115
+ Or Customizing the CSS:
116
+
117
+ ```css
118
+ :host ::ng-deep json-editor,
119
+ :host ::ng-deep json-editor .jsoneditor,
120
+ :host ::ng-deep json-editor > div,
121
+ :host ::ng-deep json-editor jsoneditor-outer {
122
+ height: 500px;
123
+ }
124
+ ```
125
+
126
+ Or as a inner style in component:
127
+
128
+ ```html
129
+ <json-editor class="col-md-12" #editorExample style="min-height: 300px;" [options]="editorOptionsData" [data]="dataStructure"></json-editor>
130
+ ```
131
+
132
+ For code view you can change the height using this example:
133
+ ```css
134
+ .ace_editor.ace-jsoneditor {
135
+ min-height: 500px;
136
+ }
137
+ ```
138
+
139
+ Use debug mode to see in your console the data and options passed to jsoneditor. Copy this and paste in your issue when reporting bugs.
140
+
141
+ ```html
142
+ <json-editor [debug]="true" [options]="editorOptionsData" [data]="dataStructure"></json-editor>
143
+ ```
144
+
145
+ ## JSONOptions missing params
146
+
147
+ If you find youself trying to use an custom option that is not mapped here, you can do:
148
+
149
+ ```ts
150
+ let editorOptions: JsonEditorOptions = new JsonEditorOptions(); (<any>this.editorOptions).templates = [{menu options objects as in json editor documentation}]
151
+ ```
152
+
153
+ See the [issue](https://github.com/yasir-nazir/ees-jsoneditor/issues/57)
154
+
155
+ ## Internet Explorer
156
+
157
+ If you want to support IE, please follow this guide:
158
+ * https://github.com/yasir-nazir/ees-jsoneditor/issues/44#issuecomment-508650610
159
+
160
+ ## Multiple editors
161
+
162
+ To use multiple jsoneditors in your view you cannot use the same editor options.
163
+
164
+ You should have something like:
165
+
166
+ ```html
167
+ <div *ngFor="let prd of data.products" class="w-100-p p-24" >
168
+ <json-editor [options]="makeOptions()" [data]="prd" (change)="showJson($event)"></json-editor>
169
+ </div>
170
+ ```
171
+
172
+ ```ts
173
+ makeOptions = () => {
174
+ const options = new JsonEditorOptions();
175
+ options.modes = ['code', 'text', 'tree', 'view'];
176
+ return options;
177
+ }
178
+ ```
179
+
180
+ # Demo
181
+
182
+ Demo component files are included in Git Project.
183
+
184
+ Demo Project with a lot of different implementations (ngInit, change event and others):
185
+ [https://github.com/yasir-nazir/ees-jsoneditor/tree/master/src/app/demo)
186
+
187
+ When publishing it to npm, look over this docs: https://docs.npmjs.com/misc/developers
188
+
189
+ # Collaborate
190
+
191
+ Fork, clone this repo and install dependencies.
192
+ This project just works with webpack 4 (dont change to 5):
193
+
194
+ ```sh
195
+ npm i -g rimraf
196
+ npm i
197
+ ```
198
+
199
+ # License
200
+ MIT(./LICENSE)
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/ees-jsoneditor",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "ees-jsoneditor",
3
+ "version": "4.0.1",
4
+ "license": "MIT",
5
+ "homepage": "hhttps://github.com/yasir-nazir/ees-jsoneditor",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/yasir-nazir/ees-jsoneditor.git"
9
+ },
10
+ "author": "Yasir Nazir <eesystem2010@gmail.com>",
11
+ "keywords": [
12
+ "angular",
13
+ "jsoneditor",
14
+ "ees-jsoneditor",
15
+ "ng-jsoneditor",
16
+ "angular"
17
+ ],
18
+ "peerDependencies": {
19
+ "@angular/common": "^20.3.0",
20
+ "@angular/core": "^20.3.0",
21
+ "jsoneditor": "*"
22
+ },
23
+ "dependencies": {
24
+ "tslib": "^2.3.0"
25
+ },
26
+ "sideEffects": false
27
+ }
@@ -0,0 +1,25 @@
1
+ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { InfinityJsonEditorComponent } from './jsoneditor.component';
4
+
5
+ describe('InfinityJsonEditorComponent', () => {
6
+ let component: InfinityJsonEditorComponent;
7
+ let fixture: ComponentFixture<InfinityJsonEditorComponent>;
8
+
9
+ beforeEach(waitForAsync(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [ InfinityJsonEditorComponent ]
12
+ })
13
+ .compileComponents();
14
+ }));
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(InfinityJsonEditorComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should be created', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,269 @@
1
+ /* eslint-disable @typescript-eslint/ban-types */
2
+ /* eslint-disable @angular-eslint/no-input-rename */
3
+ /* eslint-disable @angular-eslint/no-output-native */
4
+
5
+ import JSONEditor from 'jsoneditor';
6
+
7
+ import {
8
+ ChangeDetectionStrategy,
9
+ Component,
10
+ ElementRef,
11
+ EventEmitter,
12
+ Input,
13
+ OnDestroy,
14
+ OnInit,
15
+ Output,
16
+ ViewChild,
17
+ forwardRef
18
+ } from '@angular/core';
19
+ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
20
+ import { IError, JsonEditorMode, JsonEditorOptions, JsonEditorTreeNode } from './jsoneditoroptions';
21
+
22
+ @Component({
23
+ // eslint-disable-next-line @angular-eslint/component-selector
24
+ selector: 'json-editor',
25
+ standalone: true,
26
+ template: `<div [id]="id" #jsonEditorContainer></div>`,
27
+ providers: [
28
+ {
29
+ provide: NG_VALUE_ACCESSOR,
30
+ useExisting: forwardRef(() => InfinityJsonEditorComponent),
31
+ multi: true
32
+ }
33
+ ],
34
+ preserveWhitespaces: false,
35
+ changeDetection: ChangeDetectionStrategy.OnPush
36
+ })
37
+
38
+ export class InfinityJsonEditorComponent implements ControlValueAccessor, OnInit, OnDestroy {
39
+ @ViewChild('jsonEditorContainer', { static: true }) jsonEditorContainer: ElementRef;
40
+ @Input() options: JsonEditorOptions = new JsonEditorOptions();
41
+ @Output()
42
+ change: EventEmitter<any> = new EventEmitter<any>();
43
+ @Output()
44
+ jsonChange: EventEmitter<any> = new EventEmitter<any>();
45
+ @Input() debug = false;
46
+ public optionsChanged = false;
47
+
48
+ disabled = false;
49
+ isFocused = false;
50
+
51
+ public id = 'angjsoneditor' + Math.floor(Math.random() * 1000000);
52
+ private _data: Object = {};
53
+ private editor: JSONEditor;
54
+
55
+ constructor() { }
56
+
57
+ @Input('data')
58
+ set data(value: Object) {
59
+ this._data = value;
60
+ if (this.editor) {
61
+ this.editor.destroy();
62
+ this.ngOnInit();
63
+ }
64
+ }
65
+
66
+ ngOnInit() {
67
+ let optionsBefore = this.options;
68
+ if (!this.optionsChanged && this.editor) {
69
+ //TODO: check if this is needed
70
+ optionsBefore = (this.editor as any).options;
71
+ }
72
+
73
+ if (!this.options.onChangeJSON && this.jsonChange) {
74
+ this.options.onChangeJSON = this.onChangeJSON;
75
+ }
76
+ if (!this.options.onChange && this.change) {
77
+ this.options.onChange = this.onChange;
78
+ }
79
+ const optionsCopy = Object.assign({}, optionsBefore);
80
+
81
+ // expandAll is an option only supported by ees-jsoneditor and not by the the original jsoneditor.
82
+ delete optionsCopy.expandAll;
83
+ if (this.debug) {
84
+ console.log(optionsCopy, this._data);
85
+ }
86
+ if (!this.jsonEditorContainer.nativeElement) {
87
+ console.error(`Can't find the ElementRef reference for jsoneditor)`);
88
+ }
89
+
90
+ if (
91
+ optionsCopy.mode === 'text' || optionsCopy.mode === 'code' ||
92
+ (
93
+ optionsCopy.modes &&
94
+ (optionsCopy.modes.indexOf('text') !== -1 || optionsCopy.modes.indexOf('code') !== -1)
95
+ )
96
+ ) {
97
+ optionsCopy.onChangeJSON = undefined;
98
+ }
99
+ this.editor = new JSONEditor(this.jsonEditorContainer.nativeElement, optionsCopy as any, this._data);
100
+
101
+ if (this.options.expandAll) {
102
+ this.editor.expandAll();
103
+ }
104
+ }
105
+
106
+ ngOnDestroy() {
107
+ this.destroy();
108
+ }
109
+
110
+
111
+ /**
112
+ * ngModel
113
+ * ControlValueAccessor
114
+ */
115
+
116
+ // ControlValueAccessor implementation
117
+ writeValue(value: any) {
118
+ this.data = value;
119
+ }
120
+
121
+ // Implemented as part of ControlValueAccessor
122
+ registerOnChange(fn: any) {
123
+ this.onChangeModel = fn;
124
+ }
125
+
126
+ // Implemented as part of ControlValueAccessor.
127
+ registerOnTouched(fn: any) {
128
+ this.onTouched = fn;
129
+ }
130
+
131
+ // Implemented as part of ControlValueAccessor.
132
+ setDisabledState(isDisabled: boolean): void {
133
+ this.disabled = isDisabled;
134
+ }
135
+
136
+ public onChange = () => {
137
+ if (this.editor) {
138
+ try {
139
+ const json = this.editor.get();
140
+ this.onChangeModel(json);
141
+ this.change.emit(json);
142
+ } catch (error) {
143
+ if (this.debug) {
144
+ console.log(error);
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ public onChangeJSON = () => {
151
+ if (this.editor) {
152
+ try {
153
+ this.jsonChange.emit(this.editor.get());
154
+ } catch (error) {
155
+ if (this.debug) {
156
+ console.log(error);
157
+ }
158
+ }
159
+ }
160
+ }
161
+
162
+
163
+ /**
164
+ * JSON EDITOR FUNCTIONS
165
+ */
166
+
167
+ public collapseAll() {
168
+ this.editor.collapseAll();
169
+ }
170
+
171
+ public expandAll() {
172
+ this.editor.expandAll();
173
+ }
174
+
175
+ public focus() {
176
+ this.editor.focus();
177
+ }
178
+
179
+ public get(): JSON {
180
+ return this.editor.get();
181
+ }
182
+
183
+ public getMode(): JsonEditorMode {
184
+ return this.editor.getMode() as JsonEditorMode;
185
+ }
186
+
187
+ public getName(): string {
188
+ return this.editor.getName()!;
189
+ }
190
+
191
+ public getText(): string {
192
+ return this.editor.getText();
193
+ }
194
+
195
+ public set(json: JSON) {
196
+ this.editor.set(json);
197
+ }
198
+
199
+ public setMode(mode: JsonEditorMode) {
200
+ this.editor.setMode(mode);
201
+ }
202
+
203
+ public setName(name: string) {
204
+ this.editor.setName(name);
205
+ }
206
+
207
+ public setSelection(start: any, end: any) {
208
+ this.editor.setSelection(start, end);
209
+ }
210
+
211
+ public getSelection(): any {
212
+ return this.editor.getSelection();
213
+ }
214
+
215
+ public getValidateSchema(): any {
216
+ //TODO: check if this is needed
217
+ return (this.editor as any).validateSchema;
218
+ }
219
+
220
+ public setSchema(schema: any, schemaRefs: any) {
221
+ this.editor.setSchema(schema, schemaRefs);
222
+ }
223
+
224
+ public search(query: string) {
225
+ //TODO: check if this is needed
226
+ (this.editor as any).search(query);
227
+ }
228
+
229
+ public setOptions(newOptions: JsonEditorOptions) {
230
+ if (this.editor) {
231
+ this.editor.destroy();
232
+ }
233
+ this.optionsChanged = true;
234
+ this.options = newOptions;
235
+ this.ngOnInit();
236
+ }
237
+
238
+ public update(json: JSON) {
239
+ this.editor.update(json);
240
+ }
241
+
242
+ public destroy() {
243
+ this.editor.destroy();
244
+ }
245
+
246
+ public getEditor(){
247
+ //TODO: made it any because of the missing type definition
248
+ return this.editor as any;
249
+ }
250
+
251
+ public isValidJson() {
252
+ try {
253
+ JSON.parse(this.getText());
254
+ return true;
255
+ } catch (e) {
256
+ return false;
257
+ }
258
+ }
259
+
260
+ // Implemented as part of ControlValueAccessor.
261
+ private onTouched = () => {
262
+ };
263
+
264
+ // Implemented as part of ControlValueAccessor.
265
+ private onChangeModel = (e: any) => {
266
+ };
267
+ }
268
+
269
+ export { JsonEditorOptions, JsonEditorMode, JsonEditorTreeNode, IError };
@@ -0,0 +1,166 @@
1
+ /* eslint-disable @typescript-eslint/ban-types */
2
+
3
+ export type JsonEditorMode = 'tree' | 'view' | 'form' | 'code' | 'text';
4
+
5
+ export interface JsonEditorTreeNode {
6
+ field: String,
7
+ value: String,
8
+ path: String[]
9
+ }
10
+
11
+ export interface IError {
12
+ path: (string | number)[];
13
+ message: string;
14
+ }
15
+
16
+ export class JsonEditorOptions {
17
+ public ace: any;
18
+ public ajv: Object;
19
+
20
+
21
+ /**
22
+ * {function} onChange Callback method, triggered
23
+ on change of contents.
24
+ Does not pass the contents itself.
25
+ See also `onChangeJSON` and
26
+ `onChangeText`.
27
+ */
28
+ public onChange: () => void;
29
+
30
+ /**
31
+ * // {function} onChangeJSON Callback method, triggered
32
+ // in modes on change of contents,
33
+ // passing the changed contents
34
+ // as JSON.
35
+ // Only applicable for modes
36
+ // 'tree', 'view', and 'form'.
37
+ */
38
+ public onChangeJSON?: () => void;
39
+
40
+
41
+ public onNodeName: () => void;
42
+ public onCreateMenu: (items: Array<any>, node: object) => Array<any>;
43
+ public onColorPicker: () => void;
44
+
45
+ /**
46
+ // {function} onChangeText Callback method, triggered
47
+ // in modes on change of contents,
48
+ // passing the changed contents
49
+ // as stringified JSON.
50
+ */
51
+ public onChangeText: (jsonstr: string) => void;
52
+
53
+
54
+ /**
55
+ * {function} onSelectionChange Callback method,
56
+ triggered on node selection change
57
+ Only applicable for modes
58
+ 'tree', 'view', and 'form'
59
+ */
60
+ public onSelectionChange: () => void;
61
+
62
+ /**
63
+ * {function} onTextSelectionChange Callback method,
64
+ triggered on text selection change
65
+ Only applicable for modes
66
+ */
67
+ public onTextSelectionChange: () => void;
68
+
69
+
70
+ /**
71
+ * // {function} onEvent Callback method, triggered
72
+ // when an event occurs in
73
+ // a JSON field or value.
74
+ // Only applicable for
75
+ // modes 'form', 'tree' and
76
+ // 'view'
77
+ */
78
+ public onEvent: () => void;
79
+
80
+ /**
81
+ * // * {function} onFocus Callback method, triggered
82
+ // when the editor comes into focus,
83
+ // passing an object {type, target},
84
+ // Applicable for all modes
85
+ */
86
+ public onFocus: () => void;
87
+
88
+ // * {function} onBlur Callback method, triggered
89
+ // when the editor goes out of focus,
90
+ // passing an object {type, target},
91
+ // Applicable for all modes
92
+ public onBlur: () => void;
93
+
94
+ /**
95
+ * // * {function} onClassName Callback method, triggered
96
+ // when a Node DOM is rendered. Function returns
97
+ // a css class name to be set on a node.
98
+ // Only applicable for
99
+ // modes 'form', 'tree' and
100
+ // 'view'
101
+ */
102
+ public onClassName: (node: JsonEditorTreeNode) => void;
103
+
104
+ public onEditable: (node: JsonEditorTreeNode | {}) => boolean | { field: boolean, value: boolean };
105
+
106
+ /**
107
+ * {function} onError Callback method, triggered
108
+ when an error occurs
109
+ */
110
+ public onError: (error: any) => void;
111
+ public onModeChange: (newMode: JsonEditorMode, oldMode: JsonEditorMode) => void;
112
+ public onValidate: (json: Object) => IError[];
113
+ public onValidationError: (errors: object[]) => void;
114
+
115
+ public enableSort: boolean;
116
+ public enableTransform: boolean;
117
+ public escapeUnicode: boolean;
118
+ public expandAll?: boolean;
119
+ public sortObjectKeys: boolean;
120
+ public history: boolean;
121
+ public mode: JsonEditorMode;
122
+ public modes: JsonEditorMode[];
123
+ public name: String;
124
+ public schema: Object;
125
+ public search: boolean;
126
+ public indentation: Number;
127
+ public templates: Object;
128
+ public theme: Number;
129
+ public language: String;
130
+ public languages: Object;
131
+ public limitDragging: boolean;
132
+
133
+ /**
134
+ * Adds main menu bar - Contains format, sort, transform, search etc. functionality. True
135
+ * by default. Applicable in all types of mode.
136
+ */
137
+ public mainMenuBar: boolean;
138
+
139
+ /**
140
+ * Adds navigation bar to the menu - the navigation bar visualize the current position on
141
+ * the tree structure as well as allows breadcrumbs navigation.
142
+ * True by default.
143
+ * Only applicable when mode is 'tree', 'form' or 'view'.
144
+ */
145
+ public navigationBar: boolean;
146
+
147
+ /**
148
+ * Adds status bar to the bottom of the editor - the status bar shows the cursor position
149
+ * and a count of the selected characters.
150
+ * True by default.
151
+ * Only applicable when mode is 'code' or 'text'.
152
+ */
153
+ public statusBar: boolean;
154
+
155
+ constructor() {
156
+ this.enableSort = true;
157
+ this.enableTransform = true;
158
+ this.escapeUnicode = false;
159
+ this.expandAll = false;
160
+ this.sortObjectKeys = false;
161
+ this.history = true;
162
+ this.mode = 'tree';
163
+ this.search = true;
164
+ this.indentation = 2;
165
+ }
166
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Public API Surface of my-lib
3
+ */
4
+
5
+ export * from './lib/jsoneditor.component';
6
+ export * from './lib/jsoneditoroptions';