@absreim/react-bootstrap-data-grid 4.1.0 → 4.3.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 (112) hide show
  1. package/common/constants.d.ts +2 -0
  2. package/common/constants.js +2 -0
  3. package/common/editing/types.d.ts +30 -0
  4. package/common/export/types.d.ts +6 -0
  5. package/common/export/useExportFn.js +1 -1
  6. package/common/filtering/DateFilterRow.d.ts +1 -1
  7. package/common/filtering/DateFilterRow.js +1 -1
  8. package/common/filtering/FilterOptionsTable.d.ts +3 -2
  9. package/common/filtering/NumberFilterRow.d.ts +1 -1
  10. package/common/filtering/NumberFilterRow.js +1 -1
  11. package/common/filtering/StringFilterRow.js +1 -1
  12. package/common/filtering/constants.d.ts +19 -0
  13. package/common/filtering/constants.js +44 -0
  14. package/common/filtering/internalTypes.d.ts +77 -0
  15. package/common/filtering/types.d.ts +165 -22
  16. package/common/filtering/types.js +46 -17
  17. package/common/filtering/useFilterFormState.d.ts +1 -1
  18. package/common/icons/CaretDownFill.d.ts +4 -0
  19. package/common/icons/CaretDownFill.js +6 -0
  20. package/common/icons/CaretUp.d.ts +4 -0
  21. package/common/icons/CaretUp.js +6 -0
  22. package/common/icons/CaretUpFill.d.ts +4 -0
  23. package/common/icons/CaretUpFill.js +6 -0
  24. package/common/icons/internalTypes.d.ts +3 -0
  25. package/common/index.d.ts +0 -3
  26. package/common/index.js +0 -3
  27. package/common/internalTypes.d.ts +10 -0
  28. package/common/internalTypes.js +1 -0
  29. package/common/pagination/Pagination.d.ts +1 -1
  30. package/common/pagination/internalTypes.d.ts +8 -0
  31. package/common/pagination/internalTypes.js +1 -0
  32. package/common/pagination/types.d.ts +105 -5
  33. package/common/pipeline/{types.d.ts → internalTypes.d.ts} +5 -0
  34. package/common/pipeline/internalTypes.js +1 -0
  35. package/common/pipeline/useAugFormattedRows.d.ts +3 -2
  36. package/common/pipeline/useColNameToWidth.d.ts +2 -1
  37. package/common/pipeline/useCombinedPipeline/index.d.ts +4 -3
  38. package/common/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +2 -1
  39. package/common/pipeline/useCombinedPipeline/useCurrentPageRows.js +3 -2
  40. package/common/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +2 -1
  41. package/common/pipeline/useCombinedPipeline/useFilterStateStore.d.ts +2 -1
  42. package/common/pipeline/useGridSelectionFns.d.ts +2 -1
  43. package/common/selection/internalTypes.d.ts +34 -0
  44. package/common/selection/internalTypes.js +1 -0
  45. package/common/selection/types.d.ts +91 -17
  46. package/common/selection/types.js +0 -3
  47. package/common/sorting/ArrowPlaceholder.d.ts +3 -0
  48. package/common/sorting/ArrowPlaceholder.js +3 -0
  49. package/common/sorting/DownArrow.d.ts +6 -0
  50. package/common/sorting/DownArrow.js +6 -0
  51. package/common/sorting/UpArrow.d.ts +6 -0
  52. package/common/sorting/UpArrow.js +6 -0
  53. package/common/sorting/internalTypes.d.ts +10 -0
  54. package/common/sorting/internalTypes.js +1 -0
  55. package/common/sorting/types.d.ts +48 -4
  56. package/common/sorting/useSortHeaderStates.d.ts +1 -1
  57. package/common/sorting/useSortHeaderStates.js +8 -7
  58. package/common/styling/types.d.ts +57 -0
  59. package/common/toolbar/Toolbar.d.ts +1 -1
  60. package/common/toolbar/ToolbarContainer.d.ts +1 -1
  61. package/common/toolbar/{types.d.ts → internalTypes.d.ts} +27 -0
  62. package/common/toolbar/internalTypes.js +1 -0
  63. package/common/toolbar/useInterfaces.d.ts +1 -1
  64. package/common/types.d.ts +169 -16
  65. package/common/util/datetime.d.ts +17 -0
  66. package/common/util/datetime.js +17 -0
  67. package/common/util/getWidthStyle.d.ts +9 -0
  68. package/common/util/getWidthStyle.js +9 -0
  69. package/common/util/index.d.ts +0 -4
  70. package/common/util/index.js +0 -4
  71. package/common/util/isSubset.d.ts +12 -1
  72. package/common/util/isSubset.js +13 -2
  73. package/common/util/useControlledHover.d.ts +5 -0
  74. package/common/util/useControlledHover.js +5 -0
  75. package/grid/focus/types.d.ts +11 -0
  76. package/grid/focus/useGridFocus.d.ts +1 -1
  77. package/grid/focus/useGridFocus.js +20 -5
  78. package/grid/main/Grid.d.ts +5 -0
  79. package/grid/main/Grid.js +14 -7
  80. package/grid/main/GridBody.d.ts +1 -1
  81. package/grid/main/GridHeader.d.ts +1 -1
  82. package/grid/main/GridHeader.js +29 -2
  83. package/grid/main/internalTypes.d.ts +31 -0
  84. package/grid/main/internalTypes.js +1 -0
  85. package/grid/main/types.d.ts +120 -19
  86. package/grid/sort/HeaderToggleButton.d.ts +11 -0
  87. package/grid/sort/HeaderToggleButton.js +30 -0
  88. package/grid.css +1 -1
  89. package/grid.scss +95 -33
  90. package/package.json +5 -5
  91. package/table/InternalTable.d.ts +1 -1
  92. package/table/Table.d.ts +5 -1
  93. package/table/Table.js +5 -0
  94. package/table/editing/EditableRow.d.ts +1 -1
  95. package/table/editing/EditableRow.js +1 -1
  96. package/table/internalTypes.d.ts +23 -0
  97. package/table/internalTypes.js +1 -0
  98. package/table/main/BodyRows.d.ts +4 -3
  99. package/table/main/ColHeaderCell/index.d.ts +1 -1
  100. package/table/selection/SelectAllHeaderCell.d.ts +1 -1
  101. package/table/styling/types.d.ts +122 -5
  102. package/table/types.d.ts +57 -15
  103. package/common/sorting/arrowPlaceholder.d.ts +0 -2
  104. package/common/sorting/arrowPlaceholder.js +0 -7
  105. package/common/sorting/downArrow.d.ts +0 -2
  106. package/common/sorting/downArrow.js +0 -3
  107. package/common/sorting/upArrow.d.ts +0 -2
  108. package/common/sorting/upArrow.js +0 -13
  109. package/common/util/trueModulo.d.ts +0 -2
  110. package/common/util/trueModulo.js +0 -4
  111. /package/common/{pipeline/types.js → filtering/internalTypes.js} +0 -0
  112. /package/common/{toolbar/types.js → icons/internalTypes.js} +0 -0
@@ -1,2 +1,4 @@
1
1
  export declare const DEFAULT_COL_WIDTH = 100;
2
2
  export declare const CSS_PREFIX = "rbdg-grid";
3
+ export declare const DEFAULT_MAX_PAGE_BUTTONS = 5;
4
+ export declare const DEFAULT_PAGE_SIZES: number[];
@@ -1,2 +1,4 @@
1
1
  export var DEFAULT_COL_WIDTH = 100;
2
2
  export var CSS_PREFIX = "rbdg-grid";
3
+ export var DEFAULT_MAX_PAGE_BUTTONS = 5;
4
+ export var DEFAULT_PAGE_SIZES = [10, 25, 100];
@@ -1,7 +1,37 @@
1
1
  import { RowData, RowId } from "../types";
2
+ /**
3
+ * Function that returns a callback function that responds to a row being
4
+ * updated with the editing feature.
5
+ *
6
+ * @param id - the id of the row being updated
7
+ * @param rowData - the contents of the edited row
8
+ *
9
+ * @public
10
+ */
2
11
  export type UpdateCallbackGenerator = (id: RowId) => (rowData: RowData) => void;
12
+ /**
13
+ * Object that enables and configures the row editing feature.
14
+ *
15
+ * @public
16
+ */
3
17
  export interface EditModel {
18
+ /**
19
+ * Function that generates a callback function that responds to a row update.
20
+ * Use this property to specify how row updates affect the state outside
21
+ * the table component.
22
+ */
4
23
  getUpdateCallback: UpdateCallbackGenerator;
24
+ /**
25
+ * Callback function for deleting rows via the UI. Omit this property or pass
26
+ * undefined to disallow deletions via the UI.
27
+ */
5
28
  getDeleteCallback?: (id: RowId) => () => void;
29
+ /**
30
+ * Specifies a fixed width in pixels for the column that contains the buttons
31
+ * for editing a row. In particular, the min-width and max-width CSS
32
+ * properties will be set.
33
+ *
34
+ * @defaultValue undefined - no CSS will be specified
35
+ */
6
36
  editColWidth?: number;
7
37
  }
@@ -1,4 +1,10 @@
1
1
  import { RowId } from "../types";
2
+ /**
3
+ * Intermediary object that represents a single row that is formatted in a
4
+ * manner suitable for CSV export.
5
+ *
6
+ * @internal
7
+ */
2
8
  export type FormattedExportRow = {
3
9
  id: RowId;
4
10
  data: Record<string, string | number>;
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { dateToDatetimeInputStr, dateToInputStr } from "../util/datetime";
12
+ import { dateToDatetimeInputStr, dateToInputStr } from "../util";
13
13
  import Papa from "papaparse";
14
14
  import { useCallback, useMemo } from "react";
15
15
  var downloadFile = function (data, filename, type) {
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
- import { DateFormFilterState } from "./types";
3
2
  import { CommonFilterRowStyleProps } from "./FilterRow";
3
+ import { DateFormFilterState } from "./internalTypes";
4
4
  export type DateFilterRowProps = {
5
5
  ariaRowIndex: number;
6
6
  includeTime: boolean;
@@ -11,9 +11,9 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useId } from "react";
14
- import { dateFilterSchemeNames, } from "./types";
15
14
  import FilterRow from "./FilterRow";
16
15
  import classNames from "classnames";
16
+ import { dateFilterSchemeNames } from "./constants";
17
17
  var DateFilterRow = function (_a) {
18
18
  var ariaRowIndex = _a.ariaRowIndex, includeTime = _a.includeTime, columnLabel = _a.columnLabel, filterState = _a.filterState, setFilterState = _a.setFilterState, schemeSelectClasses = _a.schemeSelectClasses, enableInputClasses = _a.enableInputClasses, startDateInputClasses = _a.startDateInputClasses, endDateInputClasses = _a.endDateInputClasses, tdClasses = _a.tdClasses, trClasses = _a.trClasses;
19
19
  var handleOpChange = function (_a) {
@@ -1,6 +1,7 @@
1
1
  import { FC } from "react";
2
- import { EditableFilterState, FilterState } from "./types";
3
- import { FilterInputTableStyleModel } from "../../table/styling/types";
2
+ import { EditableFilterState } from "./types";
3
+ import { FilterInputTableStyleModel } from "../../table";
4
+ import { FilterState } from "./internalTypes";
4
5
  export interface FilterOptionsTableProps {
5
6
  filterState: FilterState;
6
7
  setFilterState: (filterState: EditableFilterState) => void;
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
- import { NumberFormFilterState } from "./types";
3
2
  import { CommonFilterRowStyleProps } from "./FilterRow";
3
+ import { NumberFormFilterState } from "./internalTypes";
4
4
  export type NumberFilterRowProps = {
5
5
  ariaRowIndex: number;
6
6
  columnLabel: string;
@@ -10,9 +10,9 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { numberFilterSchemeNames, } from "./types";
14
13
  import FilterRow from "./FilterRow";
15
14
  import classNames from "classnames";
15
+ import { numberFilterSchemeNames } from "./constants";
16
16
  var NumberFilterRow = function (_a) {
17
17
  var ariaRowIndex = _a.ariaRowIndex, columnLabel = _a.columnLabel, filterState = _a.filterState, setFilterState = _a.setFilterState, schemeSelectClasses = _a.schemeSelectClasses, enableInputClasses = _a.enableInputClasses, numberInputClasses = _a.numberInputClasses, tdClasses = _a.tdClasses, trClasses = _a.trClasses;
18
18
  var handleOpChange = function (_a) {
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import FilterRow from "./FilterRow";
14
14
  import classNames from "classnames";
15
- import { stringFilterSchemeNames, } from "./types";
15
+ import { stringFilterSchemeNames } from "./constants";
16
16
  var StringFilterRow = function (_a) {
17
17
  var ariaRowIndex = _a.ariaRowIndex, columnLabel = _a.columnLabel, filterState = _a.filterState, setFilterState = _a.setFilterState, schemeSelectClasses = _a.schemeSelectClasses, enableInputClasses = _a.enableInputClasses, searchStringInputClasses = _a.searchStringInputClasses, tdClasses = _a.tdClasses, trClasses = _a.trClasses;
18
18
  var handleOpChange = function (_a) {
@@ -0,0 +1,19 @@
1
+ import { DateFilterScheme, NumberFilterScheme, StringFilterScheme } from "./types";
2
+ /**
3
+ * A mapping of {@link StringFilterScheme} to display names.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare const stringFilterSchemeNames: Record<StringFilterScheme, string>;
8
+ /**
9
+ * A mapping of display names for {@link NumberFilterScheme}.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare const numberFilterSchemeNames: Record<NumberFilterScheme, string>;
14
+ /**
15
+ * A mapping of display names for {@link DateFilterScheme}.
16
+ *
17
+ * @internal
18
+ */
19
+ export declare const dateFilterSchemeNames: Record<DateFilterScheme, string>;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * A mapping of {@link StringFilterScheme} to display names.
3
+ *
4
+ * @internal
5
+ */
6
+ export var stringFilterSchemeNames = {
7
+ contains: "Contains",
8
+ startsWith: "Starts With",
9
+ endsWith: "Ends With",
10
+ };
11
+ /**
12
+ * A mapping of display names for {@link NumberFilterScheme}.
13
+ *
14
+ * @internal
15
+ */
16
+ export var numberFilterSchemeNames = {
17
+ equals: "=",
18
+ greaterThan: ">",
19
+ lessThan: "<",
20
+ greaterOrEqual: ">=",
21
+ lessOrEqual: "<=",
22
+ };
23
+ /**
24
+ * A mapping of display names for {@link DateFilterScheme}.
25
+ *
26
+ * @internal
27
+ */
28
+ export var dateFilterSchemeNames = {
29
+ /**
30
+ * Displays the row only if {@link Date} value occurs on or after the
31
+ * inputted {@link Date}.
32
+ */
33
+ startFrom: "Start Form",
34
+ /**
35
+ * Displays the row only if {@link Date} value occurs on or before the
36
+ * inputted {@link Date}.
37
+ */
38
+ endAt: "End At",
39
+ /**
40
+ * Displays the row only if {@link Date} value occurs between the
41
+ * inputted before and end dates, inclusive.
42
+ */
43
+ between: "Between",
44
+ };
@@ -0,0 +1,77 @@
1
+ import { AbstractDateFilterState, AbstractFilterState, ControlledFilterModel, DateFilterScheme, EditableColFilterState, NumberFilterScheme, StringFilterState } from "./types";
2
+ /**
3
+ * Like {@link EditableColFilterState}, but includes additional metadata.
4
+ *
5
+ * @internal
6
+ */
7
+ export interface ColFilterState {
8
+ editableState: EditableColFilterState;
9
+ label: string;
10
+ }
11
+ /**
12
+ * Like {@link EditableFilterState}, but includes additional metadata.
13
+ *
14
+ * @internal
15
+ */
16
+ export type FilterState = Record<string, ColFilterState>;
17
+ /**
18
+ * An effective value for the filter model of a grid or table based on
19
+ * whether the controlled or uncontrolled mode was chosen.
20
+ *
21
+ * @internal
22
+ */
23
+ export type NormalizedTableFilterModel = Pick<ControlledFilterModel, "tableFilterState" | "setTableFilterState">;
24
+ /**
25
+ * Represents the form state for a number column in the filter settings UI.
26
+ * This interface differs from {@link NumberFilterState} because numerical
27
+ * HTML input elements are better represented by strings.
28
+ *
29
+ * @internal
30
+ */
31
+ export interface NumberFormFilterState extends AbstractFilterState {
32
+ type: "number";
33
+ scheme: NumberFilterScheme;
34
+ inputValue: string;
35
+ }
36
+ /**
37
+ * Represents the form state for a date or datetime column in the filter
38
+ * settings UI. This interface differs from {@link NumberFilterState} because
39
+ * numerical HTML input elements are better represented by strings.
40
+ *
41
+ * @remarks
42
+ *
43
+ * For schemes startFrom and endAt that do not use both date input fields, the
44
+ * unused field still serves the purpose of remembering the previous value. That
45
+ * way, the user can switch between filtering schemes in the UI without losing
46
+ * their previously entered date.
47
+ *
48
+ * @internal
49
+ */
50
+ export interface DateFormFilterState extends AbstractDateFilterState {
51
+ scheme: DateFilterScheme;
52
+ startDate: string;
53
+ endDate: string;
54
+ }
55
+ /**
56
+ * Represents the actual form state for a column in the filtering settings UI.
57
+ * Differs from {@link EditableColFilterState} because the HTML input fields
58
+ * for number and dates are better represented by strings.
59
+ *
60
+ * @remarks
61
+ *
62
+ * The string type in JavaScript already encompasses the full range of
63
+ * possibilities of the value of HTML text inputs. Therefore, unlike
64
+ * {@link NumberFilterState} and {@link DateFilterState},
65
+ * {@link StringFilterState} is usable as it is to represent the state of a form
66
+ * input.
67
+ *
68
+ * @internal
69
+ */
70
+ export type FilterFormRowState = StringFilterState | NumberFormFilterState | DateFormFilterState;
71
+ /**
72
+ * Represents the form state for filter settings for all columns in a grid or
73
+ * table.
74
+ *
75
+ * @internal
76
+ */
77
+ export type FilterFormState = Record<string, FilterFormRowState>;
@@ -1,70 +1,213 @@
1
- export type FilterState = Record<string, ColFilterState>;
1
+ /**
2
+ * The form state object for the filtering feature for a column.
3
+ *
4
+ * @public
5
+ */
6
+ export type EditableColFilterState = StringFilterState | NumberFilterState | DateFilterState;
7
+ /**
8
+ * State object that represents the filter settings for all of the columns in a
9
+ * grid or table.
10
+ *
11
+ * @public
12
+ */
2
13
  export type EditableFilterState = Record<string, EditableColFilterState>;
3
- export interface ColFilterState {
4
- editableState: EditableColFilterState;
5
- label: string;
6
- }
14
+ /**
15
+ * Base interface for various objects that represent the form state for the
16
+ * filter settings of a single column.
17
+ *
18
+ * @public
19
+ */
7
20
  export interface AbstractFilterState {
21
+ /**
22
+ * Indicates whether filtering is enabled on the associated row.
23
+ */
8
24
  enabled: boolean;
9
25
  }
26
+ /**
27
+ * An array of all possible values of {@link StringFilterScheme}.
28
+ *
29
+ * @public
30
+ */
10
31
  export declare const stringFilterSchemes: readonly ["contains", "startsWith", "endsWith"];
32
+ /**
33
+ * Represents all possible filter schemes for a string column.
34
+ *
35
+ * @public
36
+ */
11
37
  export type StringFilterScheme = (typeof stringFilterSchemes)[number];
12
- export declare const stringFilterSchemeNames: Record<StringFilterScheme, string>;
38
+ /**
39
+ * Form state for the filter settings for a string column.
40
+ *
41
+ * @public
42
+ */
13
43
  export interface StringFilterState extends AbstractFilterState {
44
+ /**
45
+ * A type discriminator.
46
+ */
14
47
  type: "string";
48
+ /**
49
+ * The filter scheme to apply.
50
+ */
15
51
  scheme: StringFilterScheme;
52
+ /**
53
+ * The search string to filter on.
54
+ */
16
55
  searchString: string;
17
56
  }
57
+ /**
58
+ * An array of all possible values of {@link NumberFilterScheme}.
59
+ *
60
+ * @public
61
+ */
18
62
  export declare const numberFilterSchemes: readonly ["equals", "greaterThan", "lessThan", "greaterOrEqual", "lessOrEqual"];
63
+ /**
64
+ * Indicates the filtering scheme to apply to a number column.
65
+ *
66
+ * @public
67
+ */
19
68
  export type NumberFilterScheme = (typeof numberFilterSchemes)[number];
20
- export declare const numberFilterSchemeNames: Record<NumberFilterScheme, string>;
69
+ /**
70
+ * The form state for filter settings on a number column.
71
+ *
72
+ * @public
73
+ */
21
74
  export interface NumberFilterState extends AbstractFilterState {
22
75
  type: "number";
23
76
  scheme: NumberFilterScheme;
24
77
  numValue: number | null;
25
78
  }
79
+ /**
80
+ * An array of all possible values for {@link DateFilterScheme}.
81
+ *
82
+ * @public
83
+ */
26
84
  export declare const dateFilterSchemes: readonly ["startFrom", "endAt", "between"];
85
+ /**
86
+ * Indicates the filtering scheme to apply to date and datetime columns.
87
+ *
88
+ * @public
89
+ */
27
90
  export type DateFilterScheme = (typeof dateFilterSchemes)[number];
28
- export declare const dateFilterSchemeNames: Record<DateFilterScheme, string>;
91
+ /**
92
+ * A base interface for {@link DateFilterState}.
93
+ *
94
+ * @remarks
95
+ *
96
+ * Date and datetime input elements can have a state where there is no input.
97
+ * Nulls in the date fields correspond to this empty state.
98
+ *
99
+ * @public
100
+ */
29
101
  export interface AbstractDateFilterState extends AbstractFilterState {
102
+ /**
103
+ * A type discriminator.
104
+ */
30
105
  type: "date" | "datetime";
106
+ /**
107
+ * The filter scheme to apply.
108
+ */
31
109
  scheme: DateFilterScheme;
32
110
  }
111
+ /**
112
+ * Object that holds the form state for date or datetime column filtered via the
113
+ * "startFrom" scheme.
114
+ *
115
+ * @public
116
+ */
33
117
  export interface StartDateFilterState extends AbstractDateFilterState {
118
+ /**
119
+ * A type discriminator.
120
+ */
34
121
  scheme: "startFrom";
122
+ /**
123
+ * The start date to filter against.
124
+ */
35
125
  startDate: Date | null;
36
126
  }
127
+ /**
128
+ * Object that holds the form state for date or datetime column filtered via the
129
+ * "endAt" scheme.
130
+ *
131
+ * @public
132
+ */
37
133
  export interface EndDateFilterState extends AbstractDateFilterState {
134
+ /**
135
+ * A type discriminator.
136
+ */
38
137
  scheme: "endAt";
138
+ /**
139
+ * The end date to filter against.
140
+ */
39
141
  endDate: Date | null;
40
142
  }
143
+ /**
144
+ * Object that holds the form state for date or datetime column filtered via the
145
+ * "between" scheme.
146
+ *
147
+ * @public
148
+ */
41
149
  export interface BetweenDatesFilterState extends AbstractDateFilterState {
150
+ /**
151
+ * A type discriminator.
152
+ */
42
153
  scheme: "between";
154
+ /**
155
+ * The start date to filter against.
156
+ */
43
157
  startDate: Date | null;
158
+ /**
159
+ * The end date to filter against.
160
+ */
44
161
  endDate: Date | null;
45
162
  }
163
+ /**
164
+ * The form state object for the filtering feature for a date or datetime
165
+ * column.
166
+ *
167
+ * @public
168
+ */
46
169
  export type DateFilterState = StartDateFilterState | EndDateFilterState | BetweenDatesFilterState;
47
- export type EditableColFilterState = StringFilterState | NumberFilterState | DateFilterState;
170
+ /**
171
+ * Object that enables the filtering feature on a grid or table in an
172
+ * externally controllable manner.
173
+ *
174
+ * @public
175
+ */
48
176
  export interface ControlledFilterModel {
177
+ /**
178
+ * A type discriminator.
179
+ */
49
180
  type?: "controlled";
181
+ /**
182
+ * State object that represents the filters currently being applied to the
183
+ * table or grid.
184
+ */
50
185
  tableFilterState: EditableFilterState;
186
+ /**
187
+ * Update callback function for the tableFilterState property. This function
188
+ * is called when the user submits the filter settings form.
189
+ */
51
190
  setTableFilterState: (state: EditableFilterState) => void;
191
+ /**
192
+ * Caption for the filter settings table element.
193
+ *
194
+ * @defaultValue undefined - no caption will be displayed
195
+ */
52
196
  filterTableCaption?: string;
53
197
  }
198
+ /**
199
+ * Object that enables the filtering feature on a grid or table in manner that
200
+ * cannot be controlled externally. In this mode, "tableFilterState" is the
201
+ * initial set of filtering settings.
202
+ *
203
+ * @public
204
+ */
54
205
  export type UncontrolledFilterModel = Partial<Pick<ControlledFilterModel, "tableFilterState" | "filterTableCaption">> & {
55
206
  type: "uncontrolled";
56
207
  };
57
- export type NormalizedTableFilterModel = Pick<ControlledFilterModel, "tableFilterState" | "setTableFilterState">;
58
- export interface NumberFormFilterState extends AbstractFilterState {
59
- type: "number";
60
- scheme: NumberFilterScheme;
61
- inputValue: string;
62
- }
208
+ /**
209
+ * Object used to enable and configure filtering for a grid or table.
210
+ *
211
+ * @public
212
+ */
63
213
  export type FilterModel = ControlledFilterModel | UncontrolledFilterModel;
64
- export interface DateFormFilterState extends AbstractDateFilterState {
65
- scheme: DateFilterScheme;
66
- startDate: string;
67
- endDate: string;
68
- }
69
- export type FilterFormRowState = StringFilterState | NumberFormFilterState | DateFormFilterState;
70
- export type FilterFormState = Record<string, FilterFormRowState>;
@@ -1,30 +1,59 @@
1
+ /**
2
+ * An array of all possible values of {@link StringFilterScheme}.
3
+ *
4
+ * @public
5
+ */
1
6
  export var stringFilterSchemes = [
7
+ /**
8
+ * Displays the row as long as the search string exists anywhere in the
9
+ * associated cell's value.
10
+ */
2
11
  "contains",
12
+ /**
13
+ * Displays the row only if the search string is at the beginning of the
14
+ * associated cell's value.
15
+ */
3
16
  "startsWith",
17
+ /**
18
+ * Displays the row only if the search string is at the end of the
19
+ * associated cell's value.
20
+ */
4
21
  "endsWith",
5
22
  ];
6
- export var stringFilterSchemeNames = {
7
- contains: "Contains",
8
- startsWith: "Starts With",
9
- endsWith: "Ends With",
10
- };
23
+ /**
24
+ * An array of all possible values of {@link NumberFilterScheme}.
25
+ *
26
+ * @public
27
+ */
11
28
  export var numberFilterSchemes = [
29
+ /**
30
+ * Displays the row only if the value of the cell equals the inputted number.
31
+ */
12
32
  "equals",
33
+ /**
34
+ * Displays the row only if the value of the cell is greater than the inputted
35
+ * number.
36
+ */
13
37
  "greaterThan",
38
+ /**
39
+ * Displays the row only if the value of the cell is less than the inputted
40
+ * number.
41
+ */
14
42
  "lessThan",
43
+ /**
44
+ * Displays the row only if the value of the cell is greater than or equal
45
+ * to the inputted number.
46
+ */
15
47
  "greaterOrEqual",
48
+ /**
49
+ * Displays the row only if the value of the cell is less than or equal to
50
+ * the inputted number.
51
+ */
16
52
  "lessOrEqual",
17
53
  ];
18
- export var numberFilterSchemeNames = {
19
- equals: "=",
20
- greaterThan: ">",
21
- lessThan: "<",
22
- greaterOrEqual: ">=",
23
- lessOrEqual: "<=",
24
- };
54
+ /**
55
+ * An array of all possible values for {@link DateFilterScheme}.
56
+ *
57
+ * @public
58
+ */
25
59
  export var dateFilterSchemes = ["startFrom", "endAt", "between"];
26
- export var dateFilterSchemeNames = {
27
- startFrom: "Start Form",
28
- endAt: "End At",
29
- between: "Between",
30
- };
@@ -1,3 +1,3 @@
1
- import { FilterFormState, FilterState } from "./types";
1
+ import { FilterFormState, FilterState } from "./internalTypes";
2
2
  declare const useFilterFormState: (tableFilterState: FilterState) => FilterFormState;
3
3
  export default useFilterFormState;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { IconProps } from "./internalTypes";
3
+ declare const CaretUpFill: FC<IconProps>;
4
+ export default CaretUpFill;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ var CaretUpFill = function (_a) {
3
+ var className = _a.className;
4
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", className: className, viewBox: "0 0 16 16", children: _jsx("path", { d: "M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z" }) }));
5
+ };
6
+ export default CaretUpFill;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { IconProps } from "./internalTypes";
3
+ declare const CaretUp: FC<IconProps>;
4
+ export default CaretUp;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ var CaretUp = function (_a) {
3
+ var className = _a.className;
4
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", className: className, viewBox: "0 0 16 16", children: _jsx("path", { d: "M3.204 11h9.592L8 5.519zm-.753-.659 4.796-5.48a1 1 0 0 1 1.506 0l4.796 5.48c.566.647.106 1.659-.753 1.659H3.204a1 1 0 0 1-.753-1.659" }) }));
5
+ };
6
+ export default CaretUp;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { IconProps } from "./internalTypes";
3
+ declare const CaretUpFill: FC<IconProps>;
4
+ export default CaretUpFill;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ var CaretUpFill = function (_a) {
3
+ var className = _a.className;
4
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", className: className, viewBox: "0 0 16 16", children: _jsx("path", { d: "m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z" }) }));
5
+ };
6
+ export default CaretUpFill;
@@ -0,0 +1,3 @@
1
+ export interface IconProps {
2
+ className?: string;
3
+ }
package/common/index.d.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  export * from "./editing/types";
2
- export * from "./export/types";
3
2
  export * from "./filtering/types";
4
3
  export * from "./pagination/types";
5
- export * from "./pipeline/types";
6
4
  export * from "./sorting/types";
7
5
  export * from "./styling/types";
8
- export * from "./toolbar/types";
9
6
  export * from "./selection/types";
10
7
  export * from "./types";
11
8
  export * from "./util";
package/common/index.js CHANGED
@@ -1,11 +1,8 @@
1
1
  export * from "./editing/types";
2
- export * from "./export/types";
3
2
  export * from "./filtering/types";
4
3
  export * from "./pagination/types";
5
- export * from "./pipeline/types";
6
4
  export * from "./sorting/types";
7
5
  export * from "./styling/types";
8
- export * from "./toolbar/types";
9
6
  export * from "./selection/types";
10
7
  export * from "./types";
11
8
  export * from "./util";