react-crud-mobile 1.0.749 → 1.0.751

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -851,7 +851,28 @@ function UIList(props) {
851
851
  scope.updateIndex = ++index;
852
852
  setIndex(index);
853
853
  };
854
- var items = reactCrudUtils.Utils.nvl(scope.getItems(), []);
854
+ var items = reactCrudUtils.Utils.call(function () {
855
+ var _original$list;
856
+ var list = reactCrudUtils.Utils.nvl(scope.getItems(), []);
857
+ if (original.search && !((_original$list = original.list) != null && _original$list.url)) {
858
+ var query = crud.get('query', '').toLowerCase().trim();
859
+ console.log(query);
860
+ if (query.length > 1) {
861
+ var filters = [];
862
+ var filterBy = reactCrudUtils.Utils.nvl(original.filterBy, 'label');
863
+ reactCrudUtils.Utils.each(list, function (o) {
864
+ var label = o[filterBy];
865
+ if (label) {
866
+ if (label.includes(query)) {
867
+ filters.push(o);
868
+ }
869
+ }
870
+ });
871
+ return filters;
872
+ }
873
+ }
874
+ return list;
875
+ });
855
876
  var isShowAdd = function isShowAdd() {
856
877
  if (!reactCrudUtils.Utils.isEmpty(items)) {
857
878
  return true;