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