@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.
- package/common/constants.d.ts +2 -0
- package/common/constants.js +2 -0
- package/common/editing/types.d.ts +7 -0
- package/{grid → common}/export/ExportForm.d.ts +1 -0
- package/{grid → common}/export/ExportForm.js +3 -3
- package/{grid → common}/filtering/DateFilterRow.d.ts +4 -4
- package/{grid → common}/filtering/DateFilterRow.js +1 -1
- package/common/filtering/FilterOptionsTable.d.ts +12 -0
- package/common/filtering/FilterOptionsTable.js +87 -0
- package/{grid → common}/filtering/FilterRow.d.ts +4 -4
- package/{grid → common}/filtering/FilterRow.js +1 -1
- package/{grid → common}/filtering/NumberFilterRow.d.ts +3 -3
- package/{grid → common}/filtering/NumberFilterRow.js +1 -1
- package/{grid → common}/filtering/StringFilterRow.d.ts +3 -3
- package/{grid → common}/filtering/StringFilterRow.js +1 -1
- package/{grid → common}/filtering/types.d.ts +6 -6
- package/common/filtering/useFilterFormState.d.ts +3 -0
- package/common/index.d.ts +11 -0
- package/common/index.js +11 -0
- package/{grid → common}/pagination/PageSelector.d.ts +1 -1
- package/{grid → common}/pagination/PageSizeSelector.d.ts +1 -1
- package/{grid → common}/pagination/Pagination.d.ts +1 -1
- package/{grid → common}/pagination/Pagination.js +6 -3
- package/{grid → common}/pagination/types.d.ts +3 -2
- package/{grid → common}/pipeline/useAugFormattedRows.d.ts +1 -1
- package/common/pipeline/useColNameToWidth.d.ts +3 -0
- package/common/pipeline/useColNameToWidth.js +7 -0
- package/{grid → common}/pipeline/useCombinedPipeline/index.d.ts +4 -4
- package/{grid → common}/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +3 -3
- package/{grid → common}/pipeline/useCombinedPipeline/useDisplayRows.d.ts +1 -1
- package/{grid → 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/{grid → common}/pipeline/useCombinedPipeline/useSortedRows.d.ts +2 -2
- package/{grid → common}/pipeline/useGridSelectionFns.d.ts +2 -2
- package/{grid → common}/sorting/types.d.ts +3 -3
- package/{grid/main/ColHeaderCell → common/sorting}/useSortHeaderStates.d.ts +2 -2
- package/{grid/main/ColHeaderCell → common/sorting}/useSortHeaderStates.js +4 -4
- package/common/styling/types.d.ts +21 -0
- package/{grid → common}/toolbar/ToolbarContainer.d.ts +2 -2
- package/{grid → common}/toolbar/ToolbarContainer.js +11 -7
- package/common/toolbar/types.d.ts +11 -0
- package/common/toolbar/useInterfaces.d.ts +3 -0
- package/common/toolbar/useInterfaces.js +15 -0
- package/{grid → common}/types.d.ts +24 -34
- package/common/util/index.d.ts +5 -0
- package/common/util/index.js +5 -0
- package/grid/constants.d.ts +2 -0
- package/grid/constants.js +2 -0
- package/grid/index.d.ts +3 -10
- package/grid/index.js +3 -10
- package/grid/{Grid.d.ts → main/Grid.d.ts} +0 -1
- package/grid/main/Grid.js +59 -0
- package/grid/main/GridBody.d.ts +4 -0
- package/grid/main/GridBody.js +13 -0
- package/grid/main/GridHeader.d.ts +4 -0
- package/grid/main/GridHeader.js +11 -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.css +1 -0
- package/grid.scss +231 -0
- package/package.json +1 -1
- package/pro/index.d.ts +5 -0
- package/pro/index.js +5 -0
- package/table/InternalTable.d.ts +21 -0
- package/table/InternalTable.js +58 -0
- package/table/Table.d.ts +5 -0
- package/{grid/Grid.js → table/Table.js} +11 -18
- package/{grid → table}/editing/EditControlsCell.d.ts +5 -5
- package/table/editing/EditControlsCell.js +10 -0
- package/{grid → table}/editing/EditableRow.d.ts +8 -9
- package/{grid → 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 +27 -0
- package/{grid → table}/main/ColHeaderCell/index.js +3 -3
- package/{grid → table}/selection/SelectAllHeaderCell.d.ts +2 -2
- package/{grid → table}/selection/SelectAllHeaderCell.js +2 -4
- package/{grid → table}/selection/SelectionInput.d.ts +1 -1
- package/table/style.scss +3 -0
- 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/{grid-pro → table-pro}/ColHeaderCellPro.js +4 -4
- package/table-pro/TablePro.d.ts +4 -0
- package/{grid-pro/GridPro.js → table-pro/TablePro.js} +10 -13
- package/{grid-pro → table-pro}/index.d.ts +2 -2
- package/{grid-pro → table-pro}/index.js +2 -2
- package/{grid-pro → table-pro}/reorder/ReorderHandleCell.js +1 -1
- package/{grid-pro → table-pro}/reorder/useKeyboardReorder.js +1 -1
- package/{grid-pro → table-pro}/resize/useResizeModel.d.ts +1 -1
- package/table-pro/style.scss +69 -0
- package/{grid-pro → table-pro}/types.d.ts +3 -3
- package/table-pro/types.js +1 -0
- package/table-pro.scss +1 -0
- package/grid/InternalGrid.d.ts +0 -23
- package/grid/InternalGrid.js +0 -56
- package/grid/editing/EditControlsCell.js +0 -18
- package/grid/editing/types.d.ts +0 -16
- package/grid/filtering/FilterOptionsTable.d.ts +0 -11
- package/grid/filtering/FilterOptionsTable.js +0 -81
- package/grid/filtering/useFilterFormState.d.ts +0 -3
- package/grid/main/BodyRows.d.ts +0 -22
- package/grid/main/BodyRows.js +0 -11
- package/grid/main/ToggleButton.d.ts +0 -9
- package/grid/main/ToggleButton.js +0 -13
- package/grid/pipeline/useCombinedPipeline/useFilter.d.ts +0 -4
- package/grid/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +0 -4
- package/grid/pipeline/useUnwrappedGridStyles.d.ts +0 -7
- package/grid/pipeline/useUnwrappedGridStyles.js +0 -15
- package/grid/styling/styleModelUnwrappers.d.ts +0 -4
- package/grid/styling/styleModelUnwrappers.js +0 -47
- package/grid/styling/types.d.ts +0 -62
- package/grid/toolbar/types.d.ts +0 -3
- package/grid/toolbar/useInterfaces.d.ts +0 -9
- package/grid/toolbar/useInterfaces.js +0 -11
- package/grid-pro/GridPro.d.ts +0 -4
- /package/{grid → common}/editing/inputStrsToRowData.d.ts +0 -0
- /package/{grid → common}/editing/inputStrsToRowData.js +0 -0
- /package/{grid-pro/reorder → common/editing}/types.js +0 -0
- /package/{grid → common}/export/types.d.ts +0 -0
- /package/{grid-pro/resize → common/export}/types.js +0 -0
- /package/{grid → common}/export/useExportFn.d.ts +0 -0
- /package/{grid → common}/export/useExportFn.js +0 -0
- /package/{grid → common}/filtering/types.js +0 -0
- /package/{grid → common}/filtering/useFilterFormState.js +0 -0
- /package/{grid → common}/pagination/PageSelector.js +0 -0
- /package/{grid → common}/pagination/PageSizeSelector.js +0 -0
- /package/{grid-pro → common/pagination}/types.js +0 -0
- /package/{grid → common}/pipeline/types.d.ts +0 -0
- /package/{grid-pro/util → common/pipeline}/types.js +0 -0
- /package/{grid → common}/pipeline/useAugFormattedRows.js +0 -0
- /package/{grid → common}/pipeline/useCombinedPipeline/index.js +0 -0
- /package/{grid → common}/pipeline/useCombinedPipeline/useCurrentPageRows.js +0 -0
- /package/{grid → common}/pipeline/useCombinedPipeline/useFilter.js +0 -0
- /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateFromEditable.js +0 -0
- /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateStore.d.ts +0 -0
- /package/{grid → common}/pipeline/useCombinedPipeline/useFilterStateStore.js +0 -0
- /package/{grid → common}/pipeline/useCombinedPipeline/useSortedRows.js +0 -0
- /package/{grid → common}/pipeline/useGetInputStrSubmitCallback.d.ts +0 -0
- /package/{grid → common}/pipeline/useGetInputStrSubmitCallback.js +0 -0
- /package/{grid → common}/pipeline/useGridSelectionFns.js +0 -0
- /package/{grid → common}/selection/types.d.ts +0 -0
- /package/{grid → common}/selection/types.js +0 -0
- /package/{grid → common}/sorting/arrowPlaceholder.d.ts +0 -0
- /package/{grid → common}/sorting/arrowPlaceholder.js +0 -0
- /package/{grid → common}/sorting/downArrow.d.ts +0 -0
- /package/{grid → common}/sorting/downArrow.js +0 -0
- /package/{grid → common}/sorting/sortOrderToAriaSort.d.ts +0 -0
- /package/{grid → common}/sorting/sortOrderToAriaSort.js +0 -0
- /package/{grid/editing → common/sorting}/types.js +0 -0
- /package/{grid → common}/sorting/upArrow.d.ts +0 -0
- /package/{grid → common}/sorting/upArrow.js +0 -0
- /package/{grid/export → common/styling}/types.js +0 -0
- /package/{grid → common}/toolbar/Toolbar.d.ts +0 -0
- /package/{grid → common}/toolbar/Toolbar.js +0 -0
- /package/{grid/pagination → common/toolbar}/types.js +0 -0
- /package/{grid/pipeline → common}/types.js +0 -0
- /package/{grid → common}/util/datetime.d.ts +0 -0
- /package/{grid → common}/util/datetime.js +0 -0
- /package/{grid → common}/util/getWidthStyle.d.ts +0 -0
- /package/{grid → common}/util/getWidthStyle.js +0 -0
- /package/{grid → common}/util/isSubset.d.ts +0 -0
- /package/{grid → common}/util/isSubset.js +0 -0
- /package/{grid → common}/util/trueModulo.d.ts +0 -0
- /package/{grid → common}/util/trueModulo.js +0 -0
- /package/{grid → common}/util/useControlledHover.d.ts +0 -0
- /package/{grid → common}/util/useControlledHover.js +0 -0
- /package/grid/{sorting → main}/types.js +0 -0
- /package/{grid → table}/main/ColHeaderCell/index.d.ts +0 -0
- /package/{grid → table}/selection/SelectionInput.js +0 -0
- /package/{grid-pro → table-pro}/ColHeaderCellPro.d.ts +0 -0
- /package/{grid-pro → table-pro}/assets/HorizontalGrip.d.ts +0 -0
- /package/{grid-pro → table-pro}/assets/HorizontalGrip.js +0 -0
- /package/{grid-pro → table-pro}/assets/VerticalGrip.d.ts +0 -0
- /package/{grid-pro → table-pro}/assets/VerticalGrip.js +0 -0
- /package/{grid-pro/util → table-pro/lib}/regDragCleanup.d.ts +0 -0
- /package/{grid-pro/util → table-pro/lib}/regDragCleanup.js +0 -0
- /package/{grid-pro/util → table-pro/lib}/types.d.ts +0 -0
- /package/{grid/styling → table-pro/lib}/types.js +0 -0
- /package/{grid-pro → table-pro}/reorder/ReorderHandleCell.d.ts +0 -0
- /package/{grid-pro → table-pro}/reorder/ReorderHeaderCell.d.ts +0 -0
- /package/{grid-pro → table-pro}/reorder/ReorderHeaderCell.js +0 -0
- /package/{grid-pro → table-pro}/reorder/types.d.ts +0 -0
- /package/{grid/toolbar → table-pro/reorder}/types.js +0 -0
- /package/{grid-pro → table-pro}/reorder/useKeyboardReorder.d.ts +0 -0
- /package/{grid-pro → table-pro}/reorder/useKeyboardReorderListener.d.ts +0 -0
- /package/{grid-pro → table-pro}/reorder/useKeyboardReorderListener.js +0 -0
- /package/{grid-pro → table-pro}/reorder/useReorderStyles.d.ts +0 -0
- /package/{grid-pro → table-pro}/reorder/useReorderStyles.js +0 -0
- /package/{grid-pro → table-pro}/resize/types.d.ts +0 -0
- /package/{grid → table-pro/resize}/types.js +0 -0
- /package/{grid-pro → table-pro}/resize/useResizeModel.js +0 -0
- /package/{grid-pro → table-pro}/util/index.d.ts +0 -0
- /package/{grid-pro → table-pro}/util/index.js +0 -0
- /package/{grid-pro → table-pro}/util/reorderRows.d.ts +0 -0
- /package/{grid-pro → table-pro}/util/reorderRows.js +0 -0
- /package/{style.css → table-pro.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColDef, ColDefBase, ColHeaderCellProps,
|
|
1
|
+
import { ColDef, ColDefBase, ColHeaderCellProps, TableProps, StyleModel } from "../table";
|
|
2
2
|
import { ReorderModel, ReorderStyleModel } from "./reorder/types";
|
|
3
3
|
export type ProColDef<ValueType = any> = ColDefBase<ValueType> & {
|
|
4
4
|
resizeable?: boolean;
|
|
@@ -7,12 +7,12 @@ export type ProColDef<ValueType = any> = ColDefBase<ValueType> & {
|
|
|
7
7
|
maxResizeWidth?: number;
|
|
8
8
|
keyboardResizeStep?: number;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type TableProProps = Omit<TableProps, "cols" | "styleModel"> & {
|
|
11
11
|
cols: ProColDef[];
|
|
12
12
|
reorder?: ReorderModel;
|
|
13
13
|
styleModel?: ProStyleModel;
|
|
14
14
|
};
|
|
15
|
-
export type ColHeaderCellProProps = ColHeaderCellProps & Pick<
|
|
15
|
+
export type ColHeaderCellProProps = ColHeaderCellProps & Pick<TableProps, "displayMode"> & {
|
|
16
16
|
setWidth?: (width: number) => void;
|
|
17
17
|
} & Pick<ProColDef, "minResizeWidth" | "maxResizeWidth" | "keyboardResizeStep">;
|
|
18
18
|
export interface WidthModel {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/table-pro.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use "./table-pro/style";
|
package/grid/InternalGrid.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
import { BaseGridProps } from "./types";
|
|
3
|
-
import { UseCombinedPipelineHook } from "./pipeline/useCombinedPipeline";
|
|
4
|
-
import { UseGridSelectionFnsHook } from "./pipeline/useGridSelectionFns";
|
|
5
|
-
import { UseUnwrappedGridStylesHook } from "./pipeline/useUnwrappedGridStyles";
|
|
6
|
-
export interface InternalGridProps {
|
|
7
|
-
gridProps: BaseGridProps;
|
|
8
|
-
hooks: {
|
|
9
|
-
selectFns: UseGridSelectionFnsHook;
|
|
10
|
-
pipelineOutput: UseCombinedPipelineHook;
|
|
11
|
-
unwrappedStyles: UseUnwrappedGridStylesHook;
|
|
12
|
-
};
|
|
13
|
-
slots: {
|
|
14
|
-
colHeaderCells: ReactNode;
|
|
15
|
-
bodyRows: ReactNode;
|
|
16
|
-
prefixHeader?: ReactNode;
|
|
17
|
-
};
|
|
18
|
-
classes?: {
|
|
19
|
-
headerRow?: string[];
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
declare const InternalGrid: FC<InternalGridProps>;
|
|
23
|
-
export default InternalGrid;
|
package/grid/InternalGrid.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState } from "react";
|
|
4
|
-
import ToggleButton from "./main/ToggleButton";
|
|
5
|
-
import FilterOptionsTable from "./filtering/FilterOptionsTable";
|
|
6
|
-
import SelectAllHeaderCell from "./selection/SelectAllHeaderCell";
|
|
7
|
-
import Pagination from "./pagination/Pagination";
|
|
8
|
-
import classNames from "classnames";
|
|
9
|
-
import useInterfaces from "./toolbar/useInterfaces";
|
|
10
|
-
import ToolbarContainer from "./toolbar/ToolbarContainer";
|
|
11
|
-
import useExportFn from "./export/useExportFn";
|
|
12
|
-
import getWidthStyle from "./util/getWidthStyle";
|
|
13
|
-
const InternalGrid = ({ gridProps: { rows, cols, pagination, filterModel, selectModel, editModel, caption, styleModel, useToolbar, responsive, displayMode, }, hooks: { pipelineOutput, selectFns, unwrappedStyles }, slots: { colHeaderCells, bodyRows, prefixHeader }, classes, }) => {
|
|
14
|
-
var _a;
|
|
15
|
-
const { normalizedTableFilterModel, filteredRows, filterState, sortedRowsOutput: { sortedRows }, currentPageRowsOutput: { paginatedRows, normalizedModel }, showSelectCol, } = pipelineOutput;
|
|
16
|
-
const [filterOptionsVisible, setFilterOptionsVisible] = useState(false);
|
|
17
|
-
const exportFnInfo = useExportFn({
|
|
18
|
-
rows,
|
|
19
|
-
cols,
|
|
20
|
-
filteredRows: filterModel && filteredRows,
|
|
21
|
-
currentPageRows: pagination && paginatedRows,
|
|
22
|
-
});
|
|
23
|
-
const toolbarInterfaceParams = useMemo(() => ({
|
|
24
|
-
filtering: useToolbar && filterState && filterModel && normalizedTableFilterModel
|
|
25
|
-
? {
|
|
26
|
-
filterState: filterState,
|
|
27
|
-
setFilterState: normalizedTableFilterModel.setTableFilterState,
|
|
28
|
-
caption: filterModel.filterTableCaption,
|
|
29
|
-
styleModel: styleModel === null || styleModel === void 0 ? void 0 : styleModel.filterInputTableStyleModel,
|
|
30
|
-
}
|
|
31
|
-
: undefined,
|
|
32
|
-
exporting: useToolbar
|
|
33
|
-
? { exportFnInfo, styleModel: styleModel === null || styleModel === void 0 ? void 0 : styleModel.exportFormStyleModel }
|
|
34
|
-
: undefined,
|
|
35
|
-
}), [
|
|
36
|
-
exportFnInfo,
|
|
37
|
-
filterModel,
|
|
38
|
-
filterState,
|
|
39
|
-
normalizedTableFilterModel,
|
|
40
|
-
styleModel === null || styleModel === void 0 ? void 0 : styleModel.exportFormStyleModel,
|
|
41
|
-
styleModel === null || styleModel === void 0 ? void 0 : styleModel.filterInputTableStyleModel,
|
|
42
|
-
useToolbar,
|
|
43
|
-
]);
|
|
44
|
-
const toolbarInterfaces = useInterfaces(toolbarInterfaceParams);
|
|
45
|
-
const handleToggleFilterOptions = () => {
|
|
46
|
-
setFilterOptionsVisible(!filterOptionsVisible);
|
|
47
|
-
};
|
|
48
|
-
const { rowsAreSelectable, selectionInfo, selectAllOnClick } = selectFns;
|
|
49
|
-
const { unwrappedTableModel, unwrappedAdditionalStyleModel } = unwrappedStyles;
|
|
50
|
-
const mainTable = (_jsxs("table", { className: classNames("table", {
|
|
51
|
-
"table-hover": rowsAreSelectable,
|
|
52
|
-
"d-block": displayMode === "block",
|
|
53
|
-
}, unwrappedTableModel.table), "aria-rowcount": filteredRows.length + 1, children: [caption !== undefined && (_jsx("caption", { className: classNames(unwrappedTableModel.caption), children: caption })), _jsx("thead", { className: classNames(unwrappedTableModel.thead), children: _jsxs("tr", { "aria-rowindex": 1, className: classNames(unwrappedTableModel.theadTr, (classes === null || classes === void 0 ? void 0 : classes.headerRow) || []), children: [prefixHeader, showSelectCol && (_jsx(SelectAllHeaderCell, { style: getWidthStyle(selectModel === null || selectModel === void 0 ? void 0 : selectModel.selectColWidth), selectionInfo: selectionInfo, onClick: selectAllOnClick, totalRows: rows.length, additionalClasses: unwrappedTableModel.rowSelectColTh, colIndexOffset: prefixHeader ? 1 : 0 })), colHeaderCells, editModel && (_jsx("th", { "aria-colindex": cols.length + 1 + (showSelectCol ? 1 : 0), className: classNames(unwrappedTableModel.editColTh), style: getWidthStyle(editModel === null || editModel === void 0 ? void 0 : editModel.editColWidth), children: "Edit Controls" }))] }) }), _jsx("tbody", { className: classNames(unwrappedTableModel.tbody), children: bodyRows })] }));
|
|
54
|
-
return (_jsxs("div", { "data-testid": "rbdg-top-level-div", className: classNames(unwrappedAdditionalStyleModel.topLevelDiv), children: [normalizedTableFilterModel && !useToolbar && (_jsxs("div", { "data-testid": "rbdg-filter-inputs-div", className: classNames(unwrappedAdditionalStyleModel.filterInputsDiv), children: [_jsx(ToggleButton, { isActive: filterOptionsVisible, label: `${filterOptionsVisible ? "Hide" : "Show "} Filter Options`, onClick: handleToggleFilterOptions, classes: (_a = styleModel === null || styleModel === void 0 ? void 0 : styleModel.additionalComponentsStyleModel) === null || _a === void 0 ? void 0 : _a.filterUiToggleButton }), filterOptionsVisible && (_jsx(FilterOptionsTable, { caption: filterModel.filterTableCaption, filterState: filterState, setFilterState: normalizedTableFilterModel.setTableFilterState, styleModel: styleModel === null || styleModel === void 0 ? void 0 : styleModel.filterInputTableStyleModel }))] })), useToolbar && (_jsx(ToolbarContainer, { interfaces: toolbarInterfaces, styleModel: styleModel === null || styleModel === void 0 ? void 0 : styleModel.toolbarStyleModel })), _jsxs("div", { "data-testid": "rbdg-table-and-pagination-div", className: classNames(unwrappedAdditionalStyleModel.tableAndPaginationDiv), children: [responsive ? (_jsx("div", { "data-testid": "rbdg-table-div", className: "table-responsive", children: mainTable })) : (_jsx(_Fragment, { children: mainTable })), normalizedModel && (_jsx(Pagination, { normalizedModel: normalizedModel, prePagingNumRows: sortedRows.length, containerDivClasses: unwrappedAdditionalStyleModel.paginationUiDiv }))] })] }));
|
|
55
|
-
};
|
|
56
|
-
export default InternalGrid;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
const stopPropagationWrapper = (fn) => (event) => {
|
|
4
|
-
event.stopPropagation();
|
|
5
|
-
fn();
|
|
6
|
-
};
|
|
7
|
-
const EditControlsCell = ({ ariaColIndex, beginEditingCallback, cancelEditingCallback, isEditing, saveCallback, deleteCallback, editControlsCellClasses, saveButtonClasses, deleteButtonClasses, startButtonClasses, cancelButtonClasses, }) => {
|
|
8
|
-
return (_jsx("td", { "aria-colindex": ariaColIndex, className: classNames(editControlsCellClasses), children: _jsx("div", { className: "hstack gap-2", children: isEditing ? (_jsxs(_Fragment, { children: [_jsx("button", { "aria-label": "Cancel", className: classNames("btn", cancelButtonClasses.length === 0
|
|
9
|
-
? ["btn-secondary"]
|
|
10
|
-
: cancelButtonClasses), onClick: stopPropagationWrapper(cancelEditingCallback), title: "Cancel", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", viewBox: "0 0 16 16", children: _jsx("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293z" }) }) }), _jsx("button", { "aria-label": "Save", className: classNames("btn", saveButtonClasses.length === 0
|
|
11
|
-
? ["btn-primary"]
|
|
12
|
-
: saveButtonClasses), onClick: stopPropagationWrapper(saveCallback), title: "Save", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", viewBox: "0 0 16 16", children: [_jsx("path", { d: "M12 2h-2v3h2z" }), _jsx("path", { d: "M1.5 0A1.5 1.5 0 0 0 0 1.5v13A1.5 1.5 0 0 0 1.5 16h13a1.5 1.5 0 0 0 1.5-1.5V2.914a1.5 1.5 0 0 0-.44-1.06L14.147.439A1.5 1.5 0 0 0 13.086 0zM4 6a1 1 0 0 1-1-1V1h10v4a1 1 0 0 1-1 1zM3 9h10a1 1 0 0 1 1 1v5H2v-5a1 1 0 0 1 1-1" })] }) })] })) : (_jsxs(_Fragment, { children: [deleteCallback && (_jsx("button", { "aria-label": "Delete", className: classNames("btn", deleteButtonClasses.length === 0
|
|
13
|
-
? ["btn-secondary"]
|
|
14
|
-
: deleteButtonClasses), onClick: stopPropagationWrapper(deleteCallback), title: "Delete", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", viewBox: "0 0 16 16", children: _jsx("path", { d: "M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5M8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5m3 .5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 1 0" }) }) })), _jsx("button", { "aria-label": "Edit", className: classNames("btn", startButtonClasses.length === 0
|
|
15
|
-
? ["btn-primary"]
|
|
16
|
-
: startButtonClasses), onClick: stopPropagationWrapper(beginEditingCallback), title: "Edit", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", viewBox: "0 0 16 16", children: [_jsx("path", { d: "M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" }), _jsx("path", { fillRule: "evenodd", d: "M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z" })] }) })] })) }) }));
|
|
17
|
-
};
|
|
18
|
-
export default EditControlsCell;
|
package/grid/editing/types.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ColDataType, ColDataTypeStrings, RowData, RowId } from "../types";
|
|
2
|
-
export interface CellData {
|
|
3
|
-
fieldName: string;
|
|
4
|
-
value: ColDataType;
|
|
5
|
-
type: ColDataTypeStrings;
|
|
6
|
-
ariaColIndex: number;
|
|
7
|
-
formattedValue: string;
|
|
8
|
-
label: string;
|
|
9
|
-
width?: number;
|
|
10
|
-
}
|
|
11
|
-
export type UpdateCallbackGenerator = (id: RowId) => (rowData: RowData) => void;
|
|
12
|
-
export interface EditModel {
|
|
13
|
-
getUpdateCallback: UpdateCallbackGenerator;
|
|
14
|
-
getDeleteCallback?: (id: RowId) => () => void;
|
|
15
|
-
editColWidth?: number;
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { EditableTableFilterState, TableFilterState } from "./types";
|
|
3
|
-
import { FilterInputTableStyleModel } from "../styling/types";
|
|
4
|
-
export interface FilterOptionsTableProps {
|
|
5
|
-
filterState: TableFilterState;
|
|
6
|
-
setFilterState: (filterState: EditableTableFilterState) => void;
|
|
7
|
-
caption?: string;
|
|
8
|
-
styleModel?: FilterInputTableStyleModel;
|
|
9
|
-
}
|
|
10
|
-
declare const FilterOptionsTable: FC<FilterOptionsTableProps>;
|
|
11
|
-
export default FilterOptionsTable;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, 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
|
-
import { unwrapFilterInputTableStyleModel } from "../styling/styleModelUnwrappers";
|
|
9
|
-
const convertFilterFormStateToEditableState = (filterFormState) => Object.keys(filterFormState).reduce((editableState, colName) => {
|
|
10
|
-
const rowFilterFormState = filterFormState[colName];
|
|
11
|
-
switch (rowFilterFormState.type) {
|
|
12
|
-
case "string": {
|
|
13
|
-
editableState[colName] = Object.assign({}, rowFilterFormState);
|
|
14
|
-
break;
|
|
15
|
-
}
|
|
16
|
-
case "number": {
|
|
17
|
-
editableState[colName] = {
|
|
18
|
-
type: rowFilterFormState.type,
|
|
19
|
-
enabled: rowFilterFormState.enabled,
|
|
20
|
-
scheme: rowFilterFormState.scheme,
|
|
21
|
-
numValue: rowFilterFormState.inputValue === ""
|
|
22
|
-
? null
|
|
23
|
-
: Number(rowFilterFormState.inputValue),
|
|
24
|
-
};
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
default: {
|
|
28
|
-
// date or datetime
|
|
29
|
-
const partialFilterState = {
|
|
30
|
-
type: rowFilterFormState.type,
|
|
31
|
-
enabled: rowFilterFormState.enabled,
|
|
32
|
-
};
|
|
33
|
-
const inputStrToDate = (str) => str === "" ? null : new Date(str);
|
|
34
|
-
switch (rowFilterFormState.scheme) {
|
|
35
|
-
case "startFrom": {
|
|
36
|
-
editableState[colName] = Object.assign(Object.assign({}, partialFilterState), { scheme: rowFilterFormState.scheme, startDate: inputStrToDate(rowFilterFormState.startDate) });
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
case "endAt": {
|
|
40
|
-
editableState[colName] = Object.assign(Object.assign({}, partialFilterState), { scheme: rowFilterFormState.scheme, endDate: inputStrToDate(rowFilterFormState.endDate) });
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
default: {
|
|
44
|
-
editableState[colName] = Object.assign(Object.assign({}, partialFilterState), { scheme: rowFilterFormState.scheme, startDate: inputStrToDate(rowFilterFormState.startDate), endDate: inputStrToDate(rowFilterFormState.endDate) });
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return editableState;
|
|
50
|
-
}, {});
|
|
51
|
-
const FilterOptionsTable = ({ filterState, setFilterState, caption, styleModel, }) => {
|
|
52
|
-
const formFilterState = useFilterFormState(filterState);
|
|
53
|
-
const [formState, setFormState] = useState(formFilterState);
|
|
54
|
-
const unwrappedStyleModel = useMemo(() => unwrapFilterInputTableStyleModel(styleModel), [styleModel]);
|
|
55
|
-
const getRows = () => Object.keys(formState).map((colName, index) => {
|
|
56
|
-
function getColStateSetter(colName) {
|
|
57
|
-
return (rowState) => setFormState(Object.assign(Object.assign({}, formState), { [colName]: rowState }));
|
|
58
|
-
}
|
|
59
|
-
const colLabel = filterState[colName].label;
|
|
60
|
-
const colFilterState = formState[colName];
|
|
61
|
-
switch (colFilterState.type) {
|
|
62
|
-
case "string": {
|
|
63
|
-
return (_jsx(StringFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: unwrappedStyleModel.schemeSelectionInput(index), enableInputClasses: unwrappedStyleModel.enablementInput(index), searchStringInputClasses: unwrappedStyleModel.searchStringInput(index), trClasses: unwrappedStyleModel.tbodyTr(index), tdClasses: (colIndex) => unwrappedStyleModel.tbodyTd(index, colIndex) }, colName));
|
|
64
|
-
}
|
|
65
|
-
case "number": {
|
|
66
|
-
return (_jsx(NumberFilterRow, { ariaRowIndex: index + 2, columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: unwrappedStyleModel.schemeSelectionInput(index), enableInputClasses: unwrappedStyleModel.enablementInput(index), numberInputClasses: unwrappedStyleModel.numberInput(index), trClasses: unwrappedStyleModel.tbodyTr(index), tdClasses: (colIndex) => unwrappedStyleModel.tbodyTd(index, colIndex) }, colName));
|
|
67
|
-
}
|
|
68
|
-
default: {
|
|
69
|
-
// date or datetime
|
|
70
|
-
return (_jsx(DateFilterRow, { ariaRowIndex: index + 2, includeTime: colFilterState.type === "datetime", columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName), schemeSelectClasses: unwrappedStyleModel.schemeSelectionInput(index), enableInputClasses: unwrappedStyleModel.enablementInput(index), startDateInputClasses: unwrappedStyleModel.startDateInput(index), endDateInputClasses: unwrappedStyleModel.endDateInput(index), trClasses: unwrappedStyleModel.tbodyTr(index), tdClasses: (colIndex) => unwrappedStyleModel.tbodyTd(index, colIndex) }, colName));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
const onSubmit = (event) => {
|
|
75
|
-
event.preventDefault();
|
|
76
|
-
const editableTableFilterState = convertFilterFormStateToEditableState(formState);
|
|
77
|
-
setFilterState(editableTableFilterState);
|
|
78
|
-
};
|
|
79
|
-
return (_jsxs("form", { onSubmit: onSubmit, className: classNames(styleModel === null || styleModel === void 0 ? void 0 : styleModel.form), children: [_jsxs("table", { className: classNames("table", ...unwrappedStyleModel.table), children: [caption && (_jsx("caption", { className: classNames(unwrappedStyleModel.caption), children: caption })), _jsx("thead", { className: classNames(...unwrappedStyleModel.thead), children: _jsx("tr", { className: classNames(...unwrappedStyleModel.theadTr), children: ["Enabled", "Column", "Type", "Operator", "Value"].map((colName, index) => (_jsx("th", { className: classNames(...unwrappedStyleModel.theadTh(index)), children: colName }, index))) }) }), _jsx("tbody", { className: classNames(...unwrappedStyleModel.tbody), children: getRows() })] }), _jsx("button", { className: classNames("btn", { "btn-secondary": unwrappedStyleModel.submitButton.length === 0 }, unwrappedStyleModel.submitButton), type: "submit", children: "Submit" })] }));
|
|
80
|
-
};
|
|
81
|
-
export default FilterOptionsTable;
|
package/grid/main/BodyRows.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AugFormattedRow, RowId } from "../types";
|
|
2
|
-
import { FC, ReactNode } from "react";
|
|
3
|
-
import { UseGridSelectionFnsHook } from "../pipeline/useGridSelectionFns";
|
|
4
|
-
import { UseUnwrappedGridStylesHook } from "../pipeline/useUnwrappedGridStyles";
|
|
5
|
-
import { UseCombinedPipelineHook } from "../pipeline/useCombinedPipeline";
|
|
6
|
-
import { SelectModel } from "../selection/types";
|
|
7
|
-
import { EditModel } from "../editing/types";
|
|
8
|
-
import { UseGetInputStrSubmitCallbackHook } from "../pipeline/useGetInputStrSubmitCallback";
|
|
9
|
-
interface BodyRowsProps {
|
|
10
|
-
augFormattedRows: AugFormattedRow[];
|
|
11
|
-
gridSelectionFns: UseGridSelectionFnsHook;
|
|
12
|
-
unwrappedStyles: UseUnwrappedGridStylesHook;
|
|
13
|
-
combinedPipelineOutput: UseCombinedPipelineHook;
|
|
14
|
-
selectModel: SelectModel | undefined;
|
|
15
|
-
editModel: EditModel | undefined;
|
|
16
|
-
getInputStrSubmitCallback: UseGetInputStrSubmitCallbackHook;
|
|
17
|
-
additionalColIndexOffset?: number;
|
|
18
|
-
renderPrefixCells?: (augFormattedRows: AugFormattedRow) => ReactNode;
|
|
19
|
-
additionalRowStyles?: (rowId: RowId, displayIndex: number) => string[];
|
|
20
|
-
}
|
|
21
|
-
declare const BodyRows: FC<BodyRowsProps>;
|
|
22
|
-
export default BodyRows;
|
package/grid/main/BodyRows.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import EditableRow from "../editing/EditableRow";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import getWidthStyle from "../util/getWidthStyle";
|
|
5
|
-
import SelectionInput from "../selection/SelectionInput";
|
|
6
|
-
const BodyRows = ({ augFormattedRows, gridSelectionFns: { selectedSet, getSelectInputModel, getSelectHandler, getRowClickHandler, getAriaSelectedValue, }, unwrappedStyles: { unwrappedTableModel }, combinedPipelineOutput: { showSelectCol, ariaColIndexOffset }, selectModel, editModel, getInputStrSubmitCallback, additionalColIndexOffset, renderPrefixCells, additionalRowStyles, }) => augFormattedRows.map((row, index) => {
|
|
7
|
-
return (_jsxs(EditableRow, { onClick: getRowClickHandler(row.id), className: classNames({
|
|
8
|
-
"table-active": selectedSet.has(row.id),
|
|
9
|
-
}, unwrappedTableModel.tbodyTr(row.id, index), additionalRowStyles ? additionalRowStyles(row.id, index) : []), "aria-rowindex": row.prePaginationIndex + 2, dataRowId: row.id, "aria-selected": getAriaSelectedValue(row.id), ariaColIndexOffset: ariaColIndexOffset + (additionalColIndexOffset || 0), cellData: row.contents, updateCallback: getInputStrSubmitCallback && getInputStrSubmitCallback(row.id), deleteCallback: (editModel === null || editModel === void 0 ? void 0 : editModel.getDeleteCallback) && editModel.getDeleteCallback(row.id), dataCellClasses: (colIndex) => unwrappedTableModel.tbodyTd(row.id, index, colIndex), dataCellInputClasses: (colIndex) => unwrappedTableModel.tbodyTdInput(row.id, index, colIndex), editCellClasses: unwrappedTableModel.editColTd(row.id, index), saveButtonClasses: unwrappedTableModel.editSaveButton(row.id, index), deleteButtonClasses: unwrappedTableModel.editDeleteButton(row.id, index), startButtonClasses: unwrappedTableModel.editStartButton(row.id, index), cancelButtonClasses: unwrappedTableModel.editCancelButton(row.id, index), children: [renderPrefixCells && renderPrefixCells(row), showSelectCol && (_jsx("td", { className: classNames(unwrappedTableModel.rowSelectColTd(row.id, index)), "aria-colindex": 1 + (additionalColIndexOffset || 0), style: getWidthStyle(selectModel.selectColWidth), children: _jsx(SelectionInput, { index: index, selected: selectedSet.has(row.id), selectionInputModel: getSelectInputModel(row.id, selectModel), selectCallback: getSelectHandler(row.id), additionalClasses: unwrappedTableModel.rowSelectInput(row.id, index) }) }))] }, row.id));
|
|
10
|
-
});
|
|
11
|
-
export default BodyRows;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
const ToggleButton = ({ isActive, label, onClick, classes, }) => {
|
|
5
|
-
const baseClasses = ["btn"];
|
|
6
|
-
const variableClasses = {
|
|
7
|
-
active: isActive,
|
|
8
|
-
};
|
|
9
|
-
return (_jsx("button", { type: "button", className: classNames(baseClasses, variableClasses, classes, {
|
|
10
|
-
"btn-primary": !(classes && classes.length > 0),
|
|
11
|
-
}), "aria-pressed": isActive, onClick: onClick, children: label }));
|
|
12
|
-
};
|
|
13
|
-
export default ToggleButton;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ColDef } from "../../types";
|
|
2
|
-
import { EditableTableFilterState, TableFilterState } from "../../filtering/types";
|
|
3
|
-
declare const useFilterStateFromEditable: (colDefs: ColDef[], editableFilterState: EditableTableFilterState | null) => TableFilterState | null;
|
|
4
|
-
export default useFilterStateFromEditable;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AdditionalComponentsStyleModel, StyleModel, TableStyleModel } from "../styling/types";
|
|
2
|
-
export interface UseUnwrappedGridStylesHook {
|
|
3
|
-
unwrappedTableModel: Required<TableStyleModel>;
|
|
4
|
-
unwrappedAdditionalStyleModel: Required<AdditionalComponentsStyleModel>;
|
|
5
|
-
}
|
|
6
|
-
declare const UseUnwrappedGridStyles: (styleModel: StyleModel | undefined) => UseUnwrappedGridStylesHook;
|
|
7
|
-
export default UseUnwrappedGridStyles;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { unwrapAdditionalComponentsStyleModel, unwrapTableStyleModel, } from "../styling/styleModelUnwrappers";
|
|
3
|
-
const UseUnwrappedGridStyles = (styleModel) => {
|
|
4
|
-
// To give the developer the ability to specify between removing existing styles
|
|
5
|
-
// and simply adding additional ones, we should migrate off of this "unwrapped"
|
|
6
|
-
// design over time and instead apply logic based on the original params that
|
|
7
|
-
// can be undefined.
|
|
8
|
-
const unwrappedTableModel = useMemo(() => unwrapTableStyleModel(styleModel === null || styleModel === void 0 ? void 0 : styleModel.mainTableStyleModel), [styleModel === null || styleModel === void 0 ? void 0 : styleModel.mainTableStyleModel]);
|
|
9
|
-
const unwrappedAdditionalStyleModel = useMemo(() => unwrapAdditionalComponentsStyleModel(styleModel === null || styleModel === void 0 ? void 0 : styleModel.additionalComponentsStyleModel), [styleModel === null || styleModel === void 0 ? void 0 : styleModel.additionalComponentsStyleModel]);
|
|
10
|
-
return {
|
|
11
|
-
unwrappedTableModel,
|
|
12
|
-
unwrappedAdditionalStyleModel,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default UseUnwrappedGridStyles;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AdditionalComponentsStyleModel, FilterInputTableStyleModel, TableStyleModel } from "./types";
|
|
2
|
-
export declare const unwrapTableStyleModel: (tableStyleModel: TableStyleModel | undefined) => Required<TableStyleModel>;
|
|
3
|
-
export declare const unwrapFilterInputTableStyleModel: (filterTableStyleModel: FilterInputTableStyleModel | undefined) => Required<FilterInputTableStyleModel>;
|
|
4
|
-
export declare const unwrapAdditionalComponentsStyleModel: (styleModel: AdditionalComponentsStyleModel | undefined) => Required<AdditionalComponentsStyleModel>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const unwrapSharedStyleModel = (sharedStyleModel) => ({
|
|
2
|
-
table: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.table) || [],
|
|
3
|
-
tbody: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.tbody) || [],
|
|
4
|
-
thead: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.thead) || [],
|
|
5
|
-
theadTr: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.theadTr) || [],
|
|
6
|
-
theadTh: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.theadTh) ? sharedStyleModel.theadTh : () => [],
|
|
7
|
-
caption: (sharedStyleModel === null || sharedStyleModel === void 0 ? void 0 : sharedStyleModel.caption) || [],
|
|
8
|
-
});
|
|
9
|
-
export const unwrapTableStyleModel = (tableStyleModel) => (Object.assign(Object.assign({}, unwrapSharedStyleModel(tableStyleModel)), { tbodyTr: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.tbodyTr) ? tableStyleModel.tbodyTr : () => [], tbodyTd: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.tbodyTd) ? tableStyleModel.tbodyTd : () => [], tbodyTdInput: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.tbodyTdInput)
|
|
10
|
-
? tableStyleModel.tbodyTdInput
|
|
11
|
-
: () => [], editColTh: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editColTh) || [], editColTd: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editColTd) ? tableStyleModel.editColTd : () => [], editCancelButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editCancelButton)
|
|
12
|
-
? tableStyleModel.editCancelButton
|
|
13
|
-
: () => [], editDeleteButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editDeleteButton)
|
|
14
|
-
? tableStyleModel.editDeleteButton
|
|
15
|
-
: () => [], editSaveButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editSaveButton)
|
|
16
|
-
? tableStyleModel.editSaveButton
|
|
17
|
-
: () => [], editStartButton: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.editStartButton)
|
|
18
|
-
? tableStyleModel.editStartButton
|
|
19
|
-
: () => [], rowSelectColTh: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.rowSelectColTh) || [], rowSelectColTd: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.rowSelectColTd)
|
|
20
|
-
? tableStyleModel.rowSelectColTd
|
|
21
|
-
: () => [], rowSelectInput: (tableStyleModel === null || tableStyleModel === void 0 ? void 0 : tableStyleModel.rowSelectInput)
|
|
22
|
-
? tableStyleModel.rowSelectInput
|
|
23
|
-
: () => [] }));
|
|
24
|
-
export const unwrapFilterInputTableStyleModel = (filterTableStyleModel) => (Object.assign(Object.assign({}, unwrapSharedStyleModel(filterTableStyleModel)), { tbodyTr: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.tbodyTr)
|
|
25
|
-
? filterTableStyleModel.tbodyTr
|
|
26
|
-
: () => [], tbodyTd: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.tbodyTd)
|
|
27
|
-
? filterTableStyleModel.tbodyTd
|
|
28
|
-
: () => [], enablementInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.enablementInput)
|
|
29
|
-
? filterTableStyleModel.enablementInput
|
|
30
|
-
: () => [], schemeSelectionInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.schemeSelectionInput)
|
|
31
|
-
? filterTableStyleModel.schemeSelectionInput
|
|
32
|
-
: () => [], searchStringInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.searchStringInput)
|
|
33
|
-
? filterTableStyleModel.searchStringInput
|
|
34
|
-
: () => [], numberInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.numberInput)
|
|
35
|
-
? filterTableStyleModel.numberInput
|
|
36
|
-
: () => [], startDateInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.startDateInput)
|
|
37
|
-
? filterTableStyleModel.startDateInput
|
|
38
|
-
: () => [], endDateInput: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.endDateInput)
|
|
39
|
-
? filterTableStyleModel.endDateInput
|
|
40
|
-
: () => [], submitButton: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.submitButton) || [], form: (filterTableStyleModel === null || filterTableStyleModel === void 0 ? void 0 : filterTableStyleModel.form) || [] }));
|
|
41
|
-
export const unwrapAdditionalComponentsStyleModel = (styleModel) => ({
|
|
42
|
-
topLevelDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.topLevelDiv) || [],
|
|
43
|
-
filterInputsDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.filterInputsDiv) || [],
|
|
44
|
-
tableAndPaginationDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.tableAndPaginationDiv) || [],
|
|
45
|
-
filterUiToggleButton: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.filterUiToggleButton) || [],
|
|
46
|
-
paginationUiDiv: (styleModel === null || styleModel === void 0 ? void 0 : styleModel.paginationUiDiv) || [],
|
|
47
|
-
});
|
package/grid/styling/types.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { RowId } from "../types";
|
|
2
|
-
export interface SharedTableStyleModel {
|
|
3
|
-
table?: string[];
|
|
4
|
-
tbody?: string[];
|
|
5
|
-
thead?: string[];
|
|
6
|
-
theadTr?: string[];
|
|
7
|
-
theadTh?: (colIndex: number) => string[];
|
|
8
|
-
caption?: string[];
|
|
9
|
-
}
|
|
10
|
-
export type TableStyleModel = SharedTableStyleModel & {
|
|
11
|
-
tbodyTr?: (rowId: RowId, displayIndex: number) => string[];
|
|
12
|
-
tbodyTd?: (rowId: RowId, displayRowIndex: number, colIndex: number) => string[];
|
|
13
|
-
tbodyTdInput?: (rowId: RowId, displayRowIndex: number, colIndex: number) => string[];
|
|
14
|
-
editColTh?: string[];
|
|
15
|
-
editColTd?: (rowId: RowId, displayIndex: number) => string[];
|
|
16
|
-
editStartButton?: (rowId: RowId, displayIndex: number) => string[];
|
|
17
|
-
editDeleteButton?: (rowId: RowId, displayIndex: number) => string[];
|
|
18
|
-
editSaveButton?: (rowId: RowId, displayIndex: number) => string[];
|
|
19
|
-
editCancelButton?: (rowId: RowId, displayIndex: number) => string[];
|
|
20
|
-
rowSelectColTh?: string[];
|
|
21
|
-
rowSelectColTd?: (rowId: RowId, displayIndex: number) => string[];
|
|
22
|
-
rowSelectInput?: (rowId: RowId, displayIndex: number) => string[];
|
|
23
|
-
};
|
|
24
|
-
export type FilterInputTableStyleModel = SharedTableStyleModel & {
|
|
25
|
-
tbodyTr?: (rowIndex: number) => string[];
|
|
26
|
-
tbodyTd?: (rowIndex: number, colIndex: number) => string[];
|
|
27
|
-
enablementInput?: (rowIndex: number) => string[];
|
|
28
|
-
schemeSelectionInput?: (rowIndex: number) => string[];
|
|
29
|
-
searchStringInput?: (rowIndex: number) => string[];
|
|
30
|
-
numberInput?: (rowIndex: number) => string[];
|
|
31
|
-
startDateInput?: (rowIndex: number) => string[];
|
|
32
|
-
endDateInput?: (rowIndex: number) => string[];
|
|
33
|
-
submitButton?: string[];
|
|
34
|
-
form?: string[];
|
|
35
|
-
};
|
|
36
|
-
export interface AdditionalComponentsStyleModel {
|
|
37
|
-
topLevelDiv?: string[];
|
|
38
|
-
filterInputsDiv?: string[];
|
|
39
|
-
tableAndPaginationDiv?: string[];
|
|
40
|
-
filterUiToggleButton?: string[];
|
|
41
|
-
paginationUiDiv?: string[];
|
|
42
|
-
}
|
|
43
|
-
export interface ToolbarStyleModel {
|
|
44
|
-
activeButton?: string[];
|
|
45
|
-
inactiveButton?: string[];
|
|
46
|
-
toolbar?: string[];
|
|
47
|
-
interfaceContainer?: string[];
|
|
48
|
-
}
|
|
49
|
-
export interface ExportFormStyleModel {
|
|
50
|
-
legend?: string[];
|
|
51
|
-
radioContainer?: string[];
|
|
52
|
-
radioInput?: string[];
|
|
53
|
-
radioLabel?: string[];
|
|
54
|
-
submitButton?: string[];
|
|
55
|
-
}
|
|
56
|
-
export interface StyleModel {
|
|
57
|
-
mainTableStyleModel?: TableStyleModel;
|
|
58
|
-
filterInputTableStyleModel?: FilterInputTableStyleModel;
|
|
59
|
-
additionalComponentsStyleModel?: AdditionalComponentsStyleModel;
|
|
60
|
-
toolbarStyleModel?: ToolbarStyleModel;
|
|
61
|
-
exportFormStyleModel?: ExportFormStyleModel;
|
|
62
|
-
}
|
package/grid/toolbar/types.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FilterOptionsTableProps } from "../filtering/FilterOptionsTable";
|
|
2
|
-
import { ToolbarInterfaces } from "./types";
|
|
3
|
-
import { ExportFormProps } from "../export/ExportForm";
|
|
4
|
-
export interface InterfaceParams {
|
|
5
|
-
filtering?: FilterOptionsTableProps;
|
|
6
|
-
exporting?: ExportFormProps;
|
|
7
|
-
}
|
|
8
|
-
declare const useInterfaces: (params: InterfaceParams) => ToolbarInterfaces;
|
|
9
|
-
export default useInterfaces;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import FilterOptionsTable from "../filtering/FilterOptionsTable";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import ExportForm from "../export/ExportForm";
|
|
5
|
-
const useInterfaces = ({ filtering, exporting, }) => {
|
|
6
|
-
return useMemo(() => ({
|
|
7
|
-
filtering: filtering ? _jsx(FilterOptionsTable, Object.assign({}, filtering)) : undefined,
|
|
8
|
-
exporting: exporting ? _jsx(ExportForm, Object.assign({}, exporting)) : undefined,
|
|
9
|
-
}), [exporting, filtering]);
|
|
10
|
-
};
|
|
11
|
-
export default useInterfaces;
|
package/grid-pro/GridPro.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|