ods-component-lib 1.18.270 → 1.18.271

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/App.d.ts +3 -0
  2. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/ContentHandlers.d.ts +14 -0
  3. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/EditorPreparedHandlers.d.ts +7 -0
  4. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/OnExportingHandlers.d.ts +19 -0
  5. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/OptionHandlers.d.ts +7 -0
  6. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/SummaryHandlers.d.ts +21 -0
  7. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/ActionCellRender.d.ts +15 -0
  8. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/EditingPartial.d.ts +9 -0
  9. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/PageTitle.d.ts +8 -0
  10. package/dist/components/devextreme/OdsInlineEditDataGrid/utils.d.ts +19 -0
  11. package/dist/index.js +14 -10
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.js +14 -10
  14. package/dist/index.modern.js.map +1 -1
  15. package/dist/index.umd.js +2 -0
  16. package/dist/index.umd.js.map +1 -0
  17. package/package.json +1 -1
  18. package/dist/stories/OdsBasicDataGrid/OdsBasicDataGrid.stories.d.ts +0 -110
  19. package/dist/stories/OdsBasicDataGrid/Samples/MergeCells/MergeCells.Constants.d.ts +0 -14
  20. package/dist/stories/OdsBasicDataGrid/Samples/MergeCells/MergeCells.MockData.d.ts +0 -7
  21. package/dist/stories/OdsBasicDataGrid/Samples/MergeCells/MergeCells.Sample.d.ts +0 -1
  22. package/dist/stories/OdsPivotGrid/OdsPivotGrid.stories.d.ts +0 -15
  23. package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Constants.d.ts +0 -2
  24. package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.MockData.d.ts +0 -7
  25. package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Sample.d.ts +0 -1
  26. package/dist/stories/OdsRemoteDataGrid/Samples/MergeCells/MergeCells.Constants.d.ts +0 -5
  27. package/dist/stories/OdsRemoteDataGrid/Samples/MergeCells/MergeCells.MockData.d.ts +0 -6
  28. package/dist/stories/OdsRemoteDataGrid/Samples/MergeCells/MergeCells.Sample.d.ts +0 -1
package/dist/App.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const App: React.FC;
3
+ export default App;
@@ -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,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.js CHANGED
@@ -36156,13 +36156,15 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36156
36156
  _props$isSaveButton = props.isSaveButton,
36157
36157
  isSaveButton = _props$isSaveButton === void 0 ? true : _props$isSaveButton,
36158
36158
  _props$isRevertButton = props.isRevertButton,
36159
- isRevertButton = _props$isRevertButton === void 0 ? true : _props$isRevertButton;
36159
+ isRevertButton = _props$isRevertButton === void 0 ? true : _props$isRevertButton,
36160
+ onEditorPreparing = props.onEditorPreparing,
36161
+ onEditorPrepared = props.onEditorPrepared;
36160
36162
  var _useToken = useToken$2(),
36161
36163
  token = _useToken.token;
36162
36164
  var filterApplied = React.useRef(false);
36163
36165
  var _useState = React.useState(false),
36164
- render = _useState[0],
36165
- rerender = _useState[1];
36166
+ renderTrigger = _useState[0],
36167
+ setRenderTrigger = _useState[1];
36166
36168
  var _useState2 = React.useState(props.columns),
36167
36169
  gridColumns = _useState2[0],
36168
36170
  setGridColumns = _useState2[1];
@@ -36210,7 +36212,7 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36210
36212
  }
36211
36213
  }, [props.columns]);
36212
36214
  React.useEffect(function () {
36213
- rerender(!render);
36215
+ setRenderTrigger(!renderTrigger);
36214
36216
  }, [gridColumns]);
36215
36217
  React.useEffect(function () {
36216
36218
  if (Array.isArray(props.dataSource)) {
@@ -36271,7 +36273,7 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36271
36273
  return [];
36272
36274
  }
36273
36275
  }, [props.actionButtonGroup]);
36274
- var onEditorPreparing = React.useCallback(function (e) {
36276
+ var handleOnEditorPreparing = function handleOnEditorPreparing(e) {
36275
36277
  if (e.row !== undefined && e.parentType === "dataRow") {
36276
36278
  if (props.handleEditorPreparing) {
36277
36279
  props.handleEditorPreparing(e);
@@ -36282,7 +36284,8 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36282
36284
  if (args.event && args.event.type === "cancel") e.cellElement.dispatchEvent(onCancelEditEvent$1);
36283
36285
  };
36284
36286
  }
36285
- }, [props.isServerSide]);
36287
+ onEditorPreparing === null || onEditorPreparing === void 0 ? void 0 : onEditorPreparing(e);
36288
+ };
36286
36289
  var customLoad = React.useCallback(function () {
36287
36290
  var state = JSON.parse(localStorage.getItem(props.exportFileName + "Storage"));
36288
36291
  if (localStorage.getItem(props.exportFileName + "Storage")) {
@@ -36309,7 +36312,7 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36309
36312
  }
36310
36313
  localStorage.setItem(props.exportFileName + "Storage", JSON.stringify(state));
36311
36314
  }, [props.filterEnabledShow]);
36312
- var onEditorPrepared = React.useCallback(function (info) {
36315
+ var handleOnEditorPrepared = function handleOnEditorPrepared(info) {
36313
36316
  if (info.parentType === "filterRow" && info.editorName === "dxSelectBox" && (info.dataField === "IsActive" || info.dataField === "isActive")) {
36314
36317
  if (info.dataSource != null && info.dataSource.length > 0) {
36315
36318
  info.showAllText = info.dataSource.find(function (i) {
@@ -36323,7 +36326,8 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36323
36326
  }).label;
36324
36327
  }
36325
36328
  }
36326
- }, []);
36329
+ onEditorPrepared === null || onEditorPrepared === void 0 ? void 0 : onEditorPrepared(info);
36330
+ };
36327
36331
  var renderTotal = React.useCallback(function () {
36328
36332
  var _props$customSummary;
36329
36333
  var result = "";
@@ -36572,7 +36576,6 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36572
36576
  mode: "multiple",
36573
36577
  selectAllMode: "page"
36574
36578
  },
36575
- onEditorPreparing: onEditorPreparing,
36576
36579
  onExporting: !props.closeGridHeader && function (e) {
36577
36580
  var _props$exportProps$ac, _props$exportProps$pa;
36578
36581
  return ExportDataGridToExcel({
@@ -36587,7 +36590,8 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36587
36590
  },
36588
36591
  onInitNewRow: props.onInitNewRow,
36589
36592
  onRowClick: props.onRowClick,
36590
- onEditorPrepared: onEditorPrepared,
36593
+ onEditorPreparing: handleOnEditorPreparing,
36594
+ onEditorPrepared: handleOnEditorPrepared,
36591
36595
  onSelectionChanged: props.onSelectionChanged,
36592
36596
  onSaved: props.onSaved,
36593
36597
  onSaving: props.onSaving,