@mw-kit/mw-ui 1.7.48 → 1.7.49
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 +51 -12
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +51 -12
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -13415,9 +13415,11 @@ var Main = React__default.forwardRef(function (props, ref) {
|
|
|
13415
13415
|
});
|
|
13416
13416
|
};
|
|
13417
13417
|
|
|
13418
|
+
var isControlled = props.calendar !== undefined;
|
|
13418
13419
|
useEffect(function () {
|
|
13420
|
+
if (isControlled) return;
|
|
13419
13421
|
setCalendar(getInitialCalendar(initialMonth, min, max));
|
|
13420
|
-
}, [initialMonth === null || initialMonth === void 0 ? void 0 : initialMonth.toISOString(), min === null || min === void 0 ? void 0 : min.toISOString(), max === null || max === void 0 ? void 0 : max.toISOString()]);
|
|
13422
|
+
}, [isControlled, initialMonth === null || initialMonth === void 0 ? void 0 : initialMonth.toISOString(), min === null || min === void 0 ? void 0 : min.toISOString(), max === null || max === void 0 ? void 0 : max.toISOString()]);
|
|
13421
13423
|
useEffect(function () {
|
|
13422
13424
|
var _ref2 = [calendar.weeks[0], calendar.weeks[calendar.weeks.length - 1]],
|
|
13423
13425
|
first = _ref2[0],
|
|
@@ -13552,7 +13554,19 @@ var Main = React__default.forwardRef(function (props, ref) {
|
|
|
13552
13554
|
type: details.indicator
|
|
13553
13555
|
}));
|
|
13554
13556
|
}));
|
|
13555
|
-
})),
|
|
13557
|
+
})), function () {
|
|
13558
|
+
if (!props.children) {
|
|
13559
|
+
return null;
|
|
13560
|
+
}
|
|
13561
|
+
|
|
13562
|
+
if (Array.isArray(props.children) && !props.children.some(function (e) {
|
|
13563
|
+
return e;
|
|
13564
|
+
})) {
|
|
13565
|
+
return null;
|
|
13566
|
+
}
|
|
13567
|
+
|
|
13568
|
+
return React__default.createElement(Footer, null, props.children);
|
|
13569
|
+
}(), loading && React__default.createElement(Loader, {
|
|
13556
13570
|
filled: theme$2.getColor('white', 95)
|
|
13557
13571
|
}));
|
|
13558
13572
|
});
|
|
@@ -13853,7 +13867,10 @@ var Main$1 = React__default.forwardRef(function (props, ref) {
|
|
|
13853
13867
|
time = _useState[0],
|
|
13854
13868
|
setTime = _useState[1];
|
|
13855
13869
|
|
|
13856
|
-
var _useState2 = useState(
|
|
13870
|
+
var _useState2 = useState(function () {
|
|
13871
|
+
var calendar1 = getInitialCalendar(value[0] || initialMonth, min, max);
|
|
13872
|
+
return calendar1;
|
|
13873
|
+
}),
|
|
13857
13874
|
calendar1 = _useState2[0],
|
|
13858
13875
|
_setCalendar1 = _useState2[1];
|
|
13859
13876
|
|
|
@@ -13864,7 +13881,10 @@ var Main$1 = React__default.forwardRef(function (props, ref) {
|
|
|
13864
13881
|
});
|
|
13865
13882
|
};
|
|
13866
13883
|
|
|
13867
|
-
var _useState3 = useState(
|
|
13884
|
+
var _useState3 = useState(function () {
|
|
13885
|
+
var calendar2 = getCalendar2(calendar1);
|
|
13886
|
+
return calendar2;
|
|
13887
|
+
}),
|
|
13868
13888
|
calendar2 = _useState3[0],
|
|
13869
13889
|
_setCalendar2 = _useState3[1];
|
|
13870
13890
|
|
|
@@ -13879,6 +13899,12 @@ var Main$1 = React__default.forwardRef(function (props, ref) {
|
|
|
13879
13899
|
hoverDay = _useState4[0],
|
|
13880
13900
|
setHoverDay = _useState4[1];
|
|
13881
13901
|
|
|
13902
|
+
useEffect(function () {
|
|
13903
|
+
var calendar1 = getInitialCalendar(value[0] || initialMonth, min, max);
|
|
13904
|
+
var calendar2 = getCalendar2(calendar1);
|
|
13905
|
+
setCalendar1(calendar1);
|
|
13906
|
+
setCalendar2(calendar2);
|
|
13907
|
+
}, [initialMonth === null || initialMonth === void 0 ? void 0 : initialMonth.toISOString(), min === null || min === void 0 ? void 0 : min.toISOString(), max === null || max === void 0 ? void 0 : max.toISOString()]);
|
|
13882
13908
|
useEffect(function () {
|
|
13883
13909
|
var timeProps = getTimeProps(props.time, value);
|
|
13884
13910
|
setHoverDay(null);
|
|
@@ -13997,11 +14023,16 @@ var Main$1 = React__default.forwardRef(function (props, ref) {
|
|
|
13997
14023
|
}
|
|
13998
14024
|
});
|
|
13999
14025
|
}();
|
|
14000
|
-
var middle = new Date();
|
|
14001
|
-
middle.
|
|
14002
|
-
middle.
|
|
14003
|
-
middle.
|
|
14004
|
-
middle.
|
|
14026
|
+
var middle = [new Date(), new Date()];
|
|
14027
|
+
middle[0].setDate(1);
|
|
14028
|
+
middle[0].setFullYear(calendar2.year);
|
|
14029
|
+
middle[0].setMonth(calendar2.month);
|
|
14030
|
+
middle[0].setDate(0);
|
|
14031
|
+
middle[0].setHours(23, 59, 59, 999);
|
|
14032
|
+
middle[1].setDate(1);
|
|
14033
|
+
middle[1].setFullYear(calendar1.year);
|
|
14034
|
+
middle[1].setMonth(calendar1.month + 1);
|
|
14035
|
+
middle[1].setHours(0, 0, 0, 0);
|
|
14005
14036
|
var inputs = getTimeProps(props.time, value).map(function (timeProps, index) {
|
|
14006
14037
|
if (!timeProps) return undefined;
|
|
14007
14038
|
var width = timeProps.seconds ? 'withSeconds' : 'withoutSeconds';
|
|
@@ -14042,12 +14073,20 @@ var Main$1 = React__default.forwardRef(function (props, ref) {
|
|
|
14042
14073
|
calendar: [calendar1, function (v) {
|
|
14043
14074
|
setCalendar1(function (prev) {
|
|
14044
14075
|
var c1 = typeof v === 'function' ? v(prev) : v;
|
|
14045
|
-
setCalendar2(
|
|
14076
|
+
setCalendar2(function (prev) {
|
|
14077
|
+
if (prev.year > c1.year) return prev;
|
|
14078
|
+
|
|
14079
|
+
if (prev.year === c1.year && prev.month > c1.month) {
|
|
14080
|
+
return prev;
|
|
14081
|
+
}
|
|
14082
|
+
|
|
14083
|
+
return getCalendar2(c1);
|
|
14084
|
+
});
|
|
14046
14085
|
return c1;
|
|
14047
14086
|
});
|
|
14048
14087
|
}],
|
|
14049
14088
|
min: min,
|
|
14050
|
-
max: max
|
|
14089
|
+
max: max && dateCompare(max, middle[0], 'lt') ? max : middle[0]
|
|
14051
14090
|
}), inputs[0]), React__default.createElement(BasicCalendar, Object.assign({}, calendarProps, {
|
|
14052
14091
|
getDay: function getDay(c) {
|
|
14053
14092
|
return _getDay2(c, 'right');
|
|
@@ -14062,7 +14101,7 @@ var Main$1 = React__default.forwardRef(function (props, ref) {
|
|
|
14062
14101
|
ref: ref,
|
|
14063
14102
|
label: React__default.createElement(LabelContainer$1, null, React__default.createElement("b", null, "Fim:"), " ", value[1] ? dateToIsoString(value[1]) : '––/––/––––'),
|
|
14064
14103
|
calendar: [calendar2, setCalendar2],
|
|
14065
|
-
min: min && dateCompare(min, middle, 'gt') ? min : middle,
|
|
14104
|
+
min: min && dateCompare(min, middle[1], 'gt') ? min : middle[1],
|
|
14066
14105
|
max: max
|
|
14067
14106
|
}), inputs[1], submitProps && React__default.createElement(SubmitButton, Object.assign({
|
|
14068
14107
|
content: 'Aplicar'
|