UNPKG

@alilc/lowcode-shell

Version:

Shell Layer for AliLowCodeEngine

112 lines (102 loc) 2.33 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); exports.__esModule = true; exports.Prop = void 0; var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _lowcodeTypes = require("@alilc/lowcode-types"); var _symbols = require("../symbols"); var _node = require("./node"); var Prop = exports.Prop = /*#__PURE__*/function () { function Prop(prop) { this[_symbols.propSymbol] = void 0; this[_symbols.propSymbol] = prop; } Prop.create = function create(prop) { if (!prop) { return null; } return new Prop(prop); } /** * id */; var _proto = Prop.prototype; /** * 设置值 * @param val */ _proto.setValue = function setValue(val) { this[_symbols.propSymbol].setValue(val); } /** * 获取值 * @returns */; _proto.getValue = function getValue() { return this[_symbols.propSymbol].getValue(); } /** * 移除值 */; _proto.remove = function remove() { this[_symbols.propSymbol].remove(); } /** * 导出值 * @param stage * @returns */; _proto.exportSchema = function exportSchema(stage) { if (stage === void 0) { stage = _lowcodeTypes.IPublicEnumTransformStage.Render; } return this[_symbols.propSymbol]["export"](stage); }; return (0, _createClass2["default"])(Prop, [{ key: "id", get: function get() { return this[_symbols.propSymbol].id; } /** * key 值 * get key of prop */ }, { key: "key", get: function get() { return this[_symbols.propSymbol].key; } /** * 返回当前 prop 的路径 */ }, { key: "path", get: function get() { return this[_symbols.propSymbol].path; } /** * 返回所属的节点实例 */ }, { key: "node", get: function get() { return _node.Node.create(this[_symbols.propSymbol].getNode()); } /** * return the slot node (only if the current prop represents a slot) */ }, { key: "slotNode", get: function get() { return _node.Node.create(this[_symbols.propSymbol].slotNode); } /** * judge if it is a prop or not */ }, { key: "isProp", get: function get() { return true; } }]); }();