@dotglitch/ngx-common 1.1.25 → 1.1.27

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.
@@ -9555,21 +9555,7 @@ class FileGridComponent {
9555
9555
  {
9556
9556
  label: "Download",
9557
9557
  icon: "download",
9558
- action: (file) => {
9559
- let target = `${window.origin}${this.config.apiSettings.downloadEntryUrl}`;
9560
- let path = file.path + file.name;
9561
- if (file.kind == "directory" && !path.endsWith('/'))
9562
- path += "/";
9563
- target += `${target.includes('?') ? '&' : '?'}path=${path}&ngsw-bypass=true`;
9564
- console.log(target);
9565
- // window.open(target);
9566
- var link = document.createElement("a");
9567
- link.download = file.name;
9568
- link.href = target;
9569
- link.click();
9570
- link.remove();
9571
- this.fileManager.fileDownload.next(file);
9572
- }
9558
+ action: (file) => this.fileManager.downloadFile(file)
9573
9559
  },
9574
9560
  {
9575
9561
  label: "Open in new Tab",
@@ -10476,6 +10462,21 @@ class FilemanagerComponent {
10476
10462
  url = (url.includes('?') ? '&' : '?') + `dir=${file.path}&file=${file.name}`;
10477
10463
  return url;
10478
10464
  }
10465
+ downloadFile(file) {
10466
+ let path = file.path + file.name;
10467
+ if (file.kind == "directory" && !path.endsWith('/'))
10468
+ path += "/";
10469
+ const url = this.config.apiSettings.downloadEntryUrlTemplate
10470
+ ? this.config.apiSettings.downloadEntryUrlTemplate(path)
10471
+ : this.config.apiSettings.downloadEntryUrl;
10472
+ // window.open(target);
10473
+ var link = document.createElement("a");
10474
+ link.download = file.name;
10475
+ link.href = url;
10476
+ link.click();
10477
+ link.remove();
10478
+ this.fileDownload.next(file);
10479
+ }
10479
10480
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: FilemanagerComponent, deps: [{ token: NGX_WEB_COMPONENTS_CONFIG, optional: true }, { token: LazyLoaderService }, { token: i0.ViewContainerRef }, { token: Fetch }], target: i0.ɵɵFactoryTarget.Component }); }
10480
10481
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: FilemanagerComponent, isStandalone: true, selector: "app-filemanager", inputs: { config: "config", gridSize: "gridSize", mode: "mode", contextTags: "contextTags", value: "value" }, outputs: { valueChange: "valueChange", focusedFilesChange: "focusedFilesChange", fileUpload: "fileUpload", fileDownload: "fileDownload", fileRename: "fileRename", fileDelete: "fileDelete", fileCopy: "fileCopy", filePaste: "filePaste", fileSelect: "fileSelect", fileDblClick: "fileDblClick", folderSelect: "folderSelect", folderDblClick: "folderDblClick", filesSelect: "filesSelect" }, viewQueries: [{ propertyName: "tabGroup", first: true, predicate: ["tabGroup"], descendants: true }, { propertyName: "treeView", first: true, predicate: TreeViewComponent, descendants: true }, { propertyName: "toolbar", first: true, predicate: ToolbarComponent, descendants: true }, { propertyName: "drawer", first: true, predicate: MatDrawerContainer, descendants: true }, { propertyName: "fileGrids", predicate: FileGridComponent, descendants: true }], ngImport: i0, template: "<app-toolbar\n [currentTab]=\"currentTab\"\n [(showHiddenFiles)]=\"showHiddenFiles\"\n [(showSidebar)]=\"showSidebar\"\n [config]=\"config\"\n [showBareMinimum]=\"width < 500 && config.showBreadcrumb != false\"\n (onBreadcrumbClick)=\"onBreadcrumbClick($event)\"\n/>\n\n<mat-drawer-container>\n <mat-drawer #drawer mode=\"over\">\n <app-toolbar\n *ngIf=\"width < 500 && config.showBreadcrumb != false\"\n [currentTab]=\"currentTab\"\n [(showHiddenFiles)]=\"showHiddenFiles\"\n [(showSidebar)]=\"showSidebar\"\n [config]=\"config\"\n [drawerMode]=\"true\"\n (onBreadcrumbClick)=\"onBreadcrumbClick($event)\"\n />\n <app-tree-view\n [data]=\"currentTab.sidebarItems\"\n (loadChildren)=\"onTreeViewLoadChildren($event)\"\n (click)=\"onTreeViewSelect($event)\"\n />\n </mat-drawer>\n <mat-drawer-content>\n <as-split direction=\"horizontal\" [gutterSize]=\"sidebarOverlay ? 0 : 2\" [unit]=\"'pixel'\" (dragEnd)=\"onResizeEnd()\">\n <as-split-area\n style=\"background-color: var(--filemanager-sidebar-background-color, #2c2c2c)\"\n [size]=\"215\"\n [minSize]=\"215\"\n [maxSize]=\"width/4\"\n [visible]=\"!sidebarOverlay && config.showTreeview != false\"\n >\n <div class=\"sidebar\"\n *ngIf=\"!sidebarOverlay && config.showTreeview != false\"\n (click)=\"currentTab.selection = []\"\n >\n <app-tree-view\n [data]=\"currentTab.sidebarItems\"\n (loadChildren)=\"onTreeViewLoadChildren($event)\"\n (click)=\"onTreeViewSelect($event)\"\n />\n </div>\n </as-split-area>\n <as-split-area style=\"background-color: var(--filemanager-background-color, #272727);\">\n <div class=\"content\"\n [style.--tab-height]=\"tabs.length > 1 ? '36px' : '0'\"\n >\n <mat-tab-group #tabGroup (selectedTabChange)=\"currentTab = tabs[$event.index]\" [(selectedIndex)]=\"tabIndex\">\n <mat-tab *ngFor=\"let tab of tabs; let i = index\">\n <ng-template mat-tab-label>\n {{tab.label}}\n <mat-icon\n class=\"close\"\n (click)=\"closeTab(tab)\">\n close\n </mat-icon>\n </ng-template>\n\n <ng-template matTabContent>\n <app-file-grid\n [viewMode]=\"tab.viewMode\"\n [tab]=\"tab\"\n [config]=\"config\"\n [gridSize]=\"gridSize\"\n [sortOrder]=\"tab.sortOrder\"\n [(selection)]=\"tab.selection\"\n [(path)]=\"tab.path\"\n (pathChange)=\"onTabPathChange(tab)\"\n [(value)]=\"gridValues[i]\"\n (valueChange)=\"onGridValueChange()\"\n (loadFiles)=\"onTabLoadFiles(tab, $event)\"\n\n (fileSelect)=\"fileSelect.next($event)\"\n (fileDblClick)=\"fileDblClick.next($event)\"\n (folderSelect)=\"folderSelect.next($event)\"\n (folderDblClick)=\"folderDblClick.next($event)\"\n />\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </as-split-area>\n </as-split>\n </mat-drawer-content>\n</mat-drawer-container>\n\n", styles: [":host{display:flex;flex-direction:column;height:100%;width:100%}:host .content{display:flex;height:100%;overflow:hidden}:host ::ng-deep .as-split-gutter{background-color:var(--gutter-color, #121212)!important}:host ::ng-deep .mat-mdc-tab-header{height:var(--tab-height, 0);transition:height .25s ease}:host ::ng-deep .mat-mdc-tab-header .mdc-tab{height:var(--tab-height, 0);background-color:var(--filemanager-tab-background-color, #303030)}:host ::ng-deep .mat-mdc-tab .mdc-tab__content{position:static}:host ::ng-deep .mat-mdc-tab:not(.mat-mdc-tab-disabled).mdc-tab--active .mdc-tab__text-label,:host ::ng-deep .mat-mdc-tab-link:not(.mat-mdc-tab-disabled).mdc-tab--active .mdc-tab__text-label{color:var(--text-subdued-color)}.sidebar{border-right:1px solid transparent;transition:background-color .2s cubic-bezier(0,0,.2,1),border-color .2s ease}.sidebar ul{list-style-type:none;text-align:left;margin:0;padding:0;display:flex;flex-direction:column}.sidebar ul li{display:flex;align-items:center;transition:all .2s ease;font-size:14px;padding:6px 6px 6px 24px}.sidebar ul li mat-icon{margin-right:8px}.sidebar ul li:hover{background-color:#343434}.sidebar ul .tooltip{background-color:#101010cc;border:1px solid #414141;opacity:0;pointer-events:none;transition:all .2s ease}.active .sidebar{background-color:#2c2c2c;border-right-color:#1c1c1c}.active .sidebar li:hover{background-color:#343434}.close{position:absolute;right:12px;color:#666;transition:color .25s ease}.close:hover{color:#ccc}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: AngularSplitModule }, { kind: "component", type: i3$2.SplitComponent, selector: "as-split", inputs: ["direction", "unit", "gutterSize", "gutterStep", "restrictMove", "useTransition", "disabled", "dir", "gutterDblClickDuration", "gutterClickDeltaPx", "gutterAriaLabel"], outputs: ["transitionEnd", "dragStart", "dragEnd", "gutterClick", "gutterDblClick"], exportAs: ["asSplit"] }, { kind: "directive", type: i3$2.SplitAreaDirective, selector: "as-split-area, [as-split-area]", inputs: ["order", "size", "minSize", "maxSize", "lockSize", "visible"], exportAs: ["asSplitArea"] }, { kind: "component", type: FileGridComponent, selector: "app-file-grid", inputs: ["path", "config", "showHiddenFiles", "viewMode", "gridSize", "tab", "selection", "value", "sortOrder"], outputs: ["pathChange", "fileSelect", "fileDblClick", "folderSelect", "folderDblClick", "newTab", "loadFiles", "selectionChange", "valueChange"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "directive", type: i4$2.MatTabContent, selector: "[matTabContent]" }, { kind: "directive", type: i4$2.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i4$2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i4$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "component", type: i6$2.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i6$2.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i6$2.MatDrawerContent, selector: "mat-drawer-content" }, { kind: "component", type: ToolbarComponent, selector: "app-toolbar", inputs: ["config", "currentTab", "showHiddenFiles", "showSidebar", "drawerMode", "showBareMinimum"], outputs: ["onBreadcrumbClick", "showHiddenFilesChange", "showSidebarChange"] }, { kind: "component", type: TreeViewComponent, selector: "app-tree-view", inputs: ["rowTemplate", "data"], outputs: ["click", "loadChildren"] }] }); }
10481
10482
  }