var _a;
import { __decorate, __extends } from "tslib";
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
import { extractExtension } from '../../../utils/file/file';
import { ModulVue } from '../../../utils/vue/vue';
import { ICON_FILE_NAME, ICON_NAME, PLUS_NAME } from '../../component-names';
import { MIconFile } from '../../icon-file/icon-file';
import { MIcon } from '../../icon/icon';
import { MPlus } from '../../plus/plus';
import WithRender from './tree-icon.html?style=./tree-icon.scss';
var FOLDER_OPEN = 'm-svg__folder-open';
var FOLDER_CLOSED = 'm-svg__folder';
var MTreeIcon = /** @class */ (function (_super) {
    __extends(MTreeIcon, _super);
    function MTreeIcon() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Object.defineProperty(MTreeIcon.prototype, "folderIcon", {
        get: function () {
            return this.isFolderOpen ? FOLDER_OPEN : FOLDER_CLOSED;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTreeIcon.prototype, "extensionFile", {
        get: function () {
            return '.' + extractExtension(this.filename);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTreeIcon.prototype, "showFolderIcon", {
        get: function () {
            return this.isFolder && this.useFilesIcons;
        },
        enumerable: false,
        configurable: true
    });
    __decorate([
        Prop()
    ], MTreeIcon.prototype, "filename", void 0);
    __decorate([
        Prop()
    ], MTreeIcon.prototype, "isFolderOpen", void 0);
    __decorate([
        Prop({ default: false })
    ], MTreeIcon.prototype, "isFolder", void 0);
    __decorate([
        Prop({ default: false })
    ], MTreeIcon.prototype, "useFilesIcons", void 0);
    MTreeIcon = __decorate([
        WithRender,
        Component({
            components: (_a = {},
                _a[PLUS_NAME] = MPlus,
                _a[ICON_FILE_NAME] = MIconFile,
                _a[ICON_NAME] = MIcon,
                _a)
        })
    ], MTreeIcon);
    return MTreeIcon;
}(ModulVue));
export { MTreeIcon };
//# sourceMappingURL=tree-icon.js.map