@dignite-ng/expand.file-explorer 0.0.3 → 0.0.5

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 (137) hide show
  1. package/config/{src/enums/index.ts → enums/index.d.ts} +1 -1
  2. package/config/enums/route-names.d.ts +3 -0
  3. package/config/file-config.module.d.ts +8 -0
  4. package/config/index.d.ts +5 -0
  5. package/config/{src/providers/index.ts → providers/index.d.ts} +1 -1
  6. package/config/providers/route.provider.d.ts +8 -0
  7. package/config/{src/public-api.ts → public-api.d.ts} +3 -3
  8. package/esm2022/config/dignite-ng-expand.file-explorer-config.mjs +5 -0
  9. package/esm2022/config/enums/index.mjs +2 -0
  10. package/esm2022/config/enums/route-names.mjs +2 -0
  11. package/esm2022/config/file-config.module.mjs +19 -0
  12. package/esm2022/config/providers/index.mjs +2 -0
  13. package/esm2022/config/providers/route.provider.mjs +24 -0
  14. package/esm2022/config/public-api.mjs +4 -0
  15. package/esm2022/dignite-ng-expand.file-explorer.mjs +5 -0
  16. package/esm2022/lib/components/dome/file-dome.component.mjs +32 -0
  17. package/esm2022/lib/components/file-edit/file-edit.component.mjs +104 -0
  18. package/esm2022/lib/components/file-modal/file-modal.component.mjs +272 -0
  19. package/esm2022/lib/components/file-modal-tree/file-modal-tree.component.mjs +195 -0
  20. package/esm2022/lib/components/file-picker/file-picker.component.mjs +65 -0
  21. package/esm2022/lib/components/index.mjs +6 -0
  22. package/esm2022/lib/file-explorer-routing.module.mjs +25 -0
  23. package/esm2022/lib/file-explorer.module.mjs +88 -0
  24. package/esm2022/lib/previews/file-preview.component.mjs +100 -0
  25. package/esm2022/lib/previews/index.mjs +3 -0
  26. package/esm2022/lib/previews/models.mjs +92 -0
  27. package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +48 -0
  28. package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +3 -0
  29. package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +2 -0
  30. package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +60 -0
  31. package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +3 -0
  32. package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +2 -0
  33. package/esm2022/lib/proxy/dignite/file-explorer/index.mjs +4 -0
  34. package/esm2022/lib/proxy/dignite/index.mjs +3 -0
  35. package/esm2022/lib/proxy/index.mjs +5 -0
  36. package/esm2022/lib/proxy/microsoft/asp-net-core/index.mjs +3 -0
  37. package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/index.mjs +2 -0
  38. package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +2 -0
  39. package/esm2022/lib/proxy/microsoft/extensions/index.mjs +3 -0
  40. package/esm2022/lib/proxy/microsoft/extensions/primitives/index.mjs +2 -0
  41. package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +2 -0
  42. package/esm2022/lib/proxy/microsoft/index.mjs +5 -0
  43. package/esm2022/lib/proxy/microsoft/net/http/headers/index.mjs +2 -0
  44. package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +2 -0
  45. package/esm2022/lib/proxy/microsoft/net/http/index.mjs +3 -0
  46. package/esm2022/lib/proxy/microsoft/net/index.mjs +3 -0
  47. package/esm2022/lib/proxy/volo/abp/content/index.mjs +2 -0
  48. package/esm2022/lib/proxy/volo/abp/content/models.mjs +2 -0
  49. package/esm2022/lib/proxy/volo/abp/index.mjs +3 -0
  50. package/esm2022/lib/proxy/volo/index.mjs +3 -0
  51. package/esm2022/lib/services/file-api.service.mjs +66 -0
  52. package/esm2022/lib/services/index.mjs +2 -0
  53. package/esm2022/public-api.mjs +9 -0
  54. package/fesm2022/dignite-ng-expand.file-explorer-config.mjs +47 -0
  55. package/fesm2022/dignite-ng-expand.file-explorer-config.mjs.map +1 -0
  56. package/fesm2022/dignite-ng-expand.file-explorer.mjs +1169 -0
  57. package/fesm2022/dignite-ng-expand.file-explorer.mjs.map +1 -0
  58. package/index.d.ts +5 -0
  59. package/lib/components/dome/file-dome.component.d.ts +19 -0
  60. package/lib/components/file-edit/file-edit.component.d.ts +38 -0
  61. package/lib/components/file-modal/file-modal.component.d.ts +93 -0
  62. package/lib/components/file-modal-tree/file-modal-tree.component.d.ts +66 -0
  63. package/lib/components/file-picker/file-picker.component.d.ts +26 -0
  64. package/lib/components/index.d.ts +5 -0
  65. package/lib/file-explorer-routing.module.d.ts +7 -0
  66. package/lib/file-explorer.module.d.ts +19 -0
  67. package/lib/previews/file-preview.component.d.ts +47 -0
  68. package/lib/previews/index.d.ts +2 -0
  69. package/lib/previews/models.d.ts +5 -0
  70. package/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.d.ts +17 -0
  71. package/{src/lib/proxy/dignite/file-explorer/directories/models.ts → lib/proxy/dignite/file-explorer/directories/models.d.ts} +29 -35
  72. package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +20 -0
  73. package/lib/proxy/dignite/file-explorer/files/models.d.ts +50 -0
  74. package/{src/lib/proxy/microsoft/asp-net-core/mvc/models.ts → lib/proxy/microsoft/asp-net-core/mvc/models.d.ts} +10 -12
  75. package/lib/proxy/microsoft/extensions/primitives/models.d.ts +8 -0
  76. package/{src/lib/proxy/microsoft/net/http/headers/models.ts → lib/proxy/microsoft/net/http/headers/models.d.ts} +6 -7
  77. package/lib/proxy/volo/abp/content/models.d.ts +5 -0
  78. package/lib/services/file-api.service.d.ts +14 -0
  79. package/lib/services/index.d.ts +1 -0
  80. package/package.json +21 -2
  81. package/{src/public-api.ts → public-api.d.ts} +1 -5
  82. package/config/ng-package.json +0 -7
  83. package/config/src/enums/route-names.ts +0 -15
  84. package/config/src/file-config.module.ts +0 -12
  85. package/config/src/providers/route.provider.ts +0 -26
  86. package/ng-package.json +0 -7
  87. package/src/lib/components/dome/file-dome.component.html +0 -18
  88. package/src/lib/components/dome/file-dome.component.scss +0 -0
  89. package/src/lib/components/dome/file-dome.component.spec.ts +0 -21
  90. package/src/lib/components/dome/file-dome.component.ts +0 -33
  91. package/src/lib/components/file-edit/file-edit.component.html +0 -29
  92. package/src/lib/components/file-edit/file-edit.component.scss +0 -0
  93. package/src/lib/components/file-edit/file-edit.component.spec.ts +0 -21
  94. package/src/lib/components/file-edit/file-edit.component.ts +0 -98
  95. package/src/lib/components/file-modal/file-modal.component.html +0 -112
  96. package/src/lib/components/file-modal/file-modal.component.scss +0 -56
  97. package/src/lib/components/file-modal/file-modal.component.spec.ts +0 -21
  98. package/src/lib/components/file-modal/file-modal.component.ts +0 -284
  99. package/src/lib/components/file-modal-tree/file-modal-tree.component.html +0 -63
  100. package/src/lib/components/file-modal-tree/file-modal-tree.component.scss +0 -0
  101. package/src/lib/components/file-modal-tree/file-modal-tree.component.spec.ts +0 -21
  102. package/src/lib/components/file-modal-tree/file-modal-tree.component.ts +0 -207
  103. package/src/lib/components/file-picker/file-picker.component.html +0 -28
  104. package/src/lib/components/file-picker/file-picker.component.scss +0 -0
  105. package/src/lib/components/file-picker/file-picker.component.spec.ts +0 -21
  106. package/src/lib/components/file-picker/file-picker.component.ts +0 -58
  107. package/src/lib/components/index.ts +0 -5
  108. package/src/lib/file-explorer-routing.module.ts +0 -18
  109. package/src/lib/file-explorer.module.ts +0 -46
  110. package/src/lib/proxy/README.md +0 -17
  111. package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
  112. package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
  113. package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -58
  114. package/src/lib/proxy/generate-proxy.json +0 -11810
  115. package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
  116. package/src/lib/proxy/volo/abp/content/models.ts +0 -6
  117. package/src/lib/services/file-api.service.ts +0 -59
  118. package/src/lib/services/index.ts +0 -1
  119. package/tsconfig.lib.json +0 -14
  120. package/tsconfig.lib.prod.json +0 -10
  121. package/tsconfig.spec.json +0 -14
  122. /package/{src/lib/proxy/dignite/file-explorer/directories/index.ts → lib/proxy/dignite/file-explorer/directories/index.d.ts} +0 -0
  123. /package/{src/lib/proxy/dignite/file-explorer/files/index.ts → lib/proxy/dignite/file-explorer/files/index.d.ts} +0 -0
  124. /package/{src/lib/proxy/dignite/file-explorer/index.ts → lib/proxy/dignite/file-explorer/index.d.ts} +0 -0
  125. /package/{src/lib/proxy/dignite/index.ts → lib/proxy/dignite/index.d.ts} +0 -0
  126. /package/{src/lib/proxy/index.ts → lib/proxy/index.d.ts} +0 -0
  127. /package/{src/lib/proxy/microsoft/asp-net-core/index.ts → lib/proxy/microsoft/asp-net-core/index.d.ts} +0 -0
  128. /package/{src/lib/proxy/microsoft/asp-net-core/mvc/index.ts → lib/proxy/microsoft/asp-net-core/mvc/index.d.ts} +0 -0
  129. /package/{src/lib/proxy/microsoft/extensions/index.ts → lib/proxy/microsoft/extensions/index.d.ts} +0 -0
  130. /package/{src/lib/proxy/microsoft/extensions/primitives/index.ts → lib/proxy/microsoft/extensions/primitives/index.d.ts} +0 -0
  131. /package/{src/lib/proxy/microsoft/index.ts → lib/proxy/microsoft/index.d.ts} +0 -0
  132. /package/{src/lib/proxy/microsoft/net/http/headers/index.ts → lib/proxy/microsoft/net/http/headers/index.d.ts} +0 -0
  133. /package/{src/lib/proxy/microsoft/net/http/index.ts → lib/proxy/microsoft/net/http/index.d.ts} +0 -0
  134. /package/{src/lib/proxy/microsoft/net/index.ts → lib/proxy/microsoft/net/index.d.ts} +0 -0
  135. /package/{src/lib/proxy/volo/abp/content/index.ts → lib/proxy/volo/abp/content/index.d.ts} +0 -0
  136. /package/{src/lib/proxy/volo/abp/index.ts → lib/proxy/volo/abp/index.d.ts} +0 -0
  137. /package/{src/lib/proxy/volo/index.ts → lib/proxy/volo/index.d.ts} +0 -0
@@ -1,207 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, Input, Output, ViewChild, ViewContainerRef } from '@angular/core';
2
- import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3
- import { NzFormatEmitEvent } from 'ng-zorro-antd/tree';
4
- import * as DescriptorService from '../../proxy/dignite/file-explorer/directories';
5
- import { ToasterService } from '@abp/ng.theme.shared';
6
- import { NzFormatBeforeDropEvent } from 'ng-zorro-antd/tree';
7
- import { of } from 'rxjs';
8
- import { FileApiService } from '../../services/file-api.service';
9
- import { LocalizationService } from '@abp/ng.core';
10
- var that;
11
- @Component({
12
- selector: 'fe-file-modal-tree',
13
- templateUrl: './file-modal-tree.component.html',
14
- styleUrls: ['./file-modal-tree.component.scss']
15
- })
16
- export class FileModalTreeComponent {
17
- constructor(
18
- private _DescriptorService: DescriptorService.FileDescriptorService,
19
- private fb: FormBuilder,
20
- private toaster: ToasterService,
21
- public _FileApiService: FileApiService,
22
- public _LocalizationService: LocalizationService,
23
- ) {
24
- that = this
25
- }
26
-
27
- /**文件分组列表 */
28
- fileGroupList: any[] = [];
29
-
30
- /**选择的tree节点 */
31
- _theSelectedTreeNode: any = '';
32
- @Input()
33
- public set theSelectedTreeNode(v: any) {
34
- this._theSelectedTreeNode = v;
35
- if (v.length > 0) {
36
- this.loadData()
37
- }
38
- }
39
-
40
- /**正在编辑的节点 */
41
- theNodeBeingEdited: any = '';
42
-
43
- /**已展开的节点 */
44
- anExpandedNode: any[] = [];
45
-
46
- /**图片容器 */
47
- _fileContainerName: string;
48
-
49
- /**tree节点选择回调 */
50
- @Output() nodeClick = new EventEmitter();
51
-
52
-
53
- @Input()
54
- public set fileContainerName(v: string) {
55
- if (v) {
56
- this._fileContainerName = v;
57
- this.loadData()
58
- }
59
- }
60
-
61
- handleClick = (event) => event.stopPropagation();
62
-
63
- loadData() {
64
- if (this._fileContainerName) {
65
- this.getFileGroupList()
66
- }
67
- }
68
-
69
-
70
- /**获取文件分组 */
71
- getFileGroupList() {
72
- this._DescriptorService.getList({
73
- containerName: this._fileContainerName,
74
- }).subscribe(async (res) => {
75
- this.fileGroupList = await this.setTheValueOfTheNodeRecursively(res.items)
76
- })
77
- }
78
-
79
- /**递归设置节点的值 */
80
- setTheValueOfTheNodeRecursively(array: any[]): any {
81
- return new Promise((reslove, rejects) => {
82
- array.forEach((el) => {
83
- el.title = el.name
84
- el.key = el.id
85
- el.expanded = this.anExpandedNode.includes(el.key)
86
- if (el.children.length > 0) {
87
- this.setTheValueOfTheNodeRecursively(el.children)
88
- }
89
- })
90
- reslove(array)
91
- })
92
- }
93
-
94
- /**tree-拖拽 */
95
- nzEvent(event: NzFormatEmitEvent): void {
96
- }
97
-
98
- /**tree-拖拽 -验证*/
99
- beforeDrop(arg: NzFormatBeforeDropEvent) {
100
- if (arg.pos === 0 || arg.pos === 1) {
101
- that._DescriptorService.move(arg.dragNode.key, {
102
- "parentId": arg.pos === 1 ? (arg.node.parentNode?.key||'') : arg.node.key,
103
- "order": arg.pos === 1 ? arg.node.origin.order + 1 : arg.node.origin.children.length + 1
104
- }).subscribe(res => {
105
- // that.toaster.success("拖拽完成");
106
- that.getFileGroupList()
107
- })
108
- return of(true)
109
- } else {
110
- return of(false);
111
- }
112
- }
113
-
114
- /**tree--选择节点 */
115
- activeNode(event) {
116
- this._theSelectedTreeNode = event.node
117
- this.nodeClick.emit(event.node)
118
- }
119
-
120
- /**判断节点是否选中 */
121
- isNodeSelected = (el) => el.key === this._theSelectedTreeNode?.key
122
-
123
- /**点击展开树节点图标触发 */
124
- nzExpandChange(event) {
125
- let anExpandedNode = this.anExpandedNode
126
- if (anExpandedNode.includes(event.node.key)) {
127
- anExpandedNode = anExpandedNode.filter(key => key !== event.node.key)
128
- } else {
129
- anExpandedNode.push(event.node.key)
130
- }
131
- this.anExpandedNode = anExpandedNode
132
- }
133
-
134
-
135
- /**增加分组 */
136
- addDescriptorBtn(items: any = '', edit = false) {
137
- this.ModalDescriptorOpen = true
138
- this.ModalDescriptorForm = this.fb.group({
139
- containerName: [this._fileContainerName || '', Validators.required],
140
- name: ['', Validators.required],
141
- parentId: [items?.key || '', Validators.required],
142
- })
143
- /**编辑 */
144
- if (edit) {
145
- this.theNodeBeingEdited = items.origin
146
- this.ModalDescriptorForm.patchValue({
147
- name: items.origin.name
148
- })
149
- }
150
- }
151
-
152
- /**删除分组 */
153
- deleteDescriptorBtn(node) {
154
- this._DescriptorService.delete(node.key).subscribe(res => {
155
- // this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
156
- this.ModalDescriptorOpen = false
157
- if (this.theNodeBeingEdited.key == node.key) this.theNodeBeingEdited = ''
158
- this.getFileGroupList()
159
- })
160
- }
161
-
162
-
163
-
164
- /**分组 */
165
- /**模态框-状态-是否打开 */
166
- ModalDescriptorOpen: boolean = false
167
-
168
- /**模态框-descriptor-繁忙状态-用于确定模态的繁忙状态是否为真 */
169
- ModalDescriptorBusy: boolean = false
170
-
171
- /**模态框-descriptor-表单 */
172
- ModalDescriptorForm: FormGroup | undefined;
173
-
174
- /**模态框-descriptor-表单--控件模板-动态赋值表单控件 */
175
- @ViewChild('ModalFormDescriptorSubmit', { static: false }) ModalFormDescriptorSubmit: ElementRef;
176
-
177
- /**模态框-descriptor-状态改变回调 */
178
- ModalDescriptorVisibleChange(event) {
179
- if (!event) {
180
- this.ModalDescriptorForm = undefined
181
- this.theNodeBeingEdited = ''
182
- return
183
- }
184
- }
185
-
186
- /**f分组模态框保存 */
187
- createOrEditSave() {
188
- let input = this.ModalDescriptorForm.value
189
- if (this.theNodeBeingEdited) {
190
- this._DescriptorService.update(this.theNodeBeingEdited.key, input).subscribe(res => {
191
- // this.toaster.success("保存成功");
192
- this.ModalDescriptorOpen = false
193
- this.getFileGroupList()
194
- })
195
- return
196
- }
197
- this._DescriptorService.create(input).subscribe(res => {
198
- // this.toaster.success("保存成功");
199
- this.ModalDescriptorOpen = false
200
- this.getFileGroupList()
201
- })
202
- }
203
-
204
-
205
-
206
-
207
- }
@@ -1,28 +0,0 @@
1
- <button class="btn btn-sm btn-primary ms-2" type="button" (click.stop)="ModalOpen = true">{{'FileExplorer::SelectFile' | abpLocalization}}</button>
2
- <fe-file-modal [(visible)]="ModalOpen" [selectPickerFile]="selectFormFile" (selectFilefn)="_selectFilefn($event)" [fileContainerName]="_fileContainerName"></fe-file-modal>
3
- <table class="table" *ngIf="_fileShowTable.length>0">
4
- <thead>
5
- <tr>
6
- <th scope="col">{{'FileExplorer::FileName' | abpLocalization}}</th>
7
- <th scope="col">{{'FileExplorer::FileSize' | abpLocalization}}</th>
8
- <th scope="col"></th>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <ng-container *ngFor="let item of _fileShowTable;let i =index">
13
- <tr>
14
- <th scope="row">
15
- <div>{{item.name}}</div>
16
- </th>
17
- <td >{{_FileApiService.formatFileSize(item.size)}}</td>
18
- <td>
19
- <button class="btn btn-sm p-0 btn-light " (click.stop)="deleteFileTableItem(i,item)">
20
- <i class="fas fa-trash p-2"></i>
21
- </button>
22
- </td>
23
- </tr>
24
- </ng-container>
25
- </tbody>
26
- </table>
27
-
28
-
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { FilePickerComponent } from './file-picker.component';
4
-
5
- describe('FilePickerComponent', () => {
6
- let component: FilePickerComponent;
7
- let fixture: ComponentFixture<FilePickerComponent>;
8
-
9
- beforeEach(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [FilePickerComponent]
12
- });
13
- fixture = TestBed.createComponent(FilePickerComponent);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,58 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild, ViewContainerRef } from '@angular/core';
2
- import { FileApiService } from '../../services/file-api.service';
3
-
4
- @Component({
5
- selector: 'fe-file-picker',
6
- templateUrl: './file-picker.component.html',
7
- styleUrls: ['./file-picker.component.scss']
8
- })
9
- export class FilePickerComponent implements OnChanges{
10
-
11
-
12
- constructor(
13
- private _FileApiService: FileApiService,
14
- ) {
15
- }
16
-
17
-
18
- /**图片容器 */
19
- _fileContainerName: string = 'images'
20
- @Input()
21
- public set fileContainerName(v: string) {
22
- this._fileContainerName = v;
23
- }
24
-
25
- /**已选定的文件 */
26
- @Input() selectFormFile:any[]
27
-
28
- ngOnChanges(changes: SimpleChanges): void {
29
- let selectFormFilengOnChanges=changes.selectFormFile['currentValue']
30
- if(selectFormFilengOnChanges.length>0){
31
- this._fileShowTable=selectFormFilengOnChanges
32
- }
33
- }
34
-
35
- @Output() selectedFileChange = new EventEmitter()
36
-
37
- _fileShowTable: any[] = []
38
-
39
- /**表格选择的文件回调 */
40
- _selectFilefn(event: any[]) {
41
- let _fileShowTable= this._FileApiService.deepClone(event)
42
- this._fileShowTable =_fileShowTable
43
- this.selectFormFile=_fileShowTable
44
- this.selectedFileChange.emit(_fileShowTable)
45
- }
46
-
47
- /**模态框-状态-是否打开 */
48
- ModalOpen: boolean = false
49
-
50
- /**删除文件表格项 */
51
- deleteFileTableItem(i, file) {
52
- this._fileShowTable.splice(i, 1)
53
- this.selectFormFile=this._fileShowTable
54
- this.selectedFileChange.emit([])
55
- this.selectedFileChange.emit(this.selectFormFile)
56
- }
57
-
58
- }
@@ -1,5 +0,0 @@
1
- export * from './dome/file-dome.component'
2
- export * from './file-edit/file-edit.component'
3
- export * from './file-modal/file-modal.component'
4
- export * from './file-modal-tree/file-modal-tree.component'
5
- export * from './file-picker/file-picker.component'
@@ -1,18 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { Router, RouterModule, Routes } from '@angular/router';
3
- import { FileDomeComponent } from './components/dome/file-dome.component';
4
-
5
- const routes: Routes = [
6
- {
7
- path: 'file-dome',
8
- component: FileDomeComponent
9
- },
10
- ];
11
-
12
- @NgModule({
13
- imports: [RouterModule.forChild(routes)],
14
- exports: [RouterModule]
15
- })
16
- export class FileExplorerRoutingModule {
17
-
18
- }
@@ -1,46 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CoreModule, LIST_QUERY_DEBOUNCE_TIME, ListService } from '@abp/ng.core';
3
- import { ThemeSharedModule } from '@abp/ng.theme.shared';
4
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
6
- import { NzTreeModule } from 'ng-zorro-antd/tree';
7
- import { NgxValidateCoreModule } from '@ngx-validate/core';
8
- import { FileExplorerRoutingModule } from './file-explorer-routing.module';
9
- import { FileEditComponent, FilePickerComponent, FileModalComponent, FileModalTreeComponent, FileDomeComponent } from './components';
10
- @NgModule({
11
- declarations: [
12
- FileEditComponent,
13
- FilePickerComponent,
14
- FileModalComponent,
15
- FileModalTreeComponent,
16
- FileDomeComponent,
17
- ],
18
- imports: [
19
- FormsModule,
20
- CoreModule,
21
- ThemeSharedModule,
22
- ReactiveFormsModule,
23
- NgbDropdownModule,
24
- NzTreeModule,
25
- NgxValidateCoreModule,
26
- FileExplorerRoutingModule,
27
- ],
28
- exports: [
29
- FileEditComponent,
30
- FilePickerComponent,
31
- FileModalComponent,
32
- FileModalTreeComponent,
33
- FileDomeComponent
34
- ],
35
- providers: [
36
- // [Required]
37
- ListService,
38
- // [Optional]
39
- // Provide this token if you want a different debounce time.
40
- // Default is 300. Cannot be 0. Any value below 100 is not recommended.
41
- { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
42
- ],
43
- })
44
- export class FileExplorerModule {
45
-
46
- }
@@ -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,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,58 +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: any;
10
- file: IRemoteStreamContent;
11
- }
12
-
13
- export interface FileCellDto {
14
- name?: string;
15
- displayName?: string;
16
- }
17
-
18
- export interface FileContainerConfigurationDto {
19
- maxBlobSize: number;
20
- allowedFileTypeNames: string[];
21
- fileCells: FileCellDto[];
22
- createDirectoryPermissionName?: string;
23
- createFilePermissionName?: string;
24
- updateFilePermissionName?: string;
25
- deleteFilePermissionName?: string;
26
- getFilePermissionName?: string;
27
- }
28
-
29
- export interface FileDescriptorDto extends CreationAuditedEntityDto<string> {
30
- entityId?: string;
31
- containerName?: string;
32
- blobName?: string;
33
- cellName?: string;
34
- directoryId?: string;
35
- size: number;
36
- name?: string;
37
- mimeType?: string;
38
- url?: string;
39
- }
40
-
41
- export interface GetFilesInput extends PagedAndSortedResultRequestDto {
42
- containerName: string;
43
- directoryId?: string;
44
- creatorId?: string;
45
- filter?: string;
46
- entityId?: string;
47
- }
48
-
49
- export interface ImageResizeInput {
50
- width?: number;
51
- height?: number;
52
- }
53
-
54
- export interface UpdateFileInput {
55
- cellName?: string;
56
- directoryId?: string;
57
- name?: string;
58
- }