@dignite-ng/expand.ck-editor 3.0.0-rc.5 → 3.0.0-rc.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -13
- package/esm2022/config/ck-editor-config.module.mjs +1 -1
- package/esm2022/config/dignite-ng-expand.ck-editor-config.mjs +1 -1
- package/esm2022/config/enums/index.mjs +1 -1
- package/esm2022/config/enums/route-names.mjs +1 -1
- package/esm2022/config/providers/index.mjs +1 -1
- package/esm2022/config/providers/route.provider.mjs +1 -1
- package/esm2022/config/public-api.mjs +1 -1
- package/esm2022/dignite-ng-expand.ck-editor.mjs +1 -1
- package/esm2022/lib/adapter/ckEditorUpload.mjs +1 -1
- package/esm2022/lib/adapter/index.mjs +1 -1
- package/esm2022/lib/ck-editor-routing.module.mjs +1 -1
- package/esm2022/lib/ck-editor.module.mjs +5 -2
- package/esm2022/lib/dynamic-form/ck-editor/ck-editor-config.component.mjs +4 -2
- package/esm2022/lib/dynamic-form/ck-editor/ck-editor-config.mjs +3 -2
- package/esm2022/lib/dynamic-form/ck-editor/ck-editor-control.component.mjs +16 -13
- package/esm2022/lib/dynamic-form/ck-editor/ck-editor-view.component.mjs +39 -0
- package/esm2022/lib/dynamic-form/ck-editor/ckEditorUpload.mjs +1 -1
- package/esm2022/lib/dynamic-form/ck-editor/index.mjs +2 -1
- package/esm2022/lib/dynamic-form/form-control-group.mjs +3 -2
- package/esm2022/lib/dynamic-form/index.mjs +1 -1
- package/esm2022/lib/enums/ck-editor-mode.enum.mjs +1 -1
- package/esm2022/lib/enums/languages-map.mjs +1 -1
- package/esm2022/lib/interfaces/form-config-interfaces.mjs +1 -1
- package/esm2022/lib/interfaces/index.mjs +1 -1
- package/esm2022/lib/object/ck-editor-object.mjs +68 -374
- package/esm2022/lib/services/index.mjs +1 -1
- package/esm2022/lib/services/set-ck-editor-configs.service.mjs +74 -7
- package/esm2022/public-api.mjs +1 -1
- package/fesm2022/dignite-ng-expand.ck-editor-config.mjs.map +1 -1
- package/fesm2022/dignite-ng-expand.ck-editor.mjs +206 -403
- package/fesm2022/dignite-ng-expand.ck-editor.mjs.map +1 -1
- package/lib/ck-editor.module.d.ts +6 -5
- package/lib/dynamic-form/ck-editor/ck-editor-view.component.d.ts +17 -0
- package/lib/dynamic-form/ck-editor/index.d.ts +1 -0
- package/lib/services/set-ck-editor-configs.service.d.ts +0 -1
- package/package.json +12 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule, inject, ChangeDetectorRef,
|
|
2
|
+
import { NgModule, inject, ChangeDetectorRef, ViewChild, Input, Component, Injectable } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
4
|
import { RouterModule } from '@angular/router';
|
|
5
5
|
import * as i3 from '@abp/ng.core';
|
|
@@ -7,8 +7,9 @@ import { mapEnumToOptions, ConfigStateService, RestService, LazyLoadService, Sub
|
|
|
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
|
|
10
|
+
import * as i1$2 from '@angular/common';
|
|
11
11
|
import * as i4 from '@ngx-validate/core';
|
|
12
|
+
import { PasteFromMarkdownExperimental } from 'ckeditor5';
|
|
12
13
|
import * as i4$1 from '@ckeditor/ckeditor5-angular';
|
|
13
14
|
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
|
|
14
15
|
|
|
@@ -26,10 +27,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
26
27
|
}]
|
|
27
28
|
}] });
|
|
28
29
|
|
|
30
|
+
var CkEditorModeEnum;
|
|
31
|
+
(function (CkEditorModeEnum) {
|
|
32
|
+
CkEditorModeEnum[CkEditorModeEnum["Simple"] = 0] = "Simple";
|
|
33
|
+
CkEditorModeEnum[CkEditorModeEnum["Classic"] = 1] = "Classic";
|
|
34
|
+
})(CkEditorModeEnum || (CkEditorModeEnum = {}));
|
|
35
|
+
const CkEditorModeEnumOptions = mapEnumToOptions(CkEditorModeEnum);
|
|
36
|
+
|
|
29
37
|
class CkEditorConfig {
|
|
30
38
|
constructor(data) {
|
|
31
39
|
/**类型 */
|
|
32
|
-
this['Ckeditor.Mode'] = [
|
|
40
|
+
this['Ckeditor.Mode'] = [CkEditorModeEnum.Simple, []];
|
|
33
41
|
/**文件容器名称 */
|
|
34
42
|
// placeholder: any = new FormControl('', Validators.required);
|
|
35
43
|
this['Ckeditor.ImagesContainerName'] = ['', []];
|
|
@@ -46,13 +54,7 @@ class CkEditorConfig {
|
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
(function (CkEditorModeEnum) {
|
|
51
|
-
CkEditorModeEnum[CkEditorModeEnum["Simple"] = 0] = "Simple";
|
|
52
|
-
CkEditorModeEnum[CkEditorModeEnum["Classic"] = 1] = "Classic";
|
|
53
|
-
})(CkEditorModeEnum || (CkEditorModeEnum = {}));
|
|
54
|
-
const CkEditorModeEnumOptions = mapEnumToOptions(CkEditorModeEnum);
|
|
55
|
-
|
|
57
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
56
58
|
class CkEditorConfigComponent {
|
|
57
59
|
constructor(fb) {
|
|
58
60
|
this.fb = fb;
|
|
@@ -95,7 +97,7 @@ class CkEditorConfigComponent {
|
|
|
95
97
|
});
|
|
96
98
|
}
|
|
97
99
|
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:
|
|
100
|
+
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
101
|
}
|
|
100
102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
|
|
101
103
|
type: Component,
|
|
@@ -162,6 +164,7 @@ let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
|
|
|
162
164
|
}
|
|
163
165
|
};
|
|
164
166
|
|
|
167
|
+
/* eslint-disable no-var */
|
|
165
168
|
var Simple = {
|
|
166
169
|
toolbar: {
|
|
167
170
|
items: [
|
|
@@ -174,7 +177,12 @@ var Simple = {
|
|
|
174
177
|
'bold',
|
|
175
178
|
'italic',
|
|
176
179
|
'underline',
|
|
177
|
-
'insertImage'
|
|
180
|
+
'insertImage',
|
|
181
|
+
'|',
|
|
182
|
+
'bulletedList',
|
|
183
|
+
'numberedList',
|
|
184
|
+
'|',
|
|
185
|
+
'removeFormat',
|
|
178
186
|
],
|
|
179
187
|
shouldNotGroupWhenFull: false,
|
|
180
188
|
},
|
|
@@ -238,339 +246,6 @@ var Simple = {
|
|
|
238
246
|
},
|
|
239
247
|
},
|
|
240
248
|
};
|
|
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
249
|
var Classic = {
|
|
575
250
|
toolbar: {
|
|
576
251
|
items: [
|
|
@@ -579,38 +254,28 @@ var Classic = {
|
|
|
579
254
|
'|',
|
|
580
255
|
'heading',
|
|
581
256
|
'|',
|
|
582
|
-
'fontSize',
|
|
583
|
-
'fontFamily',
|
|
584
|
-
'fontColor',
|
|
585
|
-
'fontBackgroundColor',
|
|
586
|
-
'|',
|
|
587
257
|
'bold',
|
|
588
258
|
'italic',
|
|
589
259
|
'underline',
|
|
590
|
-
'strikethrough',
|
|
591
|
-
'subscript',
|
|
592
|
-
'link',
|
|
593
260
|
'|',
|
|
594
|
-
'
|
|
261
|
+
'link',
|
|
262
|
+
'uploadImage',
|
|
263
|
+
// 'ckbox',
|
|
264
|
+
'insertTable',
|
|
595
265
|
'blockQuote',
|
|
596
|
-
'|',
|
|
597
|
-
'superscript',
|
|
598
|
-
'code',
|
|
599
|
-
'removeFormat',
|
|
600
|
-
'|',
|
|
601
|
-
'insertImage',
|
|
602
266
|
'mediaEmbed',
|
|
603
|
-
'insertTable',
|
|
604
267
|
'|',
|
|
605
|
-
'alignment',
|
|
606
268
|
'bulletedList',
|
|
607
269
|
'numberedList',
|
|
608
|
-
'
|
|
270
|
+
'|',
|
|
609
271
|
'outdent',
|
|
610
272
|
'indent',
|
|
273
|
+
'|',
|
|
274
|
+
'removeFormat',
|
|
611
275
|
],
|
|
612
276
|
shouldNotGroupWhenFull: false,
|
|
613
277
|
},
|
|
278
|
+
pasteFromWordRemoveStyles: true,
|
|
614
279
|
plugins: [],
|
|
615
280
|
fontFamily: {
|
|
616
281
|
supportAllValues: true,
|
|
@@ -664,16 +329,6 @@ var Classic = {
|
|
|
664
329
|
},
|
|
665
330
|
],
|
|
666
331
|
},
|
|
667
|
-
htmlSupport: {
|
|
668
|
-
allow: [
|
|
669
|
-
{
|
|
670
|
-
name: /^.*$/,
|
|
671
|
-
styles: true,
|
|
672
|
-
attributes: true,
|
|
673
|
-
classes: true,
|
|
674
|
-
},
|
|
675
|
-
],
|
|
676
|
-
},
|
|
677
332
|
image: {
|
|
678
333
|
toolbar: [
|
|
679
334
|
'toggleImageCaption',
|
|
@@ -687,31 +342,37 @@ var Classic = {
|
|
|
687
342
|
],
|
|
688
343
|
styles: {
|
|
689
344
|
options: [
|
|
690
|
-
'inline',
|
|
691
|
-
'
|
|
692
|
-
'
|
|
693
|
-
|
|
345
|
+
'inline',
|
|
346
|
+
'alignLeft',
|
|
347
|
+
'alignRight',
|
|
348
|
+
'alignCenter',
|
|
349
|
+
'alignBlockLeft',
|
|
350
|
+
'alignBlockRight',
|
|
351
|
+
'block',
|
|
352
|
+
'side',
|
|
353
|
+
],
|
|
694
354
|
},
|
|
695
|
-
resizeOptions: [
|
|
355
|
+
resizeOptions: [
|
|
356
|
+
{
|
|
696
357
|
name: 'resizeImage:original',
|
|
697
358
|
label: 'Original',
|
|
698
|
-
value: null
|
|
359
|
+
value: null,
|
|
699
360
|
},
|
|
700
361
|
{
|
|
701
362
|
name: 'resizeImage:25',
|
|
702
363
|
label: '25%',
|
|
703
|
-
value: '25'
|
|
364
|
+
value: '25',
|
|
704
365
|
},
|
|
705
366
|
{
|
|
706
367
|
name: 'resizeImage:50',
|
|
707
368
|
label: '50%',
|
|
708
|
-
value: '50'
|
|
369
|
+
value: '50',
|
|
709
370
|
},
|
|
710
371
|
{
|
|
711
372
|
name: 'resizeImage:75',
|
|
712
373
|
label: '75%',
|
|
713
|
-
value: '75'
|
|
714
|
-
}
|
|
374
|
+
value: '75',
|
|
375
|
+
},
|
|
715
376
|
],
|
|
716
377
|
},
|
|
717
378
|
link: {
|
|
@@ -792,12 +453,47 @@ var Classic = {
|
|
|
792
453
|
'tableCellProperties',
|
|
793
454
|
],
|
|
794
455
|
},
|
|
456
|
+
// 配置粘贴行为,移除所有样式
|
|
457
|
+
clipboard: {
|
|
458
|
+
// 配置粘贴过滤器
|
|
459
|
+
copyFormatting: true,
|
|
460
|
+
// 启用纯文本粘贴模式,这将忽略HTML格式和样式
|
|
461
|
+
pastePlainText: true,
|
|
462
|
+
filter: {
|
|
463
|
+
// 只允许特定的标签,例如 p, ul, ol, li, br, strong, em 等基本标签
|
|
464
|
+
allowedContent: 'p ul ol li br em div;'
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
// // 配置粘贴时的内容处理
|
|
468
|
+
// htmlSupport: {
|
|
469
|
+
// allow: [
|
|
470
|
+
// {
|
|
471
|
+
// name: /^(p|h[1-6]|li|ul|ol)$/,
|
|
472
|
+
// attributes: true,
|
|
473
|
+
// classes: false,
|
|
474
|
+
// styles: false
|
|
475
|
+
// },
|
|
476
|
+
// {
|
|
477
|
+
// name: /^(strong|em|u|a|span)$/,
|
|
478
|
+
// attributes: {
|
|
479
|
+
// 'href': true
|
|
480
|
+
// },
|
|
481
|
+
// classes: false,
|
|
482
|
+
// styles: false
|
|
483
|
+
// }
|
|
484
|
+
// ]
|
|
485
|
+
// },
|
|
486
|
+
// // 配置粘贴插件
|
|
487
|
+
// pasteFromOffice: {
|
|
488
|
+
// // 启用从Office粘贴的功能,但会清理样式
|
|
489
|
+
// keepZeroMargins: false
|
|
490
|
+
// }
|
|
795
491
|
};
|
|
796
492
|
var CkEditorTypesObject = {
|
|
797
493
|
// default: defaults,
|
|
798
494
|
Simple: Simple,
|
|
799
495
|
// standard: standard,
|
|
800
|
-
Classic: Classic
|
|
496
|
+
Classic: Classic,
|
|
801
497
|
};
|
|
802
498
|
|
|
803
499
|
var LanguagesMap;
|
|
@@ -822,15 +518,81 @@ var LanguagesMap;
|
|
|
822
518
|
LanguagesMap["vi"] = "vi";
|
|
823
519
|
})(LanguagesMap || (LanguagesMap = {}));
|
|
824
520
|
|
|
521
|
+
/* eslint-disable no-async-promise-executor */
|
|
825
522
|
// import { CkEditorModeEnum } from '../enums/ck-editor-mode-enum';
|
|
826
523
|
class SetCkEditorConfigsService {
|
|
827
|
-
constructor() { }
|
|
828
524
|
async get(input) {
|
|
829
|
-
|
|
525
|
+
const { language, type } = input;
|
|
830
526
|
return new Promise(async (resolve, rejects) => {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
configs.plugins = [
|
|
527
|
+
const configs = CkEditorTypesObject[CkEditorModeEnum[type]];
|
|
528
|
+
const { AccessibilityHelp, Highlight, AutoLink, 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, Clipboard, } = await import('ckeditor5');
|
|
529
|
+
configs.plugins = [
|
|
530
|
+
PasteFromMarkdownExperimental,
|
|
531
|
+
Essentials,
|
|
532
|
+
Clipboard,
|
|
533
|
+
AccessibilityHelp,
|
|
534
|
+
Highlight,
|
|
535
|
+
Alignment,
|
|
536
|
+
Autoformat,
|
|
537
|
+
AutoImage,
|
|
538
|
+
Autosave,
|
|
539
|
+
Base64UploadAdapter,
|
|
540
|
+
BlockQuote,
|
|
541
|
+
Bold,
|
|
542
|
+
CloudServices,
|
|
543
|
+
Code,
|
|
544
|
+
Essentials,
|
|
545
|
+
// FontBackgroundColor,
|
|
546
|
+
// FontColor,
|
|
547
|
+
// FontFamily,
|
|
548
|
+
// FontSize,
|
|
549
|
+
GeneralHtmlSupport,
|
|
550
|
+
Heading,
|
|
551
|
+
HorizontalLine,
|
|
552
|
+
ImageBlock,
|
|
553
|
+
ImageCaption,
|
|
554
|
+
ImageInline,
|
|
555
|
+
ImageInsert,
|
|
556
|
+
ImageInsertViaUrl,
|
|
557
|
+
ImageResize,
|
|
558
|
+
ImageStyle,
|
|
559
|
+
ImageTextAlternative,
|
|
560
|
+
ImageToolbar,
|
|
561
|
+
ImageUpload,
|
|
562
|
+
Indent,
|
|
563
|
+
IndentBlock,
|
|
564
|
+
Italic,
|
|
565
|
+
Link,
|
|
566
|
+
LinkImage,
|
|
567
|
+
List,
|
|
568
|
+
ListProperties,
|
|
569
|
+
MediaEmbed,
|
|
570
|
+
Paragraph,
|
|
571
|
+
PasteFromOffice,
|
|
572
|
+
RemoveFormat,
|
|
573
|
+
SelectAll,
|
|
574
|
+
SpecialCharacters,
|
|
575
|
+
SpecialCharactersArrows,
|
|
576
|
+
SpecialCharactersCurrency,
|
|
577
|
+
SpecialCharactersEssentials,
|
|
578
|
+
SpecialCharactersLatin,
|
|
579
|
+
SpecialCharactersMathematical,
|
|
580
|
+
SpecialCharactersText,
|
|
581
|
+
Strikethrough,
|
|
582
|
+
Style,
|
|
583
|
+
Subscript,
|
|
584
|
+
Superscript,
|
|
585
|
+
Table,
|
|
586
|
+
TableCaption,
|
|
587
|
+
TableCellProperties,
|
|
588
|
+
TableColumnResize,
|
|
589
|
+
TableProperties,
|
|
590
|
+
TableToolbar,
|
|
591
|
+
TextTransformation,
|
|
592
|
+
TodoList,
|
|
593
|
+
Underline,
|
|
594
|
+
Undo,
|
|
595
|
+
];
|
|
834
596
|
configs.language = LanguagesMap[language];
|
|
835
597
|
await import(`@ckeditor/ckeditor5-build-decoupled-document/build/translations/${LanguagesMap[language]}`);
|
|
836
598
|
resolve(configs);
|
|
@@ -844,8 +606,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
844
606
|
args: [{
|
|
845
607
|
providedIn: 'root',
|
|
846
608
|
}]
|
|
847
|
-
}]
|
|
609
|
+
}] });
|
|
848
610
|
|
|
611
|
+
/* eslint-disable no-async-promise-executor */
|
|
612
|
+
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
613
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
849
614
|
class CkEditorControlComponent {
|
|
850
615
|
constructor() {
|
|
851
616
|
this.config = inject(ConfigStateService);
|
|
@@ -867,7 +632,7 @@ class CkEditorControlComponent {
|
|
|
867
632
|
this.imagesContainerName = '';
|
|
868
633
|
}
|
|
869
634
|
onReady(editor) {
|
|
870
|
-
|
|
635
|
+
const _this = this;
|
|
871
636
|
editor.plugins.get('FileRepository').createUploadAdapter = function (loader) {
|
|
872
637
|
return new isBase64UploadAdapter$1(loader, _this.imagesContainerName, _this._restService);
|
|
873
638
|
};
|
|
@@ -890,7 +655,7 @@ class CkEditorControlComponent {
|
|
|
890
655
|
this.dataLoaded();
|
|
891
656
|
}
|
|
892
657
|
get extraProperties() {
|
|
893
|
-
return this._entity
|
|
658
|
+
return this._entity?.get('extraProperties');
|
|
894
659
|
}
|
|
895
660
|
get ckeditorInput() {
|
|
896
661
|
return this.extraProperties.get(this._fields.field.name);
|
|
@@ -902,14 +667,14 @@ class CkEditorControlComponent {
|
|
|
902
667
|
this.ckEditorValue =
|
|
903
668
|
this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
|
|
904
669
|
this.setckeditorInput(this.ckEditorValue);
|
|
905
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
670
|
+
// this.cdr.detectChanges(); // 手动触发变更检测
|
|
906
671
|
await this.loadckeditor();
|
|
907
|
-
this.submitclick?.nativeElement?.click();
|
|
672
|
+
// this.submitclick?.nativeElement?.click();
|
|
908
673
|
}
|
|
909
674
|
}
|
|
910
675
|
loadckeditor() {
|
|
911
|
-
|
|
912
|
-
|
|
676
|
+
const _that = this;
|
|
677
|
+
const formConfiguration = this._fields.field.formConfiguration;
|
|
913
678
|
return new Promise(async (resolve) => {
|
|
914
679
|
await import('ckeditor5').then(async (res) => {
|
|
915
680
|
this.loadStyle();
|
|
@@ -923,7 +688,7 @@ class CkEditorControlComponent {
|
|
|
923
688
|
formConfiguration['Ckeditor.Mode'] = CkEditorModeEnum.Simple;
|
|
924
689
|
_that.Editor = res.InlineEditor;
|
|
925
690
|
}
|
|
926
|
-
|
|
691
|
+
const configs = await _that._SetCkEditorConfigsService.get({
|
|
927
692
|
language: _that.currentCulture,
|
|
928
693
|
type: formConfiguration['Ckeditor.Mode']
|
|
929
694
|
});
|
|
@@ -948,11 +713,11 @@ class CkEditorControlComponent {
|
|
|
948
713
|
}
|
|
949
714
|
AfterInit() {
|
|
950
715
|
return new Promise(resolve => {
|
|
951
|
-
|
|
716
|
+
const ValidatorsArray = [];
|
|
952
717
|
if (this._fields.required) {
|
|
953
718
|
ValidatorsArray.push(Validators.required);
|
|
954
719
|
}
|
|
955
|
-
|
|
720
|
+
const newControl = this.fb.control(this._selected
|
|
956
721
|
? this._selected
|
|
957
722
|
: this._fields.field.formConfiguration['Ckeditor.InitialContent'], ValidatorsArray);
|
|
958
723
|
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
@@ -962,11 +727,11 @@ class CkEditorControlComponent {
|
|
|
962
727
|
});
|
|
963
728
|
}
|
|
964
729
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
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: "<
|
|
730
|
+
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: "<div [formGroup]=\"_entity\" (keydown.enter)=\"$event.stopPropagation()\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\" (keydown.enter)=\"$event.stopPropagation()\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"ckOptions\">\n <ckeditor class=\"form-textarea\" #editor [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</div>\n", styles: ["@charset \"UTF-8\";::ng-deep .ck.ck-editor__editable_inline{min-height:160px!important;border-color:var(--ck-color-base-border)!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}\n"], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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"] }] }); }
|
|
966
731
|
}
|
|
967
732
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, decorators: [{
|
|
968
733
|
type: Component,
|
|
969
|
-
args: [{ selector: 'ck-editor-control', template: "<
|
|
734
|
+
args: [{ selector: 'ck-editor-control', template: "<div [formGroup]=\"_entity\" (keydown.enter)=\"$event.stopPropagation()\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\" (keydown.enter)=\"$event.stopPropagation()\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"ckOptions\">\n <ckeditor class=\"form-textarea\" #editor [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</div>\n", styles: ["@charset \"UTF-8\";::ng-deep .ck.ck-editor__editable_inline{min-height:160px!important;border-color:var(--ck-color-base-border)!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}\n"] }]
|
|
970
735
|
}], ctorParameters: () => [], propDecorators: { fields: [{
|
|
971
736
|
type: Input
|
|
972
737
|
}], parentFiledName: [{
|
|
@@ -980,6 +745,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
980
745
|
args: ['submitclick', { static: true }]
|
|
981
746
|
}] } });
|
|
982
747
|
|
|
748
|
+
class CkEditorViewComponent {
|
|
749
|
+
constructor() {
|
|
750
|
+
/**展示则内容 */
|
|
751
|
+
this.showValue = '';
|
|
752
|
+
/**是否显示再列表 */
|
|
753
|
+
this.showInList = false;
|
|
754
|
+
/**表单控件Value */
|
|
755
|
+
this._value = '';
|
|
756
|
+
}
|
|
757
|
+
set value(v) {
|
|
758
|
+
this._value = v;
|
|
759
|
+
}
|
|
760
|
+
async ngAfterContentInit() {
|
|
761
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
762
|
+
//Add 'implements AfterContentInit' to the class.
|
|
763
|
+
let valueOptions = this._value;
|
|
764
|
+
if (this.type && valueOptions) {
|
|
765
|
+
this.showValue = valueOptions;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
769
|
+
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"] }] }); }
|
|
770
|
+
}
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorViewComponent, decorators: [{
|
|
772
|
+
type: Component,
|
|
773
|
+
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 }" }]
|
|
774
|
+
}], propDecorators: { showInList: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], fields: [{
|
|
777
|
+
type: Input
|
|
778
|
+
}], type: [{
|
|
779
|
+
type: Input
|
|
780
|
+
}], value: [{
|
|
781
|
+
type: Input
|
|
782
|
+
}] } });
|
|
783
|
+
|
|
983
784
|
/**
|
|
984
785
|
* 表单控件分组-包含配置,控件,显示的数组
|
|
985
786
|
*/
|
|
@@ -989,7 +790,7 @@ const ckEditorFieldControlGroup = [
|
|
|
989
790
|
name: 'CkEditor',
|
|
990
791
|
fieldConfigComponent: CkEditorConfigComponent,
|
|
991
792
|
fieldComponent: CkEditorControlComponent,
|
|
992
|
-
|
|
793
|
+
fieldViewComponent: CkEditorViewComponent,
|
|
993
794
|
},
|
|
994
795
|
];
|
|
995
796
|
function getExcludeAssignControl(typeName) {
|
|
@@ -1003,7 +804,8 @@ function AddFieldControlGroup(array = []) {
|
|
|
1003
804
|
class CkEditorModule {
|
|
1004
805
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1005
806
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, declarations: [CkEditorControlComponent,
|
|
1006
|
-
CkEditorConfigComponent
|
|
807
|
+
CkEditorConfigComponent,
|
|
808
|
+
CkEditorViewComponent], imports: [CoreModule,
|
|
1007
809
|
ThemeSharedModule,
|
|
1008
810
|
CkEditorRoutingModule,
|
|
1009
811
|
CKEditorModule] }); }
|
|
@@ -1018,6 +820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1018
820
|
declarations: [
|
|
1019
821
|
CkEditorControlComponent,
|
|
1020
822
|
CkEditorConfigComponent,
|
|
823
|
+
CkEditorViewComponent,
|
|
1021
824
|
],
|
|
1022
825
|
imports: [
|
|
1023
826
|
CoreModule,
|