UNPKG

iep-ui

Version:

An enterprise-class UI design language and Vue-based implementation

35 lines (30 loc) 1.29 kB
import _typeof from 'babel-runtime/helpers/typeof'; import _extends from 'babel-runtime/helpers/extends'; import PropTypes from '../_util/vue-types'; import warning from '../_util/warning'; import Base, { baseProps } from './Base'; import Omit from 'omit.js'; export var TextProps = Omit(_extends({}, baseProps, { ellipsis: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.oneOf(['expandable', 'rows', 'onExpand'])]) }), ['component']); export default { name: 'ATypographyText', functional: true, props: TextProps, render: function render(h, context) { var ellipsis = context.props.ellipsis; warning((typeof ellipsis === 'undefined' ? 'undefined' : _typeof(ellipsis)) !== 'object' || !ellipsis || !('expandable' in ellipsis) && !('rows' in ellipsis), 'Typography.Text', '`ellipsis` do not support `expandable` or `rows` props.'); // console.log(context.data); var textProps = _extends({ props: _extends({}, context.props, { ellipsis: ellipsis && (typeof ellipsis === 'undefined' ? 'undefined' : _typeof(ellipsis)) === 'object' ? Omit(ellipsis, ['expandable', 'rows']) : ellipsis, component: 'span' }) }, context.data); return h( Base, textProps, [context.slots()['default']] ); } };