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