@syncfusion/ej2-richtexteditor 19.2.57 → 19.3.43
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/.eslintrc.json +1 -1
- package/CHANGELOG.md +61 -9
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +1006 -312
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +1014 -310
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/common/types.d.ts +8 -0
- package/src/editor-manager/base/editor-manager.d.ts +1 -1
- package/src/editor-manager/base/editor-manager.js +6 -6
- package/src/editor-manager/base/interface.d.ts +7 -1
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +3 -1
- package/src/editor-manager/plugin/clearformat.js +19 -9
- package/src/editor-manager/plugin/dom-node.js +2 -2
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +87 -7
- package/src/editor-manager/plugin/image.js +77 -54
- package/src/editor-manager/plugin/inserthtml.js +20 -2
- package/src/editor-manager/plugin/isformatted.js +2 -1
- package/src/editor-manager/plugin/lists.d.ts +1 -0
- package/src/editor-manager/plugin/lists.js +87 -8
- package/src/editor-manager/plugin/nodecutter.d.ts +1 -0
- package/src/editor-manager/plugin/nodecutter.js +1 -0
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +29 -12
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.js +19 -9
- package/src/editor-manager/plugin/toolbar-status.d.ts +1 -0
- package/src/editor-manager/plugin/toolbar-status.js +20 -0
- package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -4
- package/src/rich-text-editor/actions/enter-key.d.ts +18 -0
- package/src/rich-text-editor/actions/enter-key.js +290 -0
- package/src/rich-text-editor/actions/full-screen.js +62 -42
- package/src/rich-text-editor/actions/html-editor.js +30 -20
- package/src/rich-text-editor/actions/paste-clean-up.js +5 -5
- package/src/rich-text-editor/actions/resize.js +4 -4
- package/src/rich-text-editor/base/constant.d.ts +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/interface.d.ts +15 -3
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +27 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +34 -5
- package/src/rich-text-editor/base/rich-text-editor.js +66 -57
- package/src/rich-text-editor/base/util.d.ts +7 -1
- package/src/rich-text-editor/base/util.js +45 -11
- package/src/rich-text-editor/formatter/formatter.js +9 -7
- package/src/rich-text-editor/models/items.js +3 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +6 -0
- package/src/rich-text-editor/renderer/image-module.js +70 -26
- package/src/rich-text-editor/renderer/link-module.js +4 -3
- package/src/rich-text-editor/renderer/popup-renderer.js +1 -2
- package/src/rich-text-editor/renderer/render.js +10 -2
- package/src/rich-text-editor/renderer/table-module.js +25 -15
- package/src/rich-text-editor/renderer/toolbar-renderer.js +1 -1
- package/src/rich-text-editor/renderer/view-source.js +21 -3
- package/styles/bootstrap-dark.css +25 -12
- package/styles/bootstrap.css +25 -12
- package/styles/bootstrap4.css +21 -13
- package/styles/bootstrap5-dark.css +3058 -0
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +3058 -0
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark.css +20 -12
- package/styles/fabric.css +20 -12
- package/styles/highcontrast-light.css +20 -12
- package/styles/highcontrast.css +19 -18
- package/styles/material-dark.css +22 -14
- package/styles/material.css +19 -11
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap4-definition.scss +2 -2
- package/styles/rich-text-editor/_bootstrap5-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap5-definition.scss +168 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_fabric-definition.scss +1 -1
- package/styles/rich-text-editor/_highcontrast-definition.scss +2 -2
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +64 -7
- package/styles/rich-text-editor/_tailwind-dark-definition.scss +1 -165
- package/styles/rich-text-editor/_tailwind-definition.scss +74 -72
- package/styles/rich-text-editor/_theme.scss +103 -3
- package/styles/rich-text-editor/bootstrap-dark.css +25 -12
- package/styles/rich-text-editor/bootstrap.css +25 -12
- package/styles/rich-text-editor/bootstrap4.css +21 -13
- package/styles/rich-text-editor/bootstrap5-dark.css +3058 -0
- package/styles/rich-text-editor/bootstrap5-dark.scss +4 -0
- package/styles/rich-text-editor/bootstrap5.css +3058 -0
- package/styles/rich-text-editor/bootstrap5.scss +4 -0
- package/styles/rich-text-editor/fabric-dark.css +20 -12
- package/styles/rich-text-editor/fabric.css +20 -12
- package/styles/rich-text-editor/highcontrast-light.css +20 -12
- package/styles/rich-text-editor/highcontrast.css +19 -18
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5-dark.scss +1 -0
- package/styles/rich-text-editor/icons/_bootstrap5.scss +303 -0
- package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind-dark.scss +1 -304
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +22 -14
- package/styles/rich-text-editor/material.css +19 -11
- package/styles/rich-text-editor/tailwind-dark.css +51 -20
- package/styles/rich-text-editor/tailwind.css +49 -18
- package/styles/tailwind-dark.css +51 -20
- package/styles/tailwind.css +49 -18
|
@@ -8,7 +8,7 @@ import { ClickEventArgs } from '@syncfusion/ej2-navigations';
|
|
|
8
8
|
import { BaseToolbar } from '../actions/base-toolbar';
|
|
9
9
|
import { BaseQuickToolbar } from '../actions/base-quick-toolbar';
|
|
10
10
|
import { NodeSelection } from '../../selection/selection';
|
|
11
|
-
import { EditorMode } from './../../common/types';
|
|
11
|
+
import { EditorMode, EnterKey, ShiftEnterKey } from './../../common/types';
|
|
12
12
|
import { MarkdownSelection } from './../../markdown-parser/plugin/markdown-selection';
|
|
13
13
|
import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, TableSettingsModel } from '../models/models';
|
|
14
14
|
import { QuickToolbarSettingsModel, InlineModeModel, PasteCleanupSettingsModel, FileManagerSettingsModel } from '../models/models';
|
|
@@ -32,6 +32,8 @@ import { PasteCleanup } from '../actions/paste-clean-up';
|
|
|
32
32
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
33
33
|
import { Resize } from '../actions/resize';
|
|
34
34
|
import { FileManager } from '../actions/file-manager';
|
|
35
|
+
import { NodeCutter, DOMNode } from '../../editor-manager';
|
|
36
|
+
import { EnterKeyAction } from '../actions/enter-key';
|
|
35
37
|
/**
|
|
36
38
|
* Specifies Rich Text Editor interfaces.
|
|
37
39
|
*
|
|
@@ -91,6 +93,9 @@ export interface IRichTextEditor extends Component<HTMLElement> {
|
|
|
91
93
|
fullScreenModule?: FullScreen;
|
|
92
94
|
resizeModule?: Resize;
|
|
93
95
|
refreshUI?(): void;
|
|
96
|
+
enterKeyModule?: EnterKeyAction;
|
|
97
|
+
enterKey?: EnterKey;
|
|
98
|
+
shiftEnterKey?: ShiftEnterKey;
|
|
94
99
|
pasteCleanupModule?: PasteCleanup;
|
|
95
100
|
undoRedoModule?: UndoRedoManager;
|
|
96
101
|
quickToolbarModule?: QuickToolbar;
|
|
@@ -363,8 +368,13 @@ export interface ILinkCommandsArgs {
|
|
|
363
368
|
* Provides information about a Table added to the Rich Text Editor.
|
|
364
369
|
*/
|
|
365
370
|
export interface ITableCommandsArgs {
|
|
366
|
-
/**
|
|
371
|
+
/**
|
|
372
|
+
|
|
373
|
+
* This argument deprecated. Use `rows` argument.
|
|
374
|
+
*/
|
|
367
375
|
row?: number;
|
|
376
|
+
/** Defines the number of rows to be inserted in the table */
|
|
377
|
+
rows?: number;
|
|
368
378
|
/** Defines the number of columns to be inserted in the table */
|
|
369
379
|
columns?: number;
|
|
370
380
|
/** Defines the minWidth, maxWidth and width of the table */
|
|
@@ -380,7 +390,7 @@ export interface ITableCommandsArgs {
|
|
|
380
390
|
|
|
381
391
|
*/
|
|
382
392
|
export interface ITableArgs {
|
|
383
|
-
|
|
393
|
+
rows?: number;
|
|
384
394
|
columns?: number;
|
|
385
395
|
width?: {
|
|
386
396
|
minWidth?: string | number;
|
|
@@ -417,6 +427,8 @@ export interface IEditorModel {
|
|
|
417
427
|
undoRedoManager?: UndoRedoManager | UndoRedoCommands;
|
|
418
428
|
nodeSelection?: NodeSelection;
|
|
419
429
|
mdSelectionFormats?: MDSelectionFormats;
|
|
430
|
+
domNode?: DOMNode;
|
|
431
|
+
nodeCutter?: NodeCutter;
|
|
420
432
|
}
|
|
421
433
|
/**
|
|
422
434
|
* Provides information about a ToolbarItems.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ModuleDeclaration, EventHandler, Complex, Browser, EmitType, addClass, select, detach } from '@syncfusion/ej2-base';import { Property, NotifyPropertyChanges, INotifyPropertyChanged, formatUnit, L10n, closest } from '@syncfusion/ej2-base';import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, compile, append, extend, debounce
|
|
1
|
+
import { Component, ModuleDeclaration, EventHandler, Complex, Browser, EmitType, addClass, select, detach } from '@syncfusion/ej2-base';import { Property, NotifyPropertyChanges, INotifyPropertyChanged, formatUnit, L10n, closest } from '@syncfusion/ej2-base';import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, compile, append, extend, debounce } from '@syncfusion/ej2-base';import { Touch as EJ2Touch, TapEventArgs } from '@syncfusion/ej2-base';import { getScrollableParent, BeforeOpenEventArgs, BeforeCloseEventArgs } from '@syncfusion/ej2-popups';import * as events from '../base/constant';import * as classes from '../base/classes';import { Render } from '../renderer/render';import { ViewSource } from '../renderer/view-source';import { IRenderer, IFormatter, PrintEventArgs, ActionCompleteEventArgs, ActionBeginEventArgs, ImageDropEventArgs } from './interface';import { IExecutionGroup, executeGroup, CommandName, ResizeArgs, StatusArgs, ToolbarStatusEventArgs } from './interface';import { BeforeQuickToolbarOpenArgs, ChangeEventArgs, AfterImageDeleteEventArgs, PasteCleanupArgs } from './interface';import { ILinkCommandsArgs, IImageCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';import { ServiceLocator } from '../services/service-locator';import { RendererFactory } from '../services/renderer-factory';import { RenderType, ToolbarType, DialogType } from './enum';import { EditorMode, ShiftEnterKey, EnterKey } from './../../common/types';import { Toolbar } from '../actions/toolbar';import { ExecCommandCallBack } from '../actions/execute-command-callback';import { KeyboardEvents, KeyboardEventArgs } from '../actions/keyboard';import { FontFamilyModel, FontSizeModel, FontColorModel, FormatModel, BackgroundColorModel, NumberFormatListModel, BulletFormatListModel } from '../models/models';import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, TableSettingsModel } from '../models/models';import { QuickToolbarSettingsModel, InlineModeModel, PasteCleanupSettingsModel, FileManagerSettingsModel } from '../models/models';import { ToolbarSettings, ImageSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList } from '../models/toolbar-settings';import { FileManagerSettings } from '../models/toolbar-settings';import { TableSettings, PasteCleanupSettings } from '../models/toolbar-settings';import { FontColor, BackgroundColor } from '../models/toolbar-settings';import { IFrameSettings } from '../models/iframe-settings';import { InlineMode } from '../models/inline-mode';import { Link } from '../renderer/link-module';import { Image } from '../renderer/image-module';import { Table } from '../renderer/table-module';import { Count } from '../actions/count';import { HtmlEditor } from '../actions/html-editor';import { MarkdownEditor } from '../actions/markdown-editor';import { defaultLocale } from '../models/default-locale';import { setAttributes } from '../actions/html-attributes';import { BaseToolbar } from '../actions/base-toolbar';import { QuickToolbar } from '../actions/quick-toolbar';import { FullScreen } from '../actions/full-screen';import { PasteCleanup } from '../actions/paste-clean-up';import { EnterKeyAction } from '../actions/enter-key';import * as CONSTANT from '../../common/constant';import { IHtmlKeyboardEvent } from '../../editor-manager/base/interface';import { dispatchEvent, getEditValue, isIDevice, decode, isEditableValueEmpty, getDefaultValue } from '../base/util';import { DialogRenderer } from '../renderer/dialog-renderer';import { SelectedEventArgs, RemovingEventArgs, UploadingEventArgs, BeforeUploadEventArgs } from '@syncfusion/ej2-inputs';import { Resize } from '../actions/resize';import { FileManager } from '../actions/file-manager';import { EditorManager } from '../../editor-manager';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -331,6 +331,32 @@ export interface RichTextEditorModel extends ComponentModel{
|
|
|
331
331
|
*/
|
|
332
332
|
value?: string;
|
|
333
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Specifies tag to be inserted when enter key is pressed.
|
|
336
|
+
*
|
|
337
|
+
* - `P` - When the enter key is pressed a `p` tag will be inserted and the default value of the Rich Text Editor will be <p><br></p>.
|
|
338
|
+
*
|
|
339
|
+
* - `DIV` - When the enter key is pressed a `div` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <div><br></div>.
|
|
340
|
+
*
|
|
341
|
+
* - `BR` - When the enter key is pressed a `br` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <br>.
|
|
342
|
+
*
|
|
343
|
+
* @default 'P'
|
|
344
|
+
*/
|
|
345
|
+
enterKey?: EnterKey;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Specifies tags to be inserted when shift+enter key is pressed.
|
|
349
|
+
*
|
|
350
|
+
* - `BR` - When the shift + enter key is pressed a `br` tag will be inserted which is the default behavior.
|
|
351
|
+
*
|
|
352
|
+
* - `P` - When the shift + enter key is pressed a `p` tag will be inserted instead of the default `br` tag.
|
|
353
|
+
*
|
|
354
|
+
* - `DIV` - When the shift + enter key is pressed a `div` tag will be inserted instead of the default `br` tag.
|
|
355
|
+
*
|
|
356
|
+
* @default 'BR'
|
|
357
|
+
*/
|
|
358
|
+
shiftEnterKey?: ShiftEnterKey;
|
|
359
|
+
|
|
334
360
|
/**
|
|
335
361
|
* Specifies the count of undo history which is stored in undoRedoManager.
|
|
336
362
|
*
|
|
@@ -5,12 +5,12 @@ import { RichTextEditorModel } from './rich-text-editor-model';
|
|
|
5
5
|
import { Render } from '../renderer/render';
|
|
6
6
|
import { ViewSource } from '../renderer/view-source';
|
|
7
7
|
import { IRenderer, IFormatter, ActionCompleteEventArgs, ActionBeginEventArgs, ImageDropEventArgs } from './interface';
|
|
8
|
-
import { CommandName, ResizeArgs } from './interface';
|
|
8
|
+
import { CommandName, ResizeArgs, ToolbarStatusEventArgs } from './interface';
|
|
9
9
|
import { BeforeQuickToolbarOpenArgs, ChangeEventArgs, AfterImageDeleteEventArgs, PasteCleanupArgs } from './interface';
|
|
10
10
|
import { ILinkCommandsArgs, IImageCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';
|
|
11
11
|
import { ServiceLocator } from '../services/service-locator';
|
|
12
12
|
import { DialogType } from './enum';
|
|
13
|
-
import { EditorMode } from './../../common/types';
|
|
13
|
+
import { EditorMode, ShiftEnterKey, EnterKey } from './../../common/types';
|
|
14
14
|
import { Toolbar } from '../actions/toolbar';
|
|
15
15
|
import { KeyboardEvents } from '../actions/keyboard';
|
|
16
16
|
import { FontFamilyModel, FontSizeModel, FontColorModel, FormatModel, BackgroundColorModel, NumberFormatListModel, BulletFormatListModel } from '../models/models';
|
|
@@ -26,6 +26,7 @@ import { BaseToolbar } from '../actions/base-toolbar';
|
|
|
26
26
|
import { QuickToolbar } from '../actions/quick-toolbar';
|
|
27
27
|
import { FullScreen } from '../actions/full-screen';
|
|
28
28
|
import { PasteCleanup } from '../actions/paste-clean-up';
|
|
29
|
+
import { EnterKeyAction } from '../actions/enter-key';
|
|
29
30
|
import { SelectedEventArgs, RemovingEventArgs, UploadingEventArgs, BeforeUploadEventArgs } from '@syncfusion/ej2-inputs';
|
|
30
31
|
import { Resize } from '../actions/resize';
|
|
31
32
|
import { FileManager } from '../actions/file-manager';
|
|
@@ -121,6 +122,11 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
121
122
|
/**
|
|
122
123
|
* @hidden
|
|
123
124
|
|
|
125
|
+
*/
|
|
126
|
+
enterKeyModule: EnterKeyAction;
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
|
|
124
130
|
*/
|
|
125
131
|
sourceCodeModule: ViewSource;
|
|
126
132
|
/**
|
|
@@ -458,6 +464,30 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
458
464
|
* @default null
|
|
459
465
|
*/
|
|
460
466
|
value: string;
|
|
467
|
+
/**
|
|
468
|
+
* Specifies tag to be inserted when enter key is pressed.
|
|
469
|
+
*
|
|
470
|
+
* - `P` - When the enter key is pressed a `p` tag will be inserted and the default value of the Rich Text Editor will be <p><br></p>.
|
|
471
|
+
*
|
|
472
|
+
* - `DIV` - When the enter key is pressed a `div` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <div><br></div>.
|
|
473
|
+
*
|
|
474
|
+
* - `BR` - When the enter key is pressed a `br` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <br>.
|
|
475
|
+
*
|
|
476
|
+
* @default 'P'
|
|
477
|
+
*/
|
|
478
|
+
enterKey: EnterKey;
|
|
479
|
+
/**
|
|
480
|
+
* Specifies tags to be inserted when shift+enter key is pressed.
|
|
481
|
+
*
|
|
482
|
+
* - `BR` - When the shift + enter key is pressed a `br` tag will be inserted which is the default behavior.
|
|
483
|
+
*
|
|
484
|
+
* - `P` - When the shift + enter key is pressed a `p` tag will be inserted instead of the default `br` tag.
|
|
485
|
+
*
|
|
486
|
+
* - `DIV` - When the shift + enter key is pressed a `div` tag will be inserted instead of the default `br` tag.
|
|
487
|
+
*
|
|
488
|
+
* @default 'BR'
|
|
489
|
+
*/
|
|
490
|
+
shiftEnterKey: ShiftEnterKey;
|
|
461
491
|
/**
|
|
462
492
|
* Specifies the count of undo history which is stored in undoRedoManager.
|
|
463
493
|
*
|
|
@@ -762,14 +792,14 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
762
792
|
|
|
763
793
|
* @event 'object'
|
|
764
794
|
*/
|
|
765
|
-
|
|
795
|
+
toolbarStatusUpdate: EmitType<Object>;
|
|
766
796
|
/**
|
|
767
797
|
* Triggers when the toolbar items status is updated.
|
|
768
798
|
*
|
|
769
799
|
* @event 'object'
|
|
770
800
|
* @blazorType ToolbarUpdateEventArgs
|
|
771
801
|
*/
|
|
772
|
-
|
|
802
|
+
updatedToolbarStatus: EmitType<ToolbarStatusEventArgs>;
|
|
773
803
|
/**
|
|
774
804
|
* Event triggers when the image is selected or dragged into the insert image dialog.
|
|
775
805
|
*
|
|
@@ -1253,7 +1283,6 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
1253
1283
|
private InjectSheet;
|
|
1254
1284
|
private createScriptElement;
|
|
1255
1285
|
private createStyleElement;
|
|
1256
|
-
private isBlazor;
|
|
1257
1286
|
private setValue;
|
|
1258
1287
|
private updateResizeFlag;
|
|
1259
1288
|
/**
|
|
@@ -31,7 +31,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
31
31
|
import { Component, EventHandler, Complex, Browser, addClass, select, detach } from '@syncfusion/ej2-base';
|
|
32
32
|
import { Property, NotifyPropertyChanges, formatUnit, L10n, closest } from '@syncfusion/ej2-base';
|
|
33
33
|
import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';
|
|
34
|
-
import { isNullOrUndefined as isNOU, compile, append, extend, debounce
|
|
34
|
+
import { isNullOrUndefined as isNOU, compile, append, extend, debounce } from '@syncfusion/ej2-base';
|
|
35
35
|
import { Touch as EJ2Touch } from '@syncfusion/ej2-base';
|
|
36
36
|
import { getScrollableParent } from '@syncfusion/ej2-popups';
|
|
37
37
|
import * as events from '../base/constant';
|
|
@@ -53,8 +53,9 @@ import { InlineMode } from '../models/inline-mode';
|
|
|
53
53
|
import { defaultLocale } from '../models/default-locale';
|
|
54
54
|
import { setAttributes } from '../actions/html-attributes';
|
|
55
55
|
import { FullScreen } from '../actions/full-screen';
|
|
56
|
+
import { EnterKeyAction } from '../actions/enter-key';
|
|
56
57
|
import * as CONSTANT from '../../common/constant';
|
|
57
|
-
import { dispatchEvent, getEditValue, isIDevice, decode, isEditableValueEmpty } from '../base/util';
|
|
58
|
+
import { dispatchEvent, getEditValue, isIDevice, decode, isEditableValueEmpty, getDefaultValue } from '../base/util';
|
|
58
59
|
import { DialogRenderer } from '../renderer/dialog-renderer';
|
|
59
60
|
/**
|
|
60
61
|
* Represents the Rich Text Editor component.
|
|
@@ -207,9 +208,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
207
208
|
this.htmlAttributes = { 'tabindex': this.element.getAttribute('tabindex') };
|
|
208
209
|
this.element.removeAttribute('tabindex');
|
|
209
210
|
}
|
|
210
|
-
|
|
211
|
-
this.element.innerHTML = '';
|
|
212
|
-
}
|
|
211
|
+
this.element.innerHTML = '';
|
|
213
212
|
var invalidAttr = ['class', 'style', 'id', 'ejs-for'];
|
|
214
213
|
var htmlAttr = {};
|
|
215
214
|
for (var a = 0; a < this.element.attributes.length; a++) {
|
|
@@ -227,23 +226,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
227
226
|
var rteOuterWrapper = this.createElement('div', {
|
|
228
227
|
className: this.element.getAttribute('class')
|
|
229
228
|
});
|
|
230
|
-
|
|
231
|
-
this.element.innerHTML = '';
|
|
232
|
-
}
|
|
229
|
+
this.element.innerHTML = '';
|
|
233
230
|
this.element.parentElement.insertBefore(rteOuterWrapper, this.element);
|
|
234
|
-
|
|
235
|
-
rteOuterWrapper.appendChild(this.element);
|
|
236
|
-
this.valueContainer = this.createElement('textarea', {
|
|
237
|
-
id: this.element.id + '-value'
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
this.valueContainer = this.element;
|
|
242
|
-
}
|
|
231
|
+
this.valueContainer = this.element;
|
|
243
232
|
removeClass([this.valueContainer], this.element.getAttribute('class').split(' '));
|
|
244
|
-
if (this.isBlazor()) {
|
|
245
|
-
addClass([this.element], classes.CLS_RTE_HIDDEN);
|
|
246
|
-
}
|
|
247
233
|
this.element = rteOuterWrapper;
|
|
248
234
|
}
|
|
249
235
|
else {
|
|
@@ -460,12 +446,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
460
446
|
}
|
|
461
447
|
this.setContentHeight();
|
|
462
448
|
if (this.value !== null) {
|
|
463
|
-
|
|
464
|
-
this.valueContainer.defaultValue = this.value;
|
|
465
|
-
}
|
|
466
|
-
else {
|
|
467
|
-
this.defaultResetValue = this.value;
|
|
468
|
-
}
|
|
449
|
+
this.valueContainer.defaultValue = this.value;
|
|
469
450
|
}
|
|
470
451
|
// eslint-disable-next-line
|
|
471
452
|
(!this.enabled) ? this.unWireEvents() : this.eventInitializer();
|
|
@@ -568,7 +549,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
568
549
|
this.notify(events.keyUp, { member: 'keyup', args: e });
|
|
569
550
|
if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
|
|
570
551
|
this.inputElement.innerHTML === '<br>')) {
|
|
571
|
-
this.inputElement.innerHTML = getEditValue(
|
|
552
|
+
this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
|
|
572
553
|
}
|
|
573
554
|
var allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
|
|
574
555
|
if (((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
|
|
@@ -580,7 +561,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
580
561
|
this.notify(events.toolbarRefresh, { args: e });
|
|
581
562
|
}
|
|
582
563
|
if (!isNOU(this.placeholder)) {
|
|
583
|
-
this.
|
|
564
|
+
if (!(e.key === 'Enter' && e.keyCode === 13) && (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
565
|
+
this.inputElement.innerHTML === '<br>')) {
|
|
566
|
+
this.setPlaceHolder();
|
|
567
|
+
}
|
|
584
568
|
}
|
|
585
569
|
};
|
|
586
570
|
/**
|
|
@@ -809,22 +793,16 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
809
793
|
}
|
|
810
794
|
this.unWireEvents();
|
|
811
795
|
if (this.originalElement.tagName === 'TEXTAREA') {
|
|
812
|
-
if (isBlazor()) {
|
|
813
|
-
detach(this.valueContainer);
|
|
814
|
-
this.valueContainer = this.element.querySelector('.e-blazor-hidden.e-control.e-richtexteditor');
|
|
815
|
-
}
|
|
816
796
|
this.element.parentElement.insertBefore(this.valueContainer, this.element);
|
|
817
797
|
this.valueContainer.id = this.getID();
|
|
818
798
|
this.valueContainer.removeAttribute('name');
|
|
819
799
|
detach(this.element);
|
|
820
800
|
if (this.originalElement.innerHTML.trim() !== '') {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
this.setProperties({ value: (!isNOU(this.initialValue) ? this.initialValue : null) }, true);
|
|
824
|
-
}
|
|
801
|
+
this.valueContainer.value = this.originalElement.innerHTML.trim();
|
|
802
|
+
this.setProperties({ value: (!isNOU(this.initialValue) ? this.initialValue : null) }, true);
|
|
825
803
|
}
|
|
826
804
|
else {
|
|
827
|
-
this.valueContainer.value =
|
|
805
|
+
this.valueContainer.value = this.valueContainer.defaultValue;
|
|
828
806
|
}
|
|
829
807
|
this.element = this.valueContainer;
|
|
830
808
|
for (var i = 0; i < this.originalElement.classList.length; i++) {
|
|
@@ -900,12 +878,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
900
878
|
* @returns {Element} - specifies the element.
|
|
901
879
|
*/
|
|
902
880
|
RichTextEditor.prototype.getContent = function () {
|
|
903
|
-
|
|
904
|
-
return this.inputElement;
|
|
905
|
-
}
|
|
906
|
-
else {
|
|
907
|
-
return this.contentModule.getPanel();
|
|
908
|
-
}
|
|
881
|
+
return this.contentModule.getPanel();
|
|
909
882
|
};
|
|
910
883
|
/**
|
|
911
884
|
* Returns the text content as string.
|
|
@@ -977,10 +950,23 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
977
950
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
978
951
|
var prop = _a[_i];
|
|
979
952
|
switch (prop) {
|
|
953
|
+
case 'enterKey':
|
|
980
954
|
case 'value': {
|
|
981
|
-
var nVal =
|
|
955
|
+
var nVal = void 0;
|
|
956
|
+
if (prop === 'enterKey') {
|
|
957
|
+
if (this.value === null || this.value === '<div><br></div>' || this.value === '<p><br></p>' ||
|
|
958
|
+
this.value === '<br>') {
|
|
959
|
+
nVal = null;
|
|
960
|
+
}
|
|
961
|
+
else {
|
|
962
|
+
nVal = this.value;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
else {
|
|
966
|
+
nVal = newProp[prop];
|
|
967
|
+
}
|
|
982
968
|
var val = this.editorMode === 'HTML' ? getEditValue(nVal, this) : nVal;
|
|
983
|
-
if (!isNOU(nVal) && nVal !== '') {
|
|
969
|
+
if ((!isNOU(nVal) && nVal !== '') || prop === 'enterKey') {
|
|
984
970
|
this.value = this.serializeValue(((this.enableHtmlEncode) ? this.encode(decode(val)) : val));
|
|
985
971
|
}
|
|
986
972
|
this.updatePanelValue();
|
|
@@ -1146,7 +1132,18 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1146
1132
|
getTextArea.value = '';
|
|
1147
1133
|
}
|
|
1148
1134
|
if (this.editorMode === 'HTML') {
|
|
1149
|
-
this.
|
|
1135
|
+
if (this.enterKey === 'DIV') {
|
|
1136
|
+
this.inputElement.innerHTML = '<div><br/></div>';
|
|
1137
|
+
}
|
|
1138
|
+
else if (this.enterKey === 'BR') {
|
|
1139
|
+
this.inputElement.innerHTML = '<br/>';
|
|
1140
|
+
}
|
|
1141
|
+
else {
|
|
1142
|
+
this.inputElement.innerHTML = '<p><br/></p>';
|
|
1143
|
+
if (value === '' && this.formatter && this.inputElement) {
|
|
1144
|
+
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1150
1147
|
}
|
|
1151
1148
|
else {
|
|
1152
1149
|
this.inputElement.value = '';
|
|
@@ -1194,10 +1191,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1194
1191
|
});
|
|
1195
1192
|
}
|
|
1196
1193
|
this.placeHolderWrapper.innerHTML = this.placeholder;
|
|
1197
|
-
if (this.inputElement.textContent.length === 0 &&
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
this.inputElement.innerHTML !== '<p><br></p><p><br></p>') {
|
|
1194
|
+
if (this.inputElement.textContent.length === 0 && !isNOU(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
1195
|
+
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNOU(this.inputElement.firstChild.firstChild) &&
|
|
1196
|
+
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
1201
1197
|
this.placeHolderWrapper.style.display = 'block';
|
|
1202
1198
|
}
|
|
1203
1199
|
else {
|
|
@@ -1359,6 +1355,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1359
1355
|
var rendererFactory = this.serviceLocator.getService('rendererFactory');
|
|
1360
1356
|
this.contentModule = rendererFactory.getRenderer(RenderType.Content);
|
|
1361
1357
|
this.fullScreenModule = new FullScreen(this);
|
|
1358
|
+
this.enterKeyModule = new EnterKeyAction(this);
|
|
1362
1359
|
this.renderModule.render();
|
|
1363
1360
|
this.inputElement = this.contentModule.getEditPanel();
|
|
1364
1361
|
this.setHeight(this.height);
|
|
@@ -1428,9 +1425,6 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1428
1425
|
styleEle.rel = 'stylesheet';
|
|
1429
1426
|
return styleEle;
|
|
1430
1427
|
};
|
|
1431
|
-
RichTextEditor.prototype.isBlazor = function () {
|
|
1432
|
-
return (!isBlazor() ? false : true);
|
|
1433
|
-
};
|
|
1434
1428
|
RichTextEditor.prototype.setValue = function () {
|
|
1435
1429
|
if (this.valueTemplate) {
|
|
1436
1430
|
if (typeof this.valueTemplate === 'string') {
|
|
@@ -1522,7 +1516,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1522
1516
|
}
|
|
1523
1517
|
}
|
|
1524
1518
|
if (target !== 'windowResize') {
|
|
1525
|
-
|
|
1519
|
+
if (this.iframeSettings.enable) {
|
|
1520
|
+
if (heightValue !== 'auto') {
|
|
1521
|
+
setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
else {
|
|
1525
|
+
setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
|
|
1526
|
+
}
|
|
1526
1527
|
}
|
|
1527
1528
|
if (this.iframeSettings.enable && target === 'sourceCode') {
|
|
1528
1529
|
var codeElement = select('.' + classes.CLS_RTE_CONTENT, this.element);
|
|
@@ -1730,7 +1731,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1730
1731
|
this.isFocusOut = false;
|
|
1731
1732
|
addClass([this.element], [classes.CLS_FOCUS]);
|
|
1732
1733
|
if (this.editorMode === 'HTML') {
|
|
1733
|
-
this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>'
|
|
1734
|
+
this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
1735
|
+
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
1734
1736
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
1735
1737
|
}
|
|
1736
1738
|
else {
|
|
@@ -1779,7 +1781,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1779
1781
|
}
|
|
1780
1782
|
var getTextArea = this.element.querySelector('.e-rte-srctextarea');
|
|
1781
1783
|
if (this.editorMode === 'HTML') {
|
|
1782
|
-
value = (this.inputElement.innerHTML === '<p><br></p>'
|
|
1784
|
+
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
1785
|
+
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
1783
1786
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
1784
1787
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
1785
1788
|
value = getTextArea.value;
|
|
@@ -1963,7 +1966,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1963
1966
|
};
|
|
1964
1967
|
RichTextEditor.prototype.resetHandler = function () {
|
|
1965
1968
|
var defaultValue = this.valueContainer.defaultValue.trim();
|
|
1966
|
-
this.setProperties({ value: defaultValue === '' ? null :
|
|
1969
|
+
this.setProperties({ value: defaultValue === '' ? null : defaultValue });
|
|
1967
1970
|
};
|
|
1968
1971
|
/**
|
|
1969
1972
|
* @returns {void}
|
|
@@ -2179,6 +2182,12 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2179
2182
|
__decorate([
|
|
2180
2183
|
Property(null)
|
|
2181
2184
|
], RichTextEditor.prototype, "value", void 0);
|
|
2185
|
+
__decorate([
|
|
2186
|
+
Property('P')
|
|
2187
|
+
], RichTextEditor.prototype, "enterKey", void 0);
|
|
2188
|
+
__decorate([
|
|
2189
|
+
Property('BR')
|
|
2190
|
+
], RichTextEditor.prototype, "shiftEnterKey", void 0);
|
|
2182
2191
|
__decorate([
|
|
2183
2192
|
Property(30)
|
|
2184
2193
|
], RichTextEditor.prototype, "undoRedoSteps", void 0);
|
|
@@ -128,7 +128,13 @@ export declare function getEditValue(value: string, rteObj: IRichTextEditor): st
|
|
|
128
128
|
* @returns {string} - returns the string
|
|
129
129
|
* @hidden
|
|
130
130
|
*/
|
|
131
|
-
export declare function updateTextNode(value: string): string;
|
|
131
|
+
export declare function updateTextNode(value: string, rteObj?: IRichTextEditor): string;
|
|
132
|
+
/**
|
|
133
|
+
* @param {IRichTextEditor} rteObj - specifies the rte object
|
|
134
|
+
* @returns {string} - returns the value based on enter configuration.
|
|
135
|
+
* @hidden
|
|
136
|
+
*/
|
|
137
|
+
export declare function getDefaultValue(rteObj: IRichTextEditor): string;
|
|
132
138
|
/**
|
|
133
139
|
* @param {string} value - specifies the value
|
|
134
140
|
* @returns {boolean} - returns the boolean value
|
|
@@ -380,11 +380,19 @@ export function toObjectLowerCase(obj) {
|
|
|
380
380
|
export function getEditValue(value, rteObj) {
|
|
381
381
|
var val;
|
|
382
382
|
if (value !== null && value !== '') {
|
|
383
|
-
val = rteObj.enableHtmlEncode ? updateTextNode(decode(value)) : updateTextNode(value);
|
|
383
|
+
val = rteObj.enableHtmlEncode ? updateTextNode(decode(value), rteObj) : updateTextNode(value, rteObj);
|
|
384
384
|
rteObj.setProperties({ value: val }, true);
|
|
385
385
|
}
|
|
386
386
|
else {
|
|
387
|
-
|
|
387
|
+
if (rteObj.enterKey === 'DIV') {
|
|
388
|
+
val = rteObj.enableHtmlEncode ? '<div><br/></div>' : '<div><br/></div>';
|
|
389
|
+
}
|
|
390
|
+
else if (rteObj.enterKey === 'BR') {
|
|
391
|
+
val = rteObj.enableHtmlEncode ? '<br/>' : '<br/>';
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
val = rteObj.enableHtmlEncode ? '<p><br/></p>' : '<p><br/></p>';
|
|
395
|
+
}
|
|
388
396
|
}
|
|
389
397
|
return val;
|
|
390
398
|
}
|
|
@@ -393,7 +401,7 @@ export function getEditValue(value, rteObj) {
|
|
|
393
401
|
* @returns {string} - returns the string
|
|
394
402
|
* @hidden
|
|
395
403
|
*/
|
|
396
|
-
export function updateTextNode(value) {
|
|
404
|
+
export function updateTextNode(value, rteObj) {
|
|
397
405
|
var tempNode = document.createElement('div');
|
|
398
406
|
var resultElm = document.createElement('div');
|
|
399
407
|
var childNodes = tempNode.childNodes;
|
|
@@ -402,20 +410,25 @@ export function updateTextNode(value) {
|
|
|
402
410
|
if (childNodes.length > 0) {
|
|
403
411
|
var isPreviousInlineElem = void 0;
|
|
404
412
|
var previousParent = void 0;
|
|
405
|
-
var
|
|
413
|
+
var insertElem = void 0;
|
|
406
414
|
while (tempNode.firstChild) {
|
|
407
|
-
if ((tempNode.firstChild.nodeName === '#text' &&
|
|
415
|
+
if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
|
|
408
416
|
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
409
|
-
inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
|
|
417
|
+
inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
410
418
|
if (!isPreviousInlineElem) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
419
|
+
if (rteObj.enterKey === 'DIV') {
|
|
420
|
+
insertElem = createElement('div');
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
insertElem = createElement('p');
|
|
424
|
+
}
|
|
425
|
+
resultElm.appendChild(insertElem);
|
|
426
|
+
insertElem.appendChild(tempNode.firstChild);
|
|
414
427
|
}
|
|
415
428
|
else {
|
|
416
429
|
previousParent.appendChild(tempNode.firstChild);
|
|
417
430
|
}
|
|
418
|
-
previousParent =
|
|
431
|
+
previousParent = insertElem;
|
|
419
432
|
isPreviousInlineElem = true;
|
|
420
433
|
}
|
|
421
434
|
else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
|
|
@@ -440,13 +453,34 @@ export function updateTextNode(value) {
|
|
|
440
453
|
}
|
|
441
454
|
return resultElm.innerHTML;
|
|
442
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* @param {IRichTextEditor} rteObj - specifies the rte object
|
|
458
|
+
* @returns {string} - returns the value based on enter configuration.
|
|
459
|
+
* @hidden
|
|
460
|
+
*/
|
|
461
|
+
export function getDefaultValue(rteObj) {
|
|
462
|
+
var currentVal;
|
|
463
|
+
if (rteObj.enterKey === 'DIV') {
|
|
464
|
+
currentVal = rteObj.enableHtmlEncode ? '<div><br/></div>' : '<div><br/></div>';
|
|
465
|
+
}
|
|
466
|
+
else if (rteObj.enterKey === 'BR') {
|
|
467
|
+
currentVal = rteObj.enableHtmlEncode ? '<br/>' : '<br/>';
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
currentVal = rteObj.enableHtmlEncode ? '<p><br/></p>' : '<p><br/></p>';
|
|
471
|
+
}
|
|
472
|
+
return currentVal;
|
|
473
|
+
}
|
|
443
474
|
/**
|
|
444
475
|
* @param {string} value - specifies the value
|
|
445
476
|
* @returns {boolean} - returns the boolean value
|
|
446
477
|
* @hidden
|
|
447
478
|
*/
|
|
448
479
|
export function isEditableValueEmpty(value) {
|
|
449
|
-
return (value === '<p><br></p>' || value === '<p><br></p>'
|
|
480
|
+
return (value === '<p><br></p>' || value === '<p><br></p>'
|
|
481
|
+
|| value === '<div><br></div>' || value === '<div><br></div>'
|
|
482
|
+
|| value === '<br>' || value === '<br>'
|
|
483
|
+
|| value === '') ? true : false;
|
|
450
484
|
}
|
|
451
485
|
/**
|
|
452
486
|
* @param {string} value - specifies the string value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extend, isNullOrUndefined, Browser
|
|
1
|
+
import { extend, isNullOrUndefined, Browser } from '@syncfusion/ej2-base';
|
|
2
2
|
import * as CONSTANT from '../base/constant';
|
|
3
3
|
import { updateUndoRedoStatus, isIDevice } from '../base/util';
|
|
4
4
|
import { KEY_DOWN, KEY_UP } from './../../common/constant';
|
|
@@ -59,10 +59,6 @@ var Formatter = /** @class */ (function () {
|
|
|
59
59
|
itemCollection: value
|
|
60
60
|
};
|
|
61
61
|
extend(args, args, items, true);
|
|
62
|
-
if (isBlazor()) {
|
|
63
|
-
delete args.item;
|
|
64
|
-
delete args.itemCollection;
|
|
65
|
-
}
|
|
66
62
|
self.trigger(CONSTANT.actionBegin, args, function (actionBeginArgs) {
|
|
67
63
|
if (actionBeginArgs.cancel) {
|
|
68
64
|
if (action_1 === 'paste' || action_1 === 'cut' || action_1 === 'copy') {
|
|
@@ -74,10 +70,16 @@ var Formatter = /** @class */ (function () {
|
|
|
74
70
|
var isTableModule = isNullOrUndefined(self.tableModule) ? true : self.tableModule ?
|
|
75
71
|
self.tableModule.ensureInsideTableList : false;
|
|
76
72
|
if ((event.which === 9 && isTableModule) || event.which !== 9) {
|
|
73
|
+
if (event.which === 13 && self.editorMode === 'HTML') {
|
|
74
|
+
value = {
|
|
75
|
+
'enterAction': self.enterKey
|
|
76
|
+
};
|
|
77
|
+
}
|
|
77
78
|
this.editorManager.observer.notify((event.type === 'keydown' ? KEY_DOWN : KEY_UP), {
|
|
78
79
|
event: event,
|
|
79
80
|
callBack: this.onSuccess.bind(this, self),
|
|
80
|
-
value: value
|
|
81
|
+
value: value,
|
|
82
|
+
enterAction: self.enterKey
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -105,7 +107,7 @@ var Formatter = /** @class */ (function () {
|
|
|
105
107
|
else {
|
|
106
108
|
_this.editorManager.observer.notify(CONSTANT.checkUndo, { subCommand: actionBeginArgs.item.subCommand });
|
|
107
109
|
_this.editorManager.execCommand(actionBeginArgs.item.command, actionBeginArgs.item.subCommand, event, _this.onSuccess.bind(_this, self), actionBeginArgs.item.value, actionBeginArgs.item.subCommand === 'Pre' && args.name === 'dropDownSelect' ?
|
|
108
|
-
{ name: args.name } : value, ('#' + self.getID() + ' iframe'));
|
|
110
|
+
{ name: args.name } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
});
|