import { AXButtonModule } from '@acorex/components/button';
import { AXDecoratorModule } from '@acorex/components/decorators';
import { AXFormatModule } from '@acorex/core/format';
import { AXTranslationModule } from '@acorex/core/translation';
import { AXPElementDataDirective } from '@acorex/platform/core';
import * as i0 from '@angular/core';
import { inject, Component } from '@angular/core';
import { A as AXPDocumentExplorerViewModel, a as AXMDocumentManagerService } from './acorex-modules-document-management-acorex-modules-document-management-BsfSETMk.mjs';

class AXMDocumentExplorerAttachmentComponent {
    constructor() {
        this.vm = inject(AXPDocumentExplorerViewModel);
        this.driveService = inject(AXMDocumentManagerService);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMDocumentExplorerAttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXMDocumentExplorerAttachmentComponent, isStandalone: true, selector: "axm-document-explorer-attachment-widget", ngImport: i0, template: "<!-- List View -->\n<div class=\"__content fa-xl\">\n  @for (folder of vm.folders(); track folder.id) {\n  <div\n    class=\"__explorer-item\"\n    [class.--selected]=\"vm.isItemSelected(folder)\"\n    [axp-data]=\"folder\"\n    (click)=\"vm.toggleSelect(folder)\"\n    (onDblClick)=\"vm.navigateToFolder(folder.id)\"\n  >\n    <div class=\"__icon ax-text-yellow-400\">\n      @if (vm.isLoadingFolder(folder.id)) {\n      <i class=\"fa-light fa-spinner fa-spin-pulse\"></i>\n      } @else {\n      <i class=\"fas fa-folder-closed\"></i>\n      }\n    </div>\n    <div class=\"__name\">{{ folder.name }}</div>\n  </div>\n  } @for (file of vm.files(); track file.id) { @let fileInfo = vm.getFileInfo(file.name);\n  <div\n    [class.--selected]=\"vm.isItemSelected(file)\"\n    class=\"__explorer-item ax-group\"\n    [axp-data]=\"file\"\n    (click)=\"vm.toggleSelect(file)\"\n    (onDblClick)=\"vm.openFile(file)\"\n  >\n    <div class=\"name-bar\">\n      <div class=\"__icon\">\n        <i class=\"fa-fw {{ fileInfo.icon }} fa-solid\"></i>\n      </div>\n      <div class=\"__name\">{{ file.name }}</div>\n    </div>\n    <div class=\"action-bar group-hover:ax-visible ax-invisible\">\n      <div>\n        <i class=\"fa-regular fa-trash\" (click)=\"vm.deleteNodes([file])\"></i>\n      </div>\n      <div>\n        <i class=\"fa-regular fa-download\" (click)=\"driveService.downloadFile(file)\"></i>\n      </div>\n      <div>\n        <i class=\"fa-regular fa-info\" (click)=\"vm.openFile(file)\"></i>\n      </div>\n    </div>\n  </div>\n  }\n</div>\n", styles: [":host{width:100%}:host .__content{display:flex;flex-direction:column;gap:.125rem}:host .__content .__explorer-item{display:flex;cursor:pointer;align-items:center;justify-content:space-between;gap:.75rem;border-radius:.375rem;padding:.5rem}:host .__content .__explorer-item:hover{background-color:rgb(var(--ax-sys-color-light-surface));color:rgb(var(--ax-sys-color-on-light-surface));border-color:rgb(var(--ax-sys-color-border-light-surface))}:host .__content .__explorer-item .name-bar{display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem}:host .__content .__explorer-item .action-bar{display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem}:host .__content .__explorer-item .__icon{width:1.5rem;flex-shrink:0}:host .__content .__explorer-item .__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start;font-size:.875rem;line-height:1.25rem;font-weight:500}:host .__content .__explorer-item.--selected{background-color:rgb(var(--ax-sys-color-darker-surface));color:rgb(var(--ax-sys-color-on-darker-surface));border-color:rgb(var(--ax-sys-color-border-darker-surface))}\n"], dependencies: [{ kind: "ngmodule", type: AXDecoratorModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: AXPElementDataDirective, selector: "[axp-data]", inputs: ["axp-data", "axp-data-path"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMDocumentExplorerAttachmentComponent, decorators: [{
            type: Component,
            args: [{ selector: 'axm-document-explorer-attachment-widget', standalone: true, imports: [
                        AXDecoratorModule,
                        AXFormatModule,
                        AXButtonModule,
                        AXTranslationModule,
                        AXPElementDataDirective
                    ], template: "<!-- List View -->\n<div class=\"__content fa-xl\">\n  @for (folder of vm.folders(); track folder.id) {\n  <div\n    class=\"__explorer-item\"\n    [class.--selected]=\"vm.isItemSelected(folder)\"\n    [axp-data]=\"folder\"\n    (click)=\"vm.toggleSelect(folder)\"\n    (onDblClick)=\"vm.navigateToFolder(folder.id)\"\n  >\n    <div class=\"__icon ax-text-yellow-400\">\n      @if (vm.isLoadingFolder(folder.id)) {\n      <i class=\"fa-light fa-spinner fa-spin-pulse\"></i>\n      } @else {\n      <i class=\"fas fa-folder-closed\"></i>\n      }\n    </div>\n    <div class=\"__name\">{{ folder.name }}</div>\n  </div>\n  } @for (file of vm.files(); track file.id) { @let fileInfo = vm.getFileInfo(file.name);\n  <div\n    [class.--selected]=\"vm.isItemSelected(file)\"\n    class=\"__explorer-item ax-group\"\n    [axp-data]=\"file\"\n    (click)=\"vm.toggleSelect(file)\"\n    (onDblClick)=\"vm.openFile(file)\"\n  >\n    <div class=\"name-bar\">\n      <div class=\"__icon\">\n        <i class=\"fa-fw {{ fileInfo.icon }} fa-solid\"></i>\n      </div>\n      <div class=\"__name\">{{ file.name }}</div>\n    </div>\n    <div class=\"action-bar group-hover:ax-visible ax-invisible\">\n      <div>\n        <i class=\"fa-regular fa-trash\" (click)=\"vm.deleteNodes([file])\"></i>\n      </div>\n      <div>\n        <i class=\"fa-regular fa-download\" (click)=\"driveService.downloadFile(file)\"></i>\n      </div>\n      <div>\n        <i class=\"fa-regular fa-info\" (click)=\"vm.openFile(file)\"></i>\n      </div>\n    </div>\n  </div>\n  }\n</div>\n", styles: [":host{width:100%}:host .__content{display:flex;flex-direction:column;gap:.125rem}:host .__content .__explorer-item{display:flex;cursor:pointer;align-items:center;justify-content:space-between;gap:.75rem;border-radius:.375rem;padding:.5rem}:host .__content .__explorer-item:hover{background-color:rgb(var(--ax-sys-color-light-surface));color:rgb(var(--ax-sys-color-on-light-surface));border-color:rgb(var(--ax-sys-color-border-light-surface))}:host .__content .__explorer-item .name-bar{display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem}:host .__content .__explorer-item .action-bar{display:flex;align-items:center;gap:.5rem;font-size:.875rem;line-height:1.25rem}:host .__content .__explorer-item .__icon{width:1.5rem;flex-shrink:0}:host .__content .__explorer-item .__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start;font-size:.875rem;line-height:1.25rem;font-weight:500}:host .__content .__explorer-item.--selected{background-color:rgb(var(--ax-sys-color-darker-surface));color:rgb(var(--ax-sys-color-on-darker-surface));border-color:rgb(var(--ax-sys-color-border-darker-surface))}\n"] }]
        }] });

export { AXMDocumentExplorerAttachmentComponent };
//# sourceMappingURL=acorex-modules-document-management-attachment-widget.component-C4KhZ0gC.mjs.map
