"use strict";
/**
 * TableCellField Context
 *
 *  Copyright (C) 2010-2019 R-T Specialty, LLC.
 *
 *  This file is part of the Liza Data Collection Framework
 *
 *  Liza is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableCellFieldContext = void 0;
var FieldContext_1 = require("./FieldContext");
/**
 * Context responsible for a specific table cell (TD) field
 */
var TableCellFieldContext = /** @class */ (function (_super) {
    __extends(TableCellFieldContext, _super);
    function TableCellFieldContext() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Attach the field to the DOM or make it visible if already attached
     *
     * @param to - Parent to attach to
     * @param next_element - Next element to attach before
     */
    TableCellFieldContext.prototype.show = function (to, next_element) {
        this.is_visible = true;
        if (this.isAttached() === false) {
            this.attach(to, next_element);
        }
    };
    /**
     * Table cell fields must not be detached
     *
     * Only set the visibility flag
     * and let the TableGroup do its thing
     */
    TableCellFieldContext.prototype.hide = function () {
        this.is_visible = false;
    };
    return TableCellFieldContext;
}(FieldContext_1.FieldContext));
exports.TableCellFieldContext = TableCellFieldContext;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGFibGVDZWxsRmllbGRDb250ZXh0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiVGFibGVDZWxsRmllbGRDb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW1CRzs7Ozs7Ozs7Ozs7Ozs7OztBQUVILCtDQUl3QjtBQUV4Qjs7R0FFRztBQUNIO0lBQTJDLHlDQUFZO0lBQXZEOztJQXdCQSxDQUFDO0lBdkJDOzs7OztPQUtHO0lBQ0gsb0NBQUksR0FBSixVQUFLLEVBQWtCLEVBQUUsWUFBb0M7UUFDM0QsSUFBSSxDQUFDLFVBQVUsR0FBRyxJQUFJLENBQUM7UUFFdkIsSUFBSSxJQUFJLENBQUMsVUFBVSxFQUFFLEtBQUssS0FBSyxFQUFFO1lBQy9CLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO1NBQy9CO0lBQ0gsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsb0NBQUksR0FBSjtRQUNFLElBQUksQ0FBQyxVQUFVLEdBQUcsS0FBSyxDQUFDO0lBQzFCLENBQUM7SUFDSCw0QkFBQztBQUFELENBQUMsQUF4QkQsQ0FBMkMsMkJBQVksR0F3QnREO0FBeEJZLHNEQUFxQiJ9