@absreim/react-bootstrap-data-grid-pro 2.7.0 → 4.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 (201) 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}/export/ExportForm.d.ts +1 -0
  5. package/{grid → common}/export/ExportForm.js +3 -3
  6. package/{grid → common}/filtering/DateFilterRow.d.ts +4 -4
  7. package/{grid → common}/filtering/DateFilterRow.js +1 -1
  8. package/common/filtering/FilterOptionsTable.d.ts +12 -0
  9. package/common/filtering/FilterOptionsTable.js +87 -0
  10. package/{grid → common}/filtering/FilterRow.d.ts +4 -4
  11. package/{grid → common}/filtering/FilterRow.js +1 -1
  12. package/{grid → common}/filtering/NumberFilterRow.d.ts +3 -3
  13. package/{grid → common}/filtering/NumberFilterRow.js +1 -1
  14. package/{grid → common}/filtering/StringFilterRow.d.ts +3 -3
  15. package/{grid → common}/filtering/StringFilterRow.js +1 -1
  16. package/{grid → common}/filtering/types.d.ts +6 -6
  17. package/common/filtering/useFilterFormState.d.ts +3 -0
  18. package/common/index.d.ts +11 -0
  19. package/common/index.js +11 -0
  20. package/{grid → common}/pagination/PageSelector.d.ts +1 -1
  21. package/{grid → common}/pagination/PageSizeSelector.d.ts +1 -1
  22. package/{grid → common}/pagination/Pagination.d.ts +1 -1
  23. package/{grid → common}/pagination/Pagination.js +6 -3
  24. package/{grid → common}/pagination/types.d.ts +3 -2
  25. package/{grid → common}/pipeline/useAugFormattedRows.d.ts +1 -1
  26. package/common/pipeline/useColNameToWidth.d.ts +3 -0
  27. package/common/pipeline/useColNameToWidth.js +7 -0
  28. package/{grid → common}/pipeline/useCombinedPipeline/index.d.ts +4 -4
  29. package/{grid → common}/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +3 -3
  30. package/{grid → common}/pipeline/useCombinedPipeline/useDisplayRows.d.ts +1 -1
  31. package/{grid → common}/pipeline/useCombinedPipeline/useDisplayRows.js +1 -2
  32. package/common/pipeline/useCombinedPipeline/useFilter.d.ts +4 -0
  33. package/common/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +4 -0
  34. package/{grid → common}/pipeline/useCombinedPipeline/useSortedRows.d.ts +2 -2
  35. package/{grid → common}/pipeline/useGridSelectionFns.d.ts +2 -2
  36. package/{grid → common}/sorting/types.d.ts +3 -3
  37. package/{grid/main/ColHeaderCell → common/sorting}/useSortHeaderStates.d.ts +2 -2
  38. package/{grid/main/ColHeaderCell → common/sorting}/useSortHeaderStates.js +4 -4
  39. package/common/styling/types.d.ts +21 -0
  40. package/{grid → common}/toolbar/ToolbarContainer.d.ts +2 -2
  41. package/{grid → common}/toolbar/ToolbarContainer.js +11 -7
  42. package/common/toolbar/types.d.ts +11 -0
  43. package/common/toolbar/useInterfaces.d.ts +3 -0
  44. package/common/toolbar/useInterfaces.js +15 -0
  45. package/{grid → common}/types.d.ts +24 -34
  46. package/common/util/index.d.ts +5 -0
  47. package/common/util/index.js +5 -0
  48. package/grid/constants.d.ts +2 -0
  49. package/grid/constants.js +2 -0
  50. package/grid/index.d.ts +3 -10
  51. package/grid/index.js +3 -10
  52. package/grid/{Grid.d.ts → main/Grid.d.ts} +0 -1
  53. package/grid/main/Grid.js +59 -0
  54. package/grid/main/GridBody.d.ts +4 -0
  55. package/grid/main/GridBody.js +13 -0
  56. package/grid/main/GridHeader.d.ts +4 -0
  57. package/grid/main/GridHeader.js +11 -0
  58. package/grid/main/getWidthStyles.d.ts +3 -0
  59. package/grid/main/getWidthStyles.js +6 -0
  60. package/grid/main/types.d.ts +32 -0
  61. package/grid.css +1 -0
  62. package/grid.scss +231 -0
  63. package/package.json +1 -1
  64. package/pro/index.d.ts +5 -0
  65. package/pro/index.js +5 -0
  66. package/table/InternalTable.d.ts +21 -0
  67. package/table/InternalTable.js +58 -0
  68. package/table/Table.d.ts +5 -0
  69. package/{grid/Grid.js → table/Table.js} +11 -18
  70. package/{grid → table}/editing/EditControlsCell.d.ts +5 -5
  71. package/table/editing/EditControlsCell.js +10 -0
  72. package/{grid → table}/editing/EditableRow.d.ts +8 -9
  73. package/{grid → table}/editing/EditableRow.js +3 -3
  74. package/table/index.d.ts +5 -0
  75. package/table/index.js +5 -0
  76. package/table/main/BodyRows.d.ts +22 -0
  77. package/table/main/BodyRows.js +27 -0
  78. package/{grid → table}/main/ColHeaderCell/index.js +3 -3
  79. package/{grid → table}/selection/SelectAllHeaderCell.d.ts +2 -2
  80. package/{grid → table}/selection/SelectAllHeaderCell.js +2 -4
  81. package/{grid → table}/selection/SelectionInput.d.ts +1 -1
  82. package/table/style.scss +3 -0
  83. package/table/styling/types.d.ts +41 -0
  84. package/table/styling/types.js +1 -0
  85. package/table/types.d.ts +19 -0
  86. package/table/types.js +1 -0
  87. package/{grid-pro → table-pro}/ColHeaderCellPro.js +4 -4
  88. package/table-pro/TablePro.d.ts +4 -0
  89. package/{grid-pro/GridPro.js → table-pro/TablePro.js} +10 -13
  90. package/{grid-pro → table-pro}/index.d.ts +2 -2
  91. package/{grid-pro → table-pro}/index.js +2 -2
  92. package/{grid-pro → table-pro}/reorder/ReorderHandleCell.js +1 -1
  93. package/{grid-pro → table-pro}/reorder/useKeyboardReorder.js +1 -1
  94. package/{grid-pro → table-pro}/resize/useResizeModel.d.ts +1 -1
  95. package/table-pro/style.scss +69 -0
  96. package/{grid-pro → table-pro}/types.d.ts +3 -3
  97. package/table-pro/types.js +1 -0
  98. package/table-pro.scss +1 -0
  99. package/grid/InternalGrid.d.ts +0 -23
  100. package/grid/InternalGrid.js +0 -56
  101. package/grid/editing/EditControlsCell.js +0 -18
  102. package/grid/editing/types.d.ts +0 -16
  103. package/grid/filtering/FilterOptionsTable.d.ts +0 -11
  104. package/grid/filtering/FilterOptionsTable.js +0 -81
  105. package/grid/filtering/useFilterFormState.d.ts +0 -3
  106. package/grid/main/BodyRows.d.ts +0 -22
  107. package/grid/main/BodyRows.js +0 -11
  108. package/grid/main/ToggleButton.d.ts +0 -9
  109. package/grid/main/ToggleButton.js +0 -13
  110. package/grid/pipeline/useCombinedPipeline/useFilter.d.ts +0 -4
  111. package/grid/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +0 -4
  112. package/grid/pipeline/useUnwrappedGridStyles.d.ts +0 -7
  113. package/grid/pipeline/useUnwrappedGridStyles.js +0 -15
  114. package/grid/styling/styleModelUnwrappers.d.ts +0 -4
  115. package/grid/styling/styleModelUnwrappers.js +0 -47
  116. package/grid/styling/types.d.ts +0 -62
  117. package/grid/toolbar/types.d.ts +0 -3
  118. package/grid/toolbar/useInterfaces.d.ts +0 -9
  119. package/grid/toolbar/useInterfaces.js +0 -11
  120. package/grid-pro/GridPro.d.ts +0 -4
  121. /package/{grid → common}/editing/inputStrsToRowData.d.ts +0 -0
  122. /package/{grid → common}/editing/inputStrsToRowData.js +0 -0
  123. /package/{grid-pro/reorder → common/editing}/types.js +0 -0
  124. /package/{grid → common}/export/types.d.ts +0 -0
  125. /package/{grid-pro/resize → common/export}/types.js +0 -0
  126. /package/{grid → common}/export/useExportFn.d.ts +0 -0
  127. /package/{grid → common}/export/useExportFn.js +0 -0
  128. /package/{grid → common}/filtering/types.js +0 -0
  129. /package/{grid → common}/filtering/useFilterFormState.js +0 -0
  130. /package/{grid → common}/pagination/PageSelector.js +0 -0
  131. /package/{grid → common}/pagination/PageSizeSelector.js +0 -0
  132. /package/{grid-pro → common/pagination}/types.js +0 -0
  133. /package/{grid → common}/pipeline/types.d.ts +0 -0
  134. /package/{grid-pro/util → common/pipeline}/types.js +0 -0
  135. /package/{grid → common}/pipeline/useAugFormattedRows.js +0 -0
  136. /package/{grid → common}/pipeline/useCombinedPipeline/index.js +0 -0
  137. /package/{grid → common}/pipeline/useCombinedPipeline/useCurrentPageRows.js +0 -0
  138. /package/{grid → common}/pipeline/useCombinedPipeline/useFilter.js +0 -0
  139. /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateFromEditable.js +0 -0
  140. /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateStore.d.ts +0 -0
  141. /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateStore.js +0 -0
  142. /package/{grid → common}/pipeline/useCombinedPipeline/useSortedRows.js +0 -0
  143. /package/{grid → common}/pipeline/useGetInputStrSubmitCallback.d.ts +0 -0
  144. /package/{grid → common}/pipeline/useGetInputStrSubmitCallback.js +0 -0
  145. /package/{grid → common}/pipeline/useGridSelectionFns.js +0 -0
  146. /package/{grid → common}/selection/types.d.ts +0 -0
  147. /package/{grid → common}/selection/types.js +0 -0
  148. /package/{grid → common}/sorting/arrowPlaceholder.d.ts +0 -0
  149. /package/{grid → common}/sorting/arrowPlaceholder.js +0 -0
  150. /package/{grid → common}/sorting/downArrow.d.ts +0 -0
  151. /package/{grid → common}/sorting/downArrow.js +0 -0
  152. /package/{grid → common}/sorting/sortOrderToAriaSort.d.ts +0 -0
  153. /package/{grid → common}/sorting/sortOrderToAriaSort.js +0 -0
  154. /package/{grid/editing → common/sorting}/types.js +0 -0
  155. /package/{grid → common}/sorting/upArrow.d.ts +0 -0
  156. /package/{grid → common}/sorting/upArrow.js +0 -0
  157. /package/{grid/export → common/styling}/types.js +0 -0
  158. /package/{grid → common}/toolbar/Toolbar.d.ts +0 -0
  159. /package/{grid → common}/toolbar/Toolbar.js +0 -0
  160. /package/{grid/pagination → common/toolbar}/types.js +0 -0
  161. /package/{grid/pipeline → common}/types.js +0 -0
  162. /package/{grid → common}/util/datetime.d.ts +0 -0
  163. /package/{grid → common}/util/datetime.js +0 -0
  164. /package/{grid → common}/util/getWidthStyle.d.ts +0 -0
  165. /package/{grid → common}/util/getWidthStyle.js +0 -0
  166. /package/{grid → common}/util/isSubset.d.ts +0 -0
  167. /package/{grid → common}/util/isSubset.js +0 -0
  168. /package/{grid → common}/util/trueModulo.d.ts +0 -0
  169. /package/{grid → common}/util/trueModulo.js +0 -0
  170. /package/{grid → common}/util/useControlledHover.d.ts +0 -0
  171. /package/{grid → common}/util/useControlledHover.js +0 -0
  172. /package/grid/{sorting → main}/types.js +0 -0
  173. /package/{grid → table}/main/ColHeaderCell/index.d.ts +0 -0
  174. /package/{grid → table}/selection/SelectionInput.js +0 -0
  175. /package/{grid-pro → table-pro}/ColHeaderCellPro.d.ts +0 -0
  176. /package/{grid-pro → table-pro}/assets/HorizontalGrip.d.ts +0 -0
  177. /package/{grid-pro → table-pro}/assets/HorizontalGrip.js +0 -0
  178. /package/{grid-pro → table-pro}/assets/VerticalGrip.d.ts +0 -0
  179. /package/{grid-pro → table-pro}/assets/VerticalGrip.js +0 -0
  180. /package/{grid-pro/util → table-pro/lib}/regDragCleanup.d.ts +0 -0
  181. /package/{grid-pro/util → table-pro/lib}/regDragCleanup.js +0 -0
  182. /package/{grid-pro/util → table-pro/lib}/types.d.ts +0 -0
  183. /package/{grid/styling → table-pro/lib}/types.js +0 -0
  184. /package/{grid-pro → table-pro}/reorder/ReorderHandleCell.d.ts +0 -0
  185. /package/{grid-pro → table-pro}/reorder/ReorderHeaderCell.d.ts +0 -0
  186. /package/{grid-pro → table-pro}/reorder/ReorderHeaderCell.js +0 -0
  187. /package/{grid-pro → table-pro}/reorder/types.d.ts +0 -0
  188. /package/{grid/toolbar → table-pro/reorder}/types.js +0 -0
  189. /package/{grid-pro → table-pro}/reorder/useKeyboardReorder.d.ts +0 -0
  190. /package/{grid-pro → table-pro}/reorder/useKeyboardReorderListener.d.ts +0 -0
  191. /package/{grid-pro → table-pro}/reorder/useKeyboardReorderListener.js +0 -0
  192. /package/{grid-pro → table-pro}/reorder/useReorderStyles.d.ts +0 -0
  193. /package/{grid-pro → table-pro}/reorder/useReorderStyles.js +0 -0
  194. /package/{grid-pro → table-pro}/resize/types.d.ts +0 -0
  195. /package/{grid → table-pro/resize}/types.js +0 -0
  196. /package/{grid-pro → table-pro}/resize/useResizeModel.js +0 -0
  197. /package/{grid-pro → table-pro}/util/index.d.ts +0 -0
  198. /package/{grid-pro → table-pro}/util/index.js +0 -0
  199. /package/{grid-pro → table-pro}/util/reorderRows.d.ts +0 -0
  200. /package/{grid-pro → table-pro}/util/reorderRows.js +0 -0
  201. /package/{style.css → table-pro.css} +0 -0
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_COL_WIDTH = 100;
2
+ export declare const CSS_PREFIX = "rbdg-grid";
@@ -0,0 +1,2 @@
1
+ export const DEFAULT_COL_WIDTH = 100;
2
+ export const CSS_PREFIX = "rbdg-grid";
@@ -0,0 +1,7 @@
1
+ import { RowData, RowId } from "../types";
2
+ export type UpdateCallbackGenerator = (id: RowId) => (rowData: RowData) => void;
3
+ export interface EditModel {
4
+ getUpdateCallback: UpdateCallbackGenerator;
5
+ getDeleteCallback?: (id: RowId) => () => void;
6
+ editColWidth?: number;
7
+ }
@@ -3,6 +3,7 @@ import { FC } from "react";
3
3
  import { ExportFormStyleModel } from "../styling/types";
4
4
  export interface ExportFormProps {
5
5
  exportFnInfo: ExportFnInfo;
6
+ closeCallback: () => void;
6
7
  styleModel?: ExportFormStyleModel;
7
8
  }
8
9
  declare const ExportForm: FC<ExportFormProps>;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId, useState } from "react";
3
3
  import classNames from "classnames";
4
- const ExportForm = ({ exportFnInfo: { exportFn, formattersExist, paginationEnabled, filteringEnabled, rowCounts, }, styleModel, }) => {
4
+ const ExportForm = ({ exportFnInfo: { exportFn, formattersExist, paginationEnabled, filteringEnabled, rowCounts, }, closeCallback, styleModel, }) => {
5
5
  const formId = useId();
6
6
  const [formState, setFormState] = useState({
7
7
  stage: "original",
@@ -67,7 +67,7 @@ const ExportForm = ({ exportFnInfo: { exportFn, formattersExist, paginationEnabl
67
67
  const radioContainerClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.radioContainer) || ["form-check"]);
68
68
  const radioInputClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.radioInput) || ["form-check-input"]);
69
69
  const radioLabelClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.radioLabel) || ["form-check-label"]);
70
- const submitButtonClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.submitButton) || ["btn", "btn-secondary"]);
71
- return (_jsxs("form", { onSubmit: handleSubmit, children: [_jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose data to export" }), stageOptions.map(({ value, label, disabled }) => (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: `${formId}-${value}`, value: value, checked: formState.stage === value, onChange: getChangeHandler("stage", value), disabled: disabled }), _jsx("label", { className: radioLabelClasses, htmlFor: `${formId}-${value}`, children: label })] }, value)))] }), _jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose whether to apply formatters" }), formatOptions.map(({ formatted, label, disabled }) => (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: `${formId}-${formatted}`, value: String(formatted), checked: formState.formatted === formatted, onChange: getChangeHandler("formatted", formatted), disabled: disabled }), _jsx("label", { className: radioLabelClasses, htmlFor: `${formId}-${formatted}`, children: label })] }, String(formatted))))] }), _jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose the file type" }), fileTypeOptions.map(({ fileType, label }) => (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: `${formId}-${fileType}`, value: fileType, checked: formState.fileType === fileType, onChange: getChangeHandler("fileType", fileType) }), _jsx("label", { className: radioLabelClasses, htmlFor: `${formId}-${fileType}`, children: label })] }, fileType)))] }), _jsx("button", { type: "submit", className: submitButtonClasses, children: "Submit" })] }));
70
+ const submitButtonClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.submitButton) || ["btn", "btn-primary"]);
71
+ return (_jsxs("form", { onSubmit: handleSubmit, children: [_jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose data to export" }), stageOptions.map(({ value, label, disabled }) => (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: `${formId}-${value}`, value: value, checked: formState.stage === value, onChange: getChangeHandler("stage", value), disabled: disabled }), _jsx("label", { className: radioLabelClasses, htmlFor: `${formId}-${value}`, children: label })] }, value)))] }), _jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose whether to apply formatters" }), formatOptions.map(({ formatted, label, disabled }) => (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: `${formId}-${formatted}`, value: String(formatted), checked: formState.formatted === formatted, onChange: getChangeHandler("formatted", formatted), disabled: disabled }), _jsx("label", { className: radioLabelClasses, htmlFor: `${formId}-${formatted}`, children: label })] }, String(formatted))))] }), _jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose the file type" }), fileTypeOptions.map(({ fileType, label }) => (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: `${formId}-${fileType}`, value: fileType, checked: formState.fileType === fileType, onChange: getChangeHandler("fileType", fileType) }), _jsx("label", { className: radioLabelClasses, htmlFor: `${formId}-${fileType}`, children: label })] }, fileType)))] }), _jsxs("div", { className: "hstack justify-content-end gap-2", children: [_jsx("button", { className: "btn btn-secondary", onClick: closeCallback, type: "button", children: "Cancel" }), _jsx("button", { type: "submit", className: submitButtonClasses, children: "Submit" })] })] }));
72
72
  };
73
73
  export default ExportForm;
@@ -7,10 +7,10 @@ export type DateFilterRowProps = {
7
7
  columnLabel: string;
8
8
  filterState: DateFormFilterState;
9
9
  setFilterState: (filterState: DateFormFilterState) => void;
10
- schemeSelectClasses: string[];
11
- enableInputClasses: string[];
12
- startDateInputClasses: string[];
13
- endDateInputClasses: string[];
10
+ schemeSelectClasses: string[] | null | undefined;
11
+ enableInputClasses: string[] | null | undefined;
12
+ startDateInputClasses: string[] | null | undefined;
13
+ endDateInputClasses: string[] | null | undefined;
14
14
  } & CommonFilterRowStyleProps;
15
15
  declare const DateFilterRow: FC<DateFilterRowProps>;
16
16
  export default DateFilterRow;
@@ -23,7 +23,7 @@ const DateFilterRow = ({ ariaRowIndex, includeTime, columnLabel, filterState, se
23
23
  const endDateInputId = `$endDate-${inputId}`;
24
24
  const startDateInputLabel = `${columnLabel} Column Filter Start Date`;
25
25
  const endDateInputLabel = `${columnLabel} Column Filter End Date`;
26
- const searchStringInputCellContents = (_jsxs(_Fragment, { children: [scheme !== "endAt" && (_jsxs(_Fragment, { children: [scheme === "between" && (_jsx("label", { htmlFor: startDateInputId, children: "Start Date" })), _jsx("input", { id: startDateInputId, className: classNames("form-control", startDateInputClasses), type: inputType, required: enabled, disabled: !enabled, value: startDate, onChange: handleStartValueChange, "aria-label": startDateInputLabel })] })), scheme !== "startFrom" && (_jsxs(_Fragment, { children: [scheme === "between" && (_jsx("label", { htmlFor: endDateInputId, children: "End Date" })), _jsx("input", { id: endDateInputId, className: classNames("form-control", endDateInputClasses), type: inputType, required: enabled, disabled: !enabled, value: endDate, onChange: handleEndValueChange, "aria-label": endDateInputLabel })] }))] }));
26
+ const searchStringInputCellContents = (_jsxs(_Fragment, { children: [scheme !== "endAt" && (_jsxs(_Fragment, { children: [scheme === "between" && (_jsx("label", { htmlFor: startDateInputId, children: "Start Date" })), _jsx("input", { id: startDateInputId, className: classNames(startDateInputClasses || "form-control"), type: inputType, required: enabled, disabled: !enabled, value: startDate, onChange: handleStartValueChange, "aria-label": startDateInputLabel })] })), scheme !== "startFrom" && (_jsxs(_Fragment, { children: [scheme === "between" && (_jsx("label", { htmlFor: endDateInputId, children: "End Date" })), _jsx("input", { id: endDateInputId, className: classNames(endDateInputClasses || "form-control"), type: inputType, required: enabled, disabled: !enabled, value: endDate, onChange: handleEndValueChange, "aria-label": endDateInputLabel })] }))] }));
27
27
  return (_jsx(FilterRow, { ariaRowIndex: ariaRowIndex, columnLabel: columnLabel, typeLabel: filterState.type === "date" ? "Date" : "Datetime", enabled: enabled, enabledChangeHandler: handleEnabledChange, currentScheme: scheme, handleSchemeChange: handleOpChange, schemesToLabels: dateFilterSchemeNames, searchStringInputCellContents: searchStringInputCellContents, trClasses: trClasses, tdClasses: tdClasses, inputClasses: enableInputClasses, selectClasses: schemeSelectClasses }));
28
28
  };
29
29
  export default DateFilterRow;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { EditableFilterState, FilterState } from "./types";
3
+ import { FilterInputTableStyleModel } from "../../table/styling/types";
4
+ export interface FilterOptionsTableProps {
5
+ filterState: FilterState;
6
+ setFilterState: (filterState: EditableFilterState) => void;
7
+ closeFormCallback: () => void;
8
+ caption?: string;
9
+ styleModel?: FilterInputTableStyleModel;
10
+ }
11
+ declare const FilterOptionsTable: FC<FilterOptionsTableProps>;
12
+ export default FilterOptionsTable;
@@ -0,0 +1,87 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import StringFilterRow from "./StringFilterRow";
4
+ import NumberFilterRow from "./NumberFilterRow";
5
+ import useFilterFormState from "./useFilterFormState";
6
+ import DateFilterRow from "./DateFilterRow";
7
+ import classNames from "classnames";
8
+ const convertFilterFormStateToEditableState = (filterFormState) => Object.keys(filterFormState).reduce((editableState, colName) => {
9
+ const rowFilterFormState = filterFormState[colName];
10
+ switch (rowFilterFormState.type) {
11
+ case "string": {
12
+ editableState[colName] = Object.assign({}, rowFilterFormState);
13
+ break;
14
+ }
15
+ case "number": {
16
+ editableState[colName] = {
17
+ type: rowFilterFormState.type,
18
+ enabled: rowFilterFormState.enabled,
19
+ scheme: rowFilterFormState.scheme,
20
+ numValue: rowFilterFormState.inputValue === ""
21
+ ? null
22
+ : Number(rowFilterFormState.inputValue),
23
+ };
24
+ break;
25
+ }
26
+ default: {
27
+ // date or datetime
28
+ const partialFilterState = {
29
+ type: rowFilterFormState.type,
30
+ enabled: rowFilterFormState.enabled,
31
+ };
32
+ const inputStrToDate = (str) => str === "" ? null : new Date(str);
33
+ switch (rowFilterFormState.scheme) {
34
+ case "startFrom": {
35
+ editableState[colName] = Object.assign(Object.assign({}, partialFilterState), { scheme: rowFilterFormState.scheme, startDate: inputStrToDate(rowFilterFormState.startDate) });
36
+ break;
37
+ }
38
+ case "endAt": {
39
+ editableState[colName] = Object.assign(Object.assign({}, partialFilterState), { scheme: rowFilterFormState.scheme, endDate: inputStrToDate(rowFilterFormState.endDate) });
40
+ break;
41
+ }
42
+ default: {
43
+ editableState[colName] = Object.assign(Object.assign({}, partialFilterState), { scheme: rowFilterFormState.scheme, startDate: inputStrToDate(rowFilterFormState.startDate), endDate: inputStrToDate(rowFilterFormState.endDate) });
44
+ }
45
+ }
46
+ }
47
+ }
48
+ return editableState;
49
+ }, {});
50
+ const FilterOptionsTable = ({ filterState, setFilterState, caption, styleModel, closeFormCallback, }) => {
51
+ const formFilterState = useFilterFormState(filterState);
52
+ const [formState, setFormState] = useState(formFilterState);
53
+ const getRows = () => Object.keys(formState).map((colName, index) => {
54
+ function getColStateSetter(colName) {
55
+ return (rowState) => setFormState(Object.assign(Object.assign({}, formState), { [colName]: rowState }));
56
+ }
57
+ const colLabel = filterState[colName].label;
58
+ const colFilterState = formState[colName];
59
+ switch (colFilterState.type) {
60
+ case "string": {
61
+ return (_jsx(StringFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput) &&
62
+ (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput(index)), enableInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput) &&
63
+ (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput(index)), searchStringInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.searchStringInput) &&
64
+ (styleModel === null || styleModel === void 0 ? void 0 : styleModel.searchStringInput(index)), trClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTr) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTr(index)), tdClasses: (colIndex) => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd(index, colIndex)) }, colName));
65
+ }
66
+ case "number": {
67
+ return (_jsx(NumberFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput) &&
68
+ (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput(index)), enableInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput) &&
69
+ (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput(index)), numberInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.numberInput) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.numberInput(index)), trClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTr) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTr(index)), tdClasses: (colIndex) => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd(index, colIndex)) }, colName));
70
+ }
71
+ default: {
72
+ // date or datetime
73
+ return (_jsx(DateFilterRow, { ariaRowIndex: index + 2, includeTime: colFilterState.type === "datetime", columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput) &&
74
+ (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput(index)), enableInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput) &&
75
+ (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput(index)), startDateInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.startDateInput) && styleModel.startDateInput(index), endDateInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.endDateInput) && styleModel.endDateInput(index), trClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTr) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTr(index)), tdClasses: (colIndex) => (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd(index, colIndex)) }, colName));
76
+ }
77
+ }
78
+ });
79
+ const onSubmit = (event) => {
80
+ event.preventDefault();
81
+ const editableTableFilterState = convertFilterFormStateToEditableState(formState);
82
+ setFilterState(editableTableFilterState);
83
+ closeFormCallback();
84
+ };
85
+ return (_jsxs("form", { onSubmit: onSubmit, className: classNames(styleModel === null || styleModel === void 0 ? void 0 : styleModel.form), children: [_jsxs("table", { className: classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.table) || "table"), children: [caption && (_jsx("caption", { className: classNames(styleModel === null || styleModel === void 0 ? void 0 : styleModel.caption), children: caption })), _jsx("thead", { className: classNames(styleModel === null || styleModel === void 0 ? void 0 : styleModel.thead), children: _jsx("tr", { className: classNames(styleModel === null || styleModel === void 0 ? void 0 : styleModel.theadTr), children: ["Enabled", "Column", "Type", "Operator", "Value"].map((colName, index) => (_jsx("th", { className: classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.theadTh) && styleModel.theadTh(index)), children: colName }, index))) }) }), _jsx("tbody", { className: classNames(styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbody), children: getRows() })] }), _jsxs("div", { className: "hstack justify-content-end gap-2", children: [_jsx("button", { className: "btn btn-secondary", onClick: closeFormCallback, type: "button", children: "Cancel" }), _jsx("button", { className: classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.submitButton) || ["btn", "btn-primary"]), type: "submit", children: "Submit" })] })] }));
86
+ };
87
+ export default FilterOptionsTable;
@@ -9,10 +9,10 @@ export interface FilterRowProps<FilterScheme extends string> {
9
9
  handleSchemeChange: ChangeEventHandler<HTMLSelectElement>;
10
10
  schemesToLabels: Record<FilterScheme, string>;
11
11
  searchStringInputCellContents: ReactNode;
12
- trClasses: string[];
13
- tdClasses: (colIndex: number) => string[];
14
- inputClasses: string[];
15
- selectClasses: string[];
12
+ trClasses: string[] | null | undefined;
13
+ tdClasses: (colIndex: number) => (string[] | null) | undefined;
14
+ inputClasses: string[] | null | undefined;
15
+ selectClasses: string[] | null | undefined;
16
16
  }
17
17
  export type CommonFilterRowStyleProps = Pick<FilterRowProps<string>, "trClasses" | "tdClasses">;
18
18
  export declare function FilterRow<FilterScheme extends string = string>(props: FilterRowProps<FilterScheme>): ReactNode;
@@ -4,6 +4,6 @@ export function FilterRow(props) {
4
4
  const { ariaRowIndex, columnLabel, typeLabel, enabled, enabledChangeHandler, currentScheme, handleSchemeChange, schemesToLabels, searchStringInputCellContents, trClasses, tdClasses, inputClasses, selectClasses, } = props;
5
5
  const checkboxLabel = `${columnLabel} Column Filter Toggle`;
6
6
  const opSelectLabel = `${columnLabel} Column Filter Operator Selection`;
7
- return (_jsxs("tr", { className: classNames(trClasses), "aria-rowindex": ariaRowIndex, children: [_jsx("td", { className: classNames(tdClasses(0)), "aria-colindex": 1, children: _jsx("input", { className: classNames(inputClasses), name: checkboxLabel, "aria-label": checkboxLabel, type: "checkbox", checked: enabled, onChange: enabledChangeHandler }) }), _jsx("td", { className: classNames(tdClasses(1)), "aria-colindex": 2, children: columnLabel }), _jsx("td", { className: classNames(tdClasses(2)), "aria-colindex": 3, children: typeLabel }), _jsx("td", { className: classNames(tdClasses(3)), "aria-colindex": 4, children: _jsx("select", { name: opSelectLabel, "aria-label": opSelectLabel, disabled: !enabled, className: classNames("form-select", ...selectClasses), value: currentScheme, onChange: handleSchemeChange, children: Object.keys(schemesToLabels).map((scheme) => (_jsx("option", { value: scheme, children: schemesToLabels[scheme] }, scheme))) }) }), _jsx("td", { className: classNames(tdClasses(4)), "aria-colindex": 5, children: searchStringInputCellContents })] }));
7
+ return (_jsxs("tr", { className: classNames(trClasses), "aria-rowindex": ariaRowIndex, children: [_jsx("td", { className: classNames(tdClasses(0)), "aria-colindex": 1, children: _jsx("input", { className: classNames(inputClasses), name: checkboxLabel, "aria-label": checkboxLabel, type: "checkbox", checked: enabled, onChange: enabledChangeHandler }) }), _jsx("td", { className: classNames(tdClasses(1)), "aria-colindex": 2, children: columnLabel }), _jsx("td", { className: classNames(tdClasses(2)), "aria-colindex": 3, children: typeLabel }), _jsx("td", { className: classNames(tdClasses(3)), "aria-colindex": 4, children: _jsx("select", { name: opSelectLabel, "aria-label": opSelectLabel, disabled: !enabled, className: classNames(selectClasses || "form-select"), value: currentScheme, onChange: handleSchemeChange, children: Object.keys(schemesToLabels).map((scheme) => (_jsx("option", { value: scheme, children: schemesToLabels[scheme] }, scheme))) }) }), _jsx("td", { className: classNames(tdClasses(4)), "aria-colindex": 5, children: searchStringInputCellContents })] }));
8
8
  }
9
9
  export default FilterRow;
@@ -6,9 +6,9 @@ export type NumberFilterRowProps = {
6
6
  columnLabel: string;
7
7
  filterState: NumberFormFilterState;
8
8
  setFilterState: (filterState: NumberFormFilterState) => void;
9
- schemeSelectClasses: string[];
10
- enableInputClasses: string[];
11
- numberInputClasses: string[];
9
+ schemeSelectClasses: string[] | null | undefined;
10
+ enableInputClasses: string[] | null | undefined;
11
+ numberInputClasses: string[] | null | undefined;
12
12
  } & CommonFilterRowStyleProps;
13
13
  declare const NumberFilterRow: FC<NumberFilterRowProps>;
14
14
  export default NumberFilterRow;
@@ -14,7 +14,7 @@ const NumberFilterRow = ({ ariaRowIndex, columnLabel, filterState, setFilterStat
14
14
  };
15
15
  const { enabled, scheme, inputValue } = filterState;
16
16
  const valueInputLabel = `${columnLabel} Column Filter Value`;
17
- const searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames("form-control", numberInputClasses), type: "number", required: enabled, disabled: !enabled, value: inputValue, onChange: handleNumInputValueChange }));
17
+ const searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames(numberInputClasses || "form-control"), type: "number", required: enabled, disabled: !enabled, value: inputValue, onChange: handleNumInputValueChange }));
18
18
  return (_jsx(FilterRow, { ariaRowIndex: ariaRowIndex, columnLabel: columnLabel, typeLabel: "Number", enabled: enabled, enabledChangeHandler: handleEnabledChange, currentScheme: scheme, handleSchemeChange: handleOpChange, schemesToLabels: numberFilterSchemeNames, searchStringInputCellContents: searchStringInputCellContents, trClasses: trClasses, tdClasses: tdClasses, inputClasses: enableInputClasses, selectClasses: schemeSelectClasses }));
19
19
  };
20
20
  export default NumberFilterRow;
@@ -6,9 +6,9 @@ type StringFilterRowProps = {
6
6
  columnLabel: string;
7
7
  filterState: StringFilterState;
8
8
  setFilterState: (filterState: StringFilterState) => void;
9
- schemeSelectClasses: string[];
10
- enableInputClasses: string[];
11
- searchStringInputClasses: string[];
9
+ schemeSelectClasses: string[] | null | undefined;
10
+ enableInputClasses: string[] | null | undefined;
11
+ searchStringInputClasses: string[] | null | undefined;
12
12
  } & CommonFilterRowStyleProps;
13
13
  declare const StringFilterRow: FC<StringFilterRowProps>;
14
14
  export default StringFilterRow;
@@ -14,7 +14,7 @@ const StringFilterRow = ({ ariaRowIndex, columnLabel, filterState, setFilterStat
14
14
  };
15
15
  const { enabled, scheme, searchString } = filterState;
16
16
  const valueInputLabel = `${columnLabel} Column Filter Value`;
17
- const searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames("form-control", searchStringInputClasses), required: enabled, disabled: !enabled, value: searchString, onChange: handleSearchStringChange }));
17
+ const searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames(searchStringInputClasses || "form-control"), required: enabled, disabled: !enabled, value: searchString, onChange: handleSearchStringChange }));
18
18
  return (_jsx(FilterRow, { ariaRowIndex: ariaRowIndex, columnLabel: columnLabel, typeLabel: "String", enabled: enabled, enabledChangeHandler: handleEnabledChange, currentScheme: scheme, handleSchemeChange: handleOpChange, schemesToLabels: stringFilterSchemeNames, searchStringInputCellContents: searchStringInputCellContents, trClasses: trClasses, tdClasses: tdClasses, inputClasses: enableInputClasses, selectClasses: schemeSelectClasses }));
19
19
  };
20
20
  export default StringFilterRow;
@@ -1,7 +1,7 @@
1
- export type TableFilterState = Record<string, ColFilterState>;
2
- export type EditableTableFilterState = Record<string, FilterState>;
1
+ export type FilterState = Record<string, ColFilterState>;
2
+ export type EditableFilterState = Record<string, EditableColFilterState>;
3
3
  export interface ColFilterState {
4
- editableState: FilterState;
4
+ editableState: EditableColFilterState;
5
5
  label: string;
6
6
  }
7
7
  export interface AbstractFilterState {
@@ -44,11 +44,11 @@ export interface BetweenDatesFilterState extends AbstractDateFilterState {
44
44
  endDate: Date | null;
45
45
  }
46
46
  export type DateFilterState = StartDateFilterState | EndDateFilterState | BetweenDatesFilterState;
47
- export type FilterState = StringFilterState | NumberFilterState | DateFilterState;
47
+ export type EditableColFilterState = StringFilterState | NumberFilterState | DateFilterState;
48
48
  export interface ControlledFilterModel {
49
49
  type?: "controlled";
50
- tableFilterState: EditableTableFilterState;
51
- setTableFilterState: (state: EditableTableFilterState) => void;
50
+ tableFilterState: EditableFilterState;
51
+ setTableFilterState: (state: EditableFilterState) => void;
52
52
  filterTableCaption?: string;
53
53
  }
54
54
  export type UncontrolledFilterModel = Partial<Pick<ControlledFilterModel, "tableFilterState" | "filterTableCaption">> & {
@@ -0,0 +1,3 @@
1
+ import { FilterFormState, FilterState } from "./types";
2
+ declare const useFilterFormState: (tableFilterState: FilterState) => FilterFormState;
3
+ export default useFilterFormState;
@@ -0,0 +1,11 @@
1
+ export * from "./editing/types";
2
+ export * from "./export/types";
3
+ export * from "./filtering/types";
4
+ export * from "./pagination/types";
5
+ export * from "./pipeline/types";
6
+ export * from "./sorting/types";
7
+ export * from "./styling/types";
8
+ export * from "./toolbar/types";
9
+ export * from "./selection/types";
10
+ export * from "./types";
11
+ export * from "./util";
@@ -0,0 +1,11 @@
1
+ export * from "./editing/types";
2
+ export * from "./export/types";
3
+ export * from "./filtering/types";
4
+ export * from "./pagination/types";
5
+ export * from "./pipeline/types";
6
+ export * from "./sorting/types";
7
+ export * from "./styling/types";
8
+ export * from "./toolbar/types";
9
+ export * from "./selection/types";
10
+ export * from "./types";
11
+ export * from "./util";
@@ -1,5 +1,5 @@
1
- import { JustifyContentSetting, Size } from "../types";
2
1
  import { FC } from "react";
2
+ import { JustifyContentSetting, Size } from "../";
3
3
  export interface PageSelectorProps {
4
4
  numPages: number;
5
5
  pageNum: number;
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import { Size } from "../types";
2
+ import { Size } from "../";
3
3
  export interface PageSizeSelectorProps {
4
4
  componentSize: Size;
5
5
  pageSizeOptions: number[];
@@ -3,7 +3,7 @@ import { NormalizedPaginationModel } from "./types";
3
3
  export interface PaginationProps {
4
4
  normalizedModel: NormalizedPaginationModel;
5
5
  prePagingNumRows: number;
6
- containerDivClasses: string[];
6
+ containerDivClasses: string[] | undefined;
7
7
  }
8
8
  declare const Pagination: FC<PaginationProps>;
9
9
  export default Pagination;
@@ -16,8 +16,11 @@ const Pagination = ({ normalizedModel, prePagingNumRows, containerDivClasses, })
16
16
  setCurrentPage(maxPages);
17
17
  }
18
18
  };
19
- return (_jsxs("div", { "data-testid": "pagination ui container div", className: classNames(containerDivClasses.length > 0
20
- ? containerDivClasses
21
- : ["d-flex", "justify-content-end", "gap-2", "px-2"]), children: [_jsx(PageSizeSelector, { componentSize: componentSize, pageSizeOptions: pageSizeOptions, pageSizeIndex: pageSizeIndex, handleSetPageSize: pageIndexAwarePageSizeSetter }), _jsx(PageSelector, { numPages: numPages, pageNum: currentPage, numButtons: maxPageButtons, setPageNum: setCurrentPage, size: componentSize, ariaLabel: pageSelectorAriaLabel, alignment: pageSelectorJustifyContent })] }));
19
+ return (_jsxs("div", { "data-testid": "pagination ui container div", className: classNames(containerDivClasses || [
20
+ "d-flex",
21
+ "justify-content-end",
22
+ "gap-2",
23
+ "px-2",
24
+ ]), children: [_jsx(PageSizeSelector, { componentSize: componentSize, pageSizeOptions: pageSizeOptions, pageSizeIndex: pageSizeIndex, handleSetPageSize: pageIndexAwarePageSizeSetter }), _jsx(PageSelector, { numPages: numPages, pageNum: currentPage, numButtons: maxPageButtons, setPageNum: setCurrentPage, size: componentSize, ariaLabel: pageSelectorAriaLabel, alignment: pageSelectorJustifyContent })] }));
22
25
  };
23
26
  export default Pagination;
@@ -1,4 +1,5 @@
1
- import { JustifyContentSetting, Size } from "../types";
1
+ export type JustifyContentSetting = "start" | "end" | "center" | "between" | "around" | "evenly";
2
+ export type Size = "small" | "medium" | "large";
2
3
  export interface PaginationOptions {
3
4
  pageSizeOptions?: number[];
4
5
  maxPageButtons?: number;
@@ -18,5 +19,5 @@ export type UncontrolledPaginationModel = PaginationOptions & {
18
19
  startingPageSizeIndex?: number;
19
20
  startingCurrentPage?: number;
20
21
  };
21
- export type GridPaginationState = ControlledPaginationModel | UncontrolledPaginationModel;
22
+ export type PaginationModel = ControlledPaginationModel | UncontrolledPaginationModel;
22
23
  export type NormalizedPaginationModel = Required<Omit<ControlledPaginationModel, "type" | "pageSelectorAriaLabel" | "pageSelectorJustifyContent">> & Pick<ControlledPaginationModel, "pageSelectorAriaLabel" | "pageSelectorJustifyContent">;
@@ -1,4 +1,4 @@
1
- import { AugFormattedRow, FormattedRow } from "../types";
2
1
  import { ColNameToWidth } from "./types";
2
+ import { AugFormattedRow, FormattedRow } from "../";
3
3
  declare const useAugFormattedRows: (colNameToWidth: ColNameToWidth, rows: FormattedRow[]) => AugFormattedRow[];
4
4
  export default useAugFormattedRows;
@@ -0,0 +1,3 @@
1
+ import { ColDef, ColNameToWidth } from "../";
2
+ declare const useColNameToWidth: (cols: ColDef[]) => ColNameToWidth;
3
+ export default useColNameToWidth;
@@ -0,0 +1,7 @@
1
+ import { useMemo } from "react";
2
+ const useColNameToWidth = (cols) => useMemo(() => {
3
+ const map = {};
4
+ cols.forEach(({ name, width }) => (map[name] = width));
5
+ return map;
6
+ }, [cols]);
7
+ export default useColNameToWidth;
@@ -1,14 +1,14 @@
1
1
  import { SortedRowsOutput } from "./useSortedRows";
2
2
  import { CurrentPageRowsOutput } from "./useCurrentPageRows";
3
- import { ColDefBase, FormattedRow, GridProps, RowDef } from "../../types";
4
- import { NormalizedTableFilterModel, TableFilterState } from "../../filtering/types";
5
- export type CombinedPipelineParams = Pick<GridProps, "rows" | "filterModel" | "sortModel" | "pagination" | "selectModel"> & {
3
+ import { NormalizedTableFilterModel, FilterState } from "../../";
4
+ import { ColDefBase, FormattedRow, MainComponentSharedProps, RowDef } from "../../types";
5
+ export type CombinedPipelineParams = Pick<MainComponentSharedProps, "rows" | "filterModel" | "sortModel" | "pagination" | "selectModel"> & {
6
6
  cols: ColDefBase[];
7
7
  };
8
8
  export interface UseCombinedPipelineHook {
9
9
  normalizedTableFilterModel: NormalizedTableFilterModel | null;
10
10
  filteredRows: RowDef[];
11
- filterState: TableFilterState | null;
11
+ filterState: FilterState | null;
12
12
  sortedRowsOutput: SortedRowsOutput;
13
13
  currentPageRowsOutput: CurrentPageRowsOutput;
14
14
  showSelectCol: boolean;
@@ -1,8 +1,8 @@
1
- import { AugRowDef, PostPaginationRowDef } from "../../types";
2
- import { NormalizedPaginationModel, GridPaginationState } from "../../pagination/types";
1
+ import { NormalizedPaginationModel, PaginationModel } from "../../pagination/types";
2
+ import { AugRowDef, PostPaginationRowDef } from "../../";
3
3
  export interface CurrentPageRowsOutput {
4
4
  paginatedRows: PostPaginationRowDef[];
5
5
  normalizedModel: NormalizedPaginationModel | null;
6
6
  }
7
- declare const useCurrentPageRows: (sortedRows: AugRowDef[], paginationModel: GridPaginationState | undefined) => CurrentPageRowsOutput;
7
+ declare const useCurrentPageRows: (sortedRows: AugRowDef[], paginationModel: PaginationModel | undefined) => CurrentPageRowsOutput;
8
8
  export default useCurrentPageRows;
@@ -1,3 +1,3 @@
1
- import { FormattedRow, ColDef, PostPaginationRowDef } from "../../types";
1
+ import { ColDef, FormattedRow, PostPaginationRowDef } from "../../types";
2
2
  declare const useDisplayRows: (currentPageRows: PostPaginationRowDef[], cols: ColDef[], ariaColIndexOffset: number) => FormattedRow[];
3
3
  export default useDisplayRows;
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from "react";
2
- import { dateToDatetimeInputStr, dateToInputStr } from "../../util/datetime";
2
+ import { dateToDatetimeInputStr, dateToInputStr } from "../../util";
3
3
  const getFormattedValue = (value, formatter, typeString) => {
4
4
  if (formatter) {
5
5
  return formatter(value);
@@ -31,7 +31,6 @@ const useDisplayRows = (currentPageRows, cols, ariaColIndexOffset) => useMemo(()
31
31
  const displayRow = [];
32
32
  Object.keys(row.data).forEach((name) => {
33
33
  if (!nameToIndex.has(name)) {
34
- console.error(`Warning: row data contains a property named "${name}", but it was not found among the column definitions.`);
35
34
  return;
36
35
  }
37
36
  const index = nameToIndex.get(name);
@@ -0,0 +1,4 @@
1
+ import { EditableFilterState } from "../../filtering/types";
2
+ import { AugRowDef, RowDef } from "../../types";
3
+ declare const useFilter: (rows: RowDef[], filterState: EditableFilterState | null) => AugRowDef[];
4
+ export default useFilter;
@@ -0,0 +1,4 @@
1
+ import { EditableFilterState, FilterState } from "../../filtering/types";
2
+ import { ColDef } from "../../types";
3
+ declare const useFilterStateFromEditable: (colDefs: ColDef[], editableFilterState: EditableFilterState | null) => FilterState | null;
4
+ export default useFilterStateFromEditable;
@@ -1,10 +1,10 @@
1
+ import { SortColDef, SortModel } from "../../sorting/types";
1
2
  import { AugRowDef, ColDefBase } from "../../types";
2
- import { SortColDef, TableSortModel } from "../../sorting/types";
3
3
  export interface SortedRowsOutput {
4
4
  sortedRows: AugRowDef[];
5
5
  sortingEnabled: boolean;
6
6
  sortColDef: SortColDef | null | undefined;
7
7
  setSortColDef: ((sortColDef: SortColDef | null) => void) | undefined;
8
8
  }
9
- declare const useSortedRows: (rows: AugRowDef[], cols: ColDefBase[], sortModel: TableSortModel | undefined) => SortedRowsOutput;
9
+ declare const useSortedRows: (rows: AugRowDef[], cols: ColDefBase[], sortModel: SortModel | undefined) => SortedRowsOutput;
10
10
  export default useSortedRows;
@@ -1,7 +1,7 @@
1
- import { RowDef, RowId } from "../types";
2
1
  import { MouseEventHandler } from "react";
3
2
  import { SelectionInfo, SelectModel } from "../selection/types";
4
- import { SelectionInputModel } from "../selection/SelectionInput";
3
+ import { SelectionInputModel } from "../../table/selection/SelectionInput";
4
+ import { RowDef, RowId } from "../types";
5
5
  export interface UseGridSelectionFnsHook {
6
6
  selectedSet: Set<RowId>;
7
7
  rowsAreSelectable: boolean | undefined;
@@ -7,13 +7,13 @@ export interface ColSortModel {
7
7
  sortOrder: SortOrder | null;
8
8
  setSortOrder: (order: SortOrder | null) => void;
9
9
  }
10
- export interface ControlledTableSortModel {
10
+ export interface ControlledSortModel {
11
11
  type?: "controlled";
12
12
  sortColDef: SortColDef | null;
13
13
  setSortColDef: (sortColDef: SortColDef | null) => void;
14
14
  }
15
- export interface UncontrolledTableSortModel {
15
+ export interface UncontrolledSortModel {
16
16
  type: "uncontrolled";
17
17
  initialSortColDef: SortColDef | null;
18
18
  }
19
- export type TableSortModel = ControlledTableSortModel | UncontrolledTableSortModel;
19
+ export type SortModel = ControlledSortModel | UncontrolledSortModel;
@@ -1,6 +1,6 @@
1
- import { UseControlledHoverHook } from "../../util/useControlledHover";
1
+ import { UseControlledHoverHook } from "../util/useControlledHover";
2
2
  import { ReactNode } from "react";
3
- import { ColSortModel } from "../../sorting/types";
3
+ import { ColSortModel } from "./types";
4
4
  export type UseSortHeaderStatesHook = UseControlledHoverHook<HTMLTableCellElement> & {
5
5
  handleClick: () => void;
6
6
  sortSymbol: ReactNode;
@@ -1,8 +1,8 @@
1
- import useControlledHover from "../../util/useControlledHover";
1
+ import useControlledHover from "../util/useControlledHover";
2
2
  import { useMemo } from "react";
3
- import upArrow from "../../sorting/upArrow";
4
- import arrowPlaceholder from "../../sorting/arrowPlaceholder";
5
- import downArrow from "../../sorting/downArrow";
3
+ import upArrow from "./upArrow";
4
+ import arrowPlaceholder from "./arrowPlaceholder";
5
+ import downArrow from "./downArrow";
6
6
  const useSortHeaderStates = (sortModel) => {
7
7
  const { isHovering, setIsHovering, handleMouseOver, handleMouseOut } = useControlledHover();
8
8
  const handleClick = () => {
@@ -0,0 +1,21 @@
1
+ import { AdditionalComponentsStyleModel, FilterInputTableStyleModel, TableStyleModel } from "../../table";
2
+ export interface ToolbarStyleModel {
3
+ activeButton?: string[];
4
+ inactiveButton?: string[];
5
+ toolbar?: string[];
6
+ interfaceContainer?: string[];
7
+ }
8
+ export interface ExportFormStyleModel {
9
+ legend?: string[];
10
+ radioContainer?: string[];
11
+ radioInput?: string[];
12
+ radioLabel?: string[];
13
+ submitButton?: string[];
14
+ }
15
+ export interface StyleModel {
16
+ mainTableStyleModel?: TableStyleModel;
17
+ filterInputTableStyleModel?: FilterInputTableStyleModel;
18
+ additionalComponentsStyleModel?: AdditionalComponentsStyleModel;
19
+ toolbarStyleModel?: ToolbarStyleModel;
20
+ exportFormStyleModel?: ExportFormStyleModel;
21
+ }
@@ -1,8 +1,8 @@
1
- import { ToolbarInterfaces } from "./types";
1
+ import { InterfaceNodeGenerator } from "./types";
2
2
  import { FC } from "react";
3
3
  import { ToolbarStyleModel } from "../styling/types";
4
4
  interface ToolbarContainerProps {
5
- interfaces: ToolbarInterfaces;
5
+ interfaceGen: InterfaceNodeGenerator;
6
6
  styleModel?: ToolbarStyleModel;
7
7
  }
8
8
  declare const ToolbarContainer: FC<ToolbarContainerProps>;
@@ -1,14 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import { useCallback, useMemo, useState } from "react";
3
3
  import Toolbar from "./Toolbar";
4
4
  import classNames from "classnames";
5
- const ToolbarContainer = ({ interfaces, styleModel, }) => {
5
+ const ToolbarContainer = ({ interfaceGen, styleModel, }) => {
6
6
  const [option, setOption] = useState(null);
7
- const enabledFeatures = Object.keys(interfaces).reduce((prev, toolbarOption) => {
8
- prev[toolbarOption] =
9
- !!interfaces[toolbarOption];
10
- return prev;
11
- }, {});
7
+ const closeUiCallback = useCallback(() => setOption(null), []);
8
+ const interfaces = useMemo(() => interfaceGen(closeUiCallback), [closeUiCallback, interfaceGen]);
9
+ const enabledFeatures = useMemo(() => {
10
+ return Object.keys(interfaces).reduce((prev, toolbarOption) => {
11
+ prev[toolbarOption] =
12
+ !!interfaces[toolbarOption];
13
+ return prev;
14
+ }, {});
15
+ }, [interfaces]);
12
16
  return (_jsxs("div", { className: "vstack", "data-testid": "toolbar container", children: [_jsx(Toolbar, { enabledFeatures: enabledFeatures, option: option, setOption: setOption, toolbarClasses: styleModel === null || styleModel === void 0 ? void 0 : styleModel.toolbar, activeClasses: styleModel === null || styleModel === void 0 ? void 0 : styleModel.activeButton, inactiveClasses: styleModel === null || styleModel === void 0 ? void 0 : styleModel.inactiveButton }), _jsx("div", { className: "position-relative", children: option !== null && (_jsx("div", { "data-testid": "toolbar feature interface content container", className: classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.interfaceContainer) || [
13
17
  "position-absolute",
14
18
  "z-1",