UNPKG

@hbsis.uikit/react

Version:
65 lines (62 loc) 1.83 kB
```js InputGroup.propTypes = { position: PropTypes.oneOf(['prefix', 'suffix']).isRequired, selectWidthInPx: PropTypes.number.isRequired, options: PropTypes.arrayOf(PropTypes.shape({ value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), label: PropTypes.string.isRequired, shortLabel: PropTypes.string.isRequired })), onChange: PropTypes.func.isRequired, onInputChange: PropTypes.func, onSelectChange: PropTypes.func, title: PropTypes.string, nameSelect: PropTypes.string, nameInput: PropTypes.string, type: PropTypes.oneOf(['primary', 'alert', 'error', 'success']), selectDefaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), inputDefaultValue: PropTypes.string, placeholder: PropTypes.string, }; ``` ```js <InputGroup title='Input suffix com label' position={'suffix'} selectWidthInPx={75} onChange={function (selectValue, inputValue) { console.log(selectValue, inputValue) }} onInputChange={function (inputValue) { console.log(inputValue) }} onSelectChange={function (selectValue) { console.log(selectValue) }} options={[ {value: 1, label: 'Quilograma', shortLabel: 'kg'}, {value: 2, label: 'Tonelada', shortLabel: 'ton'} ]} /> ``` ```js <InputGroup title='Input prefix com label' position={'prefix'} selectWidthInPx={75} onChange={function (selectValue, inputValue) { console.log(selectValue, inputValue) }} onInputChange={function (inputValue) { console.log(inputValue) }} onSelectChange={function (selectValue) { console.log(selectValue) }} options={[ {value: 1, label: 'Reais', shortLabel: 'BRL'}, {value: 2, label: 'Dolar', shortLabel: 'USD'}, {value: 3, label: 'Euro', shortLabel: 'EUR'} ]} /> ```