UNPKG

armisa-models

Version:
77 lines (76 loc) 4.06 kB
"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; }; var _PayLoadBoxFactory_value, _PayLoadBoxFactory_defaultValue; Object.defineProperty(exports, "__esModule", { value: true }); exports.PayLoadBoxFactory = void 0; const ElementFactory_1 = require("../Page/ElementsOfFormFactory/ElementFactory"); const Cach_1 = require("./Cach"); class PayLoadBoxFactory extends ElementFactory_1.ElementFactory { get value() { return __classPrivateFieldGet(this, _PayLoadBoxFactory_value, "f"); } get defaultValue() { return __classPrivateFieldGet(this, _PayLoadBoxFactory_defaultValue, "f"); } constructor(_mainStateFactory, _fieldName, _dispose, initialValue, payLoadKey, responseKey) { super(_mainStateFactory, _fieldName, _dispose, payLoadKey, responseKey); this.forceUpdate = () => { }; _PayLoadBoxFactory_value.set(this, void 0); this.setValue = (value) => { __classPrivateFieldSet(this, _PayLoadBoxFactory_value, value, "f"); Cach_1.Cach.setValue(this, value); }; this.deseriallize = (e) => { this.clearData(); if (e === null) { //do nothing } else if (e === undefined) { //do nothing } else { __classPrivateFieldSet(this, _PayLoadBoxFactory_value, e, "f"); __classPrivateFieldSet(this, _PayLoadBoxFactory_defaultValue, __classPrivateFieldGet(this, _PayLoadBoxFactory_value, "f"), "f"); } Cach_1.Cach.setValue(this, __classPrivateFieldGet(this, _PayLoadBoxFactory_value, "f")); }; this.clearData = () => { Cach_1.Cach.clear(this); __classPrivateFieldSet(this, _PayLoadBoxFactory_value, undefined, "f"); __classPrivateFieldSet(this, _PayLoadBoxFactory_defaultValue, undefined, "f"); this.validation = true; this._hasChange = false; }; _PayLoadBoxFactory_defaultValue.set(this, void 0); this.focusToElement = () => { }; this.tabIndex = undefined; this.restartDefaultValue = () => { __classPrivateFieldSet(this, _PayLoadBoxFactory_defaultValue, this.value, "f"); this.refreshHasChange(); }; this.refreshHasChange = () => { }; this.validate = () => { this.validation = true; }; __classPrivateFieldSet(this, _PayLoadBoxFactory_defaultValue, initialValue, "f"); __classPrivateFieldSet(this, _PayLoadBoxFactory_value, initialValue, "f"); if (Cach_1.Cach.isCached(this)) { const cach = Cach_1.Cach.getCached(this); __classPrivateFieldSet(this, _PayLoadBoxFactory_value, cach.value, "f"); } } } exports.PayLoadBoxFactory = PayLoadBoxFactory; _PayLoadBoxFactory_value = new WeakMap(), _PayLoadBoxFactory_defaultValue = new WeakMap();