@dignite-ng/expand.ck-editor 3.0.0-rc.4 → 3.0.0-rc.40
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 +19 -14
- 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 +23 -23
- package/esm2022/lib/services/index.mjs +1 -1
- package/esm2022/lib/services/set-ck-editor-configs.service.mjs +6 -4
- 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 +96 -50
- 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/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,7 +7,7 @@ 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
12
|
import * as i4$1 from '@ckeditor/ckeditor5-angular';
|
|
13
13
|
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
|
|
@@ -26,10 +26,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
26
26
|
}]
|
|
27
27
|
}] });
|
|
28
28
|
|
|
29
|
+
var CkEditorModeEnum;
|
|
30
|
+
(function (CkEditorModeEnum) {
|
|
31
|
+
CkEditorModeEnum[CkEditorModeEnum["Simple"] = 0] = "Simple";
|
|
32
|
+
CkEditorModeEnum[CkEditorModeEnum["Classic"] = 1] = "Classic";
|
|
33
|
+
})(CkEditorModeEnum || (CkEditorModeEnum = {}));
|
|
34
|
+
const CkEditorModeEnumOptions = mapEnumToOptions(CkEditorModeEnum);
|
|
35
|
+
|
|
29
36
|
class CkEditorConfig {
|
|
30
37
|
constructor(data) {
|
|
31
38
|
/**类型 */
|
|
32
|
-
this['Ckeditor.Mode'] = [
|
|
39
|
+
this['Ckeditor.Mode'] = [CkEditorModeEnum.Simple, []];
|
|
33
40
|
/**文件容器名称 */
|
|
34
41
|
// placeholder: any = new FormControl('', Validators.required);
|
|
35
42
|
this['Ckeditor.ImagesContainerName'] = ['', []];
|
|
@@ -46,13 +53,7 @@ class CkEditorConfig {
|
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
|
|
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
|
-
|
|
56
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
56
57
|
class CkEditorConfigComponent {
|
|
57
58
|
constructor(fb) {
|
|
58
59
|
this.fb = fb;
|
|
@@ -95,7 +96,7 @@ class CkEditorConfigComponent {
|
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
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:
|
|
99
|
+
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
|
}
|
|
100
101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
|
|
101
102
|
type: Component,
|
|
@@ -162,6 +163,7 @@ let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
|
|
|
162
163
|
}
|
|
163
164
|
};
|
|
164
165
|
|
|
166
|
+
/* eslint-disable no-var */
|
|
165
167
|
var Simple = {
|
|
166
168
|
toolbar: {
|
|
167
169
|
items: [
|
|
@@ -174,7 +176,10 @@ var Simple = {
|
|
|
174
176
|
'bold',
|
|
175
177
|
'italic',
|
|
176
178
|
'underline',
|
|
177
|
-
'insertImage'
|
|
179
|
+
'insertImage',
|
|
180
|
+
'|',
|
|
181
|
+
'bulletedList',
|
|
182
|
+
'numberedList',
|
|
178
183
|
],
|
|
179
184
|
shouldNotGroupWhenFull: false,
|
|
180
185
|
},
|
|
@@ -664,16 +669,6 @@ var Classic = {
|
|
|
664
669
|
},
|
|
665
670
|
],
|
|
666
671
|
},
|
|
667
|
-
htmlSupport: {
|
|
668
|
-
allow: [
|
|
669
|
-
{
|
|
670
|
-
name: /^.*$/,
|
|
671
|
-
styles: true,
|
|
672
|
-
attributes: true,
|
|
673
|
-
classes: true,
|
|
674
|
-
},
|
|
675
|
-
],
|
|
676
|
-
},
|
|
677
672
|
image: {
|
|
678
673
|
toolbar: [
|
|
679
674
|
'toggleImageCaption',
|
|
@@ -687,31 +682,37 @@ var Classic = {
|
|
|
687
682
|
],
|
|
688
683
|
styles: {
|
|
689
684
|
options: [
|
|
690
|
-
'inline',
|
|
691
|
-
'
|
|
692
|
-
'
|
|
693
|
-
|
|
685
|
+
'inline',
|
|
686
|
+
'alignLeft',
|
|
687
|
+
'alignRight',
|
|
688
|
+
'alignCenter',
|
|
689
|
+
'alignBlockLeft',
|
|
690
|
+
'alignBlockRight',
|
|
691
|
+
'block',
|
|
692
|
+
'side',
|
|
693
|
+
],
|
|
694
694
|
},
|
|
695
|
-
resizeOptions: [
|
|
695
|
+
resizeOptions: [
|
|
696
|
+
{
|
|
696
697
|
name: 'resizeImage:original',
|
|
697
698
|
label: 'Original',
|
|
698
|
-
value: null
|
|
699
|
+
value: null,
|
|
699
700
|
},
|
|
700
701
|
{
|
|
701
702
|
name: 'resizeImage:25',
|
|
702
703
|
label: '25%',
|
|
703
|
-
value: '25'
|
|
704
|
+
value: '25',
|
|
704
705
|
},
|
|
705
706
|
{
|
|
706
707
|
name: 'resizeImage:50',
|
|
707
708
|
label: '50%',
|
|
708
|
-
value: '50'
|
|
709
|
+
value: '50',
|
|
709
710
|
},
|
|
710
711
|
{
|
|
711
712
|
name: 'resizeImage:75',
|
|
712
713
|
label: '75%',
|
|
713
|
-
value: '75'
|
|
714
|
-
}
|
|
714
|
+
value: '75',
|
|
715
|
+
},
|
|
715
716
|
],
|
|
716
717
|
},
|
|
717
718
|
link: {
|
|
@@ -797,7 +798,7 @@ var CkEditorTypesObject = {
|
|
|
797
798
|
// default: defaults,
|
|
798
799
|
Simple: Simple,
|
|
799
800
|
// standard: standard,
|
|
800
|
-
Classic: Classic
|
|
801
|
+
Classic: Classic,
|
|
801
802
|
};
|
|
802
803
|
|
|
803
804
|
var LanguagesMap;
|
|
@@ -822,16 +823,18 @@ var LanguagesMap;
|
|
|
822
823
|
LanguagesMap["vi"] = "vi";
|
|
823
824
|
})(LanguagesMap || (LanguagesMap = {}));
|
|
824
825
|
|
|
826
|
+
/* eslint-disable no-async-promise-executor */
|
|
825
827
|
// import { CkEditorModeEnum } from '../enums/ck-editor-mode-enum';
|
|
826
828
|
class SetCkEditorConfigsService {
|
|
827
829
|
constructor() { }
|
|
828
830
|
async get(input) {
|
|
829
|
-
|
|
831
|
+
const { language, type } = input;
|
|
830
832
|
return new Promise(async (resolve, rejects) => {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
+
const configs = CkEditorTypesObject[CkEditorModeEnum[type]];
|
|
834
|
+
const { 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
835
|
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
836
|
configs.language = LanguagesMap[language];
|
|
837
|
+
configs.forcePasteAsPlainText = true;
|
|
835
838
|
await import(`@ckeditor/ckeditor5-build-decoupled-document/build/translations/${LanguagesMap[language]}`);
|
|
836
839
|
resolve(configs);
|
|
837
840
|
});
|
|
@@ -846,6 +849,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
846
849
|
}]
|
|
847
850
|
}], ctorParameters: () => [] });
|
|
848
851
|
|
|
852
|
+
/* eslint-disable no-async-promise-executor */
|
|
853
|
+
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
854
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
849
855
|
class CkEditorControlComponent {
|
|
850
856
|
constructor() {
|
|
851
857
|
this.config = inject(ConfigStateService);
|
|
@@ -867,7 +873,7 @@ class CkEditorControlComponent {
|
|
|
867
873
|
this.imagesContainerName = '';
|
|
868
874
|
}
|
|
869
875
|
onReady(editor) {
|
|
870
|
-
|
|
876
|
+
const _this = this;
|
|
871
877
|
editor.plugins.get('FileRepository').createUploadAdapter = function (loader) {
|
|
872
878
|
return new isBase64UploadAdapter$1(loader, _this.imagesContainerName, _this._restService);
|
|
873
879
|
};
|
|
@@ -890,7 +896,7 @@ class CkEditorControlComponent {
|
|
|
890
896
|
this.dataLoaded();
|
|
891
897
|
}
|
|
892
898
|
get extraProperties() {
|
|
893
|
-
return this._entity
|
|
899
|
+
return this._entity?.get('extraProperties');
|
|
894
900
|
}
|
|
895
901
|
get ckeditorInput() {
|
|
896
902
|
return this.extraProperties.get(this._fields.field.name);
|
|
@@ -902,14 +908,14 @@ class CkEditorControlComponent {
|
|
|
902
908
|
this.ckEditorValue =
|
|
903
909
|
this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
|
|
904
910
|
this.setckeditorInput(this.ckEditorValue);
|
|
905
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
911
|
+
// this.cdr.detectChanges(); // 手动触发变更检测
|
|
906
912
|
await this.loadckeditor();
|
|
907
|
-
this.submitclick?.nativeElement?.click();
|
|
913
|
+
// this.submitclick?.nativeElement?.click();
|
|
908
914
|
}
|
|
909
915
|
}
|
|
910
916
|
loadckeditor() {
|
|
911
|
-
|
|
912
|
-
|
|
917
|
+
const _that = this;
|
|
918
|
+
const formConfiguration = this._fields.field.formConfiguration;
|
|
913
919
|
return new Promise(async (resolve) => {
|
|
914
920
|
await import('ckeditor5').then(async (res) => {
|
|
915
921
|
this.loadStyle();
|
|
@@ -923,12 +929,14 @@ class CkEditorControlComponent {
|
|
|
923
929
|
formConfiguration['Ckeditor.Mode'] = CkEditorModeEnum.Simple;
|
|
924
930
|
_that.Editor = res.InlineEditor;
|
|
925
931
|
}
|
|
926
|
-
|
|
932
|
+
const configs = await _that._SetCkEditorConfigsService.get({
|
|
927
933
|
language: _that.currentCulture,
|
|
928
934
|
type: formConfiguration['Ckeditor.Mode']
|
|
929
935
|
});
|
|
930
936
|
if (!this.imagesContainerName) {
|
|
931
|
-
|
|
937
|
+
if (configs?.toolbar?.items?.indexOf('insertImage') != -1) {
|
|
938
|
+
configs?.toolbar?.items?.splice(configs?.toolbar?.items?.indexOf('insertImage'), 1);
|
|
939
|
+
}
|
|
932
940
|
}
|
|
933
941
|
_that.ckOptions = configs;
|
|
934
942
|
});
|
|
@@ -946,11 +954,11 @@ class CkEditorControlComponent {
|
|
|
946
954
|
}
|
|
947
955
|
AfterInit() {
|
|
948
956
|
return new Promise(resolve => {
|
|
949
|
-
|
|
957
|
+
const ValidatorsArray = [];
|
|
950
958
|
if (this._fields.required) {
|
|
951
959
|
ValidatorsArray.push(Validators.required);
|
|
952
960
|
}
|
|
953
|
-
|
|
961
|
+
const newControl = this.fb.control(this._selected
|
|
954
962
|
? this._selected
|
|
955
963
|
: this._fields.field.formConfiguration['Ckeditor.InitialContent'], ValidatorsArray);
|
|
956
964
|
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
@@ -960,11 +968,11 @@ class CkEditorControlComponent {
|
|
|
960
968
|
});
|
|
961
969
|
}
|
|
962
970
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
963
|
-
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: "<
|
|
971
|
+
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\";: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.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"] }] }); }
|
|
964
972
|
}
|
|
965
973
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, decorators: [{
|
|
966
974
|
type: Component,
|
|
967
|
-
args: [{ selector: 'ck-editor-control', template: "<
|
|
975
|
+
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\";: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"] }]
|
|
968
976
|
}], ctorParameters: () => [], propDecorators: { fields: [{
|
|
969
977
|
type: Input
|
|
970
978
|
}], parentFiledName: [{
|
|
@@ -978,6 +986,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
978
986
|
args: ['submitclick', { static: true }]
|
|
979
987
|
}] } });
|
|
980
988
|
|
|
989
|
+
class CkEditorViewComponent {
|
|
990
|
+
constructor() {
|
|
991
|
+
/**展示则内容 */
|
|
992
|
+
this.showValue = '';
|
|
993
|
+
/**是否显示再列表 */
|
|
994
|
+
this.showInList = false;
|
|
995
|
+
/**表单控件Value */
|
|
996
|
+
this._value = '';
|
|
997
|
+
}
|
|
998
|
+
set value(v) {
|
|
999
|
+
this._value = v;
|
|
1000
|
+
}
|
|
1001
|
+
async ngAfterContentInit() {
|
|
1002
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1003
|
+
//Add 'implements AfterContentInit' to the class.
|
|
1004
|
+
let valueOptions = this._value;
|
|
1005
|
+
if (this.type && valueOptions) {
|
|
1006
|
+
this.showValue = valueOptions;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1010
|
+
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"] }] }); }
|
|
1011
|
+
}
|
|
1012
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorViewComponent, decorators: [{
|
|
1013
|
+
type: Component,
|
|
1014
|
+
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 }" }]
|
|
1015
|
+
}], propDecorators: { showInList: [{
|
|
1016
|
+
type: Input
|
|
1017
|
+
}], fields: [{
|
|
1018
|
+
type: Input
|
|
1019
|
+
}], type: [{
|
|
1020
|
+
type: Input
|
|
1021
|
+
}], value: [{
|
|
1022
|
+
type: Input
|
|
1023
|
+
}] } });
|
|
1024
|
+
|
|
981
1025
|
/**
|
|
982
1026
|
* 表单控件分组-包含配置,控件,显示的数组
|
|
983
1027
|
*/
|
|
@@ -987,7 +1031,7 @@ const ckEditorFieldControlGroup = [
|
|
|
987
1031
|
name: 'CkEditor',
|
|
988
1032
|
fieldConfigComponent: CkEditorConfigComponent,
|
|
989
1033
|
fieldComponent: CkEditorControlComponent,
|
|
990
|
-
|
|
1034
|
+
fieldViewComponent: CkEditorViewComponent,
|
|
991
1035
|
},
|
|
992
1036
|
];
|
|
993
1037
|
function getExcludeAssignControl(typeName) {
|
|
@@ -1001,7 +1045,8 @@ function AddFieldControlGroup(array = []) {
|
|
|
1001
1045
|
class CkEditorModule {
|
|
1002
1046
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1003
1047
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, declarations: [CkEditorControlComponent,
|
|
1004
|
-
CkEditorConfigComponent
|
|
1048
|
+
CkEditorConfigComponent,
|
|
1049
|
+
CkEditorViewComponent], imports: [CoreModule,
|
|
1005
1050
|
ThemeSharedModule,
|
|
1006
1051
|
CkEditorRoutingModule,
|
|
1007
1052
|
CKEditorModule] }); }
|
|
@@ -1016,6 +1061,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1016
1061
|
declarations: [
|
|
1017
1062
|
CkEditorControlComponent,
|
|
1018
1063
|
CkEditorConfigComponent,
|
|
1064
|
+
CkEditorViewComponent,
|
|
1019
1065
|
],
|
|
1020
1066
|
imports: [
|
|
1021
1067
|
CoreModule,
|