UNPKG

534 BJavaScriptView Raw
1import getOptionLabel from './getOptionLabel';
2
3function getInputText(props) {
4 var activeItem = props.activeItem,
5 labelKey = props.labelKey,
6 multiple = props.multiple,
7 selected = props.selected,
8 text = props.text;
9
10 if (activeItem) {
11 // Display the input value if the pagination item is active.
12 return getOptionLabel(activeItem, labelKey);
13 }
14
15 if (!multiple && selected.length && selected[0]) {
16 return getOptionLabel(selected[0], labelKey);
17 }
18
19 return text;
20}
21
22export default getInputText;
\No newline at end of file