ods-component-lib 1.18.234 → 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 -2
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Style.d.ts +2 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Types.d.ts +54 -13
- 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.css +16 -1
- package/dist/index.js +295 -34
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +294 -34
- package/dist/index.modern.js.map +1 -1
- package/dist/stories/OdsTimelineTable/OdsTimelineTable.Constants.d.ts +2 -2
- package/dist/utils/customEnums.d.ts +5 -0
- package/dist/utils/customTypes.d.ts +3 -0
- package/package.json +2 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
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
|
-
export declare const minimalHeaderCellComponent: (data: any, __el: any) => React.JSX.Element;
|
|
5
4
|
export declare const mapCustomTask: (item: any) => any;
|
|
6
|
-
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,5 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IColumnProps, IGanttOptions, IItemProps } from "devextreme-react/gantt";
|
|
3
|
+
import { ExportDocumentType, SortingProcessType, SortingType } from "../../../utils/customTypes";
|
|
4
|
+
export declare type SortingMode = "single" | "multiple" | "none";
|
|
5
|
+
export declare const enum EnumDateDirection {
|
|
6
|
+
prevMonth = "previousMonth",
|
|
7
|
+
nextMonth = "nextMonth"
|
|
8
|
+
}
|
|
3
9
|
export interface IMenuLinkItem {
|
|
4
10
|
text: string;
|
|
5
11
|
url: string;
|
|
@@ -24,10 +30,13 @@ export interface ICheckboxColumnChange {
|
|
|
24
30
|
dataField: string;
|
|
25
31
|
}
|
|
26
32
|
export interface IOdsTimelineTableProps extends React.PropsWithChildren<IGanttOptions> {
|
|
33
|
+
/**
|
|
34
|
+
* Set reference object to access Gantt component props
|
|
35
|
+
*/
|
|
27
36
|
/**
|
|
28
37
|
* Set columns for listview.
|
|
29
38
|
*/
|
|
30
|
-
customColumns?:
|
|
39
|
+
customColumns?: IOdsTimelineTableColumnProps[];
|
|
31
40
|
/**
|
|
32
41
|
* Set task list. It is used for list view and timeline view.
|
|
33
42
|
*/
|
|
@@ -39,19 +48,19 @@ export interface IOdsTimelineTableProps extends React.PropsWithChildren<IGanttOp
|
|
|
39
48
|
/**
|
|
40
49
|
* Set key values to be selected. "multiSelectionEnabled" must be true.
|
|
41
50
|
*/
|
|
42
|
-
customSelectedKeys?: string[]
|
|
51
|
+
customSelectedKeys?: string[];
|
|
43
52
|
/**
|
|
44
53
|
* Set true if you want multi selection in list view.
|
|
45
54
|
*/
|
|
46
55
|
multiSelectionEnabled?: boolean;
|
|
47
56
|
/**
|
|
48
|
-
* Set
|
|
57
|
+
* Set settings an for toolbar.
|
|
49
58
|
*/
|
|
50
|
-
|
|
59
|
+
toolbarSettings?: IOdsTimelineTableToolbarSettings;
|
|
51
60
|
/**
|
|
52
|
-
*
|
|
61
|
+
* ClientSideSorting means Gantt's default sorting, but sorting have to be managed programmacitally if ServerSideSorting is chosen
|
|
53
62
|
*/
|
|
54
|
-
|
|
63
|
+
sortingProcess?: SortingProcessType;
|
|
55
64
|
/**
|
|
56
65
|
* This is a selection event that fired when selection is changed.
|
|
57
66
|
*/
|
|
@@ -60,26 +69,58 @@ export interface IOdsTimelineTableProps extends React.PropsWithChildren<IGanttOp
|
|
|
60
69
|
* This is a date range event that fired when date range is changed.
|
|
61
70
|
*/
|
|
62
71
|
onDateRangeChange?(e: IDateRangeChange): void;
|
|
72
|
+
/**
|
|
73
|
+
* Triggered after sorting changed
|
|
74
|
+
*/
|
|
75
|
+
onSortingChanged?(sortedColumns: ISortedColumn[], headerCellProps?: any): void;
|
|
63
76
|
}
|
|
64
|
-
export interface
|
|
77
|
+
export interface IOdsTimelineTableColumnProps extends IColumnProps {
|
|
65
78
|
isMinimized?: boolean;
|
|
66
79
|
isStatusColumn?: boolean;
|
|
67
80
|
isCheckboxColumn?: boolean;
|
|
81
|
+
sortingFieldName?: string;
|
|
82
|
+
allowExporting?: boolean;
|
|
68
83
|
}
|
|
69
|
-
export interface
|
|
84
|
+
export interface IOdsTimelineTableStatusColumnProps extends IOdsTimelineTableColumnProps {
|
|
70
85
|
onStatusColumnChange(e: IStatusColumnChange): void;
|
|
71
86
|
}
|
|
72
|
-
export interface IOdsTimelineCheckboxColumnProps extends
|
|
87
|
+
export interface IOdsTimelineCheckboxColumnProps extends IOdsTimelineTableColumnProps {
|
|
73
88
|
onCheckboxColumnChange(e: ICheckboxColumnChange): void;
|
|
74
89
|
}
|
|
75
|
-
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 {
|
|
76
115
|
defaultStartDate?: Date;
|
|
77
116
|
defaultEndDate?: Date;
|
|
78
117
|
backText?: string;
|
|
79
118
|
nextText?: string;
|
|
80
119
|
onFilterRangeChange(e: IDateRangeChange): void;
|
|
81
120
|
}
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
|
|
121
|
+
export interface IOdsTimelineTableSearchBox extends IItemProps {
|
|
122
|
+
value?: string;
|
|
123
|
+
timeoutDuration?: number;
|
|
124
|
+
placeholder?: string;
|
|
125
|
+
onSearch?(searchValue?: string): void;
|
|
85
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.css
CHANGED
|
@@ -230,7 +230,22 @@ tr._2CvVM._3Xrp3._19iuB._3udtX {
|
|
|
230
230
|
._3sOBn {
|
|
231
231
|
vertical-align: middle !important;
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
|
|
234
|
+
._ww084:has(._2Ljgj) {
|
|
235
|
+
width: 100%;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
._2Ljgj{
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
width: 100%;
|
|
241
|
+
display: flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
._2dILO {
|
|
246
|
+
flex: 1;
|
|
247
|
+
align-content: center;
|
|
248
|
+
}
|
|
234
249
|
._3n8UJ {
|
|
235
250
|
background-color: lightgreen;
|
|
236
251
|
}
|
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,
|
|
@@ -38563,17 +38565,12 @@ var statusCellComponent = function statusCellComponent(props) {
|
|
|
38563
38565
|
}
|
|
38564
38566
|
});
|
|
38565
38567
|
};
|
|
38566
|
-
var minimalHeaderCellComponent = function minimalHeaderCellComponent(data, __el) {
|
|
38567
|
-
return React__default.createElement("div", {
|
|
38568
|
-
className: "minimalHeaderCell"
|
|
38569
|
-
}, data.data.column.caption);
|
|
38570
|
-
};
|
|
38571
38568
|
var mapCustomTask = function mapCustomTask(item) {
|
|
38572
38569
|
return _extends({
|
|
38573
38570
|
isSelected: false
|
|
38574
38571
|
}, item);
|
|
38575
38572
|
};
|
|
38576
|
-
var
|
|
38573
|
+
var mapSelectedKeys = function mapSelectedKeys(datasource, key, selectedKeys) {
|
|
38577
38574
|
if (key && key != "" && selectedKeys && selectedKeys.length > 0) {
|
|
38578
38575
|
return datasource.map(function (x) {
|
|
38579
38576
|
if (selectedKeys.some(function (y) {
|
|
@@ -38588,7 +38585,7 @@ var setSelectedKeys = function setSelectedKeys(datasource, key, selectedKeys) {
|
|
|
38588
38585
|
}
|
|
38589
38586
|
};
|
|
38590
38587
|
|
|
38591
|
-
var
|
|
38588
|
+
var OdsTimelineTableDateFilter = function OdsTimelineTableDateFilter(props) {
|
|
38592
38589
|
var defaultStartDate = props.defaultStartDate,
|
|
38593
38590
|
defaultEndDate = props.defaultEndDate,
|
|
38594
38591
|
backText = props.backText,
|
|
@@ -38684,13 +38681,19 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
38684
38681
|
return selectionColumn;
|
|
38685
38682
|
};
|
|
38686
38683
|
|
|
38687
|
-
var _templateObject$B, _templateObject2$9, _templateObject3$6;
|
|
38684
|
+
var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4;
|
|
38688
38685
|
var useStyles$b = antdStyle.createStyles(function (_ref, props) {
|
|
38686
|
+
var _props$taskWidth, _props$progressPerc, _props$progressColor;
|
|
38689
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";
|
|
38690
38691
|
return {
|
|
38691
|
-
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 "])),
|
|
38692
|
-
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 "])),
|
|
38693
|
-
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 "])))
|
|
38694
38697
|
};
|
|
38695
38698
|
});
|
|
38696
38699
|
|
|
@@ -38712,7 +38715,45 @@ var OdsTimelineTableTaskTemplate = function OdsTimelineTableTaskTemplate(_ref) {
|
|
|
38712
38715
|
}));
|
|
38713
38716
|
};
|
|
38714
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
|
+
|
|
38715
38755
|
var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
38756
|
+
var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7;
|
|
38716
38757
|
var customColumns = props.customColumns,
|
|
38717
38758
|
customTasks = props.customTasks,
|
|
38718
38759
|
customTaskKey = props.customTaskKey,
|
|
@@ -38721,10 +38762,13 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38721
38762
|
startDateRange = props.startDateRange,
|
|
38722
38763
|
endDateRange = props.endDateRange,
|
|
38723
38764
|
multiSelectionEnabled = props.multiSelectionEnabled,
|
|
38724
|
-
|
|
38725
|
-
|
|
38765
|
+
sorting = props.sorting,
|
|
38766
|
+
sortingProcess = props.sortingProcess,
|
|
38767
|
+
toolbarSettings = props.toolbarSettings,
|
|
38726
38768
|
onCustomSelectionChanged = props.onCustomSelectionChanged,
|
|
38727
|
-
onDateRangeChange = props.onDateRangeChange
|
|
38769
|
+
onDateRangeChange = props.onDateRangeChange,
|
|
38770
|
+
onSortingChanged = props.onSortingChanged;
|
|
38771
|
+
var refGantt = React.useRef(null);
|
|
38728
38772
|
var _useState = React.useState(startDateRange != null ? startDateRange : Constants.timelineDefaultStartDate),
|
|
38729
38773
|
startDate = _useState[0],
|
|
38730
38774
|
setStartDate = _useState[1];
|
|
@@ -38734,23 +38778,147 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38734
38778
|
var _useState3 = React.useState([]),
|
|
38735
38779
|
timelineTasks = _useState3[0],
|
|
38736
38780
|
setTimelineTasks = _useState3[1];
|
|
38781
|
+
var _useState4 = React.useState([]),
|
|
38782
|
+
sortedColumns = _useState4[0],
|
|
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];
|
|
38790
|
+
var originalSortingMode = sorting.mode === undefined || sorting.mode === "" ? "none" : sorting.mode;
|
|
38791
|
+
var sortingMode = sortingProcess == "ServerSideSorting" ? "none" : originalSortingMode;
|
|
38792
|
+
var showSortIndexes = sortingProcess == "ServerSideSorting" ? false : sorting.showSortIndexes;
|
|
38793
|
+
var sortingActive = sortingProcess == "ServerSideSorting" && originalSortingMode != "none";
|
|
38737
38794
|
React.useEffect(function () {
|
|
38738
|
-
|
|
38739
|
-
}, [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
|
+
};
|
|
38740
38800
|
var getSelectedRowsData = function getSelectedRowsData() {
|
|
38741
38801
|
return timelineTasks.filter(function (item) {
|
|
38742
38802
|
return item.isSelected == true;
|
|
38743
38803
|
});
|
|
38744
38804
|
};
|
|
38805
|
+
var customClearSorting = function customClearSorting() {
|
|
38806
|
+
if (sortingProcess === "ServerSideSorting") {
|
|
38807
|
+
setSortedColumns([]);
|
|
38808
|
+
} else {
|
|
38809
|
+
refGantt.current.instance.clearSorting();
|
|
38810
|
+
}
|
|
38811
|
+
onSortingChanged && onSortingChanged([], undefined);
|
|
38812
|
+
};
|
|
38813
|
+
var getSortedColumns = function getSortedColumns() {
|
|
38814
|
+
return sortedColumns;
|
|
38815
|
+
};
|
|
38745
38816
|
var updateSelectionData = function updateSelectionData(keyValue, isSelected) {
|
|
38746
|
-
|
|
38747
|
-
|
|
38748
|
-
|
|
38749
|
-
|
|
38817
|
+
var newSelectedKeys = [];
|
|
38818
|
+
if (multiSelectionEnabled) {
|
|
38819
|
+
newSelectedKeys = selectedKeys.filter(function (item) {
|
|
38820
|
+
return item != keyValue;
|
|
38821
|
+
});
|
|
38822
|
+
if (isSelected) {
|
|
38823
|
+
newSelectedKeys = [].concat(newSelectedKeys, [keyValue]);
|
|
38824
|
+
}
|
|
38825
|
+
} else if (isSelected) {
|
|
38826
|
+
newSelectedKeys = [keyValue];
|
|
38827
|
+
}
|
|
38828
|
+
setSelectedKeys(newSelectedKeys);
|
|
38829
|
+
prepareTimelineTasks(timelineTasks, newSelectedKeys);
|
|
38830
|
+
};
|
|
38831
|
+
var minimalHeaderCellComponent = function minimalHeaderCellComponent(data) {
|
|
38832
|
+
return customHeaderCellComponent(data, true);
|
|
38833
|
+
};
|
|
38834
|
+
var customHeaderCellComponent = function customHeaderCellComponent(props, isMinimized) {
|
|
38835
|
+
var _ref;
|
|
38836
|
+
var _isMinimized = (_ref = isMinimized != null ? isMinimized : props.data.column.isMinimized) != null ? _ref : false;
|
|
38837
|
+
if (sortingActive && props.data.column.allowSorting) {
|
|
38838
|
+
return React__default.createElement("div", {
|
|
38839
|
+
className: "sortingHeaderCell",
|
|
38840
|
+
onClick: function onClick(e) {
|
|
38841
|
+
if (Boolean(props.data.column.allowSorting)) {
|
|
38842
|
+
if (e.shiftKey === true && e.ctrlKey === false) {
|
|
38843
|
+
onSorting(props.data, 2);
|
|
38844
|
+
} else if (e.shiftKey === false && e.ctrlKey === false) {
|
|
38845
|
+
onSorting(props.data, 1);
|
|
38846
|
+
} else if (e.shiftKey === false && e.ctrlKey === true) {
|
|
38847
|
+
onRemoveSorting(props.data);
|
|
38848
|
+
}
|
|
38849
|
+
}
|
|
38850
|
+
}
|
|
38851
|
+
}, React__default.createElement("span", {
|
|
38852
|
+
className: _isMinimized ? "headerCaption minimalHeaderCell" : "headerCaption"
|
|
38853
|
+
}, props.data.column.caption), getSortIcon(props.data.column));
|
|
38854
|
+
}
|
|
38855
|
+
return React__default.createElement("div", {
|
|
38856
|
+
className: _isMinimized ? "minimalHeaderCell" : ""
|
|
38857
|
+
}, props.data.column.caption);
|
|
38858
|
+
};
|
|
38859
|
+
var getSortIcon = function getSortIcon(column) {
|
|
38860
|
+
var sortingFieldName = getSortingFieldName(column);
|
|
38861
|
+
var sortedColumn = sortedColumns.find(function (item) {
|
|
38862
|
+
return item.sortingFieldName == sortingFieldName;
|
|
38863
|
+
});
|
|
38864
|
+
if (sortedColumn) {
|
|
38865
|
+
return sortedColumn.sortType === "ASC" ? React__default.createElement(outline.UpArrow2Icon, null) : React__default.createElement(outline.DownArrow2Icon, null);
|
|
38866
|
+
}
|
|
38867
|
+
return undefined;
|
|
38868
|
+
};
|
|
38869
|
+
var getSortingFieldName = function getSortingFieldName(column) {
|
|
38870
|
+
var _column$sortingFieldN;
|
|
38871
|
+
return (_column$sortingFieldN = column.sortingFieldName) != null ? _column$sortingFieldN : column.dataField;
|
|
38872
|
+
};
|
|
38873
|
+
var onSorting = function onSorting(headerCellProps, sortingMode) {
|
|
38874
|
+
var sortingFieldName = getSortingFieldName(headerCellProps.column);
|
|
38875
|
+
var sortedColumn = sortedColumns.find(function (item) {
|
|
38876
|
+
return item.sortingFieldName == sortingFieldName;
|
|
38877
|
+
});
|
|
38878
|
+
var prevSortIndex = sortedColumn === null || sortedColumn === void 0 ? void 0 : sortedColumn.sortIndex;
|
|
38879
|
+
var newSortedColumn = {
|
|
38880
|
+
sortingFieldName: sortingFieldName,
|
|
38881
|
+
sortType: "ASC",
|
|
38882
|
+
sortIndex: sortingMode == 2 ? sortedColumn === undefined ? sortedColumns.length : sortedColumns.length - 1 : 0,
|
|
38883
|
+
sortingText: sortingFieldName + " ASC"
|
|
38884
|
+
};
|
|
38885
|
+
if (sortedColumn) {
|
|
38886
|
+
newSortedColumn.sortType = sortedColumn.sortType == "ASC" ? "DESC" : "ASC";
|
|
38887
|
+
newSortedColumn.sortingText = sortingFieldName + " " + newSortedColumn.sortType;
|
|
38888
|
+
}
|
|
38889
|
+
var newSortedColumns = sortingMode == 2 ? [].concat(sortedColumns.filter(function (item) {
|
|
38890
|
+
return item.sortingFieldName != sortingFieldName;
|
|
38891
|
+
}), [newSortedColumn]) : [newSortedColumn];
|
|
38892
|
+
if (sortingMode == 2 && sortedColumn !== undefined) {
|
|
38893
|
+
newSortedColumns = newSortedColumns.map(function (item) {
|
|
38894
|
+
if (item.sortingFieldName != sortingFieldName && item.sortIndex > prevSortIndex) {
|
|
38895
|
+
item.sortIndex = item.sortIndex - 1;
|
|
38750
38896
|
}
|
|
38751
38897
|
return item;
|
|
38752
38898
|
});
|
|
38899
|
+
}
|
|
38900
|
+
setSortedColumns(newSortedColumns);
|
|
38901
|
+
onSortingChanged && onSortingChanged(newSortedColumns, headerCellProps);
|
|
38902
|
+
};
|
|
38903
|
+
var onRemoveSorting = function onRemoveSorting(headerCellProps) {
|
|
38904
|
+
var sortingFieldName = getSortingFieldName(headerCellProps.column);
|
|
38905
|
+
var sortedColumn = sortedColumns.find(function (item) {
|
|
38906
|
+
return item.sortingFieldName == sortingFieldName;
|
|
38907
|
+
});
|
|
38908
|
+
if (sortedColumn === undefined) {
|
|
38909
|
+
return;
|
|
38910
|
+
}
|
|
38911
|
+
var prevSortIndex = sortedColumn.sortIndex;
|
|
38912
|
+
var newSortedColumns = sortedColumns.filter(function (item) {
|
|
38913
|
+
return item.sortingFieldName != sortingFieldName;
|
|
38914
|
+
}).map(function (item) {
|
|
38915
|
+
if (item.sortIndex > prevSortIndex) {
|
|
38916
|
+
item.sortIndex = item.sortIndex - 1;
|
|
38917
|
+
}
|
|
38918
|
+
return item;
|
|
38753
38919
|
});
|
|
38920
|
+
setSortedColumns(newSortedColumns);
|
|
38921
|
+
onSortingChanged && onSortingChanged(newSortedColumns, headerCellProps);
|
|
38754
38922
|
};
|
|
38755
38923
|
var onTimelineDateRangeChange = function onTimelineDateRangeChange(e) {
|
|
38756
38924
|
setStartDate(e.startDate);
|
|
@@ -38761,13 +38929,72 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38761
38929
|
});
|
|
38762
38930
|
};
|
|
38763
38931
|
var onTimelineCheckboxSelectionChange = function onTimelineCheckboxSelectionChange(e) {
|
|
38764
|
-
updateSelectionData(e.data[props.customTaskKey], e.isSelected);
|
|
38932
|
+
updateSelectionData(e.data[props.customTaskKey].toString(), e.isSelected);
|
|
38765
38933
|
onCustomSelectionChanged && onCustomSelectionChanged(e);
|
|
38766
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
|
+
};
|
|
38767
38992
|
var timelineColumns = multiSelectionEnabled ? [OdsTimelineSelectionColumn(onTimelineCheckboxSelectionChange)].concat(customColumns) : customColumns;
|
|
38768
38993
|
React.useImperativeHandle(ref, function () {
|
|
38769
38994
|
return {
|
|
38770
|
-
getSelectedRowsData: getSelectedRowsData
|
|
38995
|
+
getSelectedRowsData: getSelectedRowsData,
|
|
38996
|
+
getSortedColumns: getSortedColumns,
|
|
38997
|
+
customClearSorting: customClearSorting
|
|
38771
38998
|
};
|
|
38772
38999
|
});
|
|
38773
39000
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(gantt.Gantt, Object.assign({
|
|
@@ -38778,21 +39005,49 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38778
39005
|
taskContentRender: function taskContentRender(params) {
|
|
38779
39006
|
return React__default.createElement(OdsTimelineTableTaskTemplate, Object.assign({}, params));
|
|
38780
39007
|
}
|
|
38781
|
-
}, props
|
|
39008
|
+
}, props, {
|
|
39009
|
+
ref: refGantt,
|
|
39010
|
+
sorting: {
|
|
39011
|
+
mode: sortingMode,
|
|
39012
|
+
showSortIndexes: false
|
|
39013
|
+
}
|
|
39014
|
+
}), toolbarSettings !== null && toolbarSettings !== void 0 && toolbarSettings.visible ? React__default.createElement(gantt.Toolbar, null, React__default.createElement(gantt.Item, {
|
|
38782
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,
|
|
38783
39018
|
component: function component(props) {
|
|
38784
|
-
return
|
|
39019
|
+
return OdsTimelineTableDateFilter(_extends({}, props, {
|
|
38785
39020
|
defaultStartDate: startDate,
|
|
38786
39021
|
defaultEndDate: endDate,
|
|
38787
39022
|
onFilterRangeChange: onTimelineDateRangeChange
|
|
38788
39023
|
}));
|
|
38789
39024
|
}
|
|
38790
|
-
})
|
|
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, {
|
|
38791
39031
|
key: "OdsTimelineTable_ToolbarItem_ZoomIn",
|
|
38792
|
-
|
|
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
|
|
38793
39035
|
}), React__default.createElement(gantt.Item, {
|
|
38794
39036
|
key: "OdsTimelineTable_ToolbarItem_ZoomOut",
|
|
38795
|
-
|
|
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
|
+
}
|
|
38796
39051
|
})) : "", React__default.createElement(gantt.ContextMenu, {
|
|
38797
39052
|
enabled: false
|
|
38798
39053
|
}), timelineColumns === null || timelineColumns === void 0 ? void 0 : timelineColumns.map(function (columnProps) {
|
|
@@ -38810,16 +39065,22 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38810
39065
|
minWidth: 50,
|
|
38811
39066
|
cssClass: "cellCenteredVertically",
|
|
38812
39067
|
cellComponent: checkboxCellComponent,
|
|
38813
|
-
headerCellComponent: minimalHeaderCellComponent
|
|
39068
|
+
headerCellComponent: minimalHeaderCellComponent,
|
|
39069
|
+
allowSorting: false
|
|
38814
39070
|
}, columnProps));
|
|
38815
39071
|
} else {
|
|
38816
39072
|
return React__default.createElement(gantt.Column, Object.assign({
|
|
38817
|
-
headerCellComponent:
|
|
39073
|
+
headerCellComponent: function headerCellComponent(props) {
|
|
39074
|
+
return customHeaderCellComponent(props);
|
|
39075
|
+
}
|
|
38818
39076
|
}, columnProps));
|
|
38819
39077
|
}
|
|
38820
39078
|
}), React__default.createElement(gantt.Tasks, {
|
|
38821
39079
|
dataSource: timelineTasks
|
|
38822
|
-
}), children
|
|
39080
|
+
}), children, React__default.createElement(gantt.Sorting, {
|
|
39081
|
+
mode: sortingMode,
|
|
39082
|
+
showSortIndexes: showSortIndexes
|
|
39083
|
+
})));
|
|
38823
39084
|
});
|
|
38824
39085
|
|
|
38825
39086
|
/**
|
|
@@ -39889,7 +40150,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39889
40150
|
});
|
|
39890
40151
|
});
|
|
39891
40152
|
} else {
|
|
39892
|
-
var doc = new
|
|
40153
|
+
var doc = new jsPDF__default();
|
|
39893
40154
|
pdf_exporter.exportDataGrid({
|
|
39894
40155
|
jsPDFDocument: doc,
|
|
39895
40156
|
component: e.component,
|