dist/vue-good-table.cjs.js
function filterRows(columnFilters) {
      var _this4 = this;

      var fromFilter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      // if (!this.rows.length) return;
      // this is invoked either as a result of changing filters
      // or as a result of modifying rows.
      this.columnFilters = columnFilters;
      var computedRows = cloneDeep(this.originalRows); // do we have a filter to care about?
      // if not we don't need to do anything

      if (this.columnFilters && Object.keys(this.columnFilters).length) {
        // every time we filter rows, we need to set current page
        // to 1
        // if the mode is remote, we only need to reset, if this is
        // being called from filter, not when rows are changing
        if (this.mode !== 'remote' || fromFilter) {
          this.changePage(1);
        } // we need to emit an event and that's that.
        // but this only needs to be invoked if filter is changing
        // not when row object is modified.


        if (fromFilter) {
          this.$emit('on-column-filter', {
            columnFilters: this.columnFilters
          });
        } // if mode is remote, we don't do any filtering here.


        if (this.mode === 'remote') {
          if (fromFilter) {
            this.$emit('update:isLoading', true);
          } else {
            // if remote filtering has already been taken care of.
            this.filteredRows = computedRows;
          }

          return;
        }

        var _loop = function _loop(i) {
          var col = _this4.typedColumns[i];

          if (_this4.columnFilters[col.field]) {
            computedRows = each(computedRows, function (headerRow) {
              var newChildren = headerRow.children.filter(function (row) {
                // If column has a custom filter, use that.
                if (col.filterOptions && typeof col.filterOptions.filterFn === 'function') {
                  return col.filterOptions.filterFn(_this4.collect(row, col.field), _this4.columnFilters[col.field]);
                } // Otherwise Use default filters


                var typeDef = col.typeDef;
                return typeDef.filterPredicate(_this4.collect(row, col.field), _this4.columnFilters[col.field]);
              }); // should we remove the header?

              headerRow.children = newChildren;
            });
          }
        };

        for (var i = 0; i < this.typedColumns.length; i++) {
          _loop(i);
        }
      }

      this.filteredRows = computedRows;
    }
function filterRows(columnFilters) {
      var _this4 = this;

      var fromFilter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      // if (!this.rows.length) return;
      // this is invoked either as a result of changing filters
      // or as a result of modifying rows.
      this.columnFilters = columnFilters;
      var computedRows = cloneDeep(this.originalRows); // do we have a filter to care about?
      // if not we don't need to do anything

      if (this.columnFilters && Object.keys(this.columnFilters).length) {
        // every time we filter rows, we need to set current page
        // to 1
        // if the mode is remote, we only need to reset, if this is
        // being called from filter, not when rows are changing
        if (this.mode !== 'remote' || fromFilter) {
          this.changePage(1);
        } // we need to emit an event and that's that.
        // but this only needs to be invoked if filter is changing
        // not when row object is modified.


        if (fromFilter) {
          this.$emit('on-column-filter', {
            columnFilters: this.columnFilters
          });
        } // if mode is remote, we don't do any filtering here.


        if (this.mode === 'remote') {
          if (fromFilter) {
            this.$emit('update:isLoading', true);
          } else {
            // if remote filtering has already been taken care of.
            this.filteredRows = computedRows;
          }

          return;
        }

        var _loop = function _loop(i) {
          var col = _this4.typedColumns[i];

          if (_this4.columnFilters[col.field]) {
            computedRows = each(computedRows, function (headerRow) {
              var newChildren = headerRow.children.filter(function (row) {
                // If column has a custom filter, use that.
                if (col.filterOptions && typeof col.filterOptions.filterFn === 'function') {
                  return col.filterOptions.filterFn(_this4.collect(row, col.field), _this4.columnFilters[col.field]);
                } // Otherwise Use default filters


                var typeDef = col.typeDef;
                return typeDef.filterPredicate(_this4.collect(row, col.field), _this4.columnFilters[col.field]);
              }); // should we remove the header?

              headerRow.children = newChildren;
            });
          }
        };

        for (var i = 0; i < this.typedColumns.length; i++) {
          _loop(i);
        }
      }

      this.filteredRows = computedRows;
    }
function filterRows ( columnFilters ) { var _this4 = this ; var fromFilter = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : true ; // if (!this.rows.length) return; // this is invoked either as a result of changing filters // or as a result of modifying rows. this . columnFilters = columnFilters ; var computedRows = cloneDeep ( this . originalRows ) ; // do we have a filter to care about? // if not we don't need to do anything if ( this . columnFilters && Object . keys ( this . columnFilters ) . length ) { // every time we filter rows, we need to set current page // to 1 // if the mode is remote, we only need to reset, if this is // being called from filter, not when rows are changing if ( this . mode !== 'remote' || fromFilter ) { this . changePage ( 1 ) ; } // we need to emit an event and that's that. // but this only needs to be invoked if filter is changing // not when row object is modified. if ( fromFilter ) { this . $emit ( 'on-column-filter' , { columnFilters : this . columnFilters } ) ; } // if mode is remote, we don't do any filtering here. if ( this . mode === 'remote' ) { if ( fromFilter ) { this . $emit ( 'update:isLoading' , true ) ; } else { // if remote filtering has already been taken care of. this . filteredRows = computedRows ; } return ; } var _loop = function _loop ( i ) { var col = _this4 . typedColumns [ i ] ; if ( _this4 . columnFilters [ col . field ] ) { computedRows = each ( computedRows , function ( headerRow ) { var newChildren = headerRow . children . filter ( function ( row ) { // If column has a custom filter, use that. if ( col . filterOptions && typeof col . filterOptions . filterFn === 'function' ) { return col . filterOptions . filterFn ( _this4 . collect ( row , col . field ) , _this4 . columnFilters [ col . field ] ) ; } // Otherwise Use default filters var typeDef = col . typeDef ; return typeDef . filterPredicate ( _this4 . collect ( row , col . field ) , _this4 . columnFilters [ col . field ] ) ; } ) ; // should we remove the header? headerRow . children = newChildren ; } ) ; } } ; for ( var i = 0 ; i < this . typedColumns . length ; i ++ ) { _loop ( i ) ; } } this . filteredRows = computedRows ; }
method to filter rows
method to filter rows