ods-component-lib 1.18.235 → 1.18.236
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/components/devextreme/OdsTimelineTable/OdsTimelineTable.Functions.d.ts +1 -1
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Style.d.ts +2 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Types.d.ts +39 -18
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.d.ts +1 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTableDateFilter.d.ts +2 -2
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTableSearchBox.d.ts +3 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTableSelectionColumn.d.ts +2 -2
- package/dist/index.js +165 -27
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +162 -25
- package/dist/index.modern.js.map +1 -1
- package/dist/stories/OdsTimelineTable/OdsTimelineTable.Constants.d.ts +2 -2
- package/dist/utils/customTypes.d.ts +1 -0
- package/package.json +2 -1
|
@@ -2,4 +2,4 @@ import React from "react";
|
|
|
2
2
|
export declare const checkboxCellComponent: (props: any) => React.JSX.Element;
|
|
3
3
|
export declare const statusCellComponent: (props: any) => React.JSX.Element;
|
|
4
4
|
export declare const mapCustomTask: (item: any) => any;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const mapSelectedKeys: (datasource: any[], key?: string, selectedKeys?: number[] | string[]) => any[];
|
|
@@ -6,4 +6,6 @@ export declare const useStyles: (props?: {
|
|
|
6
6
|
taskBar: import("antd-style").SerializedStyles;
|
|
7
7
|
taskProgress: import("antd-style").SerializedStyles;
|
|
8
8
|
taskBarTitle: import("antd-style").SerializedStyles;
|
|
9
|
+
searchBoxIcon: import("antd-style").SerializedStyles;
|
|
10
|
+
searchBox: import("antd-style").SerializedStyles;
|
|
9
11
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IColumnProps, IGanttOptions, IItemProps } from "devextreme-react/gantt";
|
|
3
|
-
import { SortingProcessType, SortingType } from "../../../utils/customTypes";
|
|
3
|
+
import { ExportDocumentType, SortingProcessType, SortingType } from "../../../utils/customTypes";
|
|
4
4
|
export declare type SortingMode = "single" | "multiple" | "none";
|
|
5
5
|
export declare const enum EnumDateDirection {
|
|
6
6
|
prevMonth = "previousMonth",
|
|
@@ -36,7 +36,7 @@ export interface IOdsTimelineTableProps extends React.PropsWithChildren<IGanttOp
|
|
|
36
36
|
/**
|
|
37
37
|
* Set columns for listview.
|
|
38
38
|
*/
|
|
39
|
-
customColumns?:
|
|
39
|
+
customColumns?: IOdsTimelineTableColumnProps[];
|
|
40
40
|
/**
|
|
41
41
|
* Set task list. It is used for list view and timeline view.
|
|
42
42
|
*/
|
|
@@ -48,19 +48,15 @@ export interface IOdsTimelineTableProps extends React.PropsWithChildren<IGanttOp
|
|
|
48
48
|
/**
|
|
49
49
|
* Set key values to be selected. "multiSelectionEnabled" must be true.
|
|
50
50
|
*/
|
|
51
|
-
customSelectedKeys?: string[]
|
|
51
|
+
customSelectedKeys?: string[];
|
|
52
52
|
/**
|
|
53
53
|
* Set true if you want multi selection in list view.
|
|
54
54
|
*/
|
|
55
55
|
multiSelectionEnabled?: boolean;
|
|
56
56
|
/**
|
|
57
|
-
* Set
|
|
57
|
+
* Set settings an for toolbar.
|
|
58
58
|
*/
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Set true if it' s visible.
|
|
62
|
-
*/
|
|
63
|
-
showDateFilter?: boolean;
|
|
59
|
+
toolbarSettings?: IOdsTimelineTableToolbarSettings;
|
|
64
60
|
/**
|
|
65
61
|
* ClientSideSorting means Gantt's default sorting, but sorting have to be managed programmacitally if ServerSideSorting is chosen
|
|
66
62
|
*/
|
|
@@ -78,28 +74,53 @@ export interface IOdsTimelineTableProps extends React.PropsWithChildren<IGanttOp
|
|
|
78
74
|
*/
|
|
79
75
|
onSortingChanged?(sortedColumns: ISortedColumn[], headerCellProps?: any): void;
|
|
80
76
|
}
|
|
81
|
-
export interface
|
|
77
|
+
export interface IOdsTimelineTableColumnProps extends IColumnProps {
|
|
82
78
|
isMinimized?: boolean;
|
|
83
79
|
isStatusColumn?: boolean;
|
|
84
80
|
isCheckboxColumn?: boolean;
|
|
85
81
|
sortingFieldName?: string;
|
|
82
|
+
allowExporting?: boolean;
|
|
86
83
|
}
|
|
87
|
-
export interface
|
|
84
|
+
export interface IOdsTimelineTableStatusColumnProps extends IOdsTimelineTableColumnProps {
|
|
88
85
|
onStatusColumnChange(e: IStatusColumnChange): void;
|
|
89
86
|
}
|
|
90
|
-
export interface IOdsTimelineCheckboxColumnProps extends
|
|
87
|
+
export interface IOdsTimelineCheckboxColumnProps extends IOdsTimelineTableColumnProps {
|
|
91
88
|
onCheckboxColumnChange(e: ICheckboxColumnChange): void;
|
|
92
89
|
}
|
|
93
|
-
export interface
|
|
90
|
+
export interface ISortedColumn {
|
|
91
|
+
sortingFieldName: string;
|
|
92
|
+
sortType: SortingType;
|
|
93
|
+
sortIndex: number;
|
|
94
|
+
sortingText: string;
|
|
95
|
+
}
|
|
96
|
+
export interface IOdsTimelineTableToolbarSettings {
|
|
97
|
+
visible?: boolean;
|
|
98
|
+
location?: "before" | "after";
|
|
99
|
+
search?: {
|
|
100
|
+
visible?: boolean;
|
|
101
|
+
placeholder?: string;
|
|
102
|
+
searchValue?: string;
|
|
103
|
+
onSearch?(searchValue?: string): void;
|
|
104
|
+
};
|
|
105
|
+
export?: {
|
|
106
|
+
visible?: boolean;
|
|
107
|
+
title?: string;
|
|
108
|
+
fileName?: string;
|
|
109
|
+
documentFormat?: ExportDocumentType;
|
|
110
|
+
};
|
|
111
|
+
dateFilterVisible?: boolean;
|
|
112
|
+
zoomVisible?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface IOdsTimelineTableDateFilter extends IItemProps {
|
|
94
115
|
defaultStartDate?: Date;
|
|
95
116
|
defaultEndDate?: Date;
|
|
96
117
|
backText?: string;
|
|
97
118
|
nextText?: string;
|
|
98
119
|
onFilterRangeChange(e: IDateRangeChange): void;
|
|
99
120
|
}
|
|
100
|
-
export interface
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
export interface IOdsTimelineTableSearchBox extends IItemProps {
|
|
122
|
+
value?: string;
|
|
123
|
+
timeoutDuration?: number;
|
|
124
|
+
placeholder?: string;
|
|
125
|
+
onSearch?(searchValue?: string): void;
|
|
105
126
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import "jspdf-autotable";
|
|
2
3
|
import "./OdsTimelineTable.css";
|
|
3
4
|
import { IOdsTimelineTableProps } from "./OdsTimelineTable.Types";
|
|
4
5
|
declare const OdsTimelineTable: React.ForwardRefExoticComponent<IOdsTimelineTableProps & React.RefAttributes<unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
2
|
+
import { IOdsTimelineTableDateFilter } from "./OdsTimelineTable.Types";
|
|
3
|
+
export declare const OdsTimelineTableDateFilter: (props: IOdsTimelineTableDateFilter | Readonly<IOdsTimelineTableDateFilter>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICustomSelectionChange,
|
|
2
|
-
export declare const OdsTimelineSelectionColumn: (selectionEvent?: (e: ICustomSelectionChange) => void) =>
|
|
1
|
+
import { ICustomSelectionChange, IOdsTimelineTableColumnProps } from "./OdsTimelineTable.Types";
|
|
2
|
+
export declare const OdsTimelineSelectionColumn: (selectionEvent?: (e: ICustomSelectionChange) => void) => IOdsTimelineTableColumnProps;
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,8 @@ var DataGrid__default = _interopDefault(DataGrid);
|
|
|
36
36
|
var form = require('devextreme-react/form');
|
|
37
37
|
var pdf_exporter = require('devextreme/pdf_exporter');
|
|
38
38
|
var excel_exporter = require('devextreme/excel_exporter');
|
|
39
|
-
var jsPDF =
|
|
39
|
+
var jsPDF = require('jspdf');
|
|
40
|
+
var jsPDF__default = _interopDefault(jsPDF);
|
|
40
41
|
var exceljs = require('exceljs');
|
|
41
42
|
var fileSaverEs = require('file-saver-es');
|
|
42
43
|
var moment = _interopDefault(require('moment'));
|
|
@@ -46,6 +47,7 @@ var antdStyle = require('antd-style');
|
|
|
46
47
|
var FileSaver = require('file-saver');
|
|
47
48
|
require('devextreme/dist/css/dx.light.css');
|
|
48
49
|
var gantt = require('devextreme-react/gantt');
|
|
50
|
+
require('jspdf-autotable');
|
|
49
51
|
|
|
50
52
|
function _toPrimitive(t, r) {
|
|
51
53
|
if ("object" != typeof t || !t) return t;
|
|
@@ -1284,7 +1286,7 @@ function OdsDataGrid(props) {
|
|
|
1284
1286
|
});
|
|
1285
1287
|
});
|
|
1286
1288
|
} else {
|
|
1287
|
-
var doc = new
|
|
1289
|
+
var doc = new jsPDF__default();
|
|
1288
1290
|
pdf_exporter.exportDataGrid({
|
|
1289
1291
|
jsPDFDocument: doc,
|
|
1290
1292
|
component: e.component,
|
|
@@ -1556,7 +1558,7 @@ function grid(props) {
|
|
|
1556
1558
|
});
|
|
1557
1559
|
});
|
|
1558
1560
|
} else {
|
|
1559
|
-
var doc = new
|
|
1561
|
+
var doc = new jsPDF__default();
|
|
1560
1562
|
pdf_exporter.exportDataGrid({
|
|
1561
1563
|
jsPDFDocument: doc,
|
|
1562
1564
|
component: e.component,
|
|
@@ -38568,7 +38570,7 @@ var mapCustomTask = function mapCustomTask(item) {
|
|
|
38568
38570
|
isSelected: false
|
|
38569
38571
|
}, item);
|
|
38570
38572
|
};
|
|
38571
|
-
var
|
|
38573
|
+
var mapSelectedKeys = function mapSelectedKeys(datasource, key, selectedKeys) {
|
|
38572
38574
|
if (key && key != "" && selectedKeys && selectedKeys.length > 0) {
|
|
38573
38575
|
return datasource.map(function (x) {
|
|
38574
38576
|
if (selectedKeys.some(function (y) {
|
|
@@ -38583,7 +38585,7 @@ var setSelectedKeys = function setSelectedKeys(datasource, key, selectedKeys) {
|
|
|
38583
38585
|
}
|
|
38584
38586
|
};
|
|
38585
38587
|
|
|
38586
|
-
var
|
|
38588
|
+
var OdsTimelineTableDateFilter = function OdsTimelineTableDateFilter(props) {
|
|
38587
38589
|
var defaultStartDate = props.defaultStartDate,
|
|
38588
38590
|
defaultEndDate = props.defaultEndDate,
|
|
38589
38591
|
backText = props.backText,
|
|
@@ -38679,13 +38681,19 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
38679
38681
|
return selectionColumn;
|
|
38680
38682
|
};
|
|
38681
38683
|
|
|
38682
|
-
var _templateObject$B, _templateObject2$9, _templateObject3$6;
|
|
38684
|
+
var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4;
|
|
38683
38685
|
var useStyles$b = antdStyle.createStyles(function (_ref, props) {
|
|
38686
|
+
var _props$taskWidth, _props$progressPerc, _props$progressColor;
|
|
38684
38687
|
var css = _ref.css;
|
|
38688
|
+
var _taskWidth = (_props$taskWidth = props === null || props === void 0 ? void 0 : props.taskWidth) != null ? _props$taskWidth : 0;
|
|
38689
|
+
var _progressPerc = (_props$progressPerc = props === null || props === void 0 ? void 0 : props.progressPerc) != null ? _props$progressPerc : 100;
|
|
38690
|
+
var _progressColor = (_props$progressColor = props === null || props === void 0 ? void 0 : props.progressColor) != null ? _props$progressColor : "unset";
|
|
38685
38691
|
return {
|
|
38686
|
-
taskBar: css(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n min-height: 22px;\n display: block;\n overflow: hidden;\n width: ", "px;\n border: 1px solid #f0f0f0;\n border-radius: 5px;\n background-color: #f0f0f0;\n "])),
|
|
38687
|
-
taskProgress: css(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n height: 100%;\n position: absolute;\n left: 0;\n bottom: 0;\n width: ", "%;\n border: 1px solid ", ";\n border-radius: 5px;\n background-color: ", ";\n "])),
|
|
38688
|
-
taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "])))
|
|
38692
|
+
taskBar: css(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n min-height: 22px;\n display: block;\n overflow: hidden;\n width: ", "px;\n border: 1px solid #f0f0f0;\n border-radius: 5px;\n background-color: #f0f0f0;\n "])), _taskWidth != null ? _taskWidth : 0),
|
|
38693
|
+
taskProgress: css(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n height: 100%;\n position: absolute;\n left: 0;\n bottom: 0;\n width: ", "%;\n border: 1px solid ", ";\n border-radius: 5px;\n background-color: ", ";\n "])), _progressPerc, _progressColor, _progressColor),
|
|
38694
|
+
taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "]))),
|
|
38695
|
+
searchBoxIcon: css(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n color: #999;\n font-size: 17px;\n line-height: 18px;\n "]))),
|
|
38696
|
+
searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n padding-left: 5px;\n "])))
|
|
38689
38697
|
};
|
|
38690
38698
|
});
|
|
38691
38699
|
|
|
@@ -38707,7 +38715,45 @@ var OdsTimelineTableTaskTemplate = function OdsTimelineTableTaskTemplate(_ref) {
|
|
|
38707
38715
|
}));
|
|
38708
38716
|
};
|
|
38709
38717
|
|
|
38718
|
+
var OdsTimelineTableSearchBox = function OdsTimelineTableSearchBox(props) {
|
|
38719
|
+
var _props$value;
|
|
38720
|
+
var _useStyles = useStyles$b(),
|
|
38721
|
+
timelineTableStyles = _useStyles.styles;
|
|
38722
|
+
var _useState = React.useState(true),
|
|
38723
|
+
initialLoad = _useState[0],
|
|
38724
|
+
setInitialLoad = _useState[1];
|
|
38725
|
+
var _useState2 = React.useState((_props$value = props.value) != null ? _props$value : ""),
|
|
38726
|
+
searchValue = _useState2[0],
|
|
38727
|
+
setSearchValue = _useState2[1];
|
|
38728
|
+
React.useEffect(function () {
|
|
38729
|
+
var _props$timeoutDuratio;
|
|
38730
|
+
if (initialLoad) {
|
|
38731
|
+
setInitialLoad(false);
|
|
38732
|
+
return function () {};
|
|
38733
|
+
}
|
|
38734
|
+
var timeoutSearch = setTimeout(function () {
|
|
38735
|
+
props.onSearch && props.onSearch(searchValue);
|
|
38736
|
+
}, (_props$timeoutDuratio = props.timeoutDuration) != null ? _props$timeoutDuratio : 2000);
|
|
38737
|
+
return function () {
|
|
38738
|
+
return clearTimeout(timeoutSearch);
|
|
38739
|
+
};
|
|
38740
|
+
}, [searchValue]);
|
|
38741
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(OdsInput, {
|
|
38742
|
+
key: "OdsTimelineTableSearchBox_OdsSearch",
|
|
38743
|
+
value: searchValue,
|
|
38744
|
+
prefix: React__default.createElement("span", {
|
|
38745
|
+
className: "dx-icon-search " + timelineTableStyles.searchBoxIcon
|
|
38746
|
+
}),
|
|
38747
|
+
placeholder: props.placeholder,
|
|
38748
|
+
className: timelineTableStyles.searchBox,
|
|
38749
|
+
onChange: function onChange(e) {
|
|
38750
|
+
return setSearchValue(e.target.value);
|
|
38751
|
+
}
|
|
38752
|
+
}));
|
|
38753
|
+
};
|
|
38754
|
+
|
|
38710
38755
|
var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
38756
|
+
var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7;
|
|
38711
38757
|
var customColumns = props.customColumns,
|
|
38712
38758
|
customTasks = props.customTasks,
|
|
38713
38759
|
customTaskKey = props.customTaskKey,
|
|
@@ -38716,10 +38762,9 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38716
38762
|
startDateRange = props.startDateRange,
|
|
38717
38763
|
endDateRange = props.endDateRange,
|
|
38718
38764
|
multiSelectionEnabled = props.multiSelectionEnabled,
|
|
38719
|
-
toolbarVisible = props.toolbarVisible,
|
|
38720
|
-
showDateFilter = props.showDateFilter,
|
|
38721
38765
|
sorting = props.sorting,
|
|
38722
38766
|
sortingProcess = props.sortingProcess,
|
|
38767
|
+
toolbarSettings = props.toolbarSettings,
|
|
38723
38768
|
onCustomSelectionChanged = props.onCustomSelectionChanged,
|
|
38724
38769
|
onDateRangeChange = props.onDateRangeChange,
|
|
38725
38770
|
onSortingChanged = props.onSortingChanged;
|
|
@@ -38736,13 +38781,22 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38736
38781
|
var _useState4 = React.useState([]),
|
|
38737
38782
|
sortedColumns = _useState4[0],
|
|
38738
38783
|
setSortedColumns = _useState4[1];
|
|
38784
|
+
var _useState5 = React.useState(customSelectedKeys),
|
|
38785
|
+
selectedKeys = _useState5[0],
|
|
38786
|
+
setSelectedKeys = _useState5[1];
|
|
38787
|
+
var _useState6 = React.useState(toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$sear = toolbarSettings.search) === null || _toolbarSettings$sear === void 0 ? void 0 : _toolbarSettings$sear.searchValue),
|
|
38788
|
+
searchValue = _useState6[0],
|
|
38789
|
+
setSearchValue = _useState6[1];
|
|
38739
38790
|
var originalSortingMode = sorting.mode === undefined || sorting.mode === "" ? "none" : sorting.mode;
|
|
38740
38791
|
var sortingMode = sortingProcess == "ServerSideSorting" ? "none" : originalSortingMode;
|
|
38741
38792
|
var showSortIndexes = sortingProcess == "ServerSideSorting" ? false : sorting.showSortIndexes;
|
|
38742
38793
|
var sortingActive = sortingProcess == "ServerSideSorting" && originalSortingMode != "none";
|
|
38743
38794
|
React.useEffect(function () {
|
|
38744
|
-
|
|
38745
|
-
}, [customTasks]);
|
|
38795
|
+
prepareTimelineTasks(customTasks, customSelectedKeys);
|
|
38796
|
+
}, [customTasks, customSelectedKeys]);
|
|
38797
|
+
var prepareTimelineTasks = function prepareTimelineTasks(tasks, selectedKeys) {
|
|
38798
|
+
setTimelineTasks(mapSelectedKeys(tasks.map(mapCustomTask), customTaskKey, multiSelectionEnabled ? selectedKeys : selectedKeys.length > 0 ? selectedKeys[0] : []));
|
|
38799
|
+
};
|
|
38746
38800
|
var getSelectedRowsData = function getSelectedRowsData() {
|
|
38747
38801
|
return timelineTasks.filter(function (item) {
|
|
38748
38802
|
return item.isSelected == true;
|
|
@@ -38760,14 +38814,19 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38760
38814
|
return sortedColumns;
|
|
38761
38815
|
};
|
|
38762
38816
|
var updateSelectionData = function updateSelectionData(keyValue, isSelected) {
|
|
38763
|
-
|
|
38764
|
-
|
|
38765
|
-
|
|
38766
|
-
|
|
38767
|
-
}
|
|
38768
|
-
return item;
|
|
38817
|
+
var newSelectedKeys = [];
|
|
38818
|
+
if (multiSelectionEnabled) {
|
|
38819
|
+
newSelectedKeys = selectedKeys.filter(function (item) {
|
|
38820
|
+
return item != keyValue;
|
|
38769
38821
|
});
|
|
38770
|
-
|
|
38822
|
+
if (isSelected) {
|
|
38823
|
+
newSelectedKeys = [].concat(newSelectedKeys, [keyValue]);
|
|
38824
|
+
}
|
|
38825
|
+
} else if (isSelected) {
|
|
38826
|
+
newSelectedKeys = [keyValue];
|
|
38827
|
+
}
|
|
38828
|
+
setSelectedKeys(newSelectedKeys);
|
|
38829
|
+
prepareTimelineTasks(timelineTasks, newSelectedKeys);
|
|
38771
38830
|
};
|
|
38772
38831
|
var minimalHeaderCellComponent = function minimalHeaderCellComponent(data) {
|
|
38773
38832
|
return customHeaderCellComponent(data, true);
|
|
@@ -38870,9 +38929,66 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38870
38929
|
});
|
|
38871
38930
|
};
|
|
38872
38931
|
var onTimelineCheckboxSelectionChange = function onTimelineCheckboxSelectionChange(e) {
|
|
38873
|
-
updateSelectionData(e.data[props.customTaskKey], e.isSelected);
|
|
38932
|
+
updateSelectionData(e.data[props.customTaskKey].toString(), e.isSelected);
|
|
38874
38933
|
onCustomSelectionChanged && onCustomSelectionChanged(e);
|
|
38875
38934
|
};
|
|
38935
|
+
var searchBoxComponent = function searchBoxComponent(props) {
|
|
38936
|
+
var _toolbarSettings$sear4;
|
|
38937
|
+
var filterInAllFields = function filterInAllFields(item, searchValue) {
|
|
38938
|
+
var fields = Object.keys(item);
|
|
38939
|
+
for (var index = 0; index < fields.length; index++) {
|
|
38940
|
+
if (String(item[fields[index]]).toLocaleLowerCase().includes(searchValue.toLocaleLowerCase())) {
|
|
38941
|
+
return true;
|
|
38942
|
+
}
|
|
38943
|
+
}
|
|
38944
|
+
return false;
|
|
38945
|
+
};
|
|
38946
|
+
var searchTask = function searchTask(searchValue) {
|
|
38947
|
+
if (searchValue === undefined || searchValue === "") {
|
|
38948
|
+
prepareTimelineTasks(customTasks, selectedKeys);
|
|
38949
|
+
return;
|
|
38950
|
+
}
|
|
38951
|
+
var filteredTasks = customTasks.filter(function (item) {
|
|
38952
|
+
return filterInAllFields(item, searchValue);
|
|
38953
|
+
});
|
|
38954
|
+
prepareTimelineTasks(filteredTasks, selectedKeys);
|
|
38955
|
+
};
|
|
38956
|
+
var onSearchBoxSearch = function onSearchBoxSearch(searchValue) {
|
|
38957
|
+
var _toolbarSettings$sear2, _toolbarSettings$sear3;
|
|
38958
|
+
setSearchValue(searchValue);
|
|
38959
|
+
searchTask(searchValue);
|
|
38960
|
+
(toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$sear2 = toolbarSettings.search) === null || _toolbarSettings$sear2 === void 0 ? void 0 : _toolbarSettings$sear2.onSearch) && (toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$sear3 = toolbarSettings.search) === null || _toolbarSettings$sear3 === void 0 ? void 0 : _toolbarSettings$sear3.onSearch(searchValue));
|
|
38961
|
+
};
|
|
38962
|
+
return OdsTimelineTableSearchBox(_extends({}, props, {
|
|
38963
|
+
value: searchValue,
|
|
38964
|
+
placeholder: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$sear4 = toolbarSettings.search) === null || _toolbarSettings$sear4 === void 0 ? void 0 : _toolbarSettings$sear4.placeholder,
|
|
38965
|
+
onSearch: onSearchBoxSearch
|
|
38966
|
+
}));
|
|
38967
|
+
};
|
|
38968
|
+
var exportToPdf = function exportToPdf() {
|
|
38969
|
+
var _odsTimelineTable$_tr, _toolbarSettings$expo, _toolbarSettings$expo2, _toolbarSettings$expo3;
|
|
38970
|
+
var _odsTimelineTable = refGantt.current.instance;
|
|
38971
|
+
console.log("exportToPdf", _odsTimelineTable, _odsTimelineTable._treeList, (_odsTimelineTable$_tr = _odsTimelineTable._treeList) === null || _odsTimelineTable$_tr === void 0 ? void 0 : _odsTimelineTable$_tr.getVisibleColumns());
|
|
38972
|
+
pdf_exporter.exportGantt({
|
|
38973
|
+
component: _odsTimelineTable,
|
|
38974
|
+
createDocumentMethod: function createDocumentMethod(args) {
|
|
38975
|
+
return new jsPDF.jsPDF(args);
|
|
38976
|
+
},
|
|
38977
|
+
format: (_toolbarSettings$expo = toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$expo2 = toolbarSettings["export"]) === null || _toolbarSettings$expo2 === void 0 ? void 0 : (_toolbarSettings$expo3 = _toolbarSettings$expo2.documentFormat) === null || _toolbarSettings$expo3 === void 0 ? void 0 : _toolbarSettings$expo3.toLowerCase()) != null ? _toolbarSettings$expo : "auto",
|
|
38978
|
+
landscape: true,
|
|
38979
|
+
exportMode: "all",
|
|
38980
|
+
dateRange: "all"
|
|
38981
|
+
}).then(function (doc) {
|
|
38982
|
+
return doc.save(getExportFileName());
|
|
38983
|
+
});
|
|
38984
|
+
};
|
|
38985
|
+
var getExportFileName = function getExportFileName() {
|
|
38986
|
+
var _toolbarSettings$expo4, _toolbarSettings$expo5;
|
|
38987
|
+
var now = new Date();
|
|
38988
|
+
var datePart = ('0' + now.getDate()).slice(-2) + "-" + ('0' + (now.getMonth() + 1)).slice(-2) + "-" + now.getFullYear();
|
|
38989
|
+
var timePart = ('0' + now.getHours()).slice(-2) + ":" + ('0' + now.getMinutes()).slice(-2);
|
|
38990
|
+
return ((_toolbarSettings$expo4 = toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$expo5 = toolbarSettings["export"]) === null || _toolbarSettings$expo5 === void 0 ? void 0 : _toolbarSettings$expo5.fileName) != null ? _toolbarSettings$expo4 : "Timeline") + "-" + datePart + "-" + timePart + ".pdf";
|
|
38991
|
+
};
|
|
38876
38992
|
var timelineColumns = multiSelectionEnabled ? [OdsTimelineSelectionColumn(onTimelineCheckboxSelectionChange)].concat(customColumns) : customColumns;
|
|
38877
38993
|
React.useImperativeHandle(ref, function () {
|
|
38878
38994
|
return {
|
|
@@ -38895,21 +39011,43 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38895
39011
|
mode: sortingMode,
|
|
38896
39012
|
showSortIndexes: false
|
|
38897
39013
|
}
|
|
38898
|
-
}),
|
|
39014
|
+
}), toolbarSettings !== null && toolbarSettings !== void 0 && toolbarSettings.visible ? React__default.createElement(gantt.Toolbar, null, React__default.createElement(gantt.Item, {
|
|
38899
39015
|
key: "OdsTimelineTable_ToolbarItem_DateFilter",
|
|
39016
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.dateFilterVisible,
|
|
39017
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
38900
39018
|
component: function component(props) {
|
|
38901
|
-
return
|
|
39019
|
+
return OdsTimelineTableDateFilter(_extends({}, props, {
|
|
38902
39020
|
defaultStartDate: startDate,
|
|
38903
39021
|
defaultEndDate: endDate,
|
|
38904
39022
|
onFilterRangeChange: onTimelineDateRangeChange
|
|
38905
39023
|
}));
|
|
38906
39024
|
}
|
|
38907
|
-
})
|
|
39025
|
+
}), React__default.createElement(gantt.Item, {
|
|
39026
|
+
key: "OdsTimelineTable_ToolbarItem_Search",
|
|
39027
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$sear5 = toolbarSettings.search) === null || _toolbarSettings$sear5 === void 0 ? void 0 : _toolbarSettings$sear5.visible,
|
|
39028
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
39029
|
+
component: searchBoxComponent
|
|
39030
|
+
}), React__default.createElement(gantt.Item, {
|
|
38908
39031
|
key: "OdsTimelineTable_ToolbarItem_ZoomIn",
|
|
38909
|
-
|
|
39032
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.zoomVisible,
|
|
39033
|
+
name: "zoomIn",
|
|
39034
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location
|
|
38910
39035
|
}), React__default.createElement(gantt.Item, {
|
|
38911
39036
|
key: "OdsTimelineTable_ToolbarItem_ZoomOut",
|
|
38912
|
-
|
|
39037
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.zoomVisible,
|
|
39038
|
+
name: "zoomOut",
|
|
39039
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location
|
|
39040
|
+
}), React__default.createElement(gantt.Item, {
|
|
39041
|
+
key: "OdsTimelineTable_ToolbarItem_Export",
|
|
39042
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$expo6 = toolbarSettings["export"]) === null || _toolbarSettings$expo6 === void 0 ? void 0 : _toolbarSettings$expo6.visible,
|
|
39043
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
39044
|
+
widget: "dxButton",
|
|
39045
|
+
options: {
|
|
39046
|
+
icon: "export",
|
|
39047
|
+
hint: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$expo7 = toolbarSettings["export"]) === null || _toolbarSettings$expo7 === void 0 ? void 0 : _toolbarSettings$expo7.title,
|
|
39048
|
+
stylingMode: "text",
|
|
39049
|
+
onClick: exportToPdf
|
|
39050
|
+
}
|
|
38913
39051
|
})) : "", React__default.createElement(gantt.ContextMenu, {
|
|
38914
39052
|
enabled: false
|
|
38915
39053
|
}), timelineColumns === null || timelineColumns === void 0 ? void 0 : timelineColumns.map(function (columnProps) {
|
|
@@ -40012,7 +40150,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
40012
40150
|
});
|
|
40013
40151
|
});
|
|
40014
40152
|
} else {
|
|
40015
|
-
var doc = new
|
|
40153
|
+
var doc = new jsPDF__default();
|
|
40016
40154
|
pdf_exporter.exportDataGrid({
|
|
40017
40155
|
jsPDFDocument: doc,
|
|
40018
40156
|
component: e.component,
|