UNPKG

@magicbe/design

Version:

React + Antd Drag Drop Visual design

49 lines (48 loc) 3 kB
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { jsx as _jsx } from "react/jsx-runtime"; import React from "react"; import { Tabs } from "antd"; import createInstance from "@emotion/css/create-instance"; var _a = createInstance({ key: "maps" }), css = _a.css, cx = _a.cx; var cls = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .ant-tabs-tab {\n border-radius: 0 !important;\n\n &:first-child {\n border-left: none;\n }\n }\n \n .ant-tabs-content {\n height: 100%;\n }\n\n .ant-tabs-tabpane {\n height: 100%;\n overflow-y: auto;\n\n scrollbar-width: none;\n -ms-overflow-style: none;\n \n &::-webkit-scrollbar {\n display: none;\n }\n }\n"], ["\n .ant-tabs-tab {\n border-radius: 0 !important;\n\n &:first-child {\n border-left: none;\n }\n }\n \n .ant-tabs-content {\n height: 100%;\n }\n\n .ant-tabs-tabpane {\n height: 100%;\n overflow-y: auto;\n\n scrollbar-width: none;\n -ms-overflow-style: none;\n \n &::-webkit-scrollbar {\n display: none;\n }\n }\n"]))); var DesignMaps = /** @class */ (function (_super) { __extends(DesignMaps, _super); function DesignMaps() { return _super !== null && _super.apply(this, arguments) || this; } DesignMaps.setMap = function (maps) { DesignMaps.items = maps.map(function (_a) { var label = _a.label, key = _a.key, children = _a.component; return ({ label: label, key: key, children: children }); }); }; DesignMaps.prototype.render = function () { return (_jsx(Tabs, { type: "card", items: DesignMaps.items, className: cx(cls, this.props.className), tabBarGutter: -1 })); }; DesignMaps.items = []; return DesignMaps; }(React.Component)); export default DesignMaps; var templateObject_1;