@dignite-ng/expand.dynamic-form 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/form/form-control-group.mjs +10 -1
- package/esm2022/lib/components/form/index.mjs +2 -1
- package/esm2022/lib/components/form/select/select-config.mjs +1 -1
- package/esm2022/lib/components/form/select/select-control.component.mjs +6 -6
- package/esm2022/lib/components/form/select/select-view.component.mjs +8 -3
- package/esm2022/lib/components/form/tree/index.mjs +5 -0
- package/esm2022/lib/components/form/tree/tree-config.component.mjs +515 -0
- package/esm2022/lib/components/form/tree/tree-config.mjs +22 -0
- package/esm2022/lib/components/form/tree/tree-control.component.mjs +272 -0
- package/esm2022/lib/components/form/tree/tree-search.component.mjs +105 -0
- package/esm2022/lib/components/form/tree/tree-view.component.mjs +62 -0
- package/esm2022/lib/dynamic-form.module.mjs +33 -12
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs +1024 -41
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -1
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/form/tree/index.d.ts +4 -0
- package/lib/components/form/tree/tree-config.component.d.ts +112 -0
- package/lib/components/form/tree/tree-config.d.ts +10 -0
- package/lib/components/form/tree/tree-control.component.d.ts +62 -0
- package/lib/components/form/tree/tree-search.component.d.ts +33 -0
- package/lib/components/form/tree/tree-view.component.d.ts +17 -0
- package/lib/dynamic-form.module.d.ts +14 -8
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ElementRef, AfterViewChecked } from '@angular/core';
|
|
2
|
+
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { ToPinyinService } from '@dignite-ng/expand.core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TreeConfigComponent implements AfterViewChecked {
|
|
6
|
+
private fb;
|
|
7
|
+
private toPinyinService;
|
|
8
|
+
constructor(fb: FormBuilder, toPinyinService: ToPinyinService);
|
|
9
|
+
/**表单控件类型 */
|
|
10
|
+
_type: any;
|
|
11
|
+
set type(v: any);
|
|
12
|
+
/**选择的表单信息 */
|
|
13
|
+
_selected: any;
|
|
14
|
+
set selected(v: any);
|
|
15
|
+
/**表单实体 */
|
|
16
|
+
formEntity: FormGroup | undefined;
|
|
17
|
+
set Entity(v: FormGroup);
|
|
18
|
+
get formConfiguration(): FormGroup;
|
|
19
|
+
get TreeOptions(): FormArray;
|
|
20
|
+
submitclick: ElementRef;
|
|
21
|
+
private cdr;
|
|
22
|
+
dataLoaded(): Promise<void>;
|
|
23
|
+
/**增加选项 */
|
|
24
|
+
AfterInit(): Promise<unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* 当选择项的文本发生变化时,更新对应的值
|
|
27
|
+
* @param event 输入事件对象
|
|
28
|
+
* @param index 选择项的索引位置
|
|
29
|
+
* @description 如果选择项已有Value值则不处理,否则将中文文本转换为拼音作为Value值
|
|
30
|
+
*/
|
|
31
|
+
/**字段标签input失去标点生成字段名字 */
|
|
32
|
+
disPlayNameInputBlur(event: any): void;
|
|
33
|
+
/**调整表格位置 */
|
|
34
|
+
/**tree数据 */
|
|
35
|
+
nodes: any[];
|
|
36
|
+
/**已展开的节点 */
|
|
37
|
+
anExpandedNode: any[];
|
|
38
|
+
/**点击展开树节点图标触发 */
|
|
39
|
+
nzExpandChange(event: any): void;
|
|
40
|
+
log(v: any): void;
|
|
41
|
+
/**正在操作的节点项 */
|
|
42
|
+
selectTree: any;
|
|
43
|
+
/**是否创建子节点 */
|
|
44
|
+
isCreateChild: boolean | any;
|
|
45
|
+
/**模态框状态 */
|
|
46
|
+
isVisible: boolean | any;
|
|
47
|
+
/**用于确定模态的繁忙状态是否为真 */
|
|
48
|
+
modalBusy: boolean | any;
|
|
49
|
+
/**创建表单 */
|
|
50
|
+
nodeForm: FormGroup | undefined;
|
|
51
|
+
/**表格已选择数据 */
|
|
52
|
+
_tableSelected: any;
|
|
53
|
+
/**表单控件模板-动态赋值表单控件 */
|
|
54
|
+
nodeModalSubmit: ElementRef;
|
|
55
|
+
/**生成GUID */
|
|
56
|
+
private generateGuid;
|
|
57
|
+
/**创建节点 */
|
|
58
|
+
addNodeBtn(): void;
|
|
59
|
+
/**编辑节点 */
|
|
60
|
+
editItemBtn(node: any): void;
|
|
61
|
+
/**创建子节点 */
|
|
62
|
+
createChildItemBtn(node: any): void;
|
|
63
|
+
/**重置模态框 */
|
|
64
|
+
resetModal(): void;
|
|
65
|
+
/**创建编辑保存 */
|
|
66
|
+
createOrEditSave(): void;
|
|
67
|
+
/**递归添加子节点 */
|
|
68
|
+
private addChildNode;
|
|
69
|
+
/**递归更新节点 */
|
|
70
|
+
private updateNode;
|
|
71
|
+
/**删除节点 */
|
|
72
|
+
deleteMenuItemBtn(node: any): void;
|
|
73
|
+
/**递归删除节点 */
|
|
74
|
+
private deleteNode;
|
|
75
|
+
/**同步 nodes 到 TreeOptions */
|
|
76
|
+
private syncTreeOptionsFromNodes;
|
|
77
|
+
/**递归创建树表单组 */
|
|
78
|
+
private createTreeFormGroup;
|
|
79
|
+
/**清理节点中的 ng-zorro 内部字段 */
|
|
80
|
+
private cleanNode;
|
|
81
|
+
/**将 TreeOptions 数据结构转换为 nodes 数据结构 */
|
|
82
|
+
private convertTreeOptionsToNodes;
|
|
83
|
+
/**设置 */
|
|
84
|
+
toggleMultiple(event: any): void;
|
|
85
|
+
/**切换节点选中状态 */
|
|
86
|
+
toggleNodeChecked(event: any, node: any): void;
|
|
87
|
+
/**清除所有节点的选中状态 */
|
|
88
|
+
private clearAllChecked;
|
|
89
|
+
/**设置指定节点的选中状态 */
|
|
90
|
+
private setNodeChecked;
|
|
91
|
+
/**递归设置所有子节点的选中状态 */
|
|
92
|
+
private setChildrenChecked;
|
|
93
|
+
/**选中所有父节点 */
|
|
94
|
+
private setParentNodesChecked;
|
|
95
|
+
/**仅设置指定节点的选中状态,不影响子节点和父节点 */
|
|
96
|
+
private setNodeCheckedOnly;
|
|
97
|
+
/**拖拽 */
|
|
98
|
+
dropOver(event: any): void;
|
|
99
|
+
/**移除并返回节点 */
|
|
100
|
+
private removeNodeByKey;
|
|
101
|
+
/**在目标节点旁边插入节点 */
|
|
102
|
+
private insertNodeBeside;
|
|
103
|
+
/**判断节点的子节点是否有被选中的 */
|
|
104
|
+
hasChildrenChecked(node: any): boolean;
|
|
105
|
+
/**递归检查子节点是否有被选中的 */
|
|
106
|
+
private hasAnyChildChecked;
|
|
107
|
+
/**根据 key 查找节点 */
|
|
108
|
+
private findNodeByKey;
|
|
109
|
+
ngAfterViewChecked(): void;
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeConfigComponent, never>;
|
|
111
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeConfigComponent, "df-tree-config", never, { "type": { "alias": "type"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "Entity": { "alias": "Entity"; "required": false; }; }, {}, never, never, false, never>;
|
|
112
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy, AfterViewChecked } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TreeControlComponent implements OnDestroy, AfterViewChecked {
|
|
5
|
+
private fb;
|
|
6
|
+
constructor(fb: FormBuilder);
|
|
7
|
+
/**字段配置列表 */
|
|
8
|
+
_fields: any;
|
|
9
|
+
set fields(v: any);
|
|
10
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
11
|
+
_parentFiledName: any;
|
|
12
|
+
set parentFiledName(v: any);
|
|
13
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
14
|
+
_selected: any;
|
|
15
|
+
set selected(v: any);
|
|
16
|
+
/**表单实体 */
|
|
17
|
+
_entity: FormGroup | undefined;
|
|
18
|
+
set entity(v: any);
|
|
19
|
+
submitclick: ElementRef;
|
|
20
|
+
get extraProperties(): FormGroup;
|
|
21
|
+
private cdr;
|
|
22
|
+
/**数据加载完成 */
|
|
23
|
+
dataLoaded(): Promise<void>;
|
|
24
|
+
formConfiguration: any;
|
|
25
|
+
AfterInit(): Promise<unknown>;
|
|
26
|
+
/**将 TreeOptions 数据结构转换为 nodes 数据结构 */
|
|
27
|
+
private convertTreeOptionsToNodes;
|
|
28
|
+
ngOnDestroy(): void;
|
|
29
|
+
/**tree数据 */
|
|
30
|
+
nodes: any[];
|
|
31
|
+
/**已展开的节点 */
|
|
32
|
+
anExpandedNode: any[];
|
|
33
|
+
/**点击展开树节点图标触发 */
|
|
34
|
+
nzExpandChange(event: any): void;
|
|
35
|
+
/**切换节点选中状态 */
|
|
36
|
+
toggleNodeChecked(event: any, node: any): void;
|
|
37
|
+
/**清除所有节点的选中状态 */
|
|
38
|
+
private clearAllChecked;
|
|
39
|
+
/**设置指定节点的选中状态 */
|
|
40
|
+
private setNodeChecked;
|
|
41
|
+
/**递归设置所有子节点的选中状态 */
|
|
42
|
+
private setChildrenChecked;
|
|
43
|
+
/**选中所有父节点 */
|
|
44
|
+
private setParentNodesChecked;
|
|
45
|
+
/**更新表单值 */
|
|
46
|
+
private updateFormValue;
|
|
47
|
+
/**获取所有选中节点的 key */
|
|
48
|
+
private getSelectedKeys;
|
|
49
|
+
/**判断节点的子节点是否有被选中的 */
|
|
50
|
+
hasChildrenChecked(node: any): boolean;
|
|
51
|
+
/**递归检查子节点是否有被选中的 */
|
|
52
|
+
private hasAnyChildChecked;
|
|
53
|
+
/**根据 key 查找节点 */
|
|
54
|
+
private findNodeByKey;
|
|
55
|
+
/**根据预设的 keys 同步更新 nodes 的选中状态 */
|
|
56
|
+
private syncNodesFromSelectedKeys;
|
|
57
|
+
/**仅设置指定节点的选中状态,不影响子节点和父节点 */
|
|
58
|
+
private setNodeCheckedOnly;
|
|
59
|
+
ngAfterViewChecked(): void;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeControlComponent, never>;
|
|
61
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeControlComponent, "df-tree-control", never, { "fields": { "alias": "fields"; "required": false; }; "parentFiledName": { "alias": "parentFiledName"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "entity": { "alias": "entity"; "required": false; }; }, {}, never, never, false, never>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TreeSearchComponent {
|
|
5
|
+
private fb;
|
|
6
|
+
constructor(fb: FormBuilder);
|
|
7
|
+
/**字段配置列表 */
|
|
8
|
+
_fields: any;
|
|
9
|
+
set fields(v: any);
|
|
10
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
11
|
+
_parentFiledName: any;
|
|
12
|
+
set parentFiledName(v: any);
|
|
13
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
14
|
+
_selected: any;
|
|
15
|
+
set selected(v: any);
|
|
16
|
+
/**表单实体 */
|
|
17
|
+
_entity: FormGroup | undefined;
|
|
18
|
+
set entity(v: any);
|
|
19
|
+
submitclick: ElementRef;
|
|
20
|
+
get extraProperties(): FormGroup;
|
|
21
|
+
private cdr;
|
|
22
|
+
/**数据加载完成 */
|
|
23
|
+
dataLoaded(): Promise<void>;
|
|
24
|
+
formConfiguration: any;
|
|
25
|
+
AfterInit(): Promise<unknown>;
|
|
26
|
+
private convertTreeOptionsToNodes;
|
|
27
|
+
changeValue(event: any): void;
|
|
28
|
+
ngOnDestroy(): void;
|
|
29
|
+
nodes: any[];
|
|
30
|
+
onChange($event: string[]): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeSearchComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeSearchComponent, "df-tree-search", never, { "fields": { "alias": "fields"; "required": false; }; "parentFiledName": { "alias": "parentFiledName"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "entity": { "alias": "entity"; "required": false; }; }, {}, never, never, false, never>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class TreeViewComponent {
|
|
3
|
+
/**展示则内容 */
|
|
4
|
+
showValue: any;
|
|
5
|
+
/**是否显示再列表 */
|
|
6
|
+
showInList: boolean;
|
|
7
|
+
/**表单字段数据 */
|
|
8
|
+
fields: any;
|
|
9
|
+
/**表单控件类型 */
|
|
10
|
+
type: any;
|
|
11
|
+
/**表单控件Value */
|
|
12
|
+
_value: any;
|
|
13
|
+
set value(v: any);
|
|
14
|
+
ngAfterContentInit(): Promise<void>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeViewComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeViewComponent, "df-tree-view", never, { "showInList": { "alias": "showInList"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "type": { "alias": "type"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, false, never>;
|
|
17
|
+
}
|
|
@@ -24,16 +24,22 @@ import * as i21 from "./components/form/select/select-search.component";
|
|
|
24
24
|
import * as i22 from "./components/form/text-edit/text-edit-search.component";
|
|
25
25
|
import * as i23 from "./components/form/switch/switch-search.component";
|
|
26
26
|
import * as i24 from "./components/form/numeric-edit/numeric-edit-search.component";
|
|
27
|
-
import * as i25 from "
|
|
28
|
-
import * as i26 from "
|
|
29
|
-
import * as i27 from "
|
|
30
|
-
import * as i28 from "
|
|
31
|
-
import * as i29 from "
|
|
32
|
-
import * as i30 from "@
|
|
33
|
-
import * as i31 from "@abp/ng.
|
|
27
|
+
import * as i25 from "./components/form/tree/tree-config.component";
|
|
28
|
+
import * as i26 from "./components/form/tree/tree-control.component";
|
|
29
|
+
import * as i27 from "./components/form/tree/tree-search.component";
|
|
30
|
+
import * as i28 from "./components/form/tree/tree-view.component";
|
|
31
|
+
import * as i29 from "@angular/forms";
|
|
32
|
+
import * as i30 from "@abp/ng.core";
|
|
33
|
+
import * as i31 from "@abp/ng.theme.shared";
|
|
34
|
+
import * as i32 from "@ng-bootstrap/ng-bootstrap";
|
|
35
|
+
import * as i33 from "ng-zorro-antd/select";
|
|
36
|
+
import * as i34 from "@angular/cdk/drag-drop";
|
|
37
|
+
import * as i35 from "@abp/ng.components/extensible";
|
|
38
|
+
import * as i36 from "@abp/ng.components/tree";
|
|
39
|
+
import * as i37 from "ng-zorro-antd/tree-select";
|
|
34
40
|
export declare class DynamicFormModule {
|
|
35
41
|
static forRoot(config?: any): ModuleWithProviders<DynamicFormModule>;
|
|
36
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormModule, never>;
|
|
37
|
-
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.DynamicConfigComponent, typeof i13.DynamicViewComponent, typeof i14.DynamicControlComponent, typeof i15.SelectViewComponent, typeof i16.SwitchViewComponent, typeof i17.TextEditViewComponent, typeof i18.DateEditViewComponent, typeof i19.NumericEditViewComponent, typeof i20.DynamicSearchComponent, typeof i21.SelectSearchComponent, typeof i22.TextEditSearchComponent, typeof i23.SwitchSearchComponent, typeof i24.NumericEditSearchComponent], [typeof
|
|
43
|
+
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.DynamicConfigComponent, typeof i13.DynamicViewComponent, typeof i14.DynamicControlComponent, typeof i15.SelectViewComponent, typeof i16.SwitchViewComponent, typeof i17.TextEditViewComponent, typeof i18.DateEditViewComponent, typeof i19.NumericEditViewComponent, typeof i20.DynamicSearchComponent, typeof i21.SelectSearchComponent, typeof i22.TextEditSearchComponent, typeof i23.SwitchSearchComponent, typeof i24.NumericEditSearchComponent, typeof i25.TreeConfigComponent, typeof i26.TreeControlComponent, typeof i27.TreeSearchComponent, typeof i28.TreeViewComponent], [typeof i29.FormsModule, typeof i30.CoreModule, typeof i31.ThemeSharedModule, typeof i29.ReactiveFormsModule, typeof i32.NgbDropdownModule, typeof i33.NzSelectModule, typeof i34.DragDropModule, typeof i32.NgbDatepickerModule, typeof i35.ExtensibleModule, typeof i36.TreeModule, typeof i37.NzTreeSelectModule], [typeof i1.TextEditConfigComponent, typeof i2.TextEditComponent, typeof i17.TextEditViewComponent, typeof i3.SwitchConfigComponent, typeof i4.SwitchControlComponent, typeof i16.SwitchViewComponent, typeof i5.NumbericEditConfigComponent, typeof i6.NumbericEditControlComponent, typeof i7.DateEditConfigComponent, typeof i8.DateEditControlComponent, typeof i18.DateEditViewComponent, typeof i9.SelectConfigComponent, typeof i10.SelectControlComponent, typeof i15.SelectViewComponent, typeof i21.SelectSearchComponent, typeof i11.DynamicComponent, typeof i12.DynamicConfigComponent, typeof i13.DynamicViewComponent, typeof i14.DynamicControlComponent, typeof i20.DynamicSearchComponent, typeof i25.TreeConfigComponent, typeof i26.TreeControlComponent, typeof i27.TreeSearchComponent, typeof i28.TreeViewComponent]>;
|
|
38
44
|
static ɵinj: i0.ɵɵInjectorDeclaration<DynamicFormModule>;
|
|
39
45
|
}
|