ods-component-lib 1.18.238 → 1.18.239

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.
@@ -38494,267 +38494,12 @@ var Constants = {
38494
38494
  timelineDefaultStartDate: new Date(currentYear, 0, 1),
38495
38495
  timelineDefaultEndDate: new Date(currentYear + 1, 0, 1)
38496
38496
  };
38497
-
38498
- var checkboxCellComponent = function checkboxCellComponent(props) {
38499
- var isChecked = props.data.value;
38500
- var onChange = function onChange(e) {
38501
- props.data.column.onCheckboxColumnChange({
38502
- data: props.data.data,
38503
- dataField: props.data.column.dataField,
38504
- isChecked: e.target.checked
38505
- });
38506
- };
38507
- return React.createElement(OdsCheckbox, {
38508
- key: "odstimeline-checkboxcolumn-" + props.data.name,
38509
- style: {
38510
- height: "32px"
38511
- },
38512
- defaultChecked: isChecked,
38513
- onChange: onChange
38514
- });
38515
- };
38516
- var statusCellComponent = function statusCellComponent(props) {
38517
- var isActive = props.data.value;
38518
- var _onClick = function onClick(value) {
38519
- props.data.column.onStatusColumnChange({
38520
- data: props.data.data,
38521
- dataField: props.data.column.dataField,
38522
- status: value
38523
- });
38524
- };
38525
- return isActive ? React.createElement(CheckCircleFilled, {
38526
- style: {
38527
- fontSize: 20,
38528
- color: "#568B6B"
38529
- },
38530
- onClick: function onClick() {
38531
- return _onClick(false);
38532
- }
38533
- }) : React.createElement(CheckCircleFilled, {
38534
- style: {
38535
- fontSize: 20,
38536
- color: "#EDEDED"
38537
- },
38538
- onClick: function onClick() {
38539
- return _onClick(true);
38540
- }
38541
- });
38542
- };
38543
- var mapCustomTask = function mapCustomTask(item) {
38544
- return _extends({
38545
- isSelected: false
38546
- }, item);
38547
- };
38548
- var mapSelectedKeys = function mapSelectedKeys(datasource, key, selectedKeys) {
38549
- if (key && key != "" && selectedKeys && selectedKeys.length > 0) {
38550
- return datasource.map(function (x) {
38551
- x.isSelected = selectedKeys.some(function (y) {
38552
- return y == x[key];
38553
- });
38554
- return x;
38555
- });
38556
- } else {
38557
- return datasource;
38558
- }
38559
- };
38560
- var getTranslatedValue = function getTranslatedValue(value, translations) {
38561
- var _translations$find$tr, _translations$find;
38562
- if (translations === undefined || translations.length == 0 || isDate(value)) {
38563
- return value;
38564
- }
38565
- return (_translations$find$tr = (_translations$find = translations.find(function (item) {
38566
- return item.originalValue === value;
38567
- })) === null || _translations$find === void 0 ? void 0 : _translations$find.translatedValue) != null ? _translations$find$tr : value;
38568
- };
38569
- var getStaticColumnWidth = function getStaticColumnWidth(props) {
38570
- switch (props.dataType) {
38571
- case "boolean":
38572
- return 100;
38573
- case "date":
38574
- case "datetime":
38575
- return 150;
38576
- default:
38577
- {
38578
- if (props.isCheckboxColumn || props.isStatusColumn) {
38579
- return 100;
38580
- }
38581
- return props.width;
38582
- }
38583
- }
38584
- };
38585
- var findMaxDataLength = function findMaxDataLength(data, dataField) {
38586
- var dataLengthList = data.map(function (item) {
38587
- return item[dataField].length;
38588
- });
38589
- return Math.max.apply(Math, dataLengthList);
38590
- };
38591
-
38592
- var OdsTimelineTableDateFilter = function OdsTimelineTableDateFilter(props) {
38593
- var defaultStartDate = props.defaultStartDate,
38594
- defaultEndDate = props.defaultEndDate,
38595
- backText = props.backText,
38596
- nextText = props.nextText,
38597
- onFilterRangeChange = props.onFilterRangeChange;
38598
- var _useState = useState([dayjs_min(defaultStartDate), dayjs_min(defaultEndDate)]),
38599
- dateRange = _useState[0],
38600
- setDateRange = _useState[1];
38601
- var startDate = dateRange[0].toDate();
38602
- var endDate = dateRange[1].toDate();
38603
- var onPickerValueChange = function onPickerValueChange(date) {
38604
- var newStartDate = date[0].toDate(),
38605
- newEndDate = date[1].toDate();
38606
- (newStartDate != startDate || newEndDate != endDate) && onFilterRangeChange({
38607
- startDate: newStartDate,
38608
- endDate: newEndDate
38609
- });
38610
- setDateRange(date);
38611
- };
38612
- var buttonClick = function buttonClick(monthDirection) {
38613
- var newStartDate = startDate,
38614
- newEndDate = endDate,
38615
- currentStartYear = startDate.getFullYear(),
38616
- currentStartMonth = startDate.getMonth(),
38617
- currentEndYear = endDate.getFullYear(),
38618
- currentEndMonth = endDate.getMonth();
38619
- switch (monthDirection) {
38620
- case "previousMonth":
38621
- newStartDate.setMonth(currentStartMonth == 0 ? 11 : currentStartMonth - 1);
38622
- newStartDate.setFullYear(currentStartMonth == 0 ? currentStartYear - 1 : currentStartYear);
38623
- break;
38624
- case "nextMonth":
38625
- newEndDate.setMonth(currentEndMonth == 11 ? 0 : currentEndMonth + 1);
38626
- newEndDate.setFullYear(currentEndMonth == 11 ? currentEndYear + 1 : currentEndYear);
38627
- break;
38628
- }
38629
- setDateRange([dayjs_min(newStartDate), dayjs_min(newEndDate)]);
38630
- onFilterRangeChange({
38631
- startDate: newStartDate,
38632
- endDate: newEndDate
38633
- });
38634
- };
38635
- return React.createElement(React.Fragment, null, React.createElement(Space, null, React.createElement(OdsButton, {
38636
- key: "odsbutton-back",
38637
- onClick: function onClick(_e) {
38638
- buttonClick("previousMonth");
38639
- },
38640
- style: {
38641
- backgroundColor: "#A19FA0",
38642
- color: "white",
38643
- borderColor: "white"
38644
- }
38645
- }, React.createElement(LeftCircleFilled, null), backText != null ? backText : "Back"), React.createElement(OdsDateRangePicker, {
38646
- defaultValue: [dayjs_min(defaultStartDate), dayjs_min(defaultEndDate)],
38647
- value: dateRange,
38648
- onPickerValueChange: onPickerValueChange
38649
- }), React.createElement(OdsButton, {
38650
- key: "odsbutton-next",
38651
- onClick: function onClick(_e) {
38652
- buttonClick("nextMonth");
38653
- },
38654
- style: {
38655
- backgroundColor: "#A19FA0",
38656
- color: "white",
38657
- borderColor: "white"
38658
- }
38659
- }, nextText != null ? nextText : "Next", React.createElement(RightCircleFilled, null))));
38660
- };
38661
-
38662
- var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEvent) {
38663
- var selectionColumn = {
38664
- caption: "",
38665
- minWidth: 50,
38666
- width: 50,
38667
- dataField: "isSelected",
38668
- allowExporting: false,
38669
- cellComponent: function cellComponent(props) {
38670
- var onChange = function onChange(e) {
38671
- selectionEvent && selectionEvent({
38672
- data: props.data.data,
38673
- isSelected: e.target.checked
38674
- });
38675
- };
38676
- return React.createElement(OdsCheckbox, {
38677
- key: "odstimeline-selection-" + props.data.name,
38678
- style: {
38679
- height: "32px"
38680
- },
38681
- defaultChecked: props.data.value,
38682
- onChange: onChange
38683
- });
38684
- }
38685
- };
38686
- return selectionColumn;
38687
- };
38688
-
38689
- var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4;
38690
- var useStyles$b = createStyles(function (_ref, props) {
38691
- var _props$taskWidth, _props$progressPerc, _props$progressColor;
38692
- var css = _ref.css;
38693
- var _taskWidth = (_props$taskWidth = props === null || props === void 0 ? void 0 : props.taskWidth) != null ? _props$taskWidth : 0;
38694
- var _progressPerc = (_props$progressPerc = props === null || props === void 0 ? void 0 : props.progressPerc) != null ? _props$progressPerc : 100;
38695
- var _progressColor = (_props$progressColor = props === null || props === void 0 ? void 0 : props.progressColor) != null ? _props$progressColor : "unset";
38696
- return {
38697
- 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),
38698
- 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),
38699
- taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "]))),
38700
- searchBoxIcon: css(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n color: #999;\n font-size: 17px;\n line-height: 18px;\n "]))),
38701
- searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n padding-left: 5px;\n "])))
38702
- };
38703
- });
38704
-
38705
- var OdsTimelineTableTaskTemplate = function OdsTimelineTableTaskTemplate(_ref) {
38706
- var taskData = _ref.taskData,
38707
- taskSize = _ref.taskSize;
38708
- var _useStyles = useStyles$b({
38709
- progressColor: taskData.color,
38710
- progressPerc: taskData.progress,
38711
- taskWidth: taskSize.width
38712
- }),
38713
- timelineTableStyles = _useStyles.styles;
38714
- return React.createElement("div", {
38715
- className: timelineTableStyles.taskBar
38716
- }, React.createElement("span", {
38717
- className: timelineTableStyles.taskBarTitle
38718
- }, taskData.title), React.createElement("div", {
38719
- className: timelineTableStyles.taskProgress
38720
- }));
38721
- };
38722
-
38723
- var OdsTimelineTableSearchBox = function OdsTimelineTableSearchBox(props) {
38724
- var _props$value;
38725
- var _useStyles = useStyles$b(),
38726
- timelineTableStyles = _useStyles.styles;
38727
- var _useState = useState(true),
38728
- initialLoad = _useState[0],
38729
- setInitialLoad = _useState[1];
38730
- var _useState2 = useState((_props$value = props.value) != null ? _props$value : ""),
38731
- searchValue = _useState2[0],
38732
- setSearchValue = _useState2[1];
38733
- useEffect(function () {
38734
- var _props$timeoutDuratio;
38735
- if (initialLoad) {
38736
- setInitialLoad(false);
38737
- return function () {};
38738
- }
38739
- var timeoutSearch = setTimeout(function () {
38740
- props.onSearch && props.onSearch(searchValue);
38741
- }, (_props$timeoutDuratio = props.timeoutDuration) != null ? _props$timeoutDuratio : 2000);
38742
- return function () {
38743
- return clearTimeout(timeoutSearch);
38744
- };
38745
- }, [searchValue]);
38746
- return React.createElement(React.Fragment, null, React.createElement(OdsInput, {
38747
- key: "OdsTimelineTableSearchBox_OdsSearch",
38748
- value: searchValue,
38749
- prefix: React.createElement("span", {
38750
- className: "dx-icon-search " + timelineTableStyles.searchBoxIcon
38751
- }),
38752
- placeholder: props.placeholder,
38753
- className: timelineTableStyles.searchBox,
38754
- onChange: function onChange(e) {
38755
- return setSearchValue(e.target.value);
38756
- }
38757
- }));
38497
+ var actionColumnProps = {
38498
+ dataField: "Actions",
38499
+ allowExporting: false,
38500
+ allowFiltering: false,
38501
+ allowSorting: false,
38502
+ dataType: "object"
38758
38503
  };
38759
38504
 
38760
38505
  var lodash = createCommonjsModule(function (module, exports) {
@@ -55856,96 +55601,420 @@ var lodash = createCommonjsModule(function (module, exports) {
55856
55601
  isUnwrapped = retUnwrapped && !chainAll,
55857
55602
  onlyLazy = isLazy && !isHybrid;
55858
55603
 
55859
- if (!retUnwrapped && useLazy) {
55860
- value = onlyLazy ? value : new LazyWrapper(this);
55861
- var result = func.apply(value, args);
55862
- result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
55863
- return new LodashWrapper(result, chainAll);
55864
- }
55865
- if (isUnwrapped && onlyLazy) {
55866
- return func.apply(this, args);
55867
- }
55868
- result = this.thru(interceptor);
55869
- return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
55870
- };
55604
+ if (!retUnwrapped && useLazy) {
55605
+ value = onlyLazy ? value : new LazyWrapper(this);
55606
+ var result = func.apply(value, args);
55607
+ result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
55608
+ return new LodashWrapper(result, chainAll);
55609
+ }
55610
+ if (isUnwrapped && onlyLazy) {
55611
+ return func.apply(this, args);
55612
+ }
55613
+ result = this.thru(interceptor);
55614
+ return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
55615
+ };
55616
+ });
55617
+
55618
+ // Add `Array` methods to `lodash.prototype`.
55619
+ arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
55620
+ var func = arrayProto[methodName],
55621
+ chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
55622
+ retUnwrapped = /^(?:pop|shift)$/.test(methodName);
55623
+
55624
+ lodash.prototype[methodName] = function() {
55625
+ var args = arguments;
55626
+ if (retUnwrapped && !this.__chain__) {
55627
+ var value = this.value();
55628
+ return func.apply(isArray(value) ? value : [], args);
55629
+ }
55630
+ return this[chainName](function(value) {
55631
+ return func.apply(isArray(value) ? value : [], args);
55632
+ });
55633
+ };
55634
+ });
55635
+
55636
+ // Map minified method names to their real names.
55637
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
55638
+ var lodashFunc = lodash[methodName];
55639
+ if (lodashFunc) {
55640
+ var key = lodashFunc.name + '';
55641
+ if (!hasOwnProperty.call(realNames, key)) {
55642
+ realNames[key] = [];
55643
+ }
55644
+ realNames[key].push({ 'name': methodName, 'func': lodashFunc });
55645
+ }
55646
+ });
55647
+
55648
+ realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
55649
+ 'name': 'wrapper',
55650
+ 'func': undefined$1
55651
+ }];
55652
+
55653
+ // Add methods to `LazyWrapper`.
55654
+ LazyWrapper.prototype.clone = lazyClone;
55655
+ LazyWrapper.prototype.reverse = lazyReverse;
55656
+ LazyWrapper.prototype.value = lazyValue;
55657
+
55658
+ // Add chain sequence methods to the `lodash` wrapper.
55659
+ lodash.prototype.at = wrapperAt;
55660
+ lodash.prototype.chain = wrapperChain;
55661
+ lodash.prototype.commit = wrapperCommit;
55662
+ lodash.prototype.next = wrapperNext;
55663
+ lodash.prototype.plant = wrapperPlant;
55664
+ lodash.prototype.reverse = wrapperReverse;
55665
+ lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
55666
+
55667
+ // Add lazy aliases.
55668
+ lodash.prototype.first = lodash.prototype.head;
55669
+
55670
+ if (symIterator) {
55671
+ lodash.prototype[symIterator] = wrapperToIterator;
55672
+ }
55673
+ return lodash;
55674
+ });
55675
+
55676
+ /*--------------------------------------------------------------------------*/
55677
+
55678
+ // Export lodash.
55679
+ var _ = runInContext();
55680
+
55681
+ // Some AMD build optimizers, like r.js, check for condition patterns like:
55682
+ if (freeModule) {
55683
+ // Export for Node.js.
55684
+ (freeModule.exports = _)._ = _;
55685
+ // Export for CommonJS support.
55686
+ freeExports._ = _;
55687
+ }
55688
+ else {
55689
+ // Export to the global object.
55690
+ root._ = _;
55691
+ }
55692
+ }.call(commonjsGlobal));
55693
+ });
55694
+
55695
+ var checkboxCellComponent = function checkboxCellComponent(props) {
55696
+ var isChecked = props.data.value;
55697
+ var onChange = function onChange(e) {
55698
+ props.data.column.onCheckboxColumnChange({
55699
+ data: props.data.data,
55700
+ dataField: props.data.column.dataField,
55701
+ isChecked: e.target.checked
55702
+ });
55703
+ };
55704
+ return React.createElement(OdsCheckbox, {
55705
+ key: "odstimeline-checkboxcolumn-" + props.data.name,
55706
+ style: {
55707
+ height: "32px"
55708
+ },
55709
+ defaultChecked: isChecked,
55710
+ onChange: onChange
55711
+ });
55712
+ };
55713
+ var statusCellComponent = function statusCellComponent(props) {
55714
+ var isActive = props.data.value;
55715
+ var _onClick = function onClick(value) {
55716
+ props.data.column.onStatusColumnChange({
55717
+ data: props.data.data,
55718
+ dataField: props.data.column.dataField,
55719
+ status: value
55720
+ });
55721
+ };
55722
+ return isActive ? React.createElement(CheckCircleFilled, {
55723
+ style: {
55724
+ fontSize: 20,
55725
+ color: "#568B6B"
55726
+ },
55727
+ onClick: function onClick() {
55728
+ return _onClick(false);
55729
+ }
55730
+ }) : React.createElement(CheckCircleFilled, {
55731
+ style: {
55732
+ fontSize: 20,
55733
+ color: "#EDEDED"
55734
+ },
55735
+ onClick: function onClick() {
55736
+ return _onClick(true);
55737
+ }
55738
+ });
55739
+ };
55740
+ var mapCustomTask = function mapCustomTask(item) {
55741
+ return _extends({
55742
+ isSelected: false
55743
+ }, item);
55744
+ };
55745
+ var mapSelectedKeys = function mapSelectedKeys(datasource, key, selectedKeys) {
55746
+ if (key && key != "" && selectedKeys && selectedKeys.length > 0) {
55747
+ return datasource.map(function (x) {
55748
+ x.isSelected = selectedKeys.some(function (y) {
55749
+ return y == x[key];
55750
+ });
55751
+ return x;
55752
+ });
55753
+ } else {
55754
+ return datasource;
55755
+ }
55756
+ };
55757
+ var getTranslatedValue = function getTranslatedValue(value, translations) {
55758
+ var _translations$find$tr, _translations$find;
55759
+ if (translations === undefined || translations.length == 0 || isDate(value)) {
55760
+ return value;
55761
+ }
55762
+ return (_translations$find$tr = (_translations$find = translations.find(function (item) {
55763
+ return item.originalValue === value;
55764
+ })) === null || _translations$find === void 0 ? void 0 : _translations$find.translatedValue) != null ? _translations$find$tr : value;
55765
+ };
55766
+ var getStaticColumnWidth = function getStaticColumnWidth(props) {
55767
+ switch (props.dataType) {
55768
+ case "boolean":
55769
+ return 100;
55770
+ case "date":
55771
+ case "datetime":
55772
+ return 150;
55773
+ default:
55774
+ {
55775
+ if (props.isCheckboxColumn || props.isStatusColumn) {
55776
+ return 100;
55777
+ }
55778
+ return props.width;
55779
+ }
55780
+ }
55781
+ };
55782
+ var findMaxDataLength = function findMaxDataLength(data, dataField) {
55783
+ var dataLengthList = data.map(function (item) {
55784
+ return item[dataField].length;
55785
+ });
55786
+ return Math.max.apply(Math, dataLengthList);
55787
+ };
55788
+ var actionCellRender = function actionCellRender(cellData, props, actionButtons) {
55789
+ var _props$actionColumnSe = props.actionColumnSettings,
55790
+ actionButtonGroup = _props$actionColumnSe.actionButtonGroup,
55791
+ actionButtonsTooltipType = _props$actionColumnSe.actionButtonsTooltipType;
55792
+ var kebabMenuButtons = actionButtonGroup && actionButtonGroup.length > 3 ? actionButtonGroup.slice(2).map(function (button) {
55793
+ return {
55794
+ icon: button.icon,
55795
+ onClick: function onClick(event) {
55796
+ var customEvent = {
55797
+ column: cellData.column,
55798
+ component: cellData.component,
55799
+ element: cellData.element,
55800
+ event: event,
55801
+ model: cellData.data,
55802
+ row: cellData.row
55803
+ };
55804
+ button.onClick(customEvent);
55805
+ }
55806
+ };
55807
+ }) : [];
55808
+ var buttonElements = [];
55809
+ lodash.forEach(actionButtons, function (buttonItem, index) {
55810
+ var isVisible = typeof buttonItem.visible === "function" ? buttonItem.visible({
55811
+ column: cellData.column,
55812
+ component: cellData.component,
55813
+ row: cellData.row
55814
+ }) : buttonItem.visible;
55815
+ buttonElements.push(React.createElement(OdsDataGrdiRowButton, Object.assign({
55816
+ key: "action-button-" + index,
55817
+ hint: buttonItem.hint,
55818
+ visible: isVisible,
55819
+ size: "small",
55820
+ type: "text",
55821
+ disabled: buttonItem.actionPermission === undefined ? false : !buttonItem.actionPermission,
55822
+ icon: buttonItem.icon
55823
+ }, actionButtonsTooltipType === "styled" && {
55824
+ tooltip: buttonItem.hint
55825
+ }, {
55826
+ onClick: function onClick(event) {
55827
+ var customEvent = {
55828
+ column: cellData.column,
55829
+ component: cellData.component,
55830
+ element: cellData.element,
55831
+ event: event,
55832
+ model: cellData.data,
55833
+ row: cellData.row
55834
+ };
55835
+ buttonItem.onClick(customEvent);
55836
+ }
55837
+ })));
55838
+ });
55839
+ if (kebabMenuButtons.length > 0) {
55840
+ buttonElements.push(React.createElement(OdsDropdown, {
55841
+ key: "dropdown-" + (cellData.rowIndex || cellData.data.ID),
55842
+ menuItems: kebabMenuButtons
55843
+ }, React.createElement(OdsDataGrdiRowButton, {
55844
+ type: "text",
55845
+ icon: React.createElement(KebabMenuIcon, null)
55846
+ })));
55847
+ }
55848
+ return React.createElement(React.Fragment, null, buttonElements);
55849
+ };
55850
+
55851
+ var OdsTimelineTableDateFilter = function OdsTimelineTableDateFilter(props) {
55852
+ var defaultStartDate = props.defaultStartDate,
55853
+ defaultEndDate = props.defaultEndDate,
55854
+ backText = props.backText,
55855
+ nextText = props.nextText,
55856
+ onFilterRangeChange = props.onFilterRangeChange;
55857
+ var _useState = useState([dayjs_min(defaultStartDate), dayjs_min(defaultEndDate)]),
55858
+ dateRange = _useState[0],
55859
+ setDateRange = _useState[1];
55860
+ var startDate = dateRange[0].toDate();
55861
+ var endDate = dateRange[1].toDate();
55862
+ var onPickerValueChange = function onPickerValueChange(date) {
55863
+ var newStartDate = date[0].toDate(),
55864
+ newEndDate = date[1].toDate();
55865
+ (newStartDate != startDate || newEndDate != endDate) && onFilterRangeChange({
55866
+ startDate: newStartDate,
55867
+ endDate: newEndDate
55871
55868
  });
55869
+ setDateRange(date);
55870
+ };
55871
+ var buttonClick = function buttonClick(monthDirection) {
55872
+ var newStartDate = startDate,
55873
+ newEndDate = endDate,
55874
+ currentStartYear = startDate.getFullYear(),
55875
+ currentStartMonth = startDate.getMonth(),
55876
+ currentEndYear = endDate.getFullYear(),
55877
+ currentEndMonth = endDate.getMonth();
55878
+ switch (monthDirection) {
55879
+ case "previousMonth":
55880
+ newStartDate.setMonth(currentStartMonth == 0 ? 11 : currentStartMonth - 1);
55881
+ newStartDate.setFullYear(currentStartMonth == 0 ? currentStartYear - 1 : currentStartYear);
55882
+ break;
55883
+ case "nextMonth":
55884
+ newEndDate.setMonth(currentEndMonth == 11 ? 0 : currentEndMonth + 1);
55885
+ newEndDate.setFullYear(currentEndMonth == 11 ? currentEndYear + 1 : currentEndYear);
55886
+ break;
55887
+ }
55888
+ setDateRange([dayjs_min(newStartDate), dayjs_min(newEndDate)]);
55889
+ onFilterRangeChange({
55890
+ startDate: newStartDate,
55891
+ endDate: newEndDate
55892
+ });
55893
+ };
55894
+ return React.createElement(React.Fragment, null, React.createElement(Space, null, React.createElement(OdsButton, {
55895
+ key: "odsbutton-back",
55896
+ onClick: function onClick(_e) {
55897
+ buttonClick("previousMonth");
55898
+ },
55899
+ style: {
55900
+ backgroundColor: "#A19FA0",
55901
+ color: "white",
55902
+ borderColor: "white"
55903
+ }
55904
+ }, React.createElement(LeftCircleFilled, null), backText != null ? backText : "Back"), React.createElement(OdsDateRangePicker, {
55905
+ defaultValue: [dayjs_min(defaultStartDate), dayjs_min(defaultEndDate)],
55906
+ value: dateRange,
55907
+ onPickerValueChange: onPickerValueChange
55908
+ }), React.createElement(OdsButton, {
55909
+ key: "odsbutton-next",
55910
+ onClick: function onClick(_e) {
55911
+ buttonClick("nextMonth");
55912
+ },
55913
+ style: {
55914
+ backgroundColor: "#A19FA0",
55915
+ color: "white",
55916
+ borderColor: "white"
55917
+ }
55918
+ }, nextText != null ? nextText : "Next", React.createElement(RightCircleFilled, null))));
55919
+ };
55872
55920
 
55873
- // Add `Array` methods to `lodash.prototype`.
55874
- arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
55875
- var func = arrayProto[methodName],
55876
- chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
55877
- retUnwrapped = /^(?:pop|shift)$/.test(methodName);
55878
-
55879
- lodash.prototype[methodName] = function() {
55880
- var args = arguments;
55881
- if (retUnwrapped && !this.__chain__) {
55882
- var value = this.value();
55883
- return func.apply(isArray(value) ? value : [], args);
55884
- }
55885
- return this[chainName](function(value) {
55886
- return func.apply(isArray(value) ? value : [], args);
55921
+ var OdsTimelineSelectionColumn = function OdsTimelineSelectionColumn(selectionEvent) {
55922
+ var selectionColumn = {
55923
+ caption: "",
55924
+ minWidth: 50,
55925
+ width: 50,
55926
+ dataField: "isSelected",
55927
+ allowExporting: false,
55928
+ cellComponent: function cellComponent(props) {
55929
+ var onChange = function onChange(e) {
55930
+ selectionEvent && selectionEvent({
55931
+ data: props.data.data,
55932
+ isSelected: e.target.checked
55887
55933
  });
55888
55934
  };
55889
- });
55890
-
55891
- // Map minified method names to their real names.
55892
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
55893
- var lodashFunc = lodash[methodName];
55894
- if (lodashFunc) {
55895
- var key = lodashFunc.name + '';
55896
- if (!hasOwnProperty.call(realNames, key)) {
55897
- realNames[key] = [];
55898
- }
55899
- realNames[key].push({ 'name': methodName, 'func': lodashFunc });
55900
- }
55901
- });
55902
-
55903
- realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
55904
- 'name': 'wrapper',
55905
- 'func': undefined$1
55906
- }];
55907
-
55908
- // Add methods to `LazyWrapper`.
55909
- LazyWrapper.prototype.clone = lazyClone;
55910
- LazyWrapper.prototype.reverse = lazyReverse;
55911
- LazyWrapper.prototype.value = lazyValue;
55912
-
55913
- // Add chain sequence methods to the `lodash` wrapper.
55914
- lodash.prototype.at = wrapperAt;
55915
- lodash.prototype.chain = wrapperChain;
55916
- lodash.prototype.commit = wrapperCommit;
55917
- lodash.prototype.next = wrapperNext;
55918
- lodash.prototype.plant = wrapperPlant;
55919
- lodash.prototype.reverse = wrapperReverse;
55920
- lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
55921
-
55922
- // Add lazy aliases.
55923
- lodash.prototype.first = lodash.prototype.head;
55924
-
55925
- if (symIterator) {
55926
- lodash.prototype[symIterator] = wrapperToIterator;
55935
+ return React.createElement(OdsCheckbox, {
55936
+ key: "odstimeline-selection-" + props.data.name,
55937
+ style: {
55938
+ height: "32px"
55939
+ },
55940
+ defaultChecked: props.data.value,
55941
+ onChange: onChange
55942
+ });
55927
55943
  }
55928
- return lodash;
55929
- });
55944
+ };
55945
+ return selectionColumn;
55946
+ };
55930
55947
 
55931
- /*--------------------------------------------------------------------------*/
55948
+ var _templateObject$B, _templateObject2$9, _templateObject3$6, _templateObject4$5, _templateObject5$4;
55949
+ var useStyles$b = createStyles(function (_ref, props) {
55950
+ var _props$taskWidth, _props$progressPerc, _props$progressColor;
55951
+ var css = _ref.css;
55952
+ var _taskWidth = (_props$taskWidth = props === null || props === void 0 ? void 0 : props.taskWidth) != null ? _props$taskWidth : 0;
55953
+ var _progressPerc = (_props$progressPerc = props === null || props === void 0 ? void 0 : props.progressPerc) != null ? _props$progressPerc : 100;
55954
+ var _progressColor = (_props$progressColor = props === null || props === void 0 ? void 0 : props.progressColor) != null ? _props$progressColor : "unset";
55955
+ return {
55956
+ 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),
55957
+ 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),
55958
+ taskBarTitle: css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n z-index: 1;\n padding-left: 4px;\n position: absolute;\n "]))),
55959
+ searchBoxIcon: css(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n color: #999;\n font-size: 17px;\n line-height: 18px;\n "]))),
55960
+ searchBox: css(_templateObject5$4 || (_templateObject5$4 = _taggedTemplateLiteralLoose(["\n padding-left: 5px;\n "])))
55961
+ };
55962
+ });
55932
55963
 
55933
- // Export lodash.
55934
- var _ = runInContext();
55964
+ var OdsTimelineTableTaskTemplate = function OdsTimelineTableTaskTemplate(_ref) {
55965
+ var taskData = _ref.taskData,
55966
+ taskSize = _ref.taskSize;
55967
+ var _useStyles = useStyles$b({
55968
+ progressColor: taskData.color,
55969
+ progressPerc: taskData.progress,
55970
+ taskWidth: taskSize.width
55971
+ }),
55972
+ timelineTableStyles = _useStyles.styles;
55973
+ return React.createElement("div", {
55974
+ className: timelineTableStyles.taskBar
55975
+ }, React.createElement("span", {
55976
+ className: timelineTableStyles.taskBarTitle
55977
+ }, taskData.title), React.createElement("div", {
55978
+ className: timelineTableStyles.taskProgress
55979
+ }));
55980
+ };
55935
55981
 
55936
- // Some AMD build optimizers, like r.js, check for condition patterns like:
55937
- if (freeModule) {
55938
- // Export for Node.js.
55939
- (freeModule.exports = _)._ = _;
55940
- // Export for CommonJS support.
55941
- freeExports._ = _;
55942
- }
55943
- else {
55944
- // Export to the global object.
55945
- root._ = _;
55946
- }
55947
- }.call(commonjsGlobal));
55948
- });
55982
+ var OdsTimelineTableSearchBox = function OdsTimelineTableSearchBox(props) {
55983
+ var _props$value;
55984
+ var _useStyles = useStyles$b(),
55985
+ timelineTableStyles = _useStyles.styles;
55986
+ var _useState = useState(true),
55987
+ initialLoad = _useState[0],
55988
+ setInitialLoad = _useState[1];
55989
+ var _useState2 = useState((_props$value = props.value) != null ? _props$value : ""),
55990
+ searchValue = _useState2[0],
55991
+ setSearchValue = _useState2[1];
55992
+ useEffect(function () {
55993
+ var _props$timeoutDuratio;
55994
+ if (initialLoad) {
55995
+ setInitialLoad(false);
55996
+ return function () {};
55997
+ }
55998
+ var timeoutSearch = setTimeout(function () {
55999
+ props.onSearch && props.onSearch(searchValue);
56000
+ }, (_props$timeoutDuratio = props.timeoutDuration) != null ? _props$timeoutDuratio : 2000);
56001
+ return function () {
56002
+ return clearTimeout(timeoutSearch);
56003
+ };
56004
+ }, [searchValue]);
56005
+ return React.createElement(React.Fragment, null, React.createElement(OdsInput, {
56006
+ key: "OdsTimelineTableSearchBox_OdsSearch",
56007
+ value: searchValue,
56008
+ prefix: React.createElement("span", {
56009
+ className: "dx-icon-search " + timelineTableStyles.searchBoxIcon
56010
+ }),
56011
+ placeholder: props.placeholder,
56012
+ className: timelineTableStyles.searchBox,
56013
+ onChange: function onChange(e) {
56014
+ return setSearchValue(e.target.value);
56015
+ }
56016
+ }));
56017
+ };
55949
56018
 
55950
56019
  var OdsTimelineTable = forwardRef(function (props, ref) {
55951
56020
  var _toolbarSettings$sear, _toolbarSettings$sear5, _toolbarSettings$expo6, _toolbarSettings$expo7;
@@ -55960,6 +56029,7 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
55960
56029
  sorting = props.sorting,
55961
56030
  sortingProcess = props.sortingProcess,
55962
56031
  toolbarSettings = props.toolbarSettings,
56032
+ actionColumnSettings = props.actionColumnSettings,
55963
56033
  onCustomSelectionChanged = props.onCustomSelectionChanged,
55964
56034
  onDateRangeChange = props.onDateRangeChange,
55965
56035
  onSortingChanged = props.onSortingChanged;
@@ -55996,6 +56066,17 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
55996
56066
  useEffect(function () {
55997
56067
  updateExportableTasks();
55998
56068
  }, [timelineTasks]);
56069
+ var actionButtons = useMemo(function () {
56070
+ if (actionColumnSettings.actionButtonGroup) {
56071
+ if (actionColumnSettings.actionButtonGroup.length > 3) {
56072
+ return actionColumnSettings.actionButtonGroup.slice(0, 2);
56073
+ } else {
56074
+ return actionColumnSettings.actionButtonGroup;
56075
+ }
56076
+ } else {
56077
+ return [];
56078
+ }
56079
+ }, [actionColumnSettings.actionButtonGroup]);
55999
56080
  var updateExportableTasks = function updateExportableTasks() {
56000
56081
  var result = [];
56001
56082
  lodash.forEach(timelineTasks, function (item) {
@@ -56214,6 +56295,9 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
56214
56295
  return exportableTasks.length > 0 && item.width === undefined && item.dataType != "boolean" && item.dataType != "date" && item.dataType != "datetime" && !item.isCheckboxColumn && !item.isStatusColumn;
56215
56296
  };
56216
56297
  var getNewWidth = function getNewWidth(item) {
56298
+ if (item.dataField === undefined || item.dataField == "") {
56299
+ return item.width;
56300
+ }
56217
56301
  var maxLength = findMaxDataLength(exportableTasks, item.dataField);
56218
56302
  return maxLength <= 10 ? 100 : maxLength * 10;
56219
56303
  };
@@ -56311,7 +56395,13 @@ var OdsTimelineTable = forwardRef(function (props, ref) {
56311
56395
  }
56312
56396
  }, columnProps));
56313
56397
  }
56314
- }), React.createElement(Tasks, {
56398
+ }), actionColumnSettings.actionColumnEnable != false ? React.createElement(Column$1, Object.assign({}, actionColumnProps, {
56399
+ caption: actionColumnSettings.actionButtonGroupCaption,
56400
+ cssClass: "actionButtonGroupCell",
56401
+ cellRender: function cellRender(cellData) {
56402
+ return actionCellRender(cellData, props, actionButtons);
56403
+ }
56404
+ })) : "", React.createElement(Tasks, {
56315
56405
  dataSource: timelineTasks
56316
56406
  }), children, React.createElement(Sorting$1, {
56317
56407
  mode: sortingMode,