@neovici/cosmoz-omnitable 14.21.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
|
-
|
|
2
|
-
export
|
|
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.
|
|
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)
|
|
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
|
-
}
|
|
49
|
-
exports.computeLayout = computeLayout
|
|
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
|
package/dist/lib/layout.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
interface
|
|
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 =
|
|
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 {};
|
package/dist/lib/layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/lib/layout.ts"],"names":[],"mappings":"AAAA,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-omnitable",
|
|
3
|
-
"version": "14.21.
|
|
3
|
+
"version": "14.21.1",
|
|
4
4
|
"description": "[](https://travis-ci.org/Neovici/cosmoz-omnitable)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components"
|