1 | const _excluded = ["children"];
|
2 |
|
3 | function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4 |
|
5 | function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
6 |
|
7 | import * as PropTypes from 'prop-types';
|
8 | import React from 'react';
|
9 | import ListOption from './ListOption';
|
10 | export const CREATE_OPTION = {};
|
11 | const propTypes = {
|
12 | searchTerm: PropTypes.string,
|
13 | focused: PropTypes.bool,
|
14 | onSelect: PropTypes.func.isRequired,
|
15 | activeId: PropTypes.string
|
16 | };
|
17 |
|
18 | function AddToListOption(_ref) {
|
19 | let {
|
20 | children
|
21 | } = _ref,
|
22 | props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
23 |
|
24 | return React.createElement(ListOption, _extends({}, props, {
|
25 | dataItem: CREATE_OPTION,
|
26 | className: 'rw-list-option-create',
|
27 | selected: false
|
28 | }), children);
|
29 | }
|
30 |
|
31 | AddToListOption.propTypes = propTypes;
|
32 | export default AddToListOption; |
\ | No newline at end of file |