@neovici/cosmoz-omnitable 14.12.0 → 14.12.1

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.
@@ -1,7 +1,8 @@
1
1
  import { layout } from './layout';
2
+ import { findLastIndex } from './utils';
2
3
 
3
4
  const _toCss = (layout, config) => {
4
- const lastVisibleIndex = layout.findLastIndex(
5
+ const lastVisibleIndex = findLastIndex(layout,
5
6
  (width) => width != null && width > 0,
6
7
  ),
7
8
  generateCellCSS = (itemName, width) =>
package/lib/utils.js CHANGED
@@ -1,3 +1,17 @@
1
1
  const indexSymbol = Symbol('index');
2
2
 
3
3
  export { indexSymbol };
4
+
5
+ export const findLastIndex = (array, predicate) => {
6
+ if (Array.prototype.findLastIndex) {
7
+ return array.findLastIndex(predicate);
8
+ }
9
+
10
+ for (let i = array.length - 1; i >= 0; i--) {
11
+ if (predicate(array[i], i, array)) {
12
+ return i;
13
+ }
14
+ }
15
+
16
+ return -1;
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "14.12.0",
3
+ "version": "14.12.1",
4
4
  "description": "[![Build Status](https://travis-ci.org/Neovici/cosmoz-omnitable.svg?branch=master)](https://travis-ci.org/Neovici/cosmoz-omnitable)",
5
5
  "keywords": [
6
6
  "web-components"