asb_cloud_front/src/pages/Measure/columnsCommon.js

52 lines
1.0 KiB
JavaScript
Raw Normal View History

import React from 'react'
import { Input } from 'antd'
import { RegExpIsFloat } from '../../components/Table'
2021-08-30 16:40:56 +05:00
const { TextArea } = Input
2021-08-30 16:40:56 +05:00
export const v = (text) => (
<div style={{
display: 'flex',
height: '180px',
justifyContent: 'center'
}}>
<span
style={{
whiteSpace: 'pre',
verticalAlign: 'center',
textAlign: 'center',
2021-09-03 09:26:43 +05:00
WebkitTransform: 'rotate(-90deg)',
MozTransform: 'rotate(-90deg)',
MsTransform: 'rotate(-90deg)',
OTransform: 'rotate(-90deg)',
transform: 'rotate(-90deg)',
}}>
{text}
</span>
</div>
)
2021-08-30 16:40:56 +05:00
export const numericColumnOptions = {
editable: true,
initialValue: 0,
width: '3rem',
2021-08-30 16:40:56 +05:00
formItemRules: [
{
required: true,
message: `Введите число`,
pattern: RegExpIsFloat,
},
],
};
export const textColumnOptions = {
editable: true,
input: <TextArea/>,
width: '3rem',
formItemRules: [{
required: true,
message: `Введите текст`
}],
}