This commit is contained in:
NikolayRechkin 2019-12-10 09:16:37 +03:00
commit e13b1e461b
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "asc-web-components",
"version": "1.0.219",
"version": "1.0.220",
"description": "Ascensio System SIA component library",
"license": "AGPL-3.0",
"main": "dist/asc-web-components.js",

View File

@ -34,7 +34,7 @@ const StyledText = styled(Text)`
| Props | Type | Required | Values | Default | Description |
| ----------------- | :------: | :------: | :----: | :-------: | -------------------------------------------------- |
| `fontSize` | `number` | - | - | `13` | Sets the font size |
| `fontSize` | `oneOfType(number, string)` | - | - | `13` | Sets the font size |
| `as` | `string` | - | - | `p` | Sets the tag through which to render the component |
| `title` | `bool` | - | - | - | Title |
| `truncate` | `bool` | - | - | `false` | Disables word wrapping |

View File

@ -4,7 +4,8 @@ import styled, { css } from 'styled-components';
import commonTextStyles from './common-text-styles';
const styleCss = css`
font-size: ${props => props.fontSize}px;
${props => (typeof (props.fontSize) === 'string' && css`font-size: ${props.fontSize};`) ||
(typeof (props.fontSize) === 'number' && css`font-size: ${props.fontSize}px;`)};
font-weight: ${props => props.fontWeight
? props.fontWeight
: props.isBold == true ? 700 : 500};
@ -33,7 +34,7 @@ Text.propTypes = {
tag: PropTypes.string,
title: PropTypes.string,
color: PropTypes.string,
fontSize: PropTypes.number,
fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
fontWeight: PropTypes.number,
backgroundColor: PropTypes.string,
truncate: PropTypes.bool,