UNPKG

@alilc/lowcode-shell

Version:

Shell Layer for AliLowCodeEngine

107 lines (98 loc) 2.04 kB
import _createClass from "@babel/runtime/helpers/createClass"; import { IPublicEnumTransformStage } from '@alilc/lowcode-types'; import { propSymbol } from '../symbols'; import { Node as ShellNode } from './node'; export var Prop = /*#__PURE__*/function () { function Prop(prop) { this[propSymbol] = void 0; this[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[propSymbol].setValue(val); } /** * 获取值 * @returns */; _proto.getValue = function getValue() { return this[propSymbol].getValue(); } /** * 移除值 */; _proto.remove = function remove() { this[propSymbol].remove(); } /** * 导出值 * @param stage * @returns */; _proto.exportSchema = function exportSchema(stage) { if (stage === void 0) { stage = IPublicEnumTransformStage.Render; } return this[propSymbol]["export"](stage); }; return _createClass(Prop, [{ key: "id", get: function get() { return this[propSymbol].id; } /** * key 值 * get key of prop */ }, { key: "key", get: function get() { return this[propSymbol].key; } /** * 返回当前 prop 的路径 */ }, { key: "path", get: function get() { return this[propSymbol].path; } /** * 返回所属的节点实例 */ }, { key: "node", get: function get() { return ShellNode.create(this[propSymbol].getNode()); } /** * return the slot node (only if the current prop represents a slot) */ }, { key: "slotNode", get: function get() { return ShellNode.create(this[propSymbol].slotNode); } /** * judge if it is a prop or not */ }, { key: "isProp", get: function get() { return true; } }]); }();