@1771technologies/lytenyte-pro 2.1.2 → 2.1.3

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,7 @@
1
1
  import { type ReactNode } from "react";
2
- import type { Column, GridSpec, RowNode } from "../../types";
3
- import type { Grid } from "../..";
4
- export interface ColumnManagerProps<Spec extends GridSpec = GridSpec> {
2
+ import type { Column, RowNode } from "../../types";
3
+ import type { Grid } from "@1771technologies/lytenyte-core";
4
+ export interface ColumnManagerProps<Spec extends Grid.GridSpec = Grid.GridSpec> {
5
5
  readonly columns: Column<Spec>[];
6
6
  readonly onColumnsChange: (change: Column<Spec>[]) => void;
7
7
  readonly base?: Grid.ColumnBase<Spec>;
@@ -16,4 +16,4 @@ export interface ColumnManagerProps<Spec extends GridSpec = GridSpec> {
16
16
  */
17
17
  readonly getPillManagerTag?: (column: Column<Spec>) => Record<string, string>;
18
18
  }
19
- export declare function ColumnManager<Spec extends GridSpec = GridSpec>({ columns: provided, base, rowHeight, onColumnsChange, endElement, getPillManagerTag, }: ColumnManagerProps<Spec>): import("react/jsx-runtime").JSX.Element;
19
+ export declare function ColumnManager<Spec extends Grid.GridSpec = Grid.GridSpec>({ columns: provided, base, rowHeight, onColumnsChange, endElement, getPillManagerTag, }: ColumnManagerProps<Spec>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import type { RowAggregated, RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared";
2
- import type { API, CellParamsWithIndex, GridSpec } from "../types";
2
+ import type { API, CellParamsWithIndex } from "../types";
3
3
  import type { ReactNode } from "react";
4
4
  import { type SlotComponent } from "../hooks/use-slot/index.js";
5
- export declare const RowGroupCell: <Spec extends GridSpec = GridSpec>({ api, row, leafLabel, groupLabel, aggLabel, expansionSlot, }: CellParamsWithIndex<Spec> & {
5
+ import type { Grid } from "@1771technologies/lytenyte-core";
6
+ export declare const RowGroupCell: <Spec extends Grid.GridSpec = Grid.GridSpec>({ api, row, leafLabel, groupLabel, aggLabel, expansionSlot, }: CellParamsWithIndex<Spec> & {
6
7
  leafLabel?: (row: RowLeaf<Spec["data"]>, api: API<Spec>) => ReactNode;
7
8
  groupLabel?: (row: RowGroup, api: API<Spec>) => ReactNode;
8
9
  aggLabel?: (row: RowAggregated, api: API<Spec>) => ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { type SlotComponent } from "../hooks/use-slot/index.js";
2
- import type { API, GridSpec } from "../types.js";
2
+ import type { API } from "../types.js";
3
+ import type { Grid } from "@1771technologies/lytenyte-core";
3
4
  export interface SelectAllProps {
4
5
  readonly slot?: SlotComponent<{
5
6
  readonly indeterminate: boolean;
@@ -7,6 +8,6 @@ export interface SelectAllProps {
7
8
  readonly toggle: (forceState?: boolean) => void;
8
9
  }>;
9
10
  }
10
- export declare function SelectAll<Spec extends GridSpec>({ api, slot, }: SelectAllProps & {
11
+ export declare function SelectAll<Spec extends Grid.GridSpec>({ api, slot, }: SelectAllProps & {
11
12
  readonly api: API<Spec>;
12
13
  }): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -1,8 +1,8 @@
1
1
  import type { UseClientDataSourceParams } from "../use-client-data-source.js";
2
2
  import type { SourceState } from "./use-controlled-ds-state.js";
3
3
  import { type LeafNodeTuple } from "@1771technologies/lytenyte-core/internal";
4
- import type { GridSpec } from "@1771technologies/lytenyte-core/types";
5
- export declare function useFlattenedData<Spec extends GridSpec>(props: UseClientDataSourceParams<Spec>, [leafsTop, leafs, leafsBot, pinMap]: LeafNodeTuple<Spec["data"]>, { expandedFn }: SourceState): {
4
+ import type { Grid } from "@1771technologies/lytenyte-core";
5
+ export declare function useFlattenedData<Spec extends Grid.GridSpec>(props: UseClientDataSourceParams<Spec>, [leafsTop, leafs, leafsBot, pinMap]: LeafNodeTuple<Spec["data"]>, { expandedFn }: SourceState): {
6
6
  tree: import("./use-group-tree/use-group-tree.js").RootNode<Spec["data"]> | null;
7
7
  maxDepth: number;
8
8
  flatten: import("@1771technologies/lytenyte-shared").RowNode<Spec["data"]>[];
@@ -1,2 +1,3 @@
1
- import type { Column, GridSpec } from "../../../../types.js";
2
- export declare function applyReferenceColumn<Spec extends GridSpec>(pivotColumn: Column<Spec>, reference: Omit<Column<Spec>, "id"> | undefined): Column<Spec>;
1
+ import type { Grid } from "@1771technologies/lytenyte-core";
2
+ import type { Column } from "../../../../types.js";
3
+ export declare function applyReferenceColumn<Spec extends Grid.GridSpec>(pivotColumn: Column<Spec>, reference: Omit<Column<Spec>, "id"> | undefined): Column<Spec>;
@@ -1,4 +1,4 @@
1
1
  import type { RowLeaf } from "@1771technologies/lytenyte-shared";
2
2
  import type { PivotModel } from "../../../use-client-data-source";
3
- import type { GridSpec } from "../../../../types.js";
4
- export declare function pivotPaths<Spec extends GridSpec>(filtered: number[], leafs: RowLeaf<Spec["data"]>[], columns: Required<PivotModel<Spec>>["columns"], measures: PivotModel<Spec>["measures"], labelFilter: PivotModel<Spec>["colLabelFilter"]): string[];
3
+ import type { Grid } from "@1771technologies/lytenyte-core";
4
+ export declare function pivotPaths<Spec extends Grid.GridSpec>(filtered: number[], leafs: RowLeaf<Spec["data"]>[], columns: Required<PivotModel<Spec>>["columns"], measures: PivotModel<Spec>["measures"], labelFilter: PivotModel<Spec>["colLabelFilter"]): string[];
@@ -1,4 +1,5 @@
1
- import type { Column, GridSpec } from "../../../types.js";
1
+ import type { Column } from "../../../types.js";
2
2
  import type { PivotModel } from "../../use-client-data-source.js";
3
3
  import type { AggregationFn, Aggregator } from "@1771technologies/lytenyte-shared";
4
- export declare function usePivotAggFunction<Spec extends GridSpec>(pivotColumns: Column<Spec>[] | null, model: PivotModel<Spec> | undefined, aggs?: Record<string, Aggregator<Spec["data"]>>): AggregationFn<Spec["data"]> | null;
4
+ import type { Grid } from "@1771technologies/lytenyte-core";
5
+ export declare function usePivotAggFunction<Spec extends Grid.GridSpec>(pivotColumns: Column<Spec>[] | null, model: PivotModel<Spec> | undefined, aggs?: Record<string, Aggregator<Spec["data"]>>): AggregationFn<Spec["data"]> | null;
@@ -1,7 +1,8 @@
1
1
  import type { PivotModel } from "../../use-client-data-source";
2
- import type { Column, GridSpec } from "../../../types.js";
2
+ import type { Column } from "../../../types.js";
3
3
  import { type ColumnPin, type RowLeaf } from "@1771technologies/lytenyte-shared";
4
4
  import type { ControlledPivotState } from "./use-pivot-state";
5
+ import type { Grid } from "@1771technologies/lytenyte-core";
5
6
  export interface PivotState {
6
7
  readonly columnState: {
7
8
  readonly ordering: string[];
@@ -11,4 +12,4 @@ export interface PivotState {
11
12
  readonly columnGroupState: Record<string, boolean>;
12
13
  readonly rowGroupExpansions: Record<string, boolean | undefined>;
13
14
  }
14
- export declare function usePivotColumns<Spec extends GridSpec = GridSpec>(pivotMode: boolean, pivotControlled: ControlledPivotState, model: PivotModel<Spec> | undefined, leafs: RowLeaf<Spec["data"]>[], filtered: number[], processor: null | undefined | ((columns: Column<any>[]) => Column<any>[])): Column<Spec>[] | null;
15
+ export declare function usePivotColumns<Spec extends Grid.GridSpec = Grid.GridSpec>(pivotMode: boolean, pivotControlled: ControlledPivotState, model: PivotModel<Spec> | undefined, leafs: RowLeaf<Spec["data"]>[], filtered: number[], processor: null | undefined | ((columns: Column<any>[]) => Column<any>[])): Column<Spec>[] | null;
@@ -1,10 +1,10 @@
1
- import type { GridSpec } from "../../../types";
2
1
  import type { UseClientDataSourceParams } from "../../use-client-data-source";
3
2
  import type { SourceState } from "../use-controlled-ds-state";
4
3
  import { type RowLeaf } from "@1771technologies/lytenyte-shared";
5
4
  import { type LeafNodeTuple } from "@1771technologies/lytenyte-core/internal";
6
5
  import { type ControlledPivotState } from "./use-pivot-state.js";
7
- export declare function usePivotData<Spec extends GridSpec>(props: UseClientDataSourceParams<Spec>, [, leafs, , pinMap]: LeafNodeTuple<Spec["data"]>, c: SourceState, controlled: ControlledPivotState): {
6
+ import type { Grid } from "@1771technologies/lytenyte-core";
7
+ export declare function usePivotData<Spec extends Grid.GridSpec>(props: UseClientDataSourceParams<Spec>, [, leafs, , pinMap]: LeafNodeTuple<Spec["data"]>, c: SourceState, controlled: ControlledPivotState): {
8
8
  tree: import("../use-group-tree/use-group-tree.js").RootNode<Spec["data"]> | null;
9
9
  maxDepth: number;
10
10
  flatten: import("@1771technologies/lytenyte-shared").RowNode<any>[];
@@ -1,4 +1,4 @@
1
- import type { GridSpec } from "../../../types.js";
2
1
  import type { GroupFn } from "@1771technologies/lytenyte-shared";
3
2
  import type { PivotModel } from "../../use-client-data-source.js";
4
- export declare function usePivotGroupFn<Spec extends GridSpec>(pivotMode: boolean, model: PivotModel<Spec> | undefined): GroupFn<Spec["data"]> | null;
3
+ import type { Grid } from "@1771technologies/lytenyte-core";
4
+ export declare function usePivotGroupFn<Spec extends Grid.GridSpec>(pivotMode: boolean, model: PivotModel<Spec> | undefined): GroupFn<Spec["data"]> | null;
@@ -1,23 +1,24 @@
1
1
  import type { AggregationFn, Aggregator, Dimension, DimensionAgg, DimensionSort, FilterFn, GroupFn, GroupIdFn, LeafIdFn, RowGroup, RowLeaf, RowNode, RowSelectionState, RowSource, SortFn } from "@1771technologies/lytenyte-shared";
2
2
  import type { PivotState } from "./hooks/use-pivot/use-pivot-columns.js";
3
- import type { Column, Field, GridSpec, Props } from "../types.js";
4
- export type PivotField<Spec extends GridSpec = GridSpec> = {
3
+ import type { Column, Field } from "../types.js";
4
+ import type { Grid } from "@1771technologies/lytenyte-core";
5
+ export type PivotField<Spec extends Grid.GridSpec = Grid.GridSpec> = {
5
6
  field?: Field<Spec["data"]>;
6
7
  };
7
8
  export type HavingFilterFn = (node: RowGroup) => boolean;
8
- export interface RowSourceClient<Spec extends GridSpec = GridSpec> extends RowSource<Spec["data"]> {
9
+ export interface RowSourceClient<Spec extends Grid.GridSpec = Grid.GridSpec> extends RowSource<Spec["data"]> {
9
10
  readonly usePivotProps: () => {
10
11
  readonly columns?: Column<Spec>[];
11
- readonly onColumnsChange: Props<Spec>["onColumnsChange"];
12
- readonly columnGroupExpansions: Props<Spec>["columnGroupExpansions"];
13
- readonly onColumnGroupExpansionChange: Props<Spec>["onColumnGroupExpansionChange"];
12
+ readonly onColumnsChange: Grid.Props<Spec>["onColumnsChange"];
13
+ readonly columnGroupExpansions: Grid.Props<Spec>["columnGroupExpansions"];
14
+ readonly onColumnGroupExpansionChange: Grid.Props<Spec>["onColumnGroupExpansionChange"];
14
15
  };
15
16
  readonly rowUpdate: (rows: Map<RowNode<Spec["data"]>, Spec["data"]>) => void;
16
17
  readonly rowDelete: (rows: RowNode<Spec["data"]>[]) => void;
17
18
  readonly rowAdd: (rows: Spec["data"][], placement?: "start" | "end" | number) => void;
18
19
  }
19
20
  export type LabelFilter = (s: string | null) => boolean;
20
- export interface PivotModel<Spec extends GridSpec = GridSpec> {
21
+ export interface PivotModel<Spec extends Grid.GridSpec = Grid.GridSpec> {
21
22
  readonly columns?: (Column<Spec> | PivotField<Spec>)[];
22
23
  readonly rows?: (Column<Spec> | PivotField<Spec>)[];
23
24
  readonly measures?: {
@@ -29,7 +30,7 @@ export interface PivotModel<Spec extends GridSpec = GridSpec> {
29
30
  readonly rowLabelFilter?: (LabelFilter | null)[];
30
31
  readonly colLabelFilter?: (LabelFilter | null)[];
31
32
  }
32
- export interface UseClientDataSourceParams<Spec extends GridSpec = GridSpec, T = Spec["data"]> {
33
+ export interface UseClientDataSourceParams<Spec extends Grid.GridSpec = Grid.GridSpec, T = Spec["data"]> {
33
34
  readonly data: T[];
34
35
  readonly topData?: T[];
35
36
  readonly botData?: T[];
@@ -86,4 +87,4 @@ export interface UseClientDataSourceParams<Spec extends GridSpec = GridSpec, T =
86
87
  readonly center: Map<number, T>;
87
88
  }) => void;
88
89
  }
89
- export declare function useClientDataSource<Spec extends GridSpec = GridSpec>(props: UseClientDataSourceParams<Spec>): RowSourceClient<Spec>;
90
+ export declare function useClientDataSource<Spec extends Grid.GridSpec = Grid.GridSpec>(props: UseClientDataSourceParams<Spec>): RowSourceClient<Spec>;
@@ -1,12 +1,13 @@
1
1
  import type * as Core from "@1771technologies/lytenyte-core/types";
2
2
  import { type PropsWithChildren, type ReactNode } from "react";
3
3
  import type { RowSource } from "@1771technologies/lytenyte-shared";
4
+ import type { Grid } from "@1771technologies/lytenyte-core";
4
5
  export declare const Root: <Spec extends Root.GridSpec = Root.GridSpec>(props: PropsWithChildren<Root.Props<Spec> & (undefined extends Spec["api"] ? object : {
5
6
  apiExtension: Spec["api"];
6
7
  })>) => ReactNode;
7
8
  export declare namespace Root {
8
- type GridSpec<T = unknown, C extends Record<string, any> = object, S extends RowSource<T> = RowSource, E extends Record<string, any> = object> = Core.GridSpec<T, C, S, E>;
9
- type Props<Spec extends GridSpec = GridSpec> = Core.Props<Spec>;
9
+ type GridSpec<T = unknown, C extends Record<string, any> = object, S extends RowSource<T> = RowSource, E extends Record<string, any> = object> = Grid.GridSpec<T, C, S, E>;
10
+ type Props<Spec extends GridSpec = GridSpec> = Grid.Props<Spec>;
10
11
  type API<Spec extends GridSpec = GridSpec> = Core.API<Spec>;
11
12
  type Column<Spec extends GridSpec = GridSpec> = Core.Column<Spec>;
12
13
  }
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": "2.1.2",
4
+ "version": "2.1.3",
5
5
  "type": "module",
6
6
  "license": "COMMERCIAL",
7
7
  "files": [
@@ -85,14 +85,14 @@
85
85
  "access": "public"
86
86
  },
87
87
  "dependencies": {
88
- "@1771technologies/js-utils": "2.1.2",
89
- "@1771technologies/lytenyte-shared": "2.1.2",
90
- "@1771technologies/dom-utils": "2.1.2",
91
- "@1771technologies/lytenyte-design": "2.1.2",
92
- "@1771technologies/lytenyte-core": "2.1.2"
88
+ "@1771technologies/js-utils": "2.1.3",
89
+ "@1771technologies/lytenyte-core": "2.1.3",
90
+ "@1771technologies/lytenyte-design": "2.1.3",
91
+ "@1771technologies/dom-utils": "2.1.3",
92
+ "@1771technologies/lytenyte-shared": "2.1.3"
93
93
  },
94
94
  "devDependencies": {
95
- "@1771technologies/grid-sample-data": "2.1.2"
95
+ "@1771technologies/grid-sample-data": "2.1.3"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "react": "18.0.0 || ^19.0.0",