@dignite-ng/expand.dynamic-form 3.0.0-rc.6 → 3.0.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/dignite-ng-expand.dynamic-form.mjs +5 -0
- package/esm2022/lib/components/dynamic/dynamic.component.mjs +106 -0
- package/esm2022/lib/components/dynamic/index.mjs +2 -0
- package/esm2022/lib/components/form/date-edit/date-edit-config.component.mjs +90 -0
- package/esm2022/lib/components/form/date-edit/date-edit-config.mjs +12 -0
- package/esm2022/lib/components/form/date-edit/date-edit-control.component.mjs +99 -0
- package/esm2022/lib/components/form/date-edit/index.mjs +3 -0
- package/esm2022/lib/components/form/form-control-group.mjs +60 -0
- package/esm2022/lib/components/form/index.mjs +7 -0
- package/esm2022/lib/components/form/numeric-edit/index.mjs +3 -0
- package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.component.mjs +60 -0
- package/esm2022/lib/components/form/numeric-edit/numberic-edit-config.mjs +25 -0
- package/esm2022/lib/components/form/numeric-edit/numberic-edit-control.component.mjs +106 -0
- package/esm2022/lib/components/form/select/index.mjs +3 -0
- package/esm2022/lib/components/form/select/select-config.component.mjs +93 -0
- package/esm2022/lib/components/form/select/select-config.mjs +19 -0
- package/esm2022/lib/components/form/select/select-control.component.mjs +87 -0
- package/esm2022/lib/components/form/switch/index.mjs +3 -0
- package/esm2022/lib/components/form/switch/switch-config.component.mjs +61 -0
- package/esm2022/lib/components/form/switch/switch-config.mjs +14 -0
- package/esm2022/lib/components/form/switch/switch-control.component.mjs +80 -0
- package/esm2022/lib/components/form/text-edit/index.mjs +4 -0
- package/esm2022/lib/components/form/text-edit/text-edit-config.component.mjs +63 -0
- package/esm2022/lib/components/form/text-edit/text-edit-config.mjs +18 -0
- package/esm2022/lib/components/form/text-edit/text-edit.component.mjs +89 -0
- package/esm2022/lib/components/index.mjs +3 -0
- package/esm2022/lib/dynamic-form.module.mjs +92 -0
- package/esm2022/lib/enums/date-edit-interfaces.mjs +16 -0
- package/esm2022/lib/enums/text-edit-mode.mjs +8 -0
- package/esm2022/lib/interfaces/form-config-interfaces.mjs +2 -0
- package/esm2022/lib/interfaces/index.mjs +2 -0
- package/esm2022/lib/services/df-api.service.mjs +82 -0
- package/esm2022/lib/services/index.mjs +2 -0
- package/esm2022/public-api.mjs +7 -0
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs +1209 -0
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dynamic/dynamic.component.d.ts +38 -0
- package/lib/components/dynamic/index.d.ts +1 -0
- package/lib/components/form/date-edit/date-edit-config.component.d.ts +29 -0
- package/lib/components/form/date-edit/date-edit-config.d.ts +9 -0
- package/lib/components/form/date-edit/date-edit-control.component.d.ts +33 -0
- package/lib/components/form/date-edit/index.d.ts +2 -0
- package/lib/components/form/form-control-group.d.ts +6 -0
- package/lib/components/form/index.d.ts +6 -0
- package/lib/components/form/numeric-edit/index.d.ts +2 -0
- package/lib/components/form/numeric-edit/numberic-edit-config.component.d.ts +23 -0
- package/lib/components/form/numeric-edit/numberic-edit-config.d.ts +11 -0
- package/lib/components/form/numeric-edit/numberic-edit-control.component.d.ts +34 -0
- package/lib/components/form/select/index.d.ts +2 -0
- package/lib/components/form/select/select-config.component.d.ts +31 -0
- package/lib/components/form/select/select-config.d.ts +7 -0
- package/lib/components/form/select/select-control.component.d.ts +29 -0
- package/lib/components/form/switch/index.d.ts +2 -0
- package/lib/components/form/switch/switch-config.component.d.ts +23 -0
- package/lib/components/form/switch/switch-config.d.ts +5 -0
- package/lib/components/form/switch/switch-control.component.d.ts +28 -0
- package/lib/components/form/text-edit/index.d.ts +3 -0
- package/lib/components/form/text-edit/text-edit-config.component.d.ts +25 -0
- package/lib/components/form/text-edit/text-edit-config.d.ts +7 -0
- package/lib/components/form/text-edit/text-edit.component.d.ts +30 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/dynamic-form.module.d.ts +24 -0
- package/lib/enums/date-edit-interfaces.d.ts +5 -0
- package/lib/enums/text-edit-mode.d.ts +4 -0
- package/{src/lib/interfaces/form-config-interfaces.ts → lib/interfaces/form-config-interfaces.d.ts} +2 -7
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/services/df-api.service.d.ts +18 -0
- package/lib/services/index.d.ts +1 -0
- package/package.json +15 -2
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/ng-package.json +0 -7
- package/src/lib/components/dynamic/dynamic.component.html +0 -2
- package/src/lib/components/dynamic/dynamic.component.scss +0 -0
- package/src/lib/components/dynamic/dynamic.component.spec.ts +0 -21
- package/src/lib/components/dynamic/dynamic.component.ts +0 -121
- package/src/lib/components/dynamic/index.ts +0 -1
- package/src/lib/components/form/date-edit/date-edit-config.component.html +0 -40
- package/src/lib/components/form/date-edit/date-edit-config.component.scss +0 -0
- package/src/lib/components/form/date-edit/date-edit-config.component.spec.ts +0 -21
- package/src/lib/components/form/date-edit/date-edit-config.component.ts +0 -87
- package/src/lib/components/form/date-edit/date-edit-config.ts +0 -14
- package/src/lib/components/form/date-edit/date-edit-control.component.html +0 -26
- package/src/lib/components/form/date-edit/date-edit-control.component.scss +0 -0
- package/src/lib/components/form/date-edit/date-edit-control.component.spec.ts +0 -21
- package/src/lib/components/form/date-edit/date-edit-control.component.ts +0 -101
- package/src/lib/components/form/date-edit/index.ts +0 -2
- package/src/lib/components/form/form-control-group.ts +0 -64
- package/src/lib/components/form/index.ts +0 -6
- package/src/lib/components/form/numeric-edit/index.ts +0 -2
- package/src/lib/components/form/numeric-edit/numberic-edit-config.component.html +0 -31
- package/src/lib/components/form/numeric-edit/numberic-edit-config.component.scss +0 -0
- package/src/lib/components/form/numeric-edit/numberic-edit-config.component.spec.ts +0 -21
- package/src/lib/components/form/numeric-edit/numberic-edit-config.component.ts +0 -57
- package/src/lib/components/form/numeric-edit/numberic-edit-config.ts +0 -28
- package/src/lib/components/form/numeric-edit/numberic-edit-control.component.html +0 -13
- package/src/lib/components/form/numeric-edit/numberic-edit-control.component.scss +0 -0
- package/src/lib/components/form/numeric-edit/numberic-edit-control.component.spec.ts +0 -21
- package/src/lib/components/form/numeric-edit/numberic-edit-control.component.ts +0 -119
- package/src/lib/components/form/select/index.ts +0 -2
- package/src/lib/components/form/select/select-config.component.html +0 -59
- package/src/lib/components/form/select/select-config.component.scss +0 -0
- package/src/lib/components/form/select/select-config.component.spec.ts +0 -21
- package/src/lib/components/form/select/select-config.component.ts +0 -90
- package/src/lib/components/form/select/select-config.ts +0 -24
- package/src/lib/components/form/select/select-control.component.html +0 -32
- package/src/lib/components/form/select/select-control.component.scss +0 -32
- package/src/lib/components/form/select/select-control.component.spec.ts +0 -21
- package/src/lib/components/form/select/select-control.component.ts +0 -86
- package/src/lib/components/form/switch/index.ts +0 -2
- package/src/lib/components/form/switch/switch-config.component.html +0 -17
- package/src/lib/components/form/switch/switch-config.component.scss +0 -0
- package/src/lib/components/form/switch/switch-config.component.spec.ts +0 -21
- package/src/lib/components/form/switch/switch-config.component.ts +0 -58
- package/src/lib/components/form/switch/switch-config.ts +0 -17
- package/src/lib/components/form/switch/switch-control.component.html +0 -13
- package/src/lib/components/form/switch/switch-control.component.scss +0 -0
- package/src/lib/components/form/switch/switch-control.component.spec.ts +0 -21
- package/src/lib/components/form/switch/switch-control.component.ts +0 -81
- package/src/lib/components/form/text-edit/index.ts +0 -3
- package/src/lib/components/form/text-edit/text-edit-config.component.html +0 -32
- package/src/lib/components/form/text-edit/text-edit-config.component.scss +0 -0
- package/src/lib/components/form/text-edit/text-edit-config.component.spec.ts +0 -21
- package/src/lib/components/form/text-edit/text-edit-config.component.ts +0 -59
- package/src/lib/components/form/text-edit/text-edit-config.ts +0 -24
- package/src/lib/components/form/text-edit/text-edit.component.html +0 -17
- package/src/lib/components/form/text-edit/text-edit.component.scss +0 -0
- package/src/lib/components/form/text-edit/text-edit.component.spec.ts +0 -21
- package/src/lib/components/form/text-edit/text-edit.component.ts +0 -91
- package/src/lib/components/index.ts +0 -2
- package/src/lib/dynamic-form.module.ts +0 -74
- package/src/lib/enums/date-edit-interfaces.ts +0 -16
- package/src/lib/enums/index.ts +0 -2
- package/src/lib/enums/text-edit-mode.ts +0 -7
- package/src/lib/interfaces/index.ts +0 -1
- package/src/lib/proxy/README.md +0 -17
- package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
- package/src/lib/proxy/dignite/file-explorer/directories/index.ts +0 -2
- package/src/lib/proxy/dignite/file-explorer/directories/models.ts +0 -35
- package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
- package/src/lib/proxy/dignite/file-explorer/files/index.ts +0 -2
- package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -57
- package/src/lib/proxy/dignite/file-explorer/index.ts +0 -3
- package/src/lib/proxy/dignite/index.ts +0 -2
- package/src/lib/proxy/generate-proxy.json +0 -11810
- package/src/lib/proxy/index.ts +0 -4
- package/src/lib/proxy/microsoft/asp-net-core/index.ts +0 -2
- package/src/lib/proxy/microsoft/asp-net-core/mvc/index.ts +0 -1
- package/src/lib/proxy/microsoft/asp-net-core/mvc/models.ts +0 -12
- package/src/lib/proxy/microsoft/extensions/index.ts +0 -2
- package/src/lib/proxy/microsoft/extensions/primitives/index.ts +0 -1
- package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
- package/src/lib/proxy/microsoft/index.ts +0 -4
- package/src/lib/proxy/microsoft/net/http/headers/index.ts +0 -1
- package/src/lib/proxy/microsoft/net/http/headers/models.ts +0 -7
- package/src/lib/proxy/microsoft/net/http/index.ts +0 -2
- package/src/lib/proxy/microsoft/net/index.ts +0 -2
- package/src/lib/proxy/volo/abp/content/index.ts +0 -1
- package/src/lib/proxy/volo/abp/content/models.ts +0 -6
- package/src/lib/proxy/volo/abp/index.ts +0 -2
- package/src/lib/proxy/volo/index.ts +0 -2
- package/src/lib/services/df-api.service.ts +0 -75
- package/src/lib/services/index.ts +0 -1
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SwitchControlComponent {
|
|
5
|
+
private fb;
|
|
6
|
+
constructor(fb: FormBuilder);
|
|
7
|
+
/**表单实体 */
|
|
8
|
+
_entity: FormGroup | undefined;
|
|
9
|
+
set entity(v: any);
|
|
10
|
+
/**字段配置列表 */
|
|
11
|
+
_fields: any;
|
|
12
|
+
set fields(v: any);
|
|
13
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
14
|
+
_parentFiledName: any;
|
|
15
|
+
set parentFiledName(v: any);
|
|
16
|
+
/** */
|
|
17
|
+
_selected: any;
|
|
18
|
+
set selected(v: any);
|
|
19
|
+
submitclick: ElementRef;
|
|
20
|
+
get extraProperties(): FormGroup;
|
|
21
|
+
private cdr;
|
|
22
|
+
/**数据加载完成 */
|
|
23
|
+
dataLoaded(): Promise<void>;
|
|
24
|
+
AfterInit(): Promise<unknown>;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SwitchControlComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SwitchControlComponent, "df-switch-control", never, { "entity": { "alias": "entity"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "parentFiledName": { "alias": "parentFiledName"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, {}, never, never, false, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { TextEditMode } from '../../../enums/text-edit-mode';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TextEditConfigComponent {
|
|
6
|
+
private fb;
|
|
7
|
+
constructor(fb: FormBuilder);
|
|
8
|
+
_TextEditMode: typeof TextEditMode;
|
|
9
|
+
/**表单控件类型 */
|
|
10
|
+
_type: any;
|
|
11
|
+
set type(v: any);
|
|
12
|
+
/**表单实体 */
|
|
13
|
+
_Entity: FormGroup | undefined;
|
|
14
|
+
set Entity(v: FormGroup);
|
|
15
|
+
/**选择的表单信息 */
|
|
16
|
+
_selected: any;
|
|
17
|
+
set selected(v: any);
|
|
18
|
+
get formConfiguration(): FormGroup;
|
|
19
|
+
submitclick: ElementRef;
|
|
20
|
+
private cdr;
|
|
21
|
+
dataLoaded(): Promise<void>;
|
|
22
|
+
AfterInit(): Promise<unknown>;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextEditConfigComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextEditConfigComponent, "df-text-edit-config", never, { "type": { "alias": "type"; "required": false; }; "Entity": { "alias": "Entity"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, {}, never, never, false, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { TextEditMode } from '../../../enums/text-edit-mode';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TextEditComponent {
|
|
6
|
+
private fb;
|
|
7
|
+
constructor(fb: FormBuilder);
|
|
8
|
+
_TextEditMode: typeof TextEditMode;
|
|
9
|
+
/**表单实体 */
|
|
10
|
+
_entity: FormGroup | undefined;
|
|
11
|
+
set entity(v: any);
|
|
12
|
+
/**字段配置列表 */
|
|
13
|
+
_fields: any;
|
|
14
|
+
set fields(v: any);
|
|
15
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
16
|
+
_parentFiledName: any;
|
|
17
|
+
set parentFiledName(v: any);
|
|
18
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
19
|
+
_selected: any;
|
|
20
|
+
set selected(v: any);
|
|
21
|
+
submitclick: ElementRef;
|
|
22
|
+
extraProperties: FormGroup | undefined;
|
|
23
|
+
private cdr;
|
|
24
|
+
dataLoaded(): Promise<void>;
|
|
25
|
+
AfterInit(): Promise<unknown>;
|
|
26
|
+
ngOnDestroy(): void;
|
|
27
|
+
isObjEmpty: (obj: any) => boolean;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextEditComponent, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextEditComponent, "df-text-edit", never, { "entity": { "alias": "entity"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "parentFiledName": { "alias": "parentFiledName"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, {}, never, never, false, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "./components/form/text-edit/text-edit-config.component";
|
|
4
|
+
import * as i2 from "./components/form/text-edit/text-edit.component";
|
|
5
|
+
import * as i3 from "./components/form/switch/switch-config.component";
|
|
6
|
+
import * as i4 from "./components/form/switch/switch-control.component";
|
|
7
|
+
import * as i5 from "./components/form/numeric-edit/numberic-edit-config.component";
|
|
8
|
+
import * as i6 from "./components/form/numeric-edit/numberic-edit-control.component";
|
|
9
|
+
import * as i7 from "./components/form/date-edit/date-edit-config.component";
|
|
10
|
+
import * as i8 from "./components/form/date-edit/date-edit-control.component";
|
|
11
|
+
import * as i9 from "./components/form/select/select-config.component";
|
|
12
|
+
import * as i10 from "./components/form/select/select-control.component";
|
|
13
|
+
import * as i11 from "./components/dynamic/dynamic.component";
|
|
14
|
+
import * as i12 from "@angular/forms";
|
|
15
|
+
import * as i13 from "@abp/ng.core";
|
|
16
|
+
import * as i14 from "@abp/ng.theme.shared";
|
|
17
|
+
import * as i15 from "@ng-bootstrap/ng-bootstrap";
|
|
18
|
+
import * as i16 from "ng-zorro-antd/select";
|
|
19
|
+
export declare class DynamicFormModule {
|
|
20
|
+
static forRoot(config?: any): ModuleWithProviders<DynamicFormModule>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormModule, never>;
|
|
22
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DynamicFormModule, [typeof i1.TextEditConfigComponent, typeof i2.TextEditComponent, typeof i3.SwitchConfigComponent, typeof i4.SwitchControlComponent, typeof i5.NumbericEditConfigComponent, typeof i6.NumbericEditControlComponent, typeof i7.DateEditConfigComponent, typeof i8.DateEditControlComponent, typeof i9.SelectConfigComponent, typeof i10.SelectControlComponent, typeof i11.DynamicComponent], [typeof i12.FormsModule, typeof i13.CoreModule, typeof i14.ThemeSharedModule, typeof i12.ReactiveFormsModule, typeof i15.NgbDropdownModule, typeof i16.NzSelectModule], [typeof i1.TextEditConfigComponent, typeof i2.TextEditComponent, typeof i3.SwitchConfigComponent, typeof i4.SwitchControlComponent, typeof i5.NumbericEditConfigComponent, typeof i6.NumbericEditControlComponent, typeof i7.DateEditConfigComponent, typeof i8.DateEditControlComponent, typeof i9.SelectConfigComponent, typeof i10.SelectControlComponent, typeof i11.DynamicComponent]>;
|
|
23
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DynamicFormModule>;
|
|
24
|
+
}
|
package/{src/lib/interfaces/form-config-interfaces.ts → lib/interfaces/form-config-interfaces.d.ts}
RENAMED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import { Type } from "@angular/core";
|
|
2
|
-
|
|
3
2
|
export interface FieldControlGroupInterfaces {
|
|
4
|
-
displayName: string
|
|
5
|
-
name: string
|
|
6
|
-
// type: TextEditMode,
|
|
3
|
+
displayName: string;
|
|
4
|
+
name: string;
|
|
7
5
|
/**
|
|
8
6
|
* 动态表单控件
|
|
9
7
|
*/
|
|
10
8
|
fieldComponent?: Type<any>;
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* 表单控件配置组件
|
|
14
11
|
*/
|
|
15
12
|
fieldConfigComponent?: Type<any>;
|
|
16
|
-
|
|
17
13
|
/**
|
|
18
14
|
* 条目列表中显示的组件
|
|
19
15
|
*/
|
|
20
16
|
fieldViewComponent?: Type<any>;
|
|
21
17
|
}
|
|
22
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './form-config-interfaces';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class DfApiService {
|
|
3
|
+
constructor();
|
|
4
|
+
/**
|
|
5
|
+
* 识别中文转化为拼音,固定返回类型
|
|
6
|
+
* 汉字转拼音
|
|
7
|
+
* 大写转小写
|
|
8
|
+
*
|
|
9
|
+
* */
|
|
10
|
+
chineseToPinyin(value: any): any;
|
|
11
|
+
/**获取图片的本地连接 */
|
|
12
|
+
getImageLacolBase64Url(file: File): Promise<unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* 深拷贝--方法 */
|
|
15
|
+
deepClone(obj: any): any;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DfApiService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DfApiService>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './df-api.service';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dignite-ng/expand.dynamic-form",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "~18.1.0",
|
|
6
6
|
"@angular/core": "~18.1.0"
|
|
@@ -12,5 +12,18 @@
|
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public",
|
|
14
14
|
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
},
|
|
16
|
+
"module": "fesm2022/dignite-ng-expand.dynamic-form.mjs",
|
|
17
|
+
"typings": "index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./package.json": {
|
|
20
|
+
"default": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./index.d.ts",
|
|
24
|
+
"esm2022": "./esm2022/dignite-ng-expand.dynamic-form.mjs",
|
|
25
|
+
"esm": "./esm2022/dignite-ng-expand.dynamic-form.mjs",
|
|
26
|
+
"default": "./fesm2022/dignite-ng-expand.dynamic-form.mjs"
|
|
27
|
+
}
|
|
15
28
|
}
|
|
16
|
-
}
|
|
29
|
+
}
|
package/ng-package.json
DELETED
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DynamicComponent } from './dynamic.component';
|
|
4
|
-
|
|
5
|
-
describe('DynamicComponent', () => {
|
|
6
|
-
let component: DynamicComponent;
|
|
7
|
-
let fixture: ComponentFixture<DynamicComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [DynamicComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(DynamicComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Component, Inject, Input, ViewChild, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { FieldControlGroupInterfaces } from '../../interfaces';
|
|
4
|
-
import { AddFieldControlGroup, } from '../form';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'df-dynamic',
|
|
8
|
-
templateUrl: './dynamic.component.html',
|
|
9
|
-
styleUrls: ['./dynamic.component.scss'],
|
|
10
|
-
})
|
|
11
|
-
export class DynamicComponent {
|
|
12
|
-
|
|
13
|
-
/**选择的表单信息 */
|
|
14
|
-
_selected: any;
|
|
15
|
-
@Input()
|
|
16
|
-
public set selected(v: any) {
|
|
17
|
-
this._selected = v === undefined ? '' : v === null ? '' : v;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**表单控件类型 */
|
|
21
|
-
_type: string;
|
|
22
|
-
@Input()
|
|
23
|
-
public set type(v: string) {
|
|
24
|
-
this._type = v;
|
|
25
|
-
if (this._entity) this.dataLoaded(3);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**语言 */
|
|
29
|
-
_culture: FormGroup | undefined;
|
|
30
|
-
@Input()
|
|
31
|
-
public set culture(v: any) {
|
|
32
|
-
this._culture = v;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
36
|
-
_parentFiledName: any;
|
|
37
|
-
@Input()
|
|
38
|
-
public set parentFiledName(v: any) {
|
|
39
|
-
this._parentFiledName = v;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**字段配置列表 */
|
|
43
|
-
_fields: any = '';
|
|
44
|
-
@Input()
|
|
45
|
-
public set fields(v: any) {
|
|
46
|
-
this._fields = v;
|
|
47
|
-
}
|
|
48
|
-
/**表单实体 */
|
|
49
|
-
_entity: FormGroup | undefined;
|
|
50
|
-
@Input()
|
|
51
|
-
public set entity(v: any) {
|
|
52
|
-
if (v) {
|
|
53
|
-
this._entity = v;
|
|
54
|
-
this.dataLoaded(3);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**表单控件模板-动态表单配置组件 */
|
|
59
|
-
@ViewChild('FormControlRef', { read: ViewContainerRef, static: true })
|
|
60
|
-
FormControlRef?: ViewContainerRef;
|
|
61
|
-
|
|
62
|
-
/**表单控件模板-动态表单组件 */
|
|
63
|
-
@ViewChild('FormComponentsRef', { read: ViewContainerRef, static: true })
|
|
64
|
-
FormComponentsRef?: ViewContainerRef;
|
|
65
|
-
|
|
66
|
-
constructor(@Inject('MERGED_FORM_CONFIG') private mergedConfig: any[]) {}
|
|
67
|
-
|
|
68
|
-
/**数据加载完成 */
|
|
69
|
-
async dataLoaded(val) {
|
|
70
|
-
let _fieldControlGroup: any[] = AddFieldControlGroup(this.mergedConfig);
|
|
71
|
-
if (this._entity) {
|
|
72
|
-
//加载所有的动态表单组件
|
|
73
|
-
if (this._type) {
|
|
74
|
-
let fieldControlItem = _fieldControlGroup.find(el => el.name === this._type);
|
|
75
|
-
this.loadfieldConfigComponent(fieldControlItem);
|
|
76
|
-
}
|
|
77
|
-
if (this._fields && this._parentFiledName && this._culture) {
|
|
78
|
-
|
|
79
|
-
/**表单控件组中的项 */
|
|
80
|
-
let fieldControlItem = _fieldControlGroup.find(
|
|
81
|
-
el => el.name === this._fields?.field?.formControlName
|
|
82
|
-
);
|
|
83
|
-
this.loadfieldComponent(fieldControlItem);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**加载动态表单配置组件 */
|
|
89
|
-
loadfieldConfigComponent(FieldControlItem?: FieldControlGroupInterfaces) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
//清空了容器中的所有组件
|
|
93
|
-
this.FormControlRef?.clear();
|
|
94
|
-
if (!FieldControlItem || !FieldControlItem.fieldConfigComponent) return;
|
|
95
|
-
//在容器中创建组件
|
|
96
|
-
const { instance } = this.FormControlRef?.createComponent(
|
|
97
|
-
FieldControlItem.fieldConfigComponent
|
|
98
|
-
); //创建组件模板
|
|
99
|
-
/**向创建的组件模板中传值 */
|
|
100
|
-
instance.selected = this._selected;
|
|
101
|
-
instance.type = this._type;
|
|
102
|
-
instance.Entity = this._entity;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**加载动态表单组件 */
|
|
106
|
-
loadfieldComponent(FieldControlItem?: FieldControlGroupInterfaces) {
|
|
107
|
-
// this.FormControlRef.clear
|
|
108
|
-
//清空了容器中的所有组件
|
|
109
|
-
this.FormComponentsRef?.clear();
|
|
110
|
-
if (!FieldControlItem || !FieldControlItem.fieldComponent) return;
|
|
111
|
-
//在容器中创建组件
|
|
112
|
-
const { instance } = this.FormComponentsRef?.createComponent(FieldControlItem.fieldComponent); //创建组件模板
|
|
113
|
-
/**向创建的组件模板中传值 */
|
|
114
|
-
instance.fields = this._fields;
|
|
115
|
-
instance.parentFiledName = this._parentFiledName;
|
|
116
|
-
instance.selected = this._selected;
|
|
117
|
-
instance.culture = this._culture;
|
|
118
|
-
instance.entity = this._entity;
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dynamic.component'
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<form [formGroup]="_Entity">
|
|
2
|
-
<div formGroupName="formConfiguration">
|
|
3
|
-
<div class="mb-3">
|
|
4
|
-
<label class="form-label">{{'DigniteAbpForms::DateEditMode' | abpLocalization}}</label>
|
|
5
|
-
<div>
|
|
6
|
-
<div class="form-check form-check-inline">
|
|
7
|
-
<input class="form-check-input" type="radio" [value]="_DateEditInterfaces.Date"
|
|
8
|
-
formControlName="DateEdit.InputMode" id="flexRadioDefault1" (change)="timeTypeChange()">
|
|
9
|
-
<label class="form-check-label" for="flexRadioDefault1">
|
|
10
|
-
{{'DigniteAbpForms::Date' | abpLocalization}}
|
|
11
|
-
</label>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="form-check form-check-inline">
|
|
14
|
-
<input class="form-check-input" type="radio" [value]="_DateEditInterfaces.DateTime"
|
|
15
|
-
formControlName="DateEdit.InputMode" id="flexRadioDefault2" (change)="timeTypeChange()">
|
|
16
|
-
<label class="form-check-label" for="flexRadioDefault2">
|
|
17
|
-
{{'DigniteAbpForms::DateTime' | abpLocalization}}
|
|
18
|
-
</label>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="form-check form-check-inline">
|
|
21
|
-
<input class="form-check-input" type="radio" [value]="_DateEditInterfaces.Month"
|
|
22
|
-
formControlName="DateEdit.InputMode" id="flexRadioDefault3" (change)="timeTypeChange()">
|
|
23
|
-
<label class="form-check-label" for="flexRadioDefault3">
|
|
24
|
-
{{'DigniteAbpForms::Month' | abpLocalization}}
|
|
25
|
-
</label>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
<div class="mb-3">
|
|
30
|
-
<label class="form-label">{{'DigniteAbpForms::Min' | abpLocalization}}</label>
|
|
31
|
-
<input [type]="dateTimeType" class="form-control" step="1" formControlName="DateEdit.Min">
|
|
32
|
-
</div>
|
|
33
|
-
<div class="mb-3">
|
|
34
|
-
<label class="form-label">{{'DigniteAbpForms::Max' | abpLocalization}}</label>
|
|
35
|
-
<input [type]="dateTimeType" class="form-control" step="1" formControlName="DateEdit.Max">
|
|
36
|
-
</div>
|
|
37
|
-
<button type="submit" (abpInit)="submitclick?.nativeElement?.click()" style="display: none;"
|
|
38
|
-
#submitclick></button>
|
|
39
|
-
</div>
|
|
40
|
-
</form>
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DateEditConfigComponent } from './date-edit-config.component';
|
|
4
|
-
|
|
5
|
-
describe('DateEditConfigComponent', () => {
|
|
6
|
-
let component: DateEditConfigComponent;
|
|
7
|
-
let fixture: ComponentFixture<DateEditConfigComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [DateEditConfigComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(DateEditConfigComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectorRef, Component, ElementRef, inject, Input, ViewChild } from '@angular/core';
|
|
2
|
-
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { DateEditConfig } from './date-edit-config';
|
|
4
|
-
import { DateEditInterfaces } from '../../../enums/date-edit-interfaces';
|
|
5
|
-
import { DatePipe } from '@angular/common';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'df-date-edit-config',
|
|
9
|
-
templateUrl: './date-edit-config.component.html',
|
|
10
|
-
styleUrls: ['./date-edit-config.component.scss'],
|
|
11
|
-
})
|
|
12
|
-
export class DateEditConfigComponent {
|
|
13
|
-
constructor(private fb: FormBuilder) {}
|
|
14
|
-
private _dataPipe = inject(DatePipe);
|
|
15
|
-
_DateEditInterfaces = DateEditInterfaces;
|
|
16
|
-
/**表单控件类型 */
|
|
17
|
-
_type: any;
|
|
18
|
-
@Input()
|
|
19
|
-
public set type(v: any) {
|
|
20
|
-
this._type = v;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**选择的表单信息 */
|
|
24
|
-
_selected: any;
|
|
25
|
-
@Input()
|
|
26
|
-
public set selected(v: any) {
|
|
27
|
-
this._selected = v;
|
|
28
|
-
}
|
|
29
|
-
/**表单实体 */
|
|
30
|
-
_Entity: FormGroup | undefined;
|
|
31
|
-
@Input()
|
|
32
|
-
public set Entity(v: FormGroup) {
|
|
33
|
-
this._Entity = v;
|
|
34
|
-
this.dataLoaded();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
dateTimeType: any = 'date';
|
|
38
|
-
get formConfiguration() {
|
|
39
|
-
return this._Entity.get('formConfiguration') as FormGroup;
|
|
40
|
-
}
|
|
41
|
-
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
42
|
-
|
|
43
|
-
private cdr = inject(ChangeDetectorRef);
|
|
44
|
-
async dataLoaded() {
|
|
45
|
-
if (this._Entity && this._type) {
|
|
46
|
-
await this.AfterInit();
|
|
47
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
48
|
-
this.submitclick?.nativeElement?.click();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
AfterInit() {
|
|
53
|
-
return new Promise((resolve, rejects) => {
|
|
54
|
-
this._Entity.setControl('formConfiguration', this.fb.group(new DateEditConfig()));
|
|
55
|
-
if (this._selected && this._selected.formControlName == this._type) {
|
|
56
|
-
this.formConfiguration.patchValue({
|
|
57
|
-
...this._selected.formConfiguration,
|
|
58
|
-
});
|
|
59
|
-
this.timeTypeChange()
|
|
60
|
-
}
|
|
61
|
-
resolve(true);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/**切换时间类型 */
|
|
65
|
-
timeTypeChange() {
|
|
66
|
-
let type = this.formConfiguration.value['DateEdit.InputMode'];
|
|
67
|
-
let Min = this.formConfiguration.value['DateEdit.Min'];
|
|
68
|
-
let Max = this.formConfiguration.value['DateEdit.Max'];
|
|
69
|
-
if (type == DateEditInterfaces.Date) {
|
|
70
|
-
this.dateTimeType = 'date';
|
|
71
|
-
Min = this._dataPipe.transform(Min, 'yyyy-MM-dd');
|
|
72
|
-
Max = this._dataPipe.transform(Max, 'yyyy-MM-dd');
|
|
73
|
-
} else if (type == DateEditInterfaces.DateTime) {
|
|
74
|
-
this.dateTimeType = 'datetime-local';
|
|
75
|
-
Min = this._dataPipe.transform(Min, 'yyyy-MM-dd HH:mm:ss');
|
|
76
|
-
Max = this._dataPipe.transform(Max, 'yyyy-MM-dd HH:mm:ss');
|
|
77
|
-
} else if (type == DateEditInterfaces.Month) {
|
|
78
|
-
this.dateTimeType = 'month';
|
|
79
|
-
Min = this._dataPipe.transform(Min, 'yyyy-MM');
|
|
80
|
-
Max = this._dataPipe.transform(Max, 'yyyy-MM');
|
|
81
|
-
}
|
|
82
|
-
this.formConfiguration.patchValue({
|
|
83
|
-
'DateEdit.Min': Min,
|
|
84
|
-
'DateEdit.Max': Max,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FormControl, Validators } from "@angular/forms";
|
|
2
|
-
import { DateEditInterfaces } from "../../../enums/date-edit-interfaces";
|
|
3
|
-
|
|
4
|
-
export class DateEditConfig {
|
|
5
|
-
/**日期格式 */
|
|
6
|
-
'DateEdit.InputMode': any = [DateEditInterfaces.Date, []];
|
|
7
|
-
/**最小值 */
|
|
8
|
-
'DateEdit.Min': any = ['', []];
|
|
9
|
-
/**最大值 */
|
|
10
|
-
'DateEdit.Max': any = ['', []];
|
|
11
|
-
|
|
12
|
-
constructor() {
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<form [formGroup]="_entity">
|
|
2
|
-
<div [formGroupName]="_parentFiledName">
|
|
3
|
-
<div class="mb-3">
|
|
4
|
-
<label class="form-label" *ngIf="_fields.displayName">{{ _fields.displayName }}</label>
|
|
5
|
-
|
|
6
|
-
<ng-container *ngIf="_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Date">
|
|
7
|
-
<input type="date" class="form-control" step="1" formControlName="{{_fields.field.name}}"
|
|
8
|
-
[min]="_fields.field.formConfiguration['DateEdit.Min']"
|
|
9
|
-
[max]="_fields.field.formConfiguration['DateEdit.Max']" />
|
|
10
|
-
</ng-container>
|
|
11
|
-
<ng-container
|
|
12
|
-
*ngIf="_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.DateTime">
|
|
13
|
-
<input type="datetime-local" class="form-control" step="1" formControlName="{{_fields.field.name}}"
|
|
14
|
-
[min]="_fields.field.formConfiguration['DateEdit.Min']"
|
|
15
|
-
[max]="_fields.field.formConfiguration['DateEdit.Max']" />
|
|
16
|
-
</ng-container>
|
|
17
|
-
<ng-container *ngIf="_fields.field.formConfiguration['DateEdit.InputMode'] === _DateEditInterfaces.Month">
|
|
18
|
-
<input type="month" class="form-control" step="1" formControlName="{{_fields.field.name}}"
|
|
19
|
-
[min]="_fields.field.formConfiguration['DateEdit.Min']"
|
|
20
|
-
[max]="_fields.field.formConfiguration['DateEdit.Max']" />
|
|
21
|
-
</ng-container>
|
|
22
|
-
<small class="form-text text-muted d-block" *ngIf="_fields.field.description">{{_fields.field.description}}</small>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<button type="submit" style="display: none;" #submitclick></button>
|
|
26
|
-
</form>
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DateEditControlComponent } from './date-edit-control.component';
|
|
4
|
-
|
|
5
|
-
describe('DateEditControlComponent', () => {
|
|
6
|
-
let component: DateEditControlComponent;
|
|
7
|
-
let fixture: ComponentFixture<DateEditControlComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [DateEditControlComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(DateEditControlComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|