1 | import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2 | import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3 | import _inherits from "@babel/runtime/helpers/esm/inherits";
|
4 | import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | import * as React from 'react';
|
37 | import SelectOptionList from './OptionList';
|
38 | import Option from './Option';
|
39 | import OptGroup from './OptGroup';
|
40 | import { convertChildrenToData as convertSelectChildrenToData } from './utils/legacyUtil';
|
41 | import { getLabeledValue as getSelectLabeledValue, filterOptions as selectDefaultFilterOptions, isValueDisabled as isSelectValueDisabled, findValueOption as findSelectValueOption, flattenOptions, fillOptionsWithMissingValue } from './utils/valueUtil';
|
42 | import generateSelector from './generate';
|
43 | import warningProps from './utils/warningPropsUtil';
|
44 | var RefSelect = generateSelector({
|
45 | prefixCls: 'rc-select',
|
46 | components: {
|
47 | optionList: SelectOptionList
|
48 | },
|
49 | convertChildrenToData: convertSelectChildrenToData,
|
50 | flattenOptions: flattenOptions,
|
51 | getLabeledValue: getSelectLabeledValue,
|
52 | filterOptions: selectDefaultFilterOptions,
|
53 | isValueDisabled: isSelectValueDisabled,
|
54 | findValueOption: findSelectValueOption,
|
55 | warningProps: warningProps,
|
56 | fillOptionsWithMissingValue: fillOptionsWithMissingValue
|
57 | });
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | var Select = function (_React$Component) {
|
64 | _inherits(Select, _React$Component);
|
65 |
|
66 | var _super = _createSuper(Select);
|
67 |
|
68 | function Select() {
|
69 | var _this;
|
70 |
|
71 | _classCallCheck(this, Select);
|
72 |
|
73 | _this = _super.apply(this, arguments);
|
74 | _this.selectRef = React.createRef();
|
75 |
|
76 | _this.focus = function () {
|
77 | _this.selectRef.current.focus();
|
78 | };
|
79 |
|
80 | _this.blur = function () {
|
81 | _this.selectRef.current.blur();
|
82 | };
|
83 |
|
84 | return _this;
|
85 | }
|
86 |
|
87 | _createClass(Select, [{
|
88 | key: "render",
|
89 | value: function render() {
|
90 | return React.createElement(RefSelect, Object.assign({
|
91 | ref: this.selectRef
|
92 | }, this.props));
|
93 | }
|
94 | }]);
|
95 |
|
96 | return Select;
|
97 | }(React.Component);
|
98 |
|
99 | Select.Option = Option;
|
100 | Select.OptGroup = OptGroup;
|
101 | export default Select; |
\ | No newline at end of file |