-
-
-
- }
- value={this.state.value}
- error={!!(touched && error)}
- renderValue={selected => (
-
- {selected
- .map(item =>
- choices.find(
- choice =>
- get(choice, optionValue) === item
- )
- )
- .map(item => (
-
- ))}
-
- )}
- data-testid="selectArray"
- {...options}
- onChange={this.handleChange}
- >
- {choices.map(this.renderMenuItem)}
-
- {helperText || (touched && error) ? (
-
-
-
- ) : null}
-
- );
- }
-}
-
-SelectArrayInput.propTypes = {
- choices: PropTypes.arrayOf(PropTypes.object),
- classes: PropTypes.object,
- className: PropTypes.string,
- children: PropTypes.node,
- input: PropTypes.object,
- isRequired: PropTypes.bool,
- label: PropTypes.string,
- meta: PropTypes.object,
- options: PropTypes.object,
- optionText: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.func,
- PropTypes.element,
- ]).isRequired,
- optionValue: PropTypes.string.isRequired,
- resource: PropTypes.string,
- source: PropTypes.string,
- translate: PropTypes.func.isRequired,
- translateChoice: PropTypes.bool,
-};
-
-SelectArrayInput.defaultProps = {
- classes: {},
- choices: [],
- options: {},
- optionText: 'name',
- optionValue: 'id',
- translateChoice: true,
-};
-
-const EnhancedSelectArrayInput = compose(
- addField,
- translate,
- withStyles(styles)
-)(SelectArrayInput);
-
-export default EnhancedSelectArrayInput;
diff --git a/packages/ra-ui-materialui/src/input/SelectArrayInput.spec.js b/packages/ra-ui-materialui/src/input/SelectArrayInput.spec.js
deleted file mode 100644
index 4d20fa1b0bc..00000000000
--- a/packages/ra-ui-materialui/src/input/SelectArrayInput.spec.js
+++ /dev/null
@@ -1,197 +0,0 @@
-import React from 'react';
-import expect from 'expect';
-import { render, cleanup } from '@testing-library/react';
-
-import { SelectArrayInput } from './SelectArrayInput';
-
-describe('