From 9cc5dcbd9490233f0ab0c3a618a1b96242294061 Mon Sep 17 00:00:00 2001 From: Denis Hilt Date: Wed, 8 Sep 2021 05:56:49 +0300 Subject: [PATCH] v2.2.2 --- README.md | 6 +++--- package-dist.json | 2 +- package.json | 2 +- src/ui-scroll.version.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0f41bddc..6f00ecf7 100644 --- a/README.md +++ b/README.md @@ -202,9 +202,9 @@ Below is the list of invocable methods of the Adapter API with description and l |[reset](https://dhilt.github.io/ngx-ui-scroll/#adapter#reset)|(datasource?: IDatasource)|Performs hard reset of the Scroller's internal state by re-instantiating all its entities (instead of reusing them when _reload_). If _datasource_ argument is passed, it will be treated as new Datasource. All props of the _datasource_ are optional and the result Datasource will be a combination (merge) of the original one and the one passed as an argument. | |[check](https://dhilt.github.io/ngx-ui-scroll/#adapter#check-size)| |Checks if any of current items changed it's size and runs a procedure to provide internal consistency and new items fetching if needed. | |[clip](https://dhilt.github.io/ngx-ui-scroll/#adapter#clip)|(options: {
  forwardOnly?: boolean,
  backwardOnly?: boolean
})|Removes out-of-viewport items on demand. The direction in which invisible items should be clipped can be specified by passing an options object. If no options is passed (or both properties are set to _true_), clipping will occur in both directions. | -|[append](https://dhilt.github.io/ngx-ui-scroll/#adapter#append-prepend)|(options: {
  items: MyItem[],
  eof?: boolean
})

(items: MyItem | MyItem[], eof?: boolean) *
* old signature, deprecated|Adds items to the end of the Scroller's dataset. If _eof_ parameter is not set, items will be added and rendered immediately, they will be placed right after the last item in the Scroller's buffer. If _eof_ is set to true, items will be added and rendered only if the end of the dataset is reached; otherwise, these items will be virtualized. See also [bof/eof](https://dhilt.github.io/ngx-ui-scroll/#adapter#bof-eof) demo. | -|[prepend](https://dhilt.github.io/ngx-ui-scroll/#adapter#append-prepend)|(options: {
  items: MyItem[],
  bof?: boolean
})

(items: MyItem | MyItem[], bof?: boolean) *
* old signature, deprecated|Adds items to the beginning of the Scroller's dataset. If _bof_ parameter is not set, items will be added and rendered immediately, they will be placed right before the first item in the Scroller's buffer. If _bof_ is set to true, items will be added and rendered only if the beginning of the dataset is reached; otherwise, these items will be virtualized. See also [bof/eof](https://dhilt.github.io/ngx-ui-scroll/#adapter#bof-eof) demo. | -|[remove](https://dhilt.github.io/ngx-ui-scroll/#adapter#remove)|(options: {
  predicate?: ItemsPredicate,
  indexes?: number[],
  increase?: boolean
})

(func: ItemsPredicate) *
* old signature, deprecated

type ItemsPredicate =
  (item: ItemAdapter) =>
    boolean|Removes items form buffer and/or virtually. Predicate is a function to be applied to every item presently in the buffer. Predicate must return a boolean value. If predicate's return value is true, the item will be removed. Only a continuous series of items can be removed at a time using _predicate_. Alternatively, if _indexes_ array is passed, the items whose indexes match the list will be removed. Only one of the _predicate_ and _indexes_ options is allowed. In case of _indexes_, the deletion is performed also virtually. By default, indexes of the items following the deleted ones are decremented. Instead, if _increase_ is set to _true_, indexes of the items before the removed ones will be increased. | +|[append](https://dhilt.github.io/ngx-ui-scroll/#adapter#append-prepend)|(options: {
  items: MyItem[],
  eof?: boolean
  decrease?: boolean
})

(items: MyItem | MyItem[], eof?: boolean) *
* old signature, deprecated|Adds items to the end of the Scroller's dataset. Indexes increase by default. If _decrease_ is set to true, indexes are decremented. If _eof_ parameter is not set, items will be added and rendered immediately, they will be placed right after the last item in the Scroller's buffer. If _eof_ is set to true, items will be added and rendered only if the end of the dataset is reached; otherwise, these items will be virtualized (see also [bof/eof](https://dhilt.github.io/ngx-ui-scroll/#adapter#bof-eof)). | +|[prepend](https://dhilt.github.io/ngx-ui-scroll/#adapter#append-prepend)|(options: {
  items: MyItem[],
  bof?: boolean
  increase?: boolean
})

(items: MyItem | MyItem[], bof?: boolean) *
* old signature, deprecated|Adds items to the beginning of the Scroller's dataset. Indexes decrease by default. If _increase_ is set to true, indexes are incremented. If _bof_ parameter is not set, items will be added and rendered immediately, they will be placed right before the first item in the Scroller's buffer. If _bof_ is set to true, items will be added and rendered only if the beginning of the dataset is reached; otherwise, these items will be virtualized (see also [bof/eof](https://dhilt.github.io/ngx-ui-scroll/#adapter#bof-eof)). | +|[remove](https://dhilt.github.io/ngx-ui-scroll/#adapter#remove)|(options: {
  predicate?: ItemsPredicate,
  indexes?: number[],
  increase?: boolean
})

(func: ItemsPredicate) *
* old signature, deprecated

type ItemsPredicate =
  (item: ItemAdapter) =>
    boolean|Removes items form buffer and/or virtually. Predicate is a function to be applied to every item presently in the buffer. Predicate must return a boolean value. If predicate's return value is true, the item will be removed. Only a continuous series of items can be removed at a time using _predicate_. Alternatively, if _indexes_ array is passed, the items whose indexes match the list will be removed. Only one of the _predicate_ and _indexes_ options is allowed. In case of _indexes_, the deletion is performed also virtually. By default, indexes of the items following the deleted ones are decremented. Instead, if _increase_ is set to _true_, the indexes of the items before the removed ones are incremented. | |[insert](https://dhilt.github.io/ngx-ui-scroll/#adapter#insert)|(options: {
  items: MyItem[],
  before?: ItemsPredicate,
  after?: ItemsPredicate,
  decrease?: boolean
})|Inserts items _before_ or _after_ the one that presents in the buffer and satisfies the predicate condition. Only one of the _before_ and _after_ options is allowed. Indexes increase by default. Decreasing strategy can be enabled via _decrease_ option. | |[replace](https://dhilt.github.io/ngx-ui-scroll/#adapter#replace)|(options: {
  predicate: ItemsPredicate,
  items: MyItem[],
  fixRight?: boolean
})|Replaces items that continuously match the _predicate_ with an array of new _items_. Indexes are maintained on the assumption that the left border of the dataset is fixed. To release the left border and fix the right one the _fixRight_ option should be set to _true_. | |[update](https://dhilt.github.io/ngx-ui-scroll/#adapter#update)|(options: {
  predicate: BufferUpdater,
  fixRight?: boolean
})

type BufferUpdater =
  (item: ItemAdapter) =>
    unknown|Updates existing items by running the _predicate_ function over the Scroller's buffer. The return value of the _predicate_ determines the operation: falsy or empty array to remove, truthy or array with only 1 current item to keep unchanged, non-empty array to replace/insert. Indexes are maintained on the assumption that the left border of the dataset is fixed. To release the left border and fix the right one the _fixRight_ option should be set to _true_. | diff --git a/package-dist.json b/package-dist.json index fd3a79e8..cad69264 100644 --- a/package-dist.json +++ b/package-dist.json @@ -1,6 +1,6 @@ { "name": "ngx-ui-scroll", - "version": "2.2.1", + "version": "2.2.2", "description": "Infinite/virtual scroll for Angular", "main": "./bundles/ngx-ui-scroll.umd.js", "module": "./fesm5/ngx-ui-scroll.js", diff --git a/package.json b/package.json index 6095122c..3d5d42d3 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build-app": "ng build --configuration production", "deploy-app": "npm run build-app && firebase deploy", "preinstall": "cd server && npm install", - "pack:install": "npm run build && npm pack ./dist && npm install ngx-ui-scroll-2.2.1.tgz --no-save", + "pack:install": "npm run build && npm pack ./dist && npm install ngx-ui-scroll-2.2.2.tgz --no-save", "pack:start": "npm run pack:install && npm start", "build": "node build.js", "publish:lib": "npm run build && npm publish ./dist", diff --git a/src/ui-scroll.version.ts b/src/ui-scroll.version.ts index 59a5b5d3..ccaaee67 100644 --- a/src/ui-scroll.version.ts +++ b/src/ui-scroll.version.ts @@ -1,4 +1,4 @@ export default { name: 'ngx-ui-scroll', - version: '2.2.1' + version: '2.2.2' };