1.6.0 • Published 1 month ago

ngx-explorer-sdteam v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

ngx-explorer-sdteam

Preview

A version inherits from ngx-explorer.

  • Image preview
  • Right click context menu
  • Read-only mode
  • Asynchronous upload progress bar
  • One-click treeview
  • Observable callback function
  • File link generation

DEMO

Icon View explorer

Detail View explorer

Quick Start

  • Install package
yarn add ngx-explorer-sdteam
  • Implement IDataService provider interface
import { IDataService } from 'ngx-explorer-sdteam';

export class MainComponent implements IDataService<ExampleNode> {
    ...
}
  • Add NgxExplorerModule and data provider to NgModule
import { MainComponent } from './main/main.component';
import { NgxExplorerModule, DataService } from 'ngx-explorer-sdteam';

@NgModule({
    imports: [
        ...
        NgxExplorerModule
    ],
    exports: [],
    declarations:[MainComponent],
    providers: [
        { provide: DataService, useClass: MainComponent }
    ]
})
export class AppModule { }
  • Add Style to angular.json
"styles": [
    "node_modules/ngx-explorer-sdteam/src/assets/icons/css/txt.css"
],
  • Add to .html
<nxe-explorer></nxe-explorer>

Available attribute

AttributeTypeDefaultDescription
read-onlybooleanfalseExplorer work on read only mode (Open Folder/Download File only)
auto-refreshbooleanfalseExplorer will be refreshed automatically
refresh-intervalnumber10000Interval between refreshes
offset-topnumber0Right click context menu offset from top
offset-rightnumber0Right click context menu offset from right
offset-bottomnumber0Right click context menu offset from bottom
offset-leftnumber0Right click context menu offset from left
main-nodestring"Files"Root folder name
view-typestring"Detail"Default explorer view type

Example

<nxe-explorer main-node="home" 
              [read-only]="true" 
              [offset-left]="30" 
              [offset-right]="48" 
              [offset-top]="126" 
              [offset-bottom]="80"> 
</nxe-explorer>

Main function

FunctionDescription
New FolderCreate a new folder on recent path
Upload FileOpen a dialog to select uploaded file
Download FileDownload selected files
RenameRename selected item
DeleteDelete selected item
Copy PathCopy recent path
Generate LinkGenerate a link to selected item

Copy Path

Path Format : Home/Music/Classical

Generate Link

Link Format : .../file-explorer?filter=Home%2FMusic%2FClassical

import { ExampleNode, IDataService, HelperService } from 'ngx-explorer-sdteam';

export class MainComponent implements IDataService<ExampleNode> {
    filter: string;
    baseUrl: string = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/`;
    constructor(
        private _activatedroute: ActivatedRoute,
        private _router: Router
    ) {
        this.filter = this._activatedroute.snapshot.queryParamMap.get('filter')
        this._router.events
            .pipe(filter((event: Event | RouterEvent) => event instanceof NavigationEnd))
            .subscribe(() => { delete this.filter });
    }
    getFilterString(): Observable<any> {
        return of(this.filter);
    }
    getBaseUrl(): Observable<any> {
        return of(`${this.baseUrl}#/file-explorer?filter=`);
    }
}

SignalR

import { ExampleNode, IDataService, HelperService } from 'ngx-explorer-sdteam';

export class MainComponent implements IDataService<ExampleNode> {
    constructor(
    private service: FileManagerService,
    private helperService: HelperService,
    private signalRService: SignalRService,
  ) {
    this.signalRService.fileChangedEmitter
    .pipe(takeUntilDestroyed())
    .subscribe(() => {
        this.helperService.refreshExplorer()
    });
  }
}

Usage

Database & API

Contact me for more detail (doquochao95@gmail.com)

SPA

Example file

1.6.0

1 month ago

1.5.0

1 month ago

1.3.0

4 months ago

1.2.0

4 months ago

1.1.8

5 months ago

1.1.6

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago