@progress/kendo-angular-editor 21.4.1 → 22.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.
Files changed (101) hide show
  1. package/fesm2022/progress-kendo-angular-editor.mjs +196 -196
  2. package/localization/messages.d.ts +1 -1
  3. package/package.json +20 -28
  4. package/schematics/ngAdd/index.js +4 -4
  5. package/tools/shared/editor-command-base.d.ts +1 -1
  6. package/esm2022/common/active-marks.mjs +0 -5
  7. package/esm2022/common/apply-to-word-options.mjs +0 -5
  8. package/esm2022/common/commands.mjs +0 -5
  9. package/esm2022/common/css-settings.interface.mjs +0 -5
  10. package/esm2022/common/direction.mjs +0 -5
  11. package/esm2022/common/error-messages.mjs +0 -16
  12. package/esm2022/common/font-family-item.interface.mjs +0 -5
  13. package/esm2022/common/font-size-item.interface.mjs +0 -5
  14. package/esm2022/common/format-item.interface.mjs +0 -5
  15. package/esm2022/common/image-data.interface.mjs +0 -5
  16. package/esm2022/common/link-data.interface.mjs +0 -5
  17. package/esm2022/common/paste-cleanup-settings.mjs +0 -5
  18. package/esm2022/common/plugins-function.mjs +0 -5
  19. package/esm2022/common/predicate.mjs +0 -5
  20. package/esm2022/common/provider.service.mjs +0 -17
  21. package/esm2022/common/resizable-options.interface.mjs +0 -5
  22. package/esm2022/common/styles.mjs +0 -306
  23. package/esm2022/common/table-data.interface.mjs +0 -5
  24. package/esm2022/config/command-icons.mjs +0 -93
  25. package/esm2022/config/commands.mjs +0 -62
  26. package/esm2022/config/schema.mjs +0 -22
  27. package/esm2022/config/semantic-nodes.mjs +0 -27
  28. package/esm2022/config/table-commands.mjs +0 -14
  29. package/esm2022/config/utils.mjs +0 -96
  30. package/esm2022/dialogs/colorpicker-dialog.component.mjs +0 -140
  31. package/esm2022/dialogs/file-link-dialog.component.mjs +0 -252
  32. package/esm2022/dialogs/font-family-dialog.component.mjs +0 -115
  33. package/esm2022/dialogs/font-size-dialog.component.mjs +0 -115
  34. package/esm2022/dialogs/format-dialog.component.mjs +0 -114
  35. package/esm2022/dialogs/image-dialog.component.mjs +0 -230
  36. package/esm2022/dialogs/insert-table-dialog.component.mjs +0 -79
  37. package/esm2022/dialogs/source-dialog.component.mjs +0 -112
  38. package/esm2022/directives.mjs +0 -95
  39. package/esm2022/editor-toolbar-state.mjs +0 -280
  40. package/esm2022/editor.component.mjs +0 -1319
  41. package/esm2022/editor.module.mjs +0 -89
  42. package/esm2022/index.mjs +0 -64
  43. package/esm2022/localization/custom-messages.component.mjs +0 -53
  44. package/esm2022/localization/editor-localization.service.mjs +0 -31
  45. package/esm2022/localization/localized-messages.directive.mjs +0 -35
  46. package/esm2022/localization/messages.mjs +0 -364
  47. package/esm2022/package-metadata.mjs +0 -16
  48. package/esm2022/preventable-events/paste-event.mjs +0 -32
  49. package/esm2022/preventable-events/preventable-event.mjs +0 -25
  50. package/esm2022/progress-kendo-angular-editor.mjs +0 -8
  51. package/esm2022/tools/alignment/editor-align-center-button.directive.mjs +0 -42
  52. package/esm2022/tools/alignment/editor-align-justify-button.directive.mjs +0 -42
  53. package/esm2022/tools/alignment/editor-align-left-button.directive.mjs +0 -42
  54. package/esm2022/tools/alignment/editor-align-right-button.directive.mjs +0 -42
  55. package/esm2022/tools/blockquote/editor-blockquote-button.directive.mjs +0 -40
  56. package/esm2022/tools/colorpicker/editor-back-color.directive.mjs +0 -41
  57. package/esm2022/tools/colorpicker/editor-colorpicker.component.mjs +0 -377
  58. package/esm2022/tools/colorpicker/editor-fore-color.directive.mjs +0 -37
  59. package/esm2022/tools/editor-clean-formatting-button.directive.mjs +0 -41
  60. package/esm2022/tools/fontfamily/editor-fontfamily-dropdownlist.component.mjs +0 -109
  61. package/esm2022/tools/fontfamily/editor-fontfamily.component.mjs +0 -297
  62. package/esm2022/tools/fontsize/editor-fontsize-dropdownlist.component.mjs +0 -98
  63. package/esm2022/tools/fontsize/editor-fontsize.component.mjs +0 -305
  64. package/esm2022/tools/format/editor-format-dropdownlist.component.mjs +0 -182
  65. package/esm2022/tools/format/editor-format.component.mjs +0 -283
  66. package/esm2022/tools/history/editor-redo-button.directive.mjs +0 -42
  67. package/esm2022/tools/history/editor-undo-button.directive.mjs +0 -42
  68. package/esm2022/tools/image/editor-insert-image-button.directive.mjs +0 -41
  69. package/esm2022/tools/indentation/editor-indent-button.directive.mjs +0 -41
  70. package/esm2022/tools/indentation/editor-outdent-button.directive.mjs +0 -41
  71. package/esm2022/tools/link/editor-create-link-button.directive.mjs +0 -41
  72. package/esm2022/tools/link/editor-insert-file-button.directive.mjs +0 -40
  73. package/esm2022/tools/link/editor-unlink-button.directive.mjs +0 -41
  74. package/esm2022/tools/list/editor-insert-ordered-list-button.directive.mjs +0 -41
  75. package/esm2022/tools/list/editor-insert-unordered-list-button.directive.mjs +0 -42
  76. package/esm2022/tools/print/editor-print-button.directive.mjs +0 -62
  77. package/esm2022/tools/select-all/select-all-button.directive.mjs +0 -45
  78. package/esm2022/tools/shared/dropdown-tool.directive.mjs +0 -40
  79. package/esm2022/tools/shared/editor-command-base.mjs +0 -78
  80. package/esm2022/tools/shared/editor-command-button.mjs +0 -37
  81. package/esm2022/tools/shared/editor-command-dialog.mjs +0 -33
  82. package/esm2022/tools/source/editor-view-source-button.directive.mjs +0 -41
  83. package/esm2022/tools/tables/editor-add-column-after-button.directive.mjs +0 -42
  84. package/esm2022/tools/tables/editor-add-column-before-button.directive.mjs +0 -42
  85. package/esm2022/tools/tables/editor-add-row-after-button.directive.mjs +0 -42
  86. package/esm2022/tools/tables/editor-add-row-before-button.directive.mjs +0 -42
  87. package/esm2022/tools/tables/editor-delete-column-button.directive.mjs +0 -42
  88. package/esm2022/tools/tables/editor-delete-row-button.directive.mjs +0 -42
  89. package/esm2022/tools/tables/editor-delete-table-button.directive.mjs +0 -42
  90. package/esm2022/tools/tables/editor-insert-table-button.component.mjs +0 -307
  91. package/esm2022/tools/tables/editor-merge-cells-button.directive.mjs +0 -44
  92. package/esm2022/tools/tables/editor-split-cell-button.directive.mjs +0 -44
  93. package/esm2022/tools/tables/popup-table-grid.component.mjs +0 -117
  94. package/esm2022/tools/tools.service.mjs +0 -22
  95. package/esm2022/tools/typographical-emphasis/editor-bold-button.directive.mjs +0 -42
  96. package/esm2022/tools/typographical-emphasis/editor-italic-button.directive.mjs +0 -42
  97. package/esm2022/tools/typographical-emphasis/editor-strikethrough-button.directive.mjs +0 -42
  98. package/esm2022/tools/typographical-emphasis/editor-subscript-button.directive.mjs +0 -42
  99. package/esm2022/tools/typographical-emphasis/editor-superscript-button.directive.mjs +0 -42
  100. package/esm2022/tools/typographical-emphasis/editor-underline-button.directive.mjs +0 -42
  101. package/esm2022/util.mjs +0 -130
@@ -1,93 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { alignCenterIcon, alignJustifyIcon, alignLeftIcon, alignRightIcon, boldIcon, cellsMergeIcon, cellSplitHorizontallyIcon, clearCssIcon, codeSnippetIcon, dropletIcon, fileAddIcon, fileImageIcon, foregroundColorIcon, indentIcon, italicIcon, linkIcon, listOrderedIcon, listUnorderedIcon, outdentIcon, printIcon, redoIcon, rightDoubleQuotesIcon, selectAllIcon, strikethroughIcon, subscriptIcon, supscriptIcon, tableAddIcon, tableColumnDeleteIcon, tableColumnInsertLeftIcon, tableColumnInsertRightIcon, tableDeleteIcon, tableRowDeleteIcon, tableRowInsertAboveIcon, tableRowInsertBelowIcon, underlineIcon, undoIcon, unlinkIcon } from '@progress/kendo-svg-icons';
6
- /**
7
- * @hidden
8
- */
9
- export const commandIcons = {
10
- alignCenter: 'align-center',
11
- alignJustify: 'align-justify',
12
- alignLeft: 'align-left',
13
- alignRight: 'align-right',
14
- backColor: 'droplet',
15
- blockquote: 'blockquote',
16
- bold: 'bold',
17
- cleanFormatting: 'clear-css',
18
- createLink: 'link',
19
- foreColor: 'foreground-color',
20
- indent: 'indent',
21
- insertFile: 'file-add',
22
- insertImage: 'image',
23
- insertOrderedList: 'list-ordered',
24
- insertUnorderedList: 'list-unordered',
25
- italic: 'italic',
26
- outdent: 'outdent',
27
- print: 'print',
28
- redo: 'redo',
29
- selectAll: 'select-all',
30
- strikethrough: 'strikethrough',
31
- subscript: 'subscript',
32
- superscript: 'supscript',
33
- underline: 'underline',
34
- undo: 'undo',
35
- unlink: 'unlink',
36
- viewSource: 'code',
37
- //table
38
- insertTable: 'table-add',
39
- addColumnBefore: 'table-column-insert-left',
40
- addColumnAfter: 'table-column-insert-right',
41
- addRowBefore: 'table-row-insert-above',
42
- addRowAfter: 'table-row-insert-below',
43
- deleteRow: 'table-row-delete',
44
- deleteColumn: 'table-column-delete',
45
- mergeCells: 'cells-merge',
46
- splitCell: 'cell-split-horizontally',
47
- deleteTable: 'table-delete'
48
- // tableWizard: 'table-wizard'
49
- };
50
- /**
51
- * @hidden
52
- */
53
- export const commandSVGIcons = {
54
- alignCenter: alignCenterIcon,
55
- alignJustify: alignJustifyIcon,
56
- alignLeft: alignLeftIcon,
57
- alignRight: alignRightIcon,
58
- backColor: dropletIcon,
59
- blockquote: rightDoubleQuotesIcon,
60
- bold: boldIcon,
61
- cleanFormatting: clearCssIcon,
62
- createLink: linkIcon,
63
- foreColor: foregroundColorIcon,
64
- indent: indentIcon,
65
- insertFile: fileAddIcon,
66
- insertImage: fileImageIcon,
67
- insertOrderedList: listOrderedIcon,
68
- insertUnorderedList: listUnorderedIcon,
69
- italic: italicIcon,
70
- outdent: outdentIcon,
71
- print: printIcon,
72
- redo: redoIcon,
73
- selectAll: selectAllIcon,
74
- strikethrough: strikethroughIcon,
75
- subscript: subscriptIcon,
76
- superscript: supscriptIcon,
77
- underline: underlineIcon,
78
- undo: undoIcon,
79
- unlink: unlinkIcon,
80
- viewSource: codeSnippetIcon,
81
- //table
82
- insertTable: tableAddIcon,
83
- addColumnBefore: tableColumnInsertLeftIcon,
84
- addColumnAfter: tableColumnInsertRightIcon,
85
- addRowBefore: tableRowInsertAboveIcon,
86
- addRowAfter: tableRowInsertBelowIcon,
87
- deleteRow: tableRowDeleteIcon,
88
- deleteColumn: tableColumnDeleteIcon,
89
- mergeCells: cellsMergeIcon,
90
- splitCell: cellSplitHorizontallyIcon,
91
- deleteTable: tableDeleteIcon
92
- // tableWizard: 'table-wizard'
93
- };
@@ -1,62 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { alignBlocks, alignLeftRules, alignCenterRules, alignRightRules, alignJustifyRules, alignRemoveRules, indent, outdent, setHtml, getHtml, insertImage, insertText, applyLink, removeLink, expandToWordWrap, blockquote,
6
- //marks
7
- bold, italic, underline, strikethrough, subscript, superscript, link, toggleInlineFormat, applyInlineStyle, formatBlockElements, toggleOrderedList, toggleUnorderedList, isAligned, undo, redo, cleanFormatting, selectAll, addColumnBefore, addColumnAfter, addRowBefore, addRowAfter, deleteRow, deleteColumn, deleteTable, mergeCells, splitCell } from '@progress/kendo-editor-common';
8
- import { insertTable } from './table-commands';
9
- const alignRemove = (state, dispatch) => alignBlocks(alignRemoveRules)(state, dispatch);
10
- const inlineCommand = {
11
- bold: (applyToWord) => expandToWordWrap(toggleInlineFormat, { ...bold, applyToWord }),
12
- cleanFormatting: (options) => cleanFormatting(options),
13
- createLink: attrs => expandToWordWrap(applyLink, { mark: 'link', attrs: attrs.value, applyToWord: attrs.applyToWord }),
14
- fontFamily: attrs => expandToWordWrap(applyInlineStyle, { style: 'font-family', value: attrs.value, applyToWord: attrs.applyToWord }),
15
- fontSize: attrs => expandToWordWrap(applyInlineStyle, { style: 'font-size', value: attrs.value, applyToWord: attrs.applyToWord }),
16
- insertFile: attrs => expandToWordWrap(applyLink, { mark: 'link', attrs: attrs, applyToWord: attrs.applyToWord }),
17
- insertText: text => insertText(text),
18
- italic: (applyToWord) => expandToWordWrap(toggleInlineFormat, { ...italic, applyToWord }),
19
- strikethrough: (applyToWord) => expandToWordWrap(toggleInlineFormat, { ...strikethrough, applyToWord }),
20
- subscript: (applyToWord) => expandToWordWrap(toggleInlineFormat, { ...subscript, applyToWord }),
21
- superscript: (applyToWord) => expandToWordWrap(toggleInlineFormat, { ...superscript, applyToWord }),
22
- underline: (applyToWord) => expandToWordWrap(toggleInlineFormat, { ...underline, applyToWord }),
23
- unlink: () => removeLink(link),
24
- foreColor: attrs => expandToWordWrap(applyInlineStyle, { style: 'color', value: attrs.value, applyToWord: attrs.applyToWord }),
25
- backColor: attrs => expandToWordWrap(applyInlineStyle, { style: 'background-color', value: attrs.value, applyToWord: attrs.applyToWord }),
26
- selectAll: () => (state, dispatch) => selectAll(state, dispatch)
27
- };
28
- const blockCommand = {
29
- alignCenter: () => (state, dispatch) => isAligned(state, alignCenterRules) ? alignRemove(state, dispatch) : alignBlocks(alignCenterRules)(state, dispatch),
30
- alignJustify: () => (state, dispatch) => isAligned(state, alignJustifyRules) ? alignRemove(state, dispatch) : alignBlocks(alignJustifyRules)(state, dispatch),
31
- alignLeft: () => (state, dispatch) => isAligned(state, alignLeftRules) ? alignRemove(state, dispatch) : alignBlocks(alignLeftRules)(state, dispatch),
32
- alignRight: () => (state, dispatch) => isAligned(state, alignRightRules) ? alignRemove(state, dispatch) : alignBlocks(alignRightRules)(state, dispatch),
33
- format: formatAttr => formatBlockElements(formatAttr.tag),
34
- getHTML: () => getHtml,
35
- indent: () => indent,
36
- insertImage: attrs => insertImage(attrs),
37
- // think about changing the command name.
38
- insertOrderedList: () => toggleOrderedList,
39
- // think about changing the command name.
40
- insertUnorderedList: () => toggleUnorderedList,
41
- outdent: () => outdent,
42
- redo: () => redo,
43
- setHTML: ({ content, parseOptions }) => setHtml(content, 'setHTML', parseOptions),
44
- undo: () => undo,
45
- blockquote: () => blockquote
46
- };
47
- const tableCommand = {
48
- insertTable: attr => insertTable(attr),
49
- addColumnBefore: () => addColumnBefore,
50
- addColumnAfter: () => addColumnAfter,
51
- addRowBefore: () => addRowBefore,
52
- addRowAfter: () => addRowAfter,
53
- deleteRow: () => deleteRow,
54
- deleteColumn: () => deleteColumn,
55
- mergeCells: () => mergeCells,
56
- splitCell: () => splitCell,
57
- deleteTable: () => deleteTable
58
- };
59
- /**
60
- * @hidden
61
- */
62
- export const editorCommands = Object.assign({}, inlineCommand, blockCommand, tableCommand);
@@ -1,22 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { semanticNodes } from './semantic-nodes';
6
- import { marks as commonMarks, nodes as commonNodes, Schema } from '@progress/kendo-editor-common';
7
- /**
8
- * @hidden
9
- */
10
- const marks = commonMarks;
11
- const nodes = Object.assign(commonNodes, semanticNodes);
12
- /**
13
- * @hidden
14
- */
15
- export const schema = new Schema({
16
- marks,
17
- nodes
18
- });
19
- /**
20
- * @hidden
21
- */
22
- export { Schema };
@@ -1,27 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { commonAttributes, getAttributes, getAttrs, hasAttrs, hole } from './utils';
6
- const createSemanticNode = (tagName) => ({
7
- // Uncaught SyntaxError: Mixing inline and block content (in content expression '(block | inline)*')
8
- // content: '(block | inline)*',
9
- content: 'block*',
10
- group: 'block',
11
- attrs: {
12
- ...commonAttributes()
13
- },
14
- parseDOM: [{
15
- tag: tagName,
16
- getAttrs: getAttributes
17
- }],
18
- toDOM: node => hasAttrs(node.attrs) ? [tagName, getAttrs(node.attrs), hole] : [tagName, hole]
19
- });
20
- /**
21
- * @hidden
22
- */
23
- export const semanticTagNames = ['article', 'main', 'nav', 'header', 'footer', 'aside', 'section'];
24
- /**
25
- * @hidden
26
- */
27
- export const semanticNodes = semanticTagNames.reduce((acc, curr) => Object.assign(acc, { [curr]: createSemanticNode(curr) }), {});
@@ -1,14 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { insertNode, createTable } from '@progress/kendo-editor-common';
6
- /**
7
- * @hidden
8
- */
9
- export const insertTable = (attrs) => (state, dispatch) => {
10
- const newTable = createTable(state.schema.nodes, attrs.rows, attrs.cols);
11
- if (newTable) {
12
- insertNode(newTable, true)(state, dispatch);
13
- }
14
- };
@@ -1,96 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /**
6
- * @hidden
7
- */
8
- export const hasAttrs = (attrs, exclude) => {
9
- for (const attr in attrs) {
10
- if (attr && attrs[attr] !== null && attr !== exclude) {
11
- return true;
12
- }
13
- }
14
- return false;
15
- };
16
- /**
17
- * @hidden
18
- */
19
- export const getAttrs = (attrs, exclude) => {
20
- const result = {};
21
- for (const attr in attrs) {
22
- if (attr && attrs[attr] !== null && attr !== exclude && attr !== 'constructor' && attr !== '__proto__' && attr !== 'prototype') {
23
- result[attr] = attrs[attr];
24
- }
25
- }
26
- return result;
27
- };
28
- /**
29
- * @hidden
30
- */
31
- export const getAttributes = (dom) => {
32
- const result = {};
33
- const attributes = dom.attributes;
34
- for (let i = 0; i < attributes.length; i++) {
35
- const attr = attributes[i];
36
- result[attr.name] = attr.value;
37
- }
38
- return result;
39
- };
40
- /**
41
- * @hidden
42
- */
43
- export const serializeDOMAttrs = (el) => Array.from(el.attributes)
44
- .reduce((acc, curr) => Object.assign({}, acc, { [curr.name]: curr.value }), {});
45
- /**
46
- * @hidden
47
- */
48
- export const commonAttributes = () => {
49
- return {
50
- ...createDefaultAttributes(['class', 'id', 'style'])
51
- };
52
- };
53
- /**
54
- * @hidden
55
- */
56
- export const createDefaultAttributes = (attrs = []) => {
57
- return {
58
- ...attrs.reduce((acc, curr) => ({ ...acc, [curr]: { default: null } }), {})
59
- };
60
- };
61
- /**
62
- * @hidden
63
- */
64
- export const hole = 0;
65
- /**
66
- * @hidden
67
- */
68
- export const isSchemaNode = (schemaNodeName) => (node) => node.type.name === schemaNodeName;
69
- /**
70
- * @hidden
71
- */
72
- export const isTable = isSchemaNode('table');
73
- /**
74
- * @hidden
75
- */
76
- export const isTableBody = isSchemaNode('table_body');
77
- /**
78
- * @hidden
79
- */
80
- export const isTableHead = isSchemaNode('table_head');
81
- /**
82
- * @hidden
83
- */
84
- export const isTableFoot = isSchemaNode('table_foot');
85
- /**
86
- * @hidden
87
- */
88
- export const isTableRow = isSchemaNode('table_row');
89
- /**
90
- * @hidden
91
- */
92
- export const isTableCell = isSchemaNode('table_cell');
93
- /**
94
- * @hidden
95
- */
96
- export const isTableHeaderCell = isSchemaNode('table_header');
@@ -1,140 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /* eslint-disable @typescript-eslint/no-explicit-any */
6
- import { Component, Input, ViewChild } from '@angular/core';
7
- import { DialogRef, DialogContentBase, DialogActionsComponent, DialogTitleBarComponent } from '@progress/kendo-angular-dialog';
8
- import { ButtonComponent } from '@progress/kendo-angular-buttons';
9
- import { EditorLocalizationService } from '../localization/editor-localization.service';
10
- import { EditorComponent } from '../editor.component';
11
- import { ColorPickerComponent } from '@progress/kendo-angular-inputs';
12
- import * as i0 from "@angular/core";
13
- import * as i1 from "@progress/kendo-angular-dialog";
14
- import * as i2 from "../localization/editor-localization.service";
15
- /**
16
- * @hidden
17
- */
18
- export class ColorPickerDialogComponent extends DialogContentBase {
19
- dialog;
20
- localization;
21
- editor;
22
- colorPicker;
23
- value;
24
- title;
25
- editorCommand;
26
- paletteSettings;
27
- icon;
28
- svgIcon;
29
- view;
30
- views;
31
- constructor(dialog, localization) {
32
- super(dialog);
33
- this.dialog = dialog;
34
- this.localization = localization;
35
- }
36
- handleActiveColorClick(event) {
37
- event.preventOpen();
38
- this.value = event.color;
39
- }
40
- handleClearButtonClick() {
41
- this.editor.exec(this.editorCommand);
42
- }
43
- onCancelAction() {
44
- this.dialog.close();
45
- }
46
- onConfirmAction() {
47
- if (this.value) {
48
- this.editor.exec(this.editorCommand, this.value);
49
- }
50
- this.dialog.close();
51
- this.editor.view.focus();
52
- }
53
- setData(args) {
54
- this.editor = args.editor;
55
- this.value = args.value;
56
- this.svgIcon = args.svgIcon;
57
- this.editorCommand = args.editorCommand;
58
- this.paletteSettings = args.paletteSettings;
59
- this.icon = args.icon;
60
- this.views = args.view ? [args.view] : args.views;
61
- }
62
- textFor(key) {
63
- return this.localization.get(key);
64
- }
65
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColorPickerDialogComponent, deps: [{ token: i1.DialogRef }, { token: i2.EditorLocalizationService }], target: i0.ɵɵFactoryTarget.Component });
66
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ColorPickerDialogComponent, isStandalone: true, selector: "ng-component", inputs: { editor: "editor" }, viewQueries: [{ propertyName: "colorPicker", first: true, predicate: ["colorpicker"], descendants: true, read: ColorPickerComponent, static: true }], usesInheritance: true, ngImport: i0, template: `
67
- <kendo-dialog-titlebar (close)="onCancelAction()">
68
- {{ textFor(editorCommand) }}
69
- </kendo-dialog-titlebar>
70
- <div [style.text-align]="'center'">
71
- <kendo-colorpicker
72
- #colorpicker
73
- [views]="views"
74
- [format]="'hex'"
75
- [attr.title]="title"
76
- [icon]="icon"
77
- [svgIcon]="svgIcon"
78
- [(value)]="value"
79
- [paletteSettings]="paletteSettings"
80
- (activeColorClick)="handleActiveColorClick($event)"
81
- (clearButtonClick)="handleClearButtonClick()"
82
- >
83
- </kendo-colorpicker>
84
- </div>
85
- <kendo-dialog-actions layout="start">
86
- <button
87
- kendoButton
88
- [primary]="true"
89
- (click)="onConfirmAction()"
90
- >{{ textFor('dialogApply') }}</button>
91
- <button
92
- kendoButton
93
- (click)="onCancelAction()"
94
- >{{ textFor('dialogCancel') }}</button>
95
- </kendo-dialog-actions>
96
- `, isInline: true, dependencies: [{ kind: "component", type: DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: ["id", "closeTitle"], outputs: ["close"] }, { kind: "component", type: ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "adaptiveMode", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "adaptiveTitle", "adaptiveSubtitle", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "clearButtonClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { kind: "component", type: DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
97
- }
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColorPickerDialogComponent, decorators: [{
99
- type: Component,
100
- args: [{
101
- template: `
102
- <kendo-dialog-titlebar (close)="onCancelAction()">
103
- {{ textFor(editorCommand) }}
104
- </kendo-dialog-titlebar>
105
- <div [style.text-align]="'center'">
106
- <kendo-colorpicker
107
- #colorpicker
108
- [views]="views"
109
- [format]="'hex'"
110
- [attr.title]="title"
111
- [icon]="icon"
112
- [svgIcon]="svgIcon"
113
- [(value)]="value"
114
- [paletteSettings]="paletteSettings"
115
- (activeColorClick)="handleActiveColorClick($event)"
116
- (clearButtonClick)="handleClearButtonClick()"
117
- >
118
- </kendo-colorpicker>
119
- </div>
120
- <kendo-dialog-actions layout="start">
121
- <button
122
- kendoButton
123
- [primary]="true"
124
- (click)="onConfirmAction()"
125
- >{{ textFor('dialogApply') }}</button>
126
- <button
127
- kendoButton
128
- (click)="onCancelAction()"
129
- >{{ textFor('dialogCancel') }}</button>
130
- </kendo-dialog-actions>
131
- `,
132
- standalone: true,
133
- imports: [DialogTitleBarComponent, ColorPickerComponent, DialogActionsComponent, ButtonComponent]
134
- }]
135
- }], ctorParameters: () => [{ type: i1.DialogRef }, { type: i2.EditorLocalizationService }], propDecorators: { editor: [{
136
- type: Input
137
- }], colorPicker: [{
138
- type: ViewChild,
139
- args: ['colorpicker', { read: ColorPickerComponent, static: true }]
140
- }] } });