import type { ExtractPropTypes, FunctionalComponent, PropType } from 'vue'; import omit from '../_util/omit'; import warning from '../_util/warning'; import type { EllipsisConfig } from './Base'; import Base, { baseProps } from './Base'; export const textProps = () => ({ ...omit(baseProps(), ['component']), ellipsis: { type: [Boolean, Object] as PropType< boolean | Omit >, default: undefined as boolean | Omit, }, }); export type TextProps = Partial>>; const Text: FunctionalComponent = (props, { slots, attrs }) => { const { ellipsis } = props; warning( typeof ellipsis !== 'object' || !ellipsis || (!('expandable' in ellipsis) && !('rows' in ellipsis)), 'Typography.Text', '`ellipsis` do not support `expandable` or `rows` props.', ); const textProps = { ...props, ellipsis: ellipsis && typeof ellipsis === 'object' ? omit(ellipsis as any, ['expandable', 'rows']) : ellipsis, component: 'span', ...attrs, }; return ; }; Text.displayName = 'ATypographyText'; Text.inheritAttrs = false; Text.props = textProps(); export default Text;