@dignite-ng/expand.ck-editor 3.0.0-rc.1 → 3.0.0-rc.3
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/esm2022/lib/ck-editor-routing.module.mjs +2 -6
- package/esm2022/lib/ck-editor.module.mjs +3 -14
- package/esm2022/lib/dynamic-form/ck-editor/ck-editor-config.component.mjs +5 -4
- package/esm2022/lib/dynamic-form/ck-editor/ck-editor-control.component.mjs +27 -20
- package/esm2022/lib/enums/languages-map.mjs +2 -2
- package/esm2022/lib/object/ck-editor-object.mjs +5 -277
- package/esm2022/lib/services/index.mjs +2 -0
- package/esm2022/lib/services/set-ck-editor-configs.service.mjs +27 -0
- package/esm2022/public-api.mjs +2 -5
- package/fesm2022/dignite-ng-expand.ck-editor.mjs +195 -521
- package/fesm2022/dignite-ng-expand.ck-editor.mjs.map +1 -1
- package/lib/ck-editor.module.d.ts +5 -7
- package/lib/dynamic-form/ck-editor/ck-editor-config.component.d.ts +1 -0
- package/lib/dynamic-form/ck-editor/ck-editor-control.component.d.ts +4 -5
- package/lib/enums/languages-map.d.ts +1 -1
- package/lib/object/ck-editor-object.d.ts +8 -27
- package/lib/services/index.d.ts +1 -0
- package/lib/services/set-ck-editor-configs.service.d.ts +7 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -4
- package/esm2022/lib/components/dome/ck-editor-dome.component.mjs +0 -84
- package/esm2022/lib/pipes/index.mjs +0 -2
- package/esm2022/lib/pipes/set-ckeditor-content.pipe.mjs +0 -25
- package/lib/components/dome/ck-editor-dome.component.d.ts +0 -26
- package/lib/pipes/index.d.ts +0 -1
- package/lib/pipes/set-ckeditor-content.pipe.d.ts +0 -8
|
@@ -1,35 +1,155 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
import * as i1
|
|
2
|
+
import { NgModule, inject, ChangeDetectorRef, Component, Input, ViewChild, Injectable } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/router';
|
|
4
4
|
import { RouterModule } from '@angular/router';
|
|
5
|
-
import
|
|
6
|
-
import '@
|
|
7
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/de-ch';
|
|
8
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/en-gb';
|
|
9
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/pt-br';
|
|
10
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/zh';
|
|
11
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/de';
|
|
12
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/ar';
|
|
13
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/cs';
|
|
14
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/hi';
|
|
15
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/fi';
|
|
16
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/hu';
|
|
17
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/fr';
|
|
18
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/it';
|
|
19
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/sk';
|
|
20
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/ja';
|
|
21
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/es';
|
|
22
|
-
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/vi';
|
|
23
|
-
import * as i2$1 from '@abp/ng.core';
|
|
24
|
-
import { ConfigStateService, LazyLoadService, SubscriptionService, LOADING_STRATEGY, RestService, CoreModule } from '@abp/ng.core';
|
|
25
|
-
import * as i1 from '@angular/forms';
|
|
26
|
-
import { FormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
27
|
-
import * as i2 from '@angular/common';
|
|
28
|
-
import * as i4 from '@ckeditor/ckeditor5-angular';
|
|
29
|
-
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
|
|
5
|
+
import * as i2 from '@abp/ng.core';
|
|
6
|
+
import { ConfigStateService, RestService, LazyLoadService, SubscriptionService, LOADING_STRATEGY, CoreModule } from '@abp/ng.core';
|
|
30
7
|
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
8
|
+
import * as i1$1 from '@angular/forms';
|
|
9
|
+
import { FormBuilder, Validators } from '@angular/forms';
|
|
31
10
|
import * as i3 from '@ngx-validate/core';
|
|
32
|
-
import
|
|
11
|
+
import * as i1$2 from '@angular/common';
|
|
12
|
+
import * as i4 from '@ckeditor/ckeditor5-angular';
|
|
13
|
+
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
|
|
14
|
+
|
|
15
|
+
const routes = [];
|
|
16
|
+
class CkEditorRoutingModule {
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
18
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] }); }
|
|
19
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
|
|
20
|
+
}
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, decorators: [{
|
|
22
|
+
type: NgModule,
|
|
23
|
+
args: [{
|
|
24
|
+
imports: [RouterModule.forChild(routes)],
|
|
25
|
+
exports: [RouterModule],
|
|
26
|
+
}]
|
|
27
|
+
}] });
|
|
28
|
+
|
|
29
|
+
class CkEditorConfig {
|
|
30
|
+
constructor(data) {
|
|
31
|
+
/**文件容器名称 */
|
|
32
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
33
|
+
this['Ckeditor.ImagesContainerName'] = ['', []];
|
|
34
|
+
/**多选 */
|
|
35
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
36
|
+
this['Ckeditor.InitialContent'] = ['', []];
|
|
37
|
+
if (data) {
|
|
38
|
+
for (const key in data) {
|
|
39
|
+
if (data.hasOwnProperty(key)) {
|
|
40
|
+
this[key] = data[key];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
class CkEditorConfigComponent {
|
|
48
|
+
constructor(fb) {
|
|
49
|
+
this.fb = fb;
|
|
50
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
51
|
+
}
|
|
52
|
+
set Entity(v) {
|
|
53
|
+
this._Entity = v;
|
|
54
|
+
this.dataLoaded();
|
|
55
|
+
}
|
|
56
|
+
set selected(v) {
|
|
57
|
+
this._selected = v || '';
|
|
58
|
+
// this.dataLoaded()
|
|
59
|
+
}
|
|
60
|
+
set type(v) {
|
|
61
|
+
this._type = v;
|
|
62
|
+
// this.dataLoaded()
|
|
63
|
+
}
|
|
64
|
+
//
|
|
65
|
+
get formConfiguration() {
|
|
66
|
+
return this._Entity.get('formConfiguration');
|
|
67
|
+
}
|
|
68
|
+
async dataLoaded() {
|
|
69
|
+
if (this._Entity && this._type) {
|
|
70
|
+
await this.AfterInit();
|
|
71
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
72
|
+
this.submitclick?.nativeElement?.click();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
AfterInit() {
|
|
76
|
+
return new Promise((resolve, rejects) => {
|
|
77
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new CkEditorConfig()));
|
|
78
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
79
|
+
this.formConfiguration.patchValue({
|
|
80
|
+
...this._selected.formConfiguration,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
resolve(true);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
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" }] }); }
|
|
88
|
+
}
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
|
|
90
|
+
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>" }]
|
|
92
|
+
}], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { Entity: [{
|
|
93
|
+
type: Input
|
|
94
|
+
}], selected: [{
|
|
95
|
+
type: Input
|
|
96
|
+
}], type: [{
|
|
97
|
+
type: Input
|
|
98
|
+
}], submitclick: [{
|
|
99
|
+
type: ViewChild,
|
|
100
|
+
args: ['submitclick', { static: true }]
|
|
101
|
+
}] } });
|
|
102
|
+
|
|
103
|
+
let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
|
|
104
|
+
constructor(loader, ImagesContainerName, restService) {
|
|
105
|
+
this.reader = new FileReader();
|
|
106
|
+
this.Base64 = false;
|
|
107
|
+
this.createFile = (input, config) => this.restService.request({
|
|
108
|
+
method: 'POST',
|
|
109
|
+
url: '/api/file-explorer/files',
|
|
110
|
+
params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
|
|
111
|
+
body: input.file,
|
|
112
|
+
}, { apiName: 'FileExplorer', ...config });
|
|
113
|
+
this.loader = loader;
|
|
114
|
+
this.ImagesContainerName = ImagesContainerName;
|
|
115
|
+
this.restService = restService;
|
|
116
|
+
}
|
|
117
|
+
upload() {
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
const reader = this.reader;
|
|
120
|
+
if (this.Base64) {
|
|
121
|
+
reader.addEventListener('load', () => {
|
|
122
|
+
resolve({ default: reader.result });
|
|
123
|
+
});
|
|
124
|
+
reader.addEventListener('error', err => {
|
|
125
|
+
reject(err);
|
|
126
|
+
});
|
|
127
|
+
reader.addEventListener('abort', () => {
|
|
128
|
+
reject();
|
|
129
|
+
});
|
|
130
|
+
this.loader.file.then((file) => {
|
|
131
|
+
reader.readAsDataURL(file);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this.loader.file.then((file) => {
|
|
136
|
+
var formData = new FormData();
|
|
137
|
+
formData.append('file', file, file.name);
|
|
138
|
+
this.createFile({
|
|
139
|
+
file: formData,
|
|
140
|
+
containerName: this.ImagesContainerName,
|
|
141
|
+
directoryId: '',
|
|
142
|
+
entityId: ''
|
|
143
|
+
}).subscribe((response) => {
|
|
144
|
+
resolve({ default: response.url });
|
|
145
|
+
}, (error) => {
|
|
146
|
+
reject(error);
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
33
153
|
|
|
34
154
|
var easy = {
|
|
35
155
|
toolbar: {
|
|
@@ -46,70 +166,7 @@ var easy = {
|
|
|
46
166
|
],
|
|
47
167
|
shouldNotGroupWhenFull: false,
|
|
48
168
|
},
|
|
49
|
-
plugins: [
|
|
50
|
-
AccessibilityHelp,
|
|
51
|
-
Alignment,
|
|
52
|
-
Autoformat,
|
|
53
|
-
AutoImage,
|
|
54
|
-
Autosave,
|
|
55
|
-
Base64UploadAdapter,
|
|
56
|
-
BlockQuote,
|
|
57
|
-
Bold,
|
|
58
|
-
CloudServices,
|
|
59
|
-
Code,
|
|
60
|
-
Essentials,
|
|
61
|
-
FontBackgroundColor,
|
|
62
|
-
FontColor,
|
|
63
|
-
FontFamily,
|
|
64
|
-
FontSize,
|
|
65
|
-
GeneralHtmlSupport,
|
|
66
|
-
Heading,
|
|
67
|
-
Highlight,
|
|
68
|
-
HorizontalLine,
|
|
69
|
-
ImageBlock,
|
|
70
|
-
ImageCaption,
|
|
71
|
-
ImageInline,
|
|
72
|
-
ImageInsert,
|
|
73
|
-
ImageInsertViaUrl,
|
|
74
|
-
ImageResize,
|
|
75
|
-
ImageStyle,
|
|
76
|
-
ImageTextAlternative,
|
|
77
|
-
ImageToolbar,
|
|
78
|
-
ImageUpload,
|
|
79
|
-
Indent,
|
|
80
|
-
IndentBlock,
|
|
81
|
-
Italic,
|
|
82
|
-
Link,
|
|
83
|
-
LinkImage,
|
|
84
|
-
List,
|
|
85
|
-
ListProperties,
|
|
86
|
-
MediaEmbed,
|
|
87
|
-
Paragraph,
|
|
88
|
-
PasteFromOffice,
|
|
89
|
-
RemoveFormat,
|
|
90
|
-
SelectAll,
|
|
91
|
-
SpecialCharacters,
|
|
92
|
-
SpecialCharactersArrows,
|
|
93
|
-
SpecialCharactersCurrency,
|
|
94
|
-
SpecialCharactersEssentials,
|
|
95
|
-
SpecialCharactersLatin,
|
|
96
|
-
SpecialCharactersMathematical,
|
|
97
|
-
SpecialCharactersText,
|
|
98
|
-
Strikethrough,
|
|
99
|
-
Style,
|
|
100
|
-
Subscript,
|
|
101
|
-
Superscript,
|
|
102
|
-
Table,
|
|
103
|
-
TableCaption,
|
|
104
|
-
TableCellProperties,
|
|
105
|
-
TableColumnResize,
|
|
106
|
-
TableProperties,
|
|
107
|
-
TableToolbar,
|
|
108
|
-
TextTransformation,
|
|
109
|
-
TodoList,
|
|
110
|
-
Underline,
|
|
111
|
-
Undo,
|
|
112
|
-
],
|
|
169
|
+
plugins: [],
|
|
113
170
|
heading: {
|
|
114
171
|
options: [
|
|
115
172
|
{
|
|
@@ -191,70 +248,7 @@ var defaults = {
|
|
|
191
248
|
],
|
|
192
249
|
shouldNotGroupWhenFull: false,
|
|
193
250
|
},
|
|
194
|
-
plugins: [
|
|
195
|
-
Undo,
|
|
196
|
-
Heading,
|
|
197
|
-
FontSize,
|
|
198
|
-
FontColor,
|
|
199
|
-
FontFamily,
|
|
200
|
-
FontBackgroundColor,
|
|
201
|
-
Link,
|
|
202
|
-
Bold,
|
|
203
|
-
Italic,
|
|
204
|
-
Underline,
|
|
205
|
-
Base64UploadAdapter,
|
|
206
|
-
ImageToolbar,
|
|
207
|
-
ImageUpload,
|
|
208
|
-
LinkImage,
|
|
209
|
-
AccessibilityHelp,
|
|
210
|
-
Alignment,
|
|
211
|
-
Autoformat,
|
|
212
|
-
AutoImage,
|
|
213
|
-
Autosave,
|
|
214
|
-
BlockQuote,
|
|
215
|
-
CloudServices,
|
|
216
|
-
Code,
|
|
217
|
-
Essentials,
|
|
218
|
-
GeneralHtmlSupport,
|
|
219
|
-
Highlight,
|
|
220
|
-
HorizontalLine,
|
|
221
|
-
ImageBlock,
|
|
222
|
-
ImageCaption,
|
|
223
|
-
ImageInline,
|
|
224
|
-
ImageInsert,
|
|
225
|
-
ImageInsertViaUrl,
|
|
226
|
-
ImageResize,
|
|
227
|
-
ImageStyle,
|
|
228
|
-
ImageTextAlternative,
|
|
229
|
-
Indent,
|
|
230
|
-
IndentBlock,
|
|
231
|
-
List,
|
|
232
|
-
ListProperties,
|
|
233
|
-
MediaEmbed,
|
|
234
|
-
Paragraph,
|
|
235
|
-
PasteFromOffice,
|
|
236
|
-
RemoveFormat,
|
|
237
|
-
SelectAll,
|
|
238
|
-
SpecialCharacters,
|
|
239
|
-
SpecialCharactersArrows,
|
|
240
|
-
SpecialCharactersCurrency,
|
|
241
|
-
SpecialCharactersEssentials,
|
|
242
|
-
SpecialCharactersLatin,
|
|
243
|
-
SpecialCharactersMathematical,
|
|
244
|
-
SpecialCharactersText,
|
|
245
|
-
Strikethrough,
|
|
246
|
-
Style,
|
|
247
|
-
Subscript,
|
|
248
|
-
Superscript,
|
|
249
|
-
Table,
|
|
250
|
-
TableCaption,
|
|
251
|
-
TableCellProperties,
|
|
252
|
-
TableColumnResize,
|
|
253
|
-
TableProperties,
|
|
254
|
-
TableToolbar,
|
|
255
|
-
TextTransformation,
|
|
256
|
-
TodoList,
|
|
257
|
-
],
|
|
251
|
+
plugins: [],
|
|
258
252
|
heading: {
|
|
259
253
|
options: [
|
|
260
254
|
{
|
|
@@ -386,70 +380,7 @@ var standard = {
|
|
|
386
380
|
],
|
|
387
381
|
shouldNotGroupWhenFull: false,
|
|
388
382
|
},
|
|
389
|
-
plugins: [
|
|
390
|
-
AccessibilityHelp,
|
|
391
|
-
Alignment,
|
|
392
|
-
Autoformat,
|
|
393
|
-
AutoImage,
|
|
394
|
-
Autosave,
|
|
395
|
-
Base64UploadAdapter,
|
|
396
|
-
BlockQuote,
|
|
397
|
-
Bold,
|
|
398
|
-
CloudServices,
|
|
399
|
-
Code,
|
|
400
|
-
Essentials,
|
|
401
|
-
FontBackgroundColor,
|
|
402
|
-
FontColor,
|
|
403
|
-
FontFamily,
|
|
404
|
-
FontSize,
|
|
405
|
-
GeneralHtmlSupport,
|
|
406
|
-
Heading,
|
|
407
|
-
Highlight,
|
|
408
|
-
HorizontalLine,
|
|
409
|
-
ImageBlock,
|
|
410
|
-
ImageCaption,
|
|
411
|
-
ImageInline,
|
|
412
|
-
ImageInsert,
|
|
413
|
-
ImageInsertViaUrl,
|
|
414
|
-
ImageResize,
|
|
415
|
-
ImageStyle,
|
|
416
|
-
ImageTextAlternative,
|
|
417
|
-
ImageToolbar,
|
|
418
|
-
ImageUpload,
|
|
419
|
-
Indent,
|
|
420
|
-
IndentBlock,
|
|
421
|
-
Italic,
|
|
422
|
-
Link,
|
|
423
|
-
LinkImage,
|
|
424
|
-
List,
|
|
425
|
-
ListProperties,
|
|
426
|
-
MediaEmbed,
|
|
427
|
-
Paragraph,
|
|
428
|
-
PasteFromOffice,
|
|
429
|
-
RemoveFormat,
|
|
430
|
-
SelectAll,
|
|
431
|
-
SpecialCharacters,
|
|
432
|
-
SpecialCharactersArrows,
|
|
433
|
-
SpecialCharactersCurrency,
|
|
434
|
-
SpecialCharactersEssentials,
|
|
435
|
-
SpecialCharactersLatin,
|
|
436
|
-
SpecialCharactersMathematical,
|
|
437
|
-
SpecialCharactersText,
|
|
438
|
-
Strikethrough,
|
|
439
|
-
Style,
|
|
440
|
-
Subscript,
|
|
441
|
-
Superscript,
|
|
442
|
-
Table,
|
|
443
|
-
TableCaption,
|
|
444
|
-
TableCellProperties,
|
|
445
|
-
TableColumnResize,
|
|
446
|
-
TableProperties,
|
|
447
|
-
TableToolbar,
|
|
448
|
-
TextTransformation,
|
|
449
|
-
TodoList,
|
|
450
|
-
Underline,
|
|
451
|
-
Undo,
|
|
452
|
-
],
|
|
383
|
+
plugins: [],
|
|
453
384
|
fontSize: {
|
|
454
385
|
options: [10, 12, 14, 'default', 18, 20, 22, 24, 26, 28, 30, 32],
|
|
455
386
|
supportAllValues: true,
|
|
@@ -668,69 +599,7 @@ var full = {
|
|
|
668
599
|
],
|
|
669
600
|
shouldNotGroupWhenFull: false,
|
|
670
601
|
},
|
|
671
|
-
plugins: [
|
|
672
|
-
AccessibilityHelp,
|
|
673
|
-
Alignment,
|
|
674
|
-
Autoformat,
|
|
675
|
-
AutoImage,
|
|
676
|
-
Autosave,
|
|
677
|
-
Base64UploadAdapter,
|
|
678
|
-
BlockQuote,
|
|
679
|
-
Bold,
|
|
680
|
-
CloudServices,
|
|
681
|
-
Code,
|
|
682
|
-
Essentials,
|
|
683
|
-
FontBackgroundColor,
|
|
684
|
-
FontColor,
|
|
685
|
-
FontFamily,
|
|
686
|
-
FontSize,
|
|
687
|
-
GeneralHtmlSupport,
|
|
688
|
-
Heading,
|
|
689
|
-
HorizontalLine,
|
|
690
|
-
ImageBlock,
|
|
691
|
-
ImageCaption,
|
|
692
|
-
ImageInline,
|
|
693
|
-
ImageInsert,
|
|
694
|
-
ImageInsertViaUrl,
|
|
695
|
-
ImageResize,
|
|
696
|
-
ImageStyle,
|
|
697
|
-
ImageTextAlternative,
|
|
698
|
-
ImageToolbar,
|
|
699
|
-
ImageUpload,
|
|
700
|
-
Indent,
|
|
701
|
-
IndentBlock,
|
|
702
|
-
Italic,
|
|
703
|
-
Link,
|
|
704
|
-
LinkImage,
|
|
705
|
-
List,
|
|
706
|
-
ListProperties,
|
|
707
|
-
MediaEmbed,
|
|
708
|
-
Paragraph,
|
|
709
|
-
PasteFromOffice,
|
|
710
|
-
RemoveFormat,
|
|
711
|
-
SelectAll,
|
|
712
|
-
SpecialCharacters,
|
|
713
|
-
SpecialCharactersArrows,
|
|
714
|
-
SpecialCharactersCurrency,
|
|
715
|
-
SpecialCharactersEssentials,
|
|
716
|
-
SpecialCharactersLatin,
|
|
717
|
-
SpecialCharactersMathematical,
|
|
718
|
-
SpecialCharactersText,
|
|
719
|
-
Strikethrough,
|
|
720
|
-
Style,
|
|
721
|
-
Subscript,
|
|
722
|
-
Superscript,
|
|
723
|
-
Table,
|
|
724
|
-
TableCaption,
|
|
725
|
-
TableCellProperties,
|
|
726
|
-
TableColumnResize,
|
|
727
|
-
TableProperties,
|
|
728
|
-
TableToolbar,
|
|
729
|
-
TextTransformation,
|
|
730
|
-
TodoList,
|
|
731
|
-
Underline,
|
|
732
|
-
Undo,
|
|
733
|
-
],
|
|
602
|
+
plugins: [],
|
|
734
603
|
fontFamily: {
|
|
735
604
|
supportAllValues: true,
|
|
736
605
|
},
|
|
@@ -923,7 +792,7 @@ var LanguagesMap;
|
|
|
923
792
|
(function (LanguagesMap) {
|
|
924
793
|
LanguagesMap["ar"] = "ar";
|
|
925
794
|
LanguagesMap["cs"] = "cs";
|
|
926
|
-
LanguagesMap["en"] = "en";
|
|
795
|
+
LanguagesMap["en"] = "en-gb";
|
|
927
796
|
LanguagesMap["hi"] = "hi";
|
|
928
797
|
LanguagesMap["fi"] = "fi";
|
|
929
798
|
LanguagesMap["hu"] = "hu";
|
|
@@ -941,201 +810,28 @@ var LanguagesMap;
|
|
|
941
810
|
LanguagesMap["vi"] = "vi";
|
|
942
811
|
})(LanguagesMap || (LanguagesMap = {}));
|
|
943
812
|
|
|
944
|
-
class
|
|
945
|
-
constructor() {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
plugins
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
this.languagesMap = LanguagesMap;
|
|
957
|
-
this.lazyLoadService = inject(LazyLoadService);
|
|
958
|
-
this.subscriptionService = inject(SubscriptionService);
|
|
959
|
-
this._config_ck = CkEditorTypesObject['full'];
|
|
960
|
-
}
|
|
961
|
-
/**切换类型 */
|
|
962
|
-
switchType(type) {
|
|
963
|
-
this.configType = type;
|
|
964
|
-
this._config_ck = '';
|
|
965
|
-
setTimeout(() => {
|
|
966
|
-
this.loadStyle();
|
|
967
|
-
let configs = CkEditorTypesObject[type];
|
|
968
|
-
configs.language = this.languagesMap[this.currentCulture];
|
|
969
|
-
// configs.translations= [coreTranslations]
|
|
970
|
-
this._config_ck = configs;
|
|
971
|
-
}, 0);
|
|
972
|
-
}
|
|
973
|
-
loadStyle() {
|
|
974
|
-
const loaded$ = this.lazyLoadService.load(LOADING_STRATEGY.AppendAnonymousStyleToHead('ckeditor5.css'));
|
|
975
|
-
this.subscriptionService.addOne(loaded$);
|
|
976
|
-
}
|
|
977
|
-
clearconfig() {
|
|
978
|
-
this._config = null;
|
|
979
|
-
}
|
|
980
|
-
/**加载完成 */
|
|
981
|
-
ckReady(editor) {
|
|
982
|
-
const element = editor.ui.getEditableElement();
|
|
983
|
-
const parent = element.parentElement;
|
|
984
|
-
parent.insertBefore(editor.ui.view.toolbar.element, element);
|
|
985
|
-
}
|
|
986
|
-
/**内容改变 */
|
|
987
|
-
ckChange({ editor }) {
|
|
988
|
-
const data = editor.getData();
|
|
989
|
-
this.editorValue = data;
|
|
813
|
+
class SetCkEditorConfigsService {
|
|
814
|
+
constructor() { }
|
|
815
|
+
async get(input) {
|
|
816
|
+
let { language } = input;
|
|
817
|
+
return new Promise(async (resolve, rejects) => {
|
|
818
|
+
let configs = CkEditorTypesObject['easy'];
|
|
819
|
+
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
|
+
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
|
+
configs.language = LanguagesMap[language];
|
|
822
|
+
await import(`@ckeditor/ckeditor5-build-decoupled-document/build/translations/${LanguagesMap[language]}`);
|
|
823
|
+
resolve(configs);
|
|
824
|
+
});
|
|
990
825
|
}
|
|
991
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type:
|
|
992
|
-
static { this.ɵ
|
|
993
|
-
}
|
|
994
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorDomeComponent, decorators: [{
|
|
995
|
-
type: Component,
|
|
996
|
-
args: [{ selector: 'lib-ck-editor-dome', template: "<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('easy')\">\u6781\u7B80</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('default')\">\u9ED8\u8BA4</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('standard')\">\u6807\u51C6</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"switchType('full')\">\u5B8C\u6574</button>\r\n\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-3\" (click.stop)=\"clearconfig()\">\u6E05\u7A7A\u914D\u7F6E</button>\r\n\r\n<h3>\u81EA\u5B9A\u4E49\u914D\u7F6E</h3>\r\n<ckeditor #editor [editor]=\"Editor\" *ngIf=\"_config_ck\" [(ngModel)]=\"editorValue\" [config]=\"_config\" ></ckeditor>\r\n\r\n<h3>\u7C7B\u578B</h3>\r\n<ckeditor #editor [editor]=\"Editor\" *ngIf=\"_config_ck\" [(ngModel)]=\"editorValue\" [config]=\"_config_ck\" (change)=\"ckChange($event)\" (ready)=\"ckReady($event)\"></ckeditor>\r\n\r\n{{editorValue}}" }]
|
|
997
|
-
}] });
|
|
998
|
-
|
|
999
|
-
const routes = [{
|
|
1000
|
-
path: 'dome',
|
|
1001
|
-
component: CkEditorDomeComponent,
|
|
1002
|
-
}];
|
|
1003
|
-
class CkEditorRoutingModule {
|
|
1004
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1005
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] }); }
|
|
1006
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
|
|
826
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
827
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, providedIn: 'root' }); }
|
|
1007
828
|
}
|
|
1008
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type:
|
|
1009
|
-
type:
|
|
829
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkEditorConfigsService, decorators: [{
|
|
830
|
+
type: Injectable,
|
|
1010
831
|
args: [{
|
|
1011
|
-
|
|
1012
|
-
exports: [RouterModule],
|
|
832
|
+
providedIn: 'root',
|
|
1013
833
|
}]
|
|
1014
|
-
}] });
|
|
1015
|
-
|
|
1016
|
-
class CkEditorConfig {
|
|
1017
|
-
constructor(data) {
|
|
1018
|
-
/**文件容器名称 */
|
|
1019
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
1020
|
-
this['Ckeditor.ImagesContainerName'] = ['', []];
|
|
1021
|
-
/**多选 */
|
|
1022
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
1023
|
-
this['Ckeditor.InitialContent'] = ['', []];
|
|
1024
|
-
if (data) {
|
|
1025
|
-
for (const key in data) {
|
|
1026
|
-
if (data.hasOwnProperty(key)) {
|
|
1027
|
-
this[key] = data[key];
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
class CkEditorConfigComponent {
|
|
1035
|
-
constructor(fb) {
|
|
1036
|
-
this.fb = fb;
|
|
1037
|
-
}
|
|
1038
|
-
set Entity(v) {
|
|
1039
|
-
this._Entity = v;
|
|
1040
|
-
this.dataLoaded();
|
|
1041
|
-
}
|
|
1042
|
-
set selected(v) {
|
|
1043
|
-
this._selected = v || '';
|
|
1044
|
-
// this.dataLoaded()
|
|
1045
|
-
}
|
|
1046
|
-
set type(v) {
|
|
1047
|
-
this._type = v;
|
|
1048
|
-
// this.dataLoaded()
|
|
1049
|
-
}
|
|
1050
|
-
//
|
|
1051
|
-
get formConfiguration() {
|
|
1052
|
-
return this._Entity.get('formConfiguration');
|
|
1053
|
-
}
|
|
1054
|
-
async dataLoaded() {
|
|
1055
|
-
// if (this.Entity && (this._selected || this._selected === '')) {
|
|
1056
|
-
if (this._Entity && this._type) {
|
|
1057
|
-
await this.AfterInit();
|
|
1058
|
-
this.submitclick.nativeElement.click();
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
AfterInit() {
|
|
1062
|
-
return new Promise((resolve, rejects) => {
|
|
1063
|
-
this._Entity.setControl('formConfiguration', this.fb.group(new CkEditorConfig()));
|
|
1064
|
-
if (this._selected && this._selected.formControlName == this._type) {
|
|
1065
|
-
this.formConfiguration.patchValue({
|
|
1066
|
-
...this._selected.formConfiguration,
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
resolve(true);
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1073
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorConfigComponent, selector: "ck-editor-config", inputs: { Entity: "Entity", selected: "selected", type: "type" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::ImagesContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.ImagesContainerName\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::InitialContent' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.InitialContent\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2$1.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
1074
|
-
}
|
|
1075
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
|
|
1076
|
-
type: Component,
|
|
1077
|
-
args: [{ selector: 'ck-editor-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::ImagesContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.ImagesContainerName\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsCkEditor::InitialContent' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Ckeditor.InitialContent\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
|
|
1078
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { Entity: [{
|
|
1079
|
-
type: Input
|
|
1080
|
-
}], selected: [{
|
|
1081
|
-
type: Input
|
|
1082
|
-
}], type: [{
|
|
1083
|
-
type: Input
|
|
1084
|
-
}], submitclick: [{
|
|
1085
|
-
type: ViewChild,
|
|
1086
|
-
args: ['submitclick', { static: true }]
|
|
1087
|
-
}] } });
|
|
1088
|
-
|
|
1089
|
-
let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
|
|
1090
|
-
constructor(loader, ImagesContainerName, restService) {
|
|
1091
|
-
this.reader = new FileReader();
|
|
1092
|
-
this.Base64 = false;
|
|
1093
|
-
this.createFile = (input, config) => this.restService.request({
|
|
1094
|
-
method: 'POST',
|
|
1095
|
-
url: '/api/file-explorer/files',
|
|
1096
|
-
params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
|
|
1097
|
-
body: input.file,
|
|
1098
|
-
}, { apiName: 'FileExplorer', ...config });
|
|
1099
|
-
this.loader = loader;
|
|
1100
|
-
this.ImagesContainerName = ImagesContainerName;
|
|
1101
|
-
this.restService = restService;
|
|
1102
|
-
}
|
|
1103
|
-
upload() {
|
|
1104
|
-
return new Promise((resolve, reject) => {
|
|
1105
|
-
const reader = this.reader;
|
|
1106
|
-
if (this.Base64) {
|
|
1107
|
-
reader.addEventListener('load', () => {
|
|
1108
|
-
resolve({ default: reader.result });
|
|
1109
|
-
});
|
|
1110
|
-
reader.addEventListener('error', err => {
|
|
1111
|
-
reject(err);
|
|
1112
|
-
});
|
|
1113
|
-
reader.addEventListener('abort', () => {
|
|
1114
|
-
reject();
|
|
1115
|
-
});
|
|
1116
|
-
this.loader.file.then((file) => {
|
|
1117
|
-
reader.readAsDataURL(file);
|
|
1118
|
-
});
|
|
1119
|
-
}
|
|
1120
|
-
else {
|
|
1121
|
-
this.loader.file.then((file) => {
|
|
1122
|
-
var formData = new FormData();
|
|
1123
|
-
formData.append('file', file, file.name);
|
|
1124
|
-
this.createFile({
|
|
1125
|
-
file: formData,
|
|
1126
|
-
containerName: this.ImagesContainerName,
|
|
1127
|
-
directoryId: '',
|
|
1128
|
-
entityId: ''
|
|
1129
|
-
}).subscribe((response) => {
|
|
1130
|
-
resolve({ default: response.url });
|
|
1131
|
-
}, (error) => {
|
|
1132
|
-
reject(error);
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
}
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
};
|
|
834
|
+
}], ctorParameters: () => [] });
|
|
1139
835
|
|
|
1140
836
|
class CkEditorControlComponent {
|
|
1141
837
|
constructor() {
|
|
@@ -1145,12 +841,11 @@ class CkEditorControlComponent {
|
|
|
1145
841
|
this.ckEditorValue = '';
|
|
1146
842
|
/**系统语言 */
|
|
1147
843
|
this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
|
|
1148
|
-
/** 语言目录,匹配系统语言,设置ckeditor的语言 */
|
|
1149
|
-
this.languagesMap = LanguagesMap;
|
|
1150
|
-
this.Editor = ClassicEditor;
|
|
1151
844
|
this.fb = inject(FormBuilder);
|
|
1152
845
|
/**字段配置列表 */
|
|
1153
846
|
this._fields = '';
|
|
847
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
848
|
+
this._SetCkEditorConfigsService = inject(SetCkEditorConfigsService);
|
|
1154
849
|
this.lazyLoadService = inject(LazyLoadService);
|
|
1155
850
|
this.subscriptionService = inject(SubscriptionService);
|
|
1156
851
|
this.invalidfeedback = false;
|
|
@@ -1191,16 +886,26 @@ class CkEditorControlComponent {
|
|
|
1191
886
|
async dataLoaded() {
|
|
1192
887
|
if (this._fields && this._entity) {
|
|
1193
888
|
await this.AfterInit();
|
|
1194
|
-
this.ckEditorValue =
|
|
889
|
+
this.ckEditorValue =
|
|
890
|
+
this._selected || this._fields.field.formConfiguration['Ckeditor.InitialContent'];
|
|
1195
891
|
this.setckeditorInput(this.ckEditorValue);
|
|
1196
|
-
this.
|
|
892
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
893
|
+
this.submitclick?.nativeElement?.click();
|
|
1197
894
|
}
|
|
1198
895
|
}
|
|
1199
896
|
loadckeditor() {
|
|
1200
|
-
this
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
897
|
+
let _that = this;
|
|
898
|
+
return new Promise(async (resolve) => {
|
|
899
|
+
await import('ckeditor5').then(async (res) => {
|
|
900
|
+
this.loadStyle();
|
|
901
|
+
_that.Editor = res.ClassicEditor;
|
|
902
|
+
let configs = await _that._SetCkEditorConfigsService.get({
|
|
903
|
+
language: _that.currentCulture,
|
|
904
|
+
});
|
|
905
|
+
_that.ckOptions = configs;
|
|
906
|
+
});
|
|
907
|
+
resolve(true);
|
|
908
|
+
});
|
|
1204
909
|
}
|
|
1205
910
|
loadStyle() {
|
|
1206
911
|
const loaded$ = this.lazyLoadService.load(LOADING_STRATEGY.AppendAnonymousStyleToHead('ckeditor5.css'));
|
|
@@ -1224,17 +929,17 @@ class CkEditorControlComponent {
|
|
|
1224
929
|
this.imagesContainerName =
|
|
1225
930
|
this._fields.field.formConfiguration['Ckeditor.ImagesContainerName'];
|
|
1226
931
|
if (!this.imagesContainerName) {
|
|
1227
|
-
this.ckOptions
|
|
932
|
+
this.ckOptions?.toolbar?.items?.splice(this.ckOptions?.toolbar?.items?.indexOf('insertImage'), 1);
|
|
1228
933
|
}
|
|
1229
934
|
resolve(true);
|
|
1230
935
|
});
|
|
1231
936
|
}
|
|
1232
937
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1233
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorControlComponent, selector: "ck-editor-control", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\"
|
|
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"] }] }); }
|
|
1234
939
|
}
|
|
1235
940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, decorators: [{
|
|
1236
941
|
type: Component,
|
|
1237
|
-
args: [{ selector: 'ck-editor-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\"
|
|
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>" }]
|
|
1238
943
|
}], ctorParameters: () => [], propDecorators: { fields: [{
|
|
1239
944
|
type: Input
|
|
1240
945
|
}], parentFiledName: [{
|
|
@@ -1271,17 +976,12 @@ function AddFieldControlGroup(array = []) {
|
|
|
1271
976
|
class CkEditorModule {
|
|
1272
977
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1273
978
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, declarations: [CkEditorControlComponent,
|
|
1274
|
-
CkEditorConfigComponent,
|
|
1275
|
-
CkEditorDomeComponent], imports: [FormsModule,
|
|
1276
|
-
CoreModule,
|
|
979
|
+
CkEditorConfigComponent], imports: [CoreModule,
|
|
1277
980
|
ThemeSharedModule,
|
|
1278
|
-
ReactiveFormsModule,
|
|
1279
981
|
CkEditorRoutingModule,
|
|
1280
982
|
CKEditorModule] }); }
|
|
1281
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, imports: [
|
|
1282
|
-
CoreModule,
|
|
983
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, imports: [CoreModule,
|
|
1283
984
|
ThemeSharedModule,
|
|
1284
|
-
ReactiveFormsModule,
|
|
1285
985
|
CkEditorRoutingModule,
|
|
1286
986
|
CKEditorModule] }); }
|
|
1287
987
|
}
|
|
@@ -1291,17 +991,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1291
991
|
declarations: [
|
|
1292
992
|
CkEditorControlComponent,
|
|
1293
993
|
CkEditorConfigComponent,
|
|
1294
|
-
CkEditorDomeComponent,
|
|
1295
994
|
],
|
|
1296
995
|
imports: [
|
|
1297
|
-
FormsModule,
|
|
1298
996
|
CoreModule,
|
|
1299
997
|
ThemeSharedModule,
|
|
1300
|
-
ReactiveFormsModule,
|
|
1301
998
|
CkEditorRoutingModule,
|
|
1302
999
|
CKEditorModule,
|
|
1303
1000
|
],
|
|
1304
|
-
exports: []
|
|
1305
1001
|
}]
|
|
1306
1002
|
}] });
|
|
1307
1003
|
|
|
@@ -1366,28 +1062,6 @@ class isBase64UploadAdapter {
|
|
|
1366
1062
|
}
|
|
1367
1063
|
}
|
|
1368
1064
|
|
|
1369
|
-
class SetCkeditorContentPipe {
|
|
1370
|
-
constructor() {
|
|
1371
|
-
this.sanitized = inject(DomSanitizer);
|
|
1372
|
-
}
|
|
1373
|
-
transform(value, ...args) {
|
|
1374
|
-
if (value) {
|
|
1375
|
-
value = value.replace(/<oembed url/ig, "<iframe src").replace(/oembed>/ig, "iframe>");
|
|
1376
|
-
value = value.replace(/<figure class="media"/ig, "<div").replace(/figure>/ig, "div>");
|
|
1377
|
-
}
|
|
1378
|
-
return this.sanitized.bypassSecurityTrustHtml(value);
|
|
1379
|
-
}
|
|
1380
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkeditorContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1381
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: SetCkeditorContentPipe, isStandalone: true, name: "setCkeditorContent" }); }
|
|
1382
|
-
}
|
|
1383
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SetCkeditorContentPipe, decorators: [{
|
|
1384
|
-
type: Pipe,
|
|
1385
|
-
args: [{
|
|
1386
|
-
name: 'setCkeditorContent',
|
|
1387
|
-
standalone: true
|
|
1388
|
-
}]
|
|
1389
|
-
}] });
|
|
1390
|
-
|
|
1391
1065
|
/*
|
|
1392
1066
|
* Public API Surface of ck-editor
|
|
1393
1067
|
*/
|
|
@@ -1396,5 +1070,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1396
1070
|
* Generated bundle index. Do not edit.
|
|
1397
1071
|
*/
|
|
1398
1072
|
|
|
1399
|
-
export { AddFieldControlGroup, CkEditorModule,
|
|
1073
|
+
export { AddFieldControlGroup, CkEditorModule, SetCkEditorConfigsService, ckEditorFieldControlGroup, getExcludeAssignControl, isBase64UploadAdapter };
|
|
1400
1074
|
//# sourceMappingURL=dignite-ng-expand.ck-editor.mjs.map
|