myrta-ui 17.0.5 → 17.0.7

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.
@@ -0,0 +1,58 @@
1
+ import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { Field } from '../../../services';
4
+ import { JsonEditorMode, JsonEditorOptions } from './utils/jsoneditoroptions';
5
+ import { JsonEditorValueTypes, JsonEditorValueWithId } from './json-editor.enum';
6
+ import * as i0 from "@angular/core";
7
+ export declare class JsonEditorComponent implements ControlValueAccessor, OnInit, OnDestroy {
8
+ private _data;
9
+ private editor;
10
+ optionsChanged: boolean;
11
+ disabled: boolean;
12
+ isFocused: boolean;
13
+ uuid: string;
14
+ fields: Field[];
15
+ options: JsonEditorOptions;
16
+ debug: boolean;
17
+ set data(value: Object);
18
+ changed: EventEmitter<JsonEditorValueTypes>;
19
+ modelChange: EventEmitter<JsonEditorValueWithId>;
20
+ jsonChange: EventEmitter<any>;
21
+ jsonEditorContainer: ElementRef;
22
+ constructor();
23
+ ngOnInit(): void;
24
+ ngOnDestroy(): void;
25
+ onChangeJSON: () => void;
26
+ onChange: () => void;
27
+ /**
28
+ * JSON EDITOR FUNCTIONS
29
+ */
30
+ collapseAll(): void;
31
+ expandAll(): void;
32
+ focus(): void;
33
+ get(): JSON;
34
+ getMode(): JsonEditorMode;
35
+ getName(): string;
36
+ getText(): string;
37
+ set(json: JSON): void;
38
+ setMode(mode: JsonEditorMode): void;
39
+ setName(name: string): void;
40
+ setSelection(start: any, end: any): void;
41
+ getSelection(): any;
42
+ getValidateSchema(): any;
43
+ setSchema(schema: any, schemaRefs: any): void;
44
+ search(query: string): void;
45
+ setOptions(newOptions: JsonEditorOptions): void;
46
+ update(json: JSON): void;
47
+ destroy(): void;
48
+ getEditor(): any;
49
+ isValidJson(): boolean;
50
+ writeValue(value: any): void;
51
+ updateValue(insideValue: any): void;
52
+ registerOnChange(fn: any): void;
53
+ registerOnTouched(fn: () => {}): void;
54
+ private onChangeFn;
55
+ private onTouchedFn;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonEditorComponent, never>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<JsonEditorComponent, "mrx-json-editor", never, { "fields": { "alias": "fields"; "required": false; }; "options": { "alias": "options"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "data": { "alias": "data"; "required": false; }; }, { "changed": "changed"; "modelChange": "modelChange"; "jsonChange": "jsonChange"; }, never, never, false, never>;
58
+ }
@@ -0,0 +1,5 @@
1
+ export type JsonEditorValueTypes = string;
2
+ export interface JsonEditorValueWithId {
3
+ value: JsonEditorValueTypes;
4
+ id: string;
5
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./json-editor.component";
3
+ import * as i2 from "@angular/common";
4
+ export declare class JsonEditorModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonEditorModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<JsonEditorModule, [typeof i1.JsonEditorComponent], [typeof i2.CommonModule], [typeof i1.JsonEditorComponent]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<JsonEditorModule>;
8
+ }
@@ -0,0 +1,128 @@
1
+ export type JsonEditorMode = 'tree' | 'view' | 'form' | 'code' | 'text';
2
+ export interface JsonEditorTreeNode {
3
+ field: String;
4
+ value: String;
5
+ path: String[];
6
+ }
7
+ export interface IError {
8
+ path: (string | number)[];
9
+ message: string;
10
+ }
11
+ export declare class JsonEditorOptions {
12
+ ace: any;
13
+ ajv: Object;
14
+ /**
15
+ * {function} onChange Callback method, triggered
16
+ on change of contents.
17
+ Does not pass the contents itself.
18
+ See also `onChangeJSON` and
19
+ `onChangeText`.
20
+ */
21
+ onChange: () => void;
22
+ /**
23
+ * // {function} onChangeJSON Callback method, triggered
24
+ // in modes on change of contents,
25
+ // passing the changed contents
26
+ // as JSON.
27
+ // Only applicable for modes
28
+ // 'tree', 'view', and 'form'.
29
+ */
30
+ onChangeJSON?: () => void;
31
+ onNodeName: () => void;
32
+ onCreateMenu: (items: Array<any>, node: object) => Array<any>;
33
+ onColorPicker: () => void;
34
+ /**
35
+ // {function} onChangeText Callback method, triggered
36
+ // in modes on change of contents,
37
+ // passing the changed contents
38
+ // as stringified JSON.
39
+ */
40
+ onChangeText: (jsonstr: string) => void;
41
+ /**
42
+ * {function} onSelectionChange Callback method,
43
+ triggered on node selection change
44
+ Only applicable for modes
45
+ 'tree', 'view', and 'form'
46
+ */
47
+ onSelectionChange: () => void;
48
+ /**
49
+ * {function} onTextSelectionChange Callback method,
50
+ triggered on text selection change
51
+ Only applicable for modes
52
+ */
53
+ onTextSelectionChange: () => void;
54
+ /**
55
+ * // {function} onEvent Callback method, triggered
56
+ // when an event occurs in
57
+ // a JSON field or value.
58
+ // Only applicable for
59
+ // modes 'form', 'tree' and
60
+ // 'view'
61
+ */
62
+ onEvent: () => void;
63
+ /**
64
+ * // * {function} onFocus Callback method, triggered
65
+ // when the editor comes into focus,
66
+ // passing an object {type, target},
67
+ // Applicable for all modes
68
+ */
69
+ onFocus: () => void;
70
+ onBlur: () => void;
71
+ /**
72
+ * // * {function} onClassName Callback method, triggered
73
+ // when a Node DOM is rendered. Function returns
74
+ // a css class name to be set on a node.
75
+ // Only applicable for
76
+ // modes 'form', 'tree' and
77
+ // 'view'
78
+ */
79
+ onClassName: (node: JsonEditorTreeNode) => void;
80
+ onEditable: (node: JsonEditorTreeNode | {}) => boolean | {
81
+ field: boolean;
82
+ value: boolean;
83
+ };
84
+ /**
85
+ * {function} onError Callback method, triggered
86
+ when an error occurs
87
+ */
88
+ onError: (error: any) => void;
89
+ onModeChange: (newMode: JsonEditorMode, oldMode: JsonEditorMode) => void;
90
+ onValidate: (json: Object) => IError[];
91
+ onValidationError: (errors: object[]) => void;
92
+ enableSort: boolean;
93
+ enableTransform: boolean;
94
+ escapeUnicode: boolean;
95
+ expandAll?: boolean;
96
+ sortObjectKeys: boolean;
97
+ history: boolean;
98
+ mode: JsonEditorMode;
99
+ modes: JsonEditorMode[];
100
+ name: String;
101
+ schema: Object;
102
+ search: boolean;
103
+ indentation: Number;
104
+ templates: Object;
105
+ theme: Number;
106
+ language: String;
107
+ languages: Object;
108
+ /**
109
+ * Adds main menu bar - Contains format, sort, transform, search etc. functionality. True
110
+ * by default. Applicable in all types of mode.
111
+ */
112
+ mainMenuBar: boolean;
113
+ /**
114
+ * Adds navigation bar to the menu - the navigation bar visualize the current position on
115
+ * the tree structure as well as allows breadcrumbs navigation.
116
+ * True by default.
117
+ * Only applicable when mode is 'tree', 'form' or 'view'.
118
+ */
119
+ navigationBar: boolean;
120
+ /**
121
+ * Adds status bar to the bottom of the editor - the status bar shows the cursor position
122
+ * and a count of the selected characters.
123
+ * True by default.
124
+ * Only applicable when mode is 'code' or 'text'.
125
+ */
126
+ statusBar: boolean;
127
+ constructor();
128
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myrta-ui",
3
- "version": "17.0.5",
3
+ "version": "17.0.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",
@@ -20,7 +20,8 @@
20
20
  "lodash-es": "^4.17.21",
21
21
  "uuid": "^10.0.0",
22
22
  "@popperjs/core": "^2.11.5",
23
- "mrx-gallery-lib": "^1.0.2"
23
+ "mrx-gallery-lib": "^1.0.2",
24
+ "jsoneditor": "^10.1.2"
24
25
  },
25
26
  "dependencies": {
26
27
  "@angular/cdk": "^17.3.0",
@@ -40,6 +41,7 @@
40
41
  "uuid": "^10.0.0",
41
42
  "@popperjs/core": "^2.11.5",
42
43
  "mrx-gallery-lib": "^1.0.2",
44
+ "jsoneditor": "^10.1.2",
43
45
  "tslib": "^2.3.0"
44
46
  },
45
47
  "module": "fesm2022/myrta-ui.mjs",
package/public-api.d.ts CHANGED
@@ -96,6 +96,10 @@ export * from './lib/components/form/input-timepicker/input-timepicker.component
96
96
  export * from './lib/components/form/editor/editor.module';
97
97
  export * from './lib/components/form/editor/editor.component';
98
98
  export * from './lib/components/form/editor/models/toolbar.model';
99
+ export * from './lib/components/form/json-editor/json-editor.module';
100
+ export * from './lib/components/form/json-editor/json-editor.component';
101
+ export * from './lib/components/form/json-editor/json-editor.enum';
102
+ export * from './lib/components/form/json-editor/utils/jsoneditoroptions';
99
103
  export * from './lib/components/form/rating/rating.module';
100
104
  export * from './lib/components/form/rating/rating.component';
101
105
  export * from './lib/components/form/rating/rating.enum';