@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
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @angular-eslint/no-empty-lifecycle-method */
|
|
2
|
-
/* eslint-disable @angular-eslint/use-lifecycle-interface */
|
|
3
|
-
import { ChangeDetectorRef, Component, ElementRef, inject, Input, ViewChild } from '@angular/core';
|
|
4
|
-
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
5
|
-
import { TextEditMode } from '../../../enums/text-edit-mode';
|
|
6
|
-
import { TextEditConfig } from './text-edit-config';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'df-text-edit',
|
|
10
|
-
templateUrl: './text-edit.component.html',
|
|
11
|
-
styleUrls: ['./text-edit.component.scss']
|
|
12
|
-
})
|
|
13
|
-
export class TextEditComponent {
|
|
14
|
-
|
|
15
|
-
constructor(
|
|
16
|
-
private fb: FormBuilder,
|
|
17
|
-
) {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
_TextEditMode = TextEditMode
|
|
21
|
-
/**表单实体 */
|
|
22
|
-
_entity: FormGroup | undefined
|
|
23
|
-
@Input()
|
|
24
|
-
public set entity(v: any) {
|
|
25
|
-
this._entity = v;
|
|
26
|
-
if (v) this.dataLoaded()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**字段配置列表 */
|
|
30
|
-
_fields: any = ''
|
|
31
|
-
@Input()
|
|
32
|
-
public set fields(v: any) {
|
|
33
|
-
this._fields = v;
|
|
34
|
-
if (v) this.dataLoaded()
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
38
|
-
_parentFiledName: any
|
|
39
|
-
@Input()
|
|
40
|
-
public set parentFiledName(v: any) {
|
|
41
|
-
this._parentFiledName = v;
|
|
42
|
-
if (v) this.dataLoaded()
|
|
43
|
-
}
|
|
44
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
45
|
-
_selected: any
|
|
46
|
-
@Input()
|
|
47
|
-
public set selected(v: any) {
|
|
48
|
-
this._selected = v || '';
|
|
49
|
-
if (v) this.dataLoaded()
|
|
50
|
-
}
|
|
51
|
-
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
52
|
-
|
|
53
|
-
extraProperties: FormGroup | undefined;
|
|
54
|
-
private cdr = inject(ChangeDetectorRef);
|
|
55
|
-
async dataLoaded() {
|
|
56
|
-
if (this._fields && this._entity && this._parentFiledName) {
|
|
57
|
-
this.extraProperties = this._entity.get(this._parentFiledName) as FormGroup
|
|
58
|
-
await this.AfterInit()
|
|
59
|
-
this.cdr.detectChanges(); // 手动触发变更检测
|
|
60
|
-
this.submitclick?.nativeElement?.click();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
AfterInit() {
|
|
66
|
-
return new Promise((resolve, rejects) => {
|
|
67
|
-
let ValidatorsArray = []
|
|
68
|
-
if (this._fields.required) {
|
|
69
|
-
ValidatorsArray.push(Validators.required)
|
|
70
|
-
}
|
|
71
|
-
this._fields.field.formConfiguration={
|
|
72
|
-
...this.fb.group(new TextEditConfig()).value,
|
|
73
|
-
...this._fields.field.formConfiguration
|
|
74
|
-
}
|
|
75
|
-
if (this._fields.field.formConfiguration['TextEdit.CharLimit']) {
|
|
76
|
-
ValidatorsArray.push(Validators.maxLength(this._fields.field.formConfiguration['TextEdit.CharLimit']))
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
let newControl = this.fb.control(this._selected, ValidatorsArray)
|
|
80
|
-
this.extraProperties.setControl(this._fields.field.name, newControl)
|
|
81
|
-
resolve(true)
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
ngOnDestroy(): void {
|
|
85
|
-
//Called once, before the instance is destroyed.
|
|
86
|
-
//Add 'implements OnDestroy' to the class.
|
|
87
|
-
this.extraProperties.removeControl(this._fields.field.name)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
isObjEmpty = (obj) => Object.keys(obj).length === 0
|
|
91
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';
|
|
2
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
-
import { CoreModule } from '@abp/ng.core';
|
|
4
|
-
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
5
|
-
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
6
|
-
// import { NzTreeModule } from 'ng-zorro-antd/tree';
|
|
7
|
-
import {
|
|
8
|
-
TextEditConfigComponent,
|
|
9
|
-
TextEditComponent,
|
|
10
|
-
SwitchConfigComponent,
|
|
11
|
-
SwitchControlComponent,
|
|
12
|
-
NumbericEditConfigComponent,
|
|
13
|
-
NumbericEditControlComponent,
|
|
14
|
-
DateEditConfigComponent,
|
|
15
|
-
DateEditControlComponent,
|
|
16
|
-
SelectConfigComponent,
|
|
17
|
-
SelectControlComponent,
|
|
18
|
-
AddFieldControlGroup,
|
|
19
|
-
DynamicComponent,
|
|
20
|
-
} from './components';
|
|
21
|
-
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@NgModule({
|
|
26
|
-
declarations: [
|
|
27
|
-
TextEditConfigComponent,
|
|
28
|
-
TextEditComponent,
|
|
29
|
-
SwitchConfigComponent,
|
|
30
|
-
SwitchControlComponent,
|
|
31
|
-
NumbericEditConfigComponent,
|
|
32
|
-
NumbericEditControlComponent,
|
|
33
|
-
DateEditConfigComponent,
|
|
34
|
-
DateEditControlComponent,
|
|
35
|
-
SelectConfigComponent,
|
|
36
|
-
SelectControlComponent,
|
|
37
|
-
DynamicComponent,
|
|
38
|
-
|
|
39
|
-
],
|
|
40
|
-
imports: [
|
|
41
|
-
FormsModule,
|
|
42
|
-
CoreModule,
|
|
43
|
-
ThemeSharedModule,
|
|
44
|
-
ReactiveFormsModule,
|
|
45
|
-
NgbDropdownModule,
|
|
46
|
-
NzSelectModule,
|
|
47
|
-
// NzTreeModule,
|
|
48
|
-
],
|
|
49
|
-
exports: [
|
|
50
|
-
TextEditConfigComponent,
|
|
51
|
-
TextEditComponent,
|
|
52
|
-
SwitchConfigComponent,
|
|
53
|
-
SwitchControlComponent,
|
|
54
|
-
NumbericEditConfigComponent,
|
|
55
|
-
NumbericEditControlComponent,
|
|
56
|
-
DateEditConfigComponent,
|
|
57
|
-
DateEditControlComponent,
|
|
58
|
-
SelectConfigComponent,
|
|
59
|
-
SelectControlComponent,
|
|
60
|
-
DynamicComponent,
|
|
61
|
-
],
|
|
62
|
-
providers: [
|
|
63
|
-
],
|
|
64
|
-
})
|
|
65
|
-
export class DynamicFormModule {
|
|
66
|
-
static forRoot(config?: any): ModuleWithProviders<DynamicFormModule> {
|
|
67
|
-
return {
|
|
68
|
-
ngModule: DynamicFormModule,
|
|
69
|
-
providers: [
|
|
70
|
-
]
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export enum DateEditInterfaces {
|
|
2
|
-
/// <summary>
|
|
3
|
-
/// Only date is allowed to be entered.
|
|
4
|
-
/// </summary>
|
|
5
|
-
Date = 0,
|
|
6
|
-
|
|
7
|
-
/// <summary>
|
|
8
|
-
/// Both date and time are allowed to be entered.
|
|
9
|
-
/// </summary>
|
|
10
|
-
DateTime = 1,
|
|
11
|
-
|
|
12
|
-
/// <summary>
|
|
13
|
-
/// Allowed to select only year and month.
|
|
14
|
-
/// </summary>
|
|
15
|
-
Month = 2
|
|
16
|
-
}
|
package/src/lib/enums/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './form-config-interfaces'
|
package/src/lib/proxy/README.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Proxy Generation Output
|
|
2
|
-
|
|
3
|
-
This directory includes the output of the latest proxy generation.
|
|
4
|
-
The files and folders in it will be overwritten when proxy generation is run again.
|
|
5
|
-
Therefore, please do not place your own content in this folder.
|
|
6
|
-
|
|
7
|
-
In addition, `generate-proxy.json` works like a lock file.
|
|
8
|
-
It includes information used by the proxy generator, so please do not delete or modify it.
|
|
9
|
-
|
|
10
|
-
Finally, the name of the files and folders should not be changed for two reasons:
|
|
11
|
-
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
|
|
12
|
-
- ABP Suite generates files which include imports from this folder.
|
|
13
|
-
|
|
14
|
-
> **Important Notice:** If you are building a module and are planning to publish to npm,
|
|
15
|
-
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
|
|
16
|
-
> please make sure you export files directly and not from barrel exports. In other words,
|
|
17
|
-
> do not include index.ts exports in your public-api.ts exports.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { CreateDirectoryInput, DirectoryDescriptorDto, DirectoryDescriptorInfoDto, GetDirectoriesInput, MoveDirectoryInput, UpdateDirectoryInput } from './models';
|
|
2
|
-
import { RestService, Rest } from '@abp/ng.core';
|
|
3
|
-
import type { PagedResultDto } from '@abp/ng.core';
|
|
4
|
-
import { Injectable } from '@angular/core';
|
|
5
|
-
|
|
6
|
-
@Injectable({
|
|
7
|
-
providedIn: 'root',
|
|
8
|
-
})
|
|
9
|
-
export class FileDescriptorService {
|
|
10
|
-
apiName = 'FileExplorer';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
create = (input: CreateDirectoryInput, config?: Partial<Rest.Config>) =>
|
|
14
|
-
this.restService.request<any, DirectoryDescriptorDto>({
|
|
15
|
-
method: 'POST',
|
|
16
|
-
url: '/api/file-explorer/directories',
|
|
17
|
-
body: input,
|
|
18
|
-
},
|
|
19
|
-
{ apiName: this.apiName,...config });
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
delete = (id: string, config?: Partial<Rest.Config>) =>
|
|
23
|
-
this.restService.request<any, void>({
|
|
24
|
-
method: 'DELETE',
|
|
25
|
-
url: `/api/file-explorer/directories/${id}`,
|
|
26
|
-
},
|
|
27
|
-
{ apiName: this.apiName,...config });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
get = (id: string, config?: Partial<Rest.Config>) =>
|
|
31
|
-
this.restService.request<any, DirectoryDescriptorDto>({
|
|
32
|
-
method: 'GET',
|
|
33
|
-
url: `/api/file-explorer/directories/${id}`,
|
|
34
|
-
},
|
|
35
|
-
{ apiName: this.apiName,...config });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
getList = (input: GetDirectoriesInput, config?: Partial<Rest.Config>) =>
|
|
39
|
-
this.restService.request<any, PagedResultDto<DirectoryDescriptorInfoDto>>({
|
|
40
|
-
method: 'GET',
|
|
41
|
-
url: '/api/file-explorer/directories',
|
|
42
|
-
params: { containerName: input.containerName },
|
|
43
|
-
},
|
|
44
|
-
{ apiName: this.apiName,...config });
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
move = (id: string, input: MoveDirectoryInput, config?: Partial<Rest.Config>) =>
|
|
48
|
-
this.restService.request<any, DirectoryDescriptorDto>({
|
|
49
|
-
method: 'PUT',
|
|
50
|
-
url: `/api/file-explorer/directories/${id}/move`,
|
|
51
|
-
body: input,
|
|
52
|
-
},
|
|
53
|
-
{ apiName: this.apiName,...config });
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
update = (id: string, input: UpdateDirectoryInput, config?: Partial<Rest.Config>) =>
|
|
57
|
-
this.restService.request<any, DirectoryDescriptorDto>({
|
|
58
|
-
method: 'PUT',
|
|
59
|
-
url: `/api/file-explorer/directories/${id}`,
|
|
60
|
-
body: input,
|
|
61
|
-
},
|
|
62
|
-
{ apiName: this.apiName,...config });
|
|
63
|
-
|
|
64
|
-
constructor(private restService: RestService) {}
|
|
65
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ExtensibleAuditedEntityDto, ExtensibleEntityDto } from '@abp/ng.core';
|
|
2
|
-
|
|
3
|
-
export interface CreateDirectoryInput {
|
|
4
|
-
containerName: string;
|
|
5
|
-
name: string;
|
|
6
|
-
parentId?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface DirectoryDescriptorDto extends ExtensibleAuditedEntityDto<string> {
|
|
10
|
-
containerName?: string;
|
|
11
|
-
name?: string;
|
|
12
|
-
parentId?: string;
|
|
13
|
-
order: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface DirectoryDescriptorInfoDto extends ExtensibleEntityDto<string> {
|
|
17
|
-
containerName?: string;
|
|
18
|
-
name?: string;
|
|
19
|
-
parentId?: string;
|
|
20
|
-
order: number;
|
|
21
|
-
children: DirectoryDescriptorInfoDto[];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface GetDirectoriesInput {
|
|
25
|
-
containerName: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface MoveDirectoryInput {
|
|
29
|
-
parentId?: string;
|
|
30
|
-
order: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface UpdateDirectoryInput {
|
|
34
|
-
name: string;
|
|
35
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { CreateFileInput, FileContainerConfigurationDto, FileDescriptorDto, GetFilesInput, ImageResizeInput, UpdateFileInput } from './models';
|
|
2
|
-
import { RestService, Rest } from '@abp/ng.core';
|
|
3
|
-
import type { PagedResultDto } from '@abp/ng.core';
|
|
4
|
-
import { Injectable } from '@angular/core';
|
|
5
|
-
import type { FileResult } from '../../../microsoft/asp-net-core/mvc/models';
|
|
6
|
-
|
|
7
|
-
@Injectable({
|
|
8
|
-
providedIn: 'root',
|
|
9
|
-
})
|
|
10
|
-
export class FileDescriptorService {
|
|
11
|
-
apiName = 'FileExplorer';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
create = (input: CreateFileInput, config?: Partial<Rest.Config>) =>
|
|
15
|
-
this.restService.request<any, FileDescriptorDto>({
|
|
16
|
-
method: 'POST',
|
|
17
|
-
url: '/api/file-explorer/files',
|
|
18
|
-
params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
|
|
19
|
-
body: input.file,
|
|
20
|
-
},
|
|
21
|
-
{ apiName: this.apiName,...config });
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
delete = (id: string, config?: Partial<Rest.Config>) =>
|
|
25
|
-
this.restService.request<any, void>({
|
|
26
|
-
method: 'DELETE',
|
|
27
|
-
url: `/api/file-explorer/files/${id}`,
|
|
28
|
-
},
|
|
29
|
-
{ apiName: this.apiName,...config });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
download = (containerName: string, blobName: string, fileName: string, config?: Partial<Rest.Config>) =>
|
|
33
|
-
this.restService.request<any, FileResult>({
|
|
34
|
-
method: 'GET',
|
|
35
|
-
url: `/api/file-explorer/files/download/${containerName}/${blobName}`,
|
|
36
|
-
params: { fileName },
|
|
37
|
-
},
|
|
38
|
-
{ apiName: this.apiName,...config });
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
get = (id: string, config?: Partial<Rest.Config>) =>
|
|
42
|
-
this.restService.request<any, FileDescriptorDto>({
|
|
43
|
-
method: 'GET',
|
|
44
|
-
url: `/api/file-explorer/files/${id}`,
|
|
45
|
-
},
|
|
46
|
-
{ apiName: this.apiName,...config });
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
getFileContainerConfiguration = (containerName: string, config?: Partial<Rest.Config>) =>
|
|
50
|
-
this.restService.request<any, FileContainerConfigurationDto>({
|
|
51
|
-
method: 'GET',
|
|
52
|
-
url: '/api/file-explorer/files/configuration',
|
|
53
|
-
params: { containerName },
|
|
54
|
-
},
|
|
55
|
-
{ apiName: this.apiName,...config });
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
getList = (input: GetFilesInput, config?: Partial<Rest.Config>) =>
|
|
59
|
-
this.restService.request<any, PagedResultDto<FileDescriptorDto>>({
|
|
60
|
-
method: 'GET',
|
|
61
|
-
url: '/api/file-explorer/files',
|
|
62
|
-
params: { containerName: input.containerName, directoryId: input.directoryId, creatorId: input.creatorId, filter: input.filter, entityId: input.entityId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
|
|
63
|
-
},
|
|
64
|
-
{ apiName: this.apiName,...config });
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
getStream = (containerName: string, blobName: string, imageResize?: ImageResizeInput, config?: Partial<Rest.Config>) =>
|
|
68
|
-
this.restService.request<any, Blob>({
|
|
69
|
-
method: 'GET',
|
|
70
|
-
responseType: 'blob',
|
|
71
|
-
url: `/api/file-explorer/files/${containerName}/${blobName}`,
|
|
72
|
-
params: { width: imageResize.width, height: imageResize.height },
|
|
73
|
-
},
|
|
74
|
-
{ apiName: this.apiName,...config });
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
update = (id: string, input: UpdateFileInput, config?: Partial<Rest.Config>) =>
|
|
78
|
-
this.restService.request<any, FileDescriptorDto>({
|
|
79
|
-
method: 'PUT',
|
|
80
|
-
url: `/api/file-explorer/files/${id}`,
|
|
81
|
-
body: input,
|
|
82
|
-
},
|
|
83
|
-
{ apiName: this.apiName,...config });
|
|
84
|
-
|
|
85
|
-
constructor(private restService: RestService) {}
|
|
86
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { IRemoteStreamContent } from '../../../volo/abp/content/models';
|
|
2
|
-
import type { CreationAuditedEntityDto, PagedAndSortedResultRequestDto } from '@abp/ng.core';
|
|
3
|
-
|
|
4
|
-
export interface CreateFileInput {
|
|
5
|
-
containerName: string;
|
|
6
|
-
cellName?: string;
|
|
7
|
-
directoryId?: string;
|
|
8
|
-
entityId?: string;
|
|
9
|
-
file: IRemoteStreamContent;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface FileCellDto {
|
|
13
|
-
name?: string;
|
|
14
|
-
displayName?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface FileContainerConfigurationDto {
|
|
18
|
-
maxBlobSize: number;
|
|
19
|
-
allowedFileTypeNames: string[];
|
|
20
|
-
fileCells: FileCellDto[];
|
|
21
|
-
createDirectoryPermissionName?: string;
|
|
22
|
-
createFilePermissionName?: string;
|
|
23
|
-
updateFilePermissionName?: string;
|
|
24
|
-
deleteFilePermissionName?: string;
|
|
25
|
-
getFilePermissionName?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface FileDescriptorDto extends CreationAuditedEntityDto<string> {
|
|
29
|
-
entityId?: string;
|
|
30
|
-
containerName?: string;
|
|
31
|
-
blobName?: string;
|
|
32
|
-
cellName?: string;
|
|
33
|
-
directoryId?: string;
|
|
34
|
-
size: number;
|
|
35
|
-
name?: string;
|
|
36
|
-
mimeType?: string;
|
|
37
|
-
url?: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface GetFilesInput extends PagedAndSortedResultRequestDto {
|
|
41
|
-
containerName: string;
|
|
42
|
-
directoryId?: string;
|
|
43
|
-
creatorId?: string;
|
|
44
|
-
filter?: string;
|
|
45
|
-
entityId?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface ImageResizeInput {
|
|
49
|
-
width?: number;
|
|
50
|
-
height?: number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface UpdateFileInput {
|
|
54
|
-
cellName?: string;
|
|
55
|
-
directoryId?: string;
|
|
56
|
-
name?: string;
|
|
57
|
-
}
|