@progress/kendo-angular-editor 2.5.0-dev.202111161123 → 2.5.0-dev.202111231749
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/dist/cdn/js/kendo-angular-editor.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/error-messages.js +2 -1
- package/dist/es/config/command-icons.js +4 -2
- package/dist/es/config/commands.js +32 -31
- package/dist/es/editor-toolbar-state.js +20 -2
- package/dist/es/editor.component.js +4 -3
- package/dist/es/editor.module.js +7 -1
- package/dist/es/index.js +2 -0
- package/dist/es/localization/messages.js +8 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/print/editor-print-button.directive.js +67 -0
- package/dist/es/tools/select-all/select-all-button.directive.js +48 -0
- package/dist/es/tools/shared/editor-command-base.js +7 -5
- package/dist/es2015/common/commands.d.ts +5 -1
- package/dist/es2015/common/error-messages.js +2 -1
- package/dist/es2015/config/command-icons.d.ts +2 -2
- package/dist/es2015/config/command-icons.js +4 -2
- package/dist/es2015/config/commands.js +31 -30
- package/dist/es2015/editor-toolbar-state.js +20 -2
- package/dist/es2015/editor.component.d.ts +5 -0
- package/dist/es2015/editor.component.js +7 -2
- package/dist/es2015/editor.module.js +7 -1
- package/dist/es2015/index.d.ts +2 -0
- package/dist/es2015/index.js +2 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/localization/messages.d.ts +8 -0
- package/dist/es2015/localization/messages.js +8 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/tools/print/editor-print-button.directive.d.ts +33 -0
- package/dist/es2015/tools/print/editor-print-button.directive.js +64 -0
- package/dist/es2015/tools/select-all/select-all-button.directive.d.ts +29 -0
- package/dist/es2015/tools/select-all/select-all-button.directive.js +46 -0
- package/dist/es2015/tools/shared/editor-command-base.d.ts +4 -3
- package/dist/es2015/tools/shared/editor-command-base.js +6 -4
- package/dist/es2015/tools/shared/editor-command-button.d.ts +3 -3
- package/dist/fesm2015/index.js +173 -43
- package/dist/fesm5/index.js +177 -46
- package/dist/npm/common/error-messages.js +2 -1
- package/dist/npm/config/command-icons.js +4 -2
- package/dist/npm/config/commands.js +33 -31
- package/dist/npm/editor-toolbar-state.js +20 -2
- package/dist/npm/editor.component.js +4 -3
- package/dist/npm/editor.module.js +7 -1
- package/dist/npm/index.js +4 -0
- package/dist/npm/localization/messages.js +8 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/print/editor-print-button.directive.js +69 -0
- package/dist/npm/tools/select-all/select-all-button.directive.js +50 -0
- package/dist/npm/tools/shared/editor-command-base.js +7 -5
- package/dist/systemjs/kendo-angular-editor.js +1 -1
- package/package.json +1 -1
|
@@ -83,10 +83,18 @@ export declare class Messages extends ComponentMessages {
|
|
|
83
83
|
* The title of the tool that outdents the content.
|
|
84
84
|
*/
|
|
85
85
|
outdent: string;
|
|
86
|
+
/**
|
|
87
|
+
* The title of the print tool.
|
|
88
|
+
*/
|
|
89
|
+
print: string;
|
|
86
90
|
/**
|
|
87
91
|
* The title of the tool that redos the last action.
|
|
88
92
|
*/
|
|
89
93
|
redo: string;
|
|
94
|
+
/**
|
|
95
|
+
* The title of the tool that selects all content.
|
|
96
|
+
*/
|
|
97
|
+
selectAll: string;
|
|
90
98
|
/**
|
|
91
99
|
* The title of the tool that strikes through text.
|
|
92
100
|
*/
|
|
@@ -86,10 +86,18 @@ tslib_1.__decorate([
|
|
|
86
86
|
Input(),
|
|
87
87
|
tslib_1.__metadata("design:type", String)
|
|
88
88
|
], Messages.prototype, "outdent", void 0);
|
|
89
|
+
tslib_1.__decorate([
|
|
90
|
+
Input(),
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
92
|
+
], Messages.prototype, "print", void 0);
|
|
89
93
|
tslib_1.__decorate([
|
|
90
94
|
Input(),
|
|
91
95
|
tslib_1.__metadata("design:type", String)
|
|
92
96
|
], Messages.prototype, "redo", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
Input(),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], Messages.prototype, "selectAll", void 0);
|
|
93
101
|
tslib_1.__decorate([
|
|
94
102
|
Input(),
|
|
95
103
|
tslib_1.__metadata("design:type", String)
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-editor',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1637689470,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
6
|
+
import { EditorComponent } from '../../editor.component';
|
|
7
|
+
import { EditorCommandButton } from '../shared/editor-command-button';
|
|
8
|
+
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
9
|
+
/**
|
|
10
|
+
* A directive which configures an existing `ToolBarButtonComponent` as an Editor Print tool
|
|
11
|
+
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
12
|
+
* The directive will predefine the `icon` and `click` event handlers of the button.
|
|
13
|
+
*
|
|
14
|
+
* > The Editor Print tool is supported in the default [`iframe`](https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorComponent/#toc-iframe) mode only.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts-no-run
|
|
18
|
+
* <kendo-toolbar-button kendoEditorPrintButton></kendo-toolbar-button>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* The following example demonstrates how to change the default icon that is applied by the directive.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts-no-run
|
|
25
|
+
* <kendo-toolbar-button kendoEditorPrintButton icon="blogger"></kendo-toolbar-button>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class EditorPrintDirective extends EditorCommandButton {
|
|
29
|
+
protected editor: EditorComponent;
|
|
30
|
+
constructor(button: ToolBarButtonComponent, editor: EditorComponent, localization: EditorLocalizationService);
|
|
31
|
+
ngAfterViewInit(): void;
|
|
32
|
+
protected clickHandler(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Directive, Host, isDevMode } from '@angular/core';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { EditorComponent } from '../../editor.component';
|
|
9
|
+
import { EditorCommandButton } from '../shared/editor-command-button';
|
|
10
|
+
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
11
|
+
import { EditorErrorMessages } from '../../common/error-messages';
|
|
12
|
+
/**
|
|
13
|
+
* A directive which configures an existing `ToolBarButtonComponent` as an Editor Print tool
|
|
14
|
+
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
15
|
+
* The directive will predefine the `icon` and `click` event handlers of the button.
|
|
16
|
+
*
|
|
17
|
+
* > The Editor Print tool is supported in the default [`iframe`](https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorComponent/#toc-iframe) mode only.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts-no-run
|
|
21
|
+
* <kendo-toolbar-button kendoEditorPrintButton></kendo-toolbar-button>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* The following example demonstrates how to change the default icon that is applied by the directive.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts-no-run
|
|
28
|
+
* <kendo-toolbar-button kendoEditorPrintButton icon="blogger"></kendo-toolbar-button>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
let EditorPrintDirective = class EditorPrintDirective extends EditorCommandButton {
|
|
32
|
+
constructor(button, editor, localization) {
|
|
33
|
+
super('print', button, editor, localization);
|
|
34
|
+
this.editor = editor;
|
|
35
|
+
}
|
|
36
|
+
ngAfterViewInit() {
|
|
37
|
+
if (isDevMode) {
|
|
38
|
+
if (!this.editor.iframe) {
|
|
39
|
+
throw new Error(EditorErrorMessages.printTool);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
clickHandler() {
|
|
44
|
+
if (this.editor.iframe) {
|
|
45
|
+
const view = this.editor.view;
|
|
46
|
+
const dom = view && view.dom;
|
|
47
|
+
const doc = dom && dom.ownerDocument;
|
|
48
|
+
const editorWindow = doc && doc.defaultView;
|
|
49
|
+
if (editorWindow) {
|
|
50
|
+
editorWindow.print();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
EditorPrintDirective = tslib_1.__decorate([
|
|
56
|
+
Directive({
|
|
57
|
+
selector: 'kendo-toolbar-button[kendoEditorPrintButton]'
|
|
58
|
+
}),
|
|
59
|
+
tslib_1.__param(1, Host()),
|
|
60
|
+
tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
|
|
61
|
+
EditorComponent,
|
|
62
|
+
EditorLocalizationService])
|
|
63
|
+
], EditorPrintDirective);
|
|
64
|
+
export { EditorPrintDirective };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
6
|
+
import { EditorComponent } from '../../editor.component';
|
|
7
|
+
import { EditorCommandButton } from '../shared/editor-command-button';
|
|
8
|
+
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
9
|
+
/**
|
|
10
|
+
* A directive which configures an existing `ToolBarButtonComponent` as an Editor SelectAll tool
|
|
11
|
+
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
12
|
+
* The directive will predefine the `icon` and `click` event handlers of the button.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts-no-run
|
|
16
|
+
* <kendo-toolbar-button kendoEditorSelectAllButton></kendo-toolbar-button>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* The following example demonstrates how to change the default icon that is applied by the directive.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts-no-run
|
|
23
|
+
* <kendo-toolbar-button kendoEditorSelectAllButton icon="blogger"></kendo-toolbar-button>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class EditorSelectAllButtonDirective extends EditorCommandButton {
|
|
27
|
+
constructor(button: ToolBarButtonComponent, editor: EditorComponent, localization: EditorLocalizationService);
|
|
28
|
+
protected clickHandler(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Directive, Host } from '@angular/core';
|
|
7
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { EditorComponent } from '../../editor.component';
|
|
9
|
+
import { EditorCommandButton } from '../shared/editor-command-button';
|
|
10
|
+
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
11
|
+
/**
|
|
12
|
+
* A directive which configures an existing `ToolBarButtonComponent` as an Editor SelectAll tool
|
|
13
|
+
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
14
|
+
* The directive will predefine the `icon` and `click` event handlers of the button.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts-no-run
|
|
18
|
+
* <kendo-toolbar-button kendoEditorSelectAllButton></kendo-toolbar-button>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* The following example demonstrates how to change the default icon that is applied by the directive.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts-no-run
|
|
25
|
+
* <kendo-toolbar-button kendoEditorSelectAllButton icon="blogger"></kendo-toolbar-button>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
let EditorSelectAllButtonDirective = class EditorSelectAllButtonDirective extends EditorCommandButton {
|
|
29
|
+
constructor(button, editor, localization) {
|
|
30
|
+
super('selectAll', button, editor, localization);
|
|
31
|
+
}
|
|
32
|
+
clickHandler() {
|
|
33
|
+
this.editor.shouldEmitFocus = true;
|
|
34
|
+
super.clickHandler();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
EditorSelectAllButtonDirective = tslib_1.__decorate([
|
|
38
|
+
Directive({
|
|
39
|
+
selector: 'kendo-toolbar-button[kendoEditorSelectAllButton]'
|
|
40
|
+
}),
|
|
41
|
+
tslib_1.__param(1, Host()),
|
|
42
|
+
tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
|
|
43
|
+
EditorComponent,
|
|
44
|
+
EditorLocalizationService])
|
|
45
|
+
], EditorSelectAllButtonDirective);
|
|
46
|
+
export { EditorSelectAllButtonDirective };
|
|
@@ -5,19 +5,20 @@
|
|
|
5
5
|
import { Subscription } from 'rxjs';
|
|
6
6
|
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
7
7
|
import { EditorComponent } from '../../editor.component';
|
|
8
|
-
import { EditorCommand, DialogCommand } from '../../common/commands';
|
|
8
|
+
import { EditorCommand, DialogCommand, EditorInternalCommand } from '../../common/commands';
|
|
9
9
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
13
|
export declare abstract class EditorCommandBase {
|
|
14
|
-
protected command: DialogCommand | EditorCommand;
|
|
14
|
+
protected command: DialogCommand | EditorCommand | EditorInternalCommand;
|
|
15
15
|
protected button: ToolBarButtonComponent;
|
|
16
16
|
protected editor: EditorComponent;
|
|
17
17
|
protected localization: LocalizationService;
|
|
18
18
|
protected subs: Subscription;
|
|
19
|
-
constructor(command: DialogCommand | EditorCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
|
|
19
|
+
constructor(command: DialogCommand | EditorCommand | EditorInternalCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
|
|
20
20
|
ngOnInit(): void;
|
|
21
|
+
ngAfterViewInit(): void;
|
|
21
22
|
ngOnDestroy(): void;
|
|
22
23
|
protected clickHandler(): void;
|
|
23
24
|
protected pointerdownHandler(_event: PointerEvent): void;
|
|
@@ -17,14 +17,16 @@ export class EditorCommandBase {
|
|
|
17
17
|
this.subs = this.editor.stateChange.subscribe(this.onStateChange.bind(this));
|
|
18
18
|
this.subs.add(this.button.click.subscribe((this.clickHandler.bind(this))));
|
|
19
19
|
this.subs.add(this.button.pointerdown.subscribe((this.pointerdownHandler.bind(this))));
|
|
20
|
-
|
|
20
|
+
}
|
|
21
|
+
ngAfterViewInit() {
|
|
22
|
+
setTimeout(() => {
|
|
21
23
|
const text = this.localization.get(this.command);
|
|
22
24
|
if (text) {
|
|
23
|
-
this.button.showText =
|
|
24
|
-
this.button.showIcon =
|
|
25
|
+
this.button.showText = 'overflow';
|
|
26
|
+
this.button.showIcon = 'both';
|
|
25
27
|
this.button.text = text;
|
|
26
28
|
}
|
|
27
|
-
if (!this.button.icon) {
|
|
29
|
+
if (!this.button.toolbarOptions.icon) {
|
|
28
30
|
this.button.icon = commandIcons[this.command];
|
|
29
31
|
}
|
|
30
32
|
this.button.title = text;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
6
|
-
import { EditorCommand } from '../../common/commands';
|
|
6
|
+
import { EditorCommand, EditorInternalCommand } from '../../common/commands';
|
|
7
7
|
import { EditorComponent } from '../../editor.component';
|
|
8
8
|
import { EditorCommandBase } from './editor-command-base';
|
|
9
9
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
@@ -11,11 +11,11 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
13
|
export declare abstract class EditorCommandButton extends EditorCommandBase {
|
|
14
|
-
protected command: EditorCommand;
|
|
14
|
+
protected command: EditorCommand | EditorInternalCommand;
|
|
15
15
|
protected button: ToolBarButtonComponent;
|
|
16
16
|
protected editor: EditorComponent;
|
|
17
17
|
protected localization: LocalizationService;
|
|
18
|
-
constructor(command: EditorCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
|
|
18
|
+
constructor(command: EditorCommand | EditorInternalCommand, button: ToolBarButtonComponent, editor: EditorComponent, localization: LocalizationService);
|
|
19
19
|
protected clickHandler(): void;
|
|
20
20
|
protected pointerdownHandler(e: PointerEvent): void;
|
|
21
21
|
protected onStateChange(toolBarState: any): void;
|