@dignite-ng/expand.dynamic-form 3.0.0-rc.3 → 3.0.0-rc.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -13
- package/esm2022/dignite-ng-expand.dynamic-form.mjs +1 -1
- package/esm2022/lib/components/dynamic/dynamic-config.component.mjs +11 -0
- package/esm2022/lib/components/dynamic/dynamic-control.component.mjs +11 -0
- package/esm2022/lib/components/dynamic/dynamic-search.component.mjs +66 -0
- package/esm2022/lib/components/dynamic/dynamic-view.component.mjs +58 -0
- package/esm2022/lib/components/dynamic/dynamic.component.mjs +18 -13
- package/esm2022/lib/components/dynamic/index.mjs +5 -1
- package/esm2022/lib/components/form/date-edit/date-edit-config.component.mjs +5 -4
- package/esm2022/lib/components/form/date-edit/date-edit-config.mjs +1 -1
- package/esm2022/lib/components/form/date-edit/date-edit-control.component.mjs +3 -3
- package/esm2022/lib/components/form/date-edit/date-edit-view.component.mjs +40 -0
- package/esm2022/lib/components/form/date-edit/index.mjs +2 -1
- package/esm2022/lib/components/form/form-control-group.mjs +27 -19
- package/esm2022/lib/components/form/index.mjs +1 -1
- package/esm2022/lib/components/form/numeric-edit/index.mjs +1 -1
- package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.component.mjs +5 -4
- package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.mjs +4 -3
- package/esm2022/lib/components/form/numeric-edit/numberic-edit-control.component.mjs +13 -11
- package/esm2022/lib/components/form/numeric-edit/numeric-edit-search.component.mjs +107 -0
- package/esm2022/lib/components/form/numeric-edit/numeric-edit-view.component.mjs +39 -0
- package/esm2022/lib/components/form/select/index.mjs +3 -1
- package/esm2022/lib/components/form/select/select-config.component.mjs +23 -10
- package/esm2022/lib/components/form/select/select-config.mjs +1 -1
- package/esm2022/lib/components/form/select/select-control.component.mjs +24 -17
- package/esm2022/lib/components/form/select/select-search.component.mjs +94 -0
- package/esm2022/lib/components/form/select/select-view.component.mjs +44 -0
- package/esm2022/lib/components/form/switch/index.mjs +3 -1
- package/esm2022/lib/components/form/switch/switch-config.component.mjs +5 -4
- package/esm2022/lib/components/form/switch/switch-config.mjs +1 -1
- package/esm2022/lib/components/form/switch/switch-control.component.mjs +5 -5
- package/esm2022/lib/components/form/switch/switch-search.component.mjs +79 -0
- package/esm2022/lib/components/form/switch/switch-view.component.mjs +40 -0
- package/esm2022/lib/components/form/text-edit/index.mjs +3 -1
- package/esm2022/lib/components/form/text-edit/text-edit-config.component.mjs +5 -4
- package/esm2022/lib/components/form/text-edit/text-edit-config.mjs +1 -1
- package/esm2022/lib/components/form/text-edit/text-edit-search.component.mjs +81 -0
- package/esm2022/lib/components/form/text-edit/text-edit-view.component.mjs +39 -0
- package/esm2022/lib/components/form/text-edit/text-edit.component.mjs +5 -5
- package/esm2022/lib/components/index.mjs +1 -1
- package/esm2022/lib/dynamic-form.module.mjs +67 -7
- package/esm2022/lib/enums/date-edit-interfaces.mjs +1 -1
- package/esm2022/lib/enums/text-edit-mode.mjs +1 -1
- package/esm2022/lib/interfaces/form-config-interfaces.mjs +1 -1
- package/esm2022/lib/interfaces/index.mjs +1 -1
- package/esm2022/lib/services/df-api.service.mjs +1 -1
- package/esm2022/lib/services/form-control.service.mjs +33 -0
- package/esm2022/lib/services/index.mjs +1 -1
- package/esm2022/public-api.mjs +1 -1
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs +833 -78
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -1
- package/lib/components/dynamic/dynamic-config.component.d.ts +5 -0
- package/lib/components/dynamic/dynamic-control.component.d.ts +5 -0
- package/lib/components/dynamic/dynamic-search.component.d.ts +28 -0
- package/lib/components/dynamic/dynamic-view.component.d.ts +24 -0
- package/lib/components/dynamic/dynamic.component.d.ts +2 -0
- package/lib/components/dynamic/index.d.ts +4 -0
- package/lib/components/form/date-edit/date-edit-view.component.d.ts +17 -0
- package/lib/components/form/date-edit/index.d.ts +1 -0
- package/lib/components/form/form-control-group.d.ts +1 -2
- package/lib/components/form/numeric-edit/numberic-edit-control.component.d.ts +1 -1
- package/lib/components/form/numeric-edit/numeric-edit-search.component.d.ts +35 -0
- package/lib/components/form/numeric-edit/numeric-edit-view.component.d.ts +17 -0
- package/lib/components/form/select/index.d.ts +2 -0
- package/lib/components/form/select/select-config.component.d.ts +2 -0
- package/lib/components/form/select/select-search.component.d.ts +30 -0
- package/lib/components/form/select/select-view.component.d.ts +17 -0
- package/lib/components/form/switch/index.d.ts +2 -0
- package/lib/components/form/switch/switch-control.component.d.ts +1 -1
- package/lib/components/form/switch/switch-search.component.d.ts +28 -0
- package/lib/components/form/switch/switch-view.component.d.ts +17 -0
- package/lib/components/form/text-edit/index.d.ts +2 -0
- package/lib/components/form/text-edit/text-edit-search.component.d.ts +30 -0
- package/lib/components/form/text-edit/text-edit-view.component.d.ts +17 -0
- package/lib/dynamic-form.module.d.ts +19 -5
- package/lib/interfaces/form-config-interfaces.d.ts +8 -4
- package/lib/services/form-control.service.d.ts +9 -0
- package/package.json +11 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef,
|
|
2
|
+
import { inject, ChangeDetectorRef, ViewChild, Input, Component, ChangeDetectionStrategy, Injectable, ViewContainerRef, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import { Validators,
|
|
4
|
+
import { Validators, FormGroup, FormControl, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i2 from '@abp/ng.core';
|
|
6
6
|
import { CoreModule } from '@abp/ng.core';
|
|
7
7
|
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
@@ -10,6 +10,8 @@ import * as i3 from '@ngx-validate/core';
|
|
|
10
10
|
import * as i2$1 from '@angular/common';
|
|
11
11
|
import { DatePipe } from '@angular/common';
|
|
12
12
|
import { pinyin } from 'pinyin-pro';
|
|
13
|
+
import * as i4 from 'ng-zorro-antd/select';
|
|
14
|
+
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
13
15
|
|
|
14
16
|
class TextEditConfig {
|
|
15
17
|
constructor(data) {
|
|
@@ -77,11 +79,11 @@ class TextEditConfigComponent {
|
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
80
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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-3\">\n <label class=\"form-label\">{{'
|
|
82
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"TextEdit.Placeholder\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::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 {{'AbpDynamicForm::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 {{'AbpDynamicForm::MultipleLine' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::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" }] }); }
|
|
81
83
|
}
|
|
82
84
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditConfigComponent, decorators: [{
|
|
83
85
|
type: Component,
|
|
84
|
-
args: [{ selector: 'df-text-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'
|
|
86
|
+
args: [{ selector: 'df-text-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"TextEdit.Placeholder\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::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 {{'AbpDynamicForm::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 {{'AbpDynamicForm::MultipleLine' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::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>" }]
|
|
85
87
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
86
88
|
type: Input
|
|
87
89
|
}], Entity: [{
|
|
@@ -146,14 +148,14 @@ class TextEditComponent {
|
|
|
146
148
|
ValidatorsArray.push(Validators.maxLength(this._fields.field.formConfiguration['TextEdit.CharLimit']));
|
|
147
149
|
}
|
|
148
150
|
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
149
|
-
this.extraProperties
|
|
151
|
+
this.extraProperties?.setControl(this._fields.field.name, newControl);
|
|
150
152
|
resolve(true);
|
|
151
153
|
});
|
|
152
154
|
}
|
|
153
155
|
ngOnDestroy() {
|
|
154
156
|
//Called once, before the instance is destroyed.
|
|
155
157
|
//Add 'implements OnDestroy' to the class.
|
|
156
|
-
this.extraProperties
|
|
158
|
+
this.extraProperties?.removeControl(this._fields.field.name);
|
|
157
159
|
}
|
|
158
160
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
159
161
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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-3\">\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 <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\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"] }] }); }
|
|
@@ -174,6 +176,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
174
176
|
args: ['submitclick', { static: true }]
|
|
175
177
|
}] } });
|
|
176
178
|
|
|
179
|
+
class TextEditViewComponent {
|
|
180
|
+
constructor() {
|
|
181
|
+
/**展示则内容 */
|
|
182
|
+
this.showValue = '';
|
|
183
|
+
/**是否显示再列表 */
|
|
184
|
+
this.showInList = false;
|
|
185
|
+
/**表单控件Value */
|
|
186
|
+
this._value = '';
|
|
187
|
+
}
|
|
188
|
+
set value(v) {
|
|
189
|
+
this._value = v;
|
|
190
|
+
}
|
|
191
|
+
async ngAfterContentInit() {
|
|
192
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
193
|
+
//Add 'implements AfterContentInit' to the class.
|
|
194
|
+
let valueOptions = this._value;
|
|
195
|
+
if (this.type && valueOptions) {
|
|
196
|
+
this.showValue = valueOptions;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
200
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: TextEditViewComponent, selector: "df-text-edit-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, ngImport: i0, template: "@if(showInList){\r\n{{showValue}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
201
|
+
}
|
|
202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditViewComponent, decorators: [{
|
|
203
|
+
type: Component,
|
|
204
|
+
args: [{ selector: 'df-text-edit-view', template: "@if(showInList){\r\n{{showValue}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n</div>\r\n}" }]
|
|
205
|
+
}], propDecorators: { showInList: [{
|
|
206
|
+
type: Input
|
|
207
|
+
}], fields: [{
|
|
208
|
+
type: Input
|
|
209
|
+
}], type: [{
|
|
210
|
+
type: Input
|
|
211
|
+
}], value: [{
|
|
212
|
+
type: Input
|
|
213
|
+
}] } });
|
|
214
|
+
|
|
215
|
+
class TextEditSearchComponent {
|
|
216
|
+
constructor(fb) {
|
|
217
|
+
this.fb = fb;
|
|
218
|
+
this._TextEditMode = TextEditMode;
|
|
219
|
+
/**字段配置列表 */
|
|
220
|
+
this._fields = '';
|
|
221
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
222
|
+
this.isObjEmpty = (obj) => Object.keys(obj).length === 0;
|
|
223
|
+
}
|
|
224
|
+
set entity(v) {
|
|
225
|
+
this._entity = v;
|
|
226
|
+
if (v)
|
|
227
|
+
this.dataLoaded();
|
|
228
|
+
}
|
|
229
|
+
set fields(v) {
|
|
230
|
+
this._fields = v;
|
|
231
|
+
if (v)
|
|
232
|
+
this.dataLoaded();
|
|
233
|
+
}
|
|
234
|
+
set parentFiledName(v) {
|
|
235
|
+
this._parentFiledName = v;
|
|
236
|
+
if (v)
|
|
237
|
+
this.dataLoaded();
|
|
238
|
+
}
|
|
239
|
+
set selected(v) {
|
|
240
|
+
this._selected = v || '';
|
|
241
|
+
if (v)
|
|
242
|
+
this.dataLoaded();
|
|
243
|
+
}
|
|
244
|
+
async dataLoaded() {
|
|
245
|
+
if (this._fields && this._entity && this._parentFiledName) {
|
|
246
|
+
this.extraProperties = this._entity.get(this._parentFiledName);
|
|
247
|
+
await this.AfterInit();
|
|
248
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
249
|
+
this.submitclick?.nativeElement?.click();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
AfterInit() {
|
|
253
|
+
return new Promise((resolve, rejects) => {
|
|
254
|
+
let ValidatorsArray = [];
|
|
255
|
+
this._fields.field.formConfiguration = {
|
|
256
|
+
...this.fb.group(new TextEditConfig()).value,
|
|
257
|
+
...this._fields.field.formConfiguration
|
|
258
|
+
};
|
|
259
|
+
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
260
|
+
this.extraProperties?.setControl(this._fields.field.name, newControl);
|
|
261
|
+
resolve(true);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
ngOnDestroy() {
|
|
265
|
+
//Called once, before the instance is destroyed.
|
|
266
|
+
//Add 'implements OnDestroy' to the class.
|
|
267
|
+
this.extraProperties?.removeControl(this._fields.field.name);
|
|
268
|
+
}
|
|
269
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditSearchComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
270
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: TextEditSearchComponent, selector: "df-text-edit-search", 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\">\r\n <div [formGroupName]=\"_parentFiledName\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\r\n [placeholder]=\"_fields.field.formConfiguration['TextEdit.Placeholder']\" />\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\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"] }] }); }
|
|
271
|
+
}
|
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditSearchComponent, decorators: [{
|
|
273
|
+
type: Component,
|
|
274
|
+
args: [{ selector: 'df-text-edit-search', template: "<form [formGroup]=\"_entity\">\r\n <div [formGroupName]=\"_parentFiledName\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\r\n [placeholder]=\"_fields.field.formConfiguration['TextEdit.Placeholder']\" />\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>" }]
|
|
275
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
|
|
276
|
+
type: Input
|
|
277
|
+
}], fields: [{
|
|
278
|
+
type: Input
|
|
279
|
+
}], parentFiledName: [{
|
|
280
|
+
type: Input
|
|
281
|
+
}], selected: [{
|
|
282
|
+
type: Input
|
|
283
|
+
}], submitclick: [{
|
|
284
|
+
type: ViewChild,
|
|
285
|
+
args: ['submitclick', { static: true }]
|
|
286
|
+
}] } });
|
|
287
|
+
|
|
177
288
|
class SwitchConfig {
|
|
178
289
|
constructor(data) {
|
|
179
290
|
/**默认值 */
|
|
@@ -227,11 +338,11 @@ class SwitchConfigComponent {
|
|
|
227
338
|
});
|
|
228
339
|
}
|
|
229
340
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
230
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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-3\">\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 {{'
|
|
341
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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-3\">\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 {{'AbpDynamicForm::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" }] }); }
|
|
231
342
|
}
|
|
232
343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchConfigComponent, decorators: [{
|
|
233
344
|
type: Component,
|
|
234
|
-
args: [{ selector: 'df-switch-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\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 {{'
|
|
345
|
+
args: [{ selector: 'df-switch-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\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 {{'AbpDynamicForm::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>" }]
|
|
235
346
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
236
347
|
type: Input
|
|
237
348
|
}], Entity: [{
|
|
@@ -299,11 +410,11 @@ class SwitchControlComponent {
|
|
|
299
410
|
this.extraProperties.removeControl(this._fields.field.name);
|
|
300
411
|
}
|
|
301
412
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchControlComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
302
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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-3\">\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 <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n
|
|
413
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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-3\">\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 <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\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.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"] }] }); }
|
|
303
414
|
}
|
|
304
415
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchControlComponent, decorators: [{
|
|
305
416
|
type: Component,
|
|
306
|
-
args: [{ selector: 'df-switch-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" formControlName=\"{{_fields.field.name}}\">\n </div>\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n
|
|
417
|
+
args: [{ selector: 'df-switch-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" formControlName=\"{{_fields.field.name}}\">\n </div>\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
|
|
307
418
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
|
|
308
419
|
type: Input
|
|
309
420
|
}], fields: [{
|
|
@@ -317,14 +428,122 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
317
428
|
args: ['submitclick', { static: true }]
|
|
318
429
|
}] } });
|
|
319
430
|
|
|
431
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
432
|
+
class SwitchSearchComponent {
|
|
433
|
+
constructor(fb) {
|
|
434
|
+
this.fb = fb;
|
|
435
|
+
/**字段配置列表 */
|
|
436
|
+
this._fields = '';
|
|
437
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
438
|
+
}
|
|
439
|
+
set entity(v) {
|
|
440
|
+
this._entity = v;
|
|
441
|
+
this.dataLoaded();
|
|
442
|
+
}
|
|
443
|
+
set fields(v) {
|
|
444
|
+
this._fields = v;
|
|
445
|
+
this.dataLoaded();
|
|
446
|
+
}
|
|
447
|
+
set parentFiledName(v) {
|
|
448
|
+
this._parentFiledName = v;
|
|
449
|
+
this.dataLoaded();
|
|
450
|
+
}
|
|
451
|
+
set selected(v) {
|
|
452
|
+
// ?v:false;
|
|
453
|
+
this._selected = v;
|
|
454
|
+
this.dataLoaded();
|
|
455
|
+
}
|
|
456
|
+
get extraProperties() {
|
|
457
|
+
return this._entity.get('extraProperties');
|
|
458
|
+
}
|
|
459
|
+
/**数据加载完成 */
|
|
460
|
+
async dataLoaded() {
|
|
461
|
+
if (this._fields && this._entity) {
|
|
462
|
+
await this.AfterInit();
|
|
463
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
464
|
+
this.submitclick?.nativeElement?.click();
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
AfterInit() {
|
|
468
|
+
return new Promise((resolve, rejects) => {
|
|
469
|
+
const ValidatorsArray = [];
|
|
470
|
+
const newControl = this.fb.control(this._selected
|
|
471
|
+
? this._selected
|
|
472
|
+
: this._selected === false
|
|
473
|
+
? this._selected
|
|
474
|
+
: '', ValidatorsArray);
|
|
475
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
476
|
+
resolve(true);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
ngOnDestroy() {
|
|
480
|
+
//Called once, before the instance is destroyed.
|
|
481
|
+
//Add 'implements OnDestroy' to the class.
|
|
482
|
+
this.extraProperties.removeControl(this._fields.field.name);
|
|
483
|
+
}
|
|
484
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchSearchComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
485
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SwitchSearchComponent, selector: "df-switch-search", 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\">\r\n <div formGroupName=\"extraProperties\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <!-- <div class=\"form-check form-switch\">\r\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" formControlName=\"{{_fields.field.name}}\">\r\n </div> -->\r\n <!-- <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small> -->\r\n <select class=\"form-select form-control\" formControlName=\"{{_fields.field.name}}\" role=\"switch\">\r\n <option [value]=\"\"></option>\r\n <option [value]=\"true\">{{'AbpUi::Yes'|abpLocalization}}</option>\r\n <option [value]=\"false\">{{'AbpUi::No'|abpLocalization}}</option>\r\n </select>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\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.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
486
|
+
}
|
|
487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchSearchComponent, decorators: [{
|
|
488
|
+
type: Component,
|
|
489
|
+
args: [{ selector: 'df-switch-search', template: "<form [formGroup]=\"_entity\">\r\n <div formGroupName=\"extraProperties\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <!-- <div class=\"form-check form-switch\">\r\n <input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" formControlName=\"{{_fields.field.name}}\">\r\n </div> -->\r\n <!-- <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small> -->\r\n <select class=\"form-select form-control\" formControlName=\"{{_fields.field.name}}\" role=\"switch\">\r\n <option [value]=\"\"></option>\r\n <option [value]=\"true\">{{'AbpUi::Yes'|abpLocalization}}</option>\r\n <option [value]=\"false\">{{'AbpUi::No'|abpLocalization}}</option>\r\n </select>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>" }]
|
|
490
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
|
|
491
|
+
type: Input
|
|
492
|
+
}], fields: [{
|
|
493
|
+
type: Input
|
|
494
|
+
}], parentFiledName: [{
|
|
495
|
+
type: Input
|
|
496
|
+
}], selected: [{
|
|
497
|
+
type: Input
|
|
498
|
+
}], submitclick: [{
|
|
499
|
+
type: ViewChild,
|
|
500
|
+
args: ['submitclick', { static: true }]
|
|
501
|
+
}] } });
|
|
502
|
+
|
|
503
|
+
class SwitchViewComponent {
|
|
504
|
+
constructor() {
|
|
505
|
+
/**展示则内容 */
|
|
506
|
+
this.showValue = '';
|
|
507
|
+
/**是否显示再列表 */
|
|
508
|
+
this.showInList = false;
|
|
509
|
+
/**表单控件Value */
|
|
510
|
+
this._value = '';
|
|
511
|
+
}
|
|
512
|
+
set value(v) {
|
|
513
|
+
this._value = v;
|
|
514
|
+
}
|
|
515
|
+
async ngAfterContentInit() {
|
|
516
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
517
|
+
//Add 'implements AfterContentInit' to the class.
|
|
518
|
+
let valueOptions = this._value;
|
|
519
|
+
if (this.type) {
|
|
520
|
+
this.showValue = valueOptions;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
524
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: SwitchViewComponent, selector: "df-switch-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, ngImport: i0, template: "@if(showInList){\r\n {{'AbpUi::'+(showValue ? 'Yes' : 'No') | abpLocalization}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{'AbpUi::'+(showValue ? 'Yes' : 'No') | abpLocalization}}\r\n </div>\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
525
|
+
}
|
|
526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchViewComponent, decorators: [{
|
|
527
|
+
type: Component,
|
|
528
|
+
args: [{ selector: 'df-switch-view', template: "@if(showInList){\r\n {{'AbpUi::'+(showValue ? 'Yes' : 'No') | abpLocalization}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{'AbpUi::'+(showValue ? 'Yes' : 'No') | abpLocalization}}\r\n </div>\r\n</div>\r\n}" }]
|
|
529
|
+
}], propDecorators: { showInList: [{
|
|
530
|
+
type: Input
|
|
531
|
+
}], fields: [{
|
|
532
|
+
type: Input
|
|
533
|
+
}], type: [{
|
|
534
|
+
type: Input
|
|
535
|
+
}], value: [{
|
|
536
|
+
type: Input
|
|
537
|
+
}] } });
|
|
538
|
+
|
|
320
539
|
class NumbericEditConfig {
|
|
321
540
|
constructor(data) {
|
|
322
541
|
/**占位符 */
|
|
323
542
|
this['NumericEditField.Placeholder'] = ['', []];
|
|
324
543
|
/**最小值 */
|
|
325
|
-
this['NumericEditField.Min'] = ['', []];
|
|
544
|
+
this['NumericEditField.Min'] = ['', [Validators.required]];
|
|
326
545
|
//最大值
|
|
327
|
-
this['NumericEditField.Max'] = ['', []];
|
|
546
|
+
this['NumericEditField.Max'] = ['', [Validators.required]];
|
|
328
547
|
// 小数位数
|
|
329
548
|
this['NumericEditField.Decimals'] = [2, []];
|
|
330
549
|
//步长
|
|
@@ -379,11 +598,11 @@ class NumbericEditConfigComponent {
|
|
|
379
598
|
});
|
|
380
599
|
}
|
|
381
600
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
382
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: NumbericEditConfigComponent, selector: "df-numberic-edit-config", inputs: { type: "type", selected: "selected", Entity: "Entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'
|
|
601
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: NumbericEditConfigComponent, selector: "df-numberic-edit-config", inputs: { type: "type", selected: "selected", Entity: "Entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Placeholder\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Min' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Min\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Max' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Max\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::NumericDecimals' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Decimals\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::NumericStep' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Step\">\n <small class=\"form-text text-muted d-block\">{{'AbpDynamicForm::NumericStepHelp'|abpLocalization}}</small>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::FormatSpecifier' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FormatSpecifier\">\n <small class=\"form-text text-muted d-block\">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></small>\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.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" }] }); }
|
|
383
602
|
}
|
|
384
603
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditConfigComponent, decorators: [{
|
|
385
604
|
type: Component,
|
|
386
|
-
args: [{ selector: 'df-numberic-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'
|
|
605
|
+
args: [{ selector: 'df-numberic-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Placeholder\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Min' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Min\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Max' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Max\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::NumericDecimals' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Decimals\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::NumericStep' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Step\">\n <small class=\"form-text text-muted d-block\">{{'AbpDynamicForm::NumericStepHelp'|abpLocalization}}</small>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::FormatSpecifier' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FormatSpecifier\">\n <small class=\"form-text text-muted d-block\">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></small>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
|
|
387
606
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
388
607
|
type: Input
|
|
389
608
|
}], selected: [{
|
|
@@ -395,6 +614,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
395
614
|
args: ['submitclick', { static: false }]
|
|
396
615
|
}] } });
|
|
397
616
|
|
|
617
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
618
|
+
/* eslint-disable @typescript-eslint/adjacent-overload-signatures */
|
|
398
619
|
function maxDecimalPlacesValidator(maxDecimalPlaces) {
|
|
399
620
|
return (control) => {
|
|
400
621
|
const value = control.value;
|
|
@@ -432,7 +653,7 @@ class NumbericEditControlComponent {
|
|
|
432
653
|
this.dataLoaded();
|
|
433
654
|
}
|
|
434
655
|
get extraProperties() {
|
|
435
|
-
return this._entity
|
|
656
|
+
return this._entity?.get('extraProperties');
|
|
436
657
|
}
|
|
437
658
|
get fieldInput() { return this.extraProperties.get(this._fields.field.name); }
|
|
438
659
|
/**数据加载完成 */
|
|
@@ -445,8 +666,8 @@ class NumbericEditControlComponent {
|
|
|
445
666
|
}
|
|
446
667
|
AfterInit() {
|
|
447
668
|
return new Promise((resolve, rejects) => {
|
|
448
|
-
|
|
449
|
-
|
|
669
|
+
const ValidatorsArray = [];
|
|
670
|
+
const formConfiguration = this._fields.field.formConfiguration;
|
|
450
671
|
if (this._fields.required) {
|
|
451
672
|
ValidatorsArray.push(Validators.required);
|
|
452
673
|
}
|
|
@@ -456,7 +677,7 @@ class NumbericEditControlComponent {
|
|
|
456
677
|
if (formConfiguration['NumericEditField.Max']) {
|
|
457
678
|
ValidatorsArray.push(Validators.max(formConfiguration['NumericEditField.Max']));
|
|
458
679
|
}
|
|
459
|
-
|
|
680
|
+
const newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
460
681
|
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
461
682
|
resolve(true);
|
|
462
683
|
});
|
|
@@ -468,12 +689,12 @@ class NumbericEditControlComponent {
|
|
|
468
689
|
}
|
|
469
690
|
/**数字框输入 */
|
|
470
691
|
inputchange(event) {
|
|
471
|
-
|
|
692
|
+
const val = event.target.value;
|
|
472
693
|
const decimalPart = val.toString().split('.')[1] || '';
|
|
473
|
-
|
|
474
|
-
|
|
694
|
+
const formConfiguration = this._fields.field.formConfiguration;
|
|
695
|
+
const Decimals = formConfiguration['NumericEditField.Decimals'];
|
|
475
696
|
if (decimalPart.length > Decimals) {
|
|
476
|
-
this.fieldInput
|
|
697
|
+
this.fieldInput?.patchValue(val.slice(0, val.length - (decimalPart.length - 2)));
|
|
477
698
|
}
|
|
478
699
|
}
|
|
479
700
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditControlComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -588,11 +809,11 @@ class DateEditConfigComponent {
|
|
|
588
809
|
});
|
|
589
810
|
}
|
|
590
811
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
591
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DateEditConfigComponent, selector: "df-date-edit-config", inputs: { type: "type", selected: "selected", Entity: "Entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'
|
|
812
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DateEditConfigComponent, selector: "df-date-edit-config", inputs: { type: "type", selected: "selected", Entity: "Entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::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\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'AbpDynamicForm::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\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'AbpDynamicForm::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\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault3\">\n {{'AbpDynamicForm::Month' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Min' | abpLocalization}}</label>\n <input [type]=\"dateTimeType\" class=\"form-control\" step=\"1\" formControlName=\"DateEdit.Min\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Max' | abpLocalization}}</label>\n <input [type]=\"dateTimeType\" 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" }] }); }
|
|
592
813
|
}
|
|
593
814
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditConfigComponent, decorators: [{
|
|
594
815
|
type: Component,
|
|
595
|
-
args: [{ selector: 'df-date-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'
|
|
816
|
+
args: [{ selector: 'df-date-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::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\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'AbpDynamicForm::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\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'AbpDynamicForm::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\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault3\">\n {{'AbpDynamicForm::Month' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Min' | abpLocalization}}</label>\n <input [type]=\"dateTimeType\" class=\"form-control\" step=\"1\" formControlName=\"DateEdit.Min\">\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::Max' | abpLocalization}}</label>\n <input [type]=\"dateTimeType\" 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>" }]
|
|
596
817
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
597
818
|
type: Input
|
|
598
819
|
}], selected: [{
|
|
@@ -695,6 +916,179 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
695
916
|
args: ['submitclick', { static: true }]
|
|
696
917
|
}] } });
|
|
697
918
|
|
|
919
|
+
class DateEditViewComponent {
|
|
920
|
+
constructor() {
|
|
921
|
+
/**展示则内容 */
|
|
922
|
+
this.showValue = '';
|
|
923
|
+
/**是否显示再列表 */
|
|
924
|
+
this.showInList = false;
|
|
925
|
+
/**表单控件Value */
|
|
926
|
+
this._value = '';
|
|
927
|
+
}
|
|
928
|
+
set value(v) {
|
|
929
|
+
this._value = v;
|
|
930
|
+
}
|
|
931
|
+
async ngAfterContentInit() {
|
|
932
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
933
|
+
//Add 'implements AfterContentInit' to the class.
|
|
934
|
+
let valueOptions = this._value;
|
|
935
|
+
if (this.type && valueOptions) {
|
|
936
|
+
this.showValue = valueOptions;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
940
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: DateEditViewComponent, selector: "df-date-edit-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, ngImport: i0, template: "@if(showInList){\r\n{{showValue|shortDateTime}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue|shortDateTime}}\r\n </div>\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.ShortDateTimePipe, name: "shortDateTime" }] }); }
|
|
941
|
+
}
|
|
942
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditViewComponent, decorators: [{
|
|
943
|
+
type: Component,
|
|
944
|
+
args: [{ selector: 'df-date-edit-view', template: "@if(showInList){\r\n{{showValue|shortDateTime}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue|shortDateTime}}\r\n </div>\r\n</div>\r\n}" }]
|
|
945
|
+
}], propDecorators: { showInList: [{
|
|
946
|
+
type: Input
|
|
947
|
+
}], fields: [{
|
|
948
|
+
type: Input
|
|
949
|
+
}], type: [{
|
|
950
|
+
type: Input
|
|
951
|
+
}], value: [{
|
|
952
|
+
type: Input
|
|
953
|
+
}] } });
|
|
954
|
+
|
|
955
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
956
|
+
class NumericEditSearchComponent {
|
|
957
|
+
constructor(fb) {
|
|
958
|
+
this.fb = fb;
|
|
959
|
+
/**字段配置列表 */
|
|
960
|
+
this._fields = '';
|
|
961
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
962
|
+
/**定义number表单用于获取最小值最大值 */
|
|
963
|
+
this.numberForm = new FormGroup({
|
|
964
|
+
min: new FormControl(''),
|
|
965
|
+
max: new FormControl(''),
|
|
966
|
+
});
|
|
967
|
+
this.formConfiguration = '';
|
|
968
|
+
}
|
|
969
|
+
set fields(v) {
|
|
970
|
+
this._fields = v;
|
|
971
|
+
}
|
|
972
|
+
set parentFiledName(v) {
|
|
973
|
+
this._parentFiledName = v;
|
|
974
|
+
}
|
|
975
|
+
set selected(v) {
|
|
976
|
+
this._selected = v;
|
|
977
|
+
}
|
|
978
|
+
set entity(v) {
|
|
979
|
+
this._entity = v;
|
|
980
|
+
this.dataLoaded();
|
|
981
|
+
}
|
|
982
|
+
get extraProperties() {
|
|
983
|
+
return this._entity?.get('extraProperties');
|
|
984
|
+
}
|
|
985
|
+
/**数据加载完成 */
|
|
986
|
+
async dataLoaded() {
|
|
987
|
+
if (this._fields && this._entity) {
|
|
988
|
+
await this.AfterInit();
|
|
989
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
990
|
+
this.submitclick?.nativeElement?.click();
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
/**定义动态字符 */
|
|
994
|
+
get numberInput() {
|
|
995
|
+
return this.extraProperties.get(this._fields.field.name);
|
|
996
|
+
}
|
|
997
|
+
get minInput() {
|
|
998
|
+
return this.numberForm.get('min');
|
|
999
|
+
}
|
|
1000
|
+
get maxInput() {
|
|
1001
|
+
return this.numberForm.get('max');
|
|
1002
|
+
}
|
|
1003
|
+
AfterInit() {
|
|
1004
|
+
return new Promise(resolve => {
|
|
1005
|
+
const ValidatorsArray = [];
|
|
1006
|
+
this.formConfiguration = this._fields.field.formConfiguration;
|
|
1007
|
+
const newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
1008
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
1009
|
+
this.numberForm.valueChanges.subscribe(res => {
|
|
1010
|
+
if (res.min < Number(this.formConfiguration['NumericEditField.Min'])) {
|
|
1011
|
+
this.minInput.patchValue(this.formConfiguration['NumericEditField.Min']);
|
|
1012
|
+
}
|
|
1013
|
+
if (res.min > Number(this.formConfiguration['NumericEditField.Max'])) {
|
|
1014
|
+
this.minInput.patchValue(this.formConfiguration['NumericEditField.Max']);
|
|
1015
|
+
}
|
|
1016
|
+
if ((res.min > res.max) && res.max) {
|
|
1017
|
+
this.minInput.patchValue(res.max);
|
|
1018
|
+
}
|
|
1019
|
+
if (res.max > Number(this.formConfiguration['NumericEditField.Max'])) {
|
|
1020
|
+
this.maxInput.patchValue(this.formConfiguration['NumericEditField.Max']);
|
|
1021
|
+
}
|
|
1022
|
+
if (this.numberForm.valid && res.min && res.max) {
|
|
1023
|
+
this.numberInput.patchValue(`${res.min}-${res.max}`);
|
|
1024
|
+
}
|
|
1025
|
+
else {
|
|
1026
|
+
this.numberInput.patchValue('');
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
resolve(true);
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
ngOnDestroy() {
|
|
1033
|
+
//Called once, before the instance is destroyed.
|
|
1034
|
+
//Add 'implements OnDestroy' to the class.
|
|
1035
|
+
this.extraProperties.removeControl(this._fields.field.name);
|
|
1036
|
+
}
|
|
1037
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditSearchComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1038
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: NumericEditSearchComponent, selector: "df-numeric-edit-search", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"numberForm\">\r\n <div class=\"selectcontrol\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <div class=\"input-group\" >\r\n <input class=\"form-control\" type=\"number\" formControlName=\"min\">\r\n <span class=\"input-group-text px-1\">-</span>\r\n <input class=\"form-control\" type=\"number\" formControlName=\"max\">\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\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: 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: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }] }); }
|
|
1039
|
+
}
|
|
1040
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditSearchComponent, decorators: [{
|
|
1041
|
+
type: Component,
|
|
1042
|
+
args: [{ selector: 'df-numeric-edit-search', template: "<form [formGroup]=\"numberForm\">\r\n <div class=\"selectcontrol\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <div class=\"input-group\" >\r\n <input class=\"form-control\" type=\"number\" formControlName=\"min\">\r\n <span class=\"input-group-text px-1\">-</span>\r\n <input class=\"form-control\" type=\"number\" formControlName=\"max\">\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>" }]
|
|
1043
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { fields: [{
|
|
1044
|
+
type: Input
|
|
1045
|
+
}], parentFiledName: [{
|
|
1046
|
+
type: Input
|
|
1047
|
+
}], selected: [{
|
|
1048
|
+
type: Input
|
|
1049
|
+
}], entity: [{
|
|
1050
|
+
type: Input
|
|
1051
|
+
}], submitclick: [{
|
|
1052
|
+
type: ViewChild,
|
|
1053
|
+
args: ['submitclick', { static: true }]
|
|
1054
|
+
}] } });
|
|
1055
|
+
|
|
1056
|
+
class NumericEditViewComponent {
|
|
1057
|
+
constructor() {
|
|
1058
|
+
/**展示则内容 */
|
|
1059
|
+
this.showValue = '';
|
|
1060
|
+
/**是否显示再列表 */
|
|
1061
|
+
this.showInList = false;
|
|
1062
|
+
/**表单控件Value */
|
|
1063
|
+
this._value = '';
|
|
1064
|
+
}
|
|
1065
|
+
set value(v) {
|
|
1066
|
+
this._value = v;
|
|
1067
|
+
}
|
|
1068
|
+
async ngAfterContentInit() {
|
|
1069
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1070
|
+
//Add 'implements AfterContentInit' to the class.
|
|
1071
|
+
let valueOptions = this._value;
|
|
1072
|
+
if (this.type && valueOptions) {
|
|
1073
|
+
this.showValue = valueOptions;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1077
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: NumericEditViewComponent, selector: "df-numeric-edit-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, ngImport: i0, template: "@if(showInList){\r\n{{showValue}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1078
|
+
}
|
|
1079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditViewComponent, decorators: [{
|
|
1080
|
+
type: Component,
|
|
1081
|
+
args: [{ selector: 'df-numeric-edit-view', template: "@if(showInList){\r\n{{showValue}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n</div>\r\n}" }]
|
|
1082
|
+
}], propDecorators: { showInList: [{
|
|
1083
|
+
type: Input
|
|
1084
|
+
}], fields: [{
|
|
1085
|
+
type: Input
|
|
1086
|
+
}], type: [{
|
|
1087
|
+
type: Input
|
|
1088
|
+
}], value: [{
|
|
1089
|
+
type: Input
|
|
1090
|
+
}] } });
|
|
1091
|
+
|
|
698
1092
|
class SelectConfig {
|
|
699
1093
|
constructor(data) {
|
|
700
1094
|
/**空值文本 */
|
|
@@ -809,7 +1203,7 @@ class SelectConfigComponent {
|
|
|
809
1203
|
this.dataLoaded();
|
|
810
1204
|
}
|
|
811
1205
|
get formConfiguration() {
|
|
812
|
-
return this._Entity
|
|
1206
|
+
return this._Entity?.get('formConfiguration');
|
|
813
1207
|
}
|
|
814
1208
|
get SelectOptions() {
|
|
815
1209
|
return this.formConfiguration.controls['Select.Options'];
|
|
@@ -835,11 +1229,16 @@ class SelectConfigComponent {
|
|
|
835
1229
|
}
|
|
836
1230
|
AfterInit() {
|
|
837
1231
|
return new Promise((resolve, rejects) => {
|
|
838
|
-
this._Entity
|
|
1232
|
+
this._Entity?.setControl('formConfiguration', this.fb.group(new SelectConfig()));
|
|
839
1233
|
if (this._selected && this._selected.formControlName == this._type) {
|
|
840
|
-
this._selected.formConfiguration['Select.Options']
|
|
1234
|
+
for (const element of this._selected.formConfiguration['Select.Options']) {
|
|
1235
|
+
for (const key in element) {
|
|
1236
|
+
const item = element[key];
|
|
1237
|
+
const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1);
|
|
1238
|
+
element[capitalizedKey] = item;
|
|
1239
|
+
}
|
|
841
1240
|
this.addSelectOptions();
|
|
842
|
-
}
|
|
1241
|
+
}
|
|
843
1242
|
this.formConfiguration.patchValue({
|
|
844
1243
|
...this._selected.formConfiguration,
|
|
845
1244
|
});
|
|
@@ -853,18 +1252,25 @@ class SelectConfigComponent {
|
|
|
853
1252
|
textChange(event, index) {
|
|
854
1253
|
let SelectOptionsItem = this.SelectOptions.at(index);
|
|
855
1254
|
let value = event.target.value;
|
|
856
|
-
if (SelectOptionsItem.get('Value')
|
|
1255
|
+
if (SelectOptionsItem.get('Value')?.value)
|
|
857
1256
|
return;
|
|
858
1257
|
SelectOptionsItem.patchValue({
|
|
859
1258
|
Value: this._DfApiService.chineseToPinyin(value),
|
|
860
1259
|
});
|
|
861
1260
|
}
|
|
1261
|
+
/**调整表格位置 */
|
|
1262
|
+
TableArrowUpOrDown(type, index) {
|
|
1263
|
+
let controlAt = this.SelectOptions.at(index);
|
|
1264
|
+
this.SelectOptions.removeAt(index);
|
|
1265
|
+
let lastindex = type == 'up' ? index - 1 : index + 1;
|
|
1266
|
+
this.SelectOptions.insert(lastindex, controlAt);
|
|
1267
|
+
}
|
|
862
1268
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectConfigComponent, deps: [{ token: i1.FormBuilder }, { token: DfApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
863
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SelectConfigComponent, selector: "df-select-config", inputs: { type: "type", selected: "selected", Entity: "Entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'
|
|
1269
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SelectConfigComponent, selector: "df-select-config", inputs: { type: "type", selected: "selected", Entity: "Entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'AbpDynamicForm::SelectListItemText' | abpLocalization}}</th>\n <th scope=\"col\">{{'AbpDynamicForm::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\">{{'AbpDynamicForm::Selected' | 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\"\n (change)=\"textChange($event,i)\"></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\"\n id=\"selected\">\n </div>\n </td>\n <td scope=\"row\" style=\"width: 1%;\">\n <div class=\"d-flex align-items-center justify-content-start\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"deleteSelectOptions(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n *ngIf=\"i!==SelectOptions.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n\n\n </tbody>\n </table>\n </div>\n\n\n\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::NullText' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Select.NullText\">\n </div>\n <div class=\"mb-3\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Select.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'AbpDynamicForm::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: 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: 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" }] }); }
|
|
864
1270
|
}
|
|
865
1271
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectConfigComponent, decorators: [{
|
|
866
1272
|
type: Component,
|
|
867
|
-
args: [{ selector: 'df-select-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'
|
|
1273
|
+
args: [{ selector: 'df-select-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'AbpDynamicForm::SelectListItemText' | abpLocalization}}</th>\n <th scope=\"col\">{{'AbpDynamicForm::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\">{{'AbpDynamicForm::Selected' | 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\"\n (change)=\"textChange($event,i)\"></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\"\n id=\"selected\">\n </div>\n </td>\n <td scope=\"row\" style=\"width: 1%;\">\n <div class=\"d-flex align-items-center justify-content-start\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"deleteSelectOptions(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n *ngIf=\"i!==SelectOptions.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n\n\n </tbody>\n </table>\n </div>\n\n\n\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'AbpDynamicForm::NullText' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Select.NullText\">\n </div>\n <div class=\"mb-3\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Select.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'AbpDynamicForm::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>" }]
|
|
868
1274
|
}], ctorParameters: () => [{ type: i1.FormBuilder }, { type: DfApiService }], propDecorators: { type: [{
|
|
869
1275
|
type: Input
|
|
870
1276
|
}], selected: [{
|
|
@@ -881,6 +1287,8 @@ class SelectControlComponent {
|
|
|
881
1287
|
this.fb = fb;
|
|
882
1288
|
/**字段配置列表 */
|
|
883
1289
|
this._fields = '';
|
|
1290
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
1291
|
+
this._selected = [];
|
|
884
1292
|
this.cdr = inject(ChangeDetectorRef);
|
|
885
1293
|
this.formConfiguration = '';
|
|
886
1294
|
}
|
|
@@ -891,14 +1299,14 @@ class SelectControlComponent {
|
|
|
891
1299
|
this._parentFiledName = v;
|
|
892
1300
|
}
|
|
893
1301
|
set selected(v) {
|
|
894
|
-
this._selected = v;
|
|
1302
|
+
this._selected = v || [];
|
|
895
1303
|
}
|
|
896
1304
|
set entity(v) {
|
|
897
1305
|
this._entity = v;
|
|
898
1306
|
this.dataLoaded();
|
|
899
1307
|
}
|
|
900
1308
|
get extraProperties() {
|
|
901
|
-
return this._entity
|
|
1309
|
+
return this._entity?.get('extraProperties');
|
|
902
1310
|
}
|
|
903
1311
|
/**数据加载完成 */
|
|
904
1312
|
async dataLoaded() {
|
|
@@ -915,18 +1323,22 @@ class SelectControlComponent {
|
|
|
915
1323
|
ValidatorsArray.push(Validators.required);
|
|
916
1324
|
}
|
|
917
1325
|
this.formConfiguration = this._fields.field.formConfiguration;
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1326
|
+
const isMultiple = this.formConfiguration['Select.Multiple'];
|
|
1327
|
+
let selectValue = isMultiple ? [] : [];
|
|
1328
|
+
for (const element of this.formConfiguration['Select.Options']) {
|
|
1329
|
+
for (const key in element) {
|
|
1330
|
+
const item = element[key];
|
|
1331
|
+
const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1);
|
|
1332
|
+
element[capitalizedKey] = item;
|
|
1333
|
+
}
|
|
1334
|
+
if (!this._selected) {
|
|
1335
|
+
if (Array.isArray(this._selected) && element.Selected && this._selected.length === 0) {
|
|
1336
|
+
selectValue = isMultiple ? [...selectValue, element.Value] : [element.Value];
|
|
1337
|
+
this._selected = selectValue;
|
|
926
1338
|
}
|
|
927
|
-
}
|
|
928
|
-
this._selected = selectValue;
|
|
1339
|
+
}
|
|
929
1340
|
}
|
|
1341
|
+
// this._selected = selectValue;
|
|
930
1342
|
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
931
1343
|
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
932
1344
|
resolve(true);
|
|
@@ -938,11 +1350,11 @@ class SelectControlComponent {
|
|
|
938
1350
|
this.extraProperties.removeControl(this._fields.field.name);
|
|
939
1351
|
}
|
|
940
1352
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectControlComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
941
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SelectControlComponent, selector: "df-select-control", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\"
|
|
1353
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SelectControlComponent, selector: "df-select-control", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\" class=\"selectcontrol\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\n <nz-select class=\"form-select dignite-form-select\" [nzMaxTagCount]=\"1\"\n nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Select.NullText']\"\n formControlName=\"{{_fields.field.name}}\" [nzDropdownMatchSelectWidth]=\"true\" [nzDropdownClassName]=\"'dignite-form-select-dropdown'\">\n <nz-option *ngFor=\"let item of _fields?.field?.formConfiguration['Select.Options']\"\n [nzLabel]=\"item.Text\" [nzValue]=\"item.Value\"></nz-option>\n </nz-select>\n </ng-container>\n <ng-template #elseTemplate>\n <select class=\"form-select\" [multiple]=\"false\" formControlName=\"{{_fields.field.name}}\">\n <option [value]=\"''\">{{formConfiguration['Select.NullText']}}</option>\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-template>\n <small class=\"form-text text-muted d-block\"\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\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"] }, { kind: "component", type: i4.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }] }); }
|
|
942
1354
|
}
|
|
943
1355
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectControlComponent, decorators: [{
|
|
944
1356
|
type: Component,
|
|
945
|
-
args: [{ selector: 'df-select-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\"
|
|
1357
|
+
args: [{ selector: 'df-select-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\" class=\"selectcontrol\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\n <nz-select class=\"form-select dignite-form-select\" [nzMaxTagCount]=\"1\"\n nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Select.NullText']\"\n formControlName=\"{{_fields.field.name}}\" [nzDropdownMatchSelectWidth]=\"true\" [nzDropdownClassName]=\"'dignite-form-select-dropdown'\">\n <nz-option *ngFor=\"let item of _fields?.field?.formConfiguration['Select.Options']\"\n [nzLabel]=\"item.Text\" [nzValue]=\"item.Value\"></nz-option>\n </nz-select>\n </ng-container>\n <ng-template #elseTemplate>\n <select class=\"form-select\" [multiple]=\"false\" formControlName=\"{{_fields.field.name}}\">\n <option [value]=\"''\">{{formConfiguration['Select.NullText']}}</option>\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-template>\n <small class=\"form-text text-muted d-block\"\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
|
|
946
1358
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { fields: [{
|
|
947
1359
|
type: Input
|
|
948
1360
|
}], parentFiledName: [{
|
|
@@ -956,6 +1368,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
956
1368
|
args: ['submitclick', { static: true }]
|
|
957
1369
|
}] } });
|
|
958
1370
|
|
|
1371
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1372
|
+
class SelectSearchComponent {
|
|
1373
|
+
constructor(fb) {
|
|
1374
|
+
this.fb = fb;
|
|
1375
|
+
/**字段配置列表 */
|
|
1376
|
+
this._fields = '';
|
|
1377
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1378
|
+
this.formConfiguration = '';
|
|
1379
|
+
}
|
|
1380
|
+
set fields(v) {
|
|
1381
|
+
this._fields = v;
|
|
1382
|
+
}
|
|
1383
|
+
set parentFiledName(v) {
|
|
1384
|
+
this._parentFiledName = v;
|
|
1385
|
+
}
|
|
1386
|
+
set selected(v) {
|
|
1387
|
+
this._selected = v;
|
|
1388
|
+
}
|
|
1389
|
+
set entity(v) {
|
|
1390
|
+
this._entity = v;
|
|
1391
|
+
this.dataLoaded();
|
|
1392
|
+
}
|
|
1393
|
+
get extraProperties() {
|
|
1394
|
+
return this._entity?.get('extraProperties');
|
|
1395
|
+
}
|
|
1396
|
+
/**数据加载完成 */
|
|
1397
|
+
async dataLoaded() {
|
|
1398
|
+
if (this._fields && this._entity) {
|
|
1399
|
+
await this.AfterInit();
|
|
1400
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
1401
|
+
this.submitclick?.nativeElement?.click();
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
AfterInit() {
|
|
1405
|
+
return new Promise((resolve, rejects) => {
|
|
1406
|
+
const ValidatorsArray = [];
|
|
1407
|
+
this.formConfiguration = this._fields.field.formConfiguration;
|
|
1408
|
+
const isMultiple = this.formConfiguration['Select.Multiple'];
|
|
1409
|
+
const selectValue = isMultiple ? [] : [];
|
|
1410
|
+
for (const element of this.formConfiguration['Select.Options']) {
|
|
1411
|
+
for (const key in element) {
|
|
1412
|
+
const item = element[key];
|
|
1413
|
+
const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1);
|
|
1414
|
+
element[capitalizedKey] = item;
|
|
1415
|
+
}
|
|
1416
|
+
// if (this._selected) {
|
|
1417
|
+
// if (Array.isArray(this._selected) && element.Selected && this._selected.length === 0) {
|
|
1418
|
+
// selectValue = isMultiple ? [...selectValue, element.Value] : [element.Value];
|
|
1419
|
+
// }
|
|
1420
|
+
// }
|
|
1421
|
+
}
|
|
1422
|
+
this._selected = selectValue;
|
|
1423
|
+
const newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
1424
|
+
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
1425
|
+
resolve(true);
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
changeValue(event) {
|
|
1429
|
+
const selectvalue = this.extraProperties.get(this._fields.field.name).value;
|
|
1430
|
+
if (selectvalue[0] === '') {
|
|
1431
|
+
this.extraProperties.get(this._fields.field.name).setValue([]);
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
ngOnDestroy() {
|
|
1435
|
+
//Called once, before the instance is destroyed.
|
|
1436
|
+
//Add 'implements OnDestroy' to the class.
|
|
1437
|
+
this.extraProperties.removeControl(this._fields.field.name);
|
|
1438
|
+
}
|
|
1439
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectSearchComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1440
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SelectSearchComponent, selector: "df-select-search", inputs: { fields: "fields", parentFiledName: "parentFiledName", selected: "selected", entity: "entity" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\r\n <div formGroupName=\"extraProperties\" class=\"selectcontrol\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\r\n <nz-select class=\"form-select dignite-form-select\" [nzMaxTagCount]=\"1\"\r\n nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Select.NullText']\"\r\n formControlName=\"{{_fields.field.name}}\" [nzDropdownMatchSelectWidth]=\"true\" [nzDropdownClassName]=\"'dignite-form-select-dropdown'\">\r\n <nz-option *ngFor=\"let item of _fields?.field?.formConfiguration['Select.Options']\"\r\n [nzLabel]=\"item.Text\" [nzValue]=\"item.Value\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <select class=\"form-select\" [multiple]=\"false\" [placeholder]=\"formConfiguration['Select.NullText']\" formControlName=\"{{_fields.field.name}}\" (change)=\"changeValue($event)\">\r\n <option [value]=\"''\">{{formConfiguration['Select.NullText']}}</option>\r\n <ng-container *ngFor=\"let item of _fields?.field?.formConfiguration['Select.Options'];let i =index\">\r\n <option [value]=\"item.Value\">{{item.Text}}</option>\r\n </ng-container>\r\n </select>\r\n </ng-template>\r\n <!-- <small class=\"form-text text-muted d-block\"\r\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small> -->\r\n </div>\r\n\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\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"] }, { kind: "component", type: i4.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }] }); }
|
|
1441
|
+
}
|
|
1442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectSearchComponent, decorators: [{
|
|
1443
|
+
type: Component,
|
|
1444
|
+
args: [{ selector: 'df-select-search', template: "<form [formGroup]=\"_entity\">\r\n <div formGroupName=\"extraProperties\" class=\"selectcontrol\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\r\n <nz-select class=\"form-select dignite-form-select\" [nzMaxTagCount]=\"1\"\r\n nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Select.NullText']\"\r\n formControlName=\"{{_fields.field.name}}\" [nzDropdownMatchSelectWidth]=\"true\" [nzDropdownClassName]=\"'dignite-form-select-dropdown'\">\r\n <nz-option *ngFor=\"let item of _fields?.field?.formConfiguration['Select.Options']\"\r\n [nzLabel]=\"item.Text\" [nzValue]=\"item.Value\"></nz-option>\r\n </nz-select>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <select class=\"form-select\" [multiple]=\"false\" [placeholder]=\"formConfiguration['Select.NullText']\" formControlName=\"{{_fields.field.name}}\" (change)=\"changeValue($event)\">\r\n <option [value]=\"''\">{{formConfiguration['Select.NullText']}}</option>\r\n <ng-container *ngFor=\"let item of _fields?.field?.formConfiguration['Select.Options'];let i =index\">\r\n <option [value]=\"item.Value\">{{item.Text}}</option>\r\n </ng-container>\r\n </select>\r\n </ng-template>\r\n <!-- <small class=\"form-text text-muted d-block\"\r\n *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small> -->\r\n </div>\r\n\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>" }]
|
|
1445
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { fields: [{
|
|
1446
|
+
type: Input
|
|
1447
|
+
}], parentFiledName: [{
|
|
1448
|
+
type: Input
|
|
1449
|
+
}], selected: [{
|
|
1450
|
+
type: Input
|
|
1451
|
+
}], entity: [{
|
|
1452
|
+
type: Input
|
|
1453
|
+
}], submitclick: [{
|
|
1454
|
+
type: ViewChild,
|
|
1455
|
+
args: ['submitclick', { static: true }]
|
|
1456
|
+
}] } });
|
|
1457
|
+
|
|
1458
|
+
class SelectViewComponent {
|
|
1459
|
+
constructor() {
|
|
1460
|
+
/**展示则内容 */
|
|
1461
|
+
this.showValue = '';
|
|
1462
|
+
/**是否显示再列表 */
|
|
1463
|
+
this.showInList = false;
|
|
1464
|
+
/**表单控件Value */
|
|
1465
|
+
this._value = '';
|
|
1466
|
+
}
|
|
1467
|
+
set value(v) {
|
|
1468
|
+
this._value = v;
|
|
1469
|
+
}
|
|
1470
|
+
async ngAfterContentInit() {
|
|
1471
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1472
|
+
//Add 'implements AfterContentInit' to the class.
|
|
1473
|
+
let valueOptions = this._value;
|
|
1474
|
+
if (this.type && valueOptions) {
|
|
1475
|
+
if (Array.isArray(valueOptions)) {
|
|
1476
|
+
this.showValue = valueOptions.join(',');
|
|
1477
|
+
}
|
|
1478
|
+
else {
|
|
1479
|
+
this.showValue = valueOptions;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1484
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: SelectViewComponent, selector: "df-select-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, ngImport: i0, template: "@if(showInList){\r\n{{showValue}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1485
|
+
}
|
|
1486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectViewComponent, decorators: [{
|
|
1487
|
+
type: Component,
|
|
1488
|
+
args: [{ selector: 'df-select-view', template: "@if(showInList){\r\n{{showValue}}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n <div>\r\n {{showValue}}\r\n </div>\r\n</div>\r\n}" }]
|
|
1489
|
+
}], propDecorators: { showInList: [{
|
|
1490
|
+
type: Input
|
|
1491
|
+
}], fields: [{
|
|
1492
|
+
type: Input
|
|
1493
|
+
}], type: [{
|
|
1494
|
+
type: Input
|
|
1495
|
+
}], value: [{
|
|
1496
|
+
type: Input
|
|
1497
|
+
}] } });
|
|
1498
|
+
|
|
959
1499
|
// import { CkEditorConfigComponent, CkEditorControlComponent } from "./ck-editor";
|
|
960
1500
|
/**
|
|
961
1501
|
* 表单控件分组-包含配置,控件,显示的数组
|
|
@@ -966,58 +1506,56 @@ const FieldControlGroup = [
|
|
|
966
1506
|
name: 'TextEdit',
|
|
967
1507
|
fieldConfigComponent: TextEditConfigComponent,
|
|
968
1508
|
fieldComponent: TextEditComponent,
|
|
969
|
-
|
|
1509
|
+
fieldViewComponent: TextEditViewComponent,
|
|
1510
|
+
fieldSearchComponent: TextEditSearchComponent,
|
|
970
1511
|
},
|
|
971
1512
|
{
|
|
972
1513
|
displayName: '开关',
|
|
973
1514
|
name: 'Switch',
|
|
974
1515
|
fieldConfigComponent: SwitchConfigComponent,
|
|
975
1516
|
fieldComponent: SwitchControlComponent,
|
|
976
|
-
|
|
1517
|
+
fieldViewComponent: SwitchViewComponent,
|
|
1518
|
+
fieldSearchComponent: SwitchSearchComponent,
|
|
977
1519
|
},
|
|
978
1520
|
{
|
|
979
1521
|
displayName: '选择',
|
|
980
1522
|
name: 'Select',
|
|
981
1523
|
fieldConfigComponent: SelectConfigComponent,
|
|
982
1524
|
fieldComponent: SelectControlComponent,
|
|
983
|
-
|
|
1525
|
+
fieldViewComponent: SelectViewComponent,
|
|
1526
|
+
fieldSearchComponent: SelectSearchComponent,
|
|
984
1527
|
},
|
|
985
1528
|
{
|
|
986
1529
|
displayName: '数字',
|
|
987
1530
|
name: 'NumericEdit',
|
|
988
1531
|
fieldConfigComponent: NumbericEditConfigComponent,
|
|
989
1532
|
fieldComponent: NumbericEditControlComponent,
|
|
990
|
-
|
|
1533
|
+
fieldViewComponent: NumericEditViewComponent,
|
|
1534
|
+
fieldSearchComponent: NumericEditSearchComponent,
|
|
991
1535
|
},
|
|
992
1536
|
{
|
|
993
1537
|
displayName: '日期',
|
|
994
1538
|
name: 'DateEdit',
|
|
995
1539
|
fieldConfigComponent: DateEditConfigComponent,
|
|
996
1540
|
fieldComponent: DateEditControlComponent,
|
|
997
|
-
|
|
1541
|
+
fieldViewComponent: DateEditViewComponent,
|
|
998
1542
|
},
|
|
999
1543
|
];
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1544
|
+
function AddFieldControlGroup(array = []) {
|
|
1545
|
+
for (const element of array) {
|
|
1546
|
+
const find = FieldControlGroup.find((control) => {
|
|
1547
|
+
return control.name === element.name;
|
|
1548
|
+
});
|
|
1549
|
+
if (!find) {
|
|
1550
|
+
FieldControlGroup.push(element);
|
|
1551
|
+
}
|
|
1008
1552
|
}
|
|
1009
|
-
AddFieldControlGroup([...fielFieldControlGroup, ...ckEditorFieldControlGroup]);
|
|
1010
1553
|
return FieldControlGroup;
|
|
1011
1554
|
}
|
|
1012
|
-
function AddFieldControlGroup(array = []) {
|
|
1013
|
-
FieldControlGroup.push(...array);
|
|
1014
|
-
}
|
|
1015
1555
|
|
|
1556
|
+
/* eslint-disable no-unsafe-optional-chaining */
|
|
1557
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1016
1558
|
class DynamicComponent {
|
|
1017
|
-
constructor() {
|
|
1018
|
-
/**字段配置列表 */
|
|
1019
|
-
this._fields = '';
|
|
1020
|
-
}
|
|
1021
1559
|
set selected(v) {
|
|
1022
1560
|
this._selected = v === undefined ? '' : v === null ? '' : v;
|
|
1023
1561
|
}
|
|
@@ -1041,19 +1579,23 @@ class DynamicComponent {
|
|
|
1041
1579
|
this.dataLoaded(3);
|
|
1042
1580
|
}
|
|
1043
1581
|
}
|
|
1582
|
+
constructor(mergedConfig) {
|
|
1583
|
+
this.mergedConfig = mergedConfig;
|
|
1584
|
+
/**字段配置列表 */
|
|
1585
|
+
this._fields = '';
|
|
1586
|
+
}
|
|
1044
1587
|
/**数据加载完成 */
|
|
1045
1588
|
async dataLoaded(val) {
|
|
1046
|
-
|
|
1047
|
-
let _fieldControlGroup = new Array(...await getExcludeAssignControl());
|
|
1589
|
+
const _fieldControlGroup = AddFieldControlGroup(this.mergedConfig);
|
|
1048
1590
|
if (this._entity) {
|
|
1049
1591
|
//加载所有的动态表单组件
|
|
1050
1592
|
if (this._type) {
|
|
1051
|
-
|
|
1593
|
+
const fieldControlItem = _fieldControlGroup.find(el => el.name === this._type);
|
|
1052
1594
|
this.loadfieldConfigComponent(fieldControlItem);
|
|
1053
1595
|
}
|
|
1054
1596
|
if (this._fields && this._parentFiledName && this._culture) {
|
|
1055
1597
|
/**表单控件组中的项 */
|
|
1056
|
-
|
|
1598
|
+
const fieldControlItem = _fieldControlGroup.find(el => el.name === this._fields?.field?.formControlName);
|
|
1057
1599
|
this.loadfieldComponent(fieldControlItem);
|
|
1058
1600
|
}
|
|
1059
1601
|
}
|
|
@@ -1087,13 +1629,16 @@ class DynamicComponent {
|
|
|
1087
1629
|
instance.culture = this._culture;
|
|
1088
1630
|
instance.entity = this._entity;
|
|
1089
1631
|
}
|
|
1090
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1632
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicComponent, deps: [{ token: 'MERGED_FORM_CONFIG' }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1091
1633
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DynamicComponent, selector: "df-dynamic", inputs: { selected: "selected", type: "type", culture: "culture", parentFiledName: "parentFiledName", fields: "fields", entity: "entity" }, 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: [""] }); }
|
|
1092
1634
|
}
|
|
1093
1635
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicComponent, decorators: [{
|
|
1094
1636
|
type: Component,
|
|
1095
1637
|
args: [{ selector: 'df-dynamic', template: "<template #FormControlRef></template>\n<template #FormComponentsRef></template>" }]
|
|
1096
|
-
}],
|
|
1638
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1639
|
+
type: Inject,
|
|
1640
|
+
args: ['MERGED_FORM_CONFIG']
|
|
1641
|
+
}] }], propDecorators: { selected: [{
|
|
1097
1642
|
type: Input
|
|
1098
1643
|
}], type: [{
|
|
1099
1644
|
type: Input
|
|
@@ -1113,9 +1658,172 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1113
1658
|
args: ['FormComponentsRef', { read: ViewContainerRef, static: true }]
|
|
1114
1659
|
}] } });
|
|
1115
1660
|
|
|
1661
|
+
class FormControlService {
|
|
1662
|
+
constructor(mergedConfig) {
|
|
1663
|
+
this.mergedConfig = mergedConfig;
|
|
1664
|
+
this._FieldControlGroup = FieldControlGroup;
|
|
1665
|
+
}
|
|
1666
|
+
AddFieldControlGroup() {
|
|
1667
|
+
let array = this.mergedConfig;
|
|
1668
|
+
for (const element of array) {
|
|
1669
|
+
let find = FieldControlGroup.find(control => {
|
|
1670
|
+
return control.name === element.name;
|
|
1671
|
+
});
|
|
1672
|
+
if (!find) {
|
|
1673
|
+
FieldControlGroup.push(element);
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
return FieldControlGroup;
|
|
1677
|
+
}
|
|
1678
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormControlService, deps: [{ token: 'MERGED_FORM_CONFIG' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1679
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormControlService, providedIn: 'root' }); }
|
|
1680
|
+
}
|
|
1681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormControlService, decorators: [{
|
|
1682
|
+
type: Injectable,
|
|
1683
|
+
args: [{
|
|
1684
|
+
providedIn: 'root',
|
|
1685
|
+
}]
|
|
1686
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1687
|
+
type: Inject,
|
|
1688
|
+
args: ['MERGED_FORM_CONFIG']
|
|
1689
|
+
}] }] });
|
|
1690
|
+
|
|
1691
|
+
class DynamicViewComponent {
|
|
1692
|
+
constructor(_FormControlService) {
|
|
1693
|
+
this._FormControlService = _FormControlService;
|
|
1694
|
+
/**是否显示再列表 */
|
|
1695
|
+
this.showInList = false;
|
|
1696
|
+
/**表单控件Value */
|
|
1697
|
+
this._value = '';
|
|
1698
|
+
}
|
|
1699
|
+
set value(v) {
|
|
1700
|
+
this._value = v;
|
|
1701
|
+
// if(this._value) this.dataLoaded();
|
|
1702
|
+
}
|
|
1703
|
+
ngAfterContentInit() {
|
|
1704
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1705
|
+
//Add 'implements AfterContentInit' to the class.
|
|
1706
|
+
if (this.type && this._value !== '') {
|
|
1707
|
+
let _fieldControlGroup = this._FormControlService.AddFieldControlGroup();
|
|
1708
|
+
let fieldControlItem = _fieldControlGroup.find(el => el.name === this.type);
|
|
1709
|
+
this.loadViewComponent(fieldControlItem);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
/**加载动态展示组件 */
|
|
1713
|
+
loadViewComponent(FieldControlItem) {
|
|
1714
|
+
//清空了容器中的所有组件
|
|
1715
|
+
this.FormTemplateRef?.clear();
|
|
1716
|
+
if (!FieldControlItem || !FieldControlItem.fieldViewComponent)
|
|
1717
|
+
return;
|
|
1718
|
+
//在容器中创建组件
|
|
1719
|
+
const { instance } = this.FormTemplateRef?.createComponent(FieldControlItem.fieldViewComponent); //创建组件模板
|
|
1720
|
+
/**向创建的组件模板中传值 */
|
|
1721
|
+
instance.type = this.type;
|
|
1722
|
+
instance.value = this._value;
|
|
1723
|
+
instance.fields = this.fields;
|
|
1724
|
+
instance.showInList = this.showInList;
|
|
1725
|
+
}
|
|
1726
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicViewComponent, deps: [{ token: FormControlService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1727
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DynamicViewComponent, selector: "df-dynamic-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, viewQueries: [{ propertyName: "FormTemplateRef", first: true, predicate: ["FormTemplateRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<template #FormTemplateRef></template>", styles: [""] }); }
|
|
1728
|
+
}
|
|
1729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicViewComponent, decorators: [{
|
|
1730
|
+
type: Component,
|
|
1731
|
+
args: [{ selector: 'df-dynamic-view', template: "<template #FormTemplateRef></template>" }]
|
|
1732
|
+
}], ctorParameters: () => [{ type: FormControlService }], propDecorators: { showInList: [{
|
|
1733
|
+
type: Input
|
|
1734
|
+
}], fields: [{
|
|
1735
|
+
type: Input
|
|
1736
|
+
}], type: [{
|
|
1737
|
+
type: Input
|
|
1738
|
+
}], value: [{
|
|
1739
|
+
type: Input
|
|
1740
|
+
}], FormTemplateRef: [{
|
|
1741
|
+
type: ViewChild,
|
|
1742
|
+
args: ['FormTemplateRef', { read: ViewContainerRef, static: true }]
|
|
1743
|
+
}] } });
|
|
1744
|
+
|
|
1745
|
+
class DynamicConfigComponent {
|
|
1746
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1747
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DynamicConfigComponent, selector: "df-dynamic-config", ngImport: i0, template: "<p>dynamic-config works!</p>\r\n", styles: [""] }); }
|
|
1748
|
+
}
|
|
1749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, decorators: [{
|
|
1750
|
+
type: Component,
|
|
1751
|
+
args: [{ selector: 'df-dynamic-config', template: "<p>dynamic-config works!</p>\r\n" }]
|
|
1752
|
+
}] });
|
|
1753
|
+
|
|
1754
|
+
class DynamicControlComponent {
|
|
1755
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1756
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DynamicControlComponent, selector: "df-dynamic-control", ngImport: i0, template: "<p>dynamic-control works!</p>\r\n", styles: [""] }); }
|
|
1757
|
+
}
|
|
1758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, decorators: [{
|
|
1759
|
+
type: Component,
|
|
1760
|
+
args: [{ selector: 'df-dynamic-control', template: "<p>dynamic-control works!</p>\r\n" }]
|
|
1761
|
+
}] });
|
|
1762
|
+
|
|
1763
|
+
class DynamicSearchComponent {
|
|
1764
|
+
constructor(_FormControlService) {
|
|
1765
|
+
this._FormControlService = _FormControlService;
|
|
1766
|
+
/**字段配置列表 */
|
|
1767
|
+
this._fields = '';
|
|
1768
|
+
}
|
|
1769
|
+
set culture(v) {
|
|
1770
|
+
this._culture = v;
|
|
1771
|
+
}
|
|
1772
|
+
set parentFiledName(v) {
|
|
1773
|
+
this._parentFiledName = v;
|
|
1774
|
+
}
|
|
1775
|
+
set fields(v) {
|
|
1776
|
+
this._fields = v;
|
|
1777
|
+
}
|
|
1778
|
+
set entity(v) {
|
|
1779
|
+
if (v) {
|
|
1780
|
+
this._entity = v;
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
ngAfterContentInit() {
|
|
1784
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1785
|
+
//Add 'implements AfterContentInit' to the class.
|
|
1786
|
+
if (this._fields && this._entity && this._culture) {
|
|
1787
|
+
let _fieldControlGroup = this._FormControlService.AddFieldControlGroup();
|
|
1788
|
+
let fieldControlItem = _fieldControlGroup.find(el => el.name === this._fields?.field?.formControlName);
|
|
1789
|
+
this.loadComponent(fieldControlItem);
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
/**加载动态展示组件 */
|
|
1793
|
+
loadComponent(FieldControlItem) {
|
|
1794
|
+
//清空了容器中的所有组件
|
|
1795
|
+
this.FormSearchTemplateRef?.clear();
|
|
1796
|
+
if (!FieldControlItem || !FieldControlItem.fieldSearchComponent)
|
|
1797
|
+
return;
|
|
1798
|
+
//在容器中创建组件
|
|
1799
|
+
const { instance } = this.FormSearchTemplateRef?.createComponent(FieldControlItem.fieldSearchComponent); //创建组件模板
|
|
1800
|
+
/**向创建的组件模板中传值 */
|
|
1801
|
+
instance.fields = this._fields;
|
|
1802
|
+
instance.parentFiledName = this._parentFiledName;
|
|
1803
|
+
instance.culture = this._culture;
|
|
1804
|
+
instance.entity = this._entity;
|
|
1805
|
+
}
|
|
1806
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicSearchComponent, deps: [{ token: FormControlService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1807
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DynamicSearchComponent, selector: "df-dynamic-search", inputs: { culture: "culture", parentFiledName: "parentFiledName", fields: "fields", entity: "entity" }, viewQueries: [{ propertyName: "FormSearchTemplateRef", first: true, predicate: ["FormSearchTemplateRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<template #FormSearchTemplateRef></template>", styles: [""] }); }
|
|
1808
|
+
}
|
|
1809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicSearchComponent, decorators: [{
|
|
1810
|
+
type: Component,
|
|
1811
|
+
args: [{ selector: 'df-dynamic-search', template: "<template #FormSearchTemplateRef></template>" }]
|
|
1812
|
+
}], ctorParameters: () => [{ type: FormControlService }], propDecorators: { culture: [{
|
|
1813
|
+
type: Input
|
|
1814
|
+
}], parentFiledName: [{
|
|
1815
|
+
type: Input
|
|
1816
|
+
}], fields: [{
|
|
1817
|
+
type: Input
|
|
1818
|
+
}], entity: [{
|
|
1819
|
+
type: Input
|
|
1820
|
+
}], FormSearchTemplateRef: [{
|
|
1821
|
+
type: ViewChild,
|
|
1822
|
+
args: ['FormSearchTemplateRef', { read: ViewContainerRef, static: true }]
|
|
1823
|
+
}] } });
|
|
1824
|
+
|
|
1116
1825
|
class DynamicFormModule {
|
|
1117
1826
|
static forRoot(config) {
|
|
1118
|
-
AddFieldControlGroup(config?.cmsFieldControlGroup);
|
|
1119
1827
|
return {
|
|
1120
1828
|
ngModule: DynamicFormModule,
|
|
1121
1829
|
providers: []
|
|
@@ -1132,26 +1840,50 @@ class DynamicFormModule {
|
|
|
1132
1840
|
DateEditControlComponent,
|
|
1133
1841
|
SelectConfigComponent,
|
|
1134
1842
|
SelectControlComponent,
|
|
1135
|
-
DynamicComponent
|
|
1843
|
+
DynamicComponent,
|
|
1844
|
+
DynamicConfigComponent,
|
|
1845
|
+
DynamicViewComponent,
|
|
1846
|
+
DynamicControlComponent,
|
|
1847
|
+
SelectViewComponent,
|
|
1848
|
+
SwitchViewComponent,
|
|
1849
|
+
TextEditViewComponent,
|
|
1850
|
+
DateEditViewComponent,
|
|
1851
|
+
NumericEditViewComponent,
|
|
1852
|
+
DynamicSearchComponent,
|
|
1853
|
+
SelectSearchComponent,
|
|
1854
|
+
TextEditSearchComponent,
|
|
1855
|
+
SwitchSearchComponent,
|
|
1856
|
+
NumericEditSearchComponent], imports: [FormsModule,
|
|
1136
1857
|
CoreModule,
|
|
1137
1858
|
ThemeSharedModule,
|
|
1138
1859
|
ReactiveFormsModule,
|
|
1139
|
-
NgbDropdownModule
|
|
1860
|
+
NgbDropdownModule,
|
|
1861
|
+
NzSelectModule], exports: [TextEditConfigComponent,
|
|
1140
1862
|
TextEditComponent,
|
|
1863
|
+
TextEditViewComponent,
|
|
1141
1864
|
SwitchConfigComponent,
|
|
1142
1865
|
SwitchControlComponent,
|
|
1866
|
+
SwitchViewComponent,
|
|
1143
1867
|
NumbericEditConfigComponent,
|
|
1144
1868
|
NumbericEditControlComponent,
|
|
1145
1869
|
DateEditConfigComponent,
|
|
1146
1870
|
DateEditControlComponent,
|
|
1871
|
+
DateEditViewComponent,
|
|
1147
1872
|
SelectConfigComponent,
|
|
1148
1873
|
SelectControlComponent,
|
|
1149
|
-
|
|
1874
|
+
SelectViewComponent,
|
|
1875
|
+
SelectSearchComponent,
|
|
1876
|
+
DynamicComponent,
|
|
1877
|
+
DynamicConfigComponent,
|
|
1878
|
+
DynamicViewComponent,
|
|
1879
|
+
DynamicControlComponent,
|
|
1880
|
+
DynamicSearchComponent] }); }
|
|
1150
1881
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, imports: [FormsModule,
|
|
1151
1882
|
CoreModule,
|
|
1152
1883
|
ThemeSharedModule,
|
|
1153
1884
|
ReactiveFormsModule,
|
|
1154
|
-
NgbDropdownModule
|
|
1885
|
+
NgbDropdownModule,
|
|
1886
|
+
NzSelectModule] }); }
|
|
1155
1887
|
}
|
|
1156
1888
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, decorators: [{
|
|
1157
1889
|
type: NgModule,
|
|
@@ -1168,6 +1900,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1168
1900
|
SelectConfigComponent,
|
|
1169
1901
|
SelectControlComponent,
|
|
1170
1902
|
DynamicComponent,
|
|
1903
|
+
DynamicConfigComponent,
|
|
1904
|
+
DynamicViewComponent,
|
|
1905
|
+
DynamicControlComponent,
|
|
1906
|
+
SelectViewComponent,
|
|
1907
|
+
SwitchViewComponent,
|
|
1908
|
+
TextEditViewComponent,
|
|
1909
|
+
DateEditViewComponent,
|
|
1910
|
+
NumericEditViewComponent,
|
|
1911
|
+
DynamicSearchComponent,
|
|
1912
|
+
SelectSearchComponent,
|
|
1913
|
+
TextEditSearchComponent,
|
|
1914
|
+
SwitchSearchComponent,
|
|
1915
|
+
NumericEditSearchComponent,
|
|
1171
1916
|
],
|
|
1172
1917
|
imports: [
|
|
1173
1918
|
FormsModule,
|
|
@@ -1175,20 +1920,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1175
1920
|
ThemeSharedModule,
|
|
1176
1921
|
ReactiveFormsModule,
|
|
1177
1922
|
NgbDropdownModule,
|
|
1923
|
+
NzSelectModule,
|
|
1178
1924
|
// NzTreeModule,
|
|
1179
1925
|
],
|
|
1180
1926
|
exports: [
|
|
1181
1927
|
TextEditConfigComponent,
|
|
1182
1928
|
TextEditComponent,
|
|
1929
|
+
TextEditViewComponent,
|
|
1183
1930
|
SwitchConfigComponent,
|
|
1184
1931
|
SwitchControlComponent,
|
|
1932
|
+
SwitchViewComponent,
|
|
1185
1933
|
NumbericEditConfigComponent,
|
|
1186
1934
|
NumbericEditControlComponent,
|
|
1187
1935
|
DateEditConfigComponent,
|
|
1188
1936
|
DateEditControlComponent,
|
|
1937
|
+
DateEditViewComponent,
|
|
1189
1938
|
SelectConfigComponent,
|
|
1190
1939
|
SelectControlComponent,
|
|
1940
|
+
SelectViewComponent,
|
|
1941
|
+
SelectSearchComponent,
|
|
1191
1942
|
DynamicComponent,
|
|
1943
|
+
DynamicConfigComponent,
|
|
1944
|
+
DynamicViewComponent,
|
|
1945
|
+
DynamicControlComponent,
|
|
1946
|
+
DynamicSearchComponent
|
|
1192
1947
|
],
|
|
1193
1948
|
providers: [],
|
|
1194
1949
|
}]
|
|
@@ -1202,5 +1957,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1202
1957
|
* Generated bundle index. Do not edit.
|
|
1203
1958
|
*/
|
|
1204
1959
|
|
|
1205
|
-
export { AddFieldControlGroup, DateEditConfigComponent, DateEditControlComponent, DynamicComponent, DynamicFormModule, FieldControlGroup, NumbericEditConfigComponent, NumbericEditControlComponent, SelectConfigComponent, SelectControlComponent, SwitchConfigComponent, SwitchControlComponent, TextEditComponent, TextEditConfig, TextEditConfigComponent,
|
|
1960
|
+
export { AddFieldControlGroup, DateEditConfigComponent, DateEditControlComponent, DateEditViewComponent, DynamicComponent, DynamicConfigComponent, DynamicControlComponent, DynamicFormModule, DynamicSearchComponent, DynamicViewComponent, FieldControlGroup, NumbericEditConfigComponent, NumbericEditControlComponent, SelectConfigComponent, SelectControlComponent, SelectSearchComponent, SelectViewComponent, SwitchConfigComponent, SwitchControlComponent, SwitchSearchComponent, SwitchViewComponent, TextEditComponent, TextEditConfig, TextEditConfigComponent, TextEditSearchComponent, TextEditViewComponent, maxDecimalPlacesValidator };
|
|
1206
1961
|
//# sourceMappingURL=dignite-ng-expand.dynamic-form.mjs.map
|