@kolkov/angular-editor 1.1.5 → 1.2.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.
@@ -1,43 +1,43 @@
1
- import { ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
2
- import { ControlValueAccessor } from '@angular/forms';
3
- export interface SelectOption {
4
- label: string;
5
- value: string;
6
- }
7
- export declare class AeSelectComponent implements OnInit, ControlValueAccessor {
8
- private elRef;
9
- private r;
10
- options: SelectOption[];
11
- isHidden: boolean;
12
- selectedOption: SelectOption;
13
- disabled: boolean;
14
- optionId: number;
15
- get label(): string;
16
- opened: boolean;
17
- get value(): string;
18
- hidden: string;
19
- changeEvent: EventEmitter<any>;
20
- labelButton: ElementRef;
21
- constructor(elRef: ElementRef, r: Renderer2);
22
- ngOnInit(): void;
23
- hide(): void;
24
- optionSelect(option: SelectOption, event: MouseEvent): void;
25
- toggleOpen(event: MouseEvent): void;
26
- onClick($event: MouseEvent): void;
27
- close(): void;
28
- get isOpen(): boolean;
29
- writeValue(value: any): void;
30
- setValue(value: any): void;
31
- onChange: any;
32
- onTouched: any;
33
- registerOnChange(fn: any): void;
34
- registerOnTouched(fn: any): void;
35
- setDisabledState(isDisabled: boolean): void;
36
- handleKeyDown($event: KeyboardEvent): void;
37
- _handleArrowDown($event: any): void;
38
- _handleArrowUp($event: any): void;
39
- _handleSpace($event: any): void;
40
- _handleEnter($event: any): void;
41
- _handleTab($event: any): void;
42
- _handleBackspace(): void;
43
- }
1
+ import { ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ export interface SelectOption {
4
+ label: string;
5
+ value: string;
6
+ }
7
+ export declare class AeSelectComponent implements OnInit, ControlValueAccessor {
8
+ private elRef;
9
+ private r;
10
+ options: SelectOption[];
11
+ isHidden: boolean;
12
+ selectedOption: SelectOption;
13
+ disabled: boolean;
14
+ optionId: number;
15
+ get label(): string;
16
+ opened: boolean;
17
+ get value(): string;
18
+ hidden: string;
19
+ changeEvent: EventEmitter<any>;
20
+ labelButton: ElementRef;
21
+ constructor(elRef: ElementRef, r: Renderer2);
22
+ ngOnInit(): void;
23
+ hide(): void;
24
+ optionSelect(option: SelectOption, event: MouseEvent): void;
25
+ toggleOpen(event: MouseEvent): void;
26
+ onClick($event: MouseEvent): void;
27
+ close(): void;
28
+ get isOpen(): boolean;
29
+ writeValue(value: any): void;
30
+ setValue(value: any): void;
31
+ onChange: any;
32
+ onTouched: any;
33
+ registerOnChange(fn: any): void;
34
+ registerOnTouched(fn: any): void;
35
+ setDisabledState(isDisabled: boolean): void;
36
+ handleKeyDown($event: KeyboardEvent): void;
37
+ _handleArrowDown($event: any): void;
38
+ _handleArrowUp($event: any): void;
39
+ _handleSpace($event: any): void;
40
+ _handleEnter($event: any): void;
41
+ _handleTab($event: any): void;
42
+ _handleBackspace(): void;
43
+ }
@@ -1,88 +1,94 @@
1
- import { ElementRef, EventEmitter, Renderer2 } from '@angular/core';
2
- import { AngularEditorService } from './angular-editor.service';
3
- import { CustomClass } from './config';
4
- import { SelectOption } from './ae-select/ae-select.component';
5
- export declare class AngularEditorToolbarComponent {
6
- private r;
7
- private editorService;
8
- private er;
9
- private doc;
10
- htmlMode: boolean;
11
- linkSelected: boolean;
12
- block: string;
13
- fontName: string;
14
- fontSize: string;
15
- foreColour: any;
16
- backColor: any;
17
- headings: SelectOption[];
18
- fontSizes: SelectOption[];
19
- customClassId: string;
20
- _customClasses: CustomClass[];
21
- customClassList: SelectOption[];
22
- tagMap: {
23
- BLOCKQUOTE: string;
24
- A: string;
25
- };
26
- select: string[];
27
- buttons: string[];
28
- id: string;
29
- uploadUrl: string;
30
- showToolbar: boolean;
31
- fonts: SelectOption[];
32
- set customClasses(classes: CustomClass[]);
33
- set defaultFontName(value: string);
34
- set defaultFontSize(value: string);
35
- hiddenButtons: string[][];
36
- execute: EventEmitter<string>;
37
- myInputFile: ElementRef;
38
- get isLinkButtonDisabled(): boolean;
39
- constructor(r: Renderer2, editorService: AngularEditorService, er: ElementRef, doc: any);
40
- /**
41
- * Trigger command from editor header buttons
42
- * @param command string from toolbar buttons
43
- */
44
- triggerCommand(command: string): void;
45
- /**
46
- * highlight editor buttons when cursor moved or positioning
47
- */
48
- triggerButtons(): void;
49
- /**
50
- * trigger highlight editor buttons when cursor moved or positioning in block
51
- */
52
- triggerBlocks(nodes: Node[]): void;
53
- /**
54
- * insert URL link
55
- */
56
- insertUrl(): void;
57
- /**
58
- * insert Video link
59
- */
60
- insertVideo(): void;
61
- /** insert color */
62
- insertColor(color: string, where: string): void;
63
- /**
64
- * set font Name/family
65
- * @param foreColor string
66
- */
67
- setFontName(foreColor: string): void;
68
- /**
69
- * set font Size
70
- * @param fontSize string
71
- */
72
- setFontSize(fontSize: string): void;
73
- /**
74
- * toggle editor mode (WYSIWYG or SOURCE)
75
- * @param m boolean
76
- */
77
- setEditorMode(m: boolean): void;
78
- /**
79
- * Upload image when file is selected
80
- */
81
- onFileChanged(event: any): void;
82
- /**
83
- * Set custom class
84
- */
85
- setCustomClass(classId: string): void;
86
- isButtonHidden(name: string): boolean;
87
- focus(): void;
88
- }
1
+ import { ElementRef, EventEmitter, Renderer2 } from '@angular/core';
2
+ import { AngularEditorService, UploadResponse } from './angular-editor.service';
3
+ import { HttpResponse, HttpEvent } from '@angular/common/http';
4
+ import { CustomClass } from './config';
5
+ import { SelectOption } from './ae-select/ae-select.component';
6
+ import { Observable } from 'rxjs';
7
+ export declare class AngularEditorToolbarComponent {
8
+ private r;
9
+ private editorService;
10
+ private er;
11
+ private doc;
12
+ htmlMode: boolean;
13
+ linkSelected: boolean;
14
+ block: string;
15
+ fontName: string;
16
+ fontSize: string;
17
+ foreColour: any;
18
+ backColor: any;
19
+ headings: SelectOption[];
20
+ fontSizes: SelectOption[];
21
+ customClassId: string;
22
+ _customClasses: CustomClass[];
23
+ customClassList: SelectOption[];
24
+ tagMap: {
25
+ BLOCKQUOTE: string;
26
+ A: string;
27
+ };
28
+ select: string[];
29
+ buttons: string[];
30
+ id: string;
31
+ uploadUrl: string;
32
+ upload: (file: File) => Observable<HttpEvent<UploadResponse>>;
33
+ showToolbar: boolean;
34
+ fonts: SelectOption[];
35
+ set customClasses(classes: CustomClass[]);
36
+ set defaultFontName(value: string);
37
+ set defaultFontSize(value: string);
38
+ hiddenButtons: string[][];
39
+ execute: EventEmitter<string>;
40
+ myInputFile: ElementRef;
41
+ get isLinkButtonDisabled(): boolean;
42
+ constructor(r: Renderer2, editorService: AngularEditorService, er: ElementRef, doc: any);
43
+ /**
44
+ * Trigger command from editor header buttons
45
+ * @param command string from toolbar buttons
46
+ */
47
+ triggerCommand(command: string): void;
48
+ /**
49
+ * highlight editor buttons when cursor moved or positioning
50
+ */
51
+ triggerButtons(): void;
52
+ /**
53
+ * trigger highlight editor buttons when cursor moved or positioning in block
54
+ */
55
+ triggerBlocks(nodes: Node[]): void;
56
+ /**
57
+ * insert URL link
58
+ */
59
+ insertUrl(): void;
60
+ /**
61
+ * insert Video link
62
+ */
63
+ insertVideo(): void;
64
+ /** insert color */
65
+ insertColor(color: string, where: string): void;
66
+ /**
67
+ * set font Name/family
68
+ * @param foreColor string
69
+ */
70
+ setFontName(foreColor: string): void;
71
+ /**
72
+ * set font Size
73
+ * @param fontSize string
74
+ */
75
+ setFontSize(fontSize: string): void;
76
+ /**
77
+ * toggle editor mode (WYSIWYG or SOURCE)
78
+ * @param m boolean
79
+ */
80
+ setEditorMode(m: boolean): void;
81
+ /**
82
+ * Upload image when file is selected.
83
+ */
84
+ onFileChanged(event: any): void;
85
+ watchUploadImage(response: HttpResponse<{
86
+ imageUrl: string;
87
+ }>, event: any): void;
88
+ /**
89
+ * Set custom class
90
+ */
91
+ setCustomClass(classId: string): void;
92
+ isButtonHidden(name: string): boolean;
93
+ focus(): void;
94
+ }
@@ -1,126 +1,127 @@
1
- import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
- import { ControlValueAccessor } from '@angular/forms';
3
- import { AngularEditorConfig } from './config';
4
- import { AngularEditorToolbarComponent } from './angular-editor-toolbar.component';
5
- import { AngularEditorService } from './angular-editor.service';
6
- import { DomSanitizer } from '@angular/platform-browser';
7
- export declare class AngularEditorComponent implements OnInit, ControlValueAccessor, AfterViewInit, OnDestroy {
8
- private r;
9
- private editorService;
10
- private doc;
11
- private sanitizer;
12
- private cdRef;
13
- private autoFocus;
14
- private onChange;
15
- private onTouched;
16
- modeVisual: boolean;
17
- showPlaceholder: boolean;
18
- disabled: boolean;
19
- focused: boolean;
20
- touched: boolean;
21
- changed: boolean;
22
- focusInstance: any;
23
- blurInstance: any;
24
- id: string;
25
- config: AngularEditorConfig;
26
- placeholder: string;
27
- tabIndex: number | null;
28
- html: any;
29
- textArea: ElementRef;
30
- editorWrapper: ElementRef;
31
- editorToolbar: AngularEditorToolbarComponent;
32
- viewMode: EventEmitter<boolean>;
33
- /** emits `blur` event when focused out from the textarea */
34
- blurEvent: EventEmitter<FocusEvent>;
35
- /** emits `focus` event when focused in to the textarea */
36
- focusEvent: EventEmitter<FocusEvent>;
37
- tabindex: number;
38
- onFocus(): void;
39
- constructor(r: Renderer2, editorService: AngularEditorService, doc: any, sanitizer: DomSanitizer, cdRef: ChangeDetectorRef, defaultTabIndex: string, autoFocus: any);
40
- ngOnInit(): void;
41
- ngAfterViewInit(): void;
42
- /**
43
- * Executed command from editor header buttons
44
- * @param command string from triggerCommand
45
- */
46
- executeCommand(command: string): void;
47
- /**
48
- * focus event
49
- */
50
- onTextAreaFocus(event: FocusEvent): void;
51
- /**
52
- * @description fires when cursor leaves textarea
53
- */
54
- onTextAreaMouseOut(event: MouseEvent): void;
55
- /**
56
- * blur event
57
- */
58
- onTextAreaBlur(event: FocusEvent): void;
59
- /**
60
- * focus the text area when the editor is focused
61
- */
62
- focus(): void;
63
- /**
64
- * Executed from the contenteditable section while the input property changes
65
- * @param element html element from contenteditable
66
- */
67
- onContentChange(element: HTMLElement): void;
68
- /**
69
- * Set the function to be called
70
- * when the control receives a change event.
71
- *
72
- * @param fn a function
73
- */
74
- registerOnChange(fn: any): void;
75
- /**
76
- * Set the function to be called
77
- * when the control receives a touch event.
78
- *
79
- * @param fn a function
80
- */
81
- registerOnTouched(fn: any): void;
82
- /**
83
- * Write a new value to the element.
84
- *
85
- * @param value value to be executed when there is a change in contenteditable
86
- */
87
- writeValue(value: any): void;
88
- /**
89
- * refresh view/HTML of the editor
90
- *
91
- * @param value html string from the editor
92
- */
93
- refreshView(value: string): void;
94
- /**
95
- * toggles placeholder based on input string
96
- *
97
- * @param value A HTML string from the editor
98
- */
99
- togglePlaceholder(value: boolean): void;
100
- /**
101
- * Implements disabled state for this element
102
- *
103
- * @param isDisabled Disabled flag
104
- */
105
- setDisabledState(isDisabled: boolean): void;
106
- /**
107
- * toggles editor mode based on bToSource bool
108
- *
109
- * @param bToSource A boolean value from the editor
110
- */
111
- toggleEditorMode(bToSource: boolean): void;
112
- /**
113
- * toggles editor buttons when cursor moved or positioning
114
- *
115
- * Send a node array from the contentEditable of the editor
116
- */
117
- exec(): void;
118
- private configure;
119
- getFonts(): {
120
- label: string;
121
- value: string;
122
- }[];
123
- getCustomTags(): string;
124
- ngOnDestroy(): void;
125
- filterStyles(html: string): string;
126
- }
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { AngularEditorConfig } from './config';
4
+ import { AngularEditorToolbarComponent } from './angular-editor-toolbar.component';
5
+ import { AngularEditorService } from './angular-editor.service';
6
+ import { DomSanitizer } from '@angular/platform-browser';
7
+ export declare class AngularEditorComponent implements OnInit, ControlValueAccessor, AfterViewInit, OnDestroy {
8
+ private r;
9
+ private editorService;
10
+ private doc;
11
+ private sanitizer;
12
+ private cdRef;
13
+ private autoFocus;
14
+ private onChange;
15
+ private onTouched;
16
+ modeVisual: boolean;
17
+ showPlaceholder: boolean;
18
+ disabled: boolean;
19
+ focused: boolean;
20
+ touched: boolean;
21
+ changed: boolean;
22
+ focusInstance: any;
23
+ blurInstance: any;
24
+ id: string;
25
+ config: AngularEditorConfig;
26
+ placeholder: string;
27
+ tabIndex: number | null;
28
+ html: any;
29
+ textArea: ElementRef;
30
+ editorWrapper: ElementRef;
31
+ editorToolbar: AngularEditorToolbarComponent;
32
+ viewMode: EventEmitter<boolean>;
33
+ /** emits `blur` event when focused out from the textarea */
34
+ blurEvent: EventEmitter<FocusEvent>;
35
+ /** emits `focus` event when focused in to the textarea */
36
+ focusEvent: EventEmitter<FocusEvent>;
37
+ tabindex: number;
38
+ onFocus(): void;
39
+ constructor(r: Renderer2, editorService: AngularEditorService, doc: any, sanitizer: DomSanitizer, cdRef: ChangeDetectorRef, defaultTabIndex: string, autoFocus: any);
40
+ ngOnInit(): void;
41
+ ngAfterViewInit(): void;
42
+ onPaste(event: ClipboardEvent): string;
43
+ /**
44
+ * Executed command from editor header buttons
45
+ * @param command string from triggerCommand
46
+ */
47
+ executeCommand(command: string): void;
48
+ /**
49
+ * focus event
50
+ */
51
+ onTextAreaFocus(event: FocusEvent): void;
52
+ /**
53
+ * @description fires when cursor leaves textarea
54
+ */
55
+ onTextAreaMouseOut(event: MouseEvent): void;
56
+ /**
57
+ * blur event
58
+ */
59
+ onTextAreaBlur(event: FocusEvent): void;
60
+ /**
61
+ * focus the text area when the editor is focused
62
+ */
63
+ focus(): void;
64
+ /**
65
+ * Executed from the contenteditable section while the input property changes
66
+ * @param element html element from contenteditable
67
+ */
68
+ onContentChange(element: HTMLElement): void;
69
+ /**
70
+ * Set the function to be called
71
+ * when the control receives a change event.
72
+ *
73
+ * @param fn a function
74
+ */
75
+ registerOnChange(fn: any): void;
76
+ /**
77
+ * Set the function to be called
78
+ * when the control receives a touch event.
79
+ *
80
+ * @param fn a function
81
+ */
82
+ registerOnTouched(fn: any): void;
83
+ /**
84
+ * Write a new value to the element.
85
+ *
86
+ * @param value value to be executed when there is a change in contenteditable
87
+ */
88
+ writeValue(value: any): void;
89
+ /**
90
+ * refresh view/HTML of the editor
91
+ *
92
+ * @param value html string from the editor
93
+ */
94
+ refreshView(value: string): void;
95
+ /**
96
+ * toggles placeholder based on input string
97
+ *
98
+ * @param value A HTML string from the editor
99
+ */
100
+ togglePlaceholder(value: boolean): void;
101
+ /**
102
+ * Implements disabled state for this element
103
+ *
104
+ * @param isDisabled Disabled flag
105
+ */
106
+ setDisabledState(isDisabled: boolean): void;
107
+ /**
108
+ * toggles editor mode based on bToSource bool
109
+ *
110
+ * @param bToSource A boolean value from the editor
111
+ */
112
+ toggleEditorMode(bToSource: boolean): void;
113
+ /**
114
+ * toggles editor buttons when cursor moved or positioning
115
+ *
116
+ * Send a node array from the contentEditable of the editor
117
+ */
118
+ exec(): void;
119
+ private configure;
120
+ getFonts(): {
121
+ label: string;
122
+ value: string;
123
+ }[];
124
+ getCustomTags(): string;
125
+ ngOnDestroy(): void;
126
+ filterStyles(html: string): string;
127
+ }
@@ -1,2 +1,2 @@
1
- export declare class AngularEditorModule {
2
- }
1
+ export declare class AngularEditorModule {
2
+ }