@absreim/react-bootstrap-data-grid-pro 2.6.1 → 3.0.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 (55) hide show
  1. package/grid/Grid.js +1 -4
  2. package/grid/InternalGrid.d.ts +3 -2
  3. package/grid/InternalGrid.js +31 -29
  4. package/grid/editing/EditControlsCell.d.ts +5 -5
  5. package/grid/editing/EditControlsCell.js +1 -9
  6. package/grid/editing/EditableRow.d.ts +7 -7
  7. package/grid/editing/EditableRow.js +1 -1
  8. package/grid/export/ExportForm.d.ts +1 -0
  9. package/grid/export/ExportForm.js +3 -3
  10. package/grid/filtering/DateFilterRow.d.ts +4 -4
  11. package/grid/filtering/DateFilterRow.js +1 -1
  12. package/grid/filtering/FilterOptionsTable.d.ts +1 -0
  13. package/grid/filtering/FilterOptionsTable.js +14 -8
  14. package/grid/filtering/FilterRow.d.ts +4 -4
  15. package/grid/filtering/FilterRow.js +1 -1
  16. package/grid/filtering/NumberFilterRow.d.ts +3 -3
  17. package/grid/filtering/NumberFilterRow.js +1 -1
  18. package/grid/filtering/StringFilterRow.d.ts +3 -3
  19. package/grid/filtering/StringFilterRow.js +1 -1
  20. package/grid/main/BodyRows.d.ts +4 -3
  21. package/grid/main/BodyRows.js +18 -2
  22. package/grid/pagination/Pagination.d.ts +1 -1
  23. package/grid/pagination/Pagination.js +6 -3
  24. package/grid/pagination/types.d.ts +1 -1
  25. package/grid/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +2 -2
  26. package/grid/selection/SelectAllHeaderCell.d.ts +1 -1
  27. package/grid/selection/SelectAllHeaderCell.js +2 -4
  28. package/grid/selection/SelectionInput.d.ts +2 -1
  29. package/grid/selection/SelectionInput.js +2 -2
  30. package/grid/styling/types.d.ts +20 -21
  31. package/grid/toolbar/ToolbarContainer.d.ts +2 -2
  32. package/grid/toolbar/ToolbarContainer.js +11 -7
  33. package/grid/toolbar/types.d.ts +8 -0
  34. package/grid/toolbar/useInterfaces.d.ts +2 -8
  35. package/grid/toolbar/useInterfaces.js +9 -5
  36. package/grid/types.d.ts +5 -6
  37. package/grid/util/trueModulo.d.ts +2 -0
  38. package/grid/util/trueModulo.js +2 -0
  39. package/grid-pro/GridPro.js +69 -8
  40. package/grid-pro/reorder/ReorderHandleCell.d.ts +4 -3
  41. package/grid-pro/reorder/ReorderHandleCell.js +28 -29
  42. package/grid-pro/reorder/types.d.ts +15 -0
  43. package/grid-pro/reorder/useKeyboardReorder.d.ts +4 -0
  44. package/grid-pro/reorder/useKeyboardReorder.js +84 -0
  45. package/grid-pro/reorder/useKeyboardReorderListener.d.ts +3 -0
  46. package/grid-pro/reorder/useKeyboardReorderListener.js +26 -0
  47. package/grid-pro/reorder/useReorderStyles.d.ts +3 -0
  48. package/grid-pro/reorder/useReorderStyles.js +20 -0
  49. package/package.json +1 -1
  50. package/grid/main/ToggleButton.d.ts +0 -9
  51. package/grid/main/ToggleButton.js +0 -13
  52. package/grid/pipeline/useUnwrappedGridStyles.d.ts +0 -7
  53. package/grid/pipeline/useUnwrappedGridStyles.js +0 -15
  54. package/grid/styling/styleModelUnwrappers.d.ts +0 -4
  55. package/grid/styling/styleModelUnwrappers.js +0 -47
@@ -0,0 +1,3 @@
1
+ import { ReorderStyleModel, ReorderStyles } from "./types";
2
+ declare const useReorderStyles: (styleModel: ReorderStyleModel | undefined) => ReorderStyles;
3
+ export default useReorderStyles;
@@ -0,0 +1,20 @@
1
+ import { useMemo } from "react";
2
+ const useReorderStyles = (styleModel) => {
3
+ const draggedRowClasses = useMemo(() => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.draggedRowClasses) || ["rbdg-reorder-dragged-row"], [styleModel === null || styleModel === void 0 ? void 0 : styleModel.draggedRowClasses]);
4
+ const draggedRowPredecessorClasses = useMemo(() => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.draggedRowPredecessorClasses) || [
5
+ "rbdg-reorder-dragged-row-pred",
6
+ ], [styleModel === null || styleModel === void 0 ? void 0 : styleModel.draggedRowPredecessorClasses]);
7
+ const topBorderRowClasses = useMemo(() => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.topBorderRowClasses) || ["rbdg-reorder-above-drag-target-row"], [styleModel === null || styleModel === void 0 ? void 0 : styleModel.topBorderRowClasses]);
8
+ const bottomBorderRowClasses = useMemo(() => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.bottomBorderRowClasses) || [
9
+ "rbdg-reorder-below-drag-target-row",
10
+ ], [styleModel === null || styleModel === void 0 ? void 0 : styleModel.bottomBorderRowClasses]);
11
+ const ghostDivClasses = useMemo(() => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.ghostDivClasses) || ["border", "rbdg-drag-ghost"], [styleModel === null || styleModel === void 0 ? void 0 : styleModel.ghostDivClasses]);
12
+ return {
13
+ draggedRowClasses,
14
+ draggedRowPredecessorClasses,
15
+ topBorderRowClasses,
16
+ bottomBorderRowClasses,
17
+ ghostDivClasses,
18
+ };
19
+ };
20
+ export default useReorderStyles;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@absreim/react-bootstrap-data-grid-pro",
3
3
  "description": "Pro Version of data grid UI component for use with web apps using React and Bootstrap",
4
- "version": "2.6.1",
4
+ "version": "3.0.0",
5
5
  "license": "Commercial. See LICENSE file.",
6
6
  "author": "Brook Li",
7
7
  "homepage": "https://react-bootstrap-data-grid.vercel.app/",
@@ -1,9 +0,0 @@
1
- import { FC } from "react";
2
- export interface ToggleButtonProps {
3
- isActive: boolean;
4
- label: string;
5
- onClick: () => void;
6
- classes?: string[];
7
- }
8
- declare const ToggleButton: FC<ToggleButtonProps>;
9
- export default ToggleButton;
@@ -1,13 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import classNames from "classnames";
4
- const ToggleButton = ({ isActive, label, onClick, classes, }) => {
5
- const baseClasses = ["btn"];
6
- const variableClasses = {
7
- active: isActive,
8
- };
9
- return (_jsx("button", { type: "button", className: classNames(baseClasses, variableClasses, classes, {
10
- "btn-primary": !(classes && classes.length > 0),
11
- }), "aria-pressed": isActive, onClick: onClick, children: label }));
12
- };
13
- export default ToggleButton;
@@ -1,7 +0,0 @@
1
- import { AdditionalComponentsStyleModel, StyleModel, TableStyleModel } from "../styling/types";
2
- export interface UseUnwrappedGridStylesHook {
3
- unwrappedTableModel: Required<TableStyleModel>;
4
- unwrappedAdditionalStyleModel: Required<AdditionalComponentsStyleModel>;
5
- }
6
- declare const UseUnwrappedGridStyles: (styleModel: StyleModel | undefined) => UseUnwrappedGridStylesHook;
7
- export default UseUnwrappedGridStyles;
@@ -1,15 +0,0 @@
1
- import { useMemo } from "react";
2
- import { unwrapAdditionalComponentsStyleModel, unwrapTableStyleModel, } from "../styling/styleModelUnwrappers";
3
- const UseUnwrappedGridStyles = (styleModel) => {
4
- // To give the developer the ability to specify between removing existing styles
5
- // and simply adding additional ones, we should migrate off of this "unwrapped"
6
- // design over time and instead apply logic based on the original params that
7
- // can be undefined.
8
- const unwrappedTableModel = useMemo(() => unwrapTableStyleModel(styleModel === null || styleModel === void 0 ? void 0 : styleModel.mainTableStyleModel), [styleModel === null || styleModel === void 0 ? void 0 : styleModel.mainTableStyleModel]);
9
- const unwrappedAdditionalStyleModel = useMemo(() => unwrapAdditionalComponentsStyleModel(styleModel === null || styleModel === void 0 ? void 0 : styleModel.additionalComponentsStyleModel), [styleModel === null || styleModel === void 0 ? void 0 : styleModel.additionalComponentsStyleModel]);
10
- return {
11
- unwrappedTableModel,
12
- unwrappedAdditionalStyleModel,
13
- };
14
- };
15
- export default UseUnwrappedGridStyles;
@@ -1,4 +0,0 @@
1
- import { AdditionalComponentsStyleModel, FilterInputTableStyleModel, TableStyleModel } from "./types";
2
- export declare const unwrapTableStyleModel: (tableStyleModel: TableStyleModel | undefined) => Required<TableStyleModel>;
3
- export declare const unwrapFilterInputTableStyleModel: (filterTableStyleModel: FilterInputTableStyleModel | undefined) => Required<FilterInputTableStyleModel>;
4
- export declare const unwrapAdditionalComponentsStyleModel: (styleModel: AdditionalComponentsStyleModel | undefined) => Required<AdditionalComponentsStyleModel>;
@@ -1,47 +0,0 @@
1
- const unwrapSharedStyleModel = (sharedStyleModel) => ({
2
- table: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.table) || [],
3
- tbody: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.tbody) || [],
4
- thead: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.thead) || [],
5
- theadTr: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.theadTr) || [],
6
- theadTh: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.theadTh) ? sharedStyleModel.theadTh : () => [],
7
- caption: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.caption) || [],
8
- });
9
- export const unwrapTableStyleModel = (tableStyleModel) => (Object.assign(Object.assign({}, unwrapSharedStyleModel(tableStyleModel)), { tbodyTr: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.tbodyTr) ? tableStyleModel.tbodyTr : () => [], tbodyTd: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.tbodyTd) ? tableStyleModel.tbodyTd : () => [], tbodyTdInput: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.tbodyTdInput)
10
- ? tableStyleModel.tbodyTdInput
11
- : () => [], editColTh: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editColTh) || [], editColTd: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editColTd) ? tableStyleModel.editColTd : () => [], editCancelButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editCancelButton)
12
- ? tableStyleModel.editCancelButton
13
- : () => [], editDeleteButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editDeleteButton)
14
- ? tableStyleModel.editDeleteButton
15
- : () => [], editSaveButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editSaveButton)
16
- ? tableStyleModel.editSaveButton
17
- : () => [], editStartButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editStartButton)
18
- ? tableStyleModel.editStartButton
19
- : () => [], rowSelectColTh: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.rowSelectColTh) || [], rowSelectColTd: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.rowSelectColTd)
20
- ? tableStyleModel.rowSelectColTd
21
- : () => [], rowSelectInput: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.rowSelectInput)
22
- ? tableStyleModel.rowSelectInput
23
- : () => [] }));
24
- export const unwrapFilterInputTableStyleModel = (filterTableStyleModel) => (Object.assign(Object.assign({}, unwrapSharedStyleModel(filterTableStyleModel)), { tbodyTr: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.tbodyTr)
25
- ? filterTableStyleModel.tbodyTr
26
- : () => [], tbodyTd: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.tbodyTd)
27
- ? filterTableStyleModel.tbodyTd
28
- : () => [], enablementInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.enablementInput)
29
- ? filterTableStyleModel.enablementInput
30
- : () => [], schemeSelectionInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.schemeSelectionInput)
31
- ? filterTableStyleModel.schemeSelectionInput
32
- : () => [], searchStringInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.searchStringInput)
33
- ? filterTableStyleModel.searchStringInput
34
- : () => [], numberInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.numberInput)
35
- ? filterTableStyleModel.numberInput
36
- : () => [], startDateInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.startDateInput)
37
- ? filterTableStyleModel.startDateInput
38
- : () => [], endDateInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.endDateInput)
39
- ? filterTableStyleModel.endDateInput
40
- : () => [], submitButton: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.submitButton) || [], form: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.form) || [] }));
41
- export const unwrapAdditionalComponentsStyleModel = (styleModel) => ({
42
- topLevelDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.topLevelDiv) || [],
43
- filterInputsDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.filterInputsDiv) || [],
44
- tableAndPaginationDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tableAndPaginationDiv) || [],
45
- filterUiToggleButton: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.filterUiToggleButton) || [],
46
- paginationUiDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.paginationUiDiv) || [],
47
- });