@absreim/react-bootstrap-data-grid 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.
- package/common/constants.d.ts +2 -0
- package/common/constants.js +2 -0
- package/common/editing/types.d.ts +7 -0
- package/{export → common/export}/ExportForm.d.ts +1 -0
- package/{export → common/export}/ExportForm.js +3 -3
- package/{filtering → common/filtering}/DateFilterRow.d.ts +4 -4
- package/{filtering → common/filtering}/DateFilterRow.js +1 -1
- package/common/filtering/FilterOptionsTable.d.ts +12 -0
- package/{filtering → common/filtering}/FilterOptionsTable.js +17 -20
- package/{filtering → common/filtering}/FilterRow.d.ts +4 -4
- package/{filtering → common/filtering}/FilterRow.js +1 -10
- package/{filtering → common/filtering}/NumberFilterRow.d.ts +3 -3
- package/{filtering → common/filtering}/NumberFilterRow.js +1 -1
- package/{filtering → common/filtering}/StringFilterRow.d.ts +3 -3
- package/{filtering → common/filtering}/StringFilterRow.js +1 -1
- package/{filtering → common/filtering}/types.d.ts +6 -6
- package/common/filtering/useFilterFormState.d.ts +3 -0
- package/{index.d.ts → common/index.d.ts} +8 -7
- package/{index.js → common/index.js} +8 -7
- package/{pagination → common/pagination}/PageSelector.d.ts +1 -1
- package/{pagination → common/pagination}/PageSizeSelector.d.ts +1 -1
- package/{pagination → common/pagination}/Pagination.d.ts +1 -1
- package/{pagination → common/pagination}/Pagination.js +6 -3
- package/{pagination → common/pagination}/types.d.ts +3 -2
- package/{pipeline → common/pipeline}/useAugFormattedRows.d.ts +1 -1
- package/common/pipeline/useColNameToWidth.d.ts +3 -0
- package/common/pipeline/useColNameToWidth.js +12 -0
- package/{pipeline → common/pipeline}/useCombinedPipeline/index.d.ts +4 -4
- package/{pipeline → common/pipeline}/useCombinedPipeline/useCurrentPageRows.d.ts +3 -3
- package/{pipeline → common/pipeline}/useCombinedPipeline/useDisplayRows.d.ts +1 -1
- package/{pipeline → common/pipeline}/useCombinedPipeline/useDisplayRows.js +1 -2
- package/common/pipeline/useCombinedPipeline/useFilter.d.ts +4 -0
- package/common/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +4 -0
- package/{pipeline → common/pipeline}/useCombinedPipeline/useSortedRows.d.ts +2 -2
- package/{pipeline → common/pipeline}/useGridSelectionFns.d.ts +2 -2
- package/{sorting → common/sorting}/types.d.ts +3 -3
- package/{main/ColHeaderCell → common/sorting}/useSortHeaderStates.d.ts +2 -2
- package/{main/ColHeaderCell → common/sorting}/useSortHeaderStates.js +4 -4
- package/common/styling/types.d.ts +21 -0
- package/{toolbar → common/toolbar}/ToolbarContainer.d.ts +2 -2
- package/{toolbar → common/toolbar}/ToolbarContainer.js +11 -7
- package/common/toolbar/types.d.ts +11 -0
- package/common/toolbar/useInterfaces.d.ts +3 -0
- package/{toolbar → common/toolbar}/useInterfaces.js +9 -6
- package/{types.d.ts → common/types.d.ts} +24 -34
- package/common/util/index.d.ts +5 -0
- package/common/util/index.js +5 -0
- package/community/index.d.ts +4 -0
- package/community/index.js +4 -0
- package/grid/constants.d.ts +2 -0
- package/grid/constants.js +2 -0
- package/grid/index.d.ts +3 -0
- package/grid/index.js +3 -0
- package/{Grid.d.ts → grid/main/Grid.d.ts} +0 -1
- package/grid/main/Grid.js +60 -0
- package/grid/main/GridBody.d.ts +4 -0
- package/grid/main/GridBody.js +17 -0
- package/grid/main/GridHeader.d.ts +4 -0
- package/grid/main/GridHeader.js +12 -0
- package/grid/main/getWidthStyles.d.ts +3 -0
- package/grid/main/getWidthStyles.js +6 -0
- package/grid/main/types.d.ts +32 -0
- package/grid/main/types.js +1 -0
- package/grid.css +1 -0
- package/grid.scss +231 -0
- package/package.json +1 -1
- package/table/InternalTable.d.ts +21 -0
- package/table/InternalTable.js +59 -0
- package/table/Table.d.ts +5 -0
- package/{Grid.js → table/Table.js} +11 -21
- package/{editing → table/editing}/EditControlsCell.d.ts +5 -5
- package/table/editing/EditControlsCell.js +11 -0
- package/{editing → table/editing}/EditableRow.d.ts +8 -9
- package/{editing → table/editing}/EditableRow.js +3 -3
- package/table/index.d.ts +5 -0
- package/table/index.js +5 -0
- package/table/main/BodyRows.d.ts +22 -0
- package/table/main/BodyRows.js +34 -0
- package/{main → table/main}/ColHeaderCell/index.js +3 -3
- package/{selection → table/selection}/SelectAllHeaderCell.d.ts +2 -2
- package/{selection → table/selection}/SelectAllHeaderCell.js +2 -4
- package/{selection → table/selection}/SelectionInput.d.ts +1 -1
- package/table/styling/types.d.ts +41 -0
- package/table/styling/types.js +1 -0
- package/table/types.d.ts +19 -0
- package/table/types.js +1 -0
- package/InternalGrid.d.ts +0 -23
- package/InternalGrid.js +0 -57
- package/editing/EditControlsCell.js +0 -19
- package/editing/types.d.ts +0 -16
- package/filtering/FilterOptionsTable.d.ts +0 -11
- package/filtering/useFilterFormState.d.ts +0 -3
- package/main/BodyRows.d.ts +0 -22
- package/main/BodyRows.js +0 -18
- package/main/ToggleButton.d.ts +0 -9
- package/main/ToggleButton.js +0 -14
- package/pipeline/useCombinedPipeline/useEditableFromFilterState.d.ts +0 -3
- package/pipeline/useCombinedPipeline/useEditableFromFilterState.js +0 -14
- package/pipeline/useCombinedPipeline/useFilter.d.ts +0 -4
- package/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +0 -4
- package/pipeline/useUnwrappedGridStyles.d.ts +0 -7
- package/pipeline/useUnwrappedGridStyles.js +0 -17
- package/styling/styleModelUnwrappers.d.ts +0 -4
- package/styling/styleModelUnwrappers.js +0 -58
- package/styling/types.d.ts +0 -62
- package/toolbar/types.d.ts +0 -3
- package/toolbar/useInterfaces.d.ts +0 -9
- /package/{editing → common/editing}/inputStrsToRowData.d.ts +0 -0
- /package/{editing → common/editing}/inputStrsToRowData.js +0 -0
- /package/{editing → common/editing}/types.js +0 -0
- /package/{export → common/export}/types.d.ts +0 -0
- /package/{export → common/export}/types.js +0 -0
- /package/{export → common/export}/useExportFn.d.ts +0 -0
- /package/{export → common/export}/useExportFn.js +0 -0
- /package/{filtering → common/filtering}/types.js +0 -0
- /package/{filtering → common/filtering}/useFilterFormState.js +0 -0
- /package/{pagination → common/pagination}/PageSelector.js +0 -0
- /package/{pagination → common/pagination}/PageSizeSelector.js +0 -0
- /package/{pagination → common/pagination}/types.js +0 -0
- /package/{pipeline → common/pipeline}/types.d.ts +0 -0
- /package/{pipeline → common/pipeline}/types.js +0 -0
- /package/{pipeline → common/pipeline}/useAugFormattedRows.js +0 -0
- /package/{pipeline → common/pipeline}/useCombinedPipeline/index.js +0 -0
- /package/{pipeline → common/pipeline}/useCombinedPipeline/useCurrentPageRows.js +0 -0
- /package/{pipeline → common/pipeline}/useCombinedPipeline/useFilter.js +0 -0
- /package/{pipeline → common/pipeline}/useCombinedPipeline/useFilterStateFromEditable.js +0 -0
- /package/{pipeline → common/pipeline}/useCombinedPipeline/useFilterStateStore.d.ts +0 -0
- /package/{pipeline → common/pipeline}/useCombinedPipeline/useFilterStateStore.js +0 -0
- /package/{pipeline → common/pipeline}/useCombinedPipeline/useSortedRows.js +0 -0
- /package/{pipeline → common/pipeline}/useGetInputStrSubmitCallback.d.ts +0 -0
- /package/{pipeline → common/pipeline}/useGetInputStrSubmitCallback.js +0 -0
- /package/{pipeline → common/pipeline}/useGridSelectionFns.js +0 -0
- /package/{selection → common/selection}/types.d.ts +0 -0
- /package/{selection → common/selection}/types.js +0 -0
- /package/{sorting → common/sorting}/arrowPlaceholder.d.ts +0 -0
- /package/{sorting → common/sorting}/arrowPlaceholder.js +0 -0
- /package/{sorting → common/sorting}/downArrow.d.ts +0 -0
- /package/{sorting → common/sorting}/downArrow.js +0 -0
- /package/{sorting → common/sorting}/sortOrderToAriaSort.d.ts +0 -0
- /package/{sorting → common/sorting}/sortOrderToAriaSort.js +0 -0
- /package/{sorting → common/sorting}/types.js +0 -0
- /package/{sorting → common/sorting}/upArrow.d.ts +0 -0
- /package/{sorting → common/sorting}/upArrow.js +0 -0
- /package/{styling → common/styling}/types.js +0 -0
- /package/{toolbar → common/toolbar}/Toolbar.d.ts +0 -0
- /package/{toolbar → common/toolbar}/Toolbar.js +0 -0
- /package/{toolbar → common/toolbar}/types.js +0 -0
- /package/{types.js → common/types.js} +0 -0
- /package/{util → common/util}/datetime.d.ts +0 -0
- /package/{util → common/util}/datetime.js +0 -0
- /package/{util → common/util}/getWidthStyle.d.ts +0 -0
- /package/{util → common/util}/getWidthStyle.js +0 -0
- /package/{util → common/util}/isSubset.d.ts +0 -0
- /package/{util → common/util}/isSubset.js +0 -0
- /package/{util → common/util}/trueModulo.d.ts +0 -0
- /package/{util → common/util}/trueModulo.js +0 -0
- /package/{util → common/util}/useControlledHover.d.ts +0 -0
- /package/{util → common/util}/useControlledHover.js +0 -0
- /package/{main → table/main}/ColHeaderCell/index.d.ts +0 -0
- /package/{selection → table/selection}/SelectionInput.js +0 -0
- /package/{style.css → table.css} +0 -0
- /package/{style.scss → table.scss} +0 -0
|
@@ -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>;
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { useId, useState } from "react";
|
|
14
14
|
import classNames from "classnames";
|
|
15
15
|
var ExportForm = function (_a) {
|
|
16
|
-
var _b = _a.exportFnInfo, exportFn = _b.exportFn, formattersExist = _b.formattersExist, paginationEnabled = _b.paginationEnabled, filteringEnabled = _b.filteringEnabled, rowCounts = _b.rowCounts, styleModel = _a.styleModel;
|
|
16
|
+
var _b = _a.exportFnInfo, exportFn = _b.exportFn, formattersExist = _b.formattersExist, paginationEnabled = _b.paginationEnabled, filteringEnabled = _b.filteringEnabled, rowCounts = _b.rowCounts, closeCallback = _a.closeCallback, styleModel = _a.styleModel;
|
|
17
17
|
var formId = useId();
|
|
18
18
|
var _c = useState({
|
|
19
19
|
stage: "original",
|
|
@@ -82,7 +82,7 @@ var ExportForm = function (_a) {
|
|
|
82
82
|
var radioContainerClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.radioContainer) || ["form-check"]);
|
|
83
83
|
var radioInputClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.radioInput) || ["form-check-input"]);
|
|
84
84
|
var radioLabelClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.radioLabel) || ["form-check-label"]);
|
|
85
|
-
var submitButtonClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.submitButton) || ["btn", "btn-
|
|
85
|
+
var submitButtonClasses = classNames((styleModel === null || styleModel === void 0 ? void 0 : styleModel.submitButton) || ["btn", "btn-primary"]);
|
|
86
86
|
return (_jsxs("form", { onSubmit: handleSubmit, children: [_jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose data to export" }), stageOptions.map(function (_a) {
|
|
87
87
|
var value = _a.value, label = _a.label, disabled = _a.disabled;
|
|
88
88
|
return (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: "".concat(formId, "-").concat(value), value: value, checked: formState.stage === value, onChange: getChangeHandler("stage", value), disabled: disabled }), _jsx("label", { className: radioLabelClasses, htmlFor: "".concat(formId, "-").concat(value), children: label })] }, value));
|
|
@@ -92,6 +92,6 @@ var ExportForm = function (_a) {
|
|
|
92
92
|
})] }), _jsxs("fieldset", { children: [_jsx("legend", { className: legendClasses, children: "Choose the file type" }), fileTypeOptions.map(function (_a) {
|
|
93
93
|
var fileType = _a.fileType, label = _a.label;
|
|
94
94
|
return (_jsxs("div", { className: radioContainerClasses, children: [_jsx("input", { className: radioInputClasses, type: "radio", id: "".concat(formId, "-").concat(fileType), value: fileType, checked: formState.fileType === fileType, onChange: getChangeHandler("fileType", fileType) }), _jsx("label", { className: radioLabelClasses, htmlFor: "".concat(formId, "-").concat(fileType), children: label })] }, fileType));
|
|
95
|
-
})] }), _jsx("button", { type: "submit", className: submitButtonClasses, children: "Submit" })] }));
|
|
95
|
+
})] }), _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" })] })] }));
|
|
96
96
|
};
|
|
97
97
|
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;
|
|
@@ -39,7 +39,7 @@ var DateFilterRow = function (_a) {
|
|
|
39
39
|
var endDateInputId = "$endDate-".concat(inputId);
|
|
40
40
|
var startDateInputLabel = "".concat(columnLabel, " Column Filter Start Date");
|
|
41
41
|
var endDateInputLabel = "".concat(columnLabel, " Column Filter End Date");
|
|
42
|
-
var 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"
|
|
42
|
+
var 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 })] }))] }));
|
|
43
43
|
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 }));
|
|
44
44
|
};
|
|
45
45
|
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;
|
|
@@ -9,23 +9,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import {
|
|
13
|
+
import { useState } from "react";
|
|
23
14
|
import StringFilterRow from "./StringFilterRow";
|
|
24
15
|
import NumberFilterRow from "./NumberFilterRow";
|
|
25
16
|
import useFilterFormState from "./useFilterFormState";
|
|
26
17
|
import DateFilterRow from "./DateFilterRow";
|
|
27
18
|
import classNames from "classnames";
|
|
28
|
-
import { unwrapFilterInputTableStyleModel } from "../styling/styleModelUnwrappers";
|
|
29
19
|
var convertFilterFormStateToEditableState = function (filterFormState) {
|
|
30
20
|
return Object.keys(filterFormState).reduce(function (editableState, colName) {
|
|
31
21
|
var rowFilterFormState = filterFormState[colName];
|
|
@@ -73,10 +63,9 @@ var convertFilterFormStateToEditableState = function (filterFormState) {
|
|
|
73
63
|
}, {});
|
|
74
64
|
};
|
|
75
65
|
var FilterOptionsTable = function (_a) {
|
|
76
|
-
var filterState = _a.filterState, setFilterState = _a.setFilterState, caption = _a.caption, styleModel = _a.styleModel;
|
|
66
|
+
var filterState = _a.filterState, setFilterState = _a.setFilterState, caption = _a.caption, styleModel = _a.styleModel, closeFormCallback = _a.closeFormCallback;
|
|
77
67
|
var formFilterState = useFilterFormState(filterState);
|
|
78
68
|
var _b = useState(formFilterState), formState = _b[0], setFormState = _b[1];
|
|
79
|
-
var unwrappedStyleModel = useMemo(function () { return unwrapFilterInputTableStyleModel(styleModel); }, [styleModel]);
|
|
80
69
|
var getRows = function () {
|
|
81
70
|
return Object.keys(formState).map(function (colName, index) {
|
|
82
71
|
function getColStateSetter(colName) {
|
|
@@ -89,19 +78,26 @@ var FilterOptionsTable = function (_a) {
|
|
|
89
78
|
var colFilterState = formState[colName];
|
|
90
79
|
switch (colFilterState.type) {
|
|
91
80
|
case "string": {
|
|
92
|
-
return (_jsx(StringFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses:
|
|
93
|
-
|
|
81
|
+
return (_jsx(StringFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput) &&
|
|
82
|
+
(styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput(index)), enableInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput) &&
|
|
83
|
+
(styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput(index)), searchStringInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.searchStringInput) &&
|
|
84
|
+
(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: function (colIndex) {
|
|
85
|
+
return (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd(index, colIndex));
|
|
94
86
|
} }, colName));
|
|
95
87
|
}
|
|
96
88
|
case "number": {
|
|
97
|
-
return (_jsx(NumberFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses:
|
|
98
|
-
|
|
89
|
+
return (_jsx(NumberFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput) &&
|
|
90
|
+
(styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput(index)), enableInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput) &&
|
|
91
|
+
(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: function (colIndex) {
|
|
92
|
+
return (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd(index, colIndex));
|
|
99
93
|
} }, colName));
|
|
100
94
|
}
|
|
101
95
|
default: {
|
|
102
96
|
// date or datetime
|
|
103
|
-
return (_jsx(DateFilterRow, { ariaRowIndex: index + 2, includeTime: colFilterState.type === "datetime", columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses:
|
|
104
|
-
|
|
97
|
+
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) &&
|
|
98
|
+
(styleModel === null || styleModel === void 0 ? void 0 : styleModel.schemeSelectionInput(index)), enableInputClasses: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.enablementInput) &&
|
|
99
|
+
(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: function (colIndex) {
|
|
100
|
+
return (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd) && (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tbodyTd(index, colIndex));
|
|
105
101
|
} }, colName));
|
|
106
102
|
}
|
|
107
103
|
}
|
|
@@ -111,7 +107,8 @@ var FilterOptionsTable = function (_a) {
|
|
|
111
107
|
event.preventDefault();
|
|
112
108
|
var editableTableFilterState = convertFilterFormStateToEditableState(formState);
|
|
113
109
|
setFilterState(editableTableFilterState);
|
|
110
|
+
closeFormCallback();
|
|
114
111
|
};
|
|
115
|
-
return (_jsxs("form", { onSubmit: onSubmit, className: classNames(styleModel === null || styleModel === void 0 ? void 0 : styleModel.form), children: [_jsxs("table", { className: classNames
|
|
112
|
+
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(function (colName, index) { return (_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" })] })] }));
|
|
116
113
|
};
|
|
117
114
|
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;
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
2
|
import classNames from "classnames";
|
|
12
3
|
export function FilterRow(props) {
|
|
13
4
|
var ariaRowIndex = props.ariaRowIndex, columnLabel = props.columnLabel, typeLabel = props.typeLabel, enabled = props.enabled, enabledChangeHandler = props.enabledChangeHandler, currentScheme = props.currentScheme, handleSchemeChange = props.handleSchemeChange, schemesToLabels = props.schemesToLabels, searchStringInputCellContents = props.searchStringInputCellContents, trClasses = props.trClasses, tdClasses = props.tdClasses, inputClasses = props.inputClasses, selectClasses = props.selectClasses;
|
|
14
5
|
var checkboxLabel = "".concat(columnLabel, " Column Filter Toggle");
|
|
15
6
|
var opSelectLabel = "".concat(columnLabel, " Column Filter Operator Selection");
|
|
16
|
-
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
|
|
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(function (scheme) { return (_jsx("option", { value: scheme, children: schemesToLabels[scheme] }, scheme)); }) }) }), _jsx("td", { className: classNames(tdClasses(4)), "aria-colindex": 5, children: searchStringInputCellContents })] }));
|
|
17
8
|
}
|
|
18
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;
|
|
@@ -29,7 +29,7 @@ var NumberFilterRow = function (_a) {
|
|
|
29
29
|
};
|
|
30
30
|
var enabled = filterState.enabled, scheme = filterState.scheme, inputValue = filterState.inputValue;
|
|
31
31
|
var valueInputLabel = "".concat(columnLabel, " Column Filter Value");
|
|
32
|
-
var searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames("form-control"
|
|
32
|
+
var searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames(numberInputClasses || "form-control"), type: "number", required: enabled, disabled: !enabled, value: inputValue, onChange: handleNumInputValueChange }));
|
|
33
33
|
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 }));
|
|
34
34
|
};
|
|
35
35
|
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;
|
|
@@ -29,7 +29,7 @@ var StringFilterRow = function (_a) {
|
|
|
29
29
|
};
|
|
30
30
|
var enabled = filterState.enabled, scheme = filterState.scheme, searchString = filterState.searchString;
|
|
31
31
|
var valueInputLabel = "".concat(columnLabel, " Column Filter Value");
|
|
32
|
-
var searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames("form-control"
|
|
32
|
+
var searchStringInputCellContents = (_jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: classNames(searchStringInputClasses || "form-control"), required: enabled, disabled: !enabled, value: searchString, onChange: handleSearchStringChange }));
|
|
33
33
|
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 }));
|
|
34
34
|
};
|
|
35
35
|
export default StringFilterRow;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export type
|
|
1
|
+
export type FilterState = Record<string, ColFilterState>;
|
|
2
|
+
export type EditableFilterState = Record<string, EditableColFilterState>;
|
|
3
3
|
export interface ColFilterState {
|
|
4
|
-
editableState:
|
|
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
|
|
47
|
+
export type EditableColFilterState = StringFilterState | NumberFilterState | DateFilterState;
|
|
48
48
|
export interface ControlledFilterModel {
|
|
49
49
|
type?: "controlled";
|
|
50
|
-
tableFilterState:
|
|
51
|
-
setTableFilterState: (state:
|
|
50
|
+
tableFilterState: EditableFilterState;
|
|
51
|
+
setTableFilterState: (state: EditableFilterState) => void;
|
|
52
52
|
filterTableCaption?: string;
|
|
53
53
|
}
|
|
54
54
|
export type UncontrolledFilterModel = Partial<Pick<ControlledFilterModel, "tableFilterState" | "filterTableCaption">> & {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./styling/types";
|
|
3
1
|
export * from "./editing/types";
|
|
4
|
-
export * from "./
|
|
2
|
+
export * from "./export/types";
|
|
5
3
|
export * from "./filtering/types";
|
|
6
|
-
export * from "./sorting/types";
|
|
7
4
|
export * from "./pagination/types";
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export
|
|
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,10 +1,11 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./styling/types";
|
|
3
1
|
export * from "./editing/types";
|
|
4
|
-
export * from "./
|
|
2
|
+
export * from "./export/types";
|
|
5
3
|
export * from "./filtering/types";
|
|
6
|
-
export * from "./sorting/types";
|
|
7
4
|
export * from "./pagination/types";
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export
|
|
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";
|
|
@@ -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;
|
|
@@ -17,8 +17,11 @@ var Pagination = function (_a) {
|
|
|
17
17
|
setCurrentPage(maxPages);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
return (_jsxs("div", { "data-testid": "pagination ui container div", className: classNames(containerDivClasses
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
return (_jsxs("div", { "data-testid": "pagination ui container div", className: classNames(containerDivClasses || [
|
|
21
|
+
"d-flex",
|
|
22
|
+
"justify-content-end",
|
|
23
|
+
"gap-2",
|
|
24
|
+
"px-2",
|
|
25
|
+
]), 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 })] }));
|
|
23
26
|
};
|
|
24
27
|
export default Pagination;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
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
|
|
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,12 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
var useColNameToWidth = function (cols) {
|
|
3
|
+
return useMemo(function () {
|
|
4
|
+
var map = {};
|
|
5
|
+
cols.forEach(function (_a) {
|
|
6
|
+
var name = _a.name, width = _a.width;
|
|
7
|
+
return (map[name] = width);
|
|
8
|
+
});
|
|
9
|
+
return map;
|
|
10
|
+
}, [cols]);
|
|
11
|
+
};
|
|
12
|
+
export default useColNameToWidth;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { SortedRowsOutput } from "./useSortedRows";
|
|
2
2
|
import { CurrentPageRowsOutput } from "./useCurrentPageRows";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export type CombinedPipelineParams = Pick<
|
|
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:
|
|
11
|
+
filterState: FilterState | null;
|
|
12
12
|
sortedRowsOutput: SortedRowsOutput;
|
|
13
13
|
currentPageRowsOutput: CurrentPageRowsOutput;
|
|
14
14
|
showSelectCol: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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:
|
|
7
|
+
declare const useCurrentPageRows: (sortedRows: AugRowDef[], paginationModel: PaginationModel | undefined) => CurrentPageRowsOutput;
|
|
8
8
|
export default useCurrentPageRows;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
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
|
|
2
|
+
import { dateToDatetimeInputStr, dateToInputStr } from "../../util";
|
|
3
3
|
var getFormattedValue = function (value, formatter, typeString) {
|
|
4
4
|
if (formatter) {
|
|
5
5
|
return formatter(value);
|
|
@@ -36,7 +36,6 @@ var useDisplayRows = function (currentPageRows, cols, ariaColIndexOffset) {
|
|
|
36
36
|
var displayRow = [];
|
|
37
37
|
Object.keys(row.data).forEach(function (name) {
|
|
38
38
|
if (!nameToIndex.has(name)) {
|
|
39
|
-
console.error("Warning: row data contains a property named \"".concat(name, "\", but it was not found among the column definitions."));
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
42
41
|
var index = nameToIndex.get(name);
|
|
@@ -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:
|
|
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 "
|
|
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
|
|
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
|
|
15
|
+
export interface UncontrolledSortModel {
|
|
16
16
|
type: "uncontrolled";
|
|
17
17
|
initialSortColDef: SortColDef | null;
|
|
18
18
|
}
|
|
19
|
-
export type
|
|
19
|
+
export type SortModel = ControlledSortModel | UncontrolledSortModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UseControlledHoverHook } from "
|
|
1
|
+
import { UseControlledHoverHook } from "../util/useControlledHover";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import { ColSortModel } from "
|
|
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 "
|
|
1
|
+
import useControlledHover from "../util/useControlledHover";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import upArrow from "
|
|
4
|
-
import arrowPlaceholder from "
|
|
5
|
-
import downArrow from "
|
|
3
|
+
import upArrow from "./upArrow";
|
|
4
|
+
import arrowPlaceholder from "./arrowPlaceholder";
|
|
5
|
+
import downArrow from "./downArrow";
|
|
6
6
|
var useSortHeaderStates = function (sortModel) {
|
|
7
7
|
var _a = useControlledHover(), isHovering = _a.isHovering, setIsHovering = _a.setIsHovering, handleMouseOver = _a.handleMouseOver, handleMouseOut = _a.handleMouseOut;
|
|
8
8
|
var handleClick = function () {
|
|
@@ -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
|
+
}
|