myrta-ui 17.1.9 → 17.1.11
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/esm2022/lib/components/form/code-editor/code-editor.component.mjs +238 -0
- package/esm2022/lib/components/form/code-editor/code-editor.enum.mjs +2 -0
- package/esm2022/lib/components/form/code-editor/code-editor.module.mjs +28 -0
- package/esm2022/lib/components/form/code-editor/utils/codeeditoroptions.mjs +65 -0
- package/esm2022/lib/components/modal/modal.component.mjs +5 -7
- package/esm2022/lib/components/table/table.component.mjs +3 -3
- package/esm2022/lib/myrta-ui.module.mjs +6 -1
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/myrta-ui.mjs +336 -13
- package/fesm2022/myrta-ui.mjs.map +1 -1
- package/lib/components/form/code-editor/code-editor.component.d.ts +57 -0
- package/lib/components/form/code-editor/code-editor.enum.d.ts +5 -0
- package/lib/components/form/code-editor/code-editor.module.d.ts +10 -0
- package/lib/components/form/code-editor/utils/codeeditoroptions.d.ts +51 -0
- package/lib/myrta-ui.module.d.ts +12 -11
- package/package.json +6 -2
- package/public-api.d.ts +4 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { NgxEditorModel } from 'ngx-monaco-editor-v2';
|
|
4
|
+
import { CodeEditorOptions } from "./utils/codeeditoroptions";
|
|
5
|
+
import { CodeEditorValueTypes, CodeEditorValueWithId } from "./code-editor.enum";
|
|
6
|
+
import { Field } from "../../../services";
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class CodeEditorComponent implements ControlValueAccessor, OnInit, OnDestroy {
|
|
9
|
+
private _data;
|
|
10
|
+
private _editor;
|
|
11
|
+
private _debounceTimeout;
|
|
12
|
+
isFocused: boolean;
|
|
13
|
+
editorModel: NgxEditorModel;
|
|
14
|
+
editorOptions: CodeEditorOptions;
|
|
15
|
+
uuid: string;
|
|
16
|
+
fields: Field[];
|
|
17
|
+
options: CodeEditorOptions;
|
|
18
|
+
debug: boolean;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
set data(value: Object);
|
|
21
|
+
get data(): Object;
|
|
22
|
+
changed: EventEmitter<CodeEditorValueTypes>;
|
|
23
|
+
modelChange: EventEmitter<CodeEditorValueWithId>;
|
|
24
|
+
jsonChange: EventEmitter<any>;
|
|
25
|
+
editorContainer: ElementRef;
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
ngOnDestroy(): void;
|
|
28
|
+
onEditorInit(editor: any): void;
|
|
29
|
+
onChangeJSON: () => void;
|
|
30
|
+
onChange: () => void;
|
|
31
|
+
focus(): void;
|
|
32
|
+
get(): JSON;
|
|
33
|
+
getText(): string;
|
|
34
|
+
set(json: JSON): void;
|
|
35
|
+
setSelection(start: any, end: any): void;
|
|
36
|
+
getSelection(): any;
|
|
37
|
+
setOptions(newOptions: CodeEditorOptions): void;
|
|
38
|
+
destroy(): void;
|
|
39
|
+
getEditor(): any;
|
|
40
|
+
isValidJson(): boolean;
|
|
41
|
+
setDisabledState(isDisabled: boolean): void;
|
|
42
|
+
writeValue(value: any): void;
|
|
43
|
+
updateValue(insideValue: any): void;
|
|
44
|
+
registerOnChange(fn: any): void;
|
|
45
|
+
registerOnTouched(fn: () => void): void;
|
|
46
|
+
private _initializeEditor;
|
|
47
|
+
private _updateEditorModel;
|
|
48
|
+
private _updateEditorOptions;
|
|
49
|
+
private _updateEditorHeight;
|
|
50
|
+
private _debounce;
|
|
51
|
+
private _clearDebounce;
|
|
52
|
+
private _destroyEditor;
|
|
53
|
+
private onChangeFn;
|
|
54
|
+
private onTouchedFn;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CodeEditorComponent, never>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CodeEditorComponent, "mrx-code-editor", never, { "fields": { "alias": "fields"; "required": false; }; "options": { "alias": "options"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "data": { "alias": "data"; "required": false; }; }, { "changed": "changed"; "modelChange": "modelChange"; "jsonChange": "jsonChange"; }, never, never, false, never>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./code-editor.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/forms";
|
|
5
|
+
import * as i4 from "ngx-monaco-editor-v2";
|
|
6
|
+
export declare class CodeEditorModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CodeEditorModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CodeEditorModule, [typeof i1.CodeEditorComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.MonacoEditorModule], [typeof i1.CodeEditorComponent]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CodeEditorModule>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type CodeEditorMode = 'code' | 'text';
|
|
2
|
+
export interface CodeEditorError {
|
|
3
|
+
path: (string | number)[];
|
|
4
|
+
message: string;
|
|
5
|
+
severity?: 'error' | 'warning' | 'info';
|
|
6
|
+
}
|
|
7
|
+
export interface CodeEditorMarker {
|
|
8
|
+
startLineNumber: number;
|
|
9
|
+
startColumn: number;
|
|
10
|
+
endLineNumber: number;
|
|
11
|
+
endColumn: number;
|
|
12
|
+
message: string;
|
|
13
|
+
severity: 'Error' | 'Warning' | 'Info';
|
|
14
|
+
}
|
|
15
|
+
export interface CodeEditor {
|
|
16
|
+
getValue(): string;
|
|
17
|
+
setValue(value: string): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class CodeEditorOptions {
|
|
20
|
+
theme?: string;
|
|
21
|
+
language?: string;
|
|
22
|
+
automaticLayout?: boolean;
|
|
23
|
+
minimap?: {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
};
|
|
26
|
+
lineNumbers?: 'on' | 'off' | 'relative';
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
fontSize?: number;
|
|
29
|
+
wordWrap?: 'on' | 'off' | 'wordWrapColumn' | 'bounded';
|
|
30
|
+
folding?: boolean;
|
|
31
|
+
renderWhitespace?: 'none' | 'boundary' | 'selection' | 'all';
|
|
32
|
+
tabSize?: number;
|
|
33
|
+
formatOnPaste?: boolean;
|
|
34
|
+
formatOnType?: boolean;
|
|
35
|
+
suggest?: {
|
|
36
|
+
showWords: boolean;
|
|
37
|
+
showSnippets: boolean;
|
|
38
|
+
};
|
|
39
|
+
scrollBeyondLastLine?: boolean;
|
|
40
|
+
foldingHighlight?: boolean;
|
|
41
|
+
foldingStrategy?: string;
|
|
42
|
+
_enableSchemaValidation?: boolean;
|
|
43
|
+
validateJson?: boolean;
|
|
44
|
+
setSchemaValidation?: (enabled: boolean) => void;
|
|
45
|
+
onChange: (content: string) => void;
|
|
46
|
+
onChangeJSON?: (json: any) => void;
|
|
47
|
+
onError: (error: CodeEditorError[]) => void;
|
|
48
|
+
onValidate: (markers: CodeEditorMarker[]) => void;
|
|
49
|
+
onInit: (editor: CodeEditor) => void;
|
|
50
|
+
constructor();
|
|
51
|
+
}
|
package/lib/myrta-ui.module.d.ts
CHANGED
|
@@ -45,18 +45,19 @@ import * as i43 from "./components/form/input-file-image/input-file-image.module
|
|
|
45
45
|
import * as i44 from "./components/form/input-opt/input-opt.module";
|
|
46
46
|
import * as i45 from "./components/form/input-password/input-password.module";
|
|
47
47
|
import * as i46 from "./components/form/json-editor/json-editor.module";
|
|
48
|
-
import * as i47 from "./components/
|
|
49
|
-
import * as i48 from "./components/wrappers/
|
|
50
|
-
import * as i49 from "./components/wrappers/
|
|
51
|
-
import * as i50 from "./
|
|
52
|
-
import * as i51 from "./pipes/
|
|
53
|
-
import * as i52 from "./pipes/
|
|
54
|
-
import * as i53 from "./pipes/
|
|
55
|
-
import * as i54 from "./pipes/
|
|
56
|
-
import * as i55 from "./
|
|
57
|
-
import * as i56 from "./
|
|
48
|
+
import * as i47 from "./components/form/code-editor/code-editor.module";
|
|
49
|
+
import * as i48 from "./components/wrappers/widget-wrapper/widget-wrapper.module";
|
|
50
|
+
import * as i49 from "./components/wrappers/content-wrapper/content-wrapper.module";
|
|
51
|
+
import * as i50 from "./components/wrappers/controls-wrapper/controls-wrapper.module";
|
|
52
|
+
import * as i51 from "./pipes/truncate/truncate.module";
|
|
53
|
+
import * as i52 from "./pipes/date/date-format.module";
|
|
54
|
+
import * as i53 from "./pipes/currency/currency.module";
|
|
55
|
+
import * as i54 from "./pipes/safe/safe.module";
|
|
56
|
+
import * as i55 from "./pipes/phone/phone-format.module";
|
|
57
|
+
import * as i56 from "./directives/truncate/truncate.module";
|
|
58
|
+
import * as i57 from "./components/form/input-tel/input-tel.module";
|
|
58
59
|
export declare class MyrtaUiModule {
|
|
59
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<MyrtaUiModule, never>;
|
|
60
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MyrtaUiModule, never, [typeof i1.ButtonModule, typeof i2.LoaderModule, typeof i3.AlertModule, typeof i4.BadgesModule, typeof i5.BreadcrumbsModule, typeof i6.LabelModule, typeof i7.LinkModule, typeof i8.CdkTooltipModule, typeof i9.CharsLeftModule, typeof i10.DropdownModule, typeof i11.ErrorMessageModule, typeof i12.HintErrorMessageModule, typeof i13.IconButtonModule, typeof i14.ModalModule, typeof i15.PaginatorModule, typeof i16.ProgressModule, typeof i17.SaveStateModule, typeof i18.StepperModule, typeof i19.TableModule, typeof i20.TabsModule, typeof i21.TooltipModule, typeof i22.TruncateTextModule, typeof i23.WarningMessageModule, typeof i24.PagesNavModule, typeof i25.GalleryModule, typeof i26.EditorModule, typeof i27.CheckboxModule, typeof i28.CheckboxGroupModule, typeof i29.RadioModule, typeof i30.RatingModule, typeof i31.SwitchModule, typeof i32.RadioGroupModule, typeof i33.InputTextModule, typeof i34.InputTextareaModule, typeof i35.InputNumberModule, typeof i36.InputPhoneModule, typeof i37.InputSearchModule, typeof i38.InputDatepickerModule, typeof i39.InputDateTimeModule, typeof i40.InputTimepickerModule, typeof i41.InputSelectModule, typeof i42.InputFileModule, typeof i43.InputFileImageModule, typeof i44.InputOptModule, typeof i45.InputPasswordModule, typeof i46.JsonEditorModule, typeof i47.
|
|
61
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MyrtaUiModule, never, [typeof i1.ButtonModule, typeof i2.LoaderModule, typeof i3.AlertModule, typeof i4.BadgesModule, typeof i5.BreadcrumbsModule, typeof i6.LabelModule, typeof i7.LinkModule, typeof i8.CdkTooltipModule, typeof i9.CharsLeftModule, typeof i10.DropdownModule, typeof i11.ErrorMessageModule, typeof i12.HintErrorMessageModule, typeof i13.IconButtonModule, typeof i14.ModalModule, typeof i15.PaginatorModule, typeof i16.ProgressModule, typeof i17.SaveStateModule, typeof i18.StepperModule, typeof i19.TableModule, typeof i20.TabsModule, typeof i21.TooltipModule, typeof i22.TruncateTextModule, typeof i23.WarningMessageModule, typeof i24.PagesNavModule, typeof i25.GalleryModule, typeof i26.EditorModule, typeof i27.CheckboxModule, typeof i28.CheckboxGroupModule, typeof i29.RadioModule, typeof i30.RatingModule, typeof i31.SwitchModule, typeof i32.RadioGroupModule, typeof i33.InputTextModule, typeof i34.InputTextareaModule, typeof i35.InputNumberModule, typeof i36.InputPhoneModule, typeof i37.InputSearchModule, typeof i38.InputDatepickerModule, typeof i39.InputDateTimeModule, typeof i40.InputTimepickerModule, typeof i41.InputSelectModule, typeof i42.InputFileModule, typeof i43.InputFileImageModule, typeof i44.InputOptModule, typeof i45.InputPasswordModule, typeof i46.JsonEditorModule, typeof i47.CodeEditorModule, typeof i48.WidgetWrapperModule, typeof i49.ContentWrapperModule, typeof i50.ControlsWrapperModule, typeof i51.TruncateModule, typeof i52.DateFormatModule, typeof i53.CurrencyModule, typeof i54.SafeModule, typeof i55.PhoneFormatModule, typeof i56.TruncateDirectiveModule, typeof i57.InputTelModule], [typeof i1.ButtonModule, typeof i2.LoaderModule, typeof i3.AlertModule, typeof i4.BadgesModule, typeof i5.BreadcrumbsModule, typeof i6.LabelModule, typeof i7.LinkModule, typeof i8.CdkTooltipModule, typeof i9.CharsLeftModule, typeof i10.DropdownModule, typeof i11.ErrorMessageModule, typeof i12.HintErrorMessageModule, typeof i13.IconButtonModule, typeof i14.ModalModule, typeof i15.PaginatorModule, typeof i16.ProgressModule, typeof i17.SaveStateModule, typeof i18.StepperModule, typeof i19.TableModule, typeof i20.TabsModule, typeof i21.TooltipModule, typeof i22.TruncateTextModule, typeof i23.WarningMessageModule, typeof i24.PagesNavModule, typeof i25.GalleryModule, typeof i26.EditorModule, typeof i27.CheckboxModule, typeof i28.CheckboxGroupModule, typeof i29.RadioModule, typeof i30.RatingModule, typeof i31.SwitchModule, typeof i32.RadioGroupModule, typeof i33.InputTextModule, typeof i34.InputTextareaModule, typeof i35.InputNumberModule, typeof i36.InputPhoneModule, typeof i37.InputSearchModule, typeof i38.InputDatepickerModule, typeof i39.InputDateTimeModule, typeof i40.InputTimepickerModule, typeof i41.InputSelectModule, typeof i42.InputFileModule, typeof i43.InputFileImageModule, typeof i44.InputOptModule, typeof i45.InputPasswordModule, typeof i46.JsonEditorModule, typeof i47.CodeEditorModule, typeof i48.WidgetWrapperModule, typeof i49.ContentWrapperModule, typeof i50.ControlsWrapperModule, typeof i51.TruncateModule, typeof i52.DateFormatModule, typeof i53.CurrencyModule, typeof i54.SafeModule, typeof i55.PhoneFormatModule, typeof i56.TruncateDirectiveModule, typeof i57.InputTelModule]>;
|
|
61
62
|
static ɵinj: i0.ɵɵInjectorDeclaration<MyrtaUiModule>;
|
|
62
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myrta-ui",
|
|
3
|
-
"version": "17.1.
|
|
3
|
+
"version": "17.1.11",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^17.3.0",
|
|
6
6
|
"@angular/core": "^17.3.0",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"uuid": "^10.0.0",
|
|
23
23
|
"@popperjs/core": "^2.11.5",
|
|
24
24
|
"mrx-gallery-lib": "^1.0.2",
|
|
25
|
-
"jsoneditor": "^10.1.2"
|
|
25
|
+
"jsoneditor": "^10.1.2",
|
|
26
|
+
"ngx-monaco-editor-v2": "^17.0.1",
|
|
27
|
+
"monaco-editor": "^0.44.0"
|
|
26
28
|
},
|
|
27
29
|
"dependencies": {
|
|
28
30
|
"@angular/cdk": "^17.3.0",
|
|
@@ -44,6 +46,8 @@
|
|
|
44
46
|
"@popperjs/core": "^2.11.5",
|
|
45
47
|
"mrx-gallery-lib": "^1.0.2",
|
|
46
48
|
"jsoneditor": "^10.1.2",
|
|
49
|
+
"ngx-monaco-editor-v2": "^17.0.1",
|
|
50
|
+
"monaco-editor": "^0.44.0",
|
|
47
51
|
"tslib": "^2.3.0"
|
|
48
52
|
},
|
|
49
53
|
"module": "fesm2022/myrta-ui.mjs",
|
package/public-api.d.ts
CHANGED
|
@@ -156,6 +156,10 @@ export * from './lib/components/form/switch/switch.enum';
|
|
|
156
156
|
export * from './lib/components/form/formula-editor/formula-editor.module';
|
|
157
157
|
export * from './lib/components/form/formula-editor/formula-editor.component';
|
|
158
158
|
export * from './lib/components/form/formula-editor/models';
|
|
159
|
+
export * from './lib/components/form/code-editor/code-editor.module';
|
|
160
|
+
export * from './lib/components/form/code-editor/code-editor.component';
|
|
161
|
+
export * from './lib/components/form/code-editor/code-editor.enum';
|
|
162
|
+
export * from './lib/components/form/code-editor/utils/codeeditoroptions';
|
|
159
163
|
export * from './lib/components/wrappers/widget-wrapper/widget-wrapper.module';
|
|
160
164
|
export * from './lib/components/wrappers/widget-wrapper/widget-wrapper.component';
|
|
161
165
|
export * from './lib/components/wrappers/content-wrapper/content-wrapper.module';
|