@dignite-ng/expand.dynamic-form 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/dynamic/dynamic.component.mjs +1 -1
- package/esm2022/lib/components/from/ck-editor/ck-editor-control.component.mjs +72 -30
- package/esm2022/lib/components/from/file-explorer/file-explorer-control.component.mjs +3 -3
- package/esm2022/lib/components/from/text-edit/text-edit.component.mjs +7 -1
- package/esm2022/lib/services/df-api.service.mjs +3 -2
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs +80 -32
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -1
- package/lib/components/from/ck-editor/ck-editor-control.component.d.ts +41 -17
- package/lib/components/from/text-edit/text-edit.component.d.ts +1 -0
- package/lib/services/df-api.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,23 @@ import { FileExplorerModule } from '@dignite-ng/expand.file-explorer';
|
|
|
12
12
|
import * as i3 from '@ngx-validate/core';
|
|
13
13
|
import * as i2$1 from '@angular/common';
|
|
14
14
|
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
|
|
15
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/zh-cn.js';
|
|
16
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/zh.js';
|
|
17
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/de.js';
|
|
18
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/de-ch.js';
|
|
19
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/ar';
|
|
20
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/cs.js';
|
|
21
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/hi.js';
|
|
22
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/fi.js';
|
|
23
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/hu.js';
|
|
24
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/fr.js';
|
|
25
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/it.js';
|
|
26
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/en-gb.js';
|
|
27
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/pt-br.js';
|
|
28
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/sk';
|
|
29
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/ja.js';
|
|
30
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/es.js';
|
|
31
|
+
import '@ckeditor/ckeditor5-build-classic/build/translations/vi.js';
|
|
15
32
|
import * as i3$1 from '@ckeditor/ckeditor5-angular';
|
|
16
33
|
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
|
|
17
34
|
import { pinyin } from 'pinyin-pro';
|
|
@@ -159,6 +176,10 @@ class TextEditComponent {
|
|
|
159
176
|
if (this._fields.required) {
|
|
160
177
|
ValidatorsArray.push(Validators.required);
|
|
161
178
|
}
|
|
179
|
+
this._fields.field.formConfiguration = {
|
|
180
|
+
...this.fb.group(new TextEditConfig()).value,
|
|
181
|
+
...this._fields.field.formConfiguration
|
|
182
|
+
};
|
|
162
183
|
if (this._fields.field.formConfiguration['TextEdit.CharLimit']) {
|
|
163
184
|
ValidatorsArray.push(Validators.maxLength(this._fields.field.formConfiguration['TextEdit.CharLimit']));
|
|
164
185
|
}
|
|
@@ -167,6 +188,7 @@ class TextEditComponent {
|
|
|
167
188
|
resolve(true);
|
|
168
189
|
});
|
|
169
190
|
}
|
|
191
|
+
isObjEmpty = (obj) => Object.keys(obj).length === 0;
|
|
170
192
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextEditComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
171
193
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TextEditComponent, selector: "df-text-edit", 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]=\"_parentFiledName\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"_fields.field.formConfiguration['TextEdit.Mode'] ===_TextEditMode.SingleLine\">\n <input type=\"text\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['TextEdit.Placeholder']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['TextEdit.Mode'] === _TextEditMode.MultipleLine\">\n <textarea class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['TextEdit.Placeholder']\" rows=\"3\"></textarea>\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.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: 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: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }] });
|
|
172
194
|
}
|
|
@@ -658,38 +680,63 @@ class isBase64UploadAdapter {
|
|
|
658
680
|
class CkEditorControlComponent {
|
|
659
681
|
fb;
|
|
660
682
|
restService;
|
|
661
|
-
|
|
683
|
+
config;
|
|
684
|
+
languagesMap = {
|
|
685
|
+
ar: 'ar',
|
|
686
|
+
cs: 'cs',
|
|
687
|
+
en: 'en',
|
|
688
|
+
hi: 'hi',
|
|
689
|
+
fi: 'fi',
|
|
690
|
+
hu: 'hu',
|
|
691
|
+
fr: 'fr',
|
|
692
|
+
it: 'it',
|
|
693
|
+
'en-GB': 'en-gb',
|
|
694
|
+
'pt-BR': 'pt-br',
|
|
695
|
+
'zh-Hant': 'zh',
|
|
696
|
+
'zh-Hans': 'zh-cn',
|
|
697
|
+
tr: 'tr',
|
|
698
|
+
sk: 'sk',
|
|
699
|
+
'de-DE': 'de',
|
|
700
|
+
es: 'es',
|
|
701
|
+
ja: 'ja',
|
|
702
|
+
vi: 'vi',
|
|
703
|
+
};
|
|
704
|
+
constructor(fb, restService, config) {
|
|
662
705
|
this.fb = fb;
|
|
663
706
|
this.restService = restService;
|
|
707
|
+
this.config = config;
|
|
708
|
+
const currentCulture = this.config.getOne("localization")?.currentCulture?.name;
|
|
709
|
+
this.editorConfig = {
|
|
710
|
+
language: this.languagesMap[currentCulture],
|
|
711
|
+
// language: currentCulture||'en',
|
|
712
|
+
placeholder: '',
|
|
713
|
+
toolbar: {
|
|
714
|
+
removeItems: ['mediaEmbed'],
|
|
715
|
+
shouldNotGroupWhenFull: true
|
|
716
|
+
},
|
|
717
|
+
styles: [
|
|
718
|
+
'alignCenter',
|
|
719
|
+
'alignLeft',
|
|
720
|
+
'alignRight'
|
|
721
|
+
],
|
|
722
|
+
image: {
|
|
723
|
+
toolbar: [
|
|
724
|
+
'imageTextAlternative', 'toggleImageCaption', '|',
|
|
725
|
+
'imageStyle:inline', 'imageStyle:wrapText', 'imageStyle:breakText', 'imageStyle:side', '|',
|
|
726
|
+
,
|
|
727
|
+
'resizeImage'
|
|
728
|
+
],
|
|
729
|
+
insert: {
|
|
730
|
+
integrations: [
|
|
731
|
+
'insertImageViaUrl'
|
|
732
|
+
]
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
};
|
|
664
736
|
}
|
|
665
737
|
Editor = ClassicEditor;
|
|
666
738
|
/**富文本配置 */
|
|
667
|
-
editorConfig = {
|
|
668
|
-
language: 'zh-cn',
|
|
669
|
-
placeholder: '',
|
|
670
|
-
toolbar: {
|
|
671
|
-
removeItems: ['mediaEmbed'],
|
|
672
|
-
shouldNotGroupWhenFull: true
|
|
673
|
-
},
|
|
674
|
-
styles: [
|
|
675
|
-
'alignCenter',
|
|
676
|
-
'alignLeft',
|
|
677
|
-
'alignRight'
|
|
678
|
-
],
|
|
679
|
-
image: {
|
|
680
|
-
toolbar: [
|
|
681
|
-
'imageTextAlternative', 'toggleImageCaption', '|',
|
|
682
|
-
'imageStyle:inline', 'imageStyle:wrapText', 'imageStyle:breakText', 'imageStyle:side', '|',
|
|
683
|
-
,
|
|
684
|
-
'resizeImage'
|
|
685
|
-
],
|
|
686
|
-
insert: {
|
|
687
|
-
integrations: [
|
|
688
|
-
'insertImageViaUrl'
|
|
689
|
-
]
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
};
|
|
739
|
+
editorConfig = {};
|
|
693
740
|
//**富文本加载完成 */
|
|
694
741
|
onReady(editor) {
|
|
695
742
|
let that = this;
|
|
@@ -755,7 +802,7 @@ class CkEditorControlComponent {
|
|
|
755
802
|
resolve(true);
|
|
756
803
|
});
|
|
757
804
|
}
|
|
758
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorControlComponent, deps: [{ token: i1.FormBuilder }, { token: i2.RestService }], target: i0.ɵɵFactoryTarget.Component });
|
|
805
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorControlComponent, deps: [{ token: i1.FormBuilder }, { token: i2.RestService }, { token: i2.ConfigStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
759
806
|
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: i3$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 }] });
|
|
760
807
|
}
|
|
761
808
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorControlComponent, decorators: [{
|
|
@@ -767,7 +814,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
767
814
|
ThemeSharedModule,
|
|
768
815
|
ReactiveFormsModule,
|
|
769
816
|
], 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>" }]
|
|
770
|
-
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.RestService }]; }, propDecorators: { entity: [{
|
|
817
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.RestService }, { type: i2.ConfigStateService }]; }, propDecorators: { entity: [{
|
|
771
818
|
type: Input
|
|
772
819
|
}], fields: [{
|
|
773
820
|
type: Input
|
|
@@ -1123,11 +1170,11 @@ class FileExplorerControlComponent {
|
|
|
1123
1170
|
console.log(event, '_selectedFile改变回调---file-explorer', this.extraProperties);
|
|
1124
1171
|
}
|
|
1125
1172
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerControlComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
1126
|
-
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
|
|
1173
|
+
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"] }] });
|
|
1127
1174
|
}
|
|
1128
1175
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerControlComponent, decorators: [{
|
|
1129
1176
|
type: Component,
|
|
1130
|
-
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
|
|
1177
|
+
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>" }]
|
|
1131
1178
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { entity: [{
|
|
1132
1179
|
type: Input
|
|
1133
1180
|
}], fields: [{
|
|
@@ -1170,7 +1217,8 @@ class DfApiService {
|
|
|
1170
1217
|
* */
|
|
1171
1218
|
chineseToPinyin(value) {
|
|
1172
1219
|
//去除字符串中所有的空格
|
|
1173
|
-
let val = value
|
|
1220
|
+
// let val = value
|
|
1221
|
+
let val = value.replaceAll(' ', "-");
|
|
1174
1222
|
let array = val.split('');
|
|
1175
1223
|
let newArray = [];
|
|
1176
1224
|
array.forEach((el, index) => {
|