@neovici/cosmoz-omnitable 14.20.0 → 14.21.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,3 +1,4 @@
1
- export function computeLayout(_columnConfigs: any, canvasWidth: any, numColumns: any): any;
2
- export function toCss(layout: any, config: any): any;
1
+ import { ColumnConfig } from './layout';
2
+ export declare const computeLayout: (_columnConfigs: ColumnConfig[], canvasWidth: number, numColumns: number) => (number | undefined)[];
3
+ export declare const toCss: (layout: number[], config: ColumnConfig[]) => string;
3
4
  //# sourceMappingURL=compute-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../src/lib/compute-layout.js"],"names":[],"mappings":"AAwCO,2FAiCkE;AAjClE,qDAiCkE"}
1
+ {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../src/lib/compute-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,UAAU,CAAC;AA8ChD,eAAO,MAAM,aAAa,GACzB,gBAAgB,YAAY,EAAE,EAC9B,aAAa,MAAM,EACnB,YAAY,MAAM,KAChB,CAAC,MAAM,GAAG,SAAS,CAAC,EA+BtB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,QAAQ,MAAM,EAAE,EAAE,QAAQ,YAAY,EAAE,WACU,CAAC"}
@@ -4,7 +4,10 @@ exports.toCss = exports.computeLayout = void 0;
4
4
  const layout_1 = require("./layout");
5
5
  const utils_1 = require("./utils");
6
6
  const _toCss = (layout, config) => {
7
- const lastVisibleIndex = (0, utils_1.findLastIndex)(layout, (width) => width != null && width > 0), generateCellCSS = (itemName, width) => `.cell[name="${itemName}"], cosmoz-omnitable-skeleton::part(cell-${itemName}){width: ${Math.floor(width)}px;padding: 0 min(3px, ${width / 2}px)}`, hideResizeNub = (itemName) => `cosmoz-omnitable-resize-nub[name="${itemName}"]{display:none}`, hideColumn = (itemName) => `cosmoz-omnitable-resize-nub[name="${itemName}"], .cell[name="${itemName}"]{display:none}`;
7
+ const lastVisibleIndex = (0, utils_1.findLastIndex)(layout, (width) => width != null && width > 0);
8
+ const generateCellCSS = (itemName, width) => `.cell[name="${itemName}"], cosmoz-omnitable-skeleton::part(cell-${itemName}){width: ${Math.floor(width)}px;padding: 0 min(3px, ${width / 2}px)}`;
9
+ const hideResizeNub = (itemName) => `cosmoz-omnitable-resize-nub[name="${itemName}"]{display:none}`;
10
+ const hideColumn = (itemName) => `cosmoz-omnitable-resize-nub[name="${itemName}"], .cell[name="${itemName}"]{display:none}`;
8
11
  return config
9
12
  .map((item, index) => {
10
13
  const width = layout[index];
@@ -45,6 +48,8 @@ const computeLayout = (_columnConfigs, canvasWidth, numColumns) => {
45
48
  sorted[columnConfigs[i].index] = width;
46
49
  return sorted;
47
50
  }, new Array(numColumns).fill(undefined));
48
- }, toCss = (layout, config) => layout.length === 0 ? '.cell {display: none;}' : _toCss(layout, config);
49
- exports.computeLayout = computeLayout, exports.toCss = toCss;
51
+ };
52
+ exports.computeLayout = computeLayout;
53
+ const toCss = (layout, config) => layout.length === 0 ? '.cell {display: none;}' : _toCss(layout, config);
54
+ exports.toCss = toCss;
50
55
  //# sourceMappingURL=compute-layout.js.map
@@ -1,12 +1,13 @@
1
- interface Column {
1
+ export interface ColumnConfig {
2
2
  flex: number;
3
3
  index: number;
4
4
  minWidth: number;
5
5
  width: number;
6
6
  priority: number;
7
7
  name: string;
8
+ hidden?: boolean;
8
9
  }
9
- type Columns = Column[];
10
+ type Columns = ColumnConfig[];
10
11
  export declare const // eslint-disable-next-line max-statements
11
12
  layout: (columns: Columns, container: number) => number[];
12
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/lib/layout.ts"],"names":[],"mappings":"AAAA,UAAU,MAAM;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,KAAK,OAAO,GAAG,MAAM,EAAE,CAAC;AAGxB,eAAO,MAAM,0CAA0C;AACtD,MAAM,GAAI,SAAS,OAAO,EAAE,WAAW,MAAM,aA0D5C,CAAC"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/lib/layout.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,KAAK,OAAO,GAAG,YAAY,EAAE,CAAC;AAG9B,eAAO,MAAM,0CAA0C;AACtD,MAAM,GAAI,SAAS,OAAO,EAAE,WAAW,MAAM,aA0D5C,CAAC"}
@@ -1,3 +1,4 @@
1
- export function findLastIndex(array: any, predicate: any): any;
2
- export const indexSymbol: unique symbol;
1
+ declare const indexSymbol: unique symbol;
2
+ export { indexSymbol };
3
+ export declare const findLastIndex: (array: number[], predicate: (prop: number, index?: number, array?: number[]) => boolean) => number;
3
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.js"],"names":[],"mappings":"AAIO,+DAYN;AAhBD,wCAAoC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW,eAAkB,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,eAAO,MAAM,aAAa,GACzB,OAAO,MAAM,EAAE,EACf,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,WActE,CAAC"}
package/dist/lib/utils.js CHANGED
@@ -4,7 +4,7 @@ exports.findLastIndex = exports.indexSymbol = void 0;
4
4
  const indexSymbol = Symbol('index');
5
5
  exports.indexSymbol = indexSymbol;
6
6
  const findLastIndex = (array, predicate) => {
7
- if (Array.prototype.findLastIndex) {
7
+ if (typeof array.findLastIndex === 'function') {
8
8
  return array.findLastIndex(predicate);
9
9
  }
10
10
  for (let i = array.length - 1; i >= 0; i--) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "14.20.0",
3
+ "version": "14.21.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"