function filterOptions(searchValue, options, _ref3) {
  var optionFilterProp = _ref3.optionFilterProp,
      filterOption = _ref3.filterOption;

  if (filterOption === false) {
    return options;
  }

  var filterOptionFunc;

  if (typeof filterOption === 'function') {
    filterOptionFunc = filterOption;
  } else {
    filterOptionFunc = getDefaultFilterOption(optionFilterProp);
  }

  function dig(list) {
    var keepAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
    return list.map(function (dataNode) {
      var children = dataNode.children;
      var match = keepAll || filterOptionFunc(searchValue, fillLegacyProps(dataNode));
      var childList = dig(children || [], match);

      if (match || childList.length) {
        return _objectSpread(_objectSpread({}, dataNode), {}, {
          children: childList
        });
      }

      return null;
    }).filter(function (node) {
      return node;
    });
  }

  return dig(options);
}
/** Filter options and return a new options by the search text */
Filter options and return a new options by the search text
Filter options and return a new options by the search text
function filterOptions(searchValue, options, _ref3) {
  var optionFilterProp = _ref3.optionFilterProp,
      filterOption = _ref3.filterOption;
  if (filterOption === false) {
    return options;
  }
  var filterOptionFunc;
  if (typeof filterOption === 'function') {
    filterOptionFunc = filterOption;
  } else {
    filterOptionFunc = getDefaultFilterOption(optionFilterProp);
  }
  function dig(list) {
    var keepAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
    return list.map(function (dataNode) {
      var children = dataNode.children;
      var match = keepAll || filterOptionFunc(searchValue, fillLegacyProps(dataNode));
      var childList = dig(children || [], match);
      if (match || childList.length) {
        return _objectSpread(_objectSpread({}, dataNode), {}, {
          children: childList
        });
      }
      return null;
    }).filter(function (node) {
      return node;
    });
  }
  return dig(options);
}
function filterOptions ( searchValue , options , _ref3 ) { var optionFilterProp = _ref3 . optionFilterProp , filterOption = _ref3 . filterOption ; if ( filterOption === false ) { return options ; } var filterOptionFunc ; if ( typeof filterOption === 'function' ) { filterOptionFunc = filterOption ; } else { filterOptionFunc = getDefaultFilterOption ( optionFilterProp ) ; } function dig ( list ) { var keepAll = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ; return list . map ( function ( dataNode ) { var children = dataNode . children ; var match = keepAll || filterOptionFunc ( searchValue , fillLegacyProps ( dataNode ) ) ; var childList = dig ( children || [ ] , match ) ; if ( match || childList . length ) { return _objectSpread ( _objectSpread ( { } , dataNode ) , { } , { children : childList } ) ; } return null ; } ) . filter ( function ( node ) { return node ; } ) ; } return dig ( options ) ; }
Filter options and return a new options by the search text
Filter options and return a new options by the search text