ui-kit-ck-consultant 0.5.199 → 0.5.202

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/index.js CHANGED
@@ -9872,7 +9872,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
9872
9872
  if (_this.state.activeDate === currentDate) {
9873
9873
  return 1;
9874
9874
  } else {
9875
- if (_this.props.disabledDates && _this.props.disabledDates.includes(currentDate) || !_this.props.isWeek && [6, 7].includes(parseInt(moment(currentDate).isoWeekday())) || !_this.props.isHoliday && _this.holidays.includes(currentDate) || _this.props.minDate && moment(_this.props.minDate).isAfter(moment(currentDate)) || _this.props.maxDate && moment(_this.props.maxDate).isBefore(moment(currentDate)) || _this.props.disabledDays && _this.props.disabledDays.filter(function (element, idx) {
9875
+ if (_this.props.enabledDates && _this.props.enabledDates.length) {
9876
+ if (_this.props.enabledDates.includes(currentDate)) {
9877
+ return 0;
9878
+ } else {
9879
+ return 2;
9880
+ }
9881
+ } else if (_this.props.disabledDates && _this.props.disabledDates.includes(currentDate) || !_this.props.isWeek && [6, 7].includes(parseInt(moment(currentDate).isoWeekday())) || !_this.props.isHoliday && _this.holidays.includes(currentDate) || _this.props.minDate && moment(_this.props.minDate).isAfter(moment(currentDate)) || _this.props.maxDate && moment(_this.props.maxDate).isBefore(moment(currentDate)) || _this.props.disabledDays && _this.props.disabledDays.filter(function (element, idx) {
9876
9882
  return element === 1 && idx === col;
9877
9883
  }).length) {
9878
9884
  return 2;
@@ -9953,15 +9959,17 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
9953
9959
  };
9954
9960
 
9955
9961
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
9962
+ var _this2 = this;
9963
+
9956
9964
  if (prevProps.show !== this.props.show && this.props.show && this.props.valueDate) {
9957
9965
  this.setState({
9958
9966
  year: parseInt(moment(this.props.valueDate).format('YYYY')),
9959
9967
  month: parseInt(moment(this.props.valueDate).format('M')),
9960
9968
  activeDate: this.props.valueDate
9961
- }, this.getArrayDays);
9962
- }
9963
-
9964
- if (prevProps.show !== this.props.show) {
9969
+ }, function () {
9970
+ _this2.getArrayDays();
9971
+ });
9972
+ } else if (prevProps.show !== this.props.show) {
9965
9973
  this.getArrayDays();
9966
9974
  }
9967
9975
 
@@ -9971,11 +9979,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
9971
9979
  }, this.getArrayTime);
9972
9980
  } else if (prevProps.show !== this.props.show) {
9973
9981
  this.getArrayTime();
9982
+ } else if (this.props.timesRange && JSON.stringify(this.props.timesRange) !== JSON.stringify(prevProps.timesRange)) {
9983
+ this.getArrayTime();
9974
9984
  }
9975
9985
  };
9976
9986
 
9977
9987
  _proto.render = function render() {
9978
- var _this2 = this;
9988
+ var _this3 = this;
9979
9989
 
9980
9990
  if (!this.props.show) {
9981
9991
  return null;
@@ -10024,14 +10034,16 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
10024
10034
  return /*#__PURE__*/React__default.createElement("tr", {
10025
10035
  key: idxRow
10026
10036
  }, row.map(function (col, idxCol) {
10027
- return /*#__PURE__*/React__default.createElement(React.Fragment, null, _this2.props.isWeek || idxCol < 5 ? /*#__PURE__*/React__default.createElement("td", {
10037
+ return /*#__PURE__*/React__default.createElement(React.Fragment, {
10038
+ idx: idxCol
10039
+ }, _this3.props.isWeek || idxCol < 5 ? /*#__PURE__*/React__default.createElement("td", {
10028
10040
  key: idxCol
10029
10041
  }, col ? /*#__PURE__*/React__default.createElement("span", {
10030
- className: _this2.checkActiveClassName(idxRow, idxCol),
10042
+ className: _this3.checkActiveClassName(idxRow, idxCol),
10031
10043
  onClick: function onClick() {
10032
- return _this2.handleActiveClick(idxRow, idxCol);
10044
+ return _this3.handleActiveClick(idxRow, idxCol);
10033
10045
  }
10034
- }, moment(_this2.state.year + "-" + _this2.state.month + "-" + col, 'YYYY-M-D').format('DD')) : null) : null);
10046
+ }, moment(_this3.state.year + "-" + _this3.state.month + "-" + col, 'YYYY-M-D').format('DD')) : null) : null);
10035
10047
  }));
10036
10048
  })))))), this.props.isTime && this.state.activeDate ? /*#__PURE__*/React__default.createElement(reactFlexboxGrid.Col, {
10037
10049
  xs: 12,
@@ -10041,9 +10053,9 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
10041
10053
  }, this.state.times.map(function (time, idx) {
10042
10054
  return /*#__PURE__*/React__default.createElement("div", {
10043
10055
  key: idx,
10044
- className: classNames$1(style$x.calendar_time_button, time === _this2.state.activeTime ? style$x.active : '', _this2.props.disabledTime.includes(time) ? style$x.disabled : ''),
10056
+ className: classNames$1(style$x.calendar_time_button, time === _this3.state.activeTime ? style$x.active : '', _this3.props.disabledTime.includes(time) ? style$x.disabled : ''),
10045
10057
  onClick: function onClick() {
10046
- return _this2.handleTimeClick(time);
10058
+ return _this3.handleTimeClick(time);
10047
10059
  }
10048
10060
  }, /*#__PURE__*/React__default.createElement("span", null, time));
10049
10061
  }))) : null), /*#__PURE__*/React__default.createElement("div", {
@@ -10051,14 +10063,14 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
10051
10063
  }, /*#__PURE__*/React__default.createElement("div", {
10052
10064
  className: classNames$1(style$x.calendar_button, style$x.button_red),
10053
10065
  onClick: function onClick() {
10054
- return _this2.props.onClose();
10066
+ return _this3.props.onClose();
10055
10067
  }
10056
10068
  }, /*#__PURE__*/React__default.createElement("span", null, "Retour"), /*#__PURE__*/React__default.createElement(reactFontawesome.FontAwesomeIcon, {
10057
10069
  icon: freeSolidSvgIcons.faTimes
10058
10070
  })), /*#__PURE__*/React__default.createElement("div", {
10059
10071
  className: style$x.calendar_button,
10060
10072
  onClick: function onClick() {
10061
- return _this2.props.onValid(_this2.state.activeDate, _this2.state.activeTime);
10073
+ return _this3.props.onValid(_this3.state.activeDate, _this3.state.activeTime);
10062
10074
  }
10063
10075
  }, /*#__PURE__*/React__default.createElement("span", null, "Valider"), /*#__PURE__*/React__default.createElement(reactFontawesome.FontAwesomeIcon, {
10064
10076
  icon: freeSolidSvgIcons.faCheck