aurelia-syncfusion-ej2-bridge 1.0.21 → 1.0.22-beta1

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.
@@ -6,7 +6,16 @@ class SyncfusionWrapper extends controlBase_1.ControlBase {
6
6
  onCreateControl() {
7
7
  this.onBeforeWidgetInstantiation();
8
8
  this.widget = new this.syncfusionWidgetType(this._eModel);
9
- this.widget.created = () => { this.onWidgetCreated(); };
9
+ let _modelCreated = null;
10
+ if (this._eModel["created"]) {
11
+ _modelCreated = this._eModel["created"];
12
+ }
13
+ this.widget.created = () => {
14
+ if (_modelCreated) {
15
+ _modelCreated();
16
+ }
17
+ this.onWidgetCreated();
18
+ };
10
19
  this.onWrapperCreated();
11
20
  this.createControlEvents(this.getBindables());
12
21
  }
@@ -1,8 +1,10 @@
1
1
  import { SyncfusionWrapper } from '../../common/syncfusionWrapper';
2
2
  import { RichTextEditor, RichTextEditorModel } from '@syncfusion/ej2-richtexteditor';
3
3
  export declare class Ej2RichTextEditor extends SyncfusionWrapper<RichTextEditor, RichTextEditorModel> {
4
+ private defaultToolbarItems;
4
5
  protected syncfusionWidgetType: any;
5
6
  protected onWrapperCreated(): void;
6
7
  protected onWidgetCreated(): void;
7
8
  onBeforeWidgetInstantiation(): void;
9
+ onChange(): void;
8
10
  }
@@ -10,18 +10,87 @@ exports.Ej2RichTextEditor = void 0;
10
10
  const aurelia_framework_1 = require("aurelia-framework");
11
11
  const decorator_1 = require("../../utilities/decorator");
12
12
  const syncfusionWrapper_1 = require("../../common/syncfusionWrapper");
13
+ const constants_1 = require("../../common/constants");
13
14
  const ej2_richtexteditor_1 = require("@syncfusion/ej2-richtexteditor");
14
15
  let Ej2RichTextEditor = class Ej2RichTextEditor extends syncfusionWrapper_1.SyncfusionWrapper {
15
16
  constructor() {
16
17
  super(...arguments);
18
+ this.defaultToolbarItems = [
19
+ 'Undo',
20
+ 'Redo',
21
+ '|',
22
+ 'Bold',
23
+ 'Italic',
24
+ 'Underline',
25
+ 'StrikeThrough',
26
+ 'InlineCode',
27
+ 'SuperScript',
28
+ 'SubScript',
29
+ '|',
30
+ 'FontName',
31
+ 'FontSize',
32
+ 'FontColor',
33
+ 'BackgroundColor',
34
+ '|',
35
+ 'LowerCase',
36
+ 'UpperCase',
37
+ '|',
38
+ 'Formats',
39
+ 'Alignments',
40
+ 'Blockquote',
41
+ '|',
42
+ 'NumberFormatList',
43
+ 'BulletFormatList',
44
+ '|',
45
+ 'Outdent',
46
+ 'Indent',
47
+ '|',
48
+ 'CreateLink',
49
+ 'CreateTable',
50
+ '|',
51
+ 'FormatPainter',
52
+ 'ClearFormat',
53
+ '|', 'EmojiPicker', 'Print', '|',
54
+ 'SourceCode', 'FullScreen'
55
+ ];
17
56
  this.syncfusionWidgetType = ej2_richtexteditor_1.RichTextEditor;
18
57
  }
19
58
  onWrapperCreated() {
20
59
  }
21
60
  onWidgetCreated() {
61
+ this.widget.change = () => { this.onChange(); };
22
62
  }
23
63
  onBeforeWidgetInstantiation() {
24
- ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.Toolbar, ej2_richtexteditor_1.Link, ej2_richtexteditor_1.Image, ej2_richtexteditor_1.Count, ej2_richtexteditor_1.HtmlEditor, ej2_richtexteditor_1.QuickToolbar, ej2_richtexteditor_1.Table, ej2_richtexteditor_1.FileManager, ej2_richtexteditor_1.EmojiPicker, ej2_richtexteditor_1.Audio, ej2_richtexteditor_1.Video, ej2_richtexteditor_1.FormatPainter, ej2_richtexteditor_1.PasteCleanup, ej2_richtexteditor_1.SlashMenu, ej2_richtexteditor_1.ImportExport);
64
+ var _a, _b, _c, _d;
65
+ if (!this['e-toolbarSettings'] && !((_a = this._eModel.toolbarSettings) === null || _a === void 0 ? void 0 : _a.items)) {
66
+ this._eModel.toolbarSettings = {
67
+ items: this.defaultToolbarItems
68
+ };
69
+ }
70
+ if ((_b = this._eModel.toolbarSettings) === null || _b === void 0 ? void 0 : _b.items) {
71
+ if (this._eModel.toolbarSettings.items.includes("Image")) {
72
+ ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.Image);
73
+ }
74
+ if (this._eModel.toolbarSettings.items.includes("Audio")) {
75
+ ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.Audio);
76
+ }
77
+ if (this._eModel.toolbarSettings.items.includes("Video")) {
78
+ ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.Video);
79
+ }
80
+ if (this._eModel.toolbarSettings.items.includes("FileManager") && ((_c = this._eModel.fileManagerSettings) === null || _c === void 0 ? void 0 : _c.enable)) {
81
+ ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.FileManager);
82
+ }
83
+ if (this._eModel.toolbarSettings.items.includes("EmojiPicker")) {
84
+ ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.EmojiPicker);
85
+ }
86
+ }
87
+ if (!this['e-slashMenuSettings'] && !((_d = this._eModel.slashMenuSettings) === null || _d === void 0 ? void 0 : _d.enable)) {
88
+ ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.SlashMenu);
89
+ }
90
+ ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.Toolbar, ej2_richtexteditor_1.Link, ej2_richtexteditor_1.Count, ej2_richtexteditor_1.HtmlEditor, ej2_richtexteditor_1.QuickToolbar, ej2_richtexteditor_1.Table, ej2_richtexteditor_1.FormatPainter, ej2_richtexteditor_1.PasteCleanup, ej2_richtexteditor_1.ImportExport);
91
+ }
92
+ onChange() {
93
+ this[`${constants_1.constants.bindablePrefix}value`] = this.widget.value;
25
94
  }
26
95
  };
27
96
  exports.Ej2RichTextEditor = Ej2RichTextEditor;
@@ -3,7 +3,16 @@ export class SyncfusionWrapper extends ControlBase {
3
3
  onCreateControl() {
4
4
  this.onBeforeWidgetInstantiation();
5
5
  this.widget = new this.syncfusionWidgetType(this._eModel);
6
- this.widget.created = () => { this.onWidgetCreated(); };
6
+ let _modelCreated = null;
7
+ if (this._eModel["created"]) {
8
+ _modelCreated = this._eModel["created"];
9
+ }
10
+ this.widget.created = () => {
11
+ if (_modelCreated) {
12
+ _modelCreated();
13
+ }
14
+ this.onWidgetCreated();
15
+ };
7
16
  this.onWrapperCreated();
8
17
  this.createControlEvents(this.getBindables());
9
18
  }
@@ -1,8 +1,10 @@
1
1
  import { SyncfusionWrapper } from '../../common/syncfusionWrapper';
2
2
  import { RichTextEditor, RichTextEditorModel } from '@syncfusion/ej2-richtexteditor';
3
3
  export declare class Ej2RichTextEditor extends SyncfusionWrapper<RichTextEditor, RichTextEditorModel> {
4
+ private defaultToolbarItems;
4
5
  protected syncfusionWidgetType: any;
5
6
  protected onWrapperCreated(): void;
6
7
  protected onWidgetCreated(): void;
7
8
  onBeforeWidgetInstantiation(): void;
9
+ onChange(): void;
8
10
  }
@@ -7,18 +7,87 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { inlineView, customElement } from 'aurelia-framework';
8
8
  import { generateBindables } from '../../utilities/decorator';
9
9
  import { SyncfusionWrapper } from '../../common/syncfusionWrapper';
10
+ import { constants } from '../../common/constants';
10
11
  import { RichTextEditor, Count, FileManager, EmojiPicker, FormatPainter, Toolbar, SlashMenu, ImportExport, Link, Image, HtmlEditor, QuickToolbar, Table, Video, Audio, PasteCleanup } from '@syncfusion/ej2-richtexteditor';
11
12
  let Ej2RichTextEditor = class Ej2RichTextEditor extends SyncfusionWrapper {
12
13
  constructor() {
13
14
  super(...arguments);
15
+ this.defaultToolbarItems = [
16
+ 'Undo',
17
+ 'Redo',
18
+ '|',
19
+ 'Bold',
20
+ 'Italic',
21
+ 'Underline',
22
+ 'StrikeThrough',
23
+ 'InlineCode',
24
+ 'SuperScript',
25
+ 'SubScript',
26
+ '|',
27
+ 'FontName',
28
+ 'FontSize',
29
+ 'FontColor',
30
+ 'BackgroundColor',
31
+ '|',
32
+ 'LowerCase',
33
+ 'UpperCase',
34
+ '|',
35
+ 'Formats',
36
+ 'Alignments',
37
+ 'Blockquote',
38
+ '|',
39
+ 'NumberFormatList',
40
+ 'BulletFormatList',
41
+ '|',
42
+ 'Outdent',
43
+ 'Indent',
44
+ '|',
45
+ 'CreateLink',
46
+ 'CreateTable',
47
+ '|',
48
+ 'FormatPainter',
49
+ 'ClearFormat',
50
+ '|', 'EmojiPicker', 'Print', '|',
51
+ 'SourceCode', 'FullScreen'
52
+ ];
14
53
  this.syncfusionWidgetType = RichTextEditor;
15
54
  }
16
55
  onWrapperCreated() {
17
56
  }
18
57
  onWidgetCreated() {
58
+ this.widget.change = () => { this.onChange(); };
19
59
  }
20
60
  onBeforeWidgetInstantiation() {
21
- RichTextEditor.Inject(Toolbar, Link, Image, Count, HtmlEditor, QuickToolbar, Table, FileManager, EmojiPicker, Audio, Video, FormatPainter, PasteCleanup, SlashMenu, ImportExport);
61
+ var _a, _b, _c, _d;
62
+ if (!this['e-toolbarSettings'] && !((_a = this._eModel.toolbarSettings) === null || _a === void 0 ? void 0 : _a.items)) {
63
+ this._eModel.toolbarSettings = {
64
+ items: this.defaultToolbarItems
65
+ };
66
+ }
67
+ if ((_b = this._eModel.toolbarSettings) === null || _b === void 0 ? void 0 : _b.items) {
68
+ if (this._eModel.toolbarSettings.items.includes("Image")) {
69
+ RichTextEditor.Inject(Image);
70
+ }
71
+ if (this._eModel.toolbarSettings.items.includes("Audio")) {
72
+ RichTextEditor.Inject(Audio);
73
+ }
74
+ if (this._eModel.toolbarSettings.items.includes("Video")) {
75
+ RichTextEditor.Inject(Video);
76
+ }
77
+ if (this._eModel.toolbarSettings.items.includes("FileManager") && ((_c = this._eModel.fileManagerSettings) === null || _c === void 0 ? void 0 : _c.enable)) {
78
+ RichTextEditor.Inject(FileManager);
79
+ }
80
+ if (this._eModel.toolbarSettings.items.includes("EmojiPicker")) {
81
+ RichTextEditor.Inject(EmojiPicker);
82
+ }
83
+ }
84
+ if (!this['e-slashMenuSettings'] && !((_d = this._eModel.slashMenuSettings) === null || _d === void 0 ? void 0 : _d.enable)) {
85
+ RichTextEditor.Inject(SlashMenu);
86
+ }
87
+ RichTextEditor.Inject(Toolbar, Link, Count, HtmlEditor, QuickToolbar, Table, FormatPainter, PasteCleanup, ImportExport);
88
+ }
89
+ onChange() {
90
+ this[`${constants.bindablePrefix}value`] = this.widget.value;
22
91
  }
23
92
  };
24
93
  Ej2RichTextEditor = __decorate([
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aurelia-syncfusion-ej2-bridge",
3
3
  "description": "An Aurelia plugin wrapper for syncfusion EJ2 controls",
4
- "version": "1.0.21",
4
+ "version": "1.0.22-beta1",
5
5
  "keywords": [
6
6
  "aurelia",
7
7
  "syncfusion"
@@ -15,14 +15,14 @@
15
15
  "yarn": "^1.22.22"
16
16
  },
17
17
  "peerDependencies": {
18
- "@syncfusion/ej2": "^30.1.37"
18
+ "@syncfusion/ej2": "^29.2.10"
19
19
  },
20
20
  "scripts": {
21
21
  "start": "au run",
22
22
  "build": "au build-plugin"
23
23
  },
24
24
  "devDependencies": {
25
- "@syncfusion/ej2": "^30.1.37",
25
+ "@syncfusion/ej2": "^29.2.10",
26
26
  "@types/jest": "^24.0.9",
27
27
  "@types/node": "^20.12.7",
28
28
  "aurelia-animator-css": "^1.0.4",