1 | import React from 'react'
|
2 | import { InputPropsType, SsDropDownPropsType } from '../utils/PropTypes'
|
3 | import Input from './Input'
|
4 | import Switch from './Switch'
|
5 | import Textarea from './Textarea'
|
6 | import SsSelect from './SsSelect'
|
7 | import SsDate from './SsDate'
|
8 | import SsDateRange from './SsDateRange'
|
9 | import SsAmount from './SsAmount'
|
10 | import SsDescription from './SsDescription'
|
11 | import SsRating from './SsRating'
|
12 | import SsMultiSelect from './SsMultiSelect'
|
13 | import SSMultiSelectView from './SSMultiSelectView'
|
14 | import SsCalculate from './SsCalculate'
|
15 | import SsImagePicker from './SsImagePicker'
|
16 |
|
17 | const NumberInput = (props: InputPropsType) => {
|
18 | return (
|
19 | <Input {...props} type="number" rules={props.rules ? [...props.rules, 'number'] : ['number']} last={props.last} />
|
20 | )
|
21 | }
|
22 |
|
23 | const SsDropDown = (props: SsDropDownPropsType) => {
|
24 | const { multiple } = props
|
25 | if (multiple) {
|
26 | return <SsMultiSelect {...props} />
|
27 | }
|
28 | return <SsSelect {...props} />
|
29 | }
|
30 |
|
31 | export {
|
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 | }
|
48 | export 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 | }
|