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