UNPKG

dareway-rui

Version:

93 lines (80 loc) 3.62 kB
'use strict'; var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault'); Object.defineProperty(exports, '__esModule', { value: true }); exports.default = tagDefineGenerator; var _objectSpread2 = _interopRequireDefault(require('@babel/runtime/helpers/objectSpread')); var _react = _interopRequireDefault(require('react')); var _GridConstants = require('../GridConstants'); function tagDefineGenerator(props) { var _props$name = props.name, name = _props$name === void 0 ? null : _props$name, _props$head = props.head, head = _props$head === void 0 ? null : _props$head, _props$headBold = props.headBold, headBold = _props$headBold === void 0 ? false : _props$headBold, _props$headFontColor = props.headFontColor, headFontColor = _props$headFontColor === void 0 ? null : _props$headFontColor, _props$headOblique = props.headOblique, headOblique = _props$headOblique === void 0 ? false : _props$headOblique, _props$bodyAlign = props.bodyAlign, bodyAlign = _props$bodyAlign === void 0 ? 'center' : _props$bodyAlign, _props$bodyBold = props.bodyBold, bodyBold = _props$bodyBold === void 0 ? false : _props$bodyBold, _props$bodyFontColor = props.bodyFontColor, bodyFontColor = _props$bodyFontColor === void 0 ? null : _props$bodyFontColor, _props$bodyOblique = props.bodyOblique, bodyOblique = _props$bodyOblique === void 0 ? false : _props$bodyOblique, _props$tail = props.tail, tail = _props$tail === void 0 ? null : _props$tail, _props$tailAlign = props.tailAlign, tailAlign = _props$tailAlign === void 0 ? 'center' : _props$tailAlign, _props$tailBold = props.tailBold, tailBold = _props$tailBold === void 0 ? false : _props$tailBold, _props$tailFontColor = props.tailFontColor, tailFontColor = _props$tailFontColor === void 0 ? null : _props$tailFontColor, _props$tailOblique = props.tailOblique, tailOblique = _props$tailOblique === void 0 ? false : _props$tailOblique, _props$width = props.width, width = _props$width === void 0 ? 150 : _props$width, _props$widthFixed = props.widthFixed, widthFixed = _props$widthFixed === void 0 ? false : _props$widthFixed, _props$hidden = props.hidden, hidden = _props$hidden === void 0 ? false : _props$hidden; // 标签自身属性 var tagAttrs = { name: name.toLowerCase(), head: head, headBold: headBold, headFontColor: headFontColor, headOblique: headOblique, bodyAlign: bodyAlign, bodyBold: bodyBold, bodyFontColor: bodyFontColor, bodyOblique: bodyOblique, tail: tail, tailAlign: tailAlign, tailBold: tailBold, tailFontColor: tailFontColor, tailOblique: tailOblique, width: width, widthFixed: widthFixed, hidden: hidden }; // 子标签属性 var children = []; _react.default.Children.forEach(props.children, function(element) { if (!_react.default.isValidElement(element)) { return; } var child = (0, _objectSpread2.default)({}, element.props); children.push(child); }); var childTagAttrs = { children: children }; // 标志属性 var specAttrs = { TAG_TYPE: _GridConstants.TAG_TYPE_BUTTONS_COLUMN }; return (0, _objectSpread2.default)({}, tagAttrs, childTagAttrs, specAttrs); } //@ sourceMappingURL=TagDefineGenerator.js.map