@dignite-ng/expand.ck-editor 3.0.0-rc.3 → 3.0.0-rc.5

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.
@@ -2,14 +2,14 @@ import * as i0 from '@angular/core';
2
2
  import { NgModule, inject, ChangeDetectorRef, Component, Input, ViewChild, Injectable } from '@angular/core';
3
3
  import * as i1 from '@angular/router';
4
4
  import { RouterModule } from '@angular/router';
5
- import * as i2 from '@abp/ng.core';
6
- import { ConfigStateService, RestService, LazyLoadService, SubscriptionService, LOADING_STRATEGY, CoreModule } from '@abp/ng.core';
5
+ import * as i3 from '@abp/ng.core';
6
+ import { mapEnumToOptions, ConfigStateService, RestService, LazyLoadService, SubscriptionService, LOADING_STRATEGY, CoreModule } from '@abp/ng.core';
7
7
  import { ThemeSharedModule } from '@abp/ng.theme.shared';
8
8
  import * as i1$1 from '@angular/forms';
9
9
  import { FormBuilder, Validators } from '@angular/forms';
10
- import * as i3 from '@ngx-validate/core';
11
- import * as i1$2 from '@angular/common';
12
- import * as i4 from '@ckeditor/ckeditor5-angular';
10
+ import * as i2 from '@angular/common';
11
+ import * as i4 from '@ngx-validate/core';
12
+ import * as i4$1 from '@ckeditor/ckeditor5-angular';
13
13
  import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
14
14
 
15
15
  const routes = [];
@@ -28,6 +28,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
28
28
 
29
29
  class CkEditorConfig {
30
30
  constructor(data) {
31
+ /**类型 */
32
+ this['Ckeditor.Mode'] = ['', []];
31
33
  /**文件容器名称 */
32
34
  // placeholder: any = new FormControl('', Validators.required);
33
35
  this['Ckeditor.ImagesContainerName'] = ['', []];
@@ -44,9 +46,18 @@ class CkEditorConfig {
44
46
  }
45
47
  }
46
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
+
47
56
  class CkEditorConfigComponent {
48
57
  constructor(fb) {
49
58
  this.fb = fb;
59
+ this.CkEditorModeEnum = CkEditorModeEnum;
60
+ this.CkEditorModeEnumOptions = CkEditorModeEnumOptions;
50
61
  this.cdr = inject(ChangeDetectorRef);
51
62
  }
52
63
  set Entity(v) {
@@ -61,7 +72,7 @@ class CkEditorConfigComponent {
61
72
  this._type = v;
62
73
  // this.dataLoaded()
63
74
  }
64
- //
75
+ //
65
76
  get formConfiguration() {
66
77
  return this._Entity.get('formConfiguration');
67
78
  }
@@ -84,11 +95,11 @@ class CkEditorConfigComponent {
84
95
  });
85
96
  }
86
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 }); }
87
- 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$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.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: i2.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.LocalizationPipe, name: "abpLocalization" }] }); }
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: i2.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" }] }); }
88
99
  }
89
100
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
90
101
  type: Component,
91
- 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>" }]
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>" }]
92
103
  }], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { Entity: [{
93
104
  type: Input
94
105
  }], selected: [{
@@ -151,7 +162,7 @@ let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
151
162
  }
152
163
  };
153
164
 
154
- var easy = {
165
+ var Simple = {
155
166
  toolbar: {
156
167
  items: [
157
168
  'undo',
@@ -163,6 +174,7 @@ var easy = {
163
174
  'bold',
164
175
  'italic',
165
176
  'underline',
177
+ 'insertImage'
166
178
  ],
167
179
  shouldNotGroupWhenFull: false,
168
180
  },
@@ -226,340 +238,340 @@ var easy = {
226
238
  },
227
239
  },
228
240
  };
229
- var defaults = {
230
- toolbar: {
231
- items: [
232
- 'undo',
233
- 'redo',
234
- '|',
235
- 'heading',
236
- '|',
237
- 'fontSize',
238
- 'fontFamily',
239
- 'fontColor',
240
- 'fontBackgroundColor',
241
- 'link',
242
- '|',
243
- 'bold',
244
- 'italic',
245
- 'underline',
246
- '|',
247
- 'insertImage',
248
- ],
249
- shouldNotGroupWhenFull: false,
250
- },
251
- plugins: [],
252
- heading: {
253
- options: [
254
- {
255
- model: 'paragraph',
256
- title: 'Paragraph',
257
- class: 'ck-heading_paragraph',
258
- },
259
- {
260
- model: 'heading1',
261
- view: 'h1',
262
- title: 'Heading 1',
263
- class: 'ck-heading_heading1',
264
- },
265
- {
266
- model: 'heading2',
267
- view: 'h2',
268
- title: 'Heading 2',
269
- class: 'ck-heading_heading2',
270
- },
271
- {
272
- model: 'heading3',
273
- view: 'h3',
274
- title: 'Heading 3',
275
- class: 'ck-heading_heading3',
276
- },
277
- {
278
- model: 'heading4',
279
- view: 'h4',
280
- title: 'Heading 4',
281
- class: 'ck-heading_heading4',
282
- },
283
- {
284
- model: 'heading5',
285
- view: 'h5',
286
- title: 'Heading 5',
287
- class: 'ck-heading_heading5',
288
- },
289
- {
290
- model: 'heading6',
291
- view: 'h6',
292
- title: 'Heading 6',
293
- class: 'ck-heading_heading6',
294
- },
295
- ],
296
- },
297
- fontSize: {
298
- options: [10, 12, 14, 'default', 18, 20, 22, 24, 26, 28, 30, 32],
299
- },
300
- link: {
301
- addTargetToExternalLinks: true,
302
- defaultProtocol: 'https://',
303
- decorators: {
304
- toggleDownloadable: {
305
- mode: 'manual',
306
- label: 'Downloadable',
307
- attributes: {
308
- download: 'file',
309
- },
310
- },
311
- },
312
- },
313
- image: {
314
- toolbar: [
315
- 'toggleImageCaption',
316
- 'imageTextAlternative',
317
- '|',
318
- 'imageStyle:inline',
319
- 'imageStyle:wrapText',
320
- 'imageStyle:breakText',
321
- '|',
322
- 'resizeImage',
323
- ],
324
- styles: {
325
- options: [
326
- 'inline', 'alignLeft', 'alignRight',
327
- 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
328
- 'block', 'side'
329
- ]
330
- },
331
- resizeOptions: [{
332
- name: 'resizeImage:original',
333
- label: 'Original',
334
- value: null
335
- },
336
- {
337
- name: 'resizeImage:25',
338
- label: '25%',
339
- value: '25'
340
- },
341
- {
342
- name: 'resizeImage:50',
343
- label: '50%',
344
- value: '50'
345
- },
346
- {
347
- name: 'resizeImage:75',
348
- label: '75%',
349
- value: '75'
350
- }
351
- ],
352
- },
353
- };
354
- var standard = {
355
- toolbar: {
356
- items: [
357
- 'undo',
358
- 'redo',
359
- '|',
360
- 'heading',
361
- '|',
362
- 'fontSize',
363
- 'fontFamily',
364
- 'fontColor',
365
- 'fontBackgroundColor',
366
- '|',
367
- 'bold',
368
- 'italic',
369
- 'underline',
370
- 'strikethrough',
371
- '|',
372
- 'link',
373
- 'insertImage',
374
- 'insertTable',
375
- '|',
376
- 'alignment',
377
- '|',
378
- 'bulletedList',
379
- 'numberedList',
380
- ],
381
- shouldNotGroupWhenFull: false,
382
- },
383
- plugins: [],
384
- fontSize: {
385
- options: [10, 12, 14, 'default', 18, 20, 22, 24, 26, 28, 30, 32],
386
- supportAllValues: true,
387
- },
388
- heading: {
389
- options: [
390
- {
391
- model: 'paragraph',
392
- title: 'Paragraph',
393
- class: 'ck-heading_paragraph',
394
- },
395
- {
396
- model: 'heading1',
397
- view: 'h1',
398
- title: 'Heading 1',
399
- class: 'ck-heading_heading1',
400
- },
401
- {
402
- model: 'heading2',
403
- view: 'h2',
404
- title: 'Heading 2',
405
- class: 'ck-heading_heading2',
406
- },
407
- {
408
- model: 'heading3',
409
- view: 'h3',
410
- title: 'Heading 3',
411
- class: 'ck-heading_heading3',
412
- },
413
- {
414
- model: 'heading4',
415
- view: 'h4',
416
- title: 'Heading 4',
417
- class: 'ck-heading_heading4',
418
- },
419
- {
420
- model: 'heading5',
421
- view: 'h5',
422
- title: 'Heading 5',
423
- class: 'ck-heading_heading5',
424
- },
425
- {
426
- model: 'heading6',
427
- view: 'h6',
428
- title: 'Heading 6',
429
- class: 'ck-heading_heading6',
430
- },
431
- ],
432
- },
433
- htmlSupport: {
434
- allow: [
435
- {
436
- name: /^.*$/,
437
- styles: true,
438
- attributes: true,
439
- classes: true,
440
- },
441
- ],
442
- },
443
- image: {
444
- toolbar: [
445
- 'toggleImageCaption',
446
- 'imageTextAlternative',
447
- '|',
448
- 'imageStyle:inline',
449
- 'imageStyle:wrapText',
450
- 'imageStyle:breakText',
451
- '|',
452
- 'resizeImage',
453
- ],
454
- styles: {
455
- options: [
456
- 'inline', 'alignLeft', 'alignRight',
457
- 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
458
- 'block', 'side'
459
- ]
460
- },
461
- resizeOptions: [{
462
- name: 'resizeImage:original',
463
- label: 'Original',
464
- value: null
465
- },
466
- {
467
- name: 'resizeImage:25',
468
- label: '25%',
469
- value: '25'
470
- },
471
- {
472
- name: 'resizeImage:50',
473
- label: '50%',
474
- value: '50'
475
- },
476
- {
477
- name: 'resizeImage:75',
478
- label: '75%',
479
- value: '75'
480
- }
481
- ],
482
- },
483
- link: {
484
- addTargetToExternalLinks: true,
485
- defaultProtocol: 'https://',
486
- decorators: {
487
- toggleDownloadable: {
488
- mode: 'manual',
489
- label: 'Downloadable',
490
- attributes: {
491
- download: 'file',
492
- },
493
- },
494
- },
495
- },
496
- list: {
497
- properties: {
498
- styles: true,
499
- startIndex: true,
500
- reversed: true,
501
- },
502
- },
503
- style: {
504
- definitions: [
505
- {
506
- name: 'Article category',
507
- element: 'h3',
508
- classes: ['category'],
509
- },
510
- {
511
- name: 'Title',
512
- element: 'h2',
513
- classes: ['document-title'],
514
- },
515
- {
516
- name: 'Subtitle',
517
- element: 'h3',
518
- classes: ['document-subtitle'],
519
- },
520
- {
521
- name: 'Info box',
522
- element: 'p',
523
- classes: ['info-box'],
524
- },
525
- {
526
- name: 'Side quote',
527
- element: 'blockquote',
528
- classes: ['side-quote'],
529
- },
530
- {
531
- name: 'Marker',
532
- element: 'span',
533
- classes: ['marker'],
534
- },
535
- {
536
- name: 'Spoiler',
537
- element: 'span',
538
- classes: ['spoiler'],
539
- },
540
- {
541
- name: 'Code (dark)',
542
- element: 'pre',
543
- classes: ['fancy-code', 'fancy-code-dark'],
544
- },
545
- {
546
- name: 'Code (bright)',
547
- element: 'pre',
548
- classes: ['fancy-code', 'fancy-code-bright'],
549
- },
550
- ],
551
- },
552
- table: {
553
- contentToolbar: [
554
- 'tableColumn',
555
- 'tableRow',
556
- 'mergeTableCells',
557
- 'tableProperties',
558
- 'tableCellProperties',
559
- ],
560
- },
561
- };
562
- 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 = {
563
575
  toolbar: {
564
576
  items: [
565
577
  'undo',
@@ -782,10 +794,10 @@ var full = {
782
794
  },
783
795
  };
784
796
  var CkEditorTypesObject = {
785
- default: defaults,
786
- easy: easy,
787
- standard: standard,
788
- full: full
797
+ // default: defaults,
798
+ Simple: Simple,
799
+ // standard: standard,
800
+ Classic: Classic
789
801
  };
790
802
 
791
803
  var LanguagesMap;
@@ -810,12 +822,13 @@ var LanguagesMap;
810
822
  LanguagesMap["vi"] = "vi";
811
823
  })(LanguagesMap || (LanguagesMap = {}));
812
824
 
825
+ // import { CkEditorModeEnum } from '../enums/ck-editor-mode-enum';
813
826
  class SetCkEditorConfigsService {
814
827
  constructor() { }
815
828
  async get(input) {
816
- let { language } = input;
829
+ let { language, type } = input;
817
830
  return new Promise(async (resolve, rejects) => {
818
- let configs = CkEditorTypesObject['easy'];
831
+ let configs = CkEditorTypesObject[CkEditorModeEnum[type]];
819
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');
820
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];
821
834
  configs.language = LanguagesMap[language];
@@ -841,6 +854,7 @@ class CkEditorControlComponent {
841
854
  this.ckEditorValue = '';
842
855
  /**系统语言 */
843
856
  this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
857
+ this.CkEditorModeEnum = CkEditorModeEnum;
844
858
  this.fb = inject(FormBuilder);
845
859
  /**字段配置列表 */
846
860
  this._fields = '';
@@ -851,7 +865,6 @@ class CkEditorControlComponent {
851
865
  this.invalidfeedback = false;
852
866
  /**图片容器名称 */
853
867
  this.imagesContainerName = '';
854
- this.loadckeditor();
855
868
  }
856
869
  onReady(editor) {
857
870
  let _this = this;
@@ -890,18 +903,35 @@ class CkEditorControlComponent {
890
903
  this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
891
904
  this.setckeditorInput(this.ckEditorValue);
892
905
  this.cdr.detectChanges(); // 手动触发变更检测
906
+ await this.loadckeditor();
893
907
  this.submitclick?.nativeElement?.click();
894
908
  }
895
909
  }
896
910
  loadckeditor() {
897
911
  let _that = this;
912
+ let formConfiguration = this._fields.field.formConfiguration;
898
913
  return new Promise(async (resolve) => {
899
914
  await import('ckeditor5').then(async (res) => {
900
915
  this.loadStyle();
901
- _that.Editor = res.ClassicEditor;
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
+ }
902
926
  let configs = await _that._SetCkEditorConfigsService.get({
903
927
  language: _that.currentCulture,
928
+ type: formConfiguration['Ckeditor.Mode']
904
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
+ }
905
935
  _that.ckOptions = configs;
906
936
  });
907
937
  resolve(true);
@@ -928,18 +958,15 @@ class CkEditorControlComponent {
928
958
  this.extraProperties.setControl(this._fields.field.name, newControl);
929
959
  this.imagesContainerName =
930
960
  this._fields.field.formConfiguration['Ckeditor.ImagesContainerName'];
931
- if (!this.imagesContainerName) {
932
- this.ckOptions?.toolbar?.items?.splice(this.ckOptions?.toolbar?.items?.indexOf('insertImage'), 1);
933
- }
934
961
  resolve(true);
935
962
  });
936
963
  }
937
964
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
938
- 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\n <ckeditor [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: [""], 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: 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: i2.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"] }] }); }
939
966
  }
940
967
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, decorators: [{
941
968
  type: Component,
942
- 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\n <ckeditor [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>" }]
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"] }]
943
970
  }], ctorParameters: () => [], propDecorators: { fields: [{
944
971
  type: Input
945
972
  }], parentFiledName: [{
@@ -1070,5 +1097,5 @@ class isBase64UploadAdapter {
1070
1097
  * Generated bundle index. Do not edit.
1071
1098
  */
1072
1099
 
1073
- export { AddFieldControlGroup, CkEditorModule, SetCkEditorConfigsService, ckEditorFieldControlGroup, getExcludeAssignControl, isBase64UploadAdapter };
1100
+ export { AddFieldControlGroup, CkEditorModeEnum, CkEditorModeEnumOptions, CkEditorModule, SetCkEditorConfigsService, ckEditorFieldControlGroup, getExcludeAssignControl, isBase64UploadAdapter };
1074
1101
  //# sourceMappingURL=dignite-ng-expand.ck-editor.mjs.map