@procore/data-table 14.9.0 → 14.11.0
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/CHANGELOG.md +23 -0
- package/dist/legacy/index.cjs +2184 -1924
- package/dist/legacy/index.d.cts +26 -4
- package/dist/legacy/index.d.ts +26 -4
- package/dist/legacy/index.js +1886 -1626
- package/dist/modern/index.cjs +2155 -1903
- package/dist/modern/index.d.cts +26 -4
- package/dist/modern/index.d.ts +26 -4
- package/dist/modern/index.js +1857 -1605
- package/package.json +6 -4
package/dist/modern/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _ag_grid_community_core from '@ag-grid-community/core';
|
|
2
|
-
import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, ColumnPinnedType, RowHeightParams, CheckboxSelectionCallbackParams, ExcelDataType, RowGroupOpenedEvent, Module, RowSelectedEvent, ColumnEverythingChangedEvent, GetRowIdParams, ColumnApi, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
|
|
2
|
+
import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, ColumnPinnedType, RowHeightParams, CheckboxSelectionCallbackParams, ExcelDataType, RowGroupOpenedEvent, Module, RowSelectedEvent, ColumnEverythingChangedEvent, TabToNextCellParams, CellPosition, GetRowIdParams, ColumnApi, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import { AgGridReactProps, AgReactUiProps } from '@ag-grid-community/react';
|
|
@@ -509,6 +509,9 @@ interface ColumnDefinition<TValue = any, TRenderer = React.FC<ICellRendererParam
|
|
|
509
509
|
autoHeight?: boolean;
|
|
510
510
|
wrapText?: boolean;
|
|
511
511
|
lockPosition?: ColDef['lockPosition'];
|
|
512
|
+
rowDrag?: boolean | ((params: {
|
|
513
|
+
node: RowNode;
|
|
514
|
+
}) => boolean);
|
|
512
515
|
}
|
|
513
516
|
interface ExtendedColDef extends ColDef {
|
|
514
517
|
bulkEditable?: ((params: IsEditableParams) => boolean) | boolean;
|
|
@@ -571,6 +574,10 @@ interface TableApi {
|
|
|
571
574
|
* @private
|
|
572
575
|
*/
|
|
573
576
|
getCellEditorInstances: () => ICellEditor[];
|
|
577
|
+
/**
|
|
578
|
+
* Returns an array of transformed visible row nodes
|
|
579
|
+
*/
|
|
580
|
+
getVisibleRowNodes: () => RowNode[];
|
|
574
581
|
/**
|
|
575
582
|
* Get the sorted leaf and group nodes remaining after filtering. Note: This only works for tables using the client side row model.
|
|
576
583
|
*/
|
|
@@ -645,7 +652,7 @@ interface TableApi {
|
|
|
645
652
|
*/
|
|
646
653
|
setIsRowSelectable?(isRowSelectableFunc: IsRowSelectable): void;
|
|
647
654
|
}
|
|
648
|
-
type PartialTableApi = Pick<TableApi, 'applyTransaction' | 'applyServerSideTransaction' | 'collapseAll' | 'deselectAll' | 'expandAll' | 'getColumnDefinitions' | 'getDetailGridTableApi' | 'getFilteredAndSortedRowNodes' | 'getRootAggregateData' | 'getRowData' | 'getSelectedRows' | 'getServerSideSelectionState' | 'getTableConfiguration' | 'refreshCells' | 'scrollToRow' | 'selectAll' | 'setPinnedBottomRowData' | 'setRowData' | 'setRowNodeExpanded' | 'sizeColumnsToFit'>;
|
|
655
|
+
type PartialTableApi = Pick<TableApi, 'applyTransaction' | 'applyServerSideTransaction' | 'collapseAll' | 'deselectAll' | 'expandAll' | 'getColumnDefinitions' | 'getDetailGridTableApi' | 'getFilteredAndSortedRowNodes' | 'getVisibleRowNodes' | 'getRootAggregateData' | 'getRowData' | 'getSelectedRows' | 'getServerSideSelectionState' | 'getTableConfiguration' | 'refreshCells' | 'scrollToRow' | 'selectAll' | 'setPinnedBottomRowData' | 'setRowData' | 'setRowNodeExpanded' | 'sizeColumnsToFit'>;
|
|
649
656
|
type AgDomLayout = 'normal' | 'autoHeight' | 'print' | undefined;
|
|
650
657
|
interface IsRowSelectable {
|
|
651
658
|
(node: RowNode): boolean;
|
|
@@ -989,6 +996,10 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
989
996
|
suppressResetColumnsOption?: boolean;
|
|
990
997
|
suppressRowClickSelection?: boolean;
|
|
991
998
|
stickyExpandedGroupRows?: boolean;
|
|
999
|
+
/**
|
|
1000
|
+
* Allows overriding the default behaviour for when user hits Tab key when a cell is focused
|
|
1001
|
+
*/
|
|
1002
|
+
tabToNextCell?: (params: TabToNextCellParams<any, any>) => CellPosition | null;
|
|
992
1003
|
}
|
|
993
1004
|
type AggregationFunction<TValue> = (params: {
|
|
994
1005
|
columnDefinition: ColumnDefinition;
|
|
@@ -1156,7 +1167,11 @@ interface IFilterProps<Opt = any, Val = number | string | null> {
|
|
|
1156
1167
|
headerName: string;
|
|
1157
1168
|
value: Val extends string ? string[] : Val extends number ? number[] : unknown[];
|
|
1158
1169
|
}) => React.FunctionComponent | string;
|
|
1159
|
-
getFilterOptions?: (
|
|
1170
|
+
getFilterOptions?: (params?: {
|
|
1171
|
+
currentOffset?: number;
|
|
1172
|
+
searchQuery?: string;
|
|
1173
|
+
}) => Promise<Opt[] | IFilterOptions<Opt>>;
|
|
1174
|
+
onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
1160
1175
|
getId?: (option: Opt) => Val extends string ? string : Val extends number ? number : unknown;
|
|
1161
1176
|
getLabel?: (option: Opt) => string;
|
|
1162
1177
|
groupName?: string;
|
|
@@ -1188,6 +1203,8 @@ interface FilterComponentProps<Opt = any, Val = Opt[] | NumberFilterModel> {
|
|
|
1188
1203
|
getOptions?: () => Promise<boolean>;
|
|
1189
1204
|
loading: boolean;
|
|
1190
1205
|
onChange: (value: Opt[] | NumberFilterModel | undefined) => void;
|
|
1206
|
+
onScrollBottom?: () => void;
|
|
1207
|
+
onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
1191
1208
|
onRemove: () => void;
|
|
1192
1209
|
options: Opt[];
|
|
1193
1210
|
value: Val;
|
|
@@ -1220,6 +1237,10 @@ interface IFilterState<Opt = any, Val = number | string> {
|
|
|
1220
1237
|
interface IServerFiltersState {
|
|
1221
1238
|
[field: string]: IFilterState;
|
|
1222
1239
|
}
|
|
1240
|
+
interface IFilterOptions<UniversalOpt = any> {
|
|
1241
|
+
options: UniversalOpt[];
|
|
1242
|
+
totalOptions: number;
|
|
1243
|
+
}
|
|
1223
1244
|
interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
|
|
1224
1245
|
hasDefinedFilters: boolean;
|
|
1225
1246
|
hasSelectedFilters: boolean;
|
|
@@ -1227,6 +1248,7 @@ interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
|
|
|
1227
1248
|
getSelected: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
|
|
1228
1249
|
getListFilter: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
|
|
1229
1250
|
selectedFilters: IServerFiltersState;
|
|
1251
|
+
getTotalOptions: (field: string) => number;
|
|
1230
1252
|
onChangeFilterValue: ({ field, value, }: {
|
|
1231
1253
|
field: string;
|
|
1232
1254
|
value: any;
|
|
@@ -1235,7 +1257,7 @@ interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
|
|
|
1235
1257
|
onClearAllFilters: React.MouseEventHandler<HTMLButtonElement>;
|
|
1236
1258
|
possibleFilters: string[];
|
|
1237
1259
|
setSelectedFilters: (filters: IServerFilter[]) => void;
|
|
1238
|
-
waitForStoredOptions: (field: string) => Promise<void>;
|
|
1260
|
+
waitForStoredOptions: (field: string, search?: string) => Promise<void>;
|
|
1239
1261
|
filtersState: IServerFilter[];
|
|
1240
1262
|
}
|
|
1241
1263
|
|
package/dist/modern/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _ag_grid_community_core from '@ag-grid-community/core';
|
|
2
|
-
import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, ColumnPinnedType, RowHeightParams, CheckboxSelectionCallbackParams, ExcelDataType, RowGroupOpenedEvent, Module, RowSelectedEvent, ColumnEverythingChangedEvent, GetRowIdParams, ColumnApi, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
|
|
2
|
+
import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, ColumnPinnedType, RowHeightParams, CheckboxSelectionCallbackParams, ExcelDataType, RowGroupOpenedEvent, Module, RowSelectedEvent, ColumnEverythingChangedEvent, TabToNextCellParams, CellPosition, GetRowIdParams, ColumnApi, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import { AgGridReactProps, AgReactUiProps } from '@ag-grid-community/react';
|
|
@@ -509,6 +509,9 @@ interface ColumnDefinition<TValue = any, TRenderer = React.FC<ICellRendererParam
|
|
|
509
509
|
autoHeight?: boolean;
|
|
510
510
|
wrapText?: boolean;
|
|
511
511
|
lockPosition?: ColDef['lockPosition'];
|
|
512
|
+
rowDrag?: boolean | ((params: {
|
|
513
|
+
node: RowNode;
|
|
514
|
+
}) => boolean);
|
|
512
515
|
}
|
|
513
516
|
interface ExtendedColDef extends ColDef {
|
|
514
517
|
bulkEditable?: ((params: IsEditableParams) => boolean) | boolean;
|
|
@@ -571,6 +574,10 @@ interface TableApi {
|
|
|
571
574
|
* @private
|
|
572
575
|
*/
|
|
573
576
|
getCellEditorInstances: () => ICellEditor[];
|
|
577
|
+
/**
|
|
578
|
+
* Returns an array of transformed visible row nodes
|
|
579
|
+
*/
|
|
580
|
+
getVisibleRowNodes: () => RowNode[];
|
|
574
581
|
/**
|
|
575
582
|
* Get the sorted leaf and group nodes remaining after filtering. Note: This only works for tables using the client side row model.
|
|
576
583
|
*/
|
|
@@ -645,7 +652,7 @@ interface TableApi {
|
|
|
645
652
|
*/
|
|
646
653
|
setIsRowSelectable?(isRowSelectableFunc: IsRowSelectable): void;
|
|
647
654
|
}
|
|
648
|
-
type PartialTableApi = Pick<TableApi, 'applyTransaction' | 'applyServerSideTransaction' | 'collapseAll' | 'deselectAll' | 'expandAll' | 'getColumnDefinitions' | 'getDetailGridTableApi' | 'getFilteredAndSortedRowNodes' | 'getRootAggregateData' | 'getRowData' | 'getSelectedRows' | 'getServerSideSelectionState' | 'getTableConfiguration' | 'refreshCells' | 'scrollToRow' | 'selectAll' | 'setPinnedBottomRowData' | 'setRowData' | 'setRowNodeExpanded' | 'sizeColumnsToFit'>;
|
|
655
|
+
type PartialTableApi = Pick<TableApi, 'applyTransaction' | 'applyServerSideTransaction' | 'collapseAll' | 'deselectAll' | 'expandAll' | 'getColumnDefinitions' | 'getDetailGridTableApi' | 'getFilteredAndSortedRowNodes' | 'getVisibleRowNodes' | 'getRootAggregateData' | 'getRowData' | 'getSelectedRows' | 'getServerSideSelectionState' | 'getTableConfiguration' | 'refreshCells' | 'scrollToRow' | 'selectAll' | 'setPinnedBottomRowData' | 'setRowData' | 'setRowNodeExpanded' | 'sizeColumnsToFit'>;
|
|
649
656
|
type AgDomLayout = 'normal' | 'autoHeight' | 'print' | undefined;
|
|
650
657
|
interface IsRowSelectable {
|
|
651
658
|
(node: RowNode): boolean;
|
|
@@ -989,6 +996,10 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
989
996
|
suppressResetColumnsOption?: boolean;
|
|
990
997
|
suppressRowClickSelection?: boolean;
|
|
991
998
|
stickyExpandedGroupRows?: boolean;
|
|
999
|
+
/**
|
|
1000
|
+
* Allows overriding the default behaviour for when user hits Tab key when a cell is focused
|
|
1001
|
+
*/
|
|
1002
|
+
tabToNextCell?: (params: TabToNextCellParams<any, any>) => CellPosition | null;
|
|
992
1003
|
}
|
|
993
1004
|
type AggregationFunction<TValue> = (params: {
|
|
994
1005
|
columnDefinition: ColumnDefinition;
|
|
@@ -1156,7 +1167,11 @@ interface IFilterProps<Opt = any, Val = number | string | null> {
|
|
|
1156
1167
|
headerName: string;
|
|
1157
1168
|
value: Val extends string ? string[] : Val extends number ? number[] : unknown[];
|
|
1158
1169
|
}) => React.FunctionComponent | string;
|
|
1159
|
-
getFilterOptions?: (
|
|
1170
|
+
getFilterOptions?: (params?: {
|
|
1171
|
+
currentOffset?: number;
|
|
1172
|
+
searchQuery?: string;
|
|
1173
|
+
}) => Promise<Opt[] | IFilterOptions<Opt>>;
|
|
1174
|
+
onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
1160
1175
|
getId?: (option: Opt) => Val extends string ? string : Val extends number ? number : unknown;
|
|
1161
1176
|
getLabel?: (option: Opt) => string;
|
|
1162
1177
|
groupName?: string;
|
|
@@ -1188,6 +1203,8 @@ interface FilterComponentProps<Opt = any, Val = Opt[] | NumberFilterModel> {
|
|
|
1188
1203
|
getOptions?: () => Promise<boolean>;
|
|
1189
1204
|
loading: boolean;
|
|
1190
1205
|
onChange: (value: Opt[] | NumberFilterModel | undefined) => void;
|
|
1206
|
+
onScrollBottom?: () => void;
|
|
1207
|
+
onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
1191
1208
|
onRemove: () => void;
|
|
1192
1209
|
options: Opt[];
|
|
1193
1210
|
value: Val;
|
|
@@ -1220,6 +1237,10 @@ interface IFilterState<Opt = any, Val = number | string> {
|
|
|
1220
1237
|
interface IServerFiltersState {
|
|
1221
1238
|
[field: string]: IFilterState;
|
|
1222
1239
|
}
|
|
1240
|
+
interface IFilterOptions<UniversalOpt = any> {
|
|
1241
|
+
options: UniversalOpt[];
|
|
1242
|
+
totalOptions: number;
|
|
1243
|
+
}
|
|
1223
1244
|
interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
|
|
1224
1245
|
hasDefinedFilters: boolean;
|
|
1225
1246
|
hasSelectedFilters: boolean;
|
|
@@ -1227,6 +1248,7 @@ interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
|
|
|
1227
1248
|
getSelected: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
|
|
1228
1249
|
getListFilter: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
|
|
1229
1250
|
selectedFilters: IServerFiltersState;
|
|
1251
|
+
getTotalOptions: (field: string) => number;
|
|
1230
1252
|
onChangeFilterValue: ({ field, value, }: {
|
|
1231
1253
|
field: string;
|
|
1232
1254
|
value: any;
|
|
@@ -1235,7 +1257,7 @@ interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
|
|
|
1235
1257
|
onClearAllFilters: React.MouseEventHandler<HTMLButtonElement>;
|
|
1236
1258
|
possibleFilters: string[];
|
|
1237
1259
|
setSelectedFilters: (filters: IServerFilter[]) => void;
|
|
1238
|
-
waitForStoredOptions: (field: string) => Promise<void>;
|
|
1260
|
+
waitForStoredOptions: (field: string, search?: string) => Promise<void>;
|
|
1239
1261
|
filtersState: IServerFilter[];
|
|
1240
1262
|
}
|
|
1241
1263
|
|