UNPKG

armisa-models

Version:
47 lines (46 loc) 1.82 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ElementFactory = void 0; const PopupFactory_1 = require("../../ComponentFactory/PopupFactory"); class ElementFactory { get any() { return this; } get hasChange() { return this._hasChange; } constructor(mainStateFactory, factoryFieldName, dispose, payLoadKey, responseKey, history) { this.mainStateFactory = mainStateFactory; this.factoryFieldName = factoryFieldName; this.dispose = dispose; this.payLoadKey = payLoadKey; this.responseKey = responseKey; this.history = history; this._hasChange = false; this.disabled = false; this.hidden = false; this.validation = true; this.showHistoryOfColumn = (JSX) => { if (!this.history) { return; } let mouseLocationOfPopup; if (this.element) { const rect = this.element.getBoundingClientRect(); mouseLocationOfPopup = new PopupFactory_1.MouseLocationOfPopup(rect.left + window.scrollX, rect.top + window.scrollY); } this.mainStateFactory.elementsOfForm.showPopup(JSX, mouseLocationOfPopup); }; if (this.mainStateFactory.any.cach === undefined) { this.mainStateFactory.any.cach = {}; } this.mainStateManager = this.mainStateFactory.mainStateManager; if (typeof responseKey === 'string') { this.mainStateFactory.elementsOfForm.addResponseElement(this); } if (typeof payLoadKey === 'string') { this.mainStateFactory.elementsOfForm.addPayloadElement(this); } } } exports.ElementFactory = ElementFactory;