|
@@ -1,7 +1,5 @@
|
|
|
import React from 'react';
|
|
import React from 'react';
|
|
|
-import Select, { Option } from '@material/react-select';
|
|
|
|
|
|
|
|
|
|
-import '@material/react-select/dist/select.min.css';
|
|
|
|
|
import './styles.scss';
|
|
import './styles.scss';
|
|
|
|
|
|
|
|
type CBKSelectProps = {
|
|
type CBKSelectProps = {
|
|
@@ -15,31 +13,8 @@ type CBKSelectProps = {
|
|
|
disabled?: boolean,
|
|
disabled?: boolean,
|
|
|
onChange: (x: any) => void
|
|
onChange: (x: any) => void
|
|
|
}
|
|
}
|
|
|
-class CBKSelect extends React.Component<CBKSelectProps> {
|
|
|
|
|
- state = {
|
|
|
|
|
- value: this.props.value || ''
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- onChange = (index:number) => this.props.onChange(this.props.options[index])
|
|
|
|
|
-
|
|
|
|
|
- render() {
|
|
|
|
|
- return (
|
|
|
|
|
- <Select
|
|
|
|
|
- className='cbk-select'
|
|
|
|
|
- enhanced
|
|
|
|
|
- disabled={this.props.disabled}
|
|
|
|
|
- label={this.props.label}
|
|
|
|
|
- value={this.props.value}
|
|
|
|
|
- onEnhancedChange={this.onChange}
|
|
|
|
|
- options={this.props.options}
|
|
|
|
|
- >
|
|
|
|
|
-
|
|
|
|
|
- </Select>
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-export const CBKSelect2: React.FunctionComponent<CBKSelectProps> = (props) => (
|
|
|
|
|
|
|
+export const CBKSelect: React.FunctionComponent<CBKSelectProps> = (props) => (
|
|
|
<select defaultValue={props.value || ''} className='cbk-select-2' onChange={props.onChange} placeholder={props.label}>
|
|
<select defaultValue={props.value || ''} className='cbk-select-2' onChange={props.onChange} placeholder={props.label}>
|
|
|
<option value='' disabled> {props.label} </option>
|
|
<option value='' disabled> {props.label} </option>
|
|
|
{
|
|
{
|