@dignite-ng/expand.dynamic-form 3.0.0-rc.6 → 3.0.0-rc.8

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 (184) hide show
  1. package/esm2022/dignite-ng-expand.dynamic-form.mjs +5 -0
  2. package/esm2022/lib/components/dynamic/dynamic-config.component.mjs +11 -0
  3. package/esm2022/lib/components/dynamic/dynamic-control.component.mjs +11 -0
  4. package/esm2022/lib/components/dynamic/dynamic-view.component.mjs +57 -0
  5. package/esm2022/lib/components/dynamic/dynamic.component.mjs +106 -0
  6. package/esm2022/lib/components/dynamic/index.mjs +5 -0
  7. package/esm2022/lib/components/form/date-edit/date-edit-config.component.mjs +90 -0
  8. package/esm2022/lib/components/form/date-edit/date-edit-config.mjs +12 -0
  9. package/esm2022/lib/components/form/date-edit/date-edit-control.component.mjs +99 -0
  10. package/esm2022/lib/components/form/date-edit/date-edit-view.component.mjs +40 -0
  11. package/esm2022/lib/components/form/date-edit/index.mjs +3 -0
  12. package/esm2022/lib/components/form/form-control-group.mjs +65 -0
  13. package/esm2022/lib/components/form/index.mjs +7 -0
  14. package/esm2022/lib/components/form/numeric-edit/index.mjs +3 -0
  15. package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.component.mjs +60 -0
  16. package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.mjs +25 -0
  17. package/esm2022/lib/components/form/numeric-edit/numberic-edit-control.component.mjs +106 -0
  18. package/esm2022/lib/components/form/numeric-edit/numeric-edit-view.component.mjs +39 -0
  19. package/esm2022/lib/components/form/select/index.mjs +3 -0
  20. package/esm2022/lib/components/form/select/select-config.component.mjs +93 -0
  21. package/esm2022/lib/components/form/select/select-config.mjs +19 -0
  22. package/esm2022/lib/components/form/select/select-control.component.mjs +87 -0
  23. package/esm2022/lib/components/form/select/select-view.component.mjs +44 -0
  24. package/esm2022/lib/components/form/switch/index.mjs +3 -0
  25. package/esm2022/lib/components/form/switch/switch-config.component.mjs +61 -0
  26. package/esm2022/lib/components/form/switch/switch-config.mjs +14 -0
  27. package/esm2022/lib/components/form/switch/switch-control.component.mjs +80 -0
  28. package/esm2022/lib/components/form/switch/switch-view.component.mjs +40 -0
  29. package/esm2022/lib/components/form/text-edit/index.mjs +4 -0
  30. package/esm2022/lib/components/form/text-edit/text-edit-config.component.mjs +63 -0
  31. package/esm2022/lib/components/form/text-edit/text-edit-config.mjs +18 -0
  32. package/esm2022/lib/components/form/text-edit/text-edit-view.component.mjs +39 -0
  33. package/esm2022/lib/components/form/text-edit/text-edit.component.mjs +89 -0
  34. package/esm2022/lib/components/index.mjs +3 -0
  35. package/esm2022/lib/dynamic-form.module.mjs +122 -0
  36. package/esm2022/lib/enums/date-edit-interfaces.mjs +16 -0
  37. package/esm2022/lib/enums/text-edit-mode.mjs +8 -0
  38. package/esm2022/lib/interfaces/form-config-interfaces.mjs +2 -0
  39. package/esm2022/lib/interfaces/index.mjs +2 -0
  40. package/esm2022/lib/services/df-api.service.mjs +82 -0
  41. package/esm2022/lib/services/form-control.service.mjs +33 -0
  42. package/esm2022/lib/services/index.mjs +2 -0
  43. package/esm2022/public-api.mjs +7 -0
  44. package/fesm2022/dignite-ng-expand.dynamic-form.mjs +1518 -0
  45. package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -0
  46. package/index.d.ts +5 -0
  47. package/lib/components/dynamic/dynamic-config.component.d.ts +5 -0
  48. package/lib/components/dynamic/dynamic-control.component.d.ts +5 -0
  49. package/lib/components/dynamic/dynamic-view.component.d.ts +24 -0
  50. package/lib/components/dynamic/dynamic.component.d.ts +38 -0
  51. package/lib/components/dynamic/index.d.ts +4 -0
  52. package/lib/components/form/date-edit/date-edit-config.component.d.ts +29 -0
  53. package/lib/components/form/date-edit/date-edit-config.d.ts +9 -0
  54. package/lib/components/form/date-edit/date-edit-control.component.d.ts +33 -0
  55. package/lib/components/form/date-edit/date-edit-view.component.d.ts +17 -0
  56. package/lib/components/form/date-edit/index.d.ts +2 -0
  57. package/lib/components/form/form-control-group.d.ts +6 -0
  58. package/lib/components/form/index.d.ts +6 -0
  59. package/lib/components/form/numeric-edit/index.d.ts +2 -0
  60. package/lib/components/form/numeric-edit/numberic-edit-config.component.d.ts +23 -0
  61. package/lib/components/form/numeric-edit/numberic-edit-config.d.ts +11 -0
  62. package/lib/components/form/numeric-edit/numberic-edit-control.component.d.ts +34 -0
  63. package/lib/components/form/numeric-edit/numeric-edit-view.component.d.ts +17 -0
  64. package/lib/components/form/select/index.d.ts +2 -0
  65. package/lib/components/form/select/select-config.component.d.ts +31 -0
  66. package/lib/components/form/select/select-config.d.ts +7 -0
  67. package/lib/components/form/select/select-control.component.d.ts +29 -0
  68. package/lib/components/form/select/select-view.component.d.ts +17 -0
  69. package/lib/components/form/switch/index.d.ts +2 -0
  70. package/lib/components/form/switch/switch-config.component.d.ts +23 -0
  71. package/lib/components/form/switch/switch-config.d.ts +5 -0
  72. package/lib/components/form/switch/switch-control.component.d.ts +28 -0
  73. package/lib/components/form/switch/switch-view.component.d.ts +17 -0
  74. package/lib/components/form/text-edit/index.d.ts +3 -0
  75. package/lib/components/form/text-edit/text-edit-config.component.d.ts +25 -0
  76. package/lib/components/form/text-edit/text-edit-config.d.ts +7 -0
  77. package/lib/components/form/text-edit/text-edit-view.component.d.ts +17 -0
  78. package/lib/components/form/text-edit/text-edit.component.d.ts +30 -0
  79. package/lib/components/index.d.ts +2 -0
  80. package/lib/dynamic-form.module.d.ts +32 -0
  81. package/lib/enums/date-edit-interfaces.d.ts +5 -0
  82. package/lib/enums/text-edit-mode.d.ts +4 -0
  83. package/{src/lib/interfaces/form-config-interfaces.ts → lib/interfaces/form-config-interfaces.d.ts} +2 -7
  84. package/lib/interfaces/index.d.ts +1 -0
  85. package/lib/services/df-api.service.d.ts +18 -0
  86. package/lib/services/form-control.service.d.ts +9 -0
  87. package/lib/services/index.d.ts +1 -0
  88. package/package.json +15 -2
  89. package/{src/public-api.ts → public-api.d.ts} +0 -4
  90. package/ng-package.json +0 -7
  91. package/src/lib/components/dynamic/dynamic.component.html +0 -2
  92. package/src/lib/components/dynamic/dynamic.component.scss +0 -0
  93. package/src/lib/components/dynamic/dynamic.component.spec.ts +0 -21
  94. package/src/lib/components/dynamic/dynamic.component.ts +0 -121
  95. package/src/lib/components/dynamic/index.ts +0 -1
  96. package/src/lib/components/form/date-edit/date-edit-config.component.html +0 -40
  97. package/src/lib/components/form/date-edit/date-edit-config.component.scss +0 -0
  98. package/src/lib/components/form/date-edit/date-edit-config.component.spec.ts +0 -21
  99. package/src/lib/components/form/date-edit/date-edit-config.component.ts +0 -87
  100. package/src/lib/components/form/date-edit/date-edit-config.ts +0 -14
  101. package/src/lib/components/form/date-edit/date-edit-control.component.html +0 -26
  102. package/src/lib/components/form/date-edit/date-edit-control.component.scss +0 -0
  103. package/src/lib/components/form/date-edit/date-edit-control.component.spec.ts +0 -21
  104. package/src/lib/components/form/date-edit/date-edit-control.component.ts +0 -101
  105. package/src/lib/components/form/date-edit/index.ts +0 -2
  106. package/src/lib/components/form/form-control-group.ts +0 -64
  107. package/src/lib/components/form/index.ts +0 -6
  108. package/src/lib/components/form/numeric-edit/index.ts +0 -2
  109. package/src/lib/components/form/numeric-edit/numberic-edit-config.component.html +0 -31
  110. package/src/lib/components/form/numeric-edit/numberic-edit-config.component.scss +0 -0
  111. package/src/lib/components/form/numeric-edit/numberic-edit-config.component.spec.ts +0 -21
  112. package/src/lib/components/form/numeric-edit/numberic-edit-config.component.ts +0 -57
  113. package/src/lib/components/form/numeric-edit/numberic-edit-config.ts +0 -28
  114. package/src/lib/components/form/numeric-edit/numberic-edit-control.component.html +0 -13
  115. package/src/lib/components/form/numeric-edit/numberic-edit-control.component.scss +0 -0
  116. package/src/lib/components/form/numeric-edit/numberic-edit-control.component.spec.ts +0 -21
  117. package/src/lib/components/form/numeric-edit/numberic-edit-control.component.ts +0 -119
  118. package/src/lib/components/form/select/index.ts +0 -2
  119. package/src/lib/components/form/select/select-config.component.html +0 -59
  120. package/src/lib/components/form/select/select-config.component.scss +0 -0
  121. package/src/lib/components/form/select/select-config.component.spec.ts +0 -21
  122. package/src/lib/components/form/select/select-config.component.ts +0 -90
  123. package/src/lib/components/form/select/select-config.ts +0 -24
  124. package/src/lib/components/form/select/select-control.component.html +0 -32
  125. package/src/lib/components/form/select/select-control.component.scss +0 -32
  126. package/src/lib/components/form/select/select-control.component.spec.ts +0 -21
  127. package/src/lib/components/form/select/select-control.component.ts +0 -86
  128. package/src/lib/components/form/switch/index.ts +0 -2
  129. package/src/lib/components/form/switch/switch-config.component.html +0 -17
  130. package/src/lib/components/form/switch/switch-config.component.scss +0 -0
  131. package/src/lib/components/form/switch/switch-config.component.spec.ts +0 -21
  132. package/src/lib/components/form/switch/switch-config.component.ts +0 -58
  133. package/src/lib/components/form/switch/switch-config.ts +0 -17
  134. package/src/lib/components/form/switch/switch-control.component.html +0 -13
  135. package/src/lib/components/form/switch/switch-control.component.scss +0 -0
  136. package/src/lib/components/form/switch/switch-control.component.spec.ts +0 -21
  137. package/src/lib/components/form/switch/switch-control.component.ts +0 -81
  138. package/src/lib/components/form/text-edit/index.ts +0 -3
  139. package/src/lib/components/form/text-edit/text-edit-config.component.html +0 -32
  140. package/src/lib/components/form/text-edit/text-edit-config.component.scss +0 -0
  141. package/src/lib/components/form/text-edit/text-edit-config.component.spec.ts +0 -21
  142. package/src/lib/components/form/text-edit/text-edit-config.component.ts +0 -59
  143. package/src/lib/components/form/text-edit/text-edit-config.ts +0 -24
  144. package/src/lib/components/form/text-edit/text-edit.component.html +0 -17
  145. package/src/lib/components/form/text-edit/text-edit.component.scss +0 -0
  146. package/src/lib/components/form/text-edit/text-edit.component.spec.ts +0 -21
  147. package/src/lib/components/form/text-edit/text-edit.component.ts +0 -91
  148. package/src/lib/components/index.ts +0 -2
  149. package/src/lib/dynamic-form.module.ts +0 -74
  150. package/src/lib/enums/date-edit-interfaces.ts +0 -16
  151. package/src/lib/enums/index.ts +0 -2
  152. package/src/lib/enums/text-edit-mode.ts +0 -7
  153. package/src/lib/interfaces/index.ts +0 -1
  154. package/src/lib/proxy/README.md +0 -17
  155. package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
  156. package/src/lib/proxy/dignite/file-explorer/directories/index.ts +0 -2
  157. package/src/lib/proxy/dignite/file-explorer/directories/models.ts +0 -35
  158. package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
  159. package/src/lib/proxy/dignite/file-explorer/files/index.ts +0 -2
  160. package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -57
  161. package/src/lib/proxy/dignite/file-explorer/index.ts +0 -3
  162. package/src/lib/proxy/dignite/index.ts +0 -2
  163. package/src/lib/proxy/generate-proxy.json +0 -11810
  164. package/src/lib/proxy/index.ts +0 -4
  165. package/src/lib/proxy/microsoft/asp-net-core/index.ts +0 -2
  166. package/src/lib/proxy/microsoft/asp-net-core/mvc/index.ts +0 -1
  167. package/src/lib/proxy/microsoft/asp-net-core/mvc/models.ts +0 -12
  168. package/src/lib/proxy/microsoft/extensions/index.ts +0 -2
  169. package/src/lib/proxy/microsoft/extensions/primitives/index.ts +0 -1
  170. package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
  171. package/src/lib/proxy/microsoft/index.ts +0 -4
  172. package/src/lib/proxy/microsoft/net/http/headers/index.ts +0 -1
  173. package/src/lib/proxy/microsoft/net/http/headers/models.ts +0 -7
  174. package/src/lib/proxy/microsoft/net/http/index.ts +0 -2
  175. package/src/lib/proxy/microsoft/net/index.ts +0 -2
  176. package/src/lib/proxy/volo/abp/content/index.ts +0 -1
  177. package/src/lib/proxy/volo/abp/content/models.ts +0 -6
  178. package/src/lib/proxy/volo/abp/index.ts +0 -2
  179. package/src/lib/proxy/volo/index.ts +0 -2
  180. package/src/lib/services/df-api.service.ts +0 -75
  181. package/src/lib/services/index.ts +0 -1
  182. package/tsconfig.lib.json +0 -14
  183. package/tsconfig.lib.prod.json +0 -10
  184. package/tsconfig.spec.json +0 -14
@@ -0,0 +1,1518 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ChangeDetectorRef, Component, Input, ViewChild, ChangeDetectionStrategy, Injectable, ViewContainerRef, Inject, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { Validators, FormArray, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import * as i2 from '@abp/ng.core';
6
+ import { CoreModule } from '@abp/ng.core';
7
+ import { ThemeSharedModule } from '@abp/ng.theme.shared';
8
+ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
9
+ import * as i3 from '@ngx-validate/core';
10
+ import * as i2$1 from '@angular/common';
11
+ import { DatePipe } from '@angular/common';
12
+ import { pinyin } from 'pinyin-pro';
13
+ import * as i4 from 'ng-zorro-antd/select';
14
+ import { NzSelectModule } from 'ng-zorro-antd/select';
15
+
16
+ class TextEditConfig {
17
+ constructor(data) {
18
+ /**占位符 */
19
+ this['TextEdit.Placeholder'] = ['', []];
20
+ //字段类型,单行文本,多行文本
21
+ this['TextEdit.Mode'] = [0, []];
22
+ // 字数限制
23
+ this['TextEdit.CharLimit'] = ['265', []];
24
+ if (data) {
25
+ for (const key in data) {
26
+ if (data.hasOwnProperty(key)) {
27
+ this[key] = data[key];
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+
34
+ var TextEditMode;
35
+ (function (TextEditMode) {
36
+ // 简单类型
37
+ TextEditMode[TextEditMode["SingleLine"] = 0] = "SingleLine";
38
+ // 复合类型;
39
+ TextEditMode[TextEditMode["MultipleLine"] = 1] = "MultipleLine";
40
+ })(TextEditMode || (TextEditMode = {}));
41
+
42
+ class TextEditConfigComponent {
43
+ constructor(fb) {
44
+ this.fb = fb;
45
+ this._TextEditMode = TextEditMode;
46
+ this.cdr = inject(ChangeDetectorRef);
47
+ }
48
+ set type(v) {
49
+ this._type = v;
50
+ this.dataLoaded();
51
+ }
52
+ set Entity(v) {
53
+ this._Entity = v;
54
+ this.dataLoaded();
55
+ }
56
+ set selected(v) {
57
+ this._selected = v;
58
+ this.dataLoaded();
59
+ }
60
+ get formConfiguration() {
61
+ return this._Entity.get('formConfiguration');
62
+ }
63
+ async dataLoaded() {
64
+ if (this._Entity && this._type) {
65
+ await this.AfterInit();
66
+ this.cdr.detectChanges(); // 手动触发变更检测
67
+ this.submitclick?.nativeElement?.click();
68
+ }
69
+ }
70
+ AfterInit() {
71
+ return new Promise((resolve, rejects) => {
72
+ this._Entity.setControl('formConfiguration', this.fb.group(new TextEditConfig()));
73
+ if (this._selected && this._selected.formControlName == this._type) {
74
+ this.formConfiguration.patchValue({
75
+ ...this._selected.formConfiguration,
76
+ });
77
+ }
78
+ resolve(true);
79
+ });
80
+ }
81
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
82
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: TextEditConfigComponent, selector: "df-text-edit-config", inputs: { type: "type", Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'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" }] }); }
83
+ }
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditConfigComponent, decorators: [{
85
+ type: Component,
86
+ args: [{ selector: 'df-text-edit-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'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>" }]
87
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
88
+ type: Input
89
+ }], Entity: [{
90
+ type: Input
91
+ }], selected: [{
92
+ type: Input
93
+ }], submitclick: [{
94
+ type: ViewChild,
95
+ args: ['submitclick', { static: true }]
96
+ }] } });
97
+
98
+ /* eslint-disable @angular-eslint/no-empty-lifecycle-method */
99
+ /* eslint-disable @angular-eslint/use-lifecycle-interface */
100
+ class TextEditComponent {
101
+ constructor(fb) {
102
+ this.fb = fb;
103
+ this._TextEditMode = TextEditMode;
104
+ /**字段配置列表 */
105
+ this._fields = '';
106
+ this.cdr = inject(ChangeDetectorRef);
107
+ this.isObjEmpty = (obj) => Object.keys(obj).length === 0;
108
+ }
109
+ set entity(v) {
110
+ this._entity = v;
111
+ if (v)
112
+ this.dataLoaded();
113
+ }
114
+ set fields(v) {
115
+ this._fields = v;
116
+ if (v)
117
+ this.dataLoaded();
118
+ }
119
+ set parentFiledName(v) {
120
+ this._parentFiledName = v;
121
+ if (v)
122
+ this.dataLoaded();
123
+ }
124
+ set selected(v) {
125
+ this._selected = v || '';
126
+ if (v)
127
+ this.dataLoaded();
128
+ }
129
+ async dataLoaded() {
130
+ if (this._fields && this._entity && this._parentFiledName) {
131
+ this.extraProperties = this._entity.get(this._parentFiledName);
132
+ await this.AfterInit();
133
+ this.cdr.detectChanges(); // 手动触发变更检测
134
+ this.submitclick?.nativeElement?.click();
135
+ }
136
+ }
137
+ AfterInit() {
138
+ return new Promise((resolve, rejects) => {
139
+ let ValidatorsArray = [];
140
+ if (this._fields.required) {
141
+ ValidatorsArray.push(Validators.required);
142
+ }
143
+ this._fields.field.formConfiguration = {
144
+ ...this.fb.group(new TextEditConfig()).value,
145
+ ...this._fields.field.formConfiguration
146
+ };
147
+ if (this._fields.field.formConfiguration['TextEdit.CharLimit']) {
148
+ ValidatorsArray.push(Validators.maxLength(this._fields.field.formConfiguration['TextEdit.CharLimit']));
149
+ }
150
+ let newControl = this.fb.control(this._selected, ValidatorsArray);
151
+ this.extraProperties?.setControl(this._fields.field.name, newControl);
152
+ resolve(true);
153
+ });
154
+ }
155
+ ngOnDestroy() {
156
+ //Called once, before the instance is destroyed.
157
+ //Add 'implements OnDestroy' to the class.
158
+ this.extraProperties?.removeControl(this._fields.field.name);
159
+ }
160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
161
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: TextEditComponent, selector: "df-text-edit", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div [formGroupName]=\"_parentFiledName\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <ng-container *ngIf=\"_fields.field.formConfiguration['TextEdit.Mode'] ===_TextEditMode.SingleLine\">\n <input type=\"text\" class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['TextEdit.Placeholder']\" />\n </ng-container>\n <ng-container *ngIf=\"_fields.field.formConfiguration['TextEdit.Mode'] === _TextEditMode.MultipleLine\">\n <textarea class=\"form-control\" formControlName=\"{{_fields.field.name}}\"\n [placeholder]=\"_fields.field.formConfiguration['TextEdit.Placeholder']\" rows=\"3\"></textarea>\n </ng-container>\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }] }); }
162
+ }
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditComponent, decorators: [{
164
+ type: Component,
165
+ args: [{ selector: 'df-text-edit', 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>" }]
166
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
167
+ type: Input
168
+ }], fields: [{
169
+ type: Input
170
+ }], parentFiledName: [{
171
+ type: Input
172
+ }], selected: [{
173
+ type: Input
174
+ }], submitclick: [{
175
+ type: ViewChild,
176
+ args: ['submitclick', { static: true }]
177
+ }] } });
178
+
179
+ class SwitchConfig {
180
+ constructor(data) {
181
+ /**默认值 */
182
+ this['Switch.Default'] = [false, []];
183
+ if (data) {
184
+ for (const key in data) {
185
+ if (data.hasOwnProperty(key)) {
186
+ this[key] = data[key];
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ class SwitchConfigComponent {
194
+ constructor(fb) {
195
+ this.fb = fb;
196
+ this.cdr = inject(ChangeDetectorRef);
197
+ }
198
+ set type(v) {
199
+ this._type = v;
200
+ this.dataLoaded();
201
+ }
202
+ set Entity(v) {
203
+ this._Entity = v;
204
+ this.dataLoaded();
205
+ }
206
+ set selected(v) {
207
+ this._selected = v;
208
+ this.dataLoaded();
209
+ }
210
+ get formConfiguration() {
211
+ return this._Entity.get('formConfiguration');
212
+ }
213
+ async dataLoaded() {
214
+ if (this._Entity && this._type) {
215
+ await this.AfterInit();
216
+ this.cdr.detectChanges(); // 手动触发变更检测
217
+ this.submitclick?.nativeElement?.click();
218
+ }
219
+ }
220
+ AfterInit() {
221
+ return new Promise((resolve, rejects) => {
222
+ this._Entity.setControl('formConfiguration', this.fb.group(new SwitchConfig()));
223
+ if (this._selected && this._selected.formControlName == this._type) {
224
+ this.formConfiguration.patchValue({
225
+ ...this._selected.formConfiguration,
226
+ });
227
+ }
228
+ resolve(true);
229
+ });
230
+ }
231
+ 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 }); }
232
+ 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" }] }); }
233
+ }
234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchConfigComponent, decorators: [{
235
+ type: Component,
236
+ 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>" }]
237
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
238
+ type: Input
239
+ }], Entity: [{
240
+ type: Input
241
+ }], selected: [{
242
+ type: Input
243
+ }], submitclick: [{
244
+ type: ViewChild,
245
+ args: ['submitclick', { static: true }]
246
+ }] } });
247
+
248
+ class SwitchControlComponent {
249
+ constructor(fb) {
250
+ this.fb = fb;
251
+ /**字段配置列表 */
252
+ this._fields = '';
253
+ this.cdr = inject(ChangeDetectorRef);
254
+ }
255
+ set entity(v) {
256
+ this._entity = v;
257
+ this.dataLoaded();
258
+ }
259
+ set fields(v) {
260
+ this._fields = v;
261
+ this.dataLoaded();
262
+ }
263
+ set parentFiledName(v) {
264
+ this._parentFiledName = v;
265
+ this.dataLoaded();
266
+ }
267
+ set selected(v) {
268
+ // ?v:false;
269
+ this._selected = v;
270
+ this.dataLoaded();
271
+ }
272
+ get extraProperties() {
273
+ return this._entity.get('extraProperties');
274
+ }
275
+ /**数据加载完成 */
276
+ async dataLoaded() {
277
+ if (this._fields && this._entity) {
278
+ await this.AfterInit();
279
+ this.cdr.detectChanges(); // 手动触发变更检测
280
+ this.submitclick?.nativeElement?.click();
281
+ }
282
+ }
283
+ AfterInit() {
284
+ return new Promise((resolve, rejects) => {
285
+ let ValidatorsArray = [];
286
+ if (this._fields.required) {
287
+ ValidatorsArray.push(Validators.required);
288
+ }
289
+ let newControl = this.fb.control(this._selected
290
+ ? this._selected
291
+ : this._selected === false
292
+ ? this._selected
293
+ : this._fields.field.formConfiguration['Switch.Default'], ValidatorsArray);
294
+ this.extraProperties.setControl(this._fields.field.name, newControl);
295
+ resolve(true);
296
+ });
297
+ }
298
+ ngOnDestroy() {
299
+ //Called once, before the instance is destroyed.
300
+ //Add 'implements OnDestroy' to the class.
301
+ this.extraProperties.removeControl(this._fields.field.name);
302
+ }
303
+ 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 }); }
304
+ 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"] }] }); }
305
+ }
306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchControlComponent, decorators: [{
307
+ type: Component,
308
+ 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>" }]
309
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
310
+ type: Input
311
+ }], fields: [{
312
+ type: Input
313
+ }], parentFiledName: [{
314
+ type: Input
315
+ }], selected: [{
316
+ type: Input
317
+ }], submitclick: [{
318
+ type: ViewChild,
319
+ args: ['submitclick', { static: true }]
320
+ }] } });
321
+
322
+ class NumbericEditConfig {
323
+ constructor(data) {
324
+ /**占位符 */
325
+ this['NumericEditField.Placeholder'] = ['', []];
326
+ /**最小值 */
327
+ this['NumericEditField.Min'] = ['', [Validators.required]];
328
+ //最大值
329
+ this['NumericEditField.Max'] = ['', [Validators.required]];
330
+ // 小数位数
331
+ this['NumericEditField.Decimals'] = [2, []];
332
+ //步长
333
+ this['NumericEditField.Step'] = ['', []];
334
+ //格式说明符
335
+ this['FormatSpecifier'] = ['', []];
336
+ if (data) {
337
+ for (const key in data) {
338
+ if (data.hasOwnProperty(key)) {
339
+ this[key] = data[key];
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
345
+
346
+ class NumbericEditConfigComponent {
347
+ constructor(fb) {
348
+ this.fb = fb;
349
+ this.cdr = inject(ChangeDetectorRef);
350
+ }
351
+ set type(v) {
352
+ this._type = v;
353
+ // this.dataLoaded()
354
+ }
355
+ set selected(v) {
356
+ this._selected = v ? v : v == false ? v : '';
357
+ }
358
+ set Entity(v) {
359
+ this._Entity = v;
360
+ this.dataLoaded();
361
+ }
362
+ get formConfiguration() {
363
+ return this._Entity.get('formConfiguration');
364
+ }
365
+ async dataLoaded() {
366
+ if (this._Entity && this._type) {
367
+ await this.AfterInit();
368
+ this.cdr.detectChanges(); // 手动触发变更检测
369
+ this.submitclick?.nativeElement?.click();
370
+ }
371
+ }
372
+ AfterInit() {
373
+ return new Promise((resolve, rejects) => {
374
+ this._Entity.setControl('formConfiguration', this.fb.group(new NumbericEditConfig()));
375
+ if (this._selected && this._selected.formControlName == this._type) {
376
+ this.formConfiguration.patchValue({
377
+ ...this._selected.formConfiguration,
378
+ });
379
+ }
380
+ resolve(true);
381
+ });
382
+ }
383
+ 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 }); }
384
+ 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" }] }); }
385
+ }
386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditConfigComponent, decorators: [{
387
+ type: Component,
388
+ 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>" }]
389
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
390
+ type: Input
391
+ }], selected: [{
392
+ type: Input
393
+ }], Entity: [{
394
+ type: Input
395
+ }], submitclick: [{
396
+ type: ViewChild,
397
+ args: ['submitclick', { static: false }]
398
+ }] } });
399
+
400
+ function maxDecimalPlacesValidator(maxDecimalPlaces) {
401
+ return (control) => {
402
+ const value = control.value;
403
+ if (typeof value === 'number' && isNaN(value) === false) {
404
+ const decimalPart = value.toString().split('.')[1];
405
+ if (decimalPart && decimalPart.length > maxDecimalPlaces) {
406
+ return { 'maxDecimalPlaces': { actual: decimalPart.length, max: maxDecimalPlaces } };
407
+ }
408
+ }
409
+ return null;
410
+ };
411
+ }
412
+ class NumbericEditControlComponent {
413
+ constructor(fb, cdr) {
414
+ this.fb = fb;
415
+ this.cdr = cdr;
416
+ /**字段配置列表 */
417
+ this._fields = '';
418
+ }
419
+ get entity() {
420
+ return this._entity;
421
+ }
422
+ set fields(v) {
423
+ this._fields = v;
424
+ }
425
+ set parentFiledName(v) {
426
+ this._parentFiledName = v;
427
+ }
428
+ set selected(v) {
429
+ this._selected = v;
430
+ //
431
+ }
432
+ set entity(v) {
433
+ this._entity = v;
434
+ this.dataLoaded();
435
+ }
436
+ get extraProperties() {
437
+ return this._entity?.get('extraProperties');
438
+ }
439
+ get fieldInput() { return this.extraProperties.get(this._fields.field.name); }
440
+ /**数据加载完成 */
441
+ async dataLoaded() {
442
+ if (this._fields && this._entity) {
443
+ await this.AfterInit();
444
+ this.cdr.detectChanges();
445
+ this.submitclick.nativeElement.click();
446
+ }
447
+ }
448
+ AfterInit() {
449
+ return new Promise((resolve, rejects) => {
450
+ let ValidatorsArray = [];
451
+ let formConfiguration = this._fields.field.formConfiguration;
452
+ if (this._fields.required) {
453
+ ValidatorsArray.push(Validators.required);
454
+ }
455
+ if (formConfiguration['NumericEditField.Min']) {
456
+ ValidatorsArray.push(Validators.min(formConfiguration['NumericEditField.Min']));
457
+ }
458
+ if (formConfiguration['NumericEditField.Max']) {
459
+ ValidatorsArray.push(Validators.max(formConfiguration['NumericEditField.Max']));
460
+ }
461
+ let newControl = this.fb.control(this._selected, ValidatorsArray);
462
+ this.extraProperties.setControl(this._fields.field.name, newControl);
463
+ resolve(true);
464
+ });
465
+ }
466
+ ngOnDestroy() {
467
+ //Called once, before the instance is destroyed.
468
+ //Add 'implements OnDestroy' to the class.
469
+ this.extraProperties.removeControl(this._fields.field.name);
470
+ }
471
+ /**数字框输入 */
472
+ inputchange(event) {
473
+ let val = event.target.value;
474
+ const decimalPart = val.toString().split('.')[1] || '';
475
+ let formConfiguration = this._fields.field.formConfiguration;
476
+ let Decimals = formConfiguration['NumericEditField.Decimals'];
477
+ if (decimalPart.length > Decimals) {
478
+ this.fieldInput?.patchValue(val.slice(0, val.length - (decimalPart.length - 2)));
479
+ }
480
+ }
481
+ 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 }); }
482
+ 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 }); }
483
+ }
484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumbericEditControlComponent, decorators: [{
485
+ type: Component,
486
+ 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>" }]
487
+ }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }], propDecorators: { fields: [{
488
+ type: Input
489
+ }], parentFiledName: [{
490
+ type: Input
491
+ }], selected: [{
492
+ type: Input
493
+ }], entity: [{
494
+ type: Input
495
+ }], submitclick: [{
496
+ type: ViewChild,
497
+ args: ['submitclick', { static: true }]
498
+ }] } });
499
+
500
+ var DateEditInterfaces;
501
+ (function (DateEditInterfaces) {
502
+ /// <summary>
503
+ /// Only date is allowed to be entered.
504
+ /// </summary>
505
+ DateEditInterfaces[DateEditInterfaces["Date"] = 0] = "Date";
506
+ /// <summary>
507
+ /// Both date and time are allowed to be entered.
508
+ /// </summary>
509
+ DateEditInterfaces[DateEditInterfaces["DateTime"] = 1] = "DateTime";
510
+ /// <summary>
511
+ /// Allowed to select only year and month.
512
+ /// </summary>
513
+ DateEditInterfaces[DateEditInterfaces["Month"] = 2] = "Month";
514
+ })(DateEditInterfaces || (DateEditInterfaces = {}));
515
+
516
+ class DateEditConfig {
517
+ constructor() {
518
+ /**日期格式 */
519
+ this['DateEdit.InputMode'] = [DateEditInterfaces.Date, []];
520
+ /**最小值 */
521
+ this['DateEdit.Min'] = ['', []];
522
+ /**最大值 */
523
+ this['DateEdit.Max'] = ['', []];
524
+ }
525
+ }
526
+
527
+ class DateEditConfigComponent {
528
+ constructor(fb) {
529
+ this.fb = fb;
530
+ this._dataPipe = inject(DatePipe);
531
+ this._DateEditInterfaces = DateEditInterfaces;
532
+ this.dateTimeType = 'date';
533
+ this.cdr = inject(ChangeDetectorRef);
534
+ }
535
+ set type(v) {
536
+ this._type = v;
537
+ }
538
+ set selected(v) {
539
+ this._selected = v;
540
+ }
541
+ set Entity(v) {
542
+ this._Entity = v;
543
+ this.dataLoaded();
544
+ }
545
+ get formConfiguration() {
546
+ return this._Entity.get('formConfiguration');
547
+ }
548
+ async dataLoaded() {
549
+ if (this._Entity && this._type) {
550
+ await this.AfterInit();
551
+ this.cdr.detectChanges(); // 手动触发变更检测
552
+ this.submitclick?.nativeElement?.click();
553
+ }
554
+ }
555
+ AfterInit() {
556
+ return new Promise((resolve, rejects) => {
557
+ this._Entity.setControl('formConfiguration', this.fb.group(new DateEditConfig()));
558
+ if (this._selected && this._selected.formControlName == this._type) {
559
+ this.formConfiguration.patchValue({
560
+ ...this._selected.formConfiguration,
561
+ });
562
+ this.timeTypeChange();
563
+ }
564
+ resolve(true);
565
+ });
566
+ }
567
+ /**切换时间类型 */
568
+ timeTypeChange() {
569
+ let type = this.formConfiguration.value['DateEdit.InputMode'];
570
+ let Min = this.formConfiguration.value['DateEdit.Min'];
571
+ let Max = this.formConfiguration.value['DateEdit.Max'];
572
+ if (type == DateEditInterfaces.Date) {
573
+ this.dateTimeType = 'date';
574
+ Min = this._dataPipe.transform(Min, 'yyyy-MM-dd');
575
+ Max = this._dataPipe.transform(Max, 'yyyy-MM-dd');
576
+ }
577
+ else if (type == DateEditInterfaces.DateTime) {
578
+ this.dateTimeType = 'datetime-local';
579
+ Min = this._dataPipe.transform(Min, 'yyyy-MM-dd HH:mm:ss');
580
+ Max = this._dataPipe.transform(Max, 'yyyy-MM-dd HH:mm:ss');
581
+ }
582
+ else if (type == DateEditInterfaces.Month) {
583
+ this.dateTimeType = 'month';
584
+ Min = this._dataPipe.transform(Min, 'yyyy-MM');
585
+ Max = this._dataPipe.transform(Max, 'yyyy-MM');
586
+ }
587
+ this.formConfiguration.patchValue({
588
+ 'DateEdit.Min': Min,
589
+ 'DateEdit.Max': Max,
590
+ });
591
+ }
592
+ 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 }); }
593
+ 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" }] }); }
594
+ }
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditConfigComponent, decorators: [{
596
+ type: Component,
597
+ 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>" }]
598
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
599
+ type: Input
600
+ }], selected: [{
601
+ type: Input
602
+ }], Entity: [{
603
+ type: Input
604
+ }], submitclick: [{
605
+ type: ViewChild,
606
+ args: ['submitclick', { static: true }]
607
+ }] } });
608
+
609
+ class DateEditControlComponent {
610
+ constructor(fb, cdr) {
611
+ this.fb = fb;
612
+ this.cdr = cdr;
613
+ this._dataPipe = inject(DatePipe);
614
+ this._DateEditInterfaces = DateEditInterfaces;
615
+ /**字段配置列表 */
616
+ this._fields = '';
617
+ }
618
+ set fields(v) {
619
+ this._fields = v;
620
+ }
621
+ set parentFiledName(v) {
622
+ this._parentFiledName = v;
623
+ }
624
+ set selected(v) {
625
+ this._selected = v;
626
+ }
627
+ set entity(v) {
628
+ this._entity = v;
629
+ this.dataLoaded();
630
+ }
631
+ get entity() {
632
+ return this._entity;
633
+ }
634
+ get extraProperties() {
635
+ return this._entity.get('extraProperties');
636
+ }
637
+ get fieldInput() {
638
+ return this.extraProperties.get(this._fields.field.name);
639
+ }
640
+ /**数据加载完成 */
641
+ async dataLoaded() {
642
+ if (this._fields && this._entity) {
643
+ await this.AfterInit();
644
+ this.cdr.detectChanges();
645
+ this.submitclick.nativeElement.click();
646
+ }
647
+ }
648
+ AfterInit() {
649
+ return new Promise((resolve, rejects) => {
650
+ let ValidatorsArray = [];
651
+ let formConfiguration = this._fields.field.formConfiguration;
652
+ if (this._fields.required) {
653
+ ValidatorsArray.push(Validators.required);
654
+ }
655
+ if (formConfiguration['DateEdit.Min']) {
656
+ ValidatorsArray.push(Validators.min(formConfiguration['DateEdit.Min']));
657
+ }
658
+ if (formConfiguration['DateEdit.Max']) {
659
+ ValidatorsArray.push(Validators.max(formConfiguration['DateEdit.Max']));
660
+ }
661
+ let controlName = this._selected;
662
+ if (this._fields.field.formConfiguration['DateEdit.InputMode'] === DateEditInterfaces.Date) {
663
+ controlName = this._dataPipe.transform(this._selected, 'yyyy-MM-dd');
664
+ }
665
+ if (this._fields.field.formConfiguration['DateEdit.InputMode'] === DateEditInterfaces.DateTime) {
666
+ controlName = this._dataPipe.transform(this._selected, 'yyyy-MM-dd HH:mm:ss');
667
+ }
668
+ if (this._fields.field.formConfiguration['DateEdit.InputMode'] === DateEditInterfaces.Month) {
669
+ controlName = this._dataPipe.transform(this._selected, 'yyyy-MM');
670
+ }
671
+ let newControl = this.fb.control(controlName, ValidatorsArray);
672
+ this.extraProperties.setControl(this._fields.field.name, newControl);
673
+ resolve(true);
674
+ });
675
+ }
676
+ ngOnDestroy() {
677
+ //Called once, before the instance is destroyed.
678
+ //Add 'implements OnDestroy' to the class.
679
+ this.extraProperties.removeControl(this._fields.field.name);
680
+ }
681
+ 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 }); }
682
+ 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"] }] }); }
683
+ }
684
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditControlComponent, decorators: [{
685
+ type: Component,
686
+ 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>" }]
687
+ }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }], propDecorators: { fields: [{
688
+ type: Input
689
+ }], parentFiledName: [{
690
+ type: Input
691
+ }], selected: [{
692
+ type: Input
693
+ }], entity: [{
694
+ type: Input
695
+ }], submitclick: [{
696
+ type: ViewChild,
697
+ args: ['submitclick', { static: true }]
698
+ }] } });
699
+
700
+ class DateEditViewComponent {
701
+ constructor() {
702
+ /**展示则内容 */
703
+ this.showValue = '';
704
+ /**是否显示再列表 */
705
+ this.showInList = false;
706
+ /**表单控件Value */
707
+ this._value = '';
708
+ }
709
+ set value(v) {
710
+ this._value = v;
711
+ }
712
+ async ngAfterContentInit() {
713
+ //Called after ngOnInit when the component's or directive's content has been initialized.
714
+ //Add 'implements AfterContentInit' to the class.
715
+ let valueOptions = this._value;
716
+ if (this.type && valueOptions) {
717
+ this.showValue = valueOptions;
718
+ }
719
+ }
720
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
721
+ 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" }] }); }
722
+ }
723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DateEditViewComponent, decorators: [{
724
+ type: Component,
725
+ 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}" }]
726
+ }], propDecorators: { showInList: [{
727
+ type: Input
728
+ }], fields: [{
729
+ type: Input
730
+ }], type: [{
731
+ type: Input
732
+ }], value: [{
733
+ type: Input
734
+ }] } });
735
+
736
+ class NumericEditViewComponent {
737
+ constructor() {
738
+ /**展示则内容 */
739
+ this.showValue = '';
740
+ /**是否显示再列表 */
741
+ this.showInList = false;
742
+ /**表单控件Value */
743
+ this._value = '';
744
+ }
745
+ set value(v) {
746
+ this._value = v;
747
+ }
748
+ async ngAfterContentInit() {
749
+ //Called after ngOnInit when the component's or directive's content has been initialized.
750
+ //Add 'implements AfterContentInit' to the class.
751
+ let valueOptions = this._value;
752
+ if (this.type && valueOptions) {
753
+ this.showValue = valueOptions;
754
+ }
755
+ }
756
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
757
+ 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"] }] }); }
758
+ }
759
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: NumericEditViewComponent, decorators: [{
760
+ type: Component,
761
+ 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}" }]
762
+ }], propDecorators: { showInList: [{
763
+ type: Input
764
+ }], fields: [{
765
+ type: Input
766
+ }], type: [{
767
+ type: Input
768
+ }], value: [{
769
+ type: Input
770
+ }] } });
771
+
772
+ class SelectConfig {
773
+ constructor(data) {
774
+ /**空值文本 */
775
+ this['Select.NullText'] = ['', []];
776
+ //多选
777
+ this['Select.Multiple'] = [false, []];
778
+ // 选项
779
+ this['Select.Options'] = new FormArray([]);
780
+ if (data) {
781
+ for (const key in data) {
782
+ if (data.hasOwnProperty(key)) {
783
+ this[key] = data[key];
784
+ }
785
+ }
786
+ }
787
+ }
788
+ }
789
+
790
+ class DfApiService {
791
+ constructor() { }
792
+ /**
793
+ * 识别中文转化为拼音,固定返回类型
794
+ * 汉字转拼音
795
+ * 大写转小写
796
+ *
797
+ * */
798
+ chineseToPinyin(value) {
799
+ //去除字符串中所有的空格
800
+ // let val = value
801
+ let val = value.replaceAll(' ', "-");
802
+ let array = val.split('');
803
+ let newArray = [];
804
+ array.forEach((el, index) => {
805
+ //转化为小写
806
+ let elChange = el.toLowerCase();
807
+ let isChinese = (str) => {
808
+ return /^[\u4e00-\u9fa5]+$/.test(str);
809
+ };
810
+ if (isChinese(elChange)) {
811
+ const resultWithoutTone = pinyin(elChange, { toneType: 'none', type: 'array' });
812
+ elChange = resultWithoutTone.toString();
813
+ if (index < array.length - 1)
814
+ elChange += '-';
815
+ }
816
+ ;
817
+ newArray.push(elChange);
818
+ });
819
+ let pinyinstr = newArray.join('');
820
+ return pinyinstr || val;
821
+ }
822
+ /**获取图片的本地连接 */
823
+ getImageLacolBase64Url(file) {
824
+ return new Promise((resolve, rejects) => {
825
+ const reader = new FileReader();
826
+ reader.readAsDataURL(file);
827
+ reader.onload = (e) => {
828
+ resolve(e.target.result);
829
+ };
830
+ reader.onerror = error => rejects(error);
831
+ });
832
+ }
833
+ /**
834
+ * 深拷贝--方法 */
835
+ deepClone(obj) {
836
+ if (typeof obj !== 'object' || obj === null)
837
+ return obj;
838
+ const result = Array.isArray(obj) ? [] : {};
839
+ for (let key in obj) {
840
+ if (obj.hasOwnProperty(key)) {
841
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
842
+ if (obj[key] instanceof Date) {
843
+ result[key] = new Date(obj[key].getTime());
844
+ }
845
+ else if (obj[key] instanceof RegExp) {
846
+ result[key] = new RegExp(obj[key]);
847
+ }
848
+ else {
849
+ result[key] = this.deepClone(obj[key]);
850
+ }
851
+ }
852
+ else {
853
+ result[key] = obj[key];
854
+ }
855
+ }
856
+ }
857
+ return result;
858
+ }
859
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DfApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
860
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DfApiService, providedIn: 'root' }); }
861
+ }
862
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DfApiService, decorators: [{
863
+ type: Injectable,
864
+ args: [{
865
+ providedIn: 'root'
866
+ }]
867
+ }], ctorParameters: () => [] });
868
+
869
+ class SelectConfigComponent {
870
+ constructor(fb, _DfApiService) {
871
+ this.fb = fb;
872
+ this._DfApiService = _DfApiService;
873
+ this.cdr = inject(ChangeDetectorRef);
874
+ }
875
+ set type(v) {
876
+ this._type = v;
877
+ }
878
+ set selected(v) {
879
+ this._selected = v;
880
+ }
881
+ set Entity(v) {
882
+ this._Entity = v;
883
+ this.dataLoaded();
884
+ }
885
+ get formConfiguration() {
886
+ return this._Entity.get('formConfiguration');
887
+ }
888
+ get SelectOptions() {
889
+ return this.formConfiguration.controls['Select.Options'];
890
+ }
891
+ async dataLoaded() {
892
+ if (this._Entity && this._type) {
893
+ await this.AfterInit();
894
+ this.cdr.detectChanges(); // 手动触发变更检测
895
+ this.submitclick?.nativeElement?.click();
896
+ }
897
+ }
898
+ /**增加选项 */
899
+ addSelectOptions() {
900
+ this.SelectOptions.push(new FormGroup({
901
+ Text: new FormControl('', Validators.required),
902
+ Value: new FormControl('', Validators.required),
903
+ Selected: new FormControl(false),
904
+ }));
905
+ }
906
+ /**删除某个选项 */
907
+ deleteSelectOptions(index) {
908
+ this.SelectOptions.removeAt(index);
909
+ }
910
+ AfterInit() {
911
+ return new Promise((resolve, rejects) => {
912
+ this._Entity.setControl('formConfiguration', this.fb.group(new SelectConfig()));
913
+ if (this._selected && this._selected.formControlName == this._type) {
914
+ this._selected.formConfiguration['Select.Options']?.forEach(el => {
915
+ this.addSelectOptions();
916
+ });
917
+ this.formConfiguration.patchValue({
918
+ ...this._selected.formConfiguration,
919
+ });
920
+ }
921
+ else {
922
+ this.addSelectOptions();
923
+ }
924
+ resolve(true);
925
+ });
926
+ }
927
+ textChange(event, index) {
928
+ let SelectOptionsItem = this.SelectOptions.at(index);
929
+ let value = event.target.value;
930
+ if (SelectOptionsItem.get('Value').value)
931
+ return;
932
+ SelectOptionsItem.patchValue({
933
+ Value: this._DfApiService.chineseToPinyin(value),
934
+ });
935
+ }
936
+ 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 }); }
937
+ 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" }] }); }
938
+ }
939
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectConfigComponent, decorators: [{
940
+ type: Component,
941
+ 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>" }]
942
+ }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: DfApiService }], propDecorators: { type: [{
943
+ type: Input
944
+ }], selected: [{
945
+ type: Input
946
+ }], Entity: [{
947
+ type: Input
948
+ }], submitclick: [{
949
+ type: ViewChild,
950
+ args: ['submitclick', { static: true }]
951
+ }] } });
952
+
953
+ class SelectControlComponent {
954
+ constructor(fb) {
955
+ this.fb = fb;
956
+ /**字段配置列表 */
957
+ this._fields = '';
958
+ this.cdr = inject(ChangeDetectorRef);
959
+ this.formConfiguration = '';
960
+ }
961
+ set fields(v) {
962
+ this._fields = v;
963
+ }
964
+ set parentFiledName(v) {
965
+ this._parentFiledName = v;
966
+ }
967
+ set selected(v) {
968
+ this._selected = v;
969
+ }
970
+ set entity(v) {
971
+ this._entity = v;
972
+ this.dataLoaded();
973
+ }
974
+ get extraProperties() {
975
+ return this._entity?.get('extraProperties');
976
+ }
977
+ /**数据加载完成 */
978
+ async dataLoaded() {
979
+ if (this._fields && this._entity) {
980
+ await this.AfterInit();
981
+ this.cdr.detectChanges(); // 手动触发变更检测
982
+ this.submitclick?.nativeElement?.click();
983
+ }
984
+ }
985
+ AfterInit() {
986
+ return new Promise((resolve, rejects) => {
987
+ let ValidatorsArray = [];
988
+ if (this._fields.required) {
989
+ ValidatorsArray.push(Validators.required);
990
+ }
991
+ this.formConfiguration = this._fields.field.formConfiguration;
992
+ if (!this._selected) {
993
+ const isMultiple = this.formConfiguration['Select.Multiple'];
994
+ let selectValue = isMultiple ? [] : '';
995
+ this.formConfiguration['Select.Options'].forEach(el => {
996
+ if (el.Selected) {
997
+ selectValue = isMultiple
998
+ ? [...selectValue, el.value || el.Value]
999
+ : [el.value || el.Value];
1000
+ }
1001
+ });
1002
+ this._selected = selectValue;
1003
+ }
1004
+ let newControl = this.fb.control(this._selected, ValidatorsArray);
1005
+ this.extraProperties.setControl(this._fields.field.name, newControl);
1006
+ resolve(true);
1007
+ });
1008
+ }
1009
+ ngOnDestroy() {
1010
+ //Called once, before the instance is destroyed.
1011
+ //Add 'implements OnDestroy' to the class.
1012
+ this.extraProperties.removeControl(this._fields.field.name);
1013
+ }
1014
+ 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 }); }
1015
+ 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 form-select-multiple\" [nzMaxTagCount]=\"1\"\n nzShowSearch nzMode=\"multiple\"\n formControlName=\"{{_fields.field.name}}\">\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: ["::ng-deep .selectcontrol nz-select{width:100%}::ng-deep .selectcontrol nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .selectcontrol nz-select .anticon-search,::ng-deep .selectcontrol nz-select .anticon-down{display:none}::ng-deep .selectcontrol .ant-select-multiple .ant-select-selection-item{max-width:40%!important}::ng-deep .was-validated .form-select-multiple{border-color:#4fbf67;padding-right:calc(1.5em + 1.35rem);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%234fbf67' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right calc(.375em + .3375rem) center;background-size:calc(.75em + .675rem) calc(.75em + .675rem)}\n"], 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"] }] }); }
1016
+ }
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectControlComponent, decorators: [{
1018
+ type: Component,
1019
+ 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 form-select-multiple\" [nzMaxTagCount]=\"1\"\n nzShowSearch nzMode=\"multiple\"\n formControlName=\"{{_fields.field.name}}\">\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: ["::ng-deep .selectcontrol nz-select{width:100%}::ng-deep .selectcontrol nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .selectcontrol nz-select .anticon-search,::ng-deep .selectcontrol nz-select .anticon-down{display:none}::ng-deep .selectcontrol .ant-select-multiple .ant-select-selection-item{max-width:40%!important}::ng-deep .was-validated .form-select-multiple{border-color:#4fbf67;padding-right:calc(1.5em + 1.35rem);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%234fbf67' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right calc(.375em + .3375rem) center;background-size:calc(.75em + .675rem) calc(.75em + .675rem)}\n"] }]
1020
+ }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { fields: [{
1021
+ type: Input
1022
+ }], parentFiledName: [{
1023
+ type: Input
1024
+ }], selected: [{
1025
+ type: Input
1026
+ }], entity: [{
1027
+ type: Input
1028
+ }], submitclick: [{
1029
+ type: ViewChild,
1030
+ args: ['submitclick', { static: true }]
1031
+ }] } });
1032
+
1033
+ class SelectViewComponent {
1034
+ constructor() {
1035
+ /**展示则内容 */
1036
+ this.showValue = '';
1037
+ /**是否显示再列表 */
1038
+ this.showInList = false;
1039
+ /**表单控件Value */
1040
+ this._value = '';
1041
+ }
1042
+ set value(v) {
1043
+ this._value = v;
1044
+ }
1045
+ async ngAfterContentInit() {
1046
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1047
+ //Add 'implements AfterContentInit' to the class.
1048
+ let valueOptions = this._value;
1049
+ if (this.type && valueOptions) {
1050
+ if (Array.isArray(valueOptions)) {
1051
+ this.showValue = valueOptions.join(',');
1052
+ }
1053
+ else {
1054
+ this.showValue = valueOptions;
1055
+ }
1056
+ }
1057
+ }
1058
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1059
+ 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"] }] }); }
1060
+ }
1061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SelectViewComponent, decorators: [{
1062
+ type: Component,
1063
+ 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}" }]
1064
+ }], propDecorators: { showInList: [{
1065
+ type: Input
1066
+ }], fields: [{
1067
+ type: Input
1068
+ }], type: [{
1069
+ type: Input
1070
+ }], value: [{
1071
+ type: Input
1072
+ }] } });
1073
+
1074
+ class SwitchViewComponent {
1075
+ constructor() {
1076
+ /**展示则内容 */
1077
+ this.showValue = '';
1078
+ /**是否显示再列表 */
1079
+ this.showInList = false;
1080
+ /**表单控件Value */
1081
+ this._value = '';
1082
+ }
1083
+ set value(v) {
1084
+ this._value = v;
1085
+ }
1086
+ async ngAfterContentInit() {
1087
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1088
+ //Add 'implements AfterContentInit' to the class.
1089
+ let valueOptions = this._value;
1090
+ if (this.type && valueOptions) {
1091
+ this.showValue = valueOptions;
1092
+ }
1093
+ }
1094
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1095
+ 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" }] }); }
1096
+ }
1097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SwitchViewComponent, decorators: [{
1098
+ type: Component,
1099
+ 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}" }]
1100
+ }], propDecorators: { showInList: [{
1101
+ type: Input
1102
+ }], fields: [{
1103
+ type: Input
1104
+ }], type: [{
1105
+ type: Input
1106
+ }], value: [{
1107
+ type: Input
1108
+ }] } });
1109
+
1110
+ class TextEditViewComponent {
1111
+ constructor() {
1112
+ /**展示则内容 */
1113
+ this.showValue = '';
1114
+ /**是否显示再列表 */
1115
+ this.showInList = false;
1116
+ /**表单控件Value */
1117
+ this._value = '';
1118
+ }
1119
+ set value(v) {
1120
+ this._value = v;
1121
+ }
1122
+ async ngAfterContentInit() {
1123
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1124
+ //Add 'implements AfterContentInit' to the class.
1125
+ let valueOptions = this._value;
1126
+ if (this.type && valueOptions) {
1127
+ this.showValue = valueOptions;
1128
+ }
1129
+ }
1130
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1131
+ 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"] }] }); }
1132
+ }
1133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TextEditViewComponent, decorators: [{
1134
+ type: Component,
1135
+ 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}" }]
1136
+ }], propDecorators: { showInList: [{
1137
+ type: Input
1138
+ }], fields: [{
1139
+ type: Input
1140
+ }], type: [{
1141
+ type: Input
1142
+ }], value: [{
1143
+ type: Input
1144
+ }] } });
1145
+
1146
+ // import { CkEditorConfigComponent, CkEditorControlComponent } from "./ck-editor";
1147
+ /**
1148
+ * 表单控件分组-包含配置,控件,显示的数组
1149
+ */
1150
+ const FieldControlGroup = [
1151
+ {
1152
+ displayName: '文本框',
1153
+ name: 'TextEdit',
1154
+ fieldConfigComponent: TextEditConfigComponent,
1155
+ fieldComponent: TextEditComponent,
1156
+ fieldViewComponent: TextEditViewComponent,
1157
+ },
1158
+ {
1159
+ displayName: '开关',
1160
+ name: 'Switch',
1161
+ fieldConfigComponent: SwitchConfigComponent,
1162
+ fieldComponent: SwitchControlComponent,
1163
+ fieldViewComponent: SwitchViewComponent,
1164
+ },
1165
+ {
1166
+ displayName: '选择',
1167
+ name: 'Select',
1168
+ fieldConfigComponent: SelectConfigComponent,
1169
+ fieldComponent: SelectControlComponent,
1170
+ fieldViewComponent: SelectViewComponent,
1171
+ },
1172
+ {
1173
+ displayName: '数字',
1174
+ name: 'NumericEdit',
1175
+ fieldConfigComponent: NumbericEditConfigComponent,
1176
+ fieldComponent: NumbericEditControlComponent,
1177
+ fieldViewComponent: NumericEditViewComponent,
1178
+ },
1179
+ {
1180
+ displayName: '日期',
1181
+ name: 'DateEdit',
1182
+ fieldConfigComponent: DateEditConfigComponent,
1183
+ fieldComponent: DateEditControlComponent,
1184
+ fieldViewComponent: DateEditViewComponent,
1185
+ },
1186
+ ];
1187
+ function AddFieldControlGroup(array = []) {
1188
+ for (const element of array) {
1189
+ let find = FieldControlGroup.find((control) => {
1190
+ return control.name === element.name;
1191
+ });
1192
+ if (!find) {
1193
+ FieldControlGroup.push(element);
1194
+ }
1195
+ }
1196
+ return FieldControlGroup;
1197
+ }
1198
+
1199
+ class DynamicComponent {
1200
+ set selected(v) {
1201
+ this._selected = v === undefined ? '' : v === null ? '' : v;
1202
+ }
1203
+ set type(v) {
1204
+ this._type = v;
1205
+ if (this._entity)
1206
+ this.dataLoaded(3);
1207
+ }
1208
+ set culture(v) {
1209
+ this._culture = v;
1210
+ }
1211
+ set parentFiledName(v) {
1212
+ this._parentFiledName = v;
1213
+ }
1214
+ set fields(v) {
1215
+ this._fields = v;
1216
+ }
1217
+ set entity(v) {
1218
+ if (v) {
1219
+ this._entity = v;
1220
+ this.dataLoaded(3);
1221
+ }
1222
+ }
1223
+ constructor(mergedConfig) {
1224
+ this.mergedConfig = mergedConfig;
1225
+ /**字段配置列表 */
1226
+ this._fields = '';
1227
+ }
1228
+ /**数据加载完成 */
1229
+ async dataLoaded(val) {
1230
+ let _fieldControlGroup = AddFieldControlGroup(this.mergedConfig);
1231
+ if (this._entity) {
1232
+ //加载所有的动态表单组件
1233
+ if (this._type) {
1234
+ let fieldControlItem = _fieldControlGroup.find(el => el.name === this._type);
1235
+ this.loadfieldConfigComponent(fieldControlItem);
1236
+ }
1237
+ if (this._fields && this._parentFiledName && this._culture) {
1238
+ /**表单控件组中的项 */
1239
+ let fieldControlItem = _fieldControlGroup.find(el => el.name === this._fields?.field?.formControlName);
1240
+ this.loadfieldComponent(fieldControlItem);
1241
+ }
1242
+ }
1243
+ }
1244
+ /**加载动态表单配置组件 */
1245
+ loadfieldConfigComponent(FieldControlItem) {
1246
+ //清空了容器中的所有组件
1247
+ this.FormControlRef?.clear();
1248
+ if (!FieldControlItem || !FieldControlItem.fieldConfigComponent)
1249
+ return;
1250
+ //在容器中创建组件
1251
+ const { instance } = this.FormControlRef?.createComponent(FieldControlItem.fieldConfigComponent); //创建组件模板
1252
+ /**向创建的组件模板中传值 */
1253
+ instance.selected = this._selected;
1254
+ instance.type = this._type;
1255
+ instance.Entity = this._entity;
1256
+ }
1257
+ /**加载动态表单组件 */
1258
+ loadfieldComponent(FieldControlItem) {
1259
+ // this.FormControlRef.clear
1260
+ //清空了容器中的所有组件
1261
+ this.FormComponentsRef?.clear();
1262
+ if (!FieldControlItem || !FieldControlItem.fieldComponent)
1263
+ return;
1264
+ //在容器中创建组件
1265
+ const { instance } = this.FormComponentsRef?.createComponent(FieldControlItem.fieldComponent); //创建组件模板
1266
+ /**向创建的组件模板中传值 */
1267
+ instance.fields = this._fields;
1268
+ instance.parentFiledName = this._parentFiledName;
1269
+ instance.selected = this._selected;
1270
+ instance.culture = this._culture;
1271
+ instance.entity = this._entity;
1272
+ }
1273
+ 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 }); }
1274
+ 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: [""] }); }
1275
+ }
1276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicComponent, decorators: [{
1277
+ type: Component,
1278
+ args: [{ selector: 'df-dynamic', template: "<template #FormControlRef></template>\n<template #FormComponentsRef></template>" }]
1279
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1280
+ type: Inject,
1281
+ args: ['MERGED_FORM_CONFIG']
1282
+ }] }], propDecorators: { selected: [{
1283
+ type: Input
1284
+ }], type: [{
1285
+ type: Input
1286
+ }], culture: [{
1287
+ type: Input
1288
+ }], parentFiledName: [{
1289
+ type: Input
1290
+ }], fields: [{
1291
+ type: Input
1292
+ }], entity: [{
1293
+ type: Input
1294
+ }], FormControlRef: [{
1295
+ type: ViewChild,
1296
+ args: ['FormControlRef', { read: ViewContainerRef, static: true }]
1297
+ }], FormComponentsRef: [{
1298
+ type: ViewChild,
1299
+ args: ['FormComponentsRef', { read: ViewContainerRef, static: true }]
1300
+ }] } });
1301
+
1302
+ class FormControlService {
1303
+ constructor(mergedConfig) {
1304
+ this.mergedConfig = mergedConfig;
1305
+ this._FieldControlGroup = FieldControlGroup;
1306
+ }
1307
+ AddFieldControlGroup() {
1308
+ let array = this.mergedConfig;
1309
+ for (const element of array) {
1310
+ let find = FieldControlGroup.find(control => {
1311
+ return control.name === element.name;
1312
+ });
1313
+ if (!find) {
1314
+ FieldControlGroup.push(element);
1315
+ }
1316
+ }
1317
+ return FieldControlGroup;
1318
+ }
1319
+ 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 }); }
1320
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormControlService, providedIn: 'root' }); }
1321
+ }
1322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormControlService, decorators: [{
1323
+ type: Injectable,
1324
+ args: [{
1325
+ providedIn: 'root',
1326
+ }]
1327
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1328
+ type: Inject,
1329
+ args: ['MERGED_FORM_CONFIG']
1330
+ }] }] });
1331
+
1332
+ class DynamicViewComponent {
1333
+ constructor(_FormControlService) {
1334
+ this._FormControlService = _FormControlService;
1335
+ /**是否显示再列表 */
1336
+ this.showInList = false;
1337
+ /**表单控件Value */
1338
+ this._value = '';
1339
+ }
1340
+ set value(v) {
1341
+ this._value = v;
1342
+ // if(this._value) this.dataLoaded();
1343
+ }
1344
+ ngAfterContentInit() {
1345
+ //Called after ngOnInit when the component's or directive's content has been initialized.
1346
+ //Add 'implements AfterContentInit' to the class.
1347
+ if (this.type && this._value) {
1348
+ let _fieldControlGroup = this._FormControlService.AddFieldControlGroup();
1349
+ let fieldControlItem = _fieldControlGroup.find(el => el.name === this.type);
1350
+ this.loadViewComponent(fieldControlItem);
1351
+ }
1352
+ }
1353
+ /**加载动态展示组件 */
1354
+ loadViewComponent(FieldControlItem) {
1355
+ //清空了容器中的所有组件
1356
+ this.FormTemplateRef?.clear();
1357
+ if (!FieldControlItem || !FieldControlItem.fieldViewComponent)
1358
+ return;
1359
+ //在容器中创建组件
1360
+ const { instance } = this.FormTemplateRef?.createComponent(FieldControlItem.fieldViewComponent); //创建组件模板
1361
+ /**向创建的组件模板中传值 */
1362
+ instance.type = this.type;
1363
+ instance.value = this._value;
1364
+ instance.fields = this.fields;
1365
+ instance.showInList = this.showInList;
1366
+ }
1367
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicViewComponent, deps: [{ token: FormControlService }], target: i0.ɵɵFactoryTarget.Component }); }
1368
+ 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: [""] }); }
1369
+ }
1370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicViewComponent, decorators: [{
1371
+ type: Component,
1372
+ args: [{ selector: 'df-dynamic-view', template: "<template #FormTemplateRef></template>" }]
1373
+ }], ctorParameters: () => [{ type: FormControlService }], propDecorators: { showInList: [{
1374
+ type: Input
1375
+ }], fields: [{
1376
+ type: Input
1377
+ }], type: [{
1378
+ type: Input
1379
+ }], value: [{
1380
+ type: Input
1381
+ }], FormTemplateRef: [{
1382
+ type: ViewChild,
1383
+ args: ['FormTemplateRef', { read: ViewContainerRef, static: true }]
1384
+ }] } });
1385
+
1386
+ class DynamicConfigComponent {
1387
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1388
+ 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: [""] }); }
1389
+ }
1390
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicConfigComponent, decorators: [{
1391
+ type: Component,
1392
+ args: [{ selector: 'df-dynamic-config', template: "<p>dynamic-config works!</p>\r\n" }]
1393
+ }] });
1394
+
1395
+ class DynamicControlComponent {
1396
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1397
+ 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: [""] }); }
1398
+ }
1399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicControlComponent, decorators: [{
1400
+ type: Component,
1401
+ args: [{ selector: 'df-dynamic-control', template: "<p>dynamic-control works!</p>\r\n" }]
1402
+ }] });
1403
+
1404
+ class DynamicFormModule {
1405
+ static forRoot(config) {
1406
+ return {
1407
+ ngModule: DynamicFormModule,
1408
+ providers: []
1409
+ };
1410
+ }
1411
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1412
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, declarations: [TextEditConfigComponent,
1413
+ TextEditComponent,
1414
+ SwitchConfigComponent,
1415
+ SwitchControlComponent,
1416
+ NumbericEditConfigComponent,
1417
+ NumbericEditControlComponent,
1418
+ DateEditConfigComponent,
1419
+ DateEditControlComponent,
1420
+ SelectConfigComponent,
1421
+ SelectControlComponent,
1422
+ DynamicComponent,
1423
+ DynamicConfigComponent,
1424
+ DynamicViewComponent,
1425
+ DynamicControlComponent,
1426
+ SelectViewComponent,
1427
+ SwitchViewComponent,
1428
+ TextEditViewComponent,
1429
+ DateEditViewComponent,
1430
+ NumericEditViewComponent], imports: [FormsModule,
1431
+ CoreModule,
1432
+ ThemeSharedModule,
1433
+ ReactiveFormsModule,
1434
+ NgbDropdownModule,
1435
+ NzSelectModule], exports: [TextEditConfigComponent,
1436
+ TextEditComponent,
1437
+ SwitchConfigComponent,
1438
+ SwitchControlComponent,
1439
+ NumbericEditConfigComponent,
1440
+ NumbericEditControlComponent,
1441
+ DateEditConfigComponent,
1442
+ DateEditControlComponent,
1443
+ SelectConfigComponent,
1444
+ SelectControlComponent,
1445
+ DynamicComponent,
1446
+ DynamicConfigComponent,
1447
+ DynamicViewComponent,
1448
+ DynamicControlComponent] }); }
1449
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, imports: [FormsModule,
1450
+ CoreModule,
1451
+ ThemeSharedModule,
1452
+ ReactiveFormsModule,
1453
+ NgbDropdownModule,
1454
+ NzSelectModule] }); }
1455
+ }
1456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: DynamicFormModule, decorators: [{
1457
+ type: NgModule,
1458
+ args: [{
1459
+ declarations: [
1460
+ TextEditConfigComponent,
1461
+ TextEditComponent,
1462
+ SwitchConfigComponent,
1463
+ SwitchControlComponent,
1464
+ NumbericEditConfigComponent,
1465
+ NumbericEditControlComponent,
1466
+ DateEditConfigComponent,
1467
+ DateEditControlComponent,
1468
+ SelectConfigComponent,
1469
+ SelectControlComponent,
1470
+ DynamicComponent,
1471
+ DynamicConfigComponent,
1472
+ DynamicViewComponent,
1473
+ DynamicControlComponent,
1474
+ SelectViewComponent,
1475
+ SwitchViewComponent,
1476
+ TextEditViewComponent,
1477
+ DateEditViewComponent,
1478
+ NumericEditViewComponent,
1479
+ ],
1480
+ imports: [
1481
+ FormsModule,
1482
+ CoreModule,
1483
+ ThemeSharedModule,
1484
+ ReactiveFormsModule,
1485
+ NgbDropdownModule,
1486
+ NzSelectModule,
1487
+ // NzTreeModule,
1488
+ ],
1489
+ exports: [
1490
+ TextEditConfigComponent,
1491
+ TextEditComponent,
1492
+ SwitchConfigComponent,
1493
+ SwitchControlComponent,
1494
+ NumbericEditConfigComponent,
1495
+ NumbericEditControlComponent,
1496
+ DateEditConfigComponent,
1497
+ DateEditControlComponent,
1498
+ SelectConfigComponent,
1499
+ SelectControlComponent,
1500
+ DynamicComponent,
1501
+ DynamicConfigComponent,
1502
+ DynamicViewComponent,
1503
+ DynamicControlComponent,
1504
+ ],
1505
+ providers: [],
1506
+ }]
1507
+ }] });
1508
+
1509
+ /*
1510
+ * Public API Surface of dynamic-form
1511
+ */
1512
+
1513
+ /**
1514
+ * Generated bundle index. Do not edit.
1515
+ */
1516
+
1517
+ export { AddFieldControlGroup, DateEditConfigComponent, DateEditControlComponent, DynamicComponent, DynamicConfigComponent, DynamicControlComponent, DynamicFormModule, DynamicViewComponent, FieldControlGroup, NumbericEditConfigComponent, NumbericEditControlComponent, SelectConfigComponent, SelectControlComponent, SwitchConfigComponent, SwitchControlComponent, TextEditComponent, TextEditConfig, TextEditConfigComponent, maxDecimalPlacesValidator };
1518
+ //# sourceMappingURL=dignite-ng-expand.dynamic-form.mjs.map