@absreim/react-bootstrap-data-grid-pro 3.0.0 → 4.1.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 (188) hide show
  1. package/common/constants.d.ts +2 -0
  2. package/common/constants.js +2 -0
  3. package/common/editing/types.d.ts +7 -0
  4. package/{grid → common}/filtering/FilterOptionsTable.d.ts +4 -4
  5. package/{grid → common}/filtering/types.d.ts +6 -6
  6. package/common/filtering/useFilterFormState.d.ts +3 -0
  7. package/common/index.d.ts +11 -0
  8. package/common/index.js +11 -0
  9. package/{grid → common}/pagination/PageSelector.d.ts +1 -1
  10. package/{grid → common}/pagination/PageSizeSelector.d.ts +1 -1
  11. package/{grid → common}/pagination/types.d.ts +2 -1
  12. package/{grid → common}/pipeline/useAugFormattedRows.d.ts +1 -1
  13. package/common/pipeline/useColNameToWidth.d.ts +3 -0
  14. package/common/pipeline/useColNameToWidth.js +7 -0
  15. package/{grid → common}/pipeline/useCombinedPipeline/index.d.ts +4 -4
  16. package/{grid → common}/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +1 -1
  17. package/{grid → common}/pipeline/useCombinedPipeline/useDisplayRows.d.ts +1 -1
  18. package/{grid → common}/pipeline/useCombinedPipeline/useDisplayRows.js +1 -2
  19. package/common/pipeline/useCombinedPipeline/useFilter.d.ts +4 -0
  20. package/common/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +4 -0
  21. package/{grid → common}/pipeline/useCombinedPipeline/useSortedRows.d.ts +2 -2
  22. package/{grid → common}/pipeline/useGridSelectionFns.d.ts +2 -2
  23. package/{grid → common}/sorting/types.d.ts +3 -3
  24. package/{grid/main/ColHeaderCell → common/sorting}/useSortHeaderStates.d.ts +2 -2
  25. package/{grid/main/ColHeaderCell → common/sorting}/useSortHeaderStates.js +4 -4
  26. package/common/styling/types.d.ts +21 -0
  27. package/{grid → common}/types.d.ts +21 -30
  28. package/common/util/index.d.ts +5 -0
  29. package/common/util/index.js +5 -0
  30. package/grid/constants.d.ts +2 -0
  31. package/grid/constants.js +2 -0
  32. package/grid/focus/types.d.ts +4 -0
  33. package/grid/focus/useGridFocus.d.ts +10 -0
  34. package/grid/focus/useGridFocus.js +130 -0
  35. package/grid/index.d.ts +3 -10
  36. package/grid/index.js +3 -10
  37. package/grid/{Grid.d.ts → main/Grid.d.ts} +0 -1
  38. package/grid/main/Grid.js +76 -0
  39. package/grid/main/GridBody.d.ts +4 -0
  40. package/grid/main/GridBody.js +26 -0
  41. package/grid/main/GridHeader.d.ts +4 -0
  42. package/grid/main/GridHeader.js +15 -0
  43. package/grid/main/getWidthStyles.d.ts +3 -0
  44. package/grid/main/getWidthStyles.js +6 -0
  45. package/grid/main/types.d.ts +41 -0
  46. package/grid.css +1 -0
  47. package/grid.scss +243 -0
  48. package/package.json +1 -1
  49. package/pro/index.d.ts +5 -0
  50. package/pro/index.js +5 -0
  51. package/{grid/InternalGrid.d.ts → table/InternalTable.d.ts} +6 -6
  52. package/{grid/InternalGrid.js → table/InternalTable.js} +7 -7
  53. package/table/Table.d.ts +5 -0
  54. package/{grid/Grid.js → table/Table.js} +10 -14
  55. package/{grid → table}/editing/EditableRow.d.ts +1 -2
  56. package/{grid → table}/editing/EditableRow.js +2 -2
  57. package/table/index.d.ts +5 -0
  58. package/table/index.js +5 -0
  59. package/{grid → table}/main/BodyRows.d.ts +7 -7
  60. package/{grid → table}/main/BodyRows.js +1 -1
  61. package/{grid → table}/main/ColHeaderCell/index.js +3 -3
  62. package/{grid → table}/selection/SelectAllHeaderCell.d.ts +1 -1
  63. package/table/style.scss +3 -0
  64. package/{grid → table}/styling/types.d.ts +1 -21
  65. package/table/styling/types.js +1 -0
  66. package/table/types.d.ts +19 -0
  67. package/table/types.js +1 -0
  68. package/{grid-pro → table-pro}/ColHeaderCellPro.js +4 -4
  69. package/table-pro/TablePro.d.ts +4 -0
  70. package/{grid-pro/GridPro.js → table-pro/TablePro.js} +9 -9
  71. package/{grid-pro → table-pro}/index.d.ts +2 -2
  72. package/{grid-pro → table-pro}/index.js +2 -2
  73. package/{grid-pro → table-pro}/reorder/ReorderHandleCell.js +1 -1
  74. package/{grid-pro → table-pro}/reorder/useKeyboardReorder.js +1 -1
  75. package/table-pro/resize/types.js +1 -0
  76. package/{grid-pro → table-pro}/resize/useResizeModel.d.ts +1 -1
  77. package/table-pro/style.scss +69 -0
  78. package/{grid-pro → table-pro}/types.d.ts +3 -3
  79. package/table-pro/types.js +1 -0
  80. package/table-pro.scss +1 -0
  81. package/grid/editing/types.d.ts +0 -16
  82. package/grid/filtering/useFilterFormState.d.ts +0 -3
  83. package/grid/pipeline/useCombinedPipeline/useFilter.d.ts +0 -4
  84. package/grid/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +0 -4
  85. package/grid-pro/GridPro.d.ts +0 -4
  86. /package/{grid → common}/editing/inputStrsToRowData.d.ts +0 -0
  87. /package/{grid → common}/editing/inputStrsToRowData.js +0 -0
  88. /package/{grid-pro/reorder → common/editing}/types.js +0 -0
  89. /package/{grid → common}/export/ExportForm.d.ts +0 -0
  90. /package/{grid → common}/export/ExportForm.js +0 -0
  91. /package/{grid → common}/export/types.d.ts +0 -0
  92. /package/{grid-pro/resize → common/export}/types.js +0 -0
  93. /package/{grid → common}/export/useExportFn.d.ts +0 -0
  94. /package/{grid → common}/export/useExportFn.js +0 -0
  95. /package/{grid → common}/filtering/DateFilterRow.d.ts +0 -0
  96. /package/{grid → common}/filtering/DateFilterRow.js +0 -0
  97. /package/{grid → common}/filtering/FilterOptionsTable.js +0 -0
  98. /package/{grid → common}/filtering/FilterRow.d.ts +0 -0
  99. /package/{grid → common}/filtering/FilterRow.js +0 -0
  100. /package/{grid → common}/filtering/NumberFilterRow.d.ts +0 -0
  101. /package/{grid → common}/filtering/NumberFilterRow.js +0 -0
  102. /package/{grid → common}/filtering/StringFilterRow.d.ts +0 -0
  103. /package/{grid → common}/filtering/StringFilterRow.js +0 -0
  104. /package/{grid → common}/filtering/types.js +0 -0
  105. /package/{grid → common}/filtering/useFilterFormState.js +0 -0
  106. /package/{grid → common}/pagination/PageSelector.js +0 -0
  107. /package/{grid → common}/pagination/PageSizeSelector.js +0 -0
  108. /package/{grid → common}/pagination/Pagination.d.ts +0 -0
  109. /package/{grid → common}/pagination/Pagination.js +0 -0
  110. /package/{grid-pro → common/pagination}/types.js +0 -0
  111. /package/{grid → common}/pipeline/types.d.ts +0 -0
  112. /package/{grid-pro/util → common/pipeline}/types.js +0 -0
  113. /package/{grid → common}/pipeline/useAugFormattedRows.js +0 -0
  114. /package/{grid → common}/pipeline/useCombinedPipeline/index.js +0 -0
  115. /package/{grid → common}/pipeline/useCombinedPipeline/useCurrentPageRows.js +0 -0
  116. /package/{grid → common}/pipeline/useCombinedPipeline/useFilter.js +0 -0
  117. /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateFromEditable.js +0 -0
  118. /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateStore.d.ts +0 -0
  119. /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateStore.js +0 -0
  120. /package/{grid → common}/pipeline/useCombinedPipeline/useSortedRows.js +0 -0
  121. /package/{grid → common}/pipeline/useGetInputStrSubmitCallback.d.ts +0 -0
  122. /package/{grid → common}/pipeline/useGetInputStrSubmitCallback.js +0 -0
  123. /package/{grid → common}/pipeline/useGridSelectionFns.js +0 -0
  124. /package/{grid → common}/selection/types.d.ts +0 -0
  125. /package/{grid → common}/selection/types.js +0 -0
  126. /package/{grid → common}/sorting/arrowPlaceholder.d.ts +0 -0
  127. /package/{grid → common}/sorting/arrowPlaceholder.js +0 -0
  128. /package/{grid → common}/sorting/downArrow.d.ts +0 -0
  129. /package/{grid → common}/sorting/downArrow.js +0 -0
  130. /package/{grid → common}/sorting/sortOrderToAriaSort.d.ts +0 -0
  131. /package/{grid → common}/sorting/sortOrderToAriaSort.js +0 -0
  132. /package/{grid/editing → common/sorting}/types.js +0 -0
  133. /package/{grid → common}/sorting/upArrow.d.ts +0 -0
  134. /package/{grid → common}/sorting/upArrow.js +0 -0
  135. /package/{grid/export → common/styling}/types.js +0 -0
  136. /package/{grid → common}/toolbar/Toolbar.d.ts +0 -0
  137. /package/{grid → common}/toolbar/Toolbar.js +0 -0
  138. /package/{grid → common}/toolbar/ToolbarContainer.d.ts +0 -0
  139. /package/{grid → common}/toolbar/ToolbarContainer.js +0 -0
  140. /package/{grid → common}/toolbar/types.d.ts +0 -0
  141. /package/{grid/pagination → common/toolbar}/types.js +0 -0
  142. /package/{grid → common}/toolbar/useInterfaces.d.ts +0 -0
  143. /package/{grid → common}/toolbar/useInterfaces.js +0 -0
  144. /package/{grid/pipeline → common}/types.js +0 -0
  145. /package/{grid → common}/util/datetime.d.ts +0 -0
  146. /package/{grid → common}/util/datetime.js +0 -0
  147. /package/{grid → common}/util/getWidthStyle.d.ts +0 -0
  148. /package/{grid → common}/util/getWidthStyle.js +0 -0
  149. /package/{grid → common}/util/isSubset.d.ts +0 -0
  150. /package/{grid → common}/util/isSubset.js +0 -0
  151. /package/{grid → common}/util/trueModulo.d.ts +0 -0
  152. /package/{grid → common}/util/trueModulo.js +0 -0
  153. /package/{grid → common}/util/useControlledHover.d.ts +0 -0
  154. /package/{grid → common}/util/useControlledHover.js +0 -0
  155. /package/grid/{sorting → focus}/types.js +0 -0
  156. /package/grid/{styling → main}/types.js +0 -0
  157. /package/{grid → table}/editing/EditControlsCell.d.ts +0 -0
  158. /package/{grid → table}/editing/EditControlsCell.js +0 -0
  159. /package/{grid → table}/main/ColHeaderCell/index.d.ts +0 -0
  160. /package/{grid → table}/selection/SelectAllHeaderCell.js +0 -0
  161. /package/{grid → table}/selection/SelectionInput.d.ts +0 -0
  162. /package/{grid → table}/selection/SelectionInput.js +0 -0
  163. /package/{grid-pro → table-pro}/ColHeaderCellPro.d.ts +0 -0
  164. /package/{grid-pro → table-pro}/assets/HorizontalGrip.d.ts +0 -0
  165. /package/{grid-pro → table-pro}/assets/HorizontalGrip.js +0 -0
  166. /package/{grid-pro → table-pro}/assets/VerticalGrip.d.ts +0 -0
  167. /package/{grid-pro → table-pro}/assets/VerticalGrip.js +0 -0
  168. /package/{grid-pro/util → table-pro/lib}/regDragCleanup.d.ts +0 -0
  169. /package/{grid-pro/util → table-pro/lib}/regDragCleanup.js +0 -0
  170. /package/{grid-pro/util → table-pro/lib}/types.d.ts +0 -0
  171. /package/{grid/toolbar → table-pro/lib}/types.js +0 -0
  172. /package/{grid-pro → table-pro}/reorder/ReorderHandleCell.d.ts +0 -0
  173. /package/{grid-pro → table-pro}/reorder/ReorderHeaderCell.d.ts +0 -0
  174. /package/{grid-pro → table-pro}/reorder/ReorderHeaderCell.js +0 -0
  175. /package/{grid-pro → table-pro}/reorder/types.d.ts +0 -0
  176. /package/{grid → table-pro/reorder}/types.js +0 -0
  177. /package/{grid-pro → table-pro}/reorder/useKeyboardReorder.d.ts +0 -0
  178. /package/{grid-pro → table-pro}/reorder/useKeyboardReorderListener.d.ts +0 -0
  179. /package/{grid-pro → table-pro}/reorder/useKeyboardReorderListener.js +0 -0
  180. /package/{grid-pro → table-pro}/reorder/useReorderStyles.d.ts +0 -0
  181. /package/{grid-pro → table-pro}/reorder/useReorderStyles.js +0 -0
  182. /package/{grid-pro → table-pro}/resize/types.d.ts +0 -0
  183. /package/{grid-pro → table-pro}/resize/useResizeModel.js +0 -0
  184. /package/{grid-pro → table-pro}/util/index.d.ts +0 -0
  185. /package/{grid-pro → table-pro}/util/index.js +0 -0
  186. /package/{grid-pro → table-pro}/util/reorderRows.d.ts +0 -0
  187. /package/{grid-pro → table-pro}/util/reorderRows.js +0 -0
  188. /package/{style.css → table-pro.css} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import EditableRow from "../editing/EditableRow";
3
3
  import classNames from "classnames";
4
- import getWidthStyle from "../util/getWidthStyle";
4
+ import getWidthStyle from "../../common/util/getWidthStyle";
5
5
  import SelectionInput from "../selection/SelectionInput";
6
6
  const BodyRows = ({ augFormattedRows, gridSelectionFns: { selectedSet, getSelectInputModel, getSelectHandler, getRowClickHandler, getAriaSelectedValue, }, tableStyleModel, combinedPipelineOutput: { showSelectCol, ariaColIndexOffset }, selectModel, editModel, getInputStrSubmitCallback, additionalColIndexOffset, renderPrefixCells, additionalRowStyles, }) => augFormattedRows.map((row, index) => {
7
7
  return (_jsxs(EditableRow, { onClick: getRowClickHandler(row.id), className: classNames({
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import classNames from "classnames";
4
- import getWidthStyle from "../../util/getWidthStyle";
5
- import useSortHeaderStates from "./useSortHeaderStates";
6
- import sortOrderToAriaSort from "../../sorting/sortOrderToAriaSort";
4
+ import getWidthStyle from "../../../common/util/getWidthStyle";
5
+ import useSortHeaderStates from "../../../common/sorting/useSortHeaderStates";
6
+ import sortOrderToAriaSort from "../../../common/sorting/sortOrderToAriaSort";
7
7
  const ColHeaderCell = ({ label, sortModel, ariaColIndex, additionalClasses, width, }) => {
8
8
  const { handleClick, handleMouseOver, handleMouseOut, sortSymbol } = useSortHeaderStates(sortModel);
9
9
  return (_jsxs("th", { className: classNames({
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, FC } from "react";
2
- import { SelectionInfo } from "./types";
2
+ import { SelectionInfo } from "../../common/selection/types";
3
3
  interface SelectAllHeaderCellProps {
4
4
  onClick: () => void;
5
5
  selectionInfo: SelectionInfo;
@@ -0,0 +1,3 @@
1
+ .rbdg-sort-toggler {
2
+ cursor: pointer;
3
+ }
@@ -1,4 +1,4 @@
1
- import { RowId } from "../types";
1
+ import { RowId } from "../../common/types";
2
2
  export interface SharedTableStyleModel {
3
3
  table?: string[];
4
4
  tbody?: string[];
@@ -39,23 +39,3 @@ export interface AdditionalComponentsStyleModel {
39
39
  tableDiv?: string[];
40
40
  paginationUiDiv?: string[];
41
41
  }
42
- export interface ToolbarStyleModel {
43
- activeButton?: string[];
44
- inactiveButton?: string[];
45
- toolbar?: string[];
46
- interfaceContainer?: string[];
47
- }
48
- export interface ExportFormStyleModel {
49
- legend?: string[];
50
- radioContainer?: string[];
51
- radioInput?: string[];
52
- radioLabel?: string[];
53
- submitButton?: string[];
54
- }
55
- export interface StyleModel {
56
- mainTableStyleModel?: TableStyleModel;
57
- filterInputTableStyleModel?: FilterInputTableStyleModel;
58
- additionalComponentsStyleModel?: AdditionalComponentsStyleModel;
59
- toolbarStyleModel?: ToolbarStyleModel;
60
- exportFormStyleModel?: ExportFormStyleModel;
61
- }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ColSortModel } from "../common/sorting/types";
2
+ import { ColDefBase, MainComponentSharedProps } from "../common/types";
3
+ import { StyleModel } from "../common/styling/types";
4
+ export type DisplayMode = "table" | "block";
5
+ export type TableProps = MainComponentSharedProps & {
6
+ caption?: string;
7
+ styleModel?: StyleModel;
8
+ 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
+ }
package/table/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -2,11 +2,11 @@
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useMemo, useRef, } from "react";
4
4
  import classNames from "classnames";
5
- import getWidthStyle from "../grid/util/getWidthStyle";
6
- import useSortHeaderStates from "../grid/main/ColHeaderCell/useSortHeaderStates";
5
+ import getWidthStyle from "../common/util/getWidthStyle";
6
+ import useSortHeaderStates from "../common/sorting/useSortHeaderStates";
7
7
  import VerticalGrip from "./assets/VerticalGrip";
8
- import regDragCleanup from "./util/regDragCleanup";
9
- import sortOrderToAriaSort from "../grid/sorting/sortOrderToAriaSort";
8
+ import regDragCleanup from "./lib/regDragCleanup";
9
+ import sortOrderToAriaSort from "../common/sorting/sortOrderToAriaSort";
10
10
  const setWidthStyle = (cells, width) => {
11
11
  cells.forEach((cell) => {
12
12
  cell.style.minWidth = `${width}px`;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { TableProProps } from "./types";
3
+ declare const TablePro: FC<TableProProps>;
4
+ export default TablePro;
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect, useMemo } from "react";
4
- import useCombinedPipeline from "../grid/pipeline/useCombinedPipeline";
5
- import InternalGrid from "../grid/InternalGrid";
4
+ import useCombinedPipeline from "../common/pipeline/useCombinedPipeline";
5
+ import InternalTable from "../table/InternalTable";
6
6
  import ColHeaderCellPro from "./ColHeaderCellPro";
7
- import useGridSelectionFns from "../grid/pipeline/useGridSelectionFns";
8
- import useGetInputStrSubmitCallback from "../grid/pipeline/useGetInputStrSubmitCallback";
9
- import useAugFormattedRows from "../grid/pipeline/useAugFormattedRows";
7
+ import useGridSelectionFns from "../common/pipeline/useGridSelectionFns";
8
+ import useGetInputStrSubmitCallback from "../common/pipeline/useGetInputStrSubmitCallback";
9
+ import useAugFormattedRows from "../common/pipeline/useAugFormattedRows";
10
10
  import useResizeModel from "./resize/useResizeModel";
11
- import BodyRows from "../grid/main/BodyRows";
11
+ import BodyRows from "../table/main/BodyRows";
12
12
  import ReorderHeaderCell from "./reorder/ReorderHeaderCell";
13
13
  import ReorderHandleCell from "./reorder/ReorderHandleCell";
14
14
  import useKeyboardReorder from "./reorder/useKeyboardReorder";
15
15
  import useReorderStyles from "./reorder/useReorderStyles";
16
16
  import useKeyboardReorderListener from "./reorder/useKeyboardReorderListener";
17
- const GridPro = (props) => {
17
+ const TablePro = (props) => {
18
18
  const { rows, cols, editModel, filterModel, sortModel, pagination, selectModel, styleModel, displayMode, reorder, } = props;
19
19
  const combinedPipelineOutput = useCombinedPipeline({
20
20
  rows,
@@ -117,11 +117,11 @@ const GridPro = (props) => {
117
117
  ]);
118
118
  const bodyRows = (_jsx(BodyRows, { augFormattedRows: augFormattedRows, gridSelectionFns: gridSelectionFns, selectModel: selectModel, combinedPipelineOutput: combinedPipelineOutput, editModel: editModel, getInputStrSubmitCallback: getInputStrSubmitCallback, renderPrefixCells: renderPrefixCells, additionalColIndexOffset: reorder ? 1 : 0, additionalRowStyles: additionalBodyRowStyles, tableStyleModel: styleModel === null || styleModel === void 0 ? void 0 : styleModel.mainTableStyleModel }));
119
119
  const prefixHeader = reorder ? _jsx(ReorderHeaderCell, {}) : null;
120
- return (_jsx(InternalGrid, { gridProps: props, hooks: {
120
+ return (_jsx(InternalTable, { gridProps: props, hooks: {
121
121
  pipelineOutput: combinedPipelineOutput,
122
122
  selectFns: gridSelectionFns,
123
123
  }, slots: { colHeaderCells, bodyRows, prefixHeader }, classes: {
124
124
  headerRow: additionalHeaderRowStyles,
125
125
  } }));
126
126
  };
127
- export default GridPro;
127
+ export default TablePro;
@@ -1,5 +1,5 @@
1
- export * from "../grid";
2
- export { default } from "./GridPro";
1
+ export * from "../table";
2
+ export { default } from "./TablePro";
3
3
  export * from "./types";
4
4
  export * from "./util";
5
5
  export * from "./reorder/types";
@@ -1,5 +1,5 @@
1
- export * from "../grid";
2
- export { default } from "./GridPro";
1
+ export * from "../table";
2
+ export { default } from "./TablePro";
3
3
  export * from "./types";
4
4
  export * from "./util";
5
5
  export * from "./reorder/types";
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback, } from "react";
3
3
  import HorizontalGrip from "../assets/HorizontalGrip";
4
- import regDragCleanup from "../util/regDragCleanup";
4
+ import regDragCleanup from "../lib/regDragCleanup";
5
5
  import classNames from "classnames";
6
6
  function dropTargetRefValuesEqual(first, second) {
7
7
  if (first === null && second === null) {
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useMemo, useState } from "react";
2
- import trueModulo from "../../grid/util/trueModulo";
2
+ import trueModulo from "../../common/util/trueModulo";
3
3
  const useKeyboardReorder = (displayRowIds) => {
4
4
  const [state, setState] = useState(null);
5
5
  // A change the displayed rows can suddenly make the existing state invalid.
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { ProColDef } from "../types";
2
- import { DisplayMode } from "../../grid";
2
+ import { DisplayMode } from "../../table";
3
3
  import { ResizeModel } from "./types";
4
4
  declare const useResizeModel: (cols: Pick<ProColDef, "resizeable" | "width" | "name">[], display: DisplayMode | undefined) => ResizeModel;
5
5
  export default useResizeModel;
@@ -0,0 +1,69 @@
1
+ @use "../table/style";
2
+
3
+ .rbdg-draggable-container {
4
+ width: 1rem;
5
+ height: 1rem;
6
+ touch-action: none;
7
+ }
8
+
9
+ .rbdg-draggable-icon {
10
+ pointer-events: none;
11
+ }
12
+
13
+ .rbdg-resize-container {
14
+ cursor: col-resize;
15
+ }
16
+
17
+ .rbdg-reorder-container {
18
+ cursor: grab !important;
19
+
20
+ &:active {
21
+ cursor: grabbing !important;
22
+ }
23
+ }
24
+
25
+ // Typical button reset to make it look like a plain div
26
+ .rbdg-plain-icon-button {
27
+ display: inline-flex;
28
+ padding: 0;
29
+ margin: 0;
30
+ border: none;
31
+
32
+ background: none;
33
+ color: inherit;
34
+ font: inherit;
35
+
36
+ -webkit-appearance: none;
37
+ appearance: none;
38
+
39
+ &:disabled {
40
+ pointer-events: none;
41
+ opacity: 0.65;
42
+ }
43
+ }
44
+
45
+ .rbdg-drag-ghost {
46
+ opacity: 75%;
47
+ position: fixed;
48
+ padding: 0.5rem;
49
+ z-index: 2; // float above toolbar panels
50
+ }
51
+
52
+ .rbdg-reorder-dragged-row-pred {
53
+ border-bottom-color: var(--bs-success);
54
+ }
55
+
56
+ .rbdg-reorder-dragged-row {
57
+ border-top-width: 1px;
58
+ opacity: 50%;
59
+ border-color: var(--bs-success);
60
+ }
61
+
62
+ .rbdg-reorder-above-drag-target-row {
63
+ border-bottom-color: var(--bs-primary);
64
+ }
65
+
66
+ .rbdg-reorder-below-drag-target-row {
67
+ border-top-width: 1px;
68
+ border-top-color: var(--bs-primary);
69
+ }
@@ -1,4 +1,4 @@
1
- import { ColDef, ColDefBase, ColHeaderCellProps, GridProps, StyleModel } from "../grid";
1
+ import { ColDef, ColDefBase, ColHeaderCellProps, TableProps, StyleModel } from "../table";
2
2
  import { ReorderModel, ReorderStyleModel } from "./reorder/types";
3
3
  export type ProColDef<ValueType = any> = ColDefBase<ValueType> & {
4
4
  resizeable?: boolean;
@@ -7,12 +7,12 @@ export type ProColDef<ValueType = any> = ColDefBase<ValueType> & {
7
7
  maxResizeWidth?: number;
8
8
  keyboardResizeStep?: number;
9
9
  };
10
- export type GridProProps = Omit<GridProps, "cols" | "styleModel"> & {
10
+ export type TableProProps = Omit<TableProps, "cols" | "styleModel"> & {
11
11
  cols: ProColDef[];
12
12
  reorder?: ReorderModel;
13
13
  styleModel?: ProStyleModel;
14
14
  };
15
- export type ColHeaderCellProProps = ColHeaderCellProps & Pick<GridProps, "displayMode"> & {
15
+ export type ColHeaderCellProProps = ColHeaderCellProps & Pick<TableProps, "displayMode"> & {
16
16
  setWidth?: (width: number) => void;
17
17
  } & Pick<ProColDef, "minResizeWidth" | "maxResizeWidth" | "keyboardResizeStep">;
18
18
  export interface WidthModel {
@@ -0,0 +1 @@
1
+ export {};
package/table-pro.scss ADDED
@@ -0,0 +1 @@
1
+ @use "./table-pro/style";
@@ -1,16 +0,0 @@
1
- import { ColDataType, ColDataTypeStrings, RowData, RowId } from "../types";
2
- export interface CellData {
3
- fieldName: string;
4
- value: ColDataType;
5
- type: ColDataTypeStrings;
6
- ariaColIndex: number;
7
- formattedValue: string;
8
- label: string;
9
- width?: number;
10
- }
11
- export type UpdateCallbackGenerator = (id: RowId) => (rowData: RowData) => void;
12
- export interface EditModel {
13
- getUpdateCallback: UpdateCallbackGenerator;
14
- getDeleteCallback?: (id: RowId) => () => void;
15
- editColWidth?: number;
16
- }
@@ -1,3 +0,0 @@
1
- import { FilterFormState, TableFilterState } from "./types";
2
- declare const useFilterFormState: (tableFilterState: TableFilterState) => FilterFormState;
3
- export default useFilterFormState;
@@ -1,4 +0,0 @@
1
- import { AugRowDef, RowDef } from "../../types";
2
- import { EditableTableFilterState } from "../../filtering/types";
3
- declare const useFilter: (rows: RowDef[], filterState: EditableTableFilterState | null) => AugRowDef[];
4
- export default useFilter;
@@ -1,4 +0,0 @@
1
- import { ColDef } from "../../types";
2
- import { EditableTableFilterState, TableFilterState } from "../../filtering/types";
3
- declare const useFilterStateFromEditable: (colDefs: ColDef[], editableFilterState: EditableTableFilterState | null) => TableFilterState | null;
4
- export default useFilterStateFromEditable;
@@ -1,4 +0,0 @@
1
- import { FC } from "react";
2
- import { GridProProps } from "./types";
3
- declare const GridPro: FC<GridProProps>;
4
- export default GridPro;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes