ods-component-lib 1.18.128 → 1.18.133

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.
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { IVirtualDataGridProps } from "./types";
3
+ /**
4
+ * OdsInlineEditDataGrid component.
5
+ * @param {IVirtualDataGridProps} props - The component props.
6
+ * @returns {React.FC} - The rendered component.
7
+ */
8
+ declare const OdsInlineEditDataGrid: React.FC<IVirtualDataGridProps>;
9
+ export default OdsInlineEditDataGrid;
10
+ export type { IVirtualDataGridProps };
@@ -0,0 +1,14 @@
1
+ import { ContentReadyEvent } from "devextreme/ui/data_grid";
2
+ import { IColumnConfig } from "../types";
3
+ /**
4
+ * Custom hook to handle content ready events for the data grid.
5
+ * @param {React.MutableRefObject<any>} lastPageIndexRef - Reference to the last page index.
6
+ * @param {boolean} contentReady - Boolean indicating if the content is ready.
7
+ * @param {Function} setRowCount - Function to set the row count state
8
+ * @param {Function} setContentReady - Function to set the content ready state.
9
+ * @param {Function} setCurrentPage - Function to set the current page state.
10
+ * @param {Function} setCurrentPageSize - Function to set the current page size state.
11
+ * @param {Function} [callback] - Optional callback function.
12
+ * @returns {(e: ContentReadyEvent<any, any>) => void} handleContentReady - Handler for content ready event.
13
+ */
14
+ export declare const useContentHandlers: (lastPageIndexRef: React.MutableRefObject<any>, contentReady: boolean, columns: IColumnConfig[], setRowCount: Function, setContentReady: Function, setCurrentPage: Function, setCurrentPageSize: Function, setHeaderFilterData: Function, callback?: Function) => (e: ContentReadyEvent<any, any>) => void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Custom hook that returns a callback function to handle the "editorPrepared" event of a DevExtreme component.
3
+ * This callback function is responsible for customizing the editor's behavior based on specific conditions.
4
+ *
5
+ * @returns {Function} The callback function to handle the "editorPrepared" event.
6
+ */
7
+ export declare const useEditorPreparedHandlers: () => (e: any) => void;
@@ -0,0 +1,19 @@
1
+ interface IOnExportingProps {
2
+ gridComponent: any;
3
+ baseFileName?: string;
4
+ selectedText?: string;
5
+ getSummary: () => string;
6
+ selectedRowsOnly: boolean;
7
+ }
8
+ /**
9
+ * Handles the exporting of data from the grid component.
10
+ *
11
+ * @param {IOnExportingProps} params - The parameters for exporting the data.
12
+ * @param {React.RefObject<Grid>} params.gridComponent - The reference to the grid component.
13
+ * @param {string} params.baseFileName - The base file name for the exported file.
14
+ * @param {string} params.selectedText - The text to be displayed for selected rows.
15
+ * @param {Function} params.getSummary - The function to get the summary of the exported data.
16
+ * @param {boolean} params.selectedRowsOnly - Indicates whether to export only selected rows.
17
+ */
18
+ export declare const onExporting: ({ gridComponent, baseFileName, selectedText, getSummary, selectedRowsOnly, }: IOnExportingProps) => void;
19
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Custom hook to handle option change events for the data grid.
3
+ * @param {Object} dataGridRef - The dataGridRef property passed to the hook.
4
+ * @param {Function} setFilterApplied - Function to set the filter applied state.
5
+ * @returns {Function} - Handler function for option changed event.
6
+ */
7
+ export declare const useOptionHandlers: (dataGridRef: any, setFilterApplied: any) => (e: any) => void;
@@ -0,0 +1,21 @@
1
+ import type { ISummaryRowOptions } from "../types";
2
+ interface IUseSummaryHandlersProps {
3
+ customSummary?: ISummaryRowOptions;
4
+ totalRecordCount: number;
5
+ currentPageSize: number;
6
+ currentPage: number;
7
+ filterApplied: boolean;
8
+ rowCount: number;
9
+ filteredRowCount: number;
10
+ isServerSide?: boolean;
11
+ }
12
+ /**
13
+ * Custom hook that provides summary handlers for a data grid.
14
+ *
15
+ * @param {IUseSummaryHandlersProps} props - The props object containing necessary parameters.
16
+ * @returns {Object} - An object containing the renderTotal function.
17
+ */
18
+ export declare const useSummaryHandlers: ({ customSummary, totalRecordCount, currentPageSize, currentPage, filterApplied, rowCount, filteredRowCount, }: IUseSummaryHandlersProps) => {
19
+ renderTotal: () => string | null;
20
+ };
21
+ export {};
@@ -0,0 +1,15 @@
1
+ import { FC } from "react";
2
+ import { IVirtualDataGridProps } from "../types";
3
+ interface ActionCellRenderProps {
4
+ cellData: any;
5
+ actionButtons: IVirtualDataGridProps["actionButtonGroup"];
6
+ edit?: IVirtualDataGridProps["edit"];
7
+ actionButtonGroup?: IVirtualDataGridProps["actionButtonGroup"];
8
+ }
9
+ /**
10
+ * Renders the action buttons for a cell in the OdsInlineEditDataGrid component.
11
+ * @param {ActionCellRenderProps} props - The props for the ActionCellRender component.
12
+ * @returns {ReactNode} - The rendered action buttons.
13
+ */
14
+ declare const ActionCellRender: FC<ActionCellRenderProps>;
15
+ export default ActionCellRender;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { IEditingOptions } from "../types";
3
+ /**
4
+ * Component that handles editing functionalities within the data grid.
5
+ * @param {IEditingOptions} props - The properties passed to the component.
6
+ * @returns {JSX.Element} - The JSX element representing the editing handlers.
7
+ */
8
+ declare const EditingPartial: React.FC<IEditingOptions>;
9
+ export default EditingPartial;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { IToolbarButton } from "../types";
3
+ interface PageTitleAndToolbarProps {
4
+ pageTitle?: string;
5
+ toolbarButtonGroup?: IToolbarButton[];
6
+ }
7
+ declare const MemoizedPageTitleAndToolbar: React.NamedExoticComponent<PageTitleAndToolbarProps>;
8
+ export default MemoizedPageTitleAndToolbar;
@@ -0,0 +1,9 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ grid: import("antd-style").SerializedStyles;
3
+ gridCustomSummary: import("antd-style").SerializedStyles;
4
+ }>;
5
+ export declare const usePageTitleAndToolbarStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
6
+ gridPageTitleWrapper: import("antd-style").SerializedStyles;
7
+ gridToolbarButtonGroupWrapper: import("antd-style").SerializedStyles;
8
+ gridToolbarButton: import("antd-style").SerializedStyles;
9
+ }>;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Represents the types for the OdsInlineEditDataGrid component.
3
+ * @module OdsInlineEditDataGrid/types
4
+ */
5
+ /// <reference types="react" />
6
+ import { ButtonType } from "antd/es/button";
7
+ import { IButtonProps, IDataGridOptions, IEditingProps, ISummaryProps } from "devextreme-react/data-grid";
8
+ /**
9
+ * Represents the configuration for a column in the data grid.
10
+ */
11
+ export interface IColumnConfig {
12
+ dataField: string;
13
+ caption: string;
14
+ allowSorting?: boolean;
15
+ allowSearch?: boolean;
16
+ cellRender?: (data: any) => JSX.Element | string;
17
+ calculateFilterExpression?: (value: any, operation: string, target: string) => any;
18
+ format?: string | object;
19
+ }
20
+ /**
21
+ * Represents the props for the pager component.
22
+ */
23
+ interface IPagerProps {
24
+ visible?: boolean;
25
+ showPageSizeSelector?: boolean;
26
+ showInfo?: boolean;
27
+ displayMode?: "full" | "compact";
28
+ infoText?: string;
29
+ }
30
+ /**
31
+ * Represents the props for the export functionality.
32
+ */
33
+ interface IExportProps {
34
+ enabled: boolean;
35
+ allowExportSelectedData?: boolean;
36
+ fileName?: string;
37
+ selectedText?: string;
38
+ }
39
+ /**
40
+ * Represents the configuration for a toolbar button.
41
+ */
42
+ export interface IToolbarButton {
43
+ type: string;
44
+ label: string;
45
+ onClick: () => void;
46
+ disabled?: boolean;
47
+ }
48
+ /**
49
+ * Represents the options for editing data in the data grid.
50
+ */
51
+ export interface IEditingOptions extends Omit<IEditingProps, "mode"> {
52
+ mode?: "row" | "cell" | "batch";
53
+ formItems?: any[];
54
+ title?: string;
55
+ }
56
+ /**
57
+ * Represents the configuration for a button group.
58
+ */
59
+ export interface IButtonGroup extends Omit<IButtonProps, "name"> {
60
+ name?: "cancel" | "delete" | "edit" | "save" | "undelete" | "unmap";
61
+ type?: ButtonType;
62
+ label?: string;
63
+ onclick?: React.MouseEventHandler<HTMLElement>;
64
+ actionPermission?: boolean;
65
+ icon: any;
66
+ }
67
+ /**
68
+ * Represents the options for summary rows in the data grid.
69
+ */
70
+ export interface ISummaryRowOptions {
71
+ summaryLoadedDataLabel?: string;
72
+ summaryTotalDataLabel?: string;
73
+ summaryFilteredDataLabel?: string;
74
+ summaryItems?: ISummaryProps[];
75
+ summaryTotalCount?: number;
76
+ summaryTotalPageCountLabel?: string;
77
+ showSumInSummary?: boolean;
78
+ showAvgInSummary?: boolean;
79
+ showCountInSummary?: boolean;
80
+ showMaxInSummary?: boolean;
81
+ showMinInSummary?: boolean;
82
+ summarySumLabel?: string;
83
+ summaryAvgLabel?: string;
84
+ summaryMinLabel?: string;
85
+ summaryMaxLabel?: string;
86
+ summaryCountLabel?: string;
87
+ }
88
+ /**
89
+ * Represents the props for a virtual data grid component.
90
+ */
91
+ export interface IVirtualDataGridProps extends IDataGridOptions {
92
+ columns: IColumnConfig[];
93
+ sortingProps?: any;
94
+ pagerProps?: IPagerProps;
95
+ exportProps?: IExportProps;
96
+ customSummary?: ISummaryRowOptions;
97
+ actionButtonGroup?: IButtonGroup[];
98
+ actionColumnEnable?: boolean;
99
+ pageTitle?: string;
100
+ language?: string;
101
+ isFilterPanel?: boolean;
102
+ isFilterRow?: boolean;
103
+ pageSize?: number;
104
+ toolbarButtonGroup?: IToolbarButton[];
105
+ edit?: IEditingOptions;
106
+ columnChooserPositionDisabled?: boolean;
107
+ dataGridPageName?: string;
108
+ totalRecordCount: number;
109
+ columnResizingMode?: "nextColumn" | "widget";
110
+ dataGridRef: any;
111
+ isServerSide?: boolean;
112
+ }
113
+ export {};
@@ -0,0 +1,19 @@
1
+ interface IConcatFilteredLabelProps {
2
+ result: string;
3
+ totalLoaded: number;
4
+ filteredRowCount: number;
5
+ filterApplied: boolean;
6
+ summaryFilteredDataLabel: string;
7
+ }
8
+ /**
9
+ * Concatenates the filtered label with the result string.
10
+ *
11
+ * @param {IConcatFilteredLabelProps} props - The object containing the necessary properties.
12
+ * @returns {string} - The concatenated result string.
13
+ */
14
+ export declare const concatFilteredLabel: ({ result, totalLoaded, filteredRowCount, filterApplied, summaryFilteredDataLabel, }: IConcatFilteredLabelProps) => string;
15
+ export {};
16
+ /**
17
+ * This file contains utility functions related to the OdsInlineEditDataGrid component.
18
+ * These utility functions are used for handling filtering and data manipulation.
19
+ */
package/dist/index.d.ts CHANGED
@@ -53,6 +53,7 @@ import OdsFileUpload from "./components/antd/fileUpload/OdsFileUpload";
53
53
  import OdsBasicDataGrid from "./components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid";
54
54
  import OdsTransfer from "./components/devextreme/OdsTransfer";
55
55
  import OdsServerSideDatagrid from "./components/devextreme/OdsServerSideDatagrid/OdsServerSideDatagrid";
56
+ import OdsInlineEditDataGrid from "./components/devextreme/OdsInlineEditDataGrid/OdsInlineEditDataGrid";
56
57
  export { OdsButton };
57
58
  export { OdsInput };
58
59
  export { OdsDropdownButton };
@@ -109,3 +110,4 @@ export { OdsRemoteDataGrid } from "./components/devextreme/index";
109
110
  export { OdsBasicDataGrid };
110
111
  export { OdsTransfer };
111
112
  export { OdsServerSideDatagrid };
113
+ export { OdsInlineEditDataGrid };