@progress/kendo-angular-editor 11.0.0-develop.99 → 11.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.
- package/NOTICE.txt +17 -17
- package/config/command-icons.d.ts +4 -0
- package/dialogs/colorpicker-dialog.component.d.ts +2 -0
- package/dialogs/file-link-dialog.component.d.ts +2 -2
- package/dialogs/image-dialog.component.d.ts +2 -2
- package/dialogs/source-dialog.component.d.ts +2 -2
- package/editor.component.d.ts +3 -2
- package/editor.module.d.ts +4 -2
- package/esm2020/config/command-icons.mjs +45 -0
- package/esm2020/dialogs/colorpicker-dialog.component.mjs +29 -34
- package/esm2020/dialogs/file-link-dialog.component.mjs +79 -77
- package/esm2020/dialogs/font-family-dialog.component.mjs +20 -28
- package/esm2020/dialogs/font-size-dialog.component.mjs +20 -28
- package/esm2020/dialogs/format-dialog.component.mjs +20 -28
- package/esm2020/dialogs/image-dialog.component.mjs +74 -63
- package/esm2020/dialogs/insert-table-dialog.component.mjs +6 -14
- package/esm2020/dialogs/source-dialog.component.mjs +9 -7
- package/esm2020/editor.component.mjs +31 -10
- package/esm2020/editor.module.mjs +15 -4
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/tools/colorpicker/editor-back-color.directive.mjs +2 -1
- package/esm2020/tools/colorpicker/editor-colorpicker.component.mjs +53 -37
- package/esm2020/tools/colorpicker/editor-fore-color.directive.mjs +2 -1
- package/esm2020/tools/fontfamily/editor-fontfamily.component.mjs +36 -31
- package/esm2020/tools/fontsize/editor-fontsize.component.mjs +35 -31
- package/esm2020/tools/format/editor-format.component.mjs +35 -33
- package/esm2020/tools/shared/editor-command-base.mjs +20 -13
- package/esm2020/tools/shared/editor-command-button.mjs +10 -2
- package/esm2020/tools/shared/editor-command-dialog.mjs +10 -2
- package/esm2020/tools/tables/editor-insert-table-button.component.mjs +36 -23
- package/esm2020/tools/tables/popup-table-grid.component.mjs +4 -2
- package/esm2020/tools/tools.service.mjs +5 -4
- package/fesm2015/progress-kendo-angular-editor.mjs +571 -464
- package/fesm2020/progress-kendo-angular-editor.mjs +570 -464
- package/package.json +16 -15
- package/schematics/ngAdd/index.js +5 -3
- package/tools/colorpicker/editor-colorpicker.component.d.ts +10 -3
- package/tools/fontfamily/editor-fontfamily.component.d.ts +5 -2
- package/tools/fontsize/editor-fontsize.component.d.ts +5 -2
- package/tools/format/editor-format.component.d.ts +5 -2
- package/tools/tables/editor-insert-table-button.component.d.ts +5 -2
- package/tools/tables/popup-table-grid.component.d.ts +2 -0
- package/tools/tools.service.d.ts +3 -0
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
6
|
// eslint-disable no-forward-ref
|
|
6
|
-
import { Component, Input, forwardRef, ViewChild, ElementRef, TemplateRef, NgZone } from '@angular/core';
|
|
7
|
+
import { Component, Input, forwardRef, ViewChild, ElementRef, TemplateRef, NgZone, Renderer2 } from '@angular/core';
|
|
7
8
|
import { ToolBarToolComponent } from '@progress/kendo-angular-toolbar';
|
|
8
9
|
import { ColorPickerComponent } from '@progress/kendo-angular-inputs';
|
|
9
10
|
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
@@ -17,18 +18,20 @@ import * as i1 from "../../localization/editor-localization.service";
|
|
|
17
18
|
import * as i2 from "@progress/kendo-angular-dialog";
|
|
18
19
|
import * as i3 from "../../common/provider.service";
|
|
19
20
|
import * as i4 from "@progress/kendo-angular-inputs";
|
|
20
|
-
import * as i5 from "@progress/kendo-angular-
|
|
21
|
+
import * as i5 from "@progress/kendo-angular-icons";
|
|
22
|
+
import * as i6 from "@angular/common";
|
|
21
23
|
/**
|
|
22
24
|
* A component which configures an existing ColorPickerComponent as a ToolBar tool.
|
|
23
25
|
* To associate a `kendo-toolbar-colorpicker` with an Editor command that changes the
|
|
24
26
|
* foreground or the background color of the text, use the `kendoEditorForeColor` or `kendoEditorBackColor` directive.
|
|
25
27
|
*/
|
|
26
28
|
export class EditorColorPickerComponent extends ToolBarToolComponent {
|
|
27
|
-
constructor(localization, dialogService, ngZone, providerService) {
|
|
29
|
+
constructor(localization, dialogService, ngZone, providerService, renderer) {
|
|
28
30
|
super();
|
|
29
31
|
this.localization = localization;
|
|
30
32
|
this.dialogService = dialogService;
|
|
31
33
|
this.ngZone = ngZone;
|
|
34
|
+
this.renderer = renderer;
|
|
32
35
|
this.tabindex = -1;
|
|
33
36
|
/**
|
|
34
37
|
* Specifies if the component should be disabled.
|
|
@@ -124,10 +127,12 @@ export class EditorColorPickerComponent extends ToolBarToolComponent {
|
|
|
124
127
|
openDialog() {
|
|
125
128
|
const dialogSettings = {
|
|
126
129
|
appendTo: this.editor.dialogContainer,
|
|
127
|
-
content: ColorPickerDialogComponent
|
|
130
|
+
content: ColorPickerDialogComponent,
|
|
131
|
+
width: 400
|
|
128
132
|
};
|
|
129
133
|
this.editor.toolbar.toggle(false);
|
|
130
134
|
const dialogContent = this.dialogService.open(dialogSettings).content.instance;
|
|
135
|
+
this.renderer.addClass(dialogContent.dialog.dialog.instance.wrapper.nativeElement.querySelector('.k-window'), 'k-editor-window');
|
|
131
136
|
dialogContent.setData({
|
|
132
137
|
editor: this.editor,
|
|
133
138
|
value: this.value,
|
|
@@ -135,6 +140,7 @@ export class EditorColorPickerComponent extends ToolBarToolComponent {
|
|
|
135
140
|
editorCommand: this.editorCommand,
|
|
136
141
|
paletteSettings: this.paletteSettings,
|
|
137
142
|
icon: this.icon,
|
|
143
|
+
svgIcon: this.svgIcon,
|
|
138
144
|
views: this.views
|
|
139
145
|
});
|
|
140
146
|
}
|
|
@@ -150,10 +156,10 @@ export class EditorColorPickerComponent extends ToolBarToolComponent {
|
|
|
150
156
|
focus() {
|
|
151
157
|
this.tabindex = 0;
|
|
152
158
|
if (this.overflows) {
|
|
153
|
-
this.colorPickerButton
|
|
159
|
+
this.colorPickerButton?.nativeElement.focus();
|
|
154
160
|
}
|
|
155
161
|
else {
|
|
156
|
-
!this.colorPicker.isOpen && this.colorPicker
|
|
162
|
+
!this.colorPicker.isOpen && this.colorPicker?.focus();
|
|
157
163
|
}
|
|
158
164
|
}
|
|
159
165
|
/**
|
|
@@ -164,13 +170,14 @@ export class EditorColorPickerComponent extends ToolBarToolComponent {
|
|
|
164
170
|
return false;
|
|
165
171
|
}
|
|
166
172
|
}
|
|
167
|
-
EditorColorPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorColorPickerComponent, deps: [{ token: i1.EditorLocalizationService }, { token: i2.DialogService }, { token: i0.NgZone }, { token: i3.ProviderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
168
|
-
EditorColorPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: EditorColorPickerComponent, selector: "kendo-toolbar-colorpicker", inputs: { value: "value", icon: "icon", paletteSettings: "paletteSettings", editorCommand: "editorCommand", disabled: "disabled", views: "views", view: "view" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => EditorColorPickerComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "element", first: true, predicate: ["colorpicker"], descendants: true, read: ElementRef }, { propertyName: "colorPicker", first: true, predicate: ["colorpicker"], descendants: true, read: ColorPickerComponent }, { propertyName: "colorPickerButton", first: true, predicate: ["colorPickerButton"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
|
|
173
|
+
EditorColorPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorColorPickerComponent, deps: [{ token: i1.EditorLocalizationService }, { token: i2.DialogService }, { token: i0.NgZone }, { token: i3.ProviderService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
174
|
+
EditorColorPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: EditorColorPickerComponent, selector: "kendo-toolbar-colorpicker", inputs: { value: "value", icon: "icon", svgIcon: "svgIcon", paletteSettings: "paletteSettings", editorCommand: "editorCommand", disabled: "disabled", views: "views", view: "view" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => EditorColorPickerComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "element", first: true, predicate: ["colorpicker"], descendants: true, read: ElementRef }, { propertyName: "colorPicker", first: true, predicate: ["colorpicker"], descendants: true, read: ColorPickerComponent }, { propertyName: "colorPickerButton", first: true, predicate: ["colorPickerButton"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
|
|
169
175
|
<ng-template #toolbarTemplate>
|
|
170
176
|
<kendo-colorpicker
|
|
171
177
|
#colorpicker
|
|
172
178
|
[attr.title]="title"
|
|
173
179
|
[icon]="icon"
|
|
180
|
+
[svgIcon]="svgIcon"
|
|
174
181
|
[views]="views"
|
|
175
182
|
[format]="'hex'"
|
|
176
183
|
[value]="value"
|
|
@@ -186,22 +193,25 @@ EditorColorPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
186
193
|
</kendo-colorpicker>
|
|
187
194
|
</ng-template>
|
|
188
195
|
<ng-template #popupTemplate>
|
|
189
|
-
<
|
|
196
|
+
<div #colorPickerButton
|
|
190
197
|
tabindex="-1"
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
class="k-overflow-button"
|
|
195
|
-
[icon]="icon"
|
|
196
|
-
[attr.title]="title"
|
|
197
|
-
[disabled]="disabled"
|
|
198
|
+
role="menuitem"
|
|
199
|
+
class="k-item k-menu-item"
|
|
200
|
+
[class.k-disabled]="disabled"
|
|
198
201
|
[tabindex]="tabindex"
|
|
199
|
-
(click)="openDialog()"
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
(click)="openDialog()">
|
|
203
|
+
<span
|
|
204
|
+
class="k-link k-menu-link">
|
|
205
|
+
<kendo-icon-wrapper
|
|
206
|
+
*ngIf="icon"
|
|
207
|
+
[name]="icon"
|
|
208
|
+
[svgIcon]="svgIcon"
|
|
209
|
+
></kendo-icon-wrapper>
|
|
210
|
+
<span *ngIf="title" class="k-menu-link-text">{{title}}</span>
|
|
211
|
+
</span>
|
|
212
|
+
</div>
|
|
203
213
|
</ng-template>
|
|
204
|
-
`, isInline: true, components: [{ type: i4.ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { type: i5.
|
|
214
|
+
`, isInline: true, components: [{ type: i4.ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { type: i5.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
205
215
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorColorPickerComponent, decorators: [{
|
|
206
216
|
type: Component,
|
|
207
217
|
args: [{
|
|
@@ -213,6 +223,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
213
223
|
#colorpicker
|
|
214
224
|
[attr.title]="title"
|
|
215
225
|
[icon]="icon"
|
|
226
|
+
[svgIcon]="svgIcon"
|
|
216
227
|
[views]="views"
|
|
217
228
|
[format]="'hex'"
|
|
218
229
|
[value]="value"
|
|
@@ -228,27 +239,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
228
239
|
</kendo-colorpicker>
|
|
229
240
|
</ng-template>
|
|
230
241
|
<ng-template #popupTemplate>
|
|
231
|
-
<
|
|
242
|
+
<div #colorPickerButton
|
|
232
243
|
tabindex="-1"
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
class="k-overflow-button"
|
|
237
|
-
[icon]="icon"
|
|
238
|
-
[attr.title]="title"
|
|
239
|
-
[disabled]="disabled"
|
|
244
|
+
role="menuitem"
|
|
245
|
+
class="k-item k-menu-item"
|
|
246
|
+
[class.k-disabled]="disabled"
|
|
240
247
|
[tabindex]="tabindex"
|
|
241
|
-
(click)="openDialog()"
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
248
|
+
(click)="openDialog()">
|
|
249
|
+
<span
|
|
250
|
+
class="k-link k-menu-link">
|
|
251
|
+
<kendo-icon-wrapper
|
|
252
|
+
*ngIf="icon"
|
|
253
|
+
[name]="icon"
|
|
254
|
+
[svgIcon]="svgIcon"
|
|
255
|
+
></kendo-icon-wrapper>
|
|
256
|
+
<span *ngIf="title" class="k-menu-link-text">{{title}}</span>
|
|
257
|
+
</span>
|
|
258
|
+
</div>
|
|
245
259
|
</ng-template>
|
|
246
260
|
`
|
|
247
261
|
}]
|
|
248
|
-
}], ctorParameters: function () { return [{ type: i1.EditorLocalizationService }, { type: i2.DialogService }, { type: i0.NgZone }, { type: i3.ProviderService }]; }, propDecorators: { value: [{
|
|
262
|
+
}], ctorParameters: function () { return [{ type: i1.EditorLocalizationService }, { type: i2.DialogService }, { type: i0.NgZone }, { type: i3.ProviderService }, { type: i0.Renderer2 }]; }, propDecorators: { value: [{
|
|
249
263
|
type: Input
|
|
250
264
|
}], icon: [{
|
|
251
265
|
type: Input
|
|
266
|
+
}], svgIcon: [{
|
|
267
|
+
type: Input
|
|
252
268
|
}], paletteSettings: [{
|
|
253
269
|
type: Input
|
|
254
270
|
}], editorCommand: [{
|
|
@@ -267,11 +283,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
267
283
|
args: ['popupTemplate', { static: true }]
|
|
268
284
|
}], element: [{
|
|
269
285
|
type: ViewChild,
|
|
270
|
-
args: ['colorpicker', { read: ElementRef
|
|
286
|
+
args: ['colorpicker', { read: ElementRef }]
|
|
271
287
|
}], colorPicker: [{
|
|
272
288
|
type: ViewChild,
|
|
273
|
-
args: ['colorpicker', { read: ColorPickerComponent
|
|
289
|
+
args: ['colorpicker', { read: ColorPickerComponent }]
|
|
274
290
|
}], colorPickerButton: [{
|
|
275
291
|
type: ViewChild,
|
|
276
|
-
args: ['colorPickerButton', { read: ElementRef
|
|
292
|
+
args: ['colorPickerButton', { read: ElementRef }]
|
|
277
293
|
}] } });
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Directive } from '@angular/core';
|
|
6
6
|
import { EditorColorPickerComponent } from './editor-colorpicker.component';
|
|
7
|
-
import { commandIcons } from '../../config/command-icons';
|
|
7
|
+
import { commandIcons, commandSVGIcons } from '../../config/command-icons';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "./editor-colorpicker.component";
|
|
10
10
|
/**
|
|
@@ -16,6 +16,7 @@ export class EditorForeColorDirective {
|
|
|
16
16
|
constructor(colorPicker) {
|
|
17
17
|
this.colorPicker = colorPicker;
|
|
18
18
|
this.colorPicker.icon = commandIcons.foreColor;
|
|
19
|
+
this.colorPicker.svgIcon = commandSVGIcons.foreColor;
|
|
19
20
|
this.colorPicker.editorCommand = 'foreColor';
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
+
import { Component, TemplateRef, ViewChild, ElementRef, forwardRef, Input, Output, EventEmitter, Renderer2 } from '@angular/core';
|
|
6
7
|
import { ToolBarToolComponent } from '@progress/kendo-angular-toolbar';
|
|
7
8
|
import { outerWidth, isPresent, getUniqueStyleValues } from '../../util';
|
|
8
9
|
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
@@ -11,13 +12,15 @@ import { FontFamilyDialogComponent } from '../../dialogs/font-family-dialog.comp
|
|
|
11
12
|
import { FontFamilyDropDownListComponent } from './editor-fontfamily-dropdownlist.component';
|
|
12
13
|
import { ProviderService } from '../../common/provider.service';
|
|
13
14
|
import { EditorToolsService } from '../tools.service';
|
|
15
|
+
import { fontFamilyIcon } from '@progress/kendo-svg-icons';
|
|
14
16
|
import * as i0 from "@angular/core";
|
|
15
17
|
import * as i1 from "@progress/kendo-angular-dialog";
|
|
16
18
|
import * as i2 from "../../localization/editor-localization.service";
|
|
17
19
|
import * as i3 from "../../common/provider.service";
|
|
18
20
|
import * as i4 from "../tools.service";
|
|
19
21
|
import * as i5 from "./editor-fontfamily-dropdownlist.component";
|
|
20
|
-
import * as i6 from "@progress/kendo-angular-
|
|
22
|
+
import * as i6 from "@progress/kendo-angular-icons";
|
|
23
|
+
import * as i7 from "@angular/common";
|
|
21
24
|
/**
|
|
22
25
|
* A component which configures an existing `DropDownListComponent` as an Editor tool
|
|
23
26
|
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
@@ -30,17 +33,19 @@ import * as i6 from "@progress/kendo-angular-buttons";
|
|
|
30
33
|
* ```
|
|
31
34
|
*/
|
|
32
35
|
export class EditorFontFamilyComponent extends ToolBarToolComponent {
|
|
33
|
-
constructor(dialogService, localization, providerService, toolsService) {
|
|
36
|
+
constructor(dialogService, localization, providerService, toolsService, renderer) {
|
|
34
37
|
super();
|
|
35
38
|
this.dialogService = dialogService;
|
|
36
39
|
this.localization = localization;
|
|
37
40
|
this.toolsService = toolsService;
|
|
41
|
+
this.renderer = renderer;
|
|
38
42
|
this.disabled = false;
|
|
39
43
|
this.tabindex = -1;
|
|
40
44
|
/**
|
|
41
45
|
* Fires when the user updates the value of the drop-down list.
|
|
42
46
|
*/
|
|
43
47
|
this.valueChange = new EventEmitter();
|
|
48
|
+
this.fontFamilySVGIcon = fontFamilyIcon;
|
|
44
49
|
this._data = [
|
|
45
50
|
{ text: 'Arial', fontName: 'Arial,"Helvetica Neue",Helvetica,sans-serif' },
|
|
46
51
|
{ text: 'Courier New', fontName: '"Courier New",Courier,"Lucida Sans Typewriter","Lucida Typewriter",monospace' },
|
|
@@ -113,10 +118,12 @@ export class EditorFontFamilyComponent extends ToolBarToolComponent {
|
|
|
113
118
|
openDialog() {
|
|
114
119
|
const dialogSettings = {
|
|
115
120
|
appendTo: this.editor.dialogContainer,
|
|
116
|
-
content: FontFamilyDialogComponent
|
|
121
|
+
content: FontFamilyDialogComponent,
|
|
122
|
+
width: 400
|
|
117
123
|
};
|
|
118
124
|
this.editor.toolbar.toggle(false);
|
|
119
125
|
const dialogContent = this.dialogService.open(dialogSettings).content.instance;
|
|
126
|
+
this.renderer.addClass(dialogContent.dialog.dialog.instance.wrapper.nativeElement.querySelector('.k-window'), 'k-editor-window');
|
|
120
127
|
dialogContent.setData({
|
|
121
128
|
editor: this.editor,
|
|
122
129
|
data: this.data,
|
|
@@ -151,7 +158,7 @@ export class EditorFontFamilyComponent extends ToolBarToolComponent {
|
|
|
151
158
|
return false;
|
|
152
159
|
}
|
|
153
160
|
}
|
|
154
|
-
EditorFontFamilyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorFontFamilyComponent, deps: [{ token: i1.DialogService }, { token: i2.EditorLocalizationService }, { token: i3.ProviderService }, { token: i4.EditorToolsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
161
|
+
EditorFontFamilyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorFontFamilyComponent, deps: [{ token: i1.DialogService }, { token: i2.EditorLocalizationService }, { token: i3.ProviderService }, { token: i4.EditorToolsService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
155
162
|
EditorFontFamilyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: EditorFontFamilyComponent, selector: "kendo-toolbar-dropdownlist[kendoEditorFontFamily]", inputs: { data: "data" }, outputs: { valueChange: "valueChange" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => EditorFontFamilyComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "element", first: true, predicate: ["element"], descendants: true }, { propertyName: "fontFamilyDropDownList", first: true, predicate: ["element"], descendants: true, read: FontFamilyDropDownListComponent }, { propertyName: "fontFamilyButton", first: true, predicate: ["fontFamilyButton"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
|
|
156
163
|
<ng-template #toolbarTemplate>
|
|
157
164
|
<kendo-editor-fontfamily-dropdownlist
|
|
@@ -168,22 +175,21 @@ EditorFontFamilyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
168
175
|
</kendo-editor-fontfamily-dropdownlist>
|
|
169
176
|
</ng-template>
|
|
170
177
|
<ng-template #popupTemplate>
|
|
171
|
-
<
|
|
178
|
+
<div #fontFamilyButton
|
|
172
179
|
tabindex="-1"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
class="k-overflow-button"
|
|
177
|
-
[icon]="'font-family'"
|
|
178
|
-
[attr.title]="title"
|
|
179
|
-
[disabled]="disabled"
|
|
180
|
+
role="menuitem"
|
|
181
|
+
class="k-item k-menu-item"
|
|
182
|
+
[class.k-disabled]="disabled"
|
|
180
183
|
[tabindex]="tabindex"
|
|
181
|
-
(click)="openDialog()"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
(click)="openDialog()">
|
|
185
|
+
<span
|
|
186
|
+
class="k-link k-menu-link">
|
|
187
|
+
<kendo-icon-wrapper name="font-family" [svgIcon]="fontFamilySVGIcon"></kendo-icon-wrapper>
|
|
188
|
+
<span *ngIf="title" class="k-menu-link-text">{{title}}</span>
|
|
189
|
+
</span>
|
|
190
|
+
</div>
|
|
185
191
|
</ng-template>
|
|
186
|
-
`, isInline: true, components: [{ type: i5.FontFamilyDropDownListComponent, selector: "kendo-editor-fontfamily-dropdownlist", inputs: ["data", "value", "defaultItem", "itemDisabled", "title", "disabled", "tabindex"], outputs: ["valueChange"] }, { type: i6.
|
|
192
|
+
`, isInline: true, components: [{ type: i5.FontFamilyDropDownListComponent, selector: "kendo-editor-fontfamily-dropdownlist", inputs: ["data", "value", "defaultItem", "itemDisabled", "title", "disabled", "tabindex"], outputs: ["valueChange"] }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
187
193
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorFontFamilyComponent, decorators: [{
|
|
188
194
|
type: Component,
|
|
189
195
|
args: [{
|
|
@@ -205,24 +211,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
205
211
|
</kendo-editor-fontfamily-dropdownlist>
|
|
206
212
|
</ng-template>
|
|
207
213
|
<ng-template #popupTemplate>
|
|
208
|
-
<
|
|
214
|
+
<div #fontFamilyButton
|
|
209
215
|
tabindex="-1"
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
class="k-overflow-button"
|
|
214
|
-
[icon]="'font-family'"
|
|
215
|
-
[attr.title]="title"
|
|
216
|
-
[disabled]="disabled"
|
|
216
|
+
role="menuitem"
|
|
217
|
+
class="k-item k-menu-item"
|
|
218
|
+
[class.k-disabled]="disabled"
|
|
217
219
|
[tabindex]="tabindex"
|
|
218
|
-
(click)="openDialog()"
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
(click)="openDialog()">
|
|
221
|
+
<span
|
|
222
|
+
class="k-link k-menu-link">
|
|
223
|
+
<kendo-icon-wrapper name="font-family" [svgIcon]="fontFamilySVGIcon"></kendo-icon-wrapper>
|
|
224
|
+
<span *ngIf="title" class="k-menu-link-text">{{title}}</span>
|
|
225
|
+
</span>
|
|
226
|
+
</div>
|
|
222
227
|
</ng-template>
|
|
223
228
|
`
|
|
224
229
|
}]
|
|
225
|
-
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.EditorLocalizationService }, { type: i3.ProviderService }, { type: i4.EditorToolsService }]; }, propDecorators: { data: [{
|
|
230
|
+
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.EditorLocalizationService }, { type: i3.ProviderService }, { type: i4.EditorToolsService }, { type: i0.Renderer2 }]; }, propDecorators: { data: [{
|
|
226
231
|
type: Input
|
|
227
232
|
}], valueChange: [{
|
|
228
233
|
type: Output
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, Input, TemplateRef, ViewChild, ElementRef, forwardRef, Output, EventEmitter } from '@angular/core';
|
|
5
|
+
import { Component, Input, TemplateRef, ViewChild, ElementRef, forwardRef, Output, EventEmitter, Renderer2 } from '@angular/core';
|
|
6
6
|
import { ToolBarToolComponent } from '@progress/kendo-angular-toolbar';
|
|
7
7
|
import { outerWidth, isPresent, getUniqueStyleValues } from '../../util';
|
|
8
8
|
import { EditorLocalizationService } from '../../localization/editor-localization.service';
|
|
@@ -11,13 +11,15 @@ import { FontSizeDialogComponent } from '../../dialogs/font-size-dialog.componen
|
|
|
11
11
|
import { FontSizeDropDownListComponent } from './editor-fontsize-dropdownlist.component';
|
|
12
12
|
import { ProviderService } from '../../common/provider.service';
|
|
13
13
|
import { EditorToolsService } from '../tools.service';
|
|
14
|
+
import { fontSizeIcon } from '@progress/kendo-svg-icons';
|
|
14
15
|
import * as i0 from "@angular/core";
|
|
15
16
|
import * as i1 from "@progress/kendo-angular-dialog";
|
|
16
17
|
import * as i2 from "../../localization/editor-localization.service";
|
|
17
18
|
import * as i3 from "../../common/provider.service";
|
|
18
19
|
import * as i4 from "../tools.service";
|
|
19
20
|
import * as i5 from "./editor-fontsize-dropdownlist.component";
|
|
20
|
-
import * as i6 from "@progress/kendo-angular-
|
|
21
|
+
import * as i6 from "@progress/kendo-angular-icons";
|
|
22
|
+
import * as i7 from "@angular/common";
|
|
21
23
|
/**
|
|
22
24
|
* A component which configures an existing `DropDownListComponent` as an Editor tool
|
|
23
25
|
* ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
|
|
@@ -32,17 +34,19 @@ import * as i6 from "@progress/kendo-angular-buttons";
|
|
|
32
34
|
* Use the FontSize tool to provide a custom list of font size options including any allowed units ([see example]({% slug toolbartools_editor %}#toc-dropdownlists)).
|
|
33
35
|
*/
|
|
34
36
|
export class EditorFontSizeComponent extends ToolBarToolComponent {
|
|
35
|
-
constructor(dialogService, localization, providerService, toolsService) {
|
|
37
|
+
constructor(dialogService, localization, providerService, toolsService, renderer) {
|
|
36
38
|
super();
|
|
37
39
|
this.dialogService = dialogService;
|
|
38
40
|
this.localization = localization;
|
|
39
41
|
this.toolsService = toolsService;
|
|
42
|
+
this.renderer = renderer;
|
|
40
43
|
this.disabled = false;
|
|
41
44
|
this.tabindex = -1;
|
|
42
45
|
/**
|
|
43
46
|
* Fires when the user updates the value of the drop-down list.
|
|
44
47
|
*/
|
|
45
48
|
this.valueChange = new EventEmitter();
|
|
49
|
+
this.fontSizeSVGIcon = fontSizeIcon;
|
|
46
50
|
this._data = [
|
|
47
51
|
{ text: '8px', size: '8px' },
|
|
48
52
|
{ text: '10px', size: '10px' },
|
|
@@ -122,10 +126,12 @@ export class EditorFontSizeComponent extends ToolBarToolComponent {
|
|
|
122
126
|
openDialog() {
|
|
123
127
|
const dialogSettings = {
|
|
124
128
|
appendTo: this.editor.dialogContainer,
|
|
125
|
-
content: FontSizeDialogComponent
|
|
129
|
+
content: FontSizeDialogComponent,
|
|
130
|
+
width: 400
|
|
126
131
|
};
|
|
127
132
|
this.editor.toolbar.toggle(false);
|
|
128
133
|
const dialogContent = this.dialogService.open(dialogSettings).content.instance;
|
|
134
|
+
this.renderer.addClass(dialogContent.dialog.dialog.instance.wrapper.nativeElement.querySelector('.k-window'), 'k-editor-window');
|
|
129
135
|
dialogContent.setData({
|
|
130
136
|
editor: this.editor,
|
|
131
137
|
data: this.data,
|
|
@@ -160,7 +166,7 @@ export class EditorFontSizeComponent extends ToolBarToolComponent {
|
|
|
160
166
|
return false;
|
|
161
167
|
}
|
|
162
168
|
}
|
|
163
|
-
EditorFontSizeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorFontSizeComponent, deps: [{ token: i1.DialogService }, { token: i2.EditorLocalizationService }, { token: i3.ProviderService }, { token: i4.EditorToolsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
169
|
+
EditorFontSizeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorFontSizeComponent, deps: [{ token: i1.DialogService }, { token: i2.EditorLocalizationService }, { token: i3.ProviderService }, { token: i4.EditorToolsService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
164
170
|
EditorFontSizeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: EditorFontSizeComponent, selector: "kendo-toolbar-dropdownlist[kendoEditorFontSize]", inputs: { data: "data" }, outputs: { valueChange: "valueChange" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => EditorFontSizeComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "element", first: true, predicate: ["element"], descendants: true }, { propertyName: "fontSizeDropDownList", first: true, predicate: ["element"], descendants: true, read: FontSizeDropDownListComponent }, { propertyName: "fontSizeButton", first: true, predicate: ["fontSizeButton"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
|
|
165
171
|
<ng-template #toolbarTemplate>
|
|
166
172
|
<kendo-editor-fontsize-dropdownlist
|
|
@@ -177,22 +183,21 @@ EditorFontSizeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
|
|
|
177
183
|
</kendo-editor-fontsize-dropdownlist>
|
|
178
184
|
</ng-template>
|
|
179
185
|
<ng-template #popupTemplate>
|
|
180
|
-
<
|
|
186
|
+
<div #fontSizeButton
|
|
181
187
|
tabindex="-1"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
class="k-overflow-button"
|
|
186
|
-
[icon]="'font-size'"
|
|
187
|
-
[attr.title]="title"
|
|
188
|
-
[disabled]="disabled"
|
|
188
|
+
role="menuitem"
|
|
189
|
+
class="k-item k-menu-item"
|
|
190
|
+
[class.k-disabled]="disabled"
|
|
189
191
|
[tabindex]="tabindex"
|
|
190
|
-
(click)="openDialog()"
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
(click)="openDialog()">
|
|
193
|
+
<span
|
|
194
|
+
class="k-link k-menu-link">
|
|
195
|
+
<kendo-icon-wrapper name="font-size" [svgIcon]="fontSizeSVGIcon"></kendo-icon-wrapper>
|
|
196
|
+
<span *ngIf="title" class="k-menu-link-text">{{title}}</span>
|
|
197
|
+
</span>
|
|
198
|
+
</div>
|
|
194
199
|
</ng-template>
|
|
195
|
-
`, isInline: true, components: [{ type: i5.FontSizeDropDownListComponent, selector: "kendo-editor-fontsize-dropdownlist", inputs: ["data", "value", "defaultItem", "itemDisabled", "title", "disabled", "tabindex"], outputs: ["valueChange"] }, { type: i6.
|
|
200
|
+
`, isInline: true, components: [{ type: i5.FontSizeDropDownListComponent, selector: "kendo-editor-fontsize-dropdownlist", inputs: ["data", "value", "defaultItem", "itemDisabled", "title", "disabled", "tabindex"], outputs: ["valueChange"] }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
196
201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EditorFontSizeComponent, decorators: [{
|
|
197
202
|
type: Component,
|
|
198
203
|
args: [{
|
|
@@ -214,24 +219,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
214
219
|
</kendo-editor-fontsize-dropdownlist>
|
|
215
220
|
</ng-template>
|
|
216
221
|
<ng-template #popupTemplate>
|
|
217
|
-
<
|
|
222
|
+
<div #fontSizeButton
|
|
218
223
|
tabindex="-1"
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
class="k-overflow-button"
|
|
223
|
-
[icon]="'font-size'"
|
|
224
|
-
[attr.title]="title"
|
|
225
|
-
[disabled]="disabled"
|
|
224
|
+
role="menuitem"
|
|
225
|
+
class="k-item k-menu-item"
|
|
226
|
+
[class.k-disabled]="disabled"
|
|
226
227
|
[tabindex]="tabindex"
|
|
227
|
-
(click)="openDialog()"
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
(click)="openDialog()">
|
|
229
|
+
<span
|
|
230
|
+
class="k-link k-menu-link">
|
|
231
|
+
<kendo-icon-wrapper name="font-size" [svgIcon]="fontSizeSVGIcon"></kendo-icon-wrapper>
|
|
232
|
+
<span *ngIf="title" class="k-menu-link-text">{{title}}</span>
|
|
233
|
+
</span>
|
|
234
|
+
</div>
|
|
231
235
|
</ng-template>
|
|
232
236
|
`
|
|
233
237
|
}]
|
|
234
|
-
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.EditorLocalizationService }, { type: i3.ProviderService }, { type: i4.EditorToolsService }]; }, propDecorators: { data: [{
|
|
238
|
+
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.EditorLocalizationService }, { type: i3.ProviderService }, { type: i4.EditorToolsService }, { type: i0.Renderer2 }]; }, propDecorators: { data: [{
|
|
235
239
|
type: Input
|
|
236
240
|
}], valueChange: [{
|
|
237
241
|
type: Output
|