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
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Alert, AutoComplete, Button, Dropdown, Calendar, Card as Card$1, Checkbox, DatePicker, Divider, Collapse, Image, Input, InputNumber, List, Modal, notification, Radio, Rate, Select, Space, Spin, Switch, Tabs, Table, Tag, Timeline, TimePicker, Typography, theme, Badge, ConfigProvider, Menu, Form as Form$1, Row, Col, Upload, Tooltip as Tooltip$1, Transfer, Progress, Tree, TreeSelect } from 'antd';
|
|
1
|
+
import { Alert, AutoComplete, Button, Dropdown, Calendar, Card as Card$1, Checkbox, DatePicker, Divider, Collapse, Image, Input, InputNumber, List, Modal, notification, Radio, Rate, Select, Space, Spin, Switch, Tabs, Table, Tag, Timeline, TimePicker, Typography, theme, Badge, ConfigProvider, Menu, Form as Form$1, Row, Col, Upload, Tooltip as Tooltip$1, Transfer, Progress, Tree, TreeSelect, Popover } from 'antd';
|
|
2
2
|
import styled, { ThemeProvider } from 'styled-components';
|
|
3
3
|
import React, { useState, useRef, useEffect, useCallback, Suspense, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import Marquee from 'react-fast-marquee';
|
|
@@ -16,13 +16,14 @@ import jsPDF, { jsPDF as jsPDF$1 } from 'jspdf';
|
|
|
16
16
|
import { Workbook } from 'exceljs';
|
|
17
17
|
import { saveAs } from 'file-saver-es';
|
|
18
18
|
import moment, { isDate } from 'moment';
|
|
19
|
-
import { GridIcon, UpArrow5Icon, DownArrow5Icon, Loop1Icon, EditIcon, Trash1Icon, CopyIcon, DiscountIcon, KebabMenuIcon, RefreshIcon, LinkBreakIcon, FloppyDiskIcon, Discount2Icon, Slide1Icon, BabyIcon, BabyBottleIcon, UsersIcon, Search1Icon, UpArrow2Icon, DownArrow2Icon } from 'ods-icon/react/24/outline';
|
|
19
|
+
import { GridIcon, UpArrow5Icon, DownArrow5Icon, Loop1Icon, EditIcon, Trash1Icon, CopyIcon, DiscountIcon, KebabMenuIcon, RefreshIcon, LinkBreakIcon, FloppyDiskIcon, Discount2Icon, Slide1Icon, BabyIcon, BabyBottleIcon, UsersIcon, Search1Icon, CrossIcon, UpArrow2Icon, DownArrow2Icon } from 'ods-icon/react/24/outline';
|
|
20
20
|
import { TreeList, Lookup, DataGrid as DataGrid$2, Toolbar as Toolbar$1 } from 'devextreme-react';
|
|
21
21
|
import { createStyles } from 'antd-style';
|
|
22
22
|
import { saveAs as saveAs$1 } from 'file-saver';
|
|
23
23
|
import 'devextreme/dist/css/dx.light.css';
|
|
24
24
|
import { Gantt, Toolbar as Toolbar$2, Item as Item$2, ContextMenu, Column as Column$1, Tasks, Sorting as Sorting$1 } from 'devextreme-react/gantt';
|
|
25
25
|
import 'jspdf-autotable';
|
|
26
|
+
import { Button as Button$2 } from 'devextreme-react/button';
|
|
26
27
|
|
|
27
28
|
function _toPrimitive(t, r) {
|
|
28
29
|
if ("object" != typeof t || !t) return t;
|
|
@@ -37940,7 +37941,7 @@ var OdsMergeCellDataGridHelper = /*#__PURE__*/function () {
|
|
|
37940
37941
|
});
|
|
37941
37942
|
} else {
|
|
37942
37943
|
mergedCells.filter(function (x) {
|
|
37943
|
-
return x.FieldName == dataFieldCurrent && x.Type != "OutOfScope";
|
|
37944
|
+
return x.FieldName == dataFieldCurrent && x.Type != "OutOfScope" && x.Type != "Dirty";
|
|
37944
37945
|
}).map(function (item) {
|
|
37945
37946
|
mergedCells.filter(function (x) {
|
|
37946
37947
|
return x.FieldName == dataFieldNext && x.Type != "New" && x.Type != "Placed";
|
|
@@ -38488,19 +38489,6 @@ var OdsMergeCellDataGrid = function OdsMergeCellDataGrid(props) {
|
|
|
38488
38489
|
})));
|
|
38489
38490
|
};
|
|
38490
38491
|
|
|
38491
|
-
var currentYear = new Date().getFullYear();
|
|
38492
|
-
var Constants = {
|
|
38493
|
-
timelineDefaultStartDate: new Date(currentYear, 0, 1),
|
|
38494
|
-
timelineDefaultEndDate: new Date(currentYear + 1, 0, 1)
|
|
38495
|
-
};
|
|
38496
|
-
var actionColumnProps = {
|
|
38497
|
-
dataField: "Actions",
|
|
38498
|
-
allowExporting: false,
|
|
38499
|
-
allowFiltering: false,
|
|
38500
|
-
allowSorting: false,
|
|
38501
|
-
dataType: "object"
|
|
38502
|
-
};
|
|
38503
|
-
|
|
38504
38492
|
var lodash = createCommonjsModule(function (module, exports) {
|
|
38505
38493
|
(function() {
|
|
38506
38494
|
|
|
@@ -55691,6 +55679,23 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
55691
55679
|
}.call(commonjsGlobal));
|
|
55692
55680
|
});
|
|
55693
55681
|
|
|
55682
|
+
var uniqueRecords = function uniqueRecords(value, index, array) {
|
|
55683
|
+
return array.indexOf(value) === index;
|
|
55684
|
+
};
|
|
55685
|
+
|
|
55686
|
+
var currentYear = new Date().getFullYear();
|
|
55687
|
+
var Constants = {
|
|
55688
|
+
timelineDefaultStartDate: new Date(currentYear, 0, 1),
|
|
55689
|
+
timelineDefaultEndDate: new Date(currentYear + 1, 0, 1)
|
|
55690
|
+
};
|
|
55691
|
+
var actionColumnProps = {
|
|
55692
|
+
dataField: "Actions",
|
|
55693
|
+
allowExporting: false,
|
|
55694
|
+
allowFiltering: false,
|
|
55695
|
+
allowSorting: false,
|
|
55696
|
+
dataType: "object"
|
|
55697
|
+
};
|
|
55698
|
+
|
|
55694
55699
|
var checkboxCellComponent = function checkboxCellComponent(props) {
|
|
55695
55700
|
var isChecked = props.data.value;
|
|
55696
55701
|
var onChange = function onChange(e) {
|
|
@@ -55923,6 +55928,7 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
55923
55928
|
minWidth: 50,
|
|
55924
55929
|
width: 50,
|
|
55925
55930
|
dataField: "isSelected",
|
|
55931
|
+
name: "selection",
|
|
55926
55932
|
allowExporting: false,
|
|
55927
55933
|
cellComponent: function cellComponent(props) {
|
|
55928
55934
|
var onChange = function onChange(e) {
|
|
@@ -55944,19 +55950,26 @@ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEv
|
|
|
55944
55950
|
return selectionColumn;
|
|
55945
55951
|
};
|
|
55946
55952
|
|
|
55947
|
-
var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4;
|
|
55953
|
+
var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4, _templateObject6$3, _templateObject7$3, _templateObject8$3, _templateObject9$3, _templateObject10$3, _templateObject11$3;
|
|
55948
55954
|
var useStyles$b = createStyles(function (_ref, props) {
|
|
55949
55955
|
var _props$taskWidth, _props$progressPerc, _props$progressColor;
|
|
55950
55956
|
var css = _ref.css;
|
|
55951
55957
|
var _taskWidth = (_props$taskWidth = props === null || props === void 0 ? void 0 : props.taskWidth) != null ? _props$taskWidth : 0;
|
|
55952
55958
|
var _progressPerc = (_props$progressPerc = props === null || props === void 0 ? void 0 : props.progressPerc) != null ? _props$progressPerc : 100;
|
|
55953
55959
|
var _progressColor = (_props$progressColor = props === null || props === void 0 ? void 0 : props.progressColor) != null ? _props$progressColor : "unset";
|
|
55960
|
+
var searchBox = "\n padding-left: 5px;\n ";
|
|
55954
55961
|
return {
|
|
55955
55962
|
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),
|
|
55956
55963
|
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),
|
|
55957
55964
|
taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "]))),
|
|
55958
55965
|
searchBoxIcon: css(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n color: #999;\n font-size: 17px;\n line-height: 18px;\n "]))),
|
|
55959
|
-
searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n
|
|
55966
|
+
searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n ", "\n "])), searchBox),
|
|
55967
|
+
columnChooserPopup: css(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n min-width: 250px;\n "]))),
|
|
55968
|
+
columnChooserHeader: css(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n "]))),
|
|
55969
|
+
columnChooserCloseButton: css(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n flex: 1;\n text-align: end;\n "]))),
|
|
55970
|
+
columnChooserDivider: css(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n margin-top: 10px;\n margin-bottom: 10px;\n "]))),
|
|
55971
|
+
columnChooserCheckbox: css(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n margin-top: 4px;\n margin-bottom: 4px;\n "]))),
|
|
55972
|
+
columnChooserSearchbox: css(_templateObject11$3 || (_templateObject11$3 = _taggedTemplateLiteralLoose(["\n ", "\n margin-top: 4px;\n margin-bottom: 4px;\n "])), searchBox)
|
|
55960
55973
|
};
|
|
55961
55974
|
});
|
|
55962
55975
|
|
|
@@ -56015,8 +56028,154 @@ var OdsTimelineTableSearchBox = function OdsTimelineTableSearchBox(props) {
|
|
|
56015
56028
|
}));
|
|
56016
56029
|
};
|
|
56017
56030
|
|
|
56031
|
+
var OdsTimelineTableColumnChooser = function OdsTimelineTableColumnChooser(props) {
|
|
56032
|
+
var _useStyles = useStyles$b(),
|
|
56033
|
+
timelineTableStyles = _useStyles.styles;
|
|
56034
|
+
var initialSelectedColumns = props.items.filter(function (item) {
|
|
56035
|
+
return item.visible !== false;
|
|
56036
|
+
});
|
|
56037
|
+
var _useState = useState(false),
|
|
56038
|
+
open = _useState[0],
|
|
56039
|
+
setOpen = _useState[1];
|
|
56040
|
+
var _useState2 = useState(props.items),
|
|
56041
|
+
columns = _useState2[0],
|
|
56042
|
+
setColumns = _useState2[1];
|
|
56043
|
+
var _useState3 = useState(initialSelectedColumns),
|
|
56044
|
+
selectedColumns = _useState3[0],
|
|
56045
|
+
setSelectedColumns = _useState3[1];
|
|
56046
|
+
var filterColumns = function filterColumns(searchValue) {
|
|
56047
|
+
var _columns = [];
|
|
56048
|
+
if (searchValue !== undefined && searchValue !== null && searchValue !== "") {
|
|
56049
|
+
_columns = columns.filter(function (item) {
|
|
56050
|
+
return item.columnCaption.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase());
|
|
56051
|
+
});
|
|
56052
|
+
} else {
|
|
56053
|
+
_columns = props.items;
|
|
56054
|
+
}
|
|
56055
|
+
setColumns(_columns);
|
|
56056
|
+
updateSelectAll({
|
|
56057
|
+
columnList: _columns
|
|
56058
|
+
});
|
|
56059
|
+
};
|
|
56060
|
+
var selectAllChanged = function selectAllChanged(isSelected) {
|
|
56061
|
+
setSelectAll(isSelected);
|
|
56062
|
+
var newSelectedColumns = [];
|
|
56063
|
+
if (isSelected) {
|
|
56064
|
+
newSelectedColumns = [].concat(selectedColumns, columns).filter(uniqueRecords);
|
|
56065
|
+
} else {
|
|
56066
|
+
newSelectedColumns = selectedColumns.filter(function (item) {
|
|
56067
|
+
return !columns.some(function (x) {
|
|
56068
|
+
return x.columnName === item.columnName;
|
|
56069
|
+
});
|
|
56070
|
+
});
|
|
56071
|
+
}
|
|
56072
|
+
setSelectedColumns(newSelectedColumns);
|
|
56073
|
+
props.onSelection && props.onSelection(columns.map(function (item) {
|
|
56074
|
+
return item.columnName;
|
|
56075
|
+
}), isSelected);
|
|
56076
|
+
};
|
|
56077
|
+
var selectChanged = function selectChanged(isSelected, column) {
|
|
56078
|
+
var newSelectedColumns = [];
|
|
56079
|
+
if (isSelected) {
|
|
56080
|
+
newSelectedColumns = [].concat(selectedColumns, [column]).filter(uniqueRecords);
|
|
56081
|
+
} else {
|
|
56082
|
+
newSelectedColumns = selectedColumns.filter(function (item) {
|
|
56083
|
+
return item.columnName !== column.columnName;
|
|
56084
|
+
});
|
|
56085
|
+
}
|
|
56086
|
+
setSelectedColumns(newSelectedColumns);
|
|
56087
|
+
updateSelectAll({
|
|
56088
|
+
selectedColumnList: newSelectedColumns
|
|
56089
|
+
});
|
|
56090
|
+
props.onSelection && props.onSelection([column.columnName], isSelected);
|
|
56091
|
+
};
|
|
56092
|
+
var updateSelectAll = function updateSelectAll(params) {
|
|
56093
|
+
var columnList = params.columnList,
|
|
56094
|
+
selectedColumnList = params.selectedColumnList;
|
|
56095
|
+
setSelectAll(isAllSelected({
|
|
56096
|
+
columnList: columnList,
|
|
56097
|
+
selectedColumnList: selectedColumnList
|
|
56098
|
+
}));
|
|
56099
|
+
};
|
|
56100
|
+
var isSelected = function isSelected(columnName) {
|
|
56101
|
+
return selectedColumns.some(function (item) {
|
|
56102
|
+
return item.columnName === columnName;
|
|
56103
|
+
});
|
|
56104
|
+
};
|
|
56105
|
+
var isAllSelected = function isAllSelected(params) {
|
|
56106
|
+
var _params$columnList, _params$selectedColum;
|
|
56107
|
+
var _columns = (_params$columnList = params === null || params === void 0 ? void 0 : params.columnList) != null ? _params$columnList : columns;
|
|
56108
|
+
var _selectedColumns = (_params$selectedColum = params === null || params === void 0 ? void 0 : params.selectedColumnList) != null ? _params$selectedColum : selectedColumns;
|
|
56109
|
+
var _result = true;
|
|
56110
|
+
lodash.forEach(_columns, function (_column) {
|
|
56111
|
+
if (!_selectedColumns.some(function (_selectedColumn) {
|
|
56112
|
+
return _selectedColumn.columnName === _column.columnName;
|
|
56113
|
+
})) {
|
|
56114
|
+
_result = false;
|
|
56115
|
+
return;
|
|
56116
|
+
}
|
|
56117
|
+
});
|
|
56118
|
+
return _result;
|
|
56119
|
+
};
|
|
56120
|
+
var _useState4 = useState(isAllSelected({
|
|
56121
|
+
columnList: props.items,
|
|
56122
|
+
selectedColumnList: initialSelectedColumns
|
|
56123
|
+
})),
|
|
56124
|
+
selectAll = _useState4[0],
|
|
56125
|
+
setSelectAll = _useState4[1];
|
|
56126
|
+
var content = React.createElement("div", {
|
|
56127
|
+
className: timelineTableStyles.columnChooserPopup
|
|
56128
|
+
}, React.createElement("div", {
|
|
56129
|
+
className: timelineTableStyles.columnChooserHeader
|
|
56130
|
+
}, React.createElement("span", null, props.title), React.createElement("span", {
|
|
56131
|
+
className: timelineTableStyles.columnChooserCloseButton
|
|
56132
|
+
}, React.createElement(CrossIcon, {
|
|
56133
|
+
style: {
|
|
56134
|
+
cursor: "pointer"
|
|
56135
|
+
},
|
|
56136
|
+
onClick: function onClick() {
|
|
56137
|
+
return setOpen(false);
|
|
56138
|
+
}
|
|
56139
|
+
}))), React.createElement(OdsInput, {
|
|
56140
|
+
key: "OdsTimelineTableColumnChooser_OdsSearch",
|
|
56141
|
+
prefix: React.createElement("span", {
|
|
56142
|
+
className: "dx-icon-search " + timelineTableStyles.searchBoxIcon
|
|
56143
|
+
}),
|
|
56144
|
+
className: timelineTableStyles.columnChooserSearchbox,
|
|
56145
|
+
onChange: function onChange(e) {
|
|
56146
|
+
return filterColumns(e.target.value);
|
|
56147
|
+
}
|
|
56148
|
+
}), React.createElement(OdsCheckbox, {
|
|
56149
|
+
className: timelineTableStyles.columnChooserCheckbox,
|
|
56150
|
+
checked: selectAll,
|
|
56151
|
+
onChange: function onChange(e) {
|
|
56152
|
+
return selectAllChanged(e.target.checked);
|
|
56153
|
+
}
|
|
56154
|
+
}, props.selectAllText), React.createElement(Divider, {
|
|
56155
|
+
className: timelineTableStyles.columnChooserDivider
|
|
56156
|
+
}), columns.map(function (_column, index) {
|
|
56157
|
+
return React.createElement("div", null, React.createElement(OdsCheckbox, {
|
|
56158
|
+
key: "OdsTimelineTableColumnChooser_OdsCheckbox_" + index,
|
|
56159
|
+
className: timelineTableStyles.columnChooserCheckbox,
|
|
56160
|
+
checked: isSelected(_column.columnName),
|
|
56161
|
+
onChange: function onChange(e) {
|
|
56162
|
+
return selectChanged(e.target.checked, _column);
|
|
56163
|
+
}
|
|
56164
|
+
}, _column.columnCaption));
|
|
56165
|
+
}));
|
|
56166
|
+
return React.createElement(React.Fragment, null, React.createElement(Popover, {
|
|
56167
|
+
open: open,
|
|
56168
|
+
content: content
|
|
56169
|
+
}, React.createElement(Button$2, {
|
|
56170
|
+
icon: "columnchooser",
|
|
56171
|
+
onClick: function onClick() {
|
|
56172
|
+
return setOpen(true);
|
|
56173
|
+
}
|
|
56174
|
+
})));
|
|
56175
|
+
};
|
|
56176
|
+
|
|
56018
56177
|
var OdsTimelineTable = forwardRef(function (props, ref) {
|
|
56019
|
-
var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7;
|
|
56178
|
+
var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7, _toolbarSettings$colu;
|
|
56020
56179
|
var customColumns = props.customColumns,
|
|
56021
56180
|
customTasks = props.customTasks,
|
|
56022
56181
|
customTaskKey = props.customTaskKey,
|
|
@@ -56058,6 +56217,15 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
|
|
|
56058
56217
|
}),
|
|
56059
56218
|
sortingChangeEventProps = _useState7[0],
|
|
56060
56219
|
setSortingChangeEventProps = _useState7[1];
|
|
56220
|
+
var _useState8 = useState(customColumns),
|
|
56221
|
+
columnList = _useState8[0],
|
|
56222
|
+
setColumnList = _useState8[1];
|
|
56223
|
+
var _useState9 = useState(customColumns.filter(function (item) {
|
|
56224
|
+
return item.visible === false;
|
|
56225
|
+
}).map(function (item) {
|
|
56226
|
+
return item.name;
|
|
56227
|
+
})),
|
|
56228
|
+
unvisibleColumnNames = _useState9[0];
|
|
56061
56229
|
var originalSortingMode = sorting.mode === undefined || sorting.mode === "" ? "none" : sorting.mode;
|
|
56062
56230
|
var sortingMode = sortingProcess == "ServerSideSorting" ? "none" : originalSortingMode;
|
|
56063
56231
|
var showSortIndexes = sortingProcess == "ServerSideSorting" ? false : sorting.showSortIndexes;
|
|
@@ -56138,7 +56306,7 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
|
|
|
56138
56306
|
updateSelectionData(e.data[props.customTaskKey].toString(), e.isSelected);
|
|
56139
56307
|
onCustomSelectionChanged && onCustomSelectionChanged(e);
|
|
56140
56308
|
};
|
|
56141
|
-
var timelineColumns = multiSelectionEnabled ? [OdsTimelineSelectionColumn(onTimelineCheckboxSelectionChange)].concat(
|
|
56309
|
+
var timelineColumns = multiSelectionEnabled ? [OdsTimelineSelectionColumn(onTimelineCheckboxSelectionChange)].concat(columnList) : columnList;
|
|
56142
56310
|
var minimalHeaderCellComponent = function minimalHeaderCellComponent(data) {
|
|
56143
56311
|
return customHeaderCellComponent(data, true);
|
|
56144
56312
|
};
|
|
@@ -56243,6 +56411,33 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
|
|
|
56243
56411
|
endDate: e.endDate
|
|
56244
56412
|
});
|
|
56245
56413
|
};
|
|
56414
|
+
var onColumnChooserSelection = function onColumnChooserSelection(items, isSelected) {
|
|
56415
|
+
var _props$toolbarSetting, _props$toolbarSetting2, _props$toolbarSetting3, _props$toolbarSetting4;
|
|
56416
|
+
var _visibleColumns = columnList.filter(function (item) {
|
|
56417
|
+
return item.visible !== false;
|
|
56418
|
+
});
|
|
56419
|
+
if (isSelected) {
|
|
56420
|
+
_visibleColumns = [].concat(_visibleColumns, customColumns.filter(function (item) {
|
|
56421
|
+
return items.includes(item.name);
|
|
56422
|
+
})).filter(uniqueRecords);
|
|
56423
|
+
} else {
|
|
56424
|
+
_visibleColumns = _visibleColumns.filter(function (item) {
|
|
56425
|
+
return !items.includes(item.name);
|
|
56426
|
+
});
|
|
56427
|
+
}
|
|
56428
|
+
_visibleColumns = _visibleColumns.filter(function (x) {
|
|
56429
|
+
return !unvisibleColumnNames.includes(x.name);
|
|
56430
|
+
});
|
|
56431
|
+
setColumnList(function (prev) {
|
|
56432
|
+
return prev.map(function (item) {
|
|
56433
|
+
item.visible = _visibleColumns.some(function (x) {
|
|
56434
|
+
return x.name === item.name;
|
|
56435
|
+
});
|
|
56436
|
+
return item;
|
|
56437
|
+
});
|
|
56438
|
+
});
|
|
56439
|
+
((_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));
|
|
56440
|
+
};
|
|
56246
56441
|
var searchBoxComponent = function searchBoxComponent(props) {
|
|
56247
56442
|
var _toolbarSettings$sear4;
|
|
56248
56443
|
var filterInAllFields = function filterInAllFields(item, searchValue) {
|
|
@@ -56297,13 +56492,13 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
|
|
|
56297
56492
|
var getExportFileName = function getExportFileName() {
|
|
56298
56493
|
var _toolbarSettings$expo4, _toolbarSettings$expo5;
|
|
56299
56494
|
var now = new Date();
|
|
56300
|
-
var datePart = (
|
|
56301
|
-
var timePart = (
|
|
56495
|
+
var datePart = ("0" + now.getDate()).slice(-2) + "-" + ("0" + (now.getMonth() + 1)).slice(-2) + "-" + now.getFullYear();
|
|
56496
|
+
var timePart = ("0" + now.getHours()).slice(-2) + ":" + ("0" + now.getMinutes()).slice(-2);
|
|
56302
56497
|
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";
|
|
56303
56498
|
};
|
|
56304
56499
|
var exportedColumns = useMemo(function () {
|
|
56305
56500
|
var newExportedColumns = [];
|
|
56306
|
-
var exportableColumns =
|
|
56501
|
+
var exportableColumns = columnList.filter(function (item) {
|
|
56307
56502
|
return item.visible != false && item.allowExporting != false;
|
|
56308
56503
|
});
|
|
56309
56504
|
var isResizableColumn = function isResizableColumn(item) {
|
|
@@ -56324,7 +56519,7 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
|
|
|
56324
56519
|
newExportedColumns.push(col);
|
|
56325
56520
|
});
|
|
56326
56521
|
return newExportedColumns;
|
|
56327
|
-
}, [exportableTasks]);
|
|
56522
|
+
}, [exportableTasks, columnList]);
|
|
56328
56523
|
useImperativeHandle(ref, function () {
|
|
56329
56524
|
return {
|
|
56330
56525
|
getSelectedRowsData: getSelectedRowsData,
|
|
@@ -56383,6 +56578,27 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
|
|
|
56383
56578
|
stylingMode: "text",
|
|
56384
56579
|
onClick: exportToPdf
|
|
56385
56580
|
}
|
|
56581
|
+
}), React.createElement(Item$2, {
|
|
56582
|
+
key: "OdsTimelineTable_ToolbarItem_ColumChooser",
|
|
56583
|
+
visible: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : (_toolbarSettings$colu = toolbarSettings.columnChooser) === null || _toolbarSettings$colu === void 0 ? void 0 : _toolbarSettings$colu.visible,
|
|
56584
|
+
location: toolbarSettings === null || toolbarSettings === void 0 ? void 0 : toolbarSettings.location,
|
|
56585
|
+
component: function component(props) {
|
|
56586
|
+
var _toolbarSettings$colu2, _toolbarSettings$colu3, _toolbarSettings$colu4, _toolbarSettings$colu5;
|
|
56587
|
+
return OdsTimelineTableColumnChooser(_extends({}, props, {
|
|
56588
|
+
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",
|
|
56589
|
+
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",
|
|
56590
|
+
items: columnList.filter(function (item) {
|
|
56591
|
+
return item.caption !== undefined && item.caption !== "";
|
|
56592
|
+
}).map(function (item) {
|
|
56593
|
+
return {
|
|
56594
|
+
columnCaption: item.caption,
|
|
56595
|
+
columnName: item.name,
|
|
56596
|
+
visible: item.visible
|
|
56597
|
+
};
|
|
56598
|
+
}),
|
|
56599
|
+
onSelection: onColumnChooserSelection
|
|
56600
|
+
}));
|
|
56601
|
+
}
|
|
56386
56602
|
})) : "", React.createElement(ContextMenu, {
|
|
56387
56603
|
enabled: false
|
|
56388
56604
|
}), timelineColumns === null || timelineColumns === void 0 ? void 0 : timelineColumns.map(function (columnProps) {
|