import { BaseView } from "../../BaseView.js";
import FooterResizer from "./FooterResizer.js";
export default class FooterView extends BaseView {
    constructor(options) {
        super(options);
        this.m_parent = options.parent;
        this.state.unset("parent");
    }
    get parent() {
        return this.m_parent;
    }
    get source() {
        return super.source;
    }
    get descriptionNode() {
        return this.node.children("div[role=description]");
    }
    template() {
        return `<div class="-fb-grid-footer">
                    <div role="description"></div>
                </div>`;
    }
    onActivate(e) {
        super.onActivate(e);
        this.source.locals.events.inputSelectedSubscribe((e) => {
            this.descriptionNode.empty();
            this.descriptionNode.append(`<div><b>${e.model.label}</b><br/>${e.model.description}</div>`);
        });
        this.resizer_init();
        let footerHeight = this.source.locals.storage.footerHeight;
        if (footerHeight != null) {
            this.node.css({
                height: `${footerHeight}px`
            });
        }
    }
    resizer_init() {
        this.m_resizer = new FooterResizer({
            grid: this.parent,
            footer: this,
            source: this.source
        });
        this.controls.add(this.m_resizer);
    }
}
