@dignite-ng/expand.dynamic-form 3.0.0-rc.49 → 3.0.0-rc.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/dynamic/dynamic-config.component.mjs +56 -6
- package/esm2022/lib/components/dynamic/dynamic-control.component.mjs +87 -6
- package/esm2022/lib/components/dynamic/dynamic-search.component.mjs +3 -2
- package/esm2022/lib/components/dynamic/dynamic-view.component.mjs +5 -3
- package/esm2022/lib/components/dynamic/dynamic.component.mjs +7 -3
- package/esm2022/lib/components/form/date-edit/date-edit-config.component.mjs +11 -10
- package/esm2022/lib/components/form/date-edit/date-edit-control.component.mjs +5 -4
- package/esm2022/lib/components/form/date-edit/date-edit-view.component.mjs +3 -2
- package/esm2022/lib/components/form/form-control-group.mjs +2 -2
- package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.component.mjs +10 -9
- package/esm2022/lib/components/form/numeric-edit/numeric-edit-search.component.mjs +1 -1
- package/esm2022/lib/components/form/select/select-config.component.mjs +16 -10
- package/esm2022/lib/components/form/select/select-config.mjs +4 -11
- package/esm2022/lib/components/form/select/select-view.component.mjs +3 -2
- package/esm2022/lib/components/form/switch/switch-config.component.mjs +14 -11
- package/esm2022/lib/components/form/switch/switch-config.mjs +3 -10
- package/esm2022/lib/components/form/text-edit/text-edit-config.component.mjs +14 -14
- package/esm2022/lib/components/form/text-edit/text-edit-config.mjs +5 -12
- package/esm2022/lib/services/df-api.service.mjs +2 -60
- package/esm2022/lib/services/form-control.service.mjs +8 -4
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs +229 -156
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -1
- package/lib/components/dynamic/dynamic-config.component.d.ts +17 -2
- package/lib/components/dynamic/dynamic-control.component.d.ts +28 -2
- package/lib/components/dynamic/dynamic-view.component.d.ts +2 -2
- package/lib/components/dynamic/dynamic.component.d.ts +4 -0
- package/lib/components/form/date-edit/date-edit-config.component.d.ts +1 -1
- package/lib/components/form/date-edit/date-edit-control.component.d.ts +2 -2
- package/lib/components/form/date-edit/date-edit-view.component.d.ts +2 -1
- package/lib/components/form/form-control-group.d.ts +1 -1
- package/lib/components/form/numeric-edit/numberic-edit-config.component.d.ts +1 -1
- package/lib/components/form/select/select-config.component.d.ts +7 -1
- package/lib/components/form/select/select-config.d.ts +0 -1
- package/lib/components/form/switch/switch-config.component.d.ts +2 -2
- package/lib/components/form/switch/switch-config.d.ts +0 -1
- package/lib/components/form/text-edit/text-edit-config.component.d.ts +4 -4
- package/lib/components/form/text-edit/text-edit-config.d.ts +0 -1
- package/lib/services/df-api.service.d.ts +0 -11
- package/lib/services/form-control.service.d.ts +5 -1
- package/package.json +1 -1
|
@@ -9,7 +9,6 @@ import { NgbDropdownModule, NgbDatepickerModule } from '@ng-bootstrap/ng-bootstr
|
|
|
9
9
|
import * as i3 from '@ngx-validate/core';
|
|
10
10
|
import * as i2$1 from '@angular/common';
|
|
11
11
|
import { DatePipe } from '@angular/common';
|
|
12
|
-
import { pinyin } from 'pinyin-pro';
|
|
13
12
|
import * as i6 from '@angular/cdk/drag-drop';
|
|
14
13
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
15
14
|
import * as i4 from 'ng-zorro-antd/select';
|
|
@@ -17,20 +16,13 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
|
17
16
|
import { ExtensibleModule } from '@abp/ng.components/extensible';
|
|
18
17
|
|
|
19
18
|
class TextEditConfig {
|
|
20
|
-
constructor(
|
|
19
|
+
constructor() {
|
|
21
20
|
/**占位符 */
|
|
22
|
-
this['TextEdit.Placeholder'] = [''
|
|
21
|
+
this['TextEdit.Placeholder'] = [''];
|
|
23
22
|
//字段类型,单行文本,多行文本
|
|
24
|
-
this['TextEdit.Mode'] = [0
|
|
23
|
+
this['TextEdit.Mode'] = [0];
|
|
25
24
|
// 字数限制
|
|
26
|
-
this['TextEdit.CharLimit'] = ['265'
|
|
27
|
-
if (data) {
|
|
28
|
-
for (const key in data) {
|
|
29
|
-
if (data.hasOwnProperty(key)) {
|
|
30
|
-
this[key] = data[key];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
25
|
+
this['TextEdit.CharLimit'] = ['265'];
|
|
34
26
|
}
|
|
35
27
|
}
|
|
36
28
|
|
|
@@ -47,16 +39,16 @@ class TextEditConfigComponent {
|
|
|
47
39
|
constructor(fb) {
|
|
48
40
|
this.fb = fb;
|
|
49
41
|
this._TextEditMode = TextEditMode;
|
|
50
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
51
42
|
this.RadioIndex1 = Math.floor(Math.random() * 1001);
|
|
52
43
|
this.RadioIndex2 = Math.floor(Math.random() * 1001);
|
|
44
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
53
45
|
}
|
|
54
46
|
set type(v) {
|
|
55
|
-
this.
|
|
47
|
+
this.formControlName = v;
|
|
56
48
|
this.dataLoaded();
|
|
57
49
|
}
|
|
58
50
|
set Entity(v) {
|
|
59
|
-
this.
|
|
51
|
+
this.formEntity = v;
|
|
60
52
|
this.dataLoaded();
|
|
61
53
|
}
|
|
62
54
|
set selected(v) {
|
|
@@ -64,19 +56,19 @@ class TextEditConfigComponent {
|
|
|
64
56
|
this.dataLoaded();
|
|
65
57
|
}
|
|
66
58
|
get formConfiguration() {
|
|
67
|
-
return this.
|
|
59
|
+
return this.formEntity.get('formConfiguration');
|
|
68
60
|
}
|
|
69
61
|
async dataLoaded() {
|
|
70
|
-
if (this.
|
|
62
|
+
if (this.formEntity && this.formControlName) {
|
|
71
63
|
await this.AfterInit();
|
|
72
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
73
|
-
// this.submitclick?.nativeElement?.click();
|
|
74
64
|
}
|
|
75
65
|
}
|
|
76
66
|
AfterInit() {
|
|
77
67
|
return new Promise((resolve, rejects) => {
|
|
78
|
-
this.
|
|
79
|
-
|
|
68
|
+
this.formEntity.setControl('formConfiguration', this.fb.group(new TextEditConfig()));
|
|
69
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
70
|
+
this.submitclick?.nativeElement?.click();
|
|
71
|
+
if (this._selected && this._selected.formControlName == this.formControlName) {
|
|
80
72
|
this.formConfiguration.patchValue({
|
|
81
73
|
...this._selected.formConfiguration,
|
|
82
74
|
});
|
|
@@ -85,11 +77,11 @@ class TextEditConfigComponent {
|
|
|
85
77
|
});
|
|
86
78
|
}
|
|
87
79
|
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 }); }
|
|
88
|
-
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: "<
|
|
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]=\"formEntity\">\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=\"flexRadioDefault{{RadioIndex1}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{RadioIndex1}}\">\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=\"flexRadioDefault{{RadioIndex2}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{RadioIndex2}}\">\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\" 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: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
89
81
|
}
|
|
90
82
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditConfigComponent, decorators: [{
|
|
91
83
|
type: Component,
|
|
92
|
-
args: [{ selector: 'df-text-edit-config', template: "<
|
|
84
|
+
args: [{ selector: 'df-text-edit-config', template: "<form [formGroup]=\"formEntity\">\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=\"flexRadioDefault{{RadioIndex1}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{RadioIndex1}}\">\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=\"flexRadioDefault{{RadioIndex2}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{RadioIndex2}}\">\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\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
|
|
93
85
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
94
86
|
type: Input
|
|
95
87
|
}], Entity: [{
|
|
@@ -293,19 +285,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
293
285
|
}] } });
|
|
294
286
|
|
|
295
287
|
class SwitchConfig {
|
|
296
|
-
constructor(
|
|
288
|
+
constructor() {
|
|
297
289
|
/**默认值 */
|
|
298
|
-
this['Switch.Default'] = [false
|
|
299
|
-
if (data) {
|
|
300
|
-
for (const key in data) {
|
|
301
|
-
if (data.hasOwnProperty(key)) {
|
|
302
|
-
this[key] = data[key];
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
290
|
+
this['Switch.Default'] = [false];
|
|
306
291
|
}
|
|
307
292
|
}
|
|
308
293
|
|
|
294
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
309
295
|
class SwitchConfigComponent {
|
|
310
296
|
constructor(fb) {
|
|
311
297
|
this.fb = fb;
|
|
@@ -316,7 +302,7 @@ class SwitchConfigComponent {
|
|
|
316
302
|
this.dataLoaded();
|
|
317
303
|
}
|
|
318
304
|
set Entity(v) {
|
|
319
|
-
this.
|
|
305
|
+
this.formEntity = v;
|
|
320
306
|
this.dataLoaded();
|
|
321
307
|
}
|
|
322
308
|
set selected(v) {
|
|
@@ -324,18 +310,20 @@ class SwitchConfigComponent {
|
|
|
324
310
|
this.dataLoaded();
|
|
325
311
|
}
|
|
326
312
|
get formConfiguration() {
|
|
327
|
-
return this.
|
|
313
|
+
return this.formEntity.get('formConfiguration');
|
|
328
314
|
}
|
|
329
315
|
async dataLoaded() {
|
|
330
|
-
if (this.
|
|
316
|
+
if (this.formEntity && this._type) {
|
|
331
317
|
await this.AfterInit();
|
|
332
|
-
this.cdr.detectChanges();
|
|
333
|
-
this.submitclick?.nativeElement?.click();
|
|
318
|
+
// this.cdr.detectChanges();
|
|
334
319
|
}
|
|
335
320
|
}
|
|
336
321
|
AfterInit() {
|
|
337
322
|
return new Promise((resolve, rejects) => {
|
|
338
|
-
this.
|
|
323
|
+
this.formEntity.setControl('formConfiguration', this.fb.group(new SwitchConfig()));
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
this.submitclick?.nativeElement?.click();
|
|
326
|
+
}, 0);
|
|
339
327
|
if (this._selected && this._selected.formControlName == this._type) {
|
|
340
328
|
this.formConfiguration.patchValue({
|
|
341
329
|
...this._selected.formConfiguration,
|
|
@@ -345,11 +333,11 @@ class SwitchConfigComponent {
|
|
|
345
333
|
});
|
|
346
334
|
}
|
|
347
335
|
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 }); }
|
|
348
|
-
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]=\"
|
|
336
|
+
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]=\"formEntity\">\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\" 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: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
349
337
|
}
|
|
350
338
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchConfigComponent, decorators: [{
|
|
351
339
|
type: Component,
|
|
352
|
-
args: [{ selector: 'df-switch-config', template: "<form [formGroup]=\"
|
|
340
|
+
args: [{ selector: 'df-switch-config', template: "<form [formGroup]=\"formEntity\">\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\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
|
|
353
341
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
354
342
|
type: Input
|
|
355
343
|
}], Entity: [{
|
|
@@ -567,6 +555,7 @@ class NumbericEditConfig {
|
|
|
567
555
|
}
|
|
568
556
|
}
|
|
569
557
|
|
|
558
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
570
559
|
class NumbericEditConfigComponent {
|
|
571
560
|
constructor(fb) {
|
|
572
561
|
this.fb = fb;
|
|
@@ -580,22 +569,22 @@ class NumbericEditConfigComponent {
|
|
|
580
569
|
this._selected = v ? v : v == false ? v : '';
|
|
581
570
|
}
|
|
582
571
|
set Entity(v) {
|
|
583
|
-
this.
|
|
572
|
+
this.formEntity = v;
|
|
584
573
|
this.dataLoaded();
|
|
585
574
|
}
|
|
586
575
|
get formConfiguration() {
|
|
587
|
-
return this.
|
|
576
|
+
return this.formEntity.get('formConfiguration');
|
|
588
577
|
}
|
|
589
578
|
async dataLoaded() {
|
|
590
|
-
if (this.
|
|
579
|
+
if (this.formEntity && this._type) {
|
|
591
580
|
await this.AfterInit();
|
|
592
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
593
|
-
this.submitclick?.nativeElement?.click();
|
|
594
581
|
}
|
|
595
582
|
}
|
|
596
583
|
AfterInit() {
|
|
597
584
|
return new Promise((resolve, rejects) => {
|
|
598
|
-
this.
|
|
585
|
+
this.formEntity.setControl('formConfiguration', this.fb.group(new NumbericEditConfig()));
|
|
586
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
587
|
+
this.submitclick?.nativeElement?.click();
|
|
599
588
|
if (this._selected && this._selected.formControlName == this._type) {
|
|
600
589
|
this.formConfiguration.patchValue({
|
|
601
590
|
...this._selected.formConfiguration,
|
|
@@ -605,11 +594,11 @@ class NumbericEditConfigComponent {
|
|
|
605
594
|
});
|
|
606
595
|
}
|
|
607
596
|
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 }); }
|
|
608
|
-
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]=\"
|
|
597
|
+
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]=\"formEntity\">\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" }] }); }
|
|
609
598
|
}
|
|
610
599
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditConfigComponent, decorators: [{
|
|
611
600
|
type: Component,
|
|
612
|
-
args: [{ selector: 'df-numberic-edit-config', template: "<form [formGroup]=\"
|
|
601
|
+
args: [{ selector: 'df-numberic-edit-config', template: "<form [formGroup]=\"formEntity\">\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>" }]
|
|
613
602
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
614
603
|
type: Input
|
|
615
604
|
}], selected: [{
|
|
@@ -756,6 +745,7 @@ class DateEditConfig {
|
|
|
756
745
|
}
|
|
757
746
|
}
|
|
758
747
|
|
|
748
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
759
749
|
class DateEditConfigComponent {
|
|
760
750
|
constructor(fb) {
|
|
761
751
|
this.fb = fb;
|
|
@@ -771,22 +761,22 @@ class DateEditConfigComponent {
|
|
|
771
761
|
this._selected = v;
|
|
772
762
|
}
|
|
773
763
|
set Entity(v) {
|
|
774
|
-
this.
|
|
764
|
+
this.formEntity = v;
|
|
775
765
|
this.dataLoaded();
|
|
776
766
|
}
|
|
777
767
|
get formConfiguration() {
|
|
778
|
-
return this.
|
|
768
|
+
return this.formEntity.get('formConfiguration');
|
|
779
769
|
}
|
|
780
770
|
async dataLoaded() {
|
|
781
|
-
if (this.
|
|
771
|
+
if (this.formEntity && this._type) {
|
|
782
772
|
await this.AfterInit();
|
|
783
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
784
|
-
this.submitclick?.nativeElement?.click();
|
|
785
773
|
}
|
|
786
774
|
}
|
|
787
775
|
AfterInit() {
|
|
788
776
|
return new Promise((resolve, rejects) => {
|
|
789
|
-
this.
|
|
777
|
+
this.formEntity.setControl('formConfiguration', this.fb.group(new DateEditConfig()));
|
|
778
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
779
|
+
this.submitclick?.nativeElement?.click();
|
|
790
780
|
if (this._selected && this._selected.formControlName == this._type) {
|
|
791
781
|
this.formConfiguration.patchValue({
|
|
792
782
|
...this._selected.formConfiguration,
|
|
@@ -798,7 +788,7 @@ class DateEditConfigComponent {
|
|
|
798
788
|
}
|
|
799
789
|
/**切换时间类型 */
|
|
800
790
|
timeTypeChange() {
|
|
801
|
-
|
|
791
|
+
const type = this.formConfiguration.value['DateEdit.InputMode'];
|
|
802
792
|
let Min = this.formConfiguration.value['DateEdit.Min'];
|
|
803
793
|
let Max = this.formConfiguration.value['DateEdit.Max'];
|
|
804
794
|
if (type == DateEditInterfaces.Date) {
|
|
@@ -822,11 +812,11 @@ class DateEditConfigComponent {
|
|
|
822
812
|
});
|
|
823
813
|
}
|
|
824
814
|
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 }); }
|
|
825
|
-
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]=\"
|
|
815
|
+
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]=\"formEntity\">\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" }] }); }
|
|
826
816
|
}
|
|
827
817
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditConfigComponent, decorators: [{
|
|
828
818
|
type: Component,
|
|
829
|
-
args: [{ selector: 'df-date-edit-config', template: "<form [formGroup]=\"
|
|
819
|
+
args: [{ selector: 'df-date-edit-config', template: "<form [formGroup]=\"formEntity\">\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>" }]
|
|
830
820
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
831
821
|
type: Input
|
|
832
822
|
}], selected: [{
|
|
@@ -838,6 +828,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
838
828
|
args: ['submitclick', { static: true }]
|
|
839
829
|
}] } });
|
|
840
830
|
|
|
831
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
841
832
|
class DateEditControlComponent {
|
|
842
833
|
constructor(fb, cdr) {
|
|
843
834
|
this.fb = fb;
|
|
@@ -879,8 +870,8 @@ class DateEditControlComponent {
|
|
|
879
870
|
}
|
|
880
871
|
AfterInit() {
|
|
881
872
|
return new Promise((resolve, rejects) => {
|
|
882
|
-
|
|
883
|
-
|
|
873
|
+
const ValidatorsArray = [];
|
|
874
|
+
const formConfiguration = this._fields.field.formConfiguration;
|
|
884
875
|
if (this._fields.required) {
|
|
885
876
|
ValidatorsArray.push(Validators.required);
|
|
886
877
|
}
|
|
@@ -900,7 +891,7 @@ class DateEditControlComponent {
|
|
|
900
891
|
if (this._fields.field.formConfiguration['DateEdit.InputMode'] === DateEditInterfaces.Month) {
|
|
901
892
|
controlName = this._dataPipe.transform(this._selected, 'yyyy-MM');
|
|
902
893
|
}
|
|
903
|
-
|
|
894
|
+
const newControl = this.fb.control(controlName, ValidatorsArray);
|
|
904
895
|
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
905
896
|
resolve(true);
|
|
906
897
|
});
|
|
@@ -929,6 +920,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
929
920
|
args: ['submitclick', { static: true }]
|
|
930
921
|
}] } });
|
|
931
922
|
|
|
923
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
932
924
|
class DateEditViewComponent {
|
|
933
925
|
constructor() {
|
|
934
926
|
/**展示则内容 */
|
|
@@ -944,7 +936,7 @@ class DateEditViewComponent {
|
|
|
944
936
|
async ngAfterContentInit() {
|
|
945
937
|
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
946
938
|
//Add 'implements AfterContentInit' to the class.
|
|
947
|
-
|
|
939
|
+
const valueOptions = this._value;
|
|
948
940
|
if (this.type && valueOptions) {
|
|
949
941
|
this.showValue = valueOptions;
|
|
950
942
|
}
|
|
@@ -1104,55 +1096,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1104
1096
|
}] } });
|
|
1105
1097
|
|
|
1106
1098
|
class SelectConfig {
|
|
1107
|
-
constructor(
|
|
1099
|
+
constructor() {
|
|
1108
1100
|
/**空值文本 */
|
|
1109
|
-
this['Select.NullText'] = [''
|
|
1101
|
+
this['Select.NullText'] = [''];
|
|
1110
1102
|
//多选
|
|
1111
|
-
this['Select.Multiple'] = [false
|
|
1103
|
+
this['Select.Multiple'] = [false];
|
|
1112
1104
|
// 选项
|
|
1113
1105
|
this['Select.Options'] = new FormArray([]);
|
|
1114
|
-
if (data) {
|
|
1115
|
-
for (const key in data) {
|
|
1116
|
-
if (data.hasOwnProperty(key)) {
|
|
1117
|
-
this[key] = data[key];
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
1106
|
}
|
|
1122
1107
|
}
|
|
1123
1108
|
|
|
1124
1109
|
class DfApiService {
|
|
1125
|
-
constructor() { }
|
|
1126
|
-
/**
|
|
1127
|
-
* 识别中文转化为拼音,固定返回类型
|
|
1128
|
-
* 汉字转拼音
|
|
1129
|
-
* 大写转小写
|
|
1130
|
-
*
|
|
1131
|
-
* */
|
|
1132
|
-
chineseToPinyin(value) {
|
|
1133
|
-
//去除字符串中所有的空格
|
|
1134
|
-
// let val = value
|
|
1135
|
-
let val = value.replaceAll(' ', "-");
|
|
1136
|
-
let array = val.split('');
|
|
1137
|
-
let newArray = [];
|
|
1138
|
-
array.forEach((el, index) => {
|
|
1139
|
-
//转化为小写
|
|
1140
|
-
let elChange = el.toLowerCase();
|
|
1141
|
-
let isChinese = (str) => {
|
|
1142
|
-
return /^[\u4e00-\u9fa5]+$/.test(str);
|
|
1143
|
-
};
|
|
1144
|
-
if (isChinese(elChange)) {
|
|
1145
|
-
const resultWithoutTone = pinyin(elChange, { toneType: 'none', type: 'array' });
|
|
1146
|
-
elChange = resultWithoutTone.toString();
|
|
1147
|
-
if (index < array.length - 1)
|
|
1148
|
-
elChange += '-';
|
|
1149
|
-
}
|
|
1150
|
-
;
|
|
1151
|
-
newArray.push(elChange);
|
|
1152
|
-
});
|
|
1153
|
-
let pinyinstr = newArray.join('');
|
|
1154
|
-
return pinyinstr || val;
|
|
1155
|
-
}
|
|
1156
1110
|
/**获取图片的本地连接 */
|
|
1157
1111
|
getImageLacolBase64Url(file) {
|
|
1158
1112
|
return new Promise((resolve, rejects) => {
|
|
@@ -1164,32 +1118,6 @@ class DfApiService {
|
|
|
1164
1118
|
reader.onerror = error => rejects(error);
|
|
1165
1119
|
});
|
|
1166
1120
|
}
|
|
1167
|
-
/**
|
|
1168
|
-
* 深拷贝--方法 */
|
|
1169
|
-
deepClone(obj) {
|
|
1170
|
-
if (typeof obj !== 'object' || obj === null)
|
|
1171
|
-
return obj;
|
|
1172
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
1173
|
-
for (let key in obj) {
|
|
1174
|
-
if (obj.hasOwnProperty(key)) {
|
|
1175
|
-
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
1176
|
-
if (obj[key] instanceof Date) {
|
|
1177
|
-
result[key] = new Date(obj[key].getTime());
|
|
1178
|
-
}
|
|
1179
|
-
else if (obj[key] instanceof RegExp) {
|
|
1180
|
-
result[key] = new RegExp(obj[key]);
|
|
1181
|
-
}
|
|
1182
|
-
else {
|
|
1183
|
-
result[key] = this.deepClone(obj[key]);
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
else {
|
|
1187
|
-
result[key] = obj[key];
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
return result;
|
|
1192
|
-
}
|
|
1193
1121
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DfApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1194
1122
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DfApiService, providedIn: 'root' }); }
|
|
1195
1123
|
}
|
|
@@ -1198,7 +1126,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1198
1126
|
args: [{
|
|
1199
1127
|
providedIn: 'root'
|
|
1200
1128
|
}]
|
|
1201
|
-
}]
|
|
1129
|
+
}] });
|
|
1202
1130
|
|
|
1203
1131
|
/* eslint-disable @angular-eslint/component-selector */
|
|
1204
1132
|
class SelectConfigComponent {
|
|
@@ -1214,20 +1142,18 @@ class SelectConfigComponent {
|
|
|
1214
1142
|
this._selected = v;
|
|
1215
1143
|
}
|
|
1216
1144
|
set Entity(v) {
|
|
1217
|
-
this.
|
|
1145
|
+
this.formEntity = v;
|
|
1218
1146
|
this.dataLoaded();
|
|
1219
1147
|
}
|
|
1220
1148
|
get formConfiguration() {
|
|
1221
|
-
return this.
|
|
1149
|
+
return this.formEntity?.get('formConfiguration');
|
|
1222
1150
|
}
|
|
1223
1151
|
get SelectOptions() {
|
|
1224
1152
|
return this.formConfiguration.controls['Select.Options'];
|
|
1225
1153
|
}
|
|
1226
1154
|
async dataLoaded() {
|
|
1227
|
-
if (this.
|
|
1155
|
+
if (this.formEntity && this._type) {
|
|
1228
1156
|
await this.AfterInit();
|
|
1229
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
1230
|
-
this.submitclick?.nativeElement?.click();
|
|
1231
1157
|
}
|
|
1232
1158
|
}
|
|
1233
1159
|
/**增加选项 */
|
|
@@ -1244,7 +1170,9 @@ class SelectConfigComponent {
|
|
|
1244
1170
|
}
|
|
1245
1171
|
AfterInit() {
|
|
1246
1172
|
return new Promise((resolve, rejects) => {
|
|
1247
|
-
this.
|
|
1173
|
+
this.formEntity?.setControl('formConfiguration', this.fb.group(new SelectConfig()));
|
|
1174
|
+
this.cdr.detectChanges(); // 手动触发变更检测
|
|
1175
|
+
this.submitclick?.nativeElement?.click();
|
|
1248
1176
|
if (this._selected && this._selected.formControlName == this._type) {
|
|
1249
1177
|
for (const element of this._selected.formConfiguration['Select.Options']) {
|
|
1250
1178
|
for (const key in element) {
|
|
@@ -1264,13 +1192,19 @@ class SelectConfigComponent {
|
|
|
1264
1192
|
resolve(true);
|
|
1265
1193
|
});
|
|
1266
1194
|
}
|
|
1195
|
+
/**
|
|
1196
|
+
* 当选择项的文本发生变化时,更新对应的值
|
|
1197
|
+
* @param event 输入事件对象
|
|
1198
|
+
* @param index 选择项的索引位置
|
|
1199
|
+
* @description 如果选择项已有Value值则不处理,否则将中文文本转换为拼音作为Value值
|
|
1200
|
+
*/
|
|
1267
1201
|
textChange(event, index) {
|
|
1268
1202
|
const SelectOptionsItem = this.SelectOptions.at(index);
|
|
1269
1203
|
const value = event.target.value;
|
|
1270
1204
|
if (SelectOptionsItem.get('Value')?.value)
|
|
1271
1205
|
return;
|
|
1272
1206
|
SelectOptionsItem.patchValue({
|
|
1273
|
-
Value:
|
|
1207
|
+
Value: structuredClone(value),
|
|
1274
1208
|
});
|
|
1275
1209
|
}
|
|
1276
1210
|
/**调整表格位置 */
|
|
@@ -1279,11 +1213,11 @@ class SelectConfigComponent {
|
|
|
1279
1213
|
this.SelectOptions.updateValueAndValidity();
|
|
1280
1214
|
}
|
|
1281
1215
|
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 }); }
|
|
1282
|
-
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]=\"
|
|
1216
|
+
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]=\"formEntity\">\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\" type=\"button\" (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\" required\n (change)=\"textChange($event,i)\"></td>\n <td><input type=\"text\" class=\"form-control\" required 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\" type=\"button\" (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: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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" }] }); }
|
|
1283
1217
|
}
|
|
1284
1218
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectConfigComponent, decorators: [{
|
|
1285
1219
|
type: Component,
|
|
1286
|
-
args: [{ selector: 'df-select-config', template: "<form [formGroup]=\"
|
|
1220
|
+
args: [{ selector: 'df-select-config', template: "<form [formGroup]=\"formEntity\">\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\" type=\"button\" (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\" required\n (change)=\"textChange($event,i)\"></td>\n <td><input type=\"text\" class=\"form-control\" required 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\" type=\"button\" (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>" }]
|
|
1287
1221
|
}], ctorParameters: () => [{ type: i1.FormBuilder }, { type: DfApiService }], propDecorators: { type: [{
|
|
1288
1222
|
type: Input
|
|
1289
1223
|
}], selected: [{
|
|
@@ -1469,6 +1403,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1469
1403
|
args: ['submitclick', { static: true }]
|
|
1470
1404
|
}] } });
|
|
1471
1405
|
|
|
1406
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1472
1407
|
class SelectViewComponent {
|
|
1473
1408
|
constructor() {
|
|
1474
1409
|
/**展示则内容 */
|
|
@@ -1484,7 +1419,7 @@ class SelectViewComponent {
|
|
|
1484
1419
|
async ngAfterContentInit() {
|
|
1485
1420
|
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1486
1421
|
//Add 'implements AfterContentInit' to the class.
|
|
1487
|
-
|
|
1422
|
+
const valueOptions = this._value;
|
|
1488
1423
|
if (this.type && valueOptions) {
|
|
1489
1424
|
if (Array.isArray(valueOptions)) {
|
|
1490
1425
|
this.showValue = valueOptions.join(',');
|
|
@@ -1555,7 +1490,7 @@ const FieldControlGroup = [
|
|
|
1555
1490
|
fieldViewComponent: DateEditViewComponent,
|
|
1556
1491
|
},
|
|
1557
1492
|
];
|
|
1558
|
-
function
|
|
1493
|
+
function addFieldControlGroup(array = []) {
|
|
1559
1494
|
for (const element of array) {
|
|
1560
1495
|
const find = FieldControlGroup.find((control) => {
|
|
1561
1496
|
return control.name === element.name;
|
|
@@ -1569,6 +1504,10 @@ function AddFieldControlGroup(array = []) {
|
|
|
1569
1504
|
|
|
1570
1505
|
/* eslint-disable no-unsafe-optional-chaining */
|
|
1571
1506
|
/* eslint-disable @angular-eslint/component-selector */
|
|
1507
|
+
/**
|
|
1508
|
+
* 丢弃
|
|
1509
|
+
* @deprecated
|
|
1510
|
+
*/
|
|
1572
1511
|
class DynamicComponent {
|
|
1573
1512
|
set selected(v) {
|
|
1574
1513
|
this._selected = v === undefined ? '' : v === null ? '' : v;
|
|
@@ -1600,7 +1539,7 @@ class DynamicComponent {
|
|
|
1600
1539
|
}
|
|
1601
1540
|
/**数据加载完成 */
|
|
1602
1541
|
async dataLoaded(val) {
|
|
1603
|
-
const _fieldControlGroup =
|
|
1542
|
+
const _fieldControlGroup = addFieldControlGroup(this.mergedConfig);
|
|
1604
1543
|
if (this._entity) {
|
|
1605
1544
|
//加载所有的动态表单组件
|
|
1606
1545
|
if (this._type) {
|
|
@@ -1672,15 +1611,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1672
1611
|
args: ['FormComponentsRef', { read: ViewContainerRef, static: true }]
|
|
1673
1612
|
}] } });
|
|
1674
1613
|
|
|
1614
|
+
/**
|
|
1615
|
+
* 表单控件服务
|
|
1616
|
+
* @description 用于获取表单所有控件的配置信息
|
|
1617
|
+
*/
|
|
1675
1618
|
class FormControlService {
|
|
1676
1619
|
constructor(mergedConfig) {
|
|
1677
1620
|
this.mergedConfig = mergedConfig;
|
|
1678
1621
|
this._FieldControlGroup = FieldControlGroup;
|
|
1679
1622
|
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1623
|
+
addFieldControlGroup() {
|
|
1624
|
+
const array = this.mergedConfig;
|
|
1682
1625
|
for (const element of array) {
|
|
1683
|
-
|
|
1626
|
+
const find = FieldControlGroup.find(control => {
|
|
1684
1627
|
return control.name === element.name;
|
|
1685
1628
|
});
|
|
1686
1629
|
if (!find) {
|
|
@@ -1702,6 +1645,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1702
1645
|
args: ['MERGED_FORM_CONFIG']
|
|
1703
1646
|
}] }] });
|
|
1704
1647
|
|
|
1648
|
+
/* eslint-disable no-unsafe-optional-chaining */
|
|
1649
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1705
1650
|
class DynamicViewComponent {
|
|
1706
1651
|
constructor(_FormControlService) {
|
|
1707
1652
|
this._FormControlService = _FormControlService;
|
|
@@ -1718,8 +1663,8 @@ class DynamicViewComponent {
|
|
|
1718
1663
|
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1719
1664
|
//Add 'implements AfterContentInit' to the class.
|
|
1720
1665
|
if (this.type && this._value !== '') {
|
|
1721
|
-
|
|
1722
|
-
|
|
1666
|
+
const _fieldControlGroup = this._FormControlService.addFieldControlGroup();
|
|
1667
|
+
const fieldControlItem = _fieldControlGroup.find(el => el.name === this.type);
|
|
1723
1668
|
this.loadViewComponent(fieldControlItem);
|
|
1724
1669
|
}
|
|
1725
1670
|
}
|
|
@@ -1756,24 +1701,152 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1756
1701
|
args: ['FormTemplateRef', { read: ViewContainerRef, static: true }]
|
|
1757
1702
|
}] } });
|
|
1758
1703
|
|
|
1704
|
+
/* eslint-disable no-unsafe-optional-chaining */
|
|
1705
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1759
1706
|
class DynamicConfigComponent {
|
|
1760
|
-
|
|
1761
|
-
|
|
1707
|
+
constructor(mergedConfig) {
|
|
1708
|
+
this.mergedConfig = mergedConfig;
|
|
1709
|
+
this.formControlName = '';
|
|
1710
|
+
}
|
|
1711
|
+
set type(v) {
|
|
1712
|
+
this.formControlName = v;
|
|
1713
|
+
}
|
|
1714
|
+
set form(v) {
|
|
1715
|
+
this.formEntity = v;
|
|
1716
|
+
}
|
|
1717
|
+
get formControlNameInput() {
|
|
1718
|
+
return this.formEntity.get('formControlName');
|
|
1719
|
+
}
|
|
1720
|
+
ngAfterContentInit() {
|
|
1721
|
+
this.loadfieldConfigComponent(this.formControlName);
|
|
1722
|
+
this.formControlNameInput?.valueChanges.subscribe((res) => {
|
|
1723
|
+
this.loadfieldConfigComponent(res);
|
|
1724
|
+
});
|
|
1725
|
+
}
|
|
1726
|
+
/**加载动态表单配置组件 */
|
|
1727
|
+
loadfieldConfigComponent(formControlName) {
|
|
1728
|
+
const _fieldControlGroup = addFieldControlGroup(this.mergedConfig);
|
|
1729
|
+
const fieldControlItem = _fieldControlGroup.find(el => el.name === formControlName);
|
|
1730
|
+
//清空了容器中的所有组件
|
|
1731
|
+
this.FormconfigRef?.clear();
|
|
1732
|
+
if (!fieldControlItem || !fieldControlItem.fieldConfigComponent)
|
|
1733
|
+
return;
|
|
1734
|
+
//在容器中创建组件
|
|
1735
|
+
const { instance } = this.FormconfigRef?.createComponent(fieldControlItem.fieldConfigComponent); //创建组件模板
|
|
1736
|
+
// /**向创建的组件模板中传值 */
|
|
1737
|
+
instance.selected = this.selected;
|
|
1738
|
+
instance.type = formControlName;
|
|
1739
|
+
instance.Entity = this.formEntity;
|
|
1740
|
+
}
|
|
1741
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, deps: [{ token: 'MERGED_FORM_CONFIG' }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1742
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DynamicConfigComponent, selector: "df-dynamic-config", inputs: { type: "type", selected: "selected", form: "form" }, viewQueries: [{ propertyName: "FormconfigRef", first: true, predicate: ["FormconfigRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: " <template #FormconfigRef></template>", styles: [""] }); }
|
|
1762
1743
|
}
|
|
1763
1744
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, decorators: [{
|
|
1764
1745
|
type: Component,
|
|
1765
|
-
args: [{ selector: 'df-dynamic-config', template: "<
|
|
1766
|
-
}]
|
|
1746
|
+
args: [{ selector: 'df-dynamic-config', template: " <template #FormconfigRef></template>" }]
|
|
1747
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1748
|
+
type: Inject,
|
|
1749
|
+
args: ['MERGED_FORM_CONFIG']
|
|
1750
|
+
}] }], propDecorators: { type: [{
|
|
1751
|
+
type: Input
|
|
1752
|
+
}], selected: [{
|
|
1753
|
+
type: Input
|
|
1754
|
+
}], form: [{
|
|
1755
|
+
type: Input
|
|
1756
|
+
}], FormconfigRef: [{
|
|
1757
|
+
type: ViewChild,
|
|
1758
|
+
args: ['FormconfigRef', { read: ViewContainerRef, static: true }]
|
|
1759
|
+
}] } });
|
|
1767
1760
|
|
|
1761
|
+
/* eslint-disable no-unsafe-optional-chaining */
|
|
1762
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1768
1763
|
class DynamicControlComponent {
|
|
1769
|
-
|
|
1770
|
-
|
|
1764
|
+
set selected(v) {
|
|
1765
|
+
this._selected = v === undefined ? '' : v === null ? '' : v;
|
|
1766
|
+
}
|
|
1767
|
+
set culture(v) {
|
|
1768
|
+
this._culture = v;
|
|
1769
|
+
}
|
|
1770
|
+
set parentFiledName(v) {
|
|
1771
|
+
this._parentFiledName = v;
|
|
1772
|
+
}
|
|
1773
|
+
set fields(v) {
|
|
1774
|
+
this._fields = v;
|
|
1775
|
+
}
|
|
1776
|
+
set entity(v) {
|
|
1777
|
+
if (v) {
|
|
1778
|
+
this._entity = v;
|
|
1779
|
+
// this.dataLoaded(3);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
constructor(mergedConfig) {
|
|
1783
|
+
this.mergedConfig = mergedConfig;
|
|
1784
|
+
/**字段配置列表 */
|
|
1785
|
+
this._fields = '';
|
|
1786
|
+
}
|
|
1787
|
+
ngAfterContentInit() {
|
|
1788
|
+
this.loadfieldComponent(this._fields?.field?.formControlName);
|
|
1789
|
+
}
|
|
1790
|
+
// /**数据加载完成 */
|
|
1791
|
+
// async dataLoaded() {
|
|
1792
|
+
// const _fieldControlGroup: any[] = addFieldControlGroup(this.mergedConfig);
|
|
1793
|
+
// if (this._entity) {
|
|
1794
|
+
// //加载所有的动态表单组件
|
|
1795
|
+
// if (this._fields && this._parentFiledName && this._culture) {
|
|
1796
|
+
// /**表单控件组中的项 */
|
|
1797
|
+
// const fieldControlItem = _fieldControlGroup.find(
|
|
1798
|
+
// el => el.name === this._fields?.field?.formControlName,
|
|
1799
|
+
// );
|
|
1800
|
+
// this.loadfieldComponent(fieldControlItem);
|
|
1801
|
+
// }
|
|
1802
|
+
// }
|
|
1803
|
+
// }
|
|
1804
|
+
/**加载动态表单组件 */
|
|
1805
|
+
loadfieldComponent(formControlName) {
|
|
1806
|
+
const _fieldControlGroup = addFieldControlGroup(this.mergedConfig);
|
|
1807
|
+
/**表单控件组中的项 */
|
|
1808
|
+
const fieldControlItem = _fieldControlGroup.find(el => el.name === formControlName);
|
|
1809
|
+
//清空了容器中的所有组件
|
|
1810
|
+
this.FormComponentsRef?.clear();
|
|
1811
|
+
if (!fieldControlItem || !fieldControlItem.fieldComponent)
|
|
1812
|
+
return;
|
|
1813
|
+
//在容器中创建组件
|
|
1814
|
+
const { instance } = this.FormComponentsRef?.createComponent(fieldControlItem.fieldComponent); //创建组件模板
|
|
1815
|
+
/**向创建的组件模板中传值 */
|
|
1816
|
+
instance.fields = this._fields;
|
|
1817
|
+
instance.parentFiledName = this._parentFiledName;
|
|
1818
|
+
instance.selected = this._selected;
|
|
1819
|
+
instance.culture = this._culture;
|
|
1820
|
+
instance.entity = this._entity;
|
|
1821
|
+
}
|
|
1822
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, deps: [{ token: 'MERGED_FORM_CONFIG' }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1823
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DynamicControlComponent, selector: "df-dynamic-control", inputs: { selected: "selected", 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 #FormComponentsRef></template>", styles: [""] }); }
|
|
1771
1824
|
}
|
|
1772
1825
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, decorators: [{
|
|
1773
1826
|
type: Component,
|
|
1774
|
-
args: [{ selector: 'df-dynamic-control', template: "<
|
|
1775
|
-
}]
|
|
1827
|
+
args: [{ selector: 'df-dynamic-control', template: "<template #FormComponentsRef></template>" }]
|
|
1828
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1829
|
+
type: Inject,
|
|
1830
|
+
args: ['MERGED_FORM_CONFIG']
|
|
1831
|
+
}] }], propDecorators: { selected: [{
|
|
1832
|
+
type: Input
|
|
1833
|
+
}], culture: [{
|
|
1834
|
+
type: Input
|
|
1835
|
+
}], parentFiledName: [{
|
|
1836
|
+
type: Input
|
|
1837
|
+
}], fields: [{
|
|
1838
|
+
type: Input
|
|
1839
|
+
}], entity: [{
|
|
1840
|
+
type: Input
|
|
1841
|
+
}], FormControlRef: [{
|
|
1842
|
+
type: ViewChild,
|
|
1843
|
+
args: ['FormControlRef', { read: ViewContainerRef, static: true }]
|
|
1844
|
+
}], FormComponentsRef: [{
|
|
1845
|
+
type: ViewChild,
|
|
1846
|
+
args: ['FormComponentsRef', { read: ViewContainerRef, static: true }]
|
|
1847
|
+
}] } });
|
|
1776
1848
|
|
|
1849
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1777
1850
|
class DynamicSearchComponent {
|
|
1778
1851
|
constructor(_FormControlService) {
|
|
1779
1852
|
this._FormControlService = _FormControlService;
|
|
@@ -1798,7 +1871,7 @@ class DynamicSearchComponent {
|
|
|
1798
1871
|
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1799
1872
|
//Add 'implements AfterContentInit' to the class.
|
|
1800
1873
|
if (this._fields && this._entity && this._culture) {
|
|
1801
|
-
let _fieldControlGroup = this._FormControlService.
|
|
1874
|
+
let _fieldControlGroup = this._FormControlService.addFieldControlGroup();
|
|
1802
1875
|
let fieldControlItem = _fieldControlGroup.find(el => el.name === this._fields?.field?.formControlName);
|
|
1803
1876
|
this.loadComponent(fieldControlItem);
|
|
1804
1877
|
}
|
|
@@ -1984,5 +2057,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1984
2057
|
* Generated bundle index. Do not edit.
|
|
1985
2058
|
*/
|
|
1986
2059
|
|
|
1987
|
-
export {
|
|
2060
|
+
export { 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, addFieldControlGroup, maxDecimalPlacesValidator };
|
|
1988
2061
|
//# sourceMappingURL=dignite-ng-expand.dynamic-form.mjs.map
|