ods-component-lib 1.18.235 → 1.18.237
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 +3 -1
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Style.d.ts +2 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Types.d.ts +47 -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 +254 -61
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +244 -53
- 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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { IOdsTimelineTableProps } from "./OdsTimelineTable.Types";
|
|
2
3
|
export declare const checkboxCellComponent: (props: any) => React.JSX.Element;
|
|
3
4
|
export declare const statusCellComponent: (props: any) => React.JSX.Element;
|
|
4
5
|
export declare const mapCustomTask: (item: any) => any;
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const mapSelectedKeys: (datasource: any[], key?: string, selectedKeys?: string[]) => any[];
|
|
7
|
+
export declare const getExportableTimelineTable: (props: IOdsTimelineTableProps, ref: any) => React.JSX.Element;
|
|
@@ -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,23 +48,23 @@ 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
|
*/
|
|
67
63
|
sortingProcess?: SortingProcessType;
|
|
64
|
+
/**
|
|
65
|
+
* Set translations for showing in cells
|
|
66
|
+
*/
|
|
67
|
+
dataTranslations?: ITranslationValue[];
|
|
68
68
|
/**
|
|
69
69
|
* This is a selection event that fired when selection is changed.
|
|
70
70
|
*/
|
|
@@ -78,28 +78,57 @@ export interface IOdsTimelineTableProps extends React.PropsWithChildren<IGanttOp
|
|
|
78
78
|
*/
|
|
79
79
|
onSortingChanged?(sortedColumns: ISortedColumn[], headerCellProps?: any): void;
|
|
80
80
|
}
|
|
81
|
-
export interface
|
|
81
|
+
export interface IOdsTimelineTableColumnProps extends IColumnProps {
|
|
82
82
|
isMinimized?: boolean;
|
|
83
83
|
isStatusColumn?: boolean;
|
|
84
84
|
isCheckboxColumn?: boolean;
|
|
85
85
|
sortingFieldName?: string;
|
|
86
|
+
allowExporting?: boolean;
|
|
86
87
|
}
|
|
87
|
-
export interface
|
|
88
|
+
export interface IOdsTimelineTableStatusColumnProps extends IOdsTimelineTableColumnProps {
|
|
88
89
|
onStatusColumnChange(e: IStatusColumnChange): void;
|
|
89
90
|
}
|
|
90
|
-
export interface IOdsTimelineCheckboxColumnProps extends
|
|
91
|
+
export interface IOdsTimelineCheckboxColumnProps extends IOdsTimelineTableColumnProps {
|
|
91
92
|
onCheckboxColumnChange(e: ICheckboxColumnChange): void;
|
|
92
93
|
}
|
|
93
|
-
export interface
|
|
94
|
+
export interface ISortedColumn {
|
|
95
|
+
sortingFieldName: string;
|
|
96
|
+
sortType: SortingType;
|
|
97
|
+
sortIndex: number;
|
|
98
|
+
sortingText: string;
|
|
99
|
+
}
|
|
100
|
+
export interface IOdsTimelineTableToolbarSettings {
|
|
101
|
+
visible?: boolean;
|
|
102
|
+
location?: "before" | "after";
|
|
103
|
+
search?: {
|
|
104
|
+
visible?: boolean;
|
|
105
|
+
placeholder?: string;
|
|
106
|
+
searchValue?: string;
|
|
107
|
+
onSearch?(searchValue?: string): void;
|
|
108
|
+
};
|
|
109
|
+
export?: {
|
|
110
|
+
visible?: boolean;
|
|
111
|
+
title?: string;
|
|
112
|
+
fileName?: string;
|
|
113
|
+
documentFormat?: ExportDocumentType;
|
|
114
|
+
};
|
|
115
|
+
dateFilterVisible?: boolean;
|
|
116
|
+
zoomVisible?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface IOdsTimelineTableDateFilter extends IItemProps {
|
|
94
119
|
defaultStartDate?: Date;
|
|
95
120
|
defaultEndDate?: Date;
|
|
96
121
|
backText?: string;
|
|
97
122
|
nextText?: string;
|
|
98
123
|
onFilterRangeChange(e: IDateRangeChange): void;
|
|
99
124
|
}
|
|
100
|
-
export interface
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
125
|
+
export interface IOdsTimelineTableSearchBox extends IItemProps {
|
|
126
|
+
value?: string;
|
|
127
|
+
timeoutDuration?: number;
|
|
128
|
+
placeholder?: string;
|
|
129
|
+
onSearch?(searchValue?: string): void;
|
|
130
|
+
}
|
|
131
|
+
export interface ITranslationValue {
|
|
132
|
+
originalValue: any;
|
|
133
|
+
translatedValue: string;
|
|
105
134
|
}
|
|
@@ -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'));
|
|
@@ -45,7 +46,9 @@ var devextremeReact = require('devextreme-react');
|
|
|
45
46
|
var antdStyle = require('antd-style');
|
|
46
47
|
var FileSaver = require('file-saver');
|
|
47
48
|
require('devextreme/dist/css/dx.light.css');
|
|
48
|
-
var
|
|
49
|
+
var Gantt = require('devextreme-react/gantt');
|
|
50
|
+
var Gantt__default = _interopDefault(Gantt);
|
|
51
|
+
require('jspdf-autotable');
|
|
49
52
|
|
|
50
53
|
function _toPrimitive(t, r) {
|
|
51
54
|
if ("object" != typeof t || !t) return t;
|
|
@@ -1284,7 +1287,7 @@ function OdsDataGrid(props) {
|
|
|
1284
1287
|
});
|
|
1285
1288
|
});
|
|
1286
1289
|
} else {
|
|
1287
|
-
var doc = new
|
|
1290
|
+
var doc = new jsPDF__default();
|
|
1288
1291
|
pdf_exporter.exportDataGrid({
|
|
1289
1292
|
jsPDFDocument: doc,
|
|
1290
1293
|
component: e.component,
|
|
@@ -1556,7 +1559,7 @@ function grid(props) {
|
|
|
1556
1559
|
});
|
|
1557
1560
|
});
|
|
1558
1561
|
} else {
|
|
1559
|
-
var doc = new
|
|
1562
|
+
var doc = new jsPDF__default();
|
|
1560
1563
|
pdf_exporter.exportDataGrid({
|
|
1561
1564
|
jsPDFDocument: doc,
|
|
1562
1565
|
component: e.component,
|
|
@@ -38518,6 +38521,40 @@ var Constants = {
|
|
|
38518
38521
|
timelineDefaultEndDate: new Date(currentYear + 1, 0, 1)
|
|
38519
38522
|
};
|
|
38520
38523
|
|
|
38524
|
+
var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4;
|
|
38525
|
+
var useStyles$b = antdStyle.createStyles(function (_ref, props) {
|
|
38526
|
+
var _props$taskWidth, _props$progressPerc, _props$progressColor;
|
|
38527
|
+
var css = _ref.css;
|
|
38528
|
+
var _taskWidth = (_props$taskWidth = props === null || props === void 0 ? void 0 : props.taskWidth) != null ? _props$taskWidth : 0;
|
|
38529
|
+
var _progressPerc = (_props$progressPerc = props === null || props === void 0 ? void 0 : props.progressPerc) != null ? _props$progressPerc : 100;
|
|
38530
|
+
var _progressColor = (_props$progressColor = props === null || props === void 0 ? void 0 : props.progressColor) != null ? _props$progressColor : "unset";
|
|
38531
|
+
return {
|
|
38532
|
+
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),
|
|
38533
|
+
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),
|
|
38534
|
+
taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "]))),
|
|
38535
|
+
searchBoxIcon: css(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n color: #999;\n font-size: 17px;\n line-height: 18px;\n "]))),
|
|
38536
|
+
searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n padding-left: 5px;\n "])))
|
|
38537
|
+
};
|
|
38538
|
+
});
|
|
38539
|
+
|
|
38540
|
+
var OdsTimelineTableTaskTemplate = function OdsTimelineTableTaskTemplate(_ref) {
|
|
38541
|
+
var taskData = _ref.taskData,
|
|
38542
|
+
taskSize = _ref.taskSize;
|
|
38543
|
+
var _useStyles = useStyles$b({
|
|
38544
|
+
progressColor: taskData.color,
|
|
38545
|
+
progressPerc: taskData.progress,
|
|
38546
|
+
taskWidth: taskSize.width
|
|
38547
|
+
}),
|
|
38548
|
+
timelineTableStyles = _useStyles.styles;
|
|
38549
|
+
return React__default.createElement("div", {
|
|
38550
|
+
className: timelineTableStyles.taskBar
|
|
38551
|
+
}, React__default.createElement("span", {
|
|
38552
|
+
className: timelineTableStyles.taskBarTitle
|
|
38553
|
+
}, taskData.title), React__default.createElement("div", {
|
|
38554
|
+
className: timelineTableStyles.taskProgress
|
|
38555
|
+
}));
|
|
38556
|
+
};
|
|
38557
|
+
|
|
38521
38558
|
var checkboxCellComponent = function checkboxCellComponent(props) {
|
|
38522
38559
|
var isChecked = props.data.value;
|
|
38523
38560
|
var onChange = function onChange(e) {
|
|
@@ -38568,22 +38605,70 @@ var mapCustomTask = function mapCustomTask(item) {
|
|
|
38568
38605
|
isSelected: false
|
|
38569
38606
|
}, item);
|
|
38570
38607
|
};
|
|
38571
|
-
var
|
|
38608
|
+
var mapSelectedKeys = function mapSelectedKeys(datasource, key, selectedKeys) {
|
|
38572
38609
|
if (key && key != "" && selectedKeys && selectedKeys.length > 0) {
|
|
38573
38610
|
return datasource.map(function (x) {
|
|
38574
|
-
|
|
38611
|
+
x.isSelected = selectedKeys.some(function (y) {
|
|
38575
38612
|
return y == x[key];
|
|
38576
|
-
})
|
|
38577
|
-
x.isSelected = true;
|
|
38578
|
-
}
|
|
38613
|
+
});
|
|
38579
38614
|
return x;
|
|
38580
38615
|
});
|
|
38581
38616
|
} else {
|
|
38582
38617
|
return datasource;
|
|
38583
38618
|
}
|
|
38584
38619
|
};
|
|
38620
|
+
var getTranslatedValue = function getTranslatedValue(value, translations) {
|
|
38621
|
+
var _translations$find$tr, _translations$find;
|
|
38622
|
+
return (_translations$find$tr = (_translations$find = translations.find(function (item) {
|
|
38623
|
+
return item.originalValue == value;
|
|
38624
|
+
})) === null || _translations$find === void 0 ? void 0 : _translations$find.translatedValue) != null ? _translations$find$tr : value;
|
|
38625
|
+
};
|
|
38626
|
+
var getExportableTimelineTable = function getExportableTimelineTable(props, ref) {
|
|
38627
|
+
var _props$customColumns;
|
|
38628
|
+
return React__default.createElement(Gantt__default, Object.assign({
|
|
38629
|
+
width: 0,
|
|
38630
|
+
height: 0,
|
|
38631
|
+
startDateRange: props.startDateRange,
|
|
38632
|
+
endDateRange: props.endDateRange,
|
|
38633
|
+
ref: ref,
|
|
38634
|
+
taskContentRender: function taskContentRender(params) {
|
|
38635
|
+
return React__default.createElement(OdsTimelineTableTaskTemplate, Object.assign({}, params));
|
|
38636
|
+
}
|
|
38637
|
+
}, props), (_props$customColumns = props.customColumns) === null || _props$customColumns === void 0 ? void 0 : _props$customColumns.filter(function (col) {
|
|
38638
|
+
return col.allowExporting != false;
|
|
38639
|
+
}).map(function (columnProps) {
|
|
38640
|
+
if (columnProps.isStatusColumn) {
|
|
38641
|
+
return React__default.createElement(Gantt.Column, Object.assign({
|
|
38642
|
+
cssClass: "cellCenteredVertically"
|
|
38643
|
+
}, columnProps, {
|
|
38644
|
+
cellRender: function cellRender(_ref) {
|
|
38645
|
+
var value = _ref.value;
|
|
38646
|
+
return getTranslatedValue(value, props.dataTranslations);
|
|
38647
|
+
}
|
|
38648
|
+
}));
|
|
38649
|
+
} else if (columnProps.isCheckboxColumn) {
|
|
38650
|
+
return React__default.createElement(Gantt.Column, Object.assign({
|
|
38651
|
+
cssClass: "cellCenteredVertically"
|
|
38652
|
+
}, columnProps, {
|
|
38653
|
+
cellRender: function cellRender(_ref2) {
|
|
38654
|
+
var value = _ref2.value;
|
|
38655
|
+
return getTranslatedValue(value, props.dataTranslations);
|
|
38656
|
+
}
|
|
38657
|
+
}));
|
|
38658
|
+
} else {
|
|
38659
|
+
return React__default.createElement(Gantt.Column, Object.assign({}, columnProps, {
|
|
38660
|
+
cellRender: function cellRender(_ref3) {
|
|
38661
|
+
var value = _ref3.value;
|
|
38662
|
+
return getTranslatedValue(value, props.dataTranslations);
|
|
38663
|
+
}
|
|
38664
|
+
}));
|
|
38665
|
+
}
|
|
38666
|
+
}), React__default.createElement(Gantt.Tasks, {
|
|
38667
|
+
dataSource: props.customTasks
|
|
38668
|
+
}), props.children);
|
|
38669
|
+
};
|
|
38585
38670
|
|
|
38586
|
-
var
|
|
38671
|
+
var OdsTimelineTableDateFilter = function OdsTimelineTableDateFilter(props) {
|
|
38587
38672
|
var defaultStartDate = props.defaultStartDate,
|
|
38588
38673
|
defaultEndDate = props.defaultEndDate,
|
|
38589
38674
|
backText = props.backText,
|
|
@@ -38659,6 +38744,7 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
38659
38744
|
minWidth: 50,
|
|
38660
38745
|
width: 50,
|
|
38661
38746
|
dataField: "isSelected",
|
|
38747
|
+
allowExporting: false,
|
|
38662
38748
|
cellComponent: function cellComponent(props) {
|
|
38663
38749
|
var onChange = function onChange(e) {
|
|
38664
38750
|
selectionEvent && selectionEvent({
|
|
@@ -38679,35 +38765,45 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
38679
38765
|
return selectionColumn;
|
|
38680
38766
|
};
|
|
38681
38767
|
|
|
38682
|
-
var
|
|
38683
|
-
var
|
|
38684
|
-
var
|
|
38685
|
-
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 "])), props.taskWidth),
|
|
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 "])), props.progressPerc, props.progressColor, props.progressColor),
|
|
38688
|
-
taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "])))
|
|
38689
|
-
};
|
|
38690
|
-
});
|
|
38691
|
-
|
|
38692
|
-
var OdsTimelineTableTaskTemplate = function OdsTimelineTableTaskTemplate(_ref) {
|
|
38693
|
-
var taskData = _ref.taskData,
|
|
38694
|
-
taskSize = _ref.taskSize;
|
|
38695
|
-
var _useStyles = useStyles$b({
|
|
38696
|
-
progressColor: taskData.color,
|
|
38697
|
-
progressPerc: taskData.progress,
|
|
38698
|
-
taskWidth: taskSize.width
|
|
38699
|
-
}),
|
|
38768
|
+
var OdsTimelineTableSearchBox = function OdsTimelineTableSearchBox(props) {
|
|
38769
|
+
var _props$value;
|
|
38770
|
+
var _useStyles = useStyles$b(),
|
|
38700
38771
|
timelineTableStyles = _useStyles.styles;
|
|
38701
|
-
|
|
38702
|
-
|
|
38703
|
-
|
|
38704
|
-
|
|
38705
|
-
|
|
38706
|
-
|
|
38772
|
+
var _useState = React.useState(true),
|
|
38773
|
+
initialLoad = _useState[0],
|
|
38774
|
+
setInitialLoad = _useState[1];
|
|
38775
|
+
var _useState2 = React.useState((_props$value = props.value) != null ? _props$value : ""),
|
|
38776
|
+
searchValue = _useState2[0],
|
|
38777
|
+
setSearchValue = _useState2[1];
|
|
38778
|
+
React.useEffect(function () {
|
|
38779
|
+
var _props$timeoutDuratio;
|
|
38780
|
+
if (initialLoad) {
|
|
38781
|
+
setInitialLoad(false);
|
|
38782
|
+
return function () {};
|
|
38783
|
+
}
|
|
38784
|
+
var timeoutSearch = setTimeout(function () {
|
|
38785
|
+
props.onSearch && props.onSearch(searchValue);
|
|
38786
|
+
}, (_props$timeoutDuratio = props.timeoutDuration) != null ? _props$timeoutDuratio : 2000);
|
|
38787
|
+
return function () {
|
|
38788
|
+
return clearTimeout(timeoutSearch);
|
|
38789
|
+
};
|
|
38790
|
+
}, [searchValue]);
|
|
38791
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(OdsInput, {
|
|
38792
|
+
key: "OdsTimelineTableSearchBox_OdsSearch",
|
|
38793
|
+
value: searchValue,
|
|
38794
|
+
prefix: React__default.createElement("span", {
|
|
38795
|
+
className: "dx-icon-search " + timelineTableStyles.searchBoxIcon
|
|
38796
|
+
}),
|
|
38797
|
+
placeholder: props.placeholder,
|
|
38798
|
+
className: timelineTableStyles.searchBox,
|
|
38799
|
+
onChange: function onChange(e) {
|
|
38800
|
+
return setSearchValue(e.target.value);
|
|
38801
|
+
}
|
|
38707
38802
|
}));
|
|
38708
38803
|
};
|
|
38709
38804
|
|
|
38710
38805
|
var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
38806
|
+
var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7;
|
|
38711
38807
|
var customColumns = props.customColumns,
|
|
38712
38808
|
customTasks = props.customTasks,
|
|
38713
38809
|
customTaskKey = props.customTaskKey,
|
|
@@ -38716,14 +38812,14 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38716
38812
|
startDateRange = props.startDateRange,
|
|
38717
38813
|
endDateRange = props.endDateRange,
|
|
38718
38814
|
multiSelectionEnabled = props.multiSelectionEnabled,
|
|
38719
|
-
toolbarVisible = props.toolbarVisible,
|
|
38720
|
-
showDateFilter = props.showDateFilter,
|
|
38721
38815
|
sorting = props.sorting,
|
|
38722
38816
|
sortingProcess = props.sortingProcess,
|
|
38817
|
+
toolbarSettings = props.toolbarSettings,
|
|
38723
38818
|
onCustomSelectionChanged = props.onCustomSelectionChanged,
|
|
38724
38819
|
onDateRangeChange = props.onDateRangeChange,
|
|
38725
38820
|
onSortingChanged = props.onSortingChanged;
|
|
38726
38821
|
var refGantt = React.useRef(null);
|
|
38822
|
+
var refGanttExportable = React.useRef(null);
|
|
38727
38823
|
var _useState = React.useState(startDateRange != null ? startDateRange : Constants.timelineDefaultStartDate),
|
|
38728
38824
|
startDate = _useState[0],
|
|
38729
38825
|
setStartDate = _useState[1];
|
|
@@ -38736,13 +38832,22 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38736
38832
|
var _useState4 = React.useState([]),
|
|
38737
38833
|
sortedColumns = _useState4[0],
|
|
38738
38834
|
setSortedColumns = _useState4[1];
|
|
38835
|
+
var _useState5 = React.useState(customSelectedKeys),
|
|
38836
|
+
selectedKeys = _useState5[0],
|
|
38837
|
+
setSelectedKeys = _useState5[1];
|
|
38838
|
+
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),
|
|
38839
|
+
searchValue = _useState6[0],
|
|
38840
|
+
setSearchValue = _useState6[1];
|
|
38739
38841
|
var originalSortingMode = sorting.mode === undefined || sorting.mode === "" ? "none" : sorting.mode;
|
|
38740
38842
|
var sortingMode = sortingProcess == "ServerSideSorting" ? "none" : originalSortingMode;
|
|
38741
38843
|
var showSortIndexes = sortingProcess == "ServerSideSorting" ? false : sorting.showSortIndexes;
|
|
38742
38844
|
var sortingActive = sortingProcess == "ServerSideSorting" && originalSortingMode != "none";
|
|
38743
38845
|
React.useEffect(function () {
|
|
38744
|
-
|
|
38745
|
-
}, [customTasks]);
|
|
38846
|
+
prepareTimelineTasks(customTasks, customSelectedKeys);
|
|
38847
|
+
}, [customTasks, customSelectedKeys]);
|
|
38848
|
+
var prepareTimelineTasks = function prepareTimelineTasks(tasks, selectedKeys) {
|
|
38849
|
+
setTimelineTasks(mapSelectedKeys(tasks.map(mapCustomTask), customTaskKey, multiSelectionEnabled ? selectedKeys : selectedKeys.length > 0 ? selectedKeys[0] : []));
|
|
38850
|
+
};
|
|
38746
38851
|
var getSelectedRowsData = function getSelectedRowsData() {
|
|
38747
38852
|
return timelineTasks.filter(function (item) {
|
|
38748
38853
|
return item.isSelected == true;
|
|
@@ -38760,14 +38865,19 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38760
38865
|
return sortedColumns;
|
|
38761
38866
|
};
|
|
38762
38867
|
var updateSelectionData = function updateSelectionData(keyValue, isSelected) {
|
|
38763
|
-
|
|
38764
|
-
|
|
38765
|
-
|
|
38766
|
-
|
|
38767
|
-
}
|
|
38768
|
-
return item;
|
|
38868
|
+
var newSelectedKeys = [];
|
|
38869
|
+
if (multiSelectionEnabled) {
|
|
38870
|
+
newSelectedKeys = selectedKeys.filter(function (item) {
|
|
38871
|
+
return item != keyValue;
|
|
38769
38872
|
});
|
|
38770
|
-
|
|
38873
|
+
if (isSelected) {
|
|
38874
|
+
newSelectedKeys = [].concat(newSelectedKeys, [keyValue]);
|
|
38875
|
+
}
|
|
38876
|
+
} else if (isSelected) {
|
|
38877
|
+
newSelectedKeys = [keyValue];
|
|
38878
|
+
}
|
|
38879
|
+
setSelectedKeys(newSelectedKeys);
|
|
38880
|
+
prepareTimelineTasks(timelineTasks, newSelectedKeys);
|
|
38771
38881
|
};
|
|
38772
38882
|
var minimalHeaderCellComponent = function minimalHeaderCellComponent(data) {
|
|
38773
38883
|
return customHeaderCellComponent(data, true);
|
|
@@ -38870,9 +38980,65 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38870
38980
|
});
|
|
38871
38981
|
};
|
|
38872
38982
|
var onTimelineCheckboxSelectionChange = function onTimelineCheckboxSelectionChange(e) {
|
|
38873
|
-
updateSelectionData(e.data[props.customTaskKey], e.isSelected);
|
|
38983
|
+
updateSelectionData(e.data[props.customTaskKey].toString(), e.isSelected);
|
|
38874
38984
|
onCustomSelectionChanged && onCustomSelectionChanged(e);
|
|
38875
38985
|
};
|
|
38986
|
+
var searchBoxComponent = function searchBoxComponent(props) {
|
|
38987
|
+
var _toolbarSettings$sear4;
|
|
38988
|
+
var filterInAllFields = function filterInAllFields(item, searchValue) {
|
|
38989
|
+
var fields = Object.keys(item);
|
|
38990
|
+
for (var index = 0; index < fields.length; index++) {
|
|
38991
|
+
if (String(item[fields[index]]).toLocaleLowerCase().includes(searchValue.toLocaleLowerCase())) {
|
|
38992
|
+
return true;
|
|
38993
|
+
}
|
|
38994
|
+
}
|
|
38995
|
+
return false;
|
|
38996
|
+
};
|
|
38997
|
+
var searchTask = function searchTask(searchValue) {
|
|
38998
|
+
if (searchValue === undefined || searchValue === "") {
|
|
38999
|
+
prepareTimelineTasks(customTasks, selectedKeys);
|
|
39000
|
+
return;
|
|
39001
|
+
}
|
|
39002
|
+
var filteredTasks = customTasks.filter(function (item) {
|
|
39003
|
+
return filterInAllFields(item, searchValue);
|
|
39004
|
+
});
|
|
39005
|
+
prepareTimelineTasks(filteredTasks, selectedKeys);
|
|
39006
|
+
};
|
|
39007
|
+
var onSearchBoxSearch = function onSearchBoxSearch(searchValue) {
|
|
39008
|
+
var _toolbarSettings$sear2, _toolbarSettings$sear3;
|
|
39009
|
+
setSearchValue(searchValue);
|
|
39010
|
+
searchTask(searchValue);
|
|
39011
|
+
(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));
|
|
39012
|
+
};
|
|
39013
|
+
return OdsTimelineTableSearchBox(_extends({}, props, {
|
|
39014
|
+
value: searchValue,
|
|
39015
|
+
placeholder: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$sear4 = toolbarSettings.search) === null || _toolbarSettings$sear4 === void 0 ? void 0 : _toolbarSettings$sear4.placeholder,
|
|
39016
|
+
onSearch: onSearchBoxSearch
|
|
39017
|
+
}));
|
|
39018
|
+
};
|
|
39019
|
+
var exportToPdf = function exportToPdf() {
|
|
39020
|
+
var _toolbarSettings$expo, _toolbarSettings$expo2, _toolbarSettings$expo3;
|
|
39021
|
+
var exportableTimelineTable = refGanttExportable.current.instance;
|
|
39022
|
+
pdf_exporter.exportGantt({
|
|
39023
|
+
component: exportableTimelineTable,
|
|
39024
|
+
createDocumentMethod: function createDocumentMethod(args) {
|
|
39025
|
+
return new jsPDF.jsPDF(args);
|
|
39026
|
+
},
|
|
39027
|
+
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",
|
|
39028
|
+
landscape: true,
|
|
39029
|
+
exportMode: "all",
|
|
39030
|
+
dateRange: "all"
|
|
39031
|
+
}).then(function (doc) {
|
|
39032
|
+
return doc.save(getExportFileName());
|
|
39033
|
+
});
|
|
39034
|
+
};
|
|
39035
|
+
var getExportFileName = function getExportFileName() {
|
|
39036
|
+
var _toolbarSettings$expo4, _toolbarSettings$expo5;
|
|
39037
|
+
var now = new Date();
|
|
39038
|
+
var datePart = ('0' + now.getDate()).slice(-2) + "-" + ('0' + (now.getMonth() + 1)).slice(-2) + "-" + now.getFullYear();
|
|
39039
|
+
var timePart = ('0' + now.getHours()).slice(-2) + ":" + ('0' + now.getMinutes()).slice(-2);
|
|
39040
|
+
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";
|
|
39041
|
+
};
|
|
38876
39042
|
var timelineColumns = multiSelectionEnabled ? [OdsTimelineSelectionColumn(onTimelineCheckboxSelectionChange)].concat(customColumns) : customColumns;
|
|
38877
39043
|
React.useImperativeHandle(ref, function () {
|
|
38878
39044
|
return {
|
|
@@ -38881,7 +39047,7 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38881
39047
|
customClearSorting: customClearSorting
|
|
38882
39048
|
};
|
|
38883
39049
|
});
|
|
38884
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(
|
|
39050
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Gantt.Gantt, Object.assign({
|
|
38885
39051
|
width: "100%",
|
|
38886
39052
|
height: 500,
|
|
38887
39053
|
startDateRange: startDate,
|
|
@@ -38895,26 +39061,48 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38895
39061
|
mode: sortingMode,
|
|
38896
39062
|
showSortIndexes: false
|
|
38897
39063
|
}
|
|
38898
|
-
}),
|
|
39064
|
+
}), toolbarSettings !== null && toolbarSettings !== void 0 && toolbarSettings.visible ? React__default.createElement(Gantt.Toolbar, null, React__default.createElement(Gantt.Item, {
|
|
38899
39065
|
key: "OdsTimelineTable_ToolbarItem_DateFilter",
|
|
39066
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.dateFilterVisible,
|
|
39067
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
38900
39068
|
component: function component(props) {
|
|
38901
|
-
return
|
|
39069
|
+
return OdsTimelineTableDateFilter(_extends({}, props, {
|
|
38902
39070
|
defaultStartDate: startDate,
|
|
38903
39071
|
defaultEndDate: endDate,
|
|
38904
39072
|
onFilterRangeChange: onTimelineDateRangeChange
|
|
38905
39073
|
}));
|
|
38906
39074
|
}
|
|
38907
|
-
})
|
|
39075
|
+
}), React__default.createElement(Gantt.Item, {
|
|
39076
|
+
key: "OdsTimelineTable_ToolbarItem_Search",
|
|
39077
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$sear5 = toolbarSettings.search) === null || _toolbarSettings$sear5 === void 0 ? void 0 : _toolbarSettings$sear5.visible,
|
|
39078
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
39079
|
+
component: searchBoxComponent
|
|
39080
|
+
}), (toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.zoomVisible) && React__default.createElement(Gantt.Item, {
|
|
38908
39081
|
key: "OdsTimelineTable_ToolbarItem_ZoomIn",
|
|
38909
|
-
|
|
38910
|
-
|
|
39082
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.zoomVisible,
|
|
39083
|
+
name: "zoomIn",
|
|
39084
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location
|
|
39085
|
+
}), (toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.zoomVisible) && React__default.createElement(Gantt.Item, {
|
|
38911
39086
|
key: "OdsTimelineTable_ToolbarItem_ZoomOut",
|
|
38912
|
-
|
|
38913
|
-
|
|
39087
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.zoomVisible,
|
|
39088
|
+
name: "zoomOut",
|
|
39089
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location
|
|
39090
|
+
}), React__default.createElement(Gantt.Item, {
|
|
39091
|
+
key: "OdsTimelineTable_ToolbarItem_Export",
|
|
39092
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$expo6 = toolbarSettings["export"]) === null || _toolbarSettings$expo6 === void 0 ? void 0 : _toolbarSettings$expo6.visible,
|
|
39093
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
39094
|
+
widget: "dxButton",
|
|
39095
|
+
options: {
|
|
39096
|
+
icon: "export",
|
|
39097
|
+
hint: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$expo7 = toolbarSettings["export"]) === null || _toolbarSettings$expo7 === void 0 ? void 0 : _toolbarSettings$expo7.title,
|
|
39098
|
+
stylingMode: "text",
|
|
39099
|
+
onClick: exportToPdf
|
|
39100
|
+
}
|
|
39101
|
+
})) : "", React__default.createElement(Gantt.ContextMenu, {
|
|
38914
39102
|
enabled: false
|
|
38915
39103
|
}), timelineColumns === null || timelineColumns === void 0 ? void 0 : timelineColumns.map(function (columnProps) {
|
|
38916
39104
|
if (columnProps.isStatusColumn) {
|
|
38917
|
-
return React__default.createElement(
|
|
39105
|
+
return React__default.createElement(Gantt.Column, Object.assign({
|
|
38918
39106
|
width: 50,
|
|
38919
39107
|
minWidth: 50,
|
|
38920
39108
|
cssClass: "cellCenteredVertically",
|
|
@@ -38922,7 +39110,7 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38922
39110
|
headerCellComponent: minimalHeaderCellComponent
|
|
38923
39111
|
}, columnProps));
|
|
38924
39112
|
} else if (columnProps.isCheckboxColumn) {
|
|
38925
|
-
return React__default.createElement(
|
|
39113
|
+
return React__default.createElement(Gantt.Column, Object.assign({
|
|
38926
39114
|
width: 50,
|
|
38927
39115
|
minWidth: 50,
|
|
38928
39116
|
cssClass: "cellCenteredVertically",
|
|
@@ -38931,18 +39119,23 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
38931
39119
|
allowSorting: false
|
|
38932
39120
|
}, columnProps));
|
|
38933
39121
|
} else {
|
|
38934
|
-
return React__default.createElement(
|
|
39122
|
+
return React__default.createElement(Gantt.Column, Object.assign({
|
|
38935
39123
|
headerCellComponent: function headerCellComponent(props) {
|
|
38936
39124
|
return customHeaderCellComponent(props);
|
|
38937
39125
|
}
|
|
38938
39126
|
}, columnProps));
|
|
38939
39127
|
}
|
|
38940
|
-
}), React__default.createElement(
|
|
39128
|
+
}), React__default.createElement(Gantt.Tasks, {
|
|
38941
39129
|
dataSource: timelineTasks
|
|
38942
|
-
}), children, React__default.createElement(
|
|
39130
|
+
}), children, React__default.createElement(Gantt.Sorting, {
|
|
38943
39131
|
mode: sortingMode,
|
|
38944
39132
|
showSortIndexes: showSortIndexes
|
|
38945
|
-
}))
|
|
39133
|
+
})), getExportableTimelineTable(_extends({}, props, {
|
|
39134
|
+
startDateRange: startDate,
|
|
39135
|
+
endDateRange: endDate,
|
|
39136
|
+
customColumns: timelineColumns,
|
|
39137
|
+
customTasks: timelineTasks
|
|
39138
|
+
}), refGanttExportable));
|
|
38946
39139
|
});
|
|
38947
39140
|
|
|
38948
39141
|
/**
|
|
@@ -40012,7 +40205,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
40012
40205
|
});
|
|
40013
40206
|
});
|
|
40014
40207
|
} else {
|
|
40015
|
-
var doc = new
|
|
40208
|
+
var doc = new jsPDF__default();
|
|
40016
40209
|
pdf_exporter.exportDataGrid({
|
|
40017
40210
|
jsPDFDocument: doc,
|
|
40018
40211
|
component: e.component,
|