@procore/data-table 14.4.1 → 14.4.3-next.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.
Files changed (122) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/Analytics/Analytics.d.ts +18 -0
  3. package/dist/Analytics/Client.d.ts +10 -0
  4. package/dist/Analytics/index.d.ts +2 -0
  5. package/dist/Analytics/types.d.ts +21 -0
  6. package/dist/BulkActions/BulkActions.d.ts +10 -0
  7. package/dist/BulkActions/BulkEditActionButton.d.ts +6 -0
  8. package/dist/CellRenderers/AutoGroupCell.d.ts +15 -0
  9. package/dist/CellRenderers/BooleanCell.d.ts +18 -0
  10. package/dist/CellRenderers/ButtonsCell.d.ts +8 -0
  11. package/dist/CellRenderers/Cells.d.ts +19 -0
  12. package/dist/CellRenderers/CompanyCell.d.ts +15 -0
  13. package/dist/CellRenderers/CurrencyCell.d.ts +23 -0
  14. package/dist/CellRenderers/DataTableCell.d.ts +67 -0
  15. package/dist/CellRenderers/DateCell.d.ts +23 -0
  16. package/dist/CellRenderers/DateTimeCell.d.ts +21 -0
  17. package/dist/CellRenderers/FullWidthCell.d.ts +5 -0
  18. package/dist/CellRenderers/GrandTotalsLabel.d.ts +5 -0
  19. package/dist/CellRenderers/GroupCell.d.ts +34 -0
  20. package/dist/CellRenderers/InlineEditWrapper.d.ts +35 -0
  21. package/dist/CellRenderers/InlineError.d.ts +10 -0
  22. package/dist/CellRenderers/LinkCell.d.ts +13 -0
  23. package/dist/CellRenderers/MultiSelectCell.d.ts +20 -0
  24. package/dist/CellRenderers/NumberCell.d.ts +21 -0
  25. package/dist/CellRenderers/PeopleCell.d.ts +18 -0
  26. package/dist/CellRenderers/PercentCell.d.ts +23 -0
  27. package/dist/CellRenderers/PersonCell.d.ts +17 -0
  28. package/dist/CellRenderers/PillCell.d.ts +22 -0
  29. package/dist/CellRenderers/RowActionsCell.d.ts +16 -0
  30. package/dist/CellRenderers/RowCheckbox.d.ts +9 -0
  31. package/dist/CellRenderers/SelectCell.d.ts +27 -0
  32. package/dist/CellRenderers/TextAreaCell.d.ts +18 -0
  33. package/dist/CellRenderers/TextCell.d.ts +18 -0
  34. package/dist/CellRenderers/index.d.ts +16 -0
  35. package/dist/ClientSideDataTable.d.ts +25 -0
  36. package/dist/DataTable.d.ts +36 -0
  37. package/dist/EmptyState.d.ts +12 -0
  38. package/dist/FilterRenderers/ClientSideFilter.d.ts +11 -0
  39. package/dist/FilterRenderers/DateFilterRenderer.d.ts +47 -0
  40. package/dist/FilterRenderers/LocationFilterRenderer.d.ts +9 -0
  41. package/dist/FilterRenderers/MultiSelectFilterRenderer.d.ts +7 -0
  42. package/dist/FilterRenderers/NumberFilterRenderer.d.ts +23 -0
  43. package/dist/FilterRenderers/ServerSideFilter.d.ts +3 -0
  44. package/dist/FilterRenderers/index.d.ts +114 -0
  45. package/dist/FilterRenderers/useServerSideFilter.d.ts +16 -0
  46. package/dist/FilterRenderers/useServerSideFilterStorage.d.ts +3 -0
  47. package/dist/FilterRenderers/utils.d.ts +7 -0
  48. package/dist/GenericHeader/GenericColumnGroupHeader.d.ts +15 -0
  49. package/dist/GenericHeader/GenericHeader.d.ts +27 -0
  50. package/dist/Panels/BulkEdit.d.ts +65 -0
  51. package/dist/Panels/Configuration.d.ts +8 -0
  52. package/dist/Panels/Filters.d.ts +10 -0
  53. package/dist/Panels/StyledPanelSection.d.ts +4 -0
  54. package/dist/Panels/helpers.d.ts +12 -0
  55. package/dist/Panels/useContextPanel.d.ts +2 -0
  56. package/dist/QuickControls/ConfigPanelButton.d.ts +2 -0
  57. package/dist/QuickControls/EmptyResultsControlTooltip.d.ts +6 -0
  58. package/dist/QuickControls/FiltersPanelToggleButton.d.ts +9 -0
  59. package/dist/QuickControls/QuickControls.d.ts +8 -0
  60. package/dist/QuickControls/QuickFilters.d.ts +12 -0
  61. package/dist/QuickControls/RowGroupSelector.d.ts +5 -0
  62. package/dist/QuickControls/Search.d.ts +9 -0
  63. package/dist/QuickControls/ServerSideSearch.d.ts +13 -0
  64. package/dist/QuickFilterRenderers/DateQuickFilterRenderer.d.ts +30 -0
  65. package/dist/QuickFilterRenderers/LocationQuickFilterRenderer.d.ts +4 -0
  66. package/dist/QuickFilterRenderers/MultiSelectQuickFilterRenderer.d.ts +7 -0
  67. package/dist/QuickFilterRenderers/QuickFilterLabel.d.ts +13 -0
  68. package/dist/QuickFilterRenderers/SingleSelectQuickFilterRenderer.d.ts +19 -0
  69. package/dist/QuickFilterRenderers/SuperSelectFilterPreset.d.ts +8 -0
  70. package/dist/QuickFilterRenderers/index.d.ts +4 -0
  71. package/dist/QuickFilterRenderers/types.d.ts +16 -0
  72. package/dist/QuickFilterRenderers/utils.d.ts +6 -0
  73. package/dist/ServerSideDataTable.d.ts +25 -0
  74. package/dist/constants.d.ts +21 -0
  75. package/dist/icons.d.ts +1 -0
  76. package/dist/index.d.ts +24 -0
  77. package/dist/index.js +220 -0
  78. package/dist/index.js.LICENSE.txt +60 -0
  79. package/dist/state/useFilterState.d.ts +36 -0
  80. package/dist/state/useRowSelectionState.d.ts +8 -0
  81. package/dist/types.d.ts +684 -0
  82. package/dist/utils/ContactItem.d.ts +12 -0
  83. package/dist/utils/RadioList.d.ts +12 -0
  84. package/dist/utils/addSubcomponents.d.ts +3 -0
  85. package/dist/utils/adjustRowDragIcon.d.ts +2 -0
  86. package/dist/utils/aggData.d.ts +3 -0
  87. package/dist/utils/aggregationFunctions.d.ts +2 -0
  88. package/dist/utils/buildDetailRows.d.ts +14 -0
  89. package/dist/utils/cellHelpers.d.ts +25 -0
  90. package/dist/utils/columnDefHelpers.d.ts +10 -0
  91. package/dist/utils/columnMenuHelpers.d.ts +11 -0
  92. package/dist/utils/companyOptionRenderer.d.ts +3 -0
  93. package/dist/utils/findNode.d.ts +6 -0
  94. package/dist/utils/generateHTMLString.d.ts +23 -0
  95. package/dist/utils/genericAnalyticsClient.d.ts +19 -0
  96. package/dist/utils/getCellValueTypographyProps.d.ts +5 -0
  97. package/dist/utils/getRootRowNode.d.ts +2 -0
  98. package/dist/utils/helpers.d.ts +14 -0
  99. package/dist/utils/internalTableContext.d.ts +45 -0
  100. package/dist/utils/isEmptyValue.d.ts +1 -0
  101. package/dist/utils/logger.d.ts +5 -0
  102. package/dist/utils/pagination.d.ts +5 -0
  103. package/dist/utils/personOptionRenderer.d.ts +3 -0
  104. package/dist/utils/rowSelectionHelpers.d.ts +54 -0
  105. package/dist/utils/serverSideSharedTestHelpers.d.ts +237 -0
  106. package/dist/utils/setSiblingGroupsRowSelection.d.ts +2 -0
  107. package/dist/utils/sort.d.ts +7 -0
  108. package/dist/utils/sortFilters.d.ts +2 -0
  109. package/dist/utils/test/i18n.d.ts +4 -0
  110. package/dist/utils/transformers.d.ts +25 -0
  111. package/dist/utils/translations.d.ts +1990 -0
  112. package/dist/utils/useTableApi.d.ts +14 -0
  113. package/dist/utils/waitForAsyncCondition.d.ts +1 -0
  114. package/package.json +10 -10
  115. package/dist/legacy/index.d.mts +0 -1399
  116. package/dist/legacy/index.d.ts +0 -1399
  117. package/dist/legacy/index.js +0 -88331
  118. package/dist/legacy/index.mjs +0 -88272
  119. package/dist/modern/index.d.mts +0 -1399
  120. package/dist/modern/index.d.ts +0 -1399
  121. package/dist/modern/index.js +0 -88101
  122. package/dist/modern/index.mjs +0 -88042
@@ -0,0 +1,18 @@
1
+ import { TextAreaProps, TypographyProps } from '@procore/core-react';
2
+ import React from 'react';
3
+ import { ColumnDefinition, RowNode } from '../types';
4
+ import { DataTableCellEditorProps, DataTableCellRendererProps } from './DataTableCell';
5
+ export interface TextAreaCellRendererParams {
6
+ typographyProps?: TypographyProps;
7
+ }
8
+ export interface TextAreaCellEditorParams {
9
+ textAreaProps?: TextAreaProps;
10
+ }
11
+ export type TextAreaCellColumnDefinition<TValue = string, TFilterOption = any, TFilterValue = number | string> = ColumnDefinition<TValue, typeof TextAreaCellRenderer, TextAreaCellRendererParams, typeof TextAreaCellEditor, TextAreaCellEditorParams, TFilterOption, TFilterValue>;
12
+ export interface TextAreaCellRendererProps<TValue = string> extends DataTableCellRendererProps<TValue, TextAreaCellColumnDefinition<TValue>> {
13
+ node?: RowNode;
14
+ }
15
+ export interface TextAreaCellEditorProps<TValue = string> extends DataTableCellEditorProps<TValue, TextAreaCellColumnDefinition<TValue>> {
16
+ }
17
+ export declare const TextAreaCellEditor: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any>>;
18
+ export declare const TextAreaCellRenderer: React.FC<import("@ag-grid-community/core").ICellRendererParams<any, any, any>>;
@@ -0,0 +1,18 @@
1
+ import { InputProps, TypographyProps } from '@procore/core-react';
2
+ import React from 'react';
3
+ import { ColumnDefinition, RowNode } from '../types';
4
+ import { DataTableCellEditorProps, DataTableCellRendererProps } from './DataTableCell';
5
+ export interface TextCellRendererParams {
6
+ typographyProps?: TypographyProps;
7
+ }
8
+ export interface TextCellEditorParams {
9
+ inputProps?: InputProps;
10
+ }
11
+ export type TextCellColumnDefinition<TValue = string, TFilterOption = any, TFilterValue = number | string> = ColumnDefinition<TValue, typeof TextCellRenderer, TextCellRendererParams, typeof TextCellEditor, TextCellEditorParams, TFilterOption, TFilterValue>;
12
+ export interface TextCellRendererProps<TValue = string> extends DataTableCellRendererProps<TValue, TextCellColumnDefinition<TValue>> {
13
+ node?: RowNode;
14
+ }
15
+ export declare const TextCellRenderer: React.FC<import("@ag-grid-community/core").ICellRendererParams<any, any, any>>;
16
+ export interface TextCellEditorProps<TValue = string> extends DataTableCellEditorProps<TValue, TextCellColumnDefinition<TValue>> {
17
+ }
18
+ export declare const TextCellEditor: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any>>;
@@ -0,0 +1,16 @@
1
+ export { BooleanCellEditor, BooleanCellRenderer } from './BooleanCell';
2
+ export { ButtonsCellRenderer } from './ButtonsCell';
3
+ export { CompanyCellRenderer } from './CompanyCell';
4
+ export { CurrencyCellEditor, CurrencyCellRenderer } from './CurrencyCell';
5
+ export { DateCellEditor, DateCellRenderer } from './DateCell';
6
+ export { DateTimeCellEditor, DateTimeCellRenderer } from './DateTimeCell';
7
+ export { GroupCellRenderer } from './GroupCell';
8
+ export { LinkCellRenderer } from './LinkCell';
9
+ export { MultiSelectCellRenderer } from './MultiSelectCell';
10
+ export { NumberCellEditor, NumberCellRenderer } from './NumberCell';
11
+ export { PeopleCellRenderer } from './PeopleCell';
12
+ export { PercentCellEditor, PercentCellRenderer } from './PercentCell';
13
+ export { PersonCellRenderer } from './PersonCell';
14
+ export { PillCellRenderer, PillSelectCellEditor } from './PillCell';
15
+ export { SelectCellEditor, SelectCellRenderer } from './SelectCell';
16
+ export { TextCellEditor, TextCellRenderer } from './TextCell';
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { ClientSideDataTableProps, TableProps } from './types';
3
+ export declare const ClientSideDataTable: ({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, }: React.PropsWithChildren<ClientSideDataTableProps>) => React.JSX.Element;
4
+ export declare const Table: React.FC<Omit<TableProps, 'selectionSSREnabled' | 'modules'>>;
5
+ declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, }: React.PropsWithChildren<ClientSideDataTableProps>) => React.JSX.Element) & {
6
+ BulkActions: React.FunctionComponent<React.PropsWithChildren<import("./BulkActions/BulkActions").BulkActionProps>>;
7
+ BulkEditActionButton: React.FunctionComponent<import("./BulkActions/BulkEditActionButton").ActionButtonProps>;
8
+ ConfigPanelButton: React.FC<{}>;
9
+ ContextPanel: React.FC<import("./types").TablePanelProps>;
10
+ QuickControls: React.FunctionComponent<import("./QuickControls/QuickControls").QuickControlsProps>;
11
+ QuickFilters: React.FunctionComponent<{
12
+ overlayMatchesTriggerWidth?: boolean | undefined;
13
+ }>;
14
+ RowGroupSelector: React.FC<{
15
+ localeText: {
16
+ reset: string;
17
+ placeholder: string;
18
+ };
19
+ }>;
20
+ Search: React.FunctionComponent<import("./QuickControls/Search").SearchProps>;
21
+ Table: React.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
22
+ FiltersPanel: React.FunctionComponent<import("./types").TablePanelProps>;
23
+ FiltersPanelButton: React.FunctionComponent<{}>;
24
+ };
25
+ export default _default;
@@ -0,0 +1,36 @@
1
+ import { IServerSideGetRowsParams } from '@ag-grid-community/core';
2
+ import React, { MutableRefObject } from 'react';
3
+ import { IServerFilter } from './FilterRenderers';
4
+ import { DataTableProps, ISearchState, TablePanelProps, TableProps } from './types';
5
+ import { InternalTableContext } from './utils/internalTableContext';
6
+ export declare const tableIcons: {
7
+ rowDrag: string;
8
+ columnMoveMove: string;
9
+ };
10
+ export declare const DataTable: ({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, translations, enableCellTextSelection, }: React.PropsWithChildren<DataTableProps>) => React.JSX.Element;
11
+ export declare function getServerSideDatasource(onServerSideDataRequestCallbackRef: MutableRefObject<DataTableProps['onServerSideDataRequest'] | undefined>, onEmptyResponseCallback: (() => void) | undefined, onNonEmptyResponseCallback: (() => void) | undefined, filters: IServerFilter[], search: ISearchState, setTotalRowCount: InternalTableContext['setTotalRowCount']): {
12
+ getRows: (params: IServerSideGetRowsParams) => Promise<void>;
13
+ };
14
+ export declare const Table: React.FC<TableProps>;
15
+ export declare const ContextPanel: React.FC<TablePanelProps>;
16
+ declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, translations, enableCellTextSelection, }: React.PropsWithChildren<DataTableProps>) => React.JSX.Element) & {
17
+ BulkActions: React.FunctionComponent<React.PropsWithChildren<import("./BulkActions/BulkActions").BulkActionProps>>;
18
+ BulkEditActionButton: React.FunctionComponent<import("./BulkActions/BulkEditActionButton").ActionButtonProps>;
19
+ ConfigPanelButton: React.FC<{}>;
20
+ ContextPanel: React.FC<TablePanelProps>;
21
+ QuickControls: React.FunctionComponent<import("./QuickControls/QuickControls").QuickControlsProps>;
22
+ QuickFilters: React.FunctionComponent<{
23
+ overlayMatchesTriggerWidth?: boolean | undefined;
24
+ }>;
25
+ RowGroupSelector: React.FC<{
26
+ localeText: {
27
+ reset: string;
28
+ placeholder: string;
29
+ };
30
+ }>;
31
+ Search: React.FunctionComponent<import("./QuickControls/Search").SearchProps>;
32
+ Table: React.FC<TableProps<any, any>>;
33
+ FiltersPanel: React.FunctionComponent<TablePanelProps>;
34
+ FiltersPanelButton: React.FunctionComponent<{}>;
35
+ };
36
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export type EmptyRendererProps = {
3
+ children?: React.ReactNode;
4
+ hasFilters?: boolean;
5
+ hasSearch?: boolean;
6
+ itemsLabel?: string;
7
+ };
8
+ export interface EmptyStateProps {
9
+ emptyStateRenderer?: React.FunctionComponent<EmptyRendererProps>;
10
+ }
11
+ export declare function DefaultEmptyStateRenderer({ children, itemsLabel, hasFilters, hasSearch, }: EmptyRendererProps): React.JSX.Element;
12
+ export declare const EmptyState: React.FC<EmptyStateProps>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { DataTableFilterProps } from '.';
3
+ import { NumberFilterModel } from './NumberFilterRenderer';
4
+ type ClientSideFilterProps = DataTableFilterProps & {
5
+ options?: any[];
6
+ onChange: (value?: string[] | NumberFilterModel) => void;
7
+ value?: any[] | NumberFilterModel;
8
+ };
9
+ declare function ClientSideFilterInner(props: ClientSideFilterProps): React.JSX.Element;
10
+ export declare const ClientSideFilter: React.MemoExoticComponent<typeof ClientSideFilterInner>;
11
+ export {};
@@ -0,0 +1,47 @@
1
+ import { DateTimeProvider } from '@procore/core-react';
2
+ import React from 'react';
3
+ import { FilterComponentProps } from '.';
4
+ import { DateFilterSelectionType } from '../types';
5
+ import { Position } from './utils';
6
+ type DateFilterValue = Date;
7
+ export type DateFilterModel = {
8
+ type: DateFilterCurrentSelectionType;
9
+ start?: Date | null;
10
+ end?: Date | null;
11
+ };
12
+ type DateFilterComponentProps = FilterComponentProps<{
13
+ date: Date;
14
+ }, Array<{
15
+ date: Date;
16
+ }>>;
17
+ type DateFilterCurrentSelectionType = Omit<DateFilterSelectionType, 'either'>;
18
+ interface DateFilterOverlayProps {
19
+ dateInputSegmentRef?: React.RefObject<HTMLDivElement>;
20
+ displayDate: Date;
21
+ monthRef: React.RefObject<HTMLDivElement>;
22
+ onSelect: (date: Date) => void;
23
+ yearRef: React.RefObject<HTMLDivElement>;
24
+ position: Position;
25
+ selectionType: DateFilterSelectionType;
26
+ selectedValue: DateFilterModel;
27
+ setDisplayDate: (date: Date) => void;
28
+ setSelectionType: (currentSelectionType: DateFilterCurrentSelectionType) => void;
29
+ }
30
+ /** Determines if a new DateTimeProvider context should be added,
31
+ * or do nothing so children can inherit an above context.
32
+ * @returns DateTimeProvider | React.Fragment */
33
+ export declare const OptionalDateTimeProvider: React.FC<React.ComponentProps<typeof DateTimeProvider>>;
34
+ export declare const DateFilterOverlay: React.ForwardRefExoticComponent<DateFilterOverlayProps & React.RefAttributes<HTMLDivElement>>;
35
+ export declare function DateFilter({ onChange, selectionType, value, ...props }: {
36
+ 'data-qa'?: string;
37
+ onChange: (val: DateFilterValue[]) => void;
38
+ selectionType?: DateFilterSelectionType;
39
+ value: string[] | Date[];
40
+ }): React.JSX.Element;
41
+ export declare function ServerSideDateSelectFilterRenderer({ columnDefinition, onChange, value, ...props }: DateFilterComponentProps): React.JSX.Element;
42
+ declare const DateFilterRenderer: (props: DateFilterComponentProps) => React.JSX.Element | null;
43
+ export declare const DateFilterTokenText: ({ headerName, value, }: {
44
+ headerName: string;
45
+ value: string[];
46
+ }) => React.JSX.Element;
47
+ export default DateFilterRenderer;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { FilterComponentProps } from '.';
3
+ export type LocationFilterProps = FilterComponentProps<LocationOption, LocationOption[]>;
4
+ export interface LocationOption {
5
+ label?: string;
6
+ name?: string;
7
+ id: string | number;
8
+ }
9
+ export declare const LocationFilterRenderer: (props: LocationFilterProps) => React.JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { FilterComponentProps } from '.';
3
+ export type MultiSelectFilterProps = FilterComponentProps<string, string[]>;
4
+ export declare function ServerSideMultiSelectFilterRenderer({ columnDefinition, getOptions, loading, onChange, options, value, ...props }: MultiSelectFilterProps): React.JSX.Element;
5
+ export declare function ClientSideMultiSelectFilterRenderer({ columnDefinition, loading, onChange, options, value, ...props }: MultiSelectFilterProps): React.JSX.Element;
6
+ declare const MultiSelectFilterRenderer: (props: FilterComponentProps) => React.JSX.Element | null;
7
+ export default MultiSelectFilterRenderer;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { NumberFilterModel as AgNumberFilterModel } from '@ag-grid-community/core';
3
+ import { FilterComponentProps, IClientSideFilter } from '.';
4
+ type AcceptedTypes = AgNumberFilterModel['type'] | 'any_value' | 'no_value';
5
+ export type NumberFilterModel = Omit<AgNumberFilterModel, 'type'> & {
6
+ type?: AcceptedTypes;
7
+ };
8
+ export type NumberFilterSelection = {
9
+ id: AcceptedTypes;
10
+ label: string;
11
+ };
12
+ export type NumberFilterValue = {
13
+ type?: AcceptedTypes;
14
+ filter?: number;
15
+ filterTo?: number;
16
+ } | undefined;
17
+ export interface NumberFilter extends IClientSideFilter {
18
+ readonly type: 'number';
19
+ value?: NumberFilterValue;
20
+ }
21
+ type NumberFilterProps = FilterComponentProps<unknown, NumberFilterValue>;
22
+ export declare const NumberFilterRenderer: React.NamedExoticComponent<NumberFilterProps>;
23
+ export {};
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { DataTableFilterProps } from '.';
3
+ export declare const ServerSideFilter: ({ columnDefinition, Component, }: DataTableFilterProps) => React.JSX.Element | null;
@@ -0,0 +1,114 @@
1
+ /// <reference types="react" />
2
+ import { IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
3
+ import { FilterRecord } from '../state/useFilterState';
4
+ import { ColumnDefinition, DateFilterSelectionType, LocationFilterOpt } from '../types';
5
+ import { NumberFilterModel } from './NumberFilterRenderer';
6
+ export { default as DateFilterRenderer } from './DateFilterRenderer';
7
+ export { LocationFilterRenderer } from './LocationFilterRenderer';
8
+ export { default as MultiSelectFilterRenderer } from './MultiSelectFilterRenderer';
9
+ export { NumberFilterRenderer } from './NumberFilterRenderer';
10
+ export { ServerSideFilter } from './ServerSideFilter';
11
+ export { useFilterStorage } from './useServerSideFilterStorage';
12
+ export interface IFilterProps<Opt = any, Val = number | string | null> {
13
+ columnDefinition: ColumnDefinition;
14
+ filter?: FilterRecord;
15
+ getFilterHeadingText?: (columnDefinition: ColumnDefinition) => React.FunctionComponent | string;
16
+ getFilterTokenText?: ({ headerName, value, }: {
17
+ headerName: string;
18
+ value: Val extends string ? string[] : Val extends number ? number[] : unknown[];
19
+ }) => React.FunctionComponent | string;
20
+ getFilterOptions?: () => Promise<Opt[]>;
21
+ getId?: (option: Opt) => Val extends string ? string : Val extends number ? number : unknown;
22
+ getLabel?: (option: Opt) => string;
23
+ groupName?: string;
24
+ index?: number;
25
+ onChange?: (values: any[]) => void;
26
+ onRemove?: () => void;
27
+ placeholder?: string;
28
+ }
29
+ export interface IDateFilterProps<Opt = {
30
+ date: Date;
31
+ }, Val = string> extends IFilterProps<Opt, Val> {
32
+ /** Controls the type of filtering: single, range,
33
+ * or up to user choice (either) */
34
+ selectionType?: DateFilterSelectionType;
35
+ }
36
+ export interface ILocationFilterProps<Opt = LocationFilterOpt, Val = string> extends IFilterProps<Opt, Val> {
37
+ onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
38
+ }
39
+ export interface INumberFilterProps<Opt = {
40
+ id: NumberFilterModel['type'];
41
+ label: string;
42
+ }, Val = any> extends Omit<IFilterProps<Opt, Val>, 'getFilterOptions'>, Pick<IScalarFilterParams, 'inRangeInclusive' | 'includeBlanksInEquals' | 'includeBlanksInLessThan' | 'includeBlanksInGreaterThan' | 'includeBlanksInRange'> {
43
+ getFilterOptions?: () => ISimpleFilterParams['filterOptions'];
44
+ }
45
+ export interface FilterComponentProps<Opt = any, Val = Opt[] | NumberFilterModel> {
46
+ columnDefinition: ColumnDefinition;
47
+ filter: FilterRecord<Opt[] | NumberFilterModel>;
48
+ filterDef: IFilter;
49
+ getOptions?: () => Promise<boolean>;
50
+ loading: boolean;
51
+ onChange: (value: Opt[] | NumberFilterModel | undefined) => void;
52
+ onRemove: () => void;
53
+ options: Opt[];
54
+ value: Val;
55
+ }
56
+ export interface IClientSideFilter {
57
+ active: boolean;
58
+ field: string;
59
+ name: string;
60
+ readonly type: 'list' | 'number';
61
+ }
62
+ export interface IServerSideFilter {
63
+ field: string;
64
+ name: string;
65
+ }
66
+ export interface DataTableFilterProps {
67
+ Component: any;
68
+ columnDefinition: ColumnDefinition;
69
+ }
70
+ export interface IFilterMeta<Opt = any, Val = number | string> {
71
+ headerName?: string;
72
+ filterRenderer?: React.FunctionComponent<IFilterProps<Opt, Val>>;
73
+ field: string;
74
+ filterProps?: IFilterProps<Opt, Val>;
75
+ }
76
+ export interface IServerFilter<Opt = any, Val = number | string> extends IFilterState<Opt, Val>, IFilterMeta<Opt, Val> {
77
+ }
78
+ export interface IFilterState<Opt = any, Val = number | string> {
79
+ /**
80
+ * The full selected option shape
81
+ */
82
+ selected: Opt[];
83
+ /**
84
+ * The result of getId from each option
85
+ */
86
+ value: Val[];
87
+ field: string;
88
+ }
89
+ export interface IServerFiltersState {
90
+ [field: string]: IFilterState;
91
+ }
92
+ export interface IFilterStorageConfig {
93
+ columnDefinitions: ColumnDefinition[];
94
+ initialSelectedFilters?: IServerFilter[];
95
+ getColumnDefinition: (field: string) => ColumnDefinition | undefined;
96
+ }
97
+ export interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
98
+ hasDefinedFilters: boolean;
99
+ hasSelectedFilters: boolean;
100
+ getOptions: (field: string) => UniversalOpt[];
101
+ getSelected: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
102
+ getListFilter: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
103
+ selectedFilters: IServerFiltersState;
104
+ onChangeFilterValue: ({ field, value, }: {
105
+ field: string;
106
+ value: any;
107
+ }) => void;
108
+ onClearFilter: (field: string) => void;
109
+ onClearAllFilters: React.MouseEventHandler<HTMLButtonElement>;
110
+ possibleFilters: string[];
111
+ setSelectedFilters: (filters: IServerFilter[]) => void;
112
+ waitForStoredOptions: (field: string) => Promise<void>;
113
+ filtersState: IServerFilter[];
114
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { ColumnDefinition } from '../types';
3
+ interface UseServerSideFilter {
4
+ columnDefinition: ColumnDefinition;
5
+ }
6
+ export declare const useServerSideFilter: ({ columnDefinition, }: UseServerSideFilter) => {
7
+ fieldName: string;
8
+ filterHeading: string | React.FunctionComponent<{}> | undefined;
9
+ getOptions: () => Promise<boolean>;
10
+ loading: boolean;
11
+ onChange: (value: any[]) => void;
12
+ onClearFilter: (field: string) => void;
13
+ options: any[];
14
+ value: any[];
15
+ };
16
+ export {};
@@ -0,0 +1,3 @@
1
+ import { IFilterStorage, IFilterStorageConfig } from '.';
2
+ export declare function useFilterStorage<UniversalOpt = any>({ columnDefinitions, initialSelectedFilters, getColumnDefinition, }: IFilterStorageConfig): IFilterStorage<UniversalOpt>;
3
+ export declare const defaultServerSideFiltersContext: IFilterStorage;
@@ -0,0 +1,7 @@
1
+ import { DateFilterModel } from './DateFilterRenderer';
2
+ export type Position = 'start' | 'end';
3
+ export declare function getLabel(func: any, option: any): string;
4
+ export declare function getId(func: any, option: any): string | number;
5
+ export declare function getOrderedDates(dateValue: DateFilterModel): DateFilterModel;
6
+ export declare function isValidDateSelection(value: DateFilterModel): boolean;
7
+ export declare function getValueFromSelection(existingValue: DateFilterModel, date: Date | null, position: Position): DateFilterModel;
@@ -0,0 +1,15 @@
1
+ import { ColumnApi } from '@ag-grid-community/core';
2
+ import React from 'react';
3
+ import './genericHeader.scss';
4
+ export interface GenericColumnGroupHeaderProps {
5
+ columnApi: ColumnApi;
6
+ columnGroup: {
7
+ providedColumnGroup: {
8
+ expanded: boolean;
9
+ expandable: boolean;
10
+ };
11
+ };
12
+ displayName: string;
13
+ setExpanded: (isExpanded: boolean) => void;
14
+ }
15
+ export declare function GenericColumnGroupHeader(props: GenericColumnGroupHeaderProps): React.JSX.Element | null;
@@ -0,0 +1,27 @@
1
+ import { ColDef, IHeaderParams } from '@ag-grid-community/core';
2
+ import { DropdownFlyoutOption } from '@procore/core-react';
3
+ import React from 'react';
4
+ import { SelectAllState } from '../types';
5
+ import './genericHeader.scss';
6
+ export declare const tooltipDelay: {
7
+ hide: number;
8
+ show: number;
9
+ };
10
+ export interface MenuDropdownOption extends Omit<DropdownFlyoutOption, 'children'> {
11
+ action?: (params: ColDef | null) => void;
12
+ children?: MenuDropdownOption[];
13
+ menuType?: 'defaultMenuOptions' | 'menuOptions';
14
+ }
15
+ export interface GenericHeaderParams extends IHeaderParams {
16
+ menuOptions: MenuDropdownOption[];
17
+ columnHeaderMenuOptions: MenuDropdownOption[];
18
+ menuConfig: {
19
+ suppressExpandGroupsButton: boolean;
20
+ suppressResetColumnsOption: boolean;
21
+ isRowGroupActive: boolean;
22
+ enableRowGroup: boolean;
23
+ };
24
+ onSelectAll?: (param: Exclude<SelectAllState, 'Partial'>) => void;
25
+ selectionSSREnabled?: boolean;
26
+ }
27
+ export declare const GenericHeaderRenderer: React.FunctionComponent<GenericHeaderParams>;
@@ -0,0 +1,65 @@
1
+ import { IRowNode } from '@ag-grid-community/core';
2
+ import { FormCurrencyProps, FormDateProps, FormMultiSelectProps, FormSelectProps } from '@procore/core-react';
3
+ import React from 'react';
4
+ export interface BulkEditResult {
5
+ /** The id of the selected row node. The value is the output from the getRowId callback */
6
+ id: number | string | undefined;
7
+ /** The row index of the selected row node */
8
+ rowIndex: IRowNode['rowIndex'];
9
+ /** The row data from before the bulk edit for the entire row */
10
+ oldRowData: {
11
+ [key: string]: any;
12
+ };
13
+ /** Row Data containing only the changed key/value pairs from the bulk edit */
14
+ changedRowData: {
15
+ [key: string]: any;
16
+ };
17
+ /** The entire updated row data including changes from the bulk edit */
18
+ newRowData: {
19
+ [key: string]: any;
20
+ };
21
+ }
22
+ /** For server side implementation, we may want to extend options to be an array,
23
+ * or a promise returning an array like server side filters */
24
+ export interface SelectBulkEditorParams extends Omit<FormSelectProps, 'name'> {
25
+ }
26
+ export interface MultiSelectBulkEditorParams extends Omit<FormMultiSelectProps, 'name'> {
27
+ }
28
+ export interface DateSelectBulkEditorParams extends FormDateProps {
29
+ }
30
+ export interface DateTimeSelectBulkEditorParams extends FormDateProps {
31
+ }
32
+ export interface CurrencyBulkEditorParams extends FormCurrencyProps {
33
+ }
34
+ export interface CompanyBulkEditorParams extends Omit<FormSelectProps, 'name'> {
35
+ getCompanyName?: (option: any) => string;
36
+ getImageURL?: (option: any) => string;
37
+ }
38
+ export interface CompaniesMultiSelectBulkEditorParams extends Omit<FormMultiSelectProps, 'name'> {
39
+ getCompanyName?: (option: any) => string;
40
+ getImageURL?: (option: any) => string;
41
+ }
42
+ export interface PersonBulkEditorParams extends Omit<FormSelectProps, 'name'> {
43
+ getCompanyName?: (option: any) => string;
44
+ getImageURL?: (option: any) => string;
45
+ getInitials?: (option: any) => string;
46
+ getPersonName?: (option: any) => string;
47
+ }
48
+ export interface PeopleBulkEditorParams extends Omit<FormMultiSelectProps, 'name'> {
49
+ getCompanyName?: (option: any) => string;
50
+ getImageURL?: (option: any) => string;
51
+ getInitials?: (option: any) => string;
52
+ getPersonName?: (option: any) => string;
53
+ }
54
+ interface BulkEditHandle {
55
+ reset: () => void;
56
+ submit: () => void;
57
+ }
58
+ interface BulkEditProps {
59
+ onReset?: () => void;
60
+ }
61
+ export declare const BulkEdit: React.ForwardRefExoticComponent<BulkEditProps & React.RefAttributes<BulkEditHandle>>;
62
+ interface BulkEditPanelProps {
63
+ }
64
+ export declare const BulkEditPanel: React.FC<BulkEditPanelProps>;
65
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const ConfigurationRowHeight: React.FC;
3
+ export interface ConfigurationProps {
4
+ }
5
+ export declare const ConfigurationColumns: React.ForwardRefExoticComponent<{
6
+ onDisplayedColumnsChange: (allVisible: boolean) => void;
7
+ } & React.RefAttributes<unknown>>;
8
+ export declare const ConfigurationPanel: React.FC;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ServerSideFilter } from '../FilterRenderers/ServerSideFilter';
3
+ import { TablePanelProps } from '../types';
4
+ interface FiltersContextPanelProps extends TablePanelProps {
5
+ filters: string[];
6
+ FilterListItem: typeof ServerSideFilter;
7
+ }
8
+ export declare const Filters: React.FunctionComponent<FiltersContextPanelProps>;
9
+ export declare const FiltersPanel: React.FunctionComponent<TablePanelProps>;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledPanelSection: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@procore/core-react/dist/Section").SectionProps & import("react").RefAttributes<HTMLDivElement>>, any, {
3
+ groupHeight?: number | undefined;
4
+ }, never>;
@@ -0,0 +1,12 @@
1
+ import { FilterRecord, useFilterState } from '../state/useFilterState';
2
+ import { ColumnDefinition, FilterGroup } from '../types';
3
+ export type FiltersInGroupType = FilterRecord[] | ColumnDefinition[];
4
+ export type FiltersByGroupNameType = Record<string, FiltersInGroupType> | null;
5
+ type FiltersInGroupProps = {
6
+ filterGroups?: FilterGroup[];
7
+ filterState: ReturnType<typeof useFilterState>;
8
+ isServerSideDataRequest: boolean;
9
+ };
10
+ export declare const FILTER_GROUP_NO_KEY = "undefined";
11
+ export declare function groupFiltersByGroupName(props: FiltersInGroupProps): FiltersByGroupNameType;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ContextPanelApi } from '../types';
2
+ export declare function useContextPanel(): ContextPanelApi;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ConfigPanelButton: React.FC;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const EmptyResultsControlTooltip: ({ enabled, children, featureI18nKey, }: {
3
+ featureI18nKey: string;
4
+ enabled: boolean;
5
+ children: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface FiltersPanelToggleButtonProps {
3
+ hasDefinedFilters: boolean;
4
+ hasSelectedFilters: boolean;
5
+ }
6
+ export declare const FiltersPanelToggleButton: React.FunctionComponent<FiltersPanelToggleButtonProps>;
7
+ export declare const ServerSideFiltersPanelToggleButton: React.FunctionComponent;
8
+ export declare const ClientSideFiltersPanelToggleButton: React.FunctionComponent;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { SearchProps } from './Search';
3
+ export interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
4
+ style?: React.CSSProperties;
5
+ disabledSearch?: boolean;
6
+ filterOverlayMatchesTriggerWidth?: boolean;
7
+ }
8
+ export declare const QuickControls: React.FunctionComponent<QuickControlsProps>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export declare const FilterIcon: React.FunctionComponent;
3
+ export declare const ClientSideQuickFilters: React.FunctionComponent<{
4
+ overlayMatchesTriggerWidth?: boolean;
5
+ }>;
6
+ export declare const ServerSideQuickFilters: React.FunctionComponent<{
7
+ overlayMatchesTriggerWidth?: boolean;
8
+ }>;
9
+ export declare const QuickFilters: React.FunctionComponent<{
10
+ overlayMatchesTriggerWidth?: boolean;
11
+ }>;
12
+ export declare const FiltersPanelButton: React.FunctionComponent;
@@ -0,0 +1,5 @@
1
+ import { GroupBySelectProps } from '@procore/labs-group-by-select';
2
+ import React from 'react';
3
+ export declare const RowGroupSelector: React.FC<{
4
+ localeText: GroupBySelectProps['localeText'];
5
+ }>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface SearchProps {
3
+ onSearch?: React.ChangeEventHandler<HTMLInputElement>;
4
+ /** The placeholder to the Search input */
5
+ placeholder?: string;
6
+ disabled?: boolean;
7
+ }
8
+ export declare const ClientSideSearch: React.FunctionComponent<SearchProps>;
9
+ export declare const Search: React.FunctionComponent<SearchProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface ISearchStorage {
3
+ searchValue: string;
4
+ setSearchValue: (value: string) => void;
5
+ }
6
+ export declare function useSearchStorage(): ISearchStorage;
7
+ export declare const defaultSearchStorage: ISearchStorage;
8
+ export interface SearchProps {
9
+ onSearch?: React.ChangeEventHandler<HTMLInputElement>;
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ }
13
+ export declare const ServerSideSearch: React.FunctionComponent<SearchProps>;