UNPKG

zent

Version:

一套前端设计语言和基于React的实现

24 lines (23 loc) 1.43 kB
import { __assign, __extends, __rest } from "tslib"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; import cx from 'classnames'; export var TimelineDot = function (_a) { var _b = _a.color, color = _b === void 0 ? '' : _b, props = __rest(_a, ["color"]); return (_jsx("div", __assign({}, props, { className: "zent-timeline-dot", style: { borderColor: color }, "data-zv": '10.0.18' }), void 0)); }; var TimelineLegend = (function (_super) { __extends(TimelineLegend, _super); function TimelineLegend() { return _super !== null && _super.apply(this, arguments) || this; } TimelineLegend.prototype.render = function () { var _a = this.props, color = _a.color, children = _a.children, style = _a.style, className = _a.className; return (_jsxs("div", __assign({ className: cx('zent-timeline-legend', className), style: style, "data-zv": '10.0.18' }, { children: [_jsx("div", __assign({ className: "zent-timeline-legend-line", style: { backgroundColor: color }, "data-zv": '10.0.18' }, { children: _jsx(TimelineDot, { color: color }, void 0) }), void 0), _jsx("label", __assign({ className: "zent-timeline-legend-label", "data-zv": '10.0.18' }, { children: children }), void 0)] }), void 0)); }; TimelineLegend.defaultProps = { className: '', }; return TimelineLegend; }(Component)); export { TimelineLegend };