@dignite-ng/expand.ck-editor 0.0.10 → 0.0.12

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.
@@ -941,17 +941,20 @@ var LanguagesMap;
941
941
  })(LanguagesMap || (LanguagesMap = {}));
942
942
 
943
943
  class CkEditorDomeComponent {
944
- config = inject(ConfigStateService);
945
- currentCulture = this.config.getOne('localization')?.currentCulture?.name;
946
- // CkEditorTypesObject = CkEditorTypesObject
947
- Editor = ClassicEditor;
948
- _config = {
949
- plugins: [Bold, Essentials, Italic, Paragraph, Undo],
950
- toolbar: ['undo', 'redo', '|', 'bold', 'italic']
951
- };
952
- configType = 'default';
953
- editorValue = '<p>12233</p>';
954
- languagesMap = LanguagesMap;
944
+ constructor() {
945
+ this.config = inject(ConfigStateService);
946
+ this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
947
+ // CkEditorTypesObject = CkEditorTypesObject
948
+ this.Editor = ClassicEditor;
949
+ this._config = {
950
+ plugins: [Bold, Essentials, Italic, Paragraph, Undo],
951
+ toolbar: ['undo', 'redo', '|', 'bold', 'italic']
952
+ };
953
+ this.configType = 'default';
954
+ this.editorValue = '<p>12233</p>';
955
+ this.languagesMap = LanguagesMap;
956
+ this._config_ck = CkEditorTypesObject['full'];
957
+ }
955
958
  /**切换类型 */
956
959
  switchType(type) {
957
960
  this.configType = type;
@@ -977,9 +980,8 @@ class CkEditorDomeComponent {
977
980
  const data = editor.getData();
978
981
  this.editorValue = data;
979
982
  }
980
- _config_ck = CkEditorTypesObject['full'];
981
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorDomeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
982
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorDomeComponent, selector: "lib-ck-editor-dome", ngImport: i0, template: "<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('easy')\">\u6781\u7B80</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('default')\">\u9ED8\u8BA4</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('standard')\">\u6807\u51C6</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('full')\">\u5B8C\u6574</button>\r\n\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (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}}", styles: [""], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i4.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }] });
983
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorDomeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
984
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorDomeComponent, selector: "lib-ck-editor-dome", ngImport: i0, template: "<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('easy')\">\u6781\u7B80</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('default')\">\u9ED8\u8BA4</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('standard')\">\u6807\u51C6</button>\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (click.stop)=\"switchType('full')\">\u5B8C\u6574</button>\r\n\r\n<button class=\"btn btn-sm btn-primary mx-2 mb-2\" (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}}", styles: [""], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i4.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }] }); }
983
985
  }
984
986
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorDomeComponent, decorators: [{
985
987
  type: Component,
@@ -991,9 +993,9 @@ const routes = [{
991
993
  component: CkEditorDomeComponent,
992
994
  }];
993
995
  class CkEditorRoutingModule {
994
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
995
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] });
996
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
996
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
997
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] }); }
998
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
997
999
  }
998
1000
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorRoutingModule, decorators: [{
999
1001
  type: NgModule,
@@ -1004,13 +1006,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1004
1006
  }] });
1005
1007
 
1006
1008
  class CkEditorConfig {
1007
- /**文件容器名称 */
1008
- // placeholder: any = new FormControl('', Validators.required);
1009
- 'Ckeditor.ImagesContainerName' = ['', []];
1010
- /**多选 */
1011
- // placeholder: any = new FormControl('', Validators.required);
1012
- 'Ckeditor.InitialContent' = ['', []];
1013
1009
  constructor(data) {
1010
+ /**文件容器名称 */
1011
+ // placeholder: any = new FormControl('', Validators.required);
1012
+ this['Ckeditor.ImagesContainerName'] = ['', []];
1013
+ /**多选 */
1014
+ // placeholder: any = new FormControl('', Validators.required);
1015
+ this['Ckeditor.InitialContent'] = ['', []];
1014
1016
  if (data) {
1015
1017
  for (const key in data) {
1016
1018
  if (data.hasOwnProperty(key)) {
@@ -1022,20 +1024,13 @@ class CkEditorConfig {
1022
1024
  }
1023
1025
 
1024
1026
  class CkEditorConfigComponent {
1025
- fb;
1026
1027
  constructor(fb) {
1027
1028
  this.fb = fb;
1028
1029
  }
1029
- /**表单实体 */
1030
- Entity;
1031
- /**选择的表单信息 */
1032
- _selected;
1033
1030
  set selected(v) {
1034
1031
  this._selected = v || '';
1035
1032
  this.dataLoaded();
1036
1033
  }
1037
- /**表单控件类型 */
1038
- _type;
1039
1034
  set type(v) {
1040
1035
  this._type = v;
1041
1036
  this.dataLoaded();
@@ -1043,7 +1038,6 @@ class CkEditorConfigComponent {
1043
1038
  get formConfiguration() {
1044
1039
  return this.Entity.get('formConfiguration');
1045
1040
  }
1046
- submitclick;
1047
1041
  async dataLoaded() {
1048
1042
  // if (this.Entity && (this._selected || this._selected === '')) {
1049
1043
  if (this.Entity && this._type) {
@@ -1062,8 +1056,8 @@ class CkEditorConfigComponent {
1062
1056
  resolve(true);
1063
1057
  });
1064
1058
  }
1065
- static ɵ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 ɵ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-2\">\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-2\">\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" }] });
1059
+ 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 }); }
1060
+ 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-2\">\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-2\">\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
1061
  }
1068
1062
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
1069
1063
  type: Component,
@@ -1079,13 +1073,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1079
1073
  args: ['submitclick', { static: true }]
1080
1074
  }] } });
1081
1075
 
1082
- class isBase64UploadAdapter {
1083
- reader = new FileReader();
1084
- restService;
1085
- loader;
1086
- ImagesContainerName;
1087
- Base64 = false;
1076
+ let isBase64UploadAdapter$1 = class isBase64UploadAdapter {
1088
1077
  constructor(loader, ImagesContainerName, restService) {
1078
+ this.reader = new FileReader();
1079
+ this.Base64 = false;
1080
+ this.createFile = (input, config) => this.restService.request({
1081
+ method: 'POST',
1082
+ url: '/api/file-explorer/files',
1083
+ params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
1084
+ body: input.file,
1085
+ }, { apiName: 'FileExplorer', ...config });
1089
1086
  this.loader = loader;
1090
1087
  this.ImagesContainerName = ImagesContainerName;
1091
1088
  this.restService = restService;
@@ -1125,119 +1122,53 @@ class isBase64UploadAdapter {
1125
1122
  }
1126
1123
  });
1127
1124
  }
1128
- createFile = (input, config) => this.restService.request({
1129
- method: 'POST',
1130
- url: '/api/file-explorer/files',
1131
- params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
1132
- body: input.file,
1133
- }, { apiName: 'FileExplorer', ...config });
1134
- }
1125
+ };
1135
1126
 
1136
1127
  class CkEditorControlComponent {
1137
- config = inject(ConfigStateService);
1138
- _restService = inject(RestService);
1139
- /**ck-Editor的值 */
1140
- ckEditorValue = '';
1141
- /**系统语言 */
1142
- currentCulture = this.config.getOne('localization')?.currentCulture?.name;
1143
- /** 语言目录,匹配系统语言,设置ckeditor的语言 */
1144
- languagesMap = LanguagesMap;
1145
- Editor = ClassicEditor;
1146
1128
  constructor() {
1147
- let configs = CkEditorTypesObject['default'];
1148
- configs.language = this.languagesMap[this.currentCulture],
1149
- this.ckOptions = configs;
1150
- // import('@ckeditor/ckeditor5-build-classic').then(res => {
1151
- // this.Editor = res.default
1152
- // this.ckOptions = {
1153
- // language: this.languagesMap[this.currentCulture],
1154
- // toolbar: {
1155
- // items: [
1156
- // 'heading', '|',
1157
- // 'bold', 'italic',
1158
- // 'link', '|',
1159
- // 'bulletedList', 'numberedList',
1160
- // 'insertTable', '|',
1161
- // 'uploadImage', '|',
1162
- // 'undo', 'redo'
1163
- // ],
1164
- // viewportTopOffset: 30,
1165
- // shouldNotGroupWhenFull: true
1166
- // },
1167
- // image: {
1168
- // toolbar: [
1169
- // 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight',
1170
- // '|',
1171
- // 'resizeImage',
1172
- // '|',
1173
- // 'imageTextAlternative'
1174
- // ],
1175
- // styles: [
1176
- // 'alignLeft', 'alignCenter', 'alignRight'
1177
- // ],
1178
- // resizeOptions: [{
1179
- // name: 'resizeImage:original',
1180
- // label: 'Original',
1181
- // value: null
1182
- // },
1183
- // {
1184
- // name: 'resizeImage:25',
1185
- // label: '25%',
1186
- // value: '25'
1187
- // },
1188
- // {
1189
- // name: 'resizeImage:50',
1190
- // label: '50%',
1191
- // value: '50'
1192
- // },
1193
- // {
1194
- // name: 'resizeImage:75',
1195
- // label: '75%',
1196
- // value: '75'
1197
- // }
1198
- // ],
1199
- // },
1200
- // }
1201
- // })
1129
+ this.config = inject(ConfigStateService);
1130
+ this._restService = inject(RestService);
1131
+ /**ck-Editor的值 */
1132
+ this.ckEditorValue = '';
1133
+ /**系统语言 */
1134
+ this.currentCulture = this.config.getOne('localization')?.currentCulture?.name;
1135
+ /** 语言目录,匹配系统语言,设置ckeditor的语言 */
1136
+ this.languagesMap = LanguagesMap;
1137
+ this.Editor = ClassicEditor;
1138
+ this.fb = inject(FormBuilder);
1139
+ /**字段配置列表 */
1140
+ this._fields = '';
1141
+ this.invalidfeedback = false;
1142
+ /**图片容器名称 */
1143
+ this.imagesContainerName = '';
1144
+ this.loadckeditor();
1202
1145
  }
1203
1146
  onReady(editor) {
1204
1147
  let _this = this;
1205
1148
  editor.plugins.get('FileRepository').createUploadAdapter = function (loader) {
1206
- return new isBase64UploadAdapter(loader, _this.imagesContainerName, _this._restService);
1149
+ return new isBase64UploadAdapter$1(loader, _this.imagesContainerName, _this._restService);
1207
1150
  };
1208
1151
  }
1209
- /**ck-editor配置 */
1210
- ckOptions;
1211
1152
  /**富文本内容改变 */
1212
1153
  ckEditorChange(event) {
1213
1154
  this.setckeditorInput(event);
1214
1155
  }
1215
- fb = inject(FormBuilder);
1216
- /**表单实体 */
1217
- _entity;
1218
1156
  set entity(v) {
1219
1157
  this._entity = v;
1220
1158
  this.dataLoaded();
1221
1159
  }
1222
- /**字段配置列表 */
1223
- _fields = '';
1224
1160
  set fields(v) {
1225
1161
  this._fields = v;
1226
1162
  this.dataLoaded();
1227
1163
  }
1228
- /**父级字段名称,用于为表单设置控件赋值 */
1229
- _parentFiledName;
1230
1164
  set parentFiledName(v) {
1231
1165
  this._parentFiledName = v;
1232
1166
  this.dataLoaded();
1233
1167
  }
1234
- /**父级字段名称,用于为表单设置控件赋值 */
1235
- _selected;
1236
1168
  set selected(v) {
1237
1169
  this._selected = v;
1238
1170
  this.dataLoaded();
1239
1171
  }
1240
- submitclick;
1241
1172
  get extraProperties() {
1242
1173
  return this._entity.get('extraProperties');
1243
1174
  }
@@ -1256,14 +1187,17 @@ class CkEditorControlComponent {
1256
1187
  this.submitclick.nativeElement.click();
1257
1188
  }
1258
1189
  }
1259
- invalidfeedback = false;
1190
+ loadckeditor() {
1191
+ let configs = CkEditorTypesObject['default'];
1192
+ configs.language = this.languagesMap[this.currentCulture],
1193
+ console.log(configs, 'configsconfigs');
1194
+ this.ckOptions = configs;
1195
+ }
1260
1196
  //设置值
1261
1197
  setckeditorInput(val) {
1262
1198
  this.invalidfeedback = true;
1263
1199
  this.ckeditorInput.patchValue(val);
1264
1200
  }
1265
- /**图片容器名称 */
1266
- imagesContainerName = '';
1267
1201
  AfterInit() {
1268
1202
  return new Promise(resolve => {
1269
1203
  let ValidatorsArray = [];
@@ -1276,11 +1210,14 @@ class CkEditorControlComponent {
1276
1210
  this.extraProperties.setControl(this._fields.field.name, newControl);
1277
1211
  this.imagesContainerName =
1278
1212
  this._fields.field.formConfiguration['Ckeditor.ImagesContainerName'];
1213
+ if (!this.imagesContainerName) {
1214
+ this.ckOptions.toolbar.items.splice(this.ckOptions.toolbar.items.indexOf('insertImage'), 1);
1215
+ }
1279
1216
  resolve(true);
1280
1217
  });
1281
1218
  }
1282
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1283
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorControlComponent, selector: "ck-editor-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected" }, 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-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\" [formControlName]=\"_fields.field.name\">\n </ckeditor>\n <ng-container *ngIf=\"ckeditorInput?.errors?.required&&invalidfeedback\">\n <div class=\"text-danger \">\n {{'DigniteAbpForms::Validate:Required' | abpLocalization:' '}}\n </div>\n </ng-container>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: 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"] }, { kind: "pipe", type: i2$1.LocalizationPipe, name: "abpLocalization" }] });
1219
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1220
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CkEditorControlComponent, selector: "ck-editor-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected" }, 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-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ckeditor [editor]=\"Editor\" *ngIf=\"Editor\" [config]=\"ckOptions\" (ready)=\"onReady($event)\" [formControlName]=\"_fields.field.name\">\n </ckeditor>\n <ng-container *ngIf=\"ckeditorInput?.errors?.required&&invalidfeedback\">\n <div class=\"text-danger \">\n {{'DigniteAbpForms::Validate:Required' | abpLocalization:' '}}\n </div>\n </ng-container>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: 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"] }, { kind: "pipe", type: i2$1.LocalizationPipe, name: "abpLocalization" }] }); }
1284
1221
  }
1285
1222
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorControlComponent, decorators: [{
1286
1223
  type: Component,
@@ -1319,21 +1256,21 @@ function AddFieldControlGroup(array = []) {
1319
1256
  }
1320
1257
 
1321
1258
  class CkEditorModule {
1322
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1323
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, declarations: [CkEditorControlComponent,
1259
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1260
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, declarations: [CkEditorControlComponent,
1324
1261
  CkEditorConfigComponent,
1325
1262
  CkEditorDomeComponent], imports: [FormsModule,
1326
1263
  CoreModule,
1327
1264
  ThemeSharedModule,
1328
1265
  ReactiveFormsModule,
1329
1266
  CkEditorRoutingModule,
1330
- CKEditorModule] });
1331
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, imports: [FormsModule,
1267
+ CKEditorModule] }); }
1268
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, imports: [FormsModule,
1332
1269
  CoreModule,
1333
1270
  ThemeSharedModule,
1334
1271
  ReactiveFormsModule,
1335
1272
  CkEditorRoutingModule,
1336
- CKEditorModule] });
1273
+ CKEditorModule] }); }
1337
1274
  }
1338
1275
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CkEditorModule, decorators: [{
1339
1276
  type: NgModule,
@@ -1355,6 +1292,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1355
1292
  }]
1356
1293
  }] });
1357
1294
 
1295
+ class isBase64UploadAdapter {
1296
+ constructor(input) {
1297
+ this.reader = new FileReader();
1298
+ this.Base64 = false;
1299
+ this.createFile = (input, config) => this.restService.request({
1300
+ method: 'POST',
1301
+ url: '/api/file-explorer/files',
1302
+ params: {
1303
+ containerName: input.containerName,
1304
+ cellName: input.cellName,
1305
+ directoryId: input.directoryId,
1306
+ entityId: input.entityId,
1307
+ },
1308
+ body: input.file,
1309
+ }, { apiName: 'FileExplorer', ...config });
1310
+ this.loader = input.loader;
1311
+ this.ImagesContainerName = input.ImagesContainerName;
1312
+ this.restService = input.restService;
1313
+ this.configState = input.configState;
1314
+ this.environment = input.environment;
1315
+ }
1316
+ upload() {
1317
+ return new Promise((resolve, reject) => {
1318
+ const reader = this.reader;
1319
+ if (this.Base64) {
1320
+ reader.addEventListener('load', () => {
1321
+ resolve({ default: reader.result });
1322
+ });
1323
+ reader.addEventListener('error', err => {
1324
+ reject(err);
1325
+ });
1326
+ reader.addEventListener('abort', () => {
1327
+ reject();
1328
+ });
1329
+ this.loader.file.then((file) => {
1330
+ reader.readAsDataURL(file);
1331
+ });
1332
+ }
1333
+ else {
1334
+ this.loader.file.then((file) => {
1335
+ var formData = new FormData();
1336
+ formData.append('file', file, file.name);
1337
+ this.createFile({
1338
+ file: formData,
1339
+ containerName: this.ImagesContainerName,
1340
+ // directoryId: '',
1341
+ // entityId: ''
1342
+ }).subscribe((response) => {
1343
+ let tenantId = this.configState.getDeep('currentUser.tenantId');
1344
+ const environment = this.environment.getEnvironment();
1345
+ let imgUrl = `${environment.apis.default.url}/api/file-explorer/files/${this.ImagesContainerName}/${response.blobName}?__tenant=${tenantId}`;
1346
+ resolve({ default: imgUrl });
1347
+ }, error => {
1348
+ reject(error);
1349
+ });
1350
+ });
1351
+ }
1352
+ });
1353
+ }
1354
+ }
1355
+
1358
1356
  /*
1359
1357
  * Public API Surface of ck-editor
1360
1358
  */
@@ -1363,5 +1361,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1363
1361
  * Generated bundle index. Do not edit.
1364
1362
  */
1365
1363
 
1366
- export { AddFieldControlGroup, CkEditorModule, CkEditorRoutingModule, CkEditorTypesObject, LanguagesMap, ckEditorFieldControlGroup, defaults, easy, full, getExcludeAssignControl, standard };
1364
+ export { AddFieldControlGroup, CkEditorModule, CkEditorRoutingModule, CkEditorTypesObject, LanguagesMap, ckEditorFieldControlGroup, defaults, easy, full, getExcludeAssignControl, isBase64UploadAdapter, standard };
1367
1365
  //# sourceMappingURL=dignite-ng-expand.ck-editor.mjs.map