|
@@ -132,11 +132,11 @@ export const StyledText = styled('div', textProps)`
|
|
|
border: ${(props) => {
|
|
|
const {borderWidth, borderType, borderColor} = props
|
|
|
if (borderType === 'none') {
|
|
|
- return borderType
|
|
|
+ return borderType
|
|
|
} else {
|
|
|
- return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
+ return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
}
|
|
|
- }};
|
|
|
+}};
|
|
|
|
|
|
.yvan-text-inner {
|
|
|
height: 100%;
|
|
@@ -195,21 +195,67 @@ export const StyledSimpleText = styled('div', textProps)`
|
|
|
padding: ${(props) => `${props.padding}px`};
|
|
|
line-height: ${(props) => props.lineHeight};
|
|
|
letter-spacing: ${(props) => `${props.letterSpacing}px`};
|
|
|
- font-weight: ${(props) => (props.textStyle?.includes('bold')? 'bold' : 'normal')};
|
|
|
- font-style: ${(props) => (props.textStyle?.includes('italic')? 'oblique' : 'normal')};
|
|
|
+ font-weight: ${(props) => (props.textStyle?.includes('bold') ? 'bold' : 'normal')};
|
|
|
+ font-style: ${(props) => (props.textStyle?.includes('italic') ? 'oblique' : 'normal')};
|
|
|
text-decoration: ${(props) => {
|
|
|
- const {textStyle} = props
|
|
|
- const isUnderLine = textStyle.includes('underline')
|
|
|
- const isStrikethrough = textStyle.includes('strikethrough')
|
|
|
- const propsValue = {
|
|
|
+ const {textStyle} = props
|
|
|
+ const isUnderLine = textStyle.includes('underline')
|
|
|
+ const isStrikethrough = textStyle.includes('strikethrough')
|
|
|
+ const propsValue = {
|
|
|
underline: isUnderLine,
|
|
|
'line-through': isStrikethrough
|
|
|
- }
|
|
|
- if (isUnderLine || isStrikethrough) {
|
|
|
+ }
|
|
|
+ if (isUnderLine || isStrikethrough) {
|
|
|
return Object.keys(propsValue).filter((item) => propsValue[item]).join(' ')
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
return 'none'
|
|
|
- }
|
|
|
+ }
|
|
|
+}};
|
|
|
+ }
|
|
|
+`
|
|
|
+export const StyledTextField = styled('div', textProps)`
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ position: absolute;
|
|
|
+ color: ${(props) => props.color};
|
|
|
+ background: ${(props) => props.background};
|
|
|
+ border: ${(props) => props.border};
|
|
|
+ border-radius: ${(props) => `${props.borderRadius}px`};
|
|
|
+ margin: ${(props) => props.margin};
|
|
|
+ font-size: ${(props) => `${props.fontSize}pt`};
|
|
|
+ font-family: ${(props) => (props.fontFamily === 'default' ? 'inherit' : `${props.fontFamily}`)};
|
|
|
+ border-top: ${(props) => (props.borderPosition?.includes('top') ? `${props.borderWidth}px ${props.borderType} ${props.borderColor}` : 'none')};
|
|
|
+ border-right: ${(props) => (props.borderPosition?.includes('right') ? `${props.borderWidth}px ${props.borderType} ${props.borderColor}` : 'none')};
|
|
|
+ border-bottom: ${(props) => (props.borderPosition?.includes('bottom') ? `${props.borderWidth}px ${props.borderType} ${props.borderColor}` : 'none')};
|
|
|
+ border-left: ${(props) => (props.borderPosition?.includes('left') ? `${props.borderWidth}px ${props.borderType} ${props.borderColor}` : 'none')};
|
|
|
+ z-index: ${(props) => props.zIndex};
|
|
|
+
|
|
|
+ .yvan-text-field-inner {
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ text-align: left;
|
|
|
+ word-break: break-all;
|
|
|
+ justify-content: ${(props) => props.justifyContent};
|
|
|
+ align-items: ${(props) => props.alignItems};
|
|
|
+ padding: ${(props) => `${props.padding}px`};
|
|
|
+ line-height: ${(props) => props.lineHeight};
|
|
|
+ letter-spacing: ${(props) => `${props.letterSpacing}px`};
|
|
|
+ font-weight: ${(props) => (props.textStyle?.includes('bold') ? 'bold' : 'normal')};
|
|
|
+ font-style: ${(props) => (props.textStyle?.includes('italic') ? 'oblique' : 'normal')};
|
|
|
+ text-decoration: ${(props) => {
|
|
|
+ const {textStyle} = props
|
|
|
+ const isUnderLine = textStyle.includes('underline')
|
|
|
+ const isStrikethrough = textStyle.includes('strikethrough')
|
|
|
+ const propsValue = {
|
|
|
+ underline: isUnderLine,
|
|
|
+ 'line-through': isStrikethrough
|
|
|
+ }
|
|
|
+ if (isUnderLine || isStrikethrough) {
|
|
|
+ return Object.keys(propsValue).filter((item) => propsValue[item]).join(' ')
|
|
|
+ } else {
|
|
|
+ return 'none'
|
|
|
+ }
|
|
|
}};
|
|
|
}
|
|
|
`
|
|
@@ -225,11 +271,11 @@ export const StyledRect = styled('div', rectProps)`
|
|
|
border: ${(props) => {
|
|
|
const {borderWidth, borderType, borderColor} = props
|
|
|
if (borderType === 'none') {
|
|
|
- return borderType
|
|
|
+ return borderType
|
|
|
} else {
|
|
|
- return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
+ return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
}
|
|
|
- }};
|
|
|
+}};
|
|
|
`
|
|
|
|
|
|
export const StyledImage = styled('div', imageProps)`
|
|
@@ -246,15 +292,15 @@ export const StyledImage = styled('div', imageProps)`
|
|
|
img {
|
|
|
height: 100%;
|
|
|
border-radius: ${(props) =>
|
|
|
- isNaN(props.borderRadius) ? props.borderRadius : `${props.borderRadius}px`};
|
|
|
+ isNaN(props.borderRadius) ? props.borderRadius : `${props.borderRadius}px`};
|
|
|
z-index: ${(props) => props.zIndex};
|
|
|
border: ${(props) => {
|
|
|
- const {borderWidth, borderType, borderColor} = props
|
|
|
- if (borderType === 'none') {
|
|
|
- return borderType
|
|
|
- } else {
|
|
|
- return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
- }
|
|
|
+ const {borderWidth, borderType, borderColor} = props
|
|
|
+ if (borderType === 'none') {
|
|
|
+ return borderType
|
|
|
+ } else {
|
|
|
+ return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
+ }
|
|
|
}};
|
|
|
}
|
|
|
`
|
|
@@ -267,12 +313,12 @@ export const StyledBarcode = styled('div', barcodeProps)`
|
|
|
z-index: ${(props) => props.zIndex};
|
|
|
border-radius: ${(props) => isNaN(props.borderRadius) ? props.borderRadius : `${props.borderRadius}px`};
|
|
|
border: ${(props) => {
|
|
|
- const {borderWidth, borderType, borderColor} = props
|
|
|
- if (borderType === 'none') {
|
|
|
- return borderType
|
|
|
- } else {
|
|
|
- return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
- }
|
|
|
+ const {borderWidth, borderType, borderColor} = props
|
|
|
+ if (borderType === 'none') {
|
|
|
+ return borderType
|
|
|
+ } else {
|
|
|
+ return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
+ }
|
|
|
}};
|
|
|
}
|
|
|
`
|
|
@@ -285,12 +331,12 @@ export const StyledQrcode = styled('div', qrcodeProps)`
|
|
|
z-index: ${(props) => props.zIndex};
|
|
|
border-radius: ${(props) => isNaN(props.borderRadius) ? props.borderRadius : `${props.borderRadius}px`};
|
|
|
border: ${(props) => {
|
|
|
- const {borderWidth, borderType, borderColor} = props
|
|
|
- if (borderType === 'none') {
|
|
|
- return borderType
|
|
|
- } else {
|
|
|
- return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
- }
|
|
|
+ const {borderWidth, borderType, borderColor} = props
|
|
|
+ if (borderType === 'none') {
|
|
|
+ return borderType
|
|
|
+ } else {
|
|
|
+ return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
+ }
|
|
|
}};
|
|
|
}
|
|
|
`
|
|
@@ -306,11 +352,11 @@ export const StyledCircle = styled('div', circleProps)`
|
|
|
border: ${(props) => {
|
|
|
const {borderWidth, borderType, borderColor} = props
|
|
|
if (borderType === 'none') {
|
|
|
- return borderType
|
|
|
+ return borderType
|
|
|
} else {
|
|
|
- return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
+ return `${borderWidth}px ${borderType} ${borderColor}`
|
|
|
}
|
|
|
- }};
|
|
|
+}};
|
|
|
`
|
|
|
|
|
|
export const StyledLine = styled('div', lineProps)`
|