ods-component-lib 1.18.269 → 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 (34) hide show
  1. package/dist/App.d.ts +3 -0
  2. package/dist/components/antd/modal/OdsAdvanceModal.d.ts +7 -0
  3. package/dist/components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.Types.d.ts +2 -1
  4. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/ContentHandlers.d.ts +14 -0
  5. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/EditorPreparedHandlers.d.ts +7 -0
  6. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/OnExportingHandlers.d.ts +19 -0
  7. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/OptionHandlers.d.ts +7 -0
  8. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/SummaryHandlers.d.ts +21 -0
  9. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/ActionCellRender.d.ts +15 -0
  10. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/EditingPartial.d.ts +9 -0
  11. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/PageTitle.d.ts +8 -0
  12. package/dist/components/devextreme/OdsInlineEditDataGrid/utils.d.ts +19 -0
  13. package/dist/components/devextreme/OdsTimeline/OdsTimeline.Constants.d.ts +4 -0
  14. package/dist/components/devextreme/OdsTimeline/OdsTimeline.Functions.d.ts +6 -0
  15. package/dist/components/devextreme/OdsTimeline/OdsTimeline.Types.d.ts +77 -0
  16. package/dist/components/devextreme/OdsTimeline/OdsTimeline.d.ts +5 -0
  17. package/dist/components/devextreme/OdsTimeline/OdsTimelineDateFilter.d.ts +3 -0
  18. package/dist/components/devextreme/OdsTimeline/OdsTimelineSelectionColumn.d.ts +2 -0
  19. package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTableSearchBox.d.ts +3 -0
  20. package/dist/index.js +19 -11
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.modern.js +19 -11
  23. package/dist/index.modern.js.map +1 -1
  24. package/dist/index.umd.js +2 -0
  25. package/dist/index.umd.js.map +1 -0
  26. package/dist/stories/OdsAdvanceModal/OdsAdvanceModal.stories.d.ts +42 -0
  27. package/dist/stories/OdsAdvanceModal/Samples/BasicOdsAdvanceModal.sample.d.ts +8 -0
  28. package/dist/stories/OdsModal/Samples/OdsModal.Sample.d.ts +1 -0
  29. package/dist/stories/OdsTimePicker/Samples/TimeRangePicker.d.ts +2 -0
  30. package/dist/stories/OdsTimeline/OdsTimeline.Constants.d.ts +3 -0
  31. package/dist/stories/OdsTimeline/OdsTimeline.Functions.d.ts +6 -0
  32. package/dist/stories/OdsTimeline/OdsTimeline.MockData.d.ts +39 -0
  33. package/dist/stories/OdsTreeList/OdsTreeList.stories.d.ts +1 -1
  34. package/package.json +1 -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,7 @@
1
+ import { ModalProps } from "antd";
2
+ import React from "react";
3
+ export interface ICustomModalProps extends ModalProps {
4
+ content: React.ReactNode;
5
+ }
6
+ declare const OdsAdvanceModal: React.FC<ICustomModalProps>;
7
+ export default OdsAdvanceModal;
@@ -92,10 +92,11 @@ interface IEditingoptions extends IEditingProps {
92
92
  interface ISelectOptions extends ISelectionProps {
93
93
  selectEnable: boolean;
94
94
  }
95
- export interface IButtonGroup extends Omit<IButtonProps, 'icon'> {
95
+ export interface IButtonGroup extends Omit<IButtonProps, "icon"> {
96
96
  icon?: JSX.Element;
97
97
  type?: ButtonType;
98
98
  label?: string;
99
+ isLabelVisible?: boolean;
99
100
  actionPermission?: boolean;
100
101
  onclick?: React.MouseEventHandler<HTMLElement>;
101
102
  }
@@ -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
+ */
@@ -0,0 +1,4 @@
1
+ export declare const Constants: {
2
+ timelineDefaultStartDate: Date;
3
+ timelineDefaultEndDate: Date;
4
+ };
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export declare const checkboxCellComponent: (props: any) => React.JSX.Element;
3
+ export declare const statusCellComponent: (props: any) => React.JSX.Element;
4
+ export declare const minimalHeaderCellComponent: (data: any, __el: any) => React.JSX.Element;
5
+ export declare const mapCustomTask: (item: any) => any;
6
+ export declare const setSelectedKeys: (datasource: any[], key?: string, selectedKeys?: number[] | string[]) => any[];
@@ -0,0 +1,77 @@
1
+ /// <reference types="react" />
2
+ import { IColumnProps, IGanttOptions, IItemProps } from "devextreme-react/gantt";
3
+ export interface IMenuLinkItem {
4
+ text: string;
5
+ url: string;
6
+ queryParamNames?: string[];
7
+ }
8
+ export interface ICustomSelectionChange {
9
+ data: any;
10
+ isSelected: boolean;
11
+ }
12
+ export interface IDateRangeChange {
13
+ startDate: Date;
14
+ endDate: Date;
15
+ }
16
+ export interface IStatusColumnChange {
17
+ data: any;
18
+ status: boolean;
19
+ dataField: string;
20
+ }
21
+ export interface ICheckboxColumnChange {
22
+ data: any;
23
+ isChecked: boolean;
24
+ dataField: string;
25
+ }
26
+ export interface IOdsTimelineProps extends React.PropsWithChildren<IGanttOptions> {
27
+ /**
28
+ * Set columns for listview.
29
+ */
30
+ customColumns?: IOdsTimelineColumnProps[];
31
+ /**
32
+ * Set task list. It is used for list view and timeline view.
33
+ */
34
+ customTasks: any[];
35
+ /**
36
+ * Set data field name from task list. This is used for selection.
37
+ */
38
+ customTaskKey?: string;
39
+ /**
40
+ * Set key values to be selected. "multiSelectionEnabled" must be true.
41
+ */
42
+ customSelectedKeys?: string[] | number[];
43
+ /**
44
+ * Set true if you want multi selection in list view.
45
+ */
46
+ multiSelectionEnabled?: boolean;
47
+ /**
48
+ * This is a selection event that fired when selection is changed.
49
+ */
50
+ onCustomSelectionChanged(e: ICustomSelectionChange): void;
51
+ /**
52
+ * This is a date range event that fired when date range is changed.
53
+ */
54
+ onDateRangeChange(e: IDateRangeChange): void;
55
+ }
56
+ export interface IOdsTimelineColumnProps extends IColumnProps {
57
+ isMinimized?: boolean;
58
+ isStatusColumn?: boolean;
59
+ isCheckboxColumn?: boolean;
60
+ }
61
+ export interface IOdsTimelineStatusColumnProps extends IOdsTimelineColumnProps {
62
+ onStatusColumnChange(e: IStatusColumnChange): void;
63
+ }
64
+ export interface IOdsTimelineCheckboxColumnProps extends IOdsTimelineColumnProps {
65
+ onCheckboxColumnChange(e: ICheckboxColumnChange): void;
66
+ }
67
+ export interface IOdsTimelineDateFilter extends IItemProps {
68
+ defaultStartDate?: Date;
69
+ defaultEndDate?: Date;
70
+ backText?: string;
71
+ nextText?: string;
72
+ onFilterRangeChange(e: IDateRangeChange): void;
73
+ }
74
+ export declare const enum DateDirection {
75
+ prevMonth = "previousMonth",
76
+ nextMonth = "nextMonth"
77
+ }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import "./OdsTimeline.css";
3
+ import { IOdsTimelineProps } from "./OdsTimeline.Types";
4
+ declare const OdsTimeline: (props: IOdsTimelineProps) => React.JSX.Element;
5
+ export default OdsTimeline;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { IOdsTimelineDateFilter } from "./OdsTimeline.Types";
3
+ export declare const OdsTimelineDateFilter: (props: IOdsTimelineDateFilter | Readonly<IOdsTimelineDateFilter>) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ICustomSelectionChange, IOdsTimelineColumnProps } from "./OdsTimeline.Types";
2
+ export declare const OdsTimelineSelectionColumn: (selectionEvent: (e: ICustomSelectionChange) => void) => IOdsTimelineColumnProps;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { IOdsTimelineTableSearchBox } from "./OdsTimelineTable.Types";
3
+ export declare const OdsTimelineTableSearchBox: (props: IOdsTimelineTableSearchBox | Readonly<IOdsTimelineTableSearchBox>) => React.JSX.Element;
package/dist/index.js CHANGED
@@ -34149,9 +34149,13 @@ var OdsBasicDataGrid = function OdsBasicDataGrid(props) {
34149
34149
  return result;
34150
34150
  }, [data, filteredRowCount, constants.loadedPageCount, props.pageSize, constants.totalRecordCount, filterApplied.current]);
34151
34151
  function actionCellRender(cellData, props) {
34152
- var kebabMenuButtons = props.actionButtonGroup && props.actionButtonGroup.length > 3 && !props.edit ? props.actionButtonGroup.slice(2).map(function (button) {
34152
+ var kebabMenuButtons = props.actionButtonGroup && props.actionButtonGroup.length > 3 && !props.edit ? props.actionButtonGroup.slice(2).map(function (button, index) {
34153
34153
  return {
34154
+ key: "kebab-menu-action-button-" + index,
34155
+ title: button.hint,
34156
+ label: button.isLabelVisible ? button.label : "",
34154
34157
  icon: button.icon,
34158
+ danger: button.danger,
34155
34159
  onClick: function onClick(event) {
34156
34160
  var customEvent = {
34157
34161
  column: cellData.column,
@@ -36152,13 +36156,15 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36152
36156
  _props$isSaveButton = props.isSaveButton,
36153
36157
  isSaveButton = _props$isSaveButton === void 0 ? true : _props$isSaveButton,
36154
36158
  _props$isRevertButton = props.isRevertButton,
36155
- 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;
36156
36162
  var _useToken = useToken$2(),
36157
36163
  token = _useToken.token;
36158
36164
  var filterApplied = React.useRef(false);
36159
36165
  var _useState = React.useState(false),
36160
- render = _useState[0],
36161
- rerender = _useState[1];
36166
+ renderTrigger = _useState[0],
36167
+ setRenderTrigger = _useState[1];
36162
36168
  var _useState2 = React.useState(props.columns),
36163
36169
  gridColumns = _useState2[0],
36164
36170
  setGridColumns = _useState2[1];
@@ -36206,7 +36212,7 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36206
36212
  }
36207
36213
  }, [props.columns]);
36208
36214
  React.useEffect(function () {
36209
- rerender(!render);
36215
+ setRenderTrigger(!renderTrigger);
36210
36216
  }, [gridColumns]);
36211
36217
  React.useEffect(function () {
36212
36218
  if (Array.isArray(props.dataSource)) {
@@ -36267,7 +36273,7 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36267
36273
  return [];
36268
36274
  }
36269
36275
  }, [props.actionButtonGroup]);
36270
- var onEditorPreparing = React.useCallback(function (e) {
36276
+ var handleOnEditorPreparing = function handleOnEditorPreparing(e) {
36271
36277
  if (e.row !== undefined && e.parentType === "dataRow") {
36272
36278
  if (props.handleEditorPreparing) {
36273
36279
  props.handleEditorPreparing(e);
@@ -36278,7 +36284,8 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36278
36284
  if (args.event && args.event.type === "cancel") e.cellElement.dispatchEvent(onCancelEditEvent$1);
36279
36285
  };
36280
36286
  }
36281
- }, [props.isServerSide]);
36287
+ onEditorPreparing === null || onEditorPreparing === void 0 ? void 0 : onEditorPreparing(e);
36288
+ };
36282
36289
  var customLoad = React.useCallback(function () {
36283
36290
  var state = JSON.parse(localStorage.getItem(props.exportFileName + "Storage"));
36284
36291
  if (localStorage.getItem(props.exportFileName + "Storage")) {
@@ -36305,7 +36312,7 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36305
36312
  }
36306
36313
  localStorage.setItem(props.exportFileName + "Storage", JSON.stringify(state));
36307
36314
  }, [props.filterEnabledShow]);
36308
- var onEditorPrepared = React.useCallback(function (info) {
36315
+ var handleOnEditorPrepared = function handleOnEditorPrepared(info) {
36309
36316
  if (info.parentType === "filterRow" && info.editorName === "dxSelectBox" && (info.dataField === "IsActive" || info.dataField === "isActive")) {
36310
36317
  if (info.dataSource != null && info.dataSource.length > 0) {
36311
36318
  info.showAllText = info.dataSource.find(function (i) {
@@ -36319,7 +36326,8 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36319
36326
  }).label;
36320
36327
  }
36321
36328
  }
36322
- }, []);
36329
+ onEditorPrepared === null || onEditorPrepared === void 0 ? void 0 : onEditorPrepared(info);
36330
+ };
36323
36331
  var renderTotal = React.useCallback(function () {
36324
36332
  var _props$customSummary;
36325
36333
  var result = "";
@@ -36568,7 +36576,6 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36568
36576
  mode: "multiple",
36569
36577
  selectAllMode: "page"
36570
36578
  },
36571
- onEditorPreparing: onEditorPreparing,
36572
36579
  onExporting: !props.closeGridHeader && function (e) {
36573
36580
  var _props$exportProps$ac, _props$exportProps$pa;
36574
36581
  return ExportDataGridToExcel({
@@ -36583,7 +36590,8 @@ var OdsBatchEditDataGrid = function OdsBatchEditDataGrid(props) {
36583
36590
  },
36584
36591
  onInitNewRow: props.onInitNewRow,
36585
36592
  onRowClick: props.onRowClick,
36586
- onEditorPrepared: onEditorPrepared,
36593
+ onEditorPreparing: handleOnEditorPreparing,
36594
+ onEditorPrepared: handleOnEditorPrepared,
36587
36595
  onSelectionChanged: props.onSelectionChanged,
36588
36596
  onSaved: props.onSaved,
36589
36597
  onSaving: props.onSaving,