UNPKG

1.4 kBTypeScriptView Raw
1import React from 'react'
2import { InputPropsType, SsDropDownPropsType } from '../utils/PropTypes'
3import Input from './Input'
4import Switch from './Switch'
5import Textarea from './Textarea'
6import SsSelect from './SsSelect'
7import SsDate from './SsDate'
8import SsDateRange from './SsDateRange'
9import SsAmount from './SsAmount'
10import SsDescription from './SsDescription'
11import SsRating from './SsRating'
12import SsMultiSelect from './SsMultiSelect'
13import SSMultiSelectView from './SSMultiSelectView'
14import SsCalculate from './SsCalculate'
15import SsImagePicker from './SsImagePicker'
16
17const NumberInput = (props: InputPropsType) => {
18 return (
19 <Input {...props} type="number" rules={props.rules ? [...props.rules, 'number'] : ['number']} last={props.last} />
20 )
21}
22
23const SsDropDown = (props: SsDropDownPropsType) => {
24 const { multiple } = props
25 if (multiple) {
26 return <SsMultiSelect {...props} />
27 }
28 return <SsSelect {...props} />
29}
30
31export {
32 Input,
33 NumberInput,
34 Textarea,
35 SsSelect,
36 SsDate,
37 SsDateRange,
38 SsAmount,
39 SsDescription,
40 SsRating,
41 SsMultiSelect,
42 SSMultiSelectView,
43 SsCalculate,
44 SsDropDown,
45 SsImagePicker,
46 Switch,
47}
48export default {
49 Input,
50 NumberInput,
51 Textarea,
52 SsSelect,
53 SsDate,
54 SsDateRange,
55 SsAmount,
56 SsDescription,
57 SsRating,
58 SsMultiSelect,
59 SSMultiSelectView,
60 SsCalculate,
61 SsDropDown,
62 SsImagePicker,
63 Switch,
64}