{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-template",
  "framework": "angular",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "template",
  "dependencies": [
    "@syncfusion/ej2-angular-filemanager",
    "@syncfusion/ej2-angular-splitbuttons"
  ],
  "description": "File manager with templated navigation pane, card-style large icons and custom details columns.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": true,
    "platformIndex": "https://ai.syncfusion.com/angular/llms.txt",
    "skillPack": "syncfusion/angular-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/angular/file-manager-template.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-template/file-manager.component.html",
      "content": "<div class=\"control-section\">\n    <div class=\"sample-container\">\n        <ejs-filemanager #filemanager id=\"filemanager\" [ajaxSettings]=\"ajaxSettings\" [toolbarSettings]=\"toolbarSettings\"\n            [contextMenuSettings]=\"contextMenuSettings\" [detailsViewSettings]=\"detailsViewSettings\"\n            cssClass=\"e-fm-template-sample\" height=\"600px\" (menuOpen)=\"onMenuOpen($event)\"\n            (fileLoad)=\"onFileLoad($event)\">\n\n            <ng-template #navigationPaneTemplate let-data>\n                <div class=\"e-nav-pane-node\" style=\"display:inline-flex; align-items:center;\">\n                    <span class=\"e-icons\" [ngClass]=\"getIconsForFolders(data)\"></span>\n                    <span class=\"folder-name\" style=\"margin-left:8px;\">{{ data?.name }}</span>\n                </div>\n            </ng-template>\n\n            <ng-template #largeIconsTemplate let-data>\n                <div class=\"custom-icon-card\">\n                    <div class=\"file-header\">\n                        <div class=\"left-info\">\n                            <ng-container *ngIf=\"data?.isFile\">\n                                <div class=\"{{ getFileIconCssClass(data) }}\"></div>\n                            </ng-container>\n                            <div class=\"file-name\" [title]=\"data?.name\">{{ data?.name }}</div>\n                        </div>\n                        <div class=\"action-ddb\"></div>\n                    </div>\n                    <div class=\"{{ getBackgroundCss(data) }}\" [title]=\"data?.name\"></div>\n                    <div class=\"file-formattedDate\">Created on {{ getFormattedDate(data?.dateCreated) }}</div>\n                </div>\n            </ng-template>\n        </ejs-filemanager>\n    </div>\n</div>\n\n"
    },
    {
      "target": "src/components/file-manager-template/file-manager.component.ts",
      "content": "import { Component, ViewChild, ViewEncapsulation, OnInit } from '@angular/core';\nimport {\n    FileManagerComponent,\n    NavigationPaneService,\n    ToolbarService,\n    DetailsViewService,\n    FileManagerModule\n} from '@syncfusion/ej2-angular-filemanager';\nimport { DropDownButton, ItemModel, DropDownButtonModule } from '@syncfusion/ej2-angular-splitbuttons';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n    selector: 'control-content',\n    templateUrl: 'file-manager.component.html',\n    styleUrls: ['../file-manager-template.style.css'],\n    encapsulation: ViewEncapsulation.None,\n    standalone: true,\n    providers: [NavigationPaneService, ToolbarService, DetailsViewService],\n    imports: [CommonModule, FileManagerModule, DropDownButtonModule],\n})\nexport class TemplateController implements OnInit {\n    @ViewChild('filemanager', { static: true }) public filemanager?: FileManagerComponent;\n    public ajaxSettings: any;\n    public toolbarSettings!: object;\n    public contextMenuSettings!: object;\n    public detailsViewSettings: any;\n    private hostUrl = 'https://physical-service.syncfusion.com/';\n    private baseActionItems: ItemModel[] = [\n        { text: 'Open', iconCss: 'e-icons e-folder-open' },\n        { text: 'Download', iconCss: 'e-icons e-download' },\n        { text: 'Refresh', iconCss: 'e-icons e-refresh' },\n        { text: 'Delete', iconCss: 'e-icons e-trash' }\n    ];\n    ngOnInit(): void {\n        this.ajaxSettings = {\n            url: this.hostUrl + 'api/FileManager/FileOperations',\n            getImageUrl: this.hostUrl + 'api/FileManager/GetImage',\n            uploadUrl: this.hostUrl + 'api/FileManager/Upload',\n            downloadUrl: this.hostUrl + 'api/FileManager/Download'\n        };\n        this.toolbarSettings = {\n            items: ['NewFolder', 'SortBy', 'Cut', 'Copy', 'Paste', 'Delete', 'Refresh', 'Download', 'Rename', 'Selection', 'View', 'Details']\n        };\n        this.contextMenuSettings = {\n            file: ['Cut', 'Copy', '|', 'Delete', 'Download', 'Rename', '|', 'Details'],\n            layout: ['SortBy', 'View', 'Refresh', '|', 'Paste', '|', 'NewFolder', '|', 'Details', '|', 'SelectAll'],\n            visible: true\n        };\n        this.detailsViewSettings = {\n            columns: [\n                { field: 'name', headerText: 'Name', template: '${name}' },\n                { field: 'size', headerText: 'Size', valueAccessor: this.sizeValueAccessor.bind(this) },\n                { field: '_fm_modified', headerText: 'DateModified', format: 'MM/dd/yyyy hh:mm a' },\n                { headerText: 'Actions', template: '<div class=\"action-ddb\" data-name=\"${name}\" data-isFile=\"${isFile}\"></div>' }\n            ]\n        };\n    }\n    sizeValueAccessor(data: any): string {\n        return data?.isFile ? this.formatSize(data.size) : '-';\n    }\n    onFileLoad(args: any): void {\n        const valid = ['DetailsView', 'LargeIconsView'];\n        if (valid.indexOf(args.module) === -1) return;\n        const name = (args.fileDetails as any)?.name;\n        const isFile = (args.fileDetails as any)?.isFile;\n        const hosts = (args.element as HTMLElement).querySelectorAll('.action-ddb');\n        hosts.forEach((host: Element) => {\n            const el = host as HTMLElement;\n            if (el.hasAttribute('data-ddb-initialized')) return;\n\n            el.setAttribute('data-name', name);\n            el.setAttribute('data-isfile', String(isFile));\n            const items: ItemModel[] = isFile\n                ? this.baseActionItems.filter(i => i.text !== 'Open')\n                : this.baseActionItems;\n\n            const ddb = new DropDownButton({\n                items,\n                cssClass: 'e-caret-hide filemanager-dropdown-button',\n                iconCss: 'e-icons e-more-vertical-1',\n                select: (ev) => this.onActionSelect(ev.item.text || '', { name, isFile })\n            });\n            ddb.appendTo(el);\n            el.setAttribute('data-ddb-initialized', 'true');\n        });\n    }\n\n    onMenuOpen(args: any): void {\n        args.cancel = true;\n    }\n\n    private onActionSelect(action: string, item: { name: string; isFile: boolean }): void {\n        const fm = this.filemanager as any;\n\n        switch (action) {\n            case 'Open':\n                fm.openFile(item.name);\n                break;\n            case 'Download':\n                fm.downloadFiles([item.name]);\n                break;\n            case 'Refresh':\n                fm.refreshFiles();\n                break;\n            case 'Delete':\n                fm.deleteFiles([item.name]);\n                break;\n            default:\n                break;\n        }\n    }\n\n    formatSize(bytes: number): string {\n        if (!bytes) return '0 B';\n        const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];\n        let i = 0;\n        let v = bytes;\n        while (v >= 1024 && i < sizes.length - 1) {\n            v /= 1024; i++;\n        }\n        return `${v.toFixed(1)} ${sizes[i]}`;\n    }\n\n    getFormattedDate(date: string | number | Date | undefined): string {\n        if (!date) return '';\n        try {\n            return new Date(date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });\n        } catch { return ''; }\n    }\n\n    getBackgroundCss(item: any): string {\n        const NamedFileBackgrounds: Record<string, string> = {\n            'Adam.png': 'background-Adam',\n            'Andrew.png': 'background-Andrew',\n            'Ellie.png': 'background-Ellie',\n            'Jameson.png': 'background-Jameson',\n            'John.png': 'background-John',\n            'Josie.png': 'background-Josie',\n            'Apple pie.png': 'background-Applepie',\n            'Bread.png': 'background-Bread',\n            'Doughnut.png': 'background-Doughnut',\n            'Nuggets.png': 'background-Nuggets',\n            'Sugar cookie.png': 'background-Sugarcookie',\n            'bird.jpg': 'background-bird',\n            'sea.jpg': 'background-sea',\n            'seaview.jpg': 'background-seaview',\n            'snow.jpg': 'background-snow',\n            'snowfall.jpg': 'background-snowfall'\n        };\n        const ExtensionBackgrounds: Record<string, string> = {\n            jpg: 'background-jpg', jpeg: 'background-jpg', png: 'background-png',\n            pptx: 'background-pptx', pdf: 'background-pdf', mp4: 'background-video',\n            mp3: 'background-audio', docx: 'background-doc', txt: 'background-txt', xlsx: 'background-xlsx', zip: 'background-zip'\n        };\n        if (!item?.isFile) return 'file-icon background-folder';\n        if (NamedFileBackgrounds[item.name]) return `file-icon ${NamedFileBackgrounds[item.name]}`;\n        const ext = (item.name.split('.').pop() || '').toLowerCase();\n        return `file-icon ${ExtensionBackgrounds[ext] || 'background-default'}`;\n    }\n\n    getIconsForFolders(item: any): string {\n        const iconMap: Record<string, string> = {\n            Files: 'e-folder',\n            Documents: 'e-file-document',\n            Downloads: 'e-download',\n            Pictures: 'e-thumbnail',\n            Music: 'e-file-format',\n            Videos: 'e-video',\n            Employees: 'e-export-png',\n            Food: 'e-export-png',\n            Nature: 'e-export-png'\n        };\n        return iconMap[item?.name] || 'e-folder';\n    }\n\n    getFileIconCssClass(item: any): string {\n        if (!item?.isFile) return '';\n        const extensionMap: Record<string, string> = {\n            jpg: 'image', jpeg: 'image', png: 'image', gif: 'image',\n            mp3: 'music', wav: 'music', mp4: 'video', avi: 'video',\n            doc: 'doc', docx: 'docx', ppt: 'pptx', pptx: 'pptx',\n            xls: 'xlsx', xlsx: 'xlsx', txt: 'txt', js: 'js', css: 'css',\n            html: 'html', exe: 'exe', msi: 'msi', php: 'php', xml: 'xml',\n            zip: 'zip', rar: 'rar', pdf: 'pdf'\n        };\n        const ext = (item.name.split('.').pop() || '').toLowerCase();\n        const iconType = extensionMap[ext] || 'unknown';\n        return `e-list-icon e-fe-${iconType}`;\n    }\n}\n"
    }
  ]
}