@dignite-ng/expand.dynamic-form 0.0.12 → 0.0.16

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.
@@ -1,17 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, ViewChild, ChangeDetectionStrategy, inject, Injectable, ViewContainerRef, NgModule } from '@angular/core';
2
+ import { Component, Input, ViewChild, ChangeDetectionStrategy, inject, Inject, Injectable, ViewContainerRef, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
- import { Validators, FormBuilder, FormsModule, ReactiveFormsModule, FormArray, FormGroup, FormControl } from '@angular/forms';
4
+ import { Validators, FormBuilder, FormArray, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import * as i2 from '@abp/ng.core';
6
6
  import { RestService, ConfigStateService, CoreModule } from '@abp/ng.core';
7
7
  import { ThemeSharedModule } from '@abp/ng.theme.shared';
8
8
  import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
9
9
  import { NzTreeModule } from 'ng-zorro-antd/tree';
10
- import * as i4 from '@dignite-ng/expand.file-explorer';
11
- import { FileExplorerModule } from '@dignite-ng/expand.file-explorer';
12
10
  import * as i3 from '@ngx-validate/core';
13
11
  import * as i2$1 from '@angular/common';
14
- import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
12
+ import { DOCUMENT } from '@angular/common';
15
13
  import '@ckeditor/ckeditor5-build-classic/build/translations/zh-cn.js';
16
14
  import '@ckeditor/ckeditor5-build-classic/build/translations/zh.js';
17
15
  import '@ckeditor/ckeditor5-build-classic/build/translations/de.js';
@@ -29,8 +27,6 @@ import '@ckeditor/ckeditor5-build-classic/build/translations/sk';
29
27
  import '@ckeditor/ckeditor5-build-classic/build/translations/ja.js';
30
28
  import '@ckeditor/ckeditor5-build-classic/build/translations/es.js';
31
29
  import '@ckeditor/ckeditor5-build-classic/build/translations/vi.js';
32
- import * as i1$1 from '@ckeditor/ckeditor5-angular';
33
- import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
34
30
  import { pinyin } from 'pinyin-pro';
35
31
 
36
32
  class TextEditConfig {
@@ -670,8 +666,10 @@ class isBase64UploadAdapter {
670
666
  }
671
667
 
672
668
  class CkEditorControlComponent {
673
- // public Editor ;
674
- Editor = ClassicEditor;
669
+ renderer;
670
+ document;
671
+ _restService = inject(RestService);
672
+ config = inject(ConfigStateService);
675
673
  languagesMap = {
676
674
  ar: 'ar',
677
675
  cs: 'cs',
@@ -692,50 +690,89 @@ class CkEditorControlComponent {
692
690
  ja: 'ja',
693
691
  vi: 'vi',
694
692
  };
695
- fb = inject(FormBuilder);
696
- restService = inject(RestService);
697
- config = inject(ConfigStateService);
698
- constructor() {
693
+ ckeditor;
694
+ Editor;
695
+ constructor(renderer, document) {
696
+ this.renderer = renderer;
697
+ this.document = document;
698
+ this.addScript('https://cdn.ckeditor.com/ckeditor5/41.4.1/classic/ckeditor.js');
699
+ }
700
+ addScript(url) {
701
+ const script = this.renderer.createElement('script');
702
+ this.renderer.setAttribute(script, 'type', 'text/javascript');
703
+ this.renderer.setAttribute(script, 'src', url);
704
+ script.onload = () => {
705
+ this._init_Editor();
706
+ };
707
+ this.renderer.appendChild(this.document.head, script);
708
+ }
709
+ // 初始化富文本
710
+ _init_Editor() {
699
711
  const currentCulture = this.config.getOne("localization")?.currentCulture?.name;
700
- this.editorConfig = {
712
+ ClassicEditor.create(this.ckeditor?.nativeElement, {
701
713
  language: this.languagesMap[currentCulture],
702
- placeholder: '',
703
714
  toolbar: {
704
- removeItems: ['mediaEmbed', 'insertTable', 'undo', 'redo'],
715
+ items: [
716
+ 'heading', '|', 'Alignment', 'FontSize', 'FontColor', 'FontFamily', 'Highlight', '|',
717
+ 'bold', 'italic',
718
+ 'link', '|',
719
+ 'bulletedList', 'numberedList',
720
+ 'insertTable', '|',
721
+ 'uploadImage', 'ImageResize', '|',
722
+ 'undo', 'redo'
723
+ ],
724
+ viewportTopOffset: 30,
705
725
  shouldNotGroupWhenFull: true
706
726
  },
707
- styles: [
708
- 'alignCenter',
709
- 'alignLeft',
710
- 'alignRight'
711
- ],
712
727
  image: {
713
728
  toolbar: [
714
- 'imageTextAlternative', 'toggleImageCaption', '|',
715
- 'imageStyle:inline', 'imageStyle:wrapText', 'imageStyle:breakText', 'imageStyle:side', '|',
716
- ,
717
- 'resizeImage'
729
+ 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight',
730
+ '|',
731
+ 'resizeImage',
732
+ '|',
733
+ 'imageTextAlternative'
718
734
  ],
719
- insert: {
720
- integrations: [
721
- 'insertImageViaUrl'
722
- ]
723
- }
724
- }
725
- };
726
- }
727
- /**富文本配置 */
728
- editorConfig = {};
729
- //**富文本加载完成 */
730
- onReady(editor) {
731
- let that = this;
732
- editor.plugins.get('FileRepository').createUploadAdapter = function (loader) {
733
- return new isBase64UploadAdapter(loader, that.imagesContainerName, that.restService);
734
- };
735
- }
736
- /**富文本内容改变 */
737
- onChange({ editor }) {
735
+ styles: [
736
+ 'alignLeft', 'alignCenter', 'alignRight'
737
+ ],
738
+ resizeOptions: [{
739
+ name: 'resizeImage:original',
740
+ label: 'Original',
741
+ value: null
742
+ },
743
+ {
744
+ name: 'resizeImage:25',
745
+ label: '25%',
746
+ value: '25'
747
+ },
748
+ {
749
+ name: 'resizeImage:50',
750
+ label: '50%',
751
+ value: '50'
752
+ },
753
+ {
754
+ name: 'resizeImage:75',
755
+ label: '75%',
756
+ value: '75'
757
+ }
758
+ ],
759
+ },
760
+ }).then((editor) => {
761
+ this.Editor = editor;
762
+ this.dataLoaded();
763
+ var _this = this;
764
+ editor.plugins.get('FileRepository').createUploadAdapter = function (loader) {
765
+ return new isBase64UploadAdapter(loader, _this.imagesContainerName, _this._restService);
766
+ };
767
+ editor.model.document.on('change:data', () => {
768
+ const data = editor.getData();
769
+ this.setckeditorInput(data);
770
+ });
771
+ }).catch((err) => {
772
+ console.log(err);
773
+ });
738
774
  }
775
+ fb = inject(FormBuilder);
739
776
  /**表单实体 */
740
777
  _entity;
741
778
  set entity(v) {
@@ -764,17 +801,29 @@ class CkEditorControlComponent {
764
801
  get extraProperties() {
765
802
  return this._entity.get('extraProperties');
766
803
  }
804
+ get ckeditorInput() {
805
+ return this.extraProperties.get(this._fields.field.name);
806
+ }
767
807
  /**数据加载完成 */
768
808
  async dataLoaded() {
769
- if (this._fields && this._entity) {
809
+ if (this._fields && this._entity && this.Editor) {
770
810
  await this.AfterInit();
811
+ if (this._selected) {
812
+ this.Editor.setData(this._selected);
813
+ this.setckeditorInput(this._selected);
814
+ }
771
815
  this.submitclick.nativeElement.click();
772
816
  }
773
817
  }
818
+ invalidfeedback = false;
819
+ setckeditorInput(val) {
820
+ this.invalidfeedback = true;
821
+ this.ckeditorInput.patchValue(val);
822
+ }
774
823
  /**图片容器名称 */
775
- imagesContainerName;
824
+ imagesContainerName = 111;
776
825
  AfterInit() {
777
- return new Promise((resolve, rejects) => {
826
+ return new Promise((resolve) => {
778
827
  let ValidatorsArray = [];
779
828
  if (this._fields.required) {
780
829
  ValidatorsArray.push(Validators.required);
@@ -785,19 +834,19 @@ class CkEditorControlComponent {
785
834
  resolve(true);
786
835
  });
787
836
  }
788
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
789
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CkEditorControlComponent, isStandalone: true, selector: "df-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\" [config]=\"editorConfig\" formControlName=\"{{_fields.field.name}}\"\n (ready)=\"onReady($event)\" (change)=\"onChange($event)\" required=\"\" name=\"overview\"></ckeditor>\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: "ngmodule", type: CKEditorModule }, { kind: "component", type: i1$1.CKEditorComponent, selector: "ckeditor", inputs: ["editor", "config", "data", "tagName", "watchdog", "editorWatchdogConfig", "disableTwoWayDataBinding", "disabled"], outputs: ["ready", "change", "blur", "focus", "error"] }, { kind: "ngmodule", type: FormsModule }, { 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: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i2$1.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: "ngmodule", type: ThemeSharedModule }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "ngmodule", type: ReactiveFormsModule }] });
837
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorControlComponent, deps: [{ token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
838
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CkEditorControlComponent, selector: "df-ck-editor-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected" }, viewQueries: [{ propertyName: "ckeditor", first: true, predicate: ["ckeditor"], descendants: true, static: true }, { 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 <div #ckeditor id=\"ckeditor\"></div>\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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] });
790
839
  }
791
840
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorControlComponent, decorators: [{
792
841
  type: Component,
793
- args: [{ selector: 'df-ck-editor-control', standalone: true, imports: [
794
- CKEditorModule,
795
- FormsModule,
796
- CoreModule,
797
- ThemeSharedModule,
798
- ReactiveFormsModule,
799
- ], 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\" [config]=\"editorConfig\" formControlName=\"{{_fields.field.name}}\"\n (ready)=\"onReady($event)\" (change)=\"onChange($event)\" required=\"\" name=\"overview\"></ckeditor>\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>" }]
800
- }], ctorParameters: function () { return []; }, propDecorators: { entity: [{
842
+ args: [{ selector: 'df-ck-editor-control', 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 <div #ckeditor id=\"ckeditor\"></div>\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>" }]
843
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: Document, decorators: [{
844
+ type: Inject,
845
+ args: [DOCUMENT]
846
+ }] }]; }, propDecorators: { ckeditor: [{
847
+ type: ViewChild,
848
+ args: ['ckeditor', { static: true }]
849
+ }], entity: [{
801
850
  type: Input
802
851
  }], fields: [{
803
852
  type: Input
@@ -991,176 +1040,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
991
1040
  args: ['submitclick', { static: true }]
992
1041
  }] } });
993
1042
 
994
- class FileExplorerConfig {
995
- /**文件容器名称 */
996
- 'FileExplorer.FileContainerName' = ['', [Validators.required]];
997
- /**多选 */
998
- 'FileExplorer.UploadFileMultiple' = [false, []];
999
- constructor(data) {
1000
- if (data) {
1001
- for (const key in data) {
1002
- if (data.hasOwnProperty(key)) {
1003
- this[key] = data[key];
1004
- }
1005
- }
1006
- }
1007
- }
1008
- }
1009
-
1010
- class FileExplorerConfigComponent {
1011
- fb;
1012
- constructor(fb) {
1013
- this.fb = fb;
1014
- }
1015
- /**表单控件类型 */
1016
- _type;
1017
- set type(v) {
1018
- this._type = v;
1019
- this.dataLoaded();
1020
- }
1021
- /**表单实体 */
1022
- _Entity;
1023
- set Entity(v) {
1024
- this._Entity = v;
1025
- this.dataLoaded();
1026
- }
1027
- /**选择的表单信息 */
1028
- _selected;
1029
- set selected(v) {
1030
- this._selected = v;
1031
- this.dataLoaded();
1032
- }
1033
- get formConfiguration() {
1034
- return this._Entity.get('formConfiguration');
1035
- }
1036
- submitclick;
1037
- async dataLoaded() {
1038
- if (this._Entity && this._type) {
1039
- await this.AfterInit();
1040
- this.submitclick?.nativeElement?.click();
1041
- }
1042
- }
1043
- AfterInit() {
1044
- return new Promise((resolve, rejects) => {
1045
- this._Entity.setControl('formConfiguration', this.fb.group(new FileExplorerConfig()));
1046
- if (this._selected && this._selected.formControlName == this._type) {
1047
- this.formConfiguration.patchValue({
1048
- ...this._selected.formConfiguration
1049
- });
1050
- }
1051
- resolve(true);
1052
- });
1053
- }
1054
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
1055
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileExplorerConfigComponent, selector: "df-file-explorer-config", inputs: { type: "type", Entity: "Entity", selected: "selected" }, 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\">{{'DigniteAbpDynamicFormsFileExplorer::FileContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FileExplorer.FileContainerName\">\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"FileExplorer.UploadFileMultiple\" id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpDynamicFormsFileExplorer::UploadFileMultiple' | abpLocalization}}\n </label>\n </div>\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.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { 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.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] });
1056
- }
1057
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerConfigComponent, decorators: [{
1058
- type: Component,
1059
- args: [{ selector: 'df-file-explorer-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsFileExplorer::FileContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FileExplorer.FileContainerName\">\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"FileExplorer.UploadFileMultiple\" id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpDynamicFormsFileExplorer::UploadFileMultiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
1060
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { type: [{
1061
- type: Input
1062
- }], Entity: [{
1063
- type: Input
1064
- }], selected: [{
1065
- type: Input
1066
- }], submitclick: [{
1067
- type: ViewChild,
1068
- args: ['submitclick', { static: true }]
1069
- }] } });
1070
-
1071
- class FileExplorerControlComponent {
1072
- fb;
1073
- constructor(fb) {
1074
- this.fb = fb;
1075
- }
1076
- /**表单实体 */
1077
- _entity;
1078
- set entity(v) {
1079
- this._entity = v;
1080
- if (v)
1081
- this.dataLoaded();
1082
- }
1083
- /**字段配置列表 */
1084
- _fields = '';
1085
- set fields(v) {
1086
- this._fields = v;
1087
- if (v)
1088
- this.dataLoaded();
1089
- }
1090
- /**父级字段名称,用于为表单设置控件赋值 */
1091
- _parentFiledName;
1092
- set parentFiledName(v) {
1093
- this._parentFiledName = v;
1094
- if (v)
1095
- this.dataLoaded();
1096
- }
1097
- /**父级字段名称,用于为表单设置控件赋值 */
1098
- _selected;
1099
- set selected(v) {
1100
- this._selected = v;
1101
- if (v && v.length > 0)
1102
- this.dataLoaded();
1103
- }
1104
- submitclick;
1105
- get extraProperties() {
1106
- return this._entity.get('extraProperties');
1107
- }
1108
- /**数据加载完成 */
1109
- async dataLoaded() {
1110
- if (this._fields && this._entity && this._parentFiledName) {
1111
- await this.AfterInit();
1112
- this.submitclick.nativeElement.click();
1113
- }
1114
- }
1115
- /**字段配置 */
1116
- formConfiguration = '';
1117
- /**文件容器名称 */
1118
- FileContainerName = '';
1119
- AfterInit() {
1120
- return new Promise((resolve, rejects) => {
1121
- let ValidatorsArray = [];
1122
- if (this._fields.required) {
1123
- ValidatorsArray.push(Validators.required);
1124
- }
1125
- this.formConfiguration = this._fields.field.formConfiguration;
1126
- this.FileContainerName = this.formConfiguration['FileExplorer.FileContainerName'];
1127
- if (this._selected && this._selected.length > 0) {
1128
- this.selectedFileGroup = this._selected;
1129
- }
1130
- let newControl = this.fb.control(this._selected, ValidatorsArray);
1131
- this.extraProperties.setControl(this._fields.field.name, newControl);
1132
- resolve(true);
1133
- });
1134
- }
1135
- /**选择文件-弹窗的-已选定的文件 */
1136
- selectedFileGroup = [];
1137
- /**_selectedFile改变回调 */
1138
- _selectedFileChange(event) {
1139
- this.selectedFileGroup = event;
1140
- let fieldName = this._fields.field.name;
1141
- let obj = {};
1142
- obj[fieldName] = event;
1143
- this.extraProperties.patchValue(obj);
1144
- }
1145
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerControlComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
1146
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileExplorerControlComponent, selector: "df-file-explorer-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 <fe-file-picker [selectFormFile]=\"selectedFileGroup\" [multiple]=\"formConfiguration['FileExplorer.UploadFileMultiple']\"\n (selectedFileChange)=\"_selectedFileChange($event)\"></fe-file-picker>\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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i4.FilePickerComponent, selector: "fe-file-picker", inputs: ["multiple", "fileContainerName", "selectFormFile"], outputs: ["selectedFileChange"] }] });
1147
- }
1148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerControlComponent, decorators: [{
1149
- type: Component,
1150
- args: [{ selector: 'df-file-explorer-control', 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 <fe-file-picker [selectFormFile]=\"selectedFileGroup\" [multiple]=\"formConfiguration['FileExplorer.UploadFileMultiple']\"\n (selectedFileChange)=\"_selectedFileChange($event)\"></fe-file-picker>\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>" }]
1151
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { entity: [{
1152
- type: Input
1153
- }], fields: [{
1154
- type: Input
1155
- }], parentFiledName: [{
1156
- type: Input
1157
- }], selected: [{
1158
- type: Input
1159
- }], submitclick: [{
1160
- type: ViewChild,
1161
- args: ['submitclick', { static: true }]
1162
- }] } });
1163
-
1164
1043
  class SelectConfig {
1165
1044
  /**空值文本 */
1166
1045
  'Select.NullText' = ['', []];
@@ -1469,12 +1348,6 @@ const FieldControlGroup = [
1469
1348
  // fieldViewComponent:TextBoxViewComponent,
1470
1349
  },
1471
1350
  {
1472
- displayName: '文件管理',
1473
- name: 'FileExplorer',
1474
- fieldConfigComponent: FileExplorerConfigComponent,
1475
- fieldComponent: FileExplorerControlComponent,
1476
- // fieldViewComponent:TextBoxViewComponent,
1477
- }, {
1478
1351
  displayName: 'CkEditor',
1479
1352
  name: 'CkEditor',
1480
1353
  fieldConfigComponent: CkEditorConfigComponent,
@@ -1547,7 +1420,7 @@ class DynamicComponent {
1547
1420
  let fieldControlItem = this._fieldControlGroup.find(el => el.name === this._type);
1548
1421
  this.loadfieldConfigComponent(fieldControlItem);
1549
1422
  }
1550
- if (this._fields && this._parentFiledName) {
1423
+ if (this._fields && this._parentFiledName && this._culture) {
1551
1424
  /**表单控件组中的项 */
1552
1425
  let fieldControlItem = this._fieldControlGroup.find(el => el.name === this._fields.field.formControlName);
1553
1426
  this.loadfieldComponent(fieldControlItem);
@@ -1610,6 +1483,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1610
1483
  args: ['FormComponentsRef', { read: ViewContainerRef, static: true }]
1611
1484
  }] } });
1612
1485
 
1486
+ // import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
1613
1487
  class DynamicFormModule {
1614
1488
  static forRoot(config) {
1615
1489
  AddFieldControlGroup(config.cmsFieldControlGroup);
@@ -1627,18 +1501,16 @@ class DynamicFormModule {
1627
1501
  NumbericEditControlComponent,
1628
1502
  DateEditConfigComponent,
1629
1503
  DateEditControlComponent,
1630
- FileExplorerConfigComponent,
1631
- FileExplorerControlComponent,
1632
1504
  CkEditorConfigComponent,
1633
1505
  SelectConfigComponent,
1634
1506
  SelectControlComponent,
1635
- DynamicComponent], imports: [FormsModule,
1507
+ DynamicComponent,
1508
+ CkEditorControlComponent], imports: [FormsModule,
1636
1509
  CoreModule,
1637
1510
  ThemeSharedModule,
1638
1511
  ReactiveFormsModule,
1639
1512
  NgbDropdownModule,
1640
- NzTreeModule,
1641
- FileExplorerModule], exports: [TextEditConfigComponent,
1513
+ NzTreeModule], exports: [TextEditConfigComponent,
1642
1514
  TextEditComponent,
1643
1515
  SwitchConfigComponent,
1644
1516
  SwitchControlComponent,
@@ -1646,8 +1518,6 @@ class DynamicFormModule {
1646
1518
  NumbericEditControlComponent,
1647
1519
  DateEditConfigComponent,
1648
1520
  DateEditControlComponent,
1649
- FileExplorerConfigComponent,
1650
- FileExplorerControlComponent,
1651
1521
  CkEditorConfigComponent,
1652
1522
  SelectConfigComponent,
1653
1523
  SelectControlComponent,
@@ -1657,8 +1527,7 @@ class DynamicFormModule {
1657
1527
  ThemeSharedModule,
1658
1528
  ReactiveFormsModule,
1659
1529
  NgbDropdownModule,
1660
- NzTreeModule,
1661
- FileExplorerModule] });
1530
+ NzTreeModule] });
1662
1531
  }
1663
1532
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicFormModule, decorators: [{
1664
1533
  type: NgModule,
@@ -1672,12 +1541,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1672
1541
  NumbericEditControlComponent,
1673
1542
  DateEditConfigComponent,
1674
1543
  DateEditControlComponent,
1675
- FileExplorerConfigComponent,
1676
- FileExplorerControlComponent,
1677
1544
  CkEditorConfigComponent,
1678
1545
  SelectConfigComponent,
1679
1546
  SelectControlComponent,
1680
1547
  DynamicComponent,
1548
+ CkEditorControlComponent
1681
1549
  ],
1682
1550
  imports: [
1683
1551
  FormsModule,
@@ -1686,8 +1554,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1686
1554
  ReactiveFormsModule,
1687
1555
  NgbDropdownModule,
1688
1556
  NzTreeModule,
1689
- FileExplorerModule,
1690
- // DynamicComponent
1557
+ // FileExplorerModule,
1558
+ // CKEditorModule,
1691
1559
  ],
1692
1560
  exports: [
1693
1561
  TextEditConfigComponent,
@@ -1698,8 +1566,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1698
1566
  NumbericEditControlComponent,
1699
1567
  DateEditConfigComponent,
1700
1568
  DateEditControlComponent,
1701
- FileExplorerConfigComponent,
1702
- FileExplorerControlComponent,
1703
1569
  CkEditorConfigComponent,
1704
1570
  SelectConfigComponent,
1705
1571
  SelectControlComponent,
@@ -1716,5 +1582,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1716
1582
  * Generated bundle index. Do not edit.
1717
1583
  */
1718
1584
 
1719
- export { AddFieldControlGroup, CkEditorConfigComponent, CkEditorControlComponent, DateEditConfigComponent, DateEditControlComponent, DynamicComponent, DynamicFormModule, FieldControlGroup, FileExplorerConfigComponent, FileExplorerControlComponent, NumbericEditConfigComponent, NumbericEditControlComponent, SelectConfigComponent, SelectControlComponent, SwitchConfigComponent, SwitchControlComponent, TextEditComponent, TextEditConfig, TextEditConfigComponent, getExcludeAssignControl, maxDecimalPlacesValidator };
1585
+ export { AddFieldControlGroup, CkEditorConfigComponent, CkEditorControlComponent, DateEditConfigComponent, DateEditControlComponent, DynamicComponent, DynamicFormModule, FieldControlGroup, NumbericEditConfigComponent, NumbericEditControlComponent, SelectConfigComponent, SelectControlComponent, SwitchConfigComponent, SwitchControlComponent, TextEditComponent, TextEditConfig, TextEditConfigComponent, getExcludeAssignControl, maxDecimalPlacesValidator };
1720
1586
  //# sourceMappingURL=dignite-ng-expand.dynamic-form.mjs.map