@absreim/react-bootstrap-data-grid 4.1.0 → 4.2.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 (84) 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/index.d.ts +0 -3
  19. package/common/index.js +0 -3
  20. package/common/internalTypes.d.ts +10 -0
  21. package/common/pagination/Pagination.d.ts +1 -1
  22. package/common/pagination/internalTypes.d.ts +8 -0
  23. package/common/pagination/internalTypes.js +1 -0
  24. package/common/pagination/types.d.ts +105 -5
  25. package/common/pipeline/{types.d.ts → internalTypes.d.ts} +5 -0
  26. package/common/pipeline/internalTypes.js +1 -0
  27. package/common/pipeline/useAugFormattedRows.d.ts +3 -2
  28. package/common/pipeline/useColNameToWidth.d.ts +2 -1
  29. package/common/pipeline/useCombinedPipeline/index.d.ts +4 -3
  30. package/common/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +2 -1
  31. package/common/pipeline/useCombinedPipeline/useCurrentPageRows.js +3 -2
  32. package/common/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +2 -1
  33. package/common/pipeline/useCombinedPipeline/useFilterStateStore.d.ts +2 -1
  34. package/common/pipeline/useGridSelectionFns.d.ts +2 -1
  35. package/common/selection/internalTypes.d.ts +34 -0
  36. package/common/selection/internalTypes.js +1 -0
  37. package/common/selection/types.d.ts +91 -17
  38. package/common/selection/types.js +0 -3
  39. package/common/sorting/internalTypes.d.ts +10 -0
  40. package/common/sorting/internalTypes.js +1 -0
  41. package/common/sorting/types.d.ts +48 -4
  42. package/common/sorting/useSortHeaderStates.d.ts +1 -1
  43. package/common/styling/types.d.ts +57 -0
  44. package/common/toolbar/Toolbar.d.ts +1 -1
  45. package/common/toolbar/ToolbarContainer.d.ts +1 -1
  46. package/common/toolbar/{types.d.ts → internalTypes.d.ts} +27 -0
  47. package/common/toolbar/internalTypes.js +1 -0
  48. package/common/toolbar/useInterfaces.d.ts +1 -1
  49. package/common/types.d.ts +165 -18
  50. package/common/util/datetime.d.ts +17 -0
  51. package/common/util/datetime.js +17 -0
  52. package/common/util/getWidthStyle.d.ts +9 -0
  53. package/common/util/getWidthStyle.js +9 -0
  54. package/common/util/index.d.ts +0 -4
  55. package/common/util/index.js +0 -4
  56. package/common/util/isSubset.d.ts +12 -1
  57. package/common/util/isSubset.js +13 -2
  58. package/common/util/useControlledHover.d.ts +5 -0
  59. package/common/util/useControlledHover.js +5 -0
  60. package/grid/focus/types.d.ts +11 -0
  61. package/grid/main/Grid.d.ts +5 -0
  62. package/grid/main/Grid.js +6 -5
  63. package/grid/main/GridBody.d.ts +1 -1
  64. package/grid/main/GridHeader.d.ts +1 -1
  65. package/grid/main/internalTypes.d.ts +29 -0
  66. package/grid/main/internalTypes.js +1 -0
  67. package/grid/main/types.d.ts +108 -19
  68. package/package.json +5 -5
  69. package/table/InternalTable.d.ts +1 -1
  70. package/table/Table.d.ts +5 -1
  71. package/table/Table.js +5 -0
  72. package/table/editing/EditableRow.d.ts +1 -1
  73. package/table/editing/EditableRow.js +1 -1
  74. package/table/internalTypes.d.ts +23 -0
  75. package/table/internalTypes.js +1 -0
  76. package/table/main/BodyRows.d.ts +4 -3
  77. package/table/main/ColHeaderCell/index.d.ts +1 -1
  78. package/table/selection/SelectAllHeaderCell.d.ts +1 -1
  79. package/table/styling/types.d.ts +122 -5
  80. package/table/types.d.ts +62 -15
  81. package/common/util/trueModulo.d.ts +0 -2
  82. package/common/util/trueModulo.js +0 -4
  83. /package/common/{pipeline/types.js → filtering/internalTypes.js} +0 -0
  84. /package/common/{toolbar/types.js → internalTypes.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, FC, ReactNode } from "react";
2
2
  import React from "react";
3
- import { CellData, RowId } from "../../common/types";
3
+ import { CellData, RowId } from "../../common";
4
4
  export type EditableRowProps = Pick<React.ComponentProps<"tr">, "onClick" | "className" | "aria-rowindex" | "aria-selected"> & {
5
5
  ariaColIndexOffset: number;
6
6
  dataRowId: RowId;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useRef, useState } from "react";
4
- import { dateToDatetimeInputStr, dateToInputStr, } from "../../common/util/datetime";
4
+ import { dateToDatetimeInputStr, dateToInputStr, } from "../../common";
5
5
  import EditControlsCell from "./EditControlsCell";
6
6
  import classNames from "classnames";
7
7
  import getWidthStyle from "../../common/util/getWidthStyle";
@@ -0,0 +1,23 @@
1
+ import { ColSortModel } from "../common/sorting/internalTypes";
2
+ import { ColDefBase } from "../common";
3
+ import { TableProps } from "./types";
4
+ /**
5
+ * All props that community and pro versions of the table have in common.
6
+ *
7
+ * @internal
8
+ */
9
+ export type BaseTableProps = Omit<TableProps, "cols"> & {
10
+ cols: ColDefBase[];
11
+ };
12
+ /**
13
+ * Props for the ColHeaderCell component.
14
+ *
15
+ * @internal
16
+ */
17
+ export interface ColHeaderCellProps {
18
+ label: string;
19
+ sortModel?: ColSortModel;
20
+ ariaColIndex: number;
21
+ additionalClasses?: string[] | null;
22
+ width?: number;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,12 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { UseGridSelectionFnsHook } from "../../common/pipeline/useGridSelectionFns";
3
3
  import { UseCombinedPipelineHook } from "../../common/pipeline/useCombinedPipeline";
4
- import { SelectModel } from "../../common/selection/types";
4
+ import { SelectModel } from "../../common";
5
5
  import { UseGetInputStrSubmitCallbackHook } from "../../common/pipeline/useGetInputStrSubmitCallback";
6
6
  import { TableStyleModel } from "../styling/types";
7
- import { AugFormattedRow, FormattedRow, RowId } from "../../common/types";
8
- import { EditModel } from "../../common/editing/types";
7
+ import { FormattedRow, RowId } from "../../common";
8
+ import { AugFormattedRow } from "../../common/internalTypes";
9
+ import { EditModel } from "../../common";
9
10
  interface BodyRowsProps {
10
11
  augFormattedRows: AugFormattedRow[];
11
12
  gridSelectionFns: UseGridSelectionFnsHook;
@@ -1,4 +1,4 @@
1
1
  import { FC } from "react";
2
- import { ColHeaderCellProps } from "../../types";
2
+ import { ColHeaderCellProps } from "../../internalTypes";
3
3
  declare const ColHeaderCell: FC<ColHeaderCellProps>;
4
4
  export default ColHeaderCell;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, FC } from "react";
2
- import { SelectionInfo } from "../../common/selection/types";
2
+ import { SelectionInfo } from "../../common/selection/internalTypes";
3
3
  interface SelectAllHeaderCellProps {
4
4
  onClick: () => void;
5
5
  selectionInfo: SelectionInfo;
@@ -1,38 +1,155 @@
1
- import { RowId } from "../../common/types";
1
+ import { RowId } from "../../common";
2
+ /**
3
+ * Style model properties shared between the main table and the filter
4
+ * options table.
5
+ *
6
+ * @public
7
+ */
2
8
  export interface SharedTableStyleModel {
9
+ /**
10
+ * Classes for the table element.
11
+ */
3
12
  table?: string[];
13
+ /**
14
+ * Classes for the tbody element.
15
+ */
4
16
  tbody?: string[];
17
+ /**
18
+ * Classes for the thead element.
19
+ */
5
20
  thead?: string[];
21
+ /**
22
+ * Classes for the sole tr element inside the thead element.
23
+ */
6
24
  theadTr?: string[];
25
+ /**
26
+ * Classes for the th elements within the thead element.
27
+ */
7
28
  theadTh?: (colIndex: number) => string[] | null;
29
+ /**
30
+ * Classes for the caption element.
31
+ */
8
32
  caption?: string[];
9
33
  }
10
- export type TableStyleModel = SharedTableStyleModel & {
34
+ /**
35
+ * Style model properties specific to the main table.
36
+ *
37
+ * @public
38
+ */
39
+ export interface MainTableSpecificStyleModel {
40
+ /**
41
+ * Classes for tr elements within the tbody element.
42
+ */
11
43
  tbodyTr?: (rowId: RowId, displayIndex: number) => string[] | null;
44
+ /**
45
+ * Classes for td elements within the tbody element.
46
+ */
12
47
  tbodyTd?: (rowId: RowId, displayRowIndex: number, colIndex: number) => string[] | null;
48
+ /**
49
+ * Classes for input elements within the tbody element.
50
+ */
13
51
  tbodyTdInput?: (rowId: RowId, displayRowIndex: number, colIndex: number) => string[] | null;
52
+ /**
53
+ * Classes for th element in the edit column.
54
+ */
14
55
  editColTh?: string[];
56
+ /**
57
+ * Classes for the td elements in the edit column.
58
+ */
15
59
  editColTd?: (rowId: RowId, displayIndex: number) => string[] | null;
60
+ /**
61
+ * Classes for the start button in the edit column.
62
+ */
16
63
  editStartButton?: (rowId: RowId, displayIndex: number) => string[] | null;
64
+ /**
65
+ * Classes for the delete button in the edit column.
66
+ */
17
67
  editDeleteButton?: (rowId: RowId, displayIndex: number) => string[] | null;
68
+ /**
69
+ * Classes for the save button in the edit column.
70
+ */
18
71
  editSaveButton?: (rowId: RowId, displayIndex: number) => string[] | null;
72
+ /**
73
+ * Classes for the cancel button in the edit column.
74
+ */
19
75
  editCancelButton?: (rowId: RowId, displayIndex: number) => string[] | null;
76
+ /**
77
+ * Classes for the th element of the row selection column.
78
+ */
20
79
  rowSelectColTh?: string[];
80
+ /**
81
+ * Classes for the td elements of the row selection column.
82
+ */
21
83
  rowSelectColTd?: (rowId: RowId, displayIndex: number) => string[] | null;
84
+ /**
85
+ * Classes for the input elements of the row selection column.
86
+ */
22
87
  rowSelectInput?: (rowId: RowId, displayIndex: number) => string[] | null;
23
- };
24
- export type FilterInputTableStyleModel = SharedTableStyleModel & {
88
+ }
89
+ /**
90
+ * Style model for the main table.
91
+ *
92
+ * @public
93
+ */
94
+ export type TableStyleModel = SharedTableStyleModel & MainTableSpecificStyleModel;
95
+ /**
96
+ * Style model properties specific to the filter inputs table.
97
+ *
98
+ * @public
99
+ */
100
+ export interface FilterTableSpecificStyleModel {
101
+ /**
102
+ * Classes for the tr elements in the tbody element.
103
+ */
25
104
  tbodyTr?: (rowIndex: number) => string[] | null;
105
+ /**
106
+ * Classes for the td elements in the tbody element.
107
+ */
26
108
  tbodyTd?: (rowIndex: number, colIndex: number) => string[] | null;
109
+ /**
110
+ * Classes for the checkboxes that enable filtering for columns.
111
+ */
27
112
  enablementInput?: (rowIndex: number) => string[] | null;
113
+ /**
114
+ * Classes for the dropdowns for selecting filter schemes.
115
+ */
28
116
  schemeSelectionInput?: (rowIndex: number) => string[] | null;
117
+ /**
118
+ * Classes for text search string input elements.
119
+ */
29
120
  searchStringInput?: (rowIndex: number) => string[] | null;
121
+ /**
122
+ * Classes for numerical input elements.
123
+ */
30
124
  numberInput?: (rowIndex: number) => string[] | null;
125
+ /**
126
+ * Classes for the state date inputs.
127
+ */
31
128
  startDateInput?: (rowIndex: number) => string[] | null;
129
+ /**
130
+ * Classes for the end date inputs.
131
+ */
32
132
  endDateInput?: (rowIndex: number) => string[] | null;
133
+ /**
134
+ * Classes for the form submit button.
135
+ */
33
136
  submitButton?: string[];
137
+ /**
138
+ * Classes for the form element.
139
+ */
34
140
  form?: string[];
35
- };
141
+ }
142
+ /**
143
+ * Style model for the filter inputs table.
144
+ *
145
+ * @public
146
+ */
147
+ export type FilterInputTableStyleModel = SharedTableStyleModel & FilterTableSpecificStyleModel;
148
+ /**
149
+ * Style model for components that are not included in other categories.
150
+ *
151
+ * @public
152
+ */
36
153
  export interface AdditionalComponentsStyleModel {
37
154
  topLevelDiv?: string[];
38
155
  tableAndPaginationDiv?: string[];
package/table/types.d.ts CHANGED
@@ -1,19 +1,66 @@
1
- import { ColSortModel } from "../common/sorting/types";
2
- import { ColDefBase, MainComponentSharedProps } from "../common/types";
3
- import { StyleModel } from "../common/styling/types";
1
+ import { EditModel, FilterModel, MainComponentSharedProps, PaginationModel, SelectModel, SortModel, StyleModel } from "../common";
2
+ /**
3
+ * Available options for the displayMode prop of {@link TableSpecificProps}.
4
+ *
5
+ * @public
6
+ */
4
7
  export type DisplayMode = "table" | "block";
5
- export type TableProps = MainComponentSharedProps & {
6
- caption?: string;
8
+ /**
9
+ * Props specific to the {@link Table} component and not the {@link Grid}
10
+ * component.
11
+ *
12
+ * @public
13
+ */
14
+ export interface TableSpecificProps {
15
+ /**
16
+ * The pagination model of the table. Passing a truthy value enables
17
+ * the pagination feature of the component.
18
+ */
19
+ pagination?: PaginationModel;
20
+ /**
21
+ * The sort model of the table. Passing a truthy value enables the
22
+ * sorting feature of the component.
23
+ */
24
+ sortModel?: SortModel;
25
+ /**
26
+ * The filter model of the table. Passing a truthy value enables the
27
+ * filtering feature of the component.
28
+ */
29
+ filterModel?: FilterModel;
30
+ /**
31
+ * The select model of the table. Passing a truthy value enables the
32
+ * selection feature of the component.
33
+ */
34
+ selectModel?: SelectModel;
35
+ /**
36
+ * The edit model of the table. Passing a truthy value enables the
37
+ * editing feature of the component.
38
+ */
39
+ editModel?: EditModel;
40
+ /**
41
+ * The style model of the table. Passing a truthy value enables the
42
+ * developer to customize the CSS classes applied to various elements of the
43
+ * table.
44
+ */
7
45
  styleModel?: StyleModel;
46
+ /**
47
+ * Enables exporting of data from the table.
48
+ */
49
+ allowExport?: boolean;
50
+ /**
51
+ * Sets a caption for the table
52
+ */
53
+ caption?: string;
54
+ /**
55
+ * Sets the CSS display property for the table element.
56
+ *
57
+ * @defaultValue `"table"`
58
+ */
8
59
  displayMode?: DisplayMode;
9
- };
10
- export type BaseTableProps = Omit<TableProps, "cols"> & {
11
- cols: ColDefBase[];
12
- };
13
- export interface ColHeaderCellProps {
14
- label: string;
15
- sortModel?: ColSortModel;
16
- ariaColIndex: number;
17
- additionalClasses?: string[] | null;
18
- width?: number;
19
60
  }
61
+ /**
62
+ * The type of the props object for the Table component.
63
+ *
64
+ * @public
65
+ */
66
+ export type TableProps = MainComponentSharedProps & TableSpecificProps;
@@ -1,2 +0,0 @@
1
- declare const trueModulo: (num: number, divisor: number) => number;
2
- export default trueModulo;
@@ -1,4 +0,0 @@
1
- var trueModulo = function (num, divisor) {
2
- return ((num % divisor) + divisor) % divisor;
3
- };
4
- export default trueModulo;
File without changes