@smallwebco/tinypivot-react 1.0.49 → 1.0.50

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.cts CHANGED
@@ -1,11 +1,27 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ColumnStats, NumericRange, FieldStats, PivotValueField, CalculatedField, AggregationFunction, PivotResult, LicenseInfo, ExportOptions, PivotExportData, SelectionBounds, PaginationOptions } from '@smallwebco/tinypivot-core';
1
+ import { ColumnStats, NumericRange, FieldStats, PivotValueField, CalculatedField, AggregationFunction, PivotResult, PivotExportData, ExportOptions, SelectionBounds, PaginationOptions, LicenseInfo } from '@smallwebco/tinypivot-core';
3
2
  export { AggregationFunction, CellClickEvent, ColumnStats, CopyEvent, DataGridProps, ExportEvent, ExportOptions, FieldStats, FilterEvent, GridOptions, LicenseInfo, LicenseType, PaginationOptions, PivotCell, PivotConfig as PivotConfigType, PivotField, PivotResult, PivotTableProps, PivotValueField, RowSelectionChangeEvent, SelectionBounds, SelectionChangeEvent, SortEvent, formatCellValue, getAggregationLabel, getColumnUniqueValues } from '@smallwebco/tinypivot-core';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default from 'react';
6
6
  import * as _tanstack_react_table from '@tanstack/react-table';
7
7
  import { SortingState, ColumnFiltersState, VisibilityState } from '@tanstack/react-table';
8
8
 
9
+ interface ColumnFilterProps {
10
+ columnId: string;
11
+ columnName: string;
12
+ stats: ColumnStats;
13
+ selectedValues: string[];
14
+ sortDirection: 'asc' | 'desc' | null;
15
+ /** Current numeric range filter (if any) */
16
+ numericRange?: NumericRange | null;
17
+ onFilter: (values: string[]) => void;
18
+ onSort: (direction: 'asc' | 'desc' | null) => void;
19
+ onClose: () => void;
20
+ /** Called when a numeric range filter is applied */
21
+ onRangeFilter?: (range: NumericRange | null) => void;
22
+ }
23
+ declare function ColumnFilter({ columnName, stats, selectedValues, sortDirection, numericRange, onFilter, onSort, onClose, onRangeFilter, }: ColumnFilterProps): react_jsx_runtime.JSX.Element;
24
+
9
25
  interface DataGridProps {
10
26
  data: Record<string, unknown>[];
11
27
  loading?: boolean;
@@ -50,22 +66,6 @@ interface DataGridProps {
50
66
  }
51
67
  declare function DataGrid({ data, loading, fontSize: initialFontSize, showPivot, enableExport, enableSearch, enablePagination, pageSize, enableColumnResize, enableClipboard, theme, stripedRows, exportFilename, enableVerticalResize, initialHeight, minHeight, maxHeight, onCellClick, onExport, onCopy, }: DataGridProps): react_jsx_runtime.JSX.Element;
52
68
 
53
- interface ColumnFilterProps {
54
- columnId: string;
55
- columnName: string;
56
- stats: ColumnStats;
57
- selectedValues: string[];
58
- sortDirection: 'asc' | 'desc' | null;
59
- /** Current numeric range filter (if any) */
60
- numericRange?: NumericRange | null;
61
- onFilter: (values: string[]) => void;
62
- onSort: (direction: 'asc' | 'desc' | null) => void;
63
- onClose: () => void;
64
- /** Called when a numeric range filter is applied */
65
- onRangeFilter?: (range: NumericRange | null) => void;
66
- }
67
- declare function ColumnFilter({ columnName, stats, selectedValues, sortDirection, numericRange, onFilter, onSort, onClose, onRangeFilter, }: ColumnFilterProps): react_jsx_runtime.JSX.Element;
68
-
69
69
  interface PivotConfigProps {
70
70
  availableFields: FieldStats[];
71
71
  rowFields: string[];
@@ -169,65 +169,6 @@ declare function useExcelGrid<T extends Record<string, unknown>>(options: ExcelG
169
169
  getNumericRangeFilter: (columnId: string) => NumericRange | null;
170
170
  };
171
171
 
172
- interface UsePivotTableReturn {
173
- rowFields: string[];
174
- columnFields: string[];
175
- valueFields: PivotValueField[];
176
- showRowTotals: boolean;
177
- showColumnTotals: boolean;
178
- calculatedFields: CalculatedField[];
179
- availableFields: FieldStats[];
180
- unassignedFields: FieldStats[];
181
- isConfigured: boolean;
182
- pivotResult: PivotResult | null;
183
- addRowField: (field: string) => void;
184
- removeRowField: (field: string) => void;
185
- addColumnField: (field: string) => void;
186
- removeColumnField: (field: string) => void;
187
- addValueField: (field: string, aggregation?: AggregationFunction) => void;
188
- removeValueField: (field: string, aggregation?: AggregationFunction) => void;
189
- updateValueFieldAggregation: (field: string, oldAgg: AggregationFunction, newAgg: AggregationFunction) => void;
190
- clearConfig: () => void;
191
- setShowRowTotals: (value: boolean) => void;
192
- setShowColumnTotals: (value: boolean) => void;
193
- autoSuggestConfig: () => void;
194
- setRowFields: (fields: string[]) => void;
195
- setColumnFields: (fields: string[]) => void;
196
- addCalculatedField: (field: CalculatedField) => void;
197
- removeCalculatedField: (id: string) => void;
198
- }
199
- /**
200
- * Main pivot table hook
201
- */
202
- declare function usePivotTable(data: Record<string, unknown>[]): UsePivotTableReturn;
203
-
204
- /**
205
- * Set the license key for the library
206
- */
207
- declare function setLicenseKey(key: string): Promise<void>;
208
- /**
209
- * Enable demo mode - requires the correct demo secret
210
- * Returns true if activation succeeded, false if secret was invalid
211
- */
212
- declare function enableDemoMode(secret: string): Promise<boolean>;
213
- /**
214
- * Configure the license secret
215
- */
216
- declare function configureLicenseSecret(secret: string): void;
217
- /**
218
- * Hook for accessing license information
219
- */
220
- declare function useLicense(): {
221
- licenseInfo: LicenseInfo;
222
- isDemo: boolean;
223
- isPro: boolean;
224
- canUsePivot: boolean;
225
- canUseAdvancedAggregations: boolean;
226
- canUsePercentageMode: boolean;
227
- showWatermark: boolean;
228
- requirePro: (feature: string) => boolean;
229
- };
230
-
231
172
  declare function exportToCSV<T extends Record<string, unknown>>(data: T[], columns: string[], options?: ExportOptions): void;
232
173
  declare function exportPivotToCSV(pivotData: PivotExportData, rowFields: string[], columnFields: string[], valueFields: PivotValueField[], options?: ExportOptions): void;
233
174
  declare function copyToClipboard(text: string, onSuccess?: () => void, onError?: (err: Error) => void): void;
@@ -290,4 +231,63 @@ declare function useColumnResize(initialWidths: Record<string, number>, minWidth
290
231
  resetAllWidths: () => void;
291
232
  };
292
233
 
234
+ /**
235
+ * Set the license key for the library
236
+ */
237
+ declare function setLicenseKey(key: string): Promise<void>;
238
+ /**
239
+ * Enable demo mode - requires the correct demo secret
240
+ * Returns true if activation succeeded, false if secret was invalid
241
+ */
242
+ declare function enableDemoMode(secret: string): Promise<boolean>;
243
+ /**
244
+ * Configure the license secret
245
+ */
246
+ declare function configureLicenseSecret(secret: string): void;
247
+ /**
248
+ * Hook for accessing license information
249
+ */
250
+ declare function useLicense(): {
251
+ licenseInfo: LicenseInfo;
252
+ isDemo: boolean;
253
+ isPro: boolean;
254
+ canUsePivot: boolean;
255
+ canUseAdvancedAggregations: boolean;
256
+ canUsePercentageMode: boolean;
257
+ showWatermark: boolean;
258
+ requirePro: (feature: string) => boolean;
259
+ };
260
+
261
+ interface UsePivotTableReturn {
262
+ rowFields: string[];
263
+ columnFields: string[];
264
+ valueFields: PivotValueField[];
265
+ showRowTotals: boolean;
266
+ showColumnTotals: boolean;
267
+ calculatedFields: CalculatedField[];
268
+ availableFields: FieldStats[];
269
+ unassignedFields: FieldStats[];
270
+ isConfigured: boolean;
271
+ pivotResult: PivotResult | null;
272
+ addRowField: (field: string) => void;
273
+ removeRowField: (field: string) => void;
274
+ addColumnField: (field: string) => void;
275
+ removeColumnField: (field: string) => void;
276
+ addValueField: (field: string, aggregation?: AggregationFunction) => void;
277
+ removeValueField: (field: string, aggregation?: AggregationFunction) => void;
278
+ updateValueFieldAggregation: (field: string, oldAgg: AggregationFunction, newAgg: AggregationFunction) => void;
279
+ clearConfig: () => void;
280
+ setShowRowTotals: (value: boolean) => void;
281
+ setShowColumnTotals: (value: boolean) => void;
282
+ autoSuggestConfig: () => void;
283
+ setRowFields: (fields: string[]) => void;
284
+ setColumnFields: (fields: string[]) => void;
285
+ addCalculatedField: (field: CalculatedField) => void;
286
+ removeCalculatedField: (id: string) => void;
287
+ }
288
+ /**
289
+ * Main pivot table hook
290
+ */
291
+ declare function usePivotTable(data: Record<string, unknown>[]): UsePivotTableReturn;
292
+
293
293
  export { ColumnFilter, DataGrid, PivotConfig, PivotSkeleton, configureLicenseSecret, copyToClipboard, enableDemoMode, exportPivotToCSV, exportToCSV, formatSelectionForClipboard, setLicenseKey, useColumnResize, useExcelGrid, useGlobalSearch, useLicense, usePagination, usePivotTable, useRowSelection };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,27 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ColumnStats, NumericRange, FieldStats, PivotValueField, CalculatedField, AggregationFunction, PivotResult, LicenseInfo, ExportOptions, PivotExportData, SelectionBounds, PaginationOptions } from '@smallwebco/tinypivot-core';
1
+ import { ColumnStats, NumericRange, FieldStats, PivotValueField, CalculatedField, AggregationFunction, PivotResult, PivotExportData, ExportOptions, SelectionBounds, PaginationOptions, LicenseInfo } from '@smallwebco/tinypivot-core';
3
2
  export { AggregationFunction, CellClickEvent, ColumnStats, CopyEvent, DataGridProps, ExportEvent, ExportOptions, FieldStats, FilterEvent, GridOptions, LicenseInfo, LicenseType, PaginationOptions, PivotCell, PivotConfig as PivotConfigType, PivotField, PivotResult, PivotTableProps, PivotValueField, RowSelectionChangeEvent, SelectionBounds, SelectionChangeEvent, SortEvent, formatCellValue, getAggregationLabel, getColumnUniqueValues } from '@smallwebco/tinypivot-core';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default from 'react';
6
6
  import * as _tanstack_react_table from '@tanstack/react-table';
7
7
  import { SortingState, ColumnFiltersState, VisibilityState } from '@tanstack/react-table';
8
8
 
9
+ interface ColumnFilterProps {
10
+ columnId: string;
11
+ columnName: string;
12
+ stats: ColumnStats;
13
+ selectedValues: string[];
14
+ sortDirection: 'asc' | 'desc' | null;
15
+ /** Current numeric range filter (if any) */
16
+ numericRange?: NumericRange | null;
17
+ onFilter: (values: string[]) => void;
18
+ onSort: (direction: 'asc' | 'desc' | null) => void;
19
+ onClose: () => void;
20
+ /** Called when a numeric range filter is applied */
21
+ onRangeFilter?: (range: NumericRange | null) => void;
22
+ }
23
+ declare function ColumnFilter({ columnName, stats, selectedValues, sortDirection, numericRange, onFilter, onSort, onClose, onRangeFilter, }: ColumnFilterProps): react_jsx_runtime.JSX.Element;
24
+
9
25
  interface DataGridProps {
10
26
  data: Record<string, unknown>[];
11
27
  loading?: boolean;
@@ -50,22 +66,6 @@ interface DataGridProps {
50
66
  }
51
67
  declare function DataGrid({ data, loading, fontSize: initialFontSize, showPivot, enableExport, enableSearch, enablePagination, pageSize, enableColumnResize, enableClipboard, theme, stripedRows, exportFilename, enableVerticalResize, initialHeight, minHeight, maxHeight, onCellClick, onExport, onCopy, }: DataGridProps): react_jsx_runtime.JSX.Element;
52
68
 
53
- interface ColumnFilterProps {
54
- columnId: string;
55
- columnName: string;
56
- stats: ColumnStats;
57
- selectedValues: string[];
58
- sortDirection: 'asc' | 'desc' | null;
59
- /** Current numeric range filter (if any) */
60
- numericRange?: NumericRange | null;
61
- onFilter: (values: string[]) => void;
62
- onSort: (direction: 'asc' | 'desc' | null) => void;
63
- onClose: () => void;
64
- /** Called when a numeric range filter is applied */
65
- onRangeFilter?: (range: NumericRange | null) => void;
66
- }
67
- declare function ColumnFilter({ columnName, stats, selectedValues, sortDirection, numericRange, onFilter, onSort, onClose, onRangeFilter, }: ColumnFilterProps): react_jsx_runtime.JSX.Element;
68
-
69
69
  interface PivotConfigProps {
70
70
  availableFields: FieldStats[];
71
71
  rowFields: string[];
@@ -169,65 +169,6 @@ declare function useExcelGrid<T extends Record<string, unknown>>(options: ExcelG
169
169
  getNumericRangeFilter: (columnId: string) => NumericRange | null;
170
170
  };
171
171
 
172
- interface UsePivotTableReturn {
173
- rowFields: string[];
174
- columnFields: string[];
175
- valueFields: PivotValueField[];
176
- showRowTotals: boolean;
177
- showColumnTotals: boolean;
178
- calculatedFields: CalculatedField[];
179
- availableFields: FieldStats[];
180
- unassignedFields: FieldStats[];
181
- isConfigured: boolean;
182
- pivotResult: PivotResult | null;
183
- addRowField: (field: string) => void;
184
- removeRowField: (field: string) => void;
185
- addColumnField: (field: string) => void;
186
- removeColumnField: (field: string) => void;
187
- addValueField: (field: string, aggregation?: AggregationFunction) => void;
188
- removeValueField: (field: string, aggregation?: AggregationFunction) => void;
189
- updateValueFieldAggregation: (field: string, oldAgg: AggregationFunction, newAgg: AggregationFunction) => void;
190
- clearConfig: () => void;
191
- setShowRowTotals: (value: boolean) => void;
192
- setShowColumnTotals: (value: boolean) => void;
193
- autoSuggestConfig: () => void;
194
- setRowFields: (fields: string[]) => void;
195
- setColumnFields: (fields: string[]) => void;
196
- addCalculatedField: (field: CalculatedField) => void;
197
- removeCalculatedField: (id: string) => void;
198
- }
199
- /**
200
- * Main pivot table hook
201
- */
202
- declare function usePivotTable(data: Record<string, unknown>[]): UsePivotTableReturn;
203
-
204
- /**
205
- * Set the license key for the library
206
- */
207
- declare function setLicenseKey(key: string): Promise<void>;
208
- /**
209
- * Enable demo mode - requires the correct demo secret
210
- * Returns true if activation succeeded, false if secret was invalid
211
- */
212
- declare function enableDemoMode(secret: string): Promise<boolean>;
213
- /**
214
- * Configure the license secret
215
- */
216
- declare function configureLicenseSecret(secret: string): void;
217
- /**
218
- * Hook for accessing license information
219
- */
220
- declare function useLicense(): {
221
- licenseInfo: LicenseInfo;
222
- isDemo: boolean;
223
- isPro: boolean;
224
- canUsePivot: boolean;
225
- canUseAdvancedAggregations: boolean;
226
- canUsePercentageMode: boolean;
227
- showWatermark: boolean;
228
- requirePro: (feature: string) => boolean;
229
- };
230
-
231
172
  declare function exportToCSV<T extends Record<string, unknown>>(data: T[], columns: string[], options?: ExportOptions): void;
232
173
  declare function exportPivotToCSV(pivotData: PivotExportData, rowFields: string[], columnFields: string[], valueFields: PivotValueField[], options?: ExportOptions): void;
233
174
  declare function copyToClipboard(text: string, onSuccess?: () => void, onError?: (err: Error) => void): void;
@@ -290,4 +231,63 @@ declare function useColumnResize(initialWidths: Record<string, number>, minWidth
290
231
  resetAllWidths: () => void;
291
232
  };
292
233
 
234
+ /**
235
+ * Set the license key for the library
236
+ */
237
+ declare function setLicenseKey(key: string): Promise<void>;
238
+ /**
239
+ * Enable demo mode - requires the correct demo secret
240
+ * Returns true if activation succeeded, false if secret was invalid
241
+ */
242
+ declare function enableDemoMode(secret: string): Promise<boolean>;
243
+ /**
244
+ * Configure the license secret
245
+ */
246
+ declare function configureLicenseSecret(secret: string): void;
247
+ /**
248
+ * Hook for accessing license information
249
+ */
250
+ declare function useLicense(): {
251
+ licenseInfo: LicenseInfo;
252
+ isDemo: boolean;
253
+ isPro: boolean;
254
+ canUsePivot: boolean;
255
+ canUseAdvancedAggregations: boolean;
256
+ canUsePercentageMode: boolean;
257
+ showWatermark: boolean;
258
+ requirePro: (feature: string) => boolean;
259
+ };
260
+
261
+ interface UsePivotTableReturn {
262
+ rowFields: string[];
263
+ columnFields: string[];
264
+ valueFields: PivotValueField[];
265
+ showRowTotals: boolean;
266
+ showColumnTotals: boolean;
267
+ calculatedFields: CalculatedField[];
268
+ availableFields: FieldStats[];
269
+ unassignedFields: FieldStats[];
270
+ isConfigured: boolean;
271
+ pivotResult: PivotResult | null;
272
+ addRowField: (field: string) => void;
273
+ removeRowField: (field: string) => void;
274
+ addColumnField: (field: string) => void;
275
+ removeColumnField: (field: string) => void;
276
+ addValueField: (field: string, aggregation?: AggregationFunction) => void;
277
+ removeValueField: (field: string, aggregation?: AggregationFunction) => void;
278
+ updateValueFieldAggregation: (field: string, oldAgg: AggregationFunction, newAgg: AggregationFunction) => void;
279
+ clearConfig: () => void;
280
+ setShowRowTotals: (value: boolean) => void;
281
+ setShowColumnTotals: (value: boolean) => void;
282
+ autoSuggestConfig: () => void;
283
+ setRowFields: (fields: string[]) => void;
284
+ setColumnFields: (fields: string[]) => void;
285
+ addCalculatedField: (field: CalculatedField) => void;
286
+ removeCalculatedField: (id: string) => void;
287
+ }
288
+ /**
289
+ * Main pivot table hook
290
+ */
291
+ declare function usePivotTable(data: Record<string, unknown>[]): UsePivotTableReturn;
292
+
293
293
  export { ColumnFilter, DataGrid, PivotConfig, PivotSkeleton, configureLicenseSecret, copyToClipboard, enableDemoMode, exportPivotToCSV, exportToCSV, formatSelectionForClipboard, setLicenseKey, useColumnResize, useExcelGrid, useGlobalSearch, useLicense, usePagination, usePivotTable, useRowSelection };