ods-component-lib 1.18.201 → 1.18.204

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/dist/App.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const App: React.FC;
3
+ export default App;
@@ -14,6 +14,8 @@ declare type FileUploadProps = {
14
14
  RemoveTitle?: string;
15
15
  RemoveOkText?: string;
16
16
  RemoveCancelText?: string;
17
+ skipSizeValidation?: boolean;
18
+ maxFileSizeMB?: number;
17
19
  };
18
20
  interface IValidationMessageOptions {
19
21
  sizeValidationFailMessage?: string;
@@ -1,6 +1,6 @@
1
1
  import { ModalProps } from "antd";
2
2
  import React from "react";
3
- interface ICustomModalProps extends ModalProps {
3
+ export interface ICustomModalProps extends ModalProps {
4
4
  content: React.ReactNode;
5
5
  }
6
6
  declare const OdsAdvanceModal: React.FC<ICustomModalProps>;
@@ -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
@@ -1931,7 +1931,11 @@ function OdsFileUpload(props) {
1931
1931
  customValidationMessages = props.customValidationMessages,
1932
1932
  RemoveTitle = props.RemoveTitle,
1933
1933
  RemoveOkText = props.RemoveOkText,
1934
- RemoveCancelText = props.RemoveCancelText;
1934
+ RemoveCancelText = props.RemoveCancelText,
1935
+ _props$skipSizeValida = props.skipSizeValidation,
1936
+ skipSizeValidation = _props$skipSizeValida === void 0 ? false : _props$skipSizeValida,
1937
+ _props$maxFileSizeMB = props.maxFileSizeMB,
1938
+ maxFileSizeMB = _props$maxFileSizeMB === void 0 ? 10 : _props$maxFileSizeMB;
1935
1939
  var confirm = antd.Modal.confirm;
1936
1940
  var _useState = React.useState(false),
1937
1941
  previewOpen = _useState[0],
@@ -1991,7 +1995,7 @@ function OdsFileUpload(props) {
1991
1995
  beforeUpload: function (file) {
1992
1996
  try {
1993
1997
  var fileType = allowDocumentUpload ? ["image/png", "image/jpg", "image/jpeg", "image/svg+xml", "application/pdf", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"] : ["image/png", "image/jpg", "image/jpeg", "image/svg+xml"];
1994
- var isFileSizeOk = file.size / (1024 * 1024) <= 1;
1998
+ var isFileSizeOk = skipSizeValidation ? true : file.size / (1024 * 1024) <= maxFileSizeMB;
1995
1999
  var checkType = fileType.includes(file.type);
1996
2000
  if (!checkType) {
1997
2001
  OdsNotification({
@@ -2114,7 +2118,8 @@ function OdsFileUpload(props) {
2114
2118
  src: previewSrc
2115
2119
  });
2116
2120
  } else {
2117
- var fileExtension = fileName != "" ? fileName.split(".").pop().toLowerCase() : previewSrc.split(".").pop().toLowerCase();
2121
+ var _fileName$split$pop, _previewSrc$split$pop;
2122
+ var fileExtension = fileName !== "" ? (_fileName$split$pop = fileName.split(".").pop()) === null || _fileName$split$pop === void 0 ? void 0 : _fileName$split$pop.toLowerCase() : (_previewSrc$split$pop = previewSrc.split(".").pop()) === null || _previewSrc$split$pop === void 0 ? void 0 : _previewSrc$split$pop.toLowerCase();
2118
2123
  if (fileExtension === "png" || fileExtension === "jpg" || fileExtension === "jpeg" || fileExtension === "svg") {
2119
2124
  return React__default.createElement("img", {
2120
2125
  alt: fileName == "" ? "file" : fileName,
@@ -33161,25 +33166,20 @@ var ExportDataGridToExcel = function ExportDataGridToExcel(_ref) {
33161
33166
  lastProcessedRowData = gridCell.data;
33162
33167
  }
33163
33168
  if ((gridCell.column.dataType === "datetime" || gridCell.column.dataField === "CreateDate" || gridCell.column.dataField === "ModifyDate") && gridCell.value) {
33164
- var date = moment(gridCell.value);
33165
- var formattedDate = date.format("DD.MM.YYYY HH:mm");
33166
- excelCell.value = formattedDate;
33169
+ excelCell.value = moment(gridCell.value).format("DD.MM.YYYY HH:mm");
33167
33170
  } else if (gridCell.column.dataType === "date" && gridCell.value) {
33168
- var _date = moment(gridCell.value);
33169
- var _formattedDate = _date.format("DD.MM.YYYY");
33170
- excelCell.value = _formattedDate;
33171
- } else {
33172
- excelCell.font = {
33173
- name: 'Arial',
33174
- size: 12
33175
- };
33176
- excelCell.alignment = {
33177
- horizontal: 'left'
33178
- };
33171
+ excelCell.value = moment(gridCell.value).format("DD.MM.YYYY");
33179
33172
  }
33180
33173
  if (gridCell.rowType === 'data' && gridCell.column.dataField.toLowerCase() === "isactive") {
33181
33174
  excelCell.value = gridCell.value === true ? "" + activeText : "" + passiveText;
33182
33175
  }
33176
+ excelCell.font = {
33177
+ name: 'Arial',
33178
+ size: 12
33179
+ };
33180
+ excelCell.alignment = {
33181
+ horizontal: 'left'
33182
+ };
33183
33183
  }
33184
33184
  }
33185
33185
  }).then(function () {