UNPKG

tfp

Version:

A Web UI framework for TaskBuilder

125 lines (104 loc) 4.12 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); var _controller = require("../controller.js"); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** * 嵌入框架组件 * @param {[type]} dataModel [description] */ var Iframe = /*#__PURE__*/function (_VisibleComponent) { (0, _inherits2["default"])(Iframe, _VisibleComponent); var _super = _createSuper(Iframe); function Iframe(__tfp, dataModel, parent) { (0, _classCallCheck2["default"])(this, Iframe); return _super.call(this, __tfp, "Iframe", dataModel, parent); } //属性 (0, _createClass2["default"])(Iframe, [{ key: "src", get: function get() { return this.dataModel.src; }, set: function set(value) { this.dataModel.src = value; if (this._jqObj) { if (this._tfp.isDesigning) { this._jqObj.find("iframe").attr("src", value); } else { this._jqObj.attr("src", value); } } } }, { key: "scrolling", get: function get() { return this.dataModel.scrolling; }, set: function set(value) { this.dataModel.scrolling = value; if (this._jqObj) { if (this._tfp.isDesigning) { this._jqObj.find("iframe").attr("scrolling", value); } else { this._jqObj.attr("scrolling", value); } } } }, { key: "frameBorder", get: function get() { return this.dataModel.frameBorder ? this.dataModel.frameBorder : 0; }, set: function set(value) { this.dataModel.frameBorder = value; if (this._jqObj) { if (this._tfp.isDesigning) { this._jqObj.find("iframe").attr("frameBorder", value); } else { this._jqObj.attr("frameBorder", value); } } } }, { key: "marginWidth", get: function get() { return this.dataModel.marginWidth ? this.dataModel.marginWidth : 0; }, set: function set(value) { this.dataModel.marginWidth = value; if (this._jqObj) { if (this._tfp.isDesigning) { this._jqObj.find("iframe").attr("marginWidth", value); } else { this._jqObj.attr("marginWidth", value); } } } }, { key: "marginHeight", get: function get() { return this.dataModel.marginHeight ? this.dataModel.marginHeight : 0; }, set: function set(value) { this.dataModel.marginHeight = value; if (this._jqObj) { if (this._tfp.isDesigning) { this._jqObj.find("iframe").attr("marginHeight", value); } else { this._jqObj.attr("marginHeight", value); } } } }]); return Iframe; }(_controller.VisibleComponent); exports["default"] = Iframe;