ods-component-lib 1.18.241 → 1.18.243
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/OdsMergeCellDataGrid/OdsMergeCellDataGrid.Functions.d.ts +2 -2
- package/dist/components/devextreme/OdsMergeCellDataGrid/OdsMergeCellDataGrid.Types.d.ts +1 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Style.d.ts +6 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTable.Types.d.ts +18 -0
- package/dist/components/devextreme/OdsTimelineTable/OdsTimelineTableColumnChooser.d.ts +4 -0
- package/dist/index.js +238 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +240 -24
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/commonFunctions.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
|
-
import { IOdsDataGridProps } from "./OdsMergeCellDataGrid.Types";
|
|
2
|
+
import { IOdsDataGridProps, SummaryTypes } from "./OdsMergeCellDataGrid.Types";
|
|
3
3
|
export declare const getRequestHeaders: (props: any) => Headers;
|
|
4
4
|
export declare const concatFilteredLabel: (result: string, totalloaded: number, filteredRowCount: number, filterApplied: boolean, props: any) => string;
|
|
5
5
|
export declare const showSummaryItems: (props: IOdsDataGridProps) => boolean;
|
|
6
6
|
export declare const getSummaryItems: (props: IOdsDataGridProps, columns: any[], grid: any, isMultiLevelColumn?: boolean) => ReactElement[];
|
|
7
|
-
export declare const getSummaryItem: (col: any, visibleIndex: number, summaryType:
|
|
7
|
+
export declare const getSummaryItem: (col: any, visibleIndex: number, summaryType: SummaryTypes, isMultiLevelColumn: boolean, label?: string) => ReactElement;
|
|
8
8
|
export declare const getMultiLevelColumns: (col: any) => any;
|
|
@@ -3,6 +3,7 @@ import { ButtonType } from "antd/es/button/buttonHelpers";
|
|
|
3
3
|
import { IButtonProps, IDataGridOptions, IEditingProps, ISelectionProps, ISummaryProps } from "devextreme-react/data-grid";
|
|
4
4
|
import { ITooltipType } from "../../../utils/customTypes";
|
|
5
5
|
import { IColumnOptions, IMasterDetailDatas, IMasterDetailFeatures } from "../OdsMasterDetailDataGrid/types";
|
|
6
|
+
export declare type SummaryTypes = "avg" | "count" | "custom" | "max" | "min" | "sum";
|
|
6
7
|
interface IExportProps {
|
|
7
8
|
enabled: boolean;
|
|
8
9
|
allowExportSelectedData?: boolean;
|
|
@@ -8,4 +8,10 @@ export declare const useStyles: (props?: {
|
|
|
8
8
|
taskBarTitle: import("antd-style").SerializedStyles;
|
|
9
9
|
searchBoxIcon: import("antd-style").SerializedStyles;
|
|
10
10
|
searchBox: import("antd-style").SerializedStyles;
|
|
11
|
+
columnChooserPopup: import("antd-style").SerializedStyles;
|
|
12
|
+
columnChooserHeader: import("antd-style").SerializedStyles;
|
|
13
|
+
columnChooserCloseButton: import("antd-style").SerializedStyles;
|
|
14
|
+
columnChooserDivider: import("antd-style").SerializedStyles;
|
|
15
|
+
columnChooserCheckbox: import("antd-style").SerializedStyles;
|
|
16
|
+
columnChooserSearchbox: import("antd-style").SerializedStyles;
|
|
11
17
|
}>;
|
|
@@ -98,6 +98,7 @@ export interface IButtonGroup extends Omit<IButtonProps, "icon"> {
|
|
|
98
98
|
onclick?: React.MouseEventHandler<HTMLElement>;
|
|
99
99
|
}
|
|
100
100
|
export interface IOdsTimelineTableColumnProps extends IColumnProps {
|
|
101
|
+
name: string;
|
|
101
102
|
isMinimized?: boolean;
|
|
102
103
|
isStatusColumn?: boolean;
|
|
103
104
|
isCheckboxColumn?: boolean;
|
|
@@ -131,6 +132,12 @@ export interface IOdsTimelineTableToolbarSettings {
|
|
|
131
132
|
fileName?: string;
|
|
132
133
|
documentFormat?: ExportDocumentType;
|
|
133
134
|
};
|
|
135
|
+
columnChooser?: {
|
|
136
|
+
visible?: boolean;
|
|
137
|
+
title?: string;
|
|
138
|
+
selectAllText: string;
|
|
139
|
+
onSelection?(items: string[], isSelected: boolean): void;
|
|
140
|
+
};
|
|
134
141
|
dateFilterVisible?: boolean;
|
|
135
142
|
zoomVisible?: boolean;
|
|
136
143
|
}
|
|
@@ -151,3 +158,14 @@ export interface ITranslationValue {
|
|
|
151
158
|
originalValue: any;
|
|
152
159
|
translatedValue: string;
|
|
153
160
|
}
|
|
161
|
+
export interface IOdsTimelineTableColumnChooserProps {
|
|
162
|
+
title: string;
|
|
163
|
+
selectAllText: string;
|
|
164
|
+
items: IOdsTimelineTableColumnChooserItemProps[];
|
|
165
|
+
onSelection?(items: string[], isSelected: boolean): void;
|
|
166
|
+
}
|
|
167
|
+
export interface IOdsTimelineTableColumnChooserItemProps {
|
|
168
|
+
columnName: string;
|
|
169
|
+
columnCaption: string;
|
|
170
|
+
visible: boolean;
|
|
171
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,7 @@ var FileSaver = require('file-saver');
|
|
|
49
49
|
require('devextreme/dist/css/dx.light.css');
|
|
50
50
|
var gantt = require('devextreme-react/gantt');
|
|
51
51
|
require('jspdf-autotable');
|
|
52
|
+
var button = require('devextreme-react/button');
|
|
52
53
|
|
|
53
54
|
function _toPrimitive(t, r) {
|
|
54
55
|
if ("object" != typeof t || !t) return t;
|
|
@@ -37966,7 +37967,7 @@ var OdsMergeCellDataGridHelper = /*#__PURE__*/function () {
|
|
|
37966
37967
|
});
|
|
37967
37968
|
} else {
|
|
37968
37969
|
mergedCells.filter(function (x) {
|
|
37969
|
-
return x.FieldName == dataFieldCurrent && x.Type != "OutOfScope";
|
|
37970
|
+
return x.FieldName == dataFieldCurrent && x.Type != "OutOfScope" && x.Type != "Dirty";
|
|
37970
37971
|
}).map(function (item) {
|
|
37971
37972
|
mergedCells.filter(function (x) {
|
|
37972
37973
|
return x.FieldName == dataFieldNext && x.Type != "New" && x.Type != "Placed";
|
|
@@ -38514,19 +38515,6 @@ var OdsMergeCellDataGrid = function OdsMergeCellDataGrid(props) {
|
|
|
38514
38515
|
})));
|
|
38515
38516
|
};
|
|
38516
38517
|
|
|
38517
|
-
var currentYear = new Date().getFullYear();
|
|
38518
|
-
var Constants = {
|
|
38519
|
-
timelineDefaultStartDate: new Date(currentYear, 0, 1),
|
|
38520
|
-
timelineDefaultEndDate: new Date(currentYear + 1, 0, 1)
|
|
38521
|
-
};
|
|
38522
|
-
var actionColumnProps = {
|
|
38523
|
-
dataField: "Actions",
|
|
38524
|
-
allowExporting: false,
|
|
38525
|
-
allowFiltering: false,
|
|
38526
|
-
allowSorting: false,
|
|
38527
|
-
dataType: "object"
|
|
38528
|
-
};
|
|
38529
|
-
|
|
38530
38518
|
var lodash = createCommonjsModule(function (module, exports) {
|
|
38531
38519
|
(function() {
|
|
38532
38520
|
|
|
@@ -55717,6 +55705,23 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
55717
55705
|
}.call(commonjsGlobal));
|
|
55718
55706
|
});
|
|
55719
55707
|
|
|
55708
|
+
var uniqueRecords = function uniqueRecords(value, index, array) {
|
|
55709
|
+
return array.indexOf(value) === index;
|
|
55710
|
+
};
|
|
55711
|
+
|
|
55712
|
+
var currentYear = new Date().getFullYear();
|
|
55713
|
+
var Constants = {
|
|
55714
|
+
timelineDefaultStartDate: new Date(currentYear, 0, 1),
|
|
55715
|
+
timelineDefaultEndDate: new Date(currentYear + 1, 0, 1)
|
|
55716
|
+
};
|
|
55717
|
+
var actionColumnProps = {
|
|
55718
|
+
dataField: "Actions",
|
|
55719
|
+
allowExporting: false,
|
|
55720
|
+
allowFiltering: false,
|
|
55721
|
+
allowSorting: false,
|
|
55722
|
+
dataType: "object"
|
|
55723
|
+
};
|
|
55724
|
+
|
|
55720
55725
|
var checkboxCellComponent = function checkboxCellComponent(props) {
|
|
55721
55726
|
var isChecked = props.data.value;
|
|
55722
55727
|
var onChange = function onChange(e) {
|
|
@@ -55949,6 +55954,7 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
55949
55954
|
minWidth: 50,
|
|
55950
55955
|
width: 50,
|
|
55951
55956
|
dataField: "isSelected",
|
|
55957
|
+
name: "selection",
|
|
55952
55958
|
allowExporting: false,
|
|
55953
55959
|
cellComponent: function cellComponent(props) {
|
|
55954
55960
|
var onChange = function onChange(e) {
|
|
@@ -55970,19 +55976,26 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
55970
55976
|
return selectionColumn;
|
|
55971
55977
|
};
|
|
55972
55978
|
|
|
55973
|
-
var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4;
|
|
55979
|
+
var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4, _templateObject6$3, _templateObject7$3, _templateObject8$3, _templateObject9$3, _templateObject10$3, _templateObject11$3;
|
|
55974
55980
|
var useStyles$b = antdStyle.createStyles(function (_ref, props) {
|
|
55975
55981
|
var _props$taskWidth, _props$progressPerc, _props$progressColor;
|
|
55976
55982
|
var css = _ref.css;
|
|
55977
55983
|
var _taskWidth = (_props$taskWidth = props === null || props === void 0 ? void 0 : props.taskWidth) != null ? _props$taskWidth : 0;
|
|
55978
55984
|
var _progressPerc = (_props$progressPerc = props === null || props === void 0 ? void 0 : props.progressPerc) != null ? _props$progressPerc : 100;
|
|
55979
55985
|
var _progressColor = (_props$progressColor = props === null || props === void 0 ? void 0 : props.progressColor) != null ? _props$progressColor : "unset";
|
|
55986
|
+
var searchBox = "\n padding-left: 5px;\n ";
|
|
55980
55987
|
return {
|
|
55981
55988
|
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),
|
|
55982
55989
|
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),
|
|
55983
55990
|
taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "]))),
|
|
55984
55991
|
searchBoxIcon: css(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n color: #999;\n font-size: 17px;\n line-height: 18px;\n "]))),
|
|
55985
|
-
searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n
|
|
55992
|
+
searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n ", "\n "])), searchBox),
|
|
55993
|
+
columnChooserPopup: css(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n min-width: 250px;\n "]))),
|
|
55994
|
+
columnChooserHeader: css(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n "]))),
|
|
55995
|
+
columnChooserCloseButton: css(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n flex: 1;\n text-align: end;\n "]))),
|
|
55996
|
+
columnChooserDivider: css(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n margin-top: 10px;\n margin-bottom: 10px;\n "]))),
|
|
55997
|
+
columnChooserCheckbox: css(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n margin-top: 4px;\n margin-bottom: 4px;\n "]))),
|
|
55998
|
+
columnChooserSearchbox: css(_templateObject11$3 || (_templateObject11$3 = _taggedTemplateLiteralLoose(["\n ", "\n margin-top: 4px;\n margin-bottom: 4px;\n "])), searchBox)
|
|
55986
55999
|
};
|
|
55987
56000
|
});
|
|
55988
56001
|
|
|
@@ -56041,8 +56054,154 @@ var OdsTimelineTableSearchBox = function OdsTimelineTableSearchBox(props) {
|
|
|
56041
56054
|
}));
|
|
56042
56055
|
};
|
|
56043
56056
|
|
|
56057
|
+
var OdsTimelineTableColumnChooser = function OdsTimelineTableColumnChooser(props) {
|
|
56058
|
+
var _useStyles = useStyles$b(),
|
|
56059
|
+
timelineTableStyles = _useStyles.styles;
|
|
56060
|
+
var initialSelectedColumns = props.items.filter(function (item) {
|
|
56061
|
+
return item.visible !== false;
|
|
56062
|
+
});
|
|
56063
|
+
var _useState = React.useState(false),
|
|
56064
|
+
open = _useState[0],
|
|
56065
|
+
setOpen = _useState[1];
|
|
56066
|
+
var _useState2 = React.useState(props.items),
|
|
56067
|
+
columns = _useState2[0],
|
|
56068
|
+
setColumns = _useState2[1];
|
|
56069
|
+
var _useState3 = React.useState(initialSelectedColumns),
|
|
56070
|
+
selectedColumns = _useState3[0],
|
|
56071
|
+
setSelectedColumns = _useState3[1];
|
|
56072
|
+
var filterColumns = function filterColumns(searchValue) {
|
|
56073
|
+
var _columns = [];
|
|
56074
|
+
if (searchValue !== undefined && searchValue !== null && searchValue !== "") {
|
|
56075
|
+
_columns = columns.filter(function (item) {
|
|
56076
|
+
return item.columnCaption.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase());
|
|
56077
|
+
});
|
|
56078
|
+
} else {
|
|
56079
|
+
_columns = props.items;
|
|
56080
|
+
}
|
|
56081
|
+
setColumns(_columns);
|
|
56082
|
+
updateSelectAll({
|
|
56083
|
+
columnList: _columns
|
|
56084
|
+
});
|
|
56085
|
+
};
|
|
56086
|
+
var selectAllChanged = function selectAllChanged(isSelected) {
|
|
56087
|
+
setSelectAll(isSelected);
|
|
56088
|
+
var newSelectedColumns = [];
|
|
56089
|
+
if (isSelected) {
|
|
56090
|
+
newSelectedColumns = [].concat(selectedColumns, columns).filter(uniqueRecords);
|
|
56091
|
+
} else {
|
|
56092
|
+
newSelectedColumns = selectedColumns.filter(function (item) {
|
|
56093
|
+
return !columns.some(function (x) {
|
|
56094
|
+
return x.columnName === item.columnName;
|
|
56095
|
+
});
|
|
56096
|
+
});
|
|
56097
|
+
}
|
|
56098
|
+
setSelectedColumns(newSelectedColumns);
|
|
56099
|
+
props.onSelection && props.onSelection(columns.map(function (item) {
|
|
56100
|
+
return item.columnName;
|
|
56101
|
+
}), isSelected);
|
|
56102
|
+
};
|
|
56103
|
+
var selectChanged = function selectChanged(isSelected, column) {
|
|
56104
|
+
var newSelectedColumns = [];
|
|
56105
|
+
if (isSelected) {
|
|
56106
|
+
newSelectedColumns = [].concat(selectedColumns, [column]).filter(uniqueRecords);
|
|
56107
|
+
} else {
|
|
56108
|
+
newSelectedColumns = selectedColumns.filter(function (item) {
|
|
56109
|
+
return item.columnName !== column.columnName;
|
|
56110
|
+
});
|
|
56111
|
+
}
|
|
56112
|
+
setSelectedColumns(newSelectedColumns);
|
|
56113
|
+
updateSelectAll({
|
|
56114
|
+
selectedColumnList: newSelectedColumns
|
|
56115
|
+
});
|
|
56116
|
+
props.onSelection && props.onSelection([column.columnName], isSelected);
|
|
56117
|
+
};
|
|
56118
|
+
var updateSelectAll = function updateSelectAll(params) {
|
|
56119
|
+
var columnList = params.columnList,
|
|
56120
|
+
selectedColumnList = params.selectedColumnList;
|
|
56121
|
+
setSelectAll(isAllSelected({
|
|
56122
|
+
columnList: columnList,
|
|
56123
|
+
selectedColumnList: selectedColumnList
|
|
56124
|
+
}));
|
|
56125
|
+
};
|
|
56126
|
+
var isSelected = function isSelected(columnName) {
|
|
56127
|
+
return selectedColumns.some(function (item) {
|
|
56128
|
+
return item.columnName === columnName;
|
|
56129
|
+
});
|
|
56130
|
+
};
|
|
56131
|
+
var isAllSelected = function isAllSelected(params) {
|
|
56132
|
+
var _params$columnList, _params$selectedColum;
|
|
56133
|
+
var _columns = (_params$columnList = params === null || params === void 0 ? void 0 : params.columnList) != null ? _params$columnList : columns;
|
|
56134
|
+
var _selectedColumns = (_params$selectedColum = params === null || params === void 0 ? void 0 : params.selectedColumnList) != null ? _params$selectedColum : selectedColumns;
|
|
56135
|
+
var _result = true;
|
|
56136
|
+
lodash.forEach(_columns, function (_column) {
|
|
56137
|
+
if (!_selectedColumns.some(function (_selectedColumn) {
|
|
56138
|
+
return _selectedColumn.columnName === _column.columnName;
|
|
56139
|
+
})) {
|
|
56140
|
+
_result = false;
|
|
56141
|
+
return;
|
|
56142
|
+
}
|
|
56143
|
+
});
|
|
56144
|
+
return _result;
|
|
56145
|
+
};
|
|
56146
|
+
var _useState4 = React.useState(isAllSelected({
|
|
56147
|
+
columnList: props.items,
|
|
56148
|
+
selectedColumnList: initialSelectedColumns
|
|
56149
|
+
})),
|
|
56150
|
+
selectAll = _useState4[0],
|
|
56151
|
+
setSelectAll = _useState4[1];
|
|
56152
|
+
var content = React__default.createElement("div", {
|
|
56153
|
+
className: timelineTableStyles.columnChooserPopup
|
|
56154
|
+
}, React__default.createElement("div", {
|
|
56155
|
+
className: timelineTableStyles.columnChooserHeader
|
|
56156
|
+
}, React__default.createElement("span", null, props.title), React__default.createElement("span", {
|
|
56157
|
+
className: timelineTableStyles.columnChooserCloseButton
|
|
56158
|
+
}, React__default.createElement(outline.CrossIcon, {
|
|
56159
|
+
style: {
|
|
56160
|
+
cursor: "pointer"
|
|
56161
|
+
},
|
|
56162
|
+
onClick: function onClick() {
|
|
56163
|
+
return setOpen(false);
|
|
56164
|
+
}
|
|
56165
|
+
}))), React__default.createElement(OdsInput, {
|
|
56166
|
+
key: "OdsTimelineTableColumnChooser_OdsSearch",
|
|
56167
|
+
prefix: React__default.createElement("span", {
|
|
56168
|
+
className: "dx-icon-search " + timelineTableStyles.searchBoxIcon
|
|
56169
|
+
}),
|
|
56170
|
+
className: timelineTableStyles.columnChooserSearchbox,
|
|
56171
|
+
onChange: function onChange(e) {
|
|
56172
|
+
return filterColumns(e.target.value);
|
|
56173
|
+
}
|
|
56174
|
+
}), React__default.createElement(OdsCheckbox, {
|
|
56175
|
+
className: timelineTableStyles.columnChooserCheckbox,
|
|
56176
|
+
checked: selectAll,
|
|
56177
|
+
onChange: function onChange(e) {
|
|
56178
|
+
return selectAllChanged(e.target.checked);
|
|
56179
|
+
}
|
|
56180
|
+
}, props.selectAllText), React__default.createElement(antd.Divider, {
|
|
56181
|
+
className: timelineTableStyles.columnChooserDivider
|
|
56182
|
+
}), columns.map(function (_column, index) {
|
|
56183
|
+
return React__default.createElement("div", null, React__default.createElement(OdsCheckbox, {
|
|
56184
|
+
key: "OdsTimelineTableColumnChooser_OdsCheckbox_" + index,
|
|
56185
|
+
className: timelineTableStyles.columnChooserCheckbox,
|
|
56186
|
+
checked: isSelected(_column.columnName),
|
|
56187
|
+
onChange: function onChange(e) {
|
|
56188
|
+
return selectChanged(e.target.checked, _column);
|
|
56189
|
+
}
|
|
56190
|
+
}, _column.columnCaption));
|
|
56191
|
+
}));
|
|
56192
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(antd.Popover, {
|
|
56193
|
+
open: open,
|
|
56194
|
+
content: content
|
|
56195
|
+
}, React__default.createElement(button.Button, {
|
|
56196
|
+
icon: "columnchooser",
|
|
56197
|
+
onClick: function onClick() {
|
|
56198
|
+
return setOpen(true);
|
|
56199
|
+
}
|
|
56200
|
+
})));
|
|
56201
|
+
};
|
|
56202
|
+
|
|
56044
56203
|
var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
56045
|
-
var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7;
|
|
56204
|
+
var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7, _toolbarSettings$colu;
|
|
56046
56205
|
var customColumns = props.customColumns,
|
|
56047
56206
|
customTasks = props.customTasks,
|
|
56048
56207
|
customTaskKey = props.customTaskKey,
|
|
@@ -56084,6 +56243,15 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
56084
56243
|
}),
|
|
56085
56244
|
sortingChangeEventProps = _useState7[0],
|
|
56086
56245
|
setSortingChangeEventProps = _useState7[1];
|
|
56246
|
+
var _useState8 = React.useState(customColumns),
|
|
56247
|
+
columnList = _useState8[0],
|
|
56248
|
+
setColumnList = _useState8[1];
|
|
56249
|
+
var _useState9 = React.useState(customColumns.filter(function (item) {
|
|
56250
|
+
return item.visible === false;
|
|
56251
|
+
}).map(function (item) {
|
|
56252
|
+
return item.name;
|
|
56253
|
+
})),
|
|
56254
|
+
unvisibleColumnNames = _useState9[0];
|
|
56087
56255
|
var originalSortingMode = sorting.mode === undefined || sorting.mode === "" ? "none" : sorting.mode;
|
|
56088
56256
|
var sortingMode = sortingProcess == "ServerSideSorting" ? "none" : originalSortingMode;
|
|
56089
56257
|
var showSortIndexes = sortingProcess == "ServerSideSorting" ? false : sorting.showSortIndexes;
|
|
@@ -56164,7 +56332,7 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
56164
56332
|
updateSelectionData(e.data[props.customTaskKey].toString(), e.isSelected);
|
|
56165
56333
|
onCustomSelectionChanged && onCustomSelectionChanged(e);
|
|
56166
56334
|
};
|
|
56167
|
-
var timelineColumns = multiSelectionEnabled ? [OdsTimelineSelectionColumn(onTimelineCheckboxSelectionChange)].concat(
|
|
56335
|
+
var timelineColumns = multiSelectionEnabled ? [OdsTimelineSelectionColumn(onTimelineCheckboxSelectionChange)].concat(columnList) : columnList;
|
|
56168
56336
|
var minimalHeaderCellComponent = function minimalHeaderCellComponent(data) {
|
|
56169
56337
|
return customHeaderCellComponent(data, true);
|
|
56170
56338
|
};
|
|
@@ -56269,6 +56437,33 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
56269
56437
|
endDate: e.endDate
|
|
56270
56438
|
});
|
|
56271
56439
|
};
|
|
56440
|
+
var onColumnChooserSelection = function onColumnChooserSelection(items, isSelected) {
|
|
56441
|
+
var _props$toolbarSetting, _props$toolbarSetting2, _props$toolbarSetting3, _props$toolbarSetting4;
|
|
56442
|
+
var _visibleColumns = columnList.filter(function (item) {
|
|
56443
|
+
return item.visible !== false;
|
|
56444
|
+
});
|
|
56445
|
+
if (isSelected) {
|
|
56446
|
+
_visibleColumns = [].concat(_visibleColumns, customColumns.filter(function (item) {
|
|
56447
|
+
return items.includes(item.name);
|
|
56448
|
+
})).filter(uniqueRecords);
|
|
56449
|
+
} else {
|
|
56450
|
+
_visibleColumns = _visibleColumns.filter(function (item) {
|
|
56451
|
+
return !items.includes(item.name);
|
|
56452
|
+
});
|
|
56453
|
+
}
|
|
56454
|
+
_visibleColumns = _visibleColumns.filter(function (x) {
|
|
56455
|
+
return !unvisibleColumnNames.includes(x.name);
|
|
56456
|
+
});
|
|
56457
|
+
setColumnList(function (prev) {
|
|
56458
|
+
return prev.map(function (item) {
|
|
56459
|
+
item.visible = _visibleColumns.some(function (x) {
|
|
56460
|
+
return x.name === item.name;
|
|
56461
|
+
});
|
|
56462
|
+
return item;
|
|
56463
|
+
});
|
|
56464
|
+
});
|
|
56465
|
+
((_props$toolbarSetting = props.toolbarSettings) === null || _props$toolbarSetting === void 0 ? void 0 : (_props$toolbarSetting2 = _props$toolbarSetting.columnChooser) === null || _props$toolbarSetting2 === void 0 ? void 0 : _props$toolbarSetting2.onSelection) && ((_props$toolbarSetting3 = props.toolbarSettings) === null || _props$toolbarSetting3 === void 0 ? void 0 : (_props$toolbarSetting4 = _props$toolbarSetting3.columnChooser) === null || _props$toolbarSetting4 === void 0 ? void 0 : _props$toolbarSetting4.onSelection(items, isSelected));
|
|
56466
|
+
};
|
|
56272
56467
|
var searchBoxComponent = function searchBoxComponent(props) {
|
|
56273
56468
|
var _toolbarSettings$sear4;
|
|
56274
56469
|
var filterInAllFields = function filterInAllFields(item, searchValue) {
|
|
@@ -56323,13 +56518,13 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
56323
56518
|
var getExportFileName = function getExportFileName() {
|
|
56324
56519
|
var _toolbarSettings$expo4, _toolbarSettings$expo5;
|
|
56325
56520
|
var now = new Date();
|
|
56326
|
-
var datePart = (
|
|
56327
|
-
var timePart = (
|
|
56521
|
+
var datePart = ("0" + now.getDate()).slice(-2) + "-" + ("0" + (now.getMonth() + 1)).slice(-2) + "-" + now.getFullYear();
|
|
56522
|
+
var timePart = ("0" + now.getHours()).slice(-2) + ":" + ("0" + now.getMinutes()).slice(-2);
|
|
56328
56523
|
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";
|
|
56329
56524
|
};
|
|
56330
56525
|
var exportedColumns = React.useMemo(function () {
|
|
56331
56526
|
var newExportedColumns = [];
|
|
56332
|
-
var exportableColumns =
|
|
56527
|
+
var exportableColumns = columnList.filter(function (item) {
|
|
56333
56528
|
return item.visible != false && item.allowExporting != false;
|
|
56334
56529
|
});
|
|
56335
56530
|
var isResizableColumn = function isResizableColumn(item) {
|
|
@@ -56350,7 +56545,7 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
56350
56545
|
newExportedColumns.push(col);
|
|
56351
56546
|
});
|
|
56352
56547
|
return newExportedColumns;
|
|
56353
|
-
}, [exportableTasks]);
|
|
56548
|
+
}, [exportableTasks, columnList]);
|
|
56354
56549
|
React.useImperativeHandle(ref, function () {
|
|
56355
56550
|
return {
|
|
56356
56551
|
getSelectedRowsData: getSelectedRowsData,
|
|
@@ -56409,6 +56604,27 @@ var OdsTimelineTable = React.forwardRef(function (props, ref) {
|
|
|
56409
56604
|
stylingMode: "text",
|
|
56410
56605
|
onClick: exportToPdf
|
|
56411
56606
|
}
|
|
56607
|
+
}), React__default.createElement(gantt.Item, {
|
|
56608
|
+
key: "OdsTimelineTable_ToolbarItem_ColumChooser",
|
|
56609
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$colu = toolbarSettings.columnChooser) === null || _toolbarSettings$colu === void 0 ? void 0 : _toolbarSettings$colu.visible,
|
|
56610
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
56611
|
+
component: function component(props) {
|
|
56612
|
+
var _toolbarSettings$colu2, _toolbarSettings$colu3, _toolbarSettings$colu4, _toolbarSettings$colu5;
|
|
56613
|
+
return OdsTimelineTableColumnChooser(_extends({}, props, {
|
|
56614
|
+
title: (_toolbarSettings$colu2 = toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$colu3 = toolbarSettings.columnChooser) === null || _toolbarSettings$colu3 === void 0 ? void 0 : _toolbarSettings$colu3.title) != null ? _toolbarSettings$colu2 : "Column Chooser",
|
|
56615
|
+
selectAllText: (_toolbarSettings$colu4 = toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$colu5 = toolbarSettings.columnChooser) === null || _toolbarSettings$colu5 === void 0 ? void 0 : _toolbarSettings$colu5.selectAllText) != null ? _toolbarSettings$colu4 : "Select All",
|
|
56616
|
+
items: columnList.filter(function (item) {
|
|
56617
|
+
return item.caption !== undefined && item.caption !== "";
|
|
56618
|
+
}).map(function (item) {
|
|
56619
|
+
return {
|
|
56620
|
+
columnCaption: item.caption,
|
|
56621
|
+
columnName: item.name,
|
|
56622
|
+
visible: item.visible
|
|
56623
|
+
};
|
|
56624
|
+
}),
|
|
56625
|
+
onSelection: onColumnChooserSelection
|
|
56626
|
+
}));
|
|
56627
|
+
}
|
|
56412
56628
|
})) : "", React__default.createElement(gantt.ContextMenu, {
|
|
56413
56629
|
enabled: false
|
|
56414
56630
|
}), timelineColumns === null || timelineColumns === void 0 ? void 0 : timelineColumns.map(function (columnProps) {
|