@paygreen/pgui 2.7.0 → 2.8.1
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/cjs/index.js +196 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/InputDayPicker/index.d.ts +5 -2
- package/dist/cjs/types/components/InputRangePicker/index.d.ts +17 -0
- package/dist/cjs/types/components/NewDayPicker/index.d.ts +4 -2
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/esm/index.js +197 -27
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/InputDayPicker/index.d.ts +5 -2
- package/dist/esm/types/components/InputRangePicker/index.d.ts +17 -0
- package/dist/esm/types/components/NewDayPicker/index.d.ts +4 -2
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/index.d.ts +23 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -42852,7 +42852,7 @@ var containsAnyLetters = function (str) {
|
|
|
42852
42852
|
return /[a-zA-Z]/.test(str);
|
|
42853
42853
|
};
|
|
42854
42854
|
var NewDayPicker = function (_a) {
|
|
42855
|
-
var defaultValue = _a.defaultValue, onChange = _a.onChange, _b = _a.locale, locale = _b === void 0 ? 'fr' : _b, customFormat = _a.customFormat, _c = _a.withTime, withTime = _c === void 0 ? false : _c, props = __rest$2(_a, ["defaultValue", "onChange", "locale", "customFormat", "withTime"]);
|
|
42855
|
+
var defaultValue = _a.defaultValue, onChange = _a.onChange, _b = _a.locale, locale = _b === void 0 ? 'fr' : _b, customFormat = _a.customFormat, _c = _a.withTime, withTime = _c === void 0 ? false : _c, minDate = _a.minDate, maxDate = _a.maxDate, calendarFunc = _a.calendarFunc, props = __rest$2(_a, ["defaultValue", "onChange", "locale", "customFormat", "withTime", "minDate", "maxDate", "calendarFunc"]);
|
|
42856
42856
|
var initialFormat = function () {
|
|
42857
42857
|
if (locale === 'fr' && withTime)
|
|
42858
42858
|
return "DD/MM/YYYY HH:mm";
|
|
@@ -42866,16 +42866,31 @@ var NewDayPicker = function (_a) {
|
|
|
42866
42866
|
var _d = React.useState(defaultValue), value = _d[0], setValue = _d[1];
|
|
42867
42867
|
var _e = React.useState('00:00'), timeValue = _e[0], setTimeValue = _e[1];
|
|
42868
42868
|
var _f = React.useState(false), isInvalid = _f[0], setIsInvalid = _f[1];
|
|
42869
|
-
var _g = React.useState(dayjs()
|
|
42870
|
-
|
|
42871
|
-
|
|
42872
|
-
|
|
42873
|
-
|
|
42874
|
-
|
|
42869
|
+
var _g = React.useState(dayjs(defaultValue).format(withTime ? 'DD/MM/YYYY HH:mm' : 'DD/MM/YYYY') ||
|
|
42870
|
+
dayjs()
|
|
42871
|
+
.set('hours', 0)
|
|
42872
|
+
.set('minutes', 0)
|
|
42873
|
+
.set('seconds', 0)
|
|
42874
|
+
.locale(locale)
|
|
42875
|
+
.format(format)), inputValue = _g[0], setInputValue = _g[1];
|
|
42875
42876
|
var theme = react.useTheme();
|
|
42876
42877
|
React.useEffect(function () {
|
|
42877
42878
|
if (value) {
|
|
42878
|
-
|
|
42879
|
+
if (minDate || maxDate) {
|
|
42880
|
+
if (minDate && dayjs(value).diff(dayjs(minDate)) < 0) {
|
|
42881
|
+
setInputValue(dayjs(minDate).format(format));
|
|
42882
|
+
setValue(minDate);
|
|
42883
|
+
onChange(dayjs(minDate).toISOString());
|
|
42884
|
+
}
|
|
42885
|
+
if (maxDate && dayjs(value).diff(dayjs(maxDate)) > 0) {
|
|
42886
|
+
setInputValue(dayjs(maxDate).format(format));
|
|
42887
|
+
setValue(maxDate);
|
|
42888
|
+
onChange(dayjs(maxDate).toISOString());
|
|
42889
|
+
}
|
|
42890
|
+
}
|
|
42891
|
+
else {
|
|
42892
|
+
setInputValue(dayjs(value).format(format));
|
|
42893
|
+
}
|
|
42879
42894
|
if (withTime) {
|
|
42880
42895
|
setTimeValue(dayjs(value).format('HH:mm'));
|
|
42881
42896
|
}
|
|
@@ -42883,7 +42898,7 @@ var NewDayPicker = function (_a) {
|
|
|
42883
42898
|
else {
|
|
42884
42899
|
setInputValue('');
|
|
42885
42900
|
}
|
|
42886
|
-
}, [value]);
|
|
42901
|
+
}, [defaultValue, value]);
|
|
42887
42902
|
var timer = [
|
|
42888
42903
|
'00:00',
|
|
42889
42904
|
'00:30',
|
|
@@ -42945,15 +42960,16 @@ var NewDayPicker = function (_a) {
|
|
|
42945
42960
|
borderRadius: '9999px'
|
|
42946
42961
|
}
|
|
42947
42962
|
};
|
|
42948
|
-
return (React__default["default"].createElement(react.VStack, __assign$2({ spacing: "2", maxW: "full", p: 2, w: "fit-content", maxWidth: "30rem", borderRadius: "md" }, props),
|
|
42963
|
+
return (React__default["default"].createElement(react.VStack, __assign$2({ spacing: "2", maxW: "full", p: 2, w: "fit-content", maxWidth: "30rem", borderRadius: "md", minH: "22.75rem" }, props),
|
|
42949
42964
|
React__default["default"].createElement(react.Stack, { direction: { base: 'column', sm: 'row' }, spacing: 2, w: "full" },
|
|
42950
|
-
React__default["default"].createElement(
|
|
42951
|
-
|
|
42952
|
-
|
|
42953
|
-
|
|
42954
|
-
|
|
42955
|
-
|
|
42956
|
-
|
|
42965
|
+
React__default["default"].createElement(react.Box, { minH: "19.25rem" },
|
|
42966
|
+
React__default["default"].createElement(Calendar, { locale: locale, minDate: minDate, maxDate: maxDate, tileClassName: calendarFunc, onChange: function (e) {
|
|
42967
|
+
setValue(e);
|
|
42968
|
+
onChange(dayjs(e).toISOString());
|
|
42969
|
+
setTimeValue('00:00');
|
|
42970
|
+
setInputValue(dayjs(e).locale(locale).format(format));
|
|
42971
|
+
setIsInvalid(false);
|
|
42972
|
+
}, value: dayjs(value).toDate() })),
|
|
42957
42973
|
withTime && (React__default["default"].createElement(react.Flex, { backgroundColor: "gray.100", p: "2", borderRadius: "sm", h: { base: '8rem', sm: 'auto' }, w: "full", minW: "8rem", alignItems: "center" },
|
|
42958
42974
|
React__default["default"].createElement(react.Box, { w: "full", h: "full", maxH: "16rem", overflowY: "auto", sx: customScrollBar },
|
|
42959
42975
|
React__default["default"].createElement(react.VStack, { w: "full" }, timer.map(function (t) { return (React__default["default"].createElement(react.Button, { key: t, size: "sm", w: "full", isActive: t === timeValue, onClick: function () {
|
|
@@ -42961,15 +42977,37 @@ var NewDayPicker = function (_a) {
|
|
|
42961
42977
|
.set('hours', parseInt(t.slice(0, 2), 10))
|
|
42962
42978
|
.set('minutes', parseInt(t.slice(-2), 10));
|
|
42963
42979
|
setValue(settedValue.toDate());
|
|
42964
|
-
|
|
42980
|
+
if (minDate && settedValue.diff(dayjs(minDate)) < 0) {
|
|
42981
|
+
onChange(dayjs(minDate).toISOString());
|
|
42982
|
+
}
|
|
42983
|
+
else if (maxDate &&
|
|
42984
|
+
settedValue.diff(dayjs(maxDate)) > 0) {
|
|
42985
|
+
onChange(dayjs(maxDate).toISOString());
|
|
42986
|
+
}
|
|
42987
|
+
else {
|
|
42988
|
+
onChange(settedValue.toISOString());
|
|
42989
|
+
}
|
|
42965
42990
|
setTimeValue(t);
|
|
42966
42991
|
setInputValue(dayjs(settedValue.toDate()).format(format));
|
|
42967
42992
|
setIsInvalid(false);
|
|
42968
42993
|
}, _active: {
|
|
42969
42994
|
backgroundColor: 'white',
|
|
42970
42995
|
color: 'brand.600'
|
|
42971
|
-
}
|
|
42972
|
-
|
|
42996
|
+
}, isDisabled: (minDate === null
|
|
42997
|
+
? undefined
|
|
42998
|
+
: minDate &&
|
|
42999
|
+
dayjs(value)
|
|
43000
|
+
.set('hours', parseInt(t.slice(0, 2), 10))
|
|
43001
|
+
.set('minutes', parseInt(t.slice(-2), 10))
|
|
43002
|
+
.diff(dayjs(minDate)) < 0) ||
|
|
43003
|
+
(maxDate === null
|
|
43004
|
+
? undefined
|
|
43005
|
+
: maxDate &&
|
|
43006
|
+
dayjs(value)
|
|
43007
|
+
.set('hours', parseInt(t.slice(0, 2), 10))
|
|
43008
|
+
.set('minutes', parseInt(t.slice(-2), 10))
|
|
43009
|
+
.diff(dayjs(maxDate)) > 0) }, t)); })))))),
|
|
43010
|
+
React__default["default"].createElement(react.HStack, { flex: "1", w: "full", alignItems: "flex-end" },
|
|
42973
43011
|
React__default["default"].createElement(react.InputGroup, { w: "full", size: "sm" },
|
|
42974
43012
|
React__default["default"].createElement(react.InputLeftElement, { pointerEvents: "none", color: "gray.300", fontSize: "1.2em", children: React__default["default"].createElement(react.Icon, { as: MdCalendarToday }) }),
|
|
42975
43013
|
React__default["default"].createElement(react.Input, { as: InputMask, mask: withTime ? '**/**/**** **:**' : '**/**/****', value: inputValue, onChange: function (e) {
|
|
@@ -42978,9 +43016,17 @@ var NewDayPicker = function (_a) {
|
|
|
42978
43016
|
containsAnyLetters(e.target.value);
|
|
42979
43017
|
if (!isInvalidFormat &&
|
|
42980
43018
|
((_a = dayjs(e.target.value, format)) === null || _a === void 0 ? void 0 : _a.isValid())) {
|
|
43019
|
+
onChange((_c = (_b = dayjs(e.target.value, format)) === null || _b === void 0 ? void 0 : _b.locale(locale)) === null || _c === void 0 ? void 0 : _c.toISOString());
|
|
42981
43020
|
setInputValue(dayjs(e.target.value, format).locale(locale).format(format));
|
|
42982
43021
|
setValue(dayjs(e.target.value, format).locale(locale).toDate());
|
|
42983
|
-
|
|
43022
|
+
if (minDate &&
|
|
43023
|
+
dayjs(e.target.value, format).diff(dayjs(minDate)) < 0) {
|
|
43024
|
+
onChange(dayjs(minDate).toISOString());
|
|
43025
|
+
}
|
|
43026
|
+
else if (maxDate &&
|
|
43027
|
+
dayjs(e.target.value, format).diff(dayjs(maxDate)) > 0) {
|
|
43028
|
+
onChange(dayjs(maxDate).toISOString());
|
|
43029
|
+
}
|
|
42984
43030
|
setIsInvalid(false);
|
|
42985
43031
|
}
|
|
42986
43032
|
else {
|
|
@@ -42997,7 +43043,7 @@ var NewDayPicker = function (_a) {
|
|
|
42997
43043
|
dayjs.extend(customParseFormat);
|
|
42998
43044
|
dayjs.extend(utc);
|
|
42999
43045
|
var InputDayPicker = function (_a) {
|
|
43000
|
-
var name = _a.name, placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, _b = _a.locale, locale = _b === void 0 ? 'fr' : _b, _c = _a.variant, variant = _c === void 0 ? 'filled' : _c, _d = _a.format, format = _d === void 0 ? 'DD/MM/YYYY' : _d, _e = _a.withTime, withTime = _e === void 0 ? false : _e, inputProps = __rest$2(_a, ["name", "placeholder", "value", "onChange", "locale", "variant", "format", "withTime"]);
|
|
43046
|
+
var name = _a.name, placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, _b = _a.locale, locale = _b === void 0 ? 'fr' : _b, _c = _a.variant, variant = _c === void 0 ? 'filled' : _c, _d = _a.format, format = _d === void 0 ? 'DD/MM/YYYY' : _d, _e = _a.withTime, withTime = _e === void 0 ? false : _e, minDate = _a.minDate, maxDate = _a.maxDate, calendarFunc = _a.calendarFunc, inputProps = __rest$2(_a, ["name", "placeholder", "value", "onChange", "locale", "variant", "format", "withTime", "minDate", "maxDate", "calendarFunc"]);
|
|
43001
43047
|
var _f = react.useDisclosure(), isOpen = _f.isOpen, onClose = _f.onClose, onToggle = _f.onToggle;
|
|
43002
43048
|
var _g = React.useState(''), prev = _g[0], setPrev = _g[1];
|
|
43003
43049
|
React.useEffect(function () {
|
|
@@ -43024,7 +43070,9 @@ var InputDayPicker = function (_a) {
|
|
|
43024
43070
|
React__default["default"].createElement(react.Popover, { closeOnBlur: true, closeOnEsc: true, isOpen: isOpen, onClose: onClose, placement: "bottom", autoFocus: true },
|
|
43025
43071
|
React__default["default"].createElement(react.PopoverTrigger, null,
|
|
43026
43072
|
React__default["default"].createElement(react.InputGroup, null,
|
|
43027
|
-
React__default["default"].createElement(react.Input, __assign$2({ as: react.Button, onClick: onToggle, name: name, fontWeight: "normal", justifyContent: "flex-start",
|
|
43073
|
+
React__default["default"].createElement(react.Input, __assign$2({ as: react.Button, onClick: onToggle, name: name, fontWeight: "normal", justifyContent: "flex-start", background: variant === 'filled' ? 'gray.50' : 'white', _hover: {
|
|
43074
|
+
background: variant === 'filled' ? 'gray.100' : 'gray.50'
|
|
43075
|
+
} }, inputProps), value ? dayjs(value).format(format) : placeholder),
|
|
43028
43076
|
value && (React__default["default"].createElement(react.InputRightElement, { onClick: function () {
|
|
43029
43077
|
onChange(null);
|
|
43030
43078
|
}, _hover: {
|
|
@@ -43035,7 +43083,7 @@ var InputDayPicker = function (_a) {
|
|
|
43035
43083
|
} }))))),
|
|
43036
43084
|
React__default["default"].createElement(react.PopoverContent, { mx: 1, width: "fit-content" },
|
|
43037
43085
|
React__default["default"].createElement(react.PopoverArrow, null),
|
|
43038
|
-
isOpen && (React__default["default"].createElement(NewDayPicker, { locale: locale, defaultValue: value, onChange: onChange,
|
|
43086
|
+
isOpen && (React__default["default"].createElement(NewDayPicker, { locale: locale, defaultValue: value, onChange: onChange, withTime: withTime, minDate: minDate, maxDate: maxDate, calendarFunc: calendarFunc }))))));
|
|
43039
43087
|
};
|
|
43040
43088
|
|
|
43041
43089
|
// This file is a workaround for a bug in web browsers' "native"
|
|
@@ -62302,10 +62350,126 @@ var InputPhone = function (_a) {
|
|
|
62302
62350
|
}
|
|
62303
62351
|
}
|
|
62304
62352
|
}, [countryFromLocale, phoneNumber]);
|
|
62305
|
-
return (React__default["default"].createElement(react.InputGroup, { position: "relative", display: "block" },
|
|
62353
|
+
return (React__default["default"].createElement(react.InputGroup, { position: "relative", display: "block", sx: { isolation: 'auto' } },
|
|
62306
62354
|
React__default["default"].createElement(PhoneInput, __assign$2({ international: true, inputComponent: react.Input, numberInputProps: { paddingLeft: '4rem' }, value: phoneNumber, labels: locale === 'fr' ? fr : en, defaultCountry: country || 'FR', disabled: isDisabled, onChange: function (val) { return setPhoneNumber(val || ''); }, addInternationalOption: false, countryCallingCodeEditable: false, countryOptionsOrder: ['FR', 'GB', 'BE', 'ES', 'DE', 'IT', 'CH'], countrySelectComponent: function (selectProps) { return (React__default["default"].createElement(SearchOnList, __assign$2({ locale: locale }, selectProps))); } }, props))));
|
|
62307
62355
|
};
|
|
62308
62356
|
|
|
62357
|
+
var isoWeek$1 = {exports: {}};
|
|
62358
|
+
|
|
62359
|
+
(function (module, exports) {
|
|
62360
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e="day";return function(t,i,s){var a=function(t){return t.add(4-t.isoWeekday(),e)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var i,d,n,o,r=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),o=4-n.isoWeekday(),n.isoWeekday()>4&&(o+=7),n.add(o,e));return r.diff(u,"week")+1},d.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var n=d.startOf;d.startOf=function(e,t){var i=this.$utils(),s=!!i.u(t)||t;return "isoweek"===i.p(e)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(e,t)};}}));
|
|
62361
|
+
} (isoWeek$1));
|
|
62362
|
+
|
|
62363
|
+
var isoWeek = isoWeek$1.exports;
|
|
62364
|
+
|
|
62365
|
+
dayjs.extend(customParseFormat);
|
|
62366
|
+
dayjs.extend(utc);
|
|
62367
|
+
dayjs.extend(isoWeek);
|
|
62368
|
+
var InputRangePicker = function (_a) {
|
|
62369
|
+
var fromLabel = _a.fromLabel, toLabel = _a.toLabel, value = _a.value, onChange = _a.onChange, minDate = _a.minDate, maxDate = _a.maxDate, _b = _a.withTime, withTime = _b === void 0 ? false : _b, _c = _a.format, format = _c === void 0 ? withTime ? 'DD/MM/YYYY HH:mm' : 'DD/MM/YYYY' : _c, _d = _a.variant, variant = _d === void 0 ? 'unstyled' : _d, props = __rest$2(_a, ["fromLabel", "toLabel", "value", "onChange", "minDate", "maxDate", "withTime", "format", "variant"]);
|
|
62370
|
+
var _e = React.useState(), fromValue = _e[0], setFromValue = _e[1];
|
|
62371
|
+
var _f = React.useState(), toValue = _f[0], setToValue = _f[1];
|
|
62372
|
+
var _g = React.useState(minDate), formatedMinDate = _g[0], setFormatedMinDate = _g[1];
|
|
62373
|
+
var _h = React.useState(maxDate), formatedMaxDate = _h[0], setFormatedMaxDate = _h[1];
|
|
62374
|
+
React.useEffect(function () {
|
|
62375
|
+
if (!withTime) {
|
|
62376
|
+
var formatedMin = minDate
|
|
62377
|
+
? dayjs(dayjs(minDate).startOf('day').toISOString()).toDate()
|
|
62378
|
+
: null;
|
|
62379
|
+
var formatedMax = maxDate
|
|
62380
|
+
? dayjs(dayjs(maxDate).endOf('day').toISOString()).toDate()
|
|
62381
|
+
: null;
|
|
62382
|
+
setFormatedMinDate(formatedMin);
|
|
62383
|
+
setFormatedMaxDate(formatedMax);
|
|
62384
|
+
}
|
|
62385
|
+
}, [withTime]);
|
|
62386
|
+
React.useEffect(function () {
|
|
62387
|
+
onChange({
|
|
62388
|
+
from: fromValue ? dayjs(fromValue).toDate() : null,
|
|
62389
|
+
to: toValue ? dayjs(toValue).toDate() : null
|
|
62390
|
+
});
|
|
62391
|
+
}, [fromValue, toValue]);
|
|
62392
|
+
React.useEffect(function () {
|
|
62393
|
+
if (!withTime) {
|
|
62394
|
+
if (value === null || value === void 0 ? void 0 : value.from) {
|
|
62395
|
+
if (dayjs(value.from).diff(dayjs(formatedMinDate).utcOffset(0, true)) < 0) {
|
|
62396
|
+
setFromValue(dayjs(formatedMinDate).utcOffset(0, true).toISOString());
|
|
62397
|
+
}
|
|
62398
|
+
}
|
|
62399
|
+
if (value === null || value === void 0 ? void 0 : value.to) {
|
|
62400
|
+
if (dayjs(value.to).diff(dayjs(formatedMaxDate).utcOffset(0, true)) > 0) {
|
|
62401
|
+
setToValue(dayjs(formatedMaxDate).utcOffset(0, true).toISOString());
|
|
62402
|
+
}
|
|
62403
|
+
}
|
|
62404
|
+
}
|
|
62405
|
+
}, [withTime, fromValue, toValue]);
|
|
62406
|
+
var fromFunc = function (_a) {
|
|
62407
|
+
var date = _a.date;
|
|
62408
|
+
if (toValue) {
|
|
62409
|
+
if (dayjs(date)
|
|
62410
|
+
.startOf('day')
|
|
62411
|
+
.utcOffset(0, true)
|
|
62412
|
+
.diff(dayjs(toValue).endOf('day').utcOffset(0, true)) > 0) {
|
|
62413
|
+
return 'after-max-date';
|
|
62414
|
+
}
|
|
62415
|
+
}
|
|
62416
|
+
else {
|
|
62417
|
+
if (formatedMaxDate &&
|
|
62418
|
+
dayjs(date)
|
|
62419
|
+
.startOf('date')
|
|
62420
|
+
.utcOffset(0, true)
|
|
62421
|
+
.diff(dayjs(formatedMaxDate).startOf('date').utcOffset(0, true)) > 0) {
|
|
62422
|
+
return 'after-max-date';
|
|
62423
|
+
}
|
|
62424
|
+
}
|
|
62425
|
+
if (formatedMinDate &&
|
|
62426
|
+
dayjs(date)
|
|
62427
|
+
.startOf('day')
|
|
62428
|
+
.utcOffset(0, true)
|
|
62429
|
+
.diff(dayjs(formatedMinDate).startOf('day').utcOffset(0, true)) < 0) {
|
|
62430
|
+
return 'before-min-date';
|
|
62431
|
+
}
|
|
62432
|
+
};
|
|
62433
|
+
var toFunc = function (_a) {
|
|
62434
|
+
var date = _a.date;
|
|
62435
|
+
if (fromValue) {
|
|
62436
|
+
if (dayjs(date)
|
|
62437
|
+
.startOf('day')
|
|
62438
|
+
.utcOffset(0, true)
|
|
62439
|
+
.diff(dayjs(fromValue).startOf('day').utcOffset(0, true)) < 0) {
|
|
62440
|
+
return 'before-min-date';
|
|
62441
|
+
}
|
|
62442
|
+
}
|
|
62443
|
+
else {
|
|
62444
|
+
if (formatedMinDate &&
|
|
62445
|
+
dayjs(date)
|
|
62446
|
+
.startOf('day')
|
|
62447
|
+
.utcOffset(0, true)
|
|
62448
|
+
.diff(dayjs(formatedMinDate).startOf('date').utcOffset(0, true)) < 0) {
|
|
62449
|
+
return 'before-min-date';
|
|
62450
|
+
}
|
|
62451
|
+
}
|
|
62452
|
+
if (formatedMaxDate &&
|
|
62453
|
+
dayjs(date)
|
|
62454
|
+
.startOf('day')
|
|
62455
|
+
.utcOffset(0, true)
|
|
62456
|
+
.diff(dayjs(formatedMaxDate).startOf('day').utcOffset(0, true)) > 0) {
|
|
62457
|
+
return 'after-max-date';
|
|
62458
|
+
}
|
|
62459
|
+
};
|
|
62460
|
+
return (React__default["default"].createElement(react.Wrap, __assign$2({ flexWrap: "wrap", w: "full", maxW: "full" }, props),
|
|
62461
|
+
React__default["default"].createElement(react.WrapItem, { flex: "1", alignItems: "center", minW: "fit-content" },
|
|
62462
|
+
React__default["default"].createElement(react.Text, { mr: 2, wordBreak: "normal" }, fromLabel),
|
|
62463
|
+
React__default["default"].createElement(InputDayPicker, { name: "from", onChange: function (e) {
|
|
62464
|
+
setFromValue(e);
|
|
62465
|
+
}, value: fromValue, format: format, minDate: formatedMinDate, maxDate: (value === null || value === void 0 ? void 0 : value.to) || maxDate, calendarFunc: fromFunc, withTime: withTime, variant: variant, minW: "11.5rem", w: "full" })),
|
|
62466
|
+
React__default["default"].createElement(react.WrapItem, { flex: "1", alignItems: "center", minW: "fit-content" },
|
|
62467
|
+
React__default["default"].createElement(react.Text, { mr: 2, wordBreak: "normal" }, toLabel),
|
|
62468
|
+
React__default["default"].createElement(InputDayPicker, { name: "to", onChange: function (e) {
|
|
62469
|
+
setToValue(e);
|
|
62470
|
+
}, value: toValue, format: format, minDate: (value === null || value === void 0 ? void 0 : value.from) || formatedMinDate, maxDate: formatedMaxDate, calendarFunc: toFunc, withTime: withTime, variant: variant, minW: "11.5rem", w: "full" }))));
|
|
62471
|
+
};
|
|
62472
|
+
|
|
62309
62473
|
var ModalResponsive = function (_a) {
|
|
62310
62474
|
var _b;
|
|
62311
62475
|
var isOpen = _a.isOpen, onClose = _a.onClose, finalFocusRef = _a.finalFocusRef, children = _a.children, rest = __rest$2(_a, ["isOpen", "onClose", "finalFocusRef", "children"]);
|
|
@@ -68064,6 +68228,12 @@ var reactCalendar = function (props) {
|
|
|
68064
68228
|
color: props.theme.colors.gray[400]
|
|
68065
68229
|
}
|
|
68066
68230
|
}
|
|
68231
|
+
},
|
|
68232
|
+
'.before-min-date': {
|
|
68233
|
+
color: props.theme.colors.gray[400]
|
|
68234
|
+
},
|
|
68235
|
+
'.after-max-date': {
|
|
68236
|
+
color: props.theme.colors.gray[400]
|
|
68067
68237
|
}
|
|
68068
68238
|
};
|
|
68069
68239
|
};
|
|
@@ -68152,6 +68322,7 @@ exports.DayPicker = DayPicker;
|
|
|
68152
68322
|
exports.FormGroup = FormGroup;
|
|
68153
68323
|
exports.InputDayPicker = InputDayPicker;
|
|
68154
68324
|
exports.InputPhone = InputPhone;
|
|
68325
|
+
exports.InputRangePicker = InputRangePicker;
|
|
68155
68326
|
exports.LayoutContainer = LayoutContainer;
|
|
68156
68327
|
exports.MenuItem = MenuItem;
|
|
68157
68328
|
exports.ModalResponsive = ModalResponsive;
|