@dignite-ng/expand.dynamic-form 0.0.2
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 +24 -0
- package/esm2022/dignite-ng-expand.dynamic-form.mjs +5 -0
- package/esm2022/lib/components/dynamic/dynamic.component.mjs +113 -0
- package/esm2022/lib/components/dynamic/index.mjs +2 -0
- package/esm2022/lib/components/from/ck-editor/ck-editor-config.component.mjs +65 -0
- package/esm2022/lib/components/from/ck-editor/ck-editor-config.mjs +18 -0
- package/esm2022/lib/components/from/ck-editor/ck-editor-control.component.mjs +139 -0
- package/esm2022/lib/components/from/ck-editor/ckEditorUpload.mjs +55 -0
- package/esm2022/lib/components/from/ck-editor/index.mjs +3 -0
- package/esm2022/lib/components/from/date-edit/date-edit-config.component.mjs +70 -0
- package/esm2022/lib/components/from/date-edit/date-edit-config.mjs +26 -0
- package/esm2022/lib/components/from/date-edit/date-edit-control.component.mjs +93 -0
- package/esm2022/lib/components/from/date-edit/index.mjs +3 -0
- package/esm2022/lib/components/from/file-explorer/file-explorer-config.component.mjs +68 -0
- package/esm2022/lib/components/from/file-explorer/file-explorer-config.mjs +18 -0
- package/esm2022/lib/components/from/file-explorer/file-explorer-control.component.mjs +102 -0
- package/esm2022/lib/components/from/file-explorer/index.mjs +3 -0
- package/esm2022/lib/components/from/form-control-group.mjs +79 -0
- package/esm2022/lib/components/from/index.mjs +11 -0
- package/esm2022/lib/components/from/numeric-edit/index.mjs +3 -0
- package/esm2022/lib/components/from/numeric-edit/numberic-edit-config.component.mjs +68 -0
- package/esm2022/lib/components/from/numeric-edit/numberic-edit-config.mjs +25 -0
- package/esm2022/lib/components/from/numeric-edit/numberic-edit-control.component.mjs +113 -0
- package/esm2022/lib/components/from/select/index.mjs +3 -0
- package/esm2022/lib/components/from/select/select-config.component.mjs +91 -0
- package/esm2022/lib/components/from/select/select-config.mjs +20 -0
- package/esm2022/lib/components/from/select/select-control.component.mjs +89 -0
- package/esm2022/lib/components/from/switch/index.mjs +3 -0
- package/esm2022/lib/components/from/switch/switch-config.component.mjs +68 -0
- package/esm2022/lib/components/from/switch/switch-config.mjs +15 -0
- package/esm2022/lib/components/from/switch/switch-control.component.mjs +77 -0
- package/esm2022/lib/components/from/text-edit/index.mjs +4 -0
- package/esm2022/lib/components/from/text-edit/text-edit-config.component.mjs +70 -0
- package/esm2022/lib/components/from/text-edit/text-edit-config.mjs +24 -0
- package/esm2022/lib/components/from/text-edit/text-edit.component.mjs +84 -0
- package/esm2022/lib/components/index.mjs +3 -0
- package/esm2022/lib/dynamic-form.module.mjs +107 -0
- package/esm2022/lib/enums/date-edit-interfaces.mjs +16 -0
- package/esm2022/lib/enums/index.mjs +3 -0
- package/esm2022/lib/enums/text-edit-mode.mjs +8 -0
- package/esm2022/lib/interfaces/form-config-interfaces.mjs +2 -0
- package/esm2022/lib/interfaces/index.mjs +2 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +48 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +60 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/file-explorer/index.mjs +4 -0
- package/esm2022/lib/proxy/dignite/index.mjs +3 -0
- package/esm2022/lib/proxy/index.mjs +5 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/extensions/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/extensions/primitives/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/index.mjs +5 -0
- package/esm2022/lib/proxy/microsoft/net/http/headers/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/net/http/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/net/index.mjs +3 -0
- package/esm2022/lib/proxy/volo/abp/content/index.mjs +2 -0
- package/esm2022/lib/proxy/volo/abp/content/models.mjs +2 -0
- package/esm2022/lib/proxy/volo/abp/index.mjs +3 -0
- package/esm2022/lib/proxy/volo/index.mjs +3 -0
- package/esm2022/lib/services/df-api.service.mjs +82 -0
- package/esm2022/lib/services/index.mjs +2 -0
- package/esm2022/public-api.mjs +10 -0
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs +1867 -0
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dynamic/dynamic.component.d.ts +35 -0
- package/lib/components/dynamic/index.d.ts +1 -0
- package/lib/components/from/ck-editor/ck-editor-config.component.d.ts +21 -0
- package/lib/components/from/ck-editor/ck-editor-config.d.ts +7 -0
- package/lib/components/from/ck-editor/ck-editor-control.component.d.ts +51 -0
- package/lib/components/from/ck-editor/ckEditorUpload.d.ts +12 -0
- package/lib/components/from/ck-editor/index.d.ts +2 -0
- package/lib/components/from/date-edit/date-edit-config.component.d.ts +24 -0
- package/lib/components/from/date-edit/date-edit-config.d.ts +10 -0
- package/lib/components/from/date-edit/date-edit-control.component.d.ts +32 -0
- package/lib/components/from/date-edit/index.d.ts +2 -0
- package/lib/components/from/file-explorer/file-explorer-config.component.d.ts +22 -0
- package/lib/components/from/file-explorer/file-explorer-config.d.ts +7 -0
- package/lib/components/from/file-explorer/file-explorer-control.component.d.ts +34 -0
- package/lib/components/from/file-explorer/index.d.ts +2 -0
- package/lib/components/from/form-control-group.d.ts +7 -0
- package/lib/components/from/index.d.ts +8 -0
- package/lib/components/from/numeric-edit/index.d.ts +2 -0
- package/lib/components/from/numeric-edit/numberic-edit-config.component.d.ts +22 -0
- package/lib/components/from/numeric-edit/numberic-edit-config.d.ts +11 -0
- package/lib/components/from/numeric-edit/numberic-edit-control.component.d.ts +33 -0
- package/lib/components/from/select/index.d.ts +2 -0
- package/lib/components/from/select/select-config.component.d.ts +27 -0
- package/lib/components/from/select/select-config.d.ts +7 -0
- package/lib/components/from/select/select-control.component.d.ts +27 -0
- package/lib/components/from/switch/index.d.ts +2 -0
- package/lib/components/from/switch/switch-config.component.d.ts +22 -0
- package/lib/components/from/switch/switch-config.d.ts +5 -0
- package/lib/components/from/switch/switch-control.component.d.ts +26 -0
- package/lib/components/from/text-edit/index.d.ts +3 -0
- package/lib/components/from/text-edit/text-edit-config.component.d.ts +24 -0
- package/lib/components/from/text-edit/text-edit-config.d.ts +6 -0
- package/lib/components/from/text-edit/text-edit.component.d.ts +27 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/dynamic-form.module.d.ts +28 -0
- package/lib/enums/date-edit-interfaces.d.ts +5 -0
- package/lib/enums/index.d.ts +2 -0
- package/lib/enums/text-edit-mode.d.ts +4 -0
- package/lib/interfaces/form-config-interfaces.d.ts +17 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.d.ts +17 -0
- package/lib/proxy/dignite/file-explorer/directories/index.d.ts +2 -0
- package/lib/proxy/dignite/file-explorer/directories/models.d.ts +29 -0
- package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +20 -0
- package/lib/proxy/dignite/file-explorer/files/index.d.ts +2 -0
- package/lib/proxy/dignite/file-explorer/files/models.d.ts +50 -0
- package/lib/proxy/dignite/file-explorer/index.d.ts +3 -0
- package/lib/proxy/dignite/index.d.ts +2 -0
- package/lib/proxy/index.d.ts +4 -0
- package/lib/proxy/microsoft/asp-net-core/index.d.ts +2 -0
- package/lib/proxy/microsoft/asp-net-core/mvc/index.d.ts +1 -0
- package/lib/proxy/microsoft/asp-net-core/mvc/models.d.ts +10 -0
- package/lib/proxy/microsoft/extensions/index.d.ts +2 -0
- package/lib/proxy/microsoft/extensions/primitives/index.d.ts +1 -0
- package/lib/proxy/microsoft/extensions/primitives/models.d.ts +8 -0
- package/lib/proxy/microsoft/index.d.ts +4 -0
- package/lib/proxy/microsoft/net/http/headers/index.d.ts +1 -0
- package/lib/proxy/microsoft/net/http/headers/models.d.ts +6 -0
- package/lib/proxy/microsoft/net/http/index.d.ts +2 -0
- package/lib/proxy/microsoft/net/index.d.ts +2 -0
- package/lib/proxy/volo/abp/content/index.d.ts +1 -0
- package/lib/proxy/volo/abp/content/models.d.ts +5 -0
- package/lib/proxy/volo/abp/index.d.ts +2 -0
- package/lib/proxy/volo/index.d.ts +2 -0
- package/lib/services/df-api.service.d.ts +18 -0
- package/lib/services/index.d.ts +1 -0
- package/package.json +37 -0
- package/public-api.d.ts +6 -0
|
@@ -0,0 +1,1867 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, Input, ViewChild, ChangeDetectionStrategy, ViewContainerRef, NgModule, Injectable } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { Validators, FormsModule, ReactiveFormsModule, FormArray, FormGroup, FormControl } from '@angular/forms';
|
|
5
|
+
import * as i2 from '@abp/ng.core';
|
|
6
|
+
import { CoreModule } from '@abp/ng.core';
|
|
7
|
+
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
8
|
+
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
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
|
+
import * as i3 from '@ngx-validate/core';
|
|
13
|
+
import * as i2$1 from '@angular/common';
|
|
14
|
+
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
|
|
15
|
+
import * as i3$1 from '@ckeditor/ckeditor5-angular';
|
|
16
|
+
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
|
|
17
|
+
import { pinyin } from 'pinyin-pro';
|
|
18
|
+
|
|
19
|
+
class TextEditConfig {
|
|
20
|
+
// /**占位符 */
|
|
21
|
+
// // placeholder: any = new FormControl('', Validators.required);
|
|
22
|
+
// 'placeholder': any = ['', []];
|
|
23
|
+
// //字段类型,单行文本,多行文本
|
|
24
|
+
// textboxMode: any = ['simple', []];
|
|
25
|
+
// // 字数限制
|
|
26
|
+
// limit: any = ['265', []];
|
|
27
|
+
'TextEdit.Placeholder' = ['', []];
|
|
28
|
+
//字段类型,单行文本,多行文本
|
|
29
|
+
'TextEdit.Mode' = [0, []];
|
|
30
|
+
// 字数限制
|
|
31
|
+
'TextEdit.CharLimit' = ['265', []];
|
|
32
|
+
constructor(data) {
|
|
33
|
+
if (data) {
|
|
34
|
+
for (const key in data) {
|
|
35
|
+
if (data.hasOwnProperty(key)) {
|
|
36
|
+
this[key] = data[key];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var TextEditMode;
|
|
44
|
+
(function (TextEditMode) {
|
|
45
|
+
// 简单类型
|
|
46
|
+
TextEditMode[TextEditMode["SingleLine"] = 0] = "SingleLine";
|
|
47
|
+
// 复合类型;
|
|
48
|
+
TextEditMode[TextEditMode["MultipleLine"] = 1] = "MultipleLine";
|
|
49
|
+
})(TextEditMode || (TextEditMode = {}));
|
|
50
|
+
|
|
51
|
+
class TextEditConfigComponent {
|
|
52
|
+
fb;
|
|
53
|
+
constructor(fb) {
|
|
54
|
+
this.fb = fb;
|
|
55
|
+
}
|
|
56
|
+
_TextEditMode = TextEditMode;
|
|
57
|
+
/**表单控件类型 */
|
|
58
|
+
_type;
|
|
59
|
+
set type(v) {
|
|
60
|
+
this._type = v;
|
|
61
|
+
this.dataLoaded();
|
|
62
|
+
}
|
|
63
|
+
/**表单实体 */
|
|
64
|
+
_Entity;
|
|
65
|
+
set Entity(v) {
|
|
66
|
+
this._Entity = v;
|
|
67
|
+
this.dataLoaded();
|
|
68
|
+
}
|
|
69
|
+
/**选择的表单信息 */
|
|
70
|
+
_selected;
|
|
71
|
+
set selected(v) {
|
|
72
|
+
this._selected = v;
|
|
73
|
+
this.dataLoaded();
|
|
74
|
+
}
|
|
75
|
+
get formConfiguration() {
|
|
76
|
+
return this._Entity.get('formConfiguration');
|
|
77
|
+
}
|
|
78
|
+
submitclick;
|
|
79
|
+
async dataLoaded() {
|
|
80
|
+
if (this._Entity && this._type) {
|
|
81
|
+
await this.AfterInit();
|
|
82
|
+
this.submitclick.nativeElement.click();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
AfterInit() {
|
|
86
|
+
return new Promise((resolve, rejects) => {
|
|
87
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new TextEditConfig()));
|
|
88
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
89
|
+
this.formConfiguration.patchValue({
|
|
90
|
+
...this._selected.formConfiguration
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
resolve(true);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextEditConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
97
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TextEditConfigComponent, selector: "df-text-edit-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\">{{'DigniteAbpForms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"TextEdit.Placeholder\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::TextEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.SingleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::SingleLine' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.MultipleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault2\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::MultipleLine' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::CharLimit' | abpLocalization}}</label>\n <input type=\"number\" class=\"form-control\" formControlName=\"TextEdit.CharLimit\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { 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" }] });
|
|
98
|
+
}
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextEditConfigComponent, decorators: [{
|
|
100
|
+
type: Component,
|
|
101
|
+
args: [{ selector: 'df-text-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"TextEdit.Placeholder\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::TextEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.SingleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::SingleLine' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.MultipleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault2\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::MultipleLine' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::CharLimit' | abpLocalization}}</label>\n <input type=\"number\" class=\"form-control\" formControlName=\"TextEdit.CharLimit\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
|
|
102
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { type: [{
|
|
103
|
+
type: Input
|
|
104
|
+
}], Entity: [{
|
|
105
|
+
type: Input
|
|
106
|
+
}], selected: [{
|
|
107
|
+
type: Input
|
|
108
|
+
}], submitclick: [{
|
|
109
|
+
type: ViewChild,
|
|
110
|
+
args: ['submitclick', { static: true }]
|
|
111
|
+
}] } });
|
|
112
|
+
|
|
113
|
+
class TextEditComponent {
|
|
114
|
+
fb;
|
|
115
|
+
constructor(fb) {
|
|
116
|
+
this.fb = fb;
|
|
117
|
+
}
|
|
118
|
+
_TextEditMode = TextEditMode;
|
|
119
|
+
/**表单实体 */
|
|
120
|
+
_entity;
|
|
121
|
+
set entity(v) {
|
|
122
|
+
this._entity = v;
|
|
123
|
+
if (v)
|
|
124
|
+
this.dataLoaded();
|
|
125
|
+
}
|
|
126
|
+
/**字段配置列表 */
|
|
127
|
+
_fields = '';
|
|
128
|
+
set fields(v) {
|
|
129
|
+
this._fields = v;
|
|
130
|
+
if (v)
|
|
131
|
+
this.dataLoaded();
|
|
132
|
+
}
|
|
133
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
134
|
+
_parentFiledName;
|
|
135
|
+
set parentFiledName(v) {
|
|
136
|
+
this._parentFiledName = v;
|
|
137
|
+
if (v)
|
|
138
|
+
this.dataLoaded();
|
|
139
|
+
}
|
|
140
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
141
|
+
_selected;
|
|
142
|
+
set selected(v) {
|
|
143
|
+
this._selected = v || '';
|
|
144
|
+
if (v)
|
|
145
|
+
this.dataLoaded();
|
|
146
|
+
}
|
|
147
|
+
submitclick;
|
|
148
|
+
extraProperties;
|
|
149
|
+
async dataLoaded() {
|
|
150
|
+
if (this._fields && this._entity && this._parentFiledName) {
|
|
151
|
+
this.extraProperties = this._entity.get(this._parentFiledName);
|
|
152
|
+
await this.AfterInit();
|
|
153
|
+
this.submitclick.nativeElement.click();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
AfterInit() {
|
|
157
|
+
return new Promise((resolve, rejects) => {
|
|
158
|
+
let ValidatorsArray = [];
|
|
159
|
+
if (this._fields.required) {
|
|
160
|
+
ValidatorsArray.push(Validators.required);
|
|
161
|
+
}
|
|
162
|
+
if (this._fields.field.formConfiguration['TextEdit.CharLimit']) {
|
|
163
|
+
ValidatorsArray.push(Validators.maxLength(this._fields.field.formConfiguration['TextEdit.CharLimit']));
|
|
164
|
+
}
|
|
165
|
+
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
166
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
167
|
+
resolve(true);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
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
|
+
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
|
+
}
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextEditComponent, decorators: [{
|
|
174
|
+
type: Component,
|
|
175
|
+
args: [{ selector: 'df-text-edit', 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>" }]
|
|
176
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { entity: [{
|
|
177
|
+
type: Input
|
|
178
|
+
}], fields: [{
|
|
179
|
+
type: Input
|
|
180
|
+
}], parentFiledName: [{
|
|
181
|
+
type: Input
|
|
182
|
+
}], selected: [{
|
|
183
|
+
type: Input
|
|
184
|
+
}], submitclick: [{
|
|
185
|
+
type: ViewChild,
|
|
186
|
+
args: ['submitclick', { static: true }]
|
|
187
|
+
}] } });
|
|
188
|
+
|
|
189
|
+
class SwitchConfig {
|
|
190
|
+
/**默认值 */
|
|
191
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
192
|
+
'Switch.Default' = [false, []];
|
|
193
|
+
constructor(data) {
|
|
194
|
+
if (data) {
|
|
195
|
+
for (const key in data) {
|
|
196
|
+
if (data.hasOwnProperty(key)) {
|
|
197
|
+
this[key] = data[key];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
class SwitchConfigComponent {
|
|
205
|
+
fb;
|
|
206
|
+
constructor(fb) {
|
|
207
|
+
this.fb = fb;
|
|
208
|
+
}
|
|
209
|
+
/**表单控件类型 */
|
|
210
|
+
_type;
|
|
211
|
+
set type(v) {
|
|
212
|
+
this._type = v;
|
|
213
|
+
this.dataLoaded();
|
|
214
|
+
}
|
|
215
|
+
/**表单实体 */
|
|
216
|
+
_Entity;
|
|
217
|
+
set Entity(v) {
|
|
218
|
+
this._Entity = v;
|
|
219
|
+
this.dataLoaded();
|
|
220
|
+
}
|
|
221
|
+
/**选择的表单信息 */
|
|
222
|
+
_selected;
|
|
223
|
+
set selected(v) {
|
|
224
|
+
this._selected = v;
|
|
225
|
+
this.dataLoaded();
|
|
226
|
+
}
|
|
227
|
+
get formConfiguration() {
|
|
228
|
+
return this._Entity.get('formConfiguration');
|
|
229
|
+
}
|
|
230
|
+
submitclick;
|
|
231
|
+
async dataLoaded() {
|
|
232
|
+
if (this._Entity && this._type) {
|
|
233
|
+
await this.AfterInit();
|
|
234
|
+
this.submitclick.nativeElement.click();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
AfterInit() {
|
|
238
|
+
return new Promise((resolve, rejects) => {
|
|
239
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new SwitchConfig()));
|
|
240
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
241
|
+
this.formConfiguration.patchValue({
|
|
242
|
+
...this._selected.formConfiguration
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
resolve(true);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SwitchConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
249
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SwitchConfigComponent, selector: "df-switch-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 <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Switch.Default\"\n id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::DefaultValue' | abpLocalization}}\n </label>\n </div>\n \n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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" }] });
|
|
250
|
+
}
|
|
251
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SwitchConfigComponent, decorators: [{
|
|
252
|
+
type: Component,
|
|
253
|
+
args: [{ selector: 'df-switch-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Switch.Default\"\n id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::DefaultValue' | abpLocalization}}\n </label>\n </div>\n \n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
|
|
254
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { type: [{
|
|
255
|
+
type: Input
|
|
256
|
+
}], Entity: [{
|
|
257
|
+
type: Input
|
|
258
|
+
}], selected: [{
|
|
259
|
+
type: Input
|
|
260
|
+
}], submitclick: [{
|
|
261
|
+
type: ViewChild,
|
|
262
|
+
args: ['submitclick', { static: true }]
|
|
263
|
+
}] } });
|
|
264
|
+
|
|
265
|
+
class SwitchControlComponent {
|
|
266
|
+
fb;
|
|
267
|
+
constructor(fb) {
|
|
268
|
+
this.fb = fb;
|
|
269
|
+
}
|
|
270
|
+
/**表单实体 */
|
|
271
|
+
_entity;
|
|
272
|
+
set entity(v) {
|
|
273
|
+
this._entity = v;
|
|
274
|
+
this.dataLoaded();
|
|
275
|
+
}
|
|
276
|
+
/**字段配置列表 */
|
|
277
|
+
_fields = '';
|
|
278
|
+
set fields(v) {
|
|
279
|
+
this._fields = v;
|
|
280
|
+
this.dataLoaded();
|
|
281
|
+
}
|
|
282
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
283
|
+
_parentFiledName;
|
|
284
|
+
set parentFiledName(v) {
|
|
285
|
+
this._parentFiledName = v;
|
|
286
|
+
this.dataLoaded();
|
|
287
|
+
}
|
|
288
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
289
|
+
_selected;
|
|
290
|
+
set selected(v) {
|
|
291
|
+
this._selected = v ? v : false;
|
|
292
|
+
this.dataLoaded();
|
|
293
|
+
}
|
|
294
|
+
submitclick;
|
|
295
|
+
get extraProperties() {
|
|
296
|
+
return this._entity.get('extraProperties');
|
|
297
|
+
}
|
|
298
|
+
/**数据加载完成 */
|
|
299
|
+
async dataLoaded() {
|
|
300
|
+
if (this._fields && this._entity) {
|
|
301
|
+
await this.AfterInit();
|
|
302
|
+
this.submitclick.nativeElement.click();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
AfterInit() {
|
|
306
|
+
return new Promise((resolve, rejects) => {
|
|
307
|
+
let ValidatorsArray = [];
|
|
308
|
+
if (this._fields.required) {
|
|
309
|
+
ValidatorsArray.push(Validators.required);
|
|
310
|
+
}
|
|
311
|
+
let newControl = this.fb.control(this._selected ? this._selected : this._selected === false ? this._selected : this._fields.field.formConfiguration.default, ValidatorsArray);
|
|
312
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
313
|
+
resolve(true);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SwitchControlComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
317
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SwitchControlComponent, selector: "df-switch-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 <div class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" formControlName=\"{{_fields.field.name}}\">\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n\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.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: 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"] }] });
|
|
318
|
+
}
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SwitchControlComponent, decorators: [{
|
|
320
|
+
type: Component,
|
|
321
|
+
args: [{ selector: 'df-switch-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 class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" formControlName=\"{{_fields.field.name}}\">\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
|
|
322
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { entity: [{
|
|
323
|
+
type: Input
|
|
324
|
+
}], fields: [{
|
|
325
|
+
type: Input
|
|
326
|
+
}], parentFiledName: [{
|
|
327
|
+
type: Input
|
|
328
|
+
}], selected: [{
|
|
329
|
+
type: Input
|
|
330
|
+
}], submitclick: [{
|
|
331
|
+
type: ViewChild,
|
|
332
|
+
args: ['submitclick', { static: true }]
|
|
333
|
+
}] } });
|
|
334
|
+
|
|
335
|
+
class NumbericEditConfig {
|
|
336
|
+
/**占位符 */
|
|
337
|
+
'NumericEditField.Placeholder' = ['', []];
|
|
338
|
+
/**最小值 */
|
|
339
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
340
|
+
'NumericEditField.Min' = ['', []];
|
|
341
|
+
//最大值
|
|
342
|
+
'NumericEditField.Max' = ['', []];
|
|
343
|
+
// 小数位数
|
|
344
|
+
'NumericEditField.Decimals' = [2, []];
|
|
345
|
+
//步长
|
|
346
|
+
'NumericEditField.Step' = ['', []];
|
|
347
|
+
//格式说明符
|
|
348
|
+
'FormatSpecifier' = ['', []];
|
|
349
|
+
constructor(data) {
|
|
350
|
+
if (data) {
|
|
351
|
+
for (const key in data) {
|
|
352
|
+
if (data.hasOwnProperty(key)) {
|
|
353
|
+
this[key] = data[key];
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
class NumbericEditConfigComponent {
|
|
361
|
+
fb;
|
|
362
|
+
constructor(fb) {
|
|
363
|
+
this.fb = fb;
|
|
364
|
+
}
|
|
365
|
+
/**表单控件类型 */
|
|
366
|
+
_type;
|
|
367
|
+
set type(v) {
|
|
368
|
+
this._type = v;
|
|
369
|
+
this.dataLoaded();
|
|
370
|
+
}
|
|
371
|
+
/**表单实体 */
|
|
372
|
+
_Entity;
|
|
373
|
+
set Entity(v) {
|
|
374
|
+
this._Entity = v;
|
|
375
|
+
this.dataLoaded();
|
|
376
|
+
}
|
|
377
|
+
/**选择的表单信息 */
|
|
378
|
+
_selected;
|
|
379
|
+
set selected(v) {
|
|
380
|
+
this._selected = v ? v : v == false ? v : '';
|
|
381
|
+
this.dataLoaded();
|
|
382
|
+
}
|
|
383
|
+
get formConfiguration() {
|
|
384
|
+
return this._Entity.get('formConfiguration');
|
|
385
|
+
}
|
|
386
|
+
submitclick;
|
|
387
|
+
async dataLoaded() {
|
|
388
|
+
if (this._Entity && this._type) {
|
|
389
|
+
await this.AfterInit();
|
|
390
|
+
this.submitclick.nativeElement.click();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
AfterInit() {
|
|
394
|
+
return new Promise((resolve, rejects) => {
|
|
395
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new NumbericEditConfig()));
|
|
396
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
397
|
+
this.formConfiguration.patchValue({
|
|
398
|
+
...this._selected.formConfiguration
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
resolve(true);
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumbericEditConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
405
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NumbericEditConfigComponent, selector: "df-numberic-edit-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\">{{'DigniteAbpForms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Placeholder\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Min' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Min\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Max' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Max\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::NumericDecimals' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Decimals\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::NumericStep' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Step\">\n <div class=\"form-text\">{{'DigniteAbpForms::NumericStepHelp'}}</div>\n </div>\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::FormatSpecifier' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FormatSpecifier\">\n <div class=\"form-text\">See:<a href=\"https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings\" target=\"_blank\">https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings</a></div>\n </div>\n \n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #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.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" }] });
|
|
406
|
+
}
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumbericEditConfigComponent, decorators: [{
|
|
408
|
+
type: Component,
|
|
409
|
+
args: [{ selector: 'df-numberic-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Placeholder\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Min' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Min\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Max' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Max\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::NumericDecimals' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Decimals\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::NumericStep' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Step\">\n <div class=\"form-text\">{{'DigniteAbpForms::NumericStepHelp'}}</div>\n </div>\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::FormatSpecifier' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FormatSpecifier\">\n <div class=\"form-text\">See:<a href=\"https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings\" target=\"_blank\">https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings</a></div>\n </div>\n \n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
|
|
410
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { type: [{
|
|
411
|
+
type: Input
|
|
412
|
+
}], Entity: [{
|
|
413
|
+
type: Input
|
|
414
|
+
}], selected: [{
|
|
415
|
+
type: Input
|
|
416
|
+
}], submitclick: [{
|
|
417
|
+
type: ViewChild,
|
|
418
|
+
args: ['submitclick', { static: true }]
|
|
419
|
+
}] } });
|
|
420
|
+
|
|
421
|
+
function maxDecimalPlacesValidator(maxDecimalPlaces) {
|
|
422
|
+
return (control) => {
|
|
423
|
+
const value = control.value;
|
|
424
|
+
if (typeof value === 'number' && isNaN(value) === false) {
|
|
425
|
+
const decimalPart = value.toString().split('.')[1];
|
|
426
|
+
if (decimalPart && decimalPart.length > maxDecimalPlaces) {
|
|
427
|
+
return { 'maxDecimalPlaces': { actual: decimalPart.length, max: maxDecimalPlaces } };
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return null;
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
class NumbericEditControlComponent {
|
|
434
|
+
fb;
|
|
435
|
+
cdr;
|
|
436
|
+
constructor(fb, cdr) {
|
|
437
|
+
this.fb = fb;
|
|
438
|
+
this.cdr = cdr;
|
|
439
|
+
}
|
|
440
|
+
/**表单实体 */
|
|
441
|
+
_entity;
|
|
442
|
+
set entity(v) {
|
|
443
|
+
this._entity = v;
|
|
444
|
+
this.dataLoaded();
|
|
445
|
+
}
|
|
446
|
+
get entity() {
|
|
447
|
+
return this._entity;
|
|
448
|
+
}
|
|
449
|
+
/**字段配置列表 */
|
|
450
|
+
_fields = '';
|
|
451
|
+
set fields(v) {
|
|
452
|
+
this._fields = v;
|
|
453
|
+
this.dataLoaded();
|
|
454
|
+
}
|
|
455
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
456
|
+
_parentFiledName;
|
|
457
|
+
set parentFiledName(v) {
|
|
458
|
+
this._parentFiledName = v;
|
|
459
|
+
this.dataLoaded();
|
|
460
|
+
}
|
|
461
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
462
|
+
_selected;
|
|
463
|
+
set selected(v) {
|
|
464
|
+
this._selected = v;
|
|
465
|
+
this.dataLoaded();
|
|
466
|
+
}
|
|
467
|
+
submitclick;
|
|
468
|
+
get extraProperties() {
|
|
469
|
+
return this._entity.get('extraProperties');
|
|
470
|
+
}
|
|
471
|
+
get fieldInput() { return this.extraProperties.get(this._fields.field.name); }
|
|
472
|
+
/**数据加载完成 */
|
|
473
|
+
async dataLoaded() {
|
|
474
|
+
if (this._fields && this._entity) {
|
|
475
|
+
await this.AfterInit();
|
|
476
|
+
this.cdr.detectChanges();
|
|
477
|
+
this.submitclick.nativeElement.click();
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
AfterInit() {
|
|
481
|
+
return new Promise((resolve, rejects) => {
|
|
482
|
+
let ValidatorsArray = [];
|
|
483
|
+
let formConfiguration = this._fields.field.formConfiguration;
|
|
484
|
+
if (this._fields.required) {
|
|
485
|
+
ValidatorsArray.push(Validators.required);
|
|
486
|
+
}
|
|
487
|
+
if (formConfiguration['NumericEditField.Min']) {
|
|
488
|
+
ValidatorsArray.push(Validators.min(formConfiguration['NumericEditField.Min']));
|
|
489
|
+
}
|
|
490
|
+
if (formConfiguration['NumericEditField.Max']) {
|
|
491
|
+
ValidatorsArray.push(Validators.max(formConfiguration['NumericEditField.Max']));
|
|
492
|
+
}
|
|
493
|
+
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
494
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
495
|
+
resolve(true);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
/**数字框输入 */
|
|
499
|
+
inputchange(event) {
|
|
500
|
+
let val = event.target.value;
|
|
501
|
+
const decimalPart = val.toString().split('.')[1] || '';
|
|
502
|
+
let formConfiguration = this._fields.field.formConfiguration;
|
|
503
|
+
let Decimals = formConfiguration['NumericEditField.Decimals'];
|
|
504
|
+
if (decimalPart.length > Decimals) {
|
|
505
|
+
this.fieldInput.patchValue(val.slice(0, val.length - (decimalPart.length - 2)));
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumbericEditControlComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
509
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NumbericEditControlComponent, selector: "df-numberic-edit-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]=\"_parentFiledName\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <input type=\"number\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['NumericEditField.Placeholder']||''\"\n [min]=\"_fields.field.formConfiguration['NumericEditField.Min']\"\n [max]=\"_fields.field.formConfiguration['NumericEditField.Max']\"\n [step]=\"_fields.field.formConfiguration['NumericEditField.Step']\" (input)=\"inputchange($event)\" />\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n\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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][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.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
510
|
+
}
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumbericEditControlComponent, decorators: [{
|
|
512
|
+
type: Component,
|
|
513
|
+
args: [{ selector: 'df-numberic-edit-control', changeDetection: ChangeDetectionStrategy.OnPush, 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 <input type=\"number\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['NumericEditField.Placeholder']||''\"\n [min]=\"_fields.field.formConfiguration['NumericEditField.Min']\"\n [max]=\"_fields.field.formConfiguration['NumericEditField.Max']\"\n [step]=\"_fields.field.formConfiguration['NumericEditField.Step']\" (input)=\"inputchange($event)\" />\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
|
|
514
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { entity: [{
|
|
515
|
+
type: Input
|
|
516
|
+
}], fields: [{
|
|
517
|
+
type: Input
|
|
518
|
+
}], parentFiledName: [{
|
|
519
|
+
type: Input
|
|
520
|
+
}], selected: [{
|
|
521
|
+
type: Input
|
|
522
|
+
}], submitclick: [{
|
|
523
|
+
type: ViewChild,
|
|
524
|
+
args: ['submitclick', { static: true }]
|
|
525
|
+
}] } });
|
|
526
|
+
|
|
527
|
+
class CkEditorConfig {
|
|
528
|
+
/**文件容器名称 */
|
|
529
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
530
|
+
'Ckeditor.ImagesContainerName' = ['', []];
|
|
531
|
+
/**多选 */
|
|
532
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
533
|
+
'Ckeditor.InitialContent' = ['', []];
|
|
534
|
+
constructor(data) {
|
|
535
|
+
if (data) {
|
|
536
|
+
for (const key in data) {
|
|
537
|
+
if (data.hasOwnProperty(key)) {
|
|
538
|
+
this[key] = data[key];
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
class CkEditorConfigComponent {
|
|
546
|
+
fb;
|
|
547
|
+
constructor(fb) {
|
|
548
|
+
this.fb = fb;
|
|
549
|
+
}
|
|
550
|
+
/**表单实体 */
|
|
551
|
+
Entity;
|
|
552
|
+
/**选择的表单信息 */
|
|
553
|
+
_selected;
|
|
554
|
+
set selected(v) {
|
|
555
|
+
this._selected = v || '';
|
|
556
|
+
this.dataLoaded();
|
|
557
|
+
}
|
|
558
|
+
/**表单控件类型 */
|
|
559
|
+
_type;
|
|
560
|
+
set type(v) {
|
|
561
|
+
this._type = v;
|
|
562
|
+
this.dataLoaded();
|
|
563
|
+
}
|
|
564
|
+
get formConfiguration() {
|
|
565
|
+
return this.Entity.get('formConfiguration');
|
|
566
|
+
}
|
|
567
|
+
submitclick;
|
|
568
|
+
async dataLoaded() {
|
|
569
|
+
// if (this.Entity && (this._selected || this._selected === '')) {
|
|
570
|
+
if (this.Entity && this._type) {
|
|
571
|
+
await this.AfterInit();
|
|
572
|
+
this.submitclick.nativeElement.click();
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
AfterInit() {
|
|
576
|
+
return new Promise((resolve, rejects) => {
|
|
577
|
+
this.Entity.setControl('formConfiguration', this.fb.group(new CkEditorConfig()));
|
|
578
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
579
|
+
this.formConfiguration.patchValue({
|
|
580
|
+
...this._selected.formConfiguration
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
resolve(true);
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
587
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CkEditorConfigComponent, selector: "df-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.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" }] });
|
|
588
|
+
}
|
|
589
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorConfigComponent, decorators: [{
|
|
590
|
+
type: Component,
|
|
591
|
+
args: [{ selector: 'df-ck-editor-config', 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>" }]
|
|
592
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { Entity: [{
|
|
593
|
+
type: Input
|
|
594
|
+
}], selected: [{
|
|
595
|
+
type: Input
|
|
596
|
+
}], type: [{
|
|
597
|
+
type: Input
|
|
598
|
+
}], submitclick: [{
|
|
599
|
+
type: ViewChild,
|
|
600
|
+
args: ['submitclick', { static: true }]
|
|
601
|
+
}] } });
|
|
602
|
+
|
|
603
|
+
class isBase64UploadAdapter {
|
|
604
|
+
reader = new FileReader();
|
|
605
|
+
restService;
|
|
606
|
+
loader;
|
|
607
|
+
ImagesContainerName;
|
|
608
|
+
Base64 = false;
|
|
609
|
+
constructor(loader, ImagesContainerName, restService) {
|
|
610
|
+
this.loader = loader;
|
|
611
|
+
this.ImagesContainerName = ImagesContainerName;
|
|
612
|
+
this.restService = restService;
|
|
613
|
+
console.log(this.restService, 11111111111, restService);
|
|
614
|
+
}
|
|
615
|
+
upload() {
|
|
616
|
+
return new Promise((resolve, reject) => {
|
|
617
|
+
const reader = this.reader;
|
|
618
|
+
if (this.Base64) {
|
|
619
|
+
reader.addEventListener('load', () => {
|
|
620
|
+
resolve({ default: reader.result });
|
|
621
|
+
});
|
|
622
|
+
reader.addEventListener('error', err => {
|
|
623
|
+
reject(err);
|
|
624
|
+
});
|
|
625
|
+
reader.addEventListener('abort', () => {
|
|
626
|
+
reject();
|
|
627
|
+
});
|
|
628
|
+
this.loader.file.then((file) => {
|
|
629
|
+
reader.readAsDataURL(file);
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
this.loader.file.then((file) => {
|
|
634
|
+
var formData = new FormData();
|
|
635
|
+
formData.append('file', file, file.name);
|
|
636
|
+
this.createFile({
|
|
637
|
+
file: formData,
|
|
638
|
+
containerName: this.ImagesContainerName,
|
|
639
|
+
directoryId: '',
|
|
640
|
+
entityId: ''
|
|
641
|
+
}).subscribe((response) => {
|
|
642
|
+
resolve({ default: response.url });
|
|
643
|
+
}, (error) => {
|
|
644
|
+
reject(error);
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
createFile = (input, config) => this.restService.request({
|
|
651
|
+
method: 'POST',
|
|
652
|
+
url: '/api/file-explorer/files',
|
|
653
|
+
params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
|
|
654
|
+
body: input.file,
|
|
655
|
+
}, { apiName: 'FileExplorer', ...config });
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
class CkEditorControlComponent {
|
|
659
|
+
fb;
|
|
660
|
+
restService;
|
|
661
|
+
constructor(fb, restService) {
|
|
662
|
+
this.fb = fb;
|
|
663
|
+
this.restService = restService;
|
|
664
|
+
}
|
|
665
|
+
Editor = ClassicEditor;
|
|
666
|
+
/**富文本配置 */
|
|
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
|
+
};
|
|
693
|
+
//**富文本加载完成 */
|
|
694
|
+
onReady(editor) {
|
|
695
|
+
let that = this;
|
|
696
|
+
editor.plugins.get('FileRepository').createUploadAdapter = function (loader) {
|
|
697
|
+
return new isBase64UploadAdapter(loader, that.imagesContainerName, that.restService);
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
/**富文本内容改变 */
|
|
701
|
+
onChange({ editor }) {
|
|
702
|
+
// const data = editor.getData();
|
|
703
|
+
// console.log(editor, 'onChangeonChange');
|
|
704
|
+
}
|
|
705
|
+
/**表单实体 */
|
|
706
|
+
_entity;
|
|
707
|
+
set entity(v) {
|
|
708
|
+
this._entity = v;
|
|
709
|
+
this.dataLoaded();
|
|
710
|
+
}
|
|
711
|
+
/**字段配置列表 */
|
|
712
|
+
_fields = '';
|
|
713
|
+
set fields(v) {
|
|
714
|
+
this._fields = v;
|
|
715
|
+
this.dataLoaded();
|
|
716
|
+
}
|
|
717
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
718
|
+
_parentFiledName;
|
|
719
|
+
set parentFiledName(v) {
|
|
720
|
+
this._parentFiledName = v;
|
|
721
|
+
this.dataLoaded();
|
|
722
|
+
}
|
|
723
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
724
|
+
_selected;
|
|
725
|
+
set selected(v) {
|
|
726
|
+
this._selected = v;
|
|
727
|
+
this.dataLoaded();
|
|
728
|
+
}
|
|
729
|
+
submitclick;
|
|
730
|
+
get extraProperties() {
|
|
731
|
+
return this._entity.get('extraProperties');
|
|
732
|
+
}
|
|
733
|
+
/**数据加载完成 */
|
|
734
|
+
async dataLoaded() {
|
|
735
|
+
if (this._fields && this._entity) {
|
|
736
|
+
await this.AfterInit();
|
|
737
|
+
this.submitclick.nativeElement.click();
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
/**图片容器名称 */
|
|
741
|
+
imagesContainerName;
|
|
742
|
+
AfterInit() {
|
|
743
|
+
return new Promise((resolve, rejects) => {
|
|
744
|
+
let ValidatorsArray = [];
|
|
745
|
+
if (this._fields.required) {
|
|
746
|
+
ValidatorsArray.push(Validators.required);
|
|
747
|
+
}
|
|
748
|
+
// if (this._fields.field.formConfiguration.limit) {
|
|
749
|
+
// ValidatorsArray.push(Validators.maxLength(this._fields.field.formConfiguration.limit))
|
|
750
|
+
// }
|
|
751
|
+
let newControl = this.fb.control(this._selected ? this._selected : this._fields.field.formConfiguration['Ckeditor.InitialContent'], ValidatorsArray);
|
|
752
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
753
|
+
this.imagesContainerName = this._fields.field.formConfiguration['Ckeditor.ImagesContainerName'];
|
|
754
|
+
// console.log(this._fields,'ceshiceshiceshiceshiceshi',this.extraProperties.value,this._entity.value,'this._selected',this._selected);
|
|
755
|
+
resolve(true);
|
|
756
|
+
});
|
|
757
|
+
}
|
|
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 });
|
|
759
|
+
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
|
+
}
|
|
761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CkEditorControlComponent, decorators: [{
|
|
762
|
+
type: Component,
|
|
763
|
+
args: [{ selector: 'df-ck-editor-control', standalone: true, imports: [
|
|
764
|
+
CKEditorModule,
|
|
765
|
+
FormsModule,
|
|
766
|
+
CoreModule,
|
|
767
|
+
ThemeSharedModule,
|
|
768
|
+
ReactiveFormsModule,
|
|
769
|
+
], 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: [{
|
|
771
|
+
type: Input
|
|
772
|
+
}], fields: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], parentFiledName: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], selected: [{
|
|
777
|
+
type: Input
|
|
778
|
+
}], submitclick: [{
|
|
779
|
+
type: ViewChild,
|
|
780
|
+
args: ['submitclick', { static: true }]
|
|
781
|
+
}] } });
|
|
782
|
+
|
|
783
|
+
var DateEditInterfaces;
|
|
784
|
+
(function (DateEditInterfaces) {
|
|
785
|
+
/// <summary>
|
|
786
|
+
/// Only date is allowed to be entered.
|
|
787
|
+
/// </summary>
|
|
788
|
+
DateEditInterfaces[DateEditInterfaces["Date"] = 0] = "Date";
|
|
789
|
+
/// <summary>
|
|
790
|
+
/// Both date and time are allowed to be entered.
|
|
791
|
+
/// </summary>
|
|
792
|
+
DateEditInterfaces[DateEditInterfaces["DateTime"] = 1] = "DateTime";
|
|
793
|
+
/// <summary>
|
|
794
|
+
/// Allowed to select only year and month.
|
|
795
|
+
/// </summary>
|
|
796
|
+
DateEditInterfaces[DateEditInterfaces["Month"] = 2] = "Month";
|
|
797
|
+
})(DateEditInterfaces || (DateEditInterfaces = {}));
|
|
798
|
+
|
|
799
|
+
class DateEditConfig {
|
|
800
|
+
/**占位符 */
|
|
801
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
802
|
+
// placeholder: any = ['', []];
|
|
803
|
+
// //字段类型,单行文本,多行文本
|
|
804
|
+
// textboxMode: any = ['simple', []];
|
|
805
|
+
// // 字数限制
|
|
806
|
+
// limit: any = ['265', []];
|
|
807
|
+
/**日期格式 */
|
|
808
|
+
'DateEdit.InputMode' = [DateEditInterfaces.Date, []];
|
|
809
|
+
/**最小值 */
|
|
810
|
+
'DateEdit.Min' = ['', []];
|
|
811
|
+
/**最大值 */
|
|
812
|
+
'DateEdit.Max' = ['', []];
|
|
813
|
+
constructor(data) {
|
|
814
|
+
if (data) {
|
|
815
|
+
for (const key in data) {
|
|
816
|
+
if (data.hasOwnProperty(key)) {
|
|
817
|
+
this[key] = data[key];
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
class DateEditConfigComponent {
|
|
825
|
+
fb;
|
|
826
|
+
constructor(fb) {
|
|
827
|
+
this.fb = fb;
|
|
828
|
+
}
|
|
829
|
+
_DateEditInterfaces = DateEditInterfaces;
|
|
830
|
+
/**表单控件类型 */
|
|
831
|
+
_type;
|
|
832
|
+
set type(v) {
|
|
833
|
+
this._type = v;
|
|
834
|
+
this.dataLoaded();
|
|
835
|
+
}
|
|
836
|
+
/**表单实体 */
|
|
837
|
+
_Entity;
|
|
838
|
+
set Entity(v) {
|
|
839
|
+
this._Entity = v;
|
|
840
|
+
this.dataLoaded();
|
|
841
|
+
}
|
|
842
|
+
/**选择的表单信息 */
|
|
843
|
+
_selected;
|
|
844
|
+
set selected(v) {
|
|
845
|
+
this._selected = v;
|
|
846
|
+
this.dataLoaded();
|
|
847
|
+
}
|
|
848
|
+
get formConfiguration() {
|
|
849
|
+
return this._Entity.get('formConfiguration');
|
|
850
|
+
}
|
|
851
|
+
submitclick;
|
|
852
|
+
async dataLoaded() {
|
|
853
|
+
if (this._Entity && this._type) {
|
|
854
|
+
await this.AfterInit();
|
|
855
|
+
this.submitclick.nativeElement.click();
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
AfterInit() {
|
|
859
|
+
return new Promise((resolve, rejects) => {
|
|
860
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new DateEditConfig()));
|
|
861
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
862
|
+
this.formConfiguration.patchValue({
|
|
863
|
+
...this._selected.formConfiguration
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
resolve(true);
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateEditConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
870
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DateEditConfigComponent, selector: "df-date-edit-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\">{{'DigniteAbpForms::DateEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Date\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::Date' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.DateTime\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault2\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::DateTime' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Month\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault3\">\n <label class=\"form-check-label\" for=\"flexRadioDefault3\">\n {{'DigniteAbpForms::Month' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Min' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"DateEdit.Min\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Max' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"DateEdit.Max\">\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.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { 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" }] });
|
|
871
|
+
}
|
|
872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateEditConfigComponent, decorators: [{
|
|
873
|
+
type: Component,
|
|
874
|
+
args: [{ selector: 'df-date-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::DateEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Date\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::Date' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.DateTime\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault2\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::DateTime' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Month\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault3\">\n <label class=\"form-check-label\" for=\"flexRadioDefault3\">\n {{'DigniteAbpForms::Month' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Min' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"DateEdit.Min\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::Max' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"DateEdit.Max\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
|
|
875
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { type: [{
|
|
876
|
+
type: Input
|
|
877
|
+
}], Entity: [{
|
|
878
|
+
type: Input
|
|
879
|
+
}], selected: [{
|
|
880
|
+
type: Input
|
|
881
|
+
}], submitclick: [{
|
|
882
|
+
type: ViewChild,
|
|
883
|
+
args: ['submitclick', { static: true }]
|
|
884
|
+
}] } });
|
|
885
|
+
|
|
886
|
+
class DateEditControlComponent {
|
|
887
|
+
fb;
|
|
888
|
+
cdr;
|
|
889
|
+
constructor(fb, cdr) {
|
|
890
|
+
this.fb = fb;
|
|
891
|
+
this.cdr = cdr;
|
|
892
|
+
}
|
|
893
|
+
_DateEditInterfaces = DateEditInterfaces;
|
|
894
|
+
/**表单实体 */
|
|
895
|
+
_entity;
|
|
896
|
+
set entity(v) {
|
|
897
|
+
this._entity = v;
|
|
898
|
+
this.dataLoaded();
|
|
899
|
+
}
|
|
900
|
+
get entity() {
|
|
901
|
+
return this._entity;
|
|
902
|
+
}
|
|
903
|
+
/**字段配置列表 */
|
|
904
|
+
_fields = '';
|
|
905
|
+
set fields(v) {
|
|
906
|
+
this._fields = v;
|
|
907
|
+
this.dataLoaded();
|
|
908
|
+
}
|
|
909
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
910
|
+
_parentFiledName;
|
|
911
|
+
set parentFiledName(v) {
|
|
912
|
+
this._parentFiledName = v;
|
|
913
|
+
this.dataLoaded();
|
|
914
|
+
}
|
|
915
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
916
|
+
_selected;
|
|
917
|
+
set selected(v) {
|
|
918
|
+
this._selected = v;
|
|
919
|
+
this.dataLoaded();
|
|
920
|
+
}
|
|
921
|
+
submitclick;
|
|
922
|
+
get extraProperties() {
|
|
923
|
+
return this._entity.get('extraProperties');
|
|
924
|
+
}
|
|
925
|
+
get fieldInput() { return this.extraProperties.get(this._fields.field.name); }
|
|
926
|
+
/**数据加载完成 */
|
|
927
|
+
async dataLoaded() {
|
|
928
|
+
if (this._fields && this._entity) {
|
|
929
|
+
await this.AfterInit();
|
|
930
|
+
this.cdr.detectChanges();
|
|
931
|
+
this.submitclick.nativeElement.click();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
AfterInit() {
|
|
935
|
+
return new Promise((resolve, rejects) => {
|
|
936
|
+
let ValidatorsArray = [];
|
|
937
|
+
let formConfiguration = this._fields.field.formConfiguration;
|
|
938
|
+
if (this._fields.required) {
|
|
939
|
+
ValidatorsArray.push(Validators.required);
|
|
940
|
+
}
|
|
941
|
+
if (formConfiguration['DateEdit.Min']) {
|
|
942
|
+
ValidatorsArray.push(Validators.min(formConfiguration['DateEdit.Min']));
|
|
943
|
+
}
|
|
944
|
+
if (formConfiguration['DateEdit.Max']) {
|
|
945
|
+
ValidatorsArray.push(Validators.max(formConfiguration['DateEdit.Max']));
|
|
946
|
+
}
|
|
947
|
+
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
948
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
949
|
+
resolve(true);
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateEditControlComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
953
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DateEditControlComponent, selector: "df-date-edit-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]=\"_parentFiledName\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Date\">\n <input type=\"date\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container\n *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.DateTime\">\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Month\">\n <input type=\"month\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\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"] }] });
|
|
954
|
+
}
|
|
955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateEditControlComponent, decorators: [{
|
|
956
|
+
type: Component,
|
|
957
|
+
args: [{ selector: 'df-date-edit-control', 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\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Date\">\n <input type=\"date\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container\n *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.DateTime\">\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Month\">\n <input type=\"month\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\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>" }]
|
|
958
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { entity: [{
|
|
959
|
+
type: Input
|
|
960
|
+
}], fields: [{
|
|
961
|
+
type: Input
|
|
962
|
+
}], parentFiledName: [{
|
|
963
|
+
type: Input
|
|
964
|
+
}], selected: [{
|
|
965
|
+
type: Input
|
|
966
|
+
}], submitclick: [{
|
|
967
|
+
type: ViewChild,
|
|
968
|
+
args: ['submitclick', { static: true }]
|
|
969
|
+
}] } });
|
|
970
|
+
|
|
971
|
+
class FileExplorerConfig {
|
|
972
|
+
/**文件容器名称 */
|
|
973
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
974
|
+
'FileExplorer.FileContainerName' = ['', []];
|
|
975
|
+
/**多选 */
|
|
976
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
977
|
+
'FileExplorer.UploadFileMultiple' = [false, []];
|
|
978
|
+
constructor(data) {
|
|
979
|
+
if (data) {
|
|
980
|
+
for (const key in data) {
|
|
981
|
+
if (data.hasOwnProperty(key)) {
|
|
982
|
+
this[key] = data[key];
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
class FileExplorerConfigComponent {
|
|
990
|
+
fb;
|
|
991
|
+
constructor(fb) {
|
|
992
|
+
this.fb = fb;
|
|
993
|
+
}
|
|
994
|
+
/**表单控件类型 */
|
|
995
|
+
_type;
|
|
996
|
+
set type(v) {
|
|
997
|
+
this._type = v;
|
|
998
|
+
this.dataLoaded();
|
|
999
|
+
}
|
|
1000
|
+
/**表单实体 */
|
|
1001
|
+
_Entity;
|
|
1002
|
+
set Entity(v) {
|
|
1003
|
+
this._Entity = v;
|
|
1004
|
+
this.dataLoaded();
|
|
1005
|
+
}
|
|
1006
|
+
/**选择的表单信息 */
|
|
1007
|
+
_selected;
|
|
1008
|
+
set selected(v) {
|
|
1009
|
+
this._selected = v;
|
|
1010
|
+
this.dataLoaded();
|
|
1011
|
+
}
|
|
1012
|
+
get formConfiguration() {
|
|
1013
|
+
return this._Entity.get('formConfiguration');
|
|
1014
|
+
}
|
|
1015
|
+
submitclick;
|
|
1016
|
+
async dataLoaded() {
|
|
1017
|
+
if (this._Entity && this._type) {
|
|
1018
|
+
await this.AfterInit();
|
|
1019
|
+
this.submitclick.nativeElement.click();
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
AfterInit() {
|
|
1023
|
+
return new Promise((resolve, rejects) => {
|
|
1024
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new FileExplorerConfig()));
|
|
1025
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
1026
|
+
this.formConfiguration.patchValue({
|
|
1027
|
+
...this._selected.formConfiguration
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
resolve(true);
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
1034
|
+
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" }] });
|
|
1035
|
+
}
|
|
1036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerConfigComponent, decorators: [{
|
|
1037
|
+
type: Component,
|
|
1038
|
+
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>" }]
|
|
1039
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { type: [{
|
|
1040
|
+
type: Input
|
|
1041
|
+
}], Entity: [{
|
|
1042
|
+
type: Input
|
|
1043
|
+
}], selected: [{
|
|
1044
|
+
type: Input
|
|
1045
|
+
}], submitclick: [{
|
|
1046
|
+
type: ViewChild,
|
|
1047
|
+
args: ['submitclick', { static: true }]
|
|
1048
|
+
}] } });
|
|
1049
|
+
|
|
1050
|
+
class FileExplorerControlComponent {
|
|
1051
|
+
fb;
|
|
1052
|
+
constructor(fb) {
|
|
1053
|
+
this.fb = fb;
|
|
1054
|
+
}
|
|
1055
|
+
/**表单实体 */
|
|
1056
|
+
_entity;
|
|
1057
|
+
set entity(v) {
|
|
1058
|
+
this._entity = v;
|
|
1059
|
+
if (v)
|
|
1060
|
+
this.dataLoaded();
|
|
1061
|
+
}
|
|
1062
|
+
/**字段配置列表 */
|
|
1063
|
+
_fields = '';
|
|
1064
|
+
set fields(v) {
|
|
1065
|
+
this._fields = v;
|
|
1066
|
+
if (v)
|
|
1067
|
+
this.dataLoaded();
|
|
1068
|
+
}
|
|
1069
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
1070
|
+
_parentFiledName;
|
|
1071
|
+
set parentFiledName(v) {
|
|
1072
|
+
this._parentFiledName = v;
|
|
1073
|
+
if (v)
|
|
1074
|
+
this.dataLoaded();
|
|
1075
|
+
}
|
|
1076
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
1077
|
+
_selected;
|
|
1078
|
+
set selected(v) {
|
|
1079
|
+
this._selected = v;
|
|
1080
|
+
if (v && v.length > 0)
|
|
1081
|
+
this.dataLoaded();
|
|
1082
|
+
}
|
|
1083
|
+
submitclick;
|
|
1084
|
+
get extraProperties() {
|
|
1085
|
+
return this._entity.get('extraProperties');
|
|
1086
|
+
}
|
|
1087
|
+
/**数据加载完成 */
|
|
1088
|
+
async dataLoaded() {
|
|
1089
|
+
if (this._fields && this._entity && this._parentFiledName) {
|
|
1090
|
+
await this.AfterInit();
|
|
1091
|
+
this.submitclick.nativeElement.click();
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
/**字段配置 */
|
|
1095
|
+
formConfiguration = '';
|
|
1096
|
+
/**文件容器名称 */
|
|
1097
|
+
FileContainerName = '';
|
|
1098
|
+
AfterInit() {
|
|
1099
|
+
return new Promise((resolve, rejects) => {
|
|
1100
|
+
let ValidatorsArray = [];
|
|
1101
|
+
if (this._fields.required) {
|
|
1102
|
+
ValidatorsArray.push(Validators.required);
|
|
1103
|
+
}
|
|
1104
|
+
this.formConfiguration = this._fields.field.formConfiguration;
|
|
1105
|
+
this.FileContainerName = this.formConfiguration['FileExplorer.FileContainerName'];
|
|
1106
|
+
if (this._selected && this._selected.length > 0) {
|
|
1107
|
+
this.selectedFileGroup = this._selected;
|
|
1108
|
+
}
|
|
1109
|
+
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
1110
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
1111
|
+
resolve(true);
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
/**选择文件-弹窗的-已选定的文件 */
|
|
1115
|
+
selectedFileGroup = [];
|
|
1116
|
+
/**_selectedFile改变回调 */
|
|
1117
|
+
_selectedFileChange(event) {
|
|
1118
|
+
this.selectedFileGroup = event;
|
|
1119
|
+
let fieldName = this._fields.field.name;
|
|
1120
|
+
let obj = {};
|
|
1121
|
+
obj[fieldName] = event;
|
|
1122
|
+
this.extraProperties.patchValue(obj);
|
|
1123
|
+
console.log(event, '_selectedFile改变回调---file-explorer', this.extraProperties);
|
|
1124
|
+
}
|
|
1125
|
+
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 [selectFormFile]=\"selectedFileGroup\" (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>\n", 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: ["fileContainerName", "selectFormFile"], outputs: ["selectedFileChange"] }] });
|
|
1127
|
+
}
|
|
1128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerControlComponent, decorators: [{
|
|
1129
|
+
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 [selectFormFile]=\"selectedFileGroup\" (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>\n" }]
|
|
1131
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { entity: [{
|
|
1132
|
+
type: Input
|
|
1133
|
+
}], fields: [{
|
|
1134
|
+
type: Input
|
|
1135
|
+
}], parentFiledName: [{
|
|
1136
|
+
type: Input
|
|
1137
|
+
}], selected: [{
|
|
1138
|
+
type: Input
|
|
1139
|
+
}], submitclick: [{
|
|
1140
|
+
type: ViewChild,
|
|
1141
|
+
args: ['submitclick', { static: true }]
|
|
1142
|
+
}] } });
|
|
1143
|
+
|
|
1144
|
+
class SelectConfig {
|
|
1145
|
+
/**空值文本 */
|
|
1146
|
+
// placeholder: any = new FormControl('', Validators.required);
|
|
1147
|
+
'Select.NullText' = ['', []];
|
|
1148
|
+
//多选
|
|
1149
|
+
'Select.Multiple' = [false, []];
|
|
1150
|
+
// 选项
|
|
1151
|
+
'Select.Options' = new FormArray([]);
|
|
1152
|
+
constructor(data) {
|
|
1153
|
+
if (data) {
|
|
1154
|
+
for (const key in data) {
|
|
1155
|
+
if (data.hasOwnProperty(key)) {
|
|
1156
|
+
this[key] = data[key];
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
class SelectConfigComponent {
|
|
1164
|
+
fb;
|
|
1165
|
+
constructor(fb) {
|
|
1166
|
+
this.fb = fb;
|
|
1167
|
+
}
|
|
1168
|
+
/**表单控件类型 */
|
|
1169
|
+
_type;
|
|
1170
|
+
set type(v) {
|
|
1171
|
+
this._type = v;
|
|
1172
|
+
this.dataLoaded();
|
|
1173
|
+
}
|
|
1174
|
+
/**表单实体 */
|
|
1175
|
+
_Entity;
|
|
1176
|
+
set Entity(v) {
|
|
1177
|
+
this._Entity = v;
|
|
1178
|
+
this.dataLoaded();
|
|
1179
|
+
}
|
|
1180
|
+
/**选择的表单信息 */
|
|
1181
|
+
_selected;
|
|
1182
|
+
set selected(v) {
|
|
1183
|
+
this._selected = v;
|
|
1184
|
+
this.dataLoaded();
|
|
1185
|
+
}
|
|
1186
|
+
get formConfiguration() {
|
|
1187
|
+
return this._Entity.get('formConfiguration');
|
|
1188
|
+
}
|
|
1189
|
+
get SelectOptions() {
|
|
1190
|
+
return this.formConfiguration.controls['Select.Options'];
|
|
1191
|
+
}
|
|
1192
|
+
submitclick;
|
|
1193
|
+
async dataLoaded() {
|
|
1194
|
+
if (this._Entity && this._type) {
|
|
1195
|
+
await this.AfterInit();
|
|
1196
|
+
this.submitclick.nativeElement.click();
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
/**增加选项 */
|
|
1200
|
+
addSelectOptions() {
|
|
1201
|
+
this.SelectOptions.push(new FormGroup({
|
|
1202
|
+
Text: new FormControl('', Validators.required),
|
|
1203
|
+
Value: new FormControl('', Validators.required),
|
|
1204
|
+
Selected: new FormControl(false)
|
|
1205
|
+
}));
|
|
1206
|
+
}
|
|
1207
|
+
/**删除某个选项 */
|
|
1208
|
+
deleteSelectOptions(index) {
|
|
1209
|
+
this.SelectOptions.removeAt(index);
|
|
1210
|
+
}
|
|
1211
|
+
AfterInit() {
|
|
1212
|
+
return new Promise((resolve, rejects) => {
|
|
1213
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new SelectConfig()));
|
|
1214
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
1215
|
+
this._selected.formConfiguration['Select.Options']?.forEach(el => {
|
|
1216
|
+
this.addSelectOptions();
|
|
1217
|
+
});
|
|
1218
|
+
this.formConfiguration.patchValue({
|
|
1219
|
+
...this._selected.formConfiguration,
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
else {
|
|
1223
|
+
this.addSelectOptions();
|
|
1224
|
+
}
|
|
1225
|
+
resolve(true);
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
1229
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectConfigComponent, selector: "df-select-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\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemText' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addSelectOptions()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"Select.Options\">\n <ng-container *ngFor=\"let item of SelectOptions.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"Text\"></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"Value\"></td>\n <td>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Selected\" id=\"selected\">\n </div>\n </td>\n <td scope=\"row\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"deleteSelectOptions(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </td>\n </tr> \n </ng-container>\n \n \n </tbody>\n </table>\n </div>\n\n\n\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::NullText' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Select.NullText\">\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Select.Multiple\"\n id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'DigniteAbpForms::Multiple' | 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: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i2.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i2.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { 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" }] });
|
|
1230
|
+
}
|
|
1231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectConfigComponent, decorators: [{
|
|
1232
|
+
type: Component,
|
|
1233
|
+
args: [{ selector: 'df-select-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemText' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addSelectOptions()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"Select.Options\">\n <ng-container *ngFor=\"let item of SelectOptions.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"Text\"></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"Value\"></td>\n <td>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Selected\" id=\"selected\">\n </div>\n </td>\n <td scope=\"row\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"deleteSelectOptions(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </td>\n </tr> \n </ng-container>\n \n \n </tbody>\n </table>\n </div>\n\n\n\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::NullText' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Select.NullText\">\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Select.Multiple\"\n id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'DigniteAbpForms::Multiple' | 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>" }]
|
|
1234
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { type: [{
|
|
1235
|
+
type: Input
|
|
1236
|
+
}], Entity: [{
|
|
1237
|
+
type: Input
|
|
1238
|
+
}], selected: [{
|
|
1239
|
+
type: Input
|
|
1240
|
+
}], submitclick: [{
|
|
1241
|
+
type: ViewChild,
|
|
1242
|
+
args: ['submitclick', { static: true }]
|
|
1243
|
+
}] } });
|
|
1244
|
+
|
|
1245
|
+
class SelectControlComponent {
|
|
1246
|
+
fb;
|
|
1247
|
+
constructor(fb) {
|
|
1248
|
+
this.fb = fb;
|
|
1249
|
+
}
|
|
1250
|
+
/**表单实体 */
|
|
1251
|
+
_entity;
|
|
1252
|
+
set entity(v) {
|
|
1253
|
+
this._entity = v;
|
|
1254
|
+
this.dataLoaded();
|
|
1255
|
+
}
|
|
1256
|
+
/**字段配置列表 */
|
|
1257
|
+
_fields = '';
|
|
1258
|
+
set fields(v) {
|
|
1259
|
+
this._fields = v;
|
|
1260
|
+
this.dataLoaded();
|
|
1261
|
+
}
|
|
1262
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
1263
|
+
_parentFiledName;
|
|
1264
|
+
set parentFiledName(v) {
|
|
1265
|
+
this._parentFiledName = v;
|
|
1266
|
+
this.dataLoaded();
|
|
1267
|
+
}
|
|
1268
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
1269
|
+
_selected;
|
|
1270
|
+
set selected(v) {
|
|
1271
|
+
this._selected = v;
|
|
1272
|
+
this.dataLoaded();
|
|
1273
|
+
}
|
|
1274
|
+
submitclick;
|
|
1275
|
+
get extraProperties() {
|
|
1276
|
+
return this._entity.get('extraProperties');
|
|
1277
|
+
}
|
|
1278
|
+
/**数据加载完成 */
|
|
1279
|
+
async dataLoaded() {
|
|
1280
|
+
if (this._fields && this._entity) {
|
|
1281
|
+
await this.AfterInit();
|
|
1282
|
+
this.submitclick.nativeElement.click();
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
formConfiguration = '';
|
|
1286
|
+
AfterInit() {
|
|
1287
|
+
return new Promise((resolve, rejects) => {
|
|
1288
|
+
let ValidatorsArray = [];
|
|
1289
|
+
if (this._fields.required) {
|
|
1290
|
+
ValidatorsArray.push(Validators.required);
|
|
1291
|
+
}
|
|
1292
|
+
this.formConfiguration = this._fields.field.formConfiguration;
|
|
1293
|
+
if (!this._selected) {
|
|
1294
|
+
const isMultiple = this.formConfiguration['Select.Multiple'];
|
|
1295
|
+
let selectValue = isMultiple ? [] : '';
|
|
1296
|
+
this.formConfiguration['Select.Options'].forEach(el => {
|
|
1297
|
+
if (el.Selected) {
|
|
1298
|
+
selectValue = isMultiple ? [...selectValue, el.value] : [el.value];
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
this._selected = selectValue;
|
|
1302
|
+
}
|
|
1303
|
+
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
1304
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
1305
|
+
resolve(true);
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectControlComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
1309
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectControlComponent, selector: "df-select-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 <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\n <select class=\"form-select\" multiple formControlName=\"{{_fields.field.name}}\">\n <ng-container *ngFor=\"let item of _fields.field.formConfiguration['Select.Options'];let i =index\">\n <option [value]=\"item.value\">{{item.text}}</option>\n </ng-container>\n </select>\n </ng-container>\n <ng-template #elseTemplate>\n <select class=\"form-select\" [multiple]=\"false\"\n formControlName=\"{{_fields.field.name}}\">\n <option>{{formConfiguration['Select.NullText']}}</option>\n <ng-container *ngFor=\"let item of formConfiguration['Select.Options'];let i =index\">\n <option [value]=\"item.Value\" >{{item.Text}}</option>\n </ng-container>\n </select>\n </ng-template>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n\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.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { 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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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"] }] });
|
|
1310
|
+
}
|
|
1311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectControlComponent, decorators: [{
|
|
1312
|
+
type: Component,
|
|
1313
|
+
args: [{ selector: 'df-select-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 <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\n <select class=\"form-select\" multiple formControlName=\"{{_fields.field.name}}\">\n <ng-container *ngFor=\"let item of _fields.field.formConfiguration['Select.Options'];let i =index\">\n <option [value]=\"item.value\">{{item.text}}</option>\n </ng-container>\n </select>\n </ng-container>\n <ng-template #elseTemplate>\n <select class=\"form-select\" [multiple]=\"false\"\n formControlName=\"{{_fields.field.name}}\">\n <option>{{formConfiguration['Select.NullText']}}</option>\n <ng-container *ngFor=\"let item of formConfiguration['Select.Options'];let i =index\">\n <option [value]=\"item.Value\" >{{item.Text}}</option>\n </ng-container>\n </select>\n </ng-template>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
|
|
1314
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { entity: [{
|
|
1315
|
+
type: Input
|
|
1316
|
+
}], fields: [{
|
|
1317
|
+
type: Input
|
|
1318
|
+
}], parentFiledName: [{
|
|
1319
|
+
type: Input
|
|
1320
|
+
}], selected: [{
|
|
1321
|
+
type: Input
|
|
1322
|
+
}], submitclick: [{
|
|
1323
|
+
type: ViewChild,
|
|
1324
|
+
args: ['submitclick', { static: true }]
|
|
1325
|
+
}] } });
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* 表单控件分组-包含配置,控件,显示的数组
|
|
1329
|
+
*/
|
|
1330
|
+
const FieldControlGroup = [
|
|
1331
|
+
{
|
|
1332
|
+
displayName: '文本框',
|
|
1333
|
+
name: 'TextEdit',
|
|
1334
|
+
fieldConfigComponent: TextEditConfigComponent,
|
|
1335
|
+
fieldComponent: TextEditComponent,
|
|
1336
|
+
// fieldViewComponent:TextBoxViewComponent,
|
|
1337
|
+
}, {
|
|
1338
|
+
displayName: '开关',
|
|
1339
|
+
name: 'Switch',
|
|
1340
|
+
fieldConfigComponent: SwitchConfigComponent,
|
|
1341
|
+
fieldComponent: SwitchControlComponent,
|
|
1342
|
+
// fieldViewComponent:TextBoxViewComponent,
|
|
1343
|
+
}, {
|
|
1344
|
+
displayName: '选择',
|
|
1345
|
+
name: 'Select',
|
|
1346
|
+
fieldConfigComponent: SelectConfigComponent,
|
|
1347
|
+
fieldComponent: SelectControlComponent,
|
|
1348
|
+
// fieldViewComponent:TextBoxViewComponent,
|
|
1349
|
+
}, {
|
|
1350
|
+
displayName: '数字',
|
|
1351
|
+
name: 'NumericEdit',
|
|
1352
|
+
fieldConfigComponent: NumbericEditConfigComponent,
|
|
1353
|
+
fieldComponent: NumbericEditControlComponent,
|
|
1354
|
+
// fieldViewComponent:TextBoxViewComponent,
|
|
1355
|
+
}, {
|
|
1356
|
+
displayName: '日期',
|
|
1357
|
+
name: 'DateEdit',
|
|
1358
|
+
fieldConfigComponent: DateEditConfigComponent,
|
|
1359
|
+
fieldComponent: DateEditControlComponent,
|
|
1360
|
+
// fieldViewComponent:TextBoxViewComponent,
|
|
1361
|
+
},
|
|
1362
|
+
// {
|
|
1363
|
+
// displayName: '表格',
|
|
1364
|
+
// name: 'Table',
|
|
1365
|
+
// fieldConfigComponent: TableConfigComponent,
|
|
1366
|
+
// fieldComponent: TableControlComponent,
|
|
1367
|
+
// // fieldViewComponent:TextBoxViewComponent,
|
|
1368
|
+
// },
|
|
1369
|
+
// {
|
|
1370
|
+
// displayName: '矩阵',
|
|
1371
|
+
// name: 'Matrix',
|
|
1372
|
+
// fieldConfigComponent: MatrixConfigComponent,
|
|
1373
|
+
// fieldComponent: MatrixControlComponent,
|
|
1374
|
+
// // fieldViewComponent:TextBoxViewComponent,
|
|
1375
|
+
// },
|
|
1376
|
+
{
|
|
1377
|
+
displayName: '文件管理',
|
|
1378
|
+
name: 'FileExplorer',
|
|
1379
|
+
fieldConfigComponent: FileExplorerConfigComponent,
|
|
1380
|
+
fieldComponent: FileExplorerControlComponent,
|
|
1381
|
+
// fieldViewComponent:TextBoxViewComponent,
|
|
1382
|
+
}, {
|
|
1383
|
+
displayName: 'CkEditor',
|
|
1384
|
+
name: 'CkEditor',
|
|
1385
|
+
fieldConfigComponent: CkEditorConfigComponent,
|
|
1386
|
+
fieldComponent: CkEditorControlComponent,
|
|
1387
|
+
// fieldViewComponent:TextBoxViewComponent,
|
|
1388
|
+
},
|
|
1389
|
+
];
|
|
1390
|
+
function getExcludeAssignControl(typeName) {
|
|
1391
|
+
return FieldControlGroup.filter(el => el.name !== typeName);
|
|
1392
|
+
}
|
|
1393
|
+
function AddFieldControlGroup(array) {
|
|
1394
|
+
FieldControlGroup.push(...array);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
// export * from './matrix'
|
|
1398
|
+
// export * from './table'
|
|
1399
|
+
|
|
1400
|
+
class DynamicComponent {
|
|
1401
|
+
/**选择的表单信息 */
|
|
1402
|
+
_selected;
|
|
1403
|
+
set selected(v) {
|
|
1404
|
+
this._selected = v || '';
|
|
1405
|
+
if (v)
|
|
1406
|
+
this.dataLoaded(1);
|
|
1407
|
+
}
|
|
1408
|
+
/**表单控件类型 */
|
|
1409
|
+
_type;
|
|
1410
|
+
set type(v) {
|
|
1411
|
+
this._type = v;
|
|
1412
|
+
if (v)
|
|
1413
|
+
this.dataLoaded(2);
|
|
1414
|
+
}
|
|
1415
|
+
/**表单实体 */
|
|
1416
|
+
_entity;
|
|
1417
|
+
set entity(v) {
|
|
1418
|
+
this._entity = v;
|
|
1419
|
+
if (v)
|
|
1420
|
+
this.dataLoaded(3);
|
|
1421
|
+
}
|
|
1422
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
1423
|
+
_parentFiledName;
|
|
1424
|
+
set parentFiledName(v) {
|
|
1425
|
+
this._parentFiledName = v;
|
|
1426
|
+
if (v)
|
|
1427
|
+
this.dataLoaded(4);
|
|
1428
|
+
}
|
|
1429
|
+
/**字段配置列表 */
|
|
1430
|
+
_fields = '';
|
|
1431
|
+
set fields(v) {
|
|
1432
|
+
this._fields = v;
|
|
1433
|
+
if (v)
|
|
1434
|
+
this.dataLoaded(5);
|
|
1435
|
+
}
|
|
1436
|
+
/**表单控件模板-动态赋值表单控件 */
|
|
1437
|
+
FormControlRef;
|
|
1438
|
+
/**表单控件模板-动态赋值表单控件 */
|
|
1439
|
+
FormComponentsRef;
|
|
1440
|
+
/**表单控件组 */
|
|
1441
|
+
_fieldControlGroup = FieldControlGroup;
|
|
1442
|
+
/**数据加载完成 */
|
|
1443
|
+
dataLoaded(val) {
|
|
1444
|
+
if (this._entity) {
|
|
1445
|
+
if (this._type) {
|
|
1446
|
+
let fieldControlItem = this._fieldControlGroup.find(el => el.name === this._type);
|
|
1447
|
+
this.loadfieldConfigComponent(fieldControlItem);
|
|
1448
|
+
}
|
|
1449
|
+
if (this._fields && this._parentFiledName) {
|
|
1450
|
+
/**表单控件组中的项 */
|
|
1451
|
+
let fieldControlItem = this._fieldControlGroup.find(el => el.name === this._fields.field.formControlName);
|
|
1452
|
+
this.loadfieldComponent(fieldControlItem);
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
/**加载动态表单配置组件 */
|
|
1457
|
+
loadfieldConfigComponent(FieldControlItem) {
|
|
1458
|
+
//清空了容器中的所有组件
|
|
1459
|
+
this.FormControlRef?.clear();
|
|
1460
|
+
if (!FieldControlItem || !FieldControlItem.fieldConfigComponent)
|
|
1461
|
+
return;
|
|
1462
|
+
//在容器中创建组件
|
|
1463
|
+
const { instance } = this.FormControlRef?.createComponent(FieldControlItem.fieldConfigComponent); //创建组件模板
|
|
1464
|
+
/**向创建的组件模板中传值 */
|
|
1465
|
+
instance.Entity = this._entity;
|
|
1466
|
+
instance.selected = this._selected;
|
|
1467
|
+
instance.type = this._type;
|
|
1468
|
+
}
|
|
1469
|
+
/**加载动态表单组件 */
|
|
1470
|
+
loadfieldComponent(FieldControlItem) {
|
|
1471
|
+
// this.FormControlRef.clear
|
|
1472
|
+
//清空了容器中的所有组件
|
|
1473
|
+
this.FormComponentsRef?.clear();
|
|
1474
|
+
if (!FieldControlItem || !FieldControlItem.fieldComponent)
|
|
1475
|
+
return;
|
|
1476
|
+
//在容器中创建组件
|
|
1477
|
+
const { instance } = this.FormComponentsRef?.createComponent(FieldControlItem.fieldComponent); //创建组件模板
|
|
1478
|
+
// this.formConfigCompoent = instance
|
|
1479
|
+
/**向创建的组件模板中传值 */
|
|
1480
|
+
instance.entity = this._entity;
|
|
1481
|
+
instance.fields = this._fields;
|
|
1482
|
+
instance.parentFiledName = this._parentFiledName;
|
|
1483
|
+
instance.selected = this._selected;
|
|
1484
|
+
}
|
|
1485
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1486
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DynamicComponent, selector: "df-dynamic", inputs: { selected: "selected", type: "type", entity: "entity", parentFiledName: "parentFiledName", fields: "fields" }, viewQueries: [{ propertyName: "FormControlRef", first: true, predicate: ["FormControlRef"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "FormComponentsRef", first: true, predicate: ["FormComponentsRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<template #FormControlRef></template>\n<template #FormComponentsRef></template>", styles: [""] });
|
|
1487
|
+
}
|
|
1488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicComponent, decorators: [{
|
|
1489
|
+
type: Component,
|
|
1490
|
+
args: [{ selector: 'df-dynamic', template: "<template #FormControlRef></template>\n<template #FormComponentsRef></template>" }]
|
|
1491
|
+
}], propDecorators: { selected: [{
|
|
1492
|
+
type: Input
|
|
1493
|
+
}], type: [{
|
|
1494
|
+
type: Input
|
|
1495
|
+
}], entity: [{
|
|
1496
|
+
type: Input
|
|
1497
|
+
}], parentFiledName: [{
|
|
1498
|
+
type: Input
|
|
1499
|
+
}], fields: [{
|
|
1500
|
+
type: Input
|
|
1501
|
+
}], FormControlRef: [{
|
|
1502
|
+
type: ViewChild,
|
|
1503
|
+
args: ['FormControlRef', { read: ViewContainerRef, static: true }]
|
|
1504
|
+
}], FormComponentsRef: [{
|
|
1505
|
+
type: ViewChild,
|
|
1506
|
+
args: ['FormComponentsRef', { read: ViewContainerRef, static: true }]
|
|
1507
|
+
}] } });
|
|
1508
|
+
|
|
1509
|
+
class DynamicFormModule {
|
|
1510
|
+
static forRoot(config) {
|
|
1511
|
+
AddFieldControlGroup(config.cmsFieldControlGroup);
|
|
1512
|
+
return {
|
|
1513
|
+
ngModule: DynamicFormModule,
|
|
1514
|
+
providers: []
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1518
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DynamicFormModule, declarations: [TextEditConfigComponent,
|
|
1519
|
+
TextEditComponent,
|
|
1520
|
+
SwitchConfigComponent,
|
|
1521
|
+
SwitchControlComponent,
|
|
1522
|
+
NumbericEditConfigComponent,
|
|
1523
|
+
NumbericEditControlComponent,
|
|
1524
|
+
DateEditConfigComponent,
|
|
1525
|
+
DateEditControlComponent,
|
|
1526
|
+
FileExplorerConfigComponent,
|
|
1527
|
+
FileExplorerControlComponent,
|
|
1528
|
+
CkEditorConfigComponent,
|
|
1529
|
+
SelectConfigComponent,
|
|
1530
|
+
SelectControlComponent,
|
|
1531
|
+
DynamicComponent], imports: [FormsModule,
|
|
1532
|
+
CoreModule,
|
|
1533
|
+
ThemeSharedModule,
|
|
1534
|
+
ReactiveFormsModule,
|
|
1535
|
+
NgbDropdownModule,
|
|
1536
|
+
NzTreeModule,
|
|
1537
|
+
FileExplorerModule], exports: [TextEditConfigComponent,
|
|
1538
|
+
TextEditComponent,
|
|
1539
|
+
SwitchConfigComponent,
|
|
1540
|
+
SwitchControlComponent,
|
|
1541
|
+
NumbericEditConfigComponent,
|
|
1542
|
+
NumbericEditControlComponent,
|
|
1543
|
+
DateEditConfigComponent,
|
|
1544
|
+
DateEditControlComponent,
|
|
1545
|
+
FileExplorerConfigComponent,
|
|
1546
|
+
FileExplorerControlComponent,
|
|
1547
|
+
CkEditorConfigComponent,
|
|
1548
|
+
SelectConfigComponent,
|
|
1549
|
+
SelectControlComponent,
|
|
1550
|
+
DynamicComponent] });
|
|
1551
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicFormModule, imports: [FormsModule,
|
|
1552
|
+
CoreModule,
|
|
1553
|
+
ThemeSharedModule,
|
|
1554
|
+
ReactiveFormsModule,
|
|
1555
|
+
NgbDropdownModule,
|
|
1556
|
+
NzTreeModule,
|
|
1557
|
+
FileExplorerModule] });
|
|
1558
|
+
}
|
|
1559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicFormModule, decorators: [{
|
|
1560
|
+
type: NgModule,
|
|
1561
|
+
args: [{
|
|
1562
|
+
declarations: [
|
|
1563
|
+
TextEditConfigComponent,
|
|
1564
|
+
TextEditComponent,
|
|
1565
|
+
SwitchConfigComponent,
|
|
1566
|
+
SwitchControlComponent,
|
|
1567
|
+
NumbericEditConfigComponent,
|
|
1568
|
+
NumbericEditControlComponent,
|
|
1569
|
+
DateEditConfigComponent,
|
|
1570
|
+
DateEditControlComponent,
|
|
1571
|
+
FileExplorerConfigComponent,
|
|
1572
|
+
FileExplorerControlComponent,
|
|
1573
|
+
CkEditorConfigComponent,
|
|
1574
|
+
SelectConfigComponent,
|
|
1575
|
+
SelectControlComponent,
|
|
1576
|
+
DynamicComponent,
|
|
1577
|
+
],
|
|
1578
|
+
imports: [
|
|
1579
|
+
FormsModule,
|
|
1580
|
+
CoreModule,
|
|
1581
|
+
ThemeSharedModule,
|
|
1582
|
+
ReactiveFormsModule,
|
|
1583
|
+
NgbDropdownModule,
|
|
1584
|
+
NzTreeModule,
|
|
1585
|
+
FileExplorerModule,
|
|
1586
|
+
],
|
|
1587
|
+
exports: [
|
|
1588
|
+
TextEditConfigComponent,
|
|
1589
|
+
TextEditComponent,
|
|
1590
|
+
SwitchConfigComponent,
|
|
1591
|
+
SwitchControlComponent,
|
|
1592
|
+
NumbericEditConfigComponent,
|
|
1593
|
+
NumbericEditControlComponent,
|
|
1594
|
+
DateEditConfigComponent,
|
|
1595
|
+
DateEditControlComponent,
|
|
1596
|
+
FileExplorerConfigComponent,
|
|
1597
|
+
FileExplorerControlComponent,
|
|
1598
|
+
CkEditorConfigComponent,
|
|
1599
|
+
SelectConfigComponent,
|
|
1600
|
+
SelectControlComponent,
|
|
1601
|
+
DynamicComponent
|
|
1602
|
+
],
|
|
1603
|
+
}]
|
|
1604
|
+
}] });
|
|
1605
|
+
|
|
1606
|
+
let FileDescriptorService$1 = class FileDescriptorService {
|
|
1607
|
+
restService;
|
|
1608
|
+
apiName = 'FileExplorer';
|
|
1609
|
+
create = (input, config) => this.restService.request({
|
|
1610
|
+
method: 'POST',
|
|
1611
|
+
url: '/api/file-explorer/directories',
|
|
1612
|
+
body: input,
|
|
1613
|
+
}, { apiName: this.apiName, ...config });
|
|
1614
|
+
delete = (id, config) => this.restService.request({
|
|
1615
|
+
method: 'DELETE',
|
|
1616
|
+
url: `/api/file-explorer/directories/${id}`,
|
|
1617
|
+
}, { apiName: this.apiName, ...config });
|
|
1618
|
+
get = (id, config) => this.restService.request({
|
|
1619
|
+
method: 'GET',
|
|
1620
|
+
url: `/api/file-explorer/directories/${id}`,
|
|
1621
|
+
}, { apiName: this.apiName, ...config });
|
|
1622
|
+
getList = (input, config) => this.restService.request({
|
|
1623
|
+
method: 'GET',
|
|
1624
|
+
url: '/api/file-explorer/directories',
|
|
1625
|
+
params: { containerName: input.containerName },
|
|
1626
|
+
}, { apiName: this.apiName, ...config });
|
|
1627
|
+
move = (id, input, config) => this.restService.request({
|
|
1628
|
+
method: 'PUT',
|
|
1629
|
+
url: `/api/file-explorer/directories/${id}/move`,
|
|
1630
|
+
body: input,
|
|
1631
|
+
}, { apiName: this.apiName, ...config });
|
|
1632
|
+
update = (id, input, config) => this.restService.request({
|
|
1633
|
+
method: 'PUT',
|
|
1634
|
+
url: `/api/file-explorer/directories/${id}`,
|
|
1635
|
+
body: input,
|
|
1636
|
+
}, { apiName: this.apiName, ...config });
|
|
1637
|
+
constructor(restService) {
|
|
1638
|
+
this.restService = restService;
|
|
1639
|
+
}
|
|
1640
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, deps: [{ token: i2.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1641
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, providedIn: 'root' });
|
|
1642
|
+
};
|
|
1643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService$1, decorators: [{
|
|
1644
|
+
type: Injectable,
|
|
1645
|
+
args: [{
|
|
1646
|
+
providedIn: 'root',
|
|
1647
|
+
}]
|
|
1648
|
+
}], ctorParameters: function () { return [{ type: i2.RestService }]; } });
|
|
1649
|
+
|
|
1650
|
+
var index$e = /*#__PURE__*/Object.freeze({
|
|
1651
|
+
__proto__: null,
|
|
1652
|
+
FileDescriptorService: FileDescriptorService$1
|
|
1653
|
+
});
|
|
1654
|
+
|
|
1655
|
+
class FileDescriptorService {
|
|
1656
|
+
restService;
|
|
1657
|
+
apiName = 'FileExplorer';
|
|
1658
|
+
create = (input, config) => this.restService.request({
|
|
1659
|
+
method: 'POST',
|
|
1660
|
+
url: '/api/file-explorer/files',
|
|
1661
|
+
params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
|
|
1662
|
+
body: input.file,
|
|
1663
|
+
}, { apiName: this.apiName, ...config });
|
|
1664
|
+
delete = (id, config) => this.restService.request({
|
|
1665
|
+
method: 'DELETE',
|
|
1666
|
+
url: `/api/file-explorer/files/${id}`,
|
|
1667
|
+
}, { apiName: this.apiName, ...config });
|
|
1668
|
+
download = (containerName, blobName, fileName, config) => this.restService.request({
|
|
1669
|
+
method: 'GET',
|
|
1670
|
+
url: `/api/file-explorer/files/download/${containerName}/${blobName}`,
|
|
1671
|
+
params: { fileName },
|
|
1672
|
+
}, { apiName: this.apiName, ...config });
|
|
1673
|
+
get = (id, config) => this.restService.request({
|
|
1674
|
+
method: 'GET',
|
|
1675
|
+
url: `/api/file-explorer/files/${id}`,
|
|
1676
|
+
}, { apiName: this.apiName, ...config });
|
|
1677
|
+
getFileContainerConfiguration = (containerName, config) => this.restService.request({
|
|
1678
|
+
method: 'GET',
|
|
1679
|
+
url: '/api/file-explorer/files/configuration',
|
|
1680
|
+
params: { containerName },
|
|
1681
|
+
}, { apiName: this.apiName, ...config });
|
|
1682
|
+
getList = (input, config) => this.restService.request({
|
|
1683
|
+
method: 'GET',
|
|
1684
|
+
url: '/api/file-explorer/files',
|
|
1685
|
+
params: { containerName: input.containerName, directoryId: input.directoryId, creatorId: input.creatorId, filter: input.filter, entityId: input.entityId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
|
|
1686
|
+
}, { apiName: this.apiName, ...config });
|
|
1687
|
+
getStream = (containerName, blobName, imageResize, config) => this.restService.request({
|
|
1688
|
+
method: 'GET',
|
|
1689
|
+
responseType: 'blob',
|
|
1690
|
+
url: `/api/file-explorer/files/${containerName}/${blobName}`,
|
|
1691
|
+
params: { width: imageResize.width, height: imageResize.height },
|
|
1692
|
+
}, { apiName: this.apiName, ...config });
|
|
1693
|
+
update = (id, input, config) => this.restService.request({
|
|
1694
|
+
method: 'PUT',
|
|
1695
|
+
url: `/api/file-explorer/files/${id}`,
|
|
1696
|
+
body: input,
|
|
1697
|
+
}, { apiName: this.apiName, ...config });
|
|
1698
|
+
constructor(restService) {
|
|
1699
|
+
this.restService = restService;
|
|
1700
|
+
}
|
|
1701
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, deps: [{ token: i2.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1702
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, providedIn: 'root' });
|
|
1703
|
+
}
|
|
1704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, decorators: [{
|
|
1705
|
+
type: Injectable,
|
|
1706
|
+
args: [{
|
|
1707
|
+
providedIn: 'root',
|
|
1708
|
+
}]
|
|
1709
|
+
}], ctorParameters: function () { return [{ type: i2.RestService }]; } });
|
|
1710
|
+
|
|
1711
|
+
var index$d = /*#__PURE__*/Object.freeze({
|
|
1712
|
+
__proto__: null,
|
|
1713
|
+
FileDescriptorService: FileDescriptorService
|
|
1714
|
+
});
|
|
1715
|
+
|
|
1716
|
+
var index$c = /*#__PURE__*/Object.freeze({
|
|
1717
|
+
__proto__: null,
|
|
1718
|
+
Directories: index$e,
|
|
1719
|
+
Files: index$d
|
|
1720
|
+
});
|
|
1721
|
+
|
|
1722
|
+
var index$b = /*#__PURE__*/Object.freeze({
|
|
1723
|
+
__proto__: null,
|
|
1724
|
+
FileExplorer: index$c
|
|
1725
|
+
});
|
|
1726
|
+
|
|
1727
|
+
var index$a = /*#__PURE__*/Object.freeze({
|
|
1728
|
+
__proto__: null
|
|
1729
|
+
});
|
|
1730
|
+
|
|
1731
|
+
var index$9 = /*#__PURE__*/Object.freeze({
|
|
1732
|
+
__proto__: null,
|
|
1733
|
+
Mvc: index$a
|
|
1734
|
+
});
|
|
1735
|
+
|
|
1736
|
+
var index$8 = /*#__PURE__*/Object.freeze({
|
|
1737
|
+
__proto__: null
|
|
1738
|
+
});
|
|
1739
|
+
|
|
1740
|
+
var index$7 = /*#__PURE__*/Object.freeze({
|
|
1741
|
+
__proto__: null,
|
|
1742
|
+
Primitives: index$8
|
|
1743
|
+
});
|
|
1744
|
+
|
|
1745
|
+
var index$6 = /*#__PURE__*/Object.freeze({
|
|
1746
|
+
__proto__: null
|
|
1747
|
+
});
|
|
1748
|
+
|
|
1749
|
+
var index$5 = /*#__PURE__*/Object.freeze({
|
|
1750
|
+
__proto__: null,
|
|
1751
|
+
Headers: index$6
|
|
1752
|
+
});
|
|
1753
|
+
|
|
1754
|
+
var index$4 = /*#__PURE__*/Object.freeze({
|
|
1755
|
+
__proto__: null,
|
|
1756
|
+
Http: index$5
|
|
1757
|
+
});
|
|
1758
|
+
|
|
1759
|
+
var index$3 = /*#__PURE__*/Object.freeze({
|
|
1760
|
+
__proto__: null,
|
|
1761
|
+
AspNetCore: index$9,
|
|
1762
|
+
Extensions: index$7,
|
|
1763
|
+
Net: index$4
|
|
1764
|
+
});
|
|
1765
|
+
|
|
1766
|
+
var index$2 = /*#__PURE__*/Object.freeze({
|
|
1767
|
+
__proto__: null
|
|
1768
|
+
});
|
|
1769
|
+
|
|
1770
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
1771
|
+
__proto__: null,
|
|
1772
|
+
Content: index$2
|
|
1773
|
+
});
|
|
1774
|
+
|
|
1775
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
1776
|
+
__proto__: null,
|
|
1777
|
+
Abp: index$1
|
|
1778
|
+
});
|
|
1779
|
+
|
|
1780
|
+
class DfApiService {
|
|
1781
|
+
constructor() { }
|
|
1782
|
+
/**
|
|
1783
|
+
* 识别中文转化为拼音,固定返回类型
|
|
1784
|
+
* 汉字转拼音
|
|
1785
|
+
* 大写转小写
|
|
1786
|
+
*
|
|
1787
|
+
* */
|
|
1788
|
+
chineseToPinyin(value) {
|
|
1789
|
+
//去除字符串中所有的空格
|
|
1790
|
+
let val = value.replace(/\s+/g, "");
|
|
1791
|
+
let array = val.split('');
|
|
1792
|
+
let newArray = [];
|
|
1793
|
+
array.forEach((el, index) => {
|
|
1794
|
+
//转化为小写
|
|
1795
|
+
let elChange = el.toLowerCase();
|
|
1796
|
+
let isChinese = (str) => {
|
|
1797
|
+
return /^[\u4e00-\u9fa5]+$/.test(str);
|
|
1798
|
+
};
|
|
1799
|
+
if (isChinese(elChange)) {
|
|
1800
|
+
const resultWithoutTone = pinyin(elChange, { toneType: 'none', type: 'array' });
|
|
1801
|
+
elChange = resultWithoutTone.toString();
|
|
1802
|
+
if (index < array.length - 1)
|
|
1803
|
+
elChange += '-';
|
|
1804
|
+
}
|
|
1805
|
+
;
|
|
1806
|
+
newArray.push(elChange);
|
|
1807
|
+
});
|
|
1808
|
+
let pinyinstr = newArray.join('');
|
|
1809
|
+
return pinyinstr || val;
|
|
1810
|
+
}
|
|
1811
|
+
/**获取图片的本地连接 */
|
|
1812
|
+
getImageLacolBase64Url(file) {
|
|
1813
|
+
return new Promise((resolve, rejects) => {
|
|
1814
|
+
const reader = new FileReader();
|
|
1815
|
+
reader.readAsDataURL(file);
|
|
1816
|
+
reader.onload = (e) => {
|
|
1817
|
+
resolve(e.target.result);
|
|
1818
|
+
};
|
|
1819
|
+
reader.onerror = error => rejects(error);
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* 深拷贝--方法 */
|
|
1824
|
+
deepClone(obj) {
|
|
1825
|
+
if (typeof obj !== 'object' || obj === null)
|
|
1826
|
+
return obj;
|
|
1827
|
+
const result = Array.isArray(obj) ? [] : {};
|
|
1828
|
+
for (let key in obj) {
|
|
1829
|
+
if (obj.hasOwnProperty(key)) {
|
|
1830
|
+
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
1831
|
+
if (obj[key] instanceof Date) {
|
|
1832
|
+
result[key] = new Date(obj[key].getTime());
|
|
1833
|
+
}
|
|
1834
|
+
else if (obj[key] instanceof RegExp) {
|
|
1835
|
+
result[key] = new RegExp(obj[key]);
|
|
1836
|
+
}
|
|
1837
|
+
else {
|
|
1838
|
+
result[key] = this.deepClone(obj[key]);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
else {
|
|
1842
|
+
result[key] = obj[key];
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
return result;
|
|
1847
|
+
}
|
|
1848
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DfApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1849
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DfApiService, providedIn: 'root' });
|
|
1850
|
+
}
|
|
1851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DfApiService, decorators: [{
|
|
1852
|
+
type: Injectable,
|
|
1853
|
+
args: [{
|
|
1854
|
+
providedIn: 'root'
|
|
1855
|
+
}]
|
|
1856
|
+
}], ctorParameters: function () { return []; } });
|
|
1857
|
+
|
|
1858
|
+
/*
|
|
1859
|
+
* Public API Surface of dynamic-form
|
|
1860
|
+
*/
|
|
1861
|
+
|
|
1862
|
+
/**
|
|
1863
|
+
* Generated bundle index. Do not edit.
|
|
1864
|
+
*/
|
|
1865
|
+
|
|
1866
|
+
export { AddFieldControlGroup, CkEditorConfigComponent, CkEditorControlComponent, DateEditConfigComponent, DateEditControlComponent, DateEditInterfaces, DfApiService, index$b as Dignite, DynamicComponent, DynamicFormModule, FieldControlGroup, FileExplorerConfigComponent, FileExplorerControlComponent, index$3 as Microsoft, NumbericEditConfigComponent, NumbericEditControlComponent, SelectConfigComponent, SelectControlComponent, SwitchConfigComponent, SwitchControlComponent, TextEditComponent, TextEditConfig, TextEditConfigComponent, TextEditMode, index as Volo, getExcludeAssignControl, maxDecimalPlacesValidator };
|
|
1867
|
+
//# sourceMappingURL=dignite-ng-expand.dynamic-form.mjs.map
|