@alilc/lowcode-editor-skeleton
Version:
alibaba lowcode editor skeleton
46 lines • 1.75 kB
JavaScript
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
var _class, _class2;
import { Component, Fragment } from 'react';
import classNames from 'classnames';
import { observer } from '@alilc/lowcode-editor-core';
var RightArea = observer(_class2 = /*#__PURE__*/function (_Component2) {
function RightArea() {
return _Component2.apply(this, arguments) || this;
}
_inheritsLoose(RightArea, _Component2);
var _proto2 = RightArea.prototype;
_proto2.render = function render() {
var area = this.props.area;
if (area.isEmpty()) {
return null;
}
return /*#__PURE__*/React.createElement("div", {
className: classNames('lc-right-area engine-tabpane', {
'lc-area-visible': area.visible
})
}, /*#__PURE__*/React.createElement(Contents, {
area: area
}));
};
return RightArea;
}(Component)) || _class2;
export { RightArea as default };
var Contents = observer(_class = /*#__PURE__*/function (_Component) {
function Contents() {
return _Component.apply(this, arguments) || this;
}
_inheritsLoose(Contents, _Component);
var _proto = Contents.prototype;
_proto.render = function render() {
var area = this.props.area;
return /*#__PURE__*/React.createElement(Fragment, null, area.container.items.slice().sort(function (a, b) {
var _a$config, _b$config;
var index1 = ((_a$config = a.config) === null || _a$config === void 0 ? void 0 : _a$config.index) || 0;
var index2 = ((_b$config = b.config) === null || _b$config === void 0 ? void 0 : _b$config.index) || 0;
return index1 === index2 ? 0 : index1 > index2 ? 1 : -1;
}).map(function (item) {
return item.content;
}));
};
return Contents;
}(Component)) || _class;