@dignite-ng/expand.dynamic-form 3.0.0-rc.4 → 3.0.0-rc.41

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.
Files changed (79) hide show
  1. package/README.md +117 -13
  2. package/esm2022/dignite-ng-expand.dynamic-form.mjs +1 -1
  3. package/esm2022/lib/components/dynamic/dynamic-config.component.mjs +11 -0
  4. package/esm2022/lib/components/dynamic/dynamic-control.component.mjs +11 -0
  5. package/esm2022/lib/components/dynamic/dynamic-search.component.mjs +66 -0
  6. package/esm2022/lib/components/dynamic/dynamic-view.component.mjs +58 -0
  7. package/esm2022/lib/components/dynamic/dynamic.component.mjs +10 -9
  8. package/esm2022/lib/components/dynamic/index.mjs +5 -1
  9. package/esm2022/lib/components/form/date-edit/date-edit-config.component.mjs +5 -4
  10. package/esm2022/lib/components/form/date-edit/date-edit-config.mjs +1 -1
  11. package/esm2022/lib/components/form/date-edit/date-edit-control.component.mjs +5 -5
  12. package/esm2022/lib/components/form/date-edit/date-edit-view.component.mjs +40 -0
  13. package/esm2022/lib/components/form/date-edit/index.mjs +2 -1
  14. package/esm2022/lib/components/form/form-control-group.mjs +27 -8
  15. package/esm2022/lib/components/form/index.mjs +1 -1
  16. package/esm2022/lib/components/form/numeric-edit/index.mjs +1 -1
  17. package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.component.mjs +5 -4
  18. package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.mjs +4 -3
  19. package/esm2022/lib/components/form/numeric-edit/numberic-edit-control.component.mjs +24 -16
  20. package/esm2022/lib/components/form/numeric-edit/numeric-edit-search.component.mjs +107 -0
  21. package/esm2022/lib/components/form/numeric-edit/numeric-edit-view.component.mjs +40 -0
  22. package/esm2022/lib/components/form/select/index.mjs +3 -1
  23. package/esm2022/lib/components/form/select/select-config.component.mjs +26 -12
  24. package/esm2022/lib/components/form/select/select-config.mjs +1 -1
  25. package/esm2022/lib/components/form/select/select-control.component.mjs +27 -19
  26. package/esm2022/lib/components/form/select/select-search.component.mjs +94 -0
  27. package/esm2022/lib/components/form/select/select-view.component.mjs +44 -0
  28. package/esm2022/lib/components/form/switch/index.mjs +3 -1
  29. package/esm2022/lib/components/form/switch/switch-config.component.mjs +5 -4
  30. package/esm2022/lib/components/form/switch/switch-config.mjs +1 -1
  31. package/esm2022/lib/components/form/switch/switch-control.component.mjs +5 -5
  32. package/esm2022/lib/components/form/switch/switch-search.component.mjs +79 -0
  33. package/esm2022/lib/components/form/switch/switch-view.component.mjs +40 -0
  34. package/esm2022/lib/components/form/text-edit/index.mjs +3 -1
  35. package/esm2022/lib/components/form/text-edit/text-edit-config.component.mjs +9 -5
  36. package/esm2022/lib/components/form/text-edit/text-edit-config.mjs +1 -1
  37. package/esm2022/lib/components/form/text-edit/text-edit-search.component.mjs +81 -0
  38. package/esm2022/lib/components/form/text-edit/text-edit-view.component.mjs +39 -0
  39. package/esm2022/lib/components/form/text-edit/text-edit.component.mjs +8 -7
  40. package/esm2022/lib/components/index.mjs +1 -1
  41. package/esm2022/lib/dynamic-form.module.mjs +82 -6
  42. package/esm2022/lib/enums/date-edit-interfaces.mjs +1 -1
  43. package/esm2022/lib/enums/text-edit-mode.mjs +1 -1
  44. package/esm2022/lib/interfaces/form-config-interfaces.mjs +1 -1
  45. package/esm2022/lib/interfaces/index.mjs +1 -1
  46. package/esm2022/lib/services/df-api.service.mjs +1 -1
  47. package/esm2022/lib/services/form-control.service.mjs +33 -0
  48. package/esm2022/lib/services/index.mjs +1 -1
  49. package/esm2022/public-api.mjs +1 -1
  50. package/fesm2022/dignite-ng-expand.dynamic-form.mjs +867 -79
  51. package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -1
  52. package/lib/components/dynamic/dynamic-config.component.d.ts +5 -0
  53. package/lib/components/dynamic/dynamic-control.component.d.ts +5 -0
  54. package/lib/components/dynamic/dynamic-search.component.d.ts +28 -0
  55. package/lib/components/dynamic/dynamic-view.component.d.ts +24 -0
  56. package/lib/components/dynamic/dynamic.component.d.ts +1 -1
  57. package/lib/components/dynamic/index.d.ts +4 -0
  58. package/lib/components/form/date-edit/date-edit-view.component.d.ts +17 -0
  59. package/lib/components/form/date-edit/index.d.ts +1 -0
  60. package/lib/components/form/numeric-edit/numberic-edit-control.component.d.ts +2 -1
  61. package/lib/components/form/numeric-edit/numeric-edit-search.component.d.ts +35 -0
  62. package/lib/components/form/numeric-edit/numeric-edit-view.component.d.ts +18 -0
  63. package/lib/components/form/select/index.d.ts +2 -0
  64. package/lib/components/form/select/select-config.component.d.ts +2 -0
  65. package/lib/components/form/select/select-control.component.d.ts +2 -2
  66. package/lib/components/form/select/select-search.component.d.ts +30 -0
  67. package/lib/components/form/select/select-view.component.d.ts +17 -0
  68. package/lib/components/form/switch/index.d.ts +2 -0
  69. package/lib/components/form/switch/switch-control.component.d.ts +1 -1
  70. package/lib/components/form/switch/switch-search.component.d.ts +28 -0
  71. package/lib/components/form/switch/switch-view.component.d.ts +17 -0
  72. package/lib/components/form/text-edit/index.d.ts +2 -0
  73. package/lib/components/form/text-edit/text-edit-config.component.d.ts +2 -0
  74. package/lib/components/form/text-edit/text-edit-search.component.d.ts +30 -0
  75. package/lib/components/form/text-edit/text-edit-view.component.d.ts +17 -0
  76. package/lib/dynamic-form.module.d.ts +21 -5
  77. package/lib/interfaces/form-config-interfaces.d.ts +8 -4
  78. package/lib/services/form-control.service.d.ts +9 -0
  79. package/package.json +11 -9
@@ -1,15 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, Component, Input, ViewChild, ChangeDetectionStrategy, Injectable, ViewContainerRef, Inject, NgModule } from '@angular/core';
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, FormArray, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
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';
8
- import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
8
+ import { NgbDropdownModule, NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap';
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
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';
17
+ import { ExtensibleModule } from '@abp/ng.components/extensible';
13
18
 
14
19
  class TextEditConfig {
15
20
  constructor(data) {
@@ -37,11 +42,14 @@ var TextEditMode;
37
42
  TextEditMode[TextEditMode["MultipleLine"] = 1] = "MultipleLine";
38
43
  })(TextEditMode || (TextEditMode = {}));
39
44
 
45
+ /* eslint-disable @angular-eslint/component-selector */
40
46
  class TextEditConfigComponent {
41
47
  constructor(fb) {
42
48
  this.fb = fb;
43
49
  this._TextEditMode = TextEditMode;
44
50
  this.cdr = inject(ChangeDetectorRef);
51
+ this.RadioIndex1 = Math.floor(Math.random() * 1001);
52
+ this.RadioIndex2 = Math.floor(Math.random() * 1001);
45
53
  }
46
54
  set type(v) {
47
55
  this._type = v;
@@ -62,7 +70,7 @@ class TextEditConfigComponent {
62
70
  if (this._Entity && this._type) {
63
71
  await this.AfterInit();
64
72
  this.cdr.detectChanges(); // 手动触发变更检测
65
- this.submitclick?.nativeElement?.click();
73
+ // this.submitclick?.nativeElement?.click();
66
74
  }
67
75
  }
68
76
  AfterInit() {
@@ -77,11 +85,11 @@ class TextEditConfigComponent {
77
85
  });
78
86
  }
79
87
  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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::TextEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.SingleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::SingleLine' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.MultipleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault2\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::MultipleLine' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::CharLimit' | abpLocalization}}</label>\n <input type=\"number\" class=\"form-control\" formControlName=\"TextEdit.CharLimit\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] }); }
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: "<div [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=\"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\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</div>", styles: [""], dependencies: [{ 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
89
  }
82
90
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditConfigComponent, decorators: [{
83
91
  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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::TextEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.SingleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::SingleLine' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_TextEditMode.MultipleLine\" formControlName=\"TextEdit.Mode\"\n id=\"flexRadioDefault2\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::MultipleLine' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::CharLimit' | abpLocalization}}</label>\n <input type=\"number\" class=\"form-control\" formControlName=\"TextEdit.CharLimit\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
92
+ args: [{ selector: 'df-text-edit-config', template: "<div [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=\"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\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</div>" }]
85
93
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
86
94
  type: Input
87
95
  }], Entity: [{
@@ -93,6 +101,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
93
101
  args: ['submitclick', { static: true }]
94
102
  }] } });
95
103
 
104
+ /* eslint-disable @angular-eslint/component-selector */
96
105
  /* eslint-disable @angular-eslint/no-empty-lifecycle-method */
97
106
  /* eslint-disable @angular-eslint/use-lifecycle-interface */
98
107
  class TextEditComponent {
@@ -134,7 +143,7 @@ class TextEditComponent {
134
143
  }
135
144
  AfterInit() {
136
145
  return new Promise((resolve, rejects) => {
137
- let ValidatorsArray = [];
146
+ const ValidatorsArray = [];
138
147
  if (this._fields.required) {
139
148
  ValidatorsArray.push(Validators.required);
140
149
  }
@@ -145,15 +154,15 @@ class TextEditComponent {
145
154
  if (this._fields.field.formConfiguration['TextEdit.CharLimit']) {
146
155
  ValidatorsArray.push(Validators.maxLength(this._fields.field.formConfiguration['TextEdit.CharLimit']));
147
156
  }
148
- let newControl = this.fb.control(this._selected, ValidatorsArray);
149
- this.extraProperties.setControl(this._fields.field.name, newControl);
157
+ const newControl = this.fb.control(this._selected, ValidatorsArray);
158
+ this.extraProperties?.setControl(this._fields.field.name, newControl);
150
159
  resolve(true);
151
160
  });
152
161
  }
153
162
  ngOnDestroy() {
154
163
  //Called once, before the instance is destroyed.
155
164
  //Add 'implements OnDestroy' to the class.
156
- this.extraProperties.removeControl(this._fields.field.name);
165
+ this.extraProperties?.removeControl(this._fields.field.name);
157
166
  }
158
167
  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
168
  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 +183,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
174
183
  args: ['submitclick', { static: true }]
175
184
  }] } });
176
185
 
186
+ class TextEditViewComponent {
187
+ constructor() {
188
+ /**展示则内容 */
189
+ this.showValue = '';
190
+ /**是否显示再列表 */
191
+ this.showInList = false;
192
+ /**表单控件Value */
193
+ this._value = '';
194
+ }
195
+ set value(v) {
196
+ this._value = v;
197
+ }
198
+ async ngAfterContentInit() {
199
+ //Called after ngOnInit when the component's or directive's content has been initialized.
200
+ //Add 'implements AfterContentInit' to the class.
201
+ let valueOptions = this._value;
202
+ if (this.type && valueOptions) {
203
+ this.showValue = valueOptions;
204
+ }
205
+ }
206
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
207
+ 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"] }] }); }
208
+ }
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditViewComponent, decorators: [{
210
+ type: Component,
211
+ 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}" }]
212
+ }], propDecorators: { showInList: [{
213
+ type: Input
214
+ }], fields: [{
215
+ type: Input
216
+ }], type: [{
217
+ type: Input
218
+ }], value: [{
219
+ type: Input
220
+ }] } });
221
+
222
+ class TextEditSearchComponent {
223
+ constructor(fb) {
224
+ this.fb = fb;
225
+ this._TextEditMode = TextEditMode;
226
+ /**字段配置列表 */
227
+ this._fields = '';
228
+ this.cdr = inject(ChangeDetectorRef);
229
+ this.isObjEmpty = (obj) => Object.keys(obj).length === 0;
230
+ }
231
+ set entity(v) {
232
+ this._entity = v;
233
+ if (v)
234
+ this.dataLoaded();
235
+ }
236
+ set fields(v) {
237
+ this._fields = v;
238
+ if (v)
239
+ this.dataLoaded();
240
+ }
241
+ set parentFiledName(v) {
242
+ this._parentFiledName = v;
243
+ if (v)
244
+ this.dataLoaded();
245
+ }
246
+ set selected(v) {
247
+ this._selected = v || '';
248
+ if (v)
249
+ this.dataLoaded();
250
+ }
251
+ async dataLoaded() {
252
+ if (this._fields && this._entity && this._parentFiledName) {
253
+ this.extraProperties = this._entity.get(this._parentFiledName);
254
+ await this.AfterInit();
255
+ this.cdr.detectChanges(); // 手动触发变更检测
256
+ this.submitclick?.nativeElement?.click();
257
+ }
258
+ }
259
+ AfterInit() {
260
+ return new Promise((resolve, rejects) => {
261
+ let ValidatorsArray = [];
262
+ this._fields.field.formConfiguration = {
263
+ ...this.fb.group(new TextEditConfig()).value,
264
+ ...this._fields.field.formConfiguration
265
+ };
266
+ let newControl = this.fb.control(this._selected, ValidatorsArray);
267
+ this.extraProperties?.setControl(this._fields.field.name, newControl);
268
+ resolve(true);
269
+ });
270
+ }
271
+ ngOnDestroy() {
272
+ //Called once, before the instance is destroyed.
273
+ //Add 'implements OnDestroy' to the class.
274
+ this.extraProperties?.removeControl(this._fields.field.name);
275
+ }
276
+ 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 }); }
277
+ 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"] }] }); }
278
+ }
279
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditSearchComponent, decorators: [{
280
+ type: Component,
281
+ 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>" }]
282
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
283
+ type: Input
284
+ }], fields: [{
285
+ type: Input
286
+ }], parentFiledName: [{
287
+ type: Input
288
+ }], selected: [{
289
+ type: Input
290
+ }], submitclick: [{
291
+ type: ViewChild,
292
+ args: ['submitclick', { static: true }]
293
+ }] } });
294
+
177
295
  class SwitchConfig {
178
296
  constructor(data) {
179
297
  /**默认值 */
@@ -227,11 +345,11 @@ class SwitchConfigComponent {
227
345
  });
228
346
  }
229
347
  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 {{'DigniteAbpForms::DefaultValue' | abpLocalization}}\n </label>\n </div>\n \n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] }); }
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]=\"_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
349
  }
232
350
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchConfigComponent, decorators: [{
233
351
  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 {{'DigniteAbpForms::DefaultValue' | abpLocalization}}\n </label>\n </div>\n \n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\" #submitclick></button>\n </div>\n</form>" }]
352
+ 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
353
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
236
354
  type: Input
237
355
  }], Entity: [{
@@ -299,11 +417,11 @@ class SwitchControlComponent {
299
417
  this.extraProperties.removeControl(this._fields.field.name);
300
418
  }
301
419
  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\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"] }] }); }
420
+ 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
421
  }
304
422
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchControlComponent, decorators: [{
305
423
  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\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
424
+ 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
425
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
308
426
  type: Input
309
427
  }], fields: [{
@@ -317,14 +435,122 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
317
435
  args: ['submitclick', { static: true }]
318
436
  }] } });
319
437
 
438
+ /* eslint-disable @angular-eslint/component-selector */
439
+ class SwitchSearchComponent {
440
+ constructor(fb) {
441
+ this.fb = fb;
442
+ /**字段配置列表 */
443
+ this._fields = '';
444
+ this.cdr = inject(ChangeDetectorRef);
445
+ }
446
+ set entity(v) {
447
+ this._entity = v;
448
+ this.dataLoaded();
449
+ }
450
+ set fields(v) {
451
+ this._fields = v;
452
+ this.dataLoaded();
453
+ }
454
+ set parentFiledName(v) {
455
+ this._parentFiledName = v;
456
+ this.dataLoaded();
457
+ }
458
+ set selected(v) {
459
+ // ?v:false;
460
+ this._selected = v;
461
+ this.dataLoaded();
462
+ }
463
+ get extraProperties() {
464
+ return this._entity.get('extraProperties');
465
+ }
466
+ /**数据加载完成 */
467
+ async dataLoaded() {
468
+ if (this._fields && this._entity) {
469
+ await this.AfterInit();
470
+ this.cdr.detectChanges(); // 手动触发变更检测
471
+ this.submitclick?.nativeElement?.click();
472
+ }
473
+ }
474
+ AfterInit() {
475
+ return new Promise((resolve, rejects) => {
476
+ const ValidatorsArray = [];
477
+ const newControl = this.fb.control(this._selected
478
+ ? this._selected
479
+ : this._selected === false
480
+ ? this._selected
481
+ : '', ValidatorsArray);
482
+ this.extraProperties.setControl(this._fields.field.name, newControl);
483
+ resolve(true);
484
+ });
485
+ }
486
+ ngOnDestroy() {
487
+ //Called once, before the instance is destroyed.
488
+ //Add 'implements OnDestroy' to the class.
489
+ this.extraProperties.removeControl(this._fields.field.name);
490
+ }
491
+ 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 }); }
492
+ 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" }] }); }
493
+ }
494
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchSearchComponent, decorators: [{
495
+ type: Component,
496
+ 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>" }]
497
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
498
+ type: Input
499
+ }], fields: [{
500
+ type: Input
501
+ }], parentFiledName: [{
502
+ type: Input
503
+ }], selected: [{
504
+ type: Input
505
+ }], submitclick: [{
506
+ type: ViewChild,
507
+ args: ['submitclick', { static: true }]
508
+ }] } });
509
+
510
+ class SwitchViewComponent {
511
+ constructor() {
512
+ /**展示则内容 */
513
+ this.showValue = '';
514
+ /**是否显示再列表 */
515
+ this.showInList = false;
516
+ /**表单控件Value */
517
+ this._value = '';
518
+ }
519
+ set value(v) {
520
+ this._value = v;
521
+ }
522
+ async ngAfterContentInit() {
523
+ //Called after ngOnInit when the component's or directive's content has been initialized.
524
+ //Add 'implements AfterContentInit' to the class.
525
+ let valueOptions = this._value;
526
+ if (this.type) {
527
+ this.showValue = valueOptions;
528
+ }
529
+ }
530
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
531
+ 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" }] }); }
532
+ }
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchViewComponent, decorators: [{
534
+ type: Component,
535
+ 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}" }]
536
+ }], propDecorators: { showInList: [{
537
+ type: Input
538
+ }], fields: [{
539
+ type: Input
540
+ }], type: [{
541
+ type: Input
542
+ }], value: [{
543
+ type: Input
544
+ }] } });
545
+
320
546
  class NumbericEditConfig {
321
547
  constructor(data) {
322
548
  /**占位符 */
323
549
  this['NumericEditField.Placeholder'] = ['', []];
324
550
  /**最小值 */
325
- this['NumericEditField.Min'] = ['', []];
551
+ this['NumericEditField.Min'] = ['', [Validators.required]];
326
552
  //最大值
327
- this['NumericEditField.Max'] = ['', []];
553
+ this['NumericEditField.Max'] = ['', [Validators.required]];
328
554
  // 小数位数
329
555
  this['NumericEditField.Decimals'] = [2, []];
330
556
  //步长
@@ -379,11 +605,11 @@ class NumbericEditConfigComponent {
379
605
  });
380
606
  }
381
607
  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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::NumericStep' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Step\">\n <small class=\"form-text text-muted d-block\">{{'DigniteAbpForms::NumericStepHelp'|abpLocalization}}</small>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::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" }] }); }
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]=\"_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
609
  }
384
610
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditConfigComponent, decorators: [{
385
611
  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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::NumericStep' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"NumericEditField.Step\">\n <small class=\"form-text text-muted d-block\">{{'DigniteAbpForms::NumericStepHelp'|abpLocalization}}</small>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::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>" }]
612
+ 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
613
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
388
614
  type: Input
389
615
  }], selected: [{
@@ -395,13 +621,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
395
621
  args: ['submitclick', { static: false }]
396
622
  }] } });
397
623
 
624
+ /* eslint-disable @angular-eslint/component-selector */
625
+ /* eslint-disable @typescript-eslint/adjacent-overload-signatures */
398
626
  function maxDecimalPlacesValidator(maxDecimalPlaces) {
399
627
  return (control) => {
400
628
  const value = control.value;
401
629
  if (typeof value === 'number' && isNaN(value) === false) {
402
630
  const decimalPart = value.toString().split('.')[1];
403
631
  if (decimalPart && decimalPart.length > maxDecimalPlaces) {
404
- return { 'maxDecimalPlaces': { actual: decimalPart.length, max: maxDecimalPlaces } };
632
+ return { maxDecimalPlaces: { actual: decimalPart.length, max: maxDecimalPlaces } };
405
633
  }
406
634
  }
407
635
  return null;
@@ -413,6 +641,7 @@ class NumbericEditControlComponent {
413
641
  this.cdr = cdr;
414
642
  /**字段配置列表 */
415
643
  this._fields = '';
644
+ this.formConfiguration = '';
416
645
  }
417
646
  get entity() {
418
647
  return this._entity;
@@ -425,16 +654,18 @@ class NumbericEditControlComponent {
425
654
  }
426
655
  set selected(v) {
427
656
  this._selected = v;
428
- //
657
+ //
429
658
  }
430
659
  set entity(v) {
431
660
  this._entity = v;
432
661
  this.dataLoaded();
433
662
  }
434
663
  get extraProperties() {
435
- return this._entity.get('extraProperties');
664
+ return this._entity?.get('extraProperties');
665
+ }
666
+ get fieldInput() {
667
+ return this.extraProperties.get(this._fields.field.name);
436
668
  }
437
- get fieldInput() { return this.extraProperties.get(this._fields.field.name); }
438
669
  /**数据加载完成 */
439
670
  async dataLoaded() {
440
671
  if (this._fields && this._entity) {
@@ -445,8 +676,9 @@ class NumbericEditControlComponent {
445
676
  }
446
677
  AfterInit() {
447
678
  return new Promise((resolve, rejects) => {
448
- let ValidatorsArray = [];
449
- let formConfiguration = this._fields.field.formConfiguration;
679
+ const ValidatorsArray = [];
680
+ const formConfiguration = this._fields.field.formConfiguration;
681
+ this.formConfiguration = formConfiguration;
450
682
  if (this._fields.required) {
451
683
  ValidatorsArray.push(Validators.required);
452
684
  }
@@ -456,7 +688,7 @@ class NumbericEditControlComponent {
456
688
  if (formConfiguration['NumericEditField.Max']) {
457
689
  ValidatorsArray.push(Validators.max(formConfiguration['NumericEditField.Max']));
458
690
  }
459
- let newControl = this.fb.control(this._selected, ValidatorsArray);
691
+ const newControl = this.fb.control(this._selected, ValidatorsArray);
460
692
  this.extraProperties.setControl(this._fields.field.name, newControl);
461
693
  resolve(true);
462
694
  });
@@ -468,20 +700,22 @@ class NumbericEditControlComponent {
468
700
  }
469
701
  /**数字框输入 */
470
702
  inputchange(event) {
471
- let val = event.target.value;
703
+ const val = event.target.value;
472
704
  const decimalPart = val.toString().split('.')[1] || '';
473
- let formConfiguration = this._fields.field.formConfiguration;
474
- let Decimals = formConfiguration['NumericEditField.Decimals'];
705
+ const formConfiguration = this._fields.field.formConfiguration;
706
+ const Decimals = formConfiguration['NumericEditField.Decimals'];
475
707
  if (decimalPart.length > Decimals) {
476
- this.fieldInput.patchValue(val.slice(0, val.length - (decimalPart.length - 2)).toString());
708
+ this.fieldInput?.patchValue(val.slice(0, val.length - (decimalPart.length - 2)));
477
709
  }
710
+ this.extraProperties.updateValueAndValidity();
711
+ this.fieldInput.updateValueAndValidity();
478
712
  }
479
713
  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 }); }
480
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: NumbericEditControlComponent, selector: "df-numberic-edit-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]=\"_parentFiledName\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <input type=\"number\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['NumericEditField.Placeholder']||''\"\n [step]=\"_fields.field.formConfiguration['NumericEditField.Step']\" (input)=\"inputchange($event)\" />\n <small class=\"form-text text-muted d-block\" *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.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: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
714
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: NumbericEditControlComponent, selector: "df-numberic-edit-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]=\"_parentFiledName\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <input type=\"number\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['NumericEditField.Placeholder']||''\"\n [step]=\"_fields.field.formConfiguration['NumericEditField.Step']\" [min]=\"formConfiguration['NumericEditField.Min']\" [max]=\"formConfiguration['NumericEditField.Max']\" (input)=\"inputchange($event)\" />\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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
481
715
  }
482
716
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditControlComponent, decorators: [{
483
717
  type: Component,
484
- args: [{ selector: 'df-numberic-edit-control', changeDetection: ChangeDetectionStrategy.OnPush, 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 <input type=\"number\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['NumericEditField.Placeholder']||''\"\n [step]=\"_fields.field.formConfiguration['NumericEditField.Step']\" (input)=\"inputchange($event)\" />\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
718
+ args: [{ selector: 'df-numberic-edit-control', changeDetection: ChangeDetectionStrategy.OnPush, 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 <input type=\"number\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['NumericEditField.Placeholder']||''\"\n [step]=\"_fields.field.formConfiguration['NumericEditField.Step']\" [min]=\"formConfiguration['NumericEditField.Min']\" [max]=\"formConfiguration['NumericEditField.Max']\" (input)=\"inputchange($event)\" />\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>" }]
485
719
  }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }], propDecorators: { fields: [{
486
720
  type: Input
487
721
  }], parentFiledName: [{
@@ -588,11 +822,11 @@ class DateEditConfigComponent {
588
822
  });
589
823
  }
590
824
  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\">{{'DigniteAbpForms::DateEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Date\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault1\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::Date' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.DateTime\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault2\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::DateTime' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Month\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault3\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault3\">\n {{'DigniteAbpForms::Month' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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" }] }); }
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]=\"_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
826
  }
593
827
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditConfigComponent, decorators: [{
594
828
  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\">{{'DigniteAbpForms::DateEditMode' | abpLocalization}}</label>\n <div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Date\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault1\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpForms::Date' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.DateTime\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault2\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault2\">\n {{'DigniteAbpForms::DateTime' | abpLocalization}}\n </label>\n </div>\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"_DateEditInterfaces.Month\"\n formControlName=\"DateEdit.InputMode\" id=\"flexRadioDefault3\" (change)=\"timeTypeChange()\">\n <label class=\"form-check-label\" for=\"flexRadioDefault3\">\n {{'DigniteAbpForms::Month' | abpLocalization}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::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\">{{'DigniteAbpForms::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>" }]
829
+ 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
830
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
597
831
  type: Input
598
832
  }], selected: [{
@@ -677,11 +911,11 @@ class DateEditControlComponent {
677
911
  this.extraProperties.removeControl(this._fields.field.name);
678
912
  }
679
913
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditControlComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
680
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DateEditControlComponent, selector: "df-date-edit-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]=\"_parentFiledName\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Date\">\n <input type=\"date\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container\n *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.DateTime\">\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Month\">\n <input type=\"month\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <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"] }] }); }
914
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: DateEditControlComponent, selector: "df-date-edit-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]=\"_parentFiledName\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Date\">\n <input type=\"date\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container\n *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.DateTime\">\n <input type=\"datetime-local\" #dateTime (focus)=\"dateTime.focus()\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Month\">\n <input type=\"month\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <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"] }] }); }
681
915
  }
682
916
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditControlComponent, decorators: [{
683
917
  type: Component,
684
- args: [{ selector: 'df-date-edit-control', 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\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Date\">\n <input type=\"date\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container\n *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.DateTime\">\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Month\">\n <input type=\"month\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <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>" }]
918
+ args: [{ selector: 'df-date-edit-control', 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\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Date\">\n <input type=\"date\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container\n *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.DateTime\">\n <input type=\"datetime-local\" #dateTime (focus)=\"dateTime.focus()\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Month\">\n <input type=\"month\" class=\"form-control\" step=\"1\" formControlName=\"{{_fields.field.name}}\"\n [min]=\"_fields.field.formConfiguration['DateEdit.Min']\"\n [max]=\"_fields.field.formConfiguration['DateEdit.Max']\" />\n </ng-container>\n <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>" }]
685
919
  }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }], propDecorators: { fields: [{
686
920
  type: Input
687
921
  }], parentFiledName: [{
@@ -695,6 +929,180 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
695
929
  args: ['submitclick', { static: true }]
696
930
  }] } });
697
931
 
932
+ class DateEditViewComponent {
933
+ constructor() {
934
+ /**展示则内容 */
935
+ this.showValue = '';
936
+ /**是否显示再列表 */
937
+ this.showInList = false;
938
+ /**表单控件Value */
939
+ this._value = '';
940
+ }
941
+ set value(v) {
942
+ this._value = v;
943
+ }
944
+ async ngAfterContentInit() {
945
+ //Called after ngOnInit when the component's or directive's content has been initialized.
946
+ //Add 'implements AfterContentInit' to the class.
947
+ let valueOptions = this._value;
948
+ if (this.type && valueOptions) {
949
+ this.showValue = valueOptions;
950
+ }
951
+ }
952
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
953
+ 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" }] }); }
954
+ }
955
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditViewComponent, decorators: [{
956
+ type: Component,
957
+ 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}" }]
958
+ }], propDecorators: { showInList: [{
959
+ type: Input
960
+ }], fields: [{
961
+ type: Input
962
+ }], type: [{
963
+ type: Input
964
+ }], value: [{
965
+ type: Input
966
+ }] } });
967
+
968
+ /* eslint-disable @angular-eslint/component-selector */
969
+ class NumericEditSearchComponent {
970
+ constructor(fb) {
971
+ this.fb = fb;
972
+ /**字段配置列表 */
973
+ this._fields = '';
974
+ this.cdr = inject(ChangeDetectorRef);
975
+ /**定义number表单用于获取最小值最大值 */
976
+ this.numberForm = new FormGroup({
977
+ min: new FormControl(''),
978
+ max: new FormControl(''),
979
+ });
980
+ this.formConfiguration = '';
981
+ }
982
+ set fields(v) {
983
+ this._fields = v;
984
+ }
985
+ set parentFiledName(v) {
986
+ this._parentFiledName = v;
987
+ }
988
+ set selected(v) {
989
+ this._selected = v;
990
+ }
991
+ set entity(v) {
992
+ this._entity = v;
993
+ this.dataLoaded();
994
+ }
995
+ get extraProperties() {
996
+ return this._entity?.get('extraProperties');
997
+ }
998
+ /**数据加载完成 */
999
+ async dataLoaded() {
1000
+ if (this._fields && this._entity) {
1001
+ await this.AfterInit();
1002
+ this.cdr.detectChanges(); // 手动触发变更检测
1003
+ this.submitclick?.nativeElement?.click();
1004
+ }
1005
+ }
1006
+ /**定义动态字符 */
1007
+ get numberInput() {
1008
+ return this.extraProperties.get(this._fields.field.name);
1009
+ }
1010
+ get minInput() {
1011
+ return this.numberForm.get('min');
1012
+ }
1013
+ get maxInput() {
1014
+ return this.numberForm.get('max');
1015
+ }
1016
+ AfterInit() {
1017
+ return new Promise(resolve => {
1018
+ const ValidatorsArray = [];
1019
+ this.formConfiguration = this._fields.field.formConfiguration;
1020
+ const newControl = this.fb.control(this._selected, ValidatorsArray);
1021
+ this.extraProperties.setControl(this._fields.field.name, newControl);
1022
+ this.numberForm.valueChanges.subscribe(res => {
1023
+ if (res.min < Number(this.formConfiguration['NumericEditField.Min'])) {
1024
+ this.minInput.patchValue(this.formConfiguration['NumericEditField.Min']);
1025
+ }
1026
+ if (res.min > Number(this.formConfiguration['NumericEditField.Max'])) {
1027
+ this.minInput.patchValue(this.formConfiguration['NumericEditField.Max']);
1028
+ }
1029
+ if ((res.min > res.max) && res.max) {
1030
+ this.minInput.patchValue(res.max);
1031
+ }
1032
+ if (res.max > Number(this.formConfiguration['NumericEditField.Max'])) {
1033
+ this.maxInput.patchValue(this.formConfiguration['NumericEditField.Max']);
1034
+ }
1035
+ if (this.numberForm.valid && res.min && res.max) {
1036
+ this.numberInput.patchValue(`${res.min}-${res.max}`);
1037
+ }
1038
+ else {
1039
+ this.numberInput.patchValue('');
1040
+ }
1041
+ });
1042
+ resolve(true);
1043
+ });
1044
+ }
1045
+ ngOnDestroy() {
1046
+ //Called once, before the instance is destroyed.
1047
+ //Add 'implements OnDestroy' to the class.
1048
+ this.extraProperties.removeControl(this._fields.field.name);
1049
+ }
1050
+ 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 }); }
1051
+ 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"] }] }); }
1052
+ }
1053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditSearchComponent, decorators: [{
1054
+ type: Component,
1055
+ 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>" }]
1056
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { fields: [{
1057
+ type: Input
1058
+ }], parentFiledName: [{
1059
+ type: Input
1060
+ }], selected: [{
1061
+ type: Input
1062
+ }], entity: [{
1063
+ type: Input
1064
+ }], submitclick: [{
1065
+ type: ViewChild,
1066
+ args: ['submitclick', { static: true }]
1067
+ }] } });
1068
+
1069
+ /* eslint-disable @angular-eslint/component-selector */
1070
+ class NumericEditViewComponent {
1071
+ constructor() {
1072
+ /**展示则内容 */
1073
+ this.showValue = '';
1074
+ /**是否显示再列表 */
1075
+ this.showInList = false;
1076
+ /**表单控件Value */
1077
+ this._value = '';
1078
+ }
1079
+ set value(v) {
1080
+ this._value = v;
1081
+ }
1082
+ async ngAfterContentInit() {
1083
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1084
+ //Add 'implements AfterContentInit' to the class.
1085
+ const valueOptions = this._value;
1086
+ if (this.type && valueOptions) {
1087
+ this.showValue = valueOptions;
1088
+ }
1089
+ }
1090
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1091
+ 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"] }] }); }
1092
+ }
1093
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditViewComponent, decorators: [{
1094
+ type: Component,
1095
+ 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}" }]
1096
+ }], propDecorators: { showInList: [{
1097
+ type: Input
1098
+ }], fields: [{
1099
+ type: Input
1100
+ }], type: [{
1101
+ type: Input
1102
+ }], value: [{
1103
+ type: Input
1104
+ }] } });
1105
+
698
1106
  class SelectConfig {
699
1107
  constructor(data) {
700
1108
  /**空值文本 */
@@ -792,6 +1200,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
792
1200
  }]
793
1201
  }], ctorParameters: () => [] });
794
1202
 
1203
+ /* eslint-disable @angular-eslint/component-selector */
795
1204
  class SelectConfigComponent {
796
1205
  constructor(fb, _DfApiService) {
797
1206
  this.fb = fb;
@@ -809,7 +1218,7 @@ class SelectConfigComponent {
809
1218
  this.dataLoaded();
810
1219
  }
811
1220
  get formConfiguration() {
812
- return this._Entity.get('formConfiguration');
1221
+ return this._Entity?.get('formConfiguration');
813
1222
  }
814
1223
  get SelectOptions() {
815
1224
  return this.formConfiguration.controls['Select.Options'];
@@ -835,11 +1244,16 @@ class SelectConfigComponent {
835
1244
  }
836
1245
  AfterInit() {
837
1246
  return new Promise((resolve, rejects) => {
838
- this._Entity.setControl('formConfiguration', this.fb.group(new SelectConfig()));
1247
+ this._Entity?.setControl('formConfiguration', this.fb.group(new SelectConfig()));
839
1248
  if (this._selected && this._selected.formControlName == this._type) {
840
- this._selected.formConfiguration['Select.Options']?.forEach(el => {
1249
+ for (const element of this._selected.formConfiguration['Select.Options']) {
1250
+ for (const key in element) {
1251
+ const item = element[key];
1252
+ const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1);
1253
+ element[capitalizedKey] = item;
1254
+ }
841
1255
  this.addSelectOptions();
842
- });
1256
+ }
843
1257
  this.formConfiguration.patchValue({
844
1258
  ...this._selected.formConfiguration,
845
1259
  });
@@ -851,20 +1265,25 @@ class SelectConfigComponent {
851
1265
  });
852
1266
  }
853
1267
  textChange(event, index) {
854
- let SelectOptionsItem = this.SelectOptions.at(index);
855
- let value = event.target.value;
856
- if (SelectOptionsItem.get('Value').value)
1268
+ const SelectOptionsItem = this.SelectOptions.at(index);
1269
+ const value = event.target.value;
1270
+ if (SelectOptionsItem.get('Value')?.value)
857
1271
  return;
858
1272
  SelectOptionsItem.patchValue({
859
1273
  Value: this._DfApiService.chineseToPinyin(value),
860
1274
  });
861
1275
  }
1276
+ /**调整表格位置 */
1277
+ drop(event) {
1278
+ moveItemInArray(this.SelectOptions.controls, event.previousIndex, event.currentIndex);
1279
+ this.SelectOptions.updateValueAndValidity();
1280
+ }
862
1281
  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\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemText' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::Selected' | abpLocalization}}</th>\n <th scope=\"col\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addSelectOptions()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"Select.Options\">\n <ng-container *ngFor=\"let item of SelectOptions.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"Text\" (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\" id=\"selected\">\n </div>\n </td>\n <td scope=\"row\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"deleteSelectOptions(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </td>\n </tr> \n </ng-container>\n \n \n </tbody>\n </table>\n </div>\n\n\n\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::NullText' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Select.NullText\">\n </div>\n <div class=\"mb-3\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Select.Multiple\"\n id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'DigniteAbpForms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i2.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i2.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i2.LocalizationPipe, name: "abpLocalization" }] }); }
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]=\"_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\" 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\"\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\" 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: 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
1283
  }
865
1284
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectConfigComponent, decorators: [{
866
1285
  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\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemText' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::SelectListItemValue' | abpLocalization}}</th>\n <th scope=\"col\">{{'DigniteAbpForms::Selected' | abpLocalization}}</th>\n <th scope=\"col\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addSelectOptions()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"Select.Options\">\n <ng-container *ngFor=\"let item of SelectOptions.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"Text\" (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\" id=\"selected\">\n </div>\n </td>\n <td scope=\"row\" style=\"width: 1%;\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"deleteSelectOptions(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </td>\n </tr> \n </ng-container>\n \n \n </tbody>\n </table>\n </div>\n\n\n\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpForms::NullText' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Select.NullText\">\n </div>\n <div class=\"mb-3\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Select.Multiple\"\n id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'DigniteAbpForms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
1286
+ 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\" 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\"\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\" 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>" }]
868
1287
  }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: DfApiService }], propDecorators: { type: [{
869
1288
  type: Input
870
1289
  }], selected: [{
@@ -876,11 +1295,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
876
1295
  args: ['submitclick', { static: true }]
877
1296
  }] } });
878
1297
 
1298
+ /* eslint-disable @angular-eslint/component-selector */
879
1299
  class SelectControlComponent {
880
1300
  constructor(fb) {
881
1301
  this.fb = fb;
882
1302
  /**字段配置列表 */
883
1303
  this._fields = '';
1304
+ /**父级字段名称,用于为表单设置控件赋值 */
1305
+ this._selected = [];
884
1306
  this.cdr = inject(ChangeDetectorRef);
885
1307
  this.formConfiguration = '';
886
1308
  }
@@ -891,14 +1313,14 @@ class SelectControlComponent {
891
1313
  this._parentFiledName = v;
892
1314
  }
893
1315
  set selected(v) {
894
- this._selected = v;
1316
+ this._selected = v || [];
895
1317
  }
896
1318
  set entity(v) {
897
1319
  this._entity = v;
898
1320
  this.dataLoaded();
899
1321
  }
900
1322
  get extraProperties() {
901
- return this._entity.get('extraProperties');
1323
+ return this._entity?.get('extraProperties');
902
1324
  }
903
1325
  /**数据加载完成 */
904
1326
  async dataLoaded() {
@@ -910,24 +1332,28 @@ class SelectControlComponent {
910
1332
  }
911
1333
  AfterInit() {
912
1334
  return new Promise((resolve, rejects) => {
913
- let ValidatorsArray = [];
1335
+ const ValidatorsArray = [];
914
1336
  if (this._fields.required) {
915
1337
  ValidatorsArray.push(Validators.required);
916
1338
  }
917
1339
  this.formConfiguration = this._fields.field.formConfiguration;
918
- if (!this._selected) {
919
- const isMultiple = this.formConfiguration['Select.Multiple'];
920
- let selectValue = isMultiple ? [] : '';
921
- this.formConfiguration['Select.Options'].forEach(el => {
922
- if (el.Selected) {
923
- selectValue = isMultiple
924
- ? [...selectValue, el.value || el.Value]
925
- : [el.value || el.Value];
1340
+ const isMultiple = this.formConfiguration['Select.Multiple'];
1341
+ let selectValue = isMultiple ? [] : [];
1342
+ for (const element of this.formConfiguration['Select.Options']) {
1343
+ for (const key in element) {
1344
+ const item = element[key];
1345
+ const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1);
1346
+ element[capitalizedKey] = item;
1347
+ }
1348
+ if (!this._selected) {
1349
+ if (Array.isArray(this._selected) && element.Selected && this._selected.length === 0) {
1350
+ selectValue = isMultiple ? [...selectValue, element.Value] : [element.Value];
1351
+ this._selected = selectValue;
926
1352
  }
927
- });
928
- this._selected = selectValue;
1353
+ }
929
1354
  }
930
- let newControl = this.fb.control(this._selected, ValidatorsArray);
1355
+ // this._selected = selectValue;
1356
+ const newControl = this.fb.control(this._selected, ValidatorsArray);
931
1357
  this.extraProperties.setControl(this._fields.field.name, newControl);
932
1358
  resolve(true);
933
1359
  });
@@ -938,11 +1364,98 @@ class SelectControlComponent {
938
1364
  this.extraProperties.removeControl(this._fields.field.name);
939
1365
  }
940
1366
  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\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\n <select class=\"form-select\" multiple formControlName=\"{{_fields.field.name}}\">\n <ng-container *ngFor=\"let item of _fields.field.formConfiguration['Select.Options'];let i =index\">\n <option [value]=\"item.Value\">{{item.Text}}</option>\n </ng-container>\n </select>\n </ng-container>\n <ng-template #elseTemplate>\n <select class=\"form-select\" [multiple]=\"false\"\n formControlName=\"{{_fields.field.name}}\">\n <option>{{formConfiguration['Select.NullText']}}</option>\n <ng-container *ngFor=\"let item of _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\" *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"] }] }); }
1367
+ 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
1368
  }
943
1369
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectControlComponent, decorators: [{
944
1370
  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\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"formConfiguration['Select.Multiple']; else elseTemplate\">\n <select class=\"form-select\" multiple formControlName=\"{{_fields.field.name}}\">\n <ng-container *ngFor=\"let item of _fields.field.formConfiguration['Select.Options'];let i =index\">\n <option [value]=\"item.Value\">{{item.Text}}</option>\n </ng-container>\n </select>\n </ng-container>\n <ng-template #elseTemplate>\n <select class=\"form-select\" [multiple]=\"false\"\n formControlName=\"{{_fields.field.name}}\">\n <option>{{formConfiguration['Select.NullText']}}</option>\n <ng-container *ngFor=\"let item of _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\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
1371
+ 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>" }]
1372
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { fields: [{
1373
+ type: Input
1374
+ }], parentFiledName: [{
1375
+ type: Input
1376
+ }], selected: [{
1377
+ type: Input
1378
+ }], entity: [{
1379
+ type: Input
1380
+ }], submitclick: [{
1381
+ type: ViewChild,
1382
+ args: ['submitclick', { static: true }]
1383
+ }] } });
1384
+
1385
+ /* eslint-disable @angular-eslint/component-selector */
1386
+ class SelectSearchComponent {
1387
+ constructor(fb) {
1388
+ this.fb = fb;
1389
+ /**字段配置列表 */
1390
+ this._fields = '';
1391
+ this.cdr = inject(ChangeDetectorRef);
1392
+ this.formConfiguration = '';
1393
+ }
1394
+ set fields(v) {
1395
+ this._fields = v;
1396
+ }
1397
+ set parentFiledName(v) {
1398
+ this._parentFiledName = v;
1399
+ }
1400
+ set selected(v) {
1401
+ this._selected = v;
1402
+ }
1403
+ set entity(v) {
1404
+ this._entity = v;
1405
+ this.dataLoaded();
1406
+ }
1407
+ get extraProperties() {
1408
+ return this._entity?.get('extraProperties');
1409
+ }
1410
+ /**数据加载完成 */
1411
+ async dataLoaded() {
1412
+ if (this._fields && this._entity) {
1413
+ await this.AfterInit();
1414
+ this.cdr.detectChanges(); // 手动触发变更检测
1415
+ this.submitclick?.nativeElement?.click();
1416
+ }
1417
+ }
1418
+ AfterInit() {
1419
+ return new Promise((resolve, rejects) => {
1420
+ const ValidatorsArray = [];
1421
+ this.formConfiguration = this._fields.field.formConfiguration;
1422
+ const isMultiple = this.formConfiguration['Select.Multiple'];
1423
+ const selectValue = isMultiple ? [] : [];
1424
+ for (const element of this.formConfiguration['Select.Options']) {
1425
+ for (const key in element) {
1426
+ const item = element[key];
1427
+ const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1);
1428
+ element[capitalizedKey] = item;
1429
+ }
1430
+ // if (this._selected) {
1431
+ // if (Array.isArray(this._selected) && element.Selected && this._selected.length === 0) {
1432
+ // selectValue = isMultiple ? [...selectValue, element.Value] : [element.Value];
1433
+ // }
1434
+ // }
1435
+ }
1436
+ this._selected = selectValue;
1437
+ const newControl = this.fb.control(this._selected, ValidatorsArray);
1438
+ this.extraProperties.setControl(this._fields.field.name, newControl);
1439
+ resolve(true);
1440
+ });
1441
+ }
1442
+ changeValue(event) {
1443
+ const selectvalue = this.extraProperties.get(this._fields.field.name).value;
1444
+ if (selectvalue[0] === '') {
1445
+ this.extraProperties.get(this._fields.field.name).setValue([]);
1446
+ }
1447
+ }
1448
+ ngOnDestroy() {
1449
+ //Called once, before the instance is destroyed.
1450
+ //Add 'implements OnDestroy' to the class.
1451
+ this.extraProperties.removeControl(this._fields.field.name);
1452
+ }
1453
+ 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 }); }
1454
+ 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"] }] }); }
1455
+ }
1456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectSearchComponent, decorators: [{
1457
+ type: Component,
1458
+ 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
1459
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { fields: [{
947
1460
  type: Input
948
1461
  }], parentFiledName: [{
@@ -956,6 +1469,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
956
1469
  args: ['submitclick', { static: true }]
957
1470
  }] } });
958
1471
 
1472
+ class SelectViewComponent {
1473
+ constructor() {
1474
+ /**展示则内容 */
1475
+ this.showValue = '';
1476
+ /**是否显示再列表 */
1477
+ this.showInList = false;
1478
+ /**表单控件Value */
1479
+ this._value = '';
1480
+ }
1481
+ set value(v) {
1482
+ this._value = v;
1483
+ }
1484
+ async ngAfterContentInit() {
1485
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1486
+ //Add 'implements AfterContentInit' to the class.
1487
+ let valueOptions = this._value;
1488
+ if (this.type && valueOptions) {
1489
+ if (Array.isArray(valueOptions)) {
1490
+ this.showValue = valueOptions.join(',');
1491
+ }
1492
+ else {
1493
+ this.showValue = valueOptions;
1494
+ }
1495
+ }
1496
+ }
1497
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1498
+ 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"] }] }); }
1499
+ }
1500
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectViewComponent, decorators: [{
1501
+ type: Component,
1502
+ 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}" }]
1503
+ }], propDecorators: { showInList: [{
1504
+ type: Input
1505
+ }], fields: [{
1506
+ type: Input
1507
+ }], type: [{
1508
+ type: Input
1509
+ }], value: [{
1510
+ type: Input
1511
+ }] } });
1512
+
959
1513
  // import { CkEditorConfigComponent, CkEditorControlComponent } from "./ck-editor";
960
1514
  /**
961
1515
  * 表单控件分组-包含配置,控件,显示的数组
@@ -966,42 +1520,55 @@ const FieldControlGroup = [
966
1520
  name: 'TextEdit',
967
1521
  fieldConfigComponent: TextEditConfigComponent,
968
1522
  fieldComponent: TextEditComponent,
969
- // fieldViewComponent:TextBoxViewComponent,
1523
+ fieldViewComponent: TextEditViewComponent,
1524
+ fieldSearchComponent: TextEditSearchComponent,
970
1525
  },
971
1526
  {
972
1527
  displayName: '开关',
973
1528
  name: 'Switch',
974
1529
  fieldConfigComponent: SwitchConfigComponent,
975
1530
  fieldComponent: SwitchControlComponent,
976
- // fieldViewComponent:TextBoxViewComponent,
1531
+ fieldViewComponent: SwitchViewComponent,
1532
+ fieldSearchComponent: SwitchSearchComponent,
977
1533
  },
978
1534
  {
979
1535
  displayName: '选择',
980
1536
  name: 'Select',
981
1537
  fieldConfigComponent: SelectConfigComponent,
982
1538
  fieldComponent: SelectControlComponent,
983
- // fieldViewComponent:TextBoxViewComponent,
1539
+ fieldViewComponent: SelectViewComponent,
1540
+ fieldSearchComponent: SelectSearchComponent,
984
1541
  },
985
1542
  {
986
1543
  displayName: '数字',
987
1544
  name: 'NumericEdit',
988
1545
  fieldConfigComponent: NumbericEditConfigComponent,
989
1546
  fieldComponent: NumbericEditControlComponent,
990
- // fieldViewComponent:TextBoxViewComponent,
1547
+ fieldViewComponent: NumericEditViewComponent,
1548
+ fieldSearchComponent: NumericEditSearchComponent,
991
1549
  },
992
1550
  {
993
1551
  displayName: '日期',
994
1552
  name: 'DateEdit',
995
1553
  fieldConfigComponent: DateEditConfigComponent,
996
1554
  fieldComponent: DateEditControlComponent,
997
- // fieldViewComponent:TextBoxViewComponent,
1555
+ fieldViewComponent: DateEditViewComponent,
998
1556
  },
999
1557
  ];
1000
1558
  function AddFieldControlGroup(array = []) {
1001
- FieldControlGroup.push(...array);
1559
+ for (const element of array) {
1560
+ const find = FieldControlGroup.find((control) => {
1561
+ return control.name === element.name;
1562
+ });
1563
+ if (!find) {
1564
+ FieldControlGroup.push(element);
1565
+ }
1566
+ }
1002
1567
  return FieldControlGroup;
1003
1568
  }
1004
1569
 
1570
+ /* eslint-disable no-unsafe-optional-chaining */
1571
+ /* eslint-disable @angular-eslint/component-selector */
1005
1572
  class DynamicComponent {
1006
1573
  set selected(v) {
1007
1574
  this._selected = v === undefined ? '' : v === null ? '' : v;
@@ -1033,19 +1600,16 @@ class DynamicComponent {
1033
1600
  }
1034
1601
  /**数据加载完成 */
1035
1602
  async dataLoaded(val) {
1036
- // let _fieldControlGroup:any[] = FieldControlGroup;
1037
- let _fieldControlGroup = AddFieldControlGroup(this.mergedConfig);
1038
- console.log(this.mergedConfig, 'mergedConfig', _fieldControlGroup);
1039
- // let _fieldControlGroup:any[] = new Array(...await getExcludeAssignControl());
1603
+ const _fieldControlGroup = AddFieldControlGroup(this.mergedConfig);
1040
1604
  if (this._entity) {
1041
1605
  //加载所有的动态表单组件
1042
1606
  if (this._type) {
1043
- let fieldControlItem = _fieldControlGroup.find(el => el.name === this._type);
1607
+ const fieldControlItem = _fieldControlGroup.find(el => el.name === this._type);
1044
1608
  this.loadfieldConfigComponent(fieldControlItem);
1045
1609
  }
1046
1610
  if (this._fields && this._parentFiledName && this._culture) {
1047
1611
  /**表单控件组中的项 */
1048
- let fieldControlItem = _fieldControlGroup.find(el => el.name === this._fields.field.formControlName);
1612
+ const fieldControlItem = _fieldControlGroup.find(el => el.name === this._fields?.field?.formControlName);
1049
1613
  this.loadfieldComponent(fieldControlItem);
1050
1614
  }
1051
1615
  }
@@ -1080,11 +1644,11 @@ class DynamicComponent {
1080
1644
  instance.entity = this._entity;
1081
1645
  }
1082
1646
  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 }); }
1083
- 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: [""] }); }
1647
+ 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: "\n<div [formGroup]=\"_entity\">\n <template #FormControlRef></template>\n <template #FormComponentsRef></template>\n</div>\n\n", styles: [""], dependencies: [{ 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: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }] }); }
1084
1648
  }
1085
1649
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicComponent, decorators: [{
1086
1650
  type: Component,
1087
- args: [{ selector: 'df-dynamic', template: "<template #FormControlRef></template>\n<template #FormComponentsRef></template>" }]
1651
+ args: [{ selector: 'df-dynamic', template: "\n<div [formGroup]=\"_entity\">\n <template #FormControlRef></template>\n <template #FormComponentsRef></template>\n</div>\n\n" }]
1088
1652
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1089
1653
  type: Inject,
1090
1654
  args: ['MERGED_FORM_CONFIG']
@@ -1108,6 +1672,170 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1108
1672
  args: ['FormComponentsRef', { read: ViewContainerRef, static: true }]
1109
1673
  }] } });
1110
1674
 
1675
+ class FormControlService {
1676
+ constructor(mergedConfig) {
1677
+ this.mergedConfig = mergedConfig;
1678
+ this._FieldControlGroup = FieldControlGroup;
1679
+ }
1680
+ AddFieldControlGroup() {
1681
+ let array = this.mergedConfig;
1682
+ for (const element of array) {
1683
+ let find = FieldControlGroup.find(control => {
1684
+ return control.name === element.name;
1685
+ });
1686
+ if (!find) {
1687
+ FieldControlGroup.push(element);
1688
+ }
1689
+ }
1690
+ return FieldControlGroup;
1691
+ }
1692
+ 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 }); }
1693
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormControlService, providedIn: 'root' }); }
1694
+ }
1695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormControlService, decorators: [{
1696
+ type: Injectable,
1697
+ args: [{
1698
+ providedIn: 'root',
1699
+ }]
1700
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1701
+ type: Inject,
1702
+ args: ['MERGED_FORM_CONFIG']
1703
+ }] }] });
1704
+
1705
+ class DynamicViewComponent {
1706
+ constructor(_FormControlService) {
1707
+ this._FormControlService = _FormControlService;
1708
+ /**是否显示再列表 */
1709
+ this.showInList = false;
1710
+ /**表单控件Value */
1711
+ this._value = '';
1712
+ }
1713
+ set value(v) {
1714
+ this._value = v;
1715
+ // if(this._value) this.dataLoaded();
1716
+ }
1717
+ ngAfterContentInit() {
1718
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1719
+ //Add 'implements AfterContentInit' to the class.
1720
+ if (this.type && this._value !== '') {
1721
+ let _fieldControlGroup = this._FormControlService.AddFieldControlGroup();
1722
+ let fieldControlItem = _fieldControlGroup.find(el => el.name === this.type);
1723
+ this.loadViewComponent(fieldControlItem);
1724
+ }
1725
+ }
1726
+ /**加载动态展示组件 */
1727
+ loadViewComponent(FieldControlItem) {
1728
+ //清空了容器中的所有组件
1729
+ this.FormTemplateRef?.clear();
1730
+ if (!FieldControlItem || !FieldControlItem.fieldViewComponent)
1731
+ return;
1732
+ //在容器中创建组件
1733
+ const { instance } = this.FormTemplateRef?.createComponent(FieldControlItem.fieldViewComponent); //创建组件模板
1734
+ /**向创建的组件模板中传值 */
1735
+ instance.type = this.type;
1736
+ instance.value = this._value;
1737
+ instance.fields = this.fields;
1738
+ instance.showInList = this.showInList;
1739
+ }
1740
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicViewComponent, deps: [{ token: FormControlService }], target: i0.ɵɵFactoryTarget.Component }); }
1741
+ 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: [""] }); }
1742
+ }
1743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicViewComponent, decorators: [{
1744
+ type: Component,
1745
+ args: [{ selector: 'df-dynamic-view', template: "<template #FormTemplateRef></template>" }]
1746
+ }], ctorParameters: () => [{ type: FormControlService }], propDecorators: { showInList: [{
1747
+ type: Input
1748
+ }], fields: [{
1749
+ type: Input
1750
+ }], type: [{
1751
+ type: Input
1752
+ }], value: [{
1753
+ type: Input
1754
+ }], FormTemplateRef: [{
1755
+ type: ViewChild,
1756
+ args: ['FormTemplateRef', { read: ViewContainerRef, static: true }]
1757
+ }] } });
1758
+
1759
+ class DynamicConfigComponent {
1760
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1761
+ 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: [""] }); }
1762
+ }
1763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, decorators: [{
1764
+ type: Component,
1765
+ args: [{ selector: 'df-dynamic-config', template: "<p>dynamic-config works!</p>\r\n" }]
1766
+ }] });
1767
+
1768
+ class DynamicControlComponent {
1769
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1770
+ 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: [""] }); }
1771
+ }
1772
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, decorators: [{
1773
+ type: Component,
1774
+ args: [{ selector: 'df-dynamic-control', template: "<p>dynamic-control works!</p>\r\n" }]
1775
+ }] });
1776
+
1777
+ class DynamicSearchComponent {
1778
+ constructor(_FormControlService) {
1779
+ this._FormControlService = _FormControlService;
1780
+ /**字段配置列表 */
1781
+ this._fields = '';
1782
+ }
1783
+ set culture(v) {
1784
+ this._culture = v;
1785
+ }
1786
+ set parentFiledName(v) {
1787
+ this._parentFiledName = v;
1788
+ }
1789
+ set fields(v) {
1790
+ this._fields = v;
1791
+ }
1792
+ set entity(v) {
1793
+ if (v) {
1794
+ this._entity = v;
1795
+ }
1796
+ }
1797
+ ngAfterContentInit() {
1798
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1799
+ //Add 'implements AfterContentInit' to the class.
1800
+ if (this._fields && this._entity && this._culture) {
1801
+ let _fieldControlGroup = this._FormControlService.AddFieldControlGroup();
1802
+ let fieldControlItem = _fieldControlGroup.find(el => el.name === this._fields?.field?.formControlName);
1803
+ this.loadComponent(fieldControlItem);
1804
+ }
1805
+ }
1806
+ /**加载动态展示组件 */
1807
+ loadComponent(FieldControlItem) {
1808
+ //清空了容器中的所有组件
1809
+ this.FormSearchTemplateRef?.clear();
1810
+ if (!FieldControlItem || !FieldControlItem.fieldSearchComponent)
1811
+ return;
1812
+ //在容器中创建组件
1813
+ const { instance } = this.FormSearchTemplateRef?.createComponent(FieldControlItem.fieldSearchComponent); //创建组件模板
1814
+ /**向创建的组件模板中传值 */
1815
+ instance.fields = this._fields;
1816
+ instance.parentFiledName = this._parentFiledName;
1817
+ instance.culture = this._culture;
1818
+ instance.entity = this._entity;
1819
+ }
1820
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicSearchComponent, deps: [{ token: FormControlService }], target: i0.ɵɵFactoryTarget.Component }); }
1821
+ 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: [""] }); }
1822
+ }
1823
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicSearchComponent, decorators: [{
1824
+ type: Component,
1825
+ args: [{ selector: 'df-dynamic-search', template: "<template #FormSearchTemplateRef></template>" }]
1826
+ }], ctorParameters: () => [{ type: FormControlService }], propDecorators: { culture: [{
1827
+ type: Input
1828
+ }], parentFiledName: [{
1829
+ type: Input
1830
+ }], fields: [{
1831
+ type: Input
1832
+ }], entity: [{
1833
+ type: Input
1834
+ }], FormSearchTemplateRef: [{
1835
+ type: ViewChild,
1836
+ args: ['FormSearchTemplateRef', { read: ViewContainerRef, static: true }]
1837
+ }] } });
1838
+
1111
1839
  class DynamicFormModule {
1112
1840
  static forRoot(config) {
1113
1841
  return {
@@ -1126,26 +1854,60 @@ class DynamicFormModule {
1126
1854
  DateEditControlComponent,
1127
1855
  SelectConfigComponent,
1128
1856
  SelectControlComponent,
1129
- DynamicComponent], imports: [FormsModule,
1857
+ DynamicComponent,
1858
+ DynamicConfigComponent,
1859
+ DynamicViewComponent,
1860
+ DynamicControlComponent,
1861
+ SelectViewComponent,
1862
+ SwitchViewComponent,
1863
+ TextEditViewComponent,
1864
+ DateEditViewComponent,
1865
+ NumericEditViewComponent,
1866
+ DynamicSearchComponent,
1867
+ SelectSearchComponent,
1868
+ TextEditSearchComponent,
1869
+ SwitchSearchComponent,
1870
+ NumericEditSearchComponent], imports: [FormsModule,
1130
1871
  CoreModule,
1131
1872
  ThemeSharedModule,
1132
1873
  ReactiveFormsModule,
1133
- NgbDropdownModule], exports: [TextEditConfigComponent,
1874
+ NgbDropdownModule,
1875
+ NzSelectModule,
1876
+ DragDropModule,
1877
+ NgbDatepickerModule,
1878
+ ExtensibleModule
1879
+ // NzTreeModule,
1880
+ ], exports: [TextEditConfigComponent,
1134
1881
  TextEditComponent,
1882
+ TextEditViewComponent,
1135
1883
  SwitchConfigComponent,
1136
1884
  SwitchControlComponent,
1885
+ SwitchViewComponent,
1137
1886
  NumbericEditConfigComponent,
1138
1887
  NumbericEditControlComponent,
1139
1888
  DateEditConfigComponent,
1140
1889
  DateEditControlComponent,
1890
+ DateEditViewComponent,
1141
1891
  SelectConfigComponent,
1142
1892
  SelectControlComponent,
1143
- DynamicComponent] }); }
1893
+ SelectViewComponent,
1894
+ SelectSearchComponent,
1895
+ DynamicComponent,
1896
+ DynamicConfigComponent,
1897
+ DynamicViewComponent,
1898
+ DynamicControlComponent,
1899
+ DynamicSearchComponent] }); }
1144
1900
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, imports: [FormsModule,
1145
1901
  CoreModule,
1146
1902
  ThemeSharedModule,
1147
1903
  ReactiveFormsModule,
1148
- NgbDropdownModule] }); }
1904
+ NgbDropdownModule,
1905
+ NzSelectModule,
1906
+ DragDropModule,
1907
+ NgbDatepickerModule,
1908
+ ExtensibleModule
1909
+ // NzTreeModule,
1910
+ ] }); }
1149
1911
  }
1150
1912
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, decorators: [{
1151
1913
  type: NgModule,
@@ -1162,6 +1924,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1162
1924
  SelectConfigComponent,
1163
1925
  SelectControlComponent,
1164
1926
  DynamicComponent,
1927
+ DynamicConfigComponent,
1928
+ DynamicViewComponent,
1929
+ DynamicControlComponent,
1930
+ SelectViewComponent,
1931
+ SwitchViewComponent,
1932
+ TextEditViewComponent,
1933
+ DateEditViewComponent,
1934
+ NumericEditViewComponent,
1935
+ DynamicSearchComponent,
1936
+ SelectSearchComponent,
1937
+ TextEditSearchComponent,
1938
+ SwitchSearchComponent,
1939
+ NumericEditSearchComponent,
1165
1940
  ],
1166
1941
  imports: [
1167
1942
  FormsModule,
@@ -1169,20 +1944,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1169
1944
  ThemeSharedModule,
1170
1945
  ReactiveFormsModule,
1171
1946
  NgbDropdownModule,
1947
+ NzSelectModule,
1948
+ DragDropModule,
1949
+ NgbDatepickerModule,
1950
+ ExtensibleModule
1172
1951
  // NzTreeModule,
1173
1952
  ],
1174
1953
  exports: [
1175
1954
  TextEditConfigComponent,
1176
1955
  TextEditComponent,
1956
+ TextEditViewComponent,
1177
1957
  SwitchConfigComponent,
1178
1958
  SwitchControlComponent,
1959
+ SwitchViewComponent,
1179
1960
  NumbericEditConfigComponent,
1180
1961
  NumbericEditControlComponent,
1181
1962
  DateEditConfigComponent,
1182
1963
  DateEditControlComponent,
1964
+ DateEditViewComponent,
1183
1965
  SelectConfigComponent,
1184
1966
  SelectControlComponent,
1967
+ SelectViewComponent,
1968
+ SelectSearchComponent,
1185
1969
  DynamicComponent,
1970
+ DynamicConfigComponent,
1971
+ DynamicViewComponent,
1972
+ DynamicControlComponent,
1973
+ DynamicSearchComponent
1186
1974
  ],
1187
1975
  providers: [],
1188
1976
  }]
@@ -1196,5 +1984,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
1196
1984
  * Generated bundle index. Do not edit.
1197
1985
  */
1198
1986
 
1199
- export { AddFieldControlGroup, DateEditConfigComponent, DateEditControlComponent, DynamicComponent, DynamicFormModule, FieldControlGroup, NumbericEditConfigComponent, NumbericEditControlComponent, SelectConfigComponent, SelectControlComponent, SwitchConfigComponent, SwitchControlComponent, TextEditComponent, TextEditConfig, TextEditConfigComponent, maxDecimalPlacesValidator };
1987
+ 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 };
1200
1988
  //# sourceMappingURL=dignite-ng-expand.dynamic-form.mjs.map