@dignite-ng/expand.ck-editor 3.0.0-rc.1 → 3.0.0-rc.19

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 (51) hide show
  1. package/README.md +117 -13
  2. package/esm2022/config/ck-editor-config.module.mjs +1 -1
  3. package/esm2022/config/dignite-ng-expand.ck-editor-config.mjs +1 -1
  4. package/esm2022/config/enums/index.mjs +1 -1
  5. package/esm2022/config/enums/route-names.mjs +1 -1
  6. package/esm2022/config/providers/index.mjs +1 -1
  7. package/esm2022/config/providers/route.provider.mjs +1 -1
  8. package/esm2022/config/public-api.mjs +1 -1
  9. package/esm2022/dignite-ng-expand.ck-editor.mjs +1 -1
  10. package/esm2022/lib/adapter/ckEditorUpload.mjs +1 -1
  11. package/esm2022/lib/adapter/index.mjs +1 -1
  12. package/esm2022/lib/ck-editor-routing.module.mjs +2 -6
  13. package/esm2022/lib/ck-editor.module.mjs +5 -13
  14. package/esm2022/lib/dynamic-form/ck-editor/ck-editor-config.component.mjs +15 -9
  15. package/esm2022/lib/dynamic-form/ck-editor/ck-editor-config.mjs +3 -1
  16. package/esm2022/lib/dynamic-form/ck-editor/ck-editor-control.component.mjs +46 -24
  17. package/esm2022/lib/dynamic-form/ck-editor/ck-editor-view.component.mjs +39 -0
  18. package/esm2022/lib/dynamic-form/ck-editor/ckEditorUpload.mjs +1 -1
  19. package/esm2022/lib/dynamic-form/ck-editor/index.mjs +2 -1
  20. package/esm2022/lib/dynamic-form/form-control-group.mjs +3 -2
  21. package/esm2022/lib/dynamic-form/index.mjs +1 -1
  22. package/esm2022/lib/enums/ck-editor-mode.enum.mjs +8 -0
  23. package/esm2022/lib/enums/languages-map.mjs +2 -2
  24. package/esm2022/lib/interfaces/form-config-interfaces.mjs +1 -1
  25. package/esm2022/lib/interfaces/index.mjs +1 -1
  26. package/esm2022/lib/object/ck-editor-object.mjs +343 -614
  27. package/esm2022/lib/services/index.mjs +2 -0
  28. package/esm2022/lib/services/set-ck-editor-configs.service.mjs +29 -0
  29. package/esm2022/public-api.mjs +3 -5
  30. package/fesm2022/dignite-ng-expand.ck-editor-config.mjs.map +1 -1
  31. package/fesm2022/dignite-ng-expand.ck-editor.mjs +610 -871
  32. package/fesm2022/dignite-ng-expand.ck-editor.mjs.map +1 -1
  33. package/lib/ck-editor.module.d.ts +6 -7
  34. package/lib/dynamic-form/ck-editor/ck-editor-config.component.d.ts +4 -0
  35. package/lib/dynamic-form/ck-editor/ck-editor-config.d.ts +2 -0
  36. package/lib/dynamic-form/ck-editor/ck-editor-control.component.d.ts +6 -5
  37. package/lib/dynamic-form/ck-editor/ck-editor-view.component.d.ts +17 -0
  38. package/lib/dynamic-form/ck-editor/index.d.ts +1 -0
  39. package/lib/enums/ck-editor-mode.enum.d.ts +5 -0
  40. package/lib/enums/languages-map.d.ts +1 -1
  41. package/lib/object/ck-editor-object.d.ts +4 -27
  42. package/lib/services/index.d.ts +1 -0
  43. package/lib/services/set-ck-editor-configs.service.d.ts +7 -0
  44. package/package.json +12 -10
  45. package/public-api.d.ts +2 -4
  46. package/esm2022/lib/components/dome/ck-editor-dome.component.mjs +0 -84
  47. package/esm2022/lib/pipes/index.mjs +0 -2
  48. package/esm2022/lib/pipes/set-ckeditor-content.pipe.mjs +0 -25
  49. package/lib/components/dome/ck-editor-dome.component.d.ts +0 -26
  50. package/lib/pipes/index.d.ts +0 -1
  51. package/lib/pipes/set-ckeditor-content.pipe.d.ts +0 -8
@@ -1,363 +1,168 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Component, NgModule, Input, ViewChild, Pipe } from '@angular/core';
3
- import * as i1$1 from '@angular/router';
2
+ import { NgModule, inject, ChangeDetectorRef, ViewChild, Input, Component, Injectable } from '@angular/core';
3
+ import * as i1 from '@angular/router';
4
4
  import { RouterModule } from '@angular/router';
5
- import { AccessibilityHelp, Alignment, Autoformat, AutoImage, Autosave, Base64UploadAdapter, BlockQuote, Bold, CloudServices, Code, Essentials, FontBackgroundColor, FontColor, FontFamily, FontSize, GeneralHtmlSupport, Heading, Highlight, HorizontalLine, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, Link, LinkImage, List, ListProperties, MediaEmbed, Paragraph, PasteFromOffice, RemoveFormat, SelectAll, SpecialCharacters, SpecialCharactersArrows, SpecialCharactersCurrency, SpecialCharactersEssentials, SpecialCharactersLatin, SpecialCharactersMathematical, SpecialCharactersText, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, TextTransformation, TodoList, Underline, Undo, ClassicEditor } from 'ckeditor5';
6
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/zh-cn';
7
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/de-ch';
8
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/en-gb';
9
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/pt-br';
10
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/zh';
11
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/de';
12
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/ar';
13
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/cs';
14
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/hi';
15
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/fi';
16
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/hu';
17
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/fr';
18
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/it';
19
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/sk';
20
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/ja';
21
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/es';
22
- import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/vi';
23
- import * as i2$1 from '@abp/ng.core';
24
- import { ConfigStateService, LazyLoadService, SubscriptionService, LOADING_STRATEGY, RestService, CoreModule } from '@abp/ng.core';
25
- import * as i1 from '@angular/forms';
26
- import { FormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
27
- import * as i2 from '@angular/common';
28
- import * as i4 from '@ckeditor/ckeditor5-angular';
29
- import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
5
+ import * as i3 from '@abp/ng.core';
6
+ import { mapEnumToOptions, ConfigStateService, RestService, LazyLoadService, SubscriptionService, LOADING_STRATEGY, CoreModule } from '@abp/ng.core';
30
7
  import { ThemeSharedModule } from '@abp/ng.theme.shared';
31
- import * as i3 from '@ngx-validate/core';
32
- import { DomSanitizer } from '@angular/platform-browser';
8
+ import * as i1$1 from '@angular/forms';
9
+ import { FormBuilder, Validators } from '@angular/forms';
10
+ import * as i1$2 from '@angular/common';
11
+ import * as i4 from '@ngx-validate/core';
12
+ import * as i4$1 from '@ckeditor/ckeditor5-angular';
13
+ import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
33
14
 
34
- var easy = {
35
- toolbar: {
36
- items: [
37
- 'undo',
38
- 'redo',
39
- '|',
40
- 'heading',
41
- '|',
42
- 'link',
43
- 'bold',
44
- 'italic',
45
- 'underline',
46
- ],
47
- shouldNotGroupWhenFull: false,
48
- },
49
- plugins: [
50
- AccessibilityHelp,
51
- Alignment,
52
- Autoformat,
53
- AutoImage,
54
- Autosave,
55
- Base64UploadAdapter,
56
- BlockQuote,
57
- Bold,
58
- CloudServices,
59
- Code,
60
- Essentials,
61
- FontBackgroundColor,
62
- FontColor,
63
- FontFamily,
64
- FontSize,
65
- GeneralHtmlSupport,
66
- Heading,
67
- Highlight,
68
- HorizontalLine,
69
- ImageBlock,
70
- ImageCaption,
71
- ImageInline,
72
- ImageInsert,
73
- ImageInsertViaUrl,
74
- ImageResize,
75
- ImageStyle,
76
- ImageTextAlternative,
77
- ImageToolbar,
78
- ImageUpload,
79
- Indent,
80
- IndentBlock,
81
- Italic,
82
- Link,
83
- LinkImage,
84
- List,
85
- ListProperties,
86
- MediaEmbed,
87
- Paragraph,
88
- PasteFromOffice,
89
- RemoveFormat,
90
- SelectAll,
91
- SpecialCharacters,
92
- SpecialCharactersArrows,
93
- SpecialCharactersCurrency,
94
- SpecialCharactersEssentials,
95
- SpecialCharactersLatin,
96
- SpecialCharactersMathematical,
97
- SpecialCharactersText,
98
- Strikethrough,
99
- Style,
100
- Subscript,
101
- Superscript,
102
- Table,
103
- TableCaption,
104
- TableCellProperties,
105
- TableColumnResize,
106
- TableProperties,
107
- TableToolbar,
108
- TextTransformation,
109
- TodoList,
110
- Underline,
111
- Undo,
112
- ],
113
- heading: {
114
- options: [
115
- {
116
- model: 'paragraph',
117
- title: 'Paragraph',
118
- class: 'ck-heading_paragraph',
119
- },
120
- {
121
- model: 'heading1',
122
- view: 'h1',
123
- title: 'Heading 1',
124
- class: 'ck-heading_heading1',
125
- },
126
- {
127
- model: 'heading2',
128
- view: 'h2',
129
- title: 'Heading 2',
130
- class: 'ck-heading_heading2',
131
- },
132
- {
133
- model: 'heading3',
134
- view: 'h3',
135
- title: 'Heading 3',
136
- class: 'ck-heading_heading3',
137
- },
138
- {
139
- model: 'heading4',
140
- view: 'h4',
141
- title: 'Heading 4',
142
- class: 'ck-heading_heading4',
143
- },
144
- {
145
- model: 'heading5',
146
- view: 'h5',
147
- title: 'Heading 5',
148
- class: 'ck-heading_heading5',
149
- },
150
- {
151
- model: 'heading6',
152
- view: 'h6',
153
- title: 'Heading 6',
154
- class: 'ck-heading_heading6',
155
- },
156
- ],
157
- },
158
- link: {
159
- addTargetToExternalLinks: true,
160
- defaultProtocol: 'https://',
161
- decorators: {
162
- toggleDownloadable: {
163
- mode: 'manual',
164
- label: 'Downloadable',
165
- attributes: {
166
- download: 'file',
167
- },
168
- },
169
- },
170
- },
171
- };
172
- var defaults = {
173
- toolbar: {
174
- items: [
175
- 'undo',
176
- 'redo',
177
- '|',
178
- 'heading',
179
- '|',
180
- 'fontSize',
181
- 'fontFamily',
182
- 'fontColor',
183
- 'fontBackgroundColor',
184
- 'link',
185
- '|',
186
- 'bold',
187
- 'italic',
188
- 'underline',
189
- '|',
190
- 'insertImage',
191
- ],
192
- shouldNotGroupWhenFull: false,
193
- },
194
- plugins: [
195
- Undo,
196
- Heading,
197
- FontSize,
198
- FontColor,
199
- FontFamily,
200
- FontBackgroundColor,
201
- Link,
202
- Bold,
203
- Italic,
204
- Underline,
205
- Base64UploadAdapter,
206
- ImageToolbar,
207
- ImageUpload,
208
- LinkImage,
209
- AccessibilityHelp,
210
- Alignment,
211
- Autoformat,
212
- AutoImage,
213
- Autosave,
214
- BlockQuote,
215
- CloudServices,
216
- Code,
217
- Essentials,
218
- GeneralHtmlSupport,
219
- Highlight,
220
- HorizontalLine,
221
- ImageBlock,
222
- ImageCaption,
223
- ImageInline,
224
- ImageInsert,
225
- ImageInsertViaUrl,
226
- ImageResize,
227
- ImageStyle,
228
- ImageTextAlternative,
229
- Indent,
230
- IndentBlock,
231
- List,
232
- ListProperties,
233
- MediaEmbed,
234
- Paragraph,
235
- PasteFromOffice,
236
- RemoveFormat,
237
- SelectAll,
238
- SpecialCharacters,
239
- SpecialCharactersArrows,
240
- SpecialCharactersCurrency,
241
- SpecialCharactersEssentials,
242
- SpecialCharactersLatin,
243
- SpecialCharactersMathematical,
244
- SpecialCharactersText,
245
- Strikethrough,
246
- Style,
247
- Subscript,
248
- Superscript,
249
- Table,
250
- TableCaption,
251
- TableCellProperties,
252
- TableColumnResize,
253
- TableProperties,
254
- TableToolbar,
255
- TextTransformation,
256
- TodoList,
257
- ],
258
- heading: {
259
- options: [
260
- {
261
- model: 'paragraph',
262
- title: 'Paragraph',
263
- class: 'ck-heading_paragraph',
264
- },
265
- {
266
- model: 'heading1',
267
- view: 'h1',
268
- title: 'Heading 1',
269
- class: 'ck-heading_heading1',
270
- },
271
- {
272
- model: 'heading2',
273
- view: 'h2',
274
- title: 'Heading 2',
275
- class: 'ck-heading_heading2',
276
- },
277
- {
278
- model: 'heading3',
279
- view: 'h3',
280
- title: 'Heading 3',
281
- class: 'ck-heading_heading3',
282
- },
283
- {
284
- model: 'heading4',
285
- view: 'h4',
286
- title: 'Heading 4',
287
- class: 'ck-heading_heading4',
288
- },
289
- {
290
- model: 'heading5',
291
- view: 'h5',
292
- title: 'Heading 5',
293
- class: 'ck-heading_heading5',
294
- },
295
- {
296
- model: 'heading6',
297
- view: 'h6',
298
- title: 'Heading 6',
299
- class: 'ck-heading_heading6',
300
- },
301
- ],
302
- },
303
- fontSize: {
304
- options: [10, 12, 14, 'default', 18, 20, 22, 24, 26, 28, 30, 32],
305
- },
306
- link: {
307
- addTargetToExternalLinks: true,
308
- defaultProtocol: 'https://',
309
- decorators: {
310
- toggleDownloadable: {
311
- mode: 'manual',
312
- label: 'Downloadable',
313
- attributes: {
314
- download: 'file',
315
- },
316
- },
317
- },
318
- },
319
- image: {
320
- toolbar: [
321
- 'toggleImageCaption',
322
- 'imageTextAlternative',
323
- '|',
324
- 'imageStyle:inline',
325
- 'imageStyle:wrapText',
326
- 'imageStyle:breakText',
327
- '|',
328
- 'resizeImage',
329
- ],
330
- styles: {
331
- options: [
332
- 'inline', 'alignLeft', 'alignRight',
333
- 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
334
- 'block', 'side'
335
- ]
336
- },
337
- resizeOptions: [{
338
- name: 'resizeImage:original',
339
- label: 'Original',
340
- value: null
341
- },
342
- {
343
- name: 'resizeImage:25',
344
- label: '25%',
345
- value: '25'
346
- },
347
- {
348
- name: 'resizeImage:50',
349
- label: '50%',
350
- value: '50'
351
- },
352
- {
353
- name: 'resizeImage:75',
354
- label: '75%',
355
- value: '75'
15
+ const routes = [];
16
+ class CkEditorRoutingModule {
17
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
18
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] }); }
19
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
20
+ }
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, decorators: [{
22
+ type: NgModule,
23
+ args: [{
24
+ imports: [RouterModule.forChild(routes)],
25
+ exports: [RouterModule],
26
+ }]
27
+ }] });
28
+
29
+ class CkEditorConfig {
30
+ constructor(data) {
31
+ /**类型 */
32
+ this['Ckeditor.Mode'] = ['', []];
33
+ /**文件容器名称 */
34
+ // placeholder: any = new FormControl('', Validators.required);
35
+ this['Ckeditor.ImagesContainerName'] = ['', []];
36
+ /**多选 */
37
+ // placeholder: any = new FormControl('', Validators.required);
38
+ this['Ckeditor.InitialContent'] = ['', []];
39
+ if (data) {
40
+ for (const key in data) {
41
+ if (data.hasOwnProperty(key)) {
42
+ this[key] = data[key];
43
+ }
356
44
  }
357
- ],
358
- },
45
+ }
46
+ }
47
+ }
48
+
49
+ var CkEditorModeEnum;
50
+ (function (CkEditorModeEnum) {
51
+ CkEditorModeEnum[CkEditorModeEnum["Simple"] = 0] = "Simple";
52
+ CkEditorModeEnum[CkEditorModeEnum["Classic"] = 1] = "Classic";
53
+ })(CkEditorModeEnum || (CkEditorModeEnum = {}));
54
+ const CkEditorModeEnumOptions = mapEnumToOptions(CkEditorModeEnum);
55
+
56
+ class CkEditorConfigComponent {
57
+ constructor(fb) {
58
+ this.fb = fb;
59
+ this.CkEditorModeEnum = CkEditorModeEnum;
60
+ this.CkEditorModeEnumOptions = CkEditorModeEnumOptions;
61
+ this.cdr = inject(ChangeDetectorRef);
62
+ }
63
+ set Entity(v) {
64
+ this._Entity = v;
65
+ this.dataLoaded();
66
+ }
67
+ set selected(v) {
68
+ this._selected = v || '';
69
+ // this.dataLoaded()
70
+ }
71
+ set type(v) {
72
+ this._type = v;
73
+ // this.dataLoaded()
74
+ }
75
+ //
76
+ get formConfiguration() {
77
+ return this._Entity.get('formConfiguration');
78
+ }
79
+ async dataLoaded() {
80
+ if (this._Entity && this._type) {
81
+ await this.AfterInit();
82
+ this.cdr.detectChanges(); // 手动触发变更检测
83
+ this.submitclick?.nativeElement?.click();
84
+ }
85
+ }
86
+ AfterInit() {
87
+ return new Promise((resolve, rejects) => {
88
+ this._Entity.setControl('formConfiguration', this.fb.group(new CkEditorConfig()));
89
+ if (this._selected && this._selected.formControlName == this._type) {
90
+ this.formConfiguration.patchValue({
91
+ ...this._selected.formConfiguration,
92
+ });
93
+ }
94
+ resolve(true);
95
+ });
96
+ }
97
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
98
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorConfigComponent, selector: "ck-editor-config", inputs: { Entity: "Entity", selected: "selected", type: "type" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::EditorMode' | abpLocalization}}</label>\n <!-- <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.Mode\"> -->\n <select class=\"form-select\" formControlName=\"Ckeditor.Mode\" >\n <ng-container *ngFor=\"let item of CkEditorModeEnumOptions\">\n <option [value]=\"item.value\">{{'DigniteAbpDynamicFormsCkEditor::EditorMode.' + item.key|abpLocalization}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::ImagesContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.ImagesContainerName\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::InitialContent' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.InitialContent\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i4.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i4.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
99
+ }
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
101
+ type: Component,
102
+ args: [{ selector: 'ck-editor-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::EditorMode' | abpLocalization}}</label>\n <!-- <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.Mode\"> -->\n <select class=\"form-select\" formControlName=\"Ckeditor.Mode\" >\n <ng-container *ngFor=\"let item of CkEditorModeEnumOptions\">\n <option [value]=\"item.value\">{{'DigniteAbpDynamicFormsCkEditor::EditorMode.' + item.key|abpLocalization}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::ImagesContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.ImagesContainerName\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::InitialContent' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.InitialContent\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
103
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { Entity: [{
104
+ type: Input
105
+ }], selected: [{
106
+ type: Input
107
+ }], type: [{
108
+ type: Input
109
+ }], submitclick: [{
110
+ type: ViewChild,
111
+ args: ['submitclick', { static: true }]
112
+ }] } });
113
+
114
+ let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
115
+ constructor(loader, ImagesContainerName, restService) {
116
+ this.reader = new FileReader();
117
+ this.Base64 = false;
118
+ this.createFile = (input, config) => this.restService.request({
119
+ method: 'POST',
120
+ url: '/api/file-explorer/files',
121
+ params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
122
+ body: input.file,
123
+ }, { apiName: 'FileExplorer', ...config });
124
+ this.loader = loader;
125
+ this.ImagesContainerName = ImagesContainerName;
126
+ this.restService = restService;
127
+ }
128
+ upload() {
129
+ return new Promise((resolve, reject) => {
130
+ const reader = this.reader;
131
+ if (this.Base64) {
132
+ reader.addEventListener('load', () => {
133
+ resolve({ default: reader.result });
134
+ });
135
+ reader.addEventListener('error', err => {
136
+ reject(err);
137
+ });
138
+ reader.addEventListener('abort', () => {
139
+ reject();
140
+ });
141
+ this.loader.file.then((file) => {
142
+ reader.readAsDataURL(file);
143
+ });
144
+ }
145
+ else {
146
+ this.loader.file.then((file) => {
147
+ var formData = new FormData();
148
+ formData.append('file', file, file.name);
149
+ this.createFile({
150
+ file: formData,
151
+ containerName: this.ImagesContainerName,
152
+ directoryId: '',
153
+ entityId: ''
154
+ }).subscribe((response) => {
155
+ resolve({ default: response.url });
156
+ }, (error) => {
157
+ reject(error);
158
+ });
159
+ });
160
+ }
161
+ });
162
+ }
359
163
  };
360
- var standard = {
164
+
165
+ var Simple = {
361
166
  toolbar: {
362
167
  items: [
363
168
  'undo',
@@ -365,95 +170,15 @@ var standard = {
365
170
  '|',
366
171
  'heading',
367
172
  '|',
368
- 'fontSize',
369
- 'fontFamily',
370
- 'fontColor',
371
- 'fontBackgroundColor',
372
- '|',
173
+ 'link',
373
174
  'bold',
374
175
  'italic',
375
176
  'underline',
376
- 'strikethrough',
377
- '|',
378
- 'link',
379
- 'insertImage',
380
- 'insertTable',
381
- '|',
382
- 'alignment',
383
- '|',
384
- 'bulletedList',
385
- 'numberedList',
177
+ 'insertImage'
386
178
  ],
387
179
  shouldNotGroupWhenFull: false,
388
180
  },
389
- plugins: [
390
- AccessibilityHelp,
391
- Alignment,
392
- Autoformat,
393
- AutoImage,
394
- Autosave,
395
- Base64UploadAdapter,
396
- BlockQuote,
397
- Bold,
398
- CloudServices,
399
- Code,
400
- Essentials,
401
- FontBackgroundColor,
402
- FontColor,
403
- FontFamily,
404
- FontSize,
405
- GeneralHtmlSupport,
406
- Heading,
407
- Highlight,
408
- HorizontalLine,
409
- ImageBlock,
410
- ImageCaption,
411
- ImageInline,
412
- ImageInsert,
413
- ImageInsertViaUrl,
414
- ImageResize,
415
- ImageStyle,
416
- ImageTextAlternative,
417
- ImageToolbar,
418
- ImageUpload,
419
- Indent,
420
- IndentBlock,
421
- Italic,
422
- Link,
423
- LinkImage,
424
- List,
425
- ListProperties,
426
- MediaEmbed,
427
- Paragraph,
428
- PasteFromOffice,
429
- RemoveFormat,
430
- SelectAll,
431
- SpecialCharacters,
432
- SpecialCharactersArrows,
433
- SpecialCharactersCurrency,
434
- SpecialCharactersEssentials,
435
- SpecialCharactersLatin,
436
- SpecialCharactersMathematical,
437
- SpecialCharactersText,
438
- Strikethrough,
439
- Style,
440
- Subscript,
441
- Superscript,
442
- Table,
443
- TableCaption,
444
- TableCellProperties,
445
- TableColumnResize,
446
- TableProperties,
447
- TableToolbar,
448
- TextTransformation,
449
- TodoList,
450
- Underline,
451
- Undo,
452
- ],
453
- fontSize: {
454
- options: [10, 12, 14, 'default', 18, 20, 22, 24, 26, 28, 30, 32],
455
- supportAllValues: true,
456
- },
181
+ plugins: [],
457
182
  heading: {
458
183
  options: [
459
184
  {
@@ -486,67 +211,17 @@ var standard = {
486
211
  class: 'ck-heading_heading4',
487
212
  },
488
213
  {
489
- model: 'heading5',
490
- view: 'h5',
491
- title: 'Heading 5',
492
- class: 'ck-heading_heading5',
493
- },
494
- {
495
- model: 'heading6',
496
- view: 'h6',
497
- title: 'Heading 6',
498
- class: 'ck-heading_heading6',
499
- },
500
- ],
501
- },
502
- htmlSupport: {
503
- allow: [
504
- {
505
- name: /^.*$/,
506
- styles: true,
507
- attributes: true,
508
- classes: true,
509
- },
510
- ],
511
- },
512
- image: {
513
- toolbar: [
514
- 'toggleImageCaption',
515
- 'imageTextAlternative',
516
- '|',
517
- 'imageStyle:inline',
518
- 'imageStyle:wrapText',
519
- 'imageStyle:breakText',
520
- '|',
521
- 'resizeImage',
522
- ],
523
- styles: {
524
- options: [
525
- 'inline', 'alignLeft', 'alignRight',
526
- 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
527
- 'block', 'side'
528
- ]
529
- },
530
- resizeOptions: [{
531
- name: 'resizeImage:original',
532
- label: 'Original',
533
- value: null
534
- },
535
- {
536
- name: 'resizeImage:25',
537
- label: '25%',
538
- value: '25'
539
- },
540
- {
541
- name: 'resizeImage:50',
542
- label: '50%',
543
- value: '50'
214
+ model: 'heading5',
215
+ view: 'h5',
216
+ title: 'Heading 5',
217
+ class: 'ck-heading_heading5',
544
218
  },
545
219
  {
546
- name: 'resizeImage:75',
547
- label: '75%',
548
- value: '75'
549
- }
220
+ model: 'heading6',
221
+ view: 'h6',
222
+ title: 'Heading 6',
223
+ class: 'ck-heading_heading6',
224
+ },
550
225
  ],
551
226
  },
552
227
  link: {
@@ -562,73 +237,341 @@ var standard = {
562
237
  },
563
238
  },
564
239
  },
565
- list: {
566
- properties: {
567
- styles: true,
568
- startIndex: true,
569
- reversed: true,
570
- },
571
- },
572
- style: {
573
- definitions: [
574
- {
575
- name: 'Article category',
576
- element: 'h3',
577
- classes: ['category'],
578
- },
579
- {
580
- name: 'Title',
581
- element: 'h2',
582
- classes: ['document-title'],
583
- },
584
- {
585
- name: 'Subtitle',
586
- element: 'h3',
587
- classes: ['document-subtitle'],
588
- },
589
- {
590
- name: 'Info box',
591
- element: 'p',
592
- classes: ['info-box'],
593
- },
594
- {
595
- name: 'Side quote',
596
- element: 'blockquote',
597
- classes: ['side-quote'],
598
- },
599
- {
600
- name: 'Marker',
601
- element: 'span',
602
- classes: ['marker'],
603
- },
604
- {
605
- name: 'Spoiler',
606
- element: 'span',
607
- classes: ['spoiler'],
608
- },
609
- {
610
- name: 'Code (dark)',
611
- element: 'pre',
612
- classes: ['fancy-code', 'fancy-code-dark'],
613
- },
614
- {
615
- name: 'Code (bright)',
616
- element: 'pre',
617
- classes: ['fancy-code', 'fancy-code-bright'],
618
- },
619
- ],
620
- },
621
- table: {
622
- contentToolbar: [
623
- 'tableColumn',
624
- 'tableRow',
625
- 'mergeTableCells',
626
- 'tableProperties',
627
- 'tableCellProperties',
628
- ],
629
- },
630
240
  };
631
- var full = {
241
+ // export var defaults: any= {
242
+ // toolbar: {
243
+ // items: [
244
+ // 'undo',
245
+ // 'redo',
246
+ // '|',
247
+ // 'heading',
248
+ // '|',
249
+ // 'fontSize',
250
+ // 'fontFamily',
251
+ // 'fontColor',
252
+ // 'fontBackgroundColor',
253
+ // 'link',
254
+ // '|',
255
+ // 'bold',
256
+ // 'italic',
257
+ // 'underline',
258
+ // '|',
259
+ // 'insertImage',
260
+ // ],
261
+ // shouldNotGroupWhenFull: false,
262
+ // },
263
+ // plugins: [],
264
+ // heading: {
265
+ // options: [
266
+ // {
267
+ // model: 'paragraph',
268
+ // title: 'Paragraph',
269
+ // class: 'ck-heading_paragraph',
270
+ // },
271
+ // {
272
+ // model: 'heading1',
273
+ // view: 'h1',
274
+ // title: 'Heading 1',
275
+ // class: 'ck-heading_heading1',
276
+ // },
277
+ // {
278
+ // model: 'heading2',
279
+ // view: 'h2',
280
+ // title: 'Heading 2',
281
+ // class: 'ck-heading_heading2',
282
+ // },
283
+ // {
284
+ // model: 'heading3',
285
+ // view: 'h3',
286
+ // title: 'Heading 3',
287
+ // class: 'ck-heading_heading3',
288
+ // },
289
+ // {
290
+ // model: 'heading4',
291
+ // view: 'h4',
292
+ // title: 'Heading 4',
293
+ // class: 'ck-heading_heading4',
294
+ // },
295
+ // {
296
+ // model: 'heading5',
297
+ // view: 'h5',
298
+ // title: 'Heading 5',
299
+ // class: 'ck-heading_heading5',
300
+ // },
301
+ // {
302
+ // model: 'heading6',
303
+ // view: 'h6',
304
+ // title: 'Heading 6',
305
+ // class: 'ck-heading_heading6',
306
+ // },
307
+ // ],
308
+ // },
309
+ // fontSize: {
310
+ // options: [10, 12, 14, 'default', 18, 20, 22, 24, 26, 28, 30, 32],
311
+ // },
312
+ // link: {
313
+ // addTargetToExternalLinks: true,
314
+ // defaultProtocol: 'https://',
315
+ // decorators: {
316
+ // toggleDownloadable: {
317
+ // mode: 'manual',
318
+ // label: 'Downloadable',
319
+ // attributes: {
320
+ // download: 'file',
321
+ // },
322
+ // },
323
+ // },
324
+ // },
325
+ // image: {
326
+ // toolbar: [
327
+ // 'toggleImageCaption',
328
+ // 'imageTextAlternative',
329
+ // '|',
330
+ // 'imageStyle:inline',
331
+ // 'imageStyle:wrapText',
332
+ // 'imageStyle:breakText',
333
+ // '|',
334
+ // 'resizeImage',
335
+ // ],
336
+ // styles: {
337
+ // options: [
338
+ // 'inline', 'alignLeft', 'alignRight',
339
+ // 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
340
+ // 'block', 'side'
341
+ // ]
342
+ // },
343
+ // resizeOptions: [{
344
+ // name: 'resizeImage:original',
345
+ // label: 'Original',
346
+ // value: null
347
+ // },
348
+ // {
349
+ // name: 'resizeImage:25',
350
+ // label: '25%',
351
+ // value: '25'
352
+ // },
353
+ // {
354
+ // name: 'resizeImage:50',
355
+ // label: '50%',
356
+ // value: '50'
357
+ // },
358
+ // {
359
+ // name: 'resizeImage:75',
360
+ // label: '75%',
361
+ // value: '75'
362
+ // }
363
+ // ],
364
+ // },
365
+ // }
366
+ // export var standard: any= {
367
+ // toolbar: {
368
+ // items: [
369
+ // 'undo',
370
+ // 'redo',
371
+ // '|',
372
+ // 'heading',
373
+ // '|',
374
+ // 'fontSize',
375
+ // 'fontFamily',
376
+ // 'fontColor',
377
+ // 'fontBackgroundColor',
378
+ // '|',
379
+ // 'bold',
380
+ // 'italic',
381
+ // 'underline',
382
+ // 'strikethrough',
383
+ // '|',
384
+ // 'link',
385
+ // 'insertImage',
386
+ // 'insertTable',
387
+ // '|',
388
+ // 'alignment',
389
+ // '|',
390
+ // 'bulletedList',
391
+ // 'numberedList',
392
+ // ],
393
+ // shouldNotGroupWhenFull: false,
394
+ // },
395
+ // plugins: [],
396
+ // fontSize: {
397
+ // options: [10, 12, 14, 'default', 18, 20, 22, 24, 26, 28, 30, 32],
398
+ // supportAllValues: true,
399
+ // },
400
+ // heading: {
401
+ // options: [
402
+ // {
403
+ // model: 'paragraph',
404
+ // title: 'Paragraph',
405
+ // class: 'ck-heading_paragraph',
406
+ // },
407
+ // {
408
+ // model: 'heading1',
409
+ // view: 'h1',
410
+ // title: 'Heading 1',
411
+ // class: 'ck-heading_heading1',
412
+ // },
413
+ // {
414
+ // model: 'heading2',
415
+ // view: 'h2',
416
+ // title: 'Heading 2',
417
+ // class: 'ck-heading_heading2',
418
+ // },
419
+ // {
420
+ // model: 'heading3',
421
+ // view: 'h3',
422
+ // title: 'Heading 3',
423
+ // class: 'ck-heading_heading3',
424
+ // },
425
+ // {
426
+ // model: 'heading4',
427
+ // view: 'h4',
428
+ // title: 'Heading 4',
429
+ // class: 'ck-heading_heading4',
430
+ // },
431
+ // {
432
+ // model: 'heading5',
433
+ // view: 'h5',
434
+ // title: 'Heading 5',
435
+ // class: 'ck-heading_heading5',
436
+ // },
437
+ // {
438
+ // model: 'heading6',
439
+ // view: 'h6',
440
+ // title: 'Heading 6',
441
+ // class: 'ck-heading_heading6',
442
+ // },
443
+ // ],
444
+ // },
445
+ // htmlSupport: {
446
+ // allow: [
447
+ // {
448
+ // name: /^.*$/,
449
+ // styles: true,
450
+ // attributes: true,
451
+ // classes: true,
452
+ // },
453
+ // ],
454
+ // },
455
+ // image: {
456
+ // toolbar: [
457
+ // 'toggleImageCaption',
458
+ // 'imageTextAlternative',
459
+ // '|',
460
+ // 'imageStyle:inline',
461
+ // 'imageStyle:wrapText',
462
+ // 'imageStyle:breakText',
463
+ // '|',
464
+ // 'resizeImage',
465
+ // ],
466
+ // styles: {
467
+ // options: [
468
+ // 'inline', 'alignLeft', 'alignRight',
469
+ // 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
470
+ // 'block', 'side'
471
+ // ]
472
+ // },
473
+ // resizeOptions: [{
474
+ // name: 'resizeImage:original',
475
+ // label: 'Original',
476
+ // value: null
477
+ // },
478
+ // {
479
+ // name: 'resizeImage:25',
480
+ // label: '25%',
481
+ // value: '25'
482
+ // },
483
+ // {
484
+ // name: 'resizeImage:50',
485
+ // label: '50%',
486
+ // value: '50'
487
+ // },
488
+ // {
489
+ // name: 'resizeImage:75',
490
+ // label: '75%',
491
+ // value: '75'
492
+ // }
493
+ // ],
494
+ // },
495
+ // link: {
496
+ // addTargetToExternalLinks: true,
497
+ // defaultProtocol: 'https://',
498
+ // decorators: {
499
+ // toggleDownloadable: {
500
+ // mode: 'manual',
501
+ // label: 'Downloadable',
502
+ // attributes: {
503
+ // download: 'file',
504
+ // },
505
+ // },
506
+ // },
507
+ // },
508
+ // list: {
509
+ // properties: {
510
+ // styles: true,
511
+ // startIndex: true,
512
+ // reversed: true,
513
+ // },
514
+ // },
515
+ // style: {
516
+ // definitions: [
517
+ // {
518
+ // name: 'Article category',
519
+ // element: 'h3',
520
+ // classes: ['category'],
521
+ // },
522
+ // {
523
+ // name: 'Title',
524
+ // element: 'h2',
525
+ // classes: ['document-title'],
526
+ // },
527
+ // {
528
+ // name: 'Subtitle',
529
+ // element: 'h3',
530
+ // classes: ['document-subtitle'],
531
+ // },
532
+ // {
533
+ // name: 'Info box',
534
+ // element: 'p',
535
+ // classes: ['info-box'],
536
+ // },
537
+ // {
538
+ // name: 'Side quote',
539
+ // element: 'blockquote',
540
+ // classes: ['side-quote'],
541
+ // },
542
+ // {
543
+ // name: 'Marker',
544
+ // element: 'span',
545
+ // classes: ['marker'],
546
+ // },
547
+ // {
548
+ // name: 'Spoiler',
549
+ // element: 'span',
550
+ // classes: ['spoiler'],
551
+ // },
552
+ // {
553
+ // name: 'Code (dark)',
554
+ // element: 'pre',
555
+ // classes: ['fancy-code', 'fancy-code-dark'],
556
+ // },
557
+ // {
558
+ // name: 'Code (bright)',
559
+ // element: 'pre',
560
+ // classes: ['fancy-code', 'fancy-code-bright'],
561
+ // },
562
+ // ],
563
+ // },
564
+ // table: {
565
+ // contentToolbar: [
566
+ // 'tableColumn',
567
+ // 'tableRow',
568
+ // 'mergeTableCells',
569
+ // 'tableProperties',
570
+ // 'tableCellProperties',
571
+ // ],
572
+ // },
573
+ // }
574
+ var Classic = {
632
575
  toolbar: {
633
576
  items: [
634
577
  'undo',
@@ -668,69 +611,7 @@ var full = {
668
611
  ],
669
612
  shouldNotGroupWhenFull: false,
670
613
  },
671
- plugins: [
672
- AccessibilityHelp,
673
- Alignment,
674
- Autoformat,
675
- AutoImage,
676
- Autosave,
677
- Base64UploadAdapter,
678
- BlockQuote,
679
- Bold,
680
- CloudServices,
681
- Code,
682
- Essentials,
683
- FontBackgroundColor,
684
- FontColor,
685
- FontFamily,
686
- FontSize,
687
- GeneralHtmlSupport,
688
- Heading,
689
- HorizontalLine,
690
- ImageBlock,
691
- ImageCaption,
692
- ImageInline,
693
- ImageInsert,
694
- ImageInsertViaUrl,
695
- ImageResize,
696
- ImageStyle,
697
- ImageTextAlternative,
698
- ImageToolbar,
699
- ImageUpload,
700
- Indent,
701
- IndentBlock,
702
- Italic,
703
- Link,
704
- LinkImage,
705
- List,
706
- ListProperties,
707
- MediaEmbed,
708
- Paragraph,
709
- PasteFromOffice,
710
- RemoveFormat,
711
- SelectAll,
712
- SpecialCharacters,
713
- SpecialCharactersArrows,
714
- SpecialCharactersCurrency,
715
- SpecialCharactersEssentials,
716
- SpecialCharactersLatin,
717
- SpecialCharactersMathematical,
718
- SpecialCharactersText,
719
- Strikethrough,
720
- Style,
721
- Subscript,
722
- Superscript,
723
- Table,
724
- TableCaption,
725
- TableCellProperties,
726
- TableColumnResize,
727
- TableProperties,
728
- TableToolbar,
729
- TextTransformation,
730
- TodoList,
731
- Underline,
732
- Undo,
733
- ],
614
+ plugins: [],
734
615
  fontFamily: {
735
616
  supportAllValues: true,
736
617
  },
@@ -913,17 +794,17 @@ var full = {
913
794
  },
914
795
  };
915
796
  var CkEditorTypesObject = {
916
- default: defaults,
917
- easy: easy,
918
- standard: standard,
919
- full: full
797
+ // default: defaults,
798
+ Simple: Simple,
799
+ // standard: standard,
800
+ Classic: Classic
920
801
  };
921
802
 
922
803
  var LanguagesMap;
923
804
  (function (LanguagesMap) {
924
805
  LanguagesMap["ar"] = "ar";
925
806
  LanguagesMap["cs"] = "cs";
926
- LanguagesMap["en"] = "en";
807
+ LanguagesMap["en"] = "en-gb";
927
808
  LanguagesMap["hi"] = "hi";
928
809
  LanguagesMap["fi"] = "fi";
929
810
  LanguagesMap["hu"] = "hu";
@@ -941,201 +822,29 @@ var LanguagesMap;
941
822
  LanguagesMap["vi"] = "vi";
942
823
  })(LanguagesMap || (LanguagesMap = {}));
943
824
 
944
- class CkEditorDomeComponent {
945
- constructor() {
946
- this.config = inject(ConfigStateService);
947
- this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
948
- // CkEditorTypesObject = CkEditorTypesObject
949
- this.Editor = ClassicEditor;
950
- this._config = {
951
- plugins: [Bold, Essentials, Italic, Paragraph, Undo],
952
- toolbar: ['undo', 'redo', '|', 'bold', 'italic'],
953
- };
954
- this.configType = 'default';
955
- this.editorValue = '<p>12233</p>';
956
- this.languagesMap = LanguagesMap;
957
- this.lazyLoadService = inject(LazyLoadService);
958
- this.subscriptionService = inject(SubscriptionService);
959
- this._config_ck = CkEditorTypesObject['full'];
960
- }
961
- /**切换类型 */
962
- switchType(type) {
963
- this.configType = type;
964
- this._config_ck = '';
965
- setTimeout(() => {
966
- this.loadStyle();
967
- let configs = CkEditorTypesObject[type];
968
- configs.language = this.languagesMap[this.currentCulture];
969
- // configs.translations= [coreTranslations]
970
- this._config_ck = configs;
971
- }, 0);
972
- }
973
- loadStyle() {
974
- const loaded$ = this.lazyLoadService.load(LOADING_STRATEGY.AppendAnonymousStyleToHead('ckeditor5.css'));
975
- this.subscriptionService.addOne(loaded$);
976
- }
977
- clearconfig() {
978
- this._config = null;
979
- }
980
- /**加载完成 */
981
- ckReady(editor) {
982
- const element = editor.ui.getEditableElement();
983
- const parent = element.parentElement;
984
- parent.insertBefore(editor.ui.view.toolbar.element, element);
985
- }
986
- /**内容改变 */
987
- ckChange({ editor }) {
988
- const data = editor.getData();
989
- this.editorValue = data;
825
+ // import { CkEditorModeEnum } from '../enums/ck-editor-mode-enum';
826
+ class SetCkEditorConfigsService {
827
+ constructor() { }
828
+ async get(input) {
829
+ let { language, type } = input;
830
+ return new Promise(async (resolve, rejects) => {
831
+ let configs = CkEditorTypesObject[CkEditorModeEnum[type]];
832
+ let { AccessibilityHelp, Highlight, Alignment, Autoformat, AutoImage, Autosave, Base64UploadAdapter, BlockQuote, Bold, CloudServices, Code, Essentials, FontBackgroundColor, FontColor, FontFamily, FontSize, GeneralHtmlSupport, Heading, HorizontalLine, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, Link, LinkImage, List, ListProperties, MediaEmbed, Paragraph, PasteFromOffice, RemoveFormat, SelectAll, SpecialCharacters, SpecialCharactersArrows, SpecialCharactersCurrency, SpecialCharactersEssentials, SpecialCharactersLatin, SpecialCharactersMathematical, SpecialCharactersText, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, TextTransformation, TodoList, Underline, Undo } = await import('ckeditor5');
833
+ configs.plugins = [AccessibilityHelp, Highlight, Alignment, Autoformat, AutoImage, Autosave, Base64UploadAdapter, BlockQuote, Bold, CloudServices, Code, Essentials, FontBackgroundColor, FontColor, FontFamily, FontSize, GeneralHtmlSupport, Heading, HorizontalLine, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, Link, LinkImage, List, ListProperties, MediaEmbed, Paragraph, PasteFromOffice, RemoveFormat, SelectAll, SpecialCharacters, SpecialCharactersArrows, SpecialCharactersCurrency, SpecialCharactersEssentials, SpecialCharactersLatin, SpecialCharactersMathematical, SpecialCharactersText, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, TextTransformation, TodoList, Underline, Undo];
834
+ configs.language = LanguagesMap[language];
835
+ await import(`@ckeditor/ckeditor5-build-decoupled-document/build/translations/${LanguagesMap[language]}`);
836
+ resolve(configs);
837
+ });
990
838
  }
991
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorDomeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
992
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorDomeComponent, selector: "lib-ck-editor-dome", ngImport: i0, template: "<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('easy')\">\u6781\u7B80</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('default')\">\u9ED8\u8BA4</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('standard')\">\u6807\u51C6</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('full')\">\u5B8C\u6574</button>\r\n\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"clearconfig()\">\u6E05\u7A7A\u914D\u7F6E</button>\r\n\r\n<h3>\u81EA\u5B9A\u4E49\u914D\u7F6E</h3>\r\n<ckeditor #editor [editor]=\"Editor\" *ngIf=\"_config_ck\" [(ngModel)]=\"editorValue\" [config]=\"_config\" ></ckeditor>\r\n\r\n<h3>\u7C7B\u578B</h3>\r\n<ckeditor #editor [editor]=\"Editor\" *ngIf=\"_config_ck\" [(ngModel)]=\"editorValue\" [config]=\"_config_ck\" (change)=\"ckChange($event)\" (ready)=\"ckReady($event)\"></ckeditor>\r\n\r\n{{editorValue}}", styles: [""], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i4.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }] }); }
839
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
840
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, providedIn: 'root' }); }
993
841
  }
994
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorDomeComponent, decorators: [{
995
- type: Component,
996
- args: [{ selector: 'lib-ck-editor-dome', template: "<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('easy')\">\u6781\u7B80</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('default')\">\u9ED8\u8BA4</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('standard')\">\u6807\u51C6</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('full')\">\u5B8C\u6574</button>\r\n\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"clearconfig()\">\u6E05\u7A7A\u914D\u7F6E</button>\r\n\r\n<h3>\u81EA\u5B9A\u4E49\u914D\u7F6E</h3>\r\n<ckeditor #editor [editor]=\"Editor\" *ngIf=\"_config_ck\" [(ngModel)]=\"editorValue\" [config]=\"_config\" ></ckeditor>\r\n\r\n<h3>\u7C7B\u578B</h3>\r\n<ckeditor #editor [editor]=\"Editor\" *ngIf=\"_config_ck\" [(ngModel)]=\"editorValue\" [config]=\"_config_ck\" (change)=\"ckChange($event)\" (ready)=\"ckReady($event)\"></ckeditor>\r\n\r\n{{editorValue}}" }]
997
- }] });
998
-
999
- const routes = [{
1000
- path: 'dome',
1001
- component: CkEditorDomeComponent,
1002
- }];
1003
- class CkEditorRoutingModule {
1004
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1005
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] }); }
1006
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
1007
- }
1008
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, decorators: [{
1009
- type: NgModule,
842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, decorators: [{
843
+ type: Injectable,
1010
844
  args: [{
1011
- imports: [RouterModule.forChild(routes)],
1012
- exports: [RouterModule],
845
+ providedIn: 'root',
1013
846
  }]
1014
- }] });
1015
-
1016
- class CkEditorConfig {
1017
- constructor(data) {
1018
- /**文件容器名称 */
1019
- // placeholder: any = new FormControl('', Validators.required);
1020
- this['Ckeditor.ImagesContainerName'] = ['', []];
1021
- /**多选 */
1022
- // placeholder: any = new FormControl('', Validators.required);
1023
- this['Ckeditor.InitialContent'] = ['', []];
1024
- if (data) {
1025
- for (const key in data) {
1026
- if (data.hasOwnProperty(key)) {
1027
- this[key] = data[key];
1028
- }
1029
- }
1030
- }
1031
- }
1032
- }
1033
-
1034
- class CkEditorConfigComponent {
1035
- constructor(fb) {
1036
- this.fb = fb;
1037
- }
1038
- set Entity(v) {
1039
- this._Entity = v;
1040
- this.dataLoaded();
1041
- }
1042
- set selected(v) {
1043
- this._selected = v || '';
1044
- // this.dataLoaded()
1045
- }
1046
- set type(v) {
1047
- this._type = v;
1048
- // this.dataLoaded()
1049
- }
1050
- //
1051
- get formConfiguration() {
1052
- return this._Entity.get('formConfiguration');
1053
- }
1054
- async dataLoaded() {
1055
- // if (this.Entity && (this._selected || this._selected === '')) {
1056
- if (this._Entity && this._type) {
1057
- await this.AfterInit();
1058
- this.submitclick.nativeElement.click();
1059
- }
1060
- }
1061
- AfterInit() {
1062
- return new Promise((resolve, rejects) => {
1063
- this._Entity.setControl('formConfiguration', this.fb.group(new CkEditorConfig()));
1064
- if (this._selected && this._selected.formControlName == this._type) {
1065
- this.formConfiguration.patchValue({
1066
- ...this._selected.formConfiguration,
1067
- });
1068
- }
1069
- resolve(true);
1070
- });
1071
- }
1072
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1073
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorConfigComponent, selector: "ck-editor-config", inputs: { Entity: "Entity", selected: "selected", type: "type" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::ImagesContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.ImagesContainerName\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::InitialContent' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.InitialContent\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2$1.LocalizationPipe, name: "abpLocalization" }] }); }
1074
- }
1075
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
1076
- type: Component,
1077
- args: [{ selector: 'ck-editor-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::ImagesContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.ImagesContainerName\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::InitialContent' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.InitialContent\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
1078
- }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { Entity: [{
1079
- type: Input
1080
- }], selected: [{
1081
- type: Input
1082
- }], type: [{
1083
- type: Input
1084
- }], submitclick: [{
1085
- type: ViewChild,
1086
- args: ['submitclick', { static: true }]
1087
- }] } });
1088
-
1089
- let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
1090
- constructor(loader, ImagesContainerName, restService) {
1091
- this.reader = new FileReader();
1092
- this.Base64 = false;
1093
- this.createFile = (input, config) => this.restService.request({
1094
- method: 'POST',
1095
- url: '/api/file-explorer/files',
1096
- params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
1097
- body: input.file,
1098
- }, { apiName: 'FileExplorer', ...config });
1099
- this.loader = loader;
1100
- this.ImagesContainerName = ImagesContainerName;
1101
- this.restService = restService;
1102
- }
1103
- upload() {
1104
- return new Promise((resolve, reject) => {
1105
- const reader = this.reader;
1106
- if (this.Base64) {
1107
- reader.addEventListener('load', () => {
1108
- resolve({ default: reader.result });
1109
- });
1110
- reader.addEventListener('error', err => {
1111
- reject(err);
1112
- });
1113
- reader.addEventListener('abort', () => {
1114
- reject();
1115
- });
1116
- this.loader.file.then((file) => {
1117
- reader.readAsDataURL(file);
1118
- });
1119
- }
1120
- else {
1121
- this.loader.file.then((file) => {
1122
- var formData = new FormData();
1123
- formData.append('file', file, file.name);
1124
- this.createFile({
1125
- file: formData,
1126
- containerName: this.ImagesContainerName,
1127
- directoryId: '',
1128
- entityId: ''
1129
- }).subscribe((response) => {
1130
- resolve({ default: response.url });
1131
- }, (error) => {
1132
- reject(error);
1133
- });
1134
- });
1135
- }
1136
- });
1137
- }
1138
- };
847
+ }], ctorParameters: () => [] });
1139
848
 
1140
849
  class CkEditorControlComponent {
1141
850
  constructor() {
@@ -1145,18 +854,17 @@ class CkEditorControlComponent {
1145
854
  this.ckEditorValue = '';
1146
855
  /**系统语言 */
1147
856
  this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
1148
- /** 语言目录,匹配系统语言,设置ckeditor的语言 */
1149
- this.languagesMap = LanguagesMap;
1150
- this.Editor = ClassicEditor;
857
+ this.CkEditorModeEnum = CkEditorModeEnum;
1151
858
  this.fb = inject(FormBuilder);
1152
859
  /**字段配置列表 */
1153
860
  this._fields = '';
861
+ this.cdr = inject(ChangeDetectorRef);
862
+ this._SetCkEditorConfigsService = inject(SetCkEditorConfigsService);
1154
863
  this.lazyLoadService = inject(LazyLoadService);
1155
864
  this.subscriptionService = inject(SubscriptionService);
1156
865
  this.invalidfeedback = false;
1157
866
  /**图片容器名称 */
1158
867
  this.imagesContainerName = '';
1159
- this.loadckeditor();
1160
868
  }
1161
869
  onReady(editor) {
1162
870
  let _this = this;
@@ -1182,7 +890,7 @@ class CkEditorControlComponent {
1182
890
  this.dataLoaded();
1183
891
  }
1184
892
  get extraProperties() {
1185
- return this._entity.get('extraProperties');
893
+ return this._entity?.get('extraProperties');
1186
894
  }
1187
895
  get ckeditorInput() {
1188
896
  return this.extraProperties.get(this._fields.field.name);
@@ -1191,16 +899,43 @@ class CkEditorControlComponent {
1191
899
  async dataLoaded() {
1192
900
  if (this._fields && this._entity) {
1193
901
  await this.AfterInit();
1194
- this.ckEditorValue = this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
902
+ this.ckEditorValue =
903
+ this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
1195
904
  this.setckeditorInput(this.ckEditorValue);
1196
- this.submitclick.nativeElement.click();
905
+ this.cdr.detectChanges(); // 手动触发变更检测
906
+ await this.loadckeditor();
907
+ this.submitclick?.nativeElement?.click();
1197
908
  }
1198
909
  }
1199
910
  loadckeditor() {
1200
- this.loadStyle();
1201
- let configs = CkEditorTypesObject['default'];
1202
- configs.language = this.languagesMap[this.currentCulture];
1203
- this.ckOptions = configs;
911
+ let _that = this;
912
+ let formConfiguration = this._fields.field.formConfiguration;
913
+ return new Promise(async (resolve) => {
914
+ await import('ckeditor5').then(async (res) => {
915
+ this.loadStyle();
916
+ if (formConfiguration['Ckeditor.Mode'] == CkEditorModeEnum.Simple) {
917
+ _that.Editor = res.InlineEditor;
918
+ }
919
+ else if (formConfiguration['Ckeditor.Mode'] == CkEditorModeEnum.Classic) {
920
+ _that.Editor = res.ClassicEditor;
921
+ }
922
+ else {
923
+ formConfiguration['Ckeditor.Mode'] = CkEditorModeEnum.Simple;
924
+ _that.Editor = res.InlineEditor;
925
+ }
926
+ let configs = await _that._SetCkEditorConfigsService.get({
927
+ language: _that.currentCulture,
928
+ type: formConfiguration['Ckeditor.Mode']
929
+ });
930
+ if (!this.imagesContainerName) {
931
+ if (configs?.toolbar?.items?.indexOf('insertImage') != -1) {
932
+ configs?.toolbar?.items?.splice(configs?.toolbar?.items?.indexOf('insertImage'), 1);
933
+ }
934
+ }
935
+ _that.ckOptions = configs;
936
+ });
937
+ resolve(true);
938
+ });
1204
939
  }
1205
940
  loadStyle() {
1206
941
  const loaded$ = this.lazyLoadService.load(LOADING_STRATEGY.AppendAnonymousStyleToHead('ckeditor5.css'));
@@ -1223,18 +958,15 @@ class CkEditorControlComponent {
1223
958
  this.extraProperties.setControl(this._fields.field.name, newControl);
1224
959
  this.imagesContainerName =
1225
960
  this._fields.field.formConfiguration['Ckeditor.ImagesContainerName'];
1226
- if (!this.imagesContainerName) {
1227
- this.ckOptions.toolbar.items.splice(this.ckOptions.toolbar.items.indexOf('insertImage'), 1);
1228
- }
1229
961
  resolve(true);
1230
962
  });
1231
963
  }
1232
964
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1233
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorControlComponent, selector: "ck-editor-control", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\" [formControlName]=\"_fields.field.name\">\n </ckeditor>\n <!-- <ng-container *ngIf=\"ckeditorInput?.errors?.required&&invalidfeedback\">\n <div class=\"text-danger \">\n {{'DigniteAbpForms::Validate:Required' | abpLocalization:' '}}\n </div>\n </ng-container> -->\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }] }); }
965
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorControlComponent, selector: "ck-editor-control", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"ckOptions\">\n <ckeditor class=\"form-textarea\" [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\"\n [formControlName]=\"_fields.field.name\">\n </ckeditor>\n </ng-container>\n <small class=\"form-text text-muted d-block\"\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: ["@charset \"UTF-8\";:root .ck.ck-editor__editable_inline{min-height:160px!important}.ck.ck-editor__main>.ck-editor__editable{background:var(--bs-body-bg)!important}.ck.ck-toolbar,.ck.ck-button.ck-list-item-button,.ck.ck-button.ck-list-item-button.ck-on,.ck.ck-dropdown__panel{background:var(--bs-body-bg)!important}.ck.ck-editor__editable_inline{border-color:var(--ck-color-base-border)!important}\n"], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i4.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i4.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4$1.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }] }); }
1234
966
  }
1235
967
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, decorators: [{
1236
968
  type: Component,
1237
- args: [{ selector: 'ck-editor-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\" [formControlName]=\"_fields.field.name\">\n </ckeditor>\n <!-- <ng-container *ngIf=\"ckeditorInput?.errors?.required&&invalidfeedback\">\n <div class=\"text-danger \">\n {{'DigniteAbpForms::Validate:Required' | abpLocalization:' '}}\n </div>\n </ng-container> -->\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
969
+ args: [{ selector: 'ck-editor-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"ckOptions\">\n <ckeditor class=\"form-textarea\" [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\"\n [formControlName]=\"_fields.field.name\">\n </ckeditor>\n </ng-container>\n <small class=\"form-text text-muted d-block\"\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: ["@charset \"UTF-8\";:root .ck.ck-editor__editable_inline{min-height:160px!important}.ck.ck-editor__main>.ck-editor__editable{background:var(--bs-body-bg)!important}.ck.ck-toolbar,.ck.ck-button.ck-list-item-button,.ck.ck-button.ck-list-item-button.ck-on,.ck.ck-dropdown__panel{background:var(--bs-body-bg)!important}.ck.ck-editor__editable_inline{border-color:var(--ck-color-base-border)!important}\n"] }]
1238
970
  }], ctorParameters: () => [], propDecorators: { fields: [{
1239
971
  type: Input
1240
972
  }], parentFiledName: [{
@@ -1248,6 +980,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1248
980
  args: ['submitclick', { static: true }]
1249
981
  }] } });
1250
982
 
983
+ class CkEditorViewComponent {
984
+ constructor() {
985
+ /**展示则内容 */
986
+ this.showValue = '';
987
+ /**是否显示再列表 */
988
+ this.showInList = false;
989
+ /**表单控件Value */
990
+ this._value = '';
991
+ }
992
+ set value(v) {
993
+ this._value = v;
994
+ }
995
+ async ngAfterContentInit() {
996
+ //Called after ngOnInit when the component's or directive's content has been initialized.
997
+ //Add 'implements AfterContentInit' to the class.
998
+ let valueOptions = this._value;
999
+ if (this.type && valueOptions) {
1000
+ this.showValue = valueOptions;
1001
+ }
1002
+ }
1003
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1004
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: CkEditorViewComponent, selector: "ck-ck-editor-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, ngImport: i0, template: "@if(showInList){\r\n {{showValue}}\r\n } @else{\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n </div>\r\n }", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1005
+ }
1006
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorViewComponent, decorators: [{
1007
+ type: Component,
1008
+ args: [{ selector: 'ck-ck-editor-view', template: "@if(showInList){\r\n {{showValue}}\r\n } @else{\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n </div>\r\n }" }]
1009
+ }], propDecorators: { showInList: [{
1010
+ type: Input
1011
+ }], fields: [{
1012
+ type: Input
1013
+ }], type: [{
1014
+ type: Input
1015
+ }], value: [{
1016
+ type: Input
1017
+ }] } });
1018
+
1251
1019
  /**
1252
1020
  * 表单控件分组-包含配置,控件,显示的数组
1253
1021
  */
@@ -1257,7 +1025,7 @@ const ckEditorFieldControlGroup = [
1257
1025
  name: 'CkEditor',
1258
1026
  fieldConfigComponent: CkEditorConfigComponent,
1259
1027
  fieldComponent: CkEditorControlComponent,
1260
- // fieldViewComponent:TextBoxViewComponent,
1028
+ fieldViewComponent: CkEditorViewComponent,
1261
1029
  },
1262
1030
  ];
1263
1031
  function getExcludeAssignControl(typeName) {
@@ -1272,16 +1040,12 @@ class CkEditorModule {
1272
1040
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1273
1041
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, declarations: [CkEditorControlComponent,
1274
1042
  CkEditorConfigComponent,
1275
- CkEditorDomeComponent], imports: [FormsModule,
1276
- CoreModule,
1043
+ CkEditorViewComponent], imports: [CoreModule,
1277
1044
  ThemeSharedModule,
1278
- ReactiveFormsModule,
1279
1045
  CkEditorRoutingModule,
1280
1046
  CKEditorModule] }); }
1281
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, imports: [FormsModule,
1282
- CoreModule,
1047
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, imports: [CoreModule,
1283
1048
  ThemeSharedModule,
1284
- ReactiveFormsModule,
1285
1049
  CkEditorRoutingModule,
1286
1050
  CKEditorModule] }); }
1287
1051
  }
@@ -1291,17 +1055,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1291
1055
  declarations: [
1292
1056
  CkEditorControlComponent,
1293
1057
  CkEditorConfigComponent,
1294
- CkEditorDomeComponent,
1058
+ CkEditorViewComponent,
1295
1059
  ],
1296
1060
  imports: [
1297
- FormsModule,
1298
1061
  CoreModule,
1299
1062
  ThemeSharedModule,
1300
- ReactiveFormsModule,
1301
1063
  CkEditorRoutingModule,
1302
1064
  CKEditorModule,
1303
1065
  ],
1304
- exports: []
1305
1066
  }]
1306
1067
  }] });
1307
1068
 
@@ -1366,28 +1127,6 @@ class isBase64UploadAdapter {
1366
1127
  }
1367
1128
  }
1368
1129
 
1369
- class SetCkeditorContentPipe {
1370
- constructor() {
1371
- this.sanitized = inject(DomSanitizer);
1372
- }
1373
- transform(value, ...args) {
1374
- if (value) {
1375
- value = value.replace(/<oembed url/ig, "<iframe src").replace(/oembed>/ig, "iframe>");
1376
- value = value.replace(/<figure class="media"/ig, "<div").replace(/figure>/ig, "div>");
1377
- }
1378
- return this.sanitized.bypassSecurityTrustHtml(value);
1379
- }
1380
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkeditorContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1381
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: SetCkeditorContentPipe, isStandalone: true, name: "setCkeditorContent" }); }
1382
- }
1383
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkeditorContentPipe, decorators: [{
1384
- type: Pipe,
1385
- args: [{
1386
- name: 'setCkeditorContent',
1387
- standalone: true
1388
- }]
1389
- }] });
1390
-
1391
1130
  /*
1392
1131
  * Public API Surface of ck-editor
1393
1132
  */
@@ -1396,5 +1135,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1396
1135
  * Generated bundle index. Do not edit.
1397
1136
  */
1398
1137
 
1399
- export { AddFieldControlGroup, CkEditorModule, CkEditorRoutingModule, CkEditorTypesObject, LanguagesMap, SetCkeditorContentPipe, ckEditorFieldControlGroup, defaults, easy, full, getExcludeAssignControl, isBase64UploadAdapter, standard };
1138
+ export { AddFieldControlGroup, CkEditorModeEnum, CkEditorModeEnumOptions, CkEditorModule, SetCkEditorConfigsService, ckEditorFieldControlGroup, getExcludeAssignControl, isBase64UploadAdapter };
1400
1139
  //# sourceMappingURL=dignite-ng-expand.ck-editor.mjs.map