@1771technologies/lytenyte-pro 1.0.0-beta.20 → 1.0.0-beta.21
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.
- package/dist/+types.d.ts +40 -0
- package/dist/header/header-group-cell.js +3 -1
- package/dist/header/use-header-cell-renderer.js +1 -1
- package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +3 -3
- package/dist/row-data-source-client/use-client-data-source-paginated.js +1 -1
- package/package.json +7 -7
package/dist/+types.d.ts
CHANGED
|
@@ -1676,6 +1676,46 @@ export interface ColumnGroupMeta {
|
|
|
1676
1676
|
* Used to build dynamic, collapsible column group layouts in LyteNyte Grid.
|
|
1677
1677
|
*/
|
|
1678
1678
|
export type ColumnGroupVisibility = "always" | "close" | "open";
|
|
1679
|
+
/**
|
|
1680
|
+
* Parameters required to initialize a client-side row data source.
|
|
1681
|
+
*/
|
|
1682
|
+
export interface ClientRowDataSourcePaginatedParams<T> {
|
|
1683
|
+
/**
|
|
1684
|
+
* The primary dataset passed to LyteNyte Grid for display.
|
|
1685
|
+
*/
|
|
1686
|
+
readonly data: T[];
|
|
1687
|
+
/**
|
|
1688
|
+
* Rows to pin to the top of the grid, rendered above all scrollable rows.
|
|
1689
|
+
*/
|
|
1690
|
+
readonly topData?: T[];
|
|
1691
|
+
/**
|
|
1692
|
+
* Rows to pin to the bottom of the grid, rendered below all scrollable rows.
|
|
1693
|
+
*/
|
|
1694
|
+
readonly bottomData?: T[];
|
|
1695
|
+
/**
|
|
1696
|
+
* If true, the data source will reflect external mutations to the original data array.
|
|
1697
|
+
*/
|
|
1698
|
+
readonly reflectData?: boolean;
|
|
1699
|
+
/**
|
|
1700
|
+
* Callback to derive a unique id for grouped (branch) rows based on group value path.
|
|
1701
|
+
*/
|
|
1702
|
+
readonly rowIdBranch?: (path: string[]) => string;
|
|
1703
|
+
/**
|
|
1704
|
+
* Callback to derive a unique id for each leaf row. Receives the row data and index.
|
|
1705
|
+
*/
|
|
1706
|
+
readonly rowIdLeaf?: (d: RowLeaf<T>, i: number) => string;
|
|
1707
|
+
/**
|
|
1708
|
+
* Callback that transforms a set of values for a given column into the in filter items LyteNyte Grid should use.
|
|
1709
|
+
*/
|
|
1710
|
+
readonly transformInFilterItem?: (params: {
|
|
1711
|
+
column: Column<T>;
|
|
1712
|
+
values: unknown[];
|
|
1713
|
+
}) => FilterInFilterItem[];
|
|
1714
|
+
/**
|
|
1715
|
+
* The number of rows to have per page. This will impact the total page count.
|
|
1716
|
+
*/
|
|
1717
|
+
readonly rowsPerPage?: number;
|
|
1718
|
+
}
|
|
1679
1719
|
/**
|
|
1680
1720
|
* Enhanced parameters for a client-side row data source with additional filtering support.
|
|
1681
1721
|
*/
|
|
@@ -9,6 +9,8 @@ const HeaderGroupCellImpl = forwardRef(function HeaderCell({ cell, children, ...
|
|
|
9
9
|
const ctx = grid.state;
|
|
10
10
|
const { ref, ...dragProps } = useDragMove(grid, cell, props.onDragStart);
|
|
11
11
|
const combined = useCombinedRefs(ref, forwarded);
|
|
12
|
-
|
|
12
|
+
const isExpanded = grid.state.columnGroupExpansions.useValue()[cell.id] ??
|
|
13
|
+
grid.state.columnGroupDefaultExpansion.get();
|
|
14
|
+
return (_jsx(HeaderGroupCellReact, { ...props, ...dragProps, ref: combined, cell: cell, cellId: cell.id, height: ctx.headerGroupHeight.useValue(), rtl: ctx.rtl.useValue(), viewportWidth: ctx.viewportWidthInner.useValue(), xPositions: ctx.xPositions.useValue(), isHiddenMove: cell.isHiddenMove ?? false, "data-ln-collapsible": cell.isCollapsible, "data-ln-collapsed": !isExpanded, children: children == undefined ? cell.id : children }));
|
|
13
15
|
});
|
|
14
16
|
export const HeaderGroupCell = fastDeepMemo(HeaderGroupCellImpl);
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useGridRoot } from "../context";
|
|
4
4
|
function DefaultRenderer(p) {
|
|
5
|
-
return _jsx(_Fragment, { children: p.column.id });
|
|
5
|
+
return _jsx(_Fragment, { children: p.column.name ?? p.column.id });
|
|
6
6
|
}
|
|
7
7
|
export function useHeaderCellRenderer(cell) {
|
|
8
8
|
const ctx = useGridRoot().grid;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { GridAtom, RowDataSourceClientPaginated } from "../+types.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ClientRowDataSourcePaginatedParams } from "../+types.js";
|
|
3
3
|
interface DataAtoms<T> {
|
|
4
4
|
readonly top: GridAtom<T[]>;
|
|
5
5
|
readonly center: GridAtom<T[]>;
|
|
6
6
|
readonly bottom: GridAtom<T[]>;
|
|
7
7
|
}
|
|
8
|
-
export declare function makeClientDataSourcePaginated<T>(p:
|
|
9
|
-
export declare function useClientRowDataSourcePaginated<T>(p:
|
|
8
|
+
export declare function makeClientDataSourcePaginated<T>(p: ClientRowDataSourcePaginatedParams<T>): [RowDataSourceClientPaginated<T>, DataAtoms<T>];
|
|
9
|
+
export declare function useClientRowDataSourcePaginated<T>(p: ClientRowDataSourcePaginatedParams<T>): RowDataSourceClientPaginated<T>;
|
|
10
10
|
export {};
|
|
@@ -10,7 +10,7 @@ import { builtIns } from "./built-ins/built-ins.js";
|
|
|
10
10
|
export function makeClientDataSourcePaginated(p) {
|
|
11
11
|
const rdsStore = createStore();
|
|
12
12
|
const pageInternal = atom(0);
|
|
13
|
-
const rowsPerPage = atom(50);
|
|
13
|
+
const rowsPerPage = atom(p.rowsPerPage ?? 50);
|
|
14
14
|
const pageCount = atom((g) => Math.max(Math.ceil(g(flatLength) / g(rowsPerPage)), 1));
|
|
15
15
|
const page = atom((g) => clamp(0, g(pageInternal), g(pageCount) - 1), (g, s, n) => {
|
|
16
16
|
const res = typeof n === "function" ? n(g(pageInternal)) : n;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1771technologies/lytenyte-pro",
|
|
3
3
|
"description": "Blazingly fast headless React data grid with 100s of features.",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.21",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "COMMERCIAL",
|
|
7
7
|
"files": [
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@1771technologies/atom": "^1.0.2",
|
|
52
|
-
"@1771technologies/lytenyte-
|
|
53
|
-
"@1771technologies/lytenyte-
|
|
54
|
-
"@1771technologies/lytenyte-
|
|
55
|
-
"@1771technologies/lytenyte-
|
|
56
|
-
"@1771technologies/lytenyte-react-hooks": "1.0.0-beta.
|
|
57
|
-
"@1771technologies/lytenyte-
|
|
52
|
+
"@1771technologies/lytenyte-dragon": "1.0.0-beta.21",
|
|
53
|
+
"@1771technologies/lytenyte-core": "1.0.0-beta.21",
|
|
54
|
+
"@1771technologies/lytenyte-dom-utils": "1.0.0-beta.21",
|
|
55
|
+
"@1771technologies/lytenyte-shared": "1.0.0-beta.21",
|
|
56
|
+
"@1771technologies/lytenyte-react-hooks": "1.0.0-beta.21",
|
|
57
|
+
"@1771technologies/lytenyte-js-utils": "1.0.0-beta.21"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.0.0 || ^19.0.0",
|