Comparing version 1.2.0 to 1.2.1
@@ -35,11 +35,8 @@ import { BaseAdapterProcessFactory, AdapterProcess, ProcessStatus } from '../misc/index'; | ||
const { predicate, indexes, increase } = options; | ||
let result = []; | ||
if (predicate) { | ||
result = Remove.runPredicateOverBuffer(scroller, predicate, !!increase); | ||
if (!predicate && !indexes) { | ||
return []; | ||
} | ||
if (indexes) { | ||
const indexPredicate = ({ $index }) => indexes.indexOf($index) >= 0; | ||
result = Remove.runPredicateOverBuffer(scroller, indexPredicate, !!increase); | ||
} | ||
return result; | ||
const newPredicate = item => (predicate && predicate(item)) || | ||
(!!indexes && indexes.includes(item.$index)); | ||
return Remove.runPredicateOverBuffer(scroller, newPredicate, !!increase); | ||
} | ||
@@ -46,0 +43,0 @@ static runPredicateOverBuffer(scroller, predicate, increase) { |
@@ -32,3 +32,3 @@ import { BaseProcessFactory, CommonProcess, ProcessStatus } from './misc/index'; | ||
render.sizeBefore = viewport.getScrollableSize(); | ||
if (fetch.items.map(item => Render.processElement(scroller, item)).some(x => !x)) { | ||
if (!fetch.items.every(item => Render.processElement(scroller, item))) { | ||
return false; | ||
@@ -35,0 +35,0 @@ } |
export default { | ||
name: 'vscroll', | ||
version: '1.2.0' | ||
version: '1.2.1' | ||
}; | ||
//# sourceMappingURL=version.js.map |
@@ -41,14 +41,10 @@ import { __extends } from "tslib"; | ||
var predicate = options.predicate, indexes = options.indexes, increase = options.increase; | ||
var result = []; | ||
if (predicate) { | ||
result = Remove.runPredicateOverBuffer(scroller, predicate, !!increase); | ||
if (!predicate && !indexes) { | ||
return []; | ||
} | ||
if (indexes) { | ||
var indexPredicate = function (_a) { | ||
var $index = _a.$index; | ||
return indexes.indexOf($index) >= 0; | ||
}; | ||
result = Remove.runPredicateOverBuffer(scroller, indexPredicate, !!increase); | ||
} | ||
return result; | ||
var newPredicate = function (item) { | ||
return (predicate && predicate(item)) || | ||
(!!indexes && indexes.includes(item.$index)); | ||
}; | ||
return Remove.runPredicateOverBuffer(scroller, newPredicate, !!increase); | ||
}; | ||
@@ -55,0 +51,0 @@ Remove.runPredicateOverBuffer = function (scroller, predicate, increase) { |
@@ -37,3 +37,5 @@ import { __extends } from "tslib"; | ||
render.sizeBefore = viewport.getScrollableSize(); | ||
if (fetch.items.map(function (item) { return Render.processElement(scroller, item); }).some(function (x) { return !x; })) { | ||
if (!fetch.items.every(function (item) { | ||
return Render.processElement(scroller, item); | ||
})) { | ||
return false; | ||
@@ -40,0 +42,0 @@ } |
export default { | ||
name: 'vscroll', | ||
version: '1.2.0' | ||
version: '1.2.1' | ||
}; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "vscroll", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Virtual scroll engine", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundles/vscroll.umd.js", |
@@ -194,3 +194,3 @@ [![build status](https://github.com/dhilt/vscroll/actions/workflows/build.yml/badge.svg)](https://github.com/dhilt/vscroll/actions/workflows/build.yml) | ||
Adapter API becomes available as `Datasource.adapter` property after the Datasource is instantiated via operator "new". In terms of "vscroll" you need to get a Datasource class by calling `makeDatasource` method, then you can instantiate it. `makeDatasource` accepts 1 argument, which is an Adapter custom configuration. Currently this config can only be used to redefine the just mentioned Adapter reactive props. Here's an example of how simple Reactive props can be overridden with RxJs Subject and BehaviorSubject entities: [ui-scroll.datasource.ts](https://github.com/dhilt/ngx-ui-scroll/blob/v2.0.0-rc.10/src/ui-scroll.datasource.ts). | ||
Adapter API becomes available as `Datasource.adapter` property after the Datasource is instantiated via operator "new". In terms of "vscroll" you need to get a Datasource class by calling `makeDatasource` method, then you can instantiate it. `makeDatasource` accepts 1 argument, which is an Adapter custom configuration. Currently this config can only be used to redefine the just mentioned Adapter reactive props. Here's an example of how simple Reactive props can be overridden with RxJs Subject and BehaviorSubject entities: [ui-scroll.datasource.ts](https://github.com/dhilt/ngx-ui-scroll/blob/v2.2.0/src/ui-scroll.datasource.ts). | ||
@@ -197,0 +197,0 @@ An important note is that the Adapter getting ready breaks onto 2 parts: instantiation (which is synchronous with the Datasource instantiation) and initialization (which occurs during the Workflow instantiating). Adapter gets all necessary props and methods during the first phase, but this starts work only when the second phase is done. Practically this means |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3348807
28295