@ornery/ui-grid-react 0.1.4 → 0.1.5
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/index.d.mts +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.js +1166 -607
- package/dist/index.mjs +1101 -549
- package/package.json +1 -1
- package/src/UiGrid.tsx +174 -47
- package/src/gridStateMath.test.ts +49 -0
- package/src/gridStateMath.ts +32 -0
- package/src/index.ts +2 -0
- package/src/rustWasmGridEngine.test.ts +56 -0
- package/src/rustWasmGridEngine.ts +21 -0
- package/src/useGridState.ts +637 -328
- package/src/useVirtualScroll.ts +11 -10
- package/src/virtualScrollMath.test.ts +44 -0
- package/src/virtualScrollMath.ts +36 -0
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ interface UiGridProps {
|
|
|
10
10
|
expandableRenderer?: (context: GridExpandableTemplateContext) => React$1.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
|
-
declare function UiGrid({ options, onRegisterApi, cellRenderer, expandableRenderer, className }: UiGridProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function UiGrid({ options, onRegisterApi, cellRenderer, expandableRenderer, className, }: UiGridProps): react_jsx_runtime.JSX.Element;
|
|
14
14
|
|
|
15
15
|
interface UseGridStateResult {
|
|
16
16
|
pipeline: PipelineResult;
|
|
@@ -76,6 +76,15 @@ interface UseGridStateResult {
|
|
|
76
76
|
pageSizeOptions: () => number[];
|
|
77
77
|
isCellEditable: (row: GridRow, column: GridColumnDef, triggerEvent?: Event | KeyboardEvent | null) => boolean;
|
|
78
78
|
shouldEditOnFocus: (column: GridColumnDef) => boolean;
|
|
79
|
+
isPinned: (column: GridColumnDef) => boolean;
|
|
80
|
+
pinnedOffset: (column: GridColumnDef) => {
|
|
81
|
+
side: 'left' | 'right';
|
|
82
|
+
offset: string;
|
|
83
|
+
} | null;
|
|
84
|
+
isPinningEnabled: () => boolean;
|
|
85
|
+
isColumnPinnable: (column: GridColumnDef) => boolean;
|
|
86
|
+
togglePin: (column: GridColumnDef) => void;
|
|
87
|
+
pinningFeature: boolean;
|
|
79
88
|
sortingFeature: boolean;
|
|
80
89
|
filteringFeature: boolean;
|
|
81
90
|
groupingFeature: boolean;
|
|
@@ -130,4 +139,17 @@ interface UseVirtualScrollResult {
|
|
|
130
139
|
}
|
|
131
140
|
declare function useVirtualScroll(options: UseVirtualScrollOptions): UseVirtualScrollResult;
|
|
132
141
|
|
|
133
|
-
|
|
142
|
+
declare function orderVisibleColumns(columns: readonly GridColumnDef[], order: readonly string[]): GridColumnDef[];
|
|
143
|
+
declare function buildGridTemplateColumns(columns: readonly GridColumnDef[]): string;
|
|
144
|
+
declare function resolveBenchmarkIterations(iterations?: number, configuredIterations?: number): number;
|
|
145
|
+
declare function formatPaginationSummary(totalItems: number, firstRowIndex: number, lastRowIndex: number): string;
|
|
146
|
+
declare function computeViewportHeightPx(viewportHeight?: number, autoViewportHeight?: number | null): string;
|
|
147
|
+
declare function computeViewportRows(viewportHeight?: number, rowHeight?: number): number;
|
|
148
|
+
|
|
149
|
+
type UiGridWasmModule = {
|
|
150
|
+
build_pipeline_js(context: unknown): PipelineResult;
|
|
151
|
+
};
|
|
152
|
+
declare function registerReactUiGridWasmEngineFromModule(module: UiGridWasmModule): void;
|
|
153
|
+
declare function enableReactUiGridWasmEngine(): Promise<void>;
|
|
154
|
+
|
|
155
|
+
export { UiGrid, type UiGridProps, type UseGridStateResult, type UseVirtualScrollOptions, type UseVirtualScrollResult, buildGridTemplateColumns, computeViewportHeightPx, computeViewportRows, enableReactUiGridWasmEngine, formatPaginationSummary, orderVisibleColumns, registerReactUiGridWasmEngineFromModule, resolveBenchmarkIterations, useGridState, useVirtualScroll };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface UiGridProps {
|
|
|
10
10
|
expandableRenderer?: (context: GridExpandableTemplateContext) => React$1.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
|
-
declare function UiGrid({ options, onRegisterApi, cellRenderer, expandableRenderer, className }: UiGridProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function UiGrid({ options, onRegisterApi, cellRenderer, expandableRenderer, className, }: UiGridProps): react_jsx_runtime.JSX.Element;
|
|
14
14
|
|
|
15
15
|
interface UseGridStateResult {
|
|
16
16
|
pipeline: PipelineResult;
|
|
@@ -76,6 +76,15 @@ interface UseGridStateResult {
|
|
|
76
76
|
pageSizeOptions: () => number[];
|
|
77
77
|
isCellEditable: (row: GridRow, column: GridColumnDef, triggerEvent?: Event | KeyboardEvent | null) => boolean;
|
|
78
78
|
shouldEditOnFocus: (column: GridColumnDef) => boolean;
|
|
79
|
+
isPinned: (column: GridColumnDef) => boolean;
|
|
80
|
+
pinnedOffset: (column: GridColumnDef) => {
|
|
81
|
+
side: 'left' | 'right';
|
|
82
|
+
offset: string;
|
|
83
|
+
} | null;
|
|
84
|
+
isPinningEnabled: () => boolean;
|
|
85
|
+
isColumnPinnable: (column: GridColumnDef) => boolean;
|
|
86
|
+
togglePin: (column: GridColumnDef) => void;
|
|
87
|
+
pinningFeature: boolean;
|
|
79
88
|
sortingFeature: boolean;
|
|
80
89
|
filteringFeature: boolean;
|
|
81
90
|
groupingFeature: boolean;
|
|
@@ -130,4 +139,17 @@ interface UseVirtualScrollResult {
|
|
|
130
139
|
}
|
|
131
140
|
declare function useVirtualScroll(options: UseVirtualScrollOptions): UseVirtualScrollResult;
|
|
132
141
|
|
|
133
|
-
|
|
142
|
+
declare function orderVisibleColumns(columns: readonly GridColumnDef[], order: readonly string[]): GridColumnDef[];
|
|
143
|
+
declare function buildGridTemplateColumns(columns: readonly GridColumnDef[]): string;
|
|
144
|
+
declare function resolveBenchmarkIterations(iterations?: number, configuredIterations?: number): number;
|
|
145
|
+
declare function formatPaginationSummary(totalItems: number, firstRowIndex: number, lastRowIndex: number): string;
|
|
146
|
+
declare function computeViewportHeightPx(viewportHeight?: number, autoViewportHeight?: number | null): string;
|
|
147
|
+
declare function computeViewportRows(viewportHeight?: number, rowHeight?: number): number;
|
|
148
|
+
|
|
149
|
+
type UiGridWasmModule = {
|
|
150
|
+
build_pipeline_js(context: unknown): PipelineResult;
|
|
151
|
+
};
|
|
152
|
+
declare function registerReactUiGridWasmEngineFromModule(module: UiGridWasmModule): void;
|
|
153
|
+
declare function enableReactUiGridWasmEngine(): Promise<void>;
|
|
154
|
+
|
|
155
|
+
export { UiGrid, type UiGridProps, type UseGridStateResult, type UseVirtualScrollOptions, type UseVirtualScrollResult, buildGridTemplateColumns, computeViewportHeightPx, computeViewportRows, enableReactUiGridWasmEngine, formatPaginationSummary, orderVisibleColumns, registerReactUiGridWasmEngineFromModule, resolveBenchmarkIterations, useGridState, useVirtualScroll };
|